Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1488 |
|
Package | general | |
Module | images | |
Tool | regionmanager |
expr | in | Boolean expression | |
Allowed: | String |
This function creates a mask region. This region can be applied on-the-fly to images. The expression must be Boolean.
- im := imagemaketestimage('zz') - r := drm.wmask(expr='zz>0') - im.statistics(region=r)
The mask region effectively creates a (notional) Boolean lattice. In this example, when the pixel values are greater than zero, the lattice is True (good), else False. The statistics, when evaluated, are then only computed when the mask region is True.
- im := imagemaketestimage('zz') - drm.setcoordinates(im.coordsys()) # - r1 := drm.wbox(...) # Make a world box - r2 := drm.wmask(expr='zz>0') # Make a mask region - r3 := drm.intersection (r1,r2) # Intersect them - im.statistics(region=r3) # Find statistics
In this example, the mask is only applied when the pixels fall in the specified box.