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.quarter - Function Up: regionmanager - Tool Previous: regionmanager.pixeltoworldregion - Function


regionmanager.pseudotoworldregion - Function



Package general
Module images
Tool regionmanager


Convert a Viewer pseudoregion to a world region


Synopsis
pseudotoworldregion(image, pseudoregionvalue, ddoptions, intersect)


Arguments

image in Image of interest
    Allowed: Image tool
pseudoregionvalue in Psuedoregion event value
    Allowed: Glish record
ddoptions in Options from display data
    Allowed: Record
intersect in Intersect with move plane ?
    Allowed: T or F
    Default: T


Returns
Region tool or fail



Description

This function is for use with the pseudoregion event emitted by a Displaypanel created by a Viewer. This function converts the pseudo-region (a region of 2-dimensions only) into a true world region by application of the Coordinate System. If the record is empty, the returned region describes the entire image.

This function is not intended for general-user use.

You must provide

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

  • pseudoregionvalue is the $value of the Glish pseudoregion event emitted by a Displaypanel (created by a Viewer).

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

If intersect=T then the pseudoregion is intersected with the plane of the current movie axis and hidden axes. If intersect=F then the pseudoregion is intersected with the current hidden axes pixels only.



Example
include 'image.g'
include 'viewer.g'
include 'regionmanager.g'
#
im : =image('myimage')
displaypanel := dv.newdisplaypanel()
displaydata := dv.loaddata(im.name(F), 'raster')
r1 := drm.quarter()
displaydata.setoptions([region=r1])
displaypanel.register(displaydata)
#
whenever displaypanel->pseudoregion do {
  options := displaydata.getoptions()
  region := drm.pseudotoworldregion(im, $value, options)
  if (is_fail(region)) fail
  im.statistics(region=region)
}

In this example, we use the default viewer (dv) to create a displaypanel on which we register a displaydata which will display the specified image as a raster. A region specifying a quarter of the image is given. When the user interactively generates a region, the event is caught and the pseudo-region event converted to a true world region with the default regionmanbager, drm. The region is then used to evaluate statistics from the image.





next up previous contents index
Next: regionmanager.quarter - Function Up: regionmanager - Tool Previous: regionmanager.pixeltoworldregion - 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