Skip to content

Commit a78ca37

Browse files
committed
Merge pull request #440 from akeshavan/fix/randomise
Fix/randomise: outputs
2 parents 400b30a + 0437713 commit a78ca37

File tree

3 files changed

+12
-19
lines changed

3 files changed

+12
-19
lines changed

nipype/interfaces/freesurfer/model.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ class Label2VolInputSpec(FSTraitedSpec):
679679
desc='list of label files')
680680
annot_file = File(exists=True, argstr='--annot %s',
681681
xor=('label_file', 'annot_file', 'seg_file', 'aparc_aseg'),
682-
requires=('subjectid', 'hemi'),
682+
requires=('subject_id', 'hemi'),
683683
mandatory=True,
684684
copyfile=False,
685685
desc='surface annotation file')
@@ -712,7 +712,7 @@ class Label2VolInputSpec(FSTraitedSpec):
712712
proj = traits.Tuple(traits.Enum('abs', 'frac'), traits.Float,
713713
traits.Float, traits.Float,
714714
argstr='--proj %s %f %f %f',
715-
requries=('subjectid', 'hemi'),
715+
requries=('subject_id', 'hemi'),
716716
desc='project along surface normal')
717717
subject_id = traits.Str(argstr='--subject %s',
718718
desc='subject id')
@@ -755,9 +755,9 @@ def _list_outputs(self):
755755
outfile = self.inputs.vol_label_file
756756
if not isdefined(outfile):
757757
for key in ['label_file', 'annot_file', 'seg_file']:
758-
if isdefined(self.inputs.label_file):
758+
if isdefined(getattr(self.inputs,key)):
759759
_, src = os.path.split(getattr(self.inputs, key))
760-
if isdefined(self.inputs.aparcaaseg):
760+
if isdefined(self.inputs.aparc_aseg):
761761
src = 'aparc+aseg.mgz'
762762
outfile = fname_presuffix(src, suffix='_vol.nii.gz',
763763
newpath=os.getcwd(),

nipype/interfaces/freesurfer/tests/test_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def test_glmfit():
132132
def test_label2vol():
133133
input_map = dict(annot_file = dict(copyfile=False, mandatory=True,
134134
xor=('label_file', 'annot_file', 'seg_file', 'aparc_aseg'),
135-
requires=('subjectid', 'hemi'), argstr='--annot %s',),
135+
requires=('subject_id', 'hemi'), argstr='--annot %s',),
136136
aparc_aseg = dict(xor=('label_file', 'annot_file', 'seg_file', 'aparc_aseg'),
137137
argstr='--aparc+aseg', mandatory=True,),
138138
args = dict(argstr='%s',),

nipype/interfaces/fsl/model.py

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,11 +1487,9 @@ class Randomise(FSLCommand):
14871487

14881488
def _list_outputs(self):
14891489
outputs = self.output_spec().get()
1490-
outputs['tstat_files'] = glob(os.path.join(
1491-
os.getcwd(),
1490+
outputs['tstat_files'] = glob(self._gen_fname(\
14921491
'%s_tstat*.nii' % self.inputs.base_name))
1493-
outputs['fstat_files'] = glob(os.path.join(
1494-
os.getcwd(),
1492+
outputs['fstat_files'] = glob(self._gen_fname(\
14951493
'%s_fstat*.nii' % self.inputs.base_name))
14961494
prefix = False
14971495
if self.inputs.tfce or self.inputs.tfce2D:
@@ -1503,18 +1501,13 @@ def _list_outputs(self):
15031501
elif self.inputs.cm_thresh or self.inputs.f_cm_thresh:
15041502
prefix = 'clusterm'
15051503
if prefix:
1506-
outputs['t_p_files'] = glob(os.path.join(
1507-
os.getcwd(),
1508-
'%s_%s_p_tstat*.nii' % (self.inputs.base_name, prefix)))
1509-
outputs['t_corrected_p_files'] = glob(os.path.join(
1510-
os.getcwd(),
1504+
outputs['t_p_files'] = glob(self._gen_fname(\
1505+
'%s_%s_p_tstat*' % (self.inputs.base_name, prefix)))
1506+
outputs['t_corrected_p_files'] = glob(self._gen_fname(\
15111507
'%s_%s_corrp_tstat*.nii' % (self.inputs.base_name, prefix)))
15121508

1513-
outputs['f_p_files'] = glob(os.path.join(
1514-
os.getcwd(),
1509+
outputs['f_p_files'] = glob(self._gen_fname(\
15151510
'%s_%s_p_fstat*.nii' % (self.inputs.base_name, prefix)))
1516-
outputs['f_corrected_p_files'] = glob(os.path.join(
1517-
os.getcwd(),
1511+
outputs['f_corrected_p_files'] = glob(self._gen_fname(\
15181512
'%s_%s_corrp_fstat*.nii' % (self.inputs.base_name, prefix)))
1519-
15201513
return outputs

0 commit comments

Comments
 (0)