Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1488 |
|
Package | general | |
Module | images | |
Tool | image |
x | in | Polyline x vertices in absolute pixel coordinates | |
Allowed: | Vector of float | ||
y | in | Polyline y vertices in absolute pixel coordinates | |
Allowed: | Vector of float | ||
axes | in | Pixel axes of plane holding slice | |
Allowed: | Vector of integers | ||
Default: | First two axes | ||
coord | in | Specify pixel coordinate for other axes | |
Allowed: | Vector of integers | ||
Default: | Unity | ||
npts | in | Number of points in slice | |
Allowed: | Integer | ||
Default: | Auto determination | ||
method | in | The interpolation method | |
Allowed: | String from 'nearest', 'linear', 'cubic' | ||
Default: | 'linear' | ||
plot | in | Make a plot of the slice | |
Allowed: | T or F | ||
Default: | F |
This function returns a 1-D slice (the pixels and opionally the pixel mask) from the image file. The slice is constrained to lie in a plane of two cardinal axes (e.g. XY or YZ). At some point this constraint will be relaxed. A range of interpolation schemes are available.
You specify the slice as a polyline giving the x (x) and y (y coordinates and the axes of the plane holding that slice (axes). As well, you must specify the absolute pixel coordinates of the other axes (coord). This defaults to the first pixel (e.g. first plane).
The return value is a Glish record with fields 'pixels' (interpolated intensity), 'mask' (interpolated mask), 'xpos' (x-location in absolute pixel coordinates), 'ypos' (y-location in absolute pixel coordinates), 'distance' (distance along slice in pixels), 'axes' (the x and y axes of slice).
You can optionally plot the slice via argument plot which defaults to False.
- im := imagemaketestimage(); - rec := im.getslice (x=[1,20], y=[2,30]) # SLice from [1,2] -> [20,30] - print field_names(rec) pixel mask xpos ypos distance axes - - rec := im.getslice (x=[1,20,25,11], y=[2,30,32,40]) # Polyline slice