00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkImageSeriesReader.h,v $ 00005 Language: C++ 00006 Date: $Date: 2004/09/03 23:47:54 $ 00007 Version: $Revision: 1.12 $ 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 } 00092 00095 void SetFileName (std::string const &name) 00096 { 00097 m_FileNames.clear(); 00098 m_FileNames.push_back(name); 00099 this->Modified(); 00100 } 00101 00104 void AddFileName (std::string const &name) 00105 { 00106 m_FileNames.push_back(name); 00107 this->Modified(); 00108 } 00109 00112 itkSetMacro(ReverseOrder,bool); 00113 itkGetMacro(ReverseOrder,bool); 00114 itkBooleanMacro(ReverseOrder); 00115 00120 itkSetObjectMacro(ImageIO,ImageIOBase); 00121 itkGetObjectMacro(ImageIO,ImageIOBase); 00122 00125 virtual void GenerateOutputInformation(void); 00126 00132 virtual void EnlargeOutputRequestedRegion(DataObject *output); 00133 00135 DictionaryArrayRawPointer GetMetaDataDictionaryArray() const; 00136 00137 protected: 00138 ImageSeriesReader() : m_ImageIO(0), m_ReverseOrder(false) {}; 00139 ~ImageSeriesReader(); 00140 void PrintSelf(std::ostream& os, Indent indent) const; 00141 00143 virtual void GenerateData(); 00144 00146 ImageIOBase::Pointer m_ImageIO; 00147 00149 bool m_ReverseOrder; 00150 00152 FileNamesContainer m_FileNames; 00153 00156 int m_NumberOfDimensionsInImage; 00157 00160 DictionaryArrayType m_MetaDataDictionaryArray; 00161 00162 private: 00163 ImageSeriesReader(const Self&); //purposely not implemented 00164 void operator=(const Self&); //purposely not implemented 00165 }; 00166 00167 } //namespace ITK 00168 00169 #ifndef ITK_MANUAL_INSTANTIATION 00170 #include "itkImageSeriesReader.txx" 00171 #endif 00172 00173 #endif // __itkImageSeriesReader_h 00174