casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
casa::ImageDecomposer< T > Class Template Reference

A tool to separate a complex image into individual components. More...

#include <ImageDecomposer.h>

Public Types

enum  componentValues {
  INDETERMINATE,
  MASKED
}
 'Special' flag values for pixels in the component map. More...
 

Public Member Functions

 ImageDecomposer ()=delete
 
 ImageDecomposer (const casacore::ImageInterface< T > &image)
 
 ImageDecomposer (const ImageDecomposer< T > &other)
 
ImageDecomposer< T > & operator= (const ImageDecomposer< T > &other)=delete
 
 ~ImageDecomposer ()
 
void setDeblend (casacore::Bool deblendIt=true)
 Tell the decomposer what image to decompose ("target image"). More...
 
void setDeblendOptions (T thresholdVal=0.1, casacore::uInt nContour=11, casacore::Int minRange=2, casacore::Int nAxis=2)
 Specifies deblending options: More...
 
void setFit (casacore::Bool fitIt=true)
 Tells the program whether or not to perform fitting. More...
 
void setFitOptions (T maximumRMS=0.1, casacore::Int maxRetries=-1, casacore::uInt maxIter=256, T convCriteria=0.0001)
 Specifies fitting options: More...
 
void decomposeImage ()
 The primary method of this class - executes the instructions stated in the options above by deblending and/or fitting to the image to generate the component map and/or component list. More...
 
casacore::uInt numRegions () const
 Returns the number of regions found in the image. More...
 
casacore::uInt numComponents () const
 Returns the number of components found in the image. More...
 
casacore::IPosition shape () const
 Returns the shape of the component map. More...
 
casacore::Int shape (casacore::uInt axis) const
 Returns the length of a specific axis. More...
 
casacore::Bool isDerived () const
 Returns true if the image has been thresholded (split up into regions.) More...
 
casacore::Bool isDecomposed () const
 Returns true if the image has been decomposed (split up into components.) More...
 
casacore::Matrix< T > componentList () const
 Returns the component parameters as a Matrix. More...
 
void componentMap () const
 Currently does nothing; in the future should return the component map in a way that it can be seen by the user in AIPS++, preferably as a colorized image. More...
 
void display () const
 Command-line text output functions. More...
 
void displayContourMap (const casacore::Vector< T > &clevels) const
 
void printComponents () const
 
void boundRegions (casacore::Block< casacore::IPosition > &blc, casacore::Block< casacore::IPosition > &trc)
 Boxes each region in the componentmap: blc is set to the lowest coordinate value in each region; trc is set to one above the highest coordinate value in each region. More...
 

Private Member Functions

void copyOptions (const ImageDecomposer< T > &other)
 
void correctBlcTrc (casacore::IPosition &blc, casacore::IPosition &trc) const
 Makes sure a pair of IPositions is in the correct format for blc/trc, and corrects them if they are not. More...
 
casacore::Bool increment (casacore::IPosition &pos, const casacore::IPosition &shape) const
 Used as an N-dimensional interator. More...
 
void decrement (casacore::IPosition &pos) const
 
casacore::Int getCell (casacore::Int x, casacore::Int y) const
 Returns the component to which the specified cell belongs. More...
 
casacore::Int getCell (casacore::Int x, casacore::Int y, casacore::Int z) const
 
casacore::Int getCell (const casacore::IPosition &coord) const
 
void setCell (casacore::Int x, casacore::Int y, casacore::Int sval)
 Assigns the specified cell to the specified component. More...
 
void setCell (casacore::Int x, casacore::Int y, casacore::Int z, casacore::Int sval)
 
void setCell (const casacore::IPosition &coord, casacore::Int sval)
 
casacore::Vector< T > autoContour (T minCon, T maxCon, T inc) const
 Semi-automatic way to set contour levels: at the given increment counting between mincon and maxcon. More...
 
