ITK  6.0.0
Insight Toolkit
itkNrrdImageIO.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 #ifndef itkNrrdImageIO_h
19 #define itkNrrdImageIO_h
20 #include "ITKIONRRDExport.h"
21 
22 
23 #include "itkImageIOBase.h"
24 #include <fstream>
25 
26 struct NrrdEncoding_t;
27 
28 namespace itk
29 {
44 class ITKIONRRD_EXPORT NrrdImageIO : public ImageIOBase
45 {
46 public:
47  ITK_DISALLOW_COPY_AND_MOVE(NrrdImageIO);
48 
50  using Self = NrrdImageIO;
53 
55  itkNewMacro(Self);
56 
58  itkOverrideGetNameOfClassMacro(NrrdImageIO);
59 
65  bool
66  SupportsDimension(unsigned long) override;
67 
70  bool
71  CanReadFile(const char *) override;
72 
74  void
75  ReadImageInformation() override;
76 
78  void
79  Read(void * buffer) override;
80 
83  bool
84  CanWriteFile(const char *) override;
85 
87  void
88  WriteImageInformation() override;
89 
92  void
93  Write(const void * buffer) override;
94 
95 protected:
96  NrrdImageIO();
97  ~NrrdImageIO() override;
98  void
99  PrintSelf(std::ostream & os, Indent indent) const override;
100 
101  void
102  InternalSetCompressor(const std::string & _compressor) override;
103 
106  int
107  ITKToNrrdComponentType(const IOComponentEnum) const;
108 
110  NrrdToITKComponentType(const int) const;
111 
112  const NrrdEncoding_t * m_NrrdCompressionEncoding{ nullptr };
113 };
114 } // end namespace itk
115 
116 #endif // itkNrrdImageIO_h
itk::ImageIOBase
Abstract superclass defines image IO interface.
Definition: itkImageIOBase.h:77
itk::NrrdImageIO
Read and write the "Nearly Raw Raster Data" (Nrrd) image format. The Nrrd format was developed as par...
Definition: itkNrrdImageIO.h:44
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::CommonEnums::IOComponent
IOComponent
Definition: itkCommonEnums.h:74
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itkImageIOBase.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:61