class DfcActualImageInfo : public DfcImageInfoInterface


Inheritance:


Public Fields

int numPlanes
Pointer to the actual data

Public Methods

void addAxis (DfcAxisInfo *newAxis)
DfcActualImageInfo* clone (void)
void copy ( const DfcActualImageInfo &other )
DfcActualImageInfo ( const DfcActualImageInfo &other )
DfcActualImageInfo ( const RWString &name, const RWTValSlist<DfcAxis> &axes, int numPlanes, DfcImageInfoInterface::TYPE storageRep = DfcImageInfoInterface::DOUBLE, const RWString &unitType = "" )
DfcActualImageInfo ( const DfcImageInfoInterface &other )
DfcAxis* getAxis ( const RWString &whichAxis )
DfcAxis* getAxis ( int whichAxis )
const RWString& getDataUnit (void)
DfcKeyword* getKeywords (void)
RWString getName (void)
int getNumAxes (void)
int getNumPlanes (void)
DfcImageInfoInterface::TYPE getStoredType (void)
DfcImageInfoInterface::TYPE getType (void)
DFC_BOOL openForRead ( const DfcIO_Strategy &strategy )
DFC_BOOL openForUpdate ( const DfcIO_Strategy &strategy )
DfcActualImageInfo& operator= (const DfcImageInfoInterface &other)
DfcActualImageInfo& operator= (const DfcActualImageInfo &other)
void proxyIsDead (void)
void setDataUnit ( const RWString &newUnit )
void setStoredType (DfcImageInfoInterface::TYPE type)
DFC_BOOL write ( const DfcIO_Strategy &strategy )
virtual ~DfcActualImageInfo (void)

Public


Purpose
Returns information about one of the axes in the Image

Purpose
Adds another axis to the image information

Purpose
Constructor

Purpose
Copy Constructor

Purpose
Copy Constructor

Purpose
Obtain the name of the image

Purpose
Query the imageInfo about the storage type of the data

Purpose
Returns the number of planes in the image

Purpose
Query the Image about its dimensionality

Purpose
Obtain a reference to the Keywords that are associated with the Image

Purpose
Returns information about one of the axes in the Image

VLT On-line Data Flow, Subsystem: df-core
$Id: DfcActualImageInfo

Purpose
Makes the object write itself

Purpose
Makes the ImageInfo instance read itself from file / server / whatever

Purpose
Makes the ImageInfo instance read itself from file / server / whatever

Purpose
Accesses the unit that is associated with the values stored in each pixel in this Image

Purpose
Sets the data unit for this axis

Purpose
Perform a deep copy of this object

Purpose
Perform a shallow copy of this object from another

Purpose
Perform a shallow copy of this object from another

Protected Methods

DfcImageInfo* getSafeInterface (void)

Protected


Purpose
Obtain a proxy object for this object

Private Fields


Proxy object is stored in the actual object
DfcKeywordStructure keywords
array of axes in the image
RWString name
Purpose
Informs this object that its proxy object has been deleted
DfcImageInfo* proxy
1 - each pixel is a scalar value, otherwise it is a vector
DfcImageInfoInterface::TYPE type
A textual representation of the quantity represented by the values in the Image

Private


Pointer to the Keywords associated with this ImageInfo object

Documentation

VLT On-line Data Flow, Subsystem: df-core
$Id: DfcActualImageInfo.h,v 1.1 1997/05/15 07:45:30 dataflow Exp $

DESCRIPTION
This class implements the interface presented in DfcImageInfoInterface.h

ImageInfo contains all the information about an Image EXCEPT the actual image data itself. It presents a good way of allowing objects, such as a Frame, to accesss only relevant information about an Image.
The user shouldn't be concerned with creating istances of this class, just obtaining and using them.

To find out how to obtain the data part of the Image, see the Image class.

