casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
casacore::ImageAttrHandlerCasa Class Reference

Abstract base class for an image attributes handler. More...

#include <ImageAttrHandlerCasa.h>

Inheritance diagram for casacore::ImageAttrHandlerCasa:
casacore::ImageAttrHandler

Public Member Functions

 ImageAttrHandlerCasa ()
 Default construct from the image table. More...
 
ImageAttrHandlerCasaattachTable (const Table &image, Bool createHandler=False)
 Attach the table and return this object. More...
 
virtual ~ImageAttrHandlerCasa ()
 
virtual void flush ()
 Flush the attibrutes if needed. More...
 
virtual Bool hasGroup (const String &name)
 Test if the given attribute group is present. More...
 
virtual Vector< StringgroupNames () const
 Get all attribute group names. More...
 
virtual ImageAttrGroupopenGroup (const String &groupName)
 Get access to a group. More...
 
virtual ImageAttrGroupcreateGroup (const String &groupName)
 Create an attribute group with the given name. More...
 
virtual void closeGroup (const String &groupName)
 Close the group with the given name. More...
 
- Public Member Functions inherited from casacore::ImageAttrHandler
 ImageAttrHandler ()
 Default constructor. More...
 
virtual ~ImageAttrHandler ()
 

Private Attributes

Bool itsCanAdd
 
Table itsImageTable
 
std::map< String,
ImageAttrGroupCasa
itsGroupMap
 

Detailed Description

Abstract base class for an image attributes handler.

Intended use:

Public interface

Review Status

Test programs:
tPagedmage
Demo programs:
dPagedImage

Prerequisite

Etymology

This class makes it possible to store extra attributes with an image to describe atrbitrary meta information.

Synopsis

For LOFAR it was needed to store extra meta information and to be able to convert it from casacore table format to HDF5 format and vice-versa. Furthermore, it must be possible to access the information in a way that arbitrary info can be stored and retrieved.

The attributes are divided into handlers. Each handler can reside in a subtable of the image or in a handler in HDF5. All attributes in a handler have the same number of values, where each value can be a scalar or (small) array. It is possible to define units and measure info for an attribute.

Example

This example shows how to get attributes from an image. make it known to the image.

// Open the image (as readonly for the moment).
PagedImage<Float> myimage ("image.name");
// Get access to attibute handler LOFAR_SOURCE.
ImageExtrAttr& = myimage.attrHandler ("LOFAR_SOURCE");
// Get the data for some field.
Vector<String> names = ImageExtrAttr->getString("NAME");

Motivation

LOFAR needed functionality to store arbitrary attributes.

Definition at line 87 of file ImageAttrHandlerCasa.h.

Constructor & Destructor Documentation

casacore::ImageAttrHandlerCasa::ImageAttrHandlerCasa ( )

Default construct from the image table.

virtual casacore::ImageAttrHandlerCasa::~ImageAttrHandlerCasa ( )
virtual

Member Function Documentation

ImageAttrHandlerCasa& casacore::ImageAttrHandlerCasa::attachTable ( const Table image,
Bool  createHandler = False 
)

Attach the table and return this object.

It looks for the table keyword ATTRGROUPS which contains the subtables defining the attribute groups. If the keyword does not exist, it will be added if createHandler is set. Otherwise the handler is an empty one and no groups can be added to it.

virtual void casacore::ImageAttrHandlerCasa::closeGroup ( const String groupName)
virtual

Close the group with the given name.

It will flush its attributes. Nothing is done if it is not open.

Reimplemented from casacore::ImageAttrHandler.

virtual ImageAttrGroup& casacore::ImageAttrHandlerCasa::createGroup ( const String groupName)
virtual

Create an attribute group with the given name.

Reimplemented from casacore::ImageAttrHandler.

virtual void casacore::ImageAttrHandlerCasa::flush ( )
virtual

Flush the attibrutes if needed.

Reimplemented from casacore::ImageAttrHandler.

virtual Vector<String> casacore::ImageAttrHandlerCasa::groupNames ( ) const
virtual

Get all attribute group names.

Reimplemented from casacore::ImageAttrHandler.

virtual Bool casacore::ImageAttrHandlerCasa::hasGroup ( const String name)
virtual

Test if the given attribute group is present.

Reimplemented from casacore::ImageAttrHandler.

virtual ImageAttrGroup& casacore::ImageAttrHandlerCasa::openGroup ( const String groupName)
virtual

Get access to a group.

Reimplemented from casacore::ImageAttrHandler.

Member Data Documentation

Bool casacore::ImageAttrHandlerCasa::itsCanAdd
private

Definition at line 124 of file ImageAttrHandlerCasa.h.

std::map<String,ImageAttrGroupCasa> casacore::ImageAttrHandlerCasa::itsGroupMap
private

Definition at line 126 of file ImageAttrHandlerCasa.h.

Table casacore::ImageAttrHandlerCasa::itsImageTable
private

Definition at line 125 of file ImageAttrHandlerCasa.h.


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