Skip to content

Commit bb45785

Browse files
author
Shoshana Berleant
committed
remove stuff
1 parent cb2faa2 commit bb45785

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

nipype/algorithms/compcor.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ class CompCorInputSpec(BaseInterfaceInputSpec):
3636
'pre-component extraction')
3737
regress_poly_degree = traits.Range(low=1, default=1, usedefault=True,
3838
desc='the degree polynomial to use')
39-
extra_regressors = File(exists=True, mandatory=False,
40-
desc='additional regressors to add')
4139

4240
class CompCorOutputSpec(TraitedSpec):
4341
components_file = File(exists=True,
@@ -90,10 +88,6 @@ def _run_interface(self, runtime):
9088
# principal components using a singular value decomposition."
9189
u, _, _ = linalg.svd(M, full_matrices=False)
9290
components = u[:, :self.inputs.num_components]
93-
if self.inputs.extra_regressors:
94-
components = self._add_extras(components,
95-
self.inputs.extra_regressors)
96-
9791
components_file = os.path.join(os.getcwd(), self.inputs.components_file)
9892
np.savetxt(components_file, components, fmt="%.10f")
9993
return runtime
@@ -108,13 +102,8 @@ def _compute_tSTD(self, M, x):
108102
# set bad values to x
109103
stdM[stdM == 0] = x
110104
stdM[np.isnan(stdM)] = x
111-
stdM[np.isinf(stdM)] = x
112105
return stdM
113106

114-
def _add_extras(self, components, extra_regressors):
115-
regressors = np.genfromtxt(self.inputs.extra_regressors)
116-
return np.hstack((components, regressors))
117-
118107
class TCompCorInputSpec(CompCorInputSpec):
119108
# and all the fields in CompCorInputSpec
120109
percentile_threshold = traits.Range(low=0., high=1., value=.02,

nipype/algorithms/tests/test_compcor.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from ..compcor import CompCor, TCompCor, ACompCor
66

77
import unittest
8-
import mock
98
import nibabel as nb
109
import numpy as np
1110
import os
@@ -51,14 +50,6 @@ def test_compcor(self):
5150
assert_equal(os.path.getsize(ccresult.outputs.components_file),
5251
os.path.getsize(accresult.outputs.components_file))
5352

54-
@mock.patch('nipype.algorithms.compcor.CompCor._add_extras')
55-
def test_compcor_with_extra_regressors(self, mock_add_extras):
56-
regressors_file ='regress.txt'
57-
open(regressors_file, 'a').close() # make sure file exists
58-
CompCor(realigned_file=self.realigned_file, mask_file=self.mask_file,
59-
extra_regressors=regressors_file).run()
60-
assert_true(mock_add_extras.called)
61-
6253
def test_tcompcor(self):
6354
ccinterface = TCompCor(realigned_file=self.realigned_file, percentile_threshold=0.75)
6455
self.run_cc(ccinterface, [['-0.1535587949', '-0.4318584065'],

0 commit comments

Comments
 (0)