EXAMPLES

    for (int image = 0; image < myFrame.getNumImages(); image++)
  {
    DfcImageInfo currentImage = myFrame.getImageInfo(image);
    cout << currentImage.getName() << endl;
  } 

    try
  {
    DfcImageInfo myInfoObj = myFrame.getImageInfo("someName");
  }
  catch(DfcDoesntExistExc exc)
  {
    cerr << "Frame doesn't contain an ImageInfo object of that name\n";
  }
  

DESIGN NOTES
Previously the ImageInfo class was the base class for an Image hierarchy so that downcasting from the ImageInfo class to, say DfcImage<float> would then yield the methods necessary to access the image data. ImageInfo has been seperated for three reasons:
1 - As pointed out in the first design review the semantics of such a hierarchy are questionable.
2 - It is desired that, regardless of whatever format the data is stored in, it should be possible to load the data into memory as any type. This means delaying the actual creation of an Image instance until the user specifies what type each pixel is to be represented as. This necessitates splitting the ImageInfo class from the Image hierarchy.
3 - The requirement for fast access to Image headers only.

The class "ActualImageInfo" is the actual object that is stored in both DfcFrame and associated with DfcImageBase. The derived class "DfcImageInfo" is a proxy object which manipualtes one of these objects. The proxy is provided to prevent the user from deleting the ActualImageInfo object.

DfcActualImageInfo( const RWString &name, const RWTValSlist<DfcAxis> &axes, int numPlanes, DfcImageInfoInterface::TYPE storageRep = DfcImageInfoInterface::DOUBLE, const RWString &unitType = "" )

Purpose
Constructor.

Arguments

DfcActualImageInfo( const DfcActualImageInfo &other )

Purpose
Copy Constructor. A shallow copy is performed (see operator=()).

Arguments

DfcActualImageInfo( const DfcImageInfoInterface &other )

Purpose
Copy Constructor. A shallow copy is performed (see operator=()).

Arguments

RWString getName(void)

Purpose
Obtain the name of the image

DfcImageInfoInterface::TYPE getType(void)

Purpose
Query the imageInfo about the storage type of the data. If a local copy of the image exists then the result will be the storage type on the local machine, otherwise it will be the storage type in the image repository.

Returns
An indication of the type of data the image is composed of. This may be vectors, or it may be scalar pixels.

DfcImageInfoInterface::TYPE getStoredType(void)

void setStoredType(DfcImageInfoInterface::TYPE type)

int getNumPlanes(void)

