00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkWarpVectorImageFilter_h
00018 #define __itkWarpVectorImageFilter_h
00019
00020 #include "itkImageToImageFilter.h"
00021 #include "itkVectorInterpolateImageFunction.h"
00022 #include "itkVectorLinearInterpolateImageFunction.h"
00023 #include "itkPoint.h"
00024 #include "itkFixedArray.h"
00025
00026 namespace itk
00027 {
00028
00082 template <
00083 class TInputImage,
00084 class TOutputImage,
00085 class TDeformationField
00086 >
00087 class ITK_EXPORT WarpVectorImageFilter :
00088 public ImageToImageFilter<TInputImage, TOutputImage>
00089 {
00090 public:
00092 typedef WarpVectorImageFilter Self;
00093 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00094 typedef SmartPointer<Self> Pointer;
00095 typedef SmartPointer<const Self> ConstPointer;
00096
00098 itkNewMacro(Self);
00099
00101 itkTypeMacro( WarpVectorImageFilter, ImageToImageFilter );
00102
00104 typedef typename TOutputImage::RegionType OutputImageRegionType;
00105
00107 typedef typename Superclass::InputImageType InputImageType;
00108 typedef typename Superclass::InputImagePointer InputImagePointer;
00109 typedef typename Superclass::OutputImageType OutputImageType;
00110 typedef typename Superclass::OutputImagePointer OutputImagePointer;
00111 typedef typename Superclass::InputImageConstPointer InputImageConstPointer;
00112 typedef typename OutputImageType::IndexType IndexType;
00113 typedef typename OutputImageType::SizeType SizeType;
00114 typedef typename OutputImageType::PixelType PixelType;
00115 typedef typename OutputImageType::SpacingType SpacingType;
00116 typedef typename OutputImageType::PixelType::ValueType ValueType;
00117
00119 itkStaticConstMacro(ImageDimension, unsigned int,
00120 TOutputImage::ImageDimension );
00121
00123 itkStaticConstMacro(PixelDimension, unsigned int,
00124 PixelType::Dimension );
00125
00127 typedef TDeformationField DeformationFieldType;
00128 typedef typename DeformationFieldType::Pointer DeformationFieldPointer;
00129 typedef typename DeformationFieldType::PixelType DisplacementType;
00130
00132 typedef double CoordRepType;
00133 typedef VectorInterpolateImageFunction<InputImageType,CoordRepType> InterpolatorType;
00134 typedef typename InterpolatorType::Pointer InterpolatorPointer;
00135 typedef VectorLinearInterpolateImageFunction<InputImageType,CoordRepType>
00136 DefaultInterpolatorType;
00137
00139 typedef Point<CoordRepType,itkGetStaticConstMacro(ImageDimension)> PointType;
00140
00142 void SetDeformationField( DeformationFieldType * field );
00143
00145 DeformationFieldType * GetDeformationField(void);
00146
00148 itkSetObjectMacro( Interpolator, InterpolatorType );
00149
00151 itkGetObjectMacro( Interpolator, InterpolatorType );
00152
00154 itkSetMacro(OutputSpacing, SpacingType);
00155 virtual void SetOutputSpacing( const double* values);
00157
00159 itkGetConstReferenceMacro(OutputSpacing, SpacingType);
00160
00162 itkSetMacro(OutputOrigin, PointType);
00163 virtual void SetOutputOrigin( const double* values);
00165
00167 itkGetConstReferenceMacro(OutputOrigin, PointType);
00168
00170 itkSetMacro( EdgePaddingValue, PixelType );
00171
00173 itkGetMacro( EdgePaddingValue, PixelType );
00174
00180 virtual void GenerateOutputInformation();
00181
00188 virtual void GenerateInputRequestedRegion();
00189
00192 virtual void BeforeThreadedGenerateData();
00193
00194 #ifdef ITK_USE_CONCEPT_CHECKING
00195
00196 itkConceptMacro(InputHasNumericTraitsCheck,
00197 (Concept::HasNumericTraits<typename TInputImage::PixelType::ValueType>));
00198 itkConceptMacro(OutputHasNumericTraitsCheck,
00199 (Concept::HasNumericTraits<ValueType>));
00200 itkConceptMacro(DeformationFieldHasNumericTraitsCheck,
00201 (Concept::HasNumericTraits<typename TDeformationField::PixelType::ValueType>));
00202
00204 #endif
00205
00206 protected:
00207 WarpVectorImageFilter();
00208 ~WarpVectorImageFilter() {};
00209 void PrintSelf(std::ostream& os, Indent indent) const;
00210
00214 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00215 int threadId );
00216
00217 private:
00218 WarpVectorImageFilter(const Self&);
00219 void operator=(const Self&);
00220
00221 PixelType m_EdgePaddingValue;
00222 SpacingType m_OutputSpacing;
00223 PointType m_OutputOrigin;
00224
00225 InterpolatorPointer m_Interpolator;
00226
00227 };
00228
00229 }
00230
00231 #ifndef ITK_MANUAL_INSTANTIATION
00232 #include "itkWarpVectorImageFilter.txx"
00233 #endif
00234
00235 #endif
00236