00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkExpandImageFilter_h
00018 #define __itkExpandImageFilter_h
00019
00020 #include "itkImageToImageFilter.h"
00021 #include "itkInterpolateImageFunction.h"
00022 #include "itkLinearInterpolateImageFunction.h"
00023
00024 namespace itk
00025 {
00026
00071 template <class TInputImage, class TOutputImage>
00072 class ITK_EXPORT ExpandImageFilter:
00073 public ImageToImageFilter<TInputImage,TOutputImage>
00074 {
00075 public:
00077 typedef ExpandImageFilter Self;
00078 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00079 typedef SmartPointer<Self> Pointer;
00080 typedef SmartPointer<const Self> ConstPointer;
00081
00083 itkNewMacro(Self);
00084
00086 itkTypeMacro(ExpandImageFilter, ImageToImageFilter);
00087
00089 typedef typename TOutputImage::RegionType OutputImageRegionType;
00090
00092 itkStaticConstMacro(ImageDimension, unsigned int,
00093 TInputImage::ImageDimension);
00094
00096 typedef typename Superclass::InputImageType InputImageType;
00097 typedef typename Superclass::OutputImageType OutputImageType;
00098 typedef typename OutputImageType::PixelType OutputPixelType;
00099 typedef typename InputImageType::Pointer InputImagePointer;
00100 typedef typename OutputImageType::Pointer OutputImagePointer;
00101
00103 typedef double CoordRepType;
00104 typedef InterpolateImageFunction<InputImageType,CoordRepType>
00105 InterpolatorType;
00106 typedef typename InterpolatorType::Pointer InterpolatorPointer;
00107 typedef LinearInterpolateImageFunction<InputImageType,CoordRepType>
00108 DefaultInterpolatorType;
00109
00111 itkSetObjectMacro( Interpolator, InterpolatorType );
00112
00114 itkGetObjectMacro( Interpolator, InterpolatorType );
00115
00118 virtual void SetExpandFactors( const unsigned int factors[] );
00119 virtual void SetExpandFactors( const unsigned int factor );
00121
00123 virtual const unsigned int * GetExpandFactors() const
00124 { return m_ExpandFactors; }
00125
00127 itkSetMacro( EdgePaddingValue, OutputPixelType );
00128
00130 itkGetMacro( EdgePaddingValue, OutputPixelType );
00131
00138 virtual void GenerateOutputInformation();
00139
00145 virtual void GenerateInputRequestedRegion();
00146
00147 #ifdef ITK_USE_CONCEPT_CHECKING
00148
00149 itkConceptMacro(InputHasNumericTraitsCheck,
00150 (Concept::HasNumericTraits<typename TInputImage::PixelType>));
00151 itkConceptMacro(OutputHasNumericTraitsCheck,
00152 (Concept::HasNumericTraits<OutputPixelType>));
00153
00155 #endif
00156
00157 protected:
00158 ExpandImageFilter();
00159 ~ExpandImageFilter() {}
00160 void PrintSelf(std::ostream& os, Indent indent) const;
00161
00171 virtual
00172 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00173 int threadId );
00174
00177 virtual void BeforeThreadedGenerateData();
00178
00179 private:
00180 ExpandImageFilter(const Self&);
00181 void operator=(const Self&);
00182
00183 unsigned int m_ExpandFactors[ImageDimension];
00184 InterpolatorPointer m_Interpolator;
00185 OutputPixelType m_EdgePaddingValue;
00186
00187 };
00188
00189 }
00190
00191 #ifndef ITK_MANUAL_INSTANTIATION
00192 #include "itkExpandImageFilter.txx"
00193 #endif
00194
00195 #endif
00196