# Clip to remove non-positive values
fd_warping_srsf = fd_warping_srsf.copy(
data_matrix=np.clip(fd_warping_srsf.data_matrix, 0, None))
# Rescale to have theoretical L2 norm
domain_range = fd_warping_srsf.domain_range
fd_warping_srsf *= np.sqrt(np.ptp(domain_range)) / l2_norm(fd_warping_srsf)
It's probably due to interpolation issues when computing SRSF. I checked in FisherRaoElasticRegistration, and warping do have monotone=True in interpolation.
Nevertheless, this may not be sufficient depending on how the derivatives are computed? I figured I would probably check later, but someone who already knows more about the package might identify the problem more easily.
Hello,
I've had data such that the SRSF of the warpings araising from a FisherRaoElasticRegistration had:
I noticed this through the following use:
I monkey patched it in my code as follows:
It's probably due to interpolation issues when computing SRSF. I checked in
FisherRaoElasticRegistration
, and warping do havemonotone=True
in interpolation.Nevertheless, this may not be sufficient depending on how the derivatives are computed? I figured I would probably check later, but someone who already knows more about the package might identify the problem more easily.
Cheers. Élie