+2003-05-27 Eric Boix <Eric.Boix@creatis.insa-lyon.fr>
+ * gdcmPython/gdcm.i:
+ - typemaps correction to take into account the systematic replacement
+ of "using namespace std" with std:: prefix e.g. std::list,
+ std::string... (cf changes of 2003-05-21).
+ - gdcmGlob global variable of type gdcmGlobal (defined in
+ src/gdcmUtil.cxx and declared in gdcmPython/gdcm.i) is now
+ exported to Python a as cvar.
+ * gdcmPython/__init__.py now defines two functions GetPubDictTagNames()
+ and GetPubDictTagNamesByCategory() as a replacement for deprecated
+ gdcmDictSet.GetPubDictTagNames() and
+ gdcmDictSet.GetPubDictTagNamesByCategory() class functions (i.e.
+ C++ static methods).
+ * gdcmPython/demo/printGroupedPublicDict.py is operational again,
+ with the above changes.
+
2003-05-22 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
* setup.py, manifest.in : bug fix under linux
gdcmHeader = gdcm.gdcmHeader
gdcmDictSet = gdcm.gdcmDictSet
gdcmFile = gdcm.gdcmFile
+
+def GetPubDictTagNames():
+ return gdcm.cvar.gdcmGlob.GetDicts().GetPubDictTagNames()
+
+def GetPubDictTagNamesByCategory():
+ return gdcm.cvar.gdcmGlob.GetDicts().GetPubDictTagNamesByCategory()
print "### Display all the possible tags of the current public"
print "### dictionary"
print "##############################################################"
-PubList = gdcmDictSet.GetPubDictTagNames()
+PubList = GetPubDictTagNames()
for i in range(0, len(PubList)):
print " ", PubList[i]
print "### Display all the possible tags of the current public"
print "### dictionary, but grouped by using the Fourth field"
print "##############################################################"
-PubDict = gdcmDictSet.GetPubDictTagNamesByCategory()
+PubDict = GetPubDictTagNamesByCategory()
for fourth in PubDict:
print " ############ Fourth group = ", fourth, " ##############"
for key in PubDict[fourth]:
#include "gdcmDictSet.h"
#include "gdcmElValue.h"
#include "gdcmElValSet.h"
+#include "gdcmUtil.h"
#include "gdcmHeader.h"
#include "gdcmFile.h"
using namespace std;
-using namespace std;
-
// Utility functions on strings for removing leading and trailing spaces
void EatLeadingAndTrailingSpaces(string & s) {
while ( s.length() && (s[0] == ' ') )
typedef unsigned int guint32;
////////////////////////////////////////////////////////////////////////////
-%typemap(out) list<string> * {
+// Global variables get exported to cvar in Python
+%immutable;
+extern gdcmGlobal gdcmGlob;
+%mutable;
+
+////////////////////////////////////////////////////////////////////////////
+%typemap(out) std::list<std::string> * {
PyObject* NewItem = (PyObject*)0;
PyObject* NewList = PyList_New(0); // The result of this typemap
for (list<string>::iterator NewString = ($1)->begin();
////////////////////////////////////////////////////////////////////////////
// Convert a c++ hash table in a python native dictionary
-%typemap(out) map<string, list<string> > * {
+%typemap(out) std::map<std::string, std::list<std::string> > * {
PyObject* NewDict = PyDict_New(); // The result of this typemap
PyObject* NewKey = (PyObject*)0;
PyObject* NewVal = (PyObject*)0;
%typemap(out) std::string {
$result = PyString_FromString(($1).c_str());
}
-//////%apply int { std::int };
////////////////////////////////////////////////////////////////////////////
%include "gdcmCommon.h"
%include "gdcmDictSet.h"
%include "gdcmElValue.h"
%include "gdcmElValSet.h"
+%include "gdcmUtil.h"
%include "gdcmHeader.h"
%include "gdcmFile.h"