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

Class to manage the drawing of raster images of slices from AIPS++ Lattices. More...

#include <LatticeAsRaster.h>

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

List of all members.

Public Member Functions

 LatticeAsRaster (Array< T > *array, const uInt xAxis, const uInt yAxis, const uInt mAxis, const IPosition fixedPos)
 Array-based constructors: >2d and 2d.
 LatticeAsRaster (Array< T > *array, const uInt xAxis, const uInt yAxis)
 LatticeAsRaster (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.
 LatticeAsRaster (ImageInterface< T > *image, const uInt xAxis, const uInt yAxis)
virtual ~LatticeAsRaster ()
 Destructor.
virtual void setupElements ()
 Create the various elements in the sequence of displayable images.
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 LatticeAsRaster 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 ()
 static Record getGlobalOption();
virtual String className ()
 class name

Static Public Attributes

static const String HISTOGRAM_RANGE
static const String COLOR_MODE

Private Attributes

Vector< FloatitsOptionsDataRange
 const static String GLOBAL_COLORS;
Vector< FloatitsOptionsDataDefault
String itsOptionsColorMode
 Float itsOptionsPower;.
WCPowerScaleHandleritsPowerScaleHandler
 pointers to scale and resampling handlers

Friends

class LatticePADMRaster< T >
 allow the corresponding DisplayMethod to access this' private data.

Detailed Description

template<class T>
class casa::LatticeAsRaster< T >

Class to manage the drawing of raster images 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 "raster" images of data that is "lattice"-based.

Synopsis

This class should be used to display raster images--- ie. filled, pseudo-color pixel images where each screen (or device) pixel is shaded with a color from a look-up table that is assigned to be proportional in some way to the intensity of the data pixel---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 channel maps of position-velocity cubes, or 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 images 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 LatticeAsRaster object can be modified at a later stage.

The LatticeAsRaster 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 LatticeAsRaster class are: range: a Vector<Double> of two elements, being the minimum and maximum data values to map to the minimum and maximum color values. power: a Float which specifies the deviation from linear of the scaling of the data onto the colormap. Increasingly negative values give increasingly severe logarithmic scaling: this scaling effectively allocates more color cells to the lowest data values (usually corresponding to the thermal noise and low surface brightness emission) in the image. Increasing positive power values give increasingly severe exponential scaling, thereby allocating more and more color cells to the highest data values (ie. signal and interference)in the image. resample: a String which is either "nearest" for nearest neighbour pixel resampling, or "bilinear" for bilinear interpolation between adjacent groups of four pixels. complexmode: this is a String, and is only relevant for LatticeAsRaster<Complex> or LatticeAsRaster<DComplex> instantantiations. One of "phase", "real", "imaginary" or "magnitude" is appropriate for this option, and indicates how complex data values should be translated to real pixel values.

LatticeAsRaster is templated, and can be used to draw Complex or Real Images or Arrays. For Complex data, the default complexmode is "magnitude." LatticeAsRaster objects can be registered on any WorldCanvasHolder, but will only draw on WorldCanvases having an attribute value of Display::Index for "colormodel."

Example

A LatticeAsRaster 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 LatticeAsRaster<Float>(pimage, 0, 1));
    } else {
      IPosition fixedPos(ndim);
      fixedPos = 0;
      dd = (DisplayData *)(new LatticeAsRaster<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 152 of file LatticeAsRaster.h.


Constructor & Destructor Documentation

template<class T >
casa::LatticeAsRaster< T >::LatticeAsRaster ( 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::LatticeAsRaster< T >::LatticeAsRaster ( Array< T > *  array,
const uInt  xAxis,
const uInt  yAxis 
)
template<class T >
casa::LatticeAsRaster< T >::LatticeAsRaster ( 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::LatticeAsRaster< T >::LatticeAsRaster ( ImageInterface< T > *  image,
const uInt  xAxis,
const uInt  yAxis 
)
template<class T >
virtual casa::LatticeAsRaster< T >::~LatticeAsRaster ( ) [virtual]

Destructor.


Member Function Documentation

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

class name

Reimplemented from casa::LatticePADisplayData< T >.

Definition at line 218 of file LatticeAsRaster.h.

References String.

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

static Record getGlobalOption();

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

Implements casa::DisplayData.

Definition at line 215 of file LatticeAsRaster.h.

References casa::Display::Raster.

template<class T >
virtual Record casa::LatticeAsRaster< 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 void casa::LatticeAsRaster< T >::setDefaultOptions ( ) [virtual]

Install the default options for display.

Reimplemented from casa::LatticePADisplayData< T >.

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

Apply the options stored in the provided Record to the LatticeAsRaster 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::LatticeAsRaster< T >::setupElements ( ) [virtual]

Create the various elements in the sequence of displayable images.

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(uInt(2)));

Implements casa::LatticePADisplayData< T >.


Friends And Related Function Documentation

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

allow the corresponding DisplayMethod to access this' private data.

Definition at line 240 of file LatticeAsRaster.h.


Member Data Documentation

template<class T >
const String casa::LatticeAsRaster< T >::COLOR_MODE [static]

Definition at line 220 of file LatticeAsRaster.h.

template<class T >
const String casa::LatticeAsRaster< T >::HISTOGRAM_RANGE [static]

Reimplemented from casa::PrincipalAxesDD.

Definition at line 219 of file LatticeAsRaster.h.

template<class T >
String casa::LatticeAsRaster< T >::itsOptionsColorMode [private]

Float itsOptionsPower;.

what colormode the raster should be drawn in, options are "colormap" for normal pseudo-color rasters, and "red", "green" and "blue" for RGB canvases, and "hue", "saturation" and "value" for HSV canvases.

Definition at line 234 of file LatticeAsRaster.h.

template<class T >
Vector<Float> casa::LatticeAsRaster< T >::itsOptionsDataDefault [private]

Definition at line 226 of file LatticeAsRaster.h.

template<class T >
Vector<Float> casa::LatticeAsRaster< T >::itsOptionsDataRange [private]

const static String GLOBAL_COLORS;

Bool setGlobalOption(Record &rec); Storage for the data range parameters

Definition at line 225 of file LatticeAsRaster.h.

template<class T >
WCPowerScaleHandler* casa::LatticeAsRaster< T >::itsPowerScaleHandler [private]

pointers to scale and resampling handlers

Definition at line 237 of file LatticeAsRaster.h.


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