]> Creatis software - clitk.git/blob - common/clitkEsrfHstImageIO.h
Add clitkImage2Dicom tool
[clitk.git] / common / clitkEsrfHstImageIO.h
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to:
5   - University of LYON              http://www.universite-lyon.fr/
6   - Léon Bérard cancer center       http://www.centreleonberard.fr
7   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
8
9   This software is distributed WITHOUT ANY WARRANTY; without even
10   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11   PURPOSE.  See the copyright notices for more information.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
18
19 #ifndef __clitkEsrfHstImageIO_h
20 #define __clitkEsrfHstImageIO_h
21
22 #include <itkImageIOBase.h>
23 #include <fstream>
24 #include <string.h>
25
26 #include "clitkCommon.h"
27
28 namespace clitk
29 {
30
31 //====================================================================
32 // Class for reading Esrf Hst Image file format
33 class EsrfHstImageIO: public itk::ImageIOBase
34 {
35 public:
36   /** Standard class typedefs. */
37   typedef EsrfHstImageIO          Self;
38   typedef itk::ImageIOBase        Superclass;
39   typedef itk::SmartPointer<Self> Pointer;
40
41   EsrfHstImageIO():Superclass() { }
42
43   /** Method for creation through the object factory. */
44   itkNewMacro(Self);
45
46   /** Run-time type information (and related methods). */
47   itkTypeMacro(EsrfHstImageIO, ImageIOBase);
48
49   /*-------- This part of the interface deals with reading data. ------ */
50   virtual void ReadImageInformation() ITK_OVERRIDE;
51   virtual bool CanReadFile( const char* FileNameToRead ) ITK_OVERRIDE;
52   virtual void Read(void * buffer) ITK_OVERRIDE;
53
54   /*-------- This part of the interfaces deals with writing data. ----- */
55   virtual void WriteImageInformation(bool keepOfStream);
56   virtual void WriteImageInformation() ITK_OVERRIDE { WriteImageInformation(false); }
57   virtual bool CanWriteFile(const char* filename) ITK_OVERRIDE;
58   virtual void Write(const void* buffer) ITK_OVERRIDE;
59
60 protected:
61   std::string m_XmlFileName;
62   std::string m_RawFileName;
63 };
64
65 } // end namespace
66
67 #endif
68