MeVisLab Toolbox Reference
mlDicomModifySequence.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 
15 #include "MLDicomModifySystem.h"
16 #include "mlDicomModifyBase.h"
17 
18 ML_START_NAMESPACE
19 
20 //----------------------------------------------------------------------------------
24 //----------------------------------------------------------------------------------
26 public:
27 
37  InsertOneEntryAtIfItExists,
39  RemoveAllButFirstEntryIfItExists
40  };
41 
43  enum { NumModificationModes = RemoveAllButFirstEntryIfItExists+1 };
44 
46  static const char * const ModificationModesStrings[NumModificationModes];
47 
50  const std::string &modStrVal = "",
51  ModificationModes modMode = DoNotModify);
52 
55 
58 
62  const std::string &modStrVal,
63  ModificationModes modMode);
64 
65 
71  std::string applyModifications(DCMTree::TreePtr dcmTree,
72  const FieldContainer *treeInfos=nullptr) override;
73 
74 private:
76  ModificationModes _modificationMode;
77 };
78 
79 ML_END_NAMESPACE
Project global and OS specific declarations.
#define ML_DICOM_MODIFY_EXPORT
DLL export macro definition.
Class to wrap a tag-id.
Definition: DCMTree_TagId.h:40
A base class which allows the modification of DICOM tags in a (cloned) DICOM tree.
A concrete class derived from DicomModifyBase which allows the modification of ordinary,...
std::string applyModifications(DCMTree::TreePtr dcmTree, const FieldContainer *treeInfos=nullptr) override
Apply a change to dcmTree according to the currently selected _modificationMode.
ModificationModes
Available modes for tag modifications.
@ MakeEmptyIfItExistsOtherwiseAddEmpty
If the tag exists the all sequence entries after the first one are removed.
@ AddEmptyIfItDoesNotExist
If the tag does not exist then an empty one with zero sequence entries is added.
@ RemoveTag
If the tag exist then it is removed.
@ ResizeToNumEntriesIfItExists
If the tag exists the number entries is set to the value given by modStrVal.
@ MakeEmptyIfItExists
If the tag exists then all sequence entries are removed, but the tag itself is left.
@ AppendNumEntriesIfItExists
If the tag exists then a number of entries given by modStrVal is appended to the end.
DicomModifySequence(DCMTree::TagId tagId=DCMTree::TagId(), const std::string &modStrVal="", ModificationModes modMode=DoNotModify)
Constructor setting TagId, ModificationStringValue, and ModificationMode.
void setModificationParameters(DCMTree::TagId tagId, const std::string &modStrVal, ModificationModes modMode)
Calls setTagId(tagId), setModificationStringValue(modStrVal), and setModificationMode(modMode)
void setModificationMode(ModificationModes modMode)
Sets how the tag with given id and modification value shall be modified.
ModificationModes getModificationMode() const
Returns the currently set modification mode.
Defines the class FieldContainer to encapsulate a vector of fields for (see class Field).
Header file of a base class which allows the modification of DICOM tags in a (cloned) DICOM tree.
boost::shared_ptr< Tree > TreePtr
shared pointer to a DCMTree::Tree
Definition: DCMTree_Lib.h:70
@ DoNotModify
The value of the DICOM tag is not modified.