LELRegion.h

Classes

LELRegion -- Class to hold a region as a LEL node (full description)
LELRegionAsBool -- Class to convert a region to a boolean node (full description)

class LELRegion : public LELInterface<Bool>

Interface

Public Members
LELRegion (const LattRegionHolder& region)
LELRegion (LattRegionHolder* region)
~LELRegion()
const LattRegionHolder& region() const
virtual void eval(LELArray<Bool>&, const Slicer&) const
virtual LELScalar<Bool> getScalar() const
virtual Bool prepareScalarExpr()
virtual String className() const
static LELRegion* makeUnion (const LELInterface<Bool>& left, const LELInterface<Bool>& right)
static LELRegion* makeIntersection (const LELInterface<Bool>& left, const LELInterface<Bool>& right)
static LELRegion* makeDifference (const LELInterface<Bool>& left, const LELInterface<Bool>& right)
static LELRegion* makeComplement (const LELInterface<Bool>& expr)
Private Members
static const LattRegionHolder& region (const LELInterface<Bool>& expr)
static void checkTypes (const LattRegionHolder& left, const LattRegionHolder& right)

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

This derived LEL letter class handles regions.

Synopsis

This LEL letter class is derived from LELInterface. It is used to construct LEL objects from regions. The internal region is an ImageRegion object, thus the region can be of any type. With operator [] a region is applied to an image (expression). At that stage possible world coordinates are converted to lattice coordinates.

The attributes of a LELRegion object define an empty shape, because in general the shape of a region is only known after it is applied to an image.

A description of the implementation details of the LEL classes can be found in Note 216

Motivation

We needed to be able to handle regions in a LEL expression.

Member Description

LELRegion (const LattRegionHolder& region)

Constructor.

LELRegion (LattRegionHolder* region)

Constructor. It takes over the pointer.

~LELRegion()

Destructor.

const LattRegionHolder& region() const

Get a pointer to the region object.

virtual void eval(LELArray<Bool>&, const Slicer&) const

Getting region data cannot be done (throws an exception).

virtual LELScalar<Bool> getScalar() const

Getting region data cannot be done (throws an exception).

virtual Bool prepareScalarExpr()

Do further preparations (e.g. optimization) on the expression.

virtual String className() const

Get class name

static LELRegion* makeUnion (const LELInterface<Bool>& left, const LELInterface<Bool>& right)
static LELRegion* makeIntersection (const LELInterface<Bool>& left, const LELInterface<Bool>& right)
static LELRegion* makeDifference (const LELInterface<Bool>& left, const LELInterface<Bool>& right)
static LELRegion* makeComplement (const LELInterface<Bool>& expr)

Form a compound from the regions.

static const LattRegionHolder& region (const LELInterface<Bool>& expr)

Get the LattRegionHolder after checking that the expression is a region.

static void checkTypes (const LattRegionHolder& left, const LattRegionHolder& right)

Check if both regions have the same type (pixel or world) and if no LCSlicer type of region is used.


class LELRegionAsBool : public LELInterface<Bool>

Interface

Public Members
LELRegionAsBool (const LELRegion& region)
~LELRegionAsBool()
virtual void eval(LELArray<Bool>& result, const Slicer& section) const
virtual LELScalar<Bool> getScalar() const
virtual Bool prepareScalarExpr()
virtual String className() const

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

This derived LEL letter class handles a region as a boolean lattice.

Synopsis

This class makes it possible to handle a region as a true boolean lattice without the need to apply the region to an image. It means that it is only possible if the region has absolute lattice coordinates.

A description of the implementation details of the LEL classes can be found in Note 216

Motivation

It is useful to be able to handle a mask as a boolean lattice.

Member Description

LELRegionAsBool (const LELRegion& region)

Constructor.

~LELRegionAsBool()

Destructor.

virtual void eval(LELArray<Bool>& result, const Slicer& section) const

Get region data.

virtual LELScalar<Bool> getScalar() const

Getting region data as a scalar cannot be done (throws an exception).

virtual Bool prepareScalarExpr()

Do further preparations (e.g. optimization) on the expression.

virtual String className() const

Get class name