00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkInverseDeformationFieldImageFilter_h
00018 #define __itkInverseDeformationFieldImageFilter_h
00019
00020 #include "itkImageToImageFilter.h"
00021 #include "itkKernelTransform.h"
00022 #include "itkImageRegionConstIteratorWithIndex.h"
00023
00024 namespace itk
00025 {
00026
00063 template <class TInputImage, class TOutputImage>
00064 class ITK_EXPORT InverseDeformationFieldImageFilter:
00065 public ImageToImageFilter<TInputImage, TOutputImage>
00066 {
00067 public:
00069 typedef InverseDeformationFieldImageFilter Self;
00070 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00071 typedef SmartPointer<Self> Pointer;
00072 typedef SmartPointer<const Self> ConstPointer;
00073 typedef TInputImage InputImageType;
00074 typedef TOutputImage OutputImageType;
00075 typedef typename InputImageType::Pointer InputImagePointer;
00076 typedef typename InputImageType::ConstPointer InputImageConstPointer;
00077 typedef typename InputImageType::RegionType InputImageRegionType;
00078 typedef typename OutputImageType::Pointer OutputImagePointer;
00079
00081 itkNewMacro(Self);
00082
00084 itkTypeMacro(InverseDeformationFieldImageFilter, ImageToImageFilter);
00085
00087 itkStaticConstMacro(ImageDimension, unsigned int,
00088 TOutputImage::ImageDimension);
00089
00094 typedef KernelTransform<double, itkGetStaticConstMacro(ImageDimension)> KernelTransformType;
00095 typedef typename KernelTransformType::Pointer KernelTransformPointerType;
00096
00098 typedef typename OutputImageType::SizeType SizeType;
00099
00101 typedef typename OutputImageType::IndexType IndexType;
00102
00104 typedef typename TOutputImage::PixelType OutputPixelType;
00105 typedef typename OutputPixelType::ValueType OutputPixelComponentType;
00106
00108 typedef typename TOutputImage::RegionType OutputImageRegionType;
00109
00111 typedef typename TOutputImage::SpacingType SpacingType;
00112 typedef typename TOutputImage::PointType OriginPointType;
00113
00117 itkSetObjectMacro( KernelTransform, KernelTransformType );
00118
00120 itkGetObjectMacro( KernelTransform, KernelTransformType );
00121
00123 itkSetMacro( Size, SizeType );
00124
00126 itkGetConstReferenceMacro( Size, SizeType );
00127
00129 itkSetMacro(OutputSpacing, SpacingType);
00130 virtual void SetOutputSpacing(const double* values);
00131
00133 itkGetConstReferenceMacro( OutputSpacing, SpacingType );
00134
00136 itkSetMacro(OutputOrigin, OriginPointType);
00137 virtual void SetOutputOrigin( const double* values);
00138
00140 itkGetConstReferenceMacro( OutputOrigin, OriginPointType );
00141
00147 itkSetMacro( SubsamplingFactor, unsigned int );
00148 itkGetMacro( SubsamplingFactor, unsigned int );
00149
00155 virtual void GenerateOutputInformation();
00156
00162 virtual void GenerateInputRequestedRegion();
00163
00165 unsigned long GetMTime( void ) const;
00166
00167 protected:
00168 InverseDeformationFieldImageFilter();
00169 ~InverseDeformationFieldImageFilter() {};
00170 void PrintSelf(std::ostream& os, Indent indent) const;
00171
00176 void GenerateData();
00177
00181 void PrepareKernelBaseSpline();
00182
00183 private:
00184 InverseDeformationFieldImageFilter(const Self&);
00185 void operator=(const Self&);
00186
00187 SizeType m_Size;
00188 KernelTransformPointerType m_KernelTransform;
00189 SpacingType m_OutputSpacing;
00190 OriginPointType m_OutputOrigin;
00191
00192 unsigned int m_SubsamplingFactor;
00193 };
00194
00195
00196 }
00197
00198 #ifndef ITK_MANUAL_INSTANTIATION
00199 #include "itkInverseDeformationFieldImageFilter.txx"
00200 #endif
00201
00202 #endif