ITK  4.8.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:
43  typedef GiplImageIO Self;
46 
48  itkNewMacro(Self);
49 
51  itkTypeMacro(GiplImageIO, Superclass);
52 
53  /*-------- This part of the interfaces deals with reading data. ----- */
54 
57  virtual bool CanReadFile(const char *) ITK_OVERRIDE;
58 
60  virtual void ReadImageInformation() ITK_OVERRIDE;
61 
63  virtual void Read(void *buffer) ITK_OVERRIDE;
64 
65  /*-------- This part of the interfaces deals with writing data. ----- */
66 
69  virtual bool CanWriteFile(const char *) ITK_OVERRIDE;
70 
72  virtual void WriteImageInformation() ITK_OVERRIDE;
73 
76  virtual void Write(const void *buffer) ITK_OVERRIDE;
77 
78  GiplImageIO();
79  ~GiplImageIO();
80  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
81 
82 private:
83  GiplImageIO(const Self &); //purposely not implemented
84  void operator=(const Self &); //purposely not implemented
85 
86  void SwapBytesIfNecessary(void *buffer, SizeValueType numberOfPixels);
87 
88  bool CheckExtension(const char *);
89 
90  std::ifstream m_Ifstream;
91  std::ofstream m_Ofstream;
92  bool m_IsCompressed;
93 
94  GiplImageIOInternals *m_Internal;
95 };
96 } // end namespace itk
97 
98 #endif // itkGiplImageIO_h
Light weight base class for most itk classes.
Abstract superclass defines image IO interface.
SmartPointer< Self > Pointer
::itk::SizeValueType SizeValueType
Read GiplImage file format.
GiplImageIO Self
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for most ITK classes.
Definition: itkObject.h:57
ImageIOBase Superclass