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
00028
namespace itk
00029 {
00030
00045
template <
class TOutputImage>
00046 class ITK_EXPORT ImageSeriesReader :
public ImageSource<TOutputImage>
00047 {
00048
public:
00050 typedef ImageSeriesReader
Self;
00051 typedef ImageSource<TOutputImage> Superclass;
00052 typedef SmartPointer<Self> Pointer;
00053
00055
itkNewMacro(
Self);
00056
00058
itkTypeMacro(ImageSeriesReader,
ImageSource);
00059
00061 typedef typename TOutputImage::SizeType
SizeType;
00062
00064 typedef typename TOutputImage::RegionType
ImageRegionType;
00065
00067 typedef typename TOutputImage::PixelType
OutputImagePixelType;
00068
00071 void SetFileNames (
const std::vector<std::string> &name)
00072 {
00073
if ( m_FileNames != name)
00074 {
00075 m_FileNames = name;
00076 this->Modified();
00077 }
00078 };
00079 const std::vector<std::string> & GetFileNames()
00080 {
00081
return m_FileNames;
00082 }
00083
00086
void SetFileName (std::string &name)
00087 {
00088 m_FileNames.clear();
00089 m_FileNames.push_back(name);
00090 }
00091
00094
void AddFileName (std::string &name)
00095 {
00096 m_FileNames.push_back(name);
00097 }
00098
00101
itkSetMacro(ReverseOrder,
bool);
00102
itkGetMacro(ReverseOrder,
bool);
00103
itkBooleanMacro(ReverseOrder);
00104
00109
itkSetObjectMacro(ImageIO,
ImageIOBase);
00110
itkGetObjectMacro(ImageIO,
ImageIOBase);
00111
00114
virtual void GenerateOutputInformation(
void);
00115
00121
virtual void EnlargeOutputRequestedRegion(
DataObject *output);
00122
00123
protected:
00124 ImageSeriesReader() : m_ImageIO(0), m_ReverseOrder(false) {};
00125
void PrintSelf(std::ostream& os, Indent indent)
const;
00126
00128 virtual void GenerateData();
00129
00131
ImageIOBase::Pointer m_ImageIO;
00132
00134
bool m_ReverseOrder;
00135
00137 std::vector<std::string> m_FileNames;
00138
00141 int m_NumberOfDimensionsInImage;
00142
00143
private:
00144 ImageSeriesReader(
const Self&);
00145 void operator=(
const Self&);
00146 };
00147
00148 }
00149
00150
#ifndef ITK_MANUAL_INSTANTIATION
00151
#include "itkImageSeriesReader.txx"
00152
#endif
00153
00154
#endif // __itkImageSeriesReader_h
00155