Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1488 |
|
Package | general | |
Module | images | |
Tool | regionmanager |
image | in | Image | |
Allowed: | Image tool | ||
ddoptions | in | Options from display data | |
Allowed: | Record | ||
zaxispixel | in | The pixel of the z (movie) axis | |
Allowed: | Integer | ||
Default: | Unset | ||
asworld | in | T for a world box, F for a pixel box | |
Allowed: | T or F | ||
Default: | T |
This function is for use with the viewer and is not of general user interest. This function will return a world region describing the plane of the image currently displayed by the viewer. Note that this region describes the full plane of the image, not just the piece you might have given to the viewer (see example).
You must provide
- include 'image.g' - include 'viewer.g' - include 'regionmanager.g' # - im : =image('myimage') - print im.shape() [10 20 4 5] - r1 := drm.quarter() - im.bb(r1) [blc=[4 6 1 1] , trc=[8 15 4 5] , inc=[1 1 1 1] , bbShape=[5 10 4 5] , regionShape=[5 10 4 5] , imageShape=[10 20 4 5] ] # - displaypanel := dv.newdisplaypanel() - displaydata := dv.loaddata(im.name(F), 'raster') - displaydata.setoptions([region=r1]) - displaypanel.register(displaydata) # - options := displaydata.getoptions() - plane := drm.displayedplane(im, options, displaypanel.index()) - if (is_fail(plane)) fail - im.bb(region=plane) [blc=[1 1 1 1] , trc=[10 20 1 1] , inc=[1 1 1 1] , bbShape=[10 20 1 1] , regionShape=[10 20 1 1] , imageShape=[10 20 4 5] ] - - cs := im.coordsys() - dr := drm.intersection(drm.pixeltoworldregion(csys=cs,region=r1), plane) - im.bb(dr) [blc=[4 6 1 1] , trc=[8 15 1 1] , inc=[1 1 1 1] , bbShape=[5 10 1 1] , regionShape=[5 10 1 1] , imageShape=[10 20 4 5] ]
In this example, we use the default Viewer (dv) to create a Viewerdisplaypanel on which we register a Viewerdisplaydata which will display the specified image as a raster. A region specifying a quarter of the image is given. The region describing the plane being displayed can be seen to reflect the full shape of the image. To make a region describing what is actually being displayed, one can simply intersect it with the region given to the viewer, as shown. Note the conversion of the pixel box to a world box before it can be used in the compound region.