MeVisLab Toolbox Reference
mlDcmDRTContentItemModifierSequenceInterface.h
Go to the documentation of this file.
1// Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2// **InsertLicense** code
3//----------------------------------------------------------------------------------
4//
5// NOTE:
6// This file has been generated automatically by
7// FMEwork/ReleaseMeVis/Configuration/CodeGenerators/dcmtkToMLConverter/convertDcmtkToML.py
8// using the template file
9// FMEwork/ReleaseMeVis/Configuration/CodeGenerators/dcmtkToMLConverter/MLDcmtkAccessoriesNew/templates/DcmSequenceInterface.h
10//
11// Destination project:
12// FMEwork/ReleaseMeVis/Sources/Shared/MLDcmtkAccessoriesNew/DcmSequenceInterfaces
13//
14//----------------------------------------------------------------------------------
16
21//----------------------------------------------------------------------------------
22
23#ifndef __mlDcmDRTContentItemModifierSequenceInterface_H
24#define __mlDcmDRTContentItemModifierSequenceInterface_H
25
26// Local includes
27#include "mlDcmtkAccessories.h"
28
29// Dcmtk includes
30//#include "mlDcmDRTContentItemModifierSequenceInterface.h" //DRTContentItemModifierSequence
31#include "mlDcmDRTConceptCodeSequenceInterface.h" //DRTConceptCodeSequence
32#include "mlDcmDRTConceptNameCodeSequenceInterface.h" //DRTConceptNameCodeSequence
33#include "mlDcmDRTMeasurementUnitsCodeSequenceInterface.h" //DRTMeasurementUnitsCodeSequence
34
35
36// ML includes
37#ifndef __mlModuleIncludes_H
38#include "mlModuleIncludes.h"
39#endif
40
42
43// ------------------------------------------------------------------
45// ------------------------------------------------------------------
47{
48 public:
49
51 {
52 public:
53
54 Item() { _dcmItem = DcmtkAccessories::createNewDicomTree(); }
55
57
58 Item(const Item &copyDcmItem) : _dcmItem(copyDcmItem.getTreePtr()) {}
59
60 Item &operator=(const Item &copyDcmItem){ _dcmItem = copyDcmItem.getTreePtr(); return *this; }
61
62 virtual ~Item() {}
63
64 DCMTree::TreePtr getTreePtr() const { return _dcmItem; }
65
66 bool isValid() const { return _dcmItem.get() != nullptr; }
67
68
69 // Date (0040,a121) vr=DA, vm=1, type=1C
70 bool getDate(std::string& parameter) const;
71 std::string getDateTag() const { return "(0040,a121)"; }
72 bool setDate(std::string parameter);
73
74 // DateTime (0040,a120) vr=DT, vm=1, type=1C
75 bool getDateTime(std::string& parameter) const;
76 std::string getDateTimeTag() const { return "(0040,a120)"; }
77 bool setDateTime(std::string parameter);
78
79 // NumericValue (0040,a30a) vr=DS, vm=1-n, type=1C
80 bool getNumericValue(std::string& parameter) const;
81 std::string getNumericValueTag() const { return "(0040,a30a)"; }
82 bool setNumericValue(std::string parameter);
83
84 // PersonName (0040,a123) vr=PN, vm=1, type=1C
85 bool getPersonName(std::string& parameter) const;
86 std::string getPersonNameTag() const { return "(0040,a123)"; }
87 bool setPersonName(std::string parameter);
88
89 // TextValue (0040,a160) vr=UT, vm=1, type=1C
90 bool getTextValue(std::string& parameter) const;
91 std::string getTextValueTag() const { return "(0040,a160)"; }
92 bool setTextValue(std::string parameter);
93
94 // Time (0040,a122) vr=TM, vm=1, type=1C
95 bool getTime(std::string& parameter) const;
96 std::string getTimeTag() const { return "(0040,a122)"; }
97 bool setTime(std::string parameter);
98
99 // UID (0040,a124) vr=UI, vm=1, type=1C
100 bool getUID(std::string& parameter) const;
101 std::string getUIDTag() const { return "(0040,a124)"; }
102 bool setUID(std::string parameter);
103
104 // ValueType (0040,a040) vr=CS, vm=1, type=1
105 bool getValueType(std::string& parameter) const;
106 std::string getValueTypeTag() const { return "(0040,a040)"; }
107 bool setValueType(std::string parameter);
108
109 // ConceptCodeSequence (0040,a168) vr=SQ, vm=1, type=1C
111 std::string getConceptCodeSequenceTag() const { return std::string("(0040,a168)"); }
113
114 // ConceptNameCodeSequence (0040,a043) vr=SQ, vm=1, type=1
116 std::string getConceptNameCodeSequenceTag() const { return std::string("(0040,a043)"); }
118
119 // MeasurementUnitsCodeSequence (0040,08ea) vr=SQ, vm=1, type=1C
121 std::string getMeasurementUnitsCodeSequenceTag() const { return std::string("(0040,08ea)"); }
123
124
125 private:
126
127 DCMTree::TreePtr _dcmItem;
128
129 };
130
132
134 DcmDRTContentItemModifierSequenceInterface(std::vector<DcmDRTContentItemModifierSequenceInterface::Item> dcmSequence) : _itemVec(dcmSequence) {}
135
142
145 // Date (0040,a121) vr=DA, vm=1, type=1C
146 bool getDate(unsigned long idx, std::string& parameter) const;
147 bool getDate(DCMTree::TreePtr item, std::string& parameter) const;
148 std::string getDateTag() const { return "(0040,a121)"; }
149 bool setDate(unsigned long idx, std::string parameter);
150
151 // DateTime (0040,a120) vr=DT, vm=1, type=1C
152 bool getDateTime(unsigned long idx, std::string& parameter) const;
153 bool getDateTime(DCMTree::TreePtr item, std::string& parameter) const;
154 std::string getDateTimeTag() const { return "(0040,a120)"; }
155 bool setDateTime(unsigned long idx, std::string parameter);
156
157 // NumericValue (0040,a30a) vr=DS, vm=1-n, type=1C
158 bool getNumericValue(unsigned long idx, std::string& parameter) const;
159 bool getNumericValue(DCMTree::TreePtr item, std::string& parameter) const;
160 std::string getNumericValueTag() const { return "(0040,a30a)"; }
161 bool setNumericValue(unsigned long idx, std::string parameter);
162
163 // PersonName (0040,a123) vr=PN, vm=1, type=1C
164 bool getPersonName(unsigned long idx, std::string& parameter) const;
165 bool getPersonName(DCMTree::TreePtr item, std::string& parameter) const;
166 std::string getPersonNameTag() const { return "(0040,a123)"; }
167 bool setPersonName(unsigned long idx, std::string parameter);
168
169 // TextValue (0040,a160) vr=UT, vm=1, type=1C
170 bool getTextValue(unsigned long idx, std::string& parameter) const;
171 bool getTextValue(DCMTree::TreePtr item, std::string& parameter) const;
172 std::string getTextValueTag() const { return "(0040,a160)"; }
173 bool setTextValue(unsigned long idx, std::string parameter);
174
175 // Time (0040,a122) vr=TM, vm=1, type=1C
176 bool getTime(unsigned long idx, std::string& parameter) const;
177 bool getTime(DCMTree::TreePtr item, std::string& parameter) const;
178 std::string getTimeTag() const { return "(0040,a122)"; }
179 bool setTime(unsigned long idx, std::string parameter);
180
181 // UID (0040,a124) vr=UI, vm=1, type=1C
182 bool getUID(unsigned long idx, std::string& parameter) const;
183 bool getUID(DCMTree::TreePtr item, std::string& parameter) const;
184 std::string getUIDTag() const { return "(0040,a124)"; }
185 bool setUID(unsigned long idx, std::string parameter);
186
187 // ValueType (0040,a040) vr=CS, vm=1, type=1
188 bool getValueType(unsigned long idx, std::string& parameter) const;
189 bool getValueType(DCMTree::TreePtr item, std::string& parameter) const;
190 std::string getValueTypeTag() const { return "(0040,a040)"; }
191 bool setValueType(unsigned long idx, std::string parameter);
192
193 // ConceptCodeSequence (0040,a168) vr=SQ, vm=1, type=1C
195 std::string getConceptCodeSequenceTag() const { return std::string("(0040,a168)"); }
197
198 // ConceptNameCodeSequence (0040,a043) vr=SQ, vm=1, type=1
200 std::string getConceptNameCodeSequenceTag() const { return std::string("(0040,a043)"); }
202
203 // MeasurementUnitsCodeSequence (0040,08ea) vr=SQ, vm=1, type=1C
205 std::string getMeasurementUnitsCodeSequenceTag() const { return std::string("(0040,08ea)"); }
207
208
211 void setSequence(std::vector<DcmDRTContentItemModifierSequenceInterface::Item> dcmSequence) {
212 _itemVec = dcmSequence;
213 }
214
217 std::vector<DcmDRTContentItemModifierSequenceInterface::Item> getSequence() const {
218 return _itemVec;
219 }
220
223 bool hasSequence() const {
224 return (_itemVec.size() != 0);
225 }
226
230 return static_cast<MLint>(_itemVec.size());
231 }
232
236 if (_itemVec.size() > idx) {
237 return _itemVec[idx];
238 }
240 }
241
246 return _itemVec[_itemVec.size()-1];
247 }
248
252
255 bool insertItem(const size_t idx) {
256 if (_itemVec.size() > idx) {
257 std::vector<DcmDRTContentItemModifierSequenceInterface::Item>::iterator it = _itemVec.begin();
258 std::advance(it, idx);
260 return true;
261 }
262 return false;
263 }
264
267 bool removeItem(const size_t idx) {
268 if ( _itemVec.size() > idx ) {
269 std::vector<DcmDRTContentItemModifierSequenceInterface::Item>::iterator it = _itemVec.begin();
270 std::advance(it, idx);
271 _itemVec.erase(it);
272 return true;
273 }
274 return false;
275 }
276
277 protected:
279 std::vector<DcmDRTContentItemModifierSequenceInterface::Item> _itemVec;
280};
281
283
284#endif // __mlDcmDRTContentItemModifierSequenceInterface_H
285
286/* MeVis-Hidden-Components-Start */
287/* MeVis-Hidden-Components-End */
#define MLDCMTKACCESSORIES_EXPORT
Class to provide access to DRTConceptCodeSequence.
Class to provide access to DRTConceptNameCodeSequence.
bool getUID(std::string &parameter) const
void setConceptCodeSequence(DcmDRTConceptCodeSequenceInterface seq)
bool getValueType(std::string &parameter) const
bool getTime(std::string &parameter) const
bool getDateTime(std::string &parameter) const
bool getNumericValue(std::string &parameter) const
void setMeasurementUnitsCodeSequence(DcmDRTMeasurementUnitsCodeSequenceInterface seq)
DcmDRTConceptNameCodeSequenceInterface getConceptNameCodeSequence() const
bool getPersonName(std::string &parameter) const
bool getTextValue(std::string &parameter) const
DcmDRTConceptCodeSequenceInterface getConceptCodeSequence() const
void setConceptNameCodeSequence(DcmDRTConceptNameCodeSequenceInterface seq)
bool getDate(std::string &parameter) const
DcmDRTMeasurementUnitsCodeSequenceInterface getMeasurementUnitsCodeSequence() const
Class to provide access to DRTContentItemModifierSequence.
bool getValueType(unsigned long idx, std::string &parameter) const
bool setDateTime(unsigned long idx, std::string parameter)
bool getNumericValue(unsigned long idx, std::string &parameter) const
bool getTime(DCMTree::TreePtr item, std::string &parameter) const
bool getValueType(DCMTree::TreePtr item, std::string &parameter) const
DcmDRTConceptCodeSequenceInterface getConceptCodeSequence(unsigned long idx) const
void setConceptNameCodeSequence(DcmDRTConceptNameCodeSequenceInterface seq, unsigned long idx)
bool setPersonName(unsigned long idx, std::string parameter)
std::vector< DcmDRTContentItemModifierSequenceInterface::Item > _itemVec
Reference to the wrapped DICOM tree pointer vector.
bool getDate(unsigned long idx, std::string &parameter) const
bool getDate(DCMTree::TreePtr item, std::string &parameter) const
std::vector< DcmDRTContentItemModifierSequenceInterface::Item > getSequence() const
Return the DRTContentItemModifierSequence this interface class provides access to.
DcmDRTContentItemModifierSequenceInterface::Item & addItem()
Adds a new item to the sequence.
bool getTime(unsigned long idx, std::string &parameter) const
bool setValueType(unsigned long idx, std::string parameter)
bool getTextValue(DCMTree::TreePtr item, std::string &parameter) const
bool getDateTime(DCMTree::TreePtr item, std::string &parameter) const
bool setUID(unsigned long idx, std::string parameter)
bool setDate(unsigned long idx, std::string parameter)
bool getPersonName(unsigned long idx, std::string &parameter) const
bool getUID(DCMTree::TreePtr item, std::string &parameter) const
void setMeasurementUnitsCodeSequence(DcmDRTMeasurementUnitsCodeSequenceInterface seq, unsigned long idx)
void setSequence(std::vector< DcmDRTContentItemModifierSequenceInterface::Item > dcmSequence)
Set the DRTContentItemModifierSequence this interface class provides access to.
DcmDRTMeasurementUnitsCodeSequenceInterface getMeasurementUnitsCodeSequence(unsigned long idx) const
bool insertItem(const size_t idx)
Insert an item at the indicated position.
void addItem(DcmDRTContentItemModifierSequenceInterface::Item newItem)
DcmDRTContentItemModifierSequenceInterface::Item getItem(const size_t idx) const
Gets the item at the indicated position.
DcmDRTConceptNameCodeSequenceInterface getConceptNameCodeSequence(unsigned long idx) const
bool removeItem(const size_t idx)
Removes the indicated item from the sequence.
void setConceptCodeSequence(DcmDRTConceptCodeSequenceInterface seq, unsigned long idx)
bool setNumericValue(unsigned long idx, std::string parameter)
bool hasSequence() const
Check if the DRTContentItemModifierSequence is set.
bool setTime(unsigned long idx, std::string parameter)
MLint getNumberOfItems() const
Return number of items the internal sequence consists of.
DcmDRTContentItemModifierSequenceInterface(std::vector< DcmDRTContentItemModifierSequenceInterface::Item > dcmSequence)
Default Constructor.
bool getDateTime(unsigned long idx, std::string &parameter) const
bool getUID(unsigned long idx, std::string &parameter) const
bool getPersonName(DCMTree::TreePtr item, std::string &parameter) const
bool getTextValue(unsigned long idx, std::string &parameter) const
bool getNumericValue(DCMTree::TreePtr item, std::string &parameter) const
bool setTextValue(unsigned long idx, std::string parameter)
Class to provide access to DRTMeasurementUnitsCodeSequence.
Class to provide access to DRTConceptCodeSequence.
Class to provide access to DRTConceptNameCodeSequence.
Class to provide access to DRTMeasurementUnitsCodeSequence.
Class collecting some DICOM helper functionality explicitly for dcmtk.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
Definition mlTypeDefs.h:490
std::vector< TreePtr > TreePtrVector
a vector of TreePtr - used for sequences
Definition DCMTree_Lib.h:85
boost::shared_ptr< Tree > TreePtr
shared pointer to a DCMTree::Tree
Definition DCMTree_Lib.h:72