Loading...
Searching...
No Matches
casacore::ImageAttrHandlerCasa Class Reference
images package (libcasa_images) » Images_module

More...

`#include <ImageAttrHandlerCasa.h>`

## Public Member Functions

| ImageAttrHandlerCasa ()
| Default construct from the image table.
ImageAttrHandlerCasa & | attachTable (const Table &image, Bool createHandler=False)
| Attach the table and return this object.
virtual | ~ImageAttrHandlerCasa ()
virtual void | flush ()
| Flush the attibrutes if needed.
virtual Bool | hasGroup (const String &name)
| Test if the given attribute group is present.
virtual Vector< String > | groupNames () const
| Get all attribute group names.
virtual ImageAttrGroup & | openGroup (const String &groupName)
| Get access to a group.
virtual ImageAttrGroup & | createGroup (const String &groupName)
| Create an attribute group with the given name.
virtual void | closeGroup (const String &groupName)
| Close the group with the given name.
Public Member Functions inherited from casacore::ImageAttrHandler
| ImageAttrHandler ()
| Default constructor.
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

- ImageInterface

### 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");
casacore::PagedImage
Definition PagedImage.h:134
casacore::Vector
Definition Vector.h:82

### Motivation

LOFAR needed functionality to store arbitrary attributes.

Definition at line 85 of file ImageAttrHandlerCasa.h.

## Constructor & Destructor Documentation

## ImageAttrHandlerCasa()

casacore::ImageAttrHandlerCasa::ImageAttrHandlerCasa | ( |  | ) |

Default construct from the image table.

Referenced by attachTable().

## ~ImageAttrHandlerCasa()

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

virtual

## Member Function Documentation

## attachTable()

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.

References casacore::False, and ImageAttrHandlerCasa().

## closeGroup()

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.

## createGroup()

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

virtual

Create an attribute group with the given name.

Reimplemented from casacore::ImageAttrHandler.

## flush()

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

virtual

Flush the attibrutes if needed.

Reimplemented from casacore::ImageAttrHandler.

## groupNames()

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

virtual

Get all attribute group names.

Reimplemented from casacore::ImageAttrHandler.

## hasGroup()

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

virtual

Test if the given attribute group is present.

Reimplemented from casacore::ImageAttrHandler.

References casacore::name().

## openGroup()

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

virtual

Get access to a group.

Reimplemented from casacore::ImageAttrHandler.

## Member Data Documentation

## itsCanAdd

Bool casacore::ImageAttrHandlerCasa::itsCanAdd

private

Definition at line 122 of file ImageAttrHandlerCasa.h.

## itsGroupMap

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

private

Definition at line 124 of file ImageAttrHandlerCasa.h.

## itsImageTable

Table casacore::ImageAttrHandlerCasa::itsImageTable

private

Definition at line 123 of file ImageAttrHandlerCasa.h.

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

- images/Images/ImageAttrHandlerCasa.h