28 #ifndef IMAGES_IMAGEDECOMPOSER_H
29 #define IMAGES_IMAGEDECOMPOSER_H
185 T convCriteria=0.0001);
464 #ifndef CASACORE_NO_AUTO_TEMPLATES
465 #include <imageanalysis/ImageAnalysis/ImageDecomposer.tcc>
466 #endif //# CASACORE_NO_AUTO_TEMPLATES
A Vector of integers, for indexing into Array<T> objects.
casacore::Lattice< casacore::Int > * itsMapPtr
A 1-D Specialization of the Array class.
casacore::Int getCell(casacore::Int x, casacore::Int y) const
Returns the component to which the specified cell belongs.
void displayContourMap(const casacore::Vector< T > &clevels) const
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...
T getImageVal(casacore::IPosition coord) const
Retrieves the target image's value at the given location.
void printComponents() const
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 com...
void zero()
Set all elements in the component map to zero and clear the component list.
ImageDecomposer< T > & operator=(const ImageDecomposer< T > &other)=delete
casacore::uInt identifyRegions(T thrval, casacore::Int naxis=2)
Performs a single threshold scan on the image.
casacore::Matrix< T > fitRegion(casacore::Int region)
Fits multiple gaussians to a single region.
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.
casacore::uInt numComponents() const
Returns the number of components found in the image.
void clear()
Set all nonmasked elements in the component map to zero and clear the component list.
casacore::Matrix< T > estimateComponents()
Estimate the component parameters based on moments calculated using the component map...
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) coordina...
casacore::uInt itsNRegions
casacore::ImageInterface< T > * itsImagePtr
A 2-D Specialization of the Array class.
casacore::Vector< T > findAllRegionGlobalMax() const
Finds the maximum value of the target image in each region of the componentmap.
void setFit(casacore::Bool fitIt=true)
Tells the program whether or not to perform fitting.
casacore::uInt itsMaxIter
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 m...
casacore::Int itsMinRange
void setDeblendOptions(T thresholdVal=0.1, casacore::uInt nContour=11, casacore::Int minRange=2, casacore::Int nAxis=2)
Specifies deblending options:
A tool to separate a complex image into individual components.
casacore::Bool increment(casacore::IPosition &pos, const casacore::IPosition &shape) const
Used as an N-dimensional interator.
A base class for astronomical images.
void componentMap() const
Currently does nothing; in the future should return the component map in a way that it can be seen by...
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 n...
casacore::Array< T > calculateMoments(casacore::Int region) const
Calculates the 0th-2nd order moments of a region.
casacore::Bool itsDeblendIt
each component.)
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 gi...
void destroyRegions(const casacore::Vector< casacore::Bool > &killRegion)
Eliminates any regions whose corresponding values in killRegion are true by setting all pixel values ...
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 ...
casacore::uInt numRegions() const
Returns the number of regions found in the image.
casacore::IPosition itsShape
void setCell(casacore::Int x, casacore::Int y, casacore::Int sval)
Assigns the specified cell to the specified component.
bool Bool
Define the standard types used by Casacore.
casacore::Int itsMaxRetries
void fitRegions()
Fits gaussians to an image; multiple gaussians per region in the component map.
casacore::Bool isDerived() const
Returns true if the image has been thresholded (split up into regions.)
void decrement(casacore::IPosition &pos) const
template <class T, class U> class vector;
T findAreaGlobalMax(casacore::IPosition blc, casacore::IPosition trc) const
Finds the greatest value inside the specified rectangular area of the target image.
void setDeblend(casacore::Bool deblendIt=true)
Tell the decomposer what image to decompose ("target image").
casacore::Matrix< T > componentList() const
Returns the component parameters as a Matrix.
casacore::Matrix< T > itsList
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...
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. ...
void decomposeImage()
The primary method of this class - executes the instructions stated in the options above by deblendin...
void copyOptions(const ImageDecomposer< T > &other)
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 c...
casacore::Bool isDecomposed() const
Returns true if the image has been decomposed (split up into components.)
void fitComponents()
Fits gaussians to an image; one gaussian per region in the pmap.
void display() const
Command-line text output functions.
void setFitOptions(T maximumRMS=0.1, casacore::Int maxRetries=-1, casacore::uInt maxIter=256, T convCriteria=0.0001)
Specifies fitting options:
casacore::IPosition shape() const
Returns the shape of the component map.
void renumberRegions()
Eliminates regions with no cells by replacing them with higher-numbered regions.
casacore::uInt itsNComponents
casacore::uInt itsNContour
componentValues
'Special' flag values for pixels in the component map.