From 86aec54c96028cec883a7202ce51df156103f976 Mon Sep 17 00:00:00 2001 From: Alejandro de la Vega Date: Fri, 13 Dec 2019 11:35:11 -0600 Subject: [PATCH] FIX: input index should filter on rows, not columns. --- fitlins/interfaces/nistats.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fitlins/interfaces/nistats.py b/fitlins/interfaces/nistats.py index bd856572..939d9cf9 100644 --- a/fitlins/interfaces/nistats.py +++ b/fitlins/interfaces/nistats.py @@ -227,12 +227,14 @@ def _run_interface(self, runtime): # Pass-through happens automatically as it can handle 1 input if contrast_type == 'FEMA': - # Filter effects and variances based on weights - ix = weights[0].astype(bool) + # Index design identity matrix on non-zero contrasts weights + con_ix = weights[0].astype(bool) + # Index of all input files "involved" with that contrast + dm_ix = mat.iloc[:, con_ix].any(axis=1) ffx_res = compute_fixed_effects( - np.array(filtered_effects)[ix], - np.array(filtered_variances)[ix] + np.array(filtered_effects)[dm_ix], + np.array(filtered_variances)[dm_ix] ) maps = {