FIX: ``NonsteadyStatesDetector`` wrongly using Nipype's ``is_outlier``
@@ -56,7 +56,10 @@ class NonsteadyStatesDetector(SimpleInterface):
global_signal = np.mean(
np.asanyarray(img.dataobj[..., : self.inputs.n_volumes]), axis=(0, 1, 2)
)
- self._results["t_mask"] = [bool(i) for i in is_outlier(global_signal)]
- self._results["n_dummy"] = int(np.sum(self._results["t_mask"]))
+
+ ndiscard = is_outlier(global_signal)
+ self._results["n_dummy"] = ndiscard
+ ndiscard = ndiscard or ntotal
+ self._results["t_mask"][:ndiscard] = [True] * ndiscard
return runtime
