MeVisLab Toolbox Reference
mlDcmDRTSourceImageSequenceInterface.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 __mlDcmDRTSourceImageSequenceInterface_H
24#define __mlDcmDRTSourceImageSequenceInterface_H
25
26// Local includes
27#include "mlDcmtkAccessories.h"
28
29// Dcmtk includes
30//#include "mlDcmDRTSourceImageSequenceInterface.h" //DRTSourceImageSequence
31#include "mlDcmDRTPurposeOfReferenceCodeSequenceInterface.h" //DRTPurposeOfReferenceCodeSequence
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 // PatientOrientation (0020,0020) vr=CS, vm=2, type=1C
68 bool getPatientOrientation(std::string& parameter) const;
69 std::string getPatientOrientationTag() const { return "(0020,0020)"; }
70 bool setPatientOrientation(std::string parameter);
71
72 // ReferencedFrameNumber (0008,1160) vr=IS, vm=1-n, type=1C
73 bool getReferencedFrameNumber(std::string& parameter) const;
74 std::string getReferencedFrameNumberTag() const { return "(0008,1160)"; }
75 bool setReferencedFrameNumber(std::string parameter);
76
77 // ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1
78 bool getReferencedSOPClassUID(std::string& parameter) const;
79 std::string getReferencedSOPClassUIDTag() const { return "(0008,1150)"; }
80 bool setReferencedSOPClassUID(std::string parameter);
81
82 // ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1
83 bool getReferencedSOPInstanceUID(std::string& parameter) const;
84 std::string getReferencedSOPInstanceUIDTag() const { return "(0008,1155)"; }
85 bool setReferencedSOPInstanceUID(std::string parameter);
86
87 // ReferencedSegmentNumber (0062,000b) vr=US, vm=1-n, type=1C
88 bool getReferencedSegmentNumber(MLuint16& parameter) const;
89 std::string getReferencedSegmentNumberTag() const { return "(0062,000b)"; }
91
92 // SpatialLocationsPreserved (0028,135a) vr=CS, vm=1, type=3
93 bool getSpatialLocationsPreserved(std::string& parameter) const;
94 std::string getSpatialLocationsPreservedTag() const { return "(0028,135a)"; }
95 bool setSpatialLocationsPreserved(std::string parameter);
96
97 // PurposeOfReferenceCodeSequence (0040,a170) vr=SQ, vm=1, type=3
99 std::string getPurposeOfReferenceCodeSequenceTag() const { return std::string("(0040,a170)"); }
101
102
103 private:
104
105 DCMTree::TreePtr _dcmItem;
106
107 };
108
110
112 DcmDRTSourceImageSequenceInterface(std::vector<DcmDRTSourceImageSequenceInterface::Item> dcmSequence) : _itemVec(dcmSequence) {}
113
115 for(size_t i=0; i < treePtrSeq.size(); i++)
116 {
118 }
119 }
120
123 // PatientOrientation (0020,0020) vr=CS, vm=2, type=1C
124 bool getPatientOrientation(unsigned long idx, std::string& parameter) const;
125 bool getPatientOrientation(DCMTree::TreePtr item, std::string& parameter) const;
126 std::string getPatientOrientationTag() const { return "(0020,0020)"; }
127 bool setPatientOrientation(unsigned long idx, std::string parameter);
128
129 // ReferencedFrameNumber (0008,1160) vr=IS, vm=1-n, type=1C
130 bool getReferencedFrameNumber(unsigned long idx, std::string& parameter) const;
131 bool getReferencedFrameNumber(DCMTree::TreePtr item, std::string& parameter) const;
132 std::string getReferencedFrameNumberTag() const { return "(0008,1160)"; }
133 bool setReferencedFrameNumber(unsigned long idx, std::string parameter);
134
135 // ReferencedSOPClassUID (0008,1150) vr=UI, vm=1, type=1
136 bool getReferencedSOPClassUID(unsigned long idx, std::string& parameter) const;
137 bool getReferencedSOPClassUID(DCMTree::TreePtr item, std::string& parameter) const;
138 std::string getReferencedSOPClassUIDTag() const { return "(0008,1150)"; }
139 bool setReferencedSOPClassUID(unsigned long idx, std::string parameter);
140
141 // ReferencedSOPInstanceUID (0008,1155) vr=UI, vm=1, type=1
142 bool getReferencedSOPInstanceUID(unsigned long idx, std::string& parameter) const;
143 bool getReferencedSOPInstanceUID(DCMTree::TreePtr item, std::string& parameter) const;
144 std::string getReferencedSOPInstanceUIDTag() const { return "(0008,1155)"; }
145 bool setReferencedSOPInstanceUID(unsigned long idx, std::string parameter);
146
147 // ReferencedSegmentNumber (0062,000b) vr=US, vm=1-n, type=1C
148 bool getReferencedSegmentNumber(unsigned long idx, MLuint16& parameter) const;
150 std::string getReferencedSegmentNumberTag() const { return "(0062,000b)"; }
151 bool setReferencedSegmentNumber(unsigned long idx, MLuint16 parameter);
152
153 // SpatialLocationsPreserved (0028,135a) vr=CS, vm=1, type=3
154 bool getSpatialLocationsPreserved(unsigned long idx, std::string& parameter) const;
155 bool getSpatialLocationsPreserved(DCMTree::TreePtr item, std::string& parameter) const;
156 std::string getSpatialLocationsPreservedTag() const { return "(0028,135a)"; }
157 bool setSpatialLocationsPreserved(unsigned long idx, std::string parameter);
158
159 // PurposeOfReferenceCodeSequence (0040,a170) vr=SQ, vm=1, type=3
161 std::string getPurposeOfReferenceCodeSequenceTag() const { return std::string("(0040,a170)"); }
163
164
167 void setSequence(std::vector<DcmDRTSourceImageSequenceInterface::Item> dcmSequence) {
168 _itemVec = dcmSequence;
169 }
170
173 std::vector<DcmDRTSourceImageSequenceInterface::Item> getSequence() const {
174 return _itemVec;
175 }
176
179 bool hasSequence() const {
180 return (_itemVec.size() != 0);
181 }
182
186 return static_cast<MLint>(_itemVec.size());
187 }
188
192 if (_itemVec.size() > idx) {
193 return _itemVec[idx];
194 }
196 }
197
201 _itemVec.push_back(DcmDRTSourceImageSequenceInterface::Item());
202 return _itemVec[_itemVec.size()-1];
203 }
204
206 _itemVec.push_back(newItem);
207 }
208
211 bool insertItem(const size_t idx) {
212 if (_itemVec.size() > idx) {
213 std::vector<DcmDRTSourceImageSequenceInterface::Item>::iterator it = _itemVec.begin();
214 std::advance(it, idx);
216 return true;
217 }
218 return false;
219 }
220
223 bool removeItem(const size_t idx) {
224 if ( _itemVec.size() > idx ) {
225 std::vector<DcmDRTSourceImageSequenceInterface::Item>::iterator it = _itemVec.begin();
226 std::advance(it, idx);
227 _itemVec.erase(it);
228 return true;
229 }
230 return false;
231 }
232
233 protected:
235 std::vector<DcmDRTSourceImageSequenceInterface::Item> _itemVec;
236};
237
239
240#endif // __mlDcmDRTSourceImageSequenceInterface_H
241
242/* MeVis-Hidden-Components-Start */
243/* MeVis-Hidden-Components-End */
#define MLDCMTKACCESSORIES_EXPORT
Class to provide access to DRTPurposeOfReferenceCodeSequence.
bool getReferencedSOPInstanceUID(std::string &parameter) const
bool getReferencedSOPClassUID(std::string &parameter) const
bool setReferencedFrameNumber(std::string parameter)
DcmDRTPurposeOfReferenceCodeSequenceInterface getPurposeOfReferenceCodeSequence() const
bool setReferencedSOPClassUID(std::string parameter)
bool setReferencedSegmentNumber(MLuint16 parameter)
void setPurposeOfReferenceCodeSequence(DcmDRTPurposeOfReferenceCodeSequenceInterface seq)
bool setReferencedSOPInstanceUID(std::string parameter)
bool getReferencedFrameNumber(std::string &parameter) const
bool setPatientOrientation(std::string parameter)
bool setSpatialLocationsPreserved(std::string parameter)
bool getSpatialLocationsPreserved(std::string &parameter) const
bool getReferencedSegmentNumber(MLuint16 &parameter) const
bool getPatientOrientation(std::string &parameter) const
Class to provide access to DRTSourceImageSequence.
bool getReferencedSOPInstanceUID(DCMTree::TreePtr item, std::string &parameter) const
bool setReferencedSOPClassUID(unsigned long idx, std::string parameter)
bool getPatientOrientation(DCMTree::TreePtr item, std::string &parameter) const
DcmDRTPurposeOfReferenceCodeSequenceInterface getPurposeOfReferenceCodeSequence(unsigned long idx) const
void setPurposeOfReferenceCodeSequence(DcmDRTPurposeOfReferenceCodeSequenceInterface seq, unsigned long idx)
bool getReferencedSOPClassUID(unsigned long idx, std::string &parameter) const
DcmDRTSourceImageSequenceInterface(std::vector< DcmDRTSourceImageSequenceInterface::Item > dcmSequence)
Default Constructor.
std::vector< DcmDRTSourceImageSequenceInterface::Item > getSequence() const
Return the DRTSourceImageSequence this interface class provides access to.
bool insertItem(const size_t idx)
Insert an item at the indicated position.
bool getPatientOrientation(unsigned long idx, std::string &parameter) const
bool setPatientOrientation(unsigned long idx, std::string parameter)
MLint getNumberOfItems() const
Return number of items the internal sequence consists of.
bool setReferencedFrameNumber(unsigned long idx, std::string parameter)
bool getReferencedFrameNumber(unsigned long idx, std::string &parameter) const
bool getSpatialLocationsPreserved(unsigned long idx, std::string &parameter) const
bool getReferencedSOPClassUID(DCMTree::TreePtr item, std::string &parameter) const
bool removeItem(const size_t idx)
Removes the indicated item from the sequence.
void addItem(DcmDRTSourceImageSequenceInterface::Item newItem)
bool getReferencedSOPInstanceUID(unsigned long idx, std::string &parameter) const
void setSequence(std::vector< DcmDRTSourceImageSequenceInterface::Item > dcmSequence)
Set the DRTSourceImageSequence this interface class provides access to.
bool getReferencedSegmentNumber(DCMTree::TreePtr item, MLuint16 &parameter) const
DcmDRTSourceImageSequenceInterface::Item getItem(const size_t idx) const
Gets the item at the indicated position.
bool hasSequence() const
Check if the DRTSourceImageSequence is set.
bool setReferencedSegmentNumber(unsigned long idx, MLuint16 parameter)
bool getSpatialLocationsPreserved(DCMTree::TreePtr item, std::string &parameter) const
DcmDRTSourceImageSequenceInterface(DCMTree::TreePtrVector treePtrSeq)
virtual ~DcmDRTSourceImageSequenceInterface()
Default virtual Destructor.
std::vector< DcmDRTSourceImageSequenceInterface::Item > _itemVec
Reference to the wrapped DICOM tree pointer vector.
bool getReferencedFrameNumber(DCMTree::TreePtr item, std::string &parameter) const
DcmDRTSourceImageSequenceInterface::Item & addItem()
Adds a new item to the sequence.
bool setReferencedSOPInstanceUID(unsigned long idx, std::string parameter)
bool setSpatialLocationsPreserved(unsigned long idx, std::string parameter)
bool getReferencedSegmentNumber(unsigned long idx, MLuint16 &parameter) const
Class to provide access to DRTPurposeOfReferenceCodeSequence.
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