MeVisLabToolboxReference
ml::MLImageFormatIOBase Class Reference

IO base class to manage/save/load/modify .mlimage files and to derive specific save, load and modification classes from it. More...

#include <mlImageFormatIOBase.h>

Inheritance diagram for ml::MLImageFormatIOBase:
ml::Module ml::FieldContainer ml::Base ml::MLImageFormatFileCache ml::MLImageFormatInfo ml::MLImageFormatLoad ml::MLImageFormatSave

List of all members.

Public Types

enum  { NumUserTags = 10 }

Public Member Functions

 MLImageFormatIOBase (int numIns=0, int numOuts=0)
 Constructor for a module with numIns inputs and numOuts outputs.
virtual ~MLImageFormatIOBase ()
 Destroy local members and this.
MLImageFormatTagList getUserTagList () const
 Create and return a list of user tags from the userTagFlds array which is to be stored in the file.
virtual void updateUserTagFieldsFromLoader (const MLImageFormat &loader)
 Set user tag fields to the state given by the passed loader object.
virtual void updateTagListFieldFromLoader (const MLImageFormat &loader)
 Set tag list field to the state given by the passed loader object.

Protected Member Functions

Field and parameter handling
virtual void activateAttachments ()
 Update internal module state after (field)reload or clone.
virtual void handleNotification (Field *field)
 Handle field changes of the field field.
Access functions to internal fields and members.
MLImageFormatCompressionParams_getCompressorParams ()
TimeCounter_getTimer ()
BoolField_getIsSavingFld ()
const StringField_getTrueFileNameFld () const
const EnumField_getUpdateModeFld () const
const NotifyField_getStopFld () const
const NotifyField_getRemoveFld () const
const StringField_getStatusFld () const
const ProgressField_getProgressFld () const
const StringField_getTagListFld () const
const StringField *const _getUserTagFlds () const
StringField_getNonConstTagListFld () const
StringField ** _getNonConstUserTagFlds ()
ImageVectorField_getRegionOffsetFld () const
BoolField_getSuppressWorldPosFld () const

Helper functions.

virtual void _setStatus (std::string str="", float progress=0.0, MLErrorCode err=ML_RESULT_OK)
 Update the status and progress field.
virtual void _setProgress (float progressVal)
 Sets the value of the progressFld to progressVal.
virtual void _resetTagFields ()
 Reset tag list field and user tag fields to empty strings.
virtual void _remove (const std::string &fileName, bool updateStatus)
 Remove the field specified by fileName and update the status field with success information if updateStatus is true; otherwise the status field is not changed, even on delete failure.
void _saveCBMethod (MLint id, MLint idNum, MLImageFormatTools::ProcessState state, bool &interrupt)
 Callback method called by _saveCB.
MLErrorCode _overWriteWithInputImage (PagedImage &inImg, MLImageFormat &fileToUpdate, ImageVector voxelShift=ImageVector(0), PagedImage *imgPropsToUpdate=NULL, bool suppressWorldCoordinateUse=false)
 Take the entire input image described in inImg and overwrite the file fileToUpdate, starting at the position given by the world origin of inImg plus voxelShift.
static void _saveCB (MLint id, MLint idNum, MLImageFormatTools::ProcessState state, void *usrData, bool &interrupt)
 Static callback function registered in the save module to get information and interrupt feature.

Detailed Description

IO base class to manage/save/load/modify .mlimage files and to derive specific save, load and modification classes from it.

Definition at line 45 of file mlImageFormatIOBase.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
NumUserTags 

Definition at line 50 of file mlImageFormatIOBase.h.


Constructor & Destructor Documentation

ml::MLImageFormatIOBase::MLImageFormatIOBase ( int  numIns = 0,
int  numOuts = 0 
)

Constructor for a module with numIns inputs and numOuts outputs.

virtual ml::MLImageFormatIOBase::~MLImageFormatIOBase ( ) [virtual]

Destroy local members and this.


Member Function Documentation

MLImageFormatCompressionParams& ml::MLImageFormatIOBase::_getCompressorParams ( ) [inline, protected]

Definition at line 157 of file mlImageFormatIOBase.h.

BoolField& ml::MLImageFormatIOBase::_getIsSavingFld ( ) [inline, protected]

Definition at line 159 of file mlImageFormatIOBase.h.

StringField& ml::MLImageFormatIOBase::_getNonConstTagListFld ( ) const [inline, protected]

Definition at line 169 of file mlImageFormatIOBase.h.

StringField** ml::MLImageFormatIOBase::_getNonConstUserTagFlds ( ) [inline, protected]

Definition at line 170 of file mlImageFormatIOBase.h.

const ProgressField& ml::MLImageFormatIOBase::_getProgressFld ( ) const [inline, protected]

Definition at line 166 of file mlImageFormatIOBase.h.

ImageVectorField& ml::MLImageFormatIOBase::_getRegionOffsetFld ( ) const [inline, protected]

Definition at line 171 of file mlImageFormatIOBase.h.

const NotifyField& ml::MLImageFormatIOBase::_getRemoveFld ( ) const [inline, protected]

Definition at line 164 of file mlImageFormatIOBase.h.

const StringField& ml::MLImageFormatIOBase::_getStatusFld ( ) const [inline, protected]

Definition at line 165 of file mlImageFormatIOBase.h.

const NotifyField& ml::MLImageFormatIOBase::_getStopFld ( ) const [inline, protected]

