casa
$Rev:20696$
|
Class to define a rectangular mask as a temporary region. More...
#include <LCMask.h>
Public Member Functions | |
LCMask () | |
LCMask (const IPosition &latticeShape) | |
Construct an LCMask object for a full lattice with the given shape. | |
LCMask (Lattice< Bool > &mask) | |
Construct an LCMask object for a full lattice with the shape of the mask. | |
LCMask (const IPosition &maskShape, const LCBox &box) | |
Construct an LCMask object for the part of a lattice given by the box. | |
LCMask (Lattice< Bool > &mask, const LCBox &box) | |
Construct an LCMask object for the part of a lattice given by the box. | |
LCMask (const LCMask &other) | |
Copy constructor (copy semantics). | |
virtual | ~LCMask () |
Destructor. | |
LCMask & | operator= (const LCMask &other) |
Assignment (reference semantics). | |
virtual Bool | operator== (const LCRegion &other) const |
Comparison. | |
virtual LCRegion * | cloneRegion () const |
Make a copy of the derived object. | |
virtual LatticeIterInterface < Bool > * | makeIter (const LatticeNavigator &navigator, Bool useRef) const |
This function is used by the LatticeIterator class to generate an iterator of the correct type for this Lattice. | |
virtual uInt | advisedMaxPixels () const |
Returns the maximum recommended number of pixels for a cursor. | |
virtual IPosition | doNiceCursorShape (uInt maxPixels) const |
Help the user pick a cursor for most efficient access. | |
virtual uInt | maximumCacheSize () const |
Maximum size - not necessarily all used. | |
virtual void | setMaximumCacheSize (uInt howManyPixels) |
Set the maximum (allowed) cache size as indicated. | |
virtual void | setCacheSizeFromPath (const IPosition &sliceShape, const IPosition &windowStart, const IPosition &windowLength, const IPosition &axisPath) |
Set the cache size as to "fit" the indicated path. | |
virtual void | setCacheSizeInTiles (uInt howManyTiles) |
Set the actual cache size for this Array to be be big enough for the indicated number of tiles. | |
virtual void | clearCache () |
Clears and frees up the caches, but the maximum allowed cache size is unchanged from when setCacheSize was called. | |
virtual void | showCacheStatistics (ostream &os) const |
Report on cache success. | |
virtual Bool | lock (FileLocker::LockType, uInt nattempts) |
Handle the (un)locking. | |
virtual void | unlock () |
virtual Bool | hasLock (FileLocker::LockType) const |
virtual void | resync () |
Resynchronize the object with the contenta tof the possible file. | |
virtual void | flush () |
Flush the data (but do not unlock). | |
virtual void | tempClose () |
Temporarily close the lattice. | |
virtual void | reopen () |
Explicitly reopen the temporarily closed lattice. | |
virtual String | type () const |
Region type. | |
virtual TableRecord | toRecord (const String &tableName) const |
Convert the (derived) object to a record. | |
virtual Bool | isWritable () const |
An LCMask is writable if the underlying Lattice is. | |
Static Public Member Functions | |
static String | className () |
Get the class name (to store in the record). | |
Protected Member Functions | |
virtual LCRegion * | doTranslate (const Vector< Float > &translateVector, const IPosition &newLatticeShape) const |
Construct another LCMask (for e.g. | |
Private Attributes | |
LCBox | itsBox |
Lattice< Bool > * | itsMask |
Class to define a rectangular mask as a temporary region.
Public interface
The LCMask class is a specialization of class LCRegion .
It can be used to define a temporary mask (e.g. for a TempImage ). It is possible to define the mask for the full lattice, but one can also define it for part of a lattice. In the latter case a LCBox has to be given as well to define for which part of the image the mask has to be used.
casa::LCMask::LCMask | ( | const IPosition & | latticeShape | ) | [explicit] |
Construct an LCMask object for a full lattice with the given shape.
It creates a TempLattice<Bool> to hold the mask.
casa::LCMask::LCMask | ( | Lattice< Bool > & | mask | ) | [explicit] |
Construct an LCMask object for a full lattice with the shape of the mask.
It clones the mask object.
casa::LCMask::LCMask | ( | const IPosition & | maskShape, |
const LCBox & | box | ||
) |
Construct an LCMask object for the part of a lattice given by the box.
The box defines the position of the mask in the lattice. The box shape and given mask shape should be equal. It creates a TempImage<Bool> to hold the mask.
casa::LCMask::LCMask | ( | Lattice< Bool > & | mask, |
const LCBox & | box | ||
) |
Construct an LCMask object for the part of a lattice given by the box.
The box defines the position of the mask in the lattice. The box shape and given mask shape should be equal. It clones the mask object.
casa::LCMask::LCMask | ( | const LCMask & | other | ) |
Copy constructor (copy semantics).
virtual casa::LCMask::~LCMask | ( | ) | [virtual] |
Destructor.
virtual uInt casa::LCMask::advisedMaxPixels | ( | ) | const [virtual] |
Returns the maximum recommended number of pixels for a cursor.
This is the number of pixels in a tile.
Reimplemented from casa::Lattice< Bool >.
static String casa::LCMask::className | ( | ) | [static] |
Get the class name (to store in the record).
virtual void casa::LCMask::clearCache | ( | ) | [virtual] |
Clears and frees up the caches, but the maximum allowed cache size is unchanged from when setCacheSize was called.
Reimplemented from casa::LatticeBase.
virtual LCRegion* casa::LCMask::cloneRegion | ( | ) | const [virtual] |
Make a copy of the derived object.
Implements casa::LCRegion.
virtual IPosition casa::LCMask::doNiceCursorShape | ( | uInt | maxPixels | ) | const [virtual] |
Help the user pick a cursor for most efficient access.
Reimplemented from casa::LCRegionSingle.
virtual LCRegion* casa::LCMask::doTranslate | ( | const Vector< Float > & | translateVector, |
const IPosition & | newLatticeShape | ||
) | const [protected, virtual] |
Construct another LCMask (for e.g.
another lattice) by moving this one. It recalculates the bounding mask. A positive translation value indicates "to right".
Implements casa::LCRegion.
virtual void casa::LCMask::flush | ( | ) | [virtual] |
Flush the data (but do not unlock).
Reimplemented from casa::LatticeBase.
virtual Bool casa::LCMask::hasLock | ( | FileLocker::LockType | ) | const [virtual] |
Reimplemented from casa::LatticeBase.
virtual Bool casa::LCMask::isWritable | ( | ) | const [virtual] |
An LCMask is writable if the underlying Lattice is.
Reimplemented from casa::LCRegion.
virtual Bool casa::LCMask::lock | ( | FileLocker::LockType | , |
uInt | nattempts | ||
) | [virtual] |
Handle the (un)locking.
Reimplemented from casa::LatticeBase.
virtual LatticeIterInterface<Bool>* casa::LCMask::makeIter | ( | const LatticeNavigator & | navigator, |
Bool | useRef | ||
) | const [virtual] |
This function is used by the LatticeIterator class to generate an iterator of the correct type for this Lattice.
Not recommended for general use.
Reimplemented from casa::LCRegionSingle.
virtual uInt casa::LCMask::maximumCacheSize | ( | ) | const [virtual] |
Comparison.
Reimplemented from casa::LCRegion.
virtual void casa::LCMask::reopen | ( | ) | [virtual] |
Explicitly reopen the temporarily closed lattice.
Reimplemented from casa::LatticeBase.
virtual void casa::LCMask::resync | ( | ) | [virtual] |
Resynchronize the object with the contenta tof the possible file.
This function is only useful if no read-locking is used, ie. if the table lock option is UserNoReadLocking or AutoNoReadLocking. In that cases the table system does not acquire a read-lock, thus does not synchronize itself automatically.
Reimplemented from casa::LatticeBase.
virtual void casa::LCMask::setCacheSizeFromPath | ( | const IPosition & | sliceShape, |
const IPosition & | windowStart, | ||
const IPosition & | windowLength, | ||
const IPosition & | axisPath | ||
) | [virtual] |
Set the cache size as to "fit" the indicated path.
Reimplemented from casa::LatticeBase.
virtual void casa::LCMask::setCacheSizeInTiles | ( | uInt | howManyTiles | ) | [virtual] |
Set the actual cache size for this Array to be be big enough for the indicated number of tiles.
This cache is not shared with PagedArrays in other rows and is always clipped to be less than the maximum value set using the setMaximumCacheSize member function. tiles. Tiles are cached using a first in first out algorithm.
Reimplemented from casa::LatticeBase.
virtual void casa::LCMask::setMaximumCacheSize | ( | uInt | howManyPixels | ) | [virtual] |
Set the maximum (allowed) cache size as indicated.
Reimplemented from casa::LatticeBase.
virtual void casa::LCMask::showCacheStatistics | ( | ostream & | os | ) | const [virtual] |
Report on cache success.
Reimplemented from casa::LatticeBase.
virtual void casa::LCMask::tempClose | ( | ) | [virtual] |
Temporarily close the lattice.
It will be reopened automatically on the next access.
Reimplemented from casa::LatticeBase.
virtual TableRecord casa::LCMask::toRecord | ( | const String & | tableName | ) | const [virtual] |
Convert the (derived) object to a record.
This cannot be done and results in an exception.
Implements casa::LCRegion.
virtual String casa::LCMask::type | ( | ) | const [virtual] |
virtual void casa::LCMask::unlock | ( | ) | [virtual] |
Reimplemented from casa::LatticeBase.
LCBox casa::LCMask::itsBox [private] |
Lattice<Bool>* casa::LCMask::itsMask [private] |