| imfill | stsdas.toolbox.imgtools | imfill |
imfill -- Set fill value in image according to a mask.
imfill image mask expr value
This task takes as input an image and mask of the same size. It evaluates an expression using the mask pixels and sets the corresponding image pixel to the fill value whenever the expression is true. The variable name in the expression which represents the mask may be any alphanumeric string, but the expression may contain only one name. For example, the expressions
x .ge. 100 .and. x .lt. 200 and mask .ge. 100 .and. mask .lt. 200 are both legal and have the same meaning. However, the expression x .ge. 100 .and. y .lt. 200
is illegal and will cause an error. The following logical operators are supported. Logical operators are supported in both their Fortran and SPP form.
.or. || logical or .and. && logical and .eq. == equality .ne. != inequality .lt. < less than .gt. > greater than .le. <= less or equal .ge. >= greater or equal .not. ! not
All the operators and standard functions of ANSI Fortran are also supported. For a list of these operators and functions, see the help file for the imcalc task. Usually the expression to be evaluated will be some combination of logical operators. However, an arithmetic expression is also acceptable and will be interpreted so that zero is false and any non-zero value is true.
1. Set the image to zero when the mask is non-zero. All groups in the image will be changed.
im> imfill w0001.d0h w0001.q0h "x .ne. 0" 0.
2. Set the image to zero when the mask is non-zero. Only change the first group.
im> imfill w0001.d0h[1] w0001.q0h[1] "x .ne. 0" 0.
3. Set the image to zero on the basis of an expression stored in a file.
im> imfill w0001.d0h w0001.q0h @imfill.dat 0.
The file imfill.dat contains the following line:
(x .ge. 100 .and. x .lt. 200) .or. x .eq. 300