Main Page   Class Overview   Pixels   Images   Geometry   Quick Index  

HxMfBroadestSig Class Reference

Class definition of method frame for broadest signature. More...

#include <HxMfBroadestSig.h>

List of all members.

Public Methods

 HxMfBroadestSig (HxImageData *objImg, HxImageData *argImg, int pixDim=0, int makeResult=1)
 Constructor. More...

 ~HxMfBroadestSig ()
 Destructor. More...

HxImageDataobject () const
 The object image of the frame. More...

HxImageDataargument () const
 The argument image of the frame. More...

HxImageDataresult () const
 The result image of the frame. More...


Detailed Description

Class definition of method frame for broadest signature.

This method frame is used to allow for heterogeneous image data types.


Constructor & Destructor Documentation

HxMfBroadestSig::HxMfBroadestSig HxImageData   objImg,
HxImageData   argImg,
int    pixDim = 0,
int    makeResult = 1
 

Constructor.

Object() will point to a copy of objImg with a signature equal to the broadest of objImg and argImg and sizes equal to the maximum of objImg and argImg. However, if (pixDim != 0) it will have the specified pixel dimensionality. In case the signature of argImg is not equal to the signature of object() a temporary image with that signature will be created for argument() with the same pixel values as argImg. if (makeResult == 1) the result will actually be allocated (and used by object()). if (makeResult == 0) there is no result image and a temporary image (with the broadest signature) may have to be allocated for object().

00023                                     : 
00024         _object(objImg), _argument(argImg), _tmpArg(0), _tmpObj(0)
00025 {
00026     if (!_object || !_argument)
00027         return;
00028 
00029     HxImageSignature objSig(_object->signature());
00030     HxImageSignature argSig(_argument->signature());
00031     HxImageSignature resultSig(objSig.broadest(argSig));
00032     if (pixDim != 0)
00033         resultSig.setPixelDimensionality(pixDim);
00034     HxSizes sizes = std::max(_object->sizes(), _argument->sizes());
00035 
00036     if (!argSig.isEqual(resultSig)) {
00037         _tmpArg = HxImgDataFactory::instance().makeImage(resultSig, sizes);
00038         _tmpArg->set(_argument);
00039         _argument = _tmpArg;
00040     }
00041 
00042     if (makeResult) {
00043         _result = HxImgDataFactory::instance().makeImage(resultSig, sizes);
00044         if (_result)
00045             _result->set(_object);
00046         _object = _result;
00047     } else { // since we did not make the result (and the new object) we
00048              // may have to "adjust" the object sig to match the broadest
00049         if (!objSig.isEqual(resultSig)) {
00050             _tmpObj = HxImgDataFactory::instance().makeImage(resultSig, sizes);
00051             _tmpObj->set(_object);
00052             _object = _tmpObj;
00053         }
00054     }
00055 }

HxMfBroadestSig::~HxMfBroadestSig  
 

Destructor.

00058 {
00059     if (_tmpArg) 
00060         delete _tmpArg;
00061     if (_tmpObj) 
00062         delete _tmpObj;
00063 }


Member Function Documentation

HxImageData * HxMfBroadestSig::object   const
 

The object image of the frame.

00067 { 
00068     return _object; 
00069 }

HxImageData * HxMfBroadestSig::argument   const
 

The argument image of the frame.

00073 { 
00074     return _argument; 
00075 }

HxImageData * HxMfBroadestSig::result   const
 

The result image of the frame.

00079 { 
00080     return _result; 
00081 }


The documentation for this class was generated from the following files:
Generated on Tue Jan 8 13:59:32 2002 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001