00001 /*========================================================================= 00002 00003 Program: GDCM (Grassroots DICOM). A DICOM library 00004 Module: $URL$ 00005 00006 Copyright (c) 2006-2010 Mathieu Malaterre 00007 All rights reserved. 00008 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00015 #ifndef GDCMPYTHONFILTER_H 00016 #define GDCMPYTHONFILTER_H 00017 00018 #include <Python.h> 00019 00020 #include "gdcmDataElement.h" 00021 #include "gdcmDicts.h" 00022 #include "gdcmFile.h" 00023 00024 namespace gdcm 00025 { 00026 00032 class GDCM_EXPORT PythonFilter 00033 { 00034 public: 00035 PythonFilter(); 00036 ~PythonFilter(); 00037 00038 void UseDictAlways(bool use) {} 00039 00040 // Allow user to pass in there own dicts 00041 void SetDicts(const Dicts &dicts); 00042 00043 // Convert to string the ByteValue contained in a DataElement 00044 PyObject *ToPyObject(const Tag& t) const; 00045 00046 void SetFile(const File& f) { F = f; } 00047 File &GetFile() { return *F; } 00048 const File &GetFile() const { return *F; } 00049 00050 private: 00051 SmartPointer<File> F; 00052 }; 00053 00054 } // end namespace gdcm 00055 00056 #endif //GDCMPYTHONFILTER_H