casacore::Vector< T > autoContour (casacore::Int nContours=11, T minValue=0) const
 Linearly spaces contours between minvalue and just below the maximum value in the target region of the target image, and returns the contour values as a Vector. More...
 
casacore::Vector< T > autoContour (const casacore::Function1D< T > &fn, casacore::Int nContours=11, T minValue=0) const
 Nonlinear spacing option for contouring; spaces contours according to the function given. More...
 
void destroyRegions (const casacore::Vector< casacore::Bool > &killRegion)
 Eliminates any regions whose corresponding values in killRegion are true by setting all pixel values in the componentmap set to that region to zero. More...
 
void renumberRegions ()
 Eliminates regions with no cells by replacing them with higher-numbered regions. More...
 
void synthesize (const ImageDecomposer< T > &subdecomposer, casacore::IPosition blc)
 Overlays a smaller map onto an empty region of a larger map, and adds submap component list to main component list. More...
 
void zero ()
 Set all elements in the component map to zero and clear the component list. More...
 
void clear ()
 Set all nonmasked elements in the component map to zero and clear the component list. More...
 
findAreaGlobalMax (casacore::IPosition blc, casacore::IPosition trc) const
 Finds the greatest value inside the specified rectangular area of the target image. More...
 
void findAreaGlobalMax (T &maxval, casacore::IPosition &maxvalpos, casacore::IPosition blc, casacore::IPosition trc) const
 
casacore::Vector< T > findAreaGlobalMax (casacore::IPosition blc, casacore::IPosition trc, casacore::Int naxis) const
 
void findAreaGlobalMax (casacore::Vector< T > &maxvals, casacore::Block< casacore::IPosition > &maxvalpos, casacore::IPosition blc, casacore::IPosition trc, casacore::Int naxis) const
 
casacore::Vector< T > findAreaLocalMax (casacore::IPosition blc, casacore::IPosition trc, casacore::Int naxis) const
 Finds all local maxima inside the specified rectangular area of the target image. More...
 
void findAreaLocalMax (casacore::Vector< T > &maxvals, casacore::Block< casacore::IPosition > &maxvalpos, casacore::IPosition blc, casacore::IPosition trc, casacore::Int naxis) const
 
casacore::Vector< T > findAllRegionGlobalMax () const
 Finds the maximum value of the target image in each region of the componentmap. More...
 
void findAllRegionGlobalMax (casacore::Vector< T > &maxvals, casacore::Block< casacore::IPosition > &maxvalpos) const
 
casacore::Vector< T > findRegionLocalMax (casacore::Int nregion, casacore::Int naxis) const
 Finds all local maxima of the target image inside the specifed region of the componentmap. More...
 
void findRegionLocalMax (casacore::Vector< T > &maxvals, casacore::Block< casacore::IPosition > &maxvalpos, casacore::Int nregion, casacore::Int naxis) const
 
casacore::Bool isLocalMax (const casacore::IPosition &pos, casacore::Int naxis) const
 
Compares specified pixel to adjacent pixels to determine if it is

greatest in local pixel block. More...

 
casacore::Bool isLocalMax (casacore::Int x, casacore::Int y, casacore::Int naxis) const
 
casacore::Bool isLocalMax (casacore::Int x, casacore::Int y, casacore::Int z, casacore::Int naxis) const
 
void estimateComponentWidths (casacore::Matrix< T > &width, const casacore::Block< casacore::IPosition > &maxvalpos) const
 Finds a rough estimate of the width of each component by scanning to find the full width at quarter maximum. More...
 
casacore::Array< T > calculateMoments (casacore::Int region) const
 Calculates the 0th-2nd order moments of a region. More...
 
casacore::uInt identifyRegions (T thrval, casacore::Int naxis=2)
 Performs a single threshold scan on the image. More...
 
