Skip to content

Commit

Permalink
Merge pull request #674 from ANTsX/np_math_fix
Browse files Browse the repository at this point in the history
BUG: Remove deprecated np.math
  • Loading branch information
cookpa authored Jun 18, 2024
2 parents b3056d5 + 1a64173 commit 099cb3e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ants/registration/landmark_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"fit_time_varying_transform_to_point_sets"]

import numpy as np
import math
import time

import ants
Expand Down Expand Up @@ -208,8 +209,8 @@ def create_zero_velocity_field(domain_image, number_of_time_points=2):
A = np.dot(x_svd[0], x_svd[2])

if transform_type == 'similarity':
scaling = (np.math.sqrt((np.power(y, 2).sum(axis=1) / number_of_points).mean()) /
np.math.sqrt((np.power(x, 2).sum(axis=1) / number_of_points).mean()))
scaling = (math.sqrt((np.power(y, 2).sum(axis=1) / number_of_points).mean()) /
math.sqrt((np.power(x, 2).sum(axis=1) / number_of_points).mean()))
A = np.dot(A, np.eye(dimensionality) * scaling)

xfrm = ants.create_ants_transform(matrix=A, translation=translation,
Expand Down

0 comments on commit 099cb3e

Please sign in to comment.