Loading...
Searching...
No Matches
casacore::WCLELMask Class Reference
images package (libcasa_images) » Regions_module

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
Public Member Functions inherited from casacore::WCRegion
| WCRegion ()
| WCRegion (const WCRegion &other)
| Copy constructor (copy semantics).
virtual | ~WCRegion ()
| Destructor.
Bool | operator!= (const WCRegion &other) const
const Record & | getAxesDesc () const
| Get the description of all axes.
const Record & | getAxisDesc (uInt axis) const
| Get the description of the given axis.
Int | axisNr (const Record &desc, const Record &axesDesc) const
| Return the axis number of the description of an axis in the full axes description.
Bool | isAxisDescEqual (const Record &desc1, const Record &desc2) const
| Are both axis descriptions equal?
const String & | comment () const
| Get or set the comment.
void | setComment (const String &comment)
LCRegion * | toLCRegionAxes (const CoordinateSystem &cSys, const IPosition &shape, const IPosition &pixelAxesMap, const IPosition &outOrder) const
| Convert to an LCRegion using the given coordinate system and shape.
void | defineRecordFields (RecordInterface &record, const String &className) const
| Define the type and class name in the record.

## 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.
Static Public Member Functions inherited from casacore::WCRegion
static WCRegion * | fromRecord (const TableRecord &rec, const String &tableName)
| Convert correct object from a record.

## 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

## Additional Inherited Members

Protected Member Functions inherited from casacore::WCRegion
WCRegion & | operator= (const WCRegion &other)
| Assignment (copy semantics) makes only sense for a derived class.
void | addAxisDesc (const Record &axisDesc)
| Add an axis with its description.
Record | makeAxisDesc (const CoordinateSystem &cSys, uInt pixelAxis) const
| Make a description of a pixel axis in the coordinate system.
Record | makeAxesDesc (const CoordinateSystem &cSys) const
| Make a description of all pixel axes in the coordinate system (in pixel axes order).
void | makeWorldAbsolute (Vector< Double > &world, const Vector< Int > &absRel, const CoordinateSystem &cSys, const IPosition &shape) const
| Convert relative to absolute world as needed.
void | checkAxes (const IPosition &pixelAxes, const CoordinateSystem &cSys, const Vector< String > &quantityUnits) const
Static Protected Member Functions inherited from casacore::WCRegion
static void | unitInit ()
static void | convertPixel (Double &pixel, const Double &value, const String &unit, const Int absRel, const Double refPix, const Int shape)

## Detailed Description

Class to define a mask as a LEL expression

### Intended use:

Public interface

### Prerequisite

- WCRegion
- ImageExpr

### Synopsis

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;

### Example

### Motivation

Users must be able to specify a mask based on an expression.

Definition at line 91 of file WCLELMask.h.

## Constructor & Destructor Documentation

## WCLELMask() [1/7]

casacore::WCLELMask::WCLELMask | ( |  | ) |

Referenced by fromRecord(), operator=(), and WCLELMask().

## WCLELMask() [2/7]

casacore::WCLELMask::WCLELMask | ( | const String & | command | ) |

explicit

Construct from the given expression command.

The command will be parsed and converted to an ImageExpr.

## WCLELMask() [3/7]

casacore::WCLELMask::WCLELMask | ( | const char * | command | ) |

explicit

## WCLELMask() [4/7]

casacore::WCLELMask::WCLELMask | ( | const ImageExpr< Bool > & | expr | ) |

explicit

Construct from the given image expression.

## WCLELMask() [5/7]

casacore::WCLELMask::WCLELMask | ( | const LatticeExpr< Bool > & | expr | ) |

explicit

Construct from the given lattice expression.

## WCLELMask() [6/7]

casacore::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>.

## WCLELMask() [7/7]

casacore::WCLELMask::WCLELMask | ( | const WCLELMask & | other | ) |

Copy constructor (copy semantics).

References WCLELMask().

## ~WCLELMask()

virtual casacore::WCLELMask::~WCLELMask | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## canExtend()

virtual Bool casacore::WCLELMask::canExtend | ( |  | ) | const

virtual

WCLELMask cannot extend a region.

Reimplemented from casacore::WCRegion.

## className()

String casacore::WCLELMask::className | ( |  | ) |

static

Returns WCLELMask.

## cloneRegion()

virtual WCRegion * casacore::WCLELMask::cloneRegion | ( |  | ) | const

virtual

Clone a WCLELMask object.

Implements casacore::WCRegion.

References casacore::WCRegion::WCRegion().

## doToLCRegion()

virtual LCRegion * casacore::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 casacore::WCRegion.

## fromRecord()

WCLELMask * casacore::WCLELMask::fromRecord | ( | const TableRecord & | rec,
|  | const String & | tableName )

static

Convert to a WCLELMask from a record.

References WCLELMask().

## getImageExpr()

const ImageExpr< Bool > * casacore::WCLELMask::getImageExpr | ( |  | ) | const

inline

Definition at line 168 of file WCLELMask.h.

References itsImageExpr.

## init()

void casacore::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>.

## ndim()

virtual uInt casacore::WCLELMask::ndim | ( |  | ) | const

virtual

Get the dimensionality (i.e.

the number of axes).

Reimplemented from casacore::WCRegion.

## operator=()

WCLELMask & casacore::WCLELMask::operator= | ( | const WCLELMask & | other | ) |

Assignment (copy semantics).

References WCLELMask().

## operator==()

virtual Bool casacore::WCLELMask::operator== | ( | const WCRegion & | other | ) | const

virtual

Comparison.

Reimplemented from casacore::WCRegion.

References casacore::WCRegion::WCRegion().

## processCommand()

void casacore::WCLELMask::processCommand | ( |  | ) |

private

Process the command.

## toLCRegion()

virtual LCRegion * casacore::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 casacore::WCRegion.

## toRecord()

virtual TableRecord casacore::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 casacore::WCRegion.

## type()

virtual String casacore::WCLELMask::type | ( |  | ) | const

virtual

Return region type.

Returns the class name

Implements casacore::WCRegion.

## Member Data Documentation

## itsCommand

String casacore::WCLELMask::itsCommand

private

Definition at line 180 of file WCLELMask.h.

## itsImageExpr

ImageExpr<Bool>* casacore::WCLELMask::itsImageExpr

private

Definition at line 181 of file WCLELMask.h.

Referenced by getImageExpr().

## itsLattExpr

LatticeExpr<Bool>* casacore::WCLELMask::itsLattExpr

private

Definition at line 182 of file WCLELMask.h.

## itsLattNode

LatticeExprNode* casacore::WCLELMask::itsLattNode

private

Definition at line 183 of file WCLELMask.h.

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

- images/Regions/WCLELMask.h