17 #ifndef __itkDemonsRegistrationFilter_txx
18 #define __itkDemonsRegistrationFilter_txx
27 template <
class TFixedImage,
class TMovingImage,
class TDeformationField>
33 drfp = DemonsRegistrationFunctionType::New();
35 this->SetDifferenceFunction( static_cast<FiniteDifferenceFunctionType *>(
38 m_UseMovingImageGradient =
false;
43 template <
class TFixedImage,
class TMovingImage,
class TDeformationField>
48 Superclass::PrintSelf( os, indent );
49 os << indent <<
"UseMovingImageGradient: ";
50 os << m_UseMovingImageGradient << std::endl;
51 os << indent <<
"Intensity difference threshold: " <<
52 this->GetIntensityDifferenceThreshold() << std::endl;
59 template <
class TFixedImage,
class TMovingImage,
class TDeformationField>
66 Superclass::InitializeIteration();
71 (this->GetDifferenceFunction().GetPointer());
76 "Could not cast difference function to DemonsRegistrationFunction" );
85 if ( this->GetSmoothDeformationField() )
87 this->SmoothDeformationField();
96 template <
class TFixedImage,
class TMovingImage,
class TDeformationField>
104 (this->GetDifferenceFunction().GetPointer());
108 itkExceptionMacro( <<
109 "Could not cast difference function to DemonsRegistrationFunction" );
120 template <
class TFixedImage,
class TMovingImage,
class TDeformationField>
128 (this->GetDifferenceFunction().GetPointer());
132 itkExceptionMacro( <<
133 "Could not cast difference function to DemonsRegistrationFunction" );
143 template <
class TFixedImage,
class TMovingImage,
class TDeformationField>
151 (this->GetDifferenceFunction().GetPointer());
155 itkExceptionMacro( <<
156 "Could not cast difference function to DemonsRegistrationFunction" );
166 template <
class TFixedImage,
class TMovingImage,
class TDeformationField>
173 if ( this->GetSmoothUpdateField() )
175 this->SmoothUpdateField();
178 this->Superclass::ApplyUpdate(dt);
182 (this->GetDifferenceFunction().GetPointer());
186 itkExceptionMacro( <<
187 "Could not cast difference function to DemonsRegistrationFunction" );