void deblendRegions (const casacore::Vector< T > &contours, casacore::Int minRange=1, casacore::Int naxis=2)
 Performs the contour decomposition on a blended image to generate a component map that can detect components blended above any threshold(s), by performing threshold scans at each contour level and recognizing as individual any components that are distinct above any such level. More...
 
getImageVal (casacore::IPosition coord) const
 Retrieves the target image's value at the given location. More...
 
getImageVal (casacore::Int x, casacore::Int y) const
 
getImageVal (casacore::Int x, casacore::Int y, casacore::Int z) const
 
casacore::Int getContourVal (casacore::IPosition coord, const casacore::Vector< T > &clevels) const
 Retrieves the number of the highest contour with a value less then the target image's value at the given location. More...
 
casacore::Int getContourVal (casacore::Int x, casacore::Int y, casacore::Int z, const casacore::Vector< T > &clevels) const
 
casacore::Int getContourVal (casacore::Int x, casacore::Int y, const casacore::Vector< T > &clevels) const
 
casacore::Int getContourVal (T val, const casacore::Vector< T > &clevels) const
 
casacore::Matrix< T > fitRegion (casacore::Int region)
 Fits multiple gaussians to a single region. More...
 
void fitRegions ()
 Fits gaussians to an image; multiple gaussians per region in the component map. More...
 
void fitComponents ()
 Fits gaussians to an image; one gaussian per region in the pmap. More...
 
casacore::Matrix< T > estimateComponents ()
 Estimate the component parameters based on moments calculated using the component map. More...
 
casacore::Matrix< T > fitGauss (const casacore::Matrix< T > &positions, const casacore::Vector< T > &dataValues, const casacore::Matrix< T > &initestimate) const
 Fits the specified number of 3D gaussians to the data, and returns solution in image (world) coordinates. More...
 

Private Attributes

casacore::ImageInterface< T > * itsImagePtr
 
casacore::Lattice
< casacore::Int > * 
itsMapPtr
 
casacore::IPosition itsShape
 
casacore::uInt itsDim
 
casacore::uInt itsNRegions
 
casacore::uInt itsNComponents
 
casacore::Matrix< T > itsList
 
casacore::Bool itsDeblendIt
 each component.) More...
 
itsThresholdVal
 
casacore::uInt itsNContour
 
casacore::Int itsMinRange
 
casacore::Int itsNAxis
 
casacore::Bool itsFitIt
 
itsMaximumRMS
 
casacore::Int itsMaxRetries
 
casacore::uInt itsMaxIter
 
itsConvCriteria
 

Detailed Description

template<class T>
class casa::ImageDecomposer< T >

A tool to separate a complex image into individual components.

Intended use:

Public interface

Review Status

Test programs:
tImageDecomposer

Prerequisite

Etymology

It takes an image, and separates it into components.

Synopsis

ImageDecomposer is an image decomposition tool that performs several tasks, with the end result being that a strongly blended image is separated into components - both in the sense that it determines the parameters for each component (assuming a Gaussian model) and that it physically assigns each pixel in the image to an individual object. The products of these two operations are called the component list and the component map, respectively. The fitting process (which determines the component list) and the pixel-decomposition process (which determines the component map) are designed to work cooperatively to increase the efficiency and accuracy of both, though each can operate without the other if necessary.

The algorithm between the decomposition is based on the function clfind described in Williams et al 1994, which uses a contouring procedure whereby a closed contour designates a separate component. The program first separates the image into clearly distint 'regions' of blended emission, then contours each region to determine the areas constituting each component and passes this information on to the fitter, which determines the component list.

The software is compatible with 2 and 3 dimensional images, but is not yet structured for higher dimensions.

Example

//(populate the image with data: see dImageDecomposer.cc)
ImageDecomposer<casacore::Double> id(image);
id.setDeblendOptions(0.3, 8);
id.setFitOptions(0.4);
id.decomposeImage();
id.display();
id.printComponents();

Motivation


Note:

To Do

