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
84class ITKIONRRD_EXPORT NrrdImageIO : public ImageIOBase
85{
86public:
87 ITK_DISALLOW_COPY_AND_MOVE(NrrdImageIO);
88
93
95 itkNewMacro(Self);
96
98 itkOverrideGetNameOfClassMacro(NrrdImageIO);
99
105 bool
106 SupportsDimension(unsigned long) override;
107
110 bool
111 CanReadFile(const char *) override;
112
114 void
116
118 void
119 Read(void * buffer) override;
120
123 bool
124 CanWriteFile(const char *) override;
125
127 void
129
132 void
133 Write(const void * buffer) override;
134
177 itkGetConstMacro(AxesReorder, AxesReorderEnum);
178
180 void
182 {
183 this->SetAxesReorder(AxesReorderEnum::UseAnyRangeAxisAsPixel);
184 }
185
188 void
190 {
191 this->SetAxesReorder(AxesReorderEnum::UseNonListRangeAxisAsPixel);
192 }
193
196 void
198 {
199 this->SetAxesReorder(AxesReorderEnum::UseScalarPixel);
200 }
201
202protected:
204 ~NrrdImageIO() override;
205 void
206 PrintSelf(std::ostream & os, Indent indent) const override;
207
208 void
209 InternalSetCompressor(const std::string & _compressor) override;
210
213 int
215
217 NrrdToITKComponentType(const int) const;
218
219 const NrrdEncoding_t * m_NrrdCompressionEncoding{ nullptr };
220
221 AxesReorderEnum m_AxesReorder{ AxesReorderEnum::UseAnyRangeAxisAsPixel };
222};
223} // end namespace itk
224
225#endif // itkNrrdImageIO_h
itk::IOComponentEnum IOComponentEnum
Control indentation during Print() invocation.
Definition itkIndent.h:50
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, typename AnatomicalOrientation::CoordinateEnum value)