RTK  2.6.0
Reconstruction Toolkit
rtkXRadImageIO.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 rtkXRadImageIO_h
20 #define rtkXRadImageIO_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 
41 class RTK_EXPORT XRadImageIO : public itk::ImageIOBase
42 {
43 public:
45  using Self = XRadImageIO;
48 
50  : Superclass()
51  {}
52 
54  itkNewMacro(Self);
55 
57 #ifdef itkOverrideGetNameOfClassMacro
58  itkOverrideGetNameOfClassMacro(XRadImageIO);
59 #else
60  itkTypeMacro(XRadImageIO, ImageIOBase);
61 #endif
62 
63 
64  /*-------- This part of the interface deals with reading data. ------ */
65  void
66  ReadImageInformation() override;
67 
68  bool
69  CanReadFile(const char * FileNameToRead) override;
70 
71  void
72  Read(void * buffer) override;
73 
74  /*-------- This part of the interfaces deals with writing data. ----- */
75  virtual void
76  WriteImageInformation(bool keepOfStream);
77 
78  void
80  {
81  WriteImageInformation(false);
82  }
83 
84  bool
85  CanWriteFile(const char * filename) override;
86 
87  void
88  Write(const void * buffer) override;
89 
90 protected:
91 }; // end class XRadImageIO
92 
93 } // namespace rtk
94 
95 #endif
void WriteImageInformation() override
Class for reading XRad image file format. XRad is the format of exported X-ray projection images on t...