Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1488 |
|
Package | general | |
Module | images | |
Tool | regionmanager |
range | in | World range | |
Allowed: | Numeric or quantum vector | ||
pixelaxis | in | The pixel axis of interest | |
Allowed: | Integer | ||
csys | in | Coordinate System | |
Allowed: | coordinates tool | ||
Default: | Private Coordinate System | ||
absrel | in | Absolute or relative coordinates | |
Allowed: | Vector of strings from 'abs', 'relref' and 'relcen' | ||
Default: | 'abs' or last | ||
comment | in | A comment stored with the region | |
Allowed: | String |
This function creates a region which selects all pixels except for the axis specified. For that axis it selects just the pixels specified by the range. The region created is just a world box.
- im := image('hcn') - cs := im.coordsys(); - drm.setcoordinates(cs); - - im.toworld([1,1,10]) [4.63647352 -0.506376202 1.41352721e+09] - im.toworld([1,1,20]) [4.63647352 -0.506376202 1.41372408e+09] - - r := drm.wrange(range="1.41352721MHz 1.4137240MHz", pixelaxis=3, csys=cs) - im.boundingbox(r) [blc=[1 1 10] , trc=[155 178 20] , inc=[1 1 1] , bbShape=[155 178 11] , regionShape=[155 178 11] , imageShape=[155 178 64] ]
To show that it works, we converted from pixel to world coordinate for pixel 10 and 20 on the third axis. These values, with a unit change to MHz from GHz were then input into the wrange function and the bounding box shows that we recover 10 and 20 pixels.
- im := image('hcn') - cs := im.coordsys(); - drm.setcoordinates(cs); - r := drm.wrange(range="10pix 20pix", pixelaxis=3, csys=cs) - im.boundingbox(r) [blc=[1 1 10] , trc=[155 178 20] , inc=[1 1 1] , bbShape=[155 178 11] , regionShape=[155 178 11] , imageShape=[155 178 64] ] - - r := drm.wrange(range=[10, 20], pixelaxis=3, csys=cs) - im.boundingbox(r) [blc=[1 1 10] , trc=[155 178 20] , inc=[1 1 1] , bbShape=[155 178 11] , regionShape=[155 178 11] , imageShape=[155 178 64] ] -
This shows how you can easily select a few planes of an image using pixel units. If you give a numeric vector for the range (second example) it assumes pixel units.