MeVisLab Toolbox Reference
mlDcmDRTRelatedRTROIObservationsSequenceInterface.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 __mlDcmDRTRelatedRTROIObservationsSequenceInterface_H
24#define __mlDcmDRTRelatedRTROIObservationsSequenceInterface_H
25
26// Local includes
27#include "mlDcmtkAccessories.h"
28
29// Dcmtk includes
30//#include "mlDcmDRTRelatedRTROIObservationsSequenceInterface.h" //DRTRelatedRTROIObservationsSequence
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 // ObservationNumber (3006,0082) vr=IS, vm=1, type=1C
67 bool getObservationNumber(std::string& parameter) const;
68 std::string getObservationNumberTag() const { return "(3006,0082)"; }
69 bool setObservationNumber(std::string parameter);
70
71
72 private:
73
74 DCMTree::TreePtr _dcmItem;
75
76 };
77
79
81 DcmDRTRelatedRTROIObservationsSequenceInterface(std::vector<DcmDRTRelatedRTROIObservationsSequenceInterface::Item> dcmSequence) : _itemVec(dcmSequence) {}
82
89
92 // ObservationNumber (3006,0082) vr=IS, vm=1, type=1C
93 bool getObservationNumber(unsigned long idx, std::string& parameter) const;
94 bool getObservationNumber(DCMTree::TreePtr item, std::string& parameter) const;
95 std::string getObservationNumberTag() const { return "(3006,0082)"; }
96 bool setObservationNumber(unsigned long idx, std::string parameter);
97
98
101 void setSequence(std::vector<DcmDRTRelatedRTROIObservationsSequenceInterface::Item> dcmSequence) {
102 _itemVec = dcmSequence;
103 }
104
107 std::vector<DcmDRTRelatedRTROIObservationsSequenceInterface::Item> getSequence() const {
108 return _itemVec;
109 }
110
113 bool hasSequence() const {
114 return (_itemVec.size() != 0);
115 }
116
120 return static_cast<MLint>(_itemVec.size());
121 }
122
126 if (_itemVec.size() > idx) {
127 return _itemVec[idx];
128 }
130 }
131
136 return _itemVec[_itemVec.size()-1];
137 }
138
142
145 bool insertItem(const size_t idx) {
146 if (_itemVec.size() > idx) {
147 std::vector<DcmDRTRelatedRTROIObservationsSequenceInterface::Item>::iterator it = _itemVec.begin();
148 std::advance(it, idx);
150 return true;
151 }
152 return false;
153 }
154
157 bool removeItem(const size_t idx) {
158 if ( _itemVec.size() > idx ) {
159 std::vector<DcmDRTRelatedRTROIObservationsSequenceInterface::Item>::iterator it = _itemVec.begin();
160 std::advance(it, idx);
161 _itemVec.erase(it);
162 return true;
163 }
164 return false;
165 }
166
167 protected:
169 std::vector<DcmDRTRelatedRTROIObservationsSequenceInterface::Item> _itemVec;
170};
171
173
174#endif // __mlDcmDRTRelatedRTROIObservationsSequenceInterface_H
175
176/* MeVis-Hidden-Components-Start */
177/* MeVis-Hidden-Components-End */
#define MLDCMTKACCESSORIES_EXPORT
bool getObservationNumber(std::string &parameter) const
Class to provide access to DRTRelatedRTROIObservationsSequence.
DcmDRTRelatedRTROIObservationsSequenceInterface::Item getItem(const size_t idx) const
Gets the item at the indicated position.
void setSequence(std::vector< DcmDRTRelatedRTROIObservationsSequenceInterface::Item > dcmSequence)
Set the DRTRelatedRTROIObservationsSequence this interface class provides access to.
DcmDRTRelatedRTROIObservationsSequenceInterface::Item & addItem()
Adds a new item to the sequence.
bool getObservationNumber(DCMTree::TreePtr item, std::string &parameter) const
std::vector< DcmDRTRelatedRTROIObservationsSequenceInterface::Item > _itemVec
Reference to the wrapped DICOM tree pointer vector.
bool insertItem(const size_t idx)
Insert an item at the indicated position.
bool hasSequence() const
Check if the DRTRelatedRTROIObservationsSequence is set.
bool getObservationNumber(unsigned long idx, std::string &parameter) const
DcmDRTRelatedRTROIObservationsSequenceInterface(std::vector< DcmDRTRelatedRTROIObservationsSequenceInterface::Item > dcmSequence)
Default Constructor.
bool setObservationNumber(unsigned long idx, std::string parameter)
MLint getNumberOfItems() const
Return number of items the internal sequence consists of.
std::vector< DcmDRTRelatedRTROIObservationsSequenceInterface::Item > getSequence() const
Return the DRTRelatedRTROIObservationsSequence this interface class provides access to.
bool removeItem(const size_t idx)
Removes the indicated item from the sequence.
void addItem(DcmDRTRelatedRTROIObservationsSequenceInterface::Item newItem)
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