ImageStatistics.h

Classes

ImageStatistics -- Displays various statistics from an image. (full description)

template <class T> class ImageStatistics : public LatticeStatistics<T>

Interface

Public Members
ImageStatistics (const ImageInterface<T>& image, T& os, Bool showProgress=True, Bool forceDisk=False)
ImageStatistics (const ImageInterface<T>& image, Bool showProgress=True, Bool forceDisk=False)
ImageStatistics(const ImageStatistics<T> &other)
virtual ~ImageStatistics ()
ImageStatistics<T> &operator=(const ImageStatistics<T> &other)
Bool setNewImage (const ImageInterface<T>& image)
Private Members
virtual void getLabels(String& higherOrder, String& xAxis, const IPosition& dPos) const
virtual Bool getBeamArea (Double& beamArea) const
virtual void listMinMax (ostringstream& osMin, ostringstream& osMax, Int oWidth, DataType type)
virtual Bool listStats (Bool hasBeam, const IPosition& dPos, const Matrix<AccumType>& ord)

Description

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

Member Description

ImageStatistics (const ImageInterface<T>& image, T& 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.

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.

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

virtual ~ImageStatistics ()

Destructor

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

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

virtual void getLabels(String& higherOrder, String& xAxis, const IPosition& dPos) const

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

Get label for higher order axes

virtual Bool getBeamArea (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)