RTK  2.6.0
Reconstruction Toolkit
rtkImagXImageIO.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright RTK Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * https://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 
19 #ifndef rtkImagXImageIO_h
20 #define rtkImagXImageIO_h
21 
22 #include <itkImageIOBase.h>
23 #include <fstream>
24 #include <cstring>
25 
26 #include "RTKExport.h"
27 #include "rtkMacro.h"
28 
29 namespace rtk
30 {
31 
38 class RTK_EXPORT ImagXImageIO : public itk::ImageIOBase
39 {
40 public:
42  using Self = ImagXImageIO;
45 
47  : Superclass()
48  {}
49 
51  itkNewMacro(Self);
52 
54 #ifdef itkOverrideGetNameOfClassMacro
55  itkOverrideGetNameOfClassMacro(ImagXImageIO);
56 #else
57  itkTypeMacro(ImagXImageIO, ImageIOBase);
58 #endif
59 
60 
61  /*-------- This part of the interface deals with reading data. ------ */
62  void
63  ReadImageInformation() override;
64 
65  bool
66  CanReadFile(const char * FileNameToRead) override;
67 
68  void
69  Read(void * buffer) override;
70 
71  /*-------- This part of the interfaces deals with writing data. ----- */
72  virtual void
73  WriteImageInformation(bool keepOfStream);
74 
75  void
77  {
78  WriteImageInformation(false);
79  }
80  bool
81  CanWriteFile(const char * filename) override;
82 
83  void
84  Write(const void * buffer) override;
85 
86 protected:
87  std::string m_RawFileName;
88 };
89 
90 } // namespace rtk
91 
92 #endif
void WriteImageInformation() override
std::string m_RawFileName