Skip to content

Commit

Permalink
enh: final fixes
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Markiewicz <[email protected]>
  • Loading branch information
oesteban and effigies committed Nov 17, 2022
1 parent 995a898 commit 80bb746
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions sdcflows/interfaces/bspline.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"""Filtering of :math:`B_0` field mappings with B-Splines."""
from itertools import product
from pathlib import Path
from contextlib import suppress
import numpy as np
import nibabel as nb
from nibabel.affines import apply_affine
Expand Down Expand Up @@ -152,14 +151,12 @@ def _run_interface(self, runtime):
if need_resize:
from sdcflows.utils.tools import resample_to_zooms

zooms_min = self.inputs.zooms_min

with suppress(TypeError):
zooms_min = [float(zooms_min)] * 3
zooms_min = np.maximum(zooms, self.inputs.zooms_min)

LOGGER.info(
"Resampling image with resolution exceeding 'zooms_min' "
f"({'x'.join(str(s) for s in zooms)})."
f"({'x'.join(str(s) for s in zooms)} → "
f"{'x'.join(str(s) for s in zooms_min)})."
)
fmapnii = resample_to_zooms(fmapnii, zooms_min)

Expand Down
2 changes: 1 addition & 1 deletion sdcflows/utils/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def resample_to_zooms(in_file, zooms, order=3, prefilter=True):
hdr.set_sform(affine, scode)
hdr.set_qform(affine, qcode)
newref = in_file.__class__(
np.zeros(new_shape, dtype=hdr.get_data_dtype()),
np.zeros(new_shape.astype(int), dtype=hdr.get_data_dtype()),
affine,
hdr,
)
Expand Down

0 comments on commit 80bb746

Please sign in to comment.