Skip to content

Commit

Permalink
FIX mypy type on mask array for sanity check
Browse files Browse the repository at this point in the history
  • Loading branch information
htwangtw committed Jan 28, 2025
1 parent 96ed715 commit 6e8f072
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion giga_connectome/mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,11 @@ def _check_mask_affine(
key_to_header[affine_hashable] = affine

if isinstance(mask_imgs[0], Nifti1Image):
mask_arrays = np.arange(len(mask_imgs))
# this looks janky, but this is for mypy to understand the type
mask_arrays = np.array(np.arange(len(mask_imgs)).tolist())
else:
mask_arrays = np.array(mask_imgs)

# get most common values
common_affine = max(
set(header_info["affine"]), key=header_info["affine"].count
Expand Down

0 comments on commit 6e8f072

Please sign in to comment.