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

More...

`#include <ImageRegion.h>`

## Public Member Functions

| ImageRegion ()
| Default constructor (has no region at all).
| ImageRegion (const LCRegion &)
| Construct from a region based on lattice coordinates.
| ImageRegion (const LCSlicer &)
| Construct from a slicer based on lattice coordinates.
| ImageRegion (const WCRegion &)
| Construct from a region based on world coordinates.
| ImageRegion (LCRegion *)
| Similar constructors as above, but using a pointer.
| ImageRegion (LCSlicer *)
| ImageRegion (WCRegion *)
| ImageRegion (const ImageRegion &other)
| Copy constructor (copy semantics).
virtual | ~ImageRegion ()
ImageRegion & | operator= (const ImageRegion &other)
| Assignment (copy semantics).
virtual ImageRegion * | clone () const
| Clone the object.
virtual Bool | operator== (const LattRegionHolder &other) const
| Comparison.
virtual Bool | isWCRegion () const
| Test if the underlying region is an WCRegion.
virtual const WCRegion * | asWCRegionPtr () const
| Get the region as a pointer to WCRegion.
const LCRegion & | asLCRegion () const
| Get the region as an LCSlicer or WCRegion.
const LCSlicer & | asLCSlicer () const
const WCRegion & | asWCRegion () const
LCRegion & | asMask ()
| Get the region as a writable mask.
virtual LatticeRegion | toLatticeRegion (const CoordinateSystem &cSys, const IPosition &shape) const
| Convert to a LatticeRegion using the given coordinate system (with reference pixel) and shape.
LCRegion * | toLCRegion (const CoordinateSystem &cSys, const IPosition &shape) const
| Convert to an LCRegion using the given coordinate system (with reference pixel) and shape.
TableRecord | toRecord (const String &tableName) const
| Convert the (derived) object to a record.
virtual LattRegionHolder * | makeUnion (const LattRegionHolder &other) const
| Form a compound from this and the other region.
virtual LattRegionHolder * | makeIntersection (const LattRegionHolder &other) const
virtual LattRegionHolder * | makeDifference (const LattRegionHolder &other) const
virtual LattRegionHolder * | makeComplement () const
Public Member Functions inherited from casacore::LattRegionHolder
| LattRegionHolder (const LCRegion &)
| Construct from a region based on lattice coordinates.
| LattRegionHolder (const LCSlicer &)
| Construct from a slicer based on lattice coordinates.
| LattRegionHolder (LCRegion *)
| Similar constructors as above, but using a pointer.
| LattRegionHolder (LCSlicer *)
| LattRegionHolder (const LattRegionHolder &other)
| Copy constructor (copy semantics).
virtual | ~LattRegionHolder ()
LattRegionHolder & | operator= (const LattRegionHolder &other)
| Assignment (copy semantics).
Bool | operator!= (const LattRegionHolder &other) const
Bool | isLCRegion () const
| Test if the underlying region is an LCRegion, etc.
Bool | isLCSlicer () const
const LCRegion * | asLCRegionPtr () const
| Get the region as a pointer to a LCRegion, LCSlicer, or WCRegion.
const LCSlicer * | asLCSlicerPtr () const
uInt | ndim () const
| Get the dimensionality.
LatticeRegion | toLatticeRegion (const IPosition &shape) const
| Convert to a LatticeRegion using the given shape.

## Static Public Member Functions

static ImageRegion * | fromLatticeExpression (const String &latticeExpression)
| Create an ImageRegion from a lattice expression.
static ImageRegion * | fromRecord (LogIO *logger, const CoordinateSystem &coords, const IPosition &imShape, const Record &regionRecord)
| Create an ImageRegion from a record.
static ImageRegion * | fromRecord (const TableRecord &, const String &tableName)
| Convert correct object from a record.

## Private Attributes

WCRegion * | itsWC

## Additional Inherited Members

Protected Member Functions inherited from casacore::LattRegionHolder
| LattRegionHolder (uInt ndim)
| Construct for the given dimensionality (for derived classes).

## Detailed Description

Class to hold a region of interest in an image.

### Intended use:

Public interface

### Prerequisite

- LCSlicer
- WCRegion

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

Definition at line 84 of file ImageRegion.h.

## Constructor & Destructor Documentation

## ImageRegion() [1/8]

casacore::ImageRegion::ImageRegion | ( |  | ) |

Default constructor (has no region at all).

Referenced by clone(), fromLatticeExpression(), fromRecord(), fromRecord(), ImageRegion(), and operator=().

## ImageRegion() [2/8]

casacore::ImageRegion::ImageRegion | ( | const LCRegion & |  | ) |

Construct from a region based on lattice coordinates.

## ImageRegion() [3/8]

casacore::ImageRegion::ImageRegion | ( | const LCSlicer & |  | ) |

Construct from a slicer based on lattice coordinates.

## ImageRegion() [4/8]

casacore::ImageRegion::ImageRegion | ( | const WCRegion & |  | ) |

Construct from a region based on world coordinates.

## ImageRegion() [5/8]

casacore::ImageRegion::ImageRegion | ( | LCRegion * |  | ) |

