00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkVectorExpandImageFilter_h
00018 #define __itkVectorExpandImageFilter_h
00019
00020 #include "itkImageToImageFilter.h"
00021 #include "itkVectorInterpolateImageFunction.h"
00022 #include "itkVectorLinearInterpolateImageFunction.h"
00023
00024 namespace itk
00025 {
00026
00076 template <
00077 class TInputImage,
00078 class TOutputImage
00079 >
00080 class ITK_EXPORT VectorExpandImageFilter:
00081 public ImageToImageFilter<TInputImage,TOutputImage>
00082 {
00083 public:
00085 typedef VectorExpandImageFilter Self;
00086 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00087 typedef SmartPointer<Self> Pointer;
00088 typedef SmartPointer<const Self> ConstPointer;
00089
00091 itkNewMacro(Self);
00092
00094 typedef typename TInputImage::Pointer InputImagePointer;
00095 typedef typename TOutputImage::Pointer OutputImagePointer;
00096 typedef typename TOutputImage::RegionType OutputImageRegionType;
00097
00099 itkTypeMacro(VectorExpandImageFilter, ImageToImageFilter);
00100
00102 itkStaticConstMacro(ImageDimension, unsigned int,
00103 TInputImage::ImageDimension);
00104
00106 typedef typename Superclass::InputImageType InputImageType;
00107 typedef typename Superclass::OutputImageType OutputImageType;
00108
00110 typedef typename OutputImageType::PixelType OutputPixelType;
00111 typedef typename OutputPixelType::ValueType OutputValueType;
00112 typedef typename InputImageType::PixelType InputPixelType;
00113 typedef typename InputPixelType::ValueType InputValueType;
00114
00116 enum { VectorDimension = InputPixelType::Dimension };
00117
00119 typedef double CoordRepType;
00120 typedef VectorInterpolateImageFunction<InputImageType,CoordRepType>
00121 InterpolatorType;
00122 typedef typename InterpolatorType::Pointer InterpolatorPointer;
00123 typedef VectorLinearInterpolateImageFunction<InputImageType,CoordRepType>
00124 DefaultInterpolatorType;
00125
00127 itkSetObjectMacro( Interpolator, InterpolatorType );
00128
00130 itkGetObjectMacro( Interpolator, InterpolatorType );
00131
00134 virtual void SetExpandFactors( const unsigned int factors[] );
00135 virtual void SetExpandFactors( const unsigned int factor );
00136
00138 const unsigned int * GetExpandFactors() const
00139 { return m_ExpandFactors; }
00140
00142 virtual void SetEdgePaddingValue( const OutputPixelType& value );
00143
00145 virtual const OutputPixelType& GetEdgePaddingValue()
00146 { return m_EdgePaddingValue; }
00147
00154 virtual void GenerateOutputInformation();
00155
00161 virtual void GenerateInputRequestedRegion();
00162
00163 protected:
00164
00165 VectorExpandImageFilter();
00166 ~VectorExpandImageFilter() {};
00167 void PrintSelf(std::ostream& os, Indent indent) const;
00168
00177 virtual
00178 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00179 int threadId );
00180
00183 virtual void BeforeThreadedGenerateData();
00184
00185 private:
00186 VectorExpandImageFilter(const Self&);
00187 void operator=(const Self&);
00188
00189 unsigned int m_ExpandFactors[ImageDimension];
00190 InterpolatorPointer m_Interpolator;
00191 OutputPixelType m_EdgePaddingValue;
00192
00193 };
00194
00195 }
00196
00197 #ifndef ITK_MANUAL_INSTANTIATION
00198 #include "itkVectorExpandImageFilter.txx"
00199 #endif
00200
00201 #endif