Skip to content

Commit 5473235

Browse files
committed
PEP8
1 parent 272e441 commit 5473235

File tree

1 file changed

+71
-64
lines changed

1 file changed

+71
-64
lines changed

nipype/interfaces/fsl/model.py

Lines changed: 71 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,8 @@ class FLAMEOOutputSpec(TraitedSpec):
679679
exists=True, desc="Variance estimates for each contrast")
680680
zstats = OutputMultiPath(exists=True, desc="z-stat file for each contrast")
681681
tstats = OutputMultiPath(exists=True, desc="t-stat file for each contrast")
682-
zfstats = OutputMultiPath(exists=True, desc="z stat file for each f contrast")
682+
zfstats = OutputMultiPath(
683+
exists=True, desc="z stat file for each f contrast")
683684
fstats = OutputMultiPath(exists=True, desc="f-stat file for each contrast")
684685
mrefvars = OutputMultiPath(
685686
exists=True, desc="mean random effect variances for each contrast")
@@ -747,30 +748,35 @@ def _list_outputs(self):
747748
assert len(copes) >= 1, 'No cope volumes generated by FSL CEstimate'
748749
outputs['copes'] = copes
749750

750-
var_copes = human_order_sorted(glob(os.path.join(pth, 'varcope[0-9]*.*')))
751+
var_copes = human_order_sorted(
752+
glob(os.path.join(pth, 'varcope[0-9]*.*')))
751753
assert len(
752754
var_copes) >= 1, 'No varcope volumes generated by FSL CEstimate'
753755
outputs['var_copes'] = var_copes
754756

755757
zstats = human_order_sorted(glob(os.path.join(pth, 'zstat[0-9]*.*')))
756758
assert len(zstats) >= 1, 'No zstat volumes generated by FSL CEstimate'
757759
outputs['zstats'] = zstats
758-
759-
760+
760761
if isdefined(self.inputs.f_con_file):
761-
zfstats = human_order_sorted(glob(os.path.join(pth, 'zfstat[0-9]*.*')))
762-
assert len(zfstats) >= 1, 'No zfstat volumes generated by FSL CEstimate'
763-
outputs['zfstats'] = zfstats
764-
765-
fstats = human_order_sorted(glob(os.path.join(pth, 'fstat[0-9]*.*')))
766-
assert len(fstats) >= 1, 'No fstat volumes generated by FSL CEstimate'
762+
zfstats = human_order_sorted(
763+
glob(os.path.join(pth, 'zfstat[0-9]*.*')))
764+
assert len(
765+
zfstats) >= 1, 'No zfstat volumes generated by FSL CEstimate'
766+
outputs['zfstats'] = zfstats
767+
768+
fstats = human_order_sorted(
769+
glob(os.path.join(pth, 'fstat[0-9]*.*')))
770+
assert len(
771+
fstats) >= 1, 'No fstat volumes generated by FSL CEstimate'
767772
outputs['fstats'] = fstats
768773

769774
tstats = human_order_sorted(glob(os.path.join(pth, 'tstat[0-9]*.*')))
770775
assert len(tstats) >= 1, 'No tstat volumes generated by FSL CEstimate'
771776
outputs['tstats'] = tstats
772777

773-
mrefs = human_order_sorted(glob(os.path.join(pth, 'mean_random_effects_var[0-9]*.*')))
778+
mrefs = human_order_sorted(
779+
glob(os.path.join(pth, 'mean_random_effects_var[0-9]*.*')))
774780
assert len(
775781
mrefs) >= 1, 'No mean random effects volumes generated by FLAMEO'
776782
outputs['mrefvars'] = mrefs
@@ -779,7 +785,8 @@ def _list_outputs(self):
779785
assert len(tdof) >= 1, 'No T dof volumes generated by FLAMEO'
780786
outputs['tdof'] = tdof
781787

782-
weights = human_order_sorted(glob(os.path.join(pth, 'weights[0-9]*.*')))
788+
weights = human_order_sorted(
789+
glob(os.path.join(pth, 'weights[0-9]*.*')))
783790
assert len(weights) >= 1, 'No weight volumes generated by FLAMEO'
784791
outputs['weights'] = weights
785792

