Skip to content

ENH: Include realignment matrices in TOPUP outputs #2084

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 4 commits into from
Jun 22, 2017
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
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ Michael Waskom <michael.l.waskom@gmail.com> Michael Waskom <mwaskom@mit.edu>
Michael Waskom <michael.l.waskom@gmail.com> Michael Waskom <mwaskom@stanford.edu>
Michael Waskom <michael.l.waskom@gmail.com> mwaskom <mwaskom@mit.edu>
Michael Waskom <michael.l.waskom@gmail.com> mwaskom <mwaskom@stanford.edu>
Michael Waskom <michael.l.waskom@gmail.com> mwaskom <mwaskom@nyu.edu>
Oscar Esteban <code@oscaresteban.es> Oscar Esteban <code@oscaresteban>
Oscar Esteban <code@oscaresteban.es> oesteban <code@oscaresteban.es>
Russell Poldrack <poldrack@gmail.com> Russ Poldrack <poldrack@gmail.com>
Expand Down
9 changes: 8 additions & 1 deletion nipype/interfaces/fsl/epi.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ class TOPUPInputSpec(FSLCommandInputSpec):
out_warp_prefix = traits.Str("warpfield", argstr='--dfout=%s', hash_files=False,
desc='prefix for the warpfield images (in mm)',
usedefault=True)
out_mat_prefix = traits.Str("xfm", argstr='--rbmout=%s', hash_files=False,
desc='prefix for the realignment matrices',
usedefault=True)
out_jac_prefix = traits.Str("jac", argstr='--jacout=%s',
hash_files=False,
desc='prefix for the warpfield images',
Expand Down Expand Up @@ -221,6 +224,7 @@ class TOPUPOutputSpec(TraitedSpec):
out_field = File(desc='name of image file with field (Hz)')
out_warps = traits.List(File(exists=True), desc='warpfield images')
out_jacs = traits.List(File(exists=True), desc='Jacobian images')
out_mats = traits.List(File(exists=True), desc='realignment matrices')
out_corrected = File(desc='name of 4D image file with unwarped images')
out_logfile = File(desc='name of log-file')

Expand All @@ -247,7 +251,7 @@ class TOPUP(FSLCommand):
'topup --config=b02b0.cnf --datain=topup_encoding.txt \
--imain=b0_b0rev.nii --out=b0_b0rev_base --iout=b0_b0rev_corrected.nii.gz \
--fout=b0_b0rev_field.nii.gz --jacout=jac --logout=b0_b0rev_topup.log \
--dfout=warpfield'
--rbmout=xfm --dfout=warpfield'
>>> res = topup.run() # doctest: +SKIP

"""
Expand Down Expand Up @@ -289,6 +293,9 @@ def _list_outputs(self):
outputs['out_jacs'] = [
fmt(prefix=self.inputs.out_jac_prefix, i=i, ext=ext)
for i in range(1, n_vols + 1)]
outputs['out_mats'] = [
fmt(prefix=self.inputs.out_mat_prefix, i=i, ext=".mat")
for i in range(1, n_vols + 1)]

if isdefined(self.inputs.encoding_direction):
outputs['out_enc_file'] = self._get_encfilename()
Expand Down
4 changes: 4 additions & 0 deletions nipype/interfaces/fsl/tests/test_auto_TOPUP.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ def test_TOPUP_inputs():
name_source=['in_file'],
name_template='%s_topup.log',
),
out_mat_prefix=dict(argstr='--rbmout=%s',
hash_files=False,
usedefault=True,
),
out_warp_prefix=dict(argstr='--dfout=%s',
hash_files=False,
usedefault=True,
Expand Down