MeVisLab Toolbox Reference
ml::DirectDicomImportOtherImporter Class Reference

Derived importer to import non DICOM files into DirectDicomImport. More...

#include <mlDirectDicomImportOtherImporter.h>

Inheritance diagram for ml::DirectDicomImportOtherImporter:
ml::DirectDicomImportImporterBase ml::ProgressLogger

Public Member Functions

 DirectDicomImportOtherImporter (DirectDicomImport &ddiOp)
 Constructor using a DirectDicomImport instance associated with. More...
 
 ~DirectDicomImportOtherImporter () override
 Destructor. More...
 
void appendFields (FieldContainer &fieldContainer) override
 Creates and appends all parameter fields for this importer. To be called in constructor. More...
 
void handleNotification (Field &field) override
 Handles changes of fields added by appendFields. More...
 
void import (const FileListTools::FileList &fileList) override
 Builds MultiFileVolume(s) from files provided by fileList. More...
 
- Public Member Functions inherited from ml::DirectDicomImportImporterBase
 DirectDicomImportImporterBase (DirectDicomImport &ddiOp)
 Constructor using a DirectDicomImport instance associated with. More...
 
 ~DirectDicomImportImporterBase () override
 Destructor. More...
 
void updateProgressIndicator (const std::string &info, float percState) override
 Update a progress indicator which shows the message info and the percentage percState. More...
 
void _updateConsole (bool fullUpdate=true) override
 Updates the output console if there is any. More...
 
virtual DicomConfigurableMessageFilterBaseRefCountedPtr getMessageCollector () const
 Privides access to the message collector of the internally referenced DDI instance. More...
 
- Public Member Functions inherited from ml::ProgressLogger
 ProgressLogger (std::stringstream *outputStream=nullptr, NotifyField *intCheckField=nullptr, StringField *statusField=nullptr, bool useRichTextCoding=true)
 Default and convenience constructor. More...
 
virtual ~ProgressLogger ()
 Destructor. More...
 
void setAutoNewLineTermination (bool on)
 Enable/disable automatic newline termination of logged messages. More...
 
bool isAutoNewLineTerminationOn () const
 Returns enabled/disabled automatic newline termination of logged messages. More...
 
virtual bool messageHook (const ProgressLogger &, MLMessageType, const std::string *, const std::string *, MLErrorCode *, const std::string *, unsigned int *)
 All logging methods pass their function arguments through this hook which allows to collect all messages sent to the ProgressLogger. More...
 
void logAnyMessage (std::string msg, unsigned int formatFlags=NoFlags)
 Log any string into the console. More...
 
void logFatalError (const std::string &func, MLErrorCode err, const std::string &reason)
 Logs a fatal error, an error, warning or information to the defined output stream/console. More...
 
void logError (const std::string &func, MLErrorCode err, const std::string &reason)
 See logFatalError() for details. More...
 
void logWarning (const std::string &func, MLErrorCode err, const std::string &reason)
 See logFatalError() for details. More...
 
void logInfo (const std::string &func, const std::string &reason="")
 Same as logFatalError, logError, and logWarning, but logging only information without error. More...
 
void logFullFatalError (const std::string &func, MLErrorCode err, const std::string &reason)
 Logs a fatal error, an error, warning or information to the defined output stream/console and sends the information also to the MeVisLab error handler. More...
 
void logFullError (const std::string &func, MLErrorCode err, const std::string &reason)
 See logFullFatalError() for details. More...
 
void logFullWarning (const std::string &func, MLErrorCode err, const std::string &reason)
 See logFullFatalError() for details. More...
 
void logFullInfo (const std::string &func, const std::string &reason)
 Same as logFullFatalError, logFullError, and logFullWarning, but logging only information without error. More...
 
bool getRichTextCodingFlag () const
 If enabled (the default) then outputs newlines are always converted to hyper/rich text line separators (
) and different message types get different colors; if false then
contents they are always converted to normal newline characters and rich/hypertext color statements are not inserted. More...
 
