Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __itkSliceBySliceImageFilter_h
00019 #define __itkSliceBySliceImageFilter_h
00020
00021 #include "itkImageToImageFilter.h"
00022
00023
00024 namespace itk {
00025
00072 template<class TInputImage,
00073 class TOutputImage,
00074 class TInputFilter=ImageToImageFilter<
00075 Image< ITK_TYPENAME TInputImage::PixelType, ::itk::GetImageDimension<TInputImage >::ImageDimension - 1 >,
00076 Image< ITK_TYPENAME TOutputImage::PixelType, ::itk::GetImageDimension<TOutputImage>::ImageDimension - 1 > >,
00077 class TOutputFilter=ITK_TYPENAME TInputFilter::Superclass,
00078 class TInternalInputImage=ITK_TYPENAME TInputFilter::InputImageType,
00079 class TInternalOutputImage=ITK_TYPENAME TOutputFilter::OutputImageType >
00080 class ITK_EXPORT SliceBySliceImageFilter :
00081 public ImageToImageFilter<TInputImage, TOutputImage>
00082 {
00083 public:
00085 typedef SliceBySliceImageFilter Self;
00086 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00087 typedef SmartPointer<Self> Pointer;
00088 typedef SmartPointer<const Self> ConstPointer;
00089
00091 typedef typename Superclass::InputImagePointer InputImagePointer;
00092
00094 itkNewMacro(Self);
00095
00097 itkTypeMacro(SliceBySliceImageFilter, ImageToImageFilter);
00098
00100 typedef TInputImage InputImageType;
00101 typedef typename TInputImage::RegionType RegionType;
00102 typedef typename TInputImage::SizeType SizeType;
00103 typedef typename TInputImage::IndexType IndexType;
00104 typedef typename TInputImage::PixelType PixelType;
00105 typedef typename TInputImage::OffsetType OffsetType;
00106
00107 typedef TOutputImage OutputImageType;
00108 typedef typename TOutputImage::PixelType OutputPixelType;
00109
00110 typedef TInputFilter InputFilterType;
00111 typedef TOutputFilter OutputFilterType;
00112
00113 typedef TInternalInputImage InternalInputImageType;
00114 typedef typename InternalInputImageType::RegionType InternalRegionType;
00115 typedef typename InternalInputImageType::SizeType InternalSizeType;
00116 typedef typename InternalInputImageType::IndexType InternalIndexType;
00117 typedef typename InternalInputImageType::OffsetType InternalOffsetType;
00118 typedef typename InternalInputImageType::PixelType InternalInputPixelType;
00119
00120 typedef TInternalOutputImage InternalOutputImageType;
00121 typedef typename InternalOutputImageType::PixelType InternalOutputPixelType;
00122
00124 itkStaticConstMacro(ImageDimension, unsigned int,
00125 TInputImage::ImageDimension);
00126
00127 itkStaticConstMacro(InternalImageDimension, unsigned int,
00128 InternalInputImageType::ImageDimension);
00129
00130 itkSetMacro(Dimension, unsigned int);
00131 itkGetConstMacro(Dimension, unsigned int);
00132
00133 void SetFilter(InputFilterType * filter);
00134 InputFilterType * GetFilter()
00135 {
00136 return this->m_InputFilter;
00137 }
00138
00139 const InputFilterType * GetFilter() const
00140 {
00141 return this->m_InputFilter;
00142 }
00143
00144 void SetInputFilter( InputFilterType * filter );
00145 itkGetObjectMacro( InputFilter, InputFilterType );
00146
00147 void SetOutputFilter( OutputFilterType * filter );
00148 itkGetObjectMacro( OutputFilter, OutputFilterType );
00149
00154 itkGetConstMacro(SliceIndex, long);
00155
00156 protected:
00157 SliceBySliceImageFilter();
00158 ~SliceBySliceImageFilter() {};
00159
00160 void GenerateData();
00161
00162 void PrintSelf(std::ostream& os, Indent indent) const;
00163
00164 void GenerateInputRequestedRegion();
00165 void EnlargeOutputRequestedRegion(DataObject *itkNotUsed(output));
00166
00167 private:
00168 SliceBySliceImageFilter(const Self&);
00169 void operator=(const Self&);
00170
00171 unsigned int m_Dimension;
00172 typename InputFilterType::Pointer m_InputFilter;
00173 typename OutputFilterType::Pointer m_OutputFilter;
00174 long m_SliceIndex;
00175 };
00176
00177 }
00178
00179 #ifndef ITK_MANUAL_INSTANTIATION
00180 #include "itkSliceBySliceImageFilter.txx"
00181 #endif
00182
00183 #endif
00184