From f46fb75574d9102b72c4b7067302155d0306035b Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 11 Jun 2014 12:32:41 +0200 Subject: [PATCH 01/11] Bugfix in FUGUE and doctest added FUGUE interface was adding wrong parameter in forward warping mode. Added the missing doctest of the interface. --- CHANGES | 1 + nipype/interfaces/fsl/preprocess.py | 41 ++++++++++++------- .../interfaces/fsl/tests/test_auto_FUGUE.py | 1 - 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/CHANGES b/CHANGES index f4ebb73be0..4fb242cb24 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,7 @@ Next Release ============ +* FIX: FUGUE interface was adding wrong parameter in forward warping mode. * 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``). * ENH: New ANTs interface: ApplyTransformsToPoints * ENH: New FreeSurfer workflow: create_skullstripped_recon_flow() diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index 0d82b258ba..0592948017 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -678,17 +678,17 @@ def _list_outputs(self): '_variance.ext', cwd=cwd) outputs['std_img'] = self._gen_fname(outputs['out_file'] + '_sigma.ext', cwd=cwd) - + # The mean image created if -stats option is specified ('meanvol') - # is missing the top and bottom slices. Therefore we only expose the - # mean image created by -meanvol option ('mean_reg') which isn't + # is missing the top and bottom slices. Therefore we only expose the + # mean image created by -meanvol option ('mean_reg') which isn't # corrupted. # Note that the same problem holds for the std and variance image. - + if isdefined(self.inputs.mean_vol) and self.inputs.mean_vol: outputs['mean_img'] = self._gen_fname(outputs['out_file'] + '_mean_reg.ext', cwd=cwd) - + if isdefined(self.inputs.save_mats) and self.inputs.save_mats: _, filename = os.path.split(outputs['out_file']) matpathname = os.path.join(cwd, filename + '.mat') @@ -1159,9 +1159,8 @@ def _gen_filename(self, name): class FUGUEInputSpec(FSLCommandInputSpec): in_file = File(exists=True, argstr='--in=%s', desc='filename of input volume') - unwarped_file = File( - argstr='--unwarp=%s', genfile=True, - desc='apply unwarping and save as filename', hash_files=False) + unwarped_file = File(argstr='--unwarp=%s', desc='apply unwarping and save as filename', + hash_files=False) forward_warping = traits.Bool( False, usedefault=True, desc='apply forward warping instead of unwarping') @@ -1242,7 +1241,16 @@ class FUGUE(FSLCommand): Examples -------- - Please insert examples for use of this command + >>> from nipype.interfaces.fsl.preprocess import FUGUE + >>> fugue = FUGUE() + >>> fugue.inputs.forward_warping = True + >>> fugue.inputs.in_file = 'epi.nii' + >>> fugue.inputs.mask_file = 'epi_mask.nii' + >>> fugue.inputs.shift_in_file = 'image.nii' # Previously computed with fugue as well + >>> fugue.inputs.unwarp_direction = 'y' + >>> fugue.cmdline #doctest: +ELLIPSIS + 'fugue --in=epi.nii --mask=epi_mask.nii --loadshift=image.nii --unwarpdir=y --warp=.../epi_warped.nii.gz' + >>> fugue.run() #doctest: +SKIP """ @@ -1257,10 +1265,14 @@ def __init__(self, **kwargs): def _list_outputs(self): outputs = self._outputs().get() - if self.inputs.forward_warping: + + if isdefined(self.inputs.forward_warping) and self.inputs.forward_warping: out_field = 'warped_file' + self.inputs.unwarped_file = Undefined + outputs.pop('unwarped_file') else: out_field = 'unwarped_file' + outputs.pop('warped_file') out_file = getattr(self.inputs, out_field) if not isdefined(out_file): @@ -1279,10 +1291,11 @@ def _list_outputs(self): return outputs def _gen_filename(self, name): - if name == 'unwarped_file' and not self.inputs.forward_warping: - return self._list_outputs()['unwarped_file'] - if name == 'warped_file' and self.inputs.forward_warping: - return self._list_outputs()['warped_file'] + is_fwd = isdefined(self.inputs.forward_warping) and self.inputs.forward_warping + + if (is_fwd and name=='warped_file') or (not is_fwd and name=='unwarped_file'): + return self._list_outputs()[name] + return None def _parse_inputs(self, skip=None): diff --git a/nipype/interfaces/fsl/tests/test_auto_FUGUE.py b/nipype/interfaces/fsl/tests/test_auto_FUGUE.py index d27a0f9d27..4de0f52fcf 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FUGUE.py +++ b/nipype/interfaces/fsl/tests/test_auto_FUGUE.py @@ -79,7 +79,6 @@ def test_FUGUE_inputs(): unwarp_direction=dict(argstr='--unwarpdir=%s', ), unwarped_file=dict(argstr='--unwarp=%s', - genfile=True, hash_files=False, ), warped_file=dict(argstr='--warp=%s', From 4ae194f79ddd95a0b6fef806940a67b456f5662a Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 11 Jun 2014 13:18:33 +0200 Subject: [PATCH 02/11] Fix incorrect requirement of FUGUE input --- nipype/interfaces/fsl/preprocess.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index 0d82b258ba..4cbd3220c7 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -678,17 +678,17 @@ def _list_outputs(self): '_variance.ext', cwd=cwd) outputs['std_img'] = self._gen_fname(outputs['out_file'] + '_sigma.ext', cwd=cwd) - + # The mean image created if -stats option is specified ('meanvol') - # is missing the top and bottom slices. Therefore we only expose the - # mean image created by -meanvol option ('mean_reg') which isn't + # is missing the top and bottom slices. Therefore we only expose the + # mean image created by -meanvol option ('mean_reg') which isn't # corrupted. # Note that the same problem holds for the std and variance image. - + if isdefined(self.inputs.mean_vol) and self.inputs.mean_vol: outputs['mean_img'] = self._gen_fname(outputs['out_file'] + '_mean_reg.ext', cwd=cwd) - + if isdefined(self.inputs.save_mats) and self.inputs.save_mats: _, filename = os.path.split(outputs['out_file']) matpathname = os.path.join(cwd, filename + '.mat') @@ -1223,7 +1223,7 @@ class FUGUEInputSpec(FSLCommandInputSpec): requires=['fmap_out_file'], desc='saves the unmasked fieldmap when using --savefmap') save_unmasked_shift = traits.Bool(argstr='--unmaskshift', - requires=['shift_out_file'], + requires=['save_shift'], desc='saves the unmasked shiftmap when using --saveshift') nokspace = traits.Bool( argstr='--nokspace', desc='do not use k-space forward warping') From 0998e5e6bfb049adf8754972e02c5dbb19d44b3d Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 11 Jun 2014 15:23:32 +0200 Subject: [PATCH 03/11] Run make specs to fix auto test --- nipype/interfaces/fsl/tests/test_auto_FUGUE.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nipype/interfaces/fsl/tests/test_auto_FUGUE.py b/nipype/interfaces/fsl/tests/test_auto_FUGUE.py index d27a0f9d27..977a49186c 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FUGUE.py +++ b/nipype/interfaces/fsl/tests/test_auto_FUGUE.py @@ -62,7 +62,7 @@ def test_FUGUE_inputs(): requires=['fmap_out_file'], ), save_unmasked_shift=dict(argstr='--unmaskshift', - requires=['shift_out_file'], + requires=['save_shift'], ), shift_in_file=dict(argstr='--loadshift=%s', ), From d9f3442c3036e1f50fb7be886407614581ed715d Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Fri, 4 Jul 2014 11:51:52 +0200 Subject: [PATCH 04/11] FUGUE interface refactored. Deeply reviewed the interface to use the new name_template system, along with the correction of several issues. Also includes changes of another PR, so close #856. --- nipype/interfaces/fsl/preprocess.py | 207 ++++++++++-------- .../interfaces/fsl/tests/test_auto_FUGUE.py | 16 +- nipype/testing/data/epi_phasediff.nii | 0 nipype/testing/data/vsm.nii | 0 4 files changed, 128 insertions(+), 95 deletions(-) create mode 100644 nipype/testing/data/epi_phasediff.nii create mode 100644 nipype/testing/data/vsm.nii diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index 3339b07f80..40d84b2d20 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -1159,34 +1159,27 @@ def _gen_filename(self, name): class FUGUEInputSpec(FSLCommandInputSpec): in_file = File(exists=True, argstr='--in=%s', desc='filename of input volume') + shift_in_file = File(exists=True, argstr='--loadshift=%s', + desc='filename for reading pixel shift volume') + phasemap_in_file = File(exists=True, argstr='--phasemap=%s', + desc='filename for input phase image') + fmap_in_file = File(exists=True, argstr='--loadfmap=%s', + desc='filename for loading fieldmap (rad/s)') unwarped_file = File(argstr='--unwarp=%s', desc='apply unwarping and save as filename', - hash_files=False) - forward_warping = traits.Bool( - False, usedefault=True, - desc='apply forward warping instead of unwarping') - warped_file = File(argstr='--warp=%s', - desc='apply forward warping and save as filename', - hash_files=False) - phasemap_file = File(exists=True, argstr='--phasemap=%s', - desc='filename for input phase image') + xor=['warped_file']) + warped_file = File(argstr='--warp=%s', desc='apply forward warping and save as filename', + xor=['unwarped_file']) + + forward_warping = traits.Bool(False, usedefault=True, mandatory=True, + desc='apply forward warping instead of unwarping') + dwell_to_asym_ratio = traits.Float(argstr='--dwelltoasym=%.10f', desc='set the dwell to asym time ratio') dwell_time = traits.Float(argstr='--dwell=%.10f', - desc='set the EPI dwell time per phase-encode line - same as echo spacing - (sec)') + desc=('set the EPI dwell time per phase-encode line - same as echo ' + 'spacing - (sec)')) asym_se_time = traits.Float(argstr='--asym=%.10f', desc='set the fieldmap asymmetric spin echo time (sec)') - fmap_out_file = File(argstr='--savefmap=%s', - desc='filename for saving fieldmap (rad/s)', hash_files=False) - fmap_in_file = File(exists=True, argstr='--loadfmap=%s', - desc='filename for loading fieldmap (rad/s)') - - save_shift = traits.Bool(desc='output pixel shift volume') - - shift_out_file = traits.File(argstr='--saveshift=%s', - desc='filename for saving pixel shift volume', hash_files=False) - - shift_in_file = File(exists=True, argstr='--loadshift=%s', - desc='filename for reading pixel shift volume') median_2dfilter = traits.Bool(argstr='--median', desc='apply 2D median filtering') despike_2dfilter = traits.Bool(argstr='--despike', @@ -1216,16 +1209,22 @@ class FUGUEInputSpec(FSLCommandInputSpec): desc='apply intensity correction to unwarping (pixel shift method only)') icorr_only = traits.Bool(argstr='--icorronly', requires=['unwarped_file'], desc='apply intensity correction only') - mask_file = File(exists=True, argstr='--mask=%s', - desc='filename for loading valid mask') - save_unmasked_fmap = traits.Bool(argstr='--unmaskfmap', - requires=['fmap_out_file'], - desc='saves the unmasked fieldmap when using --savefmap') - save_unmasked_shift = traits.Bool(argstr='--unmaskshift', - requires=['save_shift'], + mask_file = File(exists=True, argstr='--mask=%s', desc='filename for loading valid mask') + nokspace = traits.Bool(False, argstr='--nokspace', desc='do not use k-space forward warping') + + # Special outputs: shift (voxel shift map, vsm) + save_shift = traits.Bool(False, desc='write pixel shift volume') + shift_out_file = File(argstr='--saveshift=%s', desc='filename for saving pixel shift volume') + save_unmasked_shift = traits.Bool(argstr='--unmaskshift', xor=['save_shift'], desc='saves the unmasked shiftmap when using --saveshift') - nokspace = traits.Bool( - argstr='--nokspace', desc='do not use k-space forward warping') + + # Special outputs: fieldmap (fmap) + save_fmap = traits.Bool(False, desc='write field map volume') + fmap_out_file = File(argstr='--savefmap=%s', desc='filename for saving fieldmap (rad/s)') + save_unmasked_fmap = traits.Bool(False, argstr='--unmaskfmap', xor=['save_fmap'], + desc='saves the unmasked fieldmap when using --savefmap') + + class FUGUEOutputSpec(TraitedSpec): @@ -1238,87 +1237,121 @@ class FUGUEOutputSpec(TraitedSpec): class FUGUE(FSLCommand): """Use FSL FUGUE to unwarp epi's with fieldmaps - Examples - -------- + Example (unwarping an input image, the shift map is known) :: >>> from nipype.interfaces.fsl.preprocess import FUGUE >>> fugue = FUGUE() - >>> fugue.inputs.forward_warping = True >>> fugue.inputs.in_file = 'epi.nii' >>> fugue.inputs.mask_file = 'epi_mask.nii' - >>> fugue.inputs.shift_in_file = 'image.nii' # Previously computed with fugue as well + >>> fugue.inputs.shift_in_file = 'vsm.nii' # Previously computed with fugue as well >>> fugue.inputs.unwarp_direction = 'y' >>> fugue.cmdline #doctest: +ELLIPSIS - 'fugue --in=epi.nii --mask=epi_mask.nii --loadshift=image.nii --unwarpdir=y --warp=.../epi_warped.nii.gz' + 'fugue --in=epi.nii --mask=epi_mask.nii --loadshift=vsm.nii --unwarpdir=y --unwarp=.../epi_unwarped.nii.gz' >>> fugue.run() #doctest: +SKIP - """ - _cmd = 'fugue' - input_spec = FUGUEInputSpec - output_spec = FUGUEOutputSpec + Example (warping an input image, shift map is known) :: - def __init__(self, **kwargs): - super(FUGUE, self).__init__(**kwargs) - warn( - 'This interface has not been fully tested. Please report any failures.') - - def _list_outputs(self): - outputs = self._outputs().get() + >>> from nipype.interfaces.fsl.preprocess import FUGUE + >>> fugue = FUGUE() + >>> fugue.inputs.forward_warping = True + >>> fugue.inputs.in_file = 'epi.nii' + >>> fugue.inputs.mask_file = 'epi_mask.nii' + >>> fugue.inputs.shift_in_file = 'vsm.nii' # Previously computed with fugue as well + >>> fugue.inputs.unwarp_direction = 'y' + >>> fugue.cmdline #doctest: +ELLIPSIS + 'fugue --in=epi.nii --mask=epi_mask.nii --loadshift=vsm.nii --unwarpdir=y --warp=.../epi_warped.nii.gz' + >>> fugue.run() #doctest: +SKIP - if isdefined(self.inputs.forward_warping) and self.inputs.forward_warping: - out_field = 'warped_file' - self.inputs.unwarped_file = Undefined - outputs.pop('unwarped_file') - else: - out_field = 'unwarped_file' - outputs.pop('warped_file') - out_file = getattr(self.inputs, out_field) - if not isdefined(out_file): - if isdefined(self.inputs.in_file): - out_file = self._gen_fname(self.inputs.in_file, - suffix='_'+out_field[:-5]) - if isdefined(out_file): - outputs[out_field] = os.path.abspath(out_file) - if isdefined(self.inputs.fmap_out_file): - outputs['fmap_out_file'] = os.path.abspath( - self.inputs.fmap_out_file) - if isdefined(self.inputs.shift_out_file): - outputs['shift_out_file'] = os.path.abspath( - self.inputs.shift_out_file) + Example (computing the vsm, unwrapped phase map is known) :: - return outputs + >>> from nipype.interfaces.fsl.preprocess import FUGUE + >>> fugue = FUGUE() + >>> fugue.inputs.phasemap_in_file = 'epi_phasediff.nii' + >>> fugue.inputs.mask_file = 'epi_mask.nii' + >>> fugue.inputs.dwell_to_asym_ratio = 0.77e-3 / 2.46e-3 + >>> fugue.inputs.unwarp_direction = 'y' + >>> fugue.inputs.save_shift = True + >>> fugue.cmdline #doctest: +ELLIPSIS + 'fugue --dwelltoasym=0.7000000000 --mask=epi_mask.nii --phasemap=epi_phasediff.nii --saveshift=.../epi_phasediff_vsm.nii.gz --unwarpdir=y' + >>> fugue.run() #doctest: +SKIP - def _gen_filename(self, name): - is_fwd = isdefined(self.inputs.forward_warping) and self.inputs.forward_warping - if (is_fwd and name=='warped_file') or (not is_fwd and name=='unwarped_file'): - return self._list_outputs()[name] + """ - return None + _cmd = 'fugue' + input_spec = FUGUEInputSpec + output_spec = FUGUEOutputSpec def _parse_inputs(self, skip=None): if skip is None: skip = [] - if not isdefined(self.inputs.save_shift) or not self.inputs.save_shift: - skip += ['shift_out_file'] - else: - if not isdefined(self.inputs.shift_out_file): - self.inputs.shift_out_file = self._gen_fname( - self.inputs.in_file, suffix='_vsm') + input_phase = isdefined(self.inputs.phasemap_in_file) + input_vsm = isdefined(self.inputs.shift_in_file) + input_fmap = isdefined(self.inputs.fmap_in_file) + + if not input_phase and not input_vsm and not input_fmap: + raise RuntimeError('Either phasemap_in_file, shift_in_file or fmap_in_file must be set.') if not isdefined(self.inputs.in_file): skip += ['unwarped_file', 'warped_file'] - elif self.inputs.forward_warping: - if not isdefined(self.inputs.warped_file): - self.inputs.warped_file = self._gen_fname( - self.inputs.in_file, suffix='_warped') - elif not self.inputs.forward_warping: - if not isdefined(self.inputs.unwarped_file): - self.inputs.unwarped_file = self._gen_fname( - self.inputs.in_file, suffix='_unwarped') + else: + if self.inputs.forward_warping: + skip += ['unwarped_file'] + trait_spec = self.inputs.trait('warped_file') + trait_spec.name_template = "%s_warped" + trait_spec.name_source = ['in_file'] + trait_spec.output_name = 'warped_file' + else: + skip += ['warped_file'] + trait_spec = self.inputs.trait('unwarped_file') + trait_spec.name_template = "%s_unwarped" + trait_spec.name_source = ['in_file'] + trait_spec.output_name = 'unwarped_file' + + # Handle shift output + vsm_save_masked = isdefined(self.inputs.save_shift) and self.inputs.save_shift + vsm_save_unmasked = isdefined(self.inputs.save_unmasked_shift) \ + and self.inputs.save_unmasked_shift + + if (vsm_save_masked or vsm_save_unmasked) and not isdefined(self.inputs.shift_out_file): + trait_spec = self.inputs.trait('shift_out_file') + trait_spec.output_name = 'shift_out_file' + + if vsm_save_unmasked: + trait_spec.name_template = '%s_vsm_unmasked' + else: + trait_spec.name_template = '%s_vsm' + + if input_fmap: + trait_spec.name_source = ['fmap_in_file'] + elif input_phase: + trait_spec.name_source = ['phasemap_in_file'] + else: + trait_spec.name_source = ['shift_in_file'] + + # Handle fieldmap output + fmap_save_masked = isdefined(self.inputs.save_fmap) and self.inputs.save_shift + fmap_save_unmasked = isdefined(self.inputs.save_unmasked_fmap) and \ + self.inputs.save_unmasked_fmap + + if (fmap_save_masked or fmap_save_unmasked) and not isdefined(self.inputs.fmap_out_file): + trait_spec = self.inputs.trait('fmap_out_file') + trait_spec.output_name = 'fmap_out_file' + + if fmap_save_unmasked: + trait_spec.name_template = '%s_fieldmap_unmasked' + else: + trait_spec.name_template = '%s_fieldmap' + + if input_vsm: + trait_spec.name_source = ['shift_in_file'] + elif input_phase: + trait_spec.name_source = ['phasemap_in_file'] + else: + trait_spec.name_source = ['fmap_in_file'] return super(FUGUE, self)._parse_inputs(skip=skip) diff --git a/nipype/interfaces/fsl/tests/test_auto_FUGUE.py b/nipype/interfaces/fsl/tests/test_auto_FUGUE.py index 38754d9162..28d747d4a1 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FUGUE.py +++ b/nipype/interfaces/fsl/tests/test_auto_FUGUE.py @@ -21,9 +21,9 @@ def test_FUGUE_inputs(): fmap_in_file=dict(argstr='--loadfmap=%s', ), fmap_out_file=dict(argstr='--savefmap=%s', - hash_files=False, ), - forward_warping=dict(usedefault=True, + forward_warping=dict(mandatory=True, + usedefault=True, ), fourier_order=dict(argstr='--fourier=%d', ), @@ -53,21 +53,21 @@ def test_FUGUE_inputs(): ), phase_conjugate=dict(argstr='--phaseconj', ), - phasemap_file=dict(argstr='--phasemap=%s', + phasemap_in_file=dict(argstr='--phasemap=%s', ), poly_order=dict(argstr='--poly=%d', ), + save_fmap=dict(), save_shift=dict(), save_unmasked_fmap=dict(argstr='--unmaskfmap', - requires=['fmap_out_file'], + xor=['save_fmap'], ), save_unmasked_shift=dict(argstr='--unmaskshift', - requires=['save_shift'], + xor=['save_shift'], ), shift_in_file=dict(argstr='--loadshift=%s', ), shift_out_file=dict(argstr='--saveshift=%s', - hash_files=False, ), smooth2d=dict(argstr='--smooth2=%.2f', ), @@ -79,10 +79,10 @@ def test_FUGUE_inputs(): unwarp_direction=dict(argstr='--unwarpdir=%s', ), unwarped_file=dict(argstr='--unwarp=%s', - hash_files=False, + xor=['warped_file'], ), warped_file=dict(argstr='--warp=%s', - hash_files=False, + xor=['unwarped_file'], ), ) inputs = FUGUE.input_spec() diff --git a/nipype/testing/data/epi_phasediff.nii b/nipype/testing/data/epi_phasediff.nii new file mode 100644 index 0000000000..e69de29bb2 diff --git a/nipype/testing/data/vsm.nii b/nipype/testing/data/vsm.nii new file mode 100644 index 0000000000..e69de29bb2 From d24c5cd33e30ee777a5625681d12f03495318195 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Fri, 4 Jul 2014 12:07:59 +0200 Subject: [PATCH 05/11] Fixed doctests. Fixed fsl.epi workflow. The workflow was using an input with its name changed. --- CHANGES | 2 +- nipype/interfaces/fsl/preprocess.py | 29 +++++++++++++++++++++-------- nipype/workflows/dmri/fsl/epi.py | 4 ++-- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/CHANGES b/CHANGES index 4fb242cb24..573fc27183 100644 --- a/CHANGES +++ b/CHANGES @@ -1,7 +1,7 @@ Next Release ============ -* FIX: FUGUE interface was adding wrong parameter in forward warping mode. +* ENH: FUGUE interface has been refactored to use the name_template system, 3 examples added to doctests, some bugs solved. * 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``). * ENH: New ANTs interface: ApplyTransformsToPoints * ENH: New FreeSurfer workflow: create_skullstripped_recon_flow() diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index 40d84b2d20..627ea96b71 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -1235,9 +1235,22 @@ class FUGUEOutputSpec(TraitedSpec): class FUGUE(FSLCommand): - """Use FSL FUGUE to unwarp epi's with fieldmaps + """ + `FUGUE `_ is, most generally, a set of tools for + EPI distortion correction. + + Distortions may be corrected for + 1. improving registration with non-distorted images (e.g. structurals), or + 2. dealing with motion-dependent changes. + + FUGUE is designed to deal only with the first case - improving registration. + + + Examples + -------- + - Example (unwarping an input image, the shift map is known) :: + Unwarping an input image (shift map is known) :: >>> from nipype.interfaces.fsl.preprocess import FUGUE >>> fugue = FUGUE() @@ -1246,11 +1259,11 @@ class FUGUE(FSLCommand): >>> fugue.inputs.shift_in_file = 'vsm.nii' # Previously computed with fugue as well >>> fugue.inputs.unwarp_direction = 'y' >>> fugue.cmdline #doctest: +ELLIPSIS - 'fugue --in=epi.nii --mask=epi_mask.nii --loadshift=vsm.nii --unwarpdir=y --unwarp=.../epi_unwarped.nii.gz' + 'fugue --in=epi.nii --mask=epi_mask.nii --loadshift=vsm.nii --unwarpdir=y --unwarp=epi_unwarped.nii.gz' >>> fugue.run() #doctest: +SKIP - Example (warping an input image, shift map is known) :: + Warping an input image (shift map is known) :: >>> from nipype.interfaces.fsl.preprocess import FUGUE >>> fugue = FUGUE() @@ -1260,21 +1273,21 @@ class FUGUE(FSLCommand): >>> fugue.inputs.shift_in_file = 'vsm.nii' # Previously computed with fugue as well >>> fugue.inputs.unwarp_direction = 'y' >>> fugue.cmdline #doctest: +ELLIPSIS - 'fugue --in=epi.nii --mask=epi_mask.nii --loadshift=vsm.nii --unwarpdir=y --warp=.../epi_warped.nii.gz' + 'fugue --in=epi.nii --mask=epi_mask.nii --loadshift=vsm.nii --unwarpdir=y --warp=epi_warped.nii.gz' >>> fugue.run() #doctest: +SKIP - Example (computing the vsm, unwrapped phase map is known) :: + Computing the vsm (unwrapped phase map is known) :: >>> from nipype.interfaces.fsl.preprocess import FUGUE >>> fugue = FUGUE() >>> fugue.inputs.phasemap_in_file = 'epi_phasediff.nii' >>> fugue.inputs.mask_file = 'epi_mask.nii' - >>> fugue.inputs.dwell_to_asym_ratio = 0.77e-3 / 2.46e-3 + >>> fugue.inputs.dwell_to_asym_ratio = (0.77e-3 * 3) / 2.46e-3 >>> fugue.inputs.unwarp_direction = 'y' >>> fugue.inputs.save_shift = True >>> fugue.cmdline #doctest: +ELLIPSIS - 'fugue --dwelltoasym=0.7000000000 --mask=epi_mask.nii --phasemap=epi_phasediff.nii --saveshift=.../epi_phasediff_vsm.nii.gz --unwarpdir=y' + 'fugue --dwelltoasym=0.3130081301 --mask=epi_mask.nii --phasemap=epi_phasediff.nii --saveshift=epi_phasediff_vsm.nii.gz --unwarpdir=y' >>> fugue.run() #doctest: +SKIP diff --git a/nipype/workflows/dmri/fsl/epi.py b/nipype/workflows/dmri/fsl/epi.py index 194b62c9e0..48fb6e8b32 100644 --- a/nipype/workflows/dmri/fsl/epi.py +++ b/nipype/workflows/dmri/fsl/epi.py @@ -337,7 +337,7 @@ def fieldmap_correction(name='fieldmap_correction', nocheck=False): ,(inputnode, mask_mag, [('in_mask', 'mask_file' )]) ,(select_mag, mask_mag, [('roi_file', 'in_file')]) ,(mask_mag, fslprep, [('out_file', 'in_magnitude')]) - ,(fslprep, vsm, [('out_fieldmap', 'phasemap_file')]) + ,(fslprep, vsm, [('out_fieldmap', 'phasemap_in_file')]) ,(inputnode, vsm, [('fieldmap_mag', 'in_file'), ('encoding_direction','unwarp_direction'), (('te_diff', _ms2sec), 'asym_se_time'), @@ -550,7 +550,7 @@ def create_epidewarp_pipeline(name='epidewarp', fieldmap_registration=False): ,(mask_mag_dil, prelude, [('out_file', 'mask_file')]) ,(prelude, fill_phase, [('unwrapped_phase_file', 'in_file')]) ,(inputnode, vsm, [('fieldmap_mag', 'in_file')]) - ,(fill_phase, vsm, [('out_file', 'phasemap_file')]) + ,(fill_phase, vsm, [('out_file', 'phasemap_in_file')]) ,(inputnode, vsm, [(('te_diff', _ms2sec), 'asym_se_time'), ('vsm_sigma', 'smooth2d')]) ,(dwell_time, vsm, [(('dwell_time', _ms2sec), 'dwell_time')]) ,(mask_mag_dil, vsm, [('out_file', 'mask_file')]) From 3a8257808a2268260509404fbb7500f9bfb7b317 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Fri, 4 Jul 2014 12:17:35 +0200 Subject: [PATCH 06/11] Fixed doctest --- nipype/interfaces/fsl/preprocess.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index 627ea96b71..fe55382a65 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -1287,7 +1287,7 @@ class FUGUE(FSLCommand): >>> fugue.inputs.unwarp_direction = 'y' >>> fugue.inputs.save_shift = True >>> fugue.cmdline #doctest: +ELLIPSIS - 'fugue --dwelltoasym=0.3130081301 --mask=epi_mask.nii --phasemap=epi_phasediff.nii --saveshift=epi_phasediff_vsm.nii.gz --unwarpdir=y' + 'fugue --dwelltoasym=0.9390243902 --mask=epi_mask.nii --phasemap=epi_phasediff.nii --saveshift=epi_phasediff_vsm.nii.gz --unwarpdir=y' >>> fugue.run() #doctest: +SKIP From d577f5db6f23ac3a09601b233b65683e722f3b0d Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Mon, 7 Jul 2014 15:42:23 +0200 Subject: [PATCH 07/11] Added requirements of interface. Also replaced the name_source dynamic setting with str instead of lists, as it seems to produce errors when executing as MapNode of workflows. --- nipype/interfaces/fsl/preprocess.py | 22 +++++++++---------- .../interfaces/fsl/tests/test_auto_FUGUE.py | 3 +++ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index fe55382a65..1e93e278aa 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -1166,11 +1166,11 @@ class FUGUEInputSpec(FSLCommandInputSpec): fmap_in_file = File(exists=True, argstr='--loadfmap=%s', desc='filename for loading fieldmap (rad/s)') unwarped_file = File(argstr='--unwarp=%s', desc='apply unwarping and save as filename', - xor=['warped_file']) + xor=['warped_file'], requires=['in_file']) warped_file = File(argstr='--warp=%s', desc='apply forward warping and save as filename', - xor=['unwarped_file']) + xor=['unwarped_file'], requires=['in_file']) - forward_warping = traits.Bool(False, usedefault=True, mandatory=True, + forward_warping = traits.Bool(False, usedefault=True, mandatory=True, requires=['in_file'], desc='apply forward warping instead of unwarping') dwell_to_asym_ratio = traits.Float(argstr='--dwelltoasym=%.10f', @@ -1315,13 +1315,13 @@ def _parse_inputs(self, skip=None): skip += ['unwarped_file'] trait_spec = self.inputs.trait('warped_file') trait_spec.name_template = "%s_warped" - trait_spec.name_source = ['in_file'] + trait_spec.name_source = 'in_file' trait_spec.output_name = 'warped_file' else: skip += ['warped_file'] trait_spec = self.inputs.trait('unwarped_file') trait_spec.name_template = "%s_unwarped" - trait_spec.name_source = ['in_file'] + trait_spec.name_source = 'in_file' trait_spec.output_name = 'unwarped_file' # Handle shift output @@ -1339,11 +1339,11 @@ def _parse_inputs(self, skip=None): trait_spec.name_template = '%s_vsm' if input_fmap: - trait_spec.name_source = ['fmap_in_file'] + trait_spec.name_source = 'fmap_in_file' elif input_phase: - trait_spec.name_source = ['phasemap_in_file'] + trait_spec.name_source = 'phasemap_in_file' else: - trait_spec.name_source = ['shift_in_file'] + trait_spec.name_source = 'shift_in_file' # Handle fieldmap output fmap_save_masked = isdefined(self.inputs.save_fmap) and self.inputs.save_shift @@ -1360,11 +1360,11 @@ def _parse_inputs(self, skip=None): trait_spec.name_template = '%s_fieldmap' if input_vsm: - trait_spec.name_source = ['shift_in_file'] + trait_spec.name_source = 'shift_in_file' elif input_phase: - trait_spec.name_source = ['phasemap_in_file'] + trait_spec.name_source = 'phasemap_in_file' else: - trait_spec.name_source = ['fmap_in_file'] + trait_spec.name_source = 'fmap_in_file' return super(FUGUE, self)._parse_inputs(skip=skip) diff --git a/nipype/interfaces/fsl/tests/test_auto_FUGUE.py b/nipype/interfaces/fsl/tests/test_auto_FUGUE.py index 28d747d4a1..5b3f1f2831 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FUGUE.py +++ b/nipype/interfaces/fsl/tests/test_auto_FUGUE.py @@ -23,6 +23,7 @@ def test_FUGUE_inputs(): fmap_out_file=dict(argstr='--savefmap=%s', ), forward_warping=dict(mandatory=True, + requires=['in_file'], usedefault=True, ), fourier_order=dict(argstr='--fourier=%d', @@ -79,9 +80,11 @@ def test_FUGUE_inputs(): unwarp_direction=dict(argstr='--unwarpdir=%s', ), unwarped_file=dict(argstr='--unwarp=%s', + requires=['in_file'], xor=['warped_file'], ), warped_file=dict(argstr='--warp=%s', + requires=['in_file'], xor=['unwarped_file'], ), ) From cd329a4d75effb50cf1c020dc9881805aa47ec5a Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Mon, 7 Jul 2014 16:10:31 +0200 Subject: [PATCH 08/11] Removed requires as it breaks doctests --- nipype/interfaces/fsl/preprocess.py | 4 ++-- nipype/interfaces/fsl/tests/test_auto_FUGUE.py | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index 1e93e278aa..598aa3334f 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -1170,7 +1170,7 @@ class FUGUEInputSpec(FSLCommandInputSpec): warped_file = File(argstr='--warp=%s', desc='apply forward warping and save as filename', xor=['unwarped_file'], requires=['in_file']) - forward_warping = traits.Bool(False, usedefault=True, mandatory=True, requires=['in_file'], + forward_warping = traits.Bool(False, usedefault=True, desc='apply forward warping instead of unwarping') dwell_to_asym_ratio = traits.Float(argstr='--dwelltoasym=%.10f', @@ -1267,8 +1267,8 @@ class FUGUE(FSLCommand): >>> from nipype.interfaces.fsl.preprocess import FUGUE >>> fugue = FUGUE() - >>> fugue.inputs.forward_warping = True >>> fugue.inputs.in_file = 'epi.nii' + >>> fugue.inputs.forward_warping = True >>> fugue.inputs.mask_file = 'epi_mask.nii' >>> fugue.inputs.shift_in_file = 'vsm.nii' # Previously computed with fugue as well >>> fugue.inputs.unwarp_direction = 'y' diff --git a/nipype/interfaces/fsl/tests/test_auto_FUGUE.py b/nipype/interfaces/fsl/tests/test_auto_FUGUE.py index 5b3f1f2831..e1bcbadfa5 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FUGUE.py +++ b/nipype/interfaces/fsl/tests/test_auto_FUGUE.py @@ -22,9 +22,7 @@ def test_FUGUE_inputs(): ), fmap_out_file=dict(argstr='--savefmap=%s', ), - forward_warping=dict(mandatory=True, - requires=['in_file'], - usedefault=True, + forward_warping=dict(usedefault=True, ), fourier_order=dict(argstr='--fourier=%d', ), From f0838959b4fe8a991a75cb657572fb4fb7435113 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Tue, 8 Jul 2014 11:34:10 +0200 Subject: [PATCH 09/11] Fixed some (too) long logical statements to agree with PEP8 --- nipype/interfaces/fsl/preprocess.py | 58 +++++++++++-------- .../interfaces/fsl/tests/test_auto_FUGUE.py | 6 +- 2 files changed, 39 insertions(+), 25 deletions(-) diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index 598aa3334f..0822c11949 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -1213,13 +1213,15 @@ class FUGUEInputSpec(FSLCommandInputSpec): nokspace = traits.Bool(False, argstr='--nokspace', desc='do not use k-space forward warping') # Special outputs: shift (voxel shift map, vsm) - save_shift = traits.Bool(False, desc='write pixel shift volume') + save_shift = traits.Bool(False, xor=['save_unmasked_shift'], + desc='write pixel shift volume') shift_out_file = File(argstr='--saveshift=%s', desc='filename for saving pixel shift volume') save_unmasked_shift = traits.Bool(argstr='--unmaskshift', xor=['save_shift'], desc='saves the unmasked shiftmap when using --saveshift') # Special outputs: fieldmap (fmap) - save_fmap = traits.Bool(False, desc='write field map volume') + save_fmap = traits.Bool(False, xor=['save_unmasked_fmap'], + desc='write field map volume') fmap_out_file = File(argstr='--savefmap=%s', desc='filename for saving fieldmap (rad/s)') save_unmasked_fmap = traits.Bool(False, argstr='--unmaskfmap', xor=['save_fmap'], desc='saves the unmasked fieldmap when using --savefmap') @@ -1325,46 +1327,56 @@ def _parse_inputs(self, skip=None): trait_spec.output_name = 'unwarped_file' # Handle shift output - vsm_save_masked = isdefined(self.inputs.save_shift) and self.inputs.save_shift - vsm_save_unmasked = isdefined(self.inputs.save_unmasked_shift) \ - and self.inputs.save_unmasked_shift + vsm_save_masked = (isdefined(self.inputs.save_shift) and self.inputs.save_shift) + vsm_save_unmasked = (isdefined(self.inputs.save_unmasked_shift) and + self.inputs.save_unmasked_shift) - if (vsm_save_masked or vsm_save_unmasked) and not isdefined(self.inputs.shift_out_file): + if ((vsm_save_masked or vsm_save_unmasked) and + not isdefined(self.inputs.shift_out_file)): trait_spec = self.inputs.trait('shift_out_file') - trait_spec.output_name = 'shift_out_file' - - if vsm_save_unmasked: - trait_spec.name_template = '%s_vsm_unmasked' - else: - trait_spec.name_template = '%s_vsm' if input_fmap: trait_spec.name_source = 'fmap_in_file' elif input_phase: trait_spec.name_source = 'phasemap_in_file' - else: + elif input_vsm: trait_spec.name_source = 'shift_in_file' + else: + raise RuntimeError(('Either phasemap_in_file, shift_in_file or ' + 'fmap_in_file must be set.')) + + trait_spec.output_name = 'shift_out_file' + + if vsm_save_unmasked: + trait_spec.name_template = '%s_vsm_unmasked' + else: + trait_spec.name_template = '%s_vsm' # Handle fieldmap output fmap_save_masked = isdefined(self.inputs.save_fmap) and self.inputs.save_shift - fmap_save_unmasked = isdefined(self.inputs.save_unmasked_fmap) and \ - self.inputs.save_unmasked_fmap + fmap_save_unmasked = (isdefined(self.inputs.save_unmasked_fmap) and + self.inputs.save_unmasked_fmap) - if (fmap_save_masked or fmap_save_unmasked) and not isdefined(self.inputs.fmap_out_file): + if ((fmap_save_masked or fmap_save_unmasked) and + not isdefined(self.inputs.fmap_out_file)): trait_spec = self.inputs.trait('fmap_out_file') - trait_spec.output_name = 'fmap_out_file' - - if fmap_save_unmasked: - trait_spec.name_template = '%s_fieldmap_unmasked' - else: - trait_spec.name_template = '%s_fieldmap' if input_vsm: trait_spec.name_source = 'shift_in_file' elif input_phase: trait_spec.name_source = 'phasemap_in_file' - else: + elif input_fmap: trait_spec.name_source = 'fmap_in_file' + else: + raise RuntimeError(('Either phasemap_in_file, shift_in_file or ' + 'fmap_in_file must be set.')) + + trait_spec.output_name = 'fmap_out_file' + + if fmap_save_unmasked: + trait_spec.name_template = '%s_fieldmap_unmasked' + else: + trait_spec.name_template = '%s_fieldmap' return super(FUGUE, self)._parse_inputs(skip=skip) diff --git a/nipype/interfaces/fsl/tests/test_auto_FUGUE.py b/nipype/interfaces/fsl/tests/test_auto_FUGUE.py index e1bcbadfa5..918e80c519 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FUGUE.py +++ b/nipype/interfaces/fsl/tests/test_auto_FUGUE.py @@ -56,8 +56,10 @@ def test_FUGUE_inputs(): ), poly_order=dict(argstr='--poly=%d', ), - save_fmap=dict(), - save_shift=dict(), + save_fmap=dict(xor=['save_unmasked_fmap'], + ), + save_shift=dict(xor=['save_unmasked_shift'], + ), save_unmasked_fmap=dict(argstr='--unmaskfmap', xor=['save_fmap'], ), From 53bc39588b7acffa13f6192e318e3646ed727259 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Tue, 8 Jul 2014 11:54:15 +0200 Subject: [PATCH 10/11] Still having problems when running fugue inside a mapnode --- nipype/interfaces/fsl/preprocess.py | 92 +++++++++++++++-------------- 1 file changed, 48 insertions(+), 44 deletions(-) diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index 0822c11949..21ac7940e7 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -1327,56 +1327,60 @@ def _parse_inputs(self, skip=None): trait_spec.output_name = 'unwarped_file' # Handle shift output - vsm_save_masked = (isdefined(self.inputs.save_shift) and self.inputs.save_shift) - vsm_save_unmasked = (isdefined(self.inputs.save_unmasked_shift) and - self.inputs.save_unmasked_shift) - - if ((vsm_save_masked or vsm_save_unmasked) and - not isdefined(self.inputs.shift_out_file)): - trait_spec = self.inputs.trait('shift_out_file') - - if input_fmap: - trait_spec.name_source = 'fmap_in_file' - elif input_phase: - trait_spec.name_source = 'phasemap_in_file' - elif input_vsm: - trait_spec.name_source = 'shift_in_file' - else: - raise RuntimeError(('Either phasemap_in_file, shift_in_file or ' - 'fmap_in_file must be set.')) - - trait_spec.output_name = 'shift_out_file' + if not isdefined(self.inputs.shift_out_file): + vsm_save_masked = (isdefined(self.inputs.save_shift) and self.inputs.save_shift) + vsm_save_unmasked = (isdefined(self.inputs.save_unmasked_shift) and + self.inputs.save_unmasked_shift) + + if (vsm_save_masked or vsm_save_unmasked): + trait_spec = self.inputs.trait('shift_out_file') + trait_spec.output_name = 'shift_out_file' + + if input_fmap: + trait_spec.name_source = 'fmap_in_file' + elif input_phase: + trait_spec.name_source = 'phasemap_in_file' + elif input_vsm: + trait_spec.name_source = 'shift_in_file' + else: + raise RuntimeError(('Either phasemap_in_file, shift_in_file or ' + 'fmap_in_file must be set.')) - if vsm_save_unmasked: - trait_spec.name_template = '%s_vsm_unmasked' + if vsm_save_unmasked: + trait_spec.name_template = '%s_vsm_unmasked' + else: + trait_spec.name_template = '%s_vsm' else: - trait_spec.name_template = '%s_vsm' + skip += ['save_shift', 'save_unmasked_shift', 'shift_out_file'] # Handle fieldmap output - fmap_save_masked = isdefined(self.inputs.save_fmap) and self.inputs.save_shift - fmap_save_unmasked = (isdefined(self.inputs.save_unmasked_fmap) and - self.inputs.save_unmasked_fmap) - - if ((fmap_save_masked or fmap_save_unmasked) and - not isdefined(self.inputs.fmap_out_file)): - trait_spec = self.inputs.trait('fmap_out_file') - - if input_vsm: - trait_spec.name_source = 'shift_in_file' - elif input_phase: - trait_spec.name_source = 'phasemap_in_file' - elif input_fmap: - trait_spec.name_source = 'fmap_in_file' - else: - raise RuntimeError(('Either phasemap_in_file, shift_in_file or ' - 'fmap_in_file must be set.')) - - trait_spec.output_name = 'fmap_out_file' + if not isdefined(self.inputs.fmap_out_file): + fmap_save_masked = (isdefined(self.inputs.save_fmap) and self.inputs.save_fmap) + fmap_save_unmasked = (isdefined(self.inputs.save_unmasked_fmap) and + self.inputs.save_unmasked_fmap) + + if (fmap_save_masked or fmap_save_unmasked): + trait_spec = self.inputs.trait('fmap_out_file') + trait_spec.output_name = 'fmap_out_file' + + if input_vsm: + trait_spec.name_source = 'shift_in_file' + elif input_phase: + trait_spec.name_source = 'phasemap_in_file' + elif input_fmap: + trait_spec.name_source = 'fmap_in_file' + else: + raise RuntimeError(('Either phasemap_in_file, shift_in_file or ' + 'fmap_in_file must be set.')) - if fmap_save_unmasked: - trait_spec.name_template = '%s_fieldmap_unmasked' + if fmap_save_unmasked: + trait_spec.name_template = '%s_fieldmap_unmasked' + else: + trait_spec.name_template = '%s_fieldmap' else: - trait_spec.name_template = '%s_fieldmap' + skip += ['save_fmap', 'save_unmasked_fmap', 'fmap_out_file'] + + print skip return super(FUGUE, self)._parse_inputs(skip=skip) From 4015325483ec96d28771797a397836a0f9fdaa62 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Tue, 8 Jul 2014 12:44:26 +0200 Subject: [PATCH 11/11] Remove spurious print --- nipype/interfaces/fsl/preprocess.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index 21ac7940e7..7e6e2f1756 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -1380,8 +1380,6 @@ def _parse_inputs(self, skip=None): else: skip += ['save_fmap', 'save_unmasked_fmap', 'fmap_out_file'] - print skip - return super(FUGUE, self)._parse_inputs(skip=skip)