ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkMINCImageIO.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software 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  * 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 
67 class ITKIOMINC_EXPORT MINCImageIO : public ImageIOBase
68 {
69 public:
70  ITK_DISALLOW_COPY_AND_ASSIGN(MINCImageIO);
71 
73  using Self = MINCImageIO;
77 
79  itkNewMacro(Self);
80 
82  itkTypeMacro(MINCImageIO, Superclass);
83 
85  bool SupportsDimension(unsigned long dim) override
86  {
87  return dim<4;
88  }
89 
92  void SetCompressionLevel(int level);
93  int GetCompressionLevel() const;
95 
96  /*-------- This part of the interface deals with reading data. ------ */
97 
100  bool CanReadFile(const char *) override;
101 
103  void ReadImageInformation() override;
104 
106  void Read(void *buffer) override;
107 
108  /*-------- This part of the interfaces deals with writing data. ----- */
109 
112  bool CanWriteFile(const char *) override;
113 
116  void WriteImageInformation() override;
117 
120  void Write(const void *buffer) override;
121 
122 protected:
123  MINCImageIO();
124  ~MINCImageIO() override;
125 
126  void PrintSelf(std::ostream & os, Indent indent) const override;
127 
128  void WriteSlice(std::string & fileName, const void *buffer);
129 
130  // will assign m_NDims and allocate all internal buffers to hold the
131  // information
132  void AllocateDimensions(int nDims);
133 
134  // cleanup internal buffers
135  void CleanupDimensions();
136 
137  // close existing volume, cleanup internal structures
138  void CloseVolume();
139 
140 private:
141 
143 
145 
146  // complex type images, composed of complex numbers
147  //int m_Complex;
148 
149 };
150 } // end namespace itk
151 
152 #endif // itkMINCImageIO_h
Light weight base class for most itk classes.
Abstract superclass defines image IO interface.
Class that defines how to read MINC file format.
MatrixType m_DirectionCosines
struct ITKIOMINC_HIDDEN MINCImageIOPImpl
Control indentation during Print() invocation.
Definition: itkIndent.h:49
MINCImageIOPImpl * m_MINCPImpl
bool SupportsDimension(unsigned long dim) override
Base class for most ITK classes.
Definition: itkObject.h:60