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 "gdcmDocEntrySet.h"
27 #include "gdcmDocument.h"
28 #include "gdcmElementSet.h"
29 #include "gdcmFileHelper.h"
30 #include "gdcmGlobal.h"
32 #include "gdcmSerieHelper.h"
33 #include "gdcmRLEFramesInfo.h"
34 #include "gdcmJPEGFragmentsInfo.h"
35 #include "gdcmSQItem.h"
37 #include "gdcmDocEntry.h"
38 #include "gdcmDataEntry.h"
39 #include "gdcmSeqEntry.h"
42 #include "gdcmDictGroupName.h"
44 /// This is required in order to avoid %including all the gdcm include files.
49 /////////////////////// typemap section ////////////////////////////////////
51 ////////////////////////////////////////////////
52 // Redefine all types used
54 typedef unsigned char uint8_t;
55 typedef short int16_t;
56 typedef unsigned short uint16_t;
58 typedef unsigned int uint32_t;
59 typedef long long int64_t;
60 typedef unsigned long long uint64_t;
62 ////////////////////////////////////////////////
63 // Convert a DocEntry * to the real derived class
64 %typemap(out) gdcm::DocEntry *
70 if(dynamic_cast<SeqEntry *>($1)) // SeqEntry *
71 newEntry = SWIG_NewPointerObj($1,SWIGTYPE_p_gdcm__SeqEntry,0);
72 else if(dynamic_cast<DataEntry *>($1)) // DataEntry *
73 newEntry = SWIG_NewPointerObj($1,SWIGTYPE_p_gdcm__DataEntry,0);
79 newEntry = Py_BuildValue("");
84 //////////////////// STL string versus Python str ////////////////////////
85 // Convertion returning a C++ string.
86 %typemap(out) std::string
88 $result = PyString_FromString(($1).c_str());
93 $result = PyString_FromString(($1).c_str());
96 %typemap(out) std::string const &
98 $result = PyString_FromString(($1)->c_str());
101 // Convertion of incoming Python str to STL string
102 %typemap(python, in) const std::string, std::string
104 $1 = PyString_AsString($input);
107 // Same convertion as above but references (since swig converts C++
108 // refererences to pointers)
109 %typemap(python, in) std::string const &
111 $1 = new std::string( PyString_AsString( $input ) );
114 //////////////////// gdcm.TagName versus Python str //////////////////////
115 %typemap(out) gdcm::TagName, const gdcm::TagName &
117 $result = PyString_FromString(($1)->c_str());
120 // Convertion of incoming Python str to STL string
121 %typemap(python, in) const gdcm::TagName, gdcm::TagName
123 $1 = PyString_AsString($input);
126 // Same convertion as above but references (since swig converts C++
127 // refererences to pointers)
128 %typemap(python, in) gdcm::TagName const &
130 $1 = new std::string( PyString_AsString( $input ) );
133 ////////////////////////////////////////////////////////////////////////////
134 // Because overloading and %rename don't work together (see below Note 1)
135 // we need to ignore some methods (e.g. the overloaded default constructor).
136 // The gdcm::File class doesn't have any SetFilename method anyhow, and
137 // this constructor is only used internaly (not from the API) so this is
139 %ignore gdcm::binary_write(std::ostream &,uint32_t const &);
140 %ignore gdcm::binary_write(std::ostream &,uint16_t const &);
142 %ignore gdcm::VRKey::operator=(const VRKey &_val);
143 %ignore gdcm::VRKey::operator=(const std::string &_val);
144 %ignore gdcm::VRKey::operator=(const char *_val);
145 %ignore gdcm::VRKey::operator[](const unsigned int &_id) const;
146 %ignore gdcm::VRKey::operator[](const unsigned int &_id);
148 %ignore gdcm::TagKey::operator=(const TagKey &_val);
149 %ignore gdcm::TagKey::operator[](const unsigned int &_id) const;
150 %ignore gdcm::TagKey::operator[](const unsigned int &_id);
152 // Ignore all placed in gdcmCommon.h
153 %ignore GDCM_UNKNOWN;
154 %ignore GDCM_UNFOUND;
155 %ignore GDCM_BINLOADED;
156 %ignore GDCM_NOTLOADED;
158 %ignore GDCM_NOTASCII;
159 %ignore GDCM_PIXELDATA;
161 %ignore GDCM_VRUNKNOWN;
162 %ignore GDCM_FILESEPARATOR;
164 %constant const char *UNKNOWN = "gdcm::Unknown";
165 %constant const char *UNFOUND = "gdcm::Unfound";
166 %constant const char *BINLOADED = "gdcm::Binary data loaded";
167 %constant const char *NOTLOADED = "gdcm::NotLoaded";
168 %constant const char *UNREAD = "gdcm::UnRead";
169 %constant const char *GDCM_NOTASCII = "gdcm::NotAscii";
170 %constant const char *GDCM_PIXELDATA = "gdcm::Pixel Data to be loaded";
171 %constant const char *VRUNKNOWN = " ";
172 %constant const char GDCM_FILESEPARATOR = '\\';
173 ////////////////////////////////////////////////////////////////////////////
174 // Warning: Order matters !
175 %include "gdcmCommon.h"
176 %include "gdcmBase.h"
177 %include "gdcmRefCounter.h"
178 %include "gdcmCommand.h"
179 %include "gdcmCommandPy.h"
180 %include "gdcmDebug.h"
181 %include "gdcmCommandManager.h"
182 %include "gdcmTagKey.h"
183 %include "gdcmVRKey.h"
184 %include "gdcmDictEntry.h"
185 %include "gdcmDict.h"
186 %include "gdcmDictSet.h"
187 %include "gdcmDocEntrySet.h"
188 %include "gdcmElementSet.h"
189 %include "gdcmSQItem.h"
190 %include "gdcmDicomDirElement.h"
191 %include "gdcmDicomDirObject.h"
192 %include "gdcmDicomDirImage.h"
193 %include "gdcmDicomDirSerie.h"
194 %include "gdcmDicomDirStudy.h"
195 %include "gdcmDicomDirPatient.h"
196 %include "gdcmDicomDirMeta.h"
197 %include "gdcmDocument.h"
198 %include "gdcmFile.h"
199 %include "gdcmSerieHelper.h"
200 %include "gdcmFileHelper.h"
201 %include "gdcmUtil.h"
202 %include "gdcmGlobal.h"
203 %include "gdcmDicomDir.h"
204 %include "gdcmDocEntry.h"
205 %include "gdcmDataEntry.h"
206 %include "gdcmSeqEntry.h"
209 %include "gdcmDictGroupName.h"