Loading...
Searching...
No Matches
casacore::ImageProxy Class Reference

`#include <ImageProxy.h>`

## Public Member Functions

| ImageProxy ()
| Default constructor is needed for Boost-Python.
| ImageProxy (const Vector< String > &names, Int axis)
| Construct from the concatenation of the images along the axis.
| ImageProxy (const String &name, const String &mask, const std::vector< ImageProxy > &images)
| Construct from a string that contains an image name or image expression.
| ImageProxy (const std::vector< ImageProxy > &images, Int axis, Int dummy1=0, Int dummy2=0)
| Construct from the concatenation of the image objects along the axis.
| ImageProxy (const ValueHolder &values, const ValueHolder &mask, const Record &coordinates, const String &imageName=String(), Bool overwrite=True, Bool asHDF5=False, const String &maskName=String(), const IPosition &tileShape=IPosition())
| Construct from a ValueHolder containing an Array of Float or Complex.
| ImageProxy (const IPosition &shape, const ValueHolder &value, const Record &coordinates, const String &imageName=String(), Bool overwrite=True, Bool asHDF5=False, const String &maskName=String(), const IPosition &tileShape=IPosition(), Int dummy=0)
| Construct from a shape.
| ImageProxy (const std::shared_ptr< LatticeBase > &)
| Construct from an existing image object.
| ImageProxy (const ImageProxy &)
| Copy constructor (reference semantics).
ImageProxy & | operator= (const ImageProxy &)
| Assignment (reference semantics).
| ~ImageProxy ()
void | close ()
| Close the image by setting all pointers to 0.
LatticeExprNode | makeNode () const
| Turn the ImageProxy into a LatticeExprNode.
Bool | isPersistent () const
| Is the image persistent or temporary.
String | name (Bool stripPath=False) const
| Get the name of the image.
IPosition | shape () const
| Get the shape of the image.
uInt | ndim () const
| Get the dimensionality of the image.
uInt | size () const
| Get the size of the image (nr of pixels).
String | dataType () const
| Get the data type of the image.
DataType | type () const
String | imageType () const
| Get the image type (PagedImage, HDF5Image, etc.).
ValueHolder | getData (const IPosition &blc, const IPosition &trc, const IPosition &inc)
| Get a chunk of data.
ValueHolder | getMask (const IPosition &blc, const IPosition &trc, const IPosition &inc)
| Get a chunk of the mask.
void | putData (const ValueHolder &, const IPosition &blc, const IPosition &inc)
| Put a chunk of data.
void | putMask (const ValueHolder &value, const IPosition &blc, const IPosition &inc)
| Put a chunk of the mask.
Bool | hasLock (Bool writeLock=False)
| Does the image have a read or write lock?
void | lock (Bool writeLock=False, Int nattempts=0)
| Try to acquire a read or write lock.
void | unlock ()
| Release the lock acquired by lock().
Vector< String > | attrGroupNames () const
| Get the names of the attribute groups.
void | createAttrGroup (const String &groupName)
| Create a new attribute group.
Vector< String > | attrNames (const String &groupName) const
| Get the names of all attributes in a group.
uInt | attrNrows (const String &groupName) const
| Get the number of rows in an attribute group.
ValueHolder | getAttr (const String &groupName, const String &attrName, uInt rownr) const
| Get the value of an attribute in a group row.
Record | getAttrRow (const String &groupName, uInt rownr) const
| Get all attributes in a group row.
Vector< String > | getAttrUnit (const String &groupName, const String &attrName) const
| Get the unit(s) of an attribute in a group.
Vector< String > | getAttrMeas (const String &groupName, const String &attrName) const
| Get the measinfo of an attribute in a group.
void | putAttr (const String &groupName, const String &attrName, uInt rownr, const ValueHolder &value, const Vector< String > &units, const Vector< String > &measInfo)
| Put the value, unit, and measinfo of an attribute in a group row.
ImageProxy | subImage (const IPosition &blc, const IPosition &trc, const IPosition &inc, Bool dropDegenerate=True)
| Form a new (virtual) image being a subset of the image.
ImageProxy | subImage2 (const IPosition &blc, const IPosition &trc, const IPosition &inc, Bool dropDegenerate, Bool preserveAxesOrder)
| Same with a new function name for backward compatibility with old pyrap.
String | unit () const
| Get the brightness unit.
Record | coordSys () const
| Get the coordinate system.
const CoordinateSystem & | coordSysObject () const
Vector< Double > | toWorld (const Vector< Double > &pixel, Bool reverseAxes)
| Convert a pixel coordinate to world coordinate.
Vector< Double > | toPixel (const Vector< Double > &world, Bool reverseAxes)
| Convert a world coordinate to pixel coordinate.
Record | imageInfo () const
| Get the image info.
const ImageInfo & | imageInfoObject () const
Record | miscInfo () const
| Get the miscellaneous info.
Vector< String > | history () const
| Get the history.
void | toFits (const String &fitsfile, Bool overwrite=True, Bool velocity=True, Bool optical=True, Int bitpix=-32, Double minpix=1, Double maxpix=-1) const
| Write the image in FITS format.
void | saveAs (const String &fileName, Bool overwrite=True, Bool hdf5=False, Bool copyMask=True, const String &newMaskName=String(), const IPosition &newTileShape=IPosition()) const
| Write the image to an image file with the given name.
Record | statistics (const Vector< Int > &axes, const String &mask, const ValueHolder &minMaxValues, Bool exclude=False, Bool robust=False) const
| Return the statistics for the given axes.
ImageProxy | regrid (const Vector< Int > &axes=Vector< Int >(), const String &outfile=String(), Bool overwriteOutFile=True, const IPosition &outShape=IPosition(), const Record &coordSys=Record(), const String &method="linear", Int decimate=10, Bool replicate=False, Bool doRefChange=True, Bool forceRegrid=False)
| Regrid the image on the given axes to the given coordinate system.
LatticeBase * | getLattice () const

