]> Creatis software - clitk.git/blob - common/clitkVoxImageIO.h
removed headers
[clitk.git] / common / clitkVoxImageIO.h
1 #ifndef CLITKVOXIMAGEIO_H
2 #define CLITKVOXIMAGEIO_H
3 /**
4  ===================================================================
5  * @file   clitkVoxImageIO.h
6  * @author David Sarrut <David.Sarrut@creatis.insa-lyon.fr>
7  * @date   17 May 2006 08:01:35
8
9  * @brief  
10
11  ===================================================================*/
12
13 // clitk include
14 #include "clitkCommon.h"
15
16 // itk include
17 #include "itkImageIOBase.h"
18
19 // std include
20 #include <fstream>
21
22 namespace clitk {
23   
24   //====================================================================
25   // Class for reading Vox Image file format
26   class VoxImageIO: public itk::ImageIOBase
27   {
28   public: 
29         /** Standard class typedefs. */
30         typedef VoxImageIO              Self;
31         typedef itk::ImageIOBase        Superclass;
32         typedef itk::SmartPointer<Self> Pointer;        
33         typedef signed short int        PixelType;
34         
35         VoxImageIO():Superclass() { mustWriteHeader = false; }
36
37         /** Method for creation through the object factory. */
38         itkNewMacro(Self);
39         
40         /** Run-time type information (and related methods). */
41         itkTypeMacro(VoxImageIO, ImageIOBase);
42         
43         /*-------- This part of the interface deals with reading data. ------ */
44         virtual void ReadImageInformation();
45         virtual bool CanReadFile( const char* FileNameToRead );
46         virtual void Read(void * buffer);
47
48         /*-------- This part of the interfaces deals with writing data. ----- */
49         virtual void WriteImageInformation(bool keepOfStream);
50         virtual void WriteImageInformation() { WriteImageInformation(false); }
51         virtual bool CanWriteFile(const char* filename);
52         virtual void Write(const void* buffer);
53         
54   protected:
55         bool mustWriteHeader;
56         int m_HeaderSize;
57         std::ofstream file;
58
59   }; // end class VoxImageIO  
60
61 } // end namespace
62
63   // explicit template instantiation
64 template class itk::CreateObjectFunction<clitk::VoxImageIO>;
65
66 #endif /* end #define CLITKVOXIMAGEIO_H */
67