Skip to content

Commit ea60782

Browse files
author
Shoshana Berleant
committed
forgot to regress pre-computing std
1 parent 276fb57 commit ea60782

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

nipype/algorithms/compcor.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,16 @@ class TCompCor(CompCor):
118118

119119
def _run_interface(self, runtime):
120120
imgseries = nb.load(self.inputs.realigned_file).get_data()
121-
time_voxels = imgseries.T
122-
num_voxels = np.prod(time_voxels.shape[1:])
123121

124122
# From the paper:
125123
# "For each voxel time series, the temporal standard deviation is
126124
# defined as the standard deviation of the time series after the removal
127125
# of low-frequency nuisance terms (e.g., linear and quadratic drift)."
126+
imgseries = regress_poly(2, imgseries)
127+
imgseries = imgseries - np.mean(imgseries, axis=1)[:, np.newaxis]
128+
129+
time_voxels = imgseries.T
130+
num_voxels = np.prod(time_voxels.shape[1:])
128131

129132
# "To construct the tSTD noise ROI, we sorted the voxels by their
130133
# temporal standard deviation ..."

nipype/algorithms/tests/test_compcor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ def test_compcor_with_extra_regressors(self, mock_add_extras):
6161

6262
def test_tcompcor(self):
6363
ccinterface = TCompCor(realigned_file=self.realigned_file)
64-
self.run_cc(ccinterface, [['-0.2846272268'], ['0.7115680670'],
65-
['-0.6048328569'], ['0.2134704201'],
66-
['-0.0355784033']])
64+
self.run_cc(ccinterface, [['-0.2500000000'], ['0.2500000000'],
65+
['-0.2500000000'], ['0.7500000000'],
66+
['-0.5000000000']])
6767

6868
def test_tcompcor_with_percentile(self):
6969
ccinterface = TCompCor(realigned_file=self.realigned_file, percentile_threshold=0.2)

0 commit comments

Comments
 (0)