]> Creatis software - creaImageIO.git/blobdiff - src/creaImageIODicomScanner.h
move directory
[creaImageIO.git] / src / creaImageIODicomScanner.h
diff --git a/src/creaImageIODicomScanner.h b/src/creaImageIODicomScanner.h
new file mode 100644 (file)
index 0000000..9209751
--- /dev/null
@@ -0,0 +1,57 @@
+#ifndef __creaImageIODicomScanner_h_INCLUDED__
+#define __creaImageIODicomScanner_h_INCLUDED__
+
+#include "creaImageIOTree.h"
+
+#if defined(USE_GDCM2)
+#include <gdcmReader.h>
+#include <vtkGDCMImageReader.h>
+#include <gdcmScanner.h>
+#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<std::string,std::string>& 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__