26#ifndef IMAGES_IMAGEINTERFACE_H
27#define IMAGES_IMAGEINTERFACE_H
31#include <casacore/casa/aips.h>
32#include <casacore/casa/Arrays/ArrayFwd.h>
33#include <casacore/images/Regions/RegionHandler.h>
34#include <casacore/images/Images/MaskSpecifier.h>
35#include <casacore/images/Images/ImageInfo.h>
36#include <casacore/images/Images/ImageAttrHandler.h>
37#include <casacore/lattices/Lattices/MaskedLattice.h>
38#include <casacore/coordinates/Coordinates/CoordinateSystem.h>
39#include <casacore/tables/LogTables/LoggerHolder.h>
40#include <casacore/tables/Tables/TableRecord.h>
41#include <casacore/casa/Quanta/Unit.h>
46template <
class T>
class LatticeIterInterface;
47template <
class T>
class COWPtr;
341 uInt startNumber = 1)
const;
403#ifndef CASACORE_NO_AUTO_TEMPLATES
404#include <casacore/images/Images/ImageInterface.tcc>
virtual void removeRegion(const String &name, RegionHandler::GroupType=RegionHandler::Any, Bool throwIfUnknown=True)
Remove a region/mask belonging to the image from the given group (which can be Any).
const LoggerHolder & logger() const
LogIO & logSink()
Allow messages to be logged to this ImageInterface.
void appendLog(const LoggerHolder &other)
Add the messages from the other image logger to this one.
void setCoordsMember(const CoordinateSystem &coords)
Set the coordinate system variable.
LoggerHolder & logger()
Get access to the LoggerHolder.
virtual ImageAttrHandler & attrHandler(Bool createHandler=False)
Get access to the attribute handler.
virtual Bool setUnits(const Unit &newUnits)
Function which get and set the units associated with the image pixels (i.e.
virtual ~ImageInterface()
ImageInfo & rwImageInfo()
Get non-const access to the ImageInfo.
ImageInterface(const RegionHandler ®ionHandler)
Construct for a specific region handler object.
void setLogMember(const LoggerHolder &logger)
Set the image logger variable.
virtual void resize(const TiledShape &newShape)=0
Function which changes the shape of the image (N.B.
virtual void defineRegion(const String &name, const ImageRegion ®ion, RegionHandler::GroupType, Bool overwrite=False)
Define a region/mask belonging to the image.
virtual ImageInterface< T > * cloneII() const =0
virtual Bool setImageInfo(const ImageInfo &info)
const LogIO & logSink() const
virtual const Unit & units() const
virtual String imageType() const =0
Get the image type (returns name of derived class).
virtual ImageRegion makeMask(const String &name, Bool defineAsRegion=True, Bool setAsDefaultMask=True, Bool initialize=False, Bool value=True)
Make a mask which is suitable for the type of image.
Bool canDefineRegion() const
Can the image handle region definition?
const ImageInfo & imageInfo() const
The ImageInfo object contains some miscellaneous information about the image which unlike that stored...
virtual MaskedLattice< T > * cloneML() const
Make a copy of the derived object (reference semantics).
ImageAttrHandler & roAttrHandler() const
ImageAttrHandler itsBaseAttrHandler
The attribute handling object.
virtual String name(Bool stripPath=False) const =0
Return the name of the current ImageInterface object.
RegionHandler * getRegionHandler()
Get access to the region handler.
virtual String getDefaultMask() const
Get the name of the default pixelmask.
ImageRegion getRegion(const String ®ionName, RegionHandler::GroupType=RegionHandler::Any) const
Get a region belonging to the image.
virtual ImageRegion * getImageRegionPtr(const String &name, RegionHandler::GroupType=RegionHandler::Any, Bool throwIfUnknown=True) const
Get a region/mask belonging to the image from the given group (which can be Any).
RegionHandler * regHandPtr_p
The region handling object.
void setImageInfoMember(const ImageInfo &imageInfo)
Set the image info variable.
virtual void useMask(MaskSpecifier=MaskSpecifier())
Use the mask as specified.
virtual Bool ok() const =0
Check class invariants.
ImageInterface & operator=(const ImageInterface &other)
Assignment (copy semantics) is only useful for derived classes.
virtual Bool setMiscInfo(const RecordInterface &newInfo)
virtual Bool hasRegion(const String ®ionName, RegionHandler::GroupType=RegionHandler::Any) const
Does the image have a region with the given name?
virtual LELCoordinates lelCoordinates() const
Function to get a LELCoordinate object containing the coordinates.
virtual Bool setCoordinateInfo(const CoordinateSystem &coords)
Functions to set or replace the coordinate information in the Image Returns False on failure,...
void setMiscInfoMember(const RecordInterface &rec)
Set the miscinfo variable.
ImageInterface(const ImageInterface &other)
Copy constructor (copy semantics).
const CoordinateSystem & coordinates() const
Bool fromRecord(String &error, const RecordInterface &inRec)
String makeUniqueRegionName(const String &rootName, uInt startNumber=1) const
Make a unique region name from the given root name, thus make it such that the name is not already in...
virtual void setDefaultMask(const String ®ionName)
Set the default pixelmask to the mask with the given name (which has to exist in the "masks" group).
virtual void renameRegion(const String &newName, const String &oldName, RegionHandler::GroupType=RegionHandler::Any, Bool overwrite=False)
Rename a region.
const TableRecord & miscInfo() const
Often we have miscellaneous information we want to attach to an image.
virtual Vector< String > regionNames(RegionHandler::GroupType=RegionHandler::Any) const
Get the names of all regions/masks.
Bool toRecord(String &error, RecordInterface &outRec)
Save and restore an ImageInterface object to or from a state Record.
Bool restoreImageInfo(const RecordInterface &rec)
Restore the image info from the record.
void setUnitMember(const Unit &unit)
Set the unit variable.
CoordinateSystem coords_p
It is the job of the derived class to make these variables valid.
virtual IPosition shape() const =0
Return the shape of the Lattice including all degenerate axes (ie.
void append(const LoggerHolder &other)
Append the entries of the other logger to this one.
LogIO & logio()
Get access to the logger.
const LatticeRegion & region() const
Get the region used.
GroupType
Define the possible group types (regions or masks).
virtual Bool canDefineRegion() const
Can the class indeed define and handle regions? The default implementation returns False.
String: the storage and methods of handling collections of characters.
virtual void assign(const RecordInterface &that)
Assign that RecordInterface object to this one.
this file contains all the compiler specific defines
bool Bool
Define the standard types used by Casacore.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.