casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Member Functions | Private Attributes | Friends
casa::LatticeAsContour< T > Class Template Reference

Class to manage the drawing of contour maps of slices from AIPS++ Lattices. More...

#include <LatticeAsContour.h>

Inheritance diagram for casa::LatticeAsContour< T >:
casa::LatticePADisplayData< T > casa::PrincipalAxesDD casa::DisplayData casa::DisplayOptions casa::DisplayEH casa::DlTarget

List of all members.

Public Member Functions

 LatticeAsContour (Array< T > *array, const uInt xAxis, const uInt yAxis, const uInt mAxis, const IPosition fixedPos)
 Array-based constructors: >2d and 2d.
 LatticeAsContour (Array< T > *array, const uInt xAxis, const uInt yAxis)
 LatticeAsContour (ImageInterface< T > *image, const uInt xAxis, const uInt yAxis, const uInt mAxis, const IPosition fixedPos, viewer::StatusSink *sink=0)
 Image-based constructors: >2d and 2d.
 LatticeAsContour (ImageInterface< T > *image, const uInt xAxis, const uInt yAxis)
virtual ~LatticeAsContour ()
 Destructor.
virtual void setupElements ()
 Create the various elements in the sequence of displayable maps.
virtual void setDefaultOptions ()
 install the default options for display
virtual Bool setOptions (Record &rec, Record &recOut)
 Apply the options stored in the provided Record to the LatticeAsContour object.
virtual Record getOptions ()
 Retrieve the currently set options, and their types, default values, and any help text associated with each parameter.
virtual Display::DisplayDataType classType ()
 Return the DisplayData type; used by the WorldCanvasHolder to determine the order of drawing.
virtual String className ()
 class name
virtual Vector< Floatlevels ()
 Actual selected contour levels.
virtual String levelString (Int prec=0)
 Actual levels, in String format.
virtual String showPosition (const Vector< Double > &wld, const Bool &abs, const Bool &dsp)
 Adds contour level information to the standard position tracking string from PADD.

Protected Member Functions

virtual void constructParameters_ ()
 Construct user option DisplayParameters (for min/max contour.) (To be used by constructors only.)
virtual void setStdContourLimits_ (Record *recOut=0)
 Set standard limits/values for contour sliders.

Private Attributes

Vector< FloatitsLevels
 Relative contour levels.
DParameterRange< Float > * itsBaseContour
 Min and Max actual contours.
DParameterRange< Float > * itsUnitContour
Float itsLine
 
   

Bool itsDashNeg
Bool itsDashPos
String itsColor

Friends

class LatticePADMContour< T >

Detailed Description

template<class T>
class casa::LatticeAsContour< T >

Class to manage the drawing of contour maps of slices from AIPS++ Lattices.

Intended use:

Public interface

 <h3>Review Status</h3><dl><dt>Date Reviewed:<dd>yyyy/mm/dd</dl> 

Prerequisite

Etymology

The purpose of this class is to draw "contour" maps of data that is "lattice"-based.

Synopsis

This class should be used to display contour maps---ie. line drawings connecting data points of equal intensity (or level)---of two-dimensional slices of data extracted from AIPS++ Lattices or Arrays having two or more dimensions. Thus, this is the class to use to display standard zeroth-order moment map contour overlays for use on Digitized Sky Survey images, for example.

At construction, any axes in the data can be mapped to the X and Y axes of the display device (see the PrincipalAxesDD class). For data with more than two dimensions, a third axis in the dataset can be selected for generating a sequence of maps along: this is known as the "movie" axis. Animation (see the Animator class) will cause different slices of the data to be selected from along this axis. After construction, the axis settings of a LatticeAsContour object can be modified at a later stage.

