Skip to content

BF: groupwise_registration type checking #442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions nipy/algorithms/registration/groupwise_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,12 +560,12 @@ def single_run_realign4d(im4d,
speedup : int or sequence
If a sequence, implement a multi-scale realignment
"""
if not type(loops) in (list, tuple, np.array):
if not type(loops) in (list, tuple, np.ndarray):
loops = [loops]
repeats = len(loops)

def format_arg(x):
if not type(x) in (list, tuple, np.array):
if not type(x) in (list, tuple, np.ndarray):
x = [x for i in range(repeats)]
else:
if not len(x) == repeats:
Expand Down Expand Up @@ -648,7 +648,7 @@ def realign4d(runs,
"""

# Single-session case
if not type(runs) in (list, tuple, np.array):
if not type(runs) in (list, tuple, np.ndarray):
runs = [runs]
nruns = len(runs)
if nruns == 1:
Expand Down Expand Up @@ -1171,7 +1171,7 @@ def __init__(self, images, slice_order=None,
# if slice_order is a key word, replace it with the
# appropriate array of slice indices
if slice_order in ('ascending', 'descending'):
if isinstance(images, (list, tuple, np.array)):
if isinstance(images, (list, tuple, np.ndarray)):
xyz_img = as_xyz_image(images[0])
else:
xyz_img = as_xyz_image(images)
Expand Down