void setRichTextCodingFlag (bool useRichTextCoding)
 See getRichTextCodingFlag() for details. More...
 
bool getUpdateProgressDuringInterruptChecksFlag () const
 If enabled then progress updates are performed on each interrupt check; this is useful to enable the busy cursor together with interrupt checks. More...
 
void setUpdateProgressDuringInterruptChecksFlag (bool callUpdateProgressDuringInterruptChecks)
 See getUpdateProgressDuringInterruptChecksFlag() for details. More...
 
void setStatusUpdateTimeIntervalInSeconds (double checkIntervalInSeconds)
 Sets a time interval which is used to avoid that too many Module::updateProgress() calls are performed to update the user interfaces (which usually are very expensive); default is 1 second. More...
 
double getStatusUpdateTimeIntervalInSeconds () const
 Returns the currently set Module::updateProgress() call time interval when status fields are updated. More...
 
void setCheckTimeIntervalInSeconds (double checkIntervalInSeconds)
 Sets a time interval which is used to avoid that too many interruption checks are performed which usually are very expensive, default is 1 second. More...
 
double getCheckTimeIntervalInSeconds () const
 Returns the currently set interrupt check time interval. More...
 
void setInterruptCheckFunction (InterruptCheckFunc checkFunc, void *userData)
 Set a function which actually does a check for interrupts and its user data. More...
 
InterruptCheckFunc getInterruptCheckFunction () const
 Returns the currently set function for interrupt checks. More...
 
void * getInterruptCheckFunctionUserData () const
 Returns the currently set user data pointer for interrupt checks. More...
 
void setInterruptCheckField (NotifyField *interruptField=nullptr)
 Set a NotifyField which shall be checked for button presses which mean interruptions; ignored if nullptr. More...
 
NotifyFieldgetInterruptCheckField () const
 Return the currently set NotifyField pointer which shall be checked for button presses; default is nullptr. More...
 
void setStatusField (StringField *statusField)
 Set a StringField which always shall be updated with all logged messages; ignored if nullptr. More...
 
StringFieldgetStatusField () const
 Return the currently set StringField pointer which is updated on logged messages; default is nullptr. More...
 
virtual bool wasInterrupted ()
 If the interruption flag is already set then immediately true is returned. More...
 
virtual bool getInterruptedFlag () const
 Returns current state of interruption flag (but does not check for interruption). More...
 
virtual void setInterruptedFlag (bool wasInterrupted)
 Sets current state of interruption flag (but does not check for interruption). More...
 
virtual bool orToInterruptedFlag (bool wasInterrupted)
 Update interruption flag by ORing the passed flag to the internal flag and then returning the flag (but does not check for interruption). More...
 
void setHadFlags (bool hadFlag)
 Sets all had*Flags to hadFlag. More...
 
void setFatalErrorMessagePrefix (const std::string &msg)
 Set/get prefixes for messages. More...
 
void setErrorMessagePrefix (const std::string &msg)
 
void setWarningMessagePrefix (const std::string &msg)
 
void setInfoMessagePrefix (const std::string &msg)
 
std::string getFatalErrorMessagePrefix () const
 
std::string getErrorMessagePrefix () const
 
std::string getWarningMessagePrefix () const
 
std::string getInfoMessagePrefix () const
 
bool hadFatalError () const
 Returns true if any fatal error, error, warning or info was logged; can be reset with corresponding setHad*Flag(). More...
 
bool hadError () const
 
bool hadWarning () const
 
bool hadInfo () const
 
void setHadFatalErrorFlag (bool hadFatalErrorFlag)
 Sets the state of the corresponding _had* member; used to clear recent logging states. More...
 
void setHadErrorFlag (bool hadErrorFlag)
 
void setHadWarningFlag (bool hadWarningFlag)
 