Definition at line 119 of file ImageDecomposer.h.

Member Enumeration Documentation

'Special' flag values for pixels in the component map.

An indeterminate pixel lies directly between two components and cannot be immediately assigned. A masked pixel is not inside the targeted region of the sub-componentmap and is not used in decomposition or fitting.

Enumerator
INDETERMINATE 
MASKED 

Definition at line 127 of file ImageDecomposer.h.

Constructor & Destructor Documentation

template<class T>
casa::ImageDecomposer< T >::ImageDecomposer ( )
delete
template<class T>
casa::ImageDecomposer< T >::ImageDecomposer ( const casacore::ImageInterface< T > &  image)
template<class T>
casa::ImageDecomposer< T >::ImageDecomposer ( const ImageDecomposer< T > &  other)
template<class T>
casa::ImageDecomposer< T >::~ImageDecomposer ( )

Member Function Documentation

template<class T>
casacore::Vector<T> casa::ImageDecomposer< T >::autoContour ( minCon,
maxCon,
inc 
) const
private

Semi-automatic way to set contour levels: at the given increment counting between mincon and maxcon.

template<class T>
casacore::Vector<T> casa::ImageDecomposer< T >::autoContour ( casacore::Int  nContours = 11,
minValue = 0 
) const
private

Linearly spaces contours between minvalue and just below the maximum value in the target region of the target image, and returns the contour values as a Vector.

template<class T>
casacore::Vector<T> casa::ImageDecomposer< T >::autoContour ( const casacore::Function1D< T > &  fn,
casacore::Int  nContours = 11,
minValue = 0 
) const
private

Nonlinear spacing option for contouring; spaces contours according to the function given.

The domain of the function is 0 <-> ncontours-1; the range is automatically calibrated to be minvalue <-> maxvalue. The function should be nondecreasing in the domain such that each contour is greater than the last.

template<class T>
void casa::ImageDecomposer< T >::boundRegions ( casacore::Block< casacore::IPosition > &  blc,
casacore::Block< casacore::IPosition > &  trc 
)

Boxes each region in the componentmap: blc is set to the lowest coordinate value in each region; trc is set to one above the highest coordinate value in each region.

template<class T>
casacore::Array<T> casa::ImageDecomposer< T >::calculateMoments ( casacore::Int  region) const
private

Calculates the 0th-2nd order moments of a region.

template<class T>
void casa::ImageDecomposer< T >::clear ( )
private

Set all nonmasked elements in the component map to zero and clear the component list.

template<class T>
casacore::Matrix<T> casa::ImageDecomposer< T >::componentList ( ) const

Returns the component parameters as a Matrix.

(Ideally, this should be a ComponentList.)

template<class T>
void casa::ImageDecomposer< T >::componentMap ( ) const

Currently does nothing; in the future should return the component map in a way that it can be seen by the user in AIPS++, preferably as a colorized image.

template<class T>
void casa::ImageDecomposer< T >::copyOptions ( const ImageDecomposer< T > &  other)
private
template<class T>
void casa::ImageDecomposer< T >::correctBlcTrc ( casacore::IPosition blc,
casacore::IPosition trc 
) const
private

Makes sure a pair of IPositions is in the correct format for blc/trc, and corrects them if they are not.

template<class T>
void casa::ImageDecomposer< T >::deblendRegions ( const casacore::Vector< T > &  contours,
casacore::Int  minRange = 1,
casacore::Int  naxis = 2 
)
private

Performs the contour decomposition on a blended image to generate a component map that can detect components blended above any threshold(s), by performing threshold scans at each contour level and recognizing as individual any components that are distinct above any such level.

template<class T>
void casa::ImageDecomposer< T >::decomposeImage ( )

The primary method of this class - executes the instructions stated in the options above by deblending and/or fitting to the image to generate the component map and/or component list.

