ITK  5.2.0
Insight Toolkit
itkMINCImageIO.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  * http://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  *=========================================================================*/
27 #ifndef itkMINCImageIO_h
28 #define itkMINCImageIO_h
29 
30 #include "itkImageIOBase.h"
31 
32 #include "itkMatrix.h"
33 
34 #include "ITKIOMINCExport.h"
35 
36 namespace itk
37 {
38 
39 // Structure for "Pointer to Implementation" or "Private
40 // Implementation" to hide MINC data from the ITK interface.
41 struct ITKIOMINC_HIDDEN MINCImageIOPImpl;
42 
71 class ITKIOMINC_EXPORT MINCImageIO : public ImageIOBase
72 {
73 public:
74  ITK_DISALLOW_COPY_AND_MOVE(MINCImageIO);
75 
77  using Self = MINCImageIO;
81 
83  itkNewMacro(Self);
84 
86  itkTypeMacro(MINCImageIO, Superclass);
87 
89  bool
90  SupportsDimension(unsigned long dim) override
91  {
92  return dim < 4;
93  }
94 
95  /*-------- This part of the interface deals with reading data. ------ */
96 
99  bool
100  CanReadFile(const char *) override;
101 
103  void
104  ReadImageInformation() override;
105 
107  void
108  Read(void * buffer) override;
109 
110  /*-------- This part of the interfaces deals with writing data. ----- */
111 
114  bool
115  CanWriteFile(const char *) override;
116 
119  void
120  WriteImageInformation() override;
121 
124  void
125  Write(const void * buffer) override;
126 
127 protected:
128  MINCImageIO();
129  ~MINCImageIO() override;
130 
131  void
132  PrintSelf(std::ostream & os, Indent indent) const override;
133 
134  void
135  WriteSlice(std::string & fileName, const void * buffer);
136 
137  // will assign m_NDims and allocate all internal buffers to hold the
138  // information
139  void
140  AllocateDimensions(int nDims);
141 
142  // cleanup internal buffers
143  void
144  CleanupDimensions();
145 
146  // close existing volume, cleanup internal structures
147  void
148  CloseVolume();
149 
150 private:
152 
154 
155  // complex type images, composed of complex numbers
156  // int m_Complex;
157 };
158 } // end namespace itk
159 
160 #endif // itkMINCImageIO_h
itk::ImageIOBase
Abstract superclass defines image IO interface.
Definition: itkImageIOBase.h:75
itk::MINCImageIO::m_MINCPImpl
MINCImageIOPImpl * m_MINCPImpl
Definition: itkMINCImageIO.h:151
itkMatrix.h
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::MINCImageIOPImpl
struct ITKIOMINC_HIDDEN MINCImageIOPImpl
Definition: itkMINCImageIO.h:41
itk::MINCImageIO::SupportsDimension
bool SupportsDimension(unsigned long dim) override
Definition: itkMINCImageIO.h:90
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::MINCImageIO::m_DirectionCosines
MatrixType m_DirectionCosines
Definition: itkMINCImageIO.h:153
itk::MINCImageIO
Class that defines how to read MINC file format.
Definition: itkMINCImageIO.h:71
itkImageIOBase.h
itk::Matrix< float, 3, 3 >
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:62
fileName
std::string fileName
Definition: itkTestDriverInclude.h:118