MeVisLab Toolbox Reference
mlDcmDRTReferencedFractionGroupSequenceInterface.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 __mlDcmDRTReferencedFractionGroupSequenceInterface_H
24#define __mlDcmDRTReferencedFractionGroupSequenceInterface_H
25
26// Local includes
27#include "mlDcmtkAccessories.h"
28
29// Dcmtk includes
30//#include "mlDcmDRTReferencedFractionGroupSequenceInterface.h" //DRTReferencedFractionGroupSequence
31#include "mlDcmDRTReferencedBeamSequenceInRTDoseModuleInterface.h" //DRTReferencedBeamSequenceInRTDoseModule
32#include "mlDcmDRTReferencedBrachyApplicationSetupSequenceInRTDoseModuleInterface.h" //DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule
33
34
35// ML includes
36#ifndef __mlModuleIncludes_H
37#include "mlModuleIncludes.h"
38#endif
39
41
42// ------------------------------------------------------------------
44// ------------------------------------------------------------------
46{
47 public:
48
50 {
51 public:
52
53 Item() { _dcmItem = DcmtkAccessories::createNewDicomTree(); }
54
56
57 Item(const Item &copyDcmItem) : _dcmItem(copyDcmItem.getTreePtr()) {}
58
59 Item &operator=(const Item &copyDcmItem){ _dcmItem = copyDcmItem.getTreePtr(); return *this; }
60
61 virtual ~Item() {}
62
63 DCMTree::TreePtr getTreePtr() const { return _dcmItem; }
64
65 bool isValid() const { return _dcmItem.get() != nullptr; }
66
67
68 // ReferencedFractionGroupNumber (300c,0022) vr=IS, vm=1, type=1C
69 bool getReferencedFractionGroupNumber(std::string& parameter) const;
70 std::string getReferencedFractionGroupNumberTag() const { return "(300c,0022)"; }
71 bool setReferencedFractionGroupNumber(std::string parameter);
72
73 // ReferencedBeamSequence (300c,0004) vr=SQ, vm=1, type=1C
75 std::string getReferencedBeamSequenceTag() const { return std::string("(300c,0004)"); }
77
78 // ReferencedBrachyApplicationSetupSequence (300c,000a) vr=SQ, vm=1, type=1C
80 std::string getReferencedBrachyApplicationSetupSequenceTag() const { return std::string("(300c,000a)"); }
82
83
84 private:
85
86 DCMTree::TreePtr _dcmItem;
87
88 };
89
91
93 DcmDRTReferencedFractionGroupSequenceInterface(std::vector<DcmDRTReferencedFractionGroupSequenceInterface::Item> dcmSequence) : _itemVec(dcmSequence) {}
94
101
104 // ReferencedFractionGroupNumber (300c,0022) vr=IS, vm=1, type=1C
105 bool getReferencedFractionGroupNumber(unsigned long idx, std::string& parameter) const;
106 bool getReferencedFractionGroupNumber(DCMTree::TreePtr item, std::string& parameter) const;
107 std::string getReferencedFractionGroupNumberTag() const { return "(300c,0022)"; }
108 bool setReferencedFractionGroupNumber(unsigned long idx, std::string parameter);
109
110 // ReferencedBeamSequence (300c,0004) vr=SQ, vm=1, type=1C
112 std::string getReferencedBeamSequenceTag() const { return std::string("(300c,0004)"); }
114
115 // ReferencedBrachyApplicationSetupSequence (300c,000a) vr=SQ, vm=1, type=1C
117 std::string getReferencedBrachyApplicationSetupSequenceTag() const { return std::string("(300c,000a)"); }
119
120
123 void setSequence(std::vector<DcmDRTReferencedFractionGroupSequenceInterface::Item> dcmSequence) {
124 _itemVec = dcmSequence;
125 }
126
129 std::vector<DcmDRTReferencedFractionGroupSequenceInterface::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<DcmDRTReferencedFractionGroupSequenceInterface::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<DcmDRTReferencedFractionGroupSequenceInterface::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<DcmDRTReferencedFractionGroupSequenceInterface::Item> _itemVec;
192};
193
195
196#endif // __mlDcmDRTReferencedFractionGroupSequenceInterface_H
197
198/* MeVis-Hidden-Components-Start */
199/* MeVis-Hidden-Components-End */
#define MLDCMTKACCESSORIES_EXPORT
Class to provide access to DRTReferencedBeamSequenceInRTDoseModule.
bool getReferencedFractionGroupNumber(std::string &parameter) const
DcmDRTReferencedBeamSequenceInRTDoseModuleInterface getReferencedBeamSequence() const
void setReferencedBrachyApplicationSetupSequence(DcmDRTReferencedBrachyApplicationSetupSequenceInRTDoseModuleInterface seq)
void setReferencedBeamSequence(DcmDRTReferencedBeamSequenceInRTDoseModuleInterface seq)
bool setReferencedFractionGroupNumber(std::string parameter)
DcmDRTReferencedBrachyApplicationSetupSequenceInRTDoseModuleInterface getReferencedBrachyApplicationSetupSequence() const
Class to provide access to DRTReferencedFractionGroupSequence.
DcmDRTReferencedBeamSequenceInRTDoseModuleInterface getReferencedBeamSequence(unsigned long idx) const
void setSequence(std::vector< DcmDRTReferencedFractionGroupSequenceInterface::Item > dcmSequence)
Set the DRTReferencedFractionGroupSequence this interface class provides access to.
void setReferencedBeamSequence(DcmDRTReferencedBeamSequenceInRTDoseModuleInterface seq, unsigned long idx)
bool setReferencedFractionGroupNumber(unsigned long idx, std::string parameter)
DcmDRTReferencedBrachyApplicationSetupSequenceInRTDoseModuleInterface getReferencedBrachyApplicationSetupSequence(unsigned long idx) const
DcmDRTReferencedFractionGroupSequenceInterface::Item & addItem()
Adds a new item to the sequence.
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 hasSequence() const
Check if the DRTReferencedFractionGroupSequence is set.
DcmDRTReferencedFractionGroupSequenceInterface(std::vector< DcmDRTReferencedFractionGroupSequenceInterface::Item > dcmSequence)
Default Constructor.
bool removeItem(const size_t idx)
Removes the indicated item from the sequence.
void addItem(DcmDRTReferencedFractionGroupSequenceInterface::Item newItem)
bool getReferencedFractionGroupNumber(DCMTree::TreePtr item, std::string &parameter) const
DcmDRTReferencedFractionGroupSequenceInterface::Item getItem(const size_t idx) const
Gets the item at the indicated position.
std::vector< DcmDRTReferencedFractionGroupSequenceInterface::Item > getSequence() const
Return the DRTReferencedFractionGroupSequence this interface class provides access to.
void setReferencedBrachyApplicationSetupSequence(DcmDRTReferencedBrachyApplicationSetupSequenceInRTDoseModuleInterface seq, unsigned long idx)
bool getReferencedFractionGroupNumber(unsigned long idx, std::string &parameter) const
std::vector< DcmDRTReferencedFractionGroupSequenceInterface::Item > _itemVec
Reference to the wrapped DICOM tree pointer vector.
Class to provide access to DRTReferencedBeamSequenceInRTDoseModule.
Class to provide access to DRTReferencedBrachyApplicationSetupSequenceInRTDoseModule.
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