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
42ML_START_NAMESPACE
43
45class ZTUFileNameSet;
46class ProgressLogger;
47
48//----------------------------------------------------------------------------------
52//----------------------------------------------------------------------------------
54{
55public:
56
58
59protected:
60
62 void activateAttachments() override;
63
65 void handleNotification(Field *field) override;
66
76 const ZTUFileNameSet *_getInputVolumeFileSet(Matrix4 *w2vMatrix = nullptr,
77 bool *validMatrix = nullptr) const;
78
83
92 const ZTUFileNameSet &fileSet,
93 DicomMessageCollector &dcmMsgCollector);
94
102 const ZTUFileNameSet &inFileSet) const;
103
105 void _export();
106
118 std::string &oldToNewSOPInstanceUIDList,
119 const Matrix4 *w2vMatrix,
120 DicomMessageCollector &dcmMsgCollector);
121
133 void _exportFilteredFileSet(const std::vector<DICOMCachedIOFileHandle> &allFiles,
134 std::string &oldToNewSOPInstanceUIDList,
135 const Matrix4 *w2vMatrix,
136 const ZTUFileNameSet &originalInFileSet,
137 DicomMessageCollector &dcmMsgCollector);
138
168 void _createExportTree(const DICOMCachedIOFileHandle &inOrigFilePath,
169 DCMTree::Const_TreePtr inDCMTree,
170 DICOMCachedIOFileHandle &recentMFFileHandle,
171 DCMTree::Const_TreePtr &recentMFTree,
172 DCMTree::TreePtr &modifiableExportTree,
173 DCMTree::Const_TreePtr &constExportTree,
174 DicomMessageCollector &dcmMsgCollector);
175
177 void _appendExportedPath(const DICOMCachedIOFileHandle &pathOfNewlyExportedFile);
178
204 void _exportFile(const DICOMCachedIOFileHandle &inOrigFilePath,
205 DCMTree::Const_TreePtr inDCMTree,
206 size_t inFileIdx,
207 BaseField *inFilterBase,
208 const std::string &dstDirBase,
209 const std::string &dstFileNameSuffix,
210 std::string &oldSOPInstanceUID,
211 std::string &newSOPInstanceUID,
212 DICOMCachedIOFileHandle &recentMFFileHandle,
213 DCMTree::Const_TreePtr &recentMFTree,
214 const Matrix4 *w2vMatrix,
215 const DICOMTagTools::ZTUIndex *ztuPos,
216 DicomMessageCollector &dcmMsgCollector);
217
225 std::string &oldSOPInstanceUID,
226 std::string &newSOPInstanceUID);
227
231 std::string &errStr);
232
242 static std::string _filterDCMTree(DCMTree::TreePtr dcmTree,
243 BaseField *inFilterBase,
244 const Matrix4 *w2vMatrix,
245 const DICOMTagTools::ZTUIndex *ztuPos);
246
260 const DICOMCachedIOFileHandle &srcFilePath,
261 size_t fileIdx,
262 const std::string &dstDirBase,
263 const std::string &dstFileNameSuffix,
264 std::string &dstFilePath,
265 DicomMessageCollector &dcmMsgCollector);
266
267private:
268
271 MLDICOMCachedIOProxies _cacheProxies;
272
274 TreeAndVolumeInputFieldAddOn _dcmTreeInputFieldAddOn;
275
276
278 BaseField *_inputDicomModifierFld;
279
280
283 StringLineMultiField *_ztuFrameSuppressionsFld;
284
286 StringField *_destinationDirectoryFld;
287
289 StringField *_destinationFileNameSuffixFld;
290
293 BoolField *_handleAllIssuesAsErrorFld;
294
296 BoolField *_postErrorsToMLErrorHandlerFld;
297
299 NotifyField *_exportFld;
300
302 NotifyField *_stopExportingFld = nullptr;
303
305 ProgressLogger _progressLogger;
306
308 BoolField *_isExportingFld = nullptr;
309
311 ProgressField *_progressFld = nullptr;
312
313 // StudyInstanceUID:
316 StringField *_studyInstanceUIDFld;
317
319 NotifyField *_createNewStudyInstanceUIDFld;
320
323 BoolField *_modifyStudyInstanceUIDFld;
324
325
326 // SeriesInstanceUID:
328 StringField *_seriesInstanceUIDFld;
329
331 NotifyField *_createNewSeriesInstanceUIDFld;
332
335 BoolField *_modifySeriesInstanceUIDFld;
336
337
338 // SOPInstanceUID:
341 BoolField *_modifySOPInstanceUIDFld;
342
343
344 // ImageTypeUID:
346 EnumField *_imageTypeValue1And2Fld;
347
349 StringField *_imageTypeValue3Fld;
350
353 BoolField *_modifyImageTypeValue3Fld;
354
356 StringField *_imageTypeValue4Fld;
357
360 BoolField *_modifyImageTypeValue4Fld;
361
364 BoolField *_modifyImageTypeFld;
365
366
368 StringField *_assignmentOfSOPInstanceUIDsFld;
369
371 StringField *_exportedFramePathsFld = nullptr;
372
373
375 StringField *_statusFld;
376
379
380};
381
382ML_END_NAMESPACE
Project global and OS specific declarations.
#define ML_DICOM_MODIFY_EXPORT
DLL export macro definition.
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.
static std::string _filterDCMTree(DCMTree::TreePtr dcmTree, BaseField *inFilterBase, const Matrix4 *w2vMatrix, const DICOMTagTools::ZTUIndex *ztuPos)
void _exportFilteredFileSet(const std::vector< DICOMCachedIOFileHandle > &allFiles, std::string &oldToNewSOPInstanceUIDList, const Matrix4 *w2vMatrix, const ZTUFileNameSet &originalInFileSet, DicomMessageCollector &dcmMsgCollector)
void _exportFilteredDicomBaseObject(DCMTree::Const_TreePtr inDCMTree, std::string &oldToNewSOPInstanceUIDList, const Matrix4 *w2vMatrix, DicomMessageCollector &dcmMsgCollector)
void _export()
Stores the (modified) DICOM frames in the destination directory.
const ZTUFileNameSet * _getInputVolumeFileSet(Matrix4 *w2vMatrix=nullptr, bool *validMatrix=nullptr) const
std::string _applyDCMTreeChanges(DCMTree::TreePtr dcmTree, std::string &oldSOPInstanceUID, std::string &newSOPInstanceUID)
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)
DICOMTagTools::ZTUVector _getZTUSuppressions(std::string &parseInfo, const ZTUFileNameSet &inFileSet) const
DICOMTagTools::ZTUIndex _getZTUPos(const DICOMCachedIOFileHandle &fileHandle, const ZTUFileNameSet &fileSet, DicomMessageCollector &dcmMsgCollector)
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)
void _appendExportedPath(const DICOMCachedIOFileHandle &pathOfNewlyExportedFile)
Appends a newly exported file path to _exportedFramePathsFld.
void _setUpImageTypeTag(DCMTree::TreePtr dcmTree, std::string &errStr)
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)
void activateAttachments() override
Handles changes which were applied without notifications.
Module(int numInputImages, int numOutputImages)
#define ML_MODULE_CLASS_HEADER(className)
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
Definition mlZTUIndex.h:70
Tmat4< MLdouble > Matrix4
The standard 4x4 matrix of type double.
Definition mlMatrix4.h:713
DICOMCachedIOFileHandleBase< char > DICOMCachedIOFileHandle
"Forward" to DICOMCachedIOFileHandle.