casa
$Rev:20696$
|
Class to define a mask as a LEL expression. More...
#include <WCLELMask.h>
Public Member Functions | |
WCLELMask () | |
WCLELMask (const String &command) | |
Construct from the given expression command. | |
WCLELMask (const char *command) | |
WCLELMask (const ImageExpr< Bool > &expr) | |
Construct from the given image expression. | |
WCLELMask (const LatticeExpr< Bool > &expr) | |
Construct from the given lattice expression. | |
WCLELMask (const LatticeExprNode &expr) | |
Construct from the given lattice expression. | |
WCLELMask (const WCLELMask &other) | |
Copy constructor (copy semantics). | |
virtual | ~WCLELMask () |
Destructor. | |
WCLELMask & | operator= (const WCLELMask &other) |
Assignment (copy semantics) | |
virtual Bool | operator== (const WCRegion &other) const |
Comparison. | |
virtual WCRegion * | cloneRegion () const |
Clone a WCLELMask object. | |
virtual uInt | ndim () const |
Get the dimensionality (i.e. | |
virtual Bool | canExtend () const |
WCLELMask cannot extend a region. | |
virtual LCRegion * | toLCRegion (const CoordinateSystem &cSys, const IPosition &latticeShape) const |
Convert to an LCRegion using the given new coordinate system and shape. | |
virtual LCRegion * | doToLCRegion (const CoordinateSystem &cSys, const IPosition &latticeShape, const IPosition &pixelAxesMap, const IPosition &outOrder) const |
Convert to an LCRegion using the supplied CoordinateSystem and shape. | |
virtual TableRecord | toRecord (const String &tableName) const |
Convert the WCLELMask object to a record. | |
virtual String | type () const |
Return region type. | |
const ImageExpr< Bool > * | getImageExpr () const |
Static Public Member Functions | |
static WCLELMask * | fromRecord (const TableRecord &rec, const String &tableName) |
Convert to a WCLELMask from a record. | |
static String | className () |
Returns WCLELMask. | |
Private Member Functions | |
void | processCommand () |
Process the command. | |
void | init (const LatticeExprNode &expr) |
Initialize as a LatticeExprNode if expression's shape is unknown. | |
Private Attributes | |
String | itsCommand |
ImageExpr< Bool > * | itsImageExpr |
LatticeExpr< Bool > * | itsLattExpr |
LatticeExprNode * | itsLattNode |
Class to define a mask as a LEL expression.
Public interface
The WCLELMask class is a specialization of class WCRegion .
It can be used to define an on-the-fly mask for an image using a boolean LatticeExpr . The contents of the mask are calculated on the fly from the expression. Thus the mask may change if the data in the image(s) used in the expression change.
Caution: This mask is only persistent if constructed from an expression string; When constructed from an ImageExpr the mask is not persistent;
Users must be able to specify a mask based on an expression.
Definition at line 91 of file WCLELMask.h.
casa::WCLELMask::WCLELMask | ( | const String & | command | ) | [explicit] |
Construct from the given expression command.
The command will be parsed and converted to an ImageExpr.
casa::WCLELMask::WCLELMask | ( | const char * | command | ) | [explicit] |
casa::WCLELMask::WCLELMask | ( | const ImageExpr< Bool > & | expr | ) | [explicit] |
Construct from the given image expression.
casa::WCLELMask::WCLELMask | ( | const LatticeExpr< Bool > & | expr | ) | [explicit] |
Construct from the given lattice expression.
casa::WCLELMask::WCLELMask | ( | const LatticeExprNode & | expr | ) | [explicit] |
Construct from the given lattice expression.
This constructor makes it possible to have an expression with an unknown shape (e.g. using LEL function INDEXIN). If the shape is known, the LatticeExprNode will be converted to a LatticeExpr<Bool>.
casa::WCLELMask::WCLELMask | ( | const WCLELMask & | other | ) |
Copy constructor (copy semantics).
virtual casa::WCLELMask::~WCLELMask | ( | ) | [virtual] |
Destructor.
virtual Bool casa::WCLELMask::canExtend | ( | ) | const [virtual] |
WCLELMask cannot extend a region.
Reimplemented from casa::WCRegion.
static String casa::WCLELMask::className | ( | ) | [static] |
Returns WCLELMask.
virtual WCRegion* casa::WCLELMask::cloneRegion | ( | ) | const [virtual] |
Clone a WCLELMask object.
Implements casa::WCRegion.
virtual LCRegion* casa::WCLELMask::doToLCRegion | ( | const CoordinateSystem & | cSys, |
const IPosition & | latticeShape, | ||
const IPosition & | pixelAxesMap, | ||
const IPosition & | outOrder | ||
) | const [virtual] |
Convert to an LCRegion using the supplied CoordinateSystem
and shape.
It checks that coordinates match and that axes are not swapped.
Implements casa::WCRegion.
static WCLELMask* casa::WCLELMask::fromRecord | ( | const TableRecord & | rec, |
const String & | tableName | ||
) | [static] |
Convert to a WCLELMask from a record.
Reimplemented from casa::WCRegion.
const ImageExpr<Bool>* casa::WCLELMask::getImageExpr | ( | ) | const [inline] |
Definition at line 168 of file WCLELMask.h.
References itsImageExpr.
void casa::WCLELMask::init | ( | const LatticeExprNode & | expr | ) | [private] |
Initialize as a LatticeExprNode if expression's shape is unknown.
Otherwise as a LatticeExpr<Bool> if coordinates are unknown. Otherwise as an ImageExpr<Bool>.
virtual uInt casa::WCLELMask::ndim | ( | ) | const [virtual] |
Comparison.
Reimplemented from casa::WCRegion.
void casa::WCLELMask::processCommand | ( | ) | [private] |
Process the command.
virtual LCRegion* casa::WCLELMask::toLCRegion | ( | const CoordinateSystem & | cSys, |
const IPosition & | latticeShape | ||
) | const [virtual] |
Convert to an LCRegion using the given new coordinate system and shape.
If the region has coordinates, the WCRegion implementation will be called. Otherwise the LatticeExpr is returned after checking that the shape matches.
Reimplemented from casa::WCRegion.
virtual TableRecord casa::WCLELMask::toRecord | ( | const String & | tableName | ) | const [virtual] |
Convert the WCLELMask object to a record.
The record can be used to make the object persistent. The tableName
argument can be used by derived classes (e.g. LCPagedMask) to put very large objects.
Implements casa::WCRegion.
virtual String casa::WCLELMask::type | ( | ) | const [virtual] |
String casa::WCLELMask::itsCommand [private] |
Definition at line 180 of file WCLELMask.h.
ImageExpr<Bool>* casa::WCLELMask::itsImageExpr [private] |
Definition at line 181 of file WCLELMask.h.
Referenced by getImageExpr().
LatticeExpr<Bool>* casa::WCLELMask::itsLattExpr [private] |
Definition at line 182 of file WCLELMask.h.
LatticeExprNode* casa::WCLELMask::itsLattNode [private] |
Definition at line 183 of file WCLELMask.h.