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

Compute moments from a Gaussian fitted to a profile. More...

#include <MomentCalculator.h>

Inheritance diagram for casa::MomentFit< T >:
casa::MomentCalcBase< T > casa::LineCollapser< T, T >

List of all members.

Public Member Functions

 MomentFit (MomentsBase< T > &iMom, LogIO &os, const uInt nLatticeOut)
 Constructor.
 ~MomentFit ()
 Destructor (does nothing).
virtual void process (T &out, Bool &outMask, const Vector< T > &in, const Vector< Bool > &inMask, const IPosition &pos)
 This function is not implemented and throws an exception.
virtual void multiProcess (Vector< T > &out, Vector< Bool > &outMask, const Vector< T > &in, const Vector< Bool > &inMask, const IPosition &pos)
 This function returns a vector of numbers from each input vector.

Private Attributes

MomentsBase< T > & iMom_p
LogIO os_p
stdDeviation_p
peakSNR_p
Bool doAuto_p
Bool doFit_p
Gaussian1D< T > gauss_p

Detailed Description

template<class T>
class casa::MomentFit< T >

Compute moments from a Gaussian fitted to a profile.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Synopsis

This concrete class is derived from the abstract base class MomentCalcBase which provides an interface layer to the ImageMoments or MSMoments driver class. ImageMoments or MSMoments creates a MomentFit object and passes it to the LatticeApply function, lineMultiApply. This function iterates through a given lattice, and invokes the multiProcess member function of MomentFit on each vector of pixels that it extracts from the input lattice. The multiProcess function returns a vector of moments which are inserted into the output lattices also supplied to the LatticeApply function.

MomentFit computes moments by fitting a Gaussian to each profile. The moments are then computed from that fit. The fitting can be done either interactively or automatically.

The constructor takes MomentsBase object that is actually an ImageMoments or an MSMoments object; the one that is constructing the MomentFit object of course. There is much control information embodied in the state of the ImageMoments object. This information is extracted by the MomentCalcBase class and passed on to MomentFit for consumption.

See the MomentsBase , ImageMoments , and MSMoments for discussion about the moments that are available for computation.

Example

This example comes from ImageMoments. outPt is a pointer block holding pointers to the output lattices. os_P is a LogIO object.

   // Construct desired moment calculator object.  Use it polymorphically via
   // a pointer to the base class.
   
      MomentCalcBase<T>* pMomentCalculator = 0;
      if (clipMethod || smoothClipMethod) {
         pMomentCalculator = new MomentClip<T>(pSmoothedImage, *this, os_p, outPt.nelements());
      } else if (windowMethod) {
         pMomentCalculator = new MomentWindow<T>(pSmoothedImage, *this, os_p, outPt.nelements());
      } else if (fitMethod) {
         pMomentCalculator = new MomentFit<T>(*this, os_p, outPt.nelements());
      }
   
   // Iterate optimally through the image, compute the moments, fill the output lattices
   
      LatticeApply<T>::lineMultiApply(outPt, *pInImage_p, *pMomentCalculator,   
                                      momentAxis_p, pProgressMeter);
      delete pMomentCalculator;

Motivation


Tip: Note that there are is assignment operator or copy constructor; Do not use the ones the system would generate either;

Definition at line 1018 of file MomentCalculator.h.


Constructor & Destructor Documentation

template<class T >
casa::MomentFit< T >::MomentFit ( MomentsBase< T > &  iMom,
LogIO os,
const uInt  nLatticeOut 
)

Constructor.

We need the ImageMoments or MSMoments object which is calling us, its logger, and the number of output lattices it has created.

template<class T >
casa::MomentFit< T >::~MomentFit ( )

Destructor (does nothing).


Member Function Documentation

template<class T >
virtual void casa::MomentFit< T >::multiProcess ( Vector< T > &  out,
Vector< Bool > &  outMask,
const Vector< T > &  in,
const Vector< Bool > &  inMask,
const IPosition pos 
) [virtual]

This function returns a vector of numbers from each input vector.

the output vector contains the moments known to the ImageMoments or MSMoments object passed into the constructor.

Implements casa::LineCollapser< T, T >.

template<class T >
virtual void casa::MomentFit< T >::process ( T &  out,
Bool outMask,
const Vector< T > &  in,
const Vector< Bool > &  inMask,
const IPosition pos 
) [virtual]

This function is not implemented and throws an exception.

Implements casa::LineCollapser< T, T >.


Member Data Documentation

template<class T >
Bool casa::MomentFit< T >::doAuto_p [private]

Definition at line 1051 of file MomentCalculator.h.

template<class T >
Bool casa::MomentFit< T >::doFit_p [private]

Definition at line 1051 of file MomentCalculator.h.

template<class T >
Gaussian1D<T> casa::MomentFit< T >::gauss_p [private]

Definition at line 1052 of file MomentCalculator.h.

template<class T >
MomentsBase<T>& casa::MomentFit< T >::iMom_p [private]

Definition at line 1048 of file MomentCalculator.h.

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

Definition at line 1049 of file MomentCalculator.h.

template<class T >
T casa::MomentFit< T >::peakSNR_p [private]

Definition at line 1050 of file MomentCalculator.h.

template<class T >
T casa::MomentFit< T >::stdDeviation_p [private]

Definition at line 1050 of file MomentCalculator.h.


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