WCLELMask.h

Classes

WCLELMask -- Class to define a mask as a LEL expression (full description)

class WCLELMask : public WCRegion

Interface

Public Members
WCLELMask()
explicit WCLELMask (const String& command)
explicit WCLELMask (const char* command)
explicit WCLELMask (const ImageExpr<Bool>& expr)
explicit WCLELMask (const LatticeExpr<Bool>& expr)
explicit WCLELMask (const LatticeExprNode& expr)
WCLELMask (const WCLELMask& other)
virtual ~WCLELMask()
WCLELMask& operator= (const WCLELMask& other)
virtual Bool operator== (const WCRegion& other) const
virtual WCRegion* cloneRegion() const
virtual uInt ndim() const
virtual Bool canExtend() const
virtual LCRegion* toLCRegion (const CoordinateSystem& cSys, const IPosition& latticeShape) const
virtual LCRegion* doToLCRegion (const CoordinateSystem& cSys, const IPosition& latticeShape, const IPosition& pixelAxesMap, const IPosition& outOrder) const
virtual TableRecord toRecord (const String& tableName) const
static WCLELMask* fromRecord (const TableRecord& rec, const String& tableName)
static String className()
virtual String type() const
Private Members
void processCommand()
void init (const LatticeExprNode& expr)

Description

Prerequisite

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.

Member Description

WCLELMask()

explicit WCLELMask (const String& command)
explicit WCLELMask (const char* command)

Construct from the given expression command. The command will be parsed and converted to an ImageExpr.

explicit WCLELMask (const ImageExpr<Bool>& expr)

Construct from the given image expression.

explicit WCLELMask (const LatticeExpr<Bool>& expr)

Construct from the given lattice expression.

explicit WCLELMask (const LatticeExprNode& expr)

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.

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. the number of axes).

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. If the region has coordinates, the WCRegion implementation will be called. Otherwise the LatticeExpr is returned after checking that the shape matches.

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. It checks that coordinates match and that axes are not swapped.

virtual TableRecord toRecord (const String& tableName) const

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.

static WCLELMask* fromRecord (const TableRecord& rec, const String& tableName)

Convert to a WCLELMask from a record.

static String className()

Returns WCLELMask

virtual String type() const

Return region type. Returns the class name

void processCommand()

Process the command.

void init (const LatticeExprNode& expr)

Initialize as a LatticeExprNode if expression's shape is unknown. Otherwise as a LatticeExpr if coordinates are unknown. Otherwise as an ImageExpr.