## Static Public Member Functions

static LatticeBase * | openImage (const String &name, const String &mask=String(), const std::vector< ImageProxy > &images=std::vector< ImageProxy >())
| Open the image (which can also be an expression).
static LatticeBase * | openImageOrExpr (const String &str, const MaskSpecifier &, const Block< LatticeExprNode > &nodes)
| Open an image in the file/table with the given name.
static IPosition | adjustBlc (const IPosition &blc, const IPosition &shp)
| Check and adjust blc, trc, or inc using the shape.
static IPosition | adjustTrc (const IPosition &trc, const IPosition &shp)
static IPosition | adjustInc (const IPosition &inc, const IPosition &shp)

## Private Member Functions

| ImageProxy (LatticeBase *)
| Form an ImageProxy object from an existing image object.
void | checkNull () const
| Throw an exception if the object is null.
template<typename T>
void | makeImage (const Array< T > &array, const Array< Bool > &mask, const IPosition &shape, const Record &coordinates, const String &fileName, Bool asHDF5, const String &maskName, const IPosition &tileShape)
| Make an image from an array or shape.
void | concatImages (const std::vector< ImageProxy > &images, Int axis)
| Form a concatenated image.
void | concatImagesFloat (const std::vector< ImageProxy > &images, Int axis)
void | concatImagesDouble (const std::vector< ImageProxy > &images, Int axis)
void | concatImagesComplex (const std::vector< ImageProxy > &images, Int axis)
void | concatImagesDComplex (const std::vector< ImageProxy > &images, Int axis)
void | setup ()
| Setup the pointers for the various image data types.
void | setup (LatticeBase *lattice)
| Setup the pointers for the various image data types.
void | centreRefPix (CoordinateSystem &cSys, const IPosition &shape) const
| Centre all axes except the Stokes one.
template<typename T>
void | doPutMask (ImageInterface< T > &image, const ValueHolder &value, const IPosition &blc, const IPosition &inc)
| Put the mask and create it if needed.
template<typename T>
void | saveImage (const String &fileName, Bool hdf5, Bool copyMask, const String &newMaskName, const IPosition &newTileShape, const ImageInterface< T > &image) const
| Copy the image to an image (PagedImage or HDF5Image) with the given name.
TiledShape | makeTiledShape (const IPosition &newTileShape, const IPosition &shape, const IPosition &oldTileShape=IPosition()) const
| Form a tiled shape from the current shape and a possible new tile shape.
template<typename T>
Record | makeStatistics (const ImageInterface< T > &image, const Vector< Int > &axes, const String &mask, const ValueHolder &minMaxValues, Bool exclude, Bool robust) const
| Calculate the statistics.
template<typename T>
ImageProxy | doRegrid (const ImageInterface< T > &image, const Vector< Int > &axes, const String &outfile, const IPosition &shape, const Record &coordSys, const String &method, Int decimate, Bool replicate, Bool doRefChange, Bool force)
| Do the actual regridding.
CoordinateSystem | makeCoordinateSystem (const Record &coordinates, const IPosition &shape) const
| Make a coordinate system from the Record.

