ITK  5.3.0
Insight Toolkit
itkGiplImageIO.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  *=========================================================================*/
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 
40 class ITKIOGIPL_EXPORT GiplImageIO : public ImageIOBase
41 {
42 public:
43  ITK_DISALLOW_COPY_AND_MOVE(GiplImageIO);
44 
46  using Self = GiplImageIO;
49 
51  itkNewMacro(Self);
52 
54  itkTypeMacro(GiplImageIO, Superclass);
55 
56  /*-------- This part of the interfaces deals with reading data. ----- */
57 
60  bool
61  CanReadFile(const char *) override;
62 
64  void
65  ReadImageInformation() override;
66 
68  void
69  Read(void * buffer) override;
70 
71  /*-------- This part of the interfaces deals with writing data. ----- */
72 
75  bool
76  CanWriteFile(const char *) override;
77 
79  void
80  WriteImageInformation() override;
81 
84  void
85  Write(const void * buffer) override;
86 
87  GiplImageIO();
88  ~GiplImageIO() override;
89  void
90  PrintSelf(std::ostream & os, Indent indent) const override;
91 
92 private:
93  void
94  SwapBytesIfNecessary(void * buffer, SizeValueType numberOfPixels);
95 
96  bool
97  CheckExtension(const char *);
98 
99  std::ifstream m_Ifstream;
100  std::ofstream m_Ofstream;
102 
103  GiplImageIOInternals * m_Internal;
104 };
105 } // end namespace itk
106 
107 #endif // itkGiplImageIO_h
itk::ImageIOBase
Abstract superclass defines image IO interface.
Definition: itkImageIOBase.h:77
itk::GiplImageIO::m_Internal
GiplImageIOInternals * m_Internal
Definition: itkGiplImageIO.h:103
itk::GiplImageIO::m_IsCompressed
bool m_IsCompressed
Definition: itkGiplImageIO.h:101
itk::GiplImageIO::m_Ifstream
std::ifstream m_Ifstream
Definition: itkGiplImageIO.h:99
itk::GiplImageIO
Read GiplImage file format.
Definition: itkGiplImageIO.h:40
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::ImageIOBase::SizeValueType
::itk::SizeValueType SizeValueType
Definition: itkImageIOBase.h:98
itk::GiplImageIO::m_Ofstream
std::ofstream m_Ofstream
Definition: itkGiplImageIO.h:100
itkImageIOBase.h
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