MeVisLab Toolbox Reference
mlDcmDRTRTReferencedStudySequenceInterface.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 __mlDcmDRTRTReferencedStudySequenceInterface_H
24#define __mlDcmDRTRTReferencedStudySequenceInterface_H
25
26// Local includes
27#include "mlDcmtkAccessories.h"
28
29// Dcmtk includes
30//#include "mlDcmDRTRTReferencedStudySequenceInterface.h" //DRTRTReferencedStudySequence
31#include "mlDcmDRTRTReferencedSeriesSequenceInterface.h" //DRTRTReferencedSeriesSequence
32
33
34// ML includes
35#ifndef __mlModuleIncludes_H
36#include "mlModuleIncludes.h"
37#endif
38
40
41// ------------------------------------------------------------------
43// ------------------------------------------------------------------
45{
46 public:
47
49 {
50 public:
51
52 Item() { _dcmItem = DcmtkAccessories::createNewDicomTree(); }
53
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 // ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1C
68 bool getReferencedSOPClassUID(std::string& parameter) const;
69 std::string getReferencedSOPClassUIDTag() const { return "(0008,1150)"; }
70 bool setReferencedSOPClassUID(std::string parameter);
71
72 // ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1C
73 bool getReferencedSOPInstanceUID(std::string& parameter) const;
74 std::string getReferencedSOPInstanceUIDTag() const { return "(0008,1155)"; }
75 bool setReferencedSOPInstanceUID(std::string parameter);
76
77 // RTReferencedSeriesSequence (3006,0014) vr=SQ, vm=1, type=1C
79 std::string getRTReferencedSeriesSequenceTag() const { return std::string("(3006,0014)"); }
81
82
83 private:
84
85 DCMTree::TreePtr _dcmItem;
86
87 };
88
90
92 DcmDRTRTReferencedStudySequenceInterface(std::vector<DcmDRTRTReferencedStudySequenceInterface::Item> dcmSequence) : _itemVec(dcmSequence) {}
93
100
103 // ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1C
104 bool getReferencedSOPClassUID(unsigned long idx, std::string& parameter) const;
105 bool getReferencedSOPClassUID(DCMTree::TreePtr item, std::string& parameter) const;
106 std::string getReferencedSOPClassUIDTag() const { return "(0008,1150)"; }
107 bool setReferencedSOPClassUID(unsigned long idx, std::string parameter);
108
109 // ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1C
110 bool getReferencedSOPInstanceUID(unsigned long idx, std::string& parameter) const;
111 bool getReferencedSOPInstanceUID(DCMTree::TreePtr item, std::string& parameter) const;
112 std::string getReferencedSOPInstanceUIDTag() const { return "(0008,1155)"; }
113 bool setReferencedSOPInstanceUID(unsigned long idx, std::string parameter);
114
115 // RTReferencedSeriesSequence (3006,0014) vr=SQ, vm=1, type=1C
117 std::string getRTReferencedSeriesSequenceTag() const { return std::string("(3006,0014)"); }
119
120
123 void setSequence(std::vector<DcmDRTRTReferencedStudySequenceInterface::Item> dcmSequence) {
124 _itemVec = dcmSequence;
125 }
126
129 std::vector<DcmDRTRTReferencedStudySequenceInterface::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
158 return _itemVec[_itemVec.size()-1];
159 }
160
164
167 bool insertItem(const size_t idx) {
168 if (_itemVec.size() > idx) {
169 std::vector<DcmDRTRTReferencedStudySequenceInterface::Item>::iterator it = _itemVec.begin();
170 std::advance(it, idx);
172 return true;
173 }
174 return false;
175 }
176
179 bool removeItem(const size_t idx) {
180 if ( _itemVec.size() > idx ) {
181 std::vector<DcmDRTRTReferencedStudySequenceInterface::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<DcmDRTRTReferencedStudySequenceInterface::Item> _itemVec;
192};
193
195
196#endif // __mlDcmDRTRTReferencedStudySequenceInterface_H
197
198/* MeVis-Hidden-Components-Start */
199/* MeVis-Hidden-Components-End */
#define MLDCMTKACCESSORIES_EXPORT
Class to provide access to DRTRTReferencedSeriesSequence.
bool setReferencedSOPClassUID(std::string parameter)
bool getReferencedSOPClassUID(std::string &parameter) const
bool setReferencedSOPInstanceUID(std::string parameter)
DcmDRTRTReferencedSeriesSequenceInterface getRTReferencedSeriesSequence() const
void setRTReferencedSeriesSequence(DcmDRTRTReferencedSeriesSequenceInterface seq)
bool getReferencedSOPInstanceUID(std::string &parameter) const
Class to provide access to DRTRTReferencedStudySequence.
DcmDRTRTReferencedStudySequenceInterface::Item getItem(const size_t idx) const
Gets the item at the indicated position.
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.
bool getReferencedSOPClassUID(DCMTree::TreePtr item, std::string &parameter) const
std::vector< DcmDRTRTReferencedStudySequenceInterface::Item > _itemVec
Reference to the wrapped DICOM tree pointer vector.
void setSequence(std::vector< DcmDRTRTReferencedStudySequenceInterface::Item > dcmSequence)
Set the DRTRTReferencedStudySequence this interface class provides access to.
bool getReferencedSOPInstanceUID(unsigned long idx, std::string &parameter) const
DcmDRTRTReferencedSeriesSequenceInterface getRTReferencedSeriesSequence(unsigned long idx) const
bool setReferencedSOPClassUID(unsigned long idx, std::string parameter)
bool removeItem(const size_t idx)
Removes the indicated item from the sequence.
bool getReferencedSOPInstanceUID(DCMTree::TreePtr item, std::string &parameter) const
bool hasSequence() const
Check if the DRTRTReferencedStudySequence is set.
bool getReferencedSOPClassUID(unsigned long idx, std::string &parameter) const
DcmDRTRTReferencedStudySequenceInterface::Item & addItem()
Adds a new item to the sequence.
void setRTReferencedSeriesSequence(DcmDRTRTReferencedSeriesSequenceInterface seq, unsigned long idx)
void addItem(DcmDRTRTReferencedStudySequenceInterface::Item newItem)
std::vector< DcmDRTRTReferencedStudySequenceInterface::Item > getSequence() const
Return the DRTRTReferencedStudySequence this interface class provides access to.
bool setReferencedSOPInstanceUID(unsigned long idx, std::string parameter)
DcmDRTRTReferencedStudySequenceInterface(std::vector< DcmDRTRTReferencedStudySequenceInterface::Item > dcmSequence)
Default Constructor.
Class to provide access to DRTRTReferencedSeriesSequence.
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