SimpleITK  1.0.1
sitkImageFileReader.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 sitkImageFileReader_h
19 #define sitkImageFileReader_h
20 
21 #include "sitkMacro.h"
22 #include "sitkImage.h"
23 #include "sitkImageReaderBase.h"
25 
26 namespace itk {
27  namespace simple {
28 
39  : public ImageReaderBase
40  {
41  public:
43 
45  virtual std::string ToString() const;
46 
48  virtual std::string GetName() const { return std::string("ImageFileReader"); }
49 
50  SITK_RETURN_SELF_TYPE_HEADER SetFileName ( const std::string &fn );
51  std::string GetFileName() const;
52 
53  Image Execute();
54 
56 
57  protected:
58 
59  template <class TImageType> Image ExecuteInternal ( itk::ImageIOBase * );
60 
61  private:
62 
63  // function pointer type
64  typedef Image (Self::*MemberFunctionType)( itk::ImageIOBase * );
65 
66  // friend to get access to executeInternal member
67  friend struct detail::MemberFunctionAddressor<MemberFunctionType>;
68  nsstd::auto_ptr<detail::MemberFunctionFactory<MemberFunctionType> > m_MemberFactory;
69 
70  std::string m_FileName;
71  };
72 
82  SITKIO_EXPORT Image ReadImage ( const std::string &filename, PixelIDValueEnum outputPixelType = sitkUnknown );
83  }
84 }
85 
86 #endif
An abract base class for image readers.
PixelIDValueEnum
Enumerated values of pixelIDs.
Read a 2D or 3D image and return a smart pointer to a SimpleITK image.
nsstd::auto_ptr< detail::MemberFunctionFactory< MemberFunctionType > > m_MemberFactory
SITKIO_EXPORT Image ReadImage(const std::string &filename, PixelIDValueEnum outputPixelType=sitkUnknown)
ReadImage is a procedural interface to the ImageFileReader class which is convenient for most image r...
#define SITKIO_EXPORT
Definition: sitkIO.h:34
The main Image class for SimpleITK.
Definition: sitkImage.h:54
virtual std::string GetName() const