Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1488
News FAQ
Search Home


next up previous contents index
Next: regionmanager.done - Function Up: regionmanager - Tool Previous: regionmanager.difference - Function


regionmanager.displayedplane - Function



Package general
Module images
Tool regionmanager


Find a region describing the plane displayed by the viewer


Synopsis
displayedplane(image, ddoptions, zaxispixel, asworld)


Arguments

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


Returns
region tool or fail



Description

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

  • image This is the Image tool that the conversion pertains to.

  • ddoptions is a record obtained from the Viewerdisplaydata tool via the getoptions function. It contains information about what is displayed.

  • zaxispixel is the current pixel of the movie or Z axis. This is the axis that the viewer animator steps along. It can be obtained from the index function. If it's unset, then the region will not be intersected with the present movie axis plane. It will always be intersected with the hidden axes planes.



Example
- 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.





next up previous contents index
Next: regionmanager.done - Function Up: regionmanager - Tool Previous: regionmanager.difference - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-08-01