00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkDeformationFieldSource_h
00018 #define __itkDeformationFieldSource_h
00019
00020 #include "itkImageSource.h"
00021 #include "itkKernelTransform.h"
00022 #include "itkImageRegionIteratorWithIndex.h"
00023
00024 namespace itk
00025 {
00026
00047 template <class TOutputImage>
00048 class ITK_EXPORT DeformationFieldSource:
00049 public ImageSource<TOutputImage>
00050 {
00051 public:
00053 typedef DeformationFieldSource Self;
00054 typedef ImageSource<TOutputImage> Superclass;
00055 typedef SmartPointer<Self> Pointer;
00056 typedef SmartPointer<const Self> ConstPointer;
00057
00058 typedef TOutputImage OutputImageType;
00059 typedef typename OutputImageType::Pointer OutputImagePointer;
00060 typedef typename OutputImageType::RegionType OutputImageRegionType;
00061
00063 itkNewMacro(Self);
00064
00066 itkTypeMacro(DeformationFieldSource, ImageToImageFilter);
00067
00069 itkStaticConstMacro(ImageDimension, unsigned int,
00070 TOutputImage::ImageDimension);
00071
00076 typedef KernelTransform<double, itkGetStaticConstMacro(ImageDimension)> KernelTransformType;
00077 typedef typename KernelTransformType::PointSetType LandmarkPointSetType;
00078 typedef typename LandmarkPointSetType::PointType LandmarkPointType;
00079 typedef typename KernelTransformType::Pointer KernelTransformPointerType;
00080 typedef typename KernelTransformType::PointsContainer LandmarkContainer;
00081 typedef typename LandmarkContainer::ConstPointer LandmarkContainerPointer;
00082
00083
00085 typedef typename OutputImageType::SizeType OutputSizeType;
00086
00088 typedef typename OutputImageType::IndexType OutputIndexType;
00089
00091 typedef typename TOutputImage::PixelType OutputPixelType;
00092 typedef typename OutputPixelType::ValueType OutputPixelComponentType;
00093
00095 typedef typename TOutputImage::SpacingType SpacingType;
00096 typedef typename TOutputImage::PointType OriginPointType;
00097
00101 itkSetObjectMacro( KernelTransform, KernelTransformType );
00102
00104 itkGetObjectMacro( KernelTransform, KernelTransformType );
00105
00107 itkSetMacro( OutputRegion, OutputImageRegionType );
00108
00110 itkGetConstReferenceMacro( OutputRegion, OutputImageRegionType );
00111
00113 itkSetMacro(OutputSpacing, SpacingType);
00114 virtual void SetOutputSpacing( const double* values);
00115
00117 itkGetConstReferenceMacro( OutputSpacing, SpacingType );
00118
00120 itkSetMacro(OutputOrigin, OriginPointType);
00121 virtual void SetOutputOrigin( const double* values);
00122
00124 itkGetConstReferenceMacro( OutputOrigin, OriginPointType );
00125
00127 itkSetConstObjectMacro( SourceLandmarks, LandmarkContainer );
00128 itkSetConstObjectMacro( TargetLandmarks, LandmarkContainer );
00129
00135 virtual void GenerateOutputInformation();
00136
00137
00139 unsigned long GetMTime( void ) const;
00140
00141 protected:
00142 DeformationFieldSource();
00143 ~DeformationFieldSource() {};
00144 void PrintSelf(std::ostream& os, Indent indent) const;
00145
00150 void GenerateData();
00151
00155 void PrepareKernelBaseSpline();
00156
00157 private:
00158 DeformationFieldSource(const Self&);
00159 void operator=(const Self&);
00160
00161 KernelTransformPointerType m_KernelTransform;
00162
00163 OutputImageRegionType m_OutputRegion;
00164 SpacingType m_OutputSpacing;
00165 OriginPointType m_OutputOrigin;
00166
00167 LandmarkContainerPointer m_SourceLandmarks;
00168 LandmarkContainerPointer m_TargetLandmarks;
00169
00170 };
00171
00172
00173 }
00174
00175 #ifndef ITK_MANUAL_INSTANTIATION
00176 #include "itkDeformationFieldSource.txx"
00177 #endif
00178
00179 #endif