ml::MLImageFormatIOBase Class Reference

Save module for MLImageFormat. More...

#include <mlImageFormatIOBase.h>

Inheritance diagram for ml::MLImageFormatIOBase:

ml::BaseOp 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 ()
VectorField_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 (PagedImg &inImg, MLImageFormat &fileToUpdate, Vector voxelShift=Vector(0), PagedImg *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

Save module for MLImageFormat.

Definition at line 42 of file mlImageFormatIOBase.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
NumUserTags 

Definition at line 47 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 154 of file mlImageFormatIOBase.h.

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

Definition at line 156 of file mlImageFormatIOBase.h.

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

Definition at line 166 of file mlImageFormatIOBase.h.

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

Definition at line 167 of file mlImageFormatIOBase.h.

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

Definition at line 163 of file mlImageFormatIOBase.h.

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

Definition at line 168 of file mlImageFormatIOBase.h.

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

Definition at line 161 of file mlImageFormatIOBase.h.

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

Definition at line 162 of file mlImageFormatIOBase.h.

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

Definition at line 160 of file mlImageFormatIOBase.h.

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

Definition at line 169 of file mlImageFormatIOBase.h.

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

Definition at line 164 of file mlImageFormatIOBase.h.

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

Definition at line 155 of file mlImageFormatIOBase.h.

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

Definition at line 158 of file mlImageFormatIOBase.h.

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

Definition at line 159 of file mlImageFormatIOBase.h.

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

Definition at line 165 of file mlImageFormatIOBase.h.

MLErrorCode ml::MLImageFormatIOBase::_overWriteWithInputImage ( PagedImg inImg,
MLImageFormat &  fileToUpdate,
Vector  voxelShift = Vector(0),
PagedImg 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:
id the id of the processed page if a page related state is passed.
idNum the number if processed page ids in current operation.
state describes the current operation while callback is executed.
usrData pointer to application data specified while this callback function was registered.
interrupt if 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:
id the id of the processed page if a page related state is passed.
idNum the number if processed page ids in current operation.
state describes the current operation while callback is executed.
interrupt if 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:

Generated on Sat Sep 3 18:39:39 2011 for MeVisLab Toolbox Reference by  doxygen 1.5.8