template<class T>
void casa::ImageDecomposer< T >::decrement ( casacore::IPosition pos) const
private
template<class T>
void casa::ImageDecomposer< T >::destroyRegions ( const casacore::Vector< casacore::Bool > &  killRegion)
private

Eliminates any regions whose corresponding values in killRegion are true by setting all pixel values in the componentmap set to that region to zero.

Zero-oriented; there is an offset of one between the index in killRegion and the actual region in the componentmap.

template<class T>
void casa::ImageDecomposer< T >::display ( ) const

Command-line text output functions.

template<class T>
void casa::ImageDecomposer< T >::displayContourMap ( const casacore::Vector< T > &  clevels) const
template<class T>
casacore::Matrix<T> casa::ImageDecomposer< T >::estimateComponents ( )
private

Estimate the component parameters based on moments calculated using the component map.

template<class T>
void casa::ImageDecomposer< T >::estimateComponentWidths ( casacore::Matrix< T > &  width,
const casacore::Block< casacore::IPosition > &  maxvalpos 
) const
private

Finds a rough estimate of the width of each component by scanning to find the full width at quarter maximum.

Requires the location of each component. This function is mostly obsolete, and is only used when the contour deblender is off (since the component map is necessary to determine the moments).

template<class T>
casacore::Vector<T> casa::ImageDecomposer< T >::findAllRegionGlobalMax ( ) const
private

Finds the maximum value of the target image in each region of the componentmap.

template<class T>
void casa::ImageDecomposer< T >::findAllRegionGlobalMax ( casacore::Vector< T > &  maxvals,
casacore::Block< casacore::IPosition > &  maxvalpos 
) const
private
template<class T>
T casa::ImageDecomposer< T >::findAreaGlobalMax ( casacore::IPosition  blc,
casacore::IPosition  trc 
) const
private

Finds the greatest value inside the specified rectangular area of the target image.

template<class T>
void casa::ImageDecomposer< T >::findAreaGlobalMax ( T &  maxval,
casacore::IPosition maxvalpos,
casacore::IPosition  blc,
casacore::IPosition  trc 
) const
private
template<class T>
casacore::Vector<T> casa::ImageDecomposer< T >::findAreaGlobalMax ( casacore::IPosition  blc,
casacore::IPosition  trc,
casacore::Int  naxis 
) const
private
template<class T>
void casa::ImageDecomposer< T >::findAreaGlobalMax ( casacore::Vector< T > &  maxvals,
casacore::Block< casacore::IPosition > &  maxvalpos,
casacore::IPosition  blc,
casacore::IPosition  trc,
casacore::Int  naxis 
) const
private
template<class T>
casacore::Vector<T> casa::ImageDecomposer< T >::findAreaLocalMax ( casacore::IPosition  blc,
casacore::IPosition  trc,
casacore::Int  naxis 
) const
private

Finds all local maxima inside the specified rectangular area of the target image.

template<class T>
void casa::ImageDecomposer< T >::findAreaLocalMax ( casacore::Vector< T > &  maxvals,
casacore::Block< casacore::IPosition > &  maxvalpos,
casacore::IPosition  blc,
casacore::IPosition  trc,
casacore::Int  naxis 
) const
private
template<class T>
casacore::Vector<T> casa::ImageDecomposer< T >::findRegionLocalMax ( casacore::Int  nregion,
casacore::Int  naxis 
) const
private

Finds all local maxima of the target image inside the specifed region of the componentmap.

template<class T>
void casa::ImageDecomposer< T >::findRegionLocalMax ( casacore::Vector< T > &  maxvals,
casacore::Block< casacore::IPosition > &  maxvalpos,
casacore::Int  nregion,
casacore::Int  naxis 
) const
private
template<class T>
void casa::ImageDecomposer< T >::fitComponents ( )
private

Fits gaussians to an image; one gaussian per region in the pmap.

