Skip to content

autorecon1: convert_modalities output fix #1441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 25 additions & 5 deletions nipype/workflows/fmri/fsl/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ def create_parallelfeat_preproc(name='featpreproc', highpass=True):
>>> preproc.base_dir = '/tmp'
>>> preproc.run() # doctest: +SKIP
"""
version = 0
if fsl.Info.version() and \
LooseVersion(fsl.Info.version()) > LooseVersion('5.0.6'):
version = 507

featpreproc = pe.Workflow(name=name)

Expand Down Expand Up @@ -358,7 +362,26 @@ def create_parallelfeat_preproc(name='featpreproc', highpass=True):
name='highpass')
featpreproc.connect(inputnode, ('highpass', highpass_operand), highpass, 'op_string')
featpreproc.connect(meanscale, 'out_file', highpass, 'in_file')
featpreproc.connect(highpass, 'out_file', outputnode, 'highpassed_files')

if version < 507:
featpreproc.connect(highpass, 'out_file', outputnode, 'highpassed_files')
else:
"""
Add back the mean removed by the highpass filter operation as of FSL 5.0.7
"""
meanfunc4 = pe.MapNode(interface=fsl.ImageMaths(op_string='-Tmean',
suffix='_mean'),
iterfield=['in_file'],
name='meanfunc4')

featpreproc.connect(meanscale, 'out_file', meanfunc4, 'in_file')
addmean = pe.MapNode(interface=fsl.BinaryMaths(operation='add'),
iterfield=['in_file', 'operand_file'],
name='addmean')
featpreproc.connect(highpass, 'out_file', addmean, 'in_file')
featpreproc.connect(meanfunc4, 'out_file', addmean, 'operand_file')
featpreproc.connect(addmean, 'out_file', outputnode, 'highpassed_files')


"""
Generate a mean functional image from the first run
Expand All @@ -368,11 +391,8 @@ def create_parallelfeat_preproc(name='featpreproc', highpass=True):
suffix='_mean'),
iterfield=['in_file'],
name='meanfunc3')
if highpass:
featpreproc.connect(highpass, 'out_file', meanfunc3, 'in_file')
else:
featpreproc.connect(meanscale, 'out_file', meanfunc3, 'in_file')

featpreproc.connect(meanscale, 'out_file', meanfunc3, 'in_file')
featpreproc.connect(meanfunc3, 'out_file', outputnode, 'mean')

return featpreproc
Expand Down
4 changes: 2 additions & 2 deletions nipype/workflows/smri/freesurfer/autorecon1.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ def convert_modalities(in_file=None, out_file=None):
convert.inputs.in_file = in_file
convert.inputs.out_file = out_file
convert.inputs.no_scale = True
convert.run()
out_file = os.path.abspath(convert.outputs.out_file)
out = convert.run()
out_file = os.path.abspath(out.outputs.out_file)
return out_file

T2_convert = pe.Node(Function(['in_file', 'out_file'],
Expand Down