26#ifndef IMAGES_PAGEDIMAGE_H
27#define IMAGES_PAGEDIMAGE_H
31#include <casacore/casa/aips.h>
32#include <casacore/images/Images/ImageInterface.h>
33#include <casacore/images/Images/ImageAttrHandlerCasa.h>
34#include <casacore/lattices/Lattices/PagedArray.h>
35#include <casacore/tables/Tables/Table.h>
36#include <casacore/casa/Utilities/DataType.h>
37#include <casacore/tables/Tables/TableRecord.h>
40#include <casacore/casa/iosfwd.h>
147 const String& nameOfNewFile,
156 const String& nameOfNewFile,
161 const String& nameOfNewFile,
198 {
return "PagedImage"; }
275 virtual void apply (T (*function)(T));
276 virtual void apply (T (*function)(
const T& ));
291 {
return map_p.table(); }
420 const String& nameOfNewFile,
470#ifndef CASACORE_NO_AUTO_TEMPLATES
471#include <casacore/images/Images/PagedImage.tcc>
LockType
Define the possible lock types.
LogIO & logSink()
Allow messages to be logged to this ImageInterface.
void setCoordsMember(const CoordinateSystem &coords)
Set the coordinate system variable.
LoggerHolder & logger()
Get access to the LoggerHolder.
void setLogMember(const LoggerHolder &logger)
Set the image logger variable.
const ImageInfo & imageInfo() const
The ImageInfo object contains some miscellaneous information about the image which unlike that stored...
virtual String getDefaultMask() const
Get the name of the default pixelmask.
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).
void setImageInfoMember(const ImageInfo &imageInfo)
Set the image info variable.
virtual Bool hasRegion(const String ®ionName, RegionHandler::GroupType=RegionHandler::Any) const
Does the image have a region with the given name?
void setMiscInfoMember(const RecordInterface &rec)
Set the miscinfo variable.
const CoordinateSystem & coordinates() const
void setUnitMember(const Unit &unit)
Set the unit variable.
void restoreMiscInfo(const TableRecord &rec)
LatticeRegion * regionPtr_p
virtual void reopen()
If needed, reopen a temporarily closed Image.
uInt rowNumber() const
Return the current TableColumn row number.
virtual IPosition shape() const
Return the shape of the image.
PagedImage(const PagedImage< T > &other)
Copy constructor (reference semantics).
PagedImage(const TiledShape &mapShape, const CoordinateSystem &coordinateInfo, Table &table, uInt rowNumber=0)
Construct a new Image from shape and coordinate information.
virtual void clearCache()
Clears and frees up the caches, but the maximum allowed cache size is unchanged from when setCacheSiz...
virtual Bool setCoordinateInfo(const CoordinateSystem &coords)
Flushes the new coordinate system to disk if the table is writable.
virtual void useMask(MaskSpecifier=MaskSpecifier())
Use the mask as specified.
virtual uInt advisedMaxPixels() const
Returns the maximum recommended number of pixels for a cursor.
virtual void apply(T(*function)(T))
Replace every element, x, of the lattice with the result of f(x).
virtual Bool isPersistent() const
A PagedImage is always persistent.
virtual String name(Bool stripPath=False) const
Return the current Table name.
virtual void apply(const Functional< T, T > &function)
virtual void resize(const TiledShape &newShape)
Change the shape of the image (N.B.
virtual void resync()
Resynchronize the PagedImage object with the table contents.
PagedImage(Table &table, MaskSpecifier=MaskSpecifier(), uInt rowNumber=0)
Reconstruct an image from a pre-existing file.
virtual void putAt(const T &value, const IPosition &where)
Put the value of a single element.
virtual void setDefaultMask(const String &maskName)
Set the default pixelmask to the mask with the given name (which has to exist in the "masks" group).
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.
Table & table()
Return the table holding the data.
virtual Bool isPaged() const
A PagedImage is always paged to disk.
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).
virtual ImageAttrHandler & attrHandler(Bool createHandler=False)
Get access to the attribute handler.
void applyMaskSpecifier(const MaskSpecifier &)
void rename(const String &newName)
Function to change the name of the Table file on disk.
virtual Bool setMiscInfo(const RecordInterface &newInfo)
Replace the miscinfo in the PagedImage.
virtual void apply(T(*function)(const T &))
virtual void showCacheStatistics(ostream &os) const
Report on cache success.
PagedImage(const String &filename, MaskSpecifier=MaskSpecifier(), uInt rowNumber=0)
Reconstruct an image from a pre-existing file.
static String className()
Return the name of this derived class.
ImageAttrHandlerCasa itsAttrHandler
virtual Bool isWritable() const
Is the PagedImage writable?
virtual ImageInterface< T > * cloneII() const
Make a copy of the object (reference semantics).
PagedImage(const TiledShape &mapShape, const CoordinateSystem &coordinateInfo, const String &nameOfNewFile, TableLock::LockOption, uInt rowNumber=0)
Construct a new Image from shape and coordinate information.
PagedImage(const TiledShape &mapShape, const CoordinateSystem &coordinateInfo, const String &nameOfNewFile, const TableLock &lockOptions, uInt rowNumber=0)
virtual IPosition doNiceCursorShape(uInt maxPixels) const
Help the user pick a cursor for most efficient access.
virtual T getAt(const IPosition &where) const
These are the true implementations of the paran operator.
virtual void doPutSlice(const Array< T > &sourceBuffer, const IPosition &where, const IPosition &stride)
Function to replace the values in the map with soureBuffer.
virtual const Lattice< Bool > & pixelMask() const
Get access to the pixelmask used.
virtual void setCacheSizeInTiles(uInt howManyTiles)
Set the actual cache size for this Array to be be big enough for the indicated number of tiles.
PagedImage< T > & operator=(const PagedImage< T > &other)
Assignment operator (reference semantics).
virtual Bool ok() const
Check for symmetry in data members.
void applyMask(const String &maskName)
virtual Bool setUnits(const Unit &newUnits)
Function which sets the units associated with the image pixels (i.e.
virtual void setMaximumCacheSize(uInt howManyPixels)
Set the maximum (allowed) cache size as indicated.
virtual Bool hasLock(FileLocker::LockType) const
virtual Lattice< Bool > & pixelMask()
const Table & table() const
virtual void tempClose()
Close the Image and associated files temporarily.
virtual Bool doGetSlice(Array< T > &buffer, const Slicer &theSlice)
Function which extracts an array from the map.
void restoreImageInfo(const TableRecord &rec)
PagedImage(const String &filename, const TableLock &lockOptions, MaskSpecifier=MaskSpecifier(), uInt rowNumber=0)
virtual Bool lock(FileLocker::LockType, uInt nattempts)
Handle the (un)locking.
void makePagedImage(const TiledShape &mapShape, const CoordinateSystem &coordinateInfo, const String &nameOfNewFile, const TableLock &lockOptions, uInt rowNumber)
PagedImage< T > & operator+=(const Lattice< T > &other)
Add a lattice to this image.
void makePagedImage(const String &filename, const TableLock &lockOptions, const MaskSpecifier &, uInt rowNumber)
virtual Bool setImageInfo(const ImageInfo &info)
The ImageInfo object contains some miscellaneous information about the image, which unlike that store...
void restoreAll(const TableRecord &rec)
void attach_logtable()
This must be called in every constructor and place where the image is attached to a new image.
void restoreUnits(const TableRecord &rec)
PagedImage(const TiledShape &mapShape, const CoordinateSystem &coordinateInfo, const String &nameOfNewFile, uInt rowNumber=0)
Construct a new Image from shape and coordinate information.
virtual const LatticeRegion * getRegionPtr() const
Get a pointer the default pixelmask object used with this image.
static Table & getTable(void *imagePtr, Bool writable)
Function to return the internal Table object to the RegionHandler.
virtual LatticeIterInterface< T > * makeIter(const LatticeNavigator &navigator, Bool useRef) const
This is the implementation of the letter for the envelope Iterator class; Note: Not for public use ...
void check_conformance(const Lattice< T > &other)
virtual uInt maximumCacheSize() const
Maximum size - not necessarily all used.
virtual Bool hasPixelMask() const
Does the image object use a pixelmask?
virtual String imageType() const
Get the image type (returns name of this derived class).
virtual void flush()
Flush the data.
PagedImage(const String &filename, TableLock::LockOption, MaskSpecifier=MaskSpecifier(), uInt rowNumber=0)
Reconstruct an image from a pre-existing file with Locking.
GroupType
Define the possible group types (regions or masks).
String: the storage and methods of handling collections of characters.
LockOption
Define the possible table locking options.
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.
DataType imagePixelType(const String &fileName)
Determine the pixel type in the PagedImage contained in fileName.