From 2c8f87bcb19170f781a9325c46d8b4df13bd4548 Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Wed, 11 Oct 2023 09:43:42 -0400 Subject: [PATCH] Convert outlier_idx to a list. --- xcp_d/utils/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xcp_d/utils/utils.py b/xcp_d/utils/utils.py index d4b0c8c49..14c690618 100644 --- a/xcp_d/utils/utils.py +++ b/xcp_d/utils/utils.py @@ -465,7 +465,7 @@ def denoise_with_nilearn( ) # Replace any high-motion volumes at the beginning or end of the run with the closest # low-motion volume's data. - outlier_idx = np.where(~sample_mask)[0] + outlier_idx = list(np.where(~sample_mask)[0]) if outlier_idx: # Use https://stackoverflow.com/a/48106843/2589328 to group consecutive blocks of outliers. gaps = [[s, e] for s, e in zip(outlier_idx, outlier_idx[1:]) if s + 1 < e]