Skip to content

Commit e904aec

Browse files
authored
Merge pull request #1926 from chrisfilo/fix/outliers
[FIX] Minor fixes for the NonSteadyStateDetector
2 parents c444511 + 187acf4 commit e904aec

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

nipype/algorithms/confounds.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -599,19 +599,19 @@ class NonSteadyStateDetector(BaseInterface):
599599
output_spec = NonSteadyStateDetectorOutputSpec
600600

601601
def _run_interface(self, runtime):
602-
in_nii = nb.load(self.inputs.in_plots)
602+
in_nii = nb.load(self.inputs.in_file)
603603
global_signal = in_nii.get_data()[:,:,:,:50].mean(axis=0).mean(axis=0).mean(axis=0)
604604

605605
self._results = {
606-
'out_file': _is_outlier(global_signal)
606+
'n_volumes_to_discard': _is_outlier(global_signal)
607607
}
608608

609609
return runtime
610610

611611
def _list_outputs(self):
612612
return self._results
613613

614-
def _is_outlier(points, thresh=3.5):
614+
def is_outlier(points, thresh=3.5):
615615
"""
616616
Returns a boolean array with True if points are outliers and False
617617
otherwise.

nipype/algorithms/tests/test_confounds.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import pytest
88
from nipype.testing import example_data
99
from nipype.algorithms.confounds import FramewiseDisplacement, ComputeDVARS, \
10-
_is_outlier
10+
is_outlier
1111
import numpy as np
1212

1313

@@ -71,5 +71,5 @@ def test_outliers(tmpdir):
7171
in_data = np.random.randn(100)
7272
in_data[0] += 10
7373

74-
assert _is_outlier(in_data) == 1
74+
assert is_outlier(in_data) == 1
7575

0 commit comments

Comments
 (0)