Create a (sub)image from a region of the image
PARAMETER SUMMARY
imagename Name of the input image
outfile Name of output file. Empty means create a temporary image and return it.
region Region of interest. See help par.region for specification options. Default ("") is entire image.
mask Mask to use. See help par.mask. Default ("") is none.
dropdeg If True, all degenerate axes in the input image will be excluded in the output image.
overwrite If True, a pre-existing file of the same name as outfile will be overwritten.
verbose Post additional informative messages to the logger.
stretch Stretch the input mask if necessary and possible. Only used if a mask is specified.
See help par.stretch.
OVERVIEW
This task copies all or part of the image to another on-the-fly Image tool.
If {\stfaf outfile} is given, the subimage is written to the specified
disk file. If {\stfaf outfile} is unset, the returned Image \tool\ actually
references the input image file (i.e. that associated with the Image
\tool\ to which you are applying this function). So if you deleted the
input image disk file, it would render this \tool\ useless. When you destroy this
\tool\ (with the done function)
the reference connection is broken.
Sometimes it is useful to drop axes of length one (degenerate axes).
Set {\stfaf dropdeg} equal to True if you want to do this.
The output mask is the combination (logical OR) of the default input
\pixelmask\ (if any) and the OTF mask. Any other input \pixelmasks\
will not be copied. Use function maskhandler if you
need to copy other masks too.
If the mask has fewer dimensions than the image and if the shape
of the dimensions the mask and image have in common are the same,
the mask will automatically have the missing dimensions added so
it conforms to the image.
If stretch is true and if the number of mask dimensions is less than
or equal to the number of image dimensions and some axes in the
mask are degenerate while the corresponding axes in the image are not,
the mask will be stetched in the degenerate dimensions. For example,
if the input image has shape [100, 200, 10] and the input
mask has shape [100, 200, 1] and stretch is true, the mask will be
stretched along the third dimension to shape [100, 200, 10]. However if
the mask is shape [100, 200, 2], stretching is not possible and an
error will result.