This function is intended to be used only by ImageDecomposer on its intermediary subimages; using it at higher level will execute a full gaussian fit on the main image and will be extremely slow. Every nonflagged object pixel in the image is used in fitting.

If the deblended flag is true, the function will treat each region as an individual component and will fit that many gaussians to the image

template<class T>
casacore::Matrix<T> casa::ImageDecomposer< T >::fitGauss ( const casacore::Matrix< T > &  positions,
const casacore::Vector< T > &  dataValues,
const casacore::Matrix< T > &  initestimate 
) const
private

Fits the specified number of 3D gaussians to the data, and returns solution in image (world) coordinates.

Essentially just an interface for FitGaussian.

template<class T>
casacore::Matrix<T> casa::ImageDecomposer< T >::fitRegion ( casacore::Int  region)
private

Fits multiple gaussians to a single region.

First performs a local maximum scan to estimate the number of components in the region.

template<class T>
void casa::ImageDecomposer< T >::fitRegions ( )
private

Fits gaussians to an image; multiple gaussians per region in the component map.

The regions are fit sequentially and independently, so this function can be used on the main image. If the map is not yet thresholded, will fit to the entire image as if it were a single composite object, which will be very slow.

template<class T>
casacore::Int casa::ImageDecomposer< T >::getCell ( casacore::Int  x,
casacore::Int  y 
) const
private

Returns the component to which the specified cell belongs.

template<class T>
casacore::Int casa::ImageDecomposer< T >::getCell ( casacore::Int  x,
casacore::Int  y,
casacore::Int  z 
) const
private
template<class T>
casacore::Int casa::ImageDecomposer< T >::getCell ( const casacore::IPosition coord) const
private
template<class T>
casacore::Int casa::ImageDecomposer< T >::getContourVal ( casacore::IPosition  coord,
const casacore::Vector< T > &  clevels 
) const
private

Retrieves the number of the highest contour with a value less then the target image's value at the given location.

template<class T>
casacore::Int casa::ImageDecomposer< T >::getContourVal ( casacore::Int  x,
casacore::Int  y,
casacore::Int  z,
const casacore::Vector< T > &  clevels 
) const
private
template<class T>
casacore::Int casa::ImageDecomposer< T >::getContourVal ( casacore::Int  x,
casacore::Int  y,
const casacore::Vector< T > &  clevels 
) const
private
template<class T>
casacore::Int casa::ImageDecomposer< T >::getContourVal ( val,
const casacore::Vector< T > &  clevels 
) const
private
template<class T>
T casa::ImageDecomposer< T >::getImageVal ( casacore::IPosition  coord) const
private

Retrieves the target image's value at the given location.

template<class T>
T casa::ImageDecomposer< T >::getImageVal ( casacore::Int  x,
casacore::Int  y 
) const
private
template<class T>
T casa::ImageDecomposer< T >::getImageVal ( casacore::Int  x,
casacore::Int  y,
casacore::Int  z 
) const
private
template<class T>
casacore::uInt casa::ImageDecomposer< T >::identifyRegions ( thrval,
casacore::Int  naxis = 2 
)
private

Performs a single threshold scan on the image.

In other words, identifies all contigous blocks of pixels in the target image above the threshold value thrval, assigning each unique block to an integer, starting at one. All pixels with target image values below thrval are set to zero.

template<class T>
casacore::Bool casa::ImageDecomposer< T >::increment ( casacore::IPosition pos,
const casacore::IPosition shape 
) const
private

Used as an N-dimensional interator.

This should probably be replaced by LatticeIterators...?

template<class T>
casacore::Bool casa::ImageDecomposer< T >::isDecomposed ( ) const

Returns true if the image has been decomposed (split up into components.)

template<class T>
casacore::Bool casa::ImageDecomposer< T >::isDerived ( ) const

Returns true if the image has been thresholded (split up into regions.)

template<class T>
casacore::Bool casa::ImageDecomposer< T >::isLocalMax ( const casacore::IPosition pos,
casacore::Int  naxis 
) const
private