void setHadInfoFlag (bool hadInfoFlag)
 

Protected Member Functions

virtual void _determineProperties (const FileListTools::FileList &fileList, std::vector< _FilePropHelper > &filePropVec, float progressStart, float progressEnd)
 Determine a vector of image properties and file names of loadable files. More...
 
virtual void _propertySort (std::vector< _FilePropHelper > &filePropVec)
 Sort filePropVec according image extent and file name given by the vector entries. More...
 
virtual size_t _composeAndAppendVolumes (const std::vector< _FilePropHelper > &filePropVec, const FileListTools::FileList &fileList, DicomMessageCollector &dcmMsgCollector)
 Compose same sized images with same voxel type of entries in filePropVec to volumes and append those volume to the volume list; all other images are appended as single volumes. More...
 
virtual void _postProcessVolumes (size_t lastNumVolumesToProcess)
 Some settings can be set up best after full composition of the volumes, for example storing the image meta data in MultiFileVolume options; this function processes the most recent lastNumVolumesToProcess in _getOutVolumeList(). More...
 
virtual void _appendMetaData (ImagePropertyExtensionContainer &imgPropContainer, const std::string &metaData, const std::string &fileName)
 Append tag dump (and file name for entry when it's created) to an ImagePropertyExtension entry. More...
 
virtual void _appendNewDirectVolumeReferenceFromFilePropHelper (const _FilePropHelper &fileProp, const FileListTools::FileList &fileList, DicomMessageCollector &dcmMsgCollector)
 Creates and append a new DirectDicomVolumeReference with settings from a _FilePropHelper. More...
 
- Protected Member Functions inherited from ml::DirectDicomImportImporterBase
virtual MultiFileVolumeList_getOutVolumeList ()
 Modifiable list of DirectDicomImportVolumeReferences to which new volumes are going to be appended during the import process. More...
 
- Protected Member Functions inherited from ml::ProgressLogger
std::string _doAutoNewLineTerminate (const std::string &msg) const
 Helper to terminate msg with newline at end according. More...
 
virtual bool _isStopPressed () const
 Checks for interruption with currently set _checkFunc or _interruptCheckField or returns false if not available. More...
 

Additional Inherited Members

- Public Types inherited from ml::ProgressLogger
enum  FormatFlags {
  NoFlags = 0 , Bold = 1 , Green = 2 , Yellow = 4 ,
  Red = 8 , Blue = 16
}
 Enumerator describing some formatting flags. More...
 
typedef bool(* InterruptCheckFunc) (void *userData)
 Function type to check to for an interruption. More...
 
- Static Public Member Functions inherited from ml::ProgressLogger
static bool isPressedField (NotifyField *fieldToCheck)
 Convenience implementation of an interrupt check function if user of this class does not want to implement his own check callback but only wants to check a NotifyField for presses. More...
 
- Static Protected Member Functions inherited from ml::ProgressLogger
static void _updateProgressIndicatorCB (void *userData, const std::string &info, float state)
 Static callback version to update a progress indicator about the current import state. More...
 

Detailed Description

Derived importer to import non DICOM files into DirectDicomImport.

Definition at line 29 of file mlDirectDicomImportOtherImporter.h.

Constructor & Destructor Documentation

◆ DirectDicomImportOtherImporter()

ml::DirectDicomImportOtherImporter::DirectDicomImportOtherImporter ( DirectDicomImport ddiOp)

Constructor using a DirectDicomImport instance associated with.

◆ ~DirectDicomImportOtherImporter()

ml::DirectDicomImportOtherImporter::~DirectDicomImportOtherImporter ( )
override

Destructor.

Member Function Documentation

◆ _appendMetaData()

virtual void ml::DirectDicomImportOtherImporter::_appendMetaData ( ImagePropertyExtensionContainer imgPropContainer,
const std::string &  metaData,
const std::string &  fileName 
)
protectedvirtual

Append tag dump (and file name for entry when it's created) to an ImagePropertyExtension entry.

Parameters
imgPropContainerThe container to which the entry is added if it still does not exist, otherwise the first StringImagePropertyExtension will be used.
metaDataThe meta data string to be set in first entry or to be appended if the extension already exists.
fileNameThe file name to be set if the extension entry is not found and created.

◆ _appendNewDirectVolumeReferenceFromFilePropHelper()

virtual void ml::DirectDicomImportOtherImporter::_appendNewDirectVolumeReferenceFromFilePropHelper ( const _FilePropHelper &  fileProp,
const FileListTools::FileList fileList,
DicomMessageCollector dcmMsgCollector 
)
protectedvirtual

Creates and append a new DirectDicomVolumeReference with settings from a _FilePropHelper.

Parameters
filePropThe file property providing basic information (such as file name, image properties, format etc.) used to initialize the newly created and appended VolumeReference.
fileListThe list of files and their properties from which the volume was/is created.
dcmMsgCollectorCollects error, info and issue messages (typically related to a handle).

◆ _composeAndAppendVolumes()

virtual size_t ml::DirectDicomImportOtherImporter::_composeAndAppendVolumes ( const std::vector< _FilePropHelper > &  filePropVec,
const FileListTools::FileList fileList,
DicomMessageCollector dcmMsgCollector 
)
protectedvirtual

Compose same sized images with same voxel type of entries in filePropVec to volumes and append those volume to the volume list; all other images are appended as single volumes.

Parameters
filePropVecThe vector of file properties whose elements shall be composed to groups of same sized volumes.
fileListThe list of files and their properties from which the volume was/is created.
dcmMsgCollectorCollects error, info and issue messages (typically related to a handle).
Returns
The number of newly added MultiFileVolumes.

◆ _determineProperties()

virtual void ml::DirectDicomImportOtherImporter::_determineProperties ( const FileListTools::FileList fileList,
std::vector< _FilePropHelper > &  filePropVec,
float  progressStart,
float  progressEnd 
)
protectedvirtual

Determine a vector of image properties and file names of loadable files.

Parameters
fileListImageVector containing all files potentially including suppressed and DICOM files.
filePropVecA vector of image properties together with file names first cleared and then filled with image properties and file names of loadable files.
progressStartStart of the display range of the progress indicator.
progressEndEnd of the display range of the progress indicator.

◆ _postProcessVolumes()

virtual void ml::DirectDicomImportOtherImporter::_postProcessVolumes ( size_t  lastNumVolumesToProcess)
protectedvirtual

Some settings can be set up best after full composition of the volumes, for example storing the image meta data in MultiFileVolume options; this function processes the most recent lastNumVolumesToProcess in _getOutVolumeList().

If std::string::npos is passed then all volumes will be post processed.

◆ _propertySort()

virtual void ml::DirectDicomImportOtherImporter::_propertySort ( std::vector< _FilePropHelper > &  filePropVec)
protectedvirtual

Sort filePropVec according image extent and file name given by the vector entries.

◆ appendFields()

void ml::DirectDicomImportOtherImporter::appendFields ( FieldContainer fieldContainer)
overridevirtual

Creates and appends all parameter fields for this importer. To be called in constructor.

Reimplemented from ml::DirectDicomImportImporterBase.

◆ handleNotification()

void ml::DirectDicomImportOtherImporter::handleNotification ( Field field)
overridevirtual

Handles changes of fields added by appendFields.

Reimplemented from ml::DirectDicomImportImporterBase.

◆ import()

void ml::DirectDicomImportOtherImporter::import ( const FileListTools::FileList fileList)
overridevirtual

Builds MultiFileVolume(s) from files provided by fileList.

Parameters
fileListManager for a map of file names associated with filter attributes. after import with perhaps updated file attributes.

Implements ml::DirectDicomImportImporterBase.


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