@@ -797,7 +804,7 @@ class ContrastMgrInputSpec(FSLCommandInputSpec):
797804
param_estimates = InputMultiPath(File(exists=True),
798805
argstr='', copyfile=False,
799806
mandatory=True,
800-
desc='Parameter estimates for each column of the design matrix')
807+
desc='Parameter estimates for each column of the design matrix')
801808
corrections = File(exists=True, copyfile=False, mandatory=True,
802809
desc='statistical corrections used within FILM modelling')
803810
dof_file = File(exists=True, argstr='', copyfile=False, mandatory=True,
@@ -806,26 +813,26 @@ class ContrastMgrInputSpec(FSLCommandInputSpec):
806813
copyfile=False, mandatory=True,
807814
desc='summary of residuals, See Woolrich, et. al., 2001')
808815
contrast_num = traits.Int(min=1, argstr='-cope',
809-
desc='contrast number to start labeling copes from')
816+
desc='contrast number to start labeling copes from')
810817
suffix = traits.Str(argstr='-suffix %s',
811818
desc='suffix to put on the end of the cope filename before the contrast number, default is nothing')
812819

813820

814821
class ContrastMgrOutputSpec(TraitedSpec):
815822
copes = OutputMultiPath(File(exists=True),
816-
desc='Contrast estimates for each contrast')
823+
desc='Contrast estimates for each contrast')
817824
varcopes = OutputMultiPath(File(exists=True),
818-
desc='Variance estimates for each contrast')
825+
desc='Variance estimates for each contrast')
819826
zstats = OutputMultiPath(File(exists=True),
820-
desc='z-stat file for each contrast')
827+
desc='z-stat file for each contrast')
821828
tstats = OutputMultiPath(File(exists=True),
822-
desc='t-stat file for each contrast')
829+
desc='t-stat file for each contrast')
823830
fstats = OutputMultiPath(File(exists=True),
824-
desc='f-stat file for each contrast')
831+
desc='f-stat file for each contrast')
825832
zfstats = OutputMultiPath(File(exists=True),
826833
desc='z-stat file for each F contrast')
827834
neffs = OutputMultiPath(File(exists=True),
828-
desc='neff file ?? for each contrast')
835+
desc='neff file ?? for each contrast')
829836

830837

831838
class ContrastMgr(FSLCommand):
@@ -894,16 +901,16 @@ def _list_outputs(self):
894901
neffs = []
895902
for i in range(numtcons):
896903
copes.append(self._gen_fname('cope%d.nii' % (base_contrast + i),
897-
cwd=pth))
904+
cwd=pth))
898905
varcopes.append(
899906
self._gen_fname('varcope%d.nii' % (base_contrast + i),
900-
cwd=pth))
907+
cwd=pth))
901908
zstats.append(self._gen_fname('zstat%d.nii' % (base_contrast + i),
902-
cwd=pth))
909+
cwd=pth))
903910
tstats.append(self._gen_fname('tstat%d.nii' % (base_contrast + i),
904-
cwd=pth))
911+
cwd=pth))
905912
neffs.append(self._gen_fname('neff%d.nii' % (base_contrast + i),
906-
cwd=pth))
913+
cwd=pth))
907914
if copes:
908915
outputs['copes'] = copes
909916
outputs['varcopes'] = varcopes
@@ -914,10 +921,10 @@ def _list_outputs(self):
914921
zfstats = []
915922
for i in range(numfcons):
916923
fstats.append(self._gen_fname('fstat%d.nii' % (base_contrast + i),
917-
cwd=pth))
924+
cwd=pth))
918925
zfstats.append(
919926
self._gen_fname('zfstat%d.nii' % (base_contrast + i),
920-
cwd=pth))
927+
cwd=pth))
921928
if fstats:
922929
outputs['fstats'] = fstats
923930
outputs['zfstats'] = zfstats
@@ -926,7 +933,7 @@ def _list_outputs(self):
926933

927934
class L2ModelInputSpec(BaseInterfaceInputSpec):
928935
num_copes = traits.Int(min=1, mandatory=True,
929-
desc='number of copes to be combined')
936+
desc='number of copes to be combined')
930937

931938

932939
class L2ModelOutputSpec(TraitedSpec):
@@ -1024,7 +1031,7 @@ class MultipleRegressDesignInputSpec(BaseInterfaceInputSpec):
10241031
mandatory=True,
10251032
desc='dictionary containing named lists of regressors')
10261033
groups = traits.List(traits.Int,
1027-
desc='list of group identifiers (defaults to single group)')
1034+
desc='list of group identifiers (defaults to single group)')
10281035

10291036

