MeVisLab Toolbox Reference
mlDcmDRTModifiedAttributesSequenceInterface.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 __mlDcmDRTModifiedAttributesSequenceInterface_H
24#define __mlDcmDRTModifiedAttributesSequenceInterface_H
25
26// Local includes
27#include "mlDcmtkAccessories.h"
28
29// Dcmtk includes
30//#include "mlDcmDRTModifiedAttributesSequenceInterface.h" //DRTModifiedAttributesSequence
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
67 private:
68
69 DCMTree::TreePtr _dcmItem;
70
71 };
72
74
76 DcmDRTModifiedAttributesSequenceInterface(std::vector<DcmDRTModifiedAttributesSequenceInterface::Item> dcmSequence) : _itemVec(dcmSequence) {}
77
84
87
90 void setSequence(std::vector<DcmDRTModifiedAttributesSequenceInterface::Item> dcmSequence) {
91 _itemVec = dcmSequence;
92 }
93
96 std::vector<DcmDRTModifiedAttributesSequenceInterface::Item> getSequence() const {
97 return _itemVec;
98 }
99
102 bool hasSequence() const {
103 return (_itemVec.size() != 0);
104 }
105
109 return static_cast<MLint>(_itemVec.size());
110 }
111
115 if (_itemVec.size() > idx) {
116 return _itemVec[idx];
117 }
119 }
120
125 return _itemVec[_itemVec.size()-1];
126 }
127
131
134 bool insertItem(const size_t idx) {
135 if (_itemVec.size() > idx) {
136 std::vector<DcmDRTModifiedAttributesSequenceInterface::Item>::iterator it = _itemVec.begin();
137 std::advance(it, idx);
139 return true;
140 }
141 return false;
142 }
143
146 bool removeItem(const size_t idx) {
147 if ( _itemVec.size() > idx ) {
148 std::vector<DcmDRTModifiedAttributesSequenceInterface::Item>::iterator it = _itemVec.begin();
149 std::advance(it, idx);
150 _itemVec.erase(it);
151 return true;
152 }
153 return false;
154 }
155
156 protected:
158 std::vector<DcmDRTModifiedAttributesSequenceInterface::Item> _itemVec;
159};
160
162
163#endif // __mlDcmDRTModifiedAttributesSequenceInterface_H
164
165/* MeVis-Hidden-Components-Start */
166/* MeVis-Hidden-Components-End */
#define MLDCMTKACCESSORIES_EXPORT
Class to provide access to DRTModifiedAttributesSequence.
DcmDRTModifiedAttributesSequenceInterface::Item getItem(const size_t idx) const
Gets the item at the indicated position.
DcmDRTModifiedAttributesSequenceInterface(std::vector< DcmDRTModifiedAttributesSequenceInterface::Item > dcmSequence)
Default Constructor.
bool hasSequence() const
Check if the DRTModifiedAttributesSequence is set.
std::vector< DcmDRTModifiedAttributesSequenceInterface::Item > _itemVec
Reference to the wrapped DICOM tree pointer vector.
void setSequence(std::vector< DcmDRTModifiedAttributesSequenceInterface::Item > dcmSequence)
Set the DRTModifiedAttributesSequence this interface class provides access to.
MLint getNumberOfItems() const
Return number of items the internal sequence consists of.
std::vector< DcmDRTModifiedAttributesSequenceInterface::Item > getSequence() const
Return the DRTModifiedAttributesSequence this interface class provides access to.
DcmDRTModifiedAttributesSequenceInterface::Item & addItem()
Adds a new item to the sequence.
bool removeItem(const size_t idx)
Removes the indicated item from the sequence.
bool insertItem(const size_t idx)
Insert an item at the indicated position.
void addItem(DcmDRTModifiedAttributesSequenceInterface::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