image=serie.GetFirstImage()
while(image):
print " Image"
- print " ---",image.GetDataEntry(0x0004,0x1500).GetValue()
+ print " ---",image.GetDataEntry(0x0004,0x1500).GetString()
image=serie.GetNextImage()
serie=study.GetNextSerie()
study=patient.GetNextStudy()
{
if(dynamic_cast<SeqEntry *>($1)) // SeqEntry *
newEntry = SWIG_NewPointerObj($1,SWIGTYPE_p_gdcm__SeqEntry,0);
- else if(dynamic_cast<BinEntry *>($1)) // BinEntry *
- newEntry = SWIG_NewPointerObj($1,SWIGTYPE_p_gdcm__BinEntry,0);
- else // ValEntry *
- newEntry = SWIG_NewPointerObj($1,SWIGTYPE_p_gdcm__ValEntry,0);
+ else if(dynamic_cast<DataEntry *>($1)) // DataEntry *
+ newEntry = SWIG_NewPointerObj($1,SWIGTYPE_p_gdcm__DataEntry,0);
+ else
+ newEntry = NULL;
}
else
{
%include "gdcmVR.h"
%include "gdcmTS.h"
%include "gdcmDictGroupName.h"
-
-////////////////////////////////////////////////////////////////////////////
-// Notes on swig and this file gdcm.i:
-//
-/////////////////////////////////////
-// Note 1: swig collision of method overloading and %typemap
-// Consider the following junk.i file:
-// %module junk
-// %{
-// #include <string>
-// #include <iostream>
-// void Junk(std::string const & bozo) { std::cout << bozo << std::endl; }
-// void Junk() { std::cout << "Renamed Junk()" << std::endl; }
-// %}
-//
-// %typemap(python, in) std::string const &
-// {
-// $1 = new std::string( PyString_AsString( $input ) );
-// }
-// void Junk();
-// void Junk(std::string const & bozo);
-//
-// that we compile on linux with:
-// swig -c++ -python junk.i
-// g++ -g -I/usr/include/python2.3/ -o junk_wrap.o -c junk_wrap.cxx
-// g++ junk_wrap.o -shared -g -o _junk.so -L/usr/lib/python2.3/config \
-// -lpython2.3
-// and invoque with:
-// python -c 'from junk import *; Junk("aaa") '
-// then we get the following unexpected (for novice) python TypeError:
-// TypeError: No matching function for overloaded 'Junk'
-//
-// This happens because the swig generated code (at least for python) does
-// the following two stage process:
-// 1/ first do a dynamic dispatch ON THE NUMBER OF ARGUMENTS of the overloaded
-// Junk function (the same happens with method of course). [Note that the
-// dispatch is NOT done on the type of the arguments].
-// 2/ second apply the typemap.
-// When the first dynamic dispatch is executed, the swig generated code
-// has no knowledge of the typemap, and thus expects a pointer to a std::string
-// type i.e. an argument to Junk of the form _p_std__int<address>. But this
-// is not what python handles to Junk ! An invocation of the form 'Junk("aaa")'
-// will make Python pass a PyString to swig (and this is precisely why we
-// wrote the typemap). And this will fail....
-/////////////////////////////////////
Program: gdcm
Module: $RCSfile: gdcmCommon.h,v $
Language: C++
- Date: $Date: 2005/10/19 08:06:45 $
- Version: $Revision: 1.97 $
+ Date: $Date: 2005/10/19 12:01:50 $
+ Version: $Revision: 1.98 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include <string>
+//-----------------------------------------------------------------------------
+// TagKey definition
#define FASTTAGKEY 0
// FIXME: Should rewrite this:
#include <iostream>
#endif
+//-----------------------------------------------------------------------------
+#if defined(_WIN32) && defined(BUILD_SHARED_LIBS)
+ #ifdef gdcm_EXPORTS
+ #define GDCM_EXPORT __declspec( dllexport )
+ #else
+ #define GDCM_EXPORT __declspec( dllimport )
+ #endif
+#else
+ #define GDCM_EXPORT
+#endif
+
//-----------------------------------------------------------------------------
/// \brief namespace for Grass root DiCoM
namespace gdcm
/**
* \brief structure, for internal use only
*/
-struct Element
+struct DicomElement
{
/// DicomGroup number
unsigned short int Group;
Program: gdcm
Module: $RCSfile: gdcmDefaultDicts.cxx.in,v $
Language: C++
- Date: $Date: 2005/04/05 10:56:25 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2005/10/19 12:01:50 $
+ Version: $Revision: 1.10 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
unsigned int i = 0;
ELEMENT e = dataElement[i];
- Element elem;
+ DicomElement elem;
DicomDirType type;
std::string strType;
Program: gdcm
Module: $RCSfile: gdcmDicomDirElement.cxx,v $
Language: C++
- Date: $Date: 2005/07/11 14:40:40 $
- Version: $Revision: 1.39 $
+ Date: $Date: 2005/10/19 12:01:50 $
+ Version: $Revision: 1.40 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
char buff[1024];
std::string strType;
- Element elem;
+ DicomElement elem;
DicomDirType type;
while (!from.eof())
* @param type Element type (DD_PATIENT, DD_STUDY, DD_SERIE, DD_IMAGE)
* @param elem elem
*/
-bool DicomDirElement::AddEntry(DicomDirType type, Element const &elem)
+bool DicomDirElement::AddEntry(DicomDirType type, DicomElement const &elem)
{
switch( type )
{
void DicomDirElement::AddDicomDirElement(DicomDirType type,
uint16_t group, uint16_t elem)
{
- Element el;
+ DicomElement el;
el.Group = group;
el.Elem = elem;
el.Value = "";
AddEntry(type, el);
}
+
//-----------------------------------------------------------------------------
// Protected
void DicomDirElement::Print(std::ostream &os)
{
std::ostringstream s;
- std::list<Element>::iterator it;
+ std::list<DicomElement>::iterator it;
//char greltag[10]; //group element tag
TagKey greltag;
Program: gdcm
Module: $RCSfile: gdcmDicomDirElement.h,v $
Language: C++
- Date: $Date: 2005/09/02 07:10:03 $
- Version: $Revision: 1.31 $
+ Date: $Date: 2005/10/19 12:01:50 $
+ Version: $Revision: 1.32 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
//-----------------------------------------------------------------------------
-typedef std::list<Element> ListDicomDirElem;
-typedef std::list<Element> ListDicomDirMetaElem;
-typedef std::list<Element> ListDicomDirPatientElem;
-typedef std::list<Element> ListDicomDirStudyElem;
-typedef std::list<Element> ListDicomDirVisitElem;
-typedef std::list<Element> ListDicomDirSerieElem;
-typedef std::list<Element> ListDicomDirImageElem;
+typedef std::list<DicomElement> ListDicomDirElem;
+typedef std::list<DicomElement> ListDicomDirMetaElem;
+typedef std::list<DicomElement> ListDicomDirPatientElem;
+typedef std::list<DicomElement> ListDicomDirStudyElem;
+typedef std::list<DicomElement> ListDicomDirVisitElem;
+typedef std::list<DicomElement> ListDicomDirSerieElem;
+typedef std::list<DicomElement> ListDicomDirImageElem;
// For future use (Full DICOMDIR)
/*
-typedef std::list<Element> ListDicomDirResultElem;
-typedef std::list<Element> ListDicomDirStudyComponentElem;
-
-typedef std::list<Element> ListDicomDirOverlayElem;
-typedef std::list<Element> ListDicomDirModalityLutElem;
-typedef std::list<Element> ListDicomDirModalityLutElem;
-typedef std::list<Element> ListDicomDirCurveElem;
-typedef std::list<Element> ListDicomDirStoredPrintElem;
-typedef std::list<Element> ListDicomDirRtDoseElem;
-typedef std::list<Element> ListDicomDirRtStructureSetElem;
-typedef std::list<Element> ListDicomDirRtPlanElem;
-typedef std::list<Element> ListDicomDirRtTreatRecordElem;
-typedef std::list<Element> ListDicomDirPresentationElem;
-typedef std::list<Element> ListDicomDirSrDocumentElem;
-typedef std::list<Element> ListDicomDirKeyObjectDocElem;
-typedef std::list<Element> ListDicomDirSpectroscopyElem;
-typedef std::list<Element> ListDicomDirRawDataElem;
-typedef std::list<Element> ListDicomDirRegistrationElem;
-typedef std::list<Element> ListDicomDirFiducialElem;
+typedef std::list<DicomElement> ListDicomDirResultElem;
+typedef std::list<DicomElement> ListDicomDirStudyComponentElem;
+
+typedef std::list<DicomElement> ListDicomDirOverlayElem;
+typedef std::list<DicomElement> ListDicomDirModalityLutElem;
+typedef std::list<DicomElement> ListDicomDirModalityLutElem;
+typedef std::list<DicomElement> ListDicomDirCurveElem;
+typedef std::list<DicomElement> ListDicomDirStoredPrintElem;
+typedef std::list<DicomElement> ListDicomDirRtDoseElem;
+typedef std::list<DicomElement> ListDicomDirRtStructureSetElem;
+typedef std::list<DicomElement> ListDicomDirRtPlanElem;
+typedef std::list<DicomElement> ListDicomDirRtTreatRecordElem;
+typedef std::list<DicomElement> ListDicomDirPresentationElem;
+typedef std::list<DicomElement> ListDicomDirSrDocumentElem;
+typedef std::list<DicomElement> ListDicomDirKeyObjectDocElem;
+typedef std::list<DicomElement> ListDicomDirSpectroscopyElem;
+typedef std::list<DicomElement> ListDicomDirRawDataElem;
+typedef std::list<DicomElement> ListDicomDirRegistrationElem;
+typedef std::list<DicomElement> ListDicomDirFiducialElem;
*/
//-----------------------------------------------------------------------------
{ return DicomDirImageList; }
// Public method to add an element
- bool AddEntry(DicomDirType type, Element const &elem);
+ bool AddEntry(DicomDirType type, DicomElement const &elem);
// Only one instance of ddElem
void AddDicomDirElement(DicomDirType type,
Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2005/10/18 21:19:57 $
- Version: $Revision: 1.297 $
+ Date: $Date: 2005/10/19 12:01:50 $
+ Version: $Revision: 1.298 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
*/
void Document::AddForceLoadElement (uint16_t group, uint16_t elem)
{
- Element el;
+ DicomElement el;
el.Group = group;
el.Elem = elem;
UserForceLoadList.push_back(el);
Program: gdcm
Module: $RCSfile: gdcmDocument.h,v $
Language: C++
- Date: $Date: 2005/10/18 12:58:28 $
- Version: $Revision: 1.125 $
+ Date: $Date: 2005/10/19 12:01:51 $
+ Version: $Revision: 1.126 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
public:
-typedef std::list<Element> ListElements;
+typedef std::list<DicomElement> ListElements;
// Loading
//Deprecated : use SetFileName() + Load()
Program: gdcm
Module: $RCSfile: gdcmFile.cxx,v $
Language: C++
- Date: $Date: 2005/10/19 09:43:13 $
- Version: $Revision: 1.281 $
+ Date: $Date: 2005/10/19 12:01:51 $
+ Version: $Revision: 1.282 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
void File::AddAnonymizeElement (uint16_t group, uint16_t elem,
std::string const &value)
{
- Element el;
+ DicomElement el;
el.Group = group;
el.Elem = elem;
el.Value = value;
Program: gdcm
Module: $RCSfile: gdcmSystem.h,v $
Language: C++
- Date: $Date: 2005/10/19 08:16:59 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2005/10/19 12:01:51 $
+ Version: $Revision: 1.4 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#define UINT32_MAX (4294967295U)
#endif
-#if defined(_WIN32) && defined(BUILD_SHARED_LIBS)
- #ifdef gdcm_EXPORTS
- #define GDCM_EXPORT __declspec( dllexport )
- #else
- #define GDCM_EXPORT __declspec( dllimport )
- #endif
-#else
- #define GDCM_EXPORT
-#endif
-
//-----------------------------------------------------------------------------
#endif