Skip to content

Add SetFixedPoints and SetMovingPoints to ElastixRegistrationMethod, for point-to-point EuclideanDistanceMetric #1239

Merged
N-Dekker merged 2 commits intomainfrom
Add-landmark-support-to-library
Nov 15, 2024
Merged

Add SetFixedPoints and SetMovingPoints to ElastixRegistrationMethod, for point-to-point EuclideanDistanceMetric #1239
N-Dekker merged 2 commits intomainfrom
Add-landmark-support-to-library

Conversation

@N-Dekker
Copy link
Copy Markdown
Member

@N-Dekker N-Dekker commented Sep 13, 2024

Currently trying it out in Python:

Dimension = 2
ImageType = itk.Image[itk.UC, Dimension]
PointType = itk.Point[itk.D, Dimension]
PointContainerType = itk.VectorContainer[itk.ULL, PointType]

fixed_image = ImageType.New()
fixed_image.SetRegions(itk.Size[Dimension].Filled(8))
fixed_image.AllocateInitialized()

moving_image = ImageType.New()
moving_image.SetRegions(itk.Size[Dimension].Filled(8))
moving_image.AllocateInitialized()

fixed_point = PointType([0.0, 0.0])
fixed_points = PointContainerType.New()
fixed_points.InsertElement(0, fixed_point)

moving_point = PointType([1.0, -2.0])
moving_points = PointContainerType.New()
moving_points.InsertElement(0, moving_point)

parameter_object = itk.ParameterObject.New()
parameter_object.AddParameterMap(
    {"ImageSampler": ("Full",),
    "MaximumNumberOfIterations": ("2",),
    "Metric": ("AdvancedNormalizedCorrelation", "CorrespondingPointsEuclideanDistanceMetric"),
    "Optimizer": ("AdaptiveStochasticGradientDescent",),
    "Registration": ( "MultiMetricMultiResolutionRegistration",),
    "Transform": ("TranslationTransform",)})

result_image, result_transform_parameters = itk.elastix_registration_method(
    fixed_image, moving_image, fixed_points=fixed_points, moving_points=moving_points,
    parameter_object=parameter_object)

print(result_transform_parameters)

Output:


ParameterObject (000001D212B702D0)
  RTTI typeinfo:   class elastix::ParameterObject
  Reference Count: 1
  Modified Time: 10574
  Debug: Off
  Object Name: 
  Observers: 
    none
ParameterMap 0: 
  (CompressResultImage "false")
  (DefaultPixelValue)
  (Direction 1 0 0 1)
  (FinalBSplineInterpolationOrder 3)
  (FixedImageDimension 2)
  (FixedInternalImagePixelType "float")
  (HowToCombineTransforms "Compose")
  (Index 0 0)
  (InitialTransformParameterFileName "NoInitialTransform")
  (MovingImageDimension 2)
  (MovingInternalImagePixelType "float")
  (NumberOfParameters 2)
  (Origin 0 0)
  (ResampleInterpolator "FinalBSplineInterpolator")
  (Resampler "DefaultResampler")
  (ResultImageFormat "mhd")
  (ResultImagePixelType "unsigned char")
  (Size 8 8)
  (Spacing 1 1)
  (Transform "TranslationTransform")
  (TransformParameters 0.983615 -1.96723)
  (UseDirectionCosines "true")

@N-Dekker
Copy link
Copy Markdown
Member Author

TODO: each metric should have its own point set pair, when having multi metric registration.

@N-Dekker N-Dekker force-pushed the Add-landmark-support-to-library branch 2 times, most recently from 48096f5 to 8d389de Compare September 24, 2024 11:55
Supported specifying the input points for CorrespondingPointsEuclideanDistanceMetric.
@N-Dekker N-Dekker force-pushed the Add-landmark-support-to-library branch from 8d389de to 0c4b5c5 Compare November 10, 2024 14:57
Overloaded SetFixedPoints and SetMovingPoints for 32-bit float coordinates.
@N-Dekker N-Dekker marked this pull request as ready for review November 15, 2024 16:16
@N-Dekker N-Dekker merged commit 2261c7d into main Nov 15, 2024
@N-Dekker N-Dekker deleted the Add-landmark-support-to-library branch November 15, 2024 16:16
N-Dekker added a commit to N-Dekker/ITKElastix that referenced this pull request Nov 15, 2024
Including elastix pull request SuperElastix/elastix#1239
"Add SetFixedPoints and SetMovingPoints to ElastixRegistrationMethod, for
point-to-point EuclideanDistanceMetric"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant