ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkGiplImageIO.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  *=========================================================================*/
18 #ifndef itkGiplImageIO_h
19 #define itkGiplImageIO_h
20 #include "ITKIOGIPLExport.h"
21 
22 
23 #include <fstream>
24 #include "itkImageIOBase.h"
25 #include <cstdio>
26 
27 namespace itk
28 {
29 class GiplImageIOInternals;
30 
39 class ITKIOGIPL_EXPORT GiplImageIO:public ImageIOBase
40 {
41 public:
42  ITK_DISALLOW_COPY_AND_ASSIGN(GiplImageIO);
43 
45  using Self = GiplImageIO;
48 
50  itkNewMacro(Self);
51 
53  itkTypeMacro(GiplImageIO, Superclass);
54 
55  /*-------- This part of the interfaces deals with reading data. ----- */
56 
59  bool CanReadFile(const char *) override;
60 
62  void ReadImageInformation() override;
63 
65  void Read(void *buffer) override;
66 
67  /*-------- This part of the interfaces deals with writing data. ----- */
68 
71  bool CanWriteFile(const char *) override;
72 
74  void WriteImageInformation() override;
75 
78  void Write(const void *buffer) override;
79 
80  GiplImageIO();
81  ~GiplImageIO() override;
82  void PrintSelf(std::ostream & os, Indent indent) const override;
83 
84 private:
85  void SwapBytesIfNecessary(void *buffer, SizeValueType numberOfPixels);
86 
87  bool CheckExtension(const char *);
88 
89  std::ifstream m_Ifstream;
90  std::ofstream m_Ofstream;
92 
93  GiplImageIOInternals *m_Internal;
94 };
95 } // end namespace itk
96 
97 #endif // itkGiplImageIO_h
Light weight base class for most itk classes.
Abstract superclass defines image IO interface.
GiplImageIOInternals * m_Internal
std::ifstream m_Ifstream
std::ofstream m_Ofstream
::itk::SizeValueType SizeValueType
Read GiplImage file format.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for most ITK classes.
Definition: itkObject.h:60