Compares specified pixel to adjacent pixels to determine if it is

greatest in local pixel block.

2D: naxis = 1: compare to 4 adjacent pixels (axes only) naxis = 2: compare to 8 adjacent pixels (axes and diagonals) 3D: naxis = 1: compare to 6 adjacent pixels (axes only) naxis = 2: compare to 18 adjacent pixels (axes and 2-axis diagonals) naxis = 3: compare to 26 adjacent pixels (axes and 2/3-axis diagonals)

template<class T>
casacore::Bool casa::ImageDecomposer< T >::isLocalMax ( casacore::Int  x,
casacore::Int  y,
casacore::Int  naxis 
) const
private
template<class T>
casacore::Bool casa::ImageDecomposer< T >::isLocalMax ( casacore::Int  x,
casacore::Int  y,
casacore::Int  z,
casacore::Int  naxis 
) const
private
template<class T>
casacore::uInt casa::ImageDecomposer< T >::numComponents ( ) const

Returns the number of components found in the image.

A 'component' as defined in this code is a source that can be described as a single Gaussian. This can only be determined after deblending.

template<class T>
casacore::uInt casa::ImageDecomposer< T >::numRegions ( ) const

Returns the number of regions found in the image.

A 'region' as defined in this code is a subset of the image of contiguous pixels whose values are greater than the threshold value specified in decomposeImage. A region may contain one or more components.

template<class T>
ImageDecomposer<T>& casa::ImageDecomposer< T >::operator= ( const ImageDecomposer< T > &  other)
delete
template<class T>
void casa::ImageDecomposer< T >::printComponents ( ) const
template<class T>
void casa::ImageDecomposer< T >::renumberRegions ( )
private

Eliminates regions with no cells by replacing them with higher-numbered regions.

template<class T>
void casa::ImageDecomposer< T >::setCell ( casacore::Int  x,
casacore::Int  y,
casacore::Int  sval 
)
private

Assigns the specified cell to the specified component.

template<class T>
void casa::ImageDecomposer< T >::setCell ( casacore::Int  x,
casacore::Int  y,
casacore::Int  z,
casacore::Int  sval 
)
private
template<class T>
void casa::ImageDecomposer< T >::setCell ( const casacore::IPosition coord,
casacore::Int  sval 
)
private
template<class T>
void casa::ImageDecomposer< T >::setDeblend ( casacore::Bool  deblendIt = true)

Tell the decomposer what image to decompose ("target image").

Also resets the internal component map. void setImage (casacore::ImageInterface<T>& image);

Tells the program whether or not to use the contour-based deblender. If not, the program will instead perform a single thresholding followed by a local maximum scan before fitting.

template<class T>
void casa::ImageDecomposer< T >::setDeblendOptions ( thresholdVal = 0.1,
casacore::uInt  nContour = 11,
casacore::Int  minRange = 2,
casacore::Int  nAxis = 2 
)

Specifies deblending options:

  • thresholdVal: noise cutoff level, used to distinguish source pixels from background pixels. Also, regions which are not blended above this value will be fit separately.
  • nContour: number of total contours to use in deblending regions.
  • minRange: the minimum number of contours necessary to distinguish an object as a separate component.
  • nAxis: paramater used to define whether or not two adjacent blocks of pixels are contiguous - see identifyRegions for details.

See decomposeImage for more information on the deblending process.

template<class T>
void casa::ImageDecomposer< T >::setFit ( casacore::Bool  fitIt = true)

Tells the program whether or not to perform fitting.

If not, the component list will be dstermined by estimation from the values of the first and second order moments of each component.

template<class T>
void casa::ImageDecomposer< T >::setFitOptions ( maximumRMS = 0.1,
casacore::Int  maxRetries = -1,
casacore::uInt  maxIter = 256,
convCriteria = 0.0001 
)

