MeVisLab Toolbox Reference
mlDirectDicomImportOtherImporter.h
Go to the documentation of this file.
1 // Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2 // **InsertLicense** code
3 //----------------------------------------------------------------------------------
5 
10 //----------------------------------------------------------------------------------
11 #pragma once
12 
13 // Local includes
15 #include "mlModuleIncludes.h"
17 
18 ML_START_NAMESPACE
19 
20 // Forward to internally used classes.
21 class DicomMessageCollector;
22 class DirectDicomImport;
23 class MultiFileVolume;
24 class _FilePropHelper;
25 class FileReaderPluginsBase;
26 //----------------------------------------------------------------------------------
28 //----------------------------------------------------------------------------------
30 
31 public:
32 
35 
38 
40  void appendFields(FieldContainer &fieldContainer) override;
41 
43  void handleNotification(Field &field) override;
44 
48  void import(const FileListTools::FileList &fileList) override;
49 
50 protected:
51 
58  virtual void _determineProperties(const FileListTools::FileList &fileList,
59  std::vector<_FilePropHelper> &filePropVec,
60  float progressStart,
61  float progressEnd);
62 
64  virtual void _propertySort(std::vector<_FilePropHelper> &filePropVec);
65 
74  virtual size_t _composeAndAppendVolumes(const std::vector<_FilePropHelper> &filePropVec,
75  const FileListTools::FileList &fileList,
76  DicomMessageCollector &dcmMsgCollector);
77 
82  virtual void _postProcessVolumes(size_t lastNumVolumesToProcess);
83 
93  virtual void _appendMetaData(ImagePropertyExtensionContainer &imgPropContainer,
94  const std::string &metaData,
95  const std::string &fileName);
96 
103  virtual void _appendNewDirectVolumeReferenceFromFilePropHelper(const _FilePropHelper &fileProp,
104  const FileListTools::FileList &fileList,
105  DicomMessageCollector &dcmMsgCollector);
106 
107 private:
108 
116  void _appendMLImageFileProperties(const std::string &fileName,
117  bool checkSilently,
118  std::vector<_FilePropHelper> &filePropVec);
119 
128  bool _appendLoaderPluginFileProperties(const std::string &fileName,
129  bool checkSilently,
130  std::vector<_FilePropHelper> &filePropVec);
131 
142  std::string _appendImgFileReaderProperties(const std::string &fileName,
143  bool checkSilently,
144  bool isDCMTiffPair,
145  std::vector<_FilePropHelper> &filePropVec);
146 
154  void _appendItkImageFileReaderProperties(const std::string &fileName,
155  bool checkSilently,
156  std::vector<_FilePropHelper> &filePropVec);
157 
159  enum ComposeOtherFilesModes {
160  COMPOSE_OTHER_FILES_SINGLE = 0,
161  COMPOSE_OTHER_FILES_HEAP,
162 
163  NUM_COMPOSE_OTHER_FILES_MODES
164  };
165 
167  static const char * const composeOtherFilesModesStrings[NUM_COMPOSE_OTHER_FILES_MODES];
168 
172  EnumField *_composeOtherFilesModeFld;
173 
178  StringField *_silentTrialFileTypesFld;
179 
181  std::vector< std::string > _silentTrialFileTypes;
182 
186  Module *_mlItkImageFileReader;
187 
193 
205  void _optimizeImageReaderPageExtents(_FilePropHelper& fileProp);
206 };
207 
208 ML_END_NAMESPACE
Project global and OS specific declarations.
#define MLDIRECTDICOMIMPORT_EXPORT
Only for diagnostic purposes.
Class to collect messages and errors related to a given frame handle.
Base importer class for the DirectDicomImport module.
Derived importer to import non DICOM files into DirectDicomImport.
DirectDicomImportOtherImporter(DirectDicomImport &ddiOp)
Constructor using a DirectDicomImport instance associated with.
virtual void _appendNewDirectVolumeReferenceFromFilePropHelper(const _FilePropHelper &fileProp, const FileListTools::FileList &fileList, DicomMessageCollector &dcmMsgCollector)
Creates and append a new DirectDicomVolumeReference with settings from a _FilePropHelper.
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.
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.
void appendFields(FieldContainer &fieldContainer) override
Creates and appends all parameter fields for this importer. To be called in constructor.
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 ...
virtual void _postProcessVolumes(size_t lastNumVolumesToProcess)
Some settings can be set up best after full composition of the volumes, for example storing the image...
void handleNotification(Field &field) override
Handles changes of fields added by appendFields.
virtual void _propertySort(std::vector< _FilePropHelper > &filePropVec)
Sort filePropVec according image extent and file name given by the vector entries.
~DirectDicomImportOtherImporter() override
Destructor.
Imports image files directly from DICOM or other file types without an intermediate representation.
Field to encapsulate an enumerated value.
Definition: mlFields.h:363
Defines the class FieldContainer to encapsulate a vector of fields for (see class Field).
Base class for all fields used in the ML.
Definition: mlField.h:73
A tool class to manage a list of file/frame names/urls associated with attributes.
This class is a container for extended image properties derived from ImagePropertyExtension.
Base class for an image processing module of the ML.
Definition: mlModule.h:156
Field to encapsulate a string value.
Definition: mlFields.h:1000
Base importer class for the DirectDicomImport module.