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

Displays various statistics from an image. More...

#include <ImageStatistics.h>

Inheritance diagram for casa::ImageStatistics< T >:
casa::LatticeStatistics< T > casa::LatticeStatsBase

List of all members.

Public Member Functions

 ImageStatistics (const ImageInterface< T > &image, LogIO &os, Bool showProgress=True, Bool forceDisk=False)
 Constructor takes the image and a LogIO object for logging.
 ImageStatistics (const ImageInterface< T > &image, Bool showProgress=True, Bool forceDisk=False)
 Constructor takes the image only.
 ImageStatistics (const ImageStatistics< T > &other)
 Copy constructor.
virtual ~ImageStatistics ()
 Destructor.
ImageStatistics< T > & operator= (const ImageStatistics< T > &other)
 Assignment operator.
Bool setNewImage (const ImageInterface< T > &image)
 Set a new ImageInterface object.
void setPrecision (Int precision)
void setBlc (const IPosition &blc)
IPosition getBlc () const
Int getPrecision () const
void showRobust (const Bool show)
 list robust statistics? Should be called before display()
void recordMessages (const Bool rm)
vector< StringgetMessages ()
void clearMessages ()

Private Types

typedef NumericTraits< T >
::PrecisionType 
AccumType
 List the statistics.

Private Member Functions

virtual void getLabels (String &higherOrder, String &xAxis, const IPosition &dPos) const
 Virtual functions.
virtual Bool _getBeamArea (Array< Double > &beamArea) const
 Get beam volume if possible.
virtual void listMinMax (ostringstream &osMin, ostringstream &osMax, Int oWidth, DataType type)
 List min and max with world coordinates.
virtual Bool listStats (Bool hasBeam, const IPosition &dPos, const Matrix< AccumType > &ord)
 List the statistics to the logger.
virtual void displayStats (AccumType nPts, AccumType sum, AccumType median, AccumType medAbsDevMed, AccumType quartile, AccumType sumSq, AccumType mean, AccumType var, AccumType rms, AccumType sigma, AccumType dMin, AccumType dMax)

Private Attributes

LogIO os_p
 Data.
const ImageInterface< T > * pInImage_p
IPosition blc_
Int precision_
Bool _showRobust
Bool _recordMessages
vector< String_messages

Detailed Description

template<class T>
class casa::ImageStatistics< T >

Displays various statistics from an image.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

This is a class designed to display and retrieve statistics from images

Synopsis

This class enable you to display and/or retrieve statistics evaluated over specified regions from an image. The dimension of the region is arbitrary, but the size of each dimension is always the size of the corresponding image axis. The statistics are displayed as a function of location of the axes not used to evaluate the statistics over. The axes which you evaluate the statistics over are called the cursor axes, the others are called the display axes.

This class is derived from the class LatticeStatistics which does all the work. This class only adds some extra capability in terms of logging world (rather than pixel) coordinates and computing the synthesized beam area, if there is one. There are just a few virtual functions for you to over-ride. These are rather specialized, they are not part of a general polymorphic interface, just a way to separate the Lattice and Image functionality out.

See LatticeStatistics for details and examples.

Motivation

The generation of statistical information from an image is a basic and necessary capability.

To Do

Definition at line 99 of file ImageStatistics.h.


Member Typedef Documentation

template<class T>
typedef NumericTraits<T>::PrecisionType casa::ImageStatistics< T >::AccumType [private]

List the statistics.

Reimplemented from casa::LatticeStatistics< T >.

Definition at line 182 of file ImageStatistics.h.


Constructor & Destructor Documentation

template<class T>
casa::ImageStatistics< T >::ImageStatistics ( const ImageInterface< T > &  image,
LogIO os,
Bool  showProgress = True,
Bool  forceDisk = False 
)

Constructor takes the image and a LogIO object for logging.

You can specify whether you want to see progress meters or not. You can force the storage image to be disk based, otherwise the decision for core or disk is taken for you.

template<class T>
casa::ImageStatistics< T >::ImageStatistics ( const ImageInterface< T > &  image,
Bool  showProgress = True,
Bool  forceDisk = False 
)

Constructor takes the image only.

In the absence of a logger you get no messages. This includes error messages and potential listing of the statistics. You can specify whether you want to see progress meters or not. You can force the storage image to be disk based, otherwise the decision for core or disk is taken for you.

template<class T>
casa::ImageStatistics< T >::ImageStatistics ( const ImageStatistics< T > &  other)

Copy constructor.

Copy semantics are followed. Therefore any storage image that has already been created for other is copied to *this

template<class T>
virtual casa::ImageStatistics< T >::~ImageStatistics ( ) [virtual]

