casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Static Public Member Functions | Static Private Attributes | List of all members
casacore::ImageOpener Class Reference

Definition of image types and handlers. More...

#include <ImageOpener.h>

Public Types

enum  ImageTypes {
  AIPSPP,
  FITS,
  MIRIAD,
  GIPSY,
  CAIPS,
  NEWSTAR,
  HDF5,
  IMAGECONCAT,
  IMAGEEXPR,
  COMPLISTIMAGE,
  UNKNOWN
}
 Define the possible image types. More...
 
typedef LatticeBaseOpenImageFunction (const String &fileName, const MaskSpecifier &)
 Define the signature of a function opening an image. More...
 

Static Public Member Functions

static ImageTypes imageType (const String &fileName)
 Return the type of an image with the given name. More...
 
static void registerOpenImageFunction (ImageTypes, OpenImageFunction *)
 Register an openImageFunction. More...
 
static LatticeBaseopenImage (const String &fileName, const MaskSpecifier &=MaskSpecifier())
 Open an image in the file/table with the given name. More...
 
static LatticeBaseopenPagedImage (const String &fileName, const MaskSpecifier &=MaskSpecifier())
 Open a Casacore paged image of any data type. More...
 
static LatticeBaseopenHDF5Image (const String &fileName, const MaskSpecifier &=MaskSpecifier())
 Open an HDF5 paged image of any data type. More...
 
static LatticeBaseopenImageConcat (const String &fileName)
 Open a persistent image concatenation of any type. More...
 
static LatticeBaseopenImageExpr (const String &fileName)
 Open a persistent image expression of any type. More...
 
static LatticeBaseopenExpr (const String &expr, const Block< LatticeExprNode > &nodes, const String &fileName=String())
 Parse an image expression and return the ImageExpr<T> object for it. More...
 
static LatticeBaseopenExpr (const String &expr, const Block< LatticeExprNode > &nodes, const String &fileName, const JsonKVMap &)
 

Static Private Attributes

static std::map< ImageTypes,
OpenImageFunction * > 
theirOpenFuncMap
 Mapping of the image type to an openImage function. More...
 

Detailed Description

Definition of image types and handlers.

Intended use:

Internal

Review Status

Date Reviewed:
yyyy/mm/dd

Synopsis

The class contains defines the possible image types. It contains a registry containing functions to construct an image based on its type. In this way any image can be used in the image package without the need that the code must reside in the images package.

Motivation

FITS and MIRIAD needed to be moved out of the images package.

Definition at line 66 of file ImageOpener.h.

Member Typedef Documentation

typedef LatticeBase* casacore::ImageOpener::OpenImageFunction(const String &fileName, const MaskSpecifier &)

Define the signature of a function opening an image.

Each basic image class (like FITSImage) must have a static open function with this signature. They can be registered using registerOpenImageFunction. In this way a function like openImage can create any image object without the need that all image classes are in the images package. The LogIO object can be used for possible error reporting or logging.

Definition at line 106 of file ImageOpener.h.

Member Enumeration Documentation

Define the possible image types.

Enumerator
AIPSPP 

Casacore (former AIPS++)

FITS 

FITS.

MIRIAD 

Miriad.

GIPSY 

Gipsy.

CAIPS 

Classic AIPS.

NEWSTAR 

Newstar.

HDF5 

HDF5.

IMAGECONCAT 

ImageConcat.

IMAGEEXPR 

ImageExpr.

COMPLISTIMAGE 

ComponentListImage, CASA.

UNKNOWN 

Unknown.

Definition at line 70 of file ImageOpener.h.

Member Function Documentation

static ImageTypes casacore::ImageOpener::imageType ( const String fileName)
static

Return the type of an image with the given name.

Will throw an exception if file does not exist.

static LatticeBase* casacore::ImageOpener::openExpr ( const String expr,
const Block< LatticeExprNode > &  nodes,
const String fileName = String() 
)
static

Parse an image expression and return the ImageExpr<T> object for it.

The block of nodes represents optional $i arguments in the expression. The JsonKVMap gives the keys found in a persistent image.expr file.

static LatticeBase* casacore::ImageOpener::openExpr ( const String expr,
const Block< LatticeExprNode > &  nodes,
const String fileName,
const JsonKVMap  
)
static
static LatticeBase* casacore::ImageOpener::openHDF5Image ( const String fileName,
const MaskSpecifier = MaskSpecifier() 
)
static

Open an HDF5 paged image of any data type.

static LatticeBase* casacore::ImageOpener::openImage ( const String fileName,
const MaskSpecifier = MaskSpecifier() 
)
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. Note that class ImageProxy has a function to open an image from a file or from an image expression.

static LatticeBase* casacore::ImageOpener::openImageConcat ( const String fileName)
static

Open a persistent image concatenation of any type.

static LatticeBase* casacore::ImageOpener::openImageExpr ( const String fileName)
static

Open a persistent image expression of any type.

It reads the file written by ImageExpr::save.

static LatticeBase* casacore::ImageOpener::openPagedImage ( const String fileName,
const MaskSpecifier = MaskSpecifier() 
)
static

Open a Casacore paged image of any data type.

static void casacore::ImageOpener::registerOpenImageFunction ( ImageTypes  ,
OpenImageFunction  
)
static

Register an openImageFunction.

Member Data Documentation

std::map<ImageTypes,OpenImageFunction*> casacore::ImageOpener::theirOpenFuncMap
staticprivate

Mapping of the image type to an openImage function.

Definition at line 149 of file ImageOpener.h.


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