casa
5.7.0-16
|
#include <SDMaskHandler.h>
Public Member Functions | |
SDMaskHandler () | |
Empty constructor. More... | |
~SDMaskHandler () | |
void | resetMask (std::shared_ptr< SIImageStore > imstore) |
void | fillMask (std::shared_ptr< SIImageStore > imstore, casacore::Vector< casacore::String > maskStrings) |
void | fillMask (std::shared_ptr< SIImageStore > imstore, casacore::String maskString) |
std::shared_ptr < casacore::ImageInterface < casacore::Float > > | makeMask (const casacore::String &maskName, const casacore::Quantity threshold, casacore::ImageInterface< casacore::Float > &tempim) |
Collection of methods translate mask description (text, record, threshold, etc) to mask image where the region(s) of interest are represented by the value (default = 1.0) and the rest of the image is set to 0.0. More... | |
void | copyAllMasks (const casacore::Vector< std::shared_ptr< casacore::ImageInterface< casacore::Float > > > inImageMasks, casacore::ImageInterface< casacore::Float > &outImageMask) |
merge mask images to outimage More... | |
void | copyMask (const casacore::ImageInterface< casacore::Float > &inimage, casacore::ImageInterface< casacore::Float > &outimage) |
copy and regrid a mask image to outimage More... | |
void | expandMask (const casacore::ImageInterface< casacore::Float > &inImageMask, casacore::ImageInterface< casacore::Float > &outImageMask) |
expand smaller chan mask image to larger one. More... | |
void | InMaskToImageRegion (const casacore::ImageInterface< casacore::Float > &inimage) |
convert internal mask to imageRegion More... | |
int | makeInteractiveMask (std::shared_ptr< SIImageStore > &imstore, casacore::Int &niter, casacore::Int &cycleniter, casacore::String &threshold, casacore::String &cyclethreshold) |
void | makeAutoMask (std::shared_ptr< SIImageStore > imstore) |
Return a reference to an imageinterface for the mask. More... | |
void | autoMask (std::shared_ptr< SIImageStore > imstore, casacore::TempImage< casacore::Float > &posmask, const casacore::Int iterdone, casacore::Vector< casacore::Bool > &chanflag, casacore::Record &robuststatsrec, const casacore::String &alg="", const casacore::String &threshold="", const casacore::Float &fracpeak=0.0, const casacore::String &resolution="", const casacore::Float &resbybeam=0.0, const casacore::Int nmask=0, const casacore::Bool autoadjust=false, const casacore::Float &sidelobethreshold=0.0, const casacore::Float &noisethreshold=0.0, const casacore::Float &lownoisethreshold=0.0, const casacore::Float &negativethreshold=0.0, const casacore::Float &cutthreshold=0.0, const casacore::Float &smoothfactor=0.0, const casacore::Float &minbeamfrac=0.0, const casacore::Int growiterations=0, const casacore::Bool dogrowprune=true, const casacore::Float &minpercentchange=0.0, const casacore::Bool verbose=false, const casacore::Bool fastnoise=false, const casacore::Bool isthresholdreached=false, casacore::Float pblimit=0.0) |
Top level autoMask interface Different automasking algorithm can be choosen by specifying a specific alogrithm name in alg. More... | |
void | autoMaskByThreshold (casacore::ImageInterface< casacore::Float > &mask, const casacore::ImageInterface< casacore::Float > &res, const casacore::ImageInterface< casacore::Float > &psf, const casacore::Quantity &resolution, const casacore::Float &resbybeam, const casacore::Quantity &qthreshold, const casacore::Float &fracofpeak, const casacore::Record &theStatsffff, const casacore::Float &sigma=3.0, const casacore::Int nmask=0, const casacore::Bool autoadjust=casacore::False) |
automask by threshold with binning before applying it More... | |
void | autoMaskByThreshold2 (casacore::ImageInterface< casacore::Float > &mask, const casacore::ImageInterface< casacore::Float > &res, const casacore::ImageInterface< casacore::Float > &psf, const casacore::Quantity &resolution, const casacore::Float &resbybeam, const casacore::Quantity &qthreshold, const casacore::Float &fracofpeak, const casacore::Record &theStats, const casacore::Float &sigma=3.0, const casacore::Int nmask=0) |
automask by threshold : no binning version More... | |
void | autoMaskByMultiThreshold (casacore::ImageInterface< float > &mask, casacore::TempImage< casacore::Float > &posmask, const casacore::ImageInterface< casacore::Float > &res, const casacore::ImageInterface< casacore::Float > &psf, const casacore::Record &stats, const casacore::Record &newstats, const casacore::Int iterdone, casacore::Vector< casacore::Bool > &chanFlag, const casacore::Float &maskPercentChange=0.0, const casacore::Float &sidelobeLevel=0.0, const casacore::Float &sidelobeThresholdFactor=3.0, const casacore::Float &noiseThresholdFactor=3.0, const casacore::Float &lowNoiseThresholdFactor=2.0, const casacore::Float &negativeThresholdFactor=0.0, const casacore::Float &cutThreshold=0.01, const casacore::Float &smoothFactor=1.0, const casacore::Float &minBeamFrac=-1.0, const casacore::Int growIterations=100, const casacore::Bool dogrowprune=true, const casacore::Bool verbose=false, const casacore::Bool isthresholdreached=false) |
implementation of Amanda's automasking algorithm using multiple thresholds More... | |
std::shared_ptr < casacore::ImageInterface < float > > | makeMaskFromBinnedImage (const casacore::ImageInterface< casacore::Float > &image, const casacore::Int nx, const casacore::Int ny, const casacore::Float &fracofpeak, const casacore::Float &sigma, const casacore::Int nmask, const casacore::Bool autoadjust, casacore::Double thresh=0.0) |
std::shared_ptr < casacore::ImageInterface < float > > | convolveMask (const casacore::ImageInterface< casacore::Float > &inmask, casacore::Int nxpix, casacore::Int nypix) |
Convolve mask image with nx pixel by ny pixel. More... | |
std::shared_ptr < casacore::ImageInterface < float > > | convolveMask (const casacore::ImageInterface< casacore::Float > &inmask, const casacore::GaussianBeam &beam) |
Convolve mask image by a gaussian. More... | |
std::shared_ptr < casacore::ImageInterface < float > > | pruneRegions (const casacore::ImageInterface< casacore::Float > &image, casacore::Double &thresh, casacore::Int nmask=0, casacore::Int npix=0) |
Prune the mask regions found. More... | |
std::shared_ptr < casacore::ImageInterface < float > > | pruneRegions2 (const casacore::ImageInterface< casacore::Float > &image, casacore::Double &thresh, casacore::Int nmask=0, casacore::Double prunesize=0.0) |
Prune the mask regions per spectral plane. More... | |
std::shared_ptr < casacore::ImageInterface < float > > | YAPruneRegions (const casacore::ImageInterface< casacore::Float > &image, casacore::Vector< casacore::Bool > &chanflag, casacore::Vector< casacore::Bool > &allpruned, casacore::Vector< casacore::uInt > &nreg, casacore::Vector< casacore::uInt > &npruned, casacore::Double prunesize=0.0, casacore::Bool showchanlabel=true) |
Yet another Prune the mask regions per spectral plane. More... | |
void | makeMaskByPerChanThreshold (const casacore::ImageInterface< casacore::Float > &image, casacore::Vector< casacore::Bool > &chanflag, casacore::ImageInterface< casacore::Float > &mask, casacore::Vector< casacore::Float > &thresholds, casacore::Vector< casacore::Float > &masksizes) |
create a mask image (1/0 image) applying a different threshold for each channel plane More... | |
void | binaryDilationCore (casacore::Lattice< casacore::Float > &inlattice, casacore::Array< casacore::Float > &structure, casacore::Lattice< casacore::Bool > &mask, casacore::Array< casacore::Bool > &chanmask, casacore::Lattice< casacore::Float > &outlattice) |
A core method for binary dilation of the input lattice. More... | |
void | binaryDilation (casacore::ImageInterface< casacore::Float > &inImage, casacore::Array< casacore::Float > &structure, casacore::Int niteration, casacore::Lattice< casacore::Bool > &mask, casacore::Array< casacore::Bool > &chanmask, casacore::ImageInterface< casacore::Float > &outImage) |
Multiple Binary dilation application of an image with a constraint mask and channel plane based flags. More... | |
casacore::Float | pixelBeamArea (const casacore::GaussianBeam &beam, const casacore::CoordinateSystem &csys) |
return beam area in pixel unit More... | |
void | makePBMask (std::shared_ptr< SIImageStore > imstore, casacore::Float pblimit=0.1, casacore::Bool combinemask=false) |
Create a mask image applying PB level. More... | |
void | autoMaskWithinPB (std::shared_ptr< SIImageStore > imstore, casacore::TempImage< casacore::Float > &posmask, const casacore::Int iterdone, casacore::Vector< casacore::Bool > &chanflag, casacore::Record &robuststatsrec, const casacore::String &alg="", const casacore::String &threshold="", const casacore::Float &fracpeak=0.0, const casacore::String &resolution="", const casacore::Float &resbybeam=0.0, const casacore::Int nmask=0, const casacore::Bool autoadjust=false, const casacore::Float &sidelobethreshold=0.0, const casacore::Float &noisethreshold=0.0, const casacore::Float &lownoisethreshold=0.0, const casacore::Float &negativethreshold=0.0, const casacore::Float &cutthreshold=0.0, const casacore::Float &smoothfactor=0.0, const casacore::Float &minbeamfrac=0.0, const casacore::Int growiterations=0, const casacore::Bool dogrowprune=true, const casacore::Float &minpercentchange=0.0, const casacore::Bool verbose=false, const casacore::Bool fastnoise=false, const casacore::Bool isthresholdreached=false, casacore::Float pblimit=0.1) |
void | depthFirstSearch (casacore::Int x, casacore::Int y, casacore::Int cur_label, casacore::Array< casacore::Float > &inlatarr, casacore::Array< casacore::Float > &lablatarr) |
depth-first-search algorithm for 2D More... | |
void | depthFirstSearch2 (casacore::Int x, casacore::Int y, casacore::Int cur_label, casacore::Array< casacore::Float > &inlatarr, casacore::Array< casacore::Float > &lablatarr) |
non-recursive depth-first-search algorithm for 2D More... | |
casacore::Vector < casacore::IPosition > | defineNeighbors (casacore::IPosition &pos, casacore::Int nrow, casacore::Int ncol) |
returns a Vector of neighboring pixels in IPosition (4-direction connectivity) More... | |
void | labelRegions (casacore::Lattice< casacore::Float > &inlat, casacore::Lattice< casacore::Float > &lablat) |
label connected regions using depth-first-search algorithm More... | |
casacore::Vector< casacore::Float > | findBlobSize (casacore::Lattice< casacore::Float > &lablat) |
find sizes of bolbs (regions) found by labelRegions More... | |
casacore::Bool | isEmptyMask (casacore::ImageInterface< casacore::Float > &maskiamge) |
check if mask image is empty (all zeros) =True or not More... | |
casacore::Int | getTotalPixels (casacore::ImageInterface< casacore::Float > &maskiamge) |
void | noMaskCheck (casacore::ImageInterface< casacore::Float > &mask, casacore::Matrix< casacore::String > &thresholdType) |
for warning messages for empy initial mask in automask void noMaskCheck(casacore::ImageInterface<casacore::Float>& mask, casacore::Vector<casacore::String>& thresholdType); More... | |
void | skipChannels (const casacore::Float &fracChnage, casacore::ImageInterface< casacore::Float > &prevmask, casacore::ImageInterface< casacore::Float > &curmask, const casacore::Matrix< casacore::String > &threshtype, const casacore::Bool isthresholdreached, casacore::Vector< casacore::Bool > &chanFlag, casacore::Vector< casacore::Bool > &zeroChanMask) |
determining skip channels for the mask changed less than the specfied percentage More... | |
void | printAutomaskSummary (const casacore::Array< casacore::Double > &rmss, const casacore::Array< casacore::Double > &maxs, const casacore::Array< casacore::Double > &mins, const casacore::Array< casacore::Double > &mdns, const casacore::Matrix< casacore::Float > &maskthreshold, const casacore::Matrix< casacore::String > &masktype, const casacore::Vector< casacore::Bool > &chanflag, const casacore::Matrix< casacore::Bool > &zerochanmask, const casacore::Matrix< casacore::uInt > &nreg, const casacore::Matrix< casacore::uInt > &npruned, const casacore::Matrix< casacore::uInt > &ngrowreg, const casacore::Matrix< casacore::uInt > &ngrowpruned, const casacore::Matrix< casacore::Float > &negmaskpixs, const casacore::Record &miscsummaryinfo) |
check if input image is a mask image with 0 or a value (if normalize=true, 1) casacore::Bool checkMaskImage(casacore::ImageInterface<casacore::Float>& maskiamge, casacore::Bool normalize=true); More... | |
casacore::Bool | compareSpectralCoordinate (const casacore::ImageInterface< casacore::Float > &inImage, const casacore::ImageInterface< casacore::Float > &outImage) |
void | setPBMaskLevel (const casacore::Float pbmasklevel) |
Store pbmask level (a.k.a pblimit for mask) More... | |
casacore::Float | getPBMaskLevel () |
Protected Attributes | |
InteractiveMasking * | interactiveMasker_p |
Private Attributes | |
double | itsRms |
double | itsMax |
float | itsSidelobeLevel |
float | itsPBMaskLevel |
Definition at line 48 of file SDMaskHandler.h.
casa::SDMaskHandler::SDMaskHandler | ( | ) |
Empty constructor.
casa::SDMaskHandler::~SDMaskHandler | ( | ) |
void casa::SDMaskHandler::autoMask | ( | std::shared_ptr< SIImageStore > | imstore, |
casacore::TempImage< casacore::Float > & | posmask, | ||
const casacore::Int | iterdone, | ||
casacore::Vector< casacore::Bool > & | chanflag, | ||
casacore::Record & | robuststatsrec, | ||
const casacore::String & | alg = "" , |
||
const casacore::String & | threshold = "" , |
||
const casacore::Float & | fracpeak = 0.0 , |
||
const casacore::String & | resolution = "" , |
||
const casacore::Float & | resbybeam = 0.0 , |
||
const casacore::Int | nmask = 0 , |
||
const casacore::Bool | autoadjust = false , |
||
const casacore::Float & | sidelobethreshold = 0.0 , |
||
const casacore::Float & | noisethreshold = 0.0 , |
||
const casacore::Float & | lownoisethreshold = 0.0 , |
||
const casacore::Float & | negativethreshold = 0.0 , |
||
const casacore::Float & | cutthreshold = 0.0 , |
||
const casacore::Float & | smoothfactor = 0.0 , |
||
const casacore::Float & | minbeamfrac = 0.0 , |
||
const casacore::Int | growiterations = 0 , |
||
const casacore::Bool | dogrowprune = true , |
||
const casacore::Float & | minpercentchange = 0.0 , |
||
const casacore::Bool | verbose = false , |
||
const casacore::Bool | fastnoise = false , |
||
const casacore::Bool | isthresholdreached = false , |
||
casacore::Float | pblimit = 0.0 |
||
) |
Top level autoMask interface Different automasking algorithm can be choosen by specifying a specific alogrithm name in alg.
Not all arguments are used for a choosen alogrithm.
[in,out] | imstore | SIImageStore |
[in,out] | positive | only mask |
[in] | current | iteration number completed |
[in,out] | channel | flag |
[in,out] | robust | image statistics |
[in] | alg | autoboxing alogrithm name (currently recongnized names are 'one-box', 'thresh','thresh2', and 'multithresh') |
[in] | threshold | threshold with a unit |
[in] | fracpeak | Fraction of the peak |
[in] | resolution | Resolution with a unit |
[in] | resbybeam | Multiplier of a beam to specify the resolution |
[in] | nmask | Number of masks to use |
[in] | autoadjust | Use autoadjustment of mask threshold (for 'thresh') |
[in] | sidlobethreshold | Threshold factor in a multiplier of the sidelobe level |
[in] | noisethreshold | Threshold factor in a multiplier of the rms noise |
[in] | lownoisethreshold | Threshold factor in a multiplier of the rms noise used in the binary dilation |
[in] | negativethreshold | Threshold factor in a multiplier of the rms noise used to set threshold for negative features |
[in] | cutthreshold | Cut threshold factor for adjust a mask after smoothing of the mask |
[in] | smoothfactor | Smoothing factor (multiplier of the beam) |
[in] | minbeamfrac | Percent change in mask size to trigger a new automask creation for 'noise'-based threshold |
[in] | growiterations | (maximum) number of binary dilation iteartions to grow the mask |
[in] | dogrowprune | Toggle to do or skip pruning on the grow mask |
[in] | minpercentchange | Mininum percentage change in mask to stop updating mask |
[in] | verbose | Controls automask related logging messages |
[in] | isthresholdreached | Check if cyclethreshold reached threshold |
[in] | fastnoise | Toggle to turn on and off fast (but less robust) noise calculation |
[in] | pblimit | Primary beam cut off level |
void casa::SDMaskHandler::autoMaskByMultiThreshold | ( | casacore::ImageInterface< float > & | mask, |
casacore::TempImage< casacore::Float > & | posmask, | ||
const casacore::ImageInterface< casacore::Float > & | res, | ||
const casacore::ImageInterface< casacore::Float > & | psf, | ||
const casacore::Record & | stats, | ||
const casacore::Record & | newstats, | ||
const casacore::Int | iterdone, | ||
casacore::Vector< casacore::Bool > & | chanFlag, | ||
const casacore::Float & | maskPercentChange = 0.0 , |
||
const casacore::Float & | sidelobeLevel = 0.0 , |
||
const casacore::Float & | sidelobeThresholdFactor = 3.0 , |
||
const casacore::Float & | noiseThresholdFactor = 3.0 , |
||
const casacore::Float & | lowNoiseThresholdFactor = 2.0 , |
||
const casacore::Float & | negativeThresholdFactor = 0.0 , |
||
const casacore::Float & | cutThreshold = 0.01 , |
||
const casacore::Float & | smoothFactor = 1.0 , |
||
const casacore::Float & | minBeamFrac = -1.0 , |
||
const casacore::Int | growIterations = 100 , |
||
const casacore::Bool | dogrowprune = true , |
||
const casacore::Bool | verbose = false , |
||
const casacore::Bool | isthresholdreached = false |
||
) |
implementation of Amanda's automasking algorithm using multiple thresholds
void casa::SDMaskHandler::autoMaskByThreshold | ( | casacore::ImageInterface< casacore::Float > & | mask, |
const casacore::ImageInterface< casacore::Float > & | res, | ||
const casacore::ImageInterface< casacore::Float > & | psf, | ||
const casacore::Quantity & | resolution, | ||
const casacore::Float & | resbybeam, | ||
const casacore::Quantity & | qthreshold, | ||
const casacore::Float & | fracofpeak, | ||
const casacore::Record & | theStatsffff, | ||
const casacore::Float & | sigma = 3.0 , |
||
const casacore::Int | nmask = 0 , |
||
const casacore::Bool | autoadjust = casacore::False |
||
) |
automask by threshold with binning before applying it
void casa::SDMaskHandler::autoMaskByThreshold2 | ( | casacore::ImageInterface< casacore::Float > & | mask, |
const casacore::ImageInterface< casacore::Float > & | res, | ||
const casacore::ImageInterface< casacore::Float > & | psf, | ||
const casacore::Quantity & | resolution, | ||
const casacore::Float & | resbybeam, | ||
const casacore::Quantity & | qthreshold, | ||
const casacore::Float & | fracofpeak, | ||
const casacore::Record & | theStats, | ||
const casacore::Float & | sigma = 3.0 , |
||
const casacore::Int | nmask = 0 |
||
) |
automask by threshold : no binning version
void casa::SDMaskHandler::autoMaskWithinPB | ( | std::shared_ptr< SIImageStore > | imstore, |
casacore::TempImage< casacore::Float > & | posmask, | ||
const casacore::Int | iterdone, | ||
casacore::Vector< casacore::Bool > & | chanflag, | ||
casacore::Record & | robuststatsrec, | ||
const casacore::String & | alg = "" , |
||
const casacore::String & | threshold = "" , |
||
const casacore::Float & | fracpeak = 0.0 , |
||
const casacore::String & | resolution = "" , |
||
const casacore::Float & | resbybeam = 0.0 , |
||
const casacore::Int | nmask = 0 , |
||
const casacore::Bool | autoadjust = false , |
||
const casacore::Float & | sidelobethreshold = 0.0 , |
||
const casacore::Float & | noisethreshold = 0.0 , |
||
const casacore::Float & | lownoisethreshold = 0.0 , |
||
const casacore::Float & | negativethreshold = 0.0 , |
||
const casacore::Float & | cutthreshold = 0.0 , |
||
const casacore::Float & | smoothfactor = 0.0 , |
||
const casacore::Float & | minbeamfrac = 0.0 , |
||
const casacore::Int | growiterations = 0 , |
||
const casacore::Bool | dogrowprune = true , |
||
const casacore::Float & | minpercentchange = 0.0 , |
||
const casacore::Bool | verbose = false , |
||
const casacore::Bool | fastnoise = false , |
||
const casacore::Bool | isthresholdreached = false , |
||
casacore::Float | pblimit = 0.1 |
||
) |
void casa::SDMaskHandler::binaryDilation | ( | casacore::ImageInterface< casacore::Float > & | inImage, |
casacore::Array< casacore::Float > & | structure, | ||
casacore::Int | niteration, | ||
casacore::Lattice< casacore::Bool > & | mask, | ||
casacore::Array< casacore::Bool > & | chanmask, | ||
casacore::ImageInterface< casacore::Float > & | outImage | ||
) |
Multiple Binary dilation application of an image with a constraint mask and channel plane based flags.
void casa::SDMaskHandler::binaryDilationCore | ( | casacore::Lattice< casacore::Float > & | inlattice, |
casacore::Array< casacore::Float > & | structure, | ||
casacore::Lattice< casacore::Bool > & | mask, | ||
casacore::Array< casacore::Bool > & | chanmask, | ||
casacore::Lattice< casacore::Float > & | outlattice | ||
) |
A core method for binary dilation of the input lattice.
|
static |
Convert boxes defined with blcs and trcs to ImageRegion.
|
static |
Calculate statistics on a residual image with additional region and LEL mask specifications using classical method.
|
static |
|
static |
Calcuate statistics on a residual image using robust methods to estimate RMS noise.
Basing on presence of a mask the following logic is used. a. If there is no existing clean mask, calculate statistics using the chauvenet algorithm with maxiter=5 and zscore=-1. b. If there is an existing clean mask, calculate the classic statistics with robust=True in the region outside the clean mask and inside the primary beam mask.
|
static |
Convert circles (in pixels) to ImageRegion.
|
static |
casacore::Bool casa::SDMaskHandler::compareSpectralCoordinate | ( | const casacore::ImageInterface< casacore::Float > & | inImage, |
const casacore::ImageInterface< casacore::Float > & | outImage | ||
) |
std::shared_ptr<casacore::ImageInterface<float> > casa::SDMaskHandler::convolveMask | ( | const casacore::ImageInterface< casacore::Float > & | inmask, |
casacore::Int | nxpix, | ||
casacore::Int | nypix | ||
) |
Convolve mask image with nx pixel by ny pixel.
std::shared_ptr<casacore::ImageInterface<float> > casa::SDMaskHandler::convolveMask | ( | const casacore::ImageInterface< casacore::Float > & | inmask, |
const casacore::GaussianBeam & | beam | ||
) |
Convolve mask image by a gaussian.
void casa::SDMaskHandler::copyAllMasks | ( | const casacore::Vector< std::shared_ptr< casacore::ImageInterface< casacore::Float > > > | inImageMasks, |
casacore::ImageInterface< casacore::Float > & | outImageMask | ||
) |
merge mask images to outimage
void casa::SDMaskHandler::copyMask | ( | const casacore::ImageInterface< casacore::Float > & | inimage, |
casacore::ImageInterface< casacore::Float > & | outimage | ||
) |
copy and regrid a mask image to outimage
casacore::Vector<casacore::IPosition> casa::SDMaskHandler::defineNeighbors | ( | casacore::IPosition & | pos, |
casacore::Int | nrow, | ||
casacore::Int | ncol | ||
) |
returns a Vector of neighboring pixels in IPosition (4-direction connectivity)
void casa::SDMaskHandler::depthFirstSearch | ( | casacore::Int | x, |
casacore::Int | y, | ||
casacore::Int | cur_label, | ||
casacore::Array< casacore::Float > & | inlatarr, | ||
casacore::Array< casacore::Float > & | lablatarr | ||
) |
depth-first-search algorithm for 2D
void casa::SDMaskHandler::depthFirstSearch2 | ( | casacore::Int | x, |
casacore::Int | y, | ||
casacore::Int | cur_label, | ||
casacore::Array< casacore::Float > & | inlatarr, | ||
casacore::Array< casacore::Float > & | lablatarr | ||
) |
non-recursive depth-first-search algorithm for 2D
void casa::SDMaskHandler::expandMask | ( | const casacore::ImageInterface< casacore::Float > & | inImageMask, |
casacore::ImageInterface< casacore::Float > & | outImageMask | ||
) |
expand smaller chan mask image to larger one.
void casa::SDMaskHandler::fillMask | ( | std::shared_ptr< SIImageStore > | imstore, |
casacore::Vector< casacore::String > | maskStrings | ||
) |
void casa::SDMaskHandler::fillMask | ( | std::shared_ptr< SIImageStore > | imstore, |
casacore::String | maskString | ||
) |
casacore::Vector<casacore::Float> casa::SDMaskHandler::findBlobSize | ( | casacore::Lattice< casacore::Float > & | lablat | ) |
find sizes of bolbs (regions) found by labelRegions
casacore::Float casa::SDMaskHandler::getPBMaskLevel | ( | ) |
casacore::Int casa::SDMaskHandler::getTotalPixels | ( | casacore::ImageInterface< casacore::Float > & | maskiamge | ) |
void casa::SDMaskHandler::InMaskToImageRegion | ( | const casacore::ImageInterface< casacore::Float > & | inimage | ) |
convert internal mask to imageRegion
casacore::Bool casa::SDMaskHandler::isEmptyMask | ( | casacore::ImageInterface< casacore::Float > & | maskiamge | ) |
check if mask image is empty (all zeros) =True or not
void casa::SDMaskHandler::labelRegions | ( | casacore::Lattice< casacore::Float > & | inlat, |
casacore::Lattice< casacore::Float > & | lablat | ||
) |
label connected regions using depth-first-search algorithm
void casa::SDMaskHandler::makeAutoMask | ( | std::shared_ptr< SIImageStore > | imstore | ) |
Return a reference to an imageinterface for the mask.
int casa::SDMaskHandler::makeInteractiveMask | ( | std::shared_ptr< SIImageStore > & | imstore, |
casacore::Int & | niter, | ||
casacore::Int & | cycleniter, | ||
casacore::String & | threshold, | ||
casacore::String & | cyclethreshold | ||
) |
std::shared_ptr<casacore::ImageInterface<casacore::Float> > casa::SDMaskHandler::makeMask | ( | const casacore::String & | maskName, |
const casacore::Quantity | threshold, | ||
casacore::ImageInterface< casacore::Float > & | tempim | ||
) |
Collection of methods translate mask description (text, record, threshold, etc) to mask image where the region(s) of interest are represented by the value (default = 1.0) and the rest of the image is set to 0.0.
void makeMask(); Create a mask image with maskName from tempim with a threshold applied to the pixel intensity
void casa::SDMaskHandler::makeMaskByPerChanThreshold | ( | const casacore::ImageInterface< casacore::Float > & | image, |
casacore::Vector< casacore::Bool > & | chanflag, | ||
casacore::ImageInterface< casacore::Float > & | mask, | ||
casacore::Vector< casacore::Float > & | thresholds, | ||
casacore::Vector< casacore::Float > & | masksizes | ||
) |
create a mask image (1/0 image) applying a different threshold for each channel plane
std::shared_ptr<casacore::ImageInterface<float> > casa::SDMaskHandler::makeMaskFromBinnedImage | ( | const casacore::ImageInterface< casacore::Float > & | image, |
const casacore::Int | nx, | ||
const casacore::Int | ny, | ||
const casacore::Float & | fracofpeak, | ||
const casacore::Float & | sigma, | ||
const casacore::Int | nmask, | ||
const casacore::Bool | autoadjust, | ||
casacore::Double | thresh = 0.0 |
||
) |
void casa::SDMaskHandler::makePBMask | ( | std::shared_ptr< SIImageStore > | imstore, |
casacore::Float | pblimit = 0.1 , |
||
casacore::Bool | combinemask = false |
||
) |
Create a mask image applying PB level.
[in,out] | imstore | SIImageStore |
[in] | pblimit | Primary beam cut off level |
[in] | pblimit | Primary beam cut off level |
|
inlinestatic |
max MB of memory to use in TempImage
Definition at line 385 of file SDMaskHandler.h.
void casa::SDMaskHandler::noMaskCheck | ( | casacore::ImageInterface< casacore::Float > & | mask, |
casacore::Matrix< casacore::String > & | thresholdType | ||
) |
for warning messages for empy initial mask in automask
void noMaskCheck(casacore::ImageInterface<casacore::Float>& mask, casacore::Vector<casacore::String>& thresholdType);
casacore::Float casa::SDMaskHandler::pixelBeamArea | ( | const casacore::GaussianBeam & | beam, |
const casacore::CoordinateSystem & | csys | ||
) |
return beam area in pixel unit
void casa::SDMaskHandler::printAutomaskSummary | ( | const casacore::Array< casacore::Double > & | rmss, |
const casacore::Array< casacore::Double > & | maxs, | ||
const casacore::Array< casacore::Double > & | mins, | ||
const casacore::Array< casacore::Double > & | mdns, | ||
const casacore::Matrix< casacore::Float > & | maskthreshold, | ||
const casacore::Matrix< casacore::String > & | masktype, | ||
const casacore::Vector< casacore::Bool > & | chanflag, | ||
const casacore::Matrix< casacore::Bool > & | zerochanmask, | ||
const casacore::Matrix< casacore::uInt > & | nreg, | ||
const casacore::Matrix< casacore::uInt > & | npruned, | ||
const casacore::Matrix< casacore::uInt > & | ngrowreg, | ||
const casacore::Matrix< casacore::uInt > & | ngrowpruned, | ||
const casacore::Matrix< casacore::Float > & | negmaskpixs, | ||
const casacore::Record & | miscsummaryinfo | ||
) |
check if input image is a mask image with 0 or a value (if normalize=true, 1)
casacore::Bool checkMaskImage(casacore::ImageInterface<casacore::Float>& maskiamge, casacore::Bool normalize=true);
print per-channel automask summary
maskthreshold | const casacore::Vector<casacore::Float>& maskthreshold, |
masktype | const casacore::Vector<casacore::String>& masktype, |
zerochanmask | const casacore::Vector<casacore::Bool>& zerochanmask, |
nreg | const casacore::Vector<casacore::uInt>& nreg, |
npruned | const casacore::Vector<casacore::uInt>& npruned, |
ngrowreg | const casacore::Vector<casacore::uInt>& ngrowreg, |
ngrowpruned | const casacore::Vector<casacore::uInt>& ngrowpruned, |
negmaskpixs | const casacore::Vector<casacore::Float>& negmaskpixs, |
std::shared_ptr<casacore::ImageInterface<float> > casa::SDMaskHandler::pruneRegions | ( | const casacore::ImageInterface< casacore::Float > & | image, |
casacore::Double & | thresh, | ||
casacore::Int | nmask = 0 , |
||
casacore::Int | npix = 0 |
||
) |
Prune the mask regions found.
std::shared_ptr<casacore::ImageInterface<float> > casa::SDMaskHandler::pruneRegions2 | ( | const casacore::ImageInterface< casacore::Float > & | image, |
casacore::Double & | thresh, | ||
casacore::Int | nmask = 0 , |
||
casacore::Double | prunesize = 0.0 |
||
) |
Prune the mask regions per spectral plane.
|
static |
Convert region defined by record to Imageregion.
|
static |
Read CRTF format text or the text file contains CRTF definitions and convert it to a ImageRegion.
|
static |
Make a mask image from casacore::Record, casacore::Matrix of (nboxes,4) where each row contains [blc_x,blc_y, trc_x,trc_y], and casacore::Matrix of (ncircles, 3) with the specified 'value'.
Each row of circles are radius, x_center, y_center in pixels. blctrcs and circles are applied to all the spectral and stokes while regions specified in record can specify selections in spectral and stokes axes. static casacore::Bool regionToImageMask(const casacore::String& maskimage, casacore::Record* regionRec, casacore::Matrix<casacore::Quantity> & blctrcs,
|
static |
Convert casacore::ImageRegion to a mask image with the value.
void casa::SDMaskHandler::resetMask | ( | std::shared_ptr< SIImageStore > | imstore | ) |
void casa::SDMaskHandler::setPBMaskLevel | ( | const casacore::Float | pbmasklevel | ) |
Store pbmask level (a.k.a pblimit for mask)
void casa::SDMaskHandler::skipChannels | ( | const casacore::Float & | fracChnage, |
casacore::ImageInterface< casacore::Float > & | prevmask, | ||
casacore::ImageInterface< casacore::Float > & | curmask, | ||
const casacore::Matrix< casacore::String > & | threshtype, | ||
const casacore::Bool | isthresholdreached, | ||
casacore::Vector< casacore::Bool > & | chanFlag, | ||
casacore::Vector< casacore::Bool > & | zeroChanMask | ||
) |
determining skip channels for the mask changed less than the specfied percentage
std::shared_ptr<casacore::ImageInterface<float> > casa::SDMaskHandler::YAPruneRegions | ( | const casacore::ImageInterface< casacore::Float > & | image, |
casacore::Vector< casacore::Bool > & | chanflag, | ||
casacore::Vector< casacore::Bool > & | allpruned, | ||
casacore::Vector< casacore::uInt > & | nreg, | ||
casacore::Vector< casacore::uInt > & | npruned, | ||
casacore::Double | prunesize = 0.0 , |
||
casacore::Bool | showchanlabel = true |
||
) |
Yet another Prune the mask regions per spectral plane.
|
protected |
Definition at line 421 of file SDMaskHandler.h.
|
private |
Definition at line 426 of file SDMaskHandler.h.
|
private |
Definition at line 428 of file SDMaskHandler.h.
|
private |
Definition at line 425 of file SDMaskHandler.h.
|
private |
Definition at line 427 of file SDMaskHandler.h.