ImageRegion.h
Classes
- ImageRegion -- Class to hold a region of interest in an image. (full description)
Interface
- Public Members
- ImageRegion()
- ImageRegion (const LCRegion&)
- ImageRegion (const LCSlicer&)
- ImageRegion (const WCRegion&)
- explicit ImageRegion (LCRegion*)
- explicit ImageRegion (LCSlicer*)
- explicit ImageRegion (WCRegion*)
- ImageRegion (const ImageRegion& other)
- virtual ~ImageRegion()
- ImageRegion& operator= (const ImageRegion& other)
- virtual ImageRegion* clone() const
- virtual Bool operator==(const LattRegionHolder& other) const
- virtual Bool isWCRegion() const
- virtual const WCRegion* asWCRegionPtr() const
- const LCRegion& asLCRegion() const
- const LCSlicer& asLCSlicer() const
- const WCRegion& asWCRegion() const
- LCRegion& asMask()
- virtual LatticeRegion toLatticeRegion (const CoordinateSystem& cSys, const IPosition& shape) const
- LCRegion* toLCRegion (const CoordinateSystem& cSys, const IPosition& shape) const
- TableRecord toRecord (const String& tableName) const
- static ImageRegion* fromRecord (const TableRecord&, const String& tableName)
- 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
Prerequisite
Synopsis
The only purpose of ImageRegion is to have a single object for
the various kinds of regions. It can hold a
LCRegion,
LCSlicer, and
WCRegion.
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 ImageRegion is chosen.
Member Description
Default constructor (has no region at all).
Construct from a region based on lattice coordinates.
Construct from a slicer based on lattice coordinates.
Construct from a region based on world coordinates.
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 ImageRegion destructor.
ImageRegion (const ImageRegion& other)
Copy constructor (copy semantics).
ImageRegion& operator= (const ImageRegion& other)
Assignment (copy semantics).
virtual ImageRegion* clone() const
Clone the object.
Comparison
virtual Bool isWCRegion() const
Test if the underlying region is an WCRegion.
Get the region as a pointer to WCRegion.
An exception is thrown if the region is not the correct type.
Functions isWCRegion() can be used to test the type.
Get the region as an 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.
Get the region as a writable mask.
It throws an exception if the region is not an LCRegion or if
its mask is not writable.
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).
Convert to an LCRegion using the given coordinate system
(with reference pixel) and shape.
It will also make the region complete (absolute and non-fractional).
An exception is thrown if the region type is a LCSlicer.
The axes argument tells which axes to use from the coordinate
system and shape.
Convert the (derived) object to a record.
The record can be used to make the object persistent.
Convert correct object from a record.
Form a compound from this and the other region.