Skip to content

Commit d24c5cd

Browse files
committed
Fixed doctests. Fixed fsl.epi workflow.
The workflow was using an input with its name changed.
1 parent d9f3442 commit d24c5cd

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

CHANGES

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Next Release
22
============
33

4-
* FIX: FUGUE interface was adding wrong parameter in forward warping mode.
4+
* ENH: FUGUE interface has been refactored to use the name_template system, 3 examples added to doctests, some bugs solved.
55
* API: Interfaces to external packages are no longer available in the top-level ``nipype`` namespace, and must be imported directly (e.g. ``from nipype.interfaces import fsl``).
66
* ENH: New ANTs interface: ApplyTransformsToPoints
77
* ENH: New FreeSurfer workflow: create_skullstripped_recon_flow()

nipype/interfaces/fsl/preprocess.py

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,9 +1235,22 @@ class FUGUEOutputSpec(TraitedSpec):
12351235

12361236

12371237
class FUGUE(FSLCommand):
1238-
"""Use FSL FUGUE to unwarp epi's with fieldmaps
1238+
"""
1239+
`FUGUE <http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FUGUE>`_ is, most generally, a set of tools for
1240+
EPI distortion correction.
1241+
1242+
Distortions may be corrected for
1243+
1. improving registration with non-distorted images (e.g. structurals), or
1244+
2. dealing with motion-dependent changes.
1245+
1246+
FUGUE is designed to deal only with the first case - improving registration.
1247+
1248+
1249+
Examples
1250+
--------
1251+
12391252
1240-
Example (unwarping an input image, the shift map is known) ::
1253+
Unwarping an input image (shift map is known) ::
12411254
12421255
>>> from nipype.interfaces.fsl.preprocess import FUGUE
12431256
>>> fugue = FUGUE()
@@ -1246,11 +1259,11 @@ class FUGUE(FSLCommand):
12461259
>>> fugue.inputs.shift_in_file = 'vsm.nii' # Previously computed with fugue as well
12471260
>>> fugue.inputs.unwarp_direction = 'y'
12481261
>>> fugue.cmdline #doctest: +ELLIPSIS
1249-
'fugue --in=epi.nii --mask=epi_mask.nii --loadshift=vsm.nii --unwarpdir=y --unwarp=.../epi_unwarped.nii.gz'
1262+
'fugue --in=epi.nii --mask=epi_mask.nii --loadshift=vsm.nii --unwarpdir=y --unwarp=epi_unwarped.nii.gz'
12501263
>>> fugue.run() #doctest: +SKIP
12511264
12521265
1253-
Example (warping an input image, shift map is known) ::
1266+
Warping an input image (shift map is known) ::
12541267
12551268
>>> from nipype.interfaces.fsl.preprocess import FUGUE
12561269
>>> fugue = FUGUE()
@@ -1260,21 +1273,21 @@ class FUGUE(FSLCommand):
12601273
>>> fugue.inputs.shift_in_file = 'vsm.nii' # Previously computed with fugue as well
12611274
>>> fugue.inputs.unwarp_direction = 'y'
12621275
>>> fugue.cmdline #doctest: +ELLIPSIS
1263-
'fugue --in=epi.nii --mask=epi_mask.nii --loadshift=vsm.nii --unwarpdir=y --warp=.../epi_warped.nii.gz'
1276+
'fugue --in=epi.nii --mask=epi_mask.nii --loadshift=vsm.nii --unwarpdir=y --warp=epi_warped.nii.gz'
12641277
>>> fugue.run() #doctest: +SKIP
12651278
12661279
1267-
Example (computing the vsm, unwrapped phase map is known) ::
1280+
Computing the vsm (unwrapped phase map is known) ::
12681281
12691282
>>> from nipype.interfaces.fsl.preprocess import FUGUE
12701283
>>> fugue = FUGUE()
12711284
>>> fugue.inputs.phasemap_in_file = 'epi_phasediff.nii'
12721285
>>> fugue.inputs.mask_file = 'epi_mask.nii'
1273-
>>> fugue.inputs.dwell_to_asym_ratio = 0.77e-3 / 2.46e-3
1286+
>>> fugue.inputs.dwell_to_asym_ratio = (0.77e-3 * 3) / 2.46e-3
12741287
>>> fugue.inputs.unwarp_direction = 'y'
12751288
>>> fugue.inputs.save_shift = True
12761289
>>> fugue.cmdline #doctest: +ELLIPSIS
1277-
'fugue --dwelltoasym=0.7000000000 --mask=epi_mask.nii --phasemap=epi_phasediff.nii --saveshift=.../epi_phasediff_vsm.nii.gz --unwarpdir=y'
1290+
'fugue --dwelltoasym=0.3130081301 --mask=epi_mask.nii --phasemap=epi_phasediff.nii --saveshift=epi_phasediff_vsm.nii.gz --unwarpdir=y'
12781291
>>> fugue.run() #doctest: +SKIP
12791292
12801293

nipype/workflows/dmri/fsl/epi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ def fieldmap_correction(name='fieldmap_correction', nocheck=False):
337337
,(inputnode, mask_mag, [('in_mask', 'mask_file' )])
338338
,(select_mag, mask_mag, [('roi_file', 'in_file')])
339339
,(mask_mag, fslprep, [('out_file', 'in_magnitude')])
340-
,(fslprep, vsm, [('out_fieldmap', 'phasemap_file')])
340+
,(fslprep, vsm, [('out_fieldmap', 'phasemap_in_file')])
341341
,(inputnode, vsm, [('fieldmap_mag', 'in_file'),
342342
('encoding_direction','unwarp_direction'),
343343
(('te_diff', _ms2sec), 'asym_se_time'),
@@ -550,7 +550,7 @@ def create_epidewarp_pipeline(name='epidewarp', fieldmap_registration=False):
550550
,(mask_mag_dil, prelude, [('out_file', 'mask_file')])
551551
,(prelude, fill_phase, [('unwrapped_phase_file', 'in_file')])
552552
,(inputnode, vsm, [('fieldmap_mag', 'in_file')])
553-
,(fill_phase, vsm, [('out_file', 'phasemap_file')])
553+
,(fill_phase, vsm, [('out_file', 'phasemap_in_file')])
554554
,(inputnode, vsm, [(('te_diff', _ms2sec), 'asym_se_time'), ('vsm_sigma', 'smooth2d')])
555555
,(dwell_time, vsm, [(('dwell_time', _ms2sec), 'dwell_time')])
556556
,(mask_mag_dil, vsm, [('out_file', 'mask_file')])

0 commit comments

Comments
 (0)