MeVisLab Toolbox Reference
mlDicomSeriesAndInstanceReferenceMacroTagInterface.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 
15 #include <DCMTree_DicomTags.h>
16 
17 ML_START_NAMESPACE
18 
19 //----------------------------------------------------------------------------------
21 //----------------------------------------------------------------------------------
23 {
24 public:
35  const std::string &fieldPrefix,
36  bool provideCommonInstanceReferenceStudyUIDFld,
37  bool provideSeriesInstanceUIDFld=true);
38 
40  void addFields() override;
41 
43  void inheritValues(DCMTree::Const_TreePtr dcmTree) override;
44 
47 
50  std::string applyModifications(DCMTree::TreePtr dcmTree,
51  const FieldContainer *treeInfos=nullptr) override;
52 
56  std::string checkConsistency() const override;
57 
59  virtual bool areAllFieldsEmpty() const;
60 
62  virtual void clearFields();
63 
66  virtual void setMainStudyInstanceUIDInheritance(const std::string &mainStudyInstanceUID,
67  bool inheritOnEquality);
68 
70  NotifyField *getClearFieldsFld() { return _clearFieldsFld; }
71  StringField *getSeriesInstanceUIDFld() { return _seriesInstanceUIDFld; }
72  StringField *getReferencedSOPClassUIDsFld() { return _referencedSOPClassUIDsFld; }
73  StringField *getReferencedSOPInstanceUIDsFld() { return _referencedSOPInstanceUIDsFld; }
74  StringField *getCommonInstanceReferenceStudyInstanceUIDFld(){ return _commonInstanceReferenceStudyInstanceUIDFld; }
76 
97  const std::string &seriesInstanceUIDValue,
98  const std::string &referencedSOPClassUIDs,
99  const std::string &referencedSOPInstanceUIDs,
100  DCMTree::RawTagId writtenReferencedSeriesSequenceTagId,
101  DCMTree::RawTagId writtenReferencedInstanceSequenceTagId,
102  bool setSeriesInstanceUIDFld);
103 
104 protected:
106  const std::string _fieldPrefix;
107 
110 
113 
116 
120 
123 
124  // Contents of the Referenced Series Sequence (currently only one entry is supported):
127 
128  // Contents of the Referenced Series Sequence -> Referenced Instance Sequence:
131 
134 
137 };
138 
139 ML_END_NAMESPACE
Project global and OS specific declarations.
#define MLDICOMTAGINTERFACES_EXPORT
DLL export macro definition.
The class DicomModifyFieldAddOnBase is dedicated to manage fields for ML modules and instances derive...
Manages the module field interface according to Series And Instance Reference Macro in DICOM Part 3.
const std::string _fieldPrefix
Prefix to be added before each added field name.
bool _inheritOnEquality
If true then the field contents will be inherited from the given dcmTree if its StudyInstanceUID matc...
StringField * _commonInstanceReferenceStudyInstanceUIDFld
Unique identifier referencing the study if enabled with provideCommonInstanceReferenceStudyFld,...
std::string checkConsistency() const override
Checks for invalid parameters; return textual description on error, or empty string on success; requi...
static void setUpReferencedSeriesSequence(DCMTree::TreePtr dcmTree, const std::string &seriesInstanceUIDValue, const std::string &referencedSOPClassUIDs, const std::string &referencedSOPInstanceUIDs, DCMTree::RawTagId writtenReferencedSeriesSequenceTagId, DCMTree::RawTagId writtenReferencedInstanceSequenceTagId, bool setSeriesInstanceUIDFld)
Sets and fills the Referenced Sequence tag denoted by the tag id writtenReferencedSequenceTagId into ...
StringField * _referencedSOPClassUIDsFld
The list of SOP Class UIDs uniquely identifying the referenced SOP Classes in the same order as they ...
DicomSeriesAndInstanceReferenceMacroTagInterface(Module &modRef, const std::string &fieldPrefix, bool provideCommonInstanceReferenceStudyUIDFld, bool provideSeriesInstanceUIDFld=true)
Constructor, setting the reference of the module for which the fields shall be managed.
void addFields() override
Add fields to field container of module.
std::string _mainStudyInstanceUID
The StudyInstanceUID which will be used in exported/modified DCMTrees or empty if unknown or unset.
virtual void setMainStudyInstanceUIDInheritance(const std::string &mainStudyInstanceUID, bool inheritOnEquality)
Set the StudyInstanceUID which will be used by exported or modified DCMTrees and whether the inheritV...
std::string applyModifications(DCMTree::TreePtr dcmTree, const FieldContainer *treeInfos=nullptr) override
See DicomModifyFieldAddOnBase::applyModifications() for documentation; adds field values as tags to d...
FieldAddOnBase::FieldChangeState handleFieldChanges(Field *field) override
Handle field notifications according to Module::handleNotification with a return of field change stat...
NotifyField * _clearFieldsFld
If notified then all fields are reset to empty strings.
StringField * _seriesInstanceUIDFld
Unique identifier referencing the referenced instances.
const bool _provideCommonInstanceReferenceStudyUIDFld
If true then this fieldAddOn will also create the field _commonInstanceReferenceStudyUIDFld,...
virtual void clearFields()
Make all fields empty.
NotifyField * getClearFieldsFld()
Provide access to fields; for documentation see corresponding fields.
StringField * _referencedSOPInstanceUIDsFld
The list of SOP Instance UIDs uniquely identifying the referenced SOP Instances in the same order as ...
const bool _provideSeriesInstanceUIDFld
If true then this fieldAddOn will also create the field _seriesInstanceUIDFld, otherwise not.
virtual bool areAllFieldsEmpty() const
Returns true if all fields are empty, otherwise false.
void inheritValues(DCMTree::Const_TreePtr dcmTree) override
Implements the copy of tag values from the given dcmTree to the fields.
FieldChangeState
Describes the type of a field changes detected in handleFieldChanges(Field *field).
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
Base class for an image processing module of the ML.
Definition: mlModule.h:156
Field without value for notifications.
Definition: mlFields.h:1049
Field to encapsulate a string value.
Definition: mlFields.h:1000
Header file of the DicomModifyFieldAddOnBase class dedicated to manage fields for ML modules and inst...
boost::shared_ptr< const Tree > Const_TreePtr
Definition: DCMTree_Lib.h:73
boost::shared_ptr< Tree > TreePtr
shared pointer to a DCMTree::Tree
Definition: DCMTree_Lib.h:70
unsigned int RawTagId
Definition: DCMTree_Lib.h:147