MeVisLab Toolbox Reference
mlDcmDRTProtocolContextSequenceInterface.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 __mlDcmDRTProtocolContextSequenceInterface_H
24#define __mlDcmDRTProtocolContextSequenceInterface_H
25
26// Local includes
27#include "mlDcmtkAccessories.h"
28
29// Dcmtk includes
30//#include "mlDcmDRTProtocolContextSequenceInterface.h" //DRTProtocolContextSequence
31#include "mlDcmDRTConceptCodeSequenceInterface.h" //DRTConceptCodeSequence
32#include "mlDcmDRTConceptNameCodeSequenceInterface.h" //DRTConceptNameCodeSequence
33#include "mlDcmDRTContentItemModifierSequenceInterface.h" //DRTContentItemModifierSequence
34#include "mlDcmDRTMeasurementUnitsCodeSequenceInterface.h" //DRTMeasurementUnitsCodeSequence
35
36
37// ML includes
38#ifndef __mlModuleIncludes_H
39#include "mlModuleIncludes.h"
40#endif
41
43
44// ------------------------------------------------------------------
46// ------------------------------------------------------------------
48{
49 public:
50
52 {
53 public:
54
55 Item() { _dcmItem = DcmtkAccessories::createNewDicomTree(); }
56
58
59 Item(const Item &copyDcmItem) : _dcmItem(copyDcmItem.getTreePtr()) {}
60
61 Item &operator=(const Item &copyDcmItem){ _dcmItem = copyDcmItem.getTreePtr(); return *this; }
62
63 virtual ~Item() {}
64
65 DCMTree::TreePtr getTreePtr() const { return _dcmItem; }
66
67 bool isValid() const { return _dcmItem.get() != nullptr; }
68
69
70 // Date (0040,a121) vr=DA, vm=1, type=1C
71 bool getDate(std::string& parameter) const;
72 std::string getDateTag() const { return "(0040,a121)"; }
73 bool setDate(std::string parameter);
74
75 // DateTime (0040,a120) vr=DT, vm=1, type=1C
76 bool getDateTime(std::string& parameter) const;
77 std::string getDateTimeTag() const { return "(0040,a120)"; }
78 bool setDateTime(std::string parameter);
79
80 // NumericValue (0040,a30a) vr=DS, vm=1-n, type=1C
81 bool getNumericValue(std::string& parameter) const;
82 std::string getNumericValueTag() const { return "(0040,a30a)"; }
83 bool setNumericValue(std::string parameter);
84
85 // PersonName (0040,a123) vr=PN, vm=1, type=1C
86 bool getPersonName(std::string& parameter) const;
87 std::string getPersonNameTag() const { return "(0040,a123)"; }
88 bool setPersonName(std::string parameter);
89
90 // TextValue (0040,a160) vr=UT, vm=1, type=1C
91 bool getTextValue(std::string& parameter) const;
92 std::string getTextValueTag() const { return "(0040,a160)"; }
93 bool setTextValue(std::string parameter);
94
95 // Time (0040,a122) vr=TM, vm=1, type=1C
96 bool getTime(std::string& parameter) const;
97 std::string getTimeTag() const { return "(0040,a122)"; }
98 bool setTime(std::string parameter);
99
100 // UID (0040,a124) vr=UI, vm=1, type=1C
101 bool getUID(std::string& parameter) const;
102 std::string getUIDTag() const { return "(0040,a124)"; }
103 bool setUID(std::string parameter);
104
105 // ValueType (0040,a040) vr=CS, vm=1, type=1
106 bool getValueType(std::string& parameter) const;
107 std::string getValueTypeTag() const { return "(0040,a040)"; }
108 bool setValueType(std::string parameter);
109
110 // ConceptCodeSequence (0040,a168) vr=SQ, vm=1, type=1C
112 std::string getConceptCodeSequenceTag() const { return std::string("(0040,a168)"); }
114
115 // ConceptNameCodeSequence (0040,a043) vr=SQ, vm=1, type=1
117 std::string getConceptNameCodeSequenceTag() const { return std::string("(0040,a043)"); }
119
120 // ContentItemModifierSequence (0040,0441) vr=SQ, vm=1, type=3
122 std::string getContentItemModifierSequenceTag() const { return std::string("(0040,0441)"); }
124
125 // MeasurementUnitsCodeSequence (0040,08ea) vr=SQ, vm=1, type=1C
127 std::string getMeasurementUnitsCodeSequenceTag() const { return std::string("(0040,08ea)"); }
129
130
131 private:
132
133 DCMTree::TreePtr _dcmItem;
134
135 };
136
138
140 DcmDRTProtocolContextSequenceInterface(std::vector<DcmDRTProtocolContextSequenceInterface::Item> dcmSequence) : _itemVec(dcmSequence) {}
141
148
151 // Date (0040,a121) vr=DA, vm=1, type=1C
152 bool getDate(unsigned long idx, std::string& parameter) const;
153 bool getDate(DCMTree::TreePtr item, std::string& parameter) const;
154 std::string getDateTag() const { return "(0040,a121)"; }
155 bool setDate(unsigned long idx, std::string parameter);
156
157 // DateTime (0040,a120) vr=DT, vm=1, type=1C
158 bool getDateTime(unsigned long idx, std::string& parameter) const;
159 bool getDateTime(DCMTree::TreePtr item, std::string& parameter) const;
160 std::string getDateTimeTag() const { return "(0040,a120)"; }
161 bool setDateTime(unsigned long idx, std::string parameter);
162
163 // NumericValue (0040,a30a) vr=DS, vm=1-n, type=1C
164 bool getNumericValue(unsigned long idx, std::string& parameter) const;
165 bool getNumericValue(DCMTree::TreePtr item, std::string& parameter) const;
166 std::string getNumericValueTag() const { return "(0040,a30a)"; }
167 bool setNumericValue(unsigned long idx, std::string parameter);
168
169 // PersonName (0040,a123) vr=PN, vm=1, type=1C
170 bool getPersonName(unsigned long idx, std::string& parameter) const;
171 bool getPersonName(DCMTree::TreePtr item, std::string& parameter) const;
172 std::string getPersonNameTag() const { return "(0040,a123)"; }
173 bool setPersonName(unsigned long idx, std::string parameter);
174
175 // TextValue (0040,a160) vr=UT, vm=1, type=1C
176 bool getTextValue(unsigned long idx, std::string& parameter) const;
177 bool getTextValue(DCMTree::TreePtr item, std::string& parameter) const;
178 std::string getTextValueTag() const { return "(0040,a160)"; }
179 bool setTextValue(unsigned long idx, std::string parameter);
180
181 // Time (0040,a122) vr=TM, vm=1, type=1C
182 bool getTime(unsigned long idx, std::string& parameter) const;
183 bool getTime(DCMTree::TreePtr item, std::string& parameter) const;
184 std::string getTimeTag() const { return "(0040,a122)"; }
185 bool setTime(unsigned long idx, std::string parameter);
186
187 // UID (0040,a124) vr=UI, vm=1, type=1C
188 bool getUID(unsigned long idx, std::string& parameter) const;
189 bool getUID(DCMTree::TreePtr item, std::string& parameter) const;
190 std::string getUIDTag() const { return "(0040,a124)"; }
191 bool setUID(unsigned long idx, std::string parameter);
192
193 // ValueType (0040,a040) vr=CS, vm=1, type=1
194 bool getValueType(unsigned long idx, std::string& parameter) const;
195 bool getValueType(DCMTree::TreePtr item, std::string& parameter) const;
196 std::string getValueTypeTag() const { return "(0040,a040)"; }
197 bool setValueType(unsigned long idx, std::string parameter);
198
199 // ConceptCodeSequence (0040,a168) vr=SQ, vm=1, type=1C
201 std::string getConceptCodeSequenceTag() const { return std::string("(0040,a168)"); }
203
204 // ConceptNameCodeSequence (0040,a043) vr=SQ, vm=1, type=1
206 std::string getConceptNameCodeSequenceTag() const { return std::string("(0040,a043)"); }
208
209 // ContentItemModifierSequence (0040,0441) vr=SQ, vm=1, type=3
211 std::string getContentItemModifierSequenceTag() const { return std::string("(0040,0441)"); }
213
214 // MeasurementUnitsCodeSequence (0040,08ea) vr=SQ, vm=1, type=1C
216 std::string getMeasurementUnitsCodeSequenceTag() const { return std::string("(0040,08ea)"); }
218
219
222 void setSequence(std::vector<DcmDRTProtocolContextSequenceInterface::Item> dcmSequence) {
223 _itemVec = dcmSequence;
224 }
225
228 std::vector<DcmDRTProtocolContextSequenceInterface::Item> getSequence() const {
229 return _itemVec;
230 }
231
234 bool hasSequence() const {
235 return (_itemVec.size() != 0);
236 }
237
241 return static_cast<MLint>(_itemVec.size());
242 }
243
247 if (_itemVec.size() > idx) {
248 return _itemVec[idx];
249 }
251 }
252
257 return _itemVec[_itemVec.size()-1];
258 }
259
263
266 bool insertItem(const size_t idx) {
267 if (_itemVec.size() > idx) {
268 std::vector<DcmDRTProtocolContextSequenceInterface::Item>::iterator it = _itemVec.begin();
269 std::advance(it, idx);
271 return true;
272 }
273 return false;
274 }
275
278 bool removeItem(const size_t idx) {
279 if ( _itemVec.size() > idx ) {
280 std::vector<DcmDRTProtocolContextSequenceInterface::Item>::iterator it = _itemVec.begin();
281 std::advance(it, idx);
282 _itemVec.erase(it);
283 return true;
284 }
285 return false;
286 }
287
288 protected:
290 std::vector<DcmDRTProtocolContextSequenceInterface::Item> _itemVec;
291};
292
294
295#endif // __mlDcmDRTProtocolContextSequenceInterface_H
296
297/* MeVis-Hidden-Components-Start */
298/* MeVis-Hidden-Components-End */
#define MLDCMTKACCESSORIES_EXPORT
Class to provide access to DRTConceptCodeSequence.
Class to provide access to DRTConceptNameCodeSequence.
Class to provide access to DRTContentItemModifierSequence.
Class to provide access to DRTMeasurementUnitsCodeSequence.
void setMeasurementUnitsCodeSequence(DcmDRTMeasurementUnitsCodeSequenceInterface seq)
bool getTime(std::string &parameter) const
DcmDRTConceptCodeSequenceInterface getConceptCodeSequence() const
void setContentItemModifierSequence(DcmDRTContentItemModifierSequenceInterface seq)
DcmDRTMeasurementUnitsCodeSequenceInterface getMeasurementUnitsCodeSequence() const
bool getNumericValue(std::string &parameter) const
void setConceptNameCodeSequence(DcmDRTConceptNameCodeSequenceInterface seq)
DcmDRTContentItemModifierSequenceInterface getContentItemModifierSequence() const
bool getDate(std::string &parameter) const
bool getUID(std::string &parameter) const
void setConceptCodeSequence(DcmDRTConceptCodeSequenceInterface seq)
bool getPersonName(std::string &parameter) const
bool getDateTime(std::string &parameter) const
bool getTextValue(std::string &parameter) const
bool getValueType(std::string &parameter) const
DcmDRTConceptNameCodeSequenceInterface getConceptNameCodeSequence() const
Class to provide access to DRTProtocolContextSequence.
bool setTime(unsigned long idx, std::string parameter)
bool setNumericValue(unsigned long idx, std::string parameter)
DcmDRTProtocolContextSequenceInterface(std::vector< DcmDRTProtocolContextSequenceInterface::Item > dcmSequence)
Default Constructor.
bool setDateTime(unsigned long idx, std::string parameter)
DcmDRTContentItemModifierSequenceInterface getContentItemModifierSequence(unsigned long idx) const
void addItem(DcmDRTProtocolContextSequenceInterface::Item newItem)
DcmDRTConceptNameCodeSequenceInterface getConceptNameCodeSequence(unsigned long idx) const
DcmDRTConceptCodeSequenceInterface getConceptCodeSequence(unsigned long idx) const
MLint getNumberOfItems() const
Return number of items the internal sequence consists of.
void setConceptCodeSequence(DcmDRTConceptCodeSequenceInterface seq, unsigned long idx)
bool setUID(unsigned long idx, std::string parameter)
void setMeasurementUnitsCodeSequence(DcmDRTMeasurementUnitsCodeSequenceInterface seq, unsigned long idx)
void setConceptNameCodeSequence(DcmDRTConceptNameCodeSequenceInterface seq, unsigned long idx)
bool hasSequence() const
Check if the DRTProtocolContextSequence is set.
std::vector< DcmDRTProtocolContextSequenceInterface::Item > getSequence() const
Return the DRTProtocolContextSequence this interface class provides access to.
bool getTime(DCMTree::TreePtr item, std::string &parameter) const
bool setDate(unsigned long idx, std::string parameter)
bool getNumericValue(DCMTree::TreePtr item, std::string &parameter) const
std::vector< DcmDRTProtocolContextSequenceInterface::Item > _itemVec
Reference to the wrapped DICOM tree pointer vector.
bool getPersonName(unsigned long idx, std::string &parameter) const
DcmDRTMeasurementUnitsCodeSequenceInterface getMeasurementUnitsCodeSequence(unsigned long idx) const
bool getDate(DCMTree::TreePtr item, std::string &parameter) const
void setContentItemModifierSequence(DcmDRTContentItemModifierSequenceInterface seq, unsigned long idx)
bool getTextValue(DCMTree::TreePtr item, std::string &parameter) const
bool getDateTime(unsigned long idx, std::string &parameter) const
bool getPersonName(DCMTree::TreePtr item, std::string &parameter) const
DcmDRTProtocolContextSequenceInterface::Item & addItem()
Adds a new item to the sequence.
bool getDateTime(DCMTree::TreePtr item, std::string &parameter) const
virtual ~DcmDRTProtocolContextSequenceInterface()
Default virtual Destructor.
bool getUID(unsigned long idx, std::string &parameter) const
bool getUID(DCMTree::TreePtr item, std::string &parameter) const
bool setValueType(unsigned long idx, std::string parameter)
bool getTextValue(unsigned long idx, std::string &parameter) const
bool setPersonName(unsigned long idx, std::string parameter)
DcmDRTProtocolContextSequenceInterface::Item getItem(const size_t idx) const
Gets the item at the indicated position.
bool getTime(unsigned long idx, std::string &parameter) const
bool getDate(unsigned long idx, std::string &parameter) const
bool getValueType(DCMTree::TreePtr item, std::string &parameter) const
void setSequence(std::vector< DcmDRTProtocolContextSequenceInterface::Item > dcmSequence)
Set the DRTProtocolContextSequence this interface class provides access to.
bool getValueType(unsigned long idx, std::string &parameter) const
bool getNumericValue(unsigned long idx, std::string &parameter) const
bool insertItem(const size_t idx)
Insert an item at the indicated position.
bool setTextValue(unsigned long idx, std::string parameter)
bool removeItem(const size_t idx)
Removes the indicated item from the sequence.
Class to provide access to DRTConceptCodeSequence.
Class to provide access to DRTConceptNameCodeSequence.
Class to provide access to DRTContentItemModifierSequence.
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