## Private Attributes

std::shared_ptr< LatticeBase > | itsLattice
ImageInterface< Float > * | itsImageFloat
ImageInterface< Double > * | itsImageDouble
ImageInterface< Complex > * | itsImageComplex
ImageInterface< DComplex > * | itsImageDComplex
const CoordinateSystem * | itsCoordSys
ImageAttrHandler * | itsAttrHandler

## Detailed Description

### Synopsis

ImageProxy is a proxy to an image having data type Float, Double, Complex, or DComplex. Its primary purpose is to be bind the images module to Python through pyrap.images. However, it can also be used directly in C++.

An ImageProxy object can be constructed for an image stored on disk in Casacore, FITS, HDF5, or Miriad format. It can also be constructed given a shape or an N-dim array with values. Furthermore it can be constructed from a LEL expression (see class ImageExpr) or a vector of images to be concatenated (see class ImageConcat).

Many functions exist to operate on an ImageProxy object. For example:

- get meta info (shape, data type, coordinates, etc.)
- save in Casacore, HDF5, or FITS format.
- regrid.
- get statistics.
- form a subimage (which is done in a virtual way).

Functions regrid and statistics can only be used for Float images. They throw an exception for images with other data types. Note that using a LEL expression it is possible to (virtually) convert an image with another type to a Float image.

Definition at line 73 of file ImageProxy.h.

## Constructor & Destructor Documentation

## ImageProxy() [1/9]

casacore::ImageProxy::ImageProxy | ( |  | ) |

Default constructor is needed for Boost-Python.

Referenced by doRegrid(), ImageProxy(), operator=(), regrid(), subImage(), and subImage2().

## ImageProxy() [2/9]

casacore::ImageProxy::ImageProxy | ( | const Vector< String > & | names,
|  | Int | axis )

Construct from the concatenation of the images along the axis.

The axis must be given as a Fortran-array axis. All images must be of the same data type.

## ImageProxy() [3/9]

casacore::ImageProxy::ImageProxy | ( | const String & | name,
|  | const String & | mask,
|  | const std::vector< ImageProxy > & | images )

Construct from a string that contains an image name or image expression.

It is opened using ImageOpener.

References casacore::mask(), and name().

## ImageProxy() [4/9]

casacore::ImageProxy::ImageProxy | ( | const std::vector< ImageProxy > & | images,
|  | Int | axis,
|  | Int | dummy1 = 0,
|  | Int | dummy2 = 0 )

Construct from the concatenation of the image objects along the axis.

The axis must be given as a Fortran-array axis. All images must be of the same data type.

## ImageProxy() [5/9]

casacore::ImageProxy::ImageProxy | ( | const ValueHolder & | values,
|  | const ValueHolder & | mask,
|  | const Record & | coordinates,
|  | const String & | imageName = String(),
|  | Bool | overwrite = True,
|  | Bool | asHDF5 = False,
|  | const String & | maskName = String(),
|  | const IPosition & | tileShape = IPosition() )

Construct from a ValueHolder containing an Array of Float or Complex.

If the name is empty it is created as a temporary image, otherwise as a PagedImage or HDF5Image. If the coordinates record is empty, default coordinates are used. A mask is created if the mask name or mask value is not empty.

References casacore::False, casacore::mask(), casacore::Record(), and casacore::True.

## ImageProxy() [6/9]

casacore::ImageProxy::ImageProxy | ( | const IPosition & | shape,
|  | const ValueHolder & | value,
|  | const Record & | coordinates,
|  | const String & | imageName = String(),
|  | Bool | overwrite = True,
|  | Bool | asHDF5 = False,
|  | const String & | maskName = String(),
|  | const IPosition & | tileShape = IPosition(),
|  | Int | dummy = 0 )

Construct from a shape.

