Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkImageFileReader.h

Go to the documentation of this file.
00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkImageFileReader.h,v $ 00005 Language: C++ 00006 Date: $Date: 2003/09/10 14:29:34 $ 00007 Version: $Revision: 1.17 $ 00008 00009 Copyright (c) Insight Software Consortium. All rights reserved. 00010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 #ifndef __itkImageFileReader_h 00018 #define __itkImageFileReader_h 00019 00020 #include "itkImageIOBase.h" 00021 #include "itkImageSource.h" 00022 #include "itkExceptionObject.h" 00023 #include "itkSize.h" 00024 #include "itkImageRegion.h" 00025 #include "itkDefaultConvertPixelTraits.h" 00026 00027 namespace itk 00028 { 00029 00031 class ImageFileReaderException : public ExceptionObject 00032 { 00033 public: 00035 itkTypeMacro( ImageFileReaderException, ExceptionObject ); 00036 00038 ImageFileReaderException(char *file, unsigned int line, 00039 const char* message = "Error in IO") : 00040 ExceptionObject(file, line) 00041 { 00042 SetDescription(message); 00043 } 00044 00046 ImageFileReaderException(const std::string &file, unsigned int line, 00047 const char* message = "Error in IO") : 00048 ExceptionObject(file, line) 00049 { 00050 SetDescription(message); 00051 } 00052 }; 00053 00054 00085 template <class TOutputImage, 00086 class ConvertPixelTraits = 00087 DefaultConvertPixelTraits< ITK_TYPENAME TOutputImage::PixelType> > 00088 class ITK_EXPORT ImageFileReader : public ImageSource<TOutputImage> 00089 { 00090 public: 00092 typedef ImageFileReader Self; 00093 typedef ImageSource<TOutputImage> Superclass; 00094 typedef SmartPointer<Self> Pointer; 00095 00097 itkNewMacro(Self); 00098 00100 itkTypeMacro(ImageFileReader, ImageSource); 00101 00103 typedef typename TOutputImage::SizeType SizeType; 00104 00106 typedef typename TOutputImage::RegionType ImageRegionType; 00107 00109 typedef typename TOutputImage::PixelType OutputImagePixelType; 00110 00112 itkSetStringMacro(FileName); 00113 itkGetStringMacro(FileName); 00114 00121 void SetImageIO( ImageIOBase * imageIO ); 00122 itkGetObjectMacro(ImageIO,ImageIOBase); 00123 00126 virtual void GenerateOutputInformation(void); 00127 00133 virtual void EnlargeOutputRequestedRegion(DataObject *output); 00134 00135 00136 protected: 00137 ImageFileReader(); 00138 ~ImageFileReader(); 00139 void PrintSelf(std::ostream& os, Indent indent) const; 00140 00142 void DoConvertBuffer(void* buffer, unsigned long numberOfPixels); 00143 00145 virtual void GenerateData(); 00146 00147 ImageIOBase::Pointer m_ImageIO; 00148 bool m_UserSpecifiedImageIO; //keep track whether the ImageIO is user specified 00149 00151 std::string m_FileName; 00152 00153 private: 00154 ImageFileReader(const Self&); //purposely not implemented 00155 void operator=(const Self&); //purposely not implemented 00156 00157 }; 00158 00159 00160 } //namespace ITK 00161 00162 #ifndef ITK_MANUAL_INSTANTIATION 00163 #include "itkImageFileReader.txx" 00164 #endif 00165 00166 #endif // __itkImageFileReader_h

Generated at Sat Mar 31 02:20:55 2007 for ITK by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2000