SimpleITK  1.0.1
sitkImageReaderBase.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 sitkImageReaderBase_h
19 #define sitkImageReaderBase_h
20 
21 #include "sitkProcessObject.h"
22 #include "sitkPixelIDValues.h"
23 #include "sitkIO.h"
24 
25 namespace itk {
26 
27 // Forward decalaration for pointer
28 class ImageIOBase;
29 
30 template<class T>
31 class SmartPointer;
32 
33  namespace simple {
34 
40  public ProcessObject
41  {
42  public:
44 
46  // The destructor will be implicitly declared as public.
47 
56  SITK_RETURN_SELF_TYPE_HEADER SetOutputPixelType( PixelIDValueEnum pixelID );
57  PixelIDValueEnum GetOutputPixelType( void ) const;
58  /* @} */
59 
60  virtual Image Execute() = 0;
61 
62  virtual std::string ToString() const;
63 
69  virtual Self& SetLoadPrivateTags(bool loadPrivateTags);
70  virtual bool GetLoadPrivateTags() const;
71  virtual void LoadPrivateTagsOn();
72  virtual void LoadPrivateTagsOff();
73  /* @} */
74 
75  protected:
76 
77  itk::SmartPointer<ImageIOBase> GetImageIOBase(const std::string &fileName);
78 
79 
80  void GetPixelIDFromImageIO( const std::string &fileName,
81  PixelIDValueType &outPixelType,
82  unsigned int & outDimensions);
83  void GetPixelIDFromImageIO( itk::ImageIOBase* iobase,
84  PixelIDValueType &outPixelType,
85  unsigned int & outDimensions);
86 
87  unsigned int GetDimensionFromImageIO( const std::string &fileName, unsigned int i);
88  unsigned int GetDimensionFromImageIO( itk::ImageIOBase* iobase, unsigned int i);
89 
90  private:
91 
92  PixelIDValueType ExecuteInternalReadScalar( int componentType );
93 
94  PixelIDValueType ExecuteInternalReadVector( int componentType );
95 
96  PixelIDValueType ExecuteInternalReadComplex( int componentType );
97 
98 
101 
102  };
103  }
104 }
105 
106 
107 #endif // sitkImageReaderBase_h
An abract base class for image readers.
PixelIDValueEnum
Enumerated values of pixelIDs.
#define SITKIO_EXPORT
Definition: sitkIO.h:34
The main Image class for SimpleITK.
Definition: sitkImage.h:54
Base class for SimpleITK classes based on ProcessObject.