LattRegionHolder.h

Classes

LattRegionHolder -- Class to hold a region of interest in an image. (full description)

class LattRegionHolder

Interface

Public Members
LattRegionHolder (const LCRegion&)
LattRegionHolder (const LCSlicer&)
explicit LattRegionHolder (LCRegion*)
explicit LattRegionHolder (LCSlicer*)
LattRegionHolder (const LattRegionHolder& other)
virtual ~LattRegionHolder()
LattRegionHolder& operator= (const LattRegionHolder& other)
virtual LattRegionHolder* clone() const
virtual Bool operator==(const LattRegionHolder& other) const
Bool operator!=(const LattRegionHolder& other) const
Bool isLCRegion() const
Bool isLCSlicer() const
virtual Bool isWCRegion() const
const LCRegion* asLCRegionPtr() const
const LCSlicer* asLCSlicerPtr() const
virtual const WCRegion* asWCRegionPtr() const
uInt ndim() const
LatticeRegion toLatticeRegion (const IPosition& shape) const
virtual LatticeRegion toLatticeRegion (const CoordinateSystem& cSys, const IPosition& shape) const
virtual LattRegionHolder* makeUnion (const LattRegionHolder& other) const
virtual LattRegionHolder* makeIntersection (const LattRegionHolder& other) const
virtual LattRegionHolder* makeDifference (const LattRegionHolder& other) const
virtual LattRegionHolder* makeComplement() const
Protected Members
explicit LattRegionHolder (uInt ndim)

Description

Prerequisite

Synopsis

The only purpose of LattRegionHolder is to have a single object for the various kinds of regions. It can hold a LCRegion, and LCSlicer.

Example


 

Motivation

It was felt that making an abstract base class LatticeRegion for LCRegion and WCRegion would create undesirable dependencies of module Lattices on module Coordinates. E.g. it would be impossible to have a function toWCRegion. Therefore the container class LattRegionHolder is chosen, from which the container ImageRegion is derived.

Member Description

LattRegionHolder (const LCRegion&)

Construct from a region based on lattice coordinates.

LattRegionHolder (const LCSlicer&)

Construct from a slicer based on lattice coordinates.

explicit LattRegionHolder (LCRegion*)
explicit LattRegionHolder (LCSlicer*)

Similar constructors as above, but using a pointer. It takes over the pointer, so the user should not delete the object. It is deleted by the LattRegionHolder destructor.

LattRegionHolder (const LattRegionHolder& other)

Copy constructor (copy semantics).

virtual ~LattRegionHolder()

LattRegionHolder& operator= (const LattRegionHolder& other)

Assignment (copy semantics).

virtual LattRegionHolder* clone() const

Clone the object.

virtual Bool operator==(const LattRegionHolder& other) const
Bool operator!=(const LattRegionHolder& other) const

Comparison

Bool isLCRegion() const
Bool isLCSlicer() const
virtual Bool isWCRegion() const

Test if the underlying region is an LCRegion, etc..

const LCRegion* asLCRegionPtr() const
const LCSlicer* asLCSlicerPtr() const
virtual const WCRegion* asWCRegionPtr() const

Get the region as a pointer to a LCRegion, LCSlicer, or WCRegion. An exception is thrown if the region is not the correct type. Functions isWCRegion(), etc. can be used to test the type.

uInt ndim() const

Get the dimensionality.

LatticeRegion toLatticeRegion (const IPosition& shape) const

Convert to a LatticeRegion using the given shape.

virtual LatticeRegion toLatticeRegion (const CoordinateSystem& cSys, const IPosition& shape) const

Convert to a LatticeRegion using the given coordinate system (with reference pixel) and shape. It will also make the region complete (absolute and non-fractional).

virtual LattRegionHolder* makeUnion (const LattRegionHolder& other) const
virtual LattRegionHolder* makeIntersection (const LattRegionHolder& other) const
virtual LattRegionHolder* makeDifference (const LattRegionHolder& other) const
virtual LattRegionHolder* makeComplement() const

Form a compound from this and the other region.

explicit LattRegionHolder (uInt ndim)

Construct for the given dimensionality (for derived classes).