We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 32577f7 commit d0b4c0fCopy full SHA for d0b4c0f
nimare/diagnostics.py
@@ -476,11 +476,13 @@ def transform(self, dataset):
476
dset_ijk = mm2vox(dset_xyz, masker.mask_img.affine)
477
478
# Only retain coordinates inside the brain mask
479
- keep_idx = [
480
- i
481
- for i, coord in enumerate(dset_ijk)
482
- if masker_array[coord[0], coord[1], coord[2]] == 1
483
- ]
+ def check_coord(coord):
+ try:
+ return masker_array[coord[0], coord[1], coord[2]] == 1
+ except IndexError:
+ return False
484
+
485
+ keep_idx = [i for i, coord in enumerate(dset_ijk) if check_coord(coord)]
486
487
LGR.info(
488
f"{dset_ijk.shape[0] - len(keep_idx)}/{dset_ijk.shape[0]} coordinates fall outside of "
0 commit comments