Definition at line 163 of file mlImageFormatIOBase.h.

BoolField& ml::MLImageFormatIOBase::_getSuppressWorldPosFld ( ) const [inline, protected]

Definition at line 172 of file mlImageFormatIOBase.h.

const StringField& ml::MLImageFormatIOBase::_getTagListFld ( ) const [inline, protected]

Definition at line 167 of file mlImageFormatIOBase.h.

TimeCounter& ml::MLImageFormatIOBase::_getTimer ( ) [inline, protected]

Definition at line 158 of file mlImageFormatIOBase.h.

const StringField& ml::MLImageFormatIOBase::_getTrueFileNameFld ( ) const [inline, protected]

Definition at line 161 of file mlImageFormatIOBase.h.

const EnumField& ml::MLImageFormatIOBase::_getUpdateModeFld ( ) const [inline, protected]

Definition at line 162 of file mlImageFormatIOBase.h.

const StringField* const ml::MLImageFormatIOBase::_getUserTagFlds ( ) const [inline, protected]

Definition at line 168 of file mlImageFormatIOBase.h.

MLErrorCode ml::MLImageFormatIOBase::_overWriteWithInputImage ( PagedImage inImg,
MLImageFormat fileToUpdate,
ImageVector  voxelShift = ImageVector(0),
PagedImage imgPropsToUpdate = NULL,
bool  suppressWorldCoordinateUse = false 
) [protected]

Take the entire input image described in inImg and overwrite the file fileToUpdate, starting at the position given by the world origin of inImg plus voxelShift.

If necessary the min/max values of fileToUpdate are updated. If the optionally passed imgPropsToUpdate is non NULL its min/max values are also updated if they changed due to the update. If suppressWorldCoordinateUse is true (the default is false) then the location of the written inImg in the fileToUpdate will only be determined by the voxelShift; if it is true then its location in world coordinates is determined + voxelShift. Typically the value of _getRegionOffsetFld() is passed as voxelShift. Typically the value of _getSuppressWorldPosFld() is passed as suppressWorldCoordinateUse. This routine also sets up fileToUpdate.setCallback(_saveCB, this) and updates the progress fields. TODO: Currently the entire input image is loaded into memory and stored at once. This should be updated in future.

virtual void ml::MLImageFormatIOBase::_remove ( const std::string &  fileName,
bool  updateStatus 
) [protected, virtual]

Remove the field specified by fileName and update the status field with success information if updateStatus is true; otherwise the status field is not changed, even on delete failure.

virtual void ml::MLImageFormatIOBase::_resetTagFields ( ) [protected, virtual]

Reset tag list field and user tag fields to empty strings.

static void ml::MLImageFormatIOBase::_saveCB ( MLint  id,
MLint  idNum,
MLImageFormatTools::ProcessState  state,
void *  usrData,
bool &  interrupt 
) [static, protected]

Static callback function registered in the save module to get information and interrupt feature.

Parameters:
idthe id of the processed page if a page related state is passed.
idNumthe number if processed page ids in current operation.
statedescribes the current operation while callback is executed.
usrDatapointer to application data specified while this callback function was registered.
interruptif set to true during call the calling operation is assigned to be terminated as soon as possible. If returned false operation can continue.
void ml::MLImageFormatIOBase::_saveCBMethod ( MLint  id,
MLint  idNum,
MLImageFormatTools::ProcessState  state,
bool &  interrupt 
) [protected]

Callback method called by _saveCB.

Parameters:
idthe id of the processed page if a page related state is passed.
idNumthe number if processed page ids in current operation.
statedescribes the current operation while callback is executed.
interruptif set to true during call the calling operation is assigned to be terminated as soon as possible. If returned false operation can continue.
virtual void ml::MLImageFormatIOBase::_setProgress ( float  progressVal) [protected, virtual]

Sets the value of the progressFld to progressVal.

virtual void ml::MLImageFormatIOBase::_setStatus ( std::string  str = "",
float  progress = 0.0,
MLErrorCode  err = ML_RESULT_OK 
) [protected, virtual]

Update the status and progress field.

If the error code is not ML_RESULT_OK then it appends ":" and the error code description.

virtual void ml::MLImageFormatIOBase::activateAttachments ( ) [protected, virtual]

Update internal module state after (field)reload or clone.

Reimplemented from ml::FieldContainer.

Reimplemented in ml::MLImageFormatFileCache, ml::MLImageFormatInfo, ml::MLImageFormatLoad, and ml::MLImageFormatSave.

MLImageFormatTagList ml::MLImageFormatIOBase::getUserTagList ( ) const

Create and return a list of user tags from the userTagFlds array which is to be stored in the file.

virtual void ml::MLImageFormatIOBase::handleNotification ( Field field) [protected, virtual]

Handle field changes of the field field.

Reimplemented from ml::Module.

Reimplemented in ml::MLImageFormatFileCache, ml::MLImageFormatInfo, ml::MLImageFormatLoad, and ml::MLImageFormatSave.

virtual void ml::MLImageFormatIOBase::updateTagListFieldFromLoader ( const MLImageFormat loader) [virtual]

Set tag list field to the state given by the passed loader object.

virtual void ml::MLImageFormatIOBase::updateUserTagFieldsFromLoader ( const MLImageFormat loader) [virtual]

Set user tag fields to the state given by the passed loader object.


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