12
12
13
13
'''
14
14
from __future__ import print_function , division , unicode_literals , absolute_import
15
- from builtins import str , zip , range , open
15
+ from builtins import range
16
16
17
17
import os
18
18
import os .path as op
23
23
from scipy .special import legendre
24
24
25
25
from .. import logging
26
- from ..external .due import due , Doi , BibTeX
26
+ from ..external .due import BibTeX
27
27
from ..interfaces .base import (traits , TraitedSpec , BaseInterface ,
28
28
BaseInterfaceInputSpec , File , isdefined ,
29
29
InputMultiPath )
@@ -160,8 +160,8 @@ def _run_interface(self, runtime):
160
160
'dvars_nstd' , ext = self .inputs .figformat )
161
161
fig = plot_confound (dvars [1 ], self .inputs .figsize , 'DVARS' , series_tr = tr )
162
162
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' )
165
165
fig .clf ()
166
166
167
167
if self .inputs .save_vxstd :
@@ -175,8 +175,8 @@ def _run_interface(self, runtime):
175
175
fig = plot_confound (dvars [2 ], self .inputs .figsize , 'Voxelwise std DVARS' ,
176
176
series_tr = tr )
177
177
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' )
180
180
fig .clf ()
181
181
182
182
if self .inputs .save_all :
@@ -323,9 +323,9 @@ class CompCor(BaseInterface):
323
323
"author = {Behzadi, Yashar and Restom, Khaled and Liau, Joy and Liu, Thomas T.},"
324
324
"year = {2007},"
325
325
"pages = {90-101},}"
326
- ),
326
+ ),
327
327
'tags' : ['method' , 'implementation' ]
328
- }]
328
+ }]
329
329
330
330
def _run_interface (self , runtime ):
331
331
imgseries = nb .load (self .inputs .realigned_file ).get_data ()
@@ -347,8 +347,6 @@ def _run_interface(self, runtime):
347
347
# placed in a matrix M of size Nxm, with time along the row dimension
348
348
# and voxels along the column dimension."
349
349
M = voxel_timecourses .T
350
- numvols = M .shape [0 ]
351
- numvoxels = M .shape [1 ]
352
350
353
351
# "[... were removed] prior to column-wise variance normalization."
354
352
M = M / self ._compute_tSTD (M , 1. )
@@ -513,7 +511,7 @@ def _list_outputs(self):
513
511
outputs ['detrended_file' ] = op .abspath (self .inputs .detrended_file )
514
512
return outputs
515
513
516
- def regress_poly (degree , data ):
514
+ def regress_poly (degree , data , remove_mean = False ):
517
515
''' returns data with degree polynomial regressed out.
518
516
The last dimension (i.e. data.shape[-1]) should be time.
519
517
'''
@@ -569,7 +567,6 @@ def compute_dvars(in_file, in_mask, remove_zerovariance=False):
569
567
:return: the standardized DVARS
570
568
571
569
"""
572
- import os .path as op
573
570
import numpy as np
574
571
import nibabel as nb
575
572
from nitime .algorithms import AR_est_YW
0 commit comments