Skip to content

Commit

Permalink
[FIX 🔧] fixed index out of bounds error in spin perm
Browse files Browse the repository at this point in the history
  • Loading branch information
saratheriver committed Mar 10, 2021
1 parent f398837 commit 9af48f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion enigmatoolbox/permutation_testing/permutation_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ def centroid_extraction_sphere(sphere_coords, annotfile, ventricles=False):
centroid = np.empty((0, 3))
for ic in range(ctab.shape[0]):
if not names[ic].decode("utf-8") == 'unknown' and not names[ic].decode("utf-8") == 'corpus'\
and not names[ic].decode("utf-8") == 'medialwall' and not names[ic].decode("utf-8") == 'Background+FreeSurfer_Defined_Medial_Wall':
and not names[ic].decode("utf-8") == 'corpuscallosum' and not names[ic].decode("utf-8") == 'medialwall'\
and not names[ic].decode("utf-8") == 'Background+FreeSurfer_Defined_Medial_Wall':
label = ctab[ic, -1]
centroid = np.vstack((centroid, np.array(np.mean(sphere_coords[labels == label, :], axis=0))))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
for ic = 1:colortable.numEntries % loop over parcellated structures
if isempty(strfind(colortable.struct_names{ic},'unknown')) && ...
isempty(strfind(colortable.struct_names{ic},'corpus')) && ...
isempty(strfind(colortable.struct_names{ic},'corpuscallosum')) && ...
isempty(strfind(colortable.struct_names{ic},'medialwall')) && ...
isempty(strfind(colortable.struct_names{ic},'Background+FreeSurfer_Defined_Medial_Wall')) % exclude "unknown" structures and corpus callosum from the parcellation
ind = ind + 1; % increment counter for every valid region
Expand Down

0 comments on commit 9af48f7

Please sign in to comment.