Skip to content

Commit 323e595

Browse files
author
Shoshana Berleant
committed
fix problem travis caught, add appropriate unit test
1 parent 8ebd909 commit 323e595

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

nipype/algorithms/confounds.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,8 @@ def _run_interface(self, runtime):
339339
# removed [prior to ...]"
340340
if self.inputs.use_regress_poly:
341341
voxel_timecourses = regress_poly(self.inputs.regress_poly_degree,
342-
voxel_timecourses, remove_mean=True)
342+
voxel_timecourses)
343+
voxel_timecourses = regress_poly(0, voxel_timecourses, remove_mean=True)
343344

344345
# "Voxel time series from the noise ROI (either anatomical or tSTD) were
345346
# placed in a matrix M of size Nxm, with time along the row dimension

nipype/algorithms/tests/test_compcor.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ def test_tcompcor_no_percentile(self):
6666
num_nonmasked_voxels = np.count_nonzero(mask)
6767
assert_equal(num_nonmasked_voxels, 1)
6868

69+
def test_compcor_no_regress_poly(self):
70+
self.run_cc(CompCor(realigned_file=self.realigned_file, mask_file=self.mask_file,
71+
use_regress_poly=False), [['0.4451946442', '-0.7683311482'],
72+
['-0.4285129505', '-0.0926034137'],
73+
['0.5721540256', '0.5608764842'],
74+
['-0.5367548139', '0.0059943226'],
75+
['-0.0520809054', '0.2940637551']])
76+
6977
def run_cc(self, ccinterface, expected_components):
7078
# run
7179
ccresult = ccinterface.run()

0 commit comments

Comments
 (0)