Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Markiewicz <[email protected]>
  • Loading branch information
mgxd and effigies authored Jun 5, 2024
1 parent bcc7d3e commit c9619a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fmriprep/utils/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ def load_ants_h5(filename: Path) -> nt.base.TransformBase:
fixed_params = transform2['TransformFixedParameters'][:]

spacing = fixed_params[6:9]
direction = fixed_params[9:]
direction = fixed_params[9:].reshape((3, 3))

Check warning on line 75 in fmriprep/utils/transforms.py

View check run for this annotation

Codecov / codecov/patch

fmriprep/utils/transforms.py#L74-L75

Added lines #L74 - L75 were not covered by tests

# Supported spacing
if not np.array_equal(spacing, np.array([1.0, 1.0, 1.0])):
raise ValueError(f'Unexpected spacing: {spacing}')

Check warning on line 79 in fmriprep/utils/transforms.py

View check run for this annotation

Codecov / codecov/patch

fmriprep/utils/transforms.py#L78-L79

Added lines #L78 - L79 were not covered by tests

if not np.array_equal(direction, np.diag([-1, -1, -1])):
if not np.array_equal(direction, direction.T):
raise ValueError(f'Asymmetric direction matrix: {direction}')

Check warning on line 82 in fmriprep/utils/transforms.py

View check run for this annotation

Codecov / codecov/patch

fmriprep/utils/transforms.py#L81-L82

Added lines #L81 - L82 were not covered by tests

shape = tuple(fixed_params[:3].astype(int))
Expand Down

0 comments on commit c9619a8

Please sign in to comment.