2 #pragma SWIG nowarn=504,510
6 #include "gdcmCommon.h"
8 #include "gdcmRefCounter.h"
9 #include "gdcmCommand.h"
10 #include "gdcmCommandPy.h"
11 #include "gdcmDebug.h"
12 #include "gdcmCommandManager.h"
13 #include "gdcmTagKey.h"
14 #include "gdcmVRKey.h"
16 #include "gdcmDictEntry.h"
17 #include "gdcmDictSet.h"
18 #include "gdcmDicomDir.h"
19 #include "gdcmDicomDirElement.h"
20 #include "gdcmDicomDirImage.h"
21 #include "gdcmDicomDirMeta.h"
22 #include "gdcmDicomDirObject.h"
23 #include "gdcmDicomDirPatient.h"
24 #include "gdcmDicomDirStudy.h"
25 #include "gdcmDicomDirSerie.h"
26 #include "gdcmDicomDirVisit.h"
27 #include "gdcmDicomDirPrivate.h"
28 #include "gdcmDirList.h"
29 #include "gdcmDocEntrySet.h"
30 #include "gdcmDocument.h"
31 #include "gdcmElementSet.h"
32 #include "gdcmFileHelper.h"
33 #include "gdcmGlobal.h"
35 #include "gdcmSerieHelper.h"
36 #include "gdcmRLEFramesInfo.h"
37 #include "gdcmJPEGFragmentsInfo.h"
38 #include "gdcmSQItem.h"
40 #include "gdcmDocEntry.h"
41 #include "gdcmDataEntry.h"
42 #include "gdcmSeqEntry.h"
45 #include "gdcmDictGroupName.h"
47 /// This is required in order to avoid %including all the gdcm include files.
48 using namespace GDCM_NAME_SPACE;
52 /////////////////////// typemap section ////////////////////////////////////
54 ////////////////////////////////////////////////
55 // Redefine all types used
57 typedef unsigned char uint8_t;
58 typedef short int16_t;
59 typedef unsigned short uint16_t;
61 typedef unsigned int uint32_t;
62 typedef long long int64_t;
63 typedef unsigned long long uint64_t;
65 ////////////////////////////////////////////////
66 // Convert a DocEntry * to the real derived class
67 %typemap(out) GDCM_NAME_SPACE::DocEntry *
73 if(dynamic_cast<SeqEntry *>($1)) // SeqEntry *
74 newEntry = SWIG_NewPointerObj($1,SWIGTYPE_p_GDCM_NAME_SPACE__SeqEntry,0);
75 else if(dynamic_cast<DataEntry *>($1)) // DataEntry *
76 newEntry = SWIG_NewPointerObj($1,SWIGTYPE_p_GDCM_NAME_SPACE__DataEntry,0);
82 newEntry = Py_BuildValue("");
87 //////////////////// STL string versus Python str ////////////////////////
88 // Convertion returning a C++ string.
89 %typemap(out) std::string
91 $result = PyString_FromString(($1).c_str());
96 $result = PyString_FromString(($1).c_str());
99 %typemap(out) std::string const &
101 $result = PyString_FromString(($1)->c_str());
104 // Convertion of incoming Python str to STL string
105 %typemap(python, in) const std::string, std::string
107 $1 = PyString_AsString($input);
110 // Same convertion as above but references (since swig converts C++
111 // references to pointers)
112 %typemap(python, in) std::string const &
114 $1 = new std::string( PyString_AsString( $input ) );
117 //////////////////// gdcm.TagName versus Python str //////////////////////
118 %typemap(out) GDCM_NAME_SPACE::TagName, const GDCM_NAME_SPACE::TagName &
120 $result = PyString_FromString(($1)->c_str());
123 // Convertion of incoming Python str to STL string
124 %typemap(python, in) const GDCM_NAME_SPACE::TagName, GDCM_NAME_SPACE::TagName
126 $1 = PyString_AsString($input);
129 // Same convertion as above but references (since swig converts C++
130 // refererences to pointers)
131 %typemap(python, in) GDCM_NAME_SPACE::TagName const &
133 $1 = new std::string( PyString_AsString( $input ) );
136 ////////////////////////////////////////////////////////////////////////////
137 // Because overloading and %rename don't work together (see below Note 1)
138 // we need to ignore some methods (e.g. the overloaded default constructor).
139 // The GDCM_NAME_SPACE::File class doesn't have any SetFilename method anyhow, and
140 // this constructor is only used internaly (not from the API) so this is
142 %ignore GDCM_NAME_SPACE::binary_write(std::ostream &,uint32_t const &);
143 %ignore GDCM_NAME_SPACE::binary_write(std::ostream &,uint16_t const &);
145 %ignore GDCM_NAME_SPACE::VRKey::operator=(const VRKey &_val);
146 %ignore GDCM_NAME_SPACE::VRKey::operator=(const std::string &_val);
147 %ignore GDCM_NAME_SPACE::VRKey::operator=(const char *_val);
148 %ignore GDCM_NAME_SPACE::VRKey::operator[](const unsigned int &_id) const;
149 %ignore GDCM_NAME_SPACE::VRKey::operator[](const unsigned int &_id);
151 %ignore GDCM_NAME_SPACE::TagKey::operator=(const TagKey &_val);
152 %ignore GDCM_NAME_SPACE::TagKey::operator[](const unsigned int &_id) const;
153 %ignore GDCM_NAME_SPACE::TagKey::operator[](const unsigned int &_id);
155 // Ignore all placed in gdcmCommon.h
156 %ignore GDCM_UNKNOWN;
157 %ignore GDCM_UNFOUND;
158 %ignore GDCM_BINLOADED;
159 %ignore GDCM_NOTLOADED;
161 %ignore GDCM_NOTASCII;
162 %ignore GDCM_PIXELDATA;
164 %ignore GDCM_VRUNKNOWN;
165 %ignore GDCM_FILESEPARATOR;
167 %constant const char *UNKNOWN = "GDCM::Unknown";
168 %constant const char *UNFOUND = "GDCM::Unfound";
169 %constant const char *BINLOADED = "GDCM::Binary data";
170 %constant const char *NOTLOADED = "GDCM::NotLoaded";
171 %constant const char *UNREAD = "GDCM::UnRead";
172 %constant const char *GDCM_NOTASCII = "GDCM::NotAscii";
173 %constant const char *GDCM_PIXELDATA = "GDCM::Pixel Data to be loaded";
174 %constant const char *VRUNKNOWN = " ";
175 %constant const char GDCM_FILESEPARATOR = '\\';
176 ////////////////////////////////////////////////////////////////////////////
177 // Warning: Order matters !
178 %include "gdcmCommon.h"
179 %include "gdcmBase.h"
180 %include "gdcmRefCounter.h"
181 %include "gdcmCommand.h"
182 %include "gdcmCommandPy.h"
183 %include "gdcmDebug.h"
184 %include "gdcmCommandManager.h"
185 %include "gdcmTagKey.h"
186 %include "gdcmVRKey.h"
187 %include "gdcmDictEntry.h"
188 %include "gdcmDict.h"
189 %include "gdcmDictSet.h"
190 %include "gdcmDocEntrySet.h"
191 %include "gdcmElementSet.h"
192 %include "gdcmSQItem.h"
193 %include "gdcmDicomDirElement.h"
194 %include "gdcmDicomDirObject.h"
195 %include "gdcmDicomDirImage.h"
196 %include "gdcmDicomDirPrivate.h"
197 %include "gdcmDicomDirSerie.h"
198 %include "gdcmDicomDirVisit.h"
199 %include "gdcmDicomDirStudy.h"
200 %include "gdcmDicomDirPatient.h"
201 %include "gdcmDicomDirMeta.h"
202 %include "gdcmDocument.h"
203 %include "gdcmFile.h"
204 %include "gdcmSerieHelper.h"
205 %include "gdcmFileHelper.h"
206 %include "gdcmUtil.h"
207 %include "gdcmGlobal.h"
208 %include "gdcmDicomDir.h"
209 %include "gdcmDocEntry.h"
210 %include "gdcmDataEntry.h"
211 %include "gdcmSeqEntry.h"
214 %include "gdcmDictGroupName.h"