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

itkImageSeriesReader.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkImageSeriesReader.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-07-30 20:00:00 $
00007   Version:   $Revision: 1.18 $
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 #include "itkImageFileReader.h"
00029 
00030 namespace itk
00031 {
00032 
00047 template <class TOutputImage>
00048 class ITK_EXPORT ImageSeriesReader : public ImageSource<TOutputImage>
00049 {
00050 public:
00052   typedef ImageSeriesReader          Self;
00053   typedef ImageSource<TOutputImage>  Superclass;
00054   typedef SmartPointer<Self>         Pointer;
00055 
00057   itkNewMacro(Self);
00058 
00060   itkTypeMacro(ImageSeriesReader, ImageSource);
00061 
00063   typedef typename TOutputImage::SizeType  SizeType;
00064 
00066   typedef typename TOutputImage::IndexType  IndexType;
00067 
00069   typedef typename TOutputImage::RegionType  ImageRegionType;
00070 
00072   typedef typename TOutputImage::PixelType OutputImagePixelType;
00073 
00075   typedef MetaDataDictionary                   DictionaryType;
00076   typedef MetaDataDictionary *                 DictionaryRawPointer;
00077   typedef std::vector< DictionaryRawPointer >  DictionaryArrayType;
00078   typedef const DictionaryArrayType *          DictionaryArrayRawPointer;
00079 
00080   typedef  std::vector<std::string>            FileNamesContainer;
00081 
00084   void SetFileNames (const FileNamesContainer &name)
00085     {
00086     if ( m_FileNames != name)
00087       {
00088       m_FileNames = name;
00089       this->Modified();
00090       }
00091     }
00092   const FileNamesContainer & GetFileNames() const
00093     {
00094     return m_FileNames;
00095     }
00097 
00100   void SetFileName (std::string const &name)
00101     {
00102     m_FileNames.clear();
00103     m_FileNames.push_back(name);
00104     this->Modified();
00105     }
00107 
00110   void AddFileName (std::string const &name)
00111     {
00112     m_FileNames.push_back(name);
00113     this->Modified();
00114     }
00116 
00119   itkSetMacro(ReverseOrder,bool);
00120   itkGetConstMacro(ReverseOrder,bool);
00121   itkBooleanMacro(ReverseOrder);
00123 
00128   itkSetObjectMacro(ImageIO,ImageIOBase);
00129   itkGetObjectMacro(ImageIO,ImageIOBase);
00131 
00134   virtual void GenerateOutputInformation(void);
00135 
00141   virtual void EnlargeOutputRequestedRegion(DataObject *output);
00142 
00144   DictionaryArrayRawPointer GetMetaDataDictionaryArray() const;
00145 
00147   itkSetMacro(UseStreaming,bool);
00148   itkGetConstReferenceMacro(UseStreaming,bool);
00149   itkBooleanMacro(UseStreaming);
00151 
00152 protected:
00153   ImageSeriesReader() : m_ImageIO(0), m_ReverseOrder(false), m_UseStreaming(true) {};
00154   ~ImageSeriesReader();
00155   void PrintSelf(std::ostream& os, Indent indent) const;
00156   
00158   virtual void GenerateData();
00159 
00161   ImageIOBase::Pointer m_ImageIO;
00162 
00164   bool m_ReverseOrder;
00165 
00167   FileNamesContainer m_FileNames;
00168 
00174   int m_NumberOfDimensionsInImage;
00175 
00178   DictionaryArrayType m_MetaDataDictionaryArray;
00179 
00180   bool m_UseStreaming;
00181 
00182 private:
00183   ImageSeriesReader(const Self&); //purposely not implemented
00184   void operator=(const Self&); //purposely not implemented
00185 
00186   typedef ImageFileReader<TOutputImage> ReaderType;
00187 
00188   int ComputeMovingDimensionIndex( ReaderType * reader );
00189 };
00190 
00191 } //namespace ITK
00192 
00193 #ifndef ITK_MANUAL_INSTANTIATION
00194 #include "itkImageSeriesReader.txx"
00195 #endif
00196 
00197 #endif // __itkImageSeriesReader_h
00198 

Generated at Tue Sep 15 03:28:42 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000