fw4spl
itkInrImageIO.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2017.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __INR2ITK_ITKINRIMAGEIO_HPP__
8 #define __INR2ITK_ITKINRIMAGEIO_HPP__
9 
10 #include "fwItkIO/config.hpp"
11 
12 #include <itkImageIOBase.h>
13 
14 #include <fstream>
15 
16 namespace itk
17 {
18 
24 class FWITKIO_CLASS_API InrImageIO : public ImageIOBase
25 {
26 public:
28  typedef InrImageIO Self;
29  typedef ImageIOBase SuperClass;
30  typedef SmartPointer<Self> Pointer;
31 
33  itkNewMacro(Self)
34 
35 
36  itkTypeMacro(InrImageIO, Superclass)
37 
38  /*-------- This part of the interfaces deals with reading data. ----- */
39 
45  virtual bool CanReadFile(const char* FileNameToRead) override;
46 
48  virtual void ReadImageInformation() override;
49 
51  virtual void Read(void* buffer) override;
52 
53  /*-------- This part of the interfaces deals with writing data. ----- */
54 
60  virtual bool CanWriteFile(const char* FileNameToWrite) override;
61 
63  virtual void WriteImageInformation() override;
64 
67  virtual void Write(const void* buffer) override;
68 
69 protected:
70  FWITKIO_API InrImageIO();
71  FWITKIO_API ~InrImageIO();
72  void PrintSelf(std::ostream& os, Indent indent) const override;
73 private:
74  InrImageIO(const Self&); //purposely not implemented
75  void operator=(const Self&); //purposely not implemented
76 
77  std::streampos m_headerSize;
78  //bool m_swapBytes;
79 }; // class InrImageIO()
80 
81 } // namespace itk
82 
83 #endif // __INR2ITK_ITKINRIMAGEIO_HPP__
STL namespace.
Class that defines how to read/write in the InrImage file format.