| Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
| Version 1.9 Build 803 |
|
See the Image tool and § 4.7 for basic information on pixel masks. See note223 for all the details of how image pixel masks are handled in LEL.
Here we just provide some basic knowledge. LEL, like other AIPS++ image handling software, applies the default mask if there is one. You can over-ride this in LEL expressions if you wish.
im := imagecalc('x1:nomask') # Use no mask
im := imagecalc('x1:mask3') # Use mask3 stored in image x1
You can also make what is called a transient conditional mask. Take the sub-expression sum(x1[x1<5]).
Let us say that image x1 has no pixel mask to start with. The square brackets indicate an expression mask. When the result of that condition is True (effectively creating a transient mask) then the rest of the expression is evaluated. Thus, whenever a pixel in x1 is less than 5, the value of that pixel is added to the sum.
Extending this slightly,
im := imagecalc('x2', 'x1[x1 < 5]');
In this case, the output image x2 must be created with a pixel mask. It will be T for all pixels in x1 whose value is less than 5. Otherwise it will be F. The mask given to x2 is a physical mask stored with the image, whereas the expression mask is transient.