Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1488
News FAQ
Search Home


next up previous contents index
Next: image.hanning - Function Up: image - Tool Previous: image.getregion - Function


image.getslice - Function



Package general
Module images
Tool image


Get 1-D slice from the image


Synopsis
getslice(x, y, axes, coord, npts, method, plot)


Arguments

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


Returns
Glish Record, or fail


Description

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.



Example
Suppose that we have a 3-dimensional image called im. Then:
- 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





next up previous contents index
Next: image.hanning - Function Up: image - Tool Previous: image.getregion - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-08-01