ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
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
26struct NrrdEncoding_t;
27
28namespace itk
29{
35{
36public:
46};
47// Define how to print enumeration
48extern ITKIONRRD_EXPORT std::ostream &
49 operator<<(std::ostream & out, const NrrdImageIOEnums::AxesReorder value);
50
52
91class ITKIONRRD_EXPORT NrrdImageIO : public ImageIOBase
92{
93public:
94 ITK_DISALLOW_COPY_AND_MOVE(NrrdImageIO);
95
100
102 itkNewMacro(Self);
103
105 itkOverrideGetNameOfClassMacro(NrrdImageIO);
106
112 bool
113 SupportsDimension(unsigned long) override;
114
117 bool
118 CanReadFile(const char *) override;
119
121 void
123
125 void
126 Read(void * buffer) override;
127
130 bool
131 CanWriteFile(const char *) override;
132
134 void
136
139 void
140 Write(const void * buffer) override;
141
184 itkGetConstMacro(AxesReorder, AxesReorderEnum);
185
187 void
189 {
190 this->SetAxesReorder(AxesReorderEnum::UseAnyRangeAxisAsPixel);
191 }
192
195 void
197 {
198 this->SetAxesReorder(AxesReorderEnum::UseNonListRangeAxisAsPixel);
199 }
200
203 void
205 {
206 this->SetAxesReorder(AxesReorderEnum::UseScalarPixel);
207 }
208
209protected:
211 ~NrrdImageIO() override;
212 void
213 PrintSelf(std::ostream & os, Indent indent) const override;
214
215 void
216 InternalSetCompressor(const std::string & _compressor) override;
217
220 int
222
224 NrrdToITKComponentType(const int) const;
225
226 const NrrdEncoding_t * m_NrrdCompressionEncoding{ nullptr };
227
228 AxesReorderEnum m_AxesReorder{ AxesReorderEnum::UseAnyRangeAxisAsPixel };
229};
230} // end namespace itk
231
232#endif // itkNrrdImageIO_h
itk::IOComponentEnum IOComponentEnum
Control indentation during Print() invocation.
Definition itkIndent.h:51
Contains all enum classes used by NrrdImageIO class.
void ReadImageInformation() override
IOComponentEnum NrrdToITKComponentType(const int) const
SmartPointer< Self > Pointer
void InternalSetCompressor(const std::string &_compressor) override
bool SupportsDimension(unsigned long) override
bool CanReadFile(const char *) override
void SetAxesReorderToUseAnyRangeAxisAsPixel()
void Write(const void *buffer) override
void Read(void *buffer) override
const NrrdEncoding_t * m_NrrdCompressionEncoding
~NrrdImageIO() override
AxesReorderEnum m_AxesReorder
void SetAxesReorderToUseNonListRangeAxisAsPixel()
int ITKToNrrdComponentType(const IOComponentEnum) const
void SetAxesReorderToUseScalarPixel()
void PrintSelf(std::ostream &os, Indent indent) const override
virtual void SetAxesReorder(AxesReorderEnum _arg)
ImageIOBase Superclass
bool CanWriteFile(const char *) override
void WriteImageInformation() override
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
NrrdImageIOEnums::AxesReorder AxesReorderEnum
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, AnatomicalOrientation::CoordinateEnum value)