MIRIADImage.h

Classes

MIRIADImage -- Class providing native access to MIRIAD images. (full description)

class MIRIADImage: public ImageInterface<Float>

Interface

Public Members
explicit MIRIADImage(const String& name)
MIRIADImage(const String& name, const MaskSpecifier&)
MIRIADImage(const MIRIADImage& other)
~MIRIADImage()
MIRIADImage& operator=(const MIRIADImage& other)
static LatticeBase* openMIRIADImage (const String& name, const MaskSpecifier&)
static void registerOpenFunction()
virtual ImageInterface<Float>* cloneII() const
virtual String imageType() const
virtual void resize(const TiledShape& newShape)
virtual Bool setUnits(const Unit& newUnits)
virtual Unit units() const
virtual const RecordInterface &miscInfo() const
virtual Bool setMiscInfo(const RecordInterface &newInfo)
virtual Bool isMasked() const
virtual Bool hasPixelMask() const
virtual const Lattice<Bool>& pixelMask() const
virtual Lattice<Bool>& pixelMask()
virtual Bool doGetMaskSlice (Array<Bool>& buffer, const Slicer& section)
virtual const LatticeRegion* getRegionPtr() const
virtual Bool doGetSlice (Array<Float>& buffer, const Slicer& theSlice)
virtual void doPutSlice (const Array<Float>& sourceBuffer, const IPosition& where, const IPosition& stride)
virtual Bool isPaged() const
virtual Bool isPersistent() const
virtual Bool isWritable() const
virtual String name (Bool stripPath=False) const
virtual IPosition shape() const
virtual uInt advisedMaxPixels() const
virtual IPosition doNiceCursorShape (uInt maxPixels) const
virtual void tempClose()
virtual void reopen()
virtual Bool ok() const
DataType dataType () const
virtual uInt maximumCacheSize() const
virtual void setMaximumCacheSize (uInt howManyPixels)
virtual void setCacheSizeFromPath (const IPosition& sliceShape, const IPosition& windowStart, const IPosition& windowLength, const IPosition& axisPath)
virtual void setCacheSizeInTiles (uInt howManyTiles)
virtual void clearCache()
virtual void showCacheStatistics (ostream& os) const
Private Members
void reopenIfNeeded() const
void setup()
void open()
void getImageAttributes (CoordinateSystem& cSys, IPosition& shape, ImageInfo& info, Unit& brightnessUnit, Record& miscInfo, Bool& hasBlanks, const String& name)
void crackHeader (CoordinateSystem& cSys, IPosition& shape, ImageInfo& imageInfo, Unit& brightnessUnit, Record& miscInfo, LogIO&os)

Description

Review Status

Programs:
Tests:

Prerequisite

Etymology

This class provides native access to MIRIAD images.

Synopsis

A MIRIADImage provides native access to MIRIAD images by accessing them with the TiledFileAccess class. -- or -- the native miriad I/O routines. The MIRIADImage is read only. -- really -- ??

Example

    MIRIADImage im("cube1"); 
    LogIO logger(or);
    ImageStatistics<Float> stats(im, logger);
    Bool ok = stats.display();                              // Display statistics

Motivation

This provides native access to MIRIAD images.

Member Description

explicit MIRIADImage(const String& name)

Construct a MIRIADImage from the disk MIRIAD dataset name and apply mask.

MIRIADImage(const String& name, const MaskSpecifier&)

Construct a MIRIADImage from the disk MIRIAD file name and apply mask or not.

MIRIADImage(const MIRIADImage& other)

Copy constructor (reference semantics)

~MIRIADImage()

Destructor does nothing

MIRIADImage& operator=(const MIRIADImage& other)

Assignment (reference semantics)

static LatticeBase* openMIRIADImage (const String& name, const MaskSpecifier&)

Function to open a MIRIAD image.

static void registerOpenFunction()

Register the open function.

virtual ImageInterface<Float>* cloneII() const

Make a copy of the object with new (reference semantics).

virtual String imageType() const

Get the image type (returns MIRIADImage).

virtual void resize(const TiledShape& newShape)

Function which changes the shape of the MIRIADImage. Throws an exception as MIRIADImage is not writable.

virtual Bool setUnits(const Unit& newUnits)
virtual Unit units() const

Functions which get and set the units associated with the image pixels (i.e. the "brightness" unit). Initially the unit is empty. Although the MIRIADimage is not writable, you can change the unit in the MIRIADImage object, but it will not be changed in the MIRIAD disk file.

virtual const RecordInterface &miscInfo() const
virtual Bool setMiscInfo(const RecordInterface &newInfo)

Often we have miscellaneous information we want to attach to an image. Although MIRIADImage is not writable, you can set a new MiscInfo record, but it will not be stored with the MIRIAD file

virtual Bool isMasked() const

Has the object really a mask? The MIRIADImage always has a pixel mask and never has a region mask so this should always return True

virtual Bool hasPixelMask() const

MIRIADimage always has a pixel mask so should return True

virtual const Lattice<Bool>& pixelMask() const
virtual Lattice<Bool>& pixelMask()

Get access to the pixelmask. MIRIADImage always has a pixel mask.

virtual Bool doGetMaskSlice (Array<Bool>& buffer, const Slicer& section)

Do the actual get of the mask data. The return value is always False, thus the buffer does not reference another array.

virtual const LatticeRegion* getRegionPtr() const

Get the region used. There is no region. Always returns 0.

virtual Bool doGetSlice (Array<Float>& buffer, const Slicer& theSlice)

Do the actual get of the data. Returns False as the data do not reference another Array

virtual void doPutSlice (const Array<Float>& sourceBuffer, const IPosition& where, const IPosition& stride)

The MIRIADImage is not writable, so this throws an exception.

virtual Bool isPaged() const

The lattice is paged to disk.

virtual Bool isPersistent() const

The lattice is persistent.

virtual Bool isWritable() const

The MIRIADImage is not writable.

virtual String name (Bool stripPath=False) const

Returns the name of the disk file.

virtual IPosition shape() const

return the shape of the MIRIADImage

virtual uInt advisedMaxPixels() const

Returns the maximum recommended number of pixels for a cursor. This is the number of pixels in a tile.

virtual IPosition doNiceCursorShape (uInt maxPixels) const

Help the user pick a cursor for most efficient access if they only want pixel values and don't care about the order or dimension of the cursor.

virtual void tempClose()

Temporarily close the image.

virtual void reopen()

Reopen a temporarily closed image.

virtual Bool ok() const

Check class invariants.

DataType dataType () const

Return the (internal) data type (TpFloat or TpShort).

virtual uInt maximumCacheSize() const

Maximum size - not necessarily all used. In pixels.

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

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.

void reopenIfNeeded() const

Reopen the image if needed.

void setup()

Setup the object (used by constructors).

void open()

Open the image (used by setup and reopen).

void getImageAttributes (CoordinateSystem& cSys, IPosition& shape, ImageInfo& info, Unit& brightnessUnit, Record& miscInfo, Bool& hasBlanks, const String& name)

Fish things out of the MIRIAD file

void crackHeader (CoordinateSystem& cSys, IPosition& shape, ImageInfo& imageInfo, Unit& brightnessUnit, Record& miscInfo, LogIO&os)