#include <PixelValueManipulator.h>
Public Member Functions | |
PixelValueManipulator () | |
Top level interface for getting and setting image pixel values. | |
PixelValueManipulator (const SPCIIT image, const Record *const regionRec, const String &mask, Bool verboseDuringConstruction=True) | |
regionRec = 0 => no region selected, full image used mask = "" => No additional mask specification, although image default mask will be used if one exists. | |
~PixelValueManipulator () | |
void | setAxes (const IPosition &axes, Bool invert=False) |
set axes to average over. | |
Record | get () const |
Get pixel values, pixel mask values, etc. | |
Record | getProfile (uInt axis, const String &function, const String &unit, PixelValueManipulatorData::SpectralType specType=PixelValueManipulatorData::DEFAULT, const Quantity *const restFreq=nullptr, const String &frame="") |
get the aggregated values along the specified pixel axis using the region and mask at construction and any other mask the image may have. | |
Record | getProfile (uInt axis, ImageCollapserData::AggregateType function, const String &unit, PixelValueManipulatorData::SpectralType specType=PixelValueManipulatorData::DEFAULT, const Quantity *const restFreq=nullptr, const String &frame="") |
String | getClass () const |
Record | pixelValue (const Vector< Int > &pixel) const |
void | pixelValue (Bool &offImage, Quantum< T > &value, Bool &mask, Vector< Int > &pos) const |
void | setRegionName (const String &rname) |
set region name for logging purposes. | |
Static Public Member Functions | |
static void | addNoise (SPIIT image, const String &type, const Record ®ion, const Vector< Double > &pars, Bool zero, const std::pair< Int, Int > *const &seeds) |
static Record * | coordMeasures (Quantum< T > &intensity, Record &direction, Record &frequency, Record &velocity, SPCIIT image, const Vector< Double > &pixel, const String &dirFrame, const String &freqFrame) |
dirFrame and freqFrame are the codes for the frames for which it is desired that the returned measures should be specified. | |
static Record * | getSlice (SPCIIT image, const Vector< Double > &x, const Vector< Double > &y, const Vector< Int > &axes, const Vector< Int > &coord, Int npts=0, const String &method="linear") |
get a slice through the image. | |
static void | put (SPIIT image, const Array< T > &pixelsArray, const Vector< Int > &blc, const Vector< Int > &inc, Bool list, Bool locking, Bool replicate) |
static Bool | putRegion (SPIIT image, const Array< T > &pixels, const Array< Bool > &mask, Record ®ion, Bool list, Bool usemask, Bool replicateArray) |
static void | insert (ImageInterface< T > &target, const ImageInterface< T > &image, const Record ®ion, const Vector< Double > &locatePixel, Bool verbose) |
region refers to the region in the image to be inserted, not the region that was chosen at object construction | |
static void | makeRegionBlock (PtrBlock< const ImageRegion * > ®ions, const Record &Regions) |
Make a block of regions from a Record public so ImageAnalysis can use it, once those methods have been excised, make private. | |
static Bool | set (SPIIF image, const String &pixels, const Int pixelmask, Record ®ion, const Bool list=false) |
set specified pixels or mask equal to provided scalar value | |
Protected Member Functions | |
CasacRegionManager::StokesControl | _getStokesControl () const |
std::vector< Coordinate::Type > | _getNecessaryCoordinates () const |
Represents the minimum set of coordinates necessary for the task to function. | |
Bool | _hasLogfileSupport () const |
by default, derived classes are configured to have no log file support. | |
Bool | _supportsMultipleRegions () const |
Private Member Functions | |
void | _checkUnit (const String &unit, const CoordinateSystem &csys, PixelValueManipulatorData::SpectralType specType) const |
Record | _doWorld (SPIIT collapsed, const String &unit, PixelValueManipulatorData::SpectralType specType, const Quantity *const restFreq, const String &frame, uInt axis) const |
void | _doNoncomformantUnit (Vector< Double > &coords, const CoordinateSystem &csys, const String &unit, PixelValueManipulatorData::SpectralType specType, const Quantity *const restFreq, const String &axisUnit) const |
Vector< uInt > | _npts (uInt axis) const |
Private Attributes | |
IPosition | _axes |
IPosition | _lastChunkShape |
String | _regionName |
Static Private Attributes | |
static const String | _className |
Definition at line 12 of file PixelValueManipulator.h.
casa::PixelValueManipulator< T >::PixelValueManipulator | ( | ) |
casa::PixelValueManipulator< T >::PixelValueManipulator | ( | const SPCIIT | image, | |
const Record *const | regionRec, | |||
const String & | mask, | |||
Bool | verboseDuringConstruction = True | |||
) |
regionRec = 0 => no region selected, full image used mask = "" => No additional mask specification, although image default mask will be used if one exists.
casa::PixelValueManipulator< T >::~PixelValueManipulator | ( | ) | [inline] |
Definition at line 46 of file PixelValueManipulator.h.
void casa::PixelValueManipulator< T >::_checkUnit | ( | const String & | unit, | |
const CoordinateSystem & | csys, | |||
PixelValueManipulatorData::SpectralType | specType | |||
) | const [private] |
void casa::PixelValueManipulator< T >::_doNoncomformantUnit | ( | Vector< Double > & | coords, | |
const CoordinateSystem & | csys, | |||
const String & | unit, | |||
PixelValueManipulatorData::SpectralType | specType, | |||
const Quantity *const | restFreq, | |||
const String & | axisUnit | |||
) | const [private] |
Record casa::PixelValueManipulator< T >::_doWorld | ( | SPIIT | collapsed, | |
const String & | unit, | |||
PixelValueManipulatorData::SpectralType | specType, | |||
const Quantity *const | restFreq, | |||
const String & | frame, | |||
uInt | axis | |||
) | const [private] |
std::vector<Coordinate::Type> casa::PixelValueManipulator< T >::_getNecessaryCoordinates | ( | ) | const [inline, protected, virtual] |
Represents the minimum set of coordinates necessary for the task to function.
Implements casa::ImageTask< T >.
Definition at line 175 of file PixelValueManipulator.h.
CasacRegionManager::StokesControl casa::PixelValueManipulator< T >::_getStokesControl | ( | ) | const [inline, protected, virtual] |
Implements casa::ImageTask< T >.
Definition at line 171 of file PixelValueManipulator.h.
References casa::CasacRegionManager::USE_ALL_STOKES.
Bool casa::PixelValueManipulator< T >::_hasLogfileSupport | ( | ) | const [inline, protected, virtual] |
by default, derived classes are configured to have no log file support.
Reimplemented from casa::ImageTask< T >.
Definition at line 179 of file PixelValueManipulator.h.
References casacore::True.
Vector<uInt> casa::PixelValueManipulator< T >::_npts | ( | uInt | axis | ) | const [private] |
Bool casa::PixelValueManipulator< T >::_supportsMultipleRegions | ( | ) | const [inline, protected, virtual] |
Reimplemented from casa::ImageTask< T >.
Definition at line 181 of file PixelValueManipulator.h.
References casacore::True.
static void casa::PixelValueManipulator< T >::addNoise | ( | SPIIT | image, | |
const String & | type, | |||
const Record & | region, | |||
const Vector< Double > & | pars, | |||
Bool | zero, | |||
const std::pair< Int, Int > *const & | seeds | |||
) | [static] |
static Record* casa::PixelValueManipulator< T >::coordMeasures | ( | Quantum< T > & | intensity, | |
Record & | direction, | |||
Record & | frequency, | |||
Record & | velocity, | |||
SPCIIT | image, | |||
const Vector< Double > & | pixel, | |||
const String & | dirFrame, | |||
const String & | freqFrame | |||
) | [static] |
dirFrame
and freqFrame
are the codes for the frames for which it is desired that the returned measures should be specified.
In both cases, one can specify "native" for the native coordinate frame, "cl" for the conversion layer frame, or any valid frame string from MDirection::showType() or MFrequency::showType().
Record casa::PixelValueManipulator< T >::get | ( | ) | const |
Get pixel values, pixel mask values, etc.
The return Record has the following fields: 'values' => Array<T> of pixel values 'mask' => Array<Bool> of pixel mask values
String casa::PixelValueManipulator< T >::getClass | ( | ) | const [inline, virtual] |
Implements casa::ImageTask< T >.
Definition at line 137 of file PixelValueManipulator.h.
References casa::PixelValueManipulator< T >::_className.
Record casa::PixelValueManipulator< T >::getProfile | ( | uInt | axis, | |
ImageCollapserData::AggregateType | function, | |||
const String & | unit, | |||
PixelValueManipulatorData::SpectralType | specType = PixelValueManipulatorData::DEFAULT , |
|||
const Quantity *const | restFreq = nullptr , |
|||
const String & | frame = "" | |||
) |
Record casa::PixelValueManipulator< T >::getProfile | ( | uInt | axis, | |
const String & | function, | |||
const String & | unit, | |||
PixelValueManipulatorData::SpectralType | specType = PixelValueManipulatorData::DEFAULT , |
|||
const Quantity *const | restFreq = nullptr , |
|||
const String & | frame = "" | |||
) |
get the aggregated values along the specified pixel axis using the region and mask at construction and any other mask the image may have.
Supported values of function
are (case-insensitive, minimum match) those supported by ImageCollapser, ie "flux", "max", "mean", "median", "min", "rms", "sqrtsum", "sqrtsum_npix", sqrtsum_npix_beam", "stddev", "sum", "variance", and "zero. Aggregation of values occurs along all axes orthogonal to the one specified. One may specify the unit in which coordinate values are calculated using the unit
parameter. If unit starts with "pix", then pixel coordinates are calculated, world coordinates otherwise. If pixel coordinates, the values are relative to the zeroth pixel on the corresponding axis of the input image. If specified and it doesn't start with "pix", the unit must be conformant with the unit of axis
in the coordinate system of the image, or it must be a unit that this axis can be readily converted to (eg km/s if the axis is a frequency axis with base unit of Hz). If the selected axis is the spectral axis and if the unit is chosen to be something other than the native spectral coordinate unit (such as velocity or wavelength for a native frequency unit), specType
indicates the system to use when converting the frequency. Values of RELATVISTIC, RADIO_VELOCITY, and OPTICAL_VELOCITY are only permitted if unit
represents a velocity unit. Values of WAVELENGTH and AIR_WAVELENGTH are only permitted if unit
represents a length unit. For a velocity unit, DEFAULT is equivalent to RELATIVISTIC. For a length unit, DEFAULT is equivalent to WAVELENGTH. If the selected axis is the spectral axis and unit
is a velocity unit, restFreq
represents the rest frequency with respect to which the velocity scale should be calculated. If null, the rest frequency associated with the spectral coordinate is used. If the selected axis is the spectral axis, and unit
is a frequency unit, frame
represents the frame of reference with respect to which the frequency scale should be calculated. If empty, the reference frame associated with the spectral coordinate is used. The return Record has the following keys: "values" is a Vector<T> containing the aggregate pixel values, "mask" is the associated mask values (Vector<Bool>), "coords" is a Vector<Double> of coordinate values, and "xUnit" is a String containing the coordinate unit, and "yUnit" is a string containing the ordinate unit.
static Record* casa::PixelValueManipulator< T >::getSlice | ( | SPCIIT | image, | |
const Vector< Double > & | x, | |||
const Vector< Double > & | y, | |||
const Vector< Int > & | axes, | |||
const Vector< Int > & | coord, | |||
Int | npts = 0 , |
|||
const String & | method = "linear" | |||
) | [static] |
get a slice through the image.
The values are interpolated at regular intervals to provide samples at npts number of points. x and y are in pixel coordinates
static void casa::PixelValueManipulator< T >::insert | ( | ImageInterface< T > & | target, | |
const ImageInterface< T > & | image, | |||
const Record & | region, | |||
const Vector< Double > & | locatePixel, | |||
Bool | verbose | |||
) | [static] |
region refers to the region in the image to be inserted, not the region that was chosen at object construction
static void casa::PixelValueManipulator< T >::makeRegionBlock | ( | PtrBlock< const ImageRegion * > & | regions, | |
const Record & | Regions | |||
) | [static] |
Make a block of regions from a Record public so ImageAnalysis can use it, once those methods have been excised, make private.
void casa::PixelValueManipulator< T >::pixelValue | ( | Bool & | offImage, | |
Quantum< T > & | value, | |||
Bool & | mask, | |||
Vector< Int > & | pos | |||
) | const |
Record casa::PixelValueManipulator< T >::pixelValue | ( | const Vector< Int > & | pixel | ) | const |
static void casa::PixelValueManipulator< T >::put | ( | SPIIT | image, | |
const Array< T > & | pixelsArray, | |||
const Vector< Int > & | blc, | |||
const Vector< Int > & | inc, | |||
Bool | list, | |||
Bool | locking, | |||
Bool | replicate | |||
) | [static] |
static Bool casa::PixelValueManipulator< T >::putRegion | ( | SPIIT | image, | |
const Array< T > & | pixels, | |||
const Array< Bool > & | mask, | |||
Record & | region, | |||
Bool | list, | |||
Bool | usemask, | |||
Bool | replicateArray | |||
) | [static] |
static Bool casa::PixelValueManipulator< T >::set | ( | SPIIF | image, | |
const String & | pixels, | |||
const Int | pixelmask, | |||
Record & | region, | |||
const Bool | list = false | |||
) | [static] |
set specified pixels or mask equal to provided scalar value
void casa::PixelValueManipulator< T >::setAxes | ( | const IPosition & | axes, | |
Bool | invert = False | |||
) |
set axes to average over.
If invert is True, select all axes other than the specified axes to average over.
void casa::PixelValueManipulator< T >::setRegionName | ( | const String & | rname | ) | [inline] |
set region name for logging purposes.
Only used if the logfile is set.
Definition at line 168 of file PixelValueManipulator.h.
References casa::PixelValueManipulator< T >::_regionName.
IPosition casa::PixelValueManipulator< T >::_axes [private] |
Definition at line 184 of file PixelValueManipulator.h.
const String casa::PixelValueManipulator< T >::_className [static, private] |
Definition at line 186 of file PixelValueManipulator.h.
Referenced by casa::PixelValueManipulator< T >::getClass().
IPosition casa::PixelValueManipulator< T >::_lastChunkShape [private] |
Definition at line 184 of file PixelValueManipulator.h.
String casa::PixelValueManipulator< T >::_regionName [private] |
Definition at line 185 of file PixelValueManipulator.h.
Referenced by casa::PixelValueManipulator< T >::setRegionName().