creaImageIODicomScanner.h

Go to the documentation of this file.
00001 #ifndef __creaImageIODicomScanner_h_INCLUDED__
00002 #define __creaImageIODicomScanner_h_INCLUDED__
00003 
00004 #include "creaImageIOTree.h"
00005 
00006 #if defined(USE_GDCM2)
00007 #include <gdcmReader.h>
00008 #include <vtkGDCMImageReader.h>
00009 #include <gdcmScanner.h>
00010 #endif
00011 
00012 class vtkGDCMImageReader;
00013 
00014 namespace creaImageIO
00015 {
00016 
00017 
00022   //=====================================================================
00024   class DicomImageScanner 
00025   {
00026   public:
00027     DicomImageScanner();
00028     virtual ~DicomImageScanner();
00029 
00031     bool addDirectory(std::string& filename,   std::map<std::string,std::string>& attr);
00032 
00034     virtual vtkImageData* ReadImage(const std::string& filename);
00036     virtual void ReadAttributes(const std::string& filename, 
00037                                 tree::AttributeMapType& attr);
00038         void ReadAttributes2(const std::string& filename, 
00039                                 tree::AttributeMapType& attr);
00040 
00041          std::string irclean(const std::string& str);
00042   private:
00043           const std::string GetStringValueFromTag( const gdcm::DataElement& ds);
00044           vtkGDCMImageReader *mReader;
00045           gdcm::Scanner mscan;
00046           bool b_loaded;
00047 
00048   };
00049   //=====================================================================
00050 
00051 
00052 
00053 } // namespace creaImageIO
00054 
00055 
00056 
00057 #endif // #ifndef __creaImageIODicomScanner_h_INCLUDED__