Destructor.


Member Function Documentation

template<class T>
virtual Bool casa::ImageStatistics< T >::_getBeamArea ( Array< Double > &  beamArea) const [private, virtual]

Get beam volume if possible.

Return False if the beam area could not be calculated.

Reimplemented from casa::LatticeStatistics< T >.

template<class T>
void casa::ImageStatistics< T >::clearMessages ( ) [inline]

Definition at line 152 of file ImageStatistics.h.

References casa::ImageStatistics< T >::_messages.

template<class T>
virtual void casa::ImageStatistics< T >::displayStats ( AccumType  nPts,
AccumType  sum,
AccumType  median,
AccumType  medAbsDevMed,
AccumType  quartile,
AccumType  sumSq,
AccumType  mean,
AccumType  var,
AccumType  rms,
AccumType  sigma,
AccumType  dMin,
AccumType  dMax 
) [private, virtual]

Reimplemented from casa::LatticeStatistics< T >.

template<class T>
IPosition casa::ImageStatistics< T >::getBlc ( ) const
template<class T>
virtual void casa::ImageStatistics< T >::getLabels ( String higherOrder,
String xAxis,
const IPosition dPos 
) const [private, virtual]

Virtual functions.

See LatticeStatistics for more information about these, or see the implementation.

Get label for higher order axes

Reimplemented from casa::LatticeStatistics< T >.

template<class T>
vector<String> casa::ImageStatistics< T >::getMessages ( ) [inline]

Definition at line 150 of file ImageStatistics.h.

References casa::ImageStatistics< T >::_messages.

template<class T>
Int casa::ImageStatistics< T >::getPrecision ( ) const
template<class T>
virtual void casa::ImageStatistics< T >::listMinMax ( ostringstream &  osMin,
ostringstream &  osMax,
Int  oWidth,
DataType  type 
) [private, virtual]

List min and max with world coordinates.

Reimplemented from casa::LatticeStatistics< T >.

template<class T>
virtual Bool casa::ImageStatistics< T >::listStats ( Bool  hasBeam,
const IPosition dPos,
const Matrix< AccumType > &  ord 
) [private, virtual]

List the statistics to the logger.

The implementation here is adequate for all lattices. See ImageStatistics for an example of where extra information is provided. hasBeam is the return value of getBeamArea. If it is true, that means that the FLUX statistics will be available in the storage lattice. dPos is the location of the start of the cursor in the storage image for this row. stats(j,i) is the statistics matrix. for the jth point and the ith statistic. The return value is False if something goes wrong ! Have a look at the implementation to see what you really have to do.

Reimplemented from casa::LatticeStatistics< T >.

template<class T>
ImageStatistics<T>& casa::ImageStatistics< T >::operator= ( const ImageStatistics< T > &  other)

Assignment operator.

Deletes any storage image associated with the object being assigned to and copies any storage image that has already been created for "other".

template<class T>
void casa::ImageStatistics< T >::recordMessages ( const Bool  rm) [inline]

Definition at line 148 of file ImageStatistics.h.

References casa::ImageStatistics< T >::_recordMessages.

template<class T>
void casa::ImageStatistics< T >::setBlc ( const IPosition blc)
template<class T>
Bool casa::ImageStatistics< T >::setNewImage ( const ImageInterface< T > &  image)

Set a new ImageInterface object.

A return value of False indicates the image had an invalid type or that the internal state of the class is bad.

template<class T>
void casa::ImageStatistics< T >::setPrecision ( Int  precision)
template<class T>
void casa::ImageStatistics< T >::showRobust ( const Bool  show)

list robust statistics? Should be called before display()


Member Data Documentation

template<class T>
vector<String> casa::ImageStatistics< T >::_messages [private]
template<class T>
Bool casa::ImageStatistics< T >::_recordMessages [private]

Definition at line 161 of file ImageStatistics.h.

Referenced by casa::ImageStatistics< T >::recordMessages().

template<class T>
Bool casa::ImageStatistics< T >::_showRobust [private]

Definition at line 161 of file ImageStatistics.h.

template<class T>
IPosition casa::ImageStatistics< T >::blc_ [private]

Definition at line 159 of file ImageStatistics.h.

template<class T>
LogIO casa::ImageStatistics< T >::os_p [private]

Data.

Reimplemented from casa::LatticeStatistics< T >.

Definition at line 157 of file ImageStatistics.h.

template<class T>
const ImageInterface<T>* casa::ImageStatistics< T >::pInImage_p [private]

Definition at line 158 of file ImageStatistics.h.

template<class T>
Int casa::ImageStatistics< T >::precision_ [private]

Definition at line 160 of file ImageStatistics.h.


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