explicit

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() [6/8]

casacore::ImageRegion::ImageRegion | ( | LCSlicer * |  | ) |

explicit

## ImageRegion() [7/8]

casacore::ImageRegion::ImageRegion | ( | WCRegion * |  | ) |

explicit

## ImageRegion() [8/8]

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

Copy constructor (copy semantics).

References ImageRegion().

## ~ImageRegion()

virtual casacore::ImageRegion::~ImageRegion | ( |  | ) |

virtual

## Member Function Documentation

## asLCRegion()

const LCRegion & casacore::ImageRegion::asLCRegion | ( |  | ) | const

inline

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.

Definition at line 196 of file ImageRegion.h.

References casacore::LattRegionHolder::asLCRegionPtr().

## asLCSlicer()

const LCSlicer & casacore::ImageRegion::asLCSlicer | ( |  | ) | const

inline

Definition at line 201 of file ImageRegion.h.

References casacore::LattRegionHolder::asLCSlicerPtr().

## asMask()

LCRegion & casacore::ImageRegion::asMask | ( |  | ) |

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.

## asWCRegion()

const WCRegion & casacore::ImageRegion::asWCRegion | ( |  | ) | const

inline

Definition at line 206 of file ImageRegion.h.

References asWCRegionPtr().

## asWCRegionPtr()

virtual const WCRegion * casacore::ImageRegion::asWCRegionPtr | ( |  | ) | const

virtual

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.

Reimplemented from casacore::LattRegionHolder.

Referenced by asWCRegion().

## clone()

virtual ImageRegion * casacore::ImageRegion::clone | ( |  | ) | const

virtual

Clone the object.

Reimplemented from casacore::LattRegionHolder.

References ImageRegion().

## fromLatticeExpression()

ImageRegion * casacore::ImageRegion::fromLatticeExpression | ( | const String & | latticeExpression | ) |

static

Create an ImageRegion from a lattice expression.

Returned pointer is created via new(); it is the caller's responsibility to delete it.

References ImageRegion().

## fromRecord() [1/2]

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

static

Convert correct object from a record.

References ImageRegion().

## fromRecord() [2/2]

ImageRegion * casacore::ImageRegion::fromRecord | ( | LogIO * | logger,
|  | const CoordinateSystem & | coords,
|  | const IPosition & | imShape,
|  | const Record & | regionRecord )

static

Create an ImageRegion from a record.

The returned pointer is created via new(). It's the callers responsibility to delete it. If a null pointer is passed in for logger no logging is done, otherwise informational messages regarding bounding boxes are emitted to the logger object.

References ImageRegion(), and casacore::Record().

## isWCRegion()

virtual Bool casacore::ImageRegion::isWCRegion | ( |  | ) | const

virtual

Test if the underlying region is an WCRegion.

Reimplemented from casacore::LattRegionHolder.

## makeComplement()

virtual LattRegionHolder * casacore::ImageRegion::makeComplement | ( |  | ) | const

virtual

Reimplemented from casacore::LattRegionHolder.

References casacore::LattRegionHolder::LattRegionHolder().

## makeDifference()

virtual LattRegionHolder * casacore::ImageRegion::makeDifference | ( | const LattRegionHolder & | other | ) | const

virtual

Reimplemented from casacore::LattRegionHolder.

References casacore::LattRegionHolder::LattRegionHolder().

## makeIntersection()

virtual LattRegionHolder * casacore::ImageRegion::makeIntersection | ( | const LattRegionHolder & | other | ) | const

virtual

Reimplemented from casacore::LattRegionHolder.

References casacore::LattRegionHolder::LattRegionHolder().

## makeUnion()

virtual LattRegionHolder * casacore::ImageRegion::makeUnion | ( | const LattRegionHolder & | other | ) | const

virtual

Form a compound from this and the other region.

Reimplemented from casacore::LattRegionHolder.

References casacore::LattRegionHolder::LattRegionHolder().

## operator=()

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

Assignment (copy semantics).

References ImageRegion().

## operator==()

virtual Bool casacore::ImageRegion::operator== | ( | const LattRegionHolder & | other | ) | const

virtual

Comparison.

Reimplemented from casacore::LattRegionHolder.

References casacore::LattRegionHolder::LattRegionHolder().

## toLatticeRegion()

virtual LatticeRegion casacore::ImageRegion::toLatticeRegion | ( | const CoordinateSystem & | cSys,
|  | const IPosition & | shape ) const

virtual

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).

Reimplemented from casacore::LattRegionHolder.

References casacore::shape().

## toLCRegion()

LCRegion * casacore::ImageRegion::toLCRegion | ( | const CoordinateSystem & | cSys,
|  | const IPosition & | shape ) const

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.

References casacore::shape().

## toRecord()

TableRecord casacore::ImageRegion::toRecord | ( | const String & | tableName | ) | const

Convert the (derived) object to a record.

The record can be used to make the object persistent.

## Member Data Documentation

## itsWC

WCRegion* casacore::ImageRegion::itsWC

private

Definition at line 192 of file ImageRegion.h.

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

- images/Regions/ImageRegion.h