10301037
class MultipleRegressDesignOutputSpec(TraitedSpec):
@@ -1104,7 +1111,7 @@ def _run_interface(self, runtime):
11041111
convals = np.zeros((nwaves, 1))
11051112
for regidx, reg in enumerate(self.inputs.contrasts[idx][2]):
11061113
convals[regs.index(reg)
1107-
] = self.inputs.contrasts[idx][3][regidx]
1114+
] = self.inputs.contrasts[idx][3][regidx]
11081115
con_txt.append(' '.join(['%e' % val for val in convals]))
11091116
con_txt = '\n'.join(con_txt)
11101117
# write f-con file
@@ -1163,11 +1170,11 @@ def _list_outputs(self):
11631170
class SMMInputSpec(FSLCommandInputSpec):
11641171
spatial_data_file = File(
11651172
exists=True, position=0, argstr='--sdf="%s"', mandatory=True,
1166-
desc="statistics spatial map", copyfile=False)
1173+
desc="statistics spatial map", copyfile=False)
11671174
mask = File(exist=True, position=1, argstr='--mask="%s"', mandatory=True,
11681175
desc="mask file", copyfile=False)
11691176
no_deactivation_class = traits.Bool(position=2, argstr="--zfstatmode",
1170-
desc="enforces no deactivation class")
1177+
desc="enforces no deactivation class")
11711178

11721179

11731180
class SMMOutputSpec(TraitedSpec):
@@ -1202,7 +1209,7 @@ def _list_outputs(self):
12021209
class MELODICInputSpec(FSLCommandInputSpec):
12031210
in_files = InputMultiPath(
12041211
File(exists=True), argstr="-i %s", mandatory=True, position=0,
1205-
desc="input file names (either single file name or a list)")
1212+
desc="input file names (either single file name or a list)")
12061213
out_dir = Directory(
12071214
argstr="-o %s", desc="output directory name", genfile=True)
12081215
mask = File(exists=True, argstr="-m %s",
@@ -1505,7 +1512,7 @@ class RandomiseInputSpec(FSLCommandInputSpec):
15051512
position=0, mandatory=True)
15061513
base_name = traits.Str(
15071514
'tbss_', desc='the rootname that all generated files will have',
1508-
argstr='-o "%s"', position=1, usedefault=True)
1515+
argstr='-o "%s"', position=1, usedefault=True)
15091516
design_mat = File(
15101517
exists=True, desc='design matrix file', argstr='-d %s', position=2)
15111518
tcon = File(
@@ -1518,27 +1525,27 @@ class RandomiseInputSpec(FSLCommandInputSpec):
15181525
desc='demean data temporally before model fitting', argstr='-D')
15191526
one_sample_group_mean = traits.Bool(
15201527
desc='perform 1-sample group-mean test instead of generic permutation test',
1521-
argstr='-1')
1528+
argstr='-1')
15221529
show_total_perms = traits.Bool(
15231530
desc='print out how many unique permutations would be generated and exit',
1524-
argstr='-q')
1531+
argstr='-q')
15251532
show_info_parallel_mode = traits.Bool(
15261533
desc='print out information required for parallel mode and exit',
1527-
argstr='-Q')
1534+
argstr='-Q')
15281535
vox_p_values = traits.Bool(
15291536
desc='output voxelwise (corrected and uncorrected) p-value images',
1530-
argstr='-x')
1537+
argstr='-x')
15311538
tfce = traits.Bool(
15321539
desc='carry out Threshold-Free Cluster Enhancement', argstr='-T')
15331540
tfce2D = traits.Bool(
15341541
desc='carry out Threshold-Free Cluster Enhancement with 2D optimisation',
1535-
argstr='--T2')
1542+
argstr='--T2')
15361543
f_only = traits.Bool(desc='calculate f-statistics only', argstr='--f_only')
15371544
raw_stats_imgs = traits.Bool(
15381545
desc='output raw ( unpermuted ) statistic images', argstr='-R')
15391546
p_vec_n_dist_files = traits.Bool(
15401547
desc='output permutation vector and null distribution text files',
1541-
argstr='-P')
1548+
argstr='-P')
15421549
num_perm = traits.Int(
15431550
argstr='-n %d', desc='number of permutations (default 5000, set to 0 for exhaustive)')
15441551
seed = traits.Int(
@@ -1609,9 +1616,9 @@ class Randomise(FSLCommand):
16091616
def _list_outputs(self):
16101617
outputs = self.output_spec().get()
16111618
outputs['tstat_files'] = glob(self._gen_fname(
1612-
'%s_tstat*.nii' % self.inputs.base_name))
1619+
'%s_tstat*.nii' % self.inputs.base_name))
16131620
outputs['fstat_files'] = glob(self._gen_fname(
1614-
'%s_fstat*.nii' % self.inputs.base_name))
1621+
'%s_fstat*.nii' % self.inputs.base_name))
16151622
prefix = False
16161623
if self.inputs.tfce or self.inputs.tfce2D:
16171624
prefix = 'tfce'
@@ -1623,7 +1630,7 @@ def _list_outputs(self):
16231630
prefix = 'clusterm'
16241631
if prefix:
16251632
outputs['t_p_files'] = glob(self._gen_fname(
1626-
'%s_%s_p_tstat*' % (self.inputs.base_name, prefix)))
1633+
'%s_%s_p_tstat*' % (self.inputs.base_name, prefix)))
16271634
outputs['t_corrected_p_files'] = glob(self._gen_fname(
16281635
'%s_%s_corrp_tstat*.nii' % (self.inputs.base_name, prefix)))
16291636

