Skip to content

PERF: EuclideanDistanceMetric get vector norm without GetVnlVector()#1237

Merged
N-Dekker merged 1 commit intomainfrom
PERF-EuclideanDistanceMetric-GetNorm
Sep 7, 2024
Merged

PERF: EuclideanDistanceMetric get vector norm without GetVnlVector()#1237
N-Dekker merged 1 commit intomainfrom
PERF-EuclideanDistanceMetric-GetNorm

Conversation

@N-Dekker
Copy link
Copy Markdown
Member

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

Removed unnecessary conversion from itk::Vector to vnl_vector, when retrieving the norm (the magnitude) of a vector (movingPoint - mappedPoint), in CorrespondingPointsEuclideanDistancePointMetric.

Appears to make GetValue more that 7 times faster (from more than 0.07 sec. down to less than 0.009 sec. on 1 million 3D points), as observed on Visual C++ 2022.


For the record, GetDerivative appears to have become more than 3 times faster, from more than 0.10 sec down to less than 0.03 sec, with this commit.

Removed unnecessary conversion from `itk::Vector` to vnl_vector, when retrieving the norm (the magnitude) of a vector (movingPoint - mappedPoint), in `CorrespondingPointsEuclideanDistancePointMetric`.

Appears to make `GetValue` more that 7 times faster (from more than 0.07 sec. down to less than 0.009 sec. on 1 million 3D points), as observed on Visual C++ 2022.
@N-Dekker N-Dekker merged commit 1c4b468 into main Sep 7, 2024
@N-Dekker N-Dekker deleted the PERF-EuclideanDistanceMetric-GetNorm branch September 7, 2024 18:59
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