28 #ifndef IMAGES_PAGEDIMAGE_H
29 #define IMAGES_PAGEDIMAGE_H
33 #include <casacore/casa/aips.h>
34 #include <casacore/images/Images/ImageInterface.h>
35 #include <casacore/images/Images/ImageAttrHandlerCasa.h>
36 #include <casacore/lattices/Lattices/PagedArray.h>
37 #include <casacore/tables/Tables/Table.h>
38 #include <casacore/casa/Utilities/DataType.h>
39 #include <casacore/tables/Tables/TableRecord.h>
42 #include <casacore/casa/iosfwd.h>
149 const String& nameOfNewFile,
158 const String& nameOfNewFile,
163 const String& nameOfNewFile,
200 {
return "PagedImage"; }
277 virtual void apply (T (*
function)(T));
278 virtual void apply (T (*
function)(
const T& ));
293 {
return map_p.table(); }
422 const String& nameOfNewFile,
472 #ifndef CASACORE_NO_AUTO_TEMPLATES
473 #include <casacore/images/Images/PagedImage.tcc>
LockType
Define the possible lock types.
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 ImageAttrHandler & attrHandler(Bool createHandler=False)
Get access to the attribute handler.
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.
static Table & getTable(void *imagePtr, Bool writable)
Function to return the internal Table object to the RegionHandler.
virtual String name(Bool stripPath=False) const
Return the current Table name.
virtual const LatticeRegion * getRegionPtr() const
Get a pointer the default pixelmask object used with this image.
PagedImage< T > & operator+=(const Lattice< T > &other)
Add a lattice to this image.
virtual void apply(const Functional< T, T > &function)
virtual void resize(const TiledShape &newShape)
Change the shape of the image (N.B.
virtual Lattice< Bool > & pixelMask()
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.
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).
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 const Lattice< Bool > & pixelMask() const
Get access to the pixelmask used.
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?
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.
Table & table()
Return the table holding the data.
PagedImage< T > & operator=(const PagedImage< T > &other)
Assignment operator (reference semantics).
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 void setCacheSizeInTiles(uInt howManyTiles)
Set the actual cache size for this Array to be be big enough for the indicated number of tiles.
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 void tempClose()
Close the Image and associated files temporarily.
const Table & table() const
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.
virtual ImageInterface< T > * cloneII() const
Make a copy of the object (reference semantics).
void makePagedImage(const TiledShape &mapShape, const CoordinateSystem &coordinateInfo, const String &nameOfNewFile, const TableLock &lockOptions, uInt rowNumber)
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 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.
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.