Skip to content

Commit 9ac1058

Browse files
authored
Merge pull request #2084 from mwaskom/topup_framewise_matrices
ENH: Include realignment matrices in TOPUP outputs
2 parents 5040260 + 27daccc commit 9ac1058

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Michael Waskom <[email protected]> Michael Waskom <[email protected]>
8383
Michael Waskom <[email protected]> Michael Waskom <[email protected]>
8484
Michael Waskom <[email protected]> mwaskom <[email protected]>
8585
Michael Waskom <[email protected]> mwaskom <[email protected]>
86+
Michael Waskom <[email protected]> mwaskom <[email protected]>
8687
Oscar Esteban <[email protected]> Oscar Esteban <code@oscaresteban>
8788
Oscar Esteban <[email protected]> oesteban <[email protected]>
8889
Russell Poldrack <[email protected]> Russ Poldrack <[email protected]>

nipype/interfaces/fsl/epi.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ class TOPUPInputSpec(FSLCommandInputSpec):
143143
out_warp_prefix = traits.Str("warpfield", argstr='--dfout=%s', hash_files=False,
144144
desc='prefix for the warpfield images (in mm)',
145145
usedefault=True)
146+
out_mat_prefix = traits.Str("xfm", argstr='--rbmout=%s', hash_files=False,
147+
desc='prefix for the realignment matrices',
148+
usedefault=True)
146149
out_jac_prefix = traits.Str("jac", argstr='--jacout=%s',
147150
hash_files=False,
148151
desc='prefix for the warpfield images',
@@ -221,6 +224,7 @@ class TOPUPOutputSpec(TraitedSpec):
221224
out_field = File(desc='name of image file with field (Hz)')
222225
out_warps = traits.List(File(exists=True), desc='warpfield images')
223226
out_jacs = traits.List(File(exists=True), desc='Jacobian images')
227+
out_mats = traits.List(File(exists=True), desc='realignment matrices')
224228
out_corrected = File(desc='name of 4D image file with unwarped images')
225229
out_logfile = File(desc='name of log-file')
226230

@@ -247,7 +251,7 @@ class TOPUP(FSLCommand):
247251
'topup --config=b02b0.cnf --datain=topup_encoding.txt \
248252
--imain=b0_b0rev.nii --out=b0_b0rev_base --iout=b0_b0rev_corrected.nii.gz \
249253
--fout=b0_b0rev_field.nii.gz --jacout=jac --logout=b0_b0rev_topup.log \
250-
--dfout=warpfield'
254+
--rbmout=xfm --dfout=warpfield'
251255
>>> res = topup.run() # doctest: +SKIP
252256
253257
"""
@@ -289,6 +293,9 @@ def _list_outputs(self):
289293
outputs['out_jacs'] = [
290294
fmt(prefix=self.inputs.out_jac_prefix, i=i, ext=ext)
291295
for i in range(1, n_vols + 1)]
296+
outputs['out_mats'] = [
297+
fmt(prefix=self.inputs.out_mat_prefix, i=i, ext=".mat")
298+
for i in range(1, n_vols + 1)]
292299

293300
if isdefined(self.inputs.encoding_direction):
294301
outputs['out_enc_file'] = self._get_encfilename()

nipype/interfaces/fsl/tests/test_auto_TOPUP.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ def test_TOPUP_inputs():
6464
name_source=['in_file'],
6565
name_template='%s_topup.log',
6666
),
67+
out_mat_prefix=dict(argstr='--rbmout=%s',
68+
hash_files=False,
69+
usedefault=True,
70+
),
6771
out_warp_prefix=dict(argstr='--dfout=%s',
6872
hash_files=False,
6973
usedefault=True,

0 commit comments

Comments
 (0)