From 47352f75a950bbff1c593a8a9c758b0142da3fb9 Mon Sep 17 00:00:00 2001 From: Chris Gorgolewski Date: Fri, 31 Mar 2017 23:21:36 -0400 Subject: [PATCH 1/3] fixes --- nipype/algorithms/confounds.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nipype/algorithms/confounds.py b/nipype/algorithms/confounds.py index ecb8d4e8a8..da75db9ace 100644 --- a/nipype/algorithms/confounds.py +++ b/nipype/algorithms/confounds.py @@ -599,11 +599,11 @@ class NonSteadyStateDetector(BaseInterface): output_spec = NonSteadyStateDetectorOutputSpec def _run_interface(self, runtime): - in_nii = nb.load(self.inputs.in_plots) + in_nii = nb.load(self.inputs.in_file) global_signal = in_nii.get_data()[:,:,:,:50].mean(axis=0).mean(axis=0).mean(axis=0) self._results = { - 'out_file': _is_outlier(global_signal) + 'n_volumes_to_discard': _is_outlier(global_signal) } return runtime @@ -611,7 +611,7 @@ def _run_interface(self, runtime): def _list_outputs(self): return self._results -def _is_outlier(points, thresh=3.5): +def is_outlier(points, thresh=3.5): """ Returns a boolean array with True if points are outliers and False otherwise. From 83bae7d801c02ffb29f26fc11215eb9687e73007 Mon Sep 17 00:00:00 2001 From: Chris Gorgolewski Date: Sat, 1 Apr 2017 00:43:23 -0700 Subject: [PATCH 2/3] fix tests --- nipype/algorithms/tests/test_confounds.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nipype/algorithms/tests/test_confounds.py b/nipype/algorithms/tests/test_confounds.py index 4eaa9dc073..66343a61ae 100644 --- a/nipype/algorithms/tests/test_confounds.py +++ b/nipype/algorithms/tests/test_confounds.py @@ -7,7 +7,7 @@ import pytest from nipype.testing import example_data from nipype.algorithms.confounds import FramewiseDisplacement, ComputeDVARS, \ - _is_outlier + is_outlier import numpy as np From 187acf4d71acd778a9a6b87b2abf225a7865ae57 Mon Sep 17 00:00:00 2001 From: Chris Gorgolewski Date: Sat, 1 Apr 2017 10:33:40 -0700 Subject: [PATCH 3/3] fix tests --- nipype/algorithms/tests/test_confounds.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nipype/algorithms/tests/test_confounds.py b/nipype/algorithms/tests/test_confounds.py index 66343a61ae..7d6eff1283 100644 --- a/nipype/algorithms/tests/test_confounds.py +++ b/nipype/algorithms/tests/test_confounds.py @@ -71,5 +71,5 @@ def test_outliers(tmpdir): in_data = np.random.randn(100) in_data[0] += 10 - assert _is_outlier(in_data) == 1 + assert is_outlier(in_data) == 1