If the name is empty it is created as a temporary image, otherwise as a PagedImage or HDF5Image. If the coordinates record is empty, default coordinates are used. A mask is created if the mask name is not empty.

References casacore::False, casacore::NewDelAllocator< T >::value, casacore::Record(), shape(), and casacore::True.

## ImageProxy() [7/9]

casacore::ImageProxy::ImageProxy | ( | const std::shared_ptr< LatticeBase > & |  | ) |

Construct from an existing image object.

## ImageProxy() [8/9]

casacore::ImageProxy::ImageProxy | ( | const ImageProxy & |  | ) |

Copy constructor (reference semantics).

References ImageProxy().

## ~ImageProxy()

casacore::ImageProxy::~ImageProxy | ( |  | ) |

## ImageProxy() [9/9]

casacore::ImageProxy::ImageProxy | ( | LatticeBase * |  | ) |

explicit private

Form an ImageProxy object from an existing image object.

## Member Function Documentation

## adjustBlc()

IPosition casacore::ImageProxy::adjustBlc | ( | const IPosition & | blc,
|  | const IPosition & | shp )

static

Check and adjust blc, trc, or inc using the shape.

## adjustInc()

IPosition casacore::ImageProxy::adjustInc | ( | const IPosition & | inc,
|  | const IPosition & | shp )

static

## adjustTrc()

IPosition casacore::ImageProxy::adjustTrc | ( | const IPosition & | trc,
|  | const IPosition & | shp )

static

## attrGroupNames()

Vector< String > casacore::ImageProxy::attrGroupNames | ( |  | ) | const

Get the names of the attribute groups.

## attrNames()

Vector< String > casacore::ImageProxy::attrNames | ( | const String & | groupName | ) | const

Get the names of all attributes in a group.

## attrNrows()

uInt casacore::ImageProxy::attrNrows | ( | const String & | groupName | ) | const

Get the number of rows in an attribute group.

## centreRefPix()

void casacore::ImageProxy::centreRefPix | ( | CoordinateSystem & | cSys,
|  | const IPosition & | shape ) const

private

Centre all axes except the Stokes one.

References shape().

## checkNull()

void casacore::ImageProxy::checkNull | ( |  | ) | const

private

Throw an exception if the object is null.

## close()

void casacore::ImageProxy::close | ( |  | ) |

Close the image by setting all pointers to 0.

## concatImages()

void casacore::ImageProxy::concatImages | ( | const std::vector< ImageProxy > & | images,
|  | Int | axis )

private

Form a concatenated image.

## concatImagesComplex()

void casacore::ImageProxy::concatImagesComplex | ( | const std::vector< ImageProxy > & | images,
|  | Int | axis )

private

## concatImagesDComplex()

void casacore::ImageProxy::concatImagesDComplex | ( | const std::vector< ImageProxy > & | images,
|  | Int | axis )

private

## concatImagesDouble()

void casacore::ImageProxy::concatImagesDouble | ( | const std::vector< ImageProxy > & | images,
|  | Int | axis )

private

## concatImagesFloat()

void casacore::ImageProxy::concatImagesFloat | ( | const std::vector< ImageProxy > & | images,
|  | Int | axis )

private

## coordSys()

Record casacore::ImageProxy::coordSys | ( |  | ) | const

Get the coordinate system.

References casacore::Record().

Referenced by doRegrid(), and regrid().

## coordSysObject()

const CoordinateSystem & casacore::ImageProxy::coordSysObject | ( |  | ) | const

## createAttrGroup()

void casacore::ImageProxy::createAttrGroup | ( | const String & | groupName | ) |

Create a new attribute group.

## dataType()

String casacore::ImageProxy::dataType | ( |  | ) | const

Get the data type of the image.

## doPutMask()

template<typename T>

void casacore::ImageProxy::doPutMask | ( | ImageInterface< T > & | image,
|  | const ValueHolder & | value,
|  | const IPosition & | blc,
|  | const IPosition & | inc )

private

Put the mask and create it if needed.

References casacore::NewDelAllocator< T >::value.

## doRegrid()

template<typename T>

ImageProxy casacore::ImageProxy::doRegrid | ( | const ImageInterface< T > & | image,
|  | const Vector< Int > & | axes,
|  | const String & | outfile,
|  | const IPosition & | shape,
|  | const Record & | coordSys,
|  | const String & | method,
|  | Int | decimate,
|  | Bool | replicate,
|  | Bool | doRefChange,
|  | Bool | force )

