00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkImageSeriesReader.h,v $ 00005 Language: C++ 00006 Date: $Date: 2007/08/24 13:35:59 $ 00007 Version: $Revision: 1.14 $ 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 __itkImageSeriesReader_h 00018 #define __itkImageSeriesReader_h 00019 00020 #include "itkImageSource.h" 00021 #include "itkImageIOBase.h" 00022 #include "itkExceptionObject.h" 00023 #include "itkSize.h" 00024 #include "itkImageRegion.h" 00025 #include <vector> 00026 #include <string> 00027 #include "itkMetaDataDictionary.h" 00028 00029 namespace itk 00030 { 00031 00046 template <class TOutputImage> 00047 class ITK_EXPORT ImageSeriesReader : public ImageSource<TOutputImage> 00048 { 00049 public: 00051 typedef ImageSeriesReader Self; 00052 typedef ImageSource<TOutputImage> Superclass; 00053 typedef SmartPointer<Self> Pointer; 00054 00056 itkNewMacro(Self); 00057 00059 itkTypeMacro(ImageSeriesReader, ImageSource); 00060 00062 typedef typename TOutputImage::SizeType SizeType; 00063 00065 typedef typename TOutputImage::RegionType ImageRegionType; 00066 00068 typedef typename TOutputImage::PixelType OutputImagePixelType; 00069 00071 typedef MetaDataDictionary DictionaryType; 00072 typedef MetaDataDictionary * DictionaryRawPointer; 00073 typedef std::vector< DictionaryRawPointer > DictionaryArrayType; 00074 typedef const DictionaryArrayType * DictionaryArrayRawPointer; 00075 00076 typedef std::vector<std::string> FileNamesContainer; 00077 00080 void SetFileNames (const FileNamesContainer &name) 00081 { 00082 if ( m_FileNames != name) 00083 { 00084 m_FileNames = name; 00085 this->Modified(); 00086 } 00087 } 00088 const FileNamesContainer & GetFileNames() const 00089 { 00090 return m_FileNames; 00091 } 00093 00096 void SetFileName (std::string const &name) 00097 { 00098 m_FileNames.clear(); 00099 m_FileNames.push_back(name); 00100 this->Modified(); 00101 } 00103 00106 void AddFileName (std::string const &name) 00107 { 00108 m_FileNames.push_back(name); 00109 this->Modified(); 00110 } 00112 00115 itkSetMacro(ReverseOrder,bool); 00116 itkGetMacro(ReverseOrder,bool); 00117 itkBooleanMacro(ReverseOrder); 00119 00124 itkSetObjectMacro(ImageIO,ImageIOBase); 00125 itkGetObjectMacro(ImageIO,ImageIOBase); 00127 00130 virtual void GenerateOutputInformation(void); 00131 00137 virtual void EnlargeOutputRequestedRegion(DataObject *output); 00138 00140 DictionaryArrayRawPointer GetMetaDataDictionaryArray() const; 00141 00142 protected: 00143 ImageSeriesReader() : m_ImageIO(0), m_ReverseOrder(false) {}; 00144 ~ImageSeriesReader(); 00145 void PrintSelf(std::ostream& os, Indent indent) const; 00146 00148 virtual void GenerateData(); 00149 00151 ImageIOBase::Pointer m_ImageIO; 00152 00154 bool m_ReverseOrder; 00155 00157 FileNamesContainer m_FileNames; 00158 00161 int m_NumberOfDimensionsInImage; 00162 00165 DictionaryArrayType m_MetaDataDictionaryArray; 00166 00167 private: 00168 ImageSeriesReader(const Self&); //purposely not implemented 00169 void operator=(const Self&); //purposely not implemented 00170 }; 00171 00172 } //namespace ITK 00173 00174 #ifndef ITK_MANUAL_INSTANTIATION 00175 #include "itkImageSeriesReader.txx" 00176 #endif 00177 00178 #endif // __itkImageSeriesReader_h 00179