MeVisLab Toolbox Reference
mlDicomModifyMultiFileVolumeExport.h
Go to the documentation of this file.
1// Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2// **InsertLicense** code
3//----------------------------------------------------------------------------------
7
12//----------------------------------------------------------------------------------
13#pragma once
14
16#include "MLDicomModifySystem.h"
17
19#include <mlModuleIncludes.h>
20
22#include <mlDicomModifyList.h>
23
25#include <mlDicomTree.h>
26
29
32
34#include <mlZTUFileNameSet.h>
35
38
41
43
45class ZTUFileNameSet;
46
47//----------------------------------------------------------------------------------
51//----------------------------------------------------------------------------------
53{
54public:
55
57
58protected:
59
61 void activateAttachments() override;
62
65
76 bool *validMatrix = nullptr) const;
77
82
92 DicomMessageCollector &dcmMsgCollector);
93
101 const ZTUFileNameSet &inFileSet) const;
102
104 void _export();
105
117 std::string &oldToNewSOPInstanceUIDList,
118 const Matrix4 *w2vMatrix,
119 DicomMessageCollector &dcmMsgCollector);
120
132 void _exportFilteredFileSet(const std::vector<DICOMCachedIOFileHandle> &allFiles,
133 std::string &oldToNewSOPInstanceUIDList,
134 const Matrix4 *w2vMatrix,
136 DicomMessageCollector &dcmMsgCollector);
137
173 DicomMessageCollector &dcmMsgCollector);
174
202 size_t inFileIdx,
204 const std::string &dstDirBase,
205 const std::string &dstFileNameSuffix,
206 std::string &oldSOPInstanceUID,
207 std::string &newSOPInstanceUID,
210 const Matrix4 *w2vMatrix,
212 DicomMessageCollector &dcmMsgCollector);
213
221 std::string &oldSOPInstanceUID,
222 std::string &newSOPInstanceUID);
223
227 std::string &errStr);
228
238 static std::string _filterDCMTree(DCMTree::TreePtr dcmTree,
240 const Matrix4 *w2vMatrix,
242
257 size_t fileIdx,
258 const std::string &dstDirBase,
259 const std::string &dstFileNameSuffix,
260 std::string &dstFilePath,
261 DicomMessageCollector &dcmMsgCollector);
262
263private:
264
267 MLDICOMCachedIOProxies _cacheProxies;
268
270 TreeAndVolumeInputFieldAddOn _dcmTreeInputFieldAddOn;
271
272
274 BaseField *_inputDicomModifierFld;
275
276
279 StringLineMultiField *_ztuFrameSuppressionsFld;
280
282 StringField *_destinationDirectoryFld;
283
285 StringField *_destinationFileNameSuffixFld;
286
289 BoolField *_handleAllIssuesAsErrorFld;
290
292 BoolField *_postErrorsToMLErrorHandlerFld;
293
295 NotifyField *_exportFld;
296
297
298 // StudyInstanceUID:
301 StringField *_studyInstanceUIDFld;
302
304 NotifyField *_createNewStudyInstanceUIDFld;
305
308 BoolField *_modifyStudyInstanceUIDFld;
309
310
311 // SeriesInstanceUID:
313 StringField *_seriesInstanceUIDFld;
314
316 NotifyField *_createNewSeriesInstanceUIDFld;
317
320 BoolField *_modifySeriesInstanceUIDFld;
321
322
323 // SOPInstanceUID:
326 BoolField *_modifySOPInstanceUIDFld;
327
328
329 // ImageTypeUID:
331 EnumField *_imageTypeValue1And2Fld;
332
334 StringField *_imageTypeValue3Fld;
335
338 BoolField *_modifyImageTypeValue3Fld;
339
341 StringField *_imageTypeValue4Fld;
342
345 BoolField *_modifyImageTypeValue4Fld;
346
349 BoolField *_modifyImageTypeFld;
350
351
353 StringField *_assignmentOfSOPInstanceUIDsFld;
354
355
357 StringField *_statusFld;
358
361
362};
363
Project global and OS specific declarations.
#define ML_DICOM_MODIFY_EXPORT
DLL export macro definition.
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:729
Field to encapsulate a boolean value.
Definition mlFields.h:56
Class managing a multi-frame Z, T, and U-dimension plus a string value.
Definition mlZTUIndex.h:26
Class to collect messages and errors related to a given frame handle.
ML module class DicomModifyMultiFileVolumeExport which exports a MultiFileVolume composed of DICOM fr...
static std::string _filterDCMTree(DCMTree::TreePtr dcmTree, BaseField *inFilterBase, const Matrix4 *w2vMatrix, const DICOMTagTools::ZTUIndex *ztuPos)
If a DicomModifyTagsPluginBase at inFilterBase is connected then it is applied to dcmTree.
void _exportFilteredFileSet(const std::vector< DICOMCachedIOFileHandle > &allFiles, std::string &oldToNewSOPInstanceUIDList, const Matrix4 *w2vMatrix, const ZTUFileNameSet &originalInFileSet, DicomMessageCollector &dcmMsgCollector)
Get all DCMFiles from the given file set and writes the files into the destination directory.
void _exportFilteredDicomBaseObject(DCMTree::Const_TreePtr inDCMTree, std::string &oldToNewSOPInstanceUIDList, const Matrix4 *w2vMatrix, DicomMessageCollector &dcmMsgCollector)
If necessary then modify the passed DICOM tree and write it into the destination directory where the ...
void _export()
Stores the (modified) DICOM frames in the destination directory.
const ZTUFileNameSet * _getInputVolumeFileSet(Matrix4 *w2vMatrix=nullptr, bool *validMatrix=nullptr) const
Return the input ZTUFileNameSet either from the currently connected MultiFileVolume or from the speci...
std::string _applyDCMTreeChanges(DCMTree::TreePtr dcmTree, std::string &oldSOPInstanceUID, std::string &newSOPInstanceUID)
Applies all necessary DICOM tree changes to dcmTree before writing it to disk.
void handleNotification(Field *field) override
Handles field changes.
void _createExportTree(const DICOMCachedIOFileHandle &inOrigFilePath, DCMTree::Const_TreePtr inDCMTree, DICOMCachedIOFileHandle &recentMFFileHandle, DCMTree::Const_TreePtr &recentMFTree, DCMTree::TreePtr &modifiableExportTree, DCMTree::Const_TreePtr &constExportTree, DicomMessageCollector &dcmMsgCollector)
Creates/determines the DICOM tree which can be modified and exported.
DICOMTagTools::ZTUVector _getZTUSuppressions(std::string &parseInfo, const ZTUFileNameSet &inFileSet) const
Returns a list of ztu positions which are described in _ztuFrameSuppressionsFld.
bool _requiresModifications() const
Returns true if any modification is implied by the module parameters, for example by a connected filt...
DICOMTagTools::ZTUIndex _getZTUPos(const DICOMCachedIOFileHandle &fileHandle, const ZTUFileNameSet &fileSet, DicomMessageCollector &dcmMsgCollector)
Gets the SOPInstanceUID of fileHandle, searches it in fileSet and returns the ztu position of the fil...
void _saveDCMTree(DCMTree::Const_TreePtr dcmTree, const DICOMCachedIOFileHandle &srcFilePath, size_t fileIdx, const std::string &dstDirBase, const std::string &dstFileNameSuffix, std::string &dstFilePath, DicomMessageCollector &dcmMsgCollector)
Stores dcmTree in file dstFileName.
void _setUpImageTypeTag(DCMTree::TreePtr dcmTree, std::string &errStr)
Sets up the value(s) of the ImageType tag in dcmTree according to the field settings,...
void _exportFile(const DICOMCachedIOFileHandle &inOrigFilePath, DCMTree::Const_TreePtr inDCMTree, size_t inFileIdx, BaseField *inFilterBase, const std::string &dstDirBase, const std::string &dstFileNameSuffix, std::string &oldSOPInstanceUID, std::string &newSOPInstanceUID, DICOMCachedIOFileHandle &recentMFFileHandle, DCMTree::Const_TreePtr &recentMFTree, const Matrix4 *w2vMatrix, const DICOMTagTools::ZTUIndex *ztuPos, DicomMessageCollector &dcmMsgCollector)
Loads the DICOM file from origFilePath, filters it with a DicomModifyTagsPluginBase possible connecte...
void activateAttachments() override
Handles changes which were applied without notifications.
Field to encapsulate an enumerated value.
Definition mlFields.h:173
Base class for all fields used in the ML.
Definition mlField.h:73
Base class for an image processing module of the ML.
Definition mlModule.h:151
Field without value for notifications.
Definition mlFields.h:598
Field to encapsulate a string value.
Definition mlFields.h:553
The field class StringLineMultiField which manages a vector of std::string lines typically separated ...
Class implementing a FieldAddOn managing fields and functionality for a multi- purpose input connecto...
Class to manage a 3D set of handles describing frames or volumes to be composed to a higher dimension...
#define ML_MODULE_CLASS_HEADER(className)
Similar to ML_CLASS_HEADER for the usage of derived classes from Module.
Header of FileHandle class which should be used in DICOM importing modules to resolve the filename fo...
An instance of this class creates singleton proxies for DICOMCachedIO cache classes such that all cac...
Header file of a class which manages a list of DicomModifyBase objects and an input which allows the ...
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
Header file of a FieldAddOn managing fields and functionality for a multi- purpose input connector fo...
Header file of class to manage a 3D set of handles describing frames or volumes to be composed to a h...
boost::shared_ptr< const Tree > Const_TreePtr
Definition DCMTree_Lib.h:67
boost::shared_ptr< Tree > TreePtr
Shared pointer to a DCMTree::Tree.
Definition DCMTree_Lib.h:66
std::vector< ZTUIndex > ZTUVector
A std::vector typedef of ZTUIndexes to describe indexes of handles in the multi-frame Z,...
Definition mlZTUIndex.h:70