38 PrependIfItExistsOtherwiseAdd,
40 AppendIfItExistsOtherwiseAdd,
42 SetNewUIDIfItExistsOtherwiseAdd,
44 ReplaceOtherValuesOnlyIfItExists,
47 SetOtherValuesIfItExistsOtherwiseAdd
53 enum { NumModificationModes = SetOtherValuesIfItExistsOtherwiseAdd+1 };
56 static const char *
const ModificationModesStrings[NumModificationModes];
Project global and OS specific declarations.
#define ML_DICOM_MODIFY_EXPORT
DLL export macro definition.
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,...
DCMTree::Vr getOtherVR() const
Returns the currently set otherVR.
void setOtherVR(DCMTree::Vr otherVr)
Sets the value representation to be used for (re)created "Other" tags.
ModificationModes getModificationMode() const
Returns the currently set modification mode.
DicomModifyOrdinary(DCMTree::TagId tagId=DCMTree::TagId(), const std::string &modStrVal="", ModificationModes modMode=DoNotModify, bool splitMode=false)
Constructor setting TagId, ModificationStringValue(""), splitMode(false), and ModificationMode(DoNotM...
void setModificationMode(ModificationModes modMode)
Sets how the tag with given id and modification value shall be modified.
void setSplitMode(bool split)
If true then completely set values are split at backslashes into different values.
std::string applyModifications(DCMTree::TreePtr dcmTree, const FieldContainer *treeInfos=nullptr) override
Apply a change to dcmTree according to the currently selected _modificationMode.
bool getSplitMode() const
Returns whether split mode is on.
ModificationModes
Available modes for tag modifications.
@ PrependOnlyIfItExists
If the tag is found then the string is prepended after the existing tag value.
@ AddIfItDoesNotExist
The tag is added if it is not found in the source tree, otherwise it is left unchanged.
@ ReplaceIfItExistsOtherwiseAdd
The tag value is replaced if the tag is found, otherwise a new tag with the value is added.
@ RemoveTag
The is removed if found in the source tree, otherwise nothing is done.
@ ReplaceOnlyIfItExists
If the tag is found then its value is replaced with the new value.
@ SetNewUIDOnlyIfItExists
If the tag is found then a newly created UID is set as tag value.
@ AppendOnlyIfItExists
If the tag is found then the string is appended after the existing tag value.
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.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
boost::shared_ptr< Tree > TreePtr
shared pointer to a DCMTree::Tree