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