MeVisLabToolboxReference
|
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>
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. |
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.
anonymous enum |
Definition at line 50 of file mlImageFormatIOBase.h.
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.
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.
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.
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.