00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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::IndexType IndexType;
00066
00068 typedef typename TOutputImage::RegionType ImageRegionType;
00069
00071 typedef typename TOutputImage::PixelType OutputImagePixelType;
00072
00074 typedef MetaDataDictionary DictionaryType;
00075 typedef MetaDataDictionary * DictionaryRawPointer;
00076 typedef std::vector< DictionaryRawPointer > DictionaryArrayType;
00077 typedef const DictionaryArrayType * DictionaryArrayRawPointer;
00078
00079 typedef std::vector<std::string> FileNamesContainer;
00080
00083 void SetFileNames (const FileNamesContainer &name)
00084 {
00085 if ( m_FileNames != name)
00086 {
00087 m_FileNames = name;
00088 this->Modified();
00089 }
00090 }
00091 const FileNamesContainer & GetFileNames() const
00092 {
00093 return m_FileNames;
00094 }
00096
00099 void SetFileName (std::string const &name)
00100 {
00101 m_FileNames.clear();
00102 m_FileNames.push_back(name);
00103 this->Modified();
00104 }
00106
00109 void AddFileName (std::string const &name)
00110 {
00111 m_FileNames.push_back(name);
00112 this->Modified();
00113 }
00115
00118 itkSetMacro(ReverseOrder,bool);
00119 itkGetConstMacro(ReverseOrder,bool);
00120 itkBooleanMacro(ReverseOrder);
00122
00127 itkSetObjectMacro(ImageIO,ImageIOBase);
00128 itkGetObjectMacro(ImageIO,ImageIOBase);
00130
00133 virtual void GenerateOutputInformation(void);
00134
00140 virtual void EnlargeOutputRequestedRegion(DataObject *output);
00141
00143 DictionaryArrayRawPointer GetMetaDataDictionaryArray() const;
00144
00146 itkSetMacro(UseStreaming,bool);
00147 itkGetConstReferenceMacro(UseStreaming,bool);
00148 itkBooleanMacro(UseStreaming);
00150
00151 protected:
00152 ImageSeriesReader() : m_ImageIO(0), m_ReverseOrder(false), m_UseStreaming(true) {};
00153 ~ImageSeriesReader();
00154 void PrintSelf(std::ostream& os, Indent indent) const;
00155
00157 virtual void GenerateData();
00158
00160 ImageIOBase::Pointer m_ImageIO;
00161
00163 bool m_ReverseOrder;
00164
00166 FileNamesContainer m_FileNames;
00167
00170 int m_NumberOfDimensionsInImage;
00171
00174 DictionaryArrayType m_MetaDataDictionaryArray;
00175
00176 bool m_UseStreaming;
00177
00178 private:
00179 ImageSeriesReader(const Self&);
00180 void operator=(const Self&);
00181 };
00182
00183 }
00184
00185 #ifndef ITK_MANUAL_INSTANTIATION
00186 #include "itkImageSeriesReader.txx"
00187 #endif
00188
00189 #endif // __itkImageSeriesReader_h
00190