MeVisLab Toolbox Reference
mlDicomModifyPrivateAdd.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
18ML_START_NAMESPACE
19
20//----------------------------------------------------------------------------------
24//----------------------------------------------------------------------------------
26public:
27
29 enum { NumberOfPrivateTags = 4 };
30
36
39
42
43
45 DicomModifyPrivateAdd(const std::string &privateCreator = "PRIVATE_CREATOR",
46 MLuint16 groupId = 0x009,
47 MLuint8 elementGroupId = 0x10,
49 MLuint8 lowerByteOfElementIdsBase = 0x10,
50 const std::string &modStrVal = "",
52 bool splitMode = false);
53
55 void setPrivateCreator(const std::string &privateCreator);
57 const std::string &getPrivateCreator() const;
58
63
66 void setPrivateElementGroupId(MLuint8 elementGroupId);
69
74 void setPrivateTagLowerByteOfElementId(MLuint8 lowerByte, size_t pIdx);
77
79 void setSplitMode(bool split, size_t pIdx);
80
82 bool getSplitMode(size_t pIdx) const;
83
88 void setPrivateTagVR(DCMTree::Vr vr, size_t pIdx);
90 DCMTree::Vr getPrivateTagVR(size_t pIdx) const;
91
96 void setPrivateTagModificationStringValue(const std::string &modStrVal, size_t pIdx);
98 std::string getPrivateTagModificationStringValue(size_t pIdx) const;
99
107
114 const FieldContainer *treeInfos=nullptr) override;
115
116private:
118 std::string _privateCreator;
119
121 MLuint16 _privateGroupId;
122
124 MLuint8 _privateElementGroupId;
125
127 MLuint8 _privateTagLowerByteOfElementId[NumberOfPrivateTags];
128
130 bool _privateSplitMode[NumberOfPrivateTags];
131
133 DCMTree::Vr _privateTagVR[NumberOfPrivateTags];
134
136 std::string _privateTagModificationStringValue[NumberOfPrivateTags];
137
139 ModificationModes _privateTagModificationMode[NumberOfPrivateTags];
140};
141
142ML_END_NAMESPACE
Project global and OS specific declarations.
#define ML_DICOM_MODIFY_EXPORT
DLL export macro definition.
DicomModifyBase(DCMTree::TagId tagId=DCMTree::TagId(), const std::string &modStrVal="")
Constructor setting the tag ID and the string value for modifications.
void setPrivateTagModificationMode(ModificationModes modMode, size_t pIdx)
MLuint8 getPrivateElementGroupId() const
Returns the currently set private element group id.
void setPrivateTagVR(DCMTree::Vr vr, size_t pIdx)
void setPrivateCreator(const std::string &privateCreator)
Sets the private creator string, shall be non empty.
void setPrivateGroupId(MLuint16 groupId)
Sets preferred group id of the private creator and by the private tags; shall be odd and from [0x09,...
void setPrivateTagModificationStringValue(const std::string &modStrVal, size_t pIdx)
void setPrivateTagLowerByteOfElementId(MLuint8 lowerByte, size_t pIdx)
MLuint8 getPrivateTagLowerByteOfElementId(size_t pIdx) const
Returns the lower byte of the element id of the manipulated private tag.
DCMTree::Vr getPrivateTagVR(size_t pIdx) const
Returns the currently set value representation for the private tag.
DicomModifyPrivateAdd(const std::string &privateCreator="PRIVATE_CREATOR", MLuint16 groupId=0x009, MLuint8 elementGroupId=0x10, DCMTree::Vr vr=DCMTree::LO, MLuint8 lowerByteOfElementIdsBase=0x10, const std::string &modStrVal="", ModificationModes modModes=DoNotModify, bool splitMode=false)
Constructor creating a no operation default object.
ModificationModes getPrivateTagModificationMode(size_t pIdx) const
Returns the currently set modification mode.
const std::string & getPrivateCreator() const
Returns the currently set private creator string.
void setPrivateElementGroupId(MLuint8 elementGroupId)
ModificationModes
Available modes for tag/tree modifications.
@ AddOrReplace
The tag with id and the given private creator is removed.
@ DoNotModify
No change is applied to the tree.
bool getSplitMode(size_t pIdx) const
Returns whether split mode is on.
std::string getPrivateTagModificationStringValue(size_t pIdx) const
Returns the value used to modify the private tag.
static const char *const ModificationModesStrings[NumModificationModes]
String versions for ModificationModes.
std::string applyModifications(DCMTree::TreePtr dcmTree, const FieldContainer *treeInfos=nullptr) override
MLuint16 getPrivateGroupId() const
Returns the currently set private group id.
void setSplitMode(bool split, size_t pIdx)
If true then set or changed values are split at backslashes into different values.
unsigned char MLuint8
Definition mlTypeDefs.h:108
unsigned short MLuint16
Definition mlTypeDefs.h:141
Vr
DICOM VR.
boost::shared_ptr< Tree > TreePtr
Shared pointer to a DCMTree::Tree.
Definition DCMTree_Lib.h:66