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-04-25 12:25:42 $
00007   Version:   $Revision: 1.16 $
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::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&); //purposely not implemented
00180   void operator=(const Self&); //purposely not implemented
00181 };
00182 
00183 } //namespace ITK
00184 
00185 #ifndef ITK_MANUAL_INSTANTIATION
00186 #include "itkImageSeriesReader.txx"
00187 #endif
00188 
00189 #endif // __itkImageSeriesReader_h
00190 

Generated at Thu May 28 10:25:37 2009 for ITK by doxygen 1.5.5 written by Dimitri van Heesch, © 1997-2000