Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef __itkCyclicBSplineDeformableTransform_h
00016 #define __itkCyclicBSplineDeformableTransform_h
00017
00018 #include "itkAdvancedTransform.h"
00019 #include "itkImage.h"
00020 #include "itkImageRegion.h"
00021 #include "itkBSplineInterpolationWeightFunction2.h"
00022 #include "itkBSplineInterpolationDerivativeWeightFunction.h"
00023 #include "itkBSplineInterpolationSecondOrderDerivativeWeightFunction.h"
00024 #include "itkAdvancedBSplineDeformableTransform.h"
00025 #include "itkCyclicBSplineDeformableTransform.h"
00026
00027 namespace itk
00028 {
00029
00037 template <
00038 class TScalarType = double,
00039 unsigned int NDimensions = 3,
00040 unsigned int VSplineOrder = 3 >
00041 class ITK_EXPORT CyclicBSplineDeformableTransform
00042 : public AdvancedBSplineDeformableTransform< TScalarType, NDimensions, VSplineOrder >
00043 {
00044 public:
00046 typedef CyclicBSplineDeformableTransform Self;
00047 typedef AdvancedBSplineDeformableTransform<
00048 TScalarType, NDimensions, VSplineOrder > Superclass;
00049 typedef SmartPointer<Self> Pointer;
00050 typedef SmartPointer<const Self> ConstPointer;
00051
00053 itkNewMacro( Self );
00054
00056 itkTypeMacro( CyclicBSplineDeformableTransform, AdvancedBSplineDeformableTransform );
00057
00059 itkStaticConstMacro( SpaceDimension, unsigned int, NDimensions );
00060
00062 itkStaticConstMacro( SplineOrder, unsigned int, VSplineOrder );
00063
00064 typedef typename Superclass::JacobianType JacobianType;
00065 typedef typename Superclass::SpatialJacobianType SpatialJacobianType;
00066 typedef typename Superclass
00067 ::NonZeroJacobianIndicesType NonZeroJacobianIndicesType;
00068 typedef typename Superclass
00069 ::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType;
00070 typedef typename Superclass::SpatialHessianType SpatialHessianType;
00071 typedef typename Superclass
00072 ::JacobianOfSpatialHessianType JacobianOfSpatialHessianType;
00073 typedef typename Superclass::InternalMatrixType InternalMatrixType;
00074 typedef typename Superclass::ParametersType ParametersType;
00075
00077 typedef typename ParametersType::ValueType PixelType;
00078 typedef Image< PixelType,
00079 itkGetStaticConstMacro( SpaceDimension )> ImageType;
00080 typedef typename ImageType::Pointer ImagePointer;
00081
00082 typedef typename Superclass::RegionType RegionType;
00083 typedef typename RegionType::IndexType IndexType;
00084 typedef typename RegionType::SizeType SizeType;
00085 typedef typename ImageType::SpacingType SpacingType;
00086 typedef typename ImageType::DirectionType DirectionType;
00087 typedef typename ImageType::PointType OriginType;
00088 typedef typename RegionType::IndexType GridOffsetType;
00089 typedef typename Superclass::InputPointType InputPointType;
00090 typedef typename Superclass::OutputPointType OutputPointType;
00091 typedef typename Superclass::WeightsType WeightsType;
00092 typedef typename Superclass::
00093 ParameterIndexArrayType ParameterIndexArrayType;
00094 typedef typename Superclass::
00095 ContinuousIndexType ContinuousIndexType;
00096 typedef typename Superclass::ScalarType ScalarType;
00097 typedef typename Superclass::
00098 JacobianImageType JacobianImageType;
00099 typedef typename Superclass::
00100 JacobianPixelType JacobianPixelType;
00101 typedef typename Superclass::
00102 WeightsFunctionType WeightsFunctionType;
00103 typedef BSplineInterpolationWeightFunction2< ScalarType,
00104 itkGetStaticConstMacro( SpaceDimension ) - 1,
00105 itkGetStaticConstMacro( SplineOrder ) > RedWeightsFunctionType;
00106 typedef typename RedWeightsFunctionType::
00107 ContinuousIndexType RedContinuousIndexType;
00108
00110 virtual void SetGridRegion( const RegionType& region );
00111
00119 virtual void TransformPoint(
00120 const InputPointType & inputPoint,
00121 OutputPointType & outputPoint,
00122 WeightsType & weights,
00123 ParameterIndexArrayType & indices,
00124 bool & inside ) const;
00125
00127 virtual const JacobianType & GetJacobian( const InputPointType & point ) const;
00128
00130 virtual void GetJacobian(
00131 const InputPointType & ipp,
00132 WeightsType & weights,
00133 ParameterIndexArrayType & indices ) const;
00134
00136 virtual void GetSpatialJacobian(
00137 const InputPointType & ipp,
00138 SpatialJacobianType & sj ) const;
00139
00140 protected:
00141 CyclicBSplineDeformableTransform();
00142 virtual ~CyclicBSplineDeformableTransform();
00143
00144 void ComputeNonZeroJacobianIndices(
00145 NonZeroJacobianIndicesType & nonZeroJacobianIndices,
00146 const RegionType & supportRegion ) const;
00147
00149 bool InsideValidRegion( const ContinuousIndexType & index ) const;
00150
00152 virtual void SplitRegion(
00153 const RegionType & imageRegion,
00154 const RegionType & inRegion,
00155 RegionType & outRegion1,
00156 RegionType & outRegion2) const;
00157
00158 private:
00159 CyclicBSplineDeformableTransform(const Self&);
00160 void operator=(const Self&);
00161
00162 };
00163
00164
00165 }
00166
00167
00168 #define ITK_TEMPLATE_CyclicBSplineDeformableTransform(_, EXPORT, x, y) namespace itk { \
00169 _(3(class EXPORT CyclicBSplineDeformableTransform< ITK_TEMPLATE_3 x >)) \
00170 namespace Templates { typedef CyclicBSplineDeformableTransform< ITK_TEMPLATE_3 x > \
00171 CyclicBSplineDeformableTransform##y; } \
00172 }
00173
00174 #if ITK_TEMPLATE_EXPLICIT
00175 # include "Templates/itkCyclicBSplineDeformableTransform+-.h"
00176 #endif
00177
00178 #if ITK_TEMPLATE_TXX
00179 # include "itkCyclicBSplineDeformableTransform.txx"
00180 #endif
00181
00182 #endif