The LatticeAsContour object supports a number of options which can be set or retrieved using the setOptions and getOptions functions. These functions simply accept a Record, which can be converted from a GlishRecord: this is done in the GTkDisplayData class. The options for the LatticeAsContour class are: levels: a Vector<Float> (or Vector<Double>) of one or more elements, being the data values at which the contours are drawn. Depending on type, the values in the vector are interpreted as absolute or fractions between the data minimum and maximum. type: a String, one of "frac" or "abs", indicating whether the contour values in "levels" (multiplied by "scale") are fractions of the data range between the minimum and maximum, or are instead absolute contour levels in the native units of the data. scale: a Float or Double which provides an additional scale factor to apply to the contour levels in "levels." line: a positive Integer specifying the line width of contours. dashneg: a Boolean value, which if True, will force contours at negative data values to be drawn in dashed line style. dashpos: a Boolean value, which if True, will force contours at positive data values to be drawn in dashed line style. color: a String which is the color with which to draw the contours. A valid X Color is required.

Example

A LatticeAsContour object could be constructed and used as follows:

    PagedImage<Float> *pimage = new PagedImage<Float>(String("test.im"));
    DisplayData *dd;
    uInt ndim = pimage->ndim();
    if (ndim < 2) {
      throw(AipsError(String("Image has less than two dimensions")));
    } else if (ndim == 2) {
      dd = (DisplayData *)(new LatticeAsContour<Float>(pimage, 0, 1));
    } else {
      IPosition fixedPos(ndim);
      fixedPos = 0;
      dd = (DisplayData *)(new LatticeAsContour<Float>(pimage, 0, 1, 2,
                                                      fixedPos));
    }
    // wcHolder is an existing WorldCanvasHolder *..\.
    wcHolder->addDisplayData(ddata);
    wcHolder->refresh();

Motivation

Displaying 2-dimensional slices of a lattice-based data volume is a standard display requirement for astronomical data visualization and presentation.

Template Type Argument Requirements (T)

Definition at line 158 of file LatticeAsContour.h.


Constructor & Destructor Documentation

template<class T>
casa::LatticeAsContour< T >::LatticeAsContour ( Array< T > *  array,
const uInt  xAxis,
const uInt  yAxis,
const uInt  mAxis,
const IPosition  fixedPos 
)

Array-based constructors: >2d and 2d.

xAxis and yAxis specify which axis in the array (0-based) should be mapped to X and Y on the display device: ie. 2-d slices of the data to be displayed have these axes. mAxis specifies the "movie" axis, which is the axis along which different slices are taken. fixedPos is an IPosition having the same length as the number of dimensions in the array, and indicate the fixed axis values for axes in the data that are not specified as xAxis, yAxis or mAxis.

template<class T>
casa::LatticeAsContour< T >::LatticeAsContour ( Array< T > *  array,
const uInt  xAxis,
const uInt  yAxis 
)
template<class T>
casa::LatticeAsContour< T >::LatticeAsContour ( ImageInterface< T > *  image,
const uInt  xAxis,
const uInt  yAxis,
const uInt  mAxis,
const IPosition  fixedPos,
viewer::StatusSink sink = 0 
)

Image-based constructors: >2d and 2d.

xAxis and yAxis specify which axis in the image (0-based) should be mapped to X and Y on the display device: ie. 2-d slices of the data to be displayed have these axes. mAxis specifies the "movie" axis, which is the axis along which different slices are taken. fixedPos is an IPosition having the same length as the number of dimensions in the image, and indicate the fixed axis values for axes in the data that are not specified as xAxis, yAxis or mAxis.

template<class T>
casa::LatticeAsContour< T >::LatticeAsContour ( ImageInterface< T > *  image,
const uInt  xAxis,
const uInt  yAxis 
)
template<class T>
virtual casa::LatticeAsContour< T >::~LatticeAsContour ( ) [virtual]

Destructor.


Member Function Documentation

template<class T>
virtual String casa::LatticeAsContour< T >::className ( ) [inline, virtual]

class name

Reimplemented from casa::LatticePADisplayData< T >.

Definition at line 223 of file LatticeAsContour.h.

References String.

