#ifndef __creaImageIODicomScanner_h_INCLUDED__ #define __creaImageIODicomScanner_h_INCLUDED__ #include "creaImageIOTree.h" #if defined(USE_GDCM2) #include #include #include #endif class vtkGDCMImageReader; namespace creaImageIO { /** * \ingroup IO */ //===================================================================== /// Concrete image reader for DICOM images class DicomImageScanner { public: DicomImageScanner(); virtual ~DicomImageScanner(); /// Add file extensions read by the reader bool addDirectory(std::string& filename, std::map& attr); /// return for a file a 2D VTkImage virtual vtkImageData* ReadImage(const std::string& filename); /// Read the attributes for a file virtual void ReadAttributes(const std::string& filename, tree::AttributeMapType& attr); void ReadAttributes2(const std::string& filename, tree::AttributeMapType& attr); std::string irclean(const std::string& str); private: const std::string GetStringValueFromTag( const gdcm::DataElement& ds); vtkGDCMImageReader *mReader; gdcm::Scanner mscan; bool b_loaded; }; //===================================================================== } // namespace creaImageIO #endif // #ifndef __creaImageIODicomScanner_h_INCLUDED__