private

Do the actual regridding.

References coordSys(), ImageProxy(), casacore::Record(), and shape().

## getAttr()

ValueHolder casacore::ImageProxy::getAttr | ( | const String & | groupName,
|  | const String & | attrName,
|  | uInt | rownr ) const

Get the value of an attribute in a group row.

## getAttrMeas()

Vector< String > casacore::ImageProxy::getAttrMeas | ( | const String & | groupName,
|  | const String & | attrName ) const

Get the measinfo of an attribute in a group.

## getAttrRow()

Record casacore::ImageProxy::getAttrRow | ( | const String & | groupName,
|  | uInt | rownr ) const

Get all attributes in a group row.

References casacore::Record().

## getAttrUnit()

Vector< String > casacore::ImageProxy::getAttrUnit | ( | const String & | groupName,
|  | const String & | attrName ) const

Get the unit(s) of an attribute in a group.

## getData()

ValueHolder casacore::ImageProxy::getData | ( | const IPosition & | blc,
|  | const IPosition & | trc,
|  | const IPosition & | inc )

Get a chunk of data.

## getLattice()

LatticeBase * casacore::ImageProxy::getLattice | ( |  | ) | const

inline

Definition at line 377 of file ImageProxy.h.

References itsLattice.

## getMask()

ValueHolder casacore::ImageProxy::getMask | ( | const IPosition & | blc,
|  | const IPosition & | trc,
|  | const IPosition & | inc )

Get a chunk of the mask.

## hasLock()

Bool casacore::ImageProxy::hasLock | ( | Bool | writeLock = False | ) |

Does the image have a read or write lock?

References casacore::False.

## history()

Vector< String > casacore::ImageProxy::history | ( |  | ) | const

Get the history.

## imageInfo()

Record casacore::ImageProxy::imageInfo | ( |  | ) | const

Get the image info.

References casacore::Record().

## imageInfoObject()

const ImageInfo & casacore::ImageProxy::imageInfoObject | ( |  | ) | const

## imageType()

String casacore::ImageProxy::imageType | ( |  | ) | const

Get the image type (PagedImage, HDF5Image, etc.).

## isPersistent()

Bool casacore::ImageProxy::isPersistent | ( |  | ) | const

Is the image persistent or temporary.

## lock()

void casacore::ImageProxy::lock | ( | Bool | writeLock = False,
|  | Int | nattempts = 0 )

Try to acquire a read or write lock.

nattempts=0 means wait until acquired. Otherwise every second an attempt is done.

References casacore::False.

## makeCoordinateSystem()

CoordinateSystem casacore::ImageProxy::makeCoordinateSystem | ( | const Record & | coordinates,
|  | const IPosition & | shape ) const

private

Make a coordinate system from the Record.

The cylindrical fix is applied if needed.

References casacore::Record(), and shape().

## makeImage()

template<typename T>

void casacore::ImageProxy::makeImage | ( | const Array< T > & | array,
|  | const Array< Bool > & | mask,
|  | const IPosition & | shape,
|  | const Record & | coordinates,
|  | const String & | fileName,
|  | Bool | asHDF5,
|  | const String & | maskName,
|  | const IPosition & | tileShape )

private

Make an image from an array or shape.

References casacore::array, casacore::mask(), casacore::Record(), and shape().

## makeNode()

LatticeExprNode casacore::ImageProxy::makeNode | ( |  | ) | const

Turn the ImageProxy into a LatticeExprNode.

## makeStatistics()

template<typename T>

Record casacore::ImageProxy::makeStatistics | ( | const ImageInterface< T > & | image,
|  | const Vector< Int > & | axes,
|  | const String & | mask,
|  | const ValueHolder & | minMaxValues,
|  | Bool | exclude,
|  | Bool | robust ) const

private

Calculate the statistics.

References casacore::mask(), and casacore::Record().

## makeTiledShape()

TiledShape casacore::ImageProxy::makeTiledShape | ( | const IPosition & | newTileShape,
|  | const IPosition & | shape,
|  | const IPosition & | oldTileShape = IPosition() ) const

private

Form a tiled shape from the current shape and a possible new tile shape.

