BioMedIA / deepali

Image, point set, and surface registration in PyTorch.
https://biomedia.github.io/deepali/
Apache License 2.0
26 stars 6 forks source link

Fix calculation of curvature regularization term #113

Closed aschuh-hf closed 1 year ago

aschuh-hf commented 1 year ago

The curvature_loss() function penalizes the sum of all computed second order derivatives. However, it should penalize the individual sums of second order derivatives computed separately for each vector field component.

In case of a 2-dimensional flow field:

(du/dxx + du/dyy) ** 2 + (dv/dxx + dv/dyy) ** 2

What is currently implemented, corresponds to

(du/dxx + du/dyy + dv/dxx + dv/dyy) ** 2