MeVisLab Toolbox Reference
mlDirectDicomImport.h
Go to the documentation of this file.
1// Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2// **InsertLicense** code
3//----------------------------------------------------------------------------------
5
12
13//----------------------------------------------------------------------------------
14#pragma once
15
16// Local includes
18
19// ML includes
20#include <mlModuleIncludes.h>
21#include <mlTimeCounter.h>
22
23// Module to convert MultiFileVolumes to ML images, to scan for min/max and to save.
25
26// Container for MultiFileVolumeList to be connected to base outputs.
28
29// FilListFilter functionality to file file sets before importing them.
31
32// DICOM tree prototypes.
33#include <DCMTree_Lib.h>
34
35// References DICOM caches to prevent their removal during life time of this.
37
38// AddOn for DicomTagDumps.
40
41// Configurable message collector class(es).
43
44// Forward to internally or friend used class.
45class MLDirectDicomImportWrapper;
46class VolumeBuilderGeneric;
47class VolumeBuilderFromDICOMs;
48
50
51// Forwards to internally or only incompletely used classes.
52class DirectDicomImportDPLImporter;
53class DirectDicomImportImporterBase;
54class DirectDicomImportOtherImporter;
55class MultiFileVolume;
56class MultiFileVolumeListView;
57class ProgressLogger;
58namespace FileListTools {
59 class FileList;
60}
61
62//----------------------------------------------------------------------------------
65//----------------------------------------------------------------------------------
67{
68public:
69
72
75
78
81
85
87 void updateConsole(bool force=true);
88
90 static void updateProgressIndicatorCB(void *userData,
91 const std::string &info,
92 float state);
93
95 void updateProgressIndicator(const std::string &info,
96 float state);
98
99protected:
101 friend class ::MLDirectDicomImportWrapper;
103 friend class ::VolumeBuilderGeneric;
104 friend class ::VolumeBuilderFromDICOMs;
105
108
111
114
117
119 void activateAttachments() override;
120
125
126 // ----------------------------------------------------------
129 // ----------------------------------------------------------
130
133 PagedImage* outImg) override;
134
140 virtual void calculateOutputSubImage(SubImage *outSubImg,
141 int outIndex,
142 SubImage *inSubImgs) override;
143
145
146private:
147
148 // ----------------------------------------------------------
150 // ----------------------------------------------------------
152
154 void _import();
155
161 void _populateFileList(const std::string &srcDirPath,
162 const std::vector<std::string> &additionalFiles,
164
169 void _importLabeledFileList(size_t fListIdx,
170 size_t numFLists,
172
176 bool _importDirectoriesAndFiles(std::vector<std::string> srcDirPaths,
177 std::vector<std::string> singleAdditionalFiles,
178 bool interrupted);
179
186 void _importDicomAndNonDicomFromFileList(const FileListTools::FileList &fileList,
188 bool& interrupted,
189 size_t& numDCMImports,
190 size_t& numNonDCMImports);
191
196 void _logPlannedImportFromFileList(const std::vector<std::string>& srcDirPaths,
197 const std::vector<std::string>& singleAdditionalFiles,
198 const std::string& srcDirPath);
199
204 void _logImportFinishState(bool interrupted,
205 size_t numDCMImports,
206 size_t numNonDCMImports);
207
208
212 DCMTree::Const_TreePtr _getSelectedDCMTree(bool checkImgProps=false);
213
215 bool _isCachingEnabledAndHasPath() const;
216
222 bool _verifyAndOrCreateResultCacheDirectory() const;
223
225 void _updateTreeCacheSizeInformation();
227 void _updateTagCacheSizeInformation();
229 void _clearCaches();
230
232 void _logDICOMCacheInfos(ProgressLogger &logger, bool forceLog=false);
233
236 bool _flushAndCheckDICOMCacheOverflow(ProgressLogger &logger);
237
240 bool _flushAndCheckDICOMTagCacheOverflow(ProgressLogger &logger);
241
244 bool _flushAndCheckDICOMTreeCacheOverflow(ProgressLogger &logger);
245
247
248 // ----------------------------------------------------------
250 // ----------------------------------------------------------
252
256 MultiFileVolume *_updateImageOutputToSelectedIndex();
257
259 void _appendDirectDicomImportFields();
260
262 void _updateInfoFields(bool updateTagDump);
263
265 void _showCurrentIssue();
267
268
269 // ----------------------------------------------------------
271 // ----------------------------------------------------------
273
276 TimeCounter _updateCounter;
277
280
282 MultiFileVolumeListImageOutput _currentDDIOutput;
283
285 MultiFileVolumeListView *_volumeListView;
286
288 DirectDicomImportDPLImporter *_dplImporter;
289
291 DirectDicomImportOtherImporter *_otherImporter;
292
294 MLDICOMCachedIOProxies _cacheProxies;
296
297 // ----------------------------------------------------------
300 // ----------------------------------------------------------
301
304 BaseField *_outputAccessConnectorFld;
305
308 BaseField *_inputFilterPluginFld;
309
312 BaseField *_inputMessageFilterPluginFld;
313
315 StringField *_fullSrcDirPathFld;
316
318 StringField *_fullUserSrcDirPathsFld;
319
321 StringField *_fullUserSrcDirPathsResolvedFld;
322
324 StringField *_fullTargetPathFld;
325
327 StringField *_cachePathFld;
328
332 BoolField *_useRelativeCachePathsFld;
333
336 BoolField *_writeSingleVolumeCacheFilesFld;
337
339 BoolField *_cachePathAutoCreateFld;
340
342 StringField *_cacheFileNameFld;
343
345 StringField *_consoleFld;
346
348 IntField *_consoleSizeInKiloBytesFld;
349
351 NotifyField *_clearConsoleFld;
352
354 IntField *_outVolIdxFld;
355
357 NotifyField *_dplImportFld;
358
360 BoolField *_clearAfterImportFld;
361
366 BoolField *_clearSingleFrameCacheAfterImportFld;
367
370 NotifyField *_clearSingleFrameCacheFld;
371
373 NotifyField *_clearCacheFld;
374
376 NotifyField *_clearResultCacheFld;
377
379 NotifyField *_clearVolumeListFld;
380
382 NotifyField *_loadResultCacheFld;
383
387 BoolField *_preferCacheBeforeImportFld;
388
390 NotifyField *_saveResultCacheFld;
391
393 NotifyField *_stopImportingFld;
394
396 BoolField *_useResultCachingFld;
397
399 ProgressField *_progressFld;
400
402 StringField *_progressInfoFld;
403
405 IntField *_maxCachedMegaBytesTreeCacheFld;
406
408 IntField *_maxCachedMegaBytesTagCacheFld;
409
411 BoolField *_dicomCacheEditableFld;
412
414 BoolField *_processingFld;
416
417
418 //--------------------------------------------------------------
420 //--------------------------------------------------------------
422
424 IntField *_numVolumesFld;
425
427 IntField *_totalSlicesFld;
428
430 IntField *_totalTimePointsFld;
431
433 IntField *_totalSlicesMultTimePointsFld;
434
436 DoubleField *_totalVoxelsFld;
437
439 IntField *_extFld[6];
440
442 DoubleField *_numVolVoxelsFld;
443
445 DicomTagDumpFieldAddOn _dicomTagDumpFieldAddOn;
446
448 StringField *_volumeInfoDumpFld;
449
451 StringField *_fileListInfoFld;
452
455 StringField *_suppressedFilesAndSuffixesFld;
456
458 StringField *_explicitFileTypesFld;
459
461 StringField *_inputFileListFld;
462
464 StringField *_inputFileListResolvedFld;
465
467 BoolField *_hadWarningsFld;
468
470 BoolField *_hadErrorsFld;
471
473 BoolField *_logDicomCacheInfosFld;
474
476 BoolField *_warnDicomCacheOverflowsFld;
478
481};
482
483
Project global and OS specific declarations.
#define MLDIRECTDICOMIMPORT_EXPORT
Only for diagnostic purposes.
An instance of this class creates singleton proxies for DICOMCachedIO cache classes such that all cac...
Field to encapsulate a pointer to an ML base object.
Definition mlFields.h:797
Field to encapsulate a boolean value.
Definition mlFields.h:58
Class managing fields to show and handle a DICOM tree tag dump.
Class handling all DICOM Processor Library Import (DPL) stuff for the DirectDicomImport module.
Base importer class for the DirectDicomImport module.
Derived importer to import non DICOM files into DirectDicomImport.
Imports image files directly from DICOM or other file types without an intermediate representation.
void handleNotification(Field *field) override
Handle field changes of the field field.
bool isStopImportingPressed() const
Returns true if _stopImporting is pressed otherwise it returns false.
void updateProgressIndicator(const std::string &info, float state)
Update a progress indicator about the current import state.
void _resetMessageFlags()
Resets the error/warnings error state to no errors/warnings.
static bool isStopImportingPressedCB(void *ddiOpPtr)
Static callback version of isStopImportingPressed(), requires either nullptr as argument or a valid D...
~DirectDicomImport() override
Destructor.
virtual void calculateOutputImageProperties(int outIndex, PagedImage *outImg) override
Sets properties of the output image at output outIndex.
DirectDicomImport()
Constructor.
void activateAttachments() override
Update internal module state after load or clone and enable notification handling again.
void updateConsole(bool force=true)
Updates the _consoleFld.
virtual DicomConfigurableMessageFilterBaseRefCountedPtr _getMessageCollector()
Convenience routine to returns a new instance of a message collector to be used for message handling;...
MultiFileVolumeList & getNonConstOutVolumes()
Provides non constant access to list of all imported output volumes.
virtual void calculateOutputSubImage(SubImage *outSubImg, int outIndex, SubImage *inSubImgs) override
Calculates page outSubImg of output image with index outIndex by using inSubimgs.
static void updateProgressIndicatorCB(void *userData, const std::string &info, float state)
Static callback version to update a progress indicator about the current import state.
const MultiFileVolumeList & getConstOutVolumes() const
Provides constant access to list of all imported output volumes.
Field to encapsulate a double value.
Definition mlFields.h:538
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.
Field to encapsulate an integer value.
Definition mlFields.h:126
Base class for an image processing module of the ML.
Definition mlModule.h:151
The ML module class MultiFileVolumeListImageOutput for extending the number of image outputs of Multi...
Manages the volume list view and its contents for the DirectDicomImport module.
Class managing a list of MultiFileVolume instances for the DirectDicomImport module; taking ownership...
Management class used by DirectDicomImport to create, represent and describe volumes composed of mult...
Field without value for notifications.
Definition mlFields.h:659
Class which represents an image, which manages properties of an image and image data which is located...
Field to encapsulate an increasing float value from range [0,1].
Definition mlFields.h:491
Configurable logger and progress handler class which can be used as base class for logging,...
Field to encapsulate a string value.
Definition mlFields.h:610
This class manages/represents a rectangular 6d image region which is organized linearly in memory.
Definition mlSubImage.h:75
Class to measure precise time intervals.
#define ML_MODULE_CLASS_HEADER(className)
Like ML_CLASS_HEADER for the usage of derived classes from Module.
An instance of this class creates singleton proxies for DICOMCachedIO cache classes such that all cac...
Header file of ML module class DicomConfigurableMessageFilter usable as plugin for modules which prod...
Header file for the DicomTagDumpFieldAddOn which manages fields to show and handle a DICOM tree tag d...
A concrete module class for file and DCMTree filtering which can be used by FileList importers to fil...
The ML module class MultiFileVolumeListImageOutput for extending the number of image outputs of Multi...
Reference counted Base class encapsulating a list of MultiFileVolume instances.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
boost::shared_ptr< const Tree > Const_TreePtr
Definition DCMTree_Lib.h:73
Namespace containing a number of tools and classes to scan directories for files, assign attributes t...