Specifies fitting options:

  • maximumRMS: The maximum RMS residual value (after fitting) allowed to identify a fit as successful.
  • maxRetries: the maximum number of times the fit will be restarted in order to try to reach a successful result (convergent with RMS < maximumRMS). The default value of -1 tells the program to calculate a reasonable value automatically based on the complexity of the image.
  • maxIter: maximum number of iterations to spend on each fit.
  • convCriteria: criterion to establish convergence: see NonLinearFitLM.

Additional information on these parameters can be found in FitGaussian.

template<class T>
casacore::IPosition casa::ImageDecomposer< T >::shape ( ) const

Returns the shape of the component map.

template<class T>
casacore::Int casa::ImageDecomposer< T >::shape ( casacore::uInt  axis) const

Returns the length of a specific axis.

template<class T>
void casa::ImageDecomposer< T >::synthesize ( const ImageDecomposer< T > &  subdecomposer,
casacore::IPosition  blc 
)
private

Overlays a smaller map onto an empty region of a larger map, and adds submap component list to main component list.

The user should exercise caution with this function and synthesize submaps only into regions of the main map that are truly empty (0), as no blending is assumed between different maps.

template<class T>
void casa::ImageDecomposer< T >::zero ( )
private

Set all elements in the component map to zero and clear the component list.

Member Data Documentation

template<class T>
T casa::ImageDecomposer< T >::itsConvCriteria
private

Definition at line 255 of file ImageDecomposer.h.

template<class T>
casacore::Bool casa::ImageDecomposer< T >::itsDeblendIt
private

each component.)

Definition at line 245 of file ImageDecomposer.h.

template<class T>
casacore::uInt casa::ImageDecomposer< T >::itsDim
private

Definition at line 240 of file ImageDecomposer.h.

template<class T>
casacore::Bool casa::ImageDecomposer< T >::itsFitIt
private

Definition at line 251 of file ImageDecomposer.h.

template<class T>
casacore::ImageInterface<T>* casa::ImageDecomposer< T >::itsImagePtr
private

Definition at line 237 of file ImageDecomposer.h.

template<class T>
casacore::Matrix<T> casa::ImageDecomposer< T >::itsList
private

Definition at line 243 of file ImageDecomposer.h.

template<class T>
casacore::Lattice<casacore::Int>* casa::ImageDecomposer< T >::itsMapPtr
private

Definition at line 238 of file ImageDecomposer.h.

template<class T>
T casa::ImageDecomposer< T >::itsMaximumRMS
private

Definition at line 252 of file ImageDecomposer.h.

template<class T>
casacore::uInt casa::ImageDecomposer< T >::itsMaxIter
private

Definition at line 254 of file ImageDecomposer.h.

template<class T>
casacore::Int casa::ImageDecomposer< T >::itsMaxRetries
private

Definition at line 253 of file ImageDecomposer.h.

template<class T>
casacore::Int casa::ImageDecomposer< T >::itsMinRange
private

Definition at line 248 of file ImageDecomposer.h.

template<class T>
casacore::Int casa::ImageDecomposer< T >::itsNAxis
private

Definition at line 249 of file ImageDecomposer.h.

template<class T>
casacore::uInt casa::ImageDecomposer< T >::itsNComponents
private

Definition at line 242 of file ImageDecomposer.h.

template<class T>
casacore::uInt casa::ImageDecomposer< T >::itsNContour
private

Definition at line 247 of file ImageDecomposer.h.

template<class T>
casacore::uInt casa::ImageDecomposer< T >::itsNRegions
private

Definition at line 241 of file ImageDecomposer.h.

template<class T>
casacore::IPosition casa::ImageDecomposer< T >::itsShape
private

Definition at line 239 of file ImageDecomposer.h.

template<class T>
T casa::ImageDecomposer< T >::itsThresholdVal
private

Definition at line 246 of file ImageDecomposer.h.


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