From 2caf7ef210ff26babf3d95156fa97c38a1e27c7c Mon Sep 17 00:00:00 2001 From: "shubham-pratap.singh" Date: Mon, 6 Apr 2026 18:37:10 +0200 Subject: [PATCH] Fix IndexError in get_topk_rois by converting labels to a list --- tribev2/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tribev2/utils.py b/tribev2/utils.py index 5236bc9..c83bd1e 100644 --- a/tribev2/utils.py +++ b/tribev2/utils.py @@ -313,6 +313,6 @@ def get_topk_rois(data: np.ndarray, hemi="both", mesh="fsaverage5", k=10) -> lis right_labels = get_hcp_labels(mesh=mesh, combine=False, hemi="right").keys() labels = [f"{l}-lh" for l in left_labels] + [f"{l}-rh" for l in right_labels] else: - labels = get_hcp_labels(mesh=mesh, combine=False, hemi=hemi).keys() + labels = list(get_hcp_labels(mesh=mesh, combine=False, hemi=hemi).keys()) top_k = np.argsort(values)[::-1][:k] return np.array(labels)[top_k]