Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1488 |
|
Package | general | |
Module | images | |
Tool | image |
op | in | The operation | |
Allowed: | String, one of `set', `default', `delete', `rename', `get', `copy' | ||
name | in | Name of mask or masks | |
Allowed: | Vector of strings |
This function (short-hand name mh) is used to manage or handle pixel masks (there is also a custom GUI interface through the maskhandlergui function). An AIPS++ image may contain zero, one or more pixel masks. Any of these masks can be designated the default pixel mask. The default mask is acted upon by AIPS++ applications. For example, if you ask for statistics from an image, pixels which are masked as bad (F) will be excluded from the calculations.
This function has an argument (op) that specifies the behaviour. In all cases, you can shorten the operation string to three characters. It is not the job of this function to modify the values of masks.
For the first case, the first element of name must be the name of the mask to copy, and the second element must be the name of the pixel mask to which it will be copied.
For the second case, the first element of name must be the name of the input image and pixel mask with a colon delimiter (e.g. hcn:mask2). The second element must be the name of the pixel mask to which the input pixel mask will be copied.
Use the summary function to see the available pixel masks. You can do this either via the logger display, or via the returned record, which contains the mask names. In the logger display, any pixel mask which is not the default mask is listed in square brackets. If a default mask is set, it is listed first, and is not enclosed in square brackets.
- im := image('myimage') - local names, name - names := im.maskhandler('get') # Get the mask names - name := im.maskhandler('default') # Get the default mask names - im.maskhandler('set', 'mask1') # Make 'mask1' the default mask - im.maskhandler('set', '') # Unset the default mask - im.maskhandler('delete', 'mask1') # Delete 'mask1' - im.maskhandler('delete', 'mask0 mask1') # Delete 'mask0' and 'mask1' - im.maskhandler('rename', 'mask1 mask0') # Rename 'mask1' to 'mask0' - im.maskhandler('copy', 'g1.app:mask1 mask10') # Copy 'mask1' from image 'g1.app' to 'mask10' in image 'myimage'