MeVisLab Toolbox Reference
mlDcmDRTOriginalAttributesSequenceInterface.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 __mlDcmDRTOriginalAttributesSequenceInterface_H
24 #define __mlDcmDRTOriginalAttributesSequenceInterface_H
25 
26 // Local includes
27 #include "mlDcmtkAccessories.h"
28 
29 // Dcmtk includes
30 //#include "mlDcmDRTOriginalAttributesSequenceInterface.h" //DRTOriginalAttributesSequence
31 #include "mlDcmDRTModifiedAttributesSequenceInterface.h" //DRTModifiedAttributesSequence
32 
33 
34 // ML includes
35 #ifndef __mlModuleIncludes_H
36 #include "mlModuleIncludes.h"
37 #endif
38 
39 ML_START_NAMESPACE
40 
41 // ------------------------------------------------------------------
43 // ------------------------------------------------------------------
45 {
46  public:
47 
49  {
50  public:
51 
52  Item() { _dcmItem = DcmtkAccessories::createNewDicomTree(); }
53 
54  Item(DCMTree::TreePtr dcmItem) : _dcmItem(dcmItem) {}
55 
56  Item(const Item &copyDcmItem) : _dcmItem(copyDcmItem.getTreePtr()) {}
57 
58  Item &operator=(const Item &copyDcmItem){ _dcmItem = copyDcmItem.getTreePtr(); return *this; }
59 
60  virtual ~Item() {}
61 
62  DCMTree::TreePtr getTreePtr() const { return _dcmItem; }
63 
64  bool isValid() const { return _dcmItem.get() != nullptr; }
65 
66 
67  // AttributeModificationDateTime (0400,0562) vr=DT, vm=1, type=1
68  bool getAttributeModificationDateTime(std::string& parameter) const;
69  std::string getAttributeModificationDateTimeTag() const { return "(0400,0562)"; }
70  bool setAttributeModificationDateTime(std::string parameter);
71 
72  // HL7InstanceIdentifier (0040,e001) vr=ST, vm=1, type=1
73  bool getHL7InstanceIdentifier(std::string& parameter) const;
74  std::string getHL7InstanceIdentifierTag() const { return "(0040,e001)"; }
75  bool setHL7InstanceIdentifier(std::string parameter);
76 
77  // ModifyingSystem (0400,0563) vr=LO, vm=1, type=1
78  bool getModifyingSystem(std::string& parameter) const;
79  std::string getModifyingSystemTag() const { return "(0400,0563)"; }
80  bool setModifyingSystem(std::string parameter);
81 
82  // ReasonForTheAttributeModification (0400,0565) vr=CS, vm=1, type=1
83  bool getReasonForTheAttributeModification(std::string& parameter) const;
84  std::string getReasonForTheAttributeModificationTag() const { return "(0400,0565)"; }
85  bool setReasonForTheAttributeModification(std::string parameter);
86 
87  // ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1
88  bool getReferencedSOPClassUID(std::string& parameter) const;
89  std::string getReferencedSOPClassUIDTag() const { return "(0008,1150)"; }
90  bool setReferencedSOPClassUID(std::string parameter);
91 
92  // ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1
93  bool getReferencedSOPInstanceUID(std::string& parameter) const;
94  std::string getReferencedSOPInstanceUIDTag() const { return "(0008,1155)"; }
95  bool setReferencedSOPInstanceUID(std::string parameter);
96 
97  // RetrieveURI (0040,e010) vr=UT, vm=1, type=3
98  bool getRetrieveURI(std::string& parameter) const;
99  std::string getRetrieveURITag() const { return "(0040,e010)"; }
100  bool setRetrieveURI(std::string parameter);
101 
102  // SourceOfPreviousValues (0400,0564) vr=LO, vm=1, type=2
103  bool getSourceOfPreviousValues(std::string& parameter) const;
104  std::string getSourceOfPreviousValuesTag() const { return "(0400,0564)"; }
105  bool setSourceOfPreviousValues(std::string parameter);
106 
107  // ModifiedAttributesSequence (0400,0550) vr=SQ, vm=1, type=1
109  std::string getModifiedAttributesSequenceTag() const { return std::string("(0400,0550)"); }
111 
112 
113  private:
114 
115  DCMTree::TreePtr _dcmItem;
116 
117  };
118 
120 
122  DcmDRTOriginalAttributesSequenceInterface(std::vector<DcmDRTOriginalAttributesSequenceInterface::Item> dcmSequence) : _itemVec(dcmSequence) {}
123 
125  for(size_t i=0; i < treePtrSeq.size(); i++)
126  {
127  _itemVec.push_back(DcmDRTOriginalAttributesSequenceInterface::Item(treePtrSeq[i]));
128  }
129  }
130 
133  // AttributeModificationDateTime (0400,0562) vr=DT, vm=1, type=1
134  bool getAttributeModificationDateTime(unsigned long idx, std::string& parameter) const;
135  bool getAttributeModificationDateTime(DCMTree::TreePtr item, std::string& parameter) const;
136  std::string getAttributeModificationDateTimeTag() const { return "(0400,0562)"; }
137  bool setAttributeModificationDateTime(unsigned long idx, std::string parameter);
138 
139  // HL7InstanceIdentifier (0040,e001) vr=ST, vm=1, type=1
140  bool getHL7InstanceIdentifier(unsigned long idx, std::string& parameter) const;
141  bool getHL7InstanceIdentifier(DCMTree::TreePtr item, std::string& parameter) const;
142  std::string getHL7InstanceIdentifierTag() const { return "(0040,e001)"; }
143  bool setHL7InstanceIdentifier(unsigned long idx, std::string parameter);
144 
145  // ModifyingSystem (0400,0563) vr=LO, vm=1, type=1
146  bool getModifyingSystem(unsigned long idx, std::string& parameter) const;
147  bool getModifyingSystem(DCMTree::TreePtr item, std::string& parameter) const;
148  std::string getModifyingSystemTag() const { return "(0400,0563)"; }
149  bool setModifyingSystem(unsigned long idx, std::string parameter);
150 
151  // ReasonForTheAttributeModification (0400,0565) vr=CS, vm=1, type=1
152  bool getReasonForTheAttributeModification(unsigned long idx, std::string& parameter) const;
153  bool getReasonForTheAttributeModification(DCMTree::TreePtr item, std::string& parameter) const;
154  std::string getReasonForTheAttributeModificationTag() const { return "(0400,0565)"; }
155  bool setReasonForTheAttributeModification(unsigned long idx, std::string parameter);
156 
157  // ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1
158  bool getReferencedSOPClassUID(unsigned long idx, std::string& parameter) const;
159  bool getReferencedSOPClassUID(DCMTree::TreePtr item, std::string& parameter) const;
160  std::string getReferencedSOPClassUIDTag() const { return "(0008,1150)"; }
161  bool setReferencedSOPClassUID(unsigned long idx, std::string parameter);
162 
163  // ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1
164  bool getReferencedSOPInstanceUID(unsigned long idx, std::string& parameter) const;
165  bool getReferencedSOPInstanceUID(DCMTree::TreePtr item, std::string& parameter) const;
166  std::string getReferencedSOPInstanceUIDTag() const { return "(0008,1155)"; }
167  bool setReferencedSOPInstanceUID(unsigned long idx, std::string parameter);
168 
169  // RetrieveURI (0040,e010) vr=UT, vm=1, type=3
170  bool getRetrieveURI(unsigned long idx, std::string& parameter) const;
171  bool getRetrieveURI(DCMTree::TreePtr item, std::string& parameter) const;
172  std::string getRetrieveURITag() const { return "(0040,e010)"; }
173  bool setRetrieveURI(unsigned long idx, std::string parameter);
174 
175  // SourceOfPreviousValues (0400,0564) vr=LO, vm=1, type=2
176  bool getSourceOfPreviousValues(unsigned long idx, std::string& parameter) const;
177  bool getSourceOfPreviousValues(DCMTree::TreePtr item, std::string& parameter) const;
178  std::string getSourceOfPreviousValuesTag() const { return "(0400,0564)"; }
179  bool setSourceOfPreviousValues(unsigned long idx, std::string parameter);
180 
181  // ModifiedAttributesSequence (0400,0550) vr=SQ, vm=1, type=1
183  std::string getModifiedAttributesSequenceTag() const { return std::string("(0400,0550)"); }
185 
186 
189  void setSequence(std::vector<DcmDRTOriginalAttributesSequenceInterface::Item> dcmSequence) {
190  _itemVec = dcmSequence;
191  }
192 
195  std::vector<DcmDRTOriginalAttributesSequenceInterface::Item> getSequence() const {
196  return _itemVec;
197  }
198 
201  bool hasSequence() const {
202  return (_itemVec.size() != 0);
203  }
204 
208  return static_cast<MLint>(_itemVec.size());
209  }
210 
214  if (_itemVec.size() > idx) {
215  return _itemVec[idx];
216  }
218  }
219 
224  return _itemVec[_itemVec.size()-1];
225  }
226 
228  _itemVec.push_back(newItem);
229  }
230 
233  bool insertItem(const size_t idx) {
234  if (_itemVec.size() > idx) {
235  std::vector<DcmDRTOriginalAttributesSequenceInterface::Item>::iterator it = _itemVec.begin();
236  std::advance(it, idx);
238  return true;
239  }
240  return false;
241  }
242 
245  bool removeItem(const size_t idx) {
246  if ( _itemVec.size() > idx ) {
247  std::vector<DcmDRTOriginalAttributesSequenceInterface::Item>::iterator it = _itemVec.begin();
248  std::advance(it, idx);
249  _itemVec.erase(it);
250  return true;
251  }
252  return false;
253  }
254 
255  protected:
257  std::vector<DcmDRTOriginalAttributesSequenceInterface::Item> _itemVec;
258 };
259 
260 ML_END_NAMESPACE
261 
262 #endif // __mlDcmDRTOriginalAttributesSequenceInterface_H
263 
264 /* MeVis-Hidden-Components-Start */
265 /* MeVis-Hidden-Components-End */
#define MLDCMTKACCESSORIES_EXPORT
Class to provide access to DRTModifiedAttributesSequence.
bool getReferencedSOPInstanceUID(std::string &parameter) const
bool getAttributeModificationDateTime(std::string &parameter) const
bool setReferencedSOPInstanceUID(std::string parameter)
bool setSourceOfPreviousValues(std::string parameter)
DcmDRTModifiedAttributesSequenceInterface getModifiedAttributesSequence() const
bool getHL7InstanceIdentifier(std::string &parameter) const
bool getSourceOfPreviousValues(std::string &parameter) const
bool setReferencedSOPClassUID(std::string parameter)
bool getModifyingSystem(std::string &parameter) const
bool getReferencedSOPClassUID(std::string &parameter) const
void setModifiedAttributesSequence(DcmDRTModifiedAttributesSequenceInterface seq)
bool setAttributeModificationDateTime(std::string parameter)
bool setHL7InstanceIdentifier(std::string parameter)
bool getReasonForTheAttributeModification(std::string &parameter) const
bool getRetrieveURI(std::string &parameter) const
bool setReasonForTheAttributeModification(std::string parameter)
Class to provide access to DRTOriginalAttributesSequence.
bool setReasonForTheAttributeModification(unsigned long idx, std::string parameter)
bool setReferencedSOPClassUID(unsigned long idx, std::string parameter)
bool getReferencedSOPClassUID(unsigned long idx, std::string &parameter) const
bool getRetrieveURI(unsigned long idx, std::string &parameter) const
bool getSourceOfPreviousValues(unsigned long idx, std::string &parameter) const
MLint getNumberOfItems() const
Return number of items the internal sequence consists of.
bool getModifyingSystem(unsigned long idx, std::string &parameter) const
DcmDRTOriginalAttributesSequenceInterface::Item getItem(const size_t idx) const
Gets the item at the indicated position.
DcmDRTOriginalAttributesSequenceInterface(std::vector< DcmDRTOriginalAttributesSequenceInterface::Item > dcmSequence)
Default Constructor.
std::vector< DcmDRTOriginalAttributesSequenceInterface::Item > getSequence() const
Return the DRTOriginalAttributesSequence this interface class provides access to.
bool setAttributeModificationDateTime(unsigned long idx, std::string parameter)
void setSequence(std::vector< DcmDRTOriginalAttributesSequenceInterface::Item > dcmSequence)
Set the DRTOriginalAttributesSequence this interface class provides access to.
bool getModifyingSystem(DCMTree::TreePtr item, std::string &parameter) const
bool setReferencedSOPInstanceUID(unsigned long idx, std::string parameter)
bool setSourceOfPreviousValues(unsigned long idx, std::string parameter)
bool insertItem(const size_t idx)
Insert an item at the indicated position.
bool getReasonForTheAttributeModification(unsigned long idx, std::string &parameter) const
bool setModifyingSystem(unsigned long idx, std::string parameter)
void setModifiedAttributesSequence(DcmDRTModifiedAttributesSequenceInterface seq, unsigned long idx)
bool getReferencedSOPInstanceUID(unsigned long idx, std::string &parameter) const
bool hasSequence() const
Check if the DRTOriginalAttributesSequence is set.
DcmDRTOriginalAttributesSequenceInterface::Item & addItem()
Adds a new item to the sequence.
bool getReferencedSOPClassUID(DCMTree::TreePtr item, std::string &parameter) const
bool setHL7InstanceIdentifier(unsigned long idx, std::string parameter)
bool getHL7InstanceIdentifier(DCMTree::TreePtr item, std::string &parameter) const
bool setRetrieveURI(unsigned long idx, std::string parameter)
bool getAttributeModificationDateTime(DCMTree::TreePtr item, std::string &parameter) const
bool getHL7InstanceIdentifier(unsigned long idx, std::string &parameter) const
bool getReasonForTheAttributeModification(DCMTree::TreePtr item, std::string &parameter) const
bool getAttributeModificationDateTime(unsigned long idx, std::string &parameter) const
std::vector< DcmDRTOriginalAttributesSequenceInterface::Item > _itemVec
Reference to the wrapped DICOM tree pointer vector.
void addItem(DcmDRTOriginalAttributesSequenceInterface::Item newItem)
bool removeItem(const size_t idx)
Removes the indicated item from the sequence.
DcmDRTModifiedAttributesSequenceInterface getModifiedAttributesSequence(unsigned long idx) const
bool getReferencedSOPInstanceUID(DCMTree::TreePtr item, std::string &parameter) const
bool getRetrieveURI(DCMTree::TreePtr item, std::string &parameter) const
bool getSourceOfPreviousValues(DCMTree::TreePtr item, std::string &parameter) const
Class to provide access to DRTModifiedAttributesSequence.
Class collecting some DICOM helper functionality explicitly for dcmtk.
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
Definition: mlTypeDefs.h:578
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:70