References shape().

## miscInfo()

Record casacore::ImageProxy::miscInfo | ( |  | ) | const

Get the miscellaneous info.

References casacore::Record().

## name()

String casacore::ImageProxy::name | ( | Bool | stripPath = False | ) | const

Get the name of the image.

References casacore::False.

Referenced by ImageProxy(), and openImage().

## ndim()

uInt casacore::ImageProxy::ndim | ( |  | ) | const

Get the dimensionality of the image.

## openImage()

LatticeBase * casacore::ImageProxy::openImage | ( | const String & | name,
|  | const String & | mask = String(),
|  | const std::vector< ImageProxy > & | images = std::vector< ImageProxy >() )

static

Open the image (which can also be an expression).

It throws an exception if not succeeded.

References casacore::mask(), and name().

## openImageOrExpr()

LatticeBase * casacore::ImageProxy::openImageOrExpr | ( | const String & | str,
|  | const MaskSpecifier & | ,
|  | const Block< LatticeExprNode > & | nodes )

static

Open an image in the file/table with the given name.

The specified mask will be applied (default is default mask). A null pointer is returned for an unknown image type. Non-Casacore image types must have been registered to be known. If not successful, try to open it as an image expression.

## operator=()

ImageProxy & casacore::ImageProxy::operator= | ( | const ImageProxy & |  | ) |

Assignment (reference semantics).

References ImageProxy().

## putAttr()

void casacore::ImageProxy::putAttr | ( | const String & | groupName,
|  | const String & | attrName,
|  | uInt | rownr,
|  | const ValueHolder & | value,
|  | const Vector< String > & | units,
|  | const Vector< String > & | measInfo )

Put the value, unit, and measinfo of an attribute in a group row.

The attribute or row is added if new.

References casacore::NewDelAllocator< T >::value.

## putData()

void casacore::ImageProxy::putData | ( | const ValueHolder & | ,
|  | const IPosition & | blc,
|  | const IPosition & | inc )

Put a chunk of data.

## putMask()

void casacore::ImageProxy::putMask | ( | const ValueHolder & | value,
|  | const IPosition & | blc,
|  | const IPosition & | inc )

Put a chunk of the mask.

The mask will be created if not present yet. That will not be done if the entire mask is True.

References casacore::NewDelAllocator< T >::value.

## regrid()

ImageProxy casacore::ImageProxy::regrid | ( | const Vector< Int > & | axes = Vector< Int >(),
|  | const String & | outfile = String(),
|  | Bool | overwriteOutFile = True,
|  | const IPosition & | outShape = IPosition(),
|  | const Record & | coordSys = Record(),
|  | const String & | method = "linear",
|  | Int | decimate = 10,
|  | Bool | replicate = False,
|  | Bool | doRefChange = True,
|  | Bool | forceRegrid = False )

Regrid the image on the given axes to the given coordinate system.

The output is stored in the given file; it no file name is given a temporary image is made. If the output shape is empty, the old shape is used. replicate=True means replication rather than regridding.

References coordSys(), casacore::False, ImageProxy(), casacore::Record(), and casacore::True.

## saveAs()

void casacore::ImageProxy::saveAs | ( | const String & | fileName,
|  | Bool | overwrite = True,
|  | Bool | hdf5 = False,
|  | Bool | copyMask = True,
|  | const String & | newMaskName = String(),
|  | const IPosition & | newTileShape = IPosition() ) const

Write the image to an image file with the given name.

An exception is thrown if the name is the name of an already open image.

References casacore::False, and casacore::True.

## saveImage()

template<typename T>

void casacore::ImageProxy::saveImage | ( | const String & | fileName,
|  | Bool | hdf5,
|  | Bool | copyMask,
|  | const String & | newMaskName,
|  | const IPosition & | newTileShape,
|  | const ImageInterface< T > & | image ) const

private

Copy the image to an image (PagedImage or HDF5Image) with the given name.

A new tile shape can be given. If the image is masked, the mask can be copied as well.

## setup() [1/2]

void casacore::ImageProxy::setup | ( |  | ) |

private

Setup the pointers for the various image data types.

## setup() [2/2]

void casacore::ImageProxy::setup | ( | LatticeBase * | lattice | ) |

private

Setup the pointers for the various image data types.

