Skip to content

Commit

Permalink
STYLE: Let Compute...Distribution use their own template parameters
Browse files Browse the repository at this point in the history
Follow-up to commit 944c341 "STYLE: Let `ComputeJacobianTerms` use its own template parameters".
  • Loading branch information
N-Dekker committed Dec 6, 2024
1 parent aef7faa commit 9149c79
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions Common/itkComputeDisplacementDistribution.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ class ITK_TEMPLATE_EXPORT ComputeDisplacementDistribution : public ScaledSingleV

/** typedef */
using FixedImageType = TFixedImage;
using FixedImagePixelType = typename FixedImageType::PixelType;
using FixedImagePixelType = typename TFixedImage::PixelType;
using TransformType = TTransform;
using TransformPointer = typename TransformType::Pointer;
using FixedImageRegionType = typename FixedImageType::RegionType;
using TransformPointer = typename TTransform::Pointer;
using FixedImageRegionType = typename TFixedImage::RegionType;
using Superclass::ParametersType;
using Superclass::DerivativeType;
using Superclass::ScalesType;
Expand All @@ -79,13 +79,13 @@ class ITK_TEMPLATE_EXPORT ComputeDisplacementDistribution : public ScaledSingleV
using FixedImageMaskType = ImageMaskSpatialObject<Self::FixedImageDimension>;
using FixedImageMaskPointer = typename FixedImageMaskType::Pointer;
using FixedImageMaskConstPointer = typename FixedImageMaskType::ConstPointer;
using NonZeroJacobianIndicesType = typename TransformType::NonZeroJacobianIndicesType;
using NonZeroJacobianIndicesType = typename TTransform::NonZeroJacobianIndicesType;

/** Set the fixed image. */
itkSetConstObjectMacro(FixedImage, FixedImageType);
itkSetConstObjectMacro(FixedImage, TFixedImage);

/** Set the transform. */
itkSetObjectMacro(Transform, TransformType);
itkSetObjectMacro(Transform, TTransform);

/** Set/Get the fixed image mask. */
itkSetObjectMacro(FixedImageMask, FixedImageMaskType);
Expand Down Expand Up @@ -138,7 +138,7 @@ class ITK_TEMPLATE_EXPORT ComputeDisplacementDistribution : public ScaledSingleV
/** Typedef for multi-threading. */
using ThreadInfoType = MultiThreaderBase::WorkUnitInfo;

typename FixedImageType::ConstPointer m_FixedImage{ nullptr };
typename TFixedImage::ConstPointer m_FixedImage{ nullptr };
FixedImageRegionType m_FixedImageRegion{};
FixedImageMaskConstPointer m_FixedImageMask{ nullptr };
TransformPointer m_Transform{ nullptr };
Expand All @@ -148,17 +148,17 @@ class ITK_TEMPLATE_EXPORT ComputeDisplacementDistribution : public ScaledSingleV
SizeValueType m_NumberOfParameters{};
MultiThreaderBase::Pointer m_Threader{ MultiThreaderBase::New() };

using FixedImageIndexType = typename FixedImageType::IndexType;
using FixedImagePointType = typename FixedImageType::PointType;
using JacobianType = typename TransformType::JacobianType;
using FixedImageIndexType = typename TFixedImage::IndexType;
using FixedImagePointType = typename TFixedImage::PointType;
using JacobianType = typename TTransform::JacobianType;
using JacobianValueType = typename JacobianType::ValueType;

using ImageSampleType = ImageSample<TFixedImage>;

/** Typedefs for support of sparse Jacobians and AdvancedTransforms. */
using TransformJacobianType = JacobianType;
using CoordinateRepresentationType = typename TransformType::ScalarType;
using NumberOfParametersType = typename TransformType::NumberOfParametersType;
using CoordinateRepresentationType = typename TTransform::ScalarType;
using NumberOfParametersType = typename TTransform::NumberOfParametersType;

/** Sample the fixed image to compute the Jacobian terms. */
// \todo: note that this is an exact copy of itk::ComputeJacobianTerms
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class ITK_TEMPLATE_EXPORT ComputePreconditionerUsingDisplacementDistribution
using typename Superclass::NonZeroJacobianIndicesType;

// check
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension);
itkStaticConstMacro(FixedImageDimension, unsigned int, TFixedImage::ImageDimension);

/** Set/get kappa for regularization. */
itkSetClampMacro(RegularizationKappa, double, 0.0, 1.0);
Expand Down

0 comments on commit 9149c79

Please sign in to comment.