MeVisLab Toolbox Reference
mlDcmDRTROIContourSequenceInterface.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 __mlDcmDRTROIContourSequenceInterface_H
24#define __mlDcmDRTROIContourSequenceInterface_H
25
26// Local includes
27#include "mlDcmtkAccessories.h"
28
29// Dcmtk includes
30//#include "mlDcmDRTROIContourSequenceInterface.h" //DRTROIContourSequence
31#include "mlDcmDRTContourSequenceInterface.h" //DRTContourSequence
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 // ROIDisplayColor (3006,002a) vr=IS, vm=3, type=3
68 bool getROIDisplayColor(std::string& parameter) const;
69 std::string getROIDisplayColorTag() const { return "(3006,002a)"; }
70 bool setROIDisplayColor(std::string parameter);
71
72 // ReferencedROINumber (3006,0084) vr=IS, vm=1, type=1
73 bool getReferencedROINumber(std::string& parameter) const;
74 std::string getReferencedROINumberTag() const { return "(3006,0084)"; }
75 bool setReferencedROINumber(std::string parameter);
76
77 // ContourSequence (3006,0040) vr=SQ, vm=1, type=3
79 std::string getContourSequenceTag() const { return std::string("(3006,0040)"); }
81
82
83 private:
84
85 DCMTree::TreePtr _dcmItem;
86
87 };
88
90
92 DcmDRTROIContourSequenceInterface(std::vector<DcmDRTROIContourSequenceInterface::Item> dcmSequence) : _itemVec(dcmSequence) {}
93
100
103 // ROIDisplayColor (3006,002a) vr=IS, vm=3, type=3
104 bool getROIDisplayColor(unsigned long idx, std::string& parameter) const;
105 bool getROIDisplayColor(DCMTree::TreePtr item, std::string& parameter) const;
106 std::string getROIDisplayColorTag() const { return "(3006,002a)"; }
107 bool setROIDisplayColor(unsigned long idx, std::string parameter);
108
109 // ReferencedROINumber (3006,0084) vr=IS, vm=1, type=1
110 bool getReferencedROINumber(unsigned long idx, std::string& parameter) const;
111 bool getReferencedROINumber(DCMTree::TreePtr item, std::string& parameter) const;
112 std::string getReferencedROINumberTag() const { return "(3006,0084)"; }
113 bool setReferencedROINumber(unsigned long idx, std::string parameter);
114
115 // ContourSequence (3006,0040) vr=SQ, vm=1, type=3
117 std::string getContourSequenceTag() const { return std::string("(3006,0040)"); }
119
120
123 void setSequence(std::vector<DcmDRTROIContourSequenceInterface::Item> dcmSequence) {
124 _itemVec = dcmSequence;
125 }
126
129 std::vector<DcmDRTROIContourSequenceInterface::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(DcmDRTROIContourSequenceInterface::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<DcmDRTROIContourSequenceInterface::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<DcmDRTROIContourSequenceInterface::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<DcmDRTROIContourSequenceInterface::Item> _itemVec;
192};
193
195
196#endif // __mlDcmDRTROIContourSequenceInterface_H
197
198/* MeVis-Hidden-Components-Start */
199/* MeVis-Hidden-Components-End */
#define MLDCMTKACCESSORIES_EXPORT
Class to provide access to DRTContourSequence.
bool getROIDisplayColor(std::string &parameter) const
bool getReferencedROINumber(std::string &parameter) const
bool setReferencedROINumber(std::string parameter)
bool setROIDisplayColor(std::string parameter)
DcmDRTContourSequenceInterface getContourSequence() const
void setContourSequence(DcmDRTContourSequenceInterface seq)
Class to provide access to DRTROIContourSequence.
bool getROIDisplayColor(unsigned long idx, std::string &parameter) const
DcmDRTROIContourSequenceInterface(std::vector< DcmDRTROIContourSequenceInterface::Item > dcmSequence)
Default Constructor.
std::vector< DcmDRTROIContourSequenceInterface::Item > _itemVec
Reference to the wrapped DICOM tree pointer vector.
virtual ~DcmDRTROIContourSequenceInterface()
Default virtual Destructor.
bool hasSequence() const
Check if the DRTROIContourSequence is set.
DcmDRTROIContourSequenceInterface::Item & addItem()
Adds a new item to the sequence.
MLint getNumberOfItems() const
Return number of items the internal sequence consists of.
DcmDRTROIContourSequenceInterface::Item getItem(const size_t idx) const
Gets the item at the indicated position.
std::vector< DcmDRTROIContourSequenceInterface::Item > getSequence() const
Return the DRTROIContourSequence this interface class provides access to.
bool getROIDisplayColor(DCMTree::TreePtr item, std::string &parameter) const
void setContourSequence(DcmDRTContourSequenceInterface seq, unsigned long idx)
void setSequence(std::vector< DcmDRTROIContourSequenceInterface::Item > dcmSequence)
Set the DRTROIContourSequence this interface class provides access to.
DcmDRTROIContourSequenceInterface(DCMTree::TreePtrVector treePtrSeq)
bool getReferencedROINumber(DCMTree::TreePtr item, std::string &parameter) const
void addItem(DcmDRTROIContourSequenceInterface::Item newItem)
bool insertItem(const size_t idx)
Insert an item at the indicated position.
DcmDRTContourSequenceInterface getContourSequence(unsigned long idx) const
bool setROIDisplayColor(unsigned long idx, std::string parameter)
bool removeItem(const size_t idx)
Removes the indicated item from the sequence.
bool setReferencedROINumber(unsigned long idx, std::string parameter)
bool getReferencedROINumber(unsigned long idx, std::string &parameter) const
Class to provide access to DRTContourSequence.
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