MeVisLab Toolbox Reference
mlDcmDRTContourImageSequenceInterface.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 __mlDcmDRTContourImageSequenceInterface_H
24#define __mlDcmDRTContourImageSequenceInterface_H
25
26// Local includes
27#include "mlDcmtkAccessories.h"
28
29// Dcmtk includes
30//#include "mlDcmDRTContourImageSequenceInterface.h" //DRTContourImageSequence
31
32
33// ML includes
34#ifndef __mlModuleIncludes_H
35#include "mlModuleIncludes.h"
36#endif
37
39
40// ------------------------------------------------------------------
42// ------------------------------------------------------------------
44{
45 public:
46
48 {
49 public:
50
51 Item() { _dcmItem = DcmtkAccessories::createNewDicomTree(); }
52
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 // ReferencedFrameNumber (0008,1160) vr=IS, vm=1-n, type=1C
67 bool getReferencedFrameNumber(std::string& parameter) const;
68 std::string getReferencedFrameNumberTag() const { return "(0008,1160)"; }
69 bool setReferencedFrameNumber(std::string parameter);
70
71 // ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1
72 bool getReferencedSOPClassUID(std::string& parameter) const;
73 std::string getReferencedSOPClassUIDTag() const { return "(0008,1150)"; }
74 bool setReferencedSOPClassUID(std::string parameter);
75
76 // ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1
77 bool getReferencedSOPInstanceUID(std::string& parameter) const;
78 std::string getReferencedSOPInstanceUIDTag() const { return "(0008,1155)"; }
79 bool setReferencedSOPInstanceUID(std::string parameter);
80
81 // ReferencedSegmentNumber (0062,000b) vr=US, vm=1-n, type=1C
82 bool getReferencedSegmentNumber(MLuint16& parameter) const;
83 std::string getReferencedSegmentNumberTag() const { return "(0062,000b)"; }
85
86
87 private:
88
89 DCMTree::TreePtr _dcmItem;
90
91 };
92
94
96 DcmDRTContourImageSequenceInterface(std::vector<DcmDRTContourImageSequenceInterface::Item> dcmSequence) : _itemVec(dcmSequence) {}
97
104
107 // ReferencedFrameNumber (0008,1160) vr=IS, vm=1-n, type=1C
108 bool getReferencedFrameNumber(unsigned long idx, std::string& parameter) const;
109 bool getReferencedFrameNumber(DCMTree::TreePtr item, std::string& parameter) const;
110 std::string getReferencedFrameNumberTag() const { return "(0008,1160)"; }
111 bool setReferencedFrameNumber(unsigned long idx, std::string parameter);
112
113 // ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1
114 bool getReferencedSOPClassUID(unsigned long idx, std::string& parameter) const;
115 bool getReferencedSOPClassUID(DCMTree::TreePtr item, std::string& parameter) const;
116 std::string getReferencedSOPClassUIDTag() const { return "(0008,1150)"; }
117 bool setReferencedSOPClassUID(unsigned long idx, std::string parameter);
118
119 // ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1
120 bool getReferencedSOPInstanceUID(unsigned long idx, std::string& parameter) const;
121 bool getReferencedSOPInstanceUID(DCMTree::TreePtr item, std::string& parameter) const;
122 std::string getReferencedSOPInstanceUIDTag() const { return "(0008,1155)"; }
123 bool setReferencedSOPInstanceUID(unsigned long idx, std::string parameter);
124
125 // ReferencedSegmentNumber (0062,000b) vr=US, vm=1-n, type=1C
126 bool getReferencedSegmentNumber(unsigned long idx, MLuint16& parameter) const;
128 std::string getReferencedSegmentNumberTag() const { return "(0062,000b)"; }
129 bool setReferencedSegmentNumber(unsigned long idx, MLuint16 parameter);
130
131
134 void setSequence(std::vector<DcmDRTContourImageSequenceInterface::Item> dcmSequence) {
135 _itemVec = dcmSequence;
136 }
137
140 std::vector<DcmDRTContourImageSequenceInterface::Item> getSequence() const {
141 return _itemVec;
142 }
143
146 bool hasSequence() const {
147 return (_itemVec.size() != 0);
148 }
149
153 return static_cast<MLint>(_itemVec.size());
154 }
155
159 if (_itemVec.size() > idx) {
160 return _itemVec[idx];
161 }
163 }
164
168 _itemVec.push_back(DcmDRTContourImageSequenceInterface::Item());
169 return _itemVec[_itemVec.size()-1];
170 }
171
173 _itemVec.push_back(newItem);
174 }
175
178 bool insertItem(const size_t idx) {
179 if (_itemVec.size() > idx) {
180 std::vector<DcmDRTContourImageSequenceInterface::Item>::iterator it = _itemVec.begin();
181 std::advance(it, idx);
183 return true;
184 }
185 return false;
186 }
187
190 bool removeItem(const size_t idx) {
191 if ( _itemVec.size() > idx ) {
192 std::vector<DcmDRTContourImageSequenceInterface::Item>::iterator it = _itemVec.begin();
193 std::advance(it, idx);
194 _itemVec.erase(it);
195 return true;
196 }
197 return false;
198 }
199
200 protected:
202 std::vector<DcmDRTContourImageSequenceInterface::Item> _itemVec;
203};
204
206
207#endif // __mlDcmDRTContourImageSequenceInterface_H
208
209/* MeVis-Hidden-Components-Start */
210/* MeVis-Hidden-Components-End */
#define MLDCMTKACCESSORIES_EXPORT
bool setReferencedFrameNumber(std::string parameter)
bool setReferencedSOPInstanceUID(std::string parameter)
bool setReferencedSOPClassUID(std::string parameter)
bool getReferencedSOPClassUID(std::string &parameter) const
bool getReferencedSegmentNumber(MLuint16 &parameter) const
bool setReferencedSegmentNumber(MLuint16 parameter)
bool getReferencedFrameNumber(std::string &parameter) const
bool getReferencedSOPInstanceUID(std::string &parameter) const
Class to provide access to DRTContourImageSequence.
virtual ~DcmDRTContourImageSequenceInterface()
Default virtual Destructor.
void setSequence(std::vector< DcmDRTContourImageSequenceInterface::Item > dcmSequence)
Set the DRTContourImageSequence this interface class provides access to.
bool getReferencedSOPInstanceUID(unsigned long idx, std::string &parameter) const
bool setReferencedSOPClassUID(unsigned long idx, std::string parameter)
bool getReferencedSOPClassUID(unsigned long idx, std::string &parameter) const
bool getReferencedSegmentNumber(DCMTree::TreePtr item, MLuint16 &parameter) const
bool insertItem(const size_t idx)
Insert an item at the indicated position.
bool getReferencedFrameNumber(DCMTree::TreePtr item, std::string &parameter) const
std::vector< DcmDRTContourImageSequenceInterface::Item > getSequence() const
Return the DRTContourImageSequence this interface class provides access to.
bool getReferencedSOPClassUID(DCMTree::TreePtr item, std::string &parameter) const
DcmDRTContourImageSequenceInterface::Item & addItem()
Adds a new item to the sequence.
bool removeItem(const size_t idx)
Removes the indicated item from the sequence.
bool getReferencedSegmentNumber(unsigned long idx, MLuint16 &parameter) const
bool setReferencedSOPInstanceUID(unsigned long idx, std::string parameter)
bool setReferencedFrameNumber(unsigned long idx, std::string parameter)
bool getReferencedSOPInstanceUID(DCMTree::TreePtr item, std::string &parameter) const
std::vector< DcmDRTContourImageSequenceInterface::Item > _itemVec
Reference to the wrapped DICOM tree pointer vector.
bool setReferencedSegmentNumber(unsigned long idx, MLuint16 parameter)
MLint getNumberOfItems() const
Return number of items the internal sequence consists of.
bool getReferencedFrameNumber(unsigned long idx, std::string &parameter) const
DcmDRTContourImageSequenceInterface(DCMTree::TreePtrVector treePtrSeq)
bool hasSequence() const
Check if the DRTContourImageSequence is set.
DcmDRTContourImageSequenceInterface::Item getItem(const size_t idx) const
Gets the item at the indicated position.
void addItem(DcmDRTContourImageSequenceInterface::Item newItem)
DcmDRTContourImageSequenceInterface(std::vector< DcmDRTContourImageSequenceInterface::Item > dcmSequence)
Default Constructor.
Class collecting some DICOM helper functionality explicitly for dcmtk.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
unsigned short MLuint16
Definition mlTypeDefs.h:142
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