ImageOpener.h

Classes

ImageOpener -- Definition of image types and handlers (full description)

class ImageOpener

Types

enum ImageTypes

AIPSPP
AIPS++
FITS
FITS
MIRIAD
Miriad
GIPSY
Gipsy
CAIPS
Classic AIPS
UNKNOWN
Unknown

Interface

Public Members
static ImageTypes imageType (const String& fileName)
typedef LatticeBase* OpenImageFunction (const LatticeBase& fileName, const String&)
static void registerOpenImageFunction (ImageTypes, OpenImageFunction*)
static LatticeBase* openImage (const String& fileName, const MaskSpecifier& = MaskSpecifier())
static LatticeBase* openPagedImage (const String& fileName, const MaskSpecifier& = MaskSpecifier())
Private Members
static LatticeBase* unknownImageOpen (const String& name, const MaskSpecifier&)

Description

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.

Member Description

enum ImageTypes

Define the possible image types.

static ImageTypes imageType (const String& fileName)

Return the type of an image with the given name. Will throw an exception if file does not exist.

typedef LatticeBase* OpenImageFunction (const LatticeBase& fileName, const String&)

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.

static void registerOpenImageFunction (ImageTypes, OpenImageFunction*)

Register an openImageFunction.

static LatticeBase* openImage (const String& fileName, const MaskSpecifier& = MaskSpecifier())

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-AIPS++ image types must have been registered to be known.

static LatticeBase* openPagedImage (const String& fileName, const MaskSpecifier& = MaskSpecifier())

Open an AIPS++ paged image of any data type.

static LatticeBase* unknownImageOpen (const String& name, const MaskSpecifier&)

The default openImage function for an unknown image type. It returns a null pointer.