Purpose
Returns the number of planes in the image. The number of planes is the number of elements that each pixel in the image consists of. For example, in an image where each pixel represents a single value, the number of planes will be 1. In an image where each pixel is a vector that contains 3 elements the number of p[lanes will be 3 etc.

int getNumAxes(void)

Purpose
Query the Image about its dimensionality.

Returns
The number of axes in the Image, will be 1, 2, 3 or 4.

DfcKeyword* getKeywords(void)

Purpose
Obtain a reference to the Keywords that are associated with the Image.

Returns
A reference to a DfcKeywordStructure instance. This is the top level structure associated with this Image. An iterator can be obtained from this Structure.

DfcAxis* getAxis( int whichAxis )

Purpose
Returns information about one of the axes in the Image.

Preconditions
0 <= whichAxis < getNumAxes();

Returns
A reference to the requested axis. Note that it is a reference - do NOT delete it.

Exceptions

  • DfcBoundsExc - whichAxis is not a valid axis.

Arguments

DfcAxis* getAxis( const RWString &whichAxis )

Purpose
Returns information about one of the axes in the Image.

Returns
A reference to the requested axis.

Exceptions

  • DfcDoesntExist - whichAxis is not a valid axis.

Arguments

DFC_BOOL write( const DfcIO_Strategy &strategy )

Purpose
Makes the object write itself. The object writes itself in terms of calls to the methods in the DfcIO_Strategy instance.

Returns
Boolean indication of whether the saving of the data was succesful or not.

Exceptions

  • DfcReadOnlyExc - the class cannot be read back because it has been opened as a read only class.

Arguments

DFC_BOOL openForUpdate( const DfcIO_Strategy &strategy )

Purpose
Makes the ImageInfo instance read itself from file / server / whatever. The ImageInfo object only needs to make invocations of the methods in the supplied IO_Strategy object to obtain its data. In this way the source and format of the data is completely transparent to it.

Returns
Boolean indicating whether the data was succesfully read or not.

Exceptions

  • DfcMemoryExc - while trying to create the sub-objects to hold the data locally, not enough memory was available.
  • DfcAlreadyOpenExc - the object is already opened somewhere else.

Arguments

DFC_BOOL openForRead( const DfcIO_Strategy &strategy )

Purpose
Makes the ImageInfo instance read itself from file / server / whatever. The ImageInfo object only needs to make invocations of the methods in the supplied IO_Strategy object to obtain its data. In this way the source and format of the data is completely transparent to it.

Returns
Boolean indicating whether the data was succesfully read or not.

Exceptions

  • DfcMemoryExc - while trying to create the sub-objects to hold the data locally, not enough memory was available.
  • DfcAlreadyOpenExc - the object is already open for update somewhere else.

Arguments

const RWString& getDataUnit(void)

Purpose
Accesses the unit that is associated with the values stored in each pixel in this Image. This is merely a string for maximum flexibility.

Returns
Reference (constant) to a RWString.

void setDataUnit( const RWString &newUnit )

Purpose
Sets the data unit for this axis. The data unit is not a unique type, merely a string for information purposes.

Arguments

DfcActualImageInfo* clone(void)

Purpose
Perform a deep copy of this object.

Returns
A pointer to the copy of this object. Responsibility for memory management transfers to the invoker of the method.

Exceptions

  • DfcAlreadyOpenExc - if an attempt is made to clone an object that is already update, this exception results.
  • DfcMemoryExc - there isn't enough memory on the local machine to perform the clone operation.

DfcActualImageInfo& operator=(const DfcActualImageInfo &other)

Purpose
Perform a shallow copy of this object from another.

Returns
Reference to this object to allow chaining together of assignment statements.

Exceptions

  • DfcAlreadyOpenExc - if an attempt is made to assign from an object that is already update, this exception results.
  • DfcMemoryExc - there isn't enough memory on the local machine to perform the copying.

Arguments

DfcActualImageInfo& operator=(const DfcImageInfoInterface &other)

Purpose
Perform a shallow copy of this object from another.

Returns
Reference to this object to allow chaining together of assignment statements.

Exceptions

  • DfcAlreadyOpenExc - if an attempt is made to assign from an object that is already update, this exception results.
  • DfcMemoryExc - there isn't enough memory on the local machine to perform the copying.

Arguments

void copy( const DfcActualImageInfo &other )

void addAxis(DfcAxisInfo *newAxis)

Purpose
Adds another axis to the image information. This method only exists in this particular class. This prevents anyone who obtains the DfcImageInfo class from addign extra axes on, but allows the DfcImage classes to do it.
This method gives responsibility of the memory management of the axis to this object. The invoking method MUST not delete the axis or chaos will ensue and there will be much wailing and nashing of teeth.

virtual ~DfcActualImageInfo(void)

DfcImageInfo* getSafeInterface(void)

Purpose
Obtain a proxy object for this object.

void proxyIsDead(void)

RWString name
Purpose
Informs this object that its proxy object has been deleted. This allows it to make sure there are no dangling pointers.
This method cannot be legitimately called as the proxy has no proxies. Therefore it does nothing but is provided to make this class concrete.

DfcImageInfoInterface::TYPE type
A textual representation of the quantity represented by the values in the Image

DfcKeywordStructure keywords
array of axes in the image

Pointer to the Keywords associated with this ImageInfo object. By default it will be a KeywordStructure that simply contains no Keywords at all.

int numPlanes
Pointer to the actual data. Null by default. Can only be set by the ImageBase end of the association to ensure that things are initialised properly.

DfcImageInfo* proxy
1 - each pixel is a scalar value, otherwise it is a vector

Proxy object is stored in the actual object. Although this creates bidirectional assosciations between objects it simplifies memory managemenet greatly in the absence of garbage collecting.


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de