@@ -1638,22 +1645,22 @@ class GLMInputSpec(FSLCommandInputSpec):
16381645
in_file = File(exists=True, argstr='-i %s', mandatory=True, position=1,
16391646
desc='input file name (text matrix or 3D/4D image file)')
16401647
out_file = File(argstr='-o %s', genfile=True, position=3,
1641-
desc=('filename for GLM parameter estimates'
1642-
+ ' (GLM betas)'))
1648+
desc=('filename for GLM parameter estimates'
1649+
+ ' (GLM betas)'))
16431650
design = File(exists=True, argstr='-d %s', mandatory=True, position=2,
1644-
desc=('file name of the GLM design matrix (text time'
1645-
+ ' courses for temporal regression or an image'
1646-
+ ' file for spatial regression)'))
1651+
desc=('file name of the GLM design matrix (text time'
1652+
+ ' courses for temporal regression or an image'
1653+
+ ' file for spatial regression)'))
16471654
contrasts = File(exists=True, argstr='-c %s', desc=('matrix of t-statics'
16481655
+ ' contrasts'))
16491656
mask = File(exists=True, argstr='-m %s', desc=('mask image file name if'
16501657
+ ' input is image'))
16511658
dof = traits.Int(argstr='--dof %d', desc=('set degrees of freedom'
16521659
+ ' explicitly'))
16531660
des_norm = traits.Bool(argstr='--des_norm', desc=('switch on normalization'
1654-
+ ' of the design matrix'
1655-
+ ' columns to unit std'
1656-
+ ' deviation'))
1661+
+ ' of the design matrix'
1662+
+ ' columns to unit std'
1663+
+ ' deviation'))
16571664
dat_norm = traits.Bool(argstr='--dat_norm', desc=('switch on normalization'
16581665
+ ' of the data time'
16591666
+ ' series to unit std'
@@ -1665,30 +1672,30 @@ class GLMInputSpec(FSLCommandInputSpec):
16651672
out_cope = File(argstr='--out_cope=%s',
16661673
desc='output file name for COPE (either as txt or image')
16671674
out_z_name = File(argstr='--out_z=%s',
1668-
desc='output file name for Z-stats (either as txt or image')
1675+
desc='output file name for Z-stats (either as txt or image')
16691676
out_t_name = File(argstr='--out_t=%s',
1670-
desc='output file name for t-stats (either as txt or image')
1677+
desc='output file name for t-stats (either as txt or image')
16711678

16721679
out_p_name = File(argstr='--out_p=%s',
1673-
desc=('output file name for p-values of Z-stats (either as'
1674-
+ ' text file or image)'))
1680+
desc=('output file name for p-values of Z-stats (either as'
1681+
+ ' text file or image)'))
16751682
out_f_name = File(argstr='--out_f=%s',
1676-
desc='output file name for F-value of full model fit')
1683+
desc='output file name for F-value of full model fit')
16771684
out_pf_name = File(argstr='--out_pf=%s',
1678-
desc='output file name for p-value for full model fit')
1685+
desc='output file name for p-value for full model fit')
16791686
out_res_name = File(argstr='--out_res=%s',
1680-
desc='output file name for residuals')
1687+
desc='output file name for residuals')
16811688
out_varcb_name = File(argstr='--out_varcb=%s',
1682-
desc='output file name for variance of COPEs')
1689+
desc='output file name for variance of COPEs')
16831690

16841691
out_sigsq_name = File(argstr='--out_sigsq=%s',
1685-
desc=('output file name for residual noise variance'
1686-
+ ' sigma-square'))
1692+
desc=('output file name for residual noise variance'
1693+
+ ' sigma-square'))
16871694
out_data_name = File(argstr='--out_data=%s',
1688-
desc='output file name for pre-processed data')
1695+
desc='output file name for pre-processed data')
16891696
out_vnscales_name = File(argstr='--out_vnscales=%s',
1690-
desc=('output file name for scaling factors for variance'
1691-
+ ' normalisation'))
1697+
desc=('output file name for scaling factors for variance'
1698+
+ ' normalisation'))
16921699

16931700

16941701
class GLMOutputSpec(TraitedSpec):

0 commit comments

Comments
 (0)