template<class T>
virtual Display::DisplayDataType casa::LatticeAsContour< T >::classType ( ) [inline, virtual]

Return the DisplayData type; used by the WorldCanvasHolder to determine the order of drawing.

Implements casa::DisplayData.

Definition at line 220 of file LatticeAsContour.h.

template<class T>
virtual void casa::LatticeAsContour< T >::constructParameters_ ( ) [protected, virtual]

Construct user option DisplayParameters (for min/max contour.) (To be used by constructors only.)

template<class T>
virtual Record casa::LatticeAsContour< T >::getOptions ( ) [virtual]

Retrieve the currently set options, and their types, default values, and any help text associated with each parameter.

This information can be used to generate form-type graphical user interfaces or command-line interfaces to set the options with prompts.

Reimplemented from casa::LatticePADisplayData< T >.

template<class T>
virtual Vector<Float> casa::LatticeAsContour< T >::levels ( ) [virtual]

Actual selected contour levels.

template<class T>
virtual String casa::LatticeAsContour< T >::levelString ( Int  prec = 0) [virtual]

Actual levels, in String format.

If precision is unspecified, one that is low enough not to be cluttered is used.

template<class T>
virtual void casa::LatticeAsContour< T >::setDefaultOptions ( ) [virtual]

install the default options for display

Reimplemented from casa::LatticePADisplayData< T >.

template<class T>
virtual Bool casa::LatticeAsContour< T >::setOptions ( Record rec,
Record recOut 
) [virtual]

Apply the options stored in the provided Record to the LatticeAsContour object.

If the return value is True, then some options have changed, and a refresh is needed to update the display.

Reimplemented from casa::LatticePADisplayData< T >.

template<class T>
virtual void casa::LatticeAsContour< T >::setStdContourLimits_ ( Record recOut = 0) [protected, virtual]

Set standard limits/values for contour sliders.

If recOut is provided, they will be set onto it in a manner suitable for updating gui via setOptions.

template<class T>
virtual void casa::LatticeAsContour< T >::setupElements ( ) [virtual]

Create the various elements in the sequence of displayable maps.

This is called upon construction as well as whenever the display and/or movie axes are changed via a call to PrincipalAxesDD::setAxes. virtual void setupElements(IPosition fixedPos = IPosition(2));

Implements casa::LatticePADisplayData< T >.

template<class T>
virtual String casa::LatticeAsContour< T >::showPosition ( const Vector< Double > &  wld,
const Bool abs,
const Bool dsp 
) [virtual]

Adds contour level information to the standard position tracking string from PADD.

Reimplemented from casa::PrincipalAxesDD.


Friends And Related Function Documentation

template<class T>
friend class LatticePADMContour< T > [friend]

Definition at line 268 of file LatticeAsContour.h.


Member Data Documentation

template<class T>
DParameterRange<Float>* casa::LatticeAsContour< T >::itsBaseContour [private]

Min and Max actual contours.

linearly scaled from itsLevels to fit these.

Definition at line 259 of file LatticeAsContour.h.

template<class T>
String casa::LatticeAsContour< T >::itsColor [private]

Definition at line 266 of file LatticeAsContour.h.

template<class T>
Bool casa::LatticeAsContour< T >::itsDashNeg [private]

Definition at line 264 of file LatticeAsContour.h.

template<class T>
Bool casa::LatticeAsContour< T >::itsDashPos [private]

Definition at line 265 of file LatticeAsContour.h.

template<class T>
Vector<Float> casa::LatticeAsContour< T >::itsLevels [private]

Relative contour levels.

Definition at line 255 of file LatticeAsContour.h.

template<class T>
Float casa::LatticeAsContour< T >::itsLine [private]

   

Definition at line 263 of file LatticeAsContour.h.

template<class T>
DParameterRange<Float>* casa::LatticeAsContour< T >::itsUnitContour [private]

Definition at line 260 of file LatticeAsContour.h.


The documentation for this class was generated from the following file: