Skip to content

Commit 632087a

Browse files
author
Shoshana Berleant
committed
add new param to regress_poly; pep8 lint
1 parent 01b6819 commit 632087a

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

nipype/algorithms/confounds.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
1313
'''
1414
from __future__ import print_function, division, unicode_literals, absolute_import
15-
from builtins import str, zip, range, open
15+
from builtins import range
1616

1717
import os
1818
import os.path as op
@@ -23,7 +23,7 @@
2323
from scipy.special import legendre
2424

2525
from .. import logging
26-
from ..external.due import due, Doi, BibTeX
26+
from ..external.due import BibTeX
2727
from ..interfaces.base import (traits, TraitedSpec, BaseInterface,
2828
BaseInterfaceInputSpec, File, isdefined,
2929
InputMultiPath)
@@ -160,8 +160,8 @@ def _run_interface(self, runtime):
160160
'dvars_nstd', ext=self.inputs.figformat)
161161
fig = plot_confound(dvars[1], self.inputs.figsize, 'DVARS', series_tr=tr)
162162
fig.savefig(self._results['fig_nstd'], dpi=float(self.inputs.figdpi),
163-
format=self.inputs.figformat,
164-
bbox_inches='tight')
163+
format=self.inputs.figformat,
164+
bbox_inches='tight')
165165
fig.clf()
166166

167167
if self.inputs.save_vxstd:
@@ -175,8 +175,8 @@ def _run_interface(self, runtime):
175175
fig = plot_confound(dvars[2], self.inputs.figsize, 'Voxelwise std DVARS',
176176
series_tr=tr)
177177
fig.savefig(self._results['fig_vxstd'], dpi=float(self.inputs.figdpi),
178-
format=self.inputs.figformat,
179-
bbox_inches='tight')
178+
format=self.inputs.figformat,
179+
bbox_inches='tight')
180180
fig.clf()
181181

182182
if self.inputs.save_all:
@@ -323,9 +323,9 @@ class CompCor(BaseInterface):
323323
"author = {Behzadi, Yashar and Restom, Khaled and Liau, Joy and Liu, Thomas T.},"
324324
"year = {2007},"
325325
"pages = {90-101},}"
326-
),
326+
),
327327
'tags': ['method', 'implementation']
328-
}]
328+
}]
329329

330330
def _run_interface(self, runtime):
331331
imgseries = nb.load(self.inputs.realigned_file).get_data()
@@ -347,8 +347,6 @@ def _run_interface(self, runtime):
347347
# placed in a matrix M of size Nxm, with time along the row dimension
348348
# and voxels along the column dimension."
349349
M = voxel_timecourses.T
350-
numvols = M.shape[0]
351-
numvoxels = M.shape[1]
352350

353351
# "[... were removed] prior to column-wise variance normalization."
354352
M = M / self._compute_tSTD(M, 1.)
@@ -513,7 +511,7 @@ def _list_outputs(self):
513511
outputs['detrended_file'] = op.abspath(self.inputs.detrended_file)
514512
return outputs
515513

516-
def regress_poly(degree, data):
514+
def regress_poly(degree, data, remove_mean=False):
517515
''' returns data with degree polynomial regressed out.
518516
The last dimension (i.e. data.shape[-1]) should be time.
519517
'''
@@ -569,7 +567,6 @@ def compute_dvars(in_file, in_mask, remove_zerovariance=False):
569567
:return: the standardized DVARS
570568
571569
"""
572-
import os.path as op
573570
import numpy as np
574571
import nibabel as nb
575572
from nitime.algorithms import AR_est_YW

0 commit comments

Comments
 (0)