#include <itkESMDemonsRegistrationFunction.h>
Fast implementation of the symmetric demons registration force.
This class provides a substantially faster implementation of the symmetric demons registration force. Speed is improved by keeping a deformed copy of the moving image for gradient evaluation.
Symmetric forces simply means using the mean of the gradient of the fixed image and the gradient of the warped moving image.
Note that this class also enables the use of fixed, mapped moving and warped moving images forces by using a call to SetUseGradientType. The WarpedMoving and MappedMoving gradients coincide wherever the displacement field is zero.
The moving image should not be saturated. We indeed use NumericTraits<MovingPixelType>::Max() as a special value.
This implementation was taken from the Insight Journal paper: https://doi.org/10.54294/ux2obj
Definition at line 86 of file itkESMDemonsRegistrationFunction.h.
Inheritance diagram for itk::ESMDemonsRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >:
Collaboration diagram for itk::ESMDemonsRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >:Classes | |
| struct | GlobalDataStruct |
Static Public Member Functions | |
| static Pointer | New () |
Static Public Member Functions inherited from itk::LightObject | |
| static void | BreakOnError () |
| static Pointer | New () |
Static Public Attributes | |
| static constexpr unsigned int | ImageDimension = Superclass::ImageDimension |
Static Public Attributes inherited from itk::FiniteDifferenceFunction< TDisplacementField > | |
| static constexpr unsigned int | ImageDimension |
| static constexpr unsigned int | ImageDimension |
Protected Types | |
| using | FixedImageNeighborhoodIteratorType = ConstNeighborhoodIterator<FixedImageType> |
Protected Member Functions | |
| ESMDemonsRegistrationFunction () | |
| void | PrintSelf (std::ostream &os, Indent indent) const override |
| ~ESMDemonsRegistrationFunction () override=default | |
Protected Member Functions inherited from itk::PDEDeformableRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField > | |
| PDEDeformableRegistrationFunction () | |
| void | PrintSelf (std::ostream &os, Indent indent) const override |
| ~PDEDeformableRegistrationFunction () override=default | |
Protected Member Functions inherited from itk::FiniteDifferenceFunction< TDisplacementField > | |
| FiniteDifferenceFunction () | |
| FiniteDifferenceFunction () | |
| ~FiniteDifferenceFunction () override=default | |
| ~FiniteDifferenceFunction () override=default | |
Protected Member Functions inherited from itk::LightObject | |
| virtual LightObject::Pointer | InternalClone () const |
| LightObject () | |
| virtual void | PrintHeader (std::ostream &os, Indent indent) const |
| virtual void | PrintTrailer (std::ostream &os, Indent indent) const |
| virtual | ~LightObject () |
Private Attributes | |
| double | m_DenominatorThreshold {} |
| DirectionType | m_FixedImageDirection {} |
| GradientCalculatorPointer | m_FixedImageGradientCalculator {} |
| PointType | m_FixedImageOrigin {} |
| SpacingType | m_FixedImageSpacing {} |
| double | m_IntensityDifferenceThreshold {} |
| MovingImageGradientCalculatorPointer | m_MappedMovingImageGradientCalculator {} |
| double | m_MaximumUpdateStepLength {} |
| double | m_Metric {} |
| std::mutex | m_MetricCalculationMutex {} |
| InterpolatorPointer | m_MovingImageInterpolator {} |
| WarperPointer | m_MovingImageWarper {} |
| MovingImageType * | m_MovingImageWarperOutput {} |
| double | m_Normalizer {} |
| SizeValueType | m_NumberOfPixelsProcessed {} |
| double | m_RMSChange {} |
| double | m_SumOfSquaredChange {} |
| double | m_SumOfSquaredDifference {} |
| TimeStepType | m_TimeStep {} |
| GradientEnum | m_UseGradientType {} |
Additional Inherited Members | |
Protected Attributes inherited from itk::PDEDeformableRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField > | |
| DisplacementFieldTypePointer | m_DisplacementField {} |
| double | m_Energy {} |
| FixedImagePointer | m_FixedImage {} |
| double | m_GradientStep {} |
| MovingImagePointer | m_MovingImage {} |
| bool | m_NormalizeGradient {} |
Protected Attributes inherited from itk::FiniteDifferenceFunction< TDisplacementField > | |
| RadiusType | m_Radius |
| RadiusType | m_Radius |
| PixelRealType | m_ScaleCoefficients [ImageDimension] |
| PixelRealType | m_ScaleCoefficients [ImageDimension] |
Protected Attributes inherited from itk::LightObject | |
| std::atomic< int > | m_ReferenceCount {} |
| using itk::ESMDemonsRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >::ConstPointer = SmartPointer<const Self> |
Definition at line 97 of file itkESMDemonsRegistrationFunction.h.
| using itk::ESMDemonsRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >::CoordinateType = double |
Interpolator type.
Definition at line 133 of file itkESMDemonsRegistrationFunction.h.
| using itk::ESMDemonsRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >::CovariantVectorType = CovariantVector<double, Self::ImageDimension> |
Covariant vector type.
Definition at line 149 of file itkESMDemonsRegistrationFunction.h.
| using itk::ESMDemonsRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >::DefaultInterpolatorType = LinearInterpolateImageFunction<MovingImageType, CoordinateType> |
Definition at line 141 of file itkESMDemonsRegistrationFunction.h.
| using itk::ESMDemonsRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >::DirectionType = typename FixedImageType::DirectionType |
Definition at line 116 of file itkESMDemonsRegistrationFunction.h.
| using itk::PDEDeformableRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >::DisplacementFieldType |
Deformation field type.
Definition at line 64 of file itkPDEDeformableRegistrationFunction.h.
| using itk::PDEDeformableRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >::DisplacementFieldTypePointer |
Definition at line 65 of file itkPDEDeformableRegistrationFunction.h.
|
protected |
FixedImage image neighborhood iterator type.
Definition at line 278 of file itkESMDemonsRegistrationFunction.h.
| using itk::PDEDeformableRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >::FixedImagePointer |
Definition at line 61 of file itkPDEDeformableRegistrationFunction.h.
| using itk::PDEDeformableRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >::FixedImageType |
FixedImage image type.
Definition at line 60 of file itkPDEDeformableRegistrationFunction.h.
| using itk::ESMDemonsRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >::GradientCalculatorPointer = typename GradientCalculatorType::Pointer |
Definition at line 153 of file itkESMDemonsRegistrationFunction.h.
| using itk::ESMDemonsRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >::GradientCalculatorType = CentralDifferenceImageFunction<FixedImageType> |
Fixed image gradient calculator type.
Definition at line 152 of file itkESMDemonsRegistrationFunction.h.
| using itk::ESMDemonsRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >::GradientEnum = ESMDemonsRegistrationFunctionEnums::Gradient |
Definition at line 248 of file itkESMDemonsRegistrationFunction.h.
| using itk::ESMDemonsRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >::IndexType = typename FixedImageType::IndexType |
Definition at line 113 of file itkESMDemonsRegistrationFunction.h.
| using itk::ESMDemonsRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >::InterpolatorPointer = typename InterpolatorType::Pointer |
Definition at line 139 of file itkESMDemonsRegistrationFunction.h.
| using itk::ESMDemonsRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >::InterpolatorType = InterpolateImageFunction<MovingImageType, CoordinateType> |
Definition at line 138 of file itkESMDemonsRegistrationFunction.h.
| using itk::ESMDemonsRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >::MovingImageGradientCalculatorPointer = typename MovingImageGradientCalculatorType::Pointer |
Definition at line 157 of file itkESMDemonsRegistrationFunction.h.
| using itk::ESMDemonsRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >::MovingImageGradientCalculatorType = CentralDifferenceImageFunction<MovingImageType, CoordinateType> |
Moving image gradient (unwarped) calculator type.
Definition at line 156 of file itkESMDemonsRegistrationFunction.h.
| using itk::PDEDeformableRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >::MovingImagePointer |
Definition at line 57 of file itkPDEDeformableRegistrationFunction.h.
| using itk::PDEDeformableRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >::MovingImageType |
MovingImage image type.
Definition at line 56 of file itkPDEDeformableRegistrationFunction.h.
| using itk::ESMDemonsRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >::MovingPixelType = typename MovingImageType::PixelType |
Definition at line 108 of file itkESMDemonsRegistrationFunction.h.
| using itk::ESMDemonsRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >::Pointer = SmartPointer<Self> |
Definition at line 96 of file itkESMDemonsRegistrationFunction.h.
| using itk::ESMDemonsRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >::PointType = typename InterpolatorType::PointType |
Definition at line 140 of file itkESMDemonsRegistrationFunction.h.
| using itk::ESMDemonsRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >::Self = ESMDemonsRegistrationFunction |
Standard class type aliases.
Definition at line 93 of file itkESMDemonsRegistrationFunction.h.
| using itk::ESMDemonsRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >::SizeType = typename FixedImageType::SizeType |
Definition at line 114 of file itkESMDemonsRegistrationFunction.h.
| using itk::ESMDemonsRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >::SpacingType = typename FixedImageType::SpacingType |
Definition at line 115 of file itkESMDemonsRegistrationFunction.h.
| using itk::ESMDemonsRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >::Superclass = PDEDeformableRegistrationFunction<TFixedImage, TMovingImage, TDisplacementField> |
Definition at line 94 of file itkESMDemonsRegistrationFunction.h.
| using itk::ESMDemonsRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >::WarperPointer = typename WarperType::Pointer |
Definition at line 146 of file itkESMDemonsRegistrationFunction.h.
| using itk::ESMDemonsRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >::WarperType = WarpImageFilter<MovingImageType, MovingImageType, DisplacementFieldType> |
Warper type
Definition at line 144 of file itkESMDemonsRegistrationFunction.h.
|
protected |
|
overrideprotecteddefault |
|
inlineoverridevirtual |
This class uses a constant timestep of 1.
Implements itk::FiniteDifferenceFunction< TDisplacementField >.
Definition at line 176 of file itkESMDemonsRegistrationFunction.h.
|
overridevirtual |
Compute update at a non-boundary neighbourhood. Called by a finite difference solver image filter at each pixel that does not lie on a data set boundary.
Implements itk::FiniteDifferenceFunction< TDisplacementField >.
|
virtual |
Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.
Reimplemented from itk::LightObject.
|
inlineoverridevirtual |
Return a pointer to a global data structure that is passed to this object from the solver at each calculation.
Implements itk::FiniteDifferenceFunction< TDisplacementField >.
Definition at line 184 of file itkESMDemonsRegistrationFunction.h.
|
virtual |
|
inlinevirtual |
Definition at line 243 of file itkESMDemonsRegistrationFunction.h.
|
inlinevirtual |
Get the metric value. The metric value is the mean square difference in intensity between the fixed image and transforming moving image computed over the overlapping region between the two images.
Definition at line 211 of file itkESMDemonsRegistrationFunction.h.
|
inline |
Get the moving image interpolator.
Definition at line 169 of file itkESMDemonsRegistrationFunction.h.
|
virtual |
Reimplemented from itk::PDEDeformableRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >.
|
inlinevirtual |
Get the rms change in deformation field.
Definition at line 218 of file itkESMDemonsRegistrationFunction.h.
|
inlinevirtual |
Set/Get the type of used image forces
Definition at line 265 of file itkESMDemonsRegistrationFunction.h.
|
overridevirtual |
Set the object's state before each iteration.
Reimplemented from itk::FiniteDifferenceFunction< TDisplacementField >.
|
static |
Method for creation through the object factory.
|
overrideprotectedvirtual |
Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from itk::LightObject.
|
overridevirtual |
Update the metric and release memory for the per-thread-global data structure.
Implements itk::FiniteDifferenceFunction< TDisplacementField >.
|
virtual |
Set/Get the threshold below which the absolute difference of intensity yields a match. When the intensities match between a moving and fixed image pixel, the update vector (for that iteration) will be the zero vector. Default is 0.001.
|
inlinevirtual |
Set/Get the maximum update step length. In Thirion this is 0.5. Setting it to 0 implies no restriction (beware of numerical instability in this case.
Definition at line 237 of file itkESMDemonsRegistrationFunction.h.
|
inline |
Set the moving image interpolator.
Definition at line 161 of file itkESMDemonsRegistrationFunction.h.
|
inlinevirtual |
Set/Get the type of used image forces
Definition at line 260 of file itkESMDemonsRegistrationFunction.h.
|
staticconstexpr |
Inherit some enums from the superclass.
Definition at line 123 of file itkESMDemonsRegistrationFunction.h.
|
private |
Threshold below which the denominator term is considered zero.
Definition at line 316 of file itkESMDemonsRegistrationFunction.h.
|
private |
Definition at line 293 of file itkESMDemonsRegistrationFunction.h.
|
private |
Function to compute derivatives of the fixed image.
Definition at line 297 of file itkESMDemonsRegistrationFunction.h.
|
private |
Cache fixed image information.
Definition at line 291 of file itkESMDemonsRegistrationFunction.h.
|
private |
Definition at line 292 of file itkESMDemonsRegistrationFunction.h.
|
private |
Threshold below which two intensity value are assumed to match.
Definition at line 319 of file itkESMDemonsRegistrationFunction.h.
|
private |
Function to compute derivatives of the moving image (unwarped).
Definition at line 300 of file itkESMDemonsRegistrationFunction.h.
|
private |
Maximum update step length in pixels (default is 0.5 as in Thirion).
Definition at line 322 of file itkESMDemonsRegistrationFunction.h.
|
mutableprivate |
The metric value is the mean square difference in intensity between the fixed image and transforming moving image computed over the the overlapping region between the two images.
Definition at line 327 of file itkESMDemonsRegistrationFunction.h.
|
mutableprivate |
Mutex lock to protect modification to metric.
Definition at line 334 of file itkESMDemonsRegistrationFunction.h.
|
private |
Function to interpolate the moving image.
Definition at line 305 of file itkESMDemonsRegistrationFunction.h.
|
private |
Filter to warp moving image for fast gradient computation.
Definition at line 308 of file itkESMDemonsRegistrationFunction.h.
|
private |
Definition at line 310 of file itkESMDemonsRegistrationFunction.h.
|
private |
Definition at line 294 of file itkESMDemonsRegistrationFunction.h.
|
mutableprivate |
Definition at line 329 of file itkESMDemonsRegistrationFunction.h.
|
mutableprivate |
Definition at line 330 of file itkESMDemonsRegistrationFunction.h.
|
mutableprivate |
Definition at line 331 of file itkESMDemonsRegistrationFunction.h.
|
mutableprivate |
Definition at line 328 of file itkESMDemonsRegistrationFunction.h.
|
private |
The global timestep.
Definition at line 313 of file itkESMDemonsRegistrationFunction.h.
|
private |
Definition at line 302 of file itkESMDemonsRegistrationFunction.h.