MeVisLab Toolbox Reference
mlDcmDRTOtherPatientIDsSequenceInterface.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 __mlDcmDRTOtherPatientIDsSequenceInterface_H
24 #define __mlDcmDRTOtherPatientIDsSequenceInterface_H
25 
26 // Local includes
27 #include "mlDcmtkAccessories.h"
28 
29 // Dcmtk includes
30 //#include "mlDcmDRTOtherPatientIDsSequenceInterface.h" //DRTOtherPatientIDsSequence
31 
32 
33 // ML includes
34 #ifndef __mlModuleIncludes_H
35 #include "mlModuleIncludes.h"
36 #endif
37 
38 ML_START_NAMESPACE
39 
40 // ------------------------------------------------------------------
42 // ------------------------------------------------------------------
44 {
45  public:
46 
48  {
49  public:
50 
51  Item() { _dcmItem = DcmtkAccessories::createNewDicomTree(); }
52 
53  Item(DCMTree::TreePtr dcmItem) : _dcmItem(dcmItem) {}
54 
55  Item(const Item &copyDcmItem) : _dcmItem(copyDcmItem.getTreePtr()) {}
56 
57  Item &operator=(const Item &copyDcmItem){ _dcmItem = copyDcmItem.getTreePtr(); return *this; }
58 
59  virtual ~Item() {}
60 
61  DCMTree::TreePtr getTreePtr() const { return _dcmItem; }
62 
63  bool isValid() const { return _dcmItem.get() != nullptr; }
64 
65 
66  // IssuerOfPatientID (0010,0021) vr=LO, vm=1, type=1
67  bool getIssuerOfPatientID(std::string& parameter) const;
68  std::string getIssuerOfPatientIDTag() const { return "(0010,0021)"; }
69  bool setIssuerOfPatientID(std::string parameter);
70 
71  // PatientID (0010,0020) vr=LO, vm=1, type=1
72  bool getPatientID(std::string& parameter) const;
73  std::string getPatientIDTag() const { return "(0010,0020)"; }
74  bool setPatientID(std::string parameter);
75 
76  // TypeOfPatientID (0010,0022) vr=CS, vm=1, type=1
77  bool getTypeOfPatientID(std::string& parameter) const;
78  std::string getTypeOfPatientIDTag() const { return "(0010,0022)"; }
79  bool setTypeOfPatientID(std::string parameter);
80 
81 
82  private:
83 
84  DCMTree::TreePtr _dcmItem;
85 
86  };
87 
89 
91  DcmDRTOtherPatientIDsSequenceInterface(std::vector<DcmDRTOtherPatientIDsSequenceInterface::Item> dcmSequence) : _itemVec(dcmSequence) {}
92 
94  for(size_t i=0; i < treePtrSeq.size(); i++)
95  {
96  _itemVec.push_back(DcmDRTOtherPatientIDsSequenceInterface::Item(treePtrSeq[i]));
97  }
98  }
99 
102  // IssuerOfPatientID (0010,0021) vr=LO, vm=1, type=1
103  bool getIssuerOfPatientID(unsigned long idx, std::string& parameter) const;
104  bool getIssuerOfPatientID(DCMTree::TreePtr item, std::string& parameter) const;
105  std::string getIssuerOfPatientIDTag() const { return "(0010,0021)"; }
106  bool setIssuerOfPatientID(unsigned long idx, std::string parameter);
107 
108  // PatientID (0010,0020) vr=LO, vm=1, type=1
109  bool getPatientID(unsigned long idx, std::string& parameter) const;
110  bool getPatientID(DCMTree::TreePtr item, std::string& parameter) const;
111  std::string getPatientIDTag() const { return "(0010,0020)"; }
112  bool setPatientID(unsigned long idx, std::string parameter);
113 
114  // TypeOfPatientID (0010,0022) vr=CS, vm=1, type=1
115  bool getTypeOfPatientID(unsigned long idx, std::string& parameter) const;
116  bool getTypeOfPatientID(DCMTree::TreePtr item, std::string& parameter) const;
117  std::string getTypeOfPatientIDTag() const { return "(0010,0022)"; }
118  bool setTypeOfPatientID(unsigned long idx, std::string parameter);
119 
120 
123  void setSequence(std::vector<DcmDRTOtherPatientIDsSequenceInterface::Item> dcmSequence) {
124  _itemVec = dcmSequence;
125  }
126 
129  std::vector<DcmDRTOtherPatientIDsSequenceInterface::Item> getSequence() const {
130  return _itemVec;
131  }
132 
135  bool hasSequence() const {
136  return (_itemVec.size() != 0);
137  }
138 
142  return static_cast<MLint>(_itemVec.size());
143  }
144 
148  if (_itemVec.size() > idx) {
149  return _itemVec[idx];
150  }
152  }
153 
157  _itemVec.push_back(DcmDRTOtherPatientIDsSequenceInterface::Item());
158  return _itemVec[_itemVec.size()-1];
159  }
160 
162  _itemVec.push_back(newItem);
163  }
164 
167  bool insertItem(const size_t idx) {
168  if (_itemVec.size() > idx) {
169  std::vector<DcmDRTOtherPatientIDsSequenceInterface::Item>::iterator it = _itemVec.begin();
170  std::advance(it, idx);
171  _itemVec.insert(it, DcmDRTOtherPatientIDsSequenceInterface::Item());
172  return true;
173  }
174  return false;
175  }
176 
179  bool removeItem(const size_t idx) {
180  if ( _itemVec.size() > idx ) {
181  std::vector<DcmDRTOtherPatientIDsSequenceInterface::Item>::iterator it = _itemVec.begin();
182  std::advance(it, idx);
183  _itemVec.erase(it);
184  return true;
185  }
186  return false;
187  }
188 
189  protected:
191  std::vector<DcmDRTOtherPatientIDsSequenceInterface::Item> _itemVec;
192 };
193 
194 ML_END_NAMESPACE
195 
196 #endif // __mlDcmDRTOtherPatientIDsSequenceInterface_H
197 
198 /* MeVis-Hidden-Components-Start */
199 /* MeVis-Hidden-Components-End */
#define MLDCMTKACCESSORIES_EXPORT
bool getTypeOfPatientID(std::string &parameter) const
bool setTypeOfPatientID(std::string parameter)
bool setIssuerOfPatientID(std::string parameter)
bool getPatientID(std::string &parameter) const
bool getIssuerOfPatientID(std::string &parameter) const
Class to provide access to DRTOtherPatientIDsSequence.
DcmDRTOtherPatientIDsSequenceInterface::Item getItem(const size_t idx) const
Gets the item at the indicated position.
std::vector< DcmDRTOtherPatientIDsSequenceInterface::Item > _itemVec
Reference to the wrapped DICOM tree pointer vector.
bool getPatientID(unsigned long idx, std::string &parameter) const
virtual ~DcmDRTOtherPatientIDsSequenceInterface()
Default virtual Destructor.
bool getIssuerOfPatientID(DCMTree::TreePtr item, std::string &parameter) const
bool setIssuerOfPatientID(unsigned long idx, std::string parameter)
bool getTypeOfPatientID(DCMTree::TreePtr item, std::string &parameter) const
bool getIssuerOfPatientID(unsigned long idx, std::string &parameter) const
bool getTypeOfPatientID(unsigned long idx, std::string &parameter) const
DcmDRTOtherPatientIDsSequenceInterface::Item & addItem()
Adds a new item to the sequence.
std::vector< DcmDRTOtherPatientIDsSequenceInterface::Item > getSequence() const
Return the DRTOtherPatientIDsSequence this interface class provides access to.
DcmDRTOtherPatientIDsSequenceInterface(std::vector< DcmDRTOtherPatientIDsSequenceInterface::Item > dcmSequence)
Default Constructor.
bool setPatientID(unsigned long idx, std::string parameter)
bool hasSequence() const
Check if the DRTOtherPatientIDsSequence is set.
void addItem(DcmDRTOtherPatientIDsSequenceInterface::Item newItem)
void setSequence(std::vector< DcmDRTOtherPatientIDsSequenceInterface::Item > dcmSequence)
Set the DRTOtherPatientIDsSequence this interface class provides access to.
DcmDRTOtherPatientIDsSequenceInterface(DCMTree::TreePtrVector treePtrSeq)
bool getPatientID(DCMTree::TreePtr item, std::string &parameter) const
bool removeItem(const size_t idx)
Removes the indicated item from the sequence.
bool setTypeOfPatientID(unsigned long idx, std::string parameter)
bool insertItem(const size_t idx)
Insert an item at the indicated position.
MLint getNumberOfItems() const
Return number of items the internal sequence consists of.
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