#ifndef __creaImageIODicomImageReader_h_INCLUDED__ #define __creaImageIODicomImageReader_h_INCLUDED__ #include #if defined(USE_GDCM2) #include #include #include #endif class vtkGDCMImageReader; namespace creaImageIO { /** * \ingroup IO */ //===================================================================== /// Concrete image reader for DICOM images class DicomImageReader : virtual public AbstractImageReader { public: DicomImageReader(); virtual ~DicomImageReader(); /// Add file extensions read by the reader virtual void PushBackExtensions(std::vector&); /// Test if file is read by this reader virtual bool CanRead(const std::string& filename); /// 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); /// Another function to read attributes for a file void getAttributes(const std::string filename, std::map &infos, std::vector i_attr); private: const std::string GetStringValueFromTag( const gdcm::DataElement& ds); vtkGDCMImageReader *mReader; gdcm::Scanner mscan; bool b_loaded; struct deleter { void operator()(gdcm::File* p) { delete p; } }; friend struct deleter; }; //===================================================================== } // namespace creaImageIO #endif // #ifndef __creaImageIODicomImageReader_h_INCLUDED__