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