Go to the documentation of this file.
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>
135 template <
class T>
class PagedImage:
public ImageInterface<T>
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>
474 #endif //# CASACORE_NO_AUTO_TEMPLATES
virtual void putAt(const T &value, const IPosition &where)
Interconvert pixel and world coordinates.
virtual Lattice< Bool > & pixelMask()
A base class for astronomical images.
Specify which elements to extract from an n-dimensional array.
virtual Bool setMiscInfo(const RecordInterface &newInfo)
Replace the miscinfo in the PagedImage.
virtual Bool isWritable() const
Is the PagedImage writable?
void restoreUnits(const TableRecord &rec)
virtual const Lattice< Bool > & pixelMask() const
Get access to the pixelmask used.
LockOption
Define the possible table locking options.
virtual void tempClose()
Close the Image and associated files temporarily.
A Vector of integers, for indexing into Array<T> objects.
LatticeRegion * regionPtr_p
PagedImage(const String &filename, MaskSpecifier=MaskSpecifier(), uInt rowNumber=0)
Reconstruct an image from a pre-existing file.
GroupType
Define the possible group types (regions or masks).
virtual IPosition doNiceCursorShape(uInt maxPixels) const
Help the user pick a cursor for most efficient access.
void applyMask(const String &maskName)
virtual String name(Bool stripPath=False) const
Return the current Table name.
virtual Bool setImageInfo(const ImageInfo &info)
The ImageInfo object contains some miscellaneous information about the image, which unlike that store...
A hierarchical collection of named fields of various types.
virtual String imageType() const
Get the image type (returns name of this derived class).
virtual uInt advisedMaxPixels() const
Returns the maximum recommended number of pixels for a cursor.
void makePagedImage(const String &filename, const TableLock &lockOptions, const MaskSpecifier &, uInt rowNumber)
Map a domain object into a range object via operator().
LockType
Define the possible lock types.
virtual Bool setUnits(const Unit &newUnits)
Function which sets the units associated with the image pixels (i.e.
virtual uInt maximumCacheSize() const
Maximum size - not necessarily all used.
Abstract base class for an image attributes handler.
PagedImage(const TiledShape &mapShape, const CoordinateSystem &coordinateInfo, Table &table, uInt rowNumber=0)
Construct a new Image from shape and coordinate information.
static Table & getTable(void *imagePtr, Bool writable)
Function to return the internal Table object to the RegionHandler.
An optionally strided region in a Lattice.
void attach_logtable()
This must be called in every constructor and place where the image is attached to a new image.
PagedImage(const String &filename, TableLock::LockOption, MaskSpecifier=MaskSpecifier(), uInt rowNumber=0)
Reconstruct an image from a pre-existing file with Locking.
const Table & table() const
Read, store, and manipulate astronomical images.
virtual void resize(const TiledShape &newShape)
Change the shape of the image (N.B.
PagedImage(Table &table, MaskSpecifier=MaskSpecifier(), uInt rowNumber=0)
Reconstruct an image from a pre-existing file.
virtual void reopen()
If needed, reopen a temporarily closed Image.
Main interface class to a read/write table.
virtual Bool lock(FileLocker::LockType, uInt nattempts)
Handle the (un)locking.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
void check_conformance(const Lattice< T > &other)
Abstract base class to steer lattice iterators.
uInt rowNumber() const
Return the current TableColumn row number.
virtual Bool hasPixelMask() const
Does the image object use a pixelmask?
virtual ImageInterface< T > * cloneII() const
Make a copy of the object (reference semantics).
virtual void apply(T(*function)(const T &))
Table & table()
Return the table holding the data.
virtual Bool doGetSlice(Array< T > &buffer, const Slicer &theSlice)
Function which extracts an array from the map.
virtual ImageAttrHandler & attrHandler(Bool createHandler=False)
Get access to the attribute handler.
PagedImage< T > & operator=(const PagedImage< T > &other)
Assignment operator (reference semantics).
A Lattice that is read from or written to disk.
Class to specify which mask to use in an image.
PagedImage(const String &filename, const TableLock &lockOptions, MaskSpecifier=MaskSpecifier(), uInt rowNumber=0)
void restoreAll(const TableRecord &rec)
PagedImage< T > & operator+=(const Lattice< T > &other)
Add a lattice to this image.
virtual void apply(const Functional< T, T > &function)
virtual IPosition shape() const
Return the shape of the image.
void rename(const String &newName)
Function to change the name of the Table file on disk.
Class to hold table lock options.
void makePagedImage(const TiledShape &mapShape, const CoordinateSystem &coordinateInfo, const String &nameOfNewFile, const TableLock &lockOptions, uInt rowNumber)
this file contains all the compiler specific defines
PagedImage(const TiledShape &mapShape, const CoordinateSystem &coordinateInfo, const String &nameOfNewFile, TableLock::LockOption, uInt rowNumber=0)
Construct a new Image from shape and coordinate information.
virtual Bool setCoordinateInfo(const CoordinateSystem &coords)
Flushes the new coordinate system to disk if the table is writable.
virtual Bool hasLock(FileLocker::LockType) const
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).
ImageAttrHandlerCasa itsAttrHandler
virtual Bool isPersistent() const
A PagedImage is always persistent.
virtual void resync()
Resynchronize the PagedImage object with the table contents.
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 ...
virtual void clearCache()
Clears and frees up the caches, but the maximum allowed cache size is unchanged from when setCacheSiz...
PagedImage(const PagedImage< T > &other)
Copy constructor (reference semantics).
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.
Abstract base class for Record classes.
void restoreImageInfo(const TableRecord &rec)
virtual void flush()
Flush the data.
template <class T, class U> class vector;
String: the storage and methods of handling collections of characters.
PagedImage(const TiledShape &mapShape, const CoordinateSystem &coordinateInfo, const String &nameOfNewFile, uInt rowNumber=0)
Construct a new Image from shape and coordinate information.
virtual void doPutSlice(const Array< T > &sourceBuffer, const IPosition &where, const IPosition &stride)
Function to replace the values in the map with soureBuffer.
bool Bool
Define the standard types used by Casacore.
virtual Bool isPaged() const
A PagedImage is always paged to disk.
Abstract base class for an image attributes handler.
virtual void setMaximumCacheSize(uInt howManyPixels)
Set the maximum (allowed) cache size as indicated.
DataType imagePixelType(const String &fileName)
Determine the pixel type in the PagedImage contained in fileName.
void restoreMiscInfo(const TableRecord &rec)
virtual const LatticeRegion * getRegionPtr() const
Get a pointer the default pixelmask object used with this image.
virtual T getAt(const IPosition &where) const
These are the true implementations of the paran operator.
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 setCacheSizeInTiles(uInt howManyTiles)
Set the actual cache size for this Array to be be big enough for the indicated number of tiles.
static String className()
Return the name of this derived class.
virtual Bool ok() const
Check for symmetry in data members.
Define the shape and tile shape.
PagedImage(const TiledShape &mapShape, const CoordinateSystem &coordinateInfo, const String &nameOfNewFile, const TableLock &lockOptions, uInt rowNumber=0)
virtual void useMask(MaskSpecifier=MaskSpecifier())
Use the mask as specified.
Miscellaneous information related to an image.
virtual void apply(T(*function)(T))
Replace every element, x, of the lattice with the result of f(x).
virtual void showCacheStatistics(ostream &os) const
Report on cache success.
A base class for Lattice iterators.
void applyMaskSpecifier(const MaskSpecifier &)