It takes over the lattice pointer.

## shape()

IPosition casacore::ImageProxy::shape | ( |  | ) | const

Get the shape of the image.

Referenced by centreRefPix(), doRegrid(), ImageProxy(), makeCoordinateSystem(), makeImage(), and makeTiledShape().

## size()

uInt casacore::ImageProxy::size | ( |  | ) | const

Get the size of the image (nr of pixels).

## statistics()

Record casacore::ImageProxy::statistics | ( | const Vector< Int > & | axes,
|  | const String & | mask,
|  | const ValueHolder & | minMaxValues,
|  | Bool | exclude = False,
|  | Bool | robust = False ) const

Return the statistics for the given axes.

E.g., if axes 0,1 is given in a 3-dim image, the statistics are calculated for each plane along the 3rd axis. MinMaxValues can be given to include or exclude (4th argument) pixels with values in the given range. If only one value is given, min=-abs(val) and max=abs(val). Robust statistics (Median, MedAbsDevMed, and Quartile) can be returned too.

References casacore::False, casacore::mask(), and casacore::Record().

## subImage()

ImageProxy casacore::ImageProxy::subImage | ( | const IPosition & | blc,
|  | const IPosition & | trc,
|  | const IPosition & | inc,
|  | Bool | dropDegenerate = True )

Form a new (virtual) image being a subset of the image.

It uses preserveAxesOrder=False.

References ImageProxy(), and casacore::True.

## subImage2()

ImageProxy casacore::ImageProxy::subImage2 | ( | const IPosition & | blc,
|  | const IPosition & | trc,
|  | const IPosition & | inc,
|  | Bool | dropDegenerate,
|  | Bool | preserveAxesOrder )

Same with a new function name for backward compatibility with old pyrap.

References ImageProxy().

## toFits()

void casacore::ImageProxy::toFits | ( | const String & | fitsfile,
|  | Bool | overwrite = True,
|  | Bool | velocity = True,
|  | Bool | optical = True,
|  | Int | bitpix = -32,
|  | Double | minpix = 1,
|  | Double | maxpix = -1 ) const

Write the image in FITS format.

See class ImageFITSConverter for a description of the arguments. Currently only a float image can be written to FITS.

References casacore::True.

## toPixel()

Vector< Double > casacore::ImageProxy::toPixel | ( | const Vector< Double > & | world,
|  | Bool | reverseAxes )

Convert a world coordinate to pixel coordinate.

if reverseAxes=True the input and output vector will be reversed (as needed for pyrap).

## toWorld()

Vector< Double > casacore::ImageProxy::toWorld | ( | const Vector< Double > & | pixel,
|  | Bool | reverseAxes )

Convert a pixel coordinate to world coordinate.

if reverseAxes=True the input and output vector will be reversed (as needed for pyrap).

## type()

DataType casacore::ImageProxy::type | ( |  | ) | const

## unit()

String casacore::ImageProxy::unit | ( |  | ) | const

Get the brightness unit.

## unlock()

void casacore::ImageProxy::unlock | ( |  | ) |

Release the lock acquired by lock().

## Member Data Documentation

## itsAttrHandler

ImageAttrHandler* casacore::ImageProxy::itsAttrHandler

private

Definition at line 473 of file ImageProxy.h.

## itsCoordSys

const CoordinateSystem* casacore::ImageProxy::itsCoordSys

private

Definition at line 472 of file ImageProxy.h.

## itsImageComplex

ImageInterface<Complex>* casacore::ImageProxy::itsImageComplex

private

Definition at line 470 of file ImageProxy.h.

## itsImageDComplex

ImageInterface<DComplex>* casacore::ImageProxy::itsImageDComplex

private

Definition at line 471 of file ImageProxy.h.

## itsImageDouble

ImageInterface<Double>* casacore::ImageProxy::itsImageDouble

private

Definition at line 469 of file ImageProxy.h.

## itsImageFloat

ImageInterface<Float>* casacore::ImageProxy::itsImageFloat

private

Definition at line 468 of file ImageProxy.h.

## itsLattice

std::shared_ptr<LatticeBase> casacore::ImageProxy::itsLattice

private

Definition at line 467 of file ImageProxy.h.

Referenced by getLattice().

The documentation for this class was generated from the following file:

- images/Images/ImageProxy.h