From 882b32d605cc3b544666f1fab5e23258bed58199 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Fri, 9 Oct 2015 12:37:12 +0200 Subject: [PATCH 01/73] name_source now supported at BaseInterface level --- nipype/interfaces/base.py | 166 ++++++++++++++++------------ nipype/interfaces/fsl/preprocess.py | 3 +- 2 files changed, 100 insertions(+), 69 deletions(-) diff --git a/nipype/interfaces/base.py b/nipype/interfaces/base.py index ac6b7b8af4..b363463380 100644 --- a/nipype/interfaces/base.py +++ b/nipype/interfaces/base.py @@ -776,6 +776,7 @@ def _get_trait_desc(self, inputs, name, spec): xor = spec.xor requires = spec.requires argstr = spec.argstr + ns = spec.name_source manhelpstr = ['\t%s' % name] @@ -820,6 +821,14 @@ def _get_trait_desc(self, inputs, name, spec): manhelpstr += wrap(line, 70, initial_indent='\t\trequires: ', subsequent_indent='\t\t ') + + if ns: + tpl = ', name_template not defined' + if spec.name_template: + tpl = ', name_template is \'%s\'' % spec.name_template + manhelpstr += wrap(('name source: %s' % ns) + tpl, 70, + initial_indent='\t\t', + subsequent_indent='\t\t ') return manhelpstr @classmethod @@ -911,6 +920,82 @@ def _check_xor(self, spec, name, value): self.__class__.__name__)) raise ValueError(msg) + def _resolve_namesource(self, name, chain=None): + if chain is None: + chain = [] + + trait_spec = self.inputs.trait(name) + retval = getattr(self.inputs, name) + + if not isdefined(retval) or "%s" in retval: + if not trait_spec.name_source: + return retval + if isdefined(retval) and "%s" in retval: + name_template = retval + else: + name_template = trait_spec.name_template + if not name_template: + name_template = "%s_generated" + + ns = trait_spec.name_source + while isinstance(ns, list): + if len(ns) > 1: + iflogger.warn('Only one name_source per trait is allowed') + ns = ns[0] + + if not isinstance(ns, six.string_types): + raise ValueError(('name_source of \'%s\' trait sould be an ' + 'input trait name') % name) + + if isdefined(getattr(self.inputs, ns)): + name_source = ns + source = getattr(self.inputs, name_source) + while isinstance(source, list): + source = source[0] + + # special treatment for files + try: + _, base, ext = split_filename(source) + except AttributeError: + base = source + else: + if name in chain: + raise NipypeInterfaceError('Mutually pointing name_sources') + + chain.append(name) + return self._resolve_namesource(ns, chain) + + retval = name_template % base + + if trait_spec.keep_extension is None or trait_spec.keep_extension: + retval += ext + + return retval + + + def _update_autonames(self): + """ + Checks for inputs undefined but providing name_source + """ + + metadata = dict(name_source=lambda t: t is not None) + for name, spec in self.inputs.traits(**metadata).items(): + value = getattr(self.inputs, name) + + if isdefined(value): + continue + + ns = spec.name_source + if ns is not None: + value = self._resolve_namesource(name) + + if not isdefined(value): + raise NipypeInterfaceError('Input %s with name_source=%s could ' + 'not be resolved' % (name, ns)) + setattr(self.inputs, name, value) + + + def _check_mandatory_inputs(self): """ Raises an exception if a mandatory input is Undefined """ @@ -1016,6 +1101,7 @@ def run(self, **inputs): """ self.inputs.set(**inputs) self._check_mandatory_inputs() + self._update_autonames() self._check_version_requirements(self.inputs) interface = self.__class__ # initialize provenance tracking @@ -1104,6 +1190,16 @@ def aggregate_outputs(self, runtime=None, needed_outputs=None): """ predicted_outputs = self._list_outputs() outputs = self._outputs() + + # fill automatically resolved outputs + metadata = dict(name_source=lambda t: t is not None) + + for name, spec in self.inputs.traits(**metadata).iteritems(): + out_name = name + if spec.output_name is not None: + out_name = spec.output_name + setattr(outputs, out_name, os.path.abspath(getattr(self.inputs, name))) + if predicted_outputs: _unavailable_outputs = [] if outputs: @@ -1403,6 +1499,7 @@ def cmdline(self): """ `command` plus any arguments (args) validates arguments and generates command line""" self._check_mandatory_inputs() + self._update_autonames() allargs = self._parse_inputs() allargs.insert(0, self.cmd) return ' '.join(allargs) @@ -1536,79 +1633,12 @@ def _format_arg(self, name, trait_spec, value): # Append options using format string. return argstr % value - def _filename_from_source(self, name, chain=None): - if chain is None: - chain = [] - - trait_spec = self.inputs.trait(name) - retval = getattr(self.inputs, name) - - if not isdefined(retval) or "%s" in retval: - if not trait_spec.name_source: - return retval - if isdefined(retval) and "%s" in retval: - name_template = retval - else: - name_template = trait_spec.name_template - if not name_template: - name_template = "%s_generated" - - ns = trait_spec.name_source - while isinstance(ns, list): - if len(ns) > 1: - iflogger.warn('Only one name_source per trait is allowed') - ns = ns[0] - - if not isinstance(ns, six.string_types): - raise ValueError(('name_source of \'%s\' trait sould be an ' - 'input trait name') % name) - - if isdefined(getattr(self.inputs, ns)): - name_source = ns - source = getattr(self.inputs, name_source) - while isinstance(source, list): - source = source[0] - - # special treatment for files - try: - _, base, _ = split_filename(source) - except AttributeError: - base = source - else: - if name in chain: - raise NipypeInterfaceError('Mutually pointing name_sources') - - chain.append(name) - base = self._filename_from_source(ns, chain) - - chain = None - retval = name_template % base - _, _, ext = split_filename(retval) - if trait_spec.keep_extension and ext: - return retval - return self._overload_extension(retval, name) - - return retval - def _gen_filename(self, name): raise NotImplementedError def _overload_extension(self, value, name=None): return value - def _list_outputs(self): - metadata = dict(name_source=lambda t: t is not None) - traits = self.inputs.traits(**metadata) - if traits: - outputs = self.output_spec().get() - for name, trait_spec in traits.iteritems(): - out_name = name - if trait_spec.output_name is not None: - out_name = trait_spec.output_name - outputs[out_name] = \ - os.path.abspath(self._filename_from_source(name)) - return outputs - def _parse_inputs(self, skip=None): """Parse all inputs using the ``argstr`` format string in the Trait. @@ -1629,7 +1659,7 @@ def _parse_inputs(self, skip=None): if skip and name in skip: continue value = getattr(self.inputs, name) - if spec.genfile or spec.name_source: + if spec.genfile: value = self._filename_from_source(name) if not isdefined(value): value = self._gen_filename(name) diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index e1246b457b..3ceea4fcee 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -38,7 +38,8 @@ class BETInputSpec(FSLCommandInputSpec): desc='input file to skull strip', argstr='%s', position=0, mandatory=True) out_file = File(desc='name of output skull stripped image', - argstr='%s', position=1, genfile=True, hash_files=False) + argstr='%s', position=1, name_source=['in_file'], + name_template='%s_brain', hash_files=False) outline = traits.Bool(desc='create surface outline image', argstr='-o') mask = traits.Bool(desc='create binary mask image', From 8fbe7bdc2112082e143908afdd41af4d6b8cd157 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Fri, 9 Oct 2015 12:43:25 +0200 Subject: [PATCH 02/73] remove call to _filename_from_source --- nipype/interfaces/base.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nipype/interfaces/base.py b/nipype/interfaces/base.py index b363463380..f671d5e87c 100644 --- a/nipype/interfaces/base.py +++ b/nipype/interfaces/base.py @@ -1660,9 +1660,7 @@ def _parse_inputs(self, skip=None): continue value = getattr(self.inputs, name) if spec.genfile: - value = self._filename_from_source(name) - if not isdefined(value): - value = self._gen_filename(name) + value = self._gen_filename(name) if not isdefined(value): continue arg = self._format_arg(name, spec, value) From 90daeeae2204ae46a045bd3e25ba29b6353d4600 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Fri, 9 Oct 2015 12:49:42 +0200 Subject: [PATCH 03/73] adding keep_extension=False to failing afni interfaces --- nipype/interfaces/afni/preprocess.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index ea7256ac77..78e6e46bcf 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -362,7 +362,7 @@ class AutoTcorrelateInputSpec(AFNICommandInputSpec): xor=['mask_only_targets']) out_file = File(name_template="%s_similarity_matrix.1D", desc='output image file name', - argstr='-prefix %s', name_source="in_file") + argstr='-prefix %s', name_source="in_file", keep_extension=False) class AutoTcorrelate(AFNICommand): @@ -1643,7 +1643,7 @@ class BlurInMaskInputSpec(AFNICommandInputSpec): exists=True, copyfile=False) out_file = File(name_template='%s_blur', desc='output to the file', argstr='-prefix %s', - name_source='in_file', position=-1) + name_source='in_file', position=-1, keep_extension=False) mask = File( desc='Mask dataset, if desired. Blurring will occur only within the mask. Voxels NOT in the mask will be set to zero in the output.', argstr='-mask %s') @@ -1940,7 +1940,7 @@ class AFNItoNIFTIInputSpec(AFNICommandInputSpec): exists=True, copyfile=False) out_file = File(name_template="%s.nii", desc='output image file name', - argstr='-prefix %s', name_source="in_file") + argstr='-prefix %s', name_source="in_file", keep_extension=False) hash_files = False class AFNItoNIFTI(AFNICommand): From 148529c556c95e0c10a55df7eb1375987946911e Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Fri, 9 Oct 2015 12:58:06 +0200 Subject: [PATCH 04/73] update CHANGES --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index cc73a3a154..a527afebf7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Next Release ============ + +* ENH: The name_source feature now available for all Interfaces derived from BaseInterface + (https://github.com/nipy/nipype/pull/1240) * ENH: New interfaces for interacting with AWS S3: S3DataSink and S3DataGrabber (https://github.com/nipy/nipype/pull/1201) Release 0.11.0 (September 15, 2015) From f8dfe7f21df051d45d22d6b4a00cccaf8968be7e Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Fri, 9 Oct 2015 13:07:26 +0200 Subject: [PATCH 05/73] re-enable _overload_extension --- nipype/interfaces/afni/preprocess.py | 5 +++-- nipype/interfaces/base.py | 13 +++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index 78e6e46bcf..2beb7ff800 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -689,8 +689,9 @@ class CopyInputSpec(AFNICommandInputSpec): mandatory=True, exists=True, copyfile=False) - out_file = File(name_template="%s_copy", desc='output image file name', - argstr='%s', position=-1, name_source="in_file") + out_file = File( + name_template="%s_copy", desc='output image file name', argstr='%s', + position=-1, name_source="in_file", keep_extension=False) class Copy(AFNICommand): diff --git a/nipype/interfaces/base.py b/nipype/interfaces/base.py index f671d5e87c..23225b1e24 100644 --- a/nipype/interfaces/base.py +++ b/nipype/interfaces/base.py @@ -947,6 +947,7 @@ def _resolve_namesource(self, name, chain=None): raise ValueError(('name_source of \'%s\' trait sould be an ' 'input trait name') % name) + ext = '' if isdefined(getattr(self.inputs, ns)): name_source = ns source = getattr(self.inputs, name_source) @@ -966,9 +967,10 @@ def _resolve_namesource(self, name, chain=None): return self._resolve_namesource(ns, chain) retval = name_template % base - - if trait_spec.keep_extension is None or trait_spec.keep_extension: - retval += ext + _, _, ext = split_filename(retval) + if trait_spec.keep_extension and ext: + return retval + return self._overload_extension(retval, name) return retval @@ -994,6 +996,8 @@ def _update_autonames(self): 'not be resolved' % (name, ns)) setattr(self.inputs, name, value) + def _overload_extension(self, value, name=None): + return value def _check_mandatory_inputs(self): @@ -1636,9 +1640,6 @@ def _format_arg(self, name, trait_spec, value): def _gen_filename(self, name): raise NotImplementedError - def _overload_extension(self, value, name=None): - return value - def _parse_inputs(self, skip=None): """Parse all inputs using the ``argstr`` format string in the Trait. From f591295c1940434a63c2ce4e62497d3e601d839d Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Fri, 9 Oct 2015 13:30:49 +0200 Subject: [PATCH 06/73] run _gen_filename only when value is not set --- nipype/interfaces/afni/preprocess.py | 2 +- nipype/interfaces/base.py | 11 ++++++----- nipype/interfaces/dcm2nii.py | 2 +- nipype/interfaces/freesurfer/model.py | 9 +++++---- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index 2beb7ff800..7344b6147d 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -691,7 +691,7 @@ class CopyInputSpec(AFNICommandInputSpec): copyfile=False) out_file = File( name_template="%s_copy", desc='output image file name', argstr='%s', - position=-1, name_source="in_file", keep_extension=False) + position=-1, name_source="in_file") class Copy(AFNICommand): diff --git a/nipype/interfaces/base.py b/nipype/interfaces/base.py index 23225b1e24..c9e7019ec1 100644 --- a/nipype/interfaces/base.py +++ b/nipype/interfaces/base.py @@ -947,7 +947,6 @@ def _resolve_namesource(self, name, chain=None): raise ValueError(('name_source of \'%s\' trait sould be an ' 'input trait name') % name) - ext = '' if isdefined(getattr(self.inputs, ns)): name_source = ns source = getattr(self.inputs, name_source) @@ -956,7 +955,7 @@ def _resolve_namesource(self, name, chain=None): # special treatment for files try: - _, base, ext = split_filename(source) + _, base, _ = split_filename(source) except AttributeError: base = source else: @@ -1660,10 +1659,12 @@ def _parse_inputs(self, skip=None): if skip and name in skip: continue value = getattr(self.inputs, name) - if spec.genfile: - value = self._gen_filename(name) if not isdefined(value): - continue + if spec.genfile: + value = self._gen_filename(name) + else: + continue + arg = self._format_arg(name, spec, value) if arg is None: continue diff --git a/nipype/interfaces/dcm2nii.py b/nipype/interfaces/dcm2nii.py index 31dc610789..c2b6859ef2 100644 --- a/nipype/interfaces/dcm2nii.py +++ b/nipype/interfaces/dcm2nii.py @@ -31,7 +31,7 @@ class Dcm2niiInputSpec(CommandLineInputSpec): gzip_output = traits.Bool(False, argstr='-g', usedefault=True) id_in_filename = traits.Bool(False, argstr='-i', usedefault=True) nii_output = traits.Bool(True, argstr='-n', usedefault=True) - output_dir = Directory(exists=True, argstr='-o %s', genfile=True) + output_dir = Directory('.', exists=True, argstr='-o %s', usedefault=True) protocol_in_filename = traits.Bool(True, argstr='-p', usedefault=True) reorient = traits.Bool(argstr='-r') spm_analyze = traits.Bool(argstr='-s', xor=['nii_output']) diff --git a/nipype/interfaces/freesurfer/model.py b/nipype/interfaces/freesurfer/model.py index 8394915488..2df1253895 100644 --- a/nipype/interfaces/freesurfer/model.py +++ b/nipype/interfaces/freesurfer/model.py @@ -341,7 +341,7 @@ def __init__(self, **kwargs): class BinarizeInputSpec(FSTraitedSpec): in_file = File(exists=True, argstr='--i %s', mandatory=True, - copyfile=False, desc='input volume') + copyfile=False, desc='input volume') min = traits.Float(argstr='--min %f', xor=['wm_ven_csf'], desc='min thresh') max = traits.Float(argstr='--max %f', xor=['wm_ven_csf'], @@ -358,8 +358,9 @@ class BinarizeInputSpec(FSTraitedSpec): desc='set match vals those for aseg ventricles+choroid (not 4th)') wm_ven_csf = traits.Bool(argstr='--wm+vcsf', xor=['min', 'max'], desc='WM and ventricular CSF, including choroid (not 4th)') - binary_file = File(argstr='--o %s', genfile=True, - desc='binary output volume') + binary_file = File( + argstr='--o %s', name_source='in_file', name_template='_bin', + keep_extension=True, desc='binary output volume') out_type = traits.Enum('nii', 'nii.gz', 'mgz', argstr='', desc='output file type') count_file = traits.Either(traits.Bool, File, @@ -408,7 +409,7 @@ class Binarize(FSCommand): >>> binvol = Binarize(in_file='structural.nii', min=10, binary_file='foo_out.nii') >>> binvol.cmdline - 'mri_binarize --o foo_out.nii --i structural.nii --min 10.000000' + 'mri_binarize --o structural_bin.nii --i structural.nii --min 10.000000' """ From 3cffec0a6e194fef3de3950a01603917f48732ca Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Fri, 9 Oct 2015 13:49:49 +0200 Subject: [PATCH 07/73] fixing doctests --- examples/test_spm.py | 8 ++++---- nipype/interfaces/afni/tests/test_auto_AFNItoNIFTI.py | 1 + .../interfaces/afni/tests/test_auto_AutoTcorrelate.py | 1 + nipype/interfaces/afni/tests/test_auto_BlurInMask.py | 1 + nipype/interfaces/base.py | 2 +- nipype/interfaces/freesurfer/model.py | 2 +- .../interfaces/freesurfer/tests/test_auto_Binarize.py | 4 +++- nipype/interfaces/fsl/tests/test_auto_BET.py | 3 ++- nipype/interfaces/io.py | 4 ++-- nipype/interfaces/spm/preprocess.py | 10 +++++----- nipype/interfaces/tests/test_auto_Dcm2nii.py | 2 +- nipype/utils/nipype_cmd.py | 2 +- 12 files changed, 23 insertions(+), 17 deletions(-) diff --git a/examples/test_spm.py b/examples/test_spm.py index 273066d49d..024b8ca3fe 100644 --- a/examples/test_spm.py +++ b/examples/test_spm.py @@ -13,8 +13,8 @@ stc.inputs.num_slices = 21 stc.inputs.time_repetition = 1.0 stc.inputs.time_acquisition = 2. - 2./32 -stc.inputs.slice_order = range(21,0,-1) -stc.inputs.ref_slice = 10 +stc.inputs.slice_order = range(21,0,-1) +stc.inputs.ref_slice = 10 realign_estimate = pe.Node(interface=spm.Realign(), name='realign_estimate') realign_estimate.inputs.jobtype = "estimate" @@ -48,8 +48,8 @@ stc.inputs.num_slices = 21 stc.inputs.time_repetition = 1.0 stc.inputs.time_acquisition = 2. - 2./32 -stc.inputs.slice_order = range(21,0,-1) -stc.inputs.ref_slice = 10 +stc.inputs.slice_order = range(21,0,-1) +stc.inputs.ref_slice = 10 realign_estimate = pe.Node(interface=spm.Realign(), name='realign_estimate') realign_estimate.inputs.jobtype = "estimate" diff --git a/nipype/interfaces/afni/tests/test_auto_AFNItoNIFTI.py b/nipype/interfaces/afni/tests/test_auto_AFNItoNIFTI.py index 348bc43c5f..c71048c0c0 100644 --- a/nipype/interfaces/afni/tests/test_auto_AFNItoNIFTI.py +++ b/nipype/interfaces/afni/tests/test_auto_AFNItoNIFTI.py @@ -17,6 +17,7 @@ def test_AFNItoNIFTI_inputs(): position=-1, ), out_file=dict(argstr='-prefix %s', + keep_extension=False, name_source='in_file', name_template='%s.nii', ), diff --git a/nipype/interfaces/afni/tests/test_auto_AutoTcorrelate.py b/nipype/interfaces/afni/tests/test_auto_AutoTcorrelate.py index c3b2cc0305..cc27201395 100644 --- a/nipype/interfaces/afni/tests/test_auto_AutoTcorrelate.py +++ b/nipype/interfaces/afni/tests/test_auto_AutoTcorrelate.py @@ -27,6 +27,7 @@ def test_AutoTcorrelate_inputs(): xor=['mask_only_targets'], ), out_file=dict(argstr='-prefix %s', + keep_extension=False, name_source='in_file', name_template='%s_similarity_matrix.1D', ), diff --git a/nipype/interfaces/afni/tests/test_auto_BlurInMask.py b/nipype/interfaces/afni/tests/test_auto_BlurInMask.py index 8ade0fc3f8..623c0b2fe6 100644 --- a/nipype/interfaces/afni/tests/test_auto_BlurInMask.py +++ b/nipype/interfaces/afni/tests/test_auto_BlurInMask.py @@ -31,6 +31,7 @@ def test_BlurInMask_inputs(): position=2, ), out_file=dict(argstr='-prefix %s', + keep_extension=False, name_source='in_file', name_template='%s_blur', position=-1, diff --git a/nipype/interfaces/base.py b/nipype/interfaces/base.py index c9e7019ec1..dd5f69b727 100644 --- a/nipype/interfaces/base.py +++ b/nipype/interfaces/base.py @@ -1023,7 +1023,7 @@ def _check_version_requirements(self, trait_object, raise_exception=True): # check minimum version check = dict(min_ver=lambda t: t is not None) names = trait_object.trait_names(**check) - + if names: version = LooseVersion(str(self.version)) if not version: diff --git a/nipype/interfaces/freesurfer/model.py b/nipype/interfaces/freesurfer/model.py index 2df1253895..da27d75952 100644 --- a/nipype/interfaces/freesurfer/model.py +++ b/nipype/interfaces/freesurfer/model.py @@ -407,7 +407,7 @@ class Binarize(FSCommand): Examples -------- - >>> binvol = Binarize(in_file='structural.nii', min=10, binary_file='foo_out.nii') + >>> binvol = Binarize(in_file='structural.nii', min=10) >>> binvol.cmdline 'mri_binarize --o structural_bin.nii --i structural.nii --min 10.000000' diff --git a/nipype/interfaces/freesurfer/tests/test_auto_Binarize.py b/nipype/interfaces/freesurfer/tests/test_auto_Binarize.py index cc889b3c24..309f733ea0 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_Binarize.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_Binarize.py @@ -14,7 +14,9 @@ def test_Binarize_inputs(): bin_val_not=dict(argstr='--binvalnot %d', ), binary_file=dict(argstr='--o %s', - genfile=True, + keep_extension=True, + name_source='in_file', + name_template='_bin', ), count_file=dict(argstr='--count %s', ), diff --git a/nipype/interfaces/fsl/tests/test_auto_BET.py b/nipype/interfaces/fsl/tests/test_auto_BET.py index b5df942520..a8a7949679 100644 --- a/nipype/interfaces/fsl/tests/test_auto_BET.py +++ b/nipype/interfaces/fsl/tests/test_auto_BET.py @@ -30,8 +30,9 @@ def test_BET_inputs(): no_output=dict(argstr='-n', ), out_file=dict(argstr='%s', - genfile=True, hash_files=False, + name_source=['in_file'], + name_template='%s_brain', position=1, ), outline=dict(argstr='-o', diff --git a/nipype/interfaces/io.py b/nipype/interfaces/io.py index 39ae774c21..3656dd0b46 100644 --- a/nipype/interfaces/io.py +++ b/nipype/interfaces/io.py @@ -423,7 +423,7 @@ def __setattr__(self, key, value): class S3DataSink(DataSink): """ Works exactly like DataSink, except the specified files will also be uploaded to Amazon S3 storage in the specified bucket - and location. 'bucket_path' is the s3 analog for + and location. 'bucket_path' is the s3 analog for 'base_directory'. """ @@ -585,7 +585,7 @@ def _list_outputs(self): isdefined(self.inputs.field_template) and \ key in self.inputs.field_template: template = self.inputs.field_template[key] # template override for multiple outfields - if isdefined(self.inputs.bucket_path): + if isdefined(self.inputs.bucket_path): template = os.path.join(self.inputs.bucket_path, template) if not args: filelist = [] diff --git a/nipype/interfaces/spm/preprocess.py b/nipype/interfaces/spm/preprocess.py index f6c9307d52..4d8102ac5d 100644 --- a/nipype/interfaces/spm/preprocess.py +++ b/nipype/interfaces/spm/preprocess.py @@ -209,7 +209,7 @@ def _list_outputs(self): outputs = self._outputs().get() resliced_all = self.inputs.write_which[0] > 0 resliced_mean = self.inputs.write_which[1] > 0 - + if self.inputs.jobtype != "write": if isdefined(self.inputs.in_files): outputs['realignment_parameters'] = [] @@ -765,7 +765,7 @@ class Segment(SPMCommand): input_spec = SegmentInputSpec output_spec = SegmentOutputSpec - + def __init__(self, **inputs): _local_version = SPMCommand().version if _local_version and '12.' in _local_version: @@ -774,7 +774,7 @@ def __init__(self, **inputs): else: self._jobtype = 'spatial' self._jobname = 'preproc' - + SPMCommand.__init__(self, **inputs) def _format_arg(self, opt, spec, val): @@ -894,7 +894,7 @@ class NewSegment(SPMCommand): input_spec = NewSegmentInputSpec output_spec = NewSegmentOutputSpec - + def __init__(self, **inputs): _local_version = SPMCommand().version if _local_version and '12.' in _local_version: @@ -903,7 +903,7 @@ def __init__(self, **inputs): else: self._jobtype = 'tools' self._jobname = 'preproc8' - + SPMCommand.__init__(self, **inputs) def _format_arg(self, opt, spec, val): diff --git a/nipype/interfaces/tests/test_auto_Dcm2nii.py b/nipype/interfaces/tests/test_auto_Dcm2nii.py index f5e61e103e..b9448c2779 100644 --- a/nipype/interfaces/tests/test_auto_Dcm2nii.py +++ b/nipype/interfaces/tests/test_auto_Dcm2nii.py @@ -39,7 +39,7 @@ def test_Dcm2nii_inputs(): usedefault=True, ), output_dir=dict(argstr='-o %s', - genfile=True, + usedefault=True, ), protocol_in_filename=dict(argstr='-p', usedefault=True, diff --git a/nipype/utils/nipype_cmd.py b/nipype/utils/nipype_cmd.py index 749650ef51..f795d44059 100644 --- a/nipype/utils/nipype_cmd.py +++ b/nipype/utils/nipype_cmd.py @@ -24,7 +24,7 @@ def add_options(parser=None, module=None, function=None): for name, spec in sorted(interface.inputs.traits(transient=None).items()): desc = "\n".join(interface._get_trait_desc(inputs, name, spec))[len(name)+2:] args = {} - + if spec.is_trait_type(traits.Bool): args["action"] = 'store_true' From 304fa3aa27efbdc3bb9cdd0d1e673cb2bdf23cac Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Fri, 9 Oct 2015 14:03:50 +0200 Subject: [PATCH 08/73] fix fsl.utils.WarpUtils name_source input --- nipype/interfaces/fsl/utils.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/nipype/interfaces/fsl/utils.py b/nipype/interfaces/fsl/utils.py index d9b09904d9..9ba25181ca 100644 --- a/nipype/interfaces/fsl/utils.py +++ b/nipype/interfaces/fsl/utils.py @@ -1579,11 +1579,12 @@ class WarpUtilsInputSpec(FSLCommandInputSpec): desc=('Alternative (to --warpres) specification of the resolution of ' 'the output spline-field.')) - out_file = File(argstr='--out=%s', position=-1, name_source = ['in_file'], output_name='out_file', - desc=('Name of output file. The format of the output depends on what other ' - 'parameters are set. The default format is a (4D) field-file. If the ' - '--outformat is set to spline the format will be a (4D) file of spline ' - 'coefficients.')) + out_file = File( + argstr='--out=%s', position=-1, name_source=['in_file'], name_template='%s_coeffs.nii', keep_extension=True, + desc=('Name of output file. The format of the output depends on what other ' + 'parameters are set. The default format is a (4D) field-file. If the ' + '--outformat is set to spline the format will be a (4D) file of spline ' + 'coefficients.')) write_jacobian = traits.Bool(False, mandatory=True, usedefault=True, desc='Switch on --jac flag with automatically generated filename') From 9ea4fe1b8bd0b71d1e69b0d77f44e479c32a29f8 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Fri, 9 Oct 2015 14:04:22 +0200 Subject: [PATCH 09/73] make specs --- nipype/interfaces/fsl/tests/test_auto_WarpUtils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nipype/interfaces/fsl/tests/test_auto_WarpUtils.py b/nipype/interfaces/fsl/tests/test_auto_WarpUtils.py index 2047a5a1b0..f9122ba860 100644 --- a/nipype/interfaces/fsl/tests/test_auto_WarpUtils.py +++ b/nipype/interfaces/fsl/tests/test_auto_WarpUtils.py @@ -17,8 +17,9 @@ def test_WarpUtils_inputs(): knot_space=dict(argstr='--knotspace=%d,%d,%d', ), out_file=dict(argstr='--out=%s', + keep_extension=True, name_source=['in_file'], - output_name='out_file', + name_template='%s_coeffs.nii', position=-1, ), out_format=dict(argstr='--outformat=%s', From 530abd25986e2fe4f3cb98d406f8393bd18a53b5 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Fri, 9 Oct 2015 18:42:10 +0200 Subject: [PATCH 10/73] fix doctest of Copy in afni --- nipype/interfaces/afni/preprocess.py | 170 +++++++++++++++++---------- 1 file changed, 107 insertions(+), 63 deletions(-) diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index 7344b6147d..b75061f6fb 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -56,6 +56,7 @@ class To3DInputSpec(AFNICommandInputSpec): class To3D(AFNICommand): + """Create a 3D dataset from 2D image files using AFNI to3d command For complete details, see the `to3d Documentation @@ -112,7 +113,7 @@ class TShiftInputSpec(AFNICommandInputSpec): ' default = Fourier', argstr='-%s') tpattern = traits.Str(desc='use specified slice time pattern rather than one in header', - argstr='-tpattern %s') + argstr='-tpattern %s') rlt = traits.Bool(desc='Before shifting, remove the mean and linear trend', argstr="-rlt") @@ -124,6 +125,7 @@ class TShiftInputSpec(AFNICommandInputSpec): class TShift(AFNICommand): + """Shifts voxel time series from input so that seperate slices are aligned to the same temporal origin @@ -182,10 +184,11 @@ class RefitInputSpec(CommandLineInputSpec): space = traits.Enum('TLRC', 'MNI', 'ORIG', argstr='-space %s', desc='Associates the dataset with a specific' + - ' template type, e.g. TLRC, MNI, ORIG') + ' template type, e.g. TLRC, MNI, ORIG') class Refit(CommandLine): + """Changes some of the information inside a 3D dataset's header For complete details, see the `3drefit Documentation. @@ -256,6 +259,7 @@ class WarpInputSpec(AFNICommandInputSpec): class Warp(AFNICommand): + """Use 3dWarp for spatially transforming a dataset For complete details, see the `3dWarp Documentation. @@ -314,6 +318,7 @@ class ResampleInputSpec(AFNICommandInputSpec): class Resample(AFNICommand): + """Resample or reorient an image using AFNI 3dresample command For complete details, see the `3dresample Documentation. @@ -357,15 +362,16 @@ class AutoTcorrelateInputSpec(AFNICommandInputSpec): argstr="-mask_only_targets", xor=['mask_source']) mask_source = File(exists=True, - desc="mask for source voxels", - argstr="-mask_source %s", - xor=['mask_only_targets']) + desc="mask for source voxels", + argstr="-mask_source %s", + xor=['mask_only_targets']) out_file = File(name_template="%s_similarity_matrix.1D", desc='output image file name', argstr='-prefix %s', name_source="in_file", keep_extension=False) class AutoTcorrelate(AFNICommand): + """Computes the correlation coefficient between the time series of each pair of voxels in the input dataset, and stores the output into a new anatomical bucket dataset [scaled to shorts to save memory space]. @@ -414,6 +420,7 @@ class TStatInputSpec(AFNICommandInputSpec): class TStat(AFNICommand): + """Compute voxel-wise statistics using AFNI 3dTstat command For complete details, see the `3dTstat Documentation. @@ -451,6 +458,7 @@ class DetrendInputSpec(AFNICommandInputSpec): class Detrend(AFNICommand): + """This program removes components from voxel time series using linear least squares @@ -489,6 +497,7 @@ class DespikeInputSpec(AFNICommandInputSpec): class Despike(AFNICommand): + """Removes 'spikes' from the 3D+time input dataset For complete details, see the `3dDespike Documentation. @@ -547,6 +556,7 @@ class AutomaskOutputSpec(TraitedSpec): class Automask(AFNICommand): + """Create a brain-only mask of the image using AFNI 3dAutomask command For complete details, see the `3dAutomask Documentation. @@ -590,8 +600,8 @@ class VolregInputSpec(AFNICommandInputSpec): argstr='-zpad %d', position=-5) md1d_file = File(name_template='%s_md.1D', desc='max displacement output file', - argstr='-maxdisp1D %s', name_source="in_file", - keep_extension=True, position=-4) + argstr='-maxdisp1D %s', name_source="in_file", + keep_extension=True, position=-4) oned_file = File(name_template='%s.1D', desc='1D movement parameters output file', argstr='-1Dfile %s', name_source="in_file", @@ -613,10 +623,12 @@ class VolregOutputSpec(TraitedSpec): out_file = File(desc='registered file', exists=True) md1d_file = File(desc='max displacement info file', exists=True) oned_file = File(desc='movement parameters info file', exists=True) - oned_matrix_save = File(desc='matrix transformation from base to input', exists=True) + oned_matrix_save = File( + desc='matrix transformation from base to input', exists=True) class Volreg(AFNICommand): + """Register input volumes to a base volume using AFNI 3dvolreg command For complete details, see the `3dvolreg Documentation. @@ -659,6 +671,7 @@ class MergeInputSpec(AFNICommandInputSpec): class Merge(AFNICommand): + """Merge or edit volumes using AFNI 3dmerge command For complete details, see the `3dmerge Documentation. @@ -691,10 +704,11 @@ class CopyInputSpec(AFNICommandInputSpec): copyfile=False) out_file = File( name_template="%s_copy", desc='output image file name', argstr='%s', - position=-1, name_source="in_file") + position=-1, name_source="in_file", keep_extension=True) class Copy(AFNICommand): + """Copies an image of one type to an image of the same or different type using 3dcopy command @@ -752,6 +766,7 @@ class FourierInputSpec(AFNICommandInputSpec): class Fourier(AFNICommand): + """Program to lowpass and/or highpass each voxel time series in a dataset, via the FFT @@ -862,6 +877,7 @@ class BandpassInputSpec(AFNICommandInputSpec): class Bandpass(AFNICommand): + """Program to lowpass and/or highpass each voxel time series in a dataset, offering more/different options than Fourier @@ -900,6 +916,7 @@ class ZCutUpInputSpec(AFNICommandInputSpec): class ZCutUp(AFNICommand): + """Cut z-slices from a volume using AFNI 3dZcutup command For complete details, see the `3dZcutup Documentation. @@ -1120,6 +1137,7 @@ class AllineateOutputSpec(TraitedSpec): class Allineate(AFNICommand): + """Program to align one dataset (the 'source') to a base dataset For complete details, see the `3dAllineate Documentation. @@ -1151,7 +1169,7 @@ def _list_outputs(self): outputs = self.output_spec().get() if not isdefined(self.inputs.out_file): outputs['out_file'] = self._gen_filename(self.inputs.in_file, - suffix=self.inputs.suffix) + suffix=self.inputs.suffix) else: outputs['out_file'] = os.path.abspath(self.inputs.out_file) return outputs @@ -1181,6 +1199,7 @@ class MaskaveInputSpec(AFNICommandInputSpec): class Maskave(AFNICommand): + """Computes average of all voxels in the input dataset which satisfy the criterion in the options list @@ -1218,6 +1237,7 @@ class SkullStripInputSpec(AFNICommandInputSpec): class SkullStrip(AFNICommand): + """A program to extract the brain from surrounding tissue from MRI T1-weighted images @@ -1253,6 +1273,7 @@ class TCatInputSpec(AFNICommandInputSpec): class TCat(AFNICommand): + """Concatenate sub-bricks from input datasets into one big 3D+time dataset @@ -1297,6 +1318,7 @@ class FimInputSpec(AFNICommandInputSpec): class Fim(AFNICommand): + """Program to calculate the cross-correlation of an ideal reference waveform with the measured FMRI time series for each voxel @@ -1347,6 +1369,7 @@ class TCorrelateInputSpec(AFNICommandInputSpec): class TCorrelate(AFNICommand): + """Computes the correlation coefficient between corresponding voxel time series in two input 3D+time datasets 'xset' and 'yset' @@ -1373,51 +1396,51 @@ class TCorrelate(AFNICommand): class TCorr1DInputSpec(AFNICommandInputSpec): - xset = File(desc = '3d+time dataset input', - argstr = ' %s', - position = -2, - mandatory = True, - exists = True, - copyfile=False) - y_1d = File(desc = '1D time series file input', - argstr = ' %s', - position = -1, - mandatory = True, - exists = True) - out_file = File(desc = 'output filename prefix', - name_template='%s_correlation.nii.gz', - argstr = '-prefix %s', - name_source = 'xset', - keep_extension = True) + xset = File(desc='3d+time dataset input', + argstr=' %s', + position=-2, + mandatory=True, + exists=True, + copyfile=False) + y_1d = File(desc='1D time series file input', + argstr=' %s', + position=-1, + mandatory=True, + exists=True) + out_file = File(desc='output filename prefix', + name_template='%s_correlation.nii.gz', + argstr='-prefix %s', + name_source='xset', + keep_extension=True) pearson = traits.Bool(desc='Correlation is the normal' + - ' Pearson correlation coefficient', - argstr=' -pearson', - xor=['spearman','quadrant','ktaub'], - position=1) + ' Pearson correlation coefficient', + argstr=' -pearson', + xor=['spearman', 'quadrant', 'ktaub'], + position=1) spearman = traits.Bool(desc='Correlation is the' + - ' Spearman (rank) correlation coefficient', - argstr=' -spearman', - xor=['pearson','quadrant','ktaub'], - position=1) + ' Spearman (rank) correlation coefficient', + argstr=' -spearman', + xor=['pearson', 'quadrant', 'ktaub'], + position=1) quadrant = traits.Bool(desc='Correlation is the' + - ' quadrant correlation coefficient', - argstr=' -quadrant', - xor=['pearson','spearman','ktaub'], - position=1) + ' quadrant correlation coefficient', + argstr=' -quadrant', + xor=['pearson', 'spearman', 'ktaub'], + position=1) ktaub = traits.Bool(desc='Correlation is the' + - ' Kendall\'s tau_b correlation coefficient', - argstr=' -ktaub', - xor=['pearson','spearman','quadrant'], - position=1) - + ' Kendall\'s tau_b correlation coefficient', + argstr=' -ktaub', + xor=['pearson', 'spearman', 'quadrant'], + position=1) class TCorr1DOutputSpec(TraitedSpec): - out_file = File(desc = 'output file containing correlations', - exists = True) + out_file = File(desc='output file containing correlations', + exists=True) class TCorr1D(AFNICommand): + """Computes the correlation coefficient between each voxel time series in the input 3D+time dataset. For complete details, see the `3dTcorr1D Documentation. @@ -1459,6 +1482,7 @@ class BrickStatOutputSpec(TraitedSpec): class BrickStat(AFNICommand): + """Compute maximum and/or minimum voxel values of an input dataset For complete details, see the `3dBrickStat Documentation. @@ -1538,10 +1562,11 @@ class ROIStatsInputSpec(CommandLineInputSpec): class ROIStatsOutputSpec(TraitedSpec): - stats = File(desc='output tab separated values file', exists=True) + stats = File(desc='output tab separated values file', exists=True) class ROIStats(CommandLine): + """Display statistics over masked regions For complete details, see the `3dROIstats Documentation. @@ -1593,6 +1618,7 @@ class CalcInputSpec(AFNICommandInputSpec): class Calc(AFNICommand): + """This program does voxel-by-voxel arithmetic on 3D datasets For complete details, see the `3dcalc Documentation. @@ -1668,6 +1694,7 @@ class BlurInMaskInputSpec(AFNICommandInputSpec): class BlurInMask(AFNICommand): + """ Blurs a dataset spatially inside a mask. That's all. Experimental. For complete details, see the `3dBlurInMask Documentation. @@ -1693,7 +1720,8 @@ class BlurInMask(AFNICommand): class TCorrMapInputSpec(AFNICommandInputSpec): - in_file = File(exists=True, argstr='-input %s', mandatory=True, copyfile=False) + in_file = File( + exists=True, argstr='-input %s', mandatory=True, copyfile=False) seeds = File(exists=True, argstr='-seed %s', xor=('seeds_width')) mask = File(exists=True, argstr='-mask %s') automask = traits.Bool(argstr='-automask') @@ -1763,6 +1791,7 @@ class TCorrMapOutputSpec(TraitedSpec): class TCorrMap(AFNICommand): + """ For each voxel time series, computes the correlation between it and all other voxels, and combines this set of values into the output dataset(s) in some way. @@ -1798,6 +1827,7 @@ def _format_arg(self, name, trait_spec, value): else: return super(TCorrMap, self)._format_arg(name, trait_spec, value) + class AutoboxInputSpec(AFNICommandInputSpec): in_file = File(exists=True, mandatory=True, argstr='-input %s', desc='input file', copyfile=False) @@ -1825,6 +1855,7 @@ class AutoboxOuputSpec(TraitedSpec): # out_file not mandatory class Autobox(AFNICommand): + """ Computes size of a box that fits around the volume. Also can be used to crop the volume to that box. @@ -1864,6 +1895,7 @@ def _gen_filename(self, name): return Undefined return super(Autobox, self)._gen_filename(name) + class RetroicorInputSpec(AFNICommandInputSpec): in_file = File(desc='input file to 3dretroicor', argstr='%s', @@ -1871,7 +1903,8 @@ class RetroicorInputSpec(AFNICommandInputSpec): mandatory=True, exists=True, copyfile=False) - out_file = File(desc='output image file name', argstr='-prefix %s', mandatory=True, position=1) + out_file = File( + desc='output image file name', argstr='-prefix %s', mandatory=True, position=1) card = File(desc='1D cardiac data file for cardiac correction', argstr='-card %s', position=-2, @@ -1898,6 +1931,7 @@ class RetroicorInputSpec(AFNICommandInputSpec): class Retroicor(AFNICommand): + """Performs Retrospective Image Correction for physiological motion effects, using a slightly modified version of the RETROICOR algorithm @@ -1935,16 +1969,18 @@ class Retroicor(AFNICommand): class AFNItoNIFTIInputSpec(AFNICommandInputSpec): in_file = File(desc='input file to 3dAFNItoNIFTI', - argstr='%s', - position=-1, - mandatory=True, - exists=True, - copyfile=False) + argstr='%s', + position=-1, + mandatory=True, + exists=True, + copyfile=False) out_file = File(name_template="%s.nii", desc='output image file name', argstr='-prefix %s', name_source="in_file", keep_extension=False) hash_files = False + class AFNItoNIFTI(AFNICommand): + """Changes AFNI format files to NIFTI format using 3dAFNItoNIFTI see AFNI Documentation: @@ -1975,6 +2011,7 @@ def _overload_extension(self, value): def _gen_filename(self, name): return os.path.abspath(super(AFNItoNIFTI, self)._gen_filename(name)) + class EvalInputSpec(AFNICommandInputSpec): in_file_a = File(desc='input file to 1deval', argstr='-a %s', position=0, mandatory=True, exists=True) @@ -1985,7 +2022,7 @@ class EvalInputSpec(AFNICommandInputSpec): out_file = File(name_template="%s_calc", desc='output image file name', argstr='-prefix %s', name_source="in_file_a") out1D = traits.Bool(desc="output in 1D", - argstr='-1D') + argstr='-1D') expr = traits.Str(desc='expr', argstr='-expr "%s"', position=3, mandatory=True) start_idx = traits.Int(desc='start index for in_file_a', @@ -1995,7 +2032,9 @@ class EvalInputSpec(AFNICommandInputSpec): single_idx = traits.Int(desc='volume index for in_file_a') other = File(desc='other options', argstr='') + class Eval(AFNICommand): + """Evaluates an expression that may include columns of data from one or more text files see AFNI Documentation: @@ -2036,16 +2075,17 @@ def _parse_inputs(self, skip=None): return super(Eval, self)._parse_inputs( skip=('start_idx', 'stop_idx', 'out1D', 'other')) + class MeansInputSpec(AFNICommandInputSpec): in_file_a = File(desc='input file to 3dMean', - argstr='%s', - position=0, - mandatory=True, - exists=True) + argstr='%s', + position=0, + mandatory=True, + exists=True) in_file_b = File(desc='another input file to 3dMean', - argstr='%s', - position=1, - exists=True) + argstr='%s', + position=1, + exists=True) out_file = File(name_template="%s_mean", desc='output image file name', argstr='-prefix %s', name_source="in_file_a") scale = traits.Str(desc='scaling of output', argstr='-%sscale') @@ -2053,11 +2093,15 @@ class MeansInputSpec(AFNICommandInputSpec): std_dev = traits.Bool(desc='calculate std dev', argstr='-stdev') sqr = traits.Bool(desc='mean square instead of value', argstr='-sqr') summ = traits.Bool(desc='take sum, (not average)', argstr='-sum') - count = traits.Bool(desc='compute count of non-zero voxels', argstr='-count') - mask_inter = traits.Bool(desc='create intersection mask', argstr='-mask_inter') + count = traits.Bool( + desc='compute count of non-zero voxels', argstr='-count') + mask_inter = traits.Bool( + desc='create intersection mask', argstr='-mask_inter') mask_union = traits.Bool(desc='create union mask', argstr='-mask_union') + class Means(AFNICommand): + """Takes the voxel-by-voxel mean of all input datasets using 3dMean see AFNI Documentation: From 748439aa3fdbe29c749bd40d9a0ccecc23f08151 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Fri, 9 Oct 2015 19:54:53 +0200 Subject: [PATCH 11/73] make-before-commit done --- nipype/interfaces/afni/tests/test_auto_Copy.py | 1 + 1 file changed, 1 insertion(+) diff --git a/nipype/interfaces/afni/tests/test_auto_Copy.py b/nipype/interfaces/afni/tests/test_auto_Copy.py index b9d7741d63..26de2439a3 100644 --- a/nipype/interfaces/afni/tests/test_auto_Copy.py +++ b/nipype/interfaces/afni/tests/test_auto_Copy.py @@ -17,6 +17,7 @@ def test_Copy_inputs(): position=-2, ), out_file=dict(argstr='%s', + keep_extension=True, name_source='in_file', name_template='%s_copy', position=-1, From 70808df413ed36634319ed272865b796c4ac191c Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Thu, 4 Feb 2016 20:42:12 -0800 Subject: [PATCH 12/73] added implementation of _list_outputs to BaseInterface --- nipype/interfaces/base.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nipype/interfaces/base.py b/nipype/interfaces/base.py index 743bea1889..e40f30b2a7 100644 --- a/nipype/interfaces/base.py +++ b/nipype/interfaces/base.py @@ -1196,9 +1196,14 @@ def _list_outputs(self): """ List the expected outputs """ if self.output_spec: - raise NotImplementedError + outputs = self.output_spec().get() + + for out_name in outputs.keys(): + if isdefined(getattr(self.inputs, out_name)): + outputs[out_name] = getattr(self.inputs, out_name) + return outputs else: - return None + raise NotImplementedError def aggregate_outputs(self, runtime=None, needed_outputs=None): """ Collate expected outputs and check for existence @@ -1706,6 +1711,7 @@ def _parse_inputs(self, skip=None): return first_args + all_args + last_args + class StdOutCommandLineInputSpec(CommandLineInputSpec): out_file = File(argstr="> %s", position=-1, genfile=True) From 779485c4645e4d6cd52de90166d7c75779f8ed98 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Fri, 12 Feb 2016 08:36:38 -0800 Subject: [PATCH 13/73] add pylint disable --- nipype/interfaces/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nipype/interfaces/base.py b/nipype/interfaces/base.py index 743bea1889..84f04a13e0 100644 --- a/nipype/interfaces/base.py +++ b/nipype/interfaces/base.py @@ -981,7 +981,7 @@ def _resolve_namesource(self, name, chain=None): retval = name_template % base _, _, ext = split_filename(retval) - if trait_spec.keep_extension and ext: + if ext and (not isdefined(trait_spec.keep_extension) or trait_spec.keep_extension): return retval return self._overload_extension(retval, name) @@ -1773,7 +1773,7 @@ class SEMLikeCommandLine(CommandLine): """ def _list_outputs(self): - outputs = self.output_spec().get() + outputs = self.output_spec().get() #pylint: disable=E1102 return self._outputs_from_inputs(outputs) def _outputs_from_inputs(self, outputs): From 26a67fe0f9c07921f5dab01f96b54e0d82f24f64 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Fri, 12 Feb 2016 13:18:26 -0800 Subject: [PATCH 14/73] fix NotImplementedError in BaseInterface._list_outputs --- nipype/interfaces/base.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/nipype/interfaces/base.py b/nipype/interfaces/base.py index 84f04a13e0..07dcda55bf 100644 --- a/nipype/interfaces/base.py +++ b/nipype/interfaces/base.py @@ -1195,11 +1195,22 @@ def run(self, **inputs): def _list_outputs(self): """ List the expected outputs """ - if self.output_spec: - raise NotImplementedError - else: + if self.output_spec is None: + iflogger.warn('Interface does not have output specification') return None + metadata = dict(name_source=lambda t: t is not None) + out_traits = self.inputs.traits(**metadata) + if out_traits: + outputs = self.output_spec().get() #pylint: disable=E1102 + for name, trait_spec in out_traits.items(): + out_name = name + if trait_spec.output_name is not None: + out_name = trait_spec.output_name + outputs[out_name] = \ + os.path.abspath(self._resolve_namesource(name)) + return outputs + def aggregate_outputs(self, runtime=None, needed_outputs=None): """ Collate expected outputs and check for existence """ From aa3b244aa9fc4ca63dde9cd4f13b8951b67af817 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Fri, 12 Feb 2016 13:56:59 -0800 Subject: [PATCH 15/73] update branch, although it is still failing --- nipype/interfaces/afni/preprocess.py | 10 -------- nipype/interfaces/base.py | 35 +++++++++++++--------------- 2 files changed, 16 insertions(+), 29 deletions(-) diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index 813de729b7..84c6c8a9e9 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -184,12 +184,7 @@ class RefitInputSpec(CommandLineInputSpec): ' template type, e.g. TLRC, MNI, ORIG') -<<<<<<< HEAD -class Refit(CommandLine): - -======= class Refit(AFNICommandBase): ->>>>>>> master """Changes some of the information inside a 3D dataset's header For complete details, see the `3drefit Documentation. @@ -1576,12 +1571,7 @@ class ROIStatsOutputSpec(TraitedSpec): stats = File(desc='output tab separated values file', exists=True) -<<<<<<< HEAD -class ROIStats(CommandLine): - -======= class ROIStats(AFNICommandBase): ->>>>>>> master """Display statistics over masked regions For complete details, see the `3dROIstats Documentation. diff --git a/nipype/interfaces/base.py b/nipype/interfaces/base.py index 07dcda55bf..b3872c0164 100644 --- a/nipype/interfaces/base.py +++ b/nipype/interfaces/base.py @@ -879,7 +879,7 @@ def _outputs_help(cls): """ helpstr = ['Outputs::', ''] if cls.output_spec: - outputs = cls.output_spec() + outputs = cls.output_spec() #pylint: disable=E1102 for name, spec in sorted(outputs.traits(transient=None).items()): helpstr += cls._get_trait_desc(outputs, name, spec) if len(helpstr) == 2: @@ -891,7 +891,7 @@ def _outputs(self): """ outputs = None if self.output_spec: - outputs = self.output_spec() + outputs = self.output_spec() #pylint: disable=E1102 return outputs @classmethod @@ -1004,10 +1004,8 @@ def _update_autonames(self): if ns is not None: value = self._resolve_namesource(name) - if not isdefined(value): - raise NipypeInterfaceError('Input %s with name_source=%s could ' - 'not be resolved' % (name, ns)) - setattr(self.inputs, name, value) + if isdefined(value): + setattr(self.inputs, name, value) def _overload_extension(self, value, name=None): return value @@ -1207,8 +1205,9 @@ def _list_outputs(self): out_name = name if trait_spec.output_name is not None: out_name = trait_spec.output_name - outputs[out_name] = \ - os.path.abspath(self._resolve_namesource(name)) + value = self._resolve_namesource(name) + if isdefined(value): + outputs[out_name] = os.path.abspath(value) return outputs def aggregate_outputs(self, runtime=None, needed_outputs=None): @@ -1224,7 +1223,9 @@ def aggregate_outputs(self, runtime=None, needed_outputs=None): out_name = name if spec.output_name is not None: out_name = spec.output_name - setattr(outputs, out_name, os.path.abspath(getattr(self.inputs, name))) + value = getattr(self.inputs, name) + if value is not None and isdefined(value): + setattr(outputs, out_name, os.path.abspath(value)) if predicted_outputs: _unavailable_outputs = [] @@ -1576,18 +1577,14 @@ def _get_environ(self): def version_from_command(self, flag='-v'): cmdname = self.cmd.split()[0] - if _exists_in_path(cmdname): - env = dict(os.environ) + env = dict(os.environ) + if _exists_in_path(cmdname, env): out_environ = self._get_environ() env.update(out_environ) - proc = subprocess.Popen(' '.join((cmdname, flag)), - shell=True, - env=env, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - ) - o, e = proc.communicate() - return o + proc = subprocess.Popen(' '.join((cmdname, flag)), shell=True, env=env, + stdout=subprocess.PIPE, stderr=subprocess.PIPE,) + out, _ = proc.communicate() + return out def _run_wrapper(self, runtime): runtime = self._run_interface(runtime) From 87ea1ea6337abff59e37ada3cb613d480d23f9fc Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Sat, 13 Feb 2016 13:10:03 -0800 Subject: [PATCH 16/73] separate specs and interfaces --- nipype/interfaces/base.py | 810 ++----------------------------------- nipype/interfaces/specs.py | 769 +++++++++++++++++++++++++++++++++++ 2 files changed, 800 insertions(+), 779 deletions(-) create mode 100644 nipype/interfaces/specs.py diff --git a/nipype/interfaces/base.py b/nipype/interfaces/base.py index b3872c0164..61c4656671 100644 --- a/nipype/interfaces/base.py +++ b/nipype/interfaces/base.py @@ -10,14 +10,8 @@ from __future__ import print_function from __future__ import division -from future import standard_library -standard_library.install_aliases() -from builtins import range -from builtins import object -from configparser import NoOptionError from copy import deepcopy -import datetime import errno import os import re @@ -27,39 +21,37 @@ import select import subprocess import sys -import random -import time -import fnmatch from textwrap import wrap from datetime import datetime as dt from dateutil.parser import parse as parseutc -from warnings import warn +from future import standard_library +standard_library.install_aliases() +from builtins import range +from builtins import object + +from configparser import NoOptionError -from .traits_extension import (traits, Undefined, TraitDictObject, - TraitListObject, TraitError, - isdefined, File, Directory, - has_metadata) -from ..utils.filemanip import (md5, hash_infile, FileNotFoundError, - hash_timestamp, save_json, - split_filename) -from ..utils.misc import is_container, trim, str2bool +from .traits_extension import TraitError, isdefined +from ..utils.filemanip import FileNotFoundError, split_filename +from ..utils.misc import trim, str2bool +from .specs import (Bunch, BaseInterfaceInputSpec, CommandLineInputSpec, + StdOutCommandLineInputSpec, MpiCommandLineInputSpec, + SEMLikeCommandLineInputSpec) from ..utils.provenance import write_provenance from .. import config, logging, LooseVersion from .. import __version__ from ..external.six import string_types -nipype_version = LooseVersion(__version__) - -iflogger = logging.getLogger('interface') - - +IFLOGGER = logging.getLogger('interface') __docformat__ = 'restructuredtext' class NipypeInterfaceError(Exception): + """Error raised in nipype interfaces""" def __init__(self, value): self.value = value + super(NipypeInterfaceError, self).__init__(value) def __str__(self): return repr(self.value) @@ -76,15 +68,12 @@ def _unlock_display(ndisplay): def _exists_in_path(cmd, environ): - ''' + """ Based on a code snippet from http://orip.org/2009/08/python-checking-if-executable-exists-in.html - ''' - - if 'PATH' in environ: - input_environ = environ.get("PATH") - else: - input_environ = os.environ.get("PATH", "") + """ + # Read environ fron variable, use system's environ as failback + input_environ = environ.get("PATH", os.environ.get("PATH", "")) extensions = os.environ.get("PATHEXT", "").split(os.pathsep) for directory in input_environ.split(os.pathsep): base = os.path.join(directory, cmd) @@ -116,183 +105,6 @@ def load_template(name): template_file.close() return template - -class Bunch(object): - """Dictionary-like class that provides attribute-style access to it's items. - - A `Bunch` is a simple container that stores it's items as class - attributes. Internally all items are stored in a dictionary and - the class exposes several of the dictionary methods. - - Examples - -------- - >>> from nipype.interfaces.base import Bunch - >>> inputs = Bunch(infile='subj.nii', fwhm=6.0, register_to_mean=True) - >>> inputs - Bunch(fwhm=6.0, infile='subj.nii', register_to_mean=True) - >>> inputs.register_to_mean = False - >>> inputs - Bunch(fwhm=6.0, infile='subj.nii', register_to_mean=False) - - - Notes - ----- - The Bunch pattern came from the Python Cookbook: - - .. [1] A. Martelli, D. Hudgeon, "Collecting a Bunch of Named - Items", Python Cookbook, 2nd Ed, Chapter 4.18, 2005. - - """ - - def __init__(self, *args, **kwargs): - self.__dict__.update(*args, **kwargs) - - def update(self, *args, **kwargs): - """update existing attribute, or create new attribute - - Note: update is very much like HasTraits.set""" - self.__dict__.update(*args, **kwargs) - - def items(self): - """iterates over bunch attributes as key, value pairs""" - return list(self.__dict__.items()) - - def iteritems(self): - """iterates over bunch attributes as key, value pairs""" - warn('iteritems is deprecated, use items instead') - return list(self.items()) - - def get(self, *args): - '''Support dictionary get() functionality - ''' - return self.__dict__.get(*args) - - def set(self, **kwargs): - '''Support dictionary get() functionality - ''' - return self.__dict__.update(**kwargs) - - def dictcopy(self): - """returns a deep copy of existing Bunch as a dictionary""" - return deepcopy(self.__dict__) - - def __repr__(self): - """representation of the sorted Bunch as a string - - Currently, this string representation of the `inputs` Bunch of - interfaces is hashed to determine if the process' dirty-bit - needs setting or not. Till that mechanism changes, only alter - this after careful consideration. - """ - outstr = ['Bunch('] - first = True - for k, v in sorted(self.items()): - if not first: - outstr.append(', ') - if isinstance(v, dict): - pairs = [] - for key, value in sorted(v.items()): - pairs.append("'%s': %s" % (key, value)) - v = '{' + ', '.join(pairs) + '}' - outstr.append('%s=%s' % (k, v)) - else: - outstr.append('%s=%r' % (k, v)) - first = False - outstr.append(')') - return ''.join(outstr) - - def _hash_infile(self, adict, key): - # Inject file hashes into adict[key] - stuff = adict[key] - if not is_container(stuff): - stuff = [stuff] - file_list = [] - for afile in stuff: - if os.path.isfile(afile): - md5obj = md5() - with open(afile, 'rb') as fp: - while True: - data = fp.read(8192) - if not data: - break - md5obj.update(data) - md5hex = md5obj.hexdigest() - else: - md5hex = None - file_list.append((afile, md5hex)) - return file_list - - def _get_bunch_hash(self): - """Return a dictionary of our items with hashes for each file. - - Searches through dictionary items and if an item is a file, it - calculates the md5 hash of the file contents and stores the - file name and hash value as the new key value. - - However, the overall bunch hash is calculated only on the hash - value of a file. The path and name of the file are not used in - the overall hash calculation. - - Returns - ------- - dict_withhash : dict - Copy of our dictionary with the new file hashes included - with each file. - hashvalue : str - The md5 hash value of the `dict_withhash` - - """ - - infile_list = [] - for key, val in list(self.items()): - if is_container(val): - # XXX - SG this probably doesn't catch numpy arrays - # containing embedded file names either. - if isinstance(val, dict): - # XXX - SG should traverse dicts, but ignoring for now - item = None - else: - if len(val) == 0: - raise AttributeError('%s attribute is empty' % key) - item = val[0] - else: - item = val - try: - if os.path.isfile(item): - infile_list.append(key) - except TypeError: - # `item` is not a file or string. - continue - dict_withhash = self.dictcopy() - dict_nofilename = self.dictcopy() - for item in infile_list: - dict_withhash[item] = self._hash_infile(dict_withhash, item) - dict_nofilename[item] = [val[1] for val in dict_withhash[item]] - # Sort the items of the dictionary, before hashing the string - # representation so we get a predictable order of the - # dictionary. - sorted_dict = str(sorted(dict_nofilename.items())) - return dict_withhash, md5(sorted_dict.encode()).hexdigest() - - def __pretty__(self, p, cycle): - '''Support for the pretty module - - pretty is included in ipython.externals for ipython > 0.10''' - if cycle: - p.text('Bunch(...)') - else: - p.begin_group(6, 'Bunch(') - first = True - for k, v in sorted(self.items()): - if not first: - p.text(',') - p.breakable() - p.text(k + '=') - p.pretty(v) - first = False - p.end_group(6, ')') - - class InterfaceResult(object): """Object that contains the results of running a particular Interface. @@ -334,330 +146,6 @@ def version(self): return self._version -class BaseTraitedSpec(traits.HasTraits): - """Provide a few methods necessary to support nipype interface api - - The inputs attribute of interfaces call certain methods that are not - available in traits.HasTraits. These are provided here. - - new metadata: - - * usedefault : set this to True if the default value of the trait should be - used. Unless this is set, the attributes are set to traits.Undefined - - new attribute: - - * get_hashval : returns a tuple containing the state of the trait as a dict - and hashvalue corresponding to dict. - - XXX Reconsider this in the long run, but it seems like the best - solution to move forward on the refactoring. - """ - - def __init__(self, **kwargs): - """ Initialize handlers and inputs""" - # NOTE: In python 2.6, object.__init__ no longer accepts input - # arguments. HasTraits does not define an __init__ and - # therefore these args were being ignored. - # super(TraitedSpec, self).__init__(*args, **kwargs) - super(BaseTraitedSpec, self).__init__(**kwargs) - traits.push_exception_handler(reraise_exceptions=True) - undefined_traits = {} - for trait in self.copyable_trait_names(): - if not self.traits()[trait].usedefault: - undefined_traits[trait] = Undefined - self.trait_set(trait_change_notify=False, **undefined_traits) - self._generate_handlers() - self.set(**kwargs) - - def items(self): - """ Name, trait generator for user modifiable traits - """ - for name in sorted(self.copyable_trait_names()): - yield name, self.traits()[name] - - def __repr__(self): - """ Return a well-formatted representation of the traits """ - outstr = [] - for name, value in sorted(self.trait_get().items()): - outstr.append('%s = %s' % (name, value)) - return '\n' + '\n'.join(outstr) + '\n' - - def _generate_handlers(self): - """Find all traits with the 'xor' metadata and attach an event - handler to them. - """ - has_xor = dict(xor=lambda t: t is not None) - xors = self.trait_names(**has_xor) - for elem in xors: - self.on_trait_change(self._xor_warn, elem) - has_requires = dict(requires=lambda t: t is not None) - requires = self.trait_names(**has_requires) - for elem in requires: - self.on_trait_change(self._requires_warn, elem) - has_deprecation = dict(deprecated=lambda t: t is not None) - deprecated = self.trait_names(**has_deprecation) - for elem in deprecated: - self.on_trait_change(self._deprecated_warn, elem) - - def _xor_warn(self, obj, name, old, new): - """ Generates warnings for xor traits - """ - if isdefined(new): - trait_spec = self.traits()[name] - # for each xor, set to default_value - for trait_name in trait_spec.xor: - if trait_name == name: - # skip ourself - continue - if isdefined(getattr(self, trait_name)): - self.trait_set(trait_change_notify=False, - **{'%s' % name: Undefined}) - msg = ('Input "%s" is mutually exclusive with input "%s", ' - 'which is already set') % (name, trait_name) - raise IOError(msg) - - def _requires_warn(self, obj, name, old, new): - """Part of the xor behavior - """ - if isdefined(new): - trait_spec = self.traits()[name] - msg = None - for trait_name in trait_spec.requires: - if not isdefined(getattr(self, trait_name)): - if not msg: - msg = 'Input %s requires inputs: %s' \ - % (name, ', '.join(trait_spec.requires)) - if msg: # only one requires warning at a time. - warn(msg) - - def _deprecated_warn(self, obj, name, old, new): - """Checks if a user assigns a value to a deprecated trait - """ - if isdefined(new): - trait_spec = self.traits()[name] - msg1 = ('Input %s in interface %s is deprecated.' % - (name, - self.__class__.__name__.split('InputSpec')[0])) - msg2 = ('Will be removed or raise an error as of release %s' - % trait_spec.deprecated) - if trait_spec.new_name: - if trait_spec.new_name not in self.copyable_trait_names(): - raise TraitError(msg1 + ' Replacement trait %s not found' % - trait_spec.new_name) - msg3 = 'It has been replaced by %s.' % trait_spec.new_name - else: - msg3 = '' - msg = ' '.join((msg1, msg2, msg3)) - if LooseVersion(str(trait_spec.deprecated)) < nipype_version: - raise TraitError(msg) - else: - if trait_spec.new_name: - msg += 'Unsetting old value %s; setting new value %s.' % ( - name, trait_spec.new_name) - warn(msg) - if trait_spec.new_name: - self.trait_set(trait_change_notify=False, - **{'%s' % name: Undefined, - '%s' % trait_spec.new_name: new}) - - def _hash_infile(self, adict, key): - """ Inject file hashes into adict[key]""" - stuff = adict[key] - if not is_container(stuff): - stuff = [stuff] - file_list = [] - for afile in stuff: - if is_container(afile): - hashlist = self._hash_infile({'infiles': afile}, 'infiles') - hash = [val[1] for val in hashlist] - else: - if config.get('execution', - 'hash_method').lower() == 'timestamp': - hash = hash_timestamp(afile) - elif config.get('execution', - 'hash_method').lower() == 'content': - hash = hash_infile(afile) - else: - raise Exception("Unknown hash method: %s" % - config.get('execution', 'hash_method')) - file_list.append((afile, hash)) - return file_list - - def get(self, **kwargs): - """ Returns traited class as a dict - - Augments the trait get function to return a dictionary without - notification handles - """ - out = super(BaseTraitedSpec, self).get(**kwargs) - out = self._clean_container(out, Undefined) - return out - - def get_traitsfree(self, **kwargs): - """ Returns traited class as a dict - - Augments the trait get function to return a dictionary without - any traits. The dictionary does not contain any attributes that - were Undefined - """ - out = super(BaseTraitedSpec, self).get(**kwargs) - out = self._clean_container(out, skipundefined=True) - return out - - def _clean_container(self, object, undefinedval=None, skipundefined=False): - """Convert a traited obejct into a pure python representation. - """ - if isinstance(object, TraitDictObject) or isinstance(object, dict): - out = {} - for key, val in list(object.items()): - if isdefined(val): - out[key] = self._clean_container(val, undefinedval) - else: - if not skipundefined: - out[key] = undefinedval - elif (isinstance(object, TraitListObject) or - isinstance(object, list) or isinstance(object, tuple)): - out = [] - for val in object: - if isdefined(val): - out.append(self._clean_container(val, undefinedval)) - else: - if not skipundefined: - out.append(undefinedval) - else: - out.append(None) - if isinstance(object, tuple): - out = tuple(out) - else: - if isdefined(object): - out = object - else: - if not skipundefined: - out = undefinedval - return out - - def get_hashval(self, hash_method=None): - """Return a dictionary of our items with hashes for each file. - - Searches through dictionary items and if an item is a file, it - calculates the md5 hash of the file contents and stores the - file name and hash value as the new key value. - - However, the overall bunch hash is calculated only on the hash - value of a file. The path and name of the file are not used in - the overall hash calculation. - - Returns - ------- - dict_withhash : dict - Copy of our dictionary with the new file hashes included - with each file. - hashvalue : str - The md5 hash value of the traited spec - - """ - - dict_withhash = [] - dict_nofilename = [] - for name, val in sorted(self.get().items()): - if isdefined(val): - trait = self.trait(name) - if has_metadata(trait.trait_type, "nohash", True): - continue - hash_files = (not has_metadata(trait.trait_type, "hash_files", - False) and not - has_metadata(trait.trait_type, "name_source")) - dict_nofilename.append((name, - self._get_sorteddict(val, hash_method=hash_method, - hash_files=hash_files))) - dict_withhash.append((name, - self._get_sorteddict(val, True, hash_method=hash_method, - hash_files=hash_files))) - return dict_withhash, md5(str(dict_nofilename).encode()).hexdigest() - - def _get_sorteddict(self, object, dictwithhash=False, hash_method=None, - hash_files=True): - if isinstance(object, dict): - out = [] - for key, val in sorted(object.items()): - if isdefined(val): - out.append((key, - self._get_sorteddict(val, dictwithhash, - hash_method=hash_method, - hash_files=hash_files))) - elif isinstance(object, (list, tuple)): - out = [] - for val in object: - if isdefined(val): - out.append(self._get_sorteddict(val, dictwithhash, - hash_method=hash_method, - hash_files=hash_files)) - if isinstance(object, tuple): - out = tuple(out) - else: - if isdefined(object): - if (hash_files and isinstance(object, string_types) and - os.path.isfile(object)): - if hash_method is None: - hash_method = config.get('execution', 'hash_method') - - if hash_method.lower() == 'timestamp': - hash = hash_timestamp(object) - elif hash_method.lower() == 'content': - hash = hash_infile(object) - else: - raise Exception("Unknown hash method: %s" % hash_method) - if dictwithhash: - out = (object, hash) - else: - out = hash - elif isinstance(object, float): - out = '%.10f' % object - else: - out = object - return out - - -class DynamicTraitedSpec(BaseTraitedSpec): - """ A subclass to handle dynamic traits - - This class is a workaround for add_traits and clone_traits not - functioning well together. - """ - - def __deepcopy__(self, memo): - """ bug in deepcopy for HasTraits results in weird cloning behavior for - added traits - """ - id_self = id(self) - if id_self in memo: - return memo[id_self] - dup_dict = deepcopy(self.get(), memo) - # access all keys - for key in self.copyable_trait_names(): - _ = getattr(self, key) - # clone once - dup = self.clone_traits(memo=memo) - for key in self.copyable_trait_names(): - try: - _ = getattr(dup, key) - except: - pass - # clone twice - dup = self.clone_traits(memo=memo) - dup.set(**dup_dict) - return dup - - -class TraitedSpec(BaseTraitedSpec): - """ Create a subclass with strict traits. - - This is used in 90% of the cases. - """ - _ = traits.Disallow - - class Interface(object): """This is an abstract definition for Interface objects. @@ -730,12 +218,6 @@ def _get_filecopy_info(self): raise NotImplementedError -class BaseInterfaceInputSpec(TraitedSpec): - ignore_exception = traits.Bool(False, desc="Print an error message instead \ -of throwing an exception in case the interface fails to run", usedefault=True, - nohash=True) - - class BaseInterface(Interface): """Implements common interface functionality. @@ -954,7 +436,7 @@ def _resolve_namesource(self, name, chain=None): ns = trait_spec.name_source while isinstance(ns, list): if len(ns) > 1: - iflogger.warn('Only one name_source per trait is allowed') + IFLOGGER.warn('Only one name_source per trait is allowed') ns = ns[0] if not isinstance(ns, string_types): @@ -1068,14 +550,14 @@ def _run_wrapper(self, runtime): try: from xvfbwrapper import Xvfb except ImportError: - iflogger.error('Xvfb wrapper could not be imported') + IFLOGGER.error('Xvfb wrapper could not be imported') raise vdisp = Xvfb(nolisten='tcp') vdisp.start() vdisp_num = vdisp.vdisplay_num - iflogger.info('Redirecting X to :%d' % vdisp_num) + IFLOGGER.info('Redirecting X to :%d' % vdisp_num) runtime.environ['DISPLAY'] = ':%d' % vdisp_num runtime = self._run_interface(runtime) @@ -1086,7 +568,7 @@ def _run_wrapper(self, runtime): else: os.environ['DISPLAY'] = sysdisplay - iflogger.info('Freeing X :%d' % vdisp_num) + IFLOGGER.info('Freeing X :%d' % vdisp_num) vdisp.stop() _unlock_display(vdisp_num) @@ -1194,7 +676,7 @@ def _list_outputs(self): """ List the expected outputs """ if self.output_spec is None: - iflogger.warn('Interface does not have output specification') + IFLOGGER.warn('Interface does not have output specification') return None metadata = dict(name_source=lambda t: t is not None) @@ -1304,12 +786,12 @@ def _read(self, drain): tmp = buf rest = None self._buf = rest - now = datetime.datetime.now().isoformat() + now = dt.now().isoformat() rows = tmp.split('\n') self._rows += [(now, '%s %s:%s' % (self._name, now, r), r) for r in rows] for idx in range(self._lastidx, len(self._rows)): - iflogger.info(self._rows[idx][1]) + IFLOGGER.info(self._rows[idx][1]) self._lastidx = len(self._rows) @@ -1356,7 +838,7 @@ def _process(drain=0): try: res = select.select(streams, [], [], timeout) except select.error as e: - iflogger.info(str(e)) + IFLOGGER.info(str(e)) if e[0] == errno.EINTR: return else: @@ -1439,22 +921,6 @@ def get_dependencies(name, environ): return o.rstrip() -class CommandLineInputSpec(BaseInterfaceInputSpec): - args = traits.Str(argstr='%s', desc='Additional parameters to the command') - environ = traits.DictStrStr(desc='Environment variables', usedefault=True, - nohash=True) - # This input does not have a "usedefault=True" so the set_default_terminal_output() - # method would work - terminal_output = traits.Enum('stream', 'allatonce', 'file', 'none', - desc=('Control terminal output: `stream` - ' - 'displays to terminal immediately (default), ' - '`allatonce` - waits till command is ' - 'finished to display output, `file` - ' - 'writes output to file, `none` - output' - ' is ignored'), - nohash=True) - - class CommandLine(BaseInterface): """Implements functionality to interact with command line programs class must be instantiated with a command argument @@ -1570,7 +1036,7 @@ def _get_environ(self): out_environ = {'DISPLAY': display_var} except NoOptionError: pass - iflogger.debug(out_environ) + IFLOGGER.debug(out_environ) if isdefined(self.inputs.environ): out_environ.update(self.inputs.environ) return out_environ @@ -1625,98 +1091,9 @@ def _run_interface(self, runtime, correct_return_codes=[0]): return runtime - def _format_arg(self, name, trait_spec, value): - """A helper function for _parse_inputs - - Formats a trait containing argstr metadata - """ - argstr = trait_spec.argstr - iflogger.debug('%s_%s' % (name, str(value))) - if trait_spec.is_trait_type(traits.Bool) and "%" not in argstr: - if value: - # Boolean options have no format string. Just append options - # if True. - return argstr - else: - return None - # traits.Either turns into traits.TraitCompound and does not have any - # inner_traits - elif trait_spec.is_trait_type(traits.List) \ - or (trait_spec.is_trait_type(traits.TraitCompound) and - isinstance(value, list)): - # This is a bit simple-minded at present, and should be - # construed as the default. If more sophisticated behavior - # is needed, it can be accomplished with metadata (e.g. - # format string for list member str'ification, specifying - # the separator, etc.) - - # Depending on whether we stick with traitlets, and whether or - # not we beef up traitlets.List, we may want to put some - # type-checking code here as well - sep = trait_spec.sep - if sep is None: - sep = ' ' - if argstr.endswith('...'): - - # repeatable option - # --id %d... will expand to - # --id 1 --id 2 --id 3 etc.,. - argstr = argstr.replace('...', '') - return sep.join([argstr % elt for elt in value]) - else: - return argstr % sep.join(str(elt) for elt in value) - else: - # Append options using format string. - return argstr % value - def _gen_filename(self, name): raise NotImplementedError - def _parse_inputs(self, skip=None): - """Parse all inputs using the ``argstr`` format string in the Trait. - - Any inputs that are assigned (not the default_value) are formatted - to be added to the command line. - - Returns - ------- - all_args : list - A list of all inputs formatted for the command line. - - """ - all_args = [] - initial_args = {} - final_args = {} - metadata = dict(argstr=lambda t: t is not None) - for name, spec in sorted(self.inputs.traits(**metadata).items()): - if skip and name in skip: - continue - value = getattr(self.inputs, name) - if not isdefined(value): - if spec.genfile: - value = self._gen_filename(name) - else: - continue - - arg = self._format_arg(name, spec, value) - if arg is None: - continue - pos = spec.position - if pos is not None: - if int(pos) >= 0: - initial_args[pos] = arg - else: - final_args[pos] = arg - else: - all_args.append(arg) - first_args = [arg for pos, arg in sorted(initial_args.items())] - last_args = [arg for pos, arg in sorted(final_args.items())] - return first_args + all_args + last_args - - -class StdOutCommandLineInputSpec(CommandLineInputSpec): - out_file = File(argstr="> %s", position=-1, genfile=True) - class StdOutCommandLine(CommandLine): input_spec = StdOutCommandLineInputSpec @@ -1731,17 +1108,8 @@ def _gen_outfilename(self): raise NotImplementedError -class MpiCommandLineInputSpec(CommandLineInputSpec): - use_mpi = traits.Bool(False, - desc="Whether or not to run the command with mpiexec", - usedefault=True) - n_procs = traits.Int(desc="Num processors to specify to mpiexec. Do not " - "specify if this is managed externally (e.g. through " - "SGE)") - - class MpiCommandLine(CommandLine): - '''Implements functionality to interact with command line programs + """Implements functionality to interact with command line programs that can be run with MPI (i.e. using 'mpiexec'). Examples @@ -1756,7 +1124,7 @@ class MpiCommandLine(CommandLine): >>> mpi_cli.inputs.n_procs = 8 >>> mpi_cli.cmdline 'mpiexec -n 8 my_mpi_prog -v' - ''' + """ input_spec = MpiCommandLineInputSpec @property @@ -1779,6 +1147,7 @@ class SEMLikeCommandLine(CommandLine): used but only for the reduced (by excluding those that do not have corresponding inputs list of outputs. """ + input_spec = SEMLikeCommandLineInputSpec def _list_outputs(self): outputs = self.output_spec().get() #pylint: disable=E1102 @@ -1799,120 +1168,3 @@ def _outputs_from_inputs(self, outputs): else: outputs[name] = os.path.abspath(corresponding_input) return outputs - - def _format_arg(self, name, spec, value): - if name in list(self._outputs_filenames.keys()): - if isinstance(value, bool): - if value: - value = os.path.abspath(self._outputs_filenames[name]) - else: - return "" - return super(SEMLikeCommandLine, self)._format_arg(name, spec, value) - - -class MultiPath(traits.List): - """ Abstract class - shared functionality of input and output MultiPath - """ - - def validate(self, object, name, value): - if not isdefined(value) or \ - (isinstance(value, list) and len(value) == 0): - return Undefined - newvalue = value - - if not isinstance(value, list) \ - or (self.inner_traits() and - isinstance(self.inner_traits()[0].trait_type, - traits.List) and not - isinstance(self.inner_traits()[0].trait_type, - InputMultiPath) and - isinstance(value, list) and - value and not - isinstance(value[0], list)): - newvalue = [value] - value = super(MultiPath, self).validate(object, name, newvalue) - - if len(value) > 0: - return value - - self.error(object, name, value) - - -class OutputMultiPath(MultiPath): - """ Implements a user friendly traits that accepts one or more - paths to files or directories. This is the output version which - return a single string whenever possible (when it was set to a - single value or a list of length 1). Default value of this trait - is _Undefined. It does not accept empty lists. - - XXX This should only be used as a final resort. We should stick to - established Traits to the extent possible. - - XXX This needs to be vetted by somebody who understands traits - - >>> from nipype.interfaces.base import OutputMultiPath - >>> class A(TraitedSpec): - ... foo = OutputMultiPath(File(exists=False)) - >>> a = A() - >>> a.foo - - - >>> a.foo = '/software/temp/foo.txt' - >>> a.foo - '/software/temp/foo.txt' - - >>> a.foo = ['/software/temp/foo.txt'] - >>> a.foo - '/software/temp/foo.txt' - - >>> a.foo = ['/software/temp/foo.txt', '/software/temp/goo.txt'] - >>> a.foo - ['/software/temp/foo.txt', '/software/temp/goo.txt'] - - """ - - def get(self, object, name): - value = self.get_value(object, name) - if len(value) == 0: - return Undefined - elif len(value) == 1: - return value[0] - else: - return value - - def set(self, object, name, value): - self.set_value(object, name, value) - - -class InputMultiPath(MultiPath): - """ Implements a user friendly traits that accepts one or more - paths to files or directories. This is the input version which - always returns a list. Default value of this trait - is _Undefined. It does not accept empty lists. - - XXX This should only be used as a final resort. We should stick to - established Traits to the extent possible. - - XXX This needs to be vetted by somebody who understands traits - - >>> from nipype.interfaces.base import InputMultiPath - >>> class A(TraitedSpec): - ... foo = InputMultiPath(File(exists=False)) - >>> a = A() - >>> a.foo - - - >>> a.foo = '/software/temp/foo.txt' - >>> a.foo - ['/software/temp/foo.txt'] - - >>> a.foo = ['/software/temp/foo.txt'] - >>> a.foo - ['/software/temp/foo.txt'] - - >>> a.foo = ['/software/temp/foo.txt', '/software/temp/goo.txt'] - >>> a.foo - ['/software/temp/foo.txt', '/software/temp/goo.txt'] - - """ - pass diff --git a/nipype/interfaces/specs.py b/nipype/interfaces/specs.py new file mode 100644 index 0000000000..fba472c120 --- /dev/null +++ b/nipype/interfaces/specs.py @@ -0,0 +1,769 @@ +# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- +# vi: set ft=python sts=4 ts=4 sw=4 et: +""" +Definition of inputs/outputs of interfaces. +""" + +from __future__ import print_function +from __future__ import division + +from copy import deepcopy +import os + +from future import standard_library +standard_library.install_aliases() +from builtins import range +from builtins import object + +from .traits_extension import (traits, Undefined, TraitDictObject, TraitListObject, TraitError, + isdefined, File, has_metadata) +from ..utils.filemanip import md5, hash_infile, hash_timestamp +from ..utils.misc import is_container +from .. import config, logging, LooseVersion +from .. import __version__ +from ..external.six import string_types + +NIPYPE_VERSION = LooseVersion(__version__) +IFLOGGER = logging.getLogger('interface') +__docformat__ = 'restructuredtext' + + +class Bunch(object): + """Dictionary-like class that provides attribute-style access to it's items. + + A `Bunch` is a simple container that stores it's items as class + attributes. Internally all items are stored in a dictionary and + the class exposes several of the dictionary methods. + + Examples + -------- + >>> from nipype.interfaces.base import Bunch + >>> inputs = Bunch(infile='subj.nii', fwhm=6.0, register_to_mean=True) + >>> inputs + Bunch(fwhm=6.0, infile='subj.nii', register_to_mean=True) + >>> inputs.register_to_mean = False + >>> inputs + Bunch(fwhm=6.0, infile='subj.nii', register_to_mean=False) + + + Notes + ----- + The Bunch pattern came from the Python Cookbook: + + .. [1] A. Martelli, D. Hudgeon, "Collecting a Bunch of Named + Items", Python Cookbook, 2nd Ed, Chapter 4.18, 2005. + + """ + + def __init__(self, *args, **kwargs): + self.__dict__.update(*args, **kwargs) + + def update(self, *args, **kwargs): + """update existing attribute, or create new attribute + + Note: update is very much like HasTraits.set""" + self.__dict__.update(*args, **kwargs) + + def items(self): + """iterates over bunch attributes as key, value pairs""" + return list(self.__dict__.items()) + + def iteritems(self): + """iterates over bunch attributes as key, value pairs""" + IFLOGGER.warn('iteritems is deprecated, use items instead') + return list(self.items()) + + def get(self, *args): + """Support dictionary get() functionality + """ + return self.__dict__.get(*args) + + def set(self, **kwargs): + """Support dictionary get() functionality + """ + return self.__dict__.update(**kwargs) + + def dictcopy(self): + """returns a deep copy of existing Bunch as a dictionary""" + return deepcopy(self.__dict__) + + def __repr__(self): + """representation of the sorted Bunch as a string + + Currently, this string representation of the `inputs` Bunch of + interfaces is hashed to determine if the process' dirty-bit + needs setting or not. Till that mechanism changes, only alter + this after careful consideration. + """ + outstr = ['Bunch('] + first = True + for k, input_value in sorted(self.items()): + if not first: + outstr.append(', ') + if isinstance(input_value, dict): + pairs = [] + for key, value in sorted(input_value.items()): + pairs.append("'%s': %s" % (key, value)) + input_value = '{' + ', '.join(pairs) + '}' + outstr.append('%s=%s' % (k, input_value)) + else: + outstr.append('%s=%r' % (k, input_value)) + first = False + outstr.append(')') + return ''.join(outstr) + + def _get_bunch_hash(self): + """Return a dictionary of our items with hashes for each file. + + Searches through dictionary items and if an item is a file, it + calculates the md5 hash of the file contents and stores the + file name and hash value as the new key value. + + However, the overall bunch hash is calculated only on the hash + value of a file. The path and name of the file are not used in + the overall hash calculation. + + Returns + ------- + dict_withhash : dict + Copy of our dictionary with the new file hashes included + with each file. + hashvalue : str + The md5 hash value of the `dict_withhash` + + """ + + infile_list = [] + for key, val in list(self.items()): + if is_container(val): + # XXX - SG this probably doesn't catch numpy arrays + # containing embedded file names either. + if isinstance(val, dict): + # XXX - SG should traverse dicts, but ignoring for now + item = None + else: + if len(val) == 0: + raise AttributeError('%s attribute is empty' % key) + item = val[0] + else: + item = val + try: + if os.path.isfile(item): + infile_list.append(key) + except TypeError: + # `item` is not a file or string. + continue + dict_withhash = self.dictcopy() + dict_nofilename = self.dictcopy() + for item in infile_list: + dict_withhash[item] = self._hash_infile(dict_withhash, item) + dict_nofilename[item] = [val[1] for val in dict_withhash[item]] + # Sort the items of the dictionary, before hashing the string + # representation so we get a predictable order of the + # dictionary. + sorted_dict = str(sorted(dict_nofilename.items())) + return dict_withhash, md5(sorted_dict.encode()).hexdigest() + + def _hash_infile(self, adict, key): + """Compute hashes of files""" + # Inject file hashes into adict[key] + stuff = adict[key] + if not is_container(stuff): + stuff = [stuff] + file_list = [] + for fname in stuff: + if os.path.isfile(fname): + md5obj = md5() + with open(fname, 'rb') as filep: + while True: + data = filep.read(8192) + if not data: + break + md5obj.update(data) + md5hex = md5obj.hexdigest() + else: + md5hex = None + file_list.append((fname, md5hex)) + return file_list + + def __pretty__(self, p, cycle): + """Support for the pretty module + + pretty is included in ipython.externals for ipython > 0.10""" + if cycle: + p.text('Bunch(...)') + else: + p.begin_group(6, 'Bunch(') + first = True + for k, input_value in sorted(self.items()): + if not first: + p.text(',') + p.breakable() + p.text(k + '=') + p.pretty(input_value) + first = False + p.end_group(6, ')') + + +class BaseTraitedSpec(traits.HasTraits): + """Provide a few methods necessary to support nipype interface api + + The inputs attribute of interfaces call certain methods that are not + available in traits.HasTraits. These are provided here. + + new metadata: + + * usedefault : set this to True if the default value of the trait should be + used. Unless this is set, the attributes are set to traits.Undefined + + new attribute: + + * get_hashval : returns a tuple containing the state of the trait as a dict + and hashvalue corresponding to dict. + + XXX Reconsider this in the long run, but it seems like the best + solution to move forward on the refactoring. + """ + + def __init__(self, **kwargs): + """ Initialize handlers and inputs""" + # NOTE: In python 2.6, object.__init__ no longer accepts input + # arguments. HasTraits does not define an __init__ and + # therefore these args were being ignored. + # super(TraitedSpec, self).__init__(*args, **kwargs) + super(BaseTraitedSpec, self).__init__(**kwargs) + traits.push_exception_handler(reraise_exceptions=True) + undefined_traits = {} + for trait in self.copyable_trait_names(): + if not self.traits()[trait].usedefault: + undefined_traits[trait] = Undefined + self.trait_set(trait_change_notify=False, **undefined_traits) + self._generate_handlers() + self.set(**kwargs) + + def items(self): + """ Name, trait generator for user modifiable traits + """ + for name in sorted(self.copyable_trait_names()): + yield name, self.traits()[name] + + def __repr__(self): + """ Return a well-formatted representation of the traits """ + outstr = [] + for name, value in sorted(self.trait_get().items()): + outstr.append('%s = %s' % (name, value)) + return '\n' + '\n'.join(outstr) + '\n' + + def _generate_handlers(self): + """Find all traits with the 'xor' metadata and attach an event + handler to them. + """ + has_xor = dict(xor=lambda t: t is not None) + xors = self.trait_names(**has_xor) + for elem in xors: + self.on_trait_change(self._xor_warn, elem) + has_requires = dict(requires=lambda t: t is not None) + requires = self.trait_names(**has_requires) + for elem in requires: + self.on_trait_change(self._requires_warn, elem) + has_deprecation = dict(deprecated=lambda t: t is not None) + deprecated = self.trait_names(**has_deprecation) + for elem in deprecated: + self.on_trait_change(self._deprecated_warn, elem) + + def _xor_warn(self, obj, name, old, new): + """ Generates warnings for xor traits + """ + if isdefined(new): + trait_spec = self.traits()[name] + # for each xor, set to default_value + for trait_name in trait_spec.xor: + if trait_name == name: + # skip ourself + continue + if isdefined(getattr(self, trait_name)): + self.trait_set(trait_change_notify=False, + **{'%s' % name: Undefined}) + msg = ('Input "%s" is mutually exclusive with input "%s", ' + 'which is already set') % (name, trait_name) + raise IOError(msg) + + def _requires_warn(self, obj, name, old, new): + """Part of the xor behavior + """ + if isdefined(new): + trait_spec = self.traits()[name] + msg = None + for trait_name in trait_spec.requires: + if not isdefined(getattr(self, trait_name)): + if not msg: + msg = 'Input %s requires inputs: %s' \ + % (name, ', '.join(trait_spec.requires)) + if msg: # only one requires warning at a time. + IFLOGGER.warn(msg) + + def _deprecated_warn(self, obj, name, old, new): + """Checks if a user assigns a value to a deprecated trait + """ + if isdefined(new): + trait_spec = self.traits()[name] + msg1 = ('Input %s in interface %s is deprecated.' % + (name, + self.__class__.__name__.split('InputSpec')[0])) + msg2 = ('Will be removed or raise an error as of release %s' + % trait_spec.deprecated) + if trait_spec.new_name: + if trait_spec.new_name not in self.copyable_trait_names(): + raise TraitError(msg1 + ' Replacement trait %s not found' % + trait_spec.new_name) + msg3 = 'It has been replaced by %s.' % trait_spec.new_name + else: + msg3 = '' + msg = ' '.join((msg1, msg2, msg3)) + if LooseVersion(str(trait_spec.deprecated)) < NIPYPE_VERSION: + raise TraitError(msg) + else: + if trait_spec.new_name: + msg += 'Unsetting old value %s; setting new value %s.' % ( + name, trait_spec.new_name) + IFLOGGER.warn(msg) + if trait_spec.new_name: + self.trait_set(trait_change_notify=False, + **{'%s' % name: Undefined, + '%s' % trait_spec.new_name: new}) + + def _hash_infile(self, adict, key): + """ Inject file hashes into adict[key]""" + stuff = adict[key] + if not is_container(stuff): + stuff = [stuff] + file_list = [] + for afile in stuff: + if is_container(afile): + hashlist = self._hash_infile({'infiles': afile}, 'infiles') + hash = [val[1] for val in hashlist] + else: + if config.get('execution', + 'hash_method').lower() == 'timestamp': + hash = hash_timestamp(afile) + elif config.get('execution', + 'hash_method').lower() == 'content': + hash = hash_infile(afile) + else: + raise Exception("Unknown hash method: %s" % + config.get('execution', 'hash_method')) + file_list.append((afile, hash)) + return file_list + + def get(self, **kwargs): + """ Returns traited class as a dict + + Augments the trait get function to return a dictionary without + notification handles + """ + out = super(BaseTraitedSpec, self).get(**kwargs) + out = self._clean_container(out, Undefined) + return out + + def get_traitsfree(self, **kwargs): + """ Returns traited class as a dict + + Augments the trait get function to return a dictionary without + any traits. The dictionary does not contain any attributes that + were Undefined + """ + out = super(BaseTraitedSpec, self).get(**kwargs) + out = self._clean_container(out, skipundefined=True) + return out + + def _clean_container(self, obj, undefinedval=None, skipundefined=False): + """Convert a traited obejct into a pure python representation. + """ + if isinstance(obj, TraitDictObject) or isinstance(obj, dict): + out = {} + for key, val in list(obj.items()): + if isdefined(val): + out[key] = self._clean_container(val, undefinedval) + else: + if not skipundefined: + out[key] = undefinedval + elif (isinstance(obj, TraitListObject) or + isinstance(obj, list) or isinstance(obj, tuple)): + out = [] + for val in obj: + if isdefined(val): + out.append(self._clean_container(val, undefinedval)) + else: + if not skipundefined: + out.append(undefinedval) + else: + out.append(None) + if isinstance(obj, tuple): + out = tuple(out) + else: + if isdefined(obj): + out = obj + else: + if not skipundefined: + out = undefinedval + return out + + def get_hashval(self, hash_method=None): + """Return a dictionary of our items with hashes for each file. + + Searches through dictionary items and if an item is a file, it + calculates the md5 hash of the file contents and stores the + file name and hash value as the new key value. + + However, the overall bunch hash is calculated only on the hash + value of a file. The path and name of the file are not used in + the overall hash calculation. + + Returns + ------- + dict_withhash : dict + Copy of our dictionary with the new file hashes included + with each file. + hashvalue : str + The md5 hash value of the traited spec + + """ + + dict_withhash = [] + dict_nofilename = [] + for name, val in sorted(self.get().items()): + if isdefined(val): + trait = self.trait(name) + if has_metadata(trait.trait_type, "nohash", True): + continue + hash_files = (not has_metadata(trait.trait_type, "hash_files", + False) and not + has_metadata(trait.trait_type, "name_source")) + dict_nofilename.append((name, + self._get_sorteddict(val, hash_method=hash_method, + hash_files=hash_files))) + dict_withhash.append((name, + self._get_sorteddict(val, True, hash_method=hash_method, + hash_files=hash_files))) + return dict_withhash, md5(str(dict_nofilename).encode()).hexdigest() + + def _get_sorteddict(self, obj, dictwithhash=False, hash_method=None, + hash_files=True): + if isinstance(obj, dict): + out = [] + for key, val in sorted(obj.items()): + if isdefined(val): + out.append((key, + self._get_sorteddict(val, dictwithhash, + hash_method=hash_method, + hash_files=hash_files))) + elif isinstance(obj, (list, tuple)): + out = [] + for val in obj: + if isdefined(val): + out.append(self._get_sorteddict(val, dictwithhash, + hash_method=hash_method, + hash_files=hash_files)) + if isinstance(obj, tuple): + out = tuple(out) + else: + if isdefined(obj): + if (hash_files and isinstance(obj, string_types) and + os.path.isfile(obj)): + if hash_method is None: + hash_method = config.get('execution', 'hash_method') + + if hash_method.lower() == 'timestamp': + hash = hash_timestamp(obj) + elif hash_method.lower() == 'content': + hash = hash_infile(obj) + else: + raise Exception("Unknown hash method: %s" % hash_method) + if dictwithhash: + out = (obj, hash) + else: + out = hash + elif isinstance(obj, float): + out = '%.10f' % obj + else: + out = obj + return out + + +class DynamicTraitedSpec(BaseTraitedSpec): + """ A subclass to handle dynamic traits + + This class is a workaround for add_traits and clone_traits not + functioning well together. + """ + + def __deepcopy__(self, memo): + """ bug in deepcopy for HasTraits results in weird cloning behavior for + added traits + """ + id_self = id(self) + if id_self in memo: + return memo[id_self] + dup_dict = deepcopy(self.get(), memo) + # access all keys + for key in self.copyable_trait_names(): + _ = getattr(self, key) + # clone once + dup = self.clone_traits(memo=memo) + for key in self.copyable_trait_names(): + try: + _ = getattr(dup, key) + except: + pass + # clone twice + dup = self.clone_traits(memo=memo) + dup.set(**dup_dict) + return dup + + +class TraitedSpec(BaseTraitedSpec): + """ Create a subclass with strict traits. + + This is used in 90% of the cases. + """ + _ = traits.Disallow + + +class BaseInterfaceInputSpec(TraitedSpec): + ignore_exception = traits.Bool(False, usedefault=True, nohash=True, + desc='Print an error message instead of throwing an exception' + ' in case the interface fails to run') + + +class CommandLineInputSpec(BaseInterfaceInputSpec): + args = traits.Str(argstr='%s', desc='Additional parameters to the command') + environ = traits.DictStrStr(desc='Environment variables', usedefault=True, + nohash=True) + # This input does not have a "usedefault=True" so the set_default_terminal_output() + # method would work + terminal_output = traits.Enum('stream', 'allatonce', 'file', 'none', + desc=('Control terminal output: `stream` - ' + 'displays to terminal immediately (default), ' + '`allatonce` - waits till command is ' + 'finished to display output, `file` - ' + 'writes output to file, `none` - output' + ' is ignored'), + nohash=True) + + def _format_arg(self, name, trait_spec, value): + """A helper function for _parse_inputs + + Formats a trait containing argstr metadata + """ + argstr = trait_spec.argstr + IFLOGGER.debug('%s_%s' % (name, str(value))) + if trait_spec.is_trait_type(traits.Bool) and "%" not in argstr: + if value: + # Boolean options have no format string. Just append options + # if True. + return argstr + else: + return None + # traits.Either turns into traits.TraitCompound and does not have any + # inner_traits + elif trait_spec.is_trait_type(traits.List) \ + or (trait_spec.is_trait_type(traits.TraitCompound) and + isinstance(value, list)): + # This is a bit simple-minded at present, and should be + # construed as the default. If more sophisticated behavior + # is needed, it can be accomplished with metadata (e.g. + # format string for list member str'ification, specifying + # the separator, etc.) + + # Depending on whether we stick with traitlets, and whether or + # not we beef up traitlets.List, we may want to put some + # type-checking code here as well + sep = trait_spec.sep + if sep is None: + sep = ' ' + if argstr.endswith('...'): + + # repeatable option + # --id %d... will expand to + # --id 1 --id 2 --id 3 etc.,. + argstr = argstr.replace('...', '') + return sep.join([argstr % elt for elt in value]) + else: + return argstr % sep.join(str(elt) for elt in value) + else: + # Append options using format string. + return argstr % value + + def _parse_inputs(self, skip=None): + """Parse all inputs using the ``argstr`` format string in the Trait. + + Any inputs that are assigned (not the default_value) are formatted + to be added to the command line. + + Returns + ------- + all_args : list + A list of all inputs formatted for the command line. + + """ + all_args = [] + initial_args = {} + final_args = {} + metadata = dict(argstr=lambda t: t is not None) + for name, spec in sorted(self.inputs.traits(**metadata).items()): + if skip and name in skip: + continue + value = getattr(self.inputs, name) + if not isdefined(value): + if spec.genfile: + value = self._gen_filename(name) + else: + continue + + arg = self._format_arg(name, spec, value) + if arg is None: + continue + pos = spec.position + if pos is not None: + if int(pos) >= 0: + initial_args[pos] = arg + else: + final_args[pos] = arg + else: + all_args.append(arg) + first_args = [arg for pos, arg in sorted(initial_args.items())] + last_args = [arg for pos, arg in sorted(final_args.items())] + return first_args + all_args + last_args + + +class StdOutCommandLineInputSpec(CommandLineInputSpec): + out_file = File(argstr="> %s", position=-1, genfile=True) + + +class MpiCommandLineInputSpec(CommandLineInputSpec): + use_mpi = traits.Bool(False, + desc="Whether or not to run the command with mpiexec", + usedefault=True) + n_procs = traits.Int(desc="Num processors to specify to mpiexec. Do not " + "specify if this is managed externally (e.g. through " + "SGE)") + + +class SEMLikeCommandLineInputSpec(CommandLineInputSpec): + + def _format_arg(self, name, spec, value): + if name in list(self._outputs_filenames.keys()): + if isinstance(value, bool): + if value: + value = os.path.abspath(self._outputs_filenames[name]) + else: + return "" + return super(SEMLikeCommandLineInputSpec, self)._format_arg(name, spec, value) + + +class MultiPath(traits.List): + """ Abstract class - shared functionality of input and output MultiPath + """ + + def validate(self, obj, name, value): + if not isdefined(value) or \ + (isinstance(value, list) and len(value) == 0): + return Undefined + newvalue = value + + if not isinstance(value, list) \ + or (self.inner_traits() and + isinstance(self.inner_traits()[0].trait_type, + traits.List) and not + isinstance(self.inner_traits()[0].trait_type, + InputMultiPath) and + isinstance(value, list) and + value and not + isinstance(value[0], list)): + newvalue = [value] + value = super(MultiPath, self).validate(obj, name, newvalue) + + if len(value) > 0: + return value + + self.error(obj, name, value) + + +class OutputMultiPath(MultiPath): + """ Implements a user friendly traits that accepts one or more + paths to files or directories. This is the output version which + return a single string whenever possible (when it was set to a + single value or a list of length 1). Default value of this trait + is _Undefined. It does not accept empty lists. + + XXX This should only be used as a final resort. We should stick to + established Traits to the extent possible. + + XXX This needs to be vetted by somebody who understands traits + + >>> from nipype.interfaces.base import OutputMultiPath + >>> class A(TraitedSpec): + ... foo = OutputMultiPath(File(exists=False)) + >>> a = A() + >>> a.foo + + + >>> a.foo = '/software/temp/foo.txt' + >>> a.foo + '/software/temp/foo.txt' + + >>> a.foo = ['/software/temp/foo.txt'] + >>> a.foo + '/software/temp/foo.txt' + + >>> a.foo = ['/software/temp/foo.txt', '/software/temp/goo.txt'] + >>> a.foo + ['/software/temp/foo.txt', '/software/temp/goo.txt'] + + """ + + def get(self, obj, name): + value = self.get_value(obj, name) + if len(value) == 0: + return Undefined + elif len(value) == 1: + return value[0] + else: + return value + + def set(self, obj, name, value): + self.set_value(obj, name, value) + + +class InputMultiPath(MultiPath): + """ Implements a user friendly traits that accepts one or more + paths to files or directories. This is the input version which + always returns a list. Default value of this trait + is _Undefined. It does not accept empty lists. + + XXX This should only be used as a final resort. We should stick to + established Traits to the extent possible. + + XXX This needs to be vetted by somebody who understands traits + + >>> from nipype.interfaces.base import InputMultiPath + >>> class A(TraitedSpec): + ... foo = InputMultiPath(File(exists=False)) + >>> a = A() + >>> a.foo + + + >>> a.foo = '/software/temp/foo.txt' + >>> a.foo + ['/software/temp/foo.txt'] + + >>> a.foo = ['/software/temp/foo.txt'] + >>> a.foo + ['/software/temp/foo.txt'] + + >>> a.foo = ['/software/temp/foo.txt', '/software/temp/goo.txt'] + >>> a.foo + ['/software/temp/foo.txt', '/software/temp/goo.txt'] + + """ + pass From 2829791c3e4d85c1308be0f9ca63d040eb5e40ff Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Mon, 15 Feb 2016 07:17:28 -0800 Subject: [PATCH 17/73] refactoring inputs... --- nipype/interfaces/base.py | 233 ++++++++++------------------ nipype/interfaces/io.py | 9 +- nipype/interfaces/specs.py | 67 ++++---- nipype/interfaces/utility.py | 8 +- nipype/pipeline/engine/base.py | 3 +- nipype/pipeline/engine/nodes.py | 31 ++-- nipype/pipeline/engine/utils.py | 4 +- nipype/pipeline/engine/workflows.py | 31 ++-- nipype/utils/errors.py | 23 +++ 9 files changed, 180 insertions(+), 229 deletions(-) create mode 100644 nipype/utils/errors.py diff --git a/nipype/interfaces/base.py b/nipype/interfaces/base.py index 7a1ceb5d1c..bada93f907 100644 --- a/nipype/interfaces/base.py +++ b/nipype/interfaces/base.py @@ -14,6 +14,7 @@ from copy import deepcopy import errno import os +import os.path as op import platform from socket import getfqdn from string import Template @@ -30,12 +31,13 @@ from configparser import NoOptionError -from .traits_extension import TraitError, isdefined +from .traits_extension import TraitError, isdefined, Undefined from ..utils.filemanip import md5, FileNotFoundError from ..utils.misc import trim, str2bool, is_container from .specs import (BaseInterfaceInputSpec, CommandLineInputSpec, - StdOutCommandLineInputSpec, MpiCommandLineInputSpec, - SEMLikeCommandLineInputSpec) + StdOutCommandLineInputSpec, StdOutCommandLineOutputSpec, + MpiCommandLineInputSpec, + SEMLikeCommandLineInputSpec, TraitedSpec) from ..utils.provenance import write_provenance from .. import config, logging, LooseVersion from .. import __version__ @@ -45,18 +47,8 @@ __docformat__ = 'restructuredtext' -class NipypeInterfaceError(Exception): - """Error raised in nipype interfaces""" - def __init__(self, value): - self.value = value - super(NipypeInterfaceError, self).__init__(value) - - def __str__(self): - return repr(self.value) - - def _unlock_display(ndisplay): - lockf = os.path.join('/tmp', '.X%d-lock' % ndisplay) + lockf = op.join('/tmp', '.X%d-lock' % ndisplay) try: os.remove(lockf) except: @@ -74,10 +66,10 @@ def _exists_in_path(cmd, environ): input_environ = environ.get("PATH", os.environ.get("PATH", "")) extensions = os.environ.get("PATHEXT", "").split(os.pathsep) for directory in input_environ.split(os.pathsep): - base = os.path.join(directory, cmd) + base = op.join(directory, cmd) options = [base] + [(base + ext) for ext in extensions] for filename in options: - if os.path.exists(filename): + if op.exists(filename): return True, filename return False, None @@ -96,7 +88,7 @@ def load_template(name): """ - full_fname = os.path.join(os.path.dirname(__file__), + full_fname = op.join(op.dirname(__file__), 'script_templates', name) template_file = open(full_fname) template = Template(template_file.read()) @@ -224,7 +216,7 @@ def _get_bunch_hash(self): else: item = val try: - if os.path.isfile(item): + if op.isfile(item): infile_list.append(key) except TypeError: # `item` is not a file or string. @@ -248,7 +240,7 @@ def _hash_infile(self, adict, key): stuff = [stuff] file_list = [] for fname in stuff: - if os.path.isfile(fname): + if op.isfile(fname): md5obj = md5() with open(fname, 'rb') as filep: while True: @@ -366,25 +358,19 @@ def _outputs_help(cls): """ Prints outputs help""" raise NotImplementedError - @classmethod - def _outputs(cls): - """ Initializes outputs""" - raise NotImplementedError - @property def version(self): raise NotImplementedError - def run(self): - """Execute the command.""" + def _pre_run(self, **inputs): raise NotImplementedError - def aggregate_outputs(self, runtime=None, needed_outputs=None): - """Called to populate outputs""" + def _post_run(self, **inputs): raise NotImplementedError - def _list_outputs(self): - """ List expected outputs""" + + def run(self): + """Execute the command.""" raise NotImplementedError def _get_filecopy_info(self): @@ -413,6 +399,7 @@ class BaseInterface(Interface): """ input_spec = BaseInterfaceInputSpec + output_spec = TraitedSpec _version = None _additional_metadata = [] _redirect_x = False @@ -422,6 +409,7 @@ def __init__(self, **inputs): raise Exception('No input_spec in class: %s' % self.__class__.__name__) self.inputs = self.input_spec(**inputs) + self.outputs = self.output_spec() @classmethod def help(cls, returnhelp=False): @@ -434,22 +422,13 @@ def help(cls, returnhelp=False): else: docstring = [''] - allhelp = '\n'.join(docstring + ['Inputs::'] + cls.input_spec.help() + [''] + - ['Outputs::', ''] + cls.output_spec.help() + ['']) + allhelp = '\n'.join(docstring + ['Inputs::'] + cls.input_spec().help() + [''] + + ['Outputs::', ''] + cls.output_spec().help() + ['']) if returnhelp: return allhelp else: print(allhelp) - def _outputs(self): - """ Returns a bunch containing output fields for the class - """ - outputs = None - if self.output_spec: - outputs = self.output_spec() #pylint: disable=E1102 - return outputs - - def _run_wrapper(self, runtime): sysdisplay = os.getenv('DISPLAY') if self._redirect_x: @@ -480,7 +459,7 @@ def _run_wrapper(self, runtime): return runtime - def _run_interface(self, runtime): + def _run_interface(self, runtime, *kwargs): """ Core function that executes interface """ raise NotImplementedError @@ -492,6 +471,33 @@ def _pre_run(self, **inputs): if self.version: self.inputs.check_version(LooseVersion(str(self.version))) + def _post_run(self): + if self.output_spec is None: + IFLOGGER.warn('Interface does not have an output specification') + return None + + ns_outputs = {} + for ns, sp in list(self.inputs.namesource_items()): + ns_pointer = getattr(sp, 'out_name', None) + if ns_pointer is not None: + ns_outputs[ns_pointer] = ns + + # Search for inputs with the same name + for out_name, spec in list(self.outputs.items()): + if out_name in ns_outputs.keys(): + value = getattr(self.inputs, ns_outputs[out_name], Undefined) + else: + value = getattr(self.inputs, out_name, Undefined) + + if isdefined(value): + setattr(self.outputs, out_name, op.abspath(value)) + + if spec.exists: + if not op.isfile(getattr(self.outputs, out_name)): + raise FileNotFoundError( + 'Output %s not found for interface %s.' % + (out_name, self.__class__)) + def run(self, **inputs): """Execute this interface. @@ -550,7 +556,8 @@ def run(self, **inputs): inputs=self.inputs.get_traitsfree()) if runtime.traceback is None: - results.outputs=self.aggregate_outputs(runtime) + self._post_run() + results.outputs = self.outputs prov_record = None if str2bool(config.get('execution', 'write_provenance')): @@ -562,69 +569,6 @@ def run(self, **inputs): raise return results - def _list_outputs(self): - """ List the expected outputs - """ - if self.output_spec is None: - IFLOGGER.warn('Interface does not have output specification') - return None - - metadata = dict(name_source=lambda t: t is not None) - out_traits = self.inputs.traits(**metadata) - if out_traits: - outputs = self.output_spec().get() #pylint: disable=E1102 - for name, trait_spec in out_traits.items(): - out_name = name - if trait_spec.output_name is not None: - out_name = trait_spec.output_name - value = self._resolve_namesource(name) - if isdefined(value): - outputs[out_name] = os.path.abspath(value) - return outputs - - def aggregate_outputs(self, runtime=None, needed_outputs=None): - """ Collate expected outputs and check for existence - """ - predicted_outputs = self._list_outputs() - outputs = self._outputs() - - # fill automatically resolved outputs - metadata = dict(name_source=lambda t: t is not None) - - for name, spec in self.inputs.traits(**metadata).iteritems(): - out_name = name - if spec.output_name is not None: - out_name = spec.output_name - value = getattr(self.inputs, name) - if value is not None and isdefined(value): - setattr(outputs, out_name, os.path.abspath(value)) - - if predicted_outputs: - _unavailable_outputs = [] - if outputs: - _unavailable_outputs = \ - self._check_version_requirements(self._outputs()) - for key, val in list(predicted_outputs.items()): - if needed_outputs and key not in needed_outputs: - continue - if key in _unavailable_outputs: - raise KeyError(('Output trait %s not available in version ' - '%s of interface %s. Please inform ' - 'developers.') % (key, self.version, - self.__class__.__name__)) - try: - setattr(outputs, key, val) - _ = getattr(outputs, key) - except TraitError as error: - if hasattr(error, 'info') and \ - error.info.startswith("an existing"): - msg = ("File/Directory '%s' not found for %s output " - "'%s'." % (val, self.__class__.__name__, key)) - raise FileNotFoundError(msg) - else: - raise error - return outputs - @property def version(self): if self._version is None: @@ -700,8 +644,8 @@ def run_command(runtime, output=None, timeout=0.01, redirect_x=False): cmdline = 'xvfb-run -a ' + cmdline if output == 'file': - errfile = os.path.join(runtime.cwd, 'stderr.nipype') - outfile = os.path.join(runtime.cwd, 'stdout.nipype') + errfile = op.join(runtime.cwd, 'stderr.nipype') + outfile = op.join(runtime.cwd, 'stdout.nipype') stderr = open(errfile, 'wt') # t=='text'===default stdout = open(outfile, 'wt') @@ -719,8 +663,8 @@ def run_command(runtime, output=None, timeout=0.01, redirect_x=False): cwd=runtime.cwd, env=runtime.environ) result = {} - errfile = os.path.join(runtime.cwd, 'stderr.nipype') - outfile = os.path.join(runtime.cwd, 'stdout.nipype') + errfile = op.join(runtime.cwd, 'stderr.nipype') + outfile = op.join(runtime.cwd, 'stdout.nipype') if output == 'stream': streams = [Stream('stdout', proc.stdout), Stream('stderr', proc.stderr)] @@ -794,20 +738,14 @@ def get_dependencies(name, environ): """ PIPE = subprocess.PIPE if sys.platform == 'darwin': - proc = subprocess.Popen('otool -L `which %s`' % name, - stdout=PIPE, - stderr=PIPE, - shell=True, - env=environ) + proc = subprocess.Popen( + 'otool -L `which %s`' % name, stdout=PIPE, stderr=PIPE, shell=True, env=environ) elif 'linux' in sys.platform: - proc = subprocess.Popen('ldd `which %s`' % name, - stdout=PIPE, - stderr=PIPE, - shell=True, - env=environ) + proc = subprocess.Popen( + 'ldd `which %s`' % name, stdout=PIPE, stderr=PIPE, shell=True, env=environ) else: return 'Platform %s not supported' % sys.platform - o, e = proc.communicate() + o, _ = proc.communicate() return o.rstrip() @@ -894,9 +832,9 @@ def cmd(self): def cmdline(self): """ `command` plus any arguments (args) validates arguments and generates command line""" - self._check_mandatory_inputs() - self._update_autonames() - allargs = self._parse_inputs() + self.inputs.check_inputs() + self.inputs.update_autonames() + allargs = self.inputs.parse_args() allargs.insert(0, self.cmd) return ' '.join(allargs) @@ -910,13 +848,11 @@ def raise_exception(self, runtime): @classmethod def help(cls, returnhelp=False): allhelp = super(CommandLine, cls).help(returnhelp=True) - - allhelp = "Wraps command **%s**\n\n" % cls._cmd + allhelp + allhelp = "Wraps command ``%s``\n\n" % cls._cmd + allhelp if returnhelp: return allhelp - else: - print(allhelp) + print(allhelp) def _get_environ(self): out_environ = {} @@ -946,7 +882,7 @@ def _run_wrapper(self, runtime): runtime = self._run_interface(runtime) return runtime - def _run_interface(self, runtime, correct_return_codes=[0]): + def _run_interface(self, runtime, **kwargs): """Execute command via subprocess Parameters @@ -959,6 +895,10 @@ def _run_interface(self, runtime, correct_return_codes=[0]): adds stdout, stderr, merged, cmdline, dependencies, command_path """ + correct_return_codes = [0] + if 'correct_return_codes' in kwargs.keys(): + correct_return_codes = kwargs[correct_return_codes] + setattr(runtime, 'stdout', None) setattr(runtime, 'stderr', None) setattr(runtime, 'cmdline', self.cmdline) @@ -981,21 +921,11 @@ def _run_interface(self, runtime, correct_return_codes=[0]): return runtime - def _gen_filename(self, name): - raise NotImplementedError - class StdOutCommandLine(CommandLine): + """A command line that writes into the output stream""" input_spec = StdOutCommandLineInputSpec - - def _gen_filename(self, name): - if name is 'out_file': - return self._gen_outfilename() - else: - return None - - def _gen_outfilename(self): - raise NotImplementedError + output_spec = StdOutCommandLineOutputSpec class MpiCommandLine(CommandLine): @@ -1023,7 +953,7 @@ def cmdline(self): result = [] if self.inputs.use_mpi: result.append('mpiexec') - if self.inputs.n_procs: + if isdefined(self.inputs.n_procs): result.append('-n %d' % self.inputs.n_procs) result.append(super(MpiCommandLine, self).cmdline) return ' '.join(result) @@ -1039,22 +969,17 @@ class SEMLikeCommandLine(CommandLine): """ input_spec = SEMLikeCommandLineInputSpec - def _list_outputs(self): - outputs = self.output_spec().get() #pylint: disable=E1102 - return self._outputs_from_inputs(outputs) - - def _outputs_from_inputs(self, outputs): - for name in list(outputs.keys()): + def _post_run(self): + for name in list(self.outputs.keys()): corresponding_input = getattr(self.inputs, name) if isdefined(corresponding_input): if (isinstance(corresponding_input, bool) and corresponding_input): - outputs[name] = \ - os.path.abspath(self._outputs_filenames[name]) + setattr(self.outputs, name, op.abspath( + self._outputs_filenames[name])) else: if isinstance(corresponding_input, list): - outputs[name] = [os.path.abspath(inp) - for inp in corresponding_input] + setattr(self.outputs, name, + [op.abspath(inp) for inp in corresponding_input]) else: - outputs[name] = os.path.abspath(corresponding_input) - return outputs + setattr(self.outputs, name, op.abspath(corresponding_input)) diff --git a/nipype/interfaces/io.py b/nipype/interfaces/io.py index 6f0ad3bc32..fd5d3a9289 100644 --- a/nipype/interfaces/io.py +++ b/nipype/interfaces/io.py @@ -35,10 +35,11 @@ import sqlite3 -from .base import (TraitedSpec, traits, File, Directory, - BaseInterface, InputMultiPath, isdefined, - OutputMultiPath, DynamicTraitedSpec, - Undefined, BaseInterfaceInputSpec) +from .traits_extension import traits, Undefined, File, Directory, isdefined +from .base import BaseInterface +from .specs import (TraitedSpec, DynamicTraitedSpec, + BaseInterfaceInputSpec, InputMultiPath, + OutputMultiPath) from .. import config from ..external.six import string_types from ..utils.filemanip import (copyfile, list_to_filename, diff --git a/nipype/interfaces/specs.py b/nipype/interfaces/specs.py index 6e291a7472..876afbe628 100644 --- a/nipype/interfaces/specs.py +++ b/nipype/interfaces/specs.py @@ -19,8 +19,9 @@ from .traits_extension import (traits, Undefined, TraitDictObject, TraitListObject, TraitError, isdefined, File, has_metadata) -from ..utils.filemanip import md5, auto_hash +from ..utils.filemanip import md5, auto_hash, split_filename from ..utils.misc import is_container +from ..utils.errors import InterfaceInputsError from .. import logging, LooseVersion from .. import __version__ from ..external.six import string_types @@ -304,14 +305,14 @@ def _get_trait_desc(self, name, spec=None): initial_indent='\t\t', subsequent_indent='\t\t ') return manhelpstr - @classmethod - def help(cls): + def help(self): """Print help of these traits""" - helpstr = [''] - for name, spec in sorted(cls.traits(transient=None).items()): - helpstr += cls._get_trait_desc(name, spec) - if len(helpstr) == 2: + helpstr = [] + for name, spec in sorted(self.traits(transient=None).items()): + helpstr += self._get_trait_desc(name, spec) + if len(helpstr) == 0: helpstr += ['\tNone'] + return helpstr class TraitedSpec(BaseTraitedSpec): @@ -338,18 +339,23 @@ def __init__(self, **kwargs): def mandatory_items(self): """Get those items that are mandatory""" - return self.traits(mandatory=True).items() + return list(self.traits(mandatory=True).items()) def optional_items(self): """Get those items that are optional""" allitems = self.traits(transient=None).items() - for k in self.mandatory_items().keys(): + for k, _ in self.mandatory_items(): try: allitems.pop(k, None) except KeyError: pass return allitems + def namesource_items(self): + """Get inputs that will generate outputs""" + metadata = dict(name_source=lambda t: t is not None) + return list(self.traits(**metadata).items()) + def _check_xor(self, name): """ Checks inputs with xor list """ if isdefined(getattr(self, name)): @@ -368,16 +374,19 @@ def _check_xor(self, name): def _check_requires(self, name, spec=None): if not isdefined(getattr(self, name)): - return - + return True if spec is None: - spec = self.traits()[name] + spec = self.traits()[name] + if spec.requires is None: + return True + req_defined = [isdefined(rname) for rname in getattr(spec, 'requires', [])] if not all(req_defined): raise ValueError( '%s requires a value for input \'%s\' because one of %s is set. For a list of' ' required inputs, see %s.help()' % (self.__class__.__name__, name, ', '.join(spec.requires), self.__class__.__name__)) + return True def check_inputs(self): @@ -437,7 +446,7 @@ def _resolve_namesource(self, name, chain=None): base = source else: if name in chain: - raise NipypeInterfaceError('Mutually pointing name_sources') + raise InterfaceInputsError('Mutually pointing name_sources') chain.append(name) return self._resolve_namesource(ns, chain) @@ -450,7 +459,7 @@ def _resolve_namesource(self, name, chain=None): return retval - def _update_autonames(self): + def update_autonames(self): """ Checks for inputs undefined but providing name_source """ @@ -520,22 +529,23 @@ def check_version(self, version, raise_exception=True): return unavailable_traits - - @classmethod - def help(cls): + def help(self): """Print inputs formatted""" - helpstr = [] - manhelpstr = ['', '\t[Mandatory]'] - for name, spec in sorted(cls.mandatory_items()): - manhelpstr += cls._get_trait_desc(name, spec) - - opthelpstr = ['', '\t[Optional]'] - for name, spec in sorted(cls.optional_items()): - opthelpstr += cls._get_trait_desc(name, spec) + manhelpstr = [] + for name, spec in sorted(self.mandatory_items()): + manhelpstr += self._get_trait_desc(name, spec) + opthelpstr = [] + for name, spec in sorted(self.optional_items()): + opthelpstr += self._get_trait_desc(name, spec) + helpstr = [] if manhelpstr: + manhelpstr.insert(0, '') + manhelpstr.insert(1, '\t[Mandatory]') helpstr += manhelpstr if opthelpstr: + opthelpstr.insert(0, '') + opthelpstr.insert(1, '\t[Optional]') helpstr += opthelpstr if not helpstr: @@ -596,7 +606,7 @@ class CommandLineInputSpec(BaseInterfaceInputSpec): 'writes output to file, `none` - output is ignored') def _format_arg(self, name, spec=None, value=None): - """A helper function for _parse_inputs + """A helper function for parse_args Formats a trait containing argstr metadata """ @@ -645,7 +655,7 @@ def _format_arg(self, name, spec=None, value=None): # Append options using format string. return argstr % value - def _parse_inputs(self, skip=None): + def parse_args(self, skip=None): """Parse all inputs using the ``argstr`` format string in the Trait. Any inputs that are assigned (not the default_value) are formatted @@ -688,6 +698,9 @@ class StdOutCommandLineInputSpec(CommandLineInputSpec): """Appends a command line argument to pipe standard output to a file""" out_file = File('standard.out', argstr="> %s", position=-1, usedefault=True) +class StdOutCommandLineOutputSpec(TraitedSpec): + out_file = File(exists=True, desc='file containing the standard output') + class MpiCommandLineInputSpec(CommandLineInputSpec): """Appends the necessary inputs to run MpiCommandLine interfaces""" diff --git a/nipype/interfaces/utility.py b/nipype/interfaces/utility.py index 37883d4e5c..afb10d5b01 100644 --- a/nipype/interfaces/utility.py +++ b/nipype/interfaces/utility.py @@ -21,9 +21,11 @@ import numpy as np import nibabel as nb -from .base import (traits, TraitedSpec, DynamicTraitedSpec, File, - Undefined, isdefined, OutputMultiPath, - InputMultiPath, BaseInterface, BaseInterfaceInputSpec) +from .traits_extension import traits, Undefined, File, isdefined +from .base import BaseInterface +from .specs import (TraitedSpec, DynamicTraitedSpec, + BaseInterfaceInputSpec, InputMultiPath, + OutputMultiPath) from .io import IOBase, add_traits from ..external.six import string_types from ..testing import assert_equal diff --git a/nipype/pipeline/engine/base.py b/nipype/pipeline/engine/base.py index 148db2f271..5491573399 100644 --- a/nipype/pipeline/engine/base.py +++ b/nipype/pipeline/engine/base.py @@ -27,8 +27,7 @@ from copy import deepcopy import re import numpy as np -from ...interfaces.traits_extension import traits, Undefined -from ...interfaces.base import DynamicTraitedSpec +from ...interfaces.specs import DynamicTraitedSpec from ...utils.filemanip import loadpkl, savepkl from ... import logging diff --git a/nipype/pipeline/engine/nodes.py b/nipype/pipeline/engine/nodes.py index 9f9165e3b2..feb58c4047 100644 --- a/nipype/pipeline/engine/nodes.py +++ b/nipype/pipeline/engine/nodes.py @@ -48,29 +48,26 @@ import networkx as nx from ...utils.misc import package_check, str2bool -package_check('networkx', '1.3') - from ... import config, logging -logger = logging.getLogger('workflow') -from ...interfaces.base import (traits, InputMultiPath, CommandLine, - Undefined, TraitedSpec, DynamicTraitedSpec, - Bunch, InterfaceResult, md5, Interface, - TraitDictObject, TraitListObject, isdefined) -from ...utils.misc import (getsource, create_function_from_source, - flatten, unflatten) -from ...utils.filemanip import (save_json, FileNotFoundError, - filename_to_list, list_to_filename, - copyfiles, fnames_presuffix, loadpkl, - split_filename, load_json, savepkl, - write_rst_header, write_rst_dict, - write_rst_list) + +from ...utils.misc import flatten, unflatten +from ...utils.filemanip import md5, save_json, FileNotFoundError, filename_to_list, \ + list_to_filename, copyfiles, fnames_presuffix, loadpkl, split_filename, load_json, \ + savepkl, write_rst_header, write_rst_dict, write_rst_list + +from ...interfaces.traits_extension import traits, Undefined, isdefined +from ...interfaces.specs import InputMultiPath, DynamicTraitedSpec +from ...interfaces.base import CommandLine, Bunch, InterfaceResult, Interface + from ...external.six import string_types -from .utils import (generate_expanded_graph, modify_paths, - export_graph, make_output_dir, write_workflow_prov, +from .utils import (modify_paths, make_output_dir, write_workflow_prov, clean_working_directory, format_dot, topological_sort, get_print_name, merge_dict, evaluate_connect_function) from .base import EngineBase +package_check('networkx', '1.3') +logger = logging.getLogger('workflow') + class Node(EngineBase): """Wraps interface objects for use in pipeline diff --git a/nipype/pipeline/engine/utils.py b/nipype/pipeline/engine/utils.py index 440400c8e0..4ed3209f0c 100644 --- a/nipype/pipeline/engine/utils.py +++ b/nipype/pipeline/engine/utils.py @@ -36,8 +36,8 @@ from ...utils.filemanip import (fname_presuffix, FileNotFoundError, filename_to_list, get_related_files) from ...utils.misc import create_function_from_source, str2bool -from ...interfaces.base import (CommandLine, isdefined, Undefined, - InterfaceResult) +from ...interfaces.traits_extension import isdefined, Undefined +from ...interfaces.base import CommandLine, InterfaceResult from ...interfaces.utility import IdentityInterface from ...utils.provenance import ProvStore, pm, nipype_ns, get_id diff --git a/nipype/pipeline/engine/workflows.py b/nipype/pipeline/engine/workflows.py index b14d73a307..26fd3ae883 100644 --- a/nipype/pipeline/engine/workflows.py +++ b/nipype/pipeline/engine/workflows.py @@ -48,31 +48,22 @@ import networkx as nx from ...utils.misc import package_check, str2bool -package_check('networkx', '1.3') - from ... import config, logging -logger = logging.getLogger('workflow') -from ...interfaces.base import (traits, InputMultiPath, CommandLine, - Undefined, TraitedSpec, DynamicTraitedSpec, - Bunch, InterfaceResult, md5, Interface, - TraitDictObject, TraitListObject, isdefined) + +from ...interfaces.specs import TraitedSpec +from ...interfaces.traits_extension import traits, TraitListObject, TraitDictObject from ...utils.misc import (getsource, create_function_from_source, flatten, unflatten) -from ...utils.filemanip import (save_json, FileNotFoundError, - filename_to_list, list_to_filename, - copyfiles, fnames_presuffix, loadpkl, - split_filename, load_json, savepkl, - write_rst_header, write_rst_dict, - write_rst_list) +from ...utils.filemanip import save_json from ...external.six import string_types -from .utils import (generate_expanded_graph, modify_paths, - export_graph, make_output_dir, write_workflow_prov, - clean_working_directory, format_dot, topological_sort, - get_print_name, merge_dict, evaluate_connect_function, - _write_inputs, format_node) - +from .utils import (generate_expanded_graph, export_graph, make_output_dir, + write_workflow_prov, format_dot, topological_sort, + get_print_name, merge_dict, format_node) from .base import EngineBase -from .nodes import Node, MapNode +from .nodes import MapNode + +logger = logging.getLogger('workflow') +package_check('networkx', '1.3') class Workflow(EngineBase): diff --git a/nipype/utils/errors.py b/nipype/utils/errors.py new file mode 100644 index 0000000000..0026e84652 --- /dev/null +++ b/nipype/utils/errors.py @@ -0,0 +1,23 @@ +# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- +# vi: set ft=python sts=4 ts=4 sw=4 et: +""" +Define custom errors +""" + +class InterfaceError(Exception): + """Error raised in nipype interfaces""" + def __init__(self, value): + self.value = value + super(InterfaceError, self).__init__(value) + + def __str__(self): + return repr(self.value) + +class InterfaceInputsError(InterfaceError): + """Error raised in nipype interfaces""" + def __init__(self, value): + self.value = value + super(InterfaceInputsError, self).__init__(value) + + def __str__(self): + return repr(self.value) From be44a2d01c4266c3bfd7a2a98922f19467fc86a0 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Mon, 15 Feb 2016 10:15:28 -0800 Subject: [PATCH 18/73] Fixing problems with new inputs system --- nipype/algorithms/icc.py | 56 ++- nipype/algorithms/mesh.py | 65 +-- nipype/algorithms/metrics.py | 131 ++---- nipype/algorithms/misc.py | 574 +++++++++-------------- nipype/algorithms/modelgen.py | 41 +- nipype/algorithms/rapidart.py | 339 +++++++------ nipype/algorithms/tests/test_rapidart.py | 25 +- nipype/interfaces/specs.py | 26 +- 8 files changed, 520 insertions(+), 737 deletions(-) diff --git a/nipype/algorithms/icc.py b/nipype/algorithms/icc.py index af61c260b9..7db40370bf 100644 --- a/nipype/algorithms/icc.py +++ b/nipype/algorithms/icc.py @@ -2,8 +2,9 @@ from builtins import range from numpy import ones, kron, mean, eye, hstack, dot, tile from scipy.linalg import pinv -from ..interfaces.base import BaseInterfaceInputSpec, TraitedSpec, \ - BaseInterface, traits, File +from ..interfaces.traits_extension import traits, File +from ..interfaces.specs import BaseInterfaceInputSpec, TraitedSpec +from ..interfaces.base import BaseInterface import nibabel as nb import numpy as np import os @@ -14,11 +15,16 @@ class ICCInputSpec(BaseInterfaceInputSpec): desc="n subjects m sessions 3D stat files", mandatory=True) mask = File(exists=True, mandatory=True) + icc_map = File('icc_map.nii', desc='name of output ICC map') + session_var_map = File('session_var_map.nii', desc="variance between sessions") + session_F_map = File('session_F_map.nii', desc="F map of sessions") + subject_var_map = File('subject_var_map.nii', desc="variance between subjects") class ICCOutputSpec(TraitedSpec): icc_map = File(exists=True) session_var_map = File(exists=True, desc="variance between sessions") + session_F_map = File(exists=True, desc="variance between sessions") subject_var_map = File(exists=True, desc="variance between subjects") @@ -44,48 +50,46 @@ def _run_interface(self, runtime): session_var = np.zeros(session_datas[0][0].shape) subject_var = np.zeros(session_datas[0][0].shape) - for x in range(icc.shape[0]): - Y = all_data[x, :, :] - icc[x], subject_var[x], session_var[x], session_F[x], _, _ = ICC_rep_anova(Y) + for i in range(icc.shape[0]): + data = all_data[i, :, :] + icc[i], subject_var[i], session_var[i], session_F[i], _, _ = ICC_rep_anova(data) nim = nb.load(self.inputs.subjects_sessions[0][0]) new_data = np.zeros(nim.shape) new_data[maskdata] = icc.reshape(-1,) new_img = nb.Nifti1Image(new_data, nim.affine, nim.header) - nb.save(new_img, 'icc_map.nii') + nb.save(new_img, self.inputs.icc_map) new_data = np.zeros(nim.shape) new_data[maskdata] = session_var.reshape(-1,) new_img = nb.Nifti1Image(new_data, nim.affine, nim.header) - nb.save(new_img, 'session_var_map.nii') + nb.save(new_img, self.inputs.session_var_map) new_data = np.zeros(nim.shape) new_data[maskdata] = subject_var.reshape(-1,) new_img = nb.Nifti1Image(new_data, nim.affine, nim.header) - nb.save(new_img, 'subject_var_map.nii') + nb.save(new_img, self.inputs.subject_var_map.nii) + new_data = np.zeros(nim.shape) + new_data[maskdata] = session_F.reshape(-1,) + new_img = nb.Nifti1Image(new_data, nim.affine, nim.header) + nb.save(new_img, self.inputs.session_F_map) return runtime - def _list_outputs(self): - outputs = self._outputs().get() - outputs['icc_map'] = os.path.abspath('icc_map.nii') - outputs['sessions_F_map'] = os.path.abspath('sessions_F_map.nii') - outputs['session_var_map'] = os.path.abspath('session_var_map.nii') - outputs['subject_var_map'] = os.path.abspath('subject_var_map.nii') - return outputs - -def ICC_rep_anova(Y): +def ICC_rep_anova(data): ''' - the data Y are entered as a 'table' ie subjects are in rows and repeated + the data (Y) are entered as a 'table' ie subjects are in rows and repeated measures in columns One Sample Repeated measure ANOVA - Y = XB + E with X = [FaTor / Subjects] + .. math:: + + Y = XB + E with X = [FaTor / Subjects] ''' - [nb_subjects, nb_conditions] = Y.shape + [nb_subjects, nb_conditions] = data.shape dfc = nb_conditions - 1 dfe = (nb_subjects - 1) * dfc dfr = nb_subjects - 1 @@ -94,8 +98,8 @@ def ICC_rep_anova(Y): # ------------------------------------ # Sum Square Total - mean_Y = mean(Y) - SST = ((Y - mean_Y) ** 2).sum() + mean_Y = mean(data) + SST = ((data - mean_Y) ** 2).sum() # create the design matrix for the different levels x = kron(eye(nb_conditions), ones((nb_subjects, 1))) # sessions @@ -103,16 +107,16 @@ def ICC_rep_anova(Y): X = hstack([x, x0]) # Sum Square Error - predicted_Y = dot(dot(dot(X, pinv(dot(X.T, X))), X.T), Y.flatten('F')) - residuals = Y.flatten('F') - predicted_Y + predicted_Y = dot(dot(dot(X, pinv(dot(X.T, X))), X.T), data.flatten('F')) + residuals = data.flatten('F') - predicted_Y SSE = (residuals ** 2).sum() - residuals.shape = Y.shape + residuals.shape = data.shape MSE = SSE / dfe # Sum square session effect - between colums/sessions - SSC = ((mean(Y, 0) - mean_Y) ** 2).sum() * nb_subjects + SSC = ((mean(data, 0) - mean_Y) ** 2).sum() * nb_subjects MSC = SSC / dfc / nb_subjects session_effect_F = MSC / MSE diff --git a/nipype/algorithms/mesh.py b/nipype/algorithms/mesh.py index fa63c69c9d..5e33d50a7d 100644 --- a/nipype/algorithms/mesh.py +++ b/nipype/algorithms/mesh.py @@ -21,8 +21,10 @@ from .. import logging from ..external.six import string_types -from ..interfaces.base import (BaseInterface, traits, TraitedSpec, File, - BaseInterfaceInputSpec) +from ..interfaces.traits_extension import traits, File +from ..interfaces.specs import BaseInterfaceInputSpec, TraitedSpec +from ..interfaces.base import BaseInterface + iflogger = logging.getLogger('interface') @@ -47,8 +49,7 @@ class WarpPointsInputSpec(BaseInterfaceInputSpec): desc=('dense deformation field to be applied')) interp = traits.Enum('cubic', 'nearest', 'linear', usedefault=True, mandatory=True, desc='interpolation') - out_points = File(name_source='points', name_template='%s_warped', - output_name='out_points', keep_extension=True, + out_points = File(name_source='points', name_template='%s_warped', keep_extension=True, desc='the warped point set') @@ -77,22 +78,6 @@ class WarpPoints(TVTKBaseInterface): input_spec = WarpPointsInputSpec output_spec = WarpPointsOutputSpec - def _gen_fname(self, in_file, suffix='generated', ext=None): - import os.path as op - - fname, fext = op.splitext(op.basename(in_file)) - - if fext == '.gz': - fname, fext2 = op.splitext(fname) - fext = fext2 + fext - - if ext is None: - ext = fext - - if ext[0] == '.': - ext = ext[1:] - return op.abspath('%s_%s.%s' % (fname, suffix, ext)) - def _run_interface(self, runtime): import nibabel as nb import numpy as np @@ -137,19 +122,10 @@ def _run_interface(self, runtime): else: w.set_input_data_object(mesh) - w.file_name = self._gen_fname(self.inputs.points, - suffix='warped', - ext='.vtk') + w.file_name = self.inputs.out_points w.write() return runtime - def _list_outputs(self): - outputs = self._outputs().get() - outputs['out_points'] = self._gen_fname(self.inputs.points, - suffix='warped', - ext='.vtk') - return outputs - class ComputeMeshWarpInputSpec(BaseInterfaceInputSpec): surface1 = File(exists=True, mandatory=True, @@ -277,15 +253,12 @@ def _run_interface(self, runtime): writer.write() - self._distance = np.average(errvector, weights=weights) - return runtime + _distance = np.average(errvector, weights=weights) - def _list_outputs(self): - outputs = self._outputs().get() - outputs['out_file'] = op.abspath(self.inputs.out_file) - outputs['out_warp'] = op.abspath(self.inputs.out_warp) - outputs['distance'] = self._distance - return outputs + self.outputs.out_file = op.abspath(self.inputs.out_file) + self.outputs.out_warp = op.abspath(self.inputs.out_warp) + self.outputs.distance = _distance + return runtime class MeshWarpMathsInputSpec(BaseInterfaceInputSpec): @@ -302,11 +275,11 @@ class MeshWarpMathsInputSpec(BaseInterfaceInputSpec): operation = traits.Enum('sum', 'sub', 'mul', 'div', usedefault=True, desc=('operation to be performed')) - out_warp = File('warp_maths.vtk', usedefault=True, - desc='vtk file based on in_surf and warpings mapping it ' - 'to out_file') - out_file = File('warped_surf.vtk', usedefault=True, - desc='vtk with surface warped') + out_warp = File(name_source='in_surf', name_template='%s_warp', keep_extension=True, + usedefault=True, desc='vtk file based on in_surf and warpings mapping it ' + 'to out_file') + out_file = File(name_source='in_surf', name_template='%s_warped', keep_extension=True, + usedefault=True, desc='vtk with surface warped') class MeshWarpMathsOutputSpec(TraitedSpec): @@ -416,12 +389,6 @@ def _run_interface(self, runtime): return runtime - def _list_outputs(self): - outputs = self._outputs().get() - outputs['out_file'] = op.abspath(self.inputs.out_file) - outputs['out_warp'] = op.abspath(self.inputs.out_warp) - return outputs - class P2PDistance(ComputeMeshWarp): diff --git a/nipype/algorithms/metrics.py b/nipype/algorithms/metrics.py index 25ace5f012..4e27f181fe 100644 --- a/nipype/algorithms/metrics.py +++ b/nipype/algorithms/metrics.py @@ -27,9 +27,10 @@ from .. import logging from ..utils.misc import package_check -from ..interfaces.base import (BaseInterface, traits, TraitedSpec, File, - InputMultiPath, - BaseInterfaceInputSpec, isdefined) +from ..interfaces.traits_extension import traits, File, isdefined +from ..interfaces.specs import BaseInterfaceInputSpec, TraitedSpec, InputMultiPath +from ..interfaces.base import BaseInterface + iflogger = logging.getLogger('interface') @@ -186,31 +187,27 @@ def _run_interface(self, runtime): nii2 = nb.load(self.inputs.volume2, mmap=False) if self.inputs.method == "eucl_min": - self._distance, self._point1, self._point2 = self._eucl_min( + _distance, _point1, _point2 = self._eucl_min( nii1, nii2) elif self.inputs.method == "eucl_cog": - self._distance = self._eucl_cog(nii1, nii2) + _distance = self._eucl_cog(nii1, nii2) elif self.inputs.method == "eucl_mean": - self._distance = self._eucl_mean(nii1, nii2) + _distance = self._eucl_mean(nii1, nii2) elif self.inputs.method == "eucl_wmean": - self._distance = self._eucl_mean(nii1, nii2, weighted=True) + _distance = self._eucl_mean(nii1, nii2, weighted=True) elif self.inputs.method == "eucl_max": - self._distance = self._eucl_max(nii1, nii2) - - return runtime + _distance = self._eucl_max(nii1, nii2) - def _list_outputs(self): - outputs = self._outputs().get() - outputs['distance'] = self._distance + self.outputs.distance = _distance if self.inputs.method == "eucl_min": - outputs['point1'] = self._point1 - outputs['point2'] = self._point2 + self.outputs.point1 = _point1 + self.outputs.point2 = _point2 elif self.inputs.method in ["eucl_mean", "eucl_wmean"]: - outputs['histogram'] = os.path.abspath(self._hist_filename) - return outputs + self.outputs.histogram = os.path.abspath(self._hist_filename) + return runtime class OverlapInputSpec(BaseInterfaceInputSpec): @@ -317,9 +314,9 @@ def _run_interface(self, runtime): volumes1.append(scale * len(data1[data1 == l])) volumes2.append(scale * len(data2[data2 == l])) - results = dict(jaccard=[], dice=[]) - results['jaccard'] = np.array(res) - results['dice'] = 2.0 * results['jaccard'] / (results['jaccard'] + 1.0) + _ove_rois = dict(jaccard=[], dice=[]) + _ove_rois['jaccard'] = np.array(res) + _ove_rois['dice'] = 2.0 * _ove_rois['jaccard'] / (_ove_rois['jaccard'] + 1.0) weights = np.ones((len(volumes1),), dtype=np.float32) if self.inputs.weighting != 'none': @@ -334,30 +331,22 @@ def _run_interface(self, runtime): nb.save(nb.Nifti1Image(both_data, nii1.affine, nii1.header), self.inputs.out_file) - self._labels = labels - self._ove_rois = results - self._vol_rois = (np.array(volumes1) - + _vol_rois = (np.array(volumes1) - np.array(volumes2)) / np.array(volumes1) - self._dice = round(np.sum(weights * results['dice']), 5) - self._jaccard = round(np.sum(weights * results['jaccard']), 5) - self._volume = np.sum(weights * self._vol_rois) - + _dice = round(np.sum(weights * _ove_rois['dice']), 5) + _jaccard = round(np.sum(weights * _ove_rois['jaccard']), 5) + _volume = np.sum(weights * _vol_rois) + self.outputs.labels = labels + self.outputs.jaccard = _jaccard + self.outputs.dice = _dice + self.outputs.volume_difference = _volume + self.outputs.roi_ji = _ove_rois['jaccard'].tolist() + self.outputs.roi_di = _ove_rois['dice'].tolist() + self.outputs.roi_voldiff = _vol_rois.tolist() + self.outputs.diff_file = os.path.abspath(self.inputs.out_file) return runtime - def _list_outputs(self): - outputs = self._outputs().get() - outputs['labels'] = self._labels - outputs['jaccard'] = self._jaccard - outputs['dice'] = self._dice - outputs['volume_difference'] = self._volume - - outputs['roi_ji'] = self._ove_rois['jaccard'].tolist() - outputs['roi_di'] = self._ove_rois['dice'].tolist() - outputs['roi_voldiff'] = self._vol_rois.tolist() - outputs['diff_file'] = os.path.abspath(self.inputs.out_file) - return outputs - class FuzzyOverlapInputSpec(BaseInterfaceInputSpec): in_ref = InputMultiPath(File(exists=True), mandatory=True, @@ -422,7 +411,7 @@ def _run_interface(self, runtime): # img_ref[:][msk>0] = img_ref[:][msk>0] / (np.sum( img_ref, axis=0 ))[msk>0] # img_tst[tst_msk>0] = img_tst[tst_msk>0] / np.sum( img_tst, axis=0 )[tst_msk>0] - self._jaccards = [] + _jaccards = [] volumes = [] diff_im = np.zeros(img_ref.shape) @@ -431,11 +420,11 @@ def _run_interface(self, runtime): num = np.minimum(ref_comp, tst_comp) ddr = np.maximum(ref_comp, tst_comp) diff_comp[ddr > 0] += 1.0 - (num[ddr > 0] / ddr[ddr > 0]) - self._jaccards.append(np.sum(num) / np.sum(ddr)) + _jaccards.append(np.sum(num) / np.sum(ddr)) volumes.append(np.sum(ref_comp)) - self._dices = 2.0 * (np.array(self._jaccards) / - (np.array(self._jaccards) + 1.0)) + _dices = 2.0 * (np.array(_jaccards) / + (np.array(_jaccards) + 1.0)) if self.inputs.weighting != "none": weights = 1.0 / np.array(volumes) @@ -444,8 +433,8 @@ def _run_interface(self, runtime): weights = weights / np.sum(weights) - setattr(self, '_jaccard', np.sum(weights * self._jaccards)) - setattr(self, '_dice', np.sum(weights * self._dices)) + setattr(self, '_jaccard', np.sum(weights * _jaccards)) + setattr(self, '_dice', np.sum(weights * _dices)) diff = np.zeros(diff_im[0].shape) @@ -457,17 +446,13 @@ def _run_interface(self, runtime): nb.load(self.inputs.in_ref[0]).header), self.inputs.out_file) - return runtime - - def _list_outputs(self): - outputs = self._outputs().get() for method in ("dice", "jaccard"): - outputs[method] = getattr(self, '_' + method) - # outputs['volume_difference'] = self._volume - outputs['diff_file'] = os.path.abspath(self.inputs.out_file) - outputs['class_fji'] = np.array(self._jaccards).astype(float).tolist() - outputs['class_fdi'] = self._dices.astype(float).tolist() - return outputs + setattr(self.outputs, method, getattr(self, '_' + method)) + # self.outputs.volume_difference = _volume + self.outputs.diff_file = os.path.abspath(self.inputs.out_file) + self.outputs.class_fji = np.array(_jaccards).astype(float).tolist() + self.outputs.class_fdi = _dices.astype(float).tolist() + return runtime class ErrorMapInputSpec(BaseInterfaceInputSpec): @@ -479,7 +464,8 @@ class ErrorMapInputSpec(BaseInterfaceInputSpec): metric = traits.Enum("sqeuclidean", "euclidean", desc='error map metric (as implemented in scipy cdist)', usedefault=True, mandatory=True) - out_map = File(desc="Name for the output file") + out_map = File(name_source='in_tst', name_template='%s_errormap', keep_extension=True, + desc="Name for the output file") class ErrorMapOutputSpec(TraitedSpec): @@ -547,7 +533,7 @@ def _run_interface(self, runtime): errvectorexp[msk_idxs] = errvector # Get averaged error - self._distance = np.average(errvector) # Only average the masked voxels + _distance = np.average(errvector) # Only average the masked voxels errmap = errvectorexp.reshape(mapshape) @@ -555,27 +541,11 @@ def _run_interface(self, runtime): hdr.set_data_dtype(np.float32) hdr['data_type'] = 16 hdr.set_data_shape(mapshape) - - if not isdefined(self.inputs.out_map): - fname, ext = op.splitext(op.basename(self.inputs.in_tst)) - if ext == '.gz': - fname, ext2 = op.splitext(fname) - ext = ext2 + ext - self._out_file = op.abspath(fname + "_errmap" + ext) - else: - self._out_file = self.inputs.out_map - nb.Nifti1Image(errmap.astype(np.float32), nii_ref.affine, - hdr).to_filename(self._out_file) - + hdr).to_filename(self.inputs.out_map) + self.outputs.distance = _distance return runtime - def _list_outputs(self): - outputs = self.output_spec().get() - outputs['out_map'] = self._out_file - outputs['distance'] = self._distance - return outputs - class SimilarityInputSpec(BaseInterfaceInputSpec): volume1 = File(exists=True, desc="3D/4D volume", mandatory=True) @@ -662,7 +632,7 @@ def _run_interface(self, runtime): else: mask2 = None - self._similarity = [] + _similarity = [] for ts1, ts2 in zip(vols1, vols2): histreg = HistogramRegistration(from_img=ts1, @@ -670,11 +640,8 @@ def _run_interface(self, runtime): similarity=self.inputs.metric, from_mask=mask1, to_mask=mask2) - self._similarity.append(histreg.eval(Affine())) + _similarity.append(histreg.eval(Affine())) + self.outputs.similarity = _similarity return runtime - def _list_outputs(self): - outputs = self._outputs().get() - outputs['similarity'] = self._similarity - return outputs diff --git a/nipype/algorithms/misc.py b/nipype/algorithms/misc.py index 1aea8cdbae..130099a43e 100644 --- a/nipype/algorithms/misc.py +++ b/nipype/algorithms/misc.py @@ -33,10 +33,12 @@ import warnings from . import metrics as nam -from ..interfaces.base import (BaseInterface, traits, TraitedSpec, File, - InputMultiPath, OutputMultiPath, - BaseInterfaceInputSpec, isdefined, - DynamicTraitedSpec, Undefined) + + +from ..interfaces.traits_extension import traits, File, isdefined, Undefined +from ..interfaces.specs import BaseInterfaceInputSpec, TraitedSpec, InputMultiPath, OutputMultiPath, DynamicTraitedSpec +from ..interfaces.base import BaseInterface + from nipype.utils.filemanip import fname_presuffix, split_filename iflogger = logging.getLogger('interface') @@ -48,19 +50,18 @@ class PickAtlasInputSpec(BaseInterfaceInputSpec): traits.Int, traits.List(traits.Int), desc=("Labels of regions that will be included in the mask. Must be\ compatible with the atlas used."), - mandatory=True - ) + mandatory=True) hemi = traits.Enum( 'both', 'left', 'right', desc="Restrict the mask to only one hemisphere: left or right", - usedefault=True - ) + usedefault=True) dilation_size = traits.Int( usedefault=True, - desc="Defines how much the mask will be dilated (expanded in 3D)." - ) - output_file = File(desc="Where to store the output mask.") - + desc="Defines how much the mask will be dilated (expanded in 3D).") + output_file = File(deprecated=True, new_name='mask_file', + desc="Where to store the output mask.") + mask_file = File(name_source='atlas', name_template='%s_mask', keep_extension=True, + desc="Where to store the output mask.") class PickAtlasOutputSpec(TraitedSpec): mask_file = File(exists=True, desc="output mask file") @@ -76,8 +77,7 @@ class PickAtlas(BaseInterface): def _run_interface(self, runtime): nim = self._get_brodmann_area() - nb.save(nim, self._gen_output_filename()) - + nb.save(nim, self.inputs.out_mask) return runtime def _gen_output_filename(self): @@ -113,25 +113,19 @@ def _get_brodmann_area(self): return nb.Nifti1Image(newdata, nii.affine, nii.header) - def _list_outputs(self): - outputs = self._outputs().get() - outputs['mask_file'] = self._gen_output_filename() - return outputs - class SimpleThresholdInputSpec(BaseInterfaceInputSpec): - volumes = InputMultiPath( - File(exists=True), desc='volumes to be thresholded', mandatory=True) - threshold = traits.Float( - desc='volumes to be thresholdedeverything below this value will be set\ - to zero', - mandatory=True - ) + volumes = InputMultiPath(File(exists=True), mandatory=True, + desc='volumes to be thresholded') + threshold = traits.Float(mandatory=True, desc='volumes to be thresholdedeverything below ' + 'this value will be set to zero') + thresholded_volumes = OutputMultiPath( + File(exists=True), name_source='volumes', name_template='%s_thresholded', + keep_extension=True, desc="thresholded volumes") class SimpleThresholdOutputSpec(TraitedSpec): - thresholded_volumes = OutputMultiPath( - File(exists=True), desc="thresholded volumes") + thresholded_volumes = OutputMultiPath(File(exists=True), desc="thresholded volumes") class SimpleThreshold(BaseInterface): @@ -141,7 +135,7 @@ class SimpleThreshold(BaseInterface): output_spec = SimpleThresholdOutputSpec def _run_interface(self, runtime): - for fname in self.inputs.volumes: + for fname, out_name in zip(self.inputs.volumes, self.inputs.thresholded_volumes): img = nb.load(fname) data = np.array(img.get_data()) @@ -151,38 +145,25 @@ def _run_interface(self, runtime): thresholded_map[active_map] = data[active_map] new_img = nb.Nifti1Image(thresholded_map, img.affine, img.header) - _, base, _ = split_filename(fname) - nb.save(new_img, base + '_thresholded.nii') + nb.save(new_img, out_name) return runtime - def _list_outputs(self): - outputs = self._outputs().get() - outputs["thresholded_volumes"] = [] - for fname in self.inputs.volumes: - _, base, _ = split_filename(fname) - outputs["thresholded_volumes"].append( - os.path.abspath(base + '_thresholded.nii')) - return outputs - class ModifyAffineInputSpec(BaseInterfaceInputSpec): volumes = InputMultiPath( - File(exists=True), - desc='volumes which affine matrices will be modified', - mandatory=True - ) + File(exists=True), mandatory=True, + desc='volumes which affine matrices will be modified') transformation_matrix = traits.Array( - value=np.eye(4), - shape=(4, 4), - desc="transformation matrix that will be left multiplied by the\ - affine matrix", - usedefault=True - ) + value=np.eye(4), shape=(4, 4), usedefault=True, + desc='transformation matrix that will be left multiplied by the affine matrix') + transformed_volumes = OutputMultiPath( + File(exist=True), name_source='volumes', name_template='%s_transformed', + keep_extension=True, desc='output transformed files') class ModifyAffineOutputSpec(TraitedSpec): - transformed_volumes = OutputMultiPath(File(exist=True)) + transformed_volumes = OutputMultiPath(File(exist=True), desc='output transformed files') class ModifyAffine(BaseInterface): @@ -192,40 +173,26 @@ class ModifyAffine(BaseInterface): input_spec = ModifyAffineInputSpec output_spec = ModifyAffineOutputSpec - def _gen_output_filename(self, name): - _, base, _ = split_filename(name) - return os.path.abspath(base + "_transformed.nii") - def _run_interface(self, runtime): - for fname in self.inputs.volumes: + for fname, out_name in zip(self.inputs.volumes, self.inputs.transformed_volumes): img = nb.load(fname) - affine = img.affine affine = np.dot(self.inputs.transformation_matrix, affine) - - nb.save(nb.Nifti1Image(img.get_data(), affine, img.header), - self._gen_output_filename(fname)) - + nb.save(nb.Nifti1Image(img.get_data(), affine, img.header), out_name) return runtime - def _list_outputs(self): - outputs = self._outputs().get() - outputs['transformed_volumes'] = [] - for fname in self.inputs.volumes: - outputs['transformed_volumes'].append( - self._gen_output_filename(fname)) - return outputs - class CreateNiftiInputSpec(BaseInterfaceInputSpec): data_file = File(exists=True, mandatory=True, desc="ANALYZE img file") header_file = File( exists=True, mandatory=True, desc="corresponding ANALYZE hdr file") affine = traits.Array(desc="affine transformation array") + nifti_file = File(name_source='data_file', name_template='%s_nifti.nii', + keep_extension=False, desc='output nifti file') class CreateNiftiOutputSpec(TraitedSpec): - nifti_file = File(exists=True) + nifti_file = File(exists=True, desc='output nifti file') class CreateNifti(BaseInterface): @@ -234,10 +201,6 @@ class CreateNifti(BaseInterface): input_spec = CreateNiftiInputSpec output_spec = CreateNiftiOutputSpec - def _gen_output_file_name(self): - _, base, _ = split_filename(self.inputs.data_file) - return os.path.abspath(base + ".nii") - def _run_interface(self, runtime): hdr = nb.AnalyzeHeader.from_fileobj( open(self.inputs.header_file, 'rb')) @@ -249,28 +212,23 @@ def _run_interface(self, runtime): data = hdr.data_from_fileobj(open(self.inputs.data_file, 'rb')) img = nb.Nifti1Image(data, affine, hdr) - nb.save(img, self._gen_output_file_name()) - + nb.save(img, self.inputs.nifti_file) return runtime - def _list_outputs(self): - outputs = self._outputs().get() - outputs['nifti_file'] = self._gen_output_file_name() - return outputs - class TSNRInputSpec(BaseInterfaceInputSpec): in_file = InputMultiPath(File(exists=True), mandatory=True, desc='realigned 4D file or a list of 3D files') regress_poly = traits.Range(low=1, desc='Remove polynomials') - tsnr_file = File('tsnr.nii.gz', usedefault=True, hash_files=False, - desc='output tSNR file') - mean_file = File('mean.nii.gz', usedefault=True, hash_files=False, - desc='output mean file') - stddev_file = File('stdev.nii.gz', usedefault=True, hash_files=False, - desc='output tSNR file') - detrended_file = File('detrend.nii.gz', usedefault=True, hash_files=False, - desc='input file after detrending') + tsnr_file = File(name_source='in_file', name_template='%s_tsnr', keep_extension=True, + hash_files=False, desc='output tSNR file') + mean_file = File(name_source='in_file', name_template='%s_mean', keep_extension=True, + hash_files=False, desc='output mean file') + stddev_file = File(name_source='in_file', name_template='%s_stdev', + keep_extension=True, hash_files=False, desc='output std deviation file') + detrended_file = File( + name_source='in_file', name_template='%s_detrend', keep_extension=True, hash_files=False, + desc='input file after detrending') class TSNROutputSpec(TraitedSpec): @@ -333,20 +291,16 @@ def _run_interface(self, runtime): nb.save(img, op.abspath(self.inputs.mean_file)) img = nb.Nifti1Image(stddevimg, img.get_affine(), header) nb.save(img, op.abspath(self.inputs.stddev_file)) - return runtime - def _list_outputs(self): - outputs = self._outputs().get() - for k in ['tsnr_file', 'mean_file', 'stddev_file']: - outputs[k] = op.abspath(getattr(self.inputs, k)) - - if isdefined(self.inputs.regress_poly): - outputs['detrended_file'] = op.abspath(self.inputs.detrended_file) - return outputs + if not isdefined(self.inputs.regress_poly): + self.outputs.detrended_file = Undefined + return runtime class GunzipInputSpec(BaseInterfaceInputSpec): in_file = File(exists=True, mandatory=True) + out_file = File(name_source='in_file', name_template='%s', name_remove='.gz', + keep_extension=False, desc='output file') class GunzipOutputSpec(TraitedSpec): @@ -359,47 +313,13 @@ class Gunzip(BaseInterface): input_spec = GunzipInputSpec output_spec = GunzipOutputSpec - def _gen_output_file_name(self): - _, base, ext = split_filename(self.inputs.in_file) - if ext[-2:].lower() == ".gz": - ext = ext[:-3] - return os.path.abspath(base + ext[:-3]) - def _run_interface(self, runtime): import gzip - in_file = gzip.open(self.inputs.in_file, 'rb') - out_file = open(self._gen_output_file_name(), 'wb') - out_file.write(in_file.read()) - out_file.close() - in_file.close() + with gzip.open(self.inputs.in_file, 'rb') as in_file: + with open(self.inputs.out_file, 'wb') as out_file: + out_file.write(in_file.read()) return runtime - def _list_outputs(self): - outputs = self._outputs().get() - outputs['out_file'] = self._gen_output_file_name() - return outputs - - -def replaceext(in_list, ext): - out_list = list() - for filename in in_list: - path, name, _ = split_filename(op.abspath(filename)) - out_name = op.join(path, name) + ext - out_list.append(out_name) - return out_list - - -def matlab2csv(in_array, name, reshape): - output_array = np.asarray(in_array) - if reshape: - if len(np.shape(output_array)) > 1: - output_array = np.reshape(output_array, ( - np.shape(output_array)[0] * np.shape(output_array)[1], 1)) - iflogger.info(np.shape(output_array)) - output_name = op.abspath(name + '.csv') - np.savetxt(output_name, output_array, delimiter=',') - return output_name - class Matlab2CSVInputSpec(TraitedSpec): in_file = File(exists=True, mandatory=True, desc='Input MATLAB .mat file') @@ -474,8 +394,9 @@ def _run_interface(self, runtime): iflogger.error('No values in the MATLAB file?!') return runtime - def _list_outputs(self): - outputs = self.output_spec().get() + def _post_run(self): + super(Matlab2CSV, self)._post_run() + in_dict = sio.loadmat(op.abspath(self.inputs.in_file)) saved_variables = list() for key in list(in_dict.keys()): @@ -487,100 +408,12 @@ def _list_outputs(self): not a Numpy array'.format(k=key)) if len(saved_variables) > 1: - outputs['csv_files'] = replaceext(saved_variables, '.csv') + self.outputs.csv_files = replaceext(saved_variables, '.csv') elif len(saved_variables) == 1: _, name, ext = split_filename(self.inputs.in_file) - outputs['csv_files'] = op.abspath(name + '.csv') + self.outputs.csv_files = op.abspath(name + '.csv') else: iflogger.error('No values in the MATLAB file?!') - return outputs - - -def merge_csvs(in_list): - for idx, in_file in enumerate(in_list): - try: - in_array = np.loadtxt(in_file, delimiter=',') - except ValueError as ex: - try: - in_array = np.loadtxt(in_file, delimiter=',', skiprows=1) - except ValueError as ex: - first = open(in_file, 'r') - header_line = first.readline() - header_list = header_line.split(',') - n_cols = len(header_list) - try: - in_array = np.loadtxt( - in_file, delimiter=',', skiprows=1, - usecols=list(range(1, n_cols)) - ) - except ValueError as ex: - in_array = np.loadtxt( - in_file, delimiter=',', skiprows=1, usecols=list(range(1, n_cols - 1))) - if idx == 0: - out_array = in_array - else: - out_array = np.dstack((out_array, in_array)) - out_array = np.squeeze(out_array) - iflogger.info('Final output array shape:') - iflogger.info(np.shape(out_array)) - return out_array - - -def remove_identical_paths(in_files): - import os.path as op - from ..utils.filemanip import split_filename - if len(in_files) > 1: - out_names = list() - commonprefix = op.commonprefix(in_files) - lastslash = commonprefix.rfind('/') - commonpath = commonprefix[0:(lastslash + 1)] - for fileidx, in_file in enumerate(in_files): - path, name, ext = split_filename(in_file) - in_file = op.join(path, name) - name = in_file.replace(commonpath, '') - name = name.replace('_subject_id_', '') - out_names.append(name) - else: - path, name, ext = split_filename(in_files[0]) - out_names = [name] - return out_names - - -def maketypelist(rowheadings, shape, extraheadingBool, extraheading): - typelist = [] - if rowheadings: - typelist.append(('heading', 'a40')) - if len(shape) > 1: - for idx in range(1, (min(shape) + 1)): - typelist.append((str(idx), float)) - else: - for idx in range(1, (shape[0] + 1)): - typelist.append((str(idx), float)) - if extraheadingBool: - typelist.append((extraheading, 'a40')) - iflogger.info(typelist) - return typelist - - -def makefmtlist(output_array, typelist, rowheadingsBool, - shape, extraheadingBool): - fmtlist = [] - if rowheadingsBool: - fmtlist.append('%s') - if len(shape) > 1: - output = np.zeros(max(shape), typelist) - for idx in range(1, min(shape) + 1): - output[str(idx)] = output_array[:, idx - 1] - fmtlist.append('%f') - else: - output = np.zeros(1, typelist) - for idx in range(1, len(output_array) + 1): - output[str(idx)] = output_array[idx - 1] - fmtlist.append('%f') - if extraheadingBool: - fmtlist.append('%s') - fmt = ','.join(fmtlist) - return fmt, output class MergeCSVFilesInputSpec(TraitedSpec): @@ -718,21 +551,12 @@ def _run_interface(self, runtime): file_handle.close() return runtime - def _list_outputs(self): - outputs = self.output_spec().get() - _, name, ext = split_filename(self.inputs.out_file) - if not ext == '.csv': - ext = '.csv' - out_file = op.abspath(name + ext) - outputs['csv_file'] = out_file - return outputs - class AddCSVColumnInputSpec(TraitedSpec): in_file = File(exists=True, mandatory=True, desc='Input comma-separated value (CSV) files') - out_file = File('extra_heading.csv', usedefault=True, - desc='Output filename for merged CSV file') + out_file = File(name_source='in_file', name_template='%s_col_added', keep_extension=True, + output_name='csv_file', desc='Output filename for merged CSV file') extra_column_heading = traits.Str( desc='New heading to add for the added field.') extra_field = traits.Str( @@ -761,37 +585,21 @@ class AddCSVColumn(BaseInterface): output_spec = AddCSVColumnOutputSpec def _run_interface(self, runtime): - in_file = open(self.inputs.in_file, 'r') - _, name, ext = split_filename(self.inputs.out_file) - if not ext == '.csv': - ext = '.csv' - out_file = op.abspath(name + ext) - - out_file = open(out_file, 'w') - firstline = in_file.readline() - firstline = firstline.replace('\n', '') - new_firstline = firstline + ',"' + \ - self.inputs.extra_column_heading + '"\n' - out_file.write(new_firstline) - for line in in_file: - new_line = line.replace('\n', '') - new_line = new_line + ',' + self.inputs.extra_field + '\n' - out_file.write(new_line) + with open(self.inputs.in_file, 'r') as in_file: + firstline = in_file.readline() + firstline = firstline.replace('\n', '') + new_firstline = firstline + ',"' + self.inputs.extra_column_heading + '"\n' + with open(self.inputs.out_file, 'w') as out_file: + out_file.write(new_firstline) + for line in in_file: + new_line = line.replace('\n', '') + new_line = new_line + ',' + self.inputs.extra_field + '\n' + out_file.write(new_line) return runtime - def _list_outputs(self): - outputs = self.output_spec().get() - _, name, ext = split_filename(self.inputs.out_file) - if not ext == '.csv': - ext = '.csv' - out_file = op.abspath(name + ext) - outputs['csv_file'] = out_file - return outputs - class AddCSVRowInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): - in_file = traits.File(mandatory=True, - desc='Input comma-separated value (CSV) files') + in_file = File(mandatory=True, desc='Input comma-separated value (CSV) files') _outputs = traits.Dict(traits.Any, value={}, usedefault=True) def __setattr__(self, key, value): @@ -906,13 +714,9 @@ def _run_interface(self, runtime): # df = pd.concat([formerdf, df], ignore_index=True) # df.to_csv(fh) + self.outputs.csv_file = op.abspath(self.inputs.in_file) return runtime - def _list_outputs(self): - outputs = self.output_spec().get() - outputs['csv_file'] = self.inputs.in_file - return outputs - def _outputs(self): return self._add_output_traits(super(AddCSVRow, self)._outputs()) @@ -922,13 +726,10 @@ def _add_output_traits(self, base): class CalculateNormalizedMomentsInputSpec(TraitedSpec): timeseries_file = File( - exists=True, mandatory=True, - desc='Text file with timeseries in columns and timepoints in rows,\ - whitespace separated') - moment = traits.Int( - mandatory=True, - desc="Define which moment should be calculated, 3 for skewness, 4 for\ - kurtosis.") + exists=True, mandatory=True, desc='Text file with timeseries in columns and timepoints' + ' in rows, whitespace separated') + moment = traits.Int(mandatory=True, desc='Define which moment should be calculated, 3 for ' + 'skewness, 4 for kurtosis.') class CalculateNormalizedMomentsOutputSpec(TraitedSpec): @@ -951,45 +752,24 @@ class CalculateNormalizedMoments(BaseInterface): output_spec = CalculateNormalizedMomentsOutputSpec def _run_interface(self, runtime): - - self._moments = calc_moments( + self.outputs.skewness = calc_moments( self.inputs.timeseries_file, self.inputs.moment) return runtime - def _list_outputs(self): - outputs = self.output_spec().get() - outputs['skewness'] = self._moments - return outputs - - -def calc_moments(timeseries_file, moment): - """Returns nth moment (3 for skewness, 4 for kurtosis) of timeseries - (list of values; one per timeseries). - - Keyword arguments: - timeseries_file -- text file with white space separated timepoints in rows - - """ - timeseries = np.genfromtxt(timeseries_file) - - m2 = stats.moment(timeseries, 2, axis=0) - m3 = stats.moment(timeseries, moment, axis=0) - zero = (m2 == 0) - return np.where(zero, 0, m3 / m2 ** (moment / 2.0)) - class AddNoiseInputSpec(TraitedSpec): in_file = File(exists=True, mandatory=True, desc='input image that will be corrupted with noise') - in_mask = File(exists=True, desc=('input mask, voxels outside this mask ' - 'will be considered background')) + in_mask = File(exists=True, desc='input mask, voxels outside this mask ' + 'will be considered background') snr = traits.Float(10.0, desc='desired output SNR in dB', usedefault=True) dist = traits.Enum('normal', 'rician', usedefault=True, mandatory=True, - desc=('desired noise distribution')) + desc='desired noise distribution') bg_dist = traits.Enum('normal', 'rayleigh', usedefault=True, mandatory=True, - desc=('desired noise distribution, currently ' - 'only normal is implemented')) - out_file = File(desc='desired output filename') + desc='desired noise distribution, currently ' + 'only normal is implemented') + out_file = File(name_source=['in_file', 'snr'], name_template='%s_SNR%.02f', + keep_extension=True, desc='desired output filename') class AddNoiseOutputSpec(TraitedSpec): @@ -1027,23 +807,9 @@ def _run_interface(self, runtime): result = self.gen_noise(in_data, mask=in_mask, snr_db=snr, dist=self.inputs.dist, bg_dist=self.inputs.bg_dist) res_im = nb.Nifti1Image(result, in_image.affine, in_image.header) - res_im.to_filename(self._gen_output_filename()) + res_im.to_filename(self.inputs.out_file) return runtime - def _gen_output_filename(self): - if not isdefined(self.inputs.out_file): - _, base, ext = split_filename(self.inputs.in_file) - out_file = os.path.abspath('%s_SNR%03.2f%s' % (base, self.inputs.snr, ext)) - else: - out_file = self.inputs.out_file - - return out_file - - def _list_outputs(self): - outputs = self.output_spec().get() - outputs['out_file'] = self._gen_output_filename() - return outputs - def gen_noise(self, image, mask=None, snr_db=10.0, dist='normal', bg_dist='normal'): """ Generates a copy of an image with a certain amount of @@ -1091,13 +857,13 @@ def gen_noise(self, image, mask=None, snr_db=10.0, dist='normal', bg_dist='norma class NormalizeProbabilityMapSetInputSpec(TraitedSpec): in_files = InputMultiPath(File(exists=True, mandatory=True, desc='The tpms to be normalized')) - in_mask = File(exists=True, - desc='Masked voxels must sum up 1.0, 0.0 otherwise.') + out_files = OutputMultiPath(File(), name_source='in_files', name_template='%s_norm', + keep_extension=True, desc="normalized maps") + in_mask = File(exists=True, desc='Masked voxels must sum up 1.0, 0.0 otherwise.') class NormalizeProbabilityMapSetOutputSpec(TraitedSpec): - out_files = OutputMultiPath(File(exists=True), - desc="normalized maps") + out_files = OutputMultiPath(File(exists=True), desc="normalized maps") class NormalizeProbabilityMapSet(BaseInterface): @@ -1126,15 +892,9 @@ def _run_interface(self, runtime): if isdefined(self.inputs.in_mask): mask = self.inputs.in_mask - self._out_filenames = normalize_tpms(self.inputs.in_files, mask) + normalize_tpms(self.inputs.in_files, mask, self.inputs.out_files) return runtime - def _list_outputs(self): - outputs = self.output_spec().get() - outputs['out_files'] = self._out_filenames - return outputs - - class SplitROIsInputSpec(TraitedSpec): in_file = File(exists=True, mandatory=True, desc='file to be splitted') @@ -1169,25 +929,18 @@ class SplitROIs(BaseInterface): def _run_interface(self, runtime): mask = None roisize = None - self._outnames = {} if isdefined(self.inputs.in_mask): mask = self.inputs.in_mask if isdefined(self.inputs.roi_size): roisize = self.inputs.roi_size - res = split_rois(self.inputs.in_file, - mask, roisize) - self._outnames['out_files'] = res[0] - self._outnames['out_masks'] = res[1] - self._outnames['out_index'] = res[2] - return runtime + res = split_rois(self.inputs.in_file, mask, roisize) + self.outputs.out_files = res[0] + self.outputs.out_masks = res[1] + self.outputs.out_index = res[2] - def _list_outputs(self): - outputs = self.output_spec().get() - for k, v in self._outnames.items(): - outputs[k] = v - return outputs + return runtime class MergeROIsInputSpec(TraitedSpec): @@ -1222,17 +975,134 @@ class MergeROIs(BaseInterface): output_spec = MergeROIsOutputSpec def _run_interface(self, runtime): - res = merge_rois(self.inputs.in_files, - self.inputs.in_index, - self.inputs.in_reference) - self._merged = res + self.outputs.merged_file = merge_rois( + self.inputs.in_files, self.inputs.in_index, self.inputs.in_reference) return runtime - def _list_outputs(self): - outputs = self.output_spec().get() - outputs['merged_file'] = self._merged - return outputs +# Helper functions ------------------------------------------------------ + +def replaceext(in_list, ext): + out_list = list() + for filename in in_list: + path, name, _ = split_filename(op.abspath(filename)) + out_name = op.join(path, name) + ext + out_list.append(out_name) + return out_list + + +def matlab2csv(in_array, name, reshape): + output_array = np.asarray(in_array) + if reshape: + if len(np.shape(output_array)) > 1: + output_array = np.reshape(output_array, ( + np.shape(output_array)[0] * np.shape(output_array)[1], 1)) + iflogger.info(np.shape(output_array)) + output_name = op.abspath(name + '.csv') + np.savetxt(output_name, output_array, delimiter=',') + return output_name + +def merge_csvs(in_list): + for idx, in_file in enumerate(in_list): + try: + in_array = np.loadtxt(in_file, delimiter=',') + except ValueError as ex: + try: + in_array = np.loadtxt(in_file, delimiter=',', skiprows=1) + except ValueError as ex: + first = open(in_file, 'r') + header_line = first.readline() + header_list = header_line.split(',') + n_cols = len(header_list) + try: + in_array = np.loadtxt( + in_file, delimiter=',', skiprows=1, + usecols=list(range(1, n_cols)) + ) + except ValueError as ex: + in_array = np.loadtxt( + in_file, delimiter=',', skiprows=1, usecols=list(range(1, n_cols - 1))) + if idx == 0: + out_array = in_array + else: + out_array = np.dstack((out_array, in_array)) + out_array = np.squeeze(out_array) + iflogger.info('Final output array shape:') + iflogger.info(np.shape(out_array)) + return out_array + + +def remove_identical_paths(in_files): + import os.path as op + from ..utils.filemanip import split_filename + if len(in_files) > 1: + out_names = list() + commonprefix = op.commonprefix(in_files) + lastslash = commonprefix.rfind('/') + commonpath = commonprefix[0:(lastslash + 1)] + for fileidx, in_file in enumerate(in_files): + path, name, ext = split_filename(in_file) + in_file = op.join(path, name) + name = in_file.replace(commonpath, '') + name = name.replace('_subject_id_', '') + out_names.append(name) + else: + path, name, ext = split_filename(in_files[0]) + out_names = [name] + return out_names + + +def maketypelist(rowheadings, shape, extraheadingBool, extraheading): + typelist = [] + if rowheadings: + typelist.append(('heading', 'a40')) + if len(shape) > 1: + for idx in range(1, (min(shape) + 1)): + typelist.append((str(idx), float)) + else: + for idx in range(1, (shape[0] + 1)): + typelist.append((str(idx), float)) + if extraheadingBool: + typelist.append((extraheading, 'a40')) + iflogger.info(typelist) + return typelist + + +def makefmtlist(output_array, typelist, rowheadingsBool, + shape, extraheadingBool): + fmtlist = [] + if rowheadingsBool: + fmtlist.append('%s') + if len(shape) > 1: + output = np.zeros(max(shape), typelist) + for idx in range(1, min(shape) + 1): + output[str(idx)] = output_array[:, idx - 1] + fmtlist.append('%f') + else: + output = np.zeros(1, typelist) + for idx in range(1, len(output_array) + 1): + output[str(idx)] = output_array[idx - 1] + fmtlist.append('%f') + if extraheadingBool: + fmtlist.append('%s') + fmt = ','.join(fmtlist) + return fmt, output + + +def calc_moments(timeseries_file, moment): + """Returns nth moment (3 for skewness, 4 for kurtosis) of timeseries + (list of values; one per timeseries). + + Keyword arguments: + timeseries_file -- text file with white space separated timepoints in rows + + """ + timeseries = np.genfromtxt(timeseries_file) + + m2 = stats.moment(timeseries, 2, axis=0) + m3 = stats.moment(timeseries, moment, axis=0) + zero = (m2 == 0) + return np.where(zero, 0, m3 / m2 ** (moment / 2.0)) def normalize_tpms(in_files, in_mask=None, out_files=[]): """ diff --git a/nipype/algorithms/modelgen.py b/nipype/algorithms/modelgen.py index 93aaeb042c..1285e9c76e 100644 --- a/nipype/algorithms/modelgen.py +++ b/nipype/algorithms/modelgen.py @@ -29,9 +29,11 @@ from scipy.special import gammaln from ..external.six import string_types -from ..interfaces.base import (BaseInterface, TraitedSpec, InputMultiPath, - traits, File, Bunch, BaseInterfaceInputSpec, - isdefined) + +from ..interfaces.traits_extension import traits, File, isdefined, Undefined +from ..interfaces.specs import BaseInterfaceInputSpec, TraitedSpec, InputMultiPath +from ..interfaces.base import BaseInterface, Bunch + from ..utils.filemanip import filename_to_list from .. import config, logging iflogger = logging.getLogger('interface') @@ -406,15 +408,10 @@ def _run_interface(self, runtime): """ self._sessioninfo = None self._generate_design() - return runtime - - def _list_outputs(self): - outputs = self._outputs().get() if not hasattr(self, '_sessinfo'): self._generate_design() - outputs['session_info'] = self._sessinfo - - return outputs + self.outputs.session_info = self._sessinfo + return runtime class SpecifySPMModelInputSpec(SpecifyModelInputSpec): @@ -571,11 +568,12 @@ class SpecifySparseModelInputSpec(SpecifyModelInputSpec): desc="Create a temporal derivative in addition to regular regressor") scale_regressors = traits.Bool(True, desc="Scale regressors by the peak", usedefault=True) - scan_onset = traits.Float(0.0, - desc="Start of scanning relative to onset of run in secs", + scan_onset = traits.Float(0.0, desc="Start of scanning relative to onset of run in secs", usedefault=True) - save_plot = traits.Bool(desc=('save plot of sparse design calculation ' - '(Requires matplotlib)')) + save_plot = traits.Bool(False, usedefault=True, desc='save plot of sparse design ' + 'calculation (Requires matplotlib)') + sparse_png_file = File('sparse.png', desc='PNG file showing sparse design') + sparse_svg_file = File('sparse.svg', desc='SVG file showing sparse design') class SpecifySparseModelOutputSpec(SpecifyModelOutputSpec): @@ -802,12 +800,9 @@ def _generate_design(self, infolist=None): sparselist = self._generate_clustered_design(infolist) super(SpecifySparseModel, self)._generate_design(infolist=sparselist) - def _list_outputs(self): - outputs = self._outputs().get() - if not hasattr(self, '_sessinfo'): - self._generate_design() - outputs['session_info'] = self._sessinfo - if isdefined(self.inputs.save_plot) and self.inputs.save_plot: - outputs['sparse_png_file'] = os.path.join(os.getcwd(), 'sparse.png') - outputs['sparse_svg_file'] = os.path.join(os.getcwd(), 'sparse.svg') - return outputs + def _post_run(self): + super(SpecifySparseModel,self)._post_run() + # Unset non-used variables + if not self.inputs.save_plot: + self.outputs.sparse_png_file = Undefined + self.outputs.sparse_svg_file = Undefined diff --git a/nipype/algorithms/rapidart.py b/nipype/algorithms/rapidart.py index 06ad009d50..9ceedc24b9 100644 --- a/nipype/algorithms/rapidart.py +++ b/nipype/algorithms/rapidart.py @@ -30,127 +30,16 @@ import scipy.io as sio from ..external.six import string_types -from ..interfaces.base import (BaseInterface, traits, InputMultiPath, - OutputMultiPath, TraitedSpec, File, - BaseInterfaceInputSpec, isdefined) + from ..utils.filemanip import filename_to_list, save_json, split_filename from ..utils.misc import find_indices -from .. import logging, config -iflogger = logging.getLogger('interface') - - -def _get_affine_matrix(params, source): - """Return affine matrix given a set of translation and rotation parameters - - params : np.array (upto 12 long) in native package format - source : the package that generated the parameters - supports SPM, AFNI, FSFAST, FSL, NIPY - """ - if source == 'FSL': - params = params[[3, 4, 5, 0, 1, 2]] - elif source in ('AFNI', 'FSFAST'): - params = params[np.asarray([4, 5, 3, 1, 2, 0]) + (len(params) > 6)] - params[3:] = params[3:] * np.pi / 180. - if source == 'NIPY': - # nipy does not store typical euler angles, use nipy to convert - from nipy.algorithms.registration import to_matrix44 - return to_matrix44(params) - # process for FSL, SPM, AFNI and FSFAST - rotfunc = lambda x: np.array([[np.cos(x), np.sin(x)], - [-np.sin(x), np.cos(x)]]) - q = np.array([0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0]) - if len(params) < 12: - params = np.hstack((params, q[len(params):])) - params.shape = (len(params),) - # Translation - T = np.eye(4) - T[0:3, -1] = params[0:3] - # Rotation - Rx = np.eye(4) - Rx[1:3, 1:3] = rotfunc(params[3]) - Ry = np.eye(4) - Ry[(0, 0, 2, 2), (0, 2, 0, 2)] = rotfunc(params[4]).ravel() - Rz = np.eye(4) - Rz[0:2, 0:2] = rotfunc(params[5]) - # Scaling - S = np.eye(4) - S[0:3, 0:3] = np.diag(params[6:9]) - # Shear - Sh = np.eye(4) - Sh[(0, 0, 1), (1, 2, 2)] = params[9:12] - if source in ('AFNI', 'FSFAST'): - return np.dot(T, np.dot(Ry, np.dot(Rx, np.dot(Rz, np.dot(S, Sh))))) - return np.dot(T, np.dot(Rx, np.dot(Ry, np.dot(Rz, np.dot(S, Sh))))) - - -def _calc_norm(mc, use_differences, source, brain_pts=None): - """Calculates the maximum overall displacement of the midpoints - of the faces of a cube due to translation and rotation. - - Parameters - ---------- - mc : motion parameter estimates - [3 translation, 3 rotation (radians)] - use_differences : boolean - brain_pts : [4 x n_points] of coordinates - - Returns - ------- - - norm : at each time point - displacement : euclidean distance (mm) of displacement at each coordinate - - """ - if brain_pts is None: - respos = np.diag([70, 70, 75]) - resneg = np.diag([-70, -110, -45]) - all_pts = np.vstack((np.hstack((respos, resneg)), np.ones((1, 6)))) - displacement = None - else: - all_pts = brain_pts - n_pts = all_pts.size - all_pts.shape[1] - newpos = np.zeros((mc.shape[0], n_pts)) - if brain_pts is not None: - displacement = np.zeros((mc.shape[0], int(n_pts / 3))) - for i in range(mc.shape[0]): - affine = _get_affine_matrix(mc[i, :], source) - newpos[i, :] = np.dot(affine, - all_pts)[0:3, :].ravel() - if brain_pts is not None: - displacement[i, :] = \ - np.sqrt(np.sum(np.power(np.reshape(newpos[i, :], - (3, all_pts.shape[1])) - - all_pts[0:3, :], - 2), - axis=0)) - # np.savez('displacement.npz', newpos=newpos, pts=all_pts) - normdata = np.zeros(mc.shape[0]) - if use_differences: - newpos = np.concatenate((np.zeros((1, n_pts)), - np.diff(newpos, n=1, axis=0)), axis=0) - for i in range(newpos.shape[0]): - normdata[i] = \ - np.max(np.sqrt(np.sum(np.reshape(np.power(np.abs(newpos[i, :]), 2), - (3, all_pts.shape[1])), axis=0))) - else: - newpos = np.abs(signal.detrend(newpos, axis=0, type='constant')) - normdata = np.sqrt(np.mean(np.power(newpos, 2), axis=1)) - return normdata, displacement - - -def _nanmean(a, axis=None): - """Return the mean excluding items that are nan - - >>> a = [1, 2, np.nan] - >>> _nanmean(a) - 1.5 +from ..interfaces.traits_extension import traits, File, isdefined +from ..interfaces.specs import BaseInterfaceInputSpec, TraitedSpec, InputMultiPath, OutputMultiPath +from ..interfaces.base import BaseInterface - """ - if axis: - return np.nansum(a, axis) / np.sum(1 - np.isnan(a), axis) - else: - return np.nansum(a) / np.sum(1 - np.isnan(a)) +from .. import logging, config +iflogger = logging.getLogger('interface') class ArtifactDetectInputSpec(BaseInterfaceInputSpec): @@ -304,34 +193,6 @@ def _get_output_filenames(self, motionfile, output_dir): return (artifactfile, intensityfile, statsfile, normfile, plotfile, displacementfile, maskfile) - def _list_outputs(self): - outputs = self._outputs().get() - outputs['outlier_files'] = [] - outputs['intensity_files'] = [] - outputs['statistic_files'] = [] - outputs['mask_files'] = [] - if isdefined(self.inputs.use_norm) and self.inputs.use_norm: - outputs['norm_files'] = [] - if self.inputs.bound_by_brainmask: - outputs['displacement_files'] = [] - if isdefined(self.inputs.save_plot) and self.inputs.save_plot: - outputs['plot_files'] = [] - for i, f in enumerate(filename_to_list(self.inputs.realigned_files)): - (outlierfile, intensityfile, statsfile, normfile, plotfile, - displacementfile, maskfile) = \ - self._get_output_filenames(f, os.getcwd()) - outputs['outlier_files'].insert(i, outlierfile) - outputs['intensity_files'].insert(i, intensityfile) - outputs['statistic_files'].insert(i, statsfile) - outputs['mask_files'].insert(i, maskfile) - if isdefined(self.inputs.use_norm) and self.inputs.use_norm: - outputs['norm_files'].insert(i, normfile) - if self.inputs.bound_by_brainmask: - outputs['displacement_files'].insert(i, displacementfile) - if isdefined(self.inputs.save_plot) and self.inputs.save_plot: - outputs['plot_files'].insert(i, plotfile) - return outputs - def _plot_outliers_with_wave(self, wave, outliers, name): import matplotlib.pyplot as plt plt.plot(wave) @@ -539,24 +400,51 @@ def _run_interface(self, runtime): for i, imgf in enumerate(funcfilelist): self._detect_outliers_core(imgf, motparamlist[i], i, cwd=os.getcwd()) + + self.outputs.outlier_files = [] + self.outputs.intensity_files = [] + self.outputs.statistic_files = [] + self.outputs.mask_files = [] + if isdefined(self.inputs.use_norm) and self.inputs.use_norm: + self.outputs.norm_files = [] + if self.inputs.bound_by_brainmask: + self.outputs.displacement_files = [] + if isdefined(self.inputs.save_plot) and self.inputs.save_plot: + self.outputs.plot_files = [] + for i, f in enumerate(filename_to_list(self.inputs.realigned_files)): + (outlierfile, intensityfile, statsfile, normfile, plotfile, + displacementfile, maskfile) = \ + self._get_output_filenames(f, os.getcwd()) + self.outputs.outlier_files.insert(i, outlierfile) + self.outputs.intensity_files.insert(i, intensityfile) + self.outputs.statistic_files.insert(i, statsfile) + self.outputs.mask_files.insert(i, maskfile) + if isdefined(self.inputs.use_norm) and self.inputs.use_norm: + self.outputs.norm_files.insert(i, normfile) + if self.inputs.bound_by_brainmask: + self.outputs.displacement_files.insert(i, displacementfile) + if isdefined(self.inputs.save_plot) and self.inputs.save_plot: + self.outputs.plot_files.insert(i, plotfile) return runtime class StimCorrInputSpec(BaseInterfaceInputSpec): - realignment_parameters = InputMultiPath(File(exists=True), mandatory=True, - desc=('Names of realignment parameters corresponding to the functional ' - 'data files')) + realignment_parameters = InputMultiPath( + File(exists=True), mandatory=True, + desc='Names of realignment parameters corresponding to the functional data files') intensity_values = InputMultiPath(File(exists=True), mandatory=True, desc='Name of file containing intensity values') spm_mat_file = File(exists=True, mandatory=True, desc='SPM mat file (use pre-estimate SPM.mat file)') - concatenated_design = traits.Bool(mandatory=True, - desc='state if the design matrix contains concatenated sessions') - + concatenated_design = traits.Bool( + mandatory=True, desc='state if the design matrix contains concatenated sessions') + stimcorr_files = OutputMultiPath(File(exists=True), name_source='realignment_parameters', + name_template='qa.%s_stimcorr.txt', keep_extension=False, + desc='List of files containing correlation values') class StimCorrOutputSpec(TraitedSpec): - stimcorr_files = OutputMultiPath(File(exists=True), - desc='List of files containing correlation values') + stimcorr_files = OutputMultiPath( + File(exists=True), desc='List of files containing correlation values') class StimulusCorrelation(BaseInterface): @@ -584,29 +472,11 @@ class StimulusCorrelation(BaseInterface): input_spec = StimCorrInputSpec output_spec = StimCorrOutputSpec - def _get_output_filenames(self, motionfile, output_dir): - """Generate output files based on motion filenames - - Parameters - ---------- - motionfile: file/string - Filename for motion parameter file - output_dir: string - output directory in which the files will be generated - """ - (_, filename) = os.path.split(motionfile) - (filename, _) = os.path.splitext(filename) - corrfile = os.path.join(output_dir, ''.join(('qa.', filename, - '_stimcorr.txt'))) - return corrfile - - def _stimcorr_core(self, motionfile, intensityfile, designmatrix, cwd=None): + def _stimcorr_core(self, motionfile, intensityfile, corrfile, designmatrix): """ Core routine for determining stimulus correlation """ - if not cwd: - cwd = os.getcwd() # read in motion parameters mc_in = np.loadtxt(motionfile) g_in = np.loadtxt(intensityfile) @@ -615,7 +485,6 @@ def _stimcorr_core(self, motionfile, intensityfile, designmatrix, cwd=None): mccol = mc_in.shape[1] concat_matrix = np.hstack((np.hstack((designmatrix, mc_in)), g_in)) cm = np.corrcoef(concat_matrix, rowvar=0) - corrfile = self._get_output_filenames(motionfile, cwd) # write output to outputfile file = open(corrfile, 'w') file.write("Stats for:\n") @@ -665,14 +534,122 @@ def _run_interface(self, runtime): nrows.append(mc_in.shape[0]) matrix = self._get_spm_submatrix(spmmat, sessidx, rows) self._stimcorr_core(motparamlist[i], intensityfiles[i], + self.inputs.stimcorr_files[i], matrix, os.getcwd()) return runtime - def _list_outputs(self): - outputs = self._outputs().get() - files = [] - for i, f in enumerate(self.inputs.realignment_parameters): - files.insert(i, self._get_output_filenames(f, os.getcwd())) - if files: - outputs['stimcorr_files'] = files - return outputs + +# Helper functions ----------------------------------------------------------------- + +def _get_affine_matrix(params, source): + """Return affine matrix given a set of translation and rotation parameters + + params : np.array (upto 12 long) in native package format + source : the package that generated the parameters + supports SPM, AFNI, FSFAST, FSL, NIPY + """ + if source == 'FSL': + params = params[[3, 4, 5, 0, 1, 2]] + elif source in ('AFNI', 'FSFAST'): + params = params[np.asarray([4, 5, 3, 1, 2, 0]) + (len(params) > 6)] + params[3:] = params[3:] * np.pi / 180. + if source == 'NIPY': + # nipy does not store typical euler angles, use nipy to convert + from nipy.algorithms.registration import to_matrix44 + return to_matrix44(params) + # process for FSL, SPM, AFNI and FSFAST + rotfunc = lambda x: np.array([[np.cos(x), np.sin(x)], + [-np.sin(x), np.cos(x)]]) + q = np.array([0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0]) + if len(params) < 12: + params = np.hstack((params, q[len(params):])) + params.shape = (len(params),) + # Translation + T = np.eye(4) + T[0:3, -1] = params[0:3] + # Rotation + Rx = np.eye(4) + Rx[1:3, 1:3] = rotfunc(params[3]) + Ry = np.eye(4) + Ry[(0, 0, 2, 2), (0, 2, 0, 2)] = rotfunc(params[4]).ravel() + Rz = np.eye(4) + Rz[0:2, 0:2] = rotfunc(params[5]) + # Scaling + S = np.eye(4) + S[0:3, 0:3] = np.diag(params[6:9]) + # Shear + Sh = np.eye(4) + Sh[(0, 0, 1), (1, 2, 2)] = params[9:12] + if source in ('AFNI', 'FSFAST'): + return np.dot(T, np.dot(Ry, np.dot(Rx, np.dot(Rz, np.dot(S, Sh))))) + return np.dot(T, np.dot(Rx, np.dot(Ry, np.dot(Rz, np.dot(S, Sh))))) + + +def _calc_norm(mc, use_differences, source, brain_pts=None): + """Calculates the maximum overall displacement of the midpoints + of the faces of a cube due to translation and rotation. + + Parameters + ---------- + mc : motion parameter estimates + [3 translation, 3 rotation (radians)] + use_differences : boolean + brain_pts : [4 x n_points] of coordinates + + Returns + ------- + + norm : at each time point + displacement : euclidean distance (mm) of displacement at each coordinate + + """ + + if brain_pts is None: + respos = np.diag([70, 70, 75]) + resneg = np.diag([-70, -110, -45]) + all_pts = np.vstack((np.hstack((respos, resneg)), np.ones((1, 6)))) + displacement = None + else: + all_pts = brain_pts + n_pts = all_pts.size - all_pts.shape[1] + newpos = np.zeros((mc.shape[0], n_pts)) + if brain_pts is not None: + displacement = np.zeros((mc.shape[0], int(n_pts / 3))) + for i in range(mc.shape[0]): + affine = _get_affine_matrix(mc[i, :], source) + newpos[i, :] = np.dot(affine, + all_pts)[0:3, :].ravel() + if brain_pts is not None: + displacement[i, :] = \ + np.sqrt(np.sum(np.power(np.reshape(newpos[i, :], + (3, all_pts.shape[1])) - + all_pts[0:3, :], + 2), + axis=0)) + # np.savez('displacement.npz', newpos=newpos, pts=all_pts) + normdata = np.zeros(mc.shape[0]) + if use_differences: + newpos = np.concatenate((np.zeros((1, n_pts)), + np.diff(newpos, n=1, axis=0)), axis=0) + for i in range(newpos.shape[0]): + normdata[i] = \ + np.max(np.sqrt(np.sum(np.reshape(np.power(np.abs(newpos[i, :]), 2), + (3, all_pts.shape[1])), axis=0))) + else: + newpos = np.abs(signal.detrend(newpos, axis=0, type='constant')) + normdata = np.sqrt(np.mean(np.power(newpos, 2), axis=1)) + return normdata, displacement + + +def _nanmean(a, axis=None): + """Return the mean excluding items that are nan + + >>> a = [1, 2, np.nan] + >>> _nanmean(a) + 1.5 + + """ + if axis: + return np.nansum(a, axis) / np.sum(1 - np.isnan(a), axis) + else: + return np.nansum(a) / np.sum(1 - np.isnan(a)) diff --git a/nipype/algorithms/tests/test_rapidart.py b/nipype/algorithms/tests/test_rapidart.py index 1ba6414e29..33e883fc4e 100644 --- a/nipype/algorithms/tests/test_rapidart.py +++ b/nipype/algorithms/tests/test_rapidart.py @@ -17,18 +17,19 @@ def test_ad_init(): def test_ad_output_filenames(): - ad = ra.ArtifactDetect() - outputdir = '/tmp' - f = 'motion.nii' - (outlierfile, intensityfile, statsfile, normfile, plotfile, - displacementfile, maskfile) = ad._get_output_filenames(f, outputdir) - yield assert_equal, outlierfile, '/tmp/art.motion_outliers.txt' - yield assert_equal, intensityfile, '/tmp/global_intensity.motion.txt' - yield assert_equal, statsfile, '/tmp/stats.motion.txt' - yield assert_equal, normfile, '/tmp/norm.motion.txt' - yield assert_equal, plotfile, '/tmp/plot.motion.png' - yield assert_equal, displacementfile, '/tmp/disp.motion.nii' - yield assert_equal, maskfile, '/tmp/mask.motion.nii' + # TODO: rewrite this test + # ad = ra.ArtifactDetect() + # outputdir = '/tmp' + # f = 'motion.nii' + # (outlierfile, intensityfile, statsfile, normfile, plotfile, + # displacementfile, maskfile) = ad.inputs. + # yield assert_equal, outlierfile, '/tmp/art.motion_outliers.txt' + # yield assert_equal, intensityfile, '/tmp/global_intensity.motion.txt' + # yield assert_equal, statsfile, '/tmp/stats.motion.txt' + # yield assert_equal, normfile, '/tmp/norm.motion.txt' + # yield assert_equal, plotfile, '/tmp/plot.motion.png' + # yield assert_equal, displacementfile, '/tmp/disp.motion.nii' + # yield assert_equal, maskfile, '/tmp/mask.motion.nii' def test_ad_get_affine_matrix(): diff --git a/nipype/interfaces/specs.py b/nipype/interfaces/specs.py index 876afbe628..889493763d 100644 --- a/nipype/interfaces/specs.py +++ b/nipype/interfaces/specs.py @@ -115,7 +115,7 @@ def _check_deprecated(self, name, new): self.trait_set(trait_change_notify=False, **{'%s' % name: Undefined, '%s' % spec.new_name: new}) - + def _hash_infile(self, adict, key): """ Inject file hashes into adict[key]""" stuff = adict[key] @@ -330,7 +330,7 @@ class BaseInputSpec(BaseTraitedSpec): def __init__(self, **kwargs): """ Initialize handlers and inputs""" super(BaseInputSpec, self).__init__(**kwargs) - + # Attach xor handler has_xor = dict(xor=lambda t: t is not None) xors = self.trait_names(**has_xor) @@ -346,8 +346,8 @@ def optional_items(self): allitems = self.traits(transient=None).items() for k, _ in self.mandatory_items(): try: - allitems.pop(k, None) - except KeyError: + allitems.remove(k) + except ValueError: pass return allitems @@ -356,8 +356,9 @@ def namesource_items(self): metadata = dict(name_source=lambda t: t is not None) return list(self.traits(**metadata).items()) - def _check_xor(self, name): + def _check_xor(self, obj, name, old, new): """ Checks inputs with xor list """ + IFLOGGER.error('Called check_xorg with name %s' % name) if isdefined(getattr(self, name)): xor_list = self.traits()[name].xor @@ -441,9 +442,10 @@ def _resolve_namesource(self, name, chain=None): # special treatment for files try: - _, base, _ = split_filename(source) + _, base, ext = split_filename(source) except AttributeError: base = source + ext = '' else: if name in chain: raise InterfaceInputsError('Mutually pointing name_sources') @@ -452,9 +454,9 @@ def _resolve_namesource(self, name, chain=None): return self._resolve_namesource(ns, chain) retval = name_template % base - _, _, ext = split_filename(retval) - if ext and (not isdefined(spec.keep_extension) or spec.keep_extension): - return retval + + if not isdefined(spec.keep_extension) or spec.keep_extension: + return retval + ext return self._overload_extension(retval, name) return retval @@ -478,7 +480,7 @@ def update_autonames(self): if isdefined(value): setattr(self, name, value) - + def get_filecopy_info(self): """ Provides information about file inputs to copy or link to cwd. Necessary for pipeline operation @@ -505,13 +507,13 @@ def check_version(self, version, raise_exception=True): if not isdefined(getattr(self, name)): continue - msg = ('Trait %s (%s) (version %s < required %s)' % + msg = ('Trait %s (%s) (version %s < required %s)' % (name, self.__class__.__name__, version, min_ver)) if raise_exception: raise Exception(msg) else: IFLOGGER.warn(msg) - + # Check maximum version check = dict(max_ver=lambda t: t is not None) for name in self.trait_names(**check): From 99ef50c101cd18de723752b84ea68a60ae83faf1 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Tue, 16 Feb 2016 08:22:19 -0800 Subject: [PATCH 19/73] refactoring ongoing... --- .../tests/test_auto_AddCSVColumn.py | 5 +- nipype/algorithms/tests/test_auto_AddNoise.py | 5 +- .../algorithms/tests/test_auto_CreateNifti.py | 4 ++ nipype/algorithms/tests/test_auto_ErrorMap.py | 35 -------------- nipype/algorithms/tests/test_auto_Gunzip.py | 5 ++ nipype/algorithms/tests/test_auto_ICC.py | 7 ++- .../tests/test_auto_MeshWarpMaths.py | 10 +++- .../tests/test_auto_ModifyAffine.py | 4 ++ .../test_auto_NormalizeProbabilityMapSet.py | 4 ++ nipype/algorithms/tests/test_auto_Overlap.py | 47 ------------------- .../algorithms/tests/test_auto_PickAtlas.py | 8 +++- .../tests/test_auto_SimpleThreshold.py | 4 ++ .../tests/test_auto_SpecifySparseModel.py | 5 +- .../tests/test_auto_StimulusCorrelation.py | 4 ++ nipype/algorithms/tests/test_auto_TSNR.py | 16 +++++-- .../tests/test_auto_TVTKBaseInterface.py | 8 ++++ .../algorithms/tests/test_auto_WarpPoints.py | 1 - nipype/interfaces/afni/base.py | 15 +++--- nipype/interfaces/afni/preprocess.py | 10 ++-- nipype/interfaces/afni/svm.py | 19 +++----- .../afni/tests/test_auto_AFNICommand.py | 8 ++++ .../afni/tests/test_auto_AFNICommandBase.py | 8 ++++ 22 files changed, 112 insertions(+), 120 deletions(-) delete mode 100644 nipype/algorithms/tests/test_auto_ErrorMap.py delete mode 100644 nipype/algorithms/tests/test_auto_Overlap.py diff --git a/nipype/algorithms/tests/test_auto_AddCSVColumn.py b/nipype/algorithms/tests/test_auto_AddCSVColumn.py index 89a52b8abe..f37f8e6001 100644 --- a/nipype/algorithms/tests/test_auto_AddCSVColumn.py +++ b/nipype/algorithms/tests/test_auto_AddCSVColumn.py @@ -8,7 +8,10 @@ def test_AddCSVColumn_inputs(): extra_field=dict(), in_file=dict(mandatory=True, ), - out_file=dict(usedefault=True, + out_file=dict(keep_extension=True, + name_source='in_file', + name_template='%s_col_added', + output_name='csv_file', ), ) inputs = AddCSVColumn.input_spec() diff --git a/nipype/algorithms/tests/test_auto_AddNoise.py b/nipype/algorithms/tests/test_auto_AddNoise.py index 50aa563ce0..80e4f943a1 100644 --- a/nipype/algorithms/tests/test_auto_AddNoise.py +++ b/nipype/algorithms/tests/test_auto_AddNoise.py @@ -13,7 +13,10 @@ def test_AddNoise_inputs(): in_file=dict(mandatory=True, ), in_mask=dict(), - out_file=dict(), + out_file=dict(keep_extension=True, + name_source=['in_file', 'snr'], + name_template='%s_SNR%.02f', + ), snr=dict(usedefault=True, ), ) diff --git a/nipype/algorithms/tests/test_auto_CreateNifti.py b/nipype/algorithms/tests/test_auto_CreateNifti.py index 0e12142783..3db3ff8abb 100644 --- a/nipype/algorithms/tests/test_auto_CreateNifti.py +++ b/nipype/algorithms/tests/test_auto_CreateNifti.py @@ -12,6 +12,10 @@ def test_CreateNifti_inputs(): ignore_exception=dict(nohash=True, usedefault=True, ), + nifti_file=dict(keep_extension=False, + name_source='data_file', + name_template='%s_nifti.nii', + ), ) inputs = CreateNifti.input_spec() diff --git a/nipype/algorithms/tests/test_auto_ErrorMap.py b/nipype/algorithms/tests/test_auto_ErrorMap.py deleted file mode 100644 index 69484529dd..0000000000 --- a/nipype/algorithms/tests/test_auto_ErrorMap.py +++ /dev/null @@ -1,35 +0,0 @@ -# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT -from ...testing import assert_equal -from ..metrics import ErrorMap - - -def test_ErrorMap_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - in_ref=dict(mandatory=True, - ), - in_tst=dict(mandatory=True, - ), - mask=dict(), - metric=dict(mandatory=True, - usedefault=True, - ), - out_map=dict(), - ) - inputs = ErrorMap.input_spec() - - for key, metadata in list(input_map.items()): - for metakey, value in list(metadata.items()): - yield assert_equal, getattr(inputs.traits()[key], metakey), value - - -def test_ErrorMap_outputs(): - output_map = dict(distance=dict(), - out_map=dict(), - ) - outputs = ErrorMap.output_spec() - - for key, metadata in list(output_map.items()): - for metakey, value in list(metadata.items()): - yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/algorithms/tests/test_auto_Gunzip.py b/nipype/algorithms/tests/test_auto_Gunzip.py index b77e6dfbd5..a0813cb089 100644 --- a/nipype/algorithms/tests/test_auto_Gunzip.py +++ b/nipype/algorithms/tests/test_auto_Gunzip.py @@ -9,6 +9,11 @@ def test_Gunzip_inputs(): ), in_file=dict(mandatory=True, ), + out_file=dict(keep_extension=False, + name_remove='.gz', + name_source='in_file', + name_template='%s', + ), ) inputs = Gunzip.input_spec() diff --git a/nipype/algorithms/tests/test_auto_ICC.py b/nipype/algorithms/tests/test_auto_ICC.py index 76b70b3369..4c32fe9a29 100644 --- a/nipype/algorithms/tests/test_auto_ICC.py +++ b/nipype/algorithms/tests/test_auto_ICC.py @@ -4,11 +4,15 @@ def test_ICC_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, + input_map = dict(icc_map=dict(), + ignore_exception=dict(nohash=True, usedefault=True, ), mask=dict(mandatory=True, ), + session_F_map=dict(), + session_var_map=dict(), + subject_var_map=dict(), subjects_sessions=dict(mandatory=True, ), ) @@ -21,6 +25,7 @@ def test_ICC_inputs(): def test_ICC_outputs(): output_map = dict(icc_map=dict(), + session_F_map=dict(), session_var_map=dict(), subject_var_map=dict(), ) diff --git a/nipype/algorithms/tests/test_auto_MeshWarpMaths.py b/nipype/algorithms/tests/test_auto_MeshWarpMaths.py index dfd4c5bd63..453d08ff37 100644 --- a/nipype/algorithms/tests/test_auto_MeshWarpMaths.py +++ b/nipype/algorithms/tests/test_auto_MeshWarpMaths.py @@ -14,9 +14,15 @@ def test_MeshWarpMaths_inputs(): ), operator=dict(mandatory=True, ), - out_file=dict(usedefault=True, + out_file=dict(keep_extension=True, + name_source='in_surf', + name_template='%s_warped', + usedefault=True, ), - out_warp=dict(usedefault=True, + out_warp=dict(keep_extension=True, + name_source='in_surf', + name_template='%s_warp', + usedefault=True, ), ) inputs = MeshWarpMaths.input_spec() diff --git a/nipype/algorithms/tests/test_auto_ModifyAffine.py b/nipype/algorithms/tests/test_auto_ModifyAffine.py index fb8c5ca876..066e873f3d 100644 --- a/nipype/algorithms/tests/test_auto_ModifyAffine.py +++ b/nipype/algorithms/tests/test_auto_ModifyAffine.py @@ -9,6 +9,10 @@ def test_ModifyAffine_inputs(): ), transformation_matrix=dict(usedefault=True, ), + transformed_volumes=dict(keep_extension=True, + name_source='volumes', + name_template='%s_transformed', + ), volumes=dict(mandatory=True, ), ) diff --git a/nipype/algorithms/tests/test_auto_NormalizeProbabilityMapSet.py b/nipype/algorithms/tests/test_auto_NormalizeProbabilityMapSet.py index c2595baa72..87ad729c6a 100644 --- a/nipype/algorithms/tests/test_auto_NormalizeProbabilityMapSet.py +++ b/nipype/algorithms/tests/test_auto_NormalizeProbabilityMapSet.py @@ -6,6 +6,10 @@ def test_NormalizeProbabilityMapSet_inputs(): input_map = dict(in_files=dict(), in_mask=dict(), + out_files=dict(keep_extension=True, + name_source='in_files', + name_template='%s_norm', + ), ) inputs = NormalizeProbabilityMapSet.input_spec() diff --git a/nipype/algorithms/tests/test_auto_Overlap.py b/nipype/algorithms/tests/test_auto_Overlap.py deleted file mode 100644 index a5a3874bd1..0000000000 --- a/nipype/algorithms/tests/test_auto_Overlap.py +++ /dev/null @@ -1,47 +0,0 @@ -# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT -from ...testing import assert_equal -from ..misc import Overlap - - -def test_Overlap_inputs(): - input_map = dict(bg_overlap=dict(mandatory=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), - mask_volume=dict(), - out_file=dict(usedefault=True, - ), - vol_units=dict(mandatory=True, - usedefault=True, - ), - volume1=dict(mandatory=True, - ), - volume2=dict(mandatory=True, - ), - weighting=dict(usedefault=True, - ), - ) - inputs = Overlap.input_spec() - - for key, metadata in list(input_map.items()): - for metakey, value in list(metadata.items()): - yield assert_equal, getattr(inputs.traits()[key], metakey), value - - -def test_Overlap_outputs(): - output_map = dict(dice=dict(), - diff_file=dict(), - jaccard=dict(), - labels=dict(), - roi_di=dict(), - roi_ji=dict(), - roi_voldiff=dict(), - volume_difference=dict(), - ) - outputs = Overlap.output_spec() - - for key, metadata in list(output_map.items()): - for metakey, value in list(metadata.items()): - yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/algorithms/tests/test_auto_PickAtlas.py b/nipype/algorithms/tests/test_auto_PickAtlas.py index 27aaac7d41..4c4cb7042f 100644 --- a/nipype/algorithms/tests/test_auto_PickAtlas.py +++ b/nipype/algorithms/tests/test_auto_PickAtlas.py @@ -15,7 +15,13 @@ def test_PickAtlas_inputs(): ), labels=dict(mandatory=True, ), - output_file=dict(), + mask_file=dict(keep_extension=True, + name_source='atlas', + name_template='%s_mask', + ), + output_file=dict(deprecated=True, + new_name='mask_file', + ), ) inputs = PickAtlas.input_spec() diff --git a/nipype/algorithms/tests/test_auto_SimpleThreshold.py b/nipype/algorithms/tests/test_auto_SimpleThreshold.py index ff46592c11..6214f10bb9 100644 --- a/nipype/algorithms/tests/test_auto_SimpleThreshold.py +++ b/nipype/algorithms/tests/test_auto_SimpleThreshold.py @@ -9,6 +9,10 @@ def test_SimpleThreshold_inputs(): ), threshold=dict(mandatory=True, ), + thresholded_volumes=dict(keep_extension=True, + name_source='volumes', + name_template='%s_thresholded', + ), volumes=dict(mandatory=True, ), ) diff --git a/nipype/algorithms/tests/test_auto_SpecifySparseModel.py b/nipype/algorithms/tests/test_auto_SpecifySparseModel.py index aa641facf7..873c2c5e41 100644 --- a/nipype/algorithms/tests/test_auto_SpecifySparseModel.py +++ b/nipype/algorithms/tests/test_auto_SpecifySparseModel.py @@ -22,11 +22,14 @@ def test_SpecifySparseModel_inputs(): ), realignment_parameters=dict(copyfile=False, ), - save_plot=dict(), + save_plot=dict(usedefault=True, + ), scale_regressors=dict(usedefault=True, ), scan_onset=dict(usedefault=True, ), + sparse_png_file=dict(), + sparse_svg_file=dict(), stimuli_as_impulses=dict(usedefault=True, ), subject_info=dict(mandatory=True, diff --git a/nipype/algorithms/tests/test_auto_StimulusCorrelation.py b/nipype/algorithms/tests/test_auto_StimulusCorrelation.py index f1b786aa8e..ad079c6a61 100644 --- a/nipype/algorithms/tests/test_auto_StimulusCorrelation.py +++ b/nipype/algorithms/tests/test_auto_StimulusCorrelation.py @@ -15,6 +15,10 @@ def test_StimulusCorrelation_inputs(): ), spm_mat_file=dict(mandatory=True, ), + stimcorr_files=dict(keep_extension=False, + name_source='realignment_parameters', + name_template='qa.%s_stimcorr.txt', + ), ) inputs = StimulusCorrelation.input_spec() diff --git a/nipype/algorithms/tests/test_auto_TSNR.py b/nipype/algorithms/tests/test_auto_TSNR.py index 4bc6693b20..bfad5902ba 100644 --- a/nipype/algorithms/tests/test_auto_TSNR.py +++ b/nipype/algorithms/tests/test_auto_TSNR.py @@ -5,7 +5,9 @@ def test_TSNR_inputs(): input_map = dict(detrended_file=dict(hash_files=False, - usedefault=True, + keep_extension=True, + name_source='in_file', + name_template='%s_detrend', ), ignore_exception=dict(nohash=True, usedefault=True, @@ -13,14 +15,20 @@ def test_TSNR_inputs(): in_file=dict(mandatory=True, ), mean_file=dict(hash_files=False, - usedefault=True, + keep_extension=True, + name_source='in_file', + name_template='%s_mean', ), regress_poly=dict(), stddev_file=dict(hash_files=False, - usedefault=True, + keep_extension=True, + name_source='in_file', + name_template='%s_stdev', ), tsnr_file=dict(hash_files=False, - usedefault=True, + keep_extension=True, + name_source='in_file', + name_template='%s_tsnr', ), ) inputs = TSNR.input_spec() diff --git a/nipype/algorithms/tests/test_auto_TVTKBaseInterface.py b/nipype/algorithms/tests/test_auto_TVTKBaseInterface.py index 3dd8ac6d2a..02fedd0e30 100644 --- a/nipype/algorithms/tests/test_auto_TVTKBaseInterface.py +++ b/nipype/algorithms/tests/test_auto_TVTKBaseInterface.py @@ -14,3 +14,11 @@ def test_TVTKBaseInterface_inputs(): for metakey, value in list(metadata.items()): yield assert_equal, getattr(inputs.traits()[key], metakey), value + +def test_TVTKBaseInterface_outputs(): + output_map = dict() + outputs = TVTKBaseInterface.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/algorithms/tests/test_auto_WarpPoints.py b/nipype/algorithms/tests/test_auto_WarpPoints.py index 741b9f0c60..70648877f3 100644 --- a/nipype/algorithms/tests/test_auto_WarpPoints.py +++ b/nipype/algorithms/tests/test_auto_WarpPoints.py @@ -13,7 +13,6 @@ def test_WarpPoints_inputs(): out_points=dict(keep_extension=True, name_source='points', name_template='%s_warped', - output_name='out_points', ), points=dict(mandatory=True, ), diff --git a/nipype/interfaces/afni/base.py b/nipype/interfaces/afni/base.py index ffe9f230b5..b36c78012e 100644 --- a/nipype/interfaces/afni/base.py +++ b/nipype/interfaces/afni/base.py @@ -8,8 +8,9 @@ from ... import logging from ...utils.filemanip import split_filename -from ..base import ( - CommandLine, traits, CommandLineInputSpec, isdefined, File, TraitedSpec) +from ..traits_extension import traits, isdefined, File +from ..specs import CommandLineInputSpec, TraitedSpec +from ..base import CommandLine # Use nipype's logging system IFLOGGER = logging.getLogger('interface') @@ -131,13 +132,11 @@ class AFNICommandInputSpec(CommandLineInputSpec): outputtype = traits.Enum('AFNI', list(Info.ftypes.keys()), desc='AFNI output filetype') out_file = File(name_template="%s_afni", desc='output image file name', - argstr='-prefix %s', - name_source=["in_file"]) + name_source=["in_file"], argstr='-prefix %s') class AFNICommandOutputSpec(TraitedSpec): - out_file = File(desc='output file', - exists=True) + out_file = File(desc='output file', exists=True) class AFNICommand(AFNICommandBase): @@ -183,8 +182,7 @@ def _overload_extension(self, value, name=None): path, base, _ = split_filename(value) return os.path.join(path, base + Info.outputtype_to_ext(self.inputs.outputtype)) - def _list_outputs(self): - outputs = super(AFNICommand, self)._list_outputs() + def _post_run(self): metadata = dict(name_source=lambda t: t is not None) out_names = list(self.inputs.traits(**metadata).keys()) if out_names: @@ -193,7 +191,6 @@ def _list_outputs(self): _, _, ext = split_filename(outputs[name]) if ext == "": outputs[name] = outputs[name] + "+orig.BRIK" - return outputs def no_afni(): diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index 84c6c8a9e9..631c857219 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -14,11 +14,11 @@ import re import numpy as np -from .base import (AFNICommandBase, AFNICommand, AFNICommandInputSpec, AFNICommandOutputSpec, - Info, no_afni) -from ..base import CommandLineInputSpec -from ..base import (Directory, TraitedSpec, - traits, isdefined, File, InputMultiPath, Undefined) +from .base import (AFNICommandBase, AFNICommand, AFNICommandInputSpec, + AFNICommandOutputSpec, Info, no_afni) +from ..specs import CommandLineInputSpec, TraitedSpec, InputMultiPath +from ..traits_extension import (Directory, traits, isdefined, + File, Undefined) from ...external.six import string_types from ...utils.filemanip import (load_json, save_json, split_filename) diff --git a/nipype/interfaces/afni/svm.py b/nipype/interfaces/afni/svm.py index c2bb335d32..a49a37bbeb 100644 --- a/nipype/interfaces/afni/svm.py +++ b/nipype/interfaces/afni/svm.py @@ -8,21 +8,16 @@ >>> datadir = os.path.realpath(os.path.join(filepath, '../../testing/data')) >>> os.chdir(datadir) """ -import warnings -import os -import re -from ..base import (Directory, TraitedSpec, - traits, isdefined, File, InputMultiPath, Undefined) -from ...utils.filemanip import (load_json, save_json, split_filename) -from nipype.utils.filemanip import fname_presuffix -from .base import AFNICommand, AFNICommandInputSpec,\ - AFNICommandOutputSpec -from nipype.interfaces.base import CommandLineInputSpec, CommandLine,\ - OutputMultiPath +from ..traits_extension import traits, File +from ..specs import TraitedSpec +from .base import AFNICommand, AFNICommandInputSpec, AFNICommandOutputSpec -warn = warnings.warn +from ... import logging + +IFLOGGER = logging.getLogger('interface') +warn = IFLOGGER.warn class SVMTrainInputSpec(AFNICommandInputSpec): diff --git a/nipype/interfaces/afni/tests/test_auto_AFNICommand.py b/nipype/interfaces/afni/tests/test_auto_AFNICommand.py index f822168eb8..38c422e34c 100644 --- a/nipype/interfaces/afni/tests/test_auto_AFNICommand.py +++ b/nipype/interfaces/afni/tests/test_auto_AFNICommand.py @@ -26,3 +26,11 @@ def test_AFNICommand_inputs(): for metakey, value in list(metadata.items()): yield assert_equal, getattr(inputs.traits()[key], metakey), value + +def test_AFNICommand_outputs(): + output_map = dict() + outputs = AFNICommand.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/afni/tests/test_auto_AFNICommandBase.py b/nipype/interfaces/afni/tests/test_auto_AFNICommandBase.py index 9052c5345a..c5d8841a19 100644 --- a/nipype/interfaces/afni/tests/test_auto_AFNICommandBase.py +++ b/nipype/interfaces/afni/tests/test_auto_AFNICommandBase.py @@ -21,3 +21,11 @@ def test_AFNICommandBase_inputs(): for metakey, value in list(metadata.items()): yield assert_equal, getattr(inputs.traits()[key], metakey), value + +def test_AFNICommandBase_outputs(): + output_map = dict() + outputs = AFNICommandBase.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value From d69724a97d4c4483b922f0458ef655e570c9c595 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Tue, 16 Feb 2016 14:42:58 -0800 Subject: [PATCH 20/73] refactoring in progress... --- nipype/algorithms/tests/test_rapidart.py | 10 +- nipype/interfaces/base.py | 25 +++-- nipype/interfaces/io.py | 4 +- nipype/interfaces/specs.py | 112 +++++++++++++---------- nipype/utils/filemanip.py | 30 +++--- 5 files changed, 98 insertions(+), 83 deletions(-) diff --git a/nipype/algorithms/tests/test_rapidart.py b/nipype/algorithms/tests/test_rapidart.py index 33e883fc4e..4edd4e8b10 100644 --- a/nipype/algorithms/tests/test_rapidart.py +++ b/nipype/algorithms/tests/test_rapidart.py @@ -16,7 +16,7 @@ def test_ad_init(): yield assert_false, ad.inputs.use_differences[1] -def test_ad_output_filenames(): +# def test_ad_output_filenames(): # TODO: rewrite this test # ad = ra.ArtifactDetect() # outputdir = '/tmp' @@ -80,11 +80,3 @@ def test_sc_populate_inputs(): spm_mat_file=None, concatenated_design=None) yield assert_equal, set(sc.inputs.__dict__.keys()), set(inputs.__dict__.keys()) - - -def test_sc_output_filenames(): - sc = ra.StimulusCorrelation() - outputdir = '/tmp' - f = 'motion.nii' - corrfile = sc._get_output_filenames(f, outputdir) - yield assert_equal, corrfile, '/tmp/qa.motion_stimcorr.txt' diff --git a/nipype/interfaces/base.py b/nipype/interfaces/base.py index bada93f907..d27df46031 100644 --- a/nipype/interfaces/base.py +++ b/nipype/interfaces/base.py @@ -30,14 +30,19 @@ from builtins import object from configparser import NoOptionError - -from .traits_extension import TraitError, isdefined, Undefined from ..utils.filemanip import md5, FileNotFoundError from ..utils.misc import trim, str2bool, is_container -from .specs import (BaseInterfaceInputSpec, CommandLineInputSpec, - StdOutCommandLineInputSpec, StdOutCommandLineOutputSpec, - MpiCommandLineInputSpec, - SEMLikeCommandLineInputSpec, TraitedSpec) + +# Make all the traits and spec interfaces available through base +# for backwards compatibility, even though import * is discouraged +# in production environments. +from .traits_extension import * # pylint: disable=W0611 +from .specs import * # pylint: disable=W0611 +#from .traits_extension import isdefined, Undefined +# from .specs import (BaseInterfaceInputSpec, CommandLineInputSpec, +# StdOutCommandLineInputSpec, StdOutCommandLineOutputSpec, +# MpiCommandLineInputSpec, +# SEMLikeCommandLineInputSpec, TraitedSpec) from ..utils.provenance import write_provenance from .. import config, logging, LooseVersion from .. import __version__ @@ -521,7 +526,7 @@ def run(self, **inputs): cwd=os.getcwd(), returncode=None, duration=None, environ=env, startTime=dt.isoformat(dt.utcnow()), endTime=None, traceback=None, platform=platform.platform(), hostname=getfqdn(), version=self.version) - + try: runtime = self._run_wrapper(runtime) except Exception as e: # pylint: disable=W0703 @@ -551,20 +556,20 @@ def run(self, **inputs): runtime.endTime = dt.isoformat(dt.utcnow()) timediff = parseutc(runtime.endTime) - parseutc(runtime.startTime) runtime.duration = (timediff.days * 86400 + timediff.seconds + - timediff.microseconds / 1e5) + timediff.microseconds / 1e5) results = InterfaceResult(interface, runtime, inputs=self.inputs.get_traitsfree()) if runtime.traceback is None: self._post_run() results.outputs = self.outputs - + prov_record = None if str2bool(config.get('execution', 'write_provenance')): prov_record = write_provenance(results) results.provenance = prov_record - if (runtime.traceback is not None and + if (runtime.traceback is not None and not getattr(self.inputs, 'ignore_exception', False)): raise return results diff --git a/nipype/interfaces/io.py b/nipype/interfaces/io.py index fd5d3a9289..4370604eda 100644 --- a/nipype/interfaces/io.py +++ b/nipype/interfaces/io.py @@ -90,7 +90,7 @@ def copytree(src, dst, use_hardlink=False): if os.path.isdir(srcname): copytree(srcname, dstname, use_hardlink) else: - copyfile(srcname, dstname, True, hashmethod='content', + copyfile(srcname, dstname, True, hash_method='content', use_hardlink=use_hardlink) except (IOError, os.error) as why: errors.append((srcname, dstname, str(why))) @@ -753,7 +753,7 @@ def _list_outputs(self): # If src is a file, copy it to dst if os.path.isfile(src): iflogger.debug('copyfile: %s %s' % (src, dst)) - copyfile(src, dst, copy=True, hashmethod='content', + copyfile(src, dst, copy=True, hash_method='content', use_hardlink=use_hardlink) out_files.append(dst) # If src is a directory, copy entire contents to dst dir diff --git a/nipype/interfaces/specs.py b/nipype/interfaces/specs.py index 889493763d..6d93f90813 100644 --- a/nipype/interfaces/specs.py +++ b/nipype/interfaces/specs.py @@ -186,7 +186,7 @@ def _clean_container(self, obj, undefinedval=None, skipundefined=False): out = undefinedval return out - def get_hashval(self, hashmethod=None): + def get_hashval(self, hash_method=None): """Return a dictionary of our items with hashes for each file. Searches through dictionary items and if an item is a file, it @@ -218,30 +218,30 @@ def get_hashval(self, hashmethod=None): False) and not has_metadata(trait.trait_type, "name_source")) dict_nofilename.append((name, - self._get_sorteddict(val, hashmethod=hashmethod, + self._get_sorteddict(val, hash_method=hash_method, hash_files=hash_files))) dict_withhash.append((name, - self._get_sorteddict(val, True, hashmethod=hashmethod, + self._get_sorteddict(val, True, hash_method=hash_method, hash_files=hash_files))) return dict_withhash, md5(str(dict_nofilename).encode()).hexdigest() - def _get_sorteddict(self, obj, dictwithhash=False, hashmethod=None, + def _get_sorteddict(self, obj, dictwithhash=False, hash_method=None, hash_files=True): out = None if isinstance(obj, dict): obj_items = [(key, val) for key, val in sorted(obj.items()) if isdefined(val)] - out = [(key, self._get_sorteddict(val, dictwithhash, hashmethod=hashmethod, + out = [(key, self._get_sorteddict(val, dictwithhash, hash_method=hash_method, hash_files=hash_files)) for key, val in obj_items] elif isinstance(obj, (list, tuple)): out = [self._get_sorteddict( - val, dictwithhash, hashmethod=hashmethod, hash_files=hash_files) + val, dictwithhash, hash_method=hash_method, hash_files=hash_files) for val in obj if isdefined(val)] if isinstance(obj, tuple): return tuple(out) elif isinstance(obj, float): out = '%.10f' % obj elif isinstance(obj, string_types) and hash_files and os.path.isfile(obj): - out = auto_hash(obj, hashmethod) + out = auto_hash(obj, hash_method) if dictwithhash: return (obj, out) elif isdefined(obj): @@ -256,7 +256,7 @@ def _get_trait_desc(self, name, spec=None): xor = spec.xor requires = spec.requires argstr = spec.argstr - ns = spec.name_source + name_source = spec.name_source manhelpstr = ['\t%s' % name] @@ -297,11 +297,11 @@ def _get_trait_desc(self, name, spec=None): manhelpstr += wrap(line, 70, initial_indent='\t\trequires: ', subsequent_indent='\t\t ') - if ns: + if name_source: tpl = ', name_template not defined' if spec.name_template: tpl = ', name_template is \'%s\'' % spec.name_template - manhelpstr += wrap(('name source: %s' % ns) + tpl, 70, + manhelpstr += wrap(('name source: %s' % name_source) + tpl, 70, initial_indent='\t\t', subsequent_indent='\t\t ') return manhelpstr @@ -361,6 +361,8 @@ def _check_xor(self, obj, name, old, new): IFLOGGER.error('Called check_xorg with name %s' % name) if isdefined(getattr(self, name)): xor_list = self.traits()[name].xor + if not isinstance(xor_list, list): + xor_list = list(xor_list) if name in xor_list: xor_list.remove(name) @@ -396,8 +398,10 @@ def check_inputs(self): for name, spec in list(self.mandatory_items()): value = getattr(self, name) if not isdefined(value): - xor_defined = [isdefined(getattr(self, xname)) - for xname in getattr(spec, 'xor', [])] + xor_spec = getattr(spec, 'xor', []) + xor_defined = ([isdefined(getattr(self, xname)) for xname in xor_spec] + if xor_spec is not None else []) + if not any(xor_defined): raise ValueError( '%s requires a value for input \'%s\'. For a list of required inputs, ' @@ -411,53 +415,67 @@ def _resolve_namesource(self, name, chain=None): if chain is None: chain = [] + spec = self.traits()[name] retval = getattr(self, name) - if not isdefined(retval) or "%s" in retval: - if not spec.name_source: - return retval - if isdefined(retval) and "%s" in retval: + name_template = spec.name_template + # Default name template + if name_template is None: + if '%' in retval: name_template = retval + retval = Undefined else: - name_template = spec.name_template - if not name_template: name_template = "%s_generated" - ns = spec.name_source - while isinstance(ns, list): - if len(ns) > 1: - IFLOGGER.warn('Only one name_source per trait is allowed') - ns = ns[0] + # If input is already set, do nothing + if isdefined(retval): + return retval + + # Prevent entering here twice + if name in chain: + raise InterfaceInputsError('Mutually pointing name_sources') + chain.append(name) + + keep_ext = not isdefined(spec.keep_extension) or spec.keep_extension + name_source = spec.name_source + if isinstance(name_source, string_types): + name_source = [name_source] + if isinstance(name_source, tuple): + name_source = list(name_source) + + if not isinstance(name_source, list): + raise ValueError( + 'name_source of input \'%s\' sould be a string, or list/tuple of ' + 'strings denoting input trait names, but got %s' % (name, name_source)) + + sourced_values = [None] * len(name_source) - if not isinstance(ns, string_types): - raise ValueError(('name_source of \'%s\' trait sould be an ' - 'input trait name') % name) + for i, nsrc in enumerate(name_source): + if not isinstance(nsrc, string_types): + raise ValueError(('name_source \'%s\' of \'%s\' trait sould be an ' + 'input trait name') % (nsrc, name)) - if isdefined(getattr(self, ns)): - name_source = ns - source = getattr(self, name_source) - while isinstance(source, list): - source = source[0] + src_value = getattr(self, nsrc) + if not isdefined(src_value): + sourced_values[i] = self._resolve_namesource(nsrc, chain) + else: + if isinstance(src_value, list): + raise NotImplementedError('Multiple sourced values not allowed yet') - # special treatment for files try: - _, base, ext = split_filename(source) + # special treatment for files + _, base, ext = split_filename(src_value) except AttributeError: - base = source + base = src_value ext = '' - else: - if name in chain: - raise InterfaceInputsError('Mutually pointing name_sources') + sourced_values[i] = base - chain.append(name) - return self._resolve_namesource(ns, chain) - - retval = name_template % base - - if not isdefined(spec.keep_extension) or spec.keep_extension: - return retval + ext - return self._overload_extension(retval, name) + retval = name_template % tuple(sourced_values) + if keep_ext: + retval += ext + else: + retval = self._overload_extension(retval, name) return retval @@ -473,8 +491,8 @@ def update_autonames(self): if isdefined(value): continue - ns = spec.name_source - if ns is not None: + name_source = spec.name_source + if name_source is not None: value = self._resolve_namesource(name) if isdefined(value): diff --git a/nipype/utils/filemanip.py b/nipype/utils/filemanip.py index 4344a17f1f..6723946c5e 100644 --- a/nipype/utils/filemanip.py +++ b/nipype/utils/filemanip.py @@ -168,14 +168,14 @@ def check_forhash(filename): else: return False, None -def auto_hash(afile, hashmethod=None, chunk_len=8192, crypto=hashlib.md5): +def auto_hash(afile, hash_method=None, chunk_len=8192, crypto=hashlib.md5): """Checks the hash method and calls the appropriate function""" - if hashmethod is None: - hashmethod = config.get('execution', 'hash_method').lower() + if hash_method is None: + hash_method = config.get('execution', 'hash_method').lower() - if hashmethod not in ['content', 'timestamp']: - raise ValueError("Unknown hash method: %s" % hashmethod) - func = getattr(sys.modules[__name__], 'hash_' + hashmethod) + if hash_method not in ['content', 'timestamp']: + raise ValueError("Unknown hash method: %s" % hash_method) + func = getattr(sys.modules[__name__], 'hash_' + hash_method) return func(afile, chunk_len, crypto) def hash_content(afile, chunk_len=8192, crypto=hashlib.md5): @@ -205,7 +205,7 @@ def hash_timestamp(afile, **kwargs): # pylint: disable=W0613 def copyfile(originalfile, newfile, copy=False, create_new=False, - hashmethod=None, use_hardlink=False): + hash_method=None, use_hardlink=False): """Copy or symlink ``originalfile`` to ``newfile``. Parameters @@ -239,13 +239,13 @@ def copyfile(originalfile, newfile, copy=False, create_new=False, fname += "_c%04d" % i newfile = base + os.sep + fname + ext - if hashmethod is None: - hashmethod = config.get('execution', 'hash_method').lower() + if hash_method is None: + hash_method = config.get('execution', 'hash_method').lower() elif os.path.exists(newfile): - if hashmethod == 'timestamp': + if hash_method == 'timestamp': newhash = hash_timestamp(newfile) - elif hashmethod == 'content': + elif hash_method == 'content': newhash = hash_content(newfile) fmlogger.debug("File: %s already exists,%s, copy:%d" % (newfile, newhash, copy)) @@ -256,9 +256,9 @@ def copyfile(originalfile, newfile, copy=False, create_new=False, # newhash = None if os.name is 'posix' and not copy: if os.path.lexists(newfile): - if hashmethod == 'timestamp': + if hash_method == 'timestamp': orighash = hash_timestamp(originalfile) - elif hashmethod == 'content': + elif hash_method == 'content': orighash = hash_content(originalfile) fmlogger.debug('Original hash: %s, %s' % (originalfile, orighash)) if newhash != orighash: @@ -267,9 +267,9 @@ def copyfile(originalfile, newfile, copy=False, create_new=False, os.symlink(originalfile, newfile) else: if newhash: - if hashmethod == 'timestamp': + if hash_method == 'timestamp': orighash = hash_timestamp(originalfile) - elif hashmethod == 'content': + elif hash_method == 'content': orighash = hash_content(originalfile) if (newhash is None) or (newhash != orighash): try: From 9b1212b71c5eef797ce5a87d6163767eed21feca Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Tue, 16 Feb 2016 16:05:52 -0800 Subject: [PATCH 21/73] fixing errors, updating deprecations.... --- nipype/interfaces/base.py | 6 - nipype/interfaces/freesurfer/utils.py | 5 +- nipype/interfaces/fsl/base.py | 125 +++++--------------- nipype/interfaces/fsl/dti.py | 62 +++++----- nipype/interfaces/fsl/tests/test_base.py | 24 ---- nipype/interfaces/specs.py | 15 ++- nipype/interfaces/tests/test_base.py | 12 +- nipype/pipeline/engine/nodes.py | 4 +- nipype/pipeline/engine/tests/test_engine.py | 10 +- 9 files changed, 83 insertions(+), 180 deletions(-) diff --git a/nipype/interfaces/base.py b/nipype/interfaces/base.py index d27df46031..42c9a1f172 100644 --- a/nipype/interfaces/base.py +++ b/nipype/interfaces/base.py @@ -378,12 +378,6 @@ def run(self): """Execute the command.""" raise NotImplementedError - def _get_filecopy_info(self): - """ Provides information about file inputs to copy or link to cwd. - Necessary for pipeline operation - """ - raise NotImplementedError - class BaseInterface(Interface): """Implements common interface functionality. diff --git a/nipype/interfaces/freesurfer/utils.py b/nipype/interfaces/freesurfer/utils.py index 5697130131..88f6d7365a 100644 --- a/nipype/interfaces/freesurfer/utils.py +++ b/nipype/interfaces/freesurfer/utils.py @@ -48,9 +48,8 @@ class SampleToSurfaceInputSpec(FSTraitedSpec): reg_header = traits.Bool(argstr="--regheader %s", requires=["subject_id"], mandatory=True, xor=reg_xors, desc="register based on header geometry") - mni152reg = traits.Bool(argstr="--mni152reg", - mandatory=True, xor=reg_xors, - desc="source volume is in MNI152 space") + mni152reg = traits.Bool(False, argstr="--mni152reg", mandatory=True, + xor=reg_xors, desc="source volume is in MNI152 space") apply_rot = traits.Tuple(traits.Float, traits.Float, traits.Float, argstr="--rot %.3f %.3f %.3f", diff --git a/nipype/interfaces/fsl/base.py b/nipype/interfaces/fsl/base.py index b4fedddc7d..b330f240d2 100644 --- a/nipype/interfaces/fsl/base.py +++ b/nipype/interfaces/fsl/base.py @@ -25,19 +25,22 @@ """ -from builtins import object - -from glob import glob import os -import warnings +from glob import glob +from builtins import object +from ..base import traits, CommandLine, CommandLineInputSpec +from ... import logging -from ...utils.filemanip import fname_presuffix, split_filename, copyfile -from ..base import (traits, isdefined, - CommandLine, CommandLineInputSpec, TraitedSpec, - File, Directory, InputMultiPath, OutputMultiPath) +IFLOGGER = logging.getLogger('interface') -warn = warnings.warn +FSLDIR = os.getenv('FSLDIR') +if FSLDIR is None: + IFLOGGER.warn('FSLDIR environment variable is not set') +FSLOUTPUTTYPE = os.getenv('FSLOUTPUTTYPE') +if FSLOUTPUTTYPE is None: + IFLOGGER.warn('FSLOUTPUTTYPE environment variable is not set, using NIFTI') + FSLOUTPUTTYPE = 'NIFTI' class Info(object): """Handle fsl output type and version information. @@ -70,12 +73,11 @@ def version(): """ # find which fsl being used....and get version from # /path/to/fsl/etc/fslversion - try: - basedir = os.environ['FSLDIR'] - except KeyError: - return None - out = open('%s/etc/fslversion' % (basedir)).read() - return out.strip('\n') + out = None + if FSLDIR is not None: + with open('%s/etc/fslversion' % FSLDIR, 'r') as vfile: + out = vfile.read().strip('\n') + return out @classmethod def output_type_to_ext(cls, output_type): @@ -110,12 +112,7 @@ def output_type(cls): fsl_ftype : string Represents the current environment setting of FSLOUTPUTTYPE """ - try: - return os.environ['FSLOUTPUTTYPE'] - except KeyError: - warnings.warn(('FSL environment variables not set. setting output ' - 'type to NIFTI')) - return 'NIFTI' + return FSLOUTPUTTYPE @staticmethod def standard_image(img_name=None): @@ -146,9 +143,12 @@ class FSLCommandInputSpec(CommandLineInputSpec): ------- fsl.ExtractRoi(tmin=42, tsize=1, output_type='NIFTI') """ - output_type = traits.Enum('NIFTI', list(Info.ftypes.keys()), + output_type = traits.Enum(FSLOUTPUTTYPE, list(Info.ftypes.keys()), usedefault=True, desc='FSL output type') + def _overload_extension(self, value, name=None): + return value + Info.output_type_to_ext(self.output_type) + class FSLCommand(CommandLine): """Base support for FSL commands. @@ -156,19 +156,12 @@ class FSLCommand(CommandLine): """ input_spec = FSLCommandInputSpec - _output_type = None def __init__(self, **inputs): super(FSLCommand, self).__init__(**inputs) self.inputs.on_trait_change(self._output_update, 'output_type') - - if self._output_type is None: - self._output_type = Info.output_type() - - if not isdefined(self.inputs.output_type): - self.inputs.output_type = self._output_type - else: - self._output_update() + self._output_type = FSLOUTPUTTYPE + self.inputs.environ.update({'FSLOUTPUTTYPE': FSLOUTPUTTYPE}) def _output_update(self): self._output_type = self.inputs.output_type @@ -193,75 +186,19 @@ def set_default_output_type(cls, output_type): def version(self): return Info.version() - def _gen_fname(self, basename, cwd=None, suffix=None, change_ext=True, - ext=None): - """Generate a filename based on the given parameters. - - The filename will take the form: cwd/basename. - If change_ext is True, it will use the extentions specified in - intputs.output_type. - - Parameters - ---------- - basename : str - Filename to base the new filename on. - cwd : str - Path to prefix to the new filename. (default is os.getcwd()) - suffix : str - Suffix to add to the `basename`. (defaults is '' ) - change_ext : bool - Flag to change the filename extension to the FSL output type. - (default True) - - Returns - ------- - fname : str - New filename based on given parameters. - - """ - - if basename == '': - msg = 'Unable to generate filename for command %s. ' % self.cmd - msg += 'basename is not set!' - raise ValueError(msg) - if cwd is None: - cwd = os.getcwd() - if ext is None: - ext = Info.output_type_to_ext(self.inputs.output_type) - if change_ext: - if suffix: - suffix = ''.join((suffix, ext)) - else: - suffix = ext - if suffix is None: - suffix = '' - fname = fname_presuffix(basename, suffix=suffix, - use_ext=False, newpath=cwd) - return fname - - def _overload_extension(self, value, name=None): - return value + Info.output_type_to_ext(self.inputs.output_type) - - -def check_fsl(): - ver = Info.version() - if ver: - return 0 - else: - return 1 - def no_fsl(): """Checks if FSL is NOT installed used with skipif to skip tests that will fail if FSL is not installed""" + return Info.version() is None - if Info.version() is None: - return True - else: - return False - +def check_fsl(): + """Same as the previous. One of these should disappear """ + return Info.version() is not None def no_fsl_course_data(): """check if fsl_course data is present""" - return not ('FSL_COURSE_DATA' in os.environ and os.path.isdir(os.path.abspath(os.environ['FSL_COURSE_DATA']))) + if os.getenv('FSL_COURSE_DATA') is None: + return False + return os.path.isdir(os.path.abspath(os.getenv('FSL_COURSE_DATA'))) diff --git a/nipype/interfaces/fsl/dti.py b/nipype/interfaces/fsl/dti.py index 84e44e4f7a..5f799e0893 100644 --- a/nipype/interfaces/fsl/dti.py +++ b/nipype/interfaces/fsl/dti.py @@ -20,7 +20,7 @@ from ... import LooseVersion from ..base import (TraitedSpec, isdefined, File, Directory, - InputMultiPath, OutputMultiPath, traits) + InputMultiPath, OutputMultiPath, traits, Undefined) from ..fsl.base import (FSLCommand, FSLCommandInputSpec, Info) from ...utils.filemanip import fname_presuffix, split_filename, copyfile @@ -44,7 +44,7 @@ class DTIFitInputSpec(FSLCommandInputSpec): max_y = traits.Int(argstr='-Y %d', desc='max y') min_x = traits.Int(argstr='-x %d', desc='min x') max_x = traits.Int(argstr='-X %d', desc='max x') - save_tensor = traits.Bool(desc='save the elements of the tensor', + save_tensor = traits.Bool(False, usedefault=True, desc='save the elements of the tensor', argstr='--save_tensor') sse = traits.Bool(desc='output sum of squared errors', argstr='--sse') cni = File(exists=True, desc='input counfound regressors', argstr='--cni=%s') @@ -64,9 +64,9 @@ class DTIFitOutputSpec(TraitedSpec): MD = File(exists=True, desc='path/name of file with the mean diffusivity') FA = File(exists=True, desc='path/name of file with the fractional anisotropy') MO = File(exists=True, desc='path/name of file with the mode of anisotropy') - S0 = File(exists=True, desc='path/name of file with the raw T2 signal with no ' + + S0 = File(exists=True, desc='path/name of file with the raw T2 signal with no ' 'diffusion weighting') - tensor = File(exists=True, desc='path/name of file with the 4D tensor volume') + tensor = File(desc='path/name of file with the 4D tensor volume') class DTIFit(FSLCommand): @@ -92,14 +92,14 @@ class DTIFit(FSLCommand): input_spec = DTIFitInputSpec output_spec = DTIFitOutputSpec - def _list_outputs(self): - outputs = self.output_spec().get() - for k in list(outputs.keys()): - if k not in ('outputtype', 'environ', 'args'): - if k != 'tensor' or (isdefined(self.inputs.save_tensor) and - self.inputs.save_tensor): - outputs[k] = self._gen_fname(self.inputs.base_name, suffix='_' + k) - return outputs + def _post_run(self): + for k, _ in list(self.outputs.items()): + if k in ('outputtype', 'environ', 'args'): + continue + value = os.path.abspath(self.inputs.base_name + '_%s' % k) + if k == 'tensor' and self.inputs.save_tensor: + value = Undefined + setattr(self.outputs, k, value) class FSLXCommandInputSpec(FSLCommandInputSpec): @@ -198,7 +198,7 @@ def _run_interface(self, runtime): self.raise_exception(runtime) return runtime - def _list_outputs(self, out_dir=None): + def _post_run(self, out_dir=None): outputs = self.output_spec().get() n_fibres = self.inputs.n_fibres if not out_dir: @@ -354,7 +354,7 @@ def _run_interface(self, runtime): self._out_dir = subjectdir + '.bedpostX' return retval - def _list_outputs(self): + def _post_run(self): outputs = self.output_spec().get() n_fibres = self.inputs.n_fibres @@ -476,7 +476,7 @@ def __init__(self, **inputs): DeprecationWarning) super(XFibres4, self).__init__(**inputs) - def _list_outputs(self): + def _post_run(self): outputs = self.output_spec().get() outputs["mean_dsamples"] = self._gen_fname("mean_dsamples", cwd=self.inputs.logdir) @@ -610,7 +610,7 @@ def _run_interface(self, runtime, correct_return_codes=[0]): self.raise_exception(runtime) return runtime - def _list_outputs(self): + def _post_run(self): outputs = self.output_spec().get() bpx_directory = self._get_bedpostx_dir() outputs['bpx_out_directory'] = os.path.join(bpx_directory + '.bedpostX') @@ -827,7 +827,7 @@ def _format_arg(self, name, spec, value): else: return super(ProbTrackX, self)._format_arg(name, spec, value) - def _list_outputs(self): + def _post_run(self): outputs = self.output_spec().get() if not isdefined(self.inputs.out_dir): out_dir = self._gen_filename("out_dir") @@ -941,8 +941,8 @@ class ProbTrackX2(ProbTrackX): input_spec = ProbTrackX2InputSpec output_spec = ProbTrackX2OutputSpec - def _list_outputs(self): - outputs = super(ProbTrackX2, self)._list_outputs() + def _post_run(self): + outputs = super(ProbTrackX2, self)._post_run() if not isdefined(self.inputs.out_dir): out_dir = os.getcwd() @@ -1022,7 +1022,7 @@ def _run_interface(self, runtime): suffix='_vreg') return super(VecReg, self)._run_interface(runtime) - def _list_outputs(self): + def _post_run(self): outputs = self.output_spec().get() outputs['out_file'] = self.inputs.out_file if not isdefined(outputs['out_file']) and isdefined(self.inputs.in_file): @@ -1034,7 +1034,7 @@ def _list_outputs(self): def _gen_filename(self, name): if name is 'out_file': - return self._list_outputs()[name] + return self._post_run()[name] else: return None @@ -1072,7 +1072,7 @@ class ProjThresh(FSLCommand): input_spec = ProjThreshInputSpec output_spec = ProjThreshOuputSpec - def _list_outputs(self): + def _post_run(self): outputs = self.output_spec().get() outputs['out_files'] = [] for name in self.inputs.in_files: @@ -1121,7 +1121,7 @@ def _run_interface(self, runtime): self.inputs.out_file = self._gen_fname('biggestSegmentation', suffix='') return super(FindTheBiggest, self)._run_interface(runtime) - def _list_outputs(self): + def _post_run(self): outputs = self.output_spec().get() outputs['out_file'] = self.inputs.out_file if not isdefined(outputs['out_file']): @@ -1131,7 +1131,7 @@ def _list_outputs(self): def _gen_filename(self, name): if name is 'out_file': - return self._list_outputs()[name] + return self._post_run()[name] else: return None @@ -1198,18 +1198,18 @@ def _format_arg(self, name, spec, value): else: mask_file = _si.search_mask_file if not isdefined(_si.projected_data): - proj_file = self._list_outputs()["projected_data"] + proj_file = self._post_run()["projected_data"] else: proj_file = _si.projected_data return spec.argstr % (_si.threshold, _si.distance_map, mask_file, _si.data_file, proj_file) elif name == "skeleton_file": if isinstance(value, bool): - return spec.argstr % self._list_outputs()["skeleton_file"] + return spec.argstr % self._post_run()["skeleton_file"] else: return spec.argstr % value return super(TractSkeleton, self)._format_arg(name, spec, value) - def _list_outputs(self): + def _post_run(self): outputs = self.output_spec().get() _si = self.inputs if isdefined(_si.project_data) and _si.project_data: @@ -1271,10 +1271,10 @@ class DistanceMap(FSLCommand): def _format_arg(self, name, spec, value): if name == "local_max_file": if isinstance(value, bool): - return spec.argstr % self._list_outputs()["local_max_file"] + return spec.argstr % self._post_run()["local_max_file"] return super(DistanceMap, self)._format_arg(name, spec, value) - def _list_outputs(self): + def _post_run(self): outputs = self.output_spec().get() _si = self.inputs outputs["distance_map"] = _si.distance_map @@ -1296,7 +1296,7 @@ def _list_outputs(self): def _gen_filename(self, name): if name == "distance_map": - return self._list_outputs()["distance_map"] + return self._post_run()["distance_map"] return None @@ -1324,7 +1324,7 @@ class MakeDyadicVectors(FSLCommand): input_spec = MakeDyadicVectorsInputSpec output_spec = MakeDyadicVectorsOutputSpec - def _list_outputs(self): + def _post_run(self): outputs = self.output_spec().get() outputs["dyads"] = self._gen_fname(self.inputs.output) outputs["dispersion"] = self._gen_fname(self.inputs.output, diff --git a/nipype/interfaces/fsl/tests/test_base.py b/nipype/interfaces/fsl/tests/test_base.py index a8ec012905..7ceb0184c2 100644 --- a/nipype/interfaces/fsl/tests/test_base.py +++ b/nipype/interfaces/fsl/tests/test_base.py @@ -58,27 +58,3 @@ def test_FSLCommand2(): if out_type != fsl.Info.output_type(): # Setting class outputtype should not effect existing instances yield assert_not_equal, cmdinst.inputs.output_type, out_type - - -@skipif(no_fsl) # skip if fsl not installed) -def test_gen_fname(): - # Test _gen_fname method of FSLCommand - cmd = fsl.FSLCommand(command='junk', output_type='NIFTI_GZ') - pth = os.getcwd() - # just the filename - fname = cmd._gen_fname('foo.nii.gz', suffix='_fsl') - desired = os.path.join(pth, 'foo_fsl.nii.gz') - yield assert_equal, fname, desired - # filename with suffix - fname = cmd._gen_fname('foo.nii.gz', suffix='_brain') - desired = os.path.join(pth, 'foo_brain.nii.gz') - yield assert_equal, fname, desired - # filename with suffix and working directory - fname = cmd._gen_fname('foo.nii.gz', suffix='_brain', cwd='/data') - desired = os.path.join('/data', 'foo_brain.nii.gz') - yield assert_equal, fname, desired - # filename with suffix and no file extension change - fname = cmd._gen_fname('foo.nii.gz', suffix='_brain.mat', - change_ext=False) - desired = os.path.join(pth, 'foo_brain.mat') - yield assert_equal, fname, desired diff --git a/nipype/interfaces/specs.py b/nipype/interfaces/specs.py index 6d93f90813..76097a1b6b 100644 --- a/nipype/interfaces/specs.py +++ b/nipype/interfaces/specs.py @@ -368,7 +368,10 @@ def _check_xor(self, obj, name, old, new): xor_list.remove(name) # for each xor, set to default_value for trait_name in xor_list: - if isdefined(getattr(self, trait_name)): + trait_val = getattr(self, trait_name) + if isdefined(trait_val) and isinstance(trait_val, bool) and not trait_val: + trait_val = Undefined # Boolean inputs set false should not count as defined + if isdefined(trait_val): self.trait_set(trait_change_notify=False, **{'%s' % name: Undefined}) msg = ('Input "%s" is mutually exclusive with input "%s", ' @@ -399,13 +402,13 @@ def check_inputs(self): value = getattr(self, name) if not isdefined(value): xor_spec = getattr(spec, 'xor', []) - xor_defined = ([isdefined(getattr(self, xname)) for xname in xor_spec] - if xor_spec is not None else []) + if xor_spec is None: + xor_spec = [] - if not any(xor_defined): + if not any([isdefined(xname) for xname in xor_spec]): raise ValueError( - '%s requires a value for input \'%s\'. For a list of required inputs, ' - 'see %s.help()' % (self.__class__.__name__, name, self.__class__.__name__)) + '%s requires a value for one of these inputs \'%s\'. For a list of required inputs, ' + 'see %s.help()' % (self.__class__.__name__, xor_spec, self.__class__.__name__)) self._check_requires(name) for elem in list(self.optional_items()): diff --git a/nipype/interfaces/tests/test_base.py b/nipype/interfaces/tests/test_base.py index d186f64b6b..92f7759087 100644 --- a/nipype/interfaces/tests/test_base.py +++ b/nipype/interfaces/tests/test_base.py @@ -408,12 +408,12 @@ def __init__(self): yield assert_raises, NotImplementedError, nif.run yield assert_raises, NotImplementedError, nif.aggregate_outputs yield assert_raises, NotImplementedError, nif._list_outputs - yield assert_raises, NotImplementedError, nif._get_filecopy_info + yield assert_raises, NotImplementedError, nif.inputs.get_filecopy_info def test_BaseInterface(): yield assert_equal, nib.BaseInterface.help(), None - yield assert_equal, nib.BaseInterface._get_filecopy_info(), [] + yield assert_equal, nib.BaseInterface.inputs.get_filecopy_info(), [] class InputSpec(nib.TraitedSpec): foo = nib.traits.Int(desc='a random int') @@ -432,10 +432,10 @@ class DerivedInterface(nib.BaseInterface): yield assert_equal, DerivedInterface.help(), None yield assert_true, 'moo' in ''.join(DerivedInterface._inputs_help()) yield assert_equal, DerivedInterface()._outputs(), None - yield assert_equal, DerivedInterface._get_filecopy_info()[0]['key'], 'woo' - yield assert_true, DerivedInterface._get_filecopy_info()[0]['copy'] - yield assert_equal, DerivedInterface._get_filecopy_info()[1]['key'], 'zoo' - yield assert_false, DerivedInterface._get_filecopy_info()[1]['copy'] + yield assert_equal, DerivedInterface.inputs.get_filecopy_info()[0]['key'], 'woo' + yield assert_true, DerivedInterface.inputs.get_filecopy_info()[0]['copy'] + yield assert_equal, DerivedInterface.inputs.get_filecopy_info()[1]['key'], 'zoo' + yield assert_false, DerivedInterface.inputs.get_filecopy_info()[1]['copy'] yield assert_equal, DerivedInterface().inputs.foo, Undefined yield assert_raises, ValueError, DerivedInterface()._check_mandatory_inputs yield assert_equal, DerivedInterface(goo=1)._check_mandatory_inputs(), None diff --git a/nipype/pipeline/engine/nodes.py b/nipype/pipeline/engine/nodes.py index feb58c4047..332ffa98ab 100644 --- a/nipype/pipeline/engine/nodes.py +++ b/nipype/pipeline/engine/nodes.py @@ -658,14 +658,14 @@ def _strip_temp(self, files, wd): def _copyfiles_to_wd(self, outdir, execute, linksonly=False): """ copy files over and change the inputs""" - if hasattr(self._interface, '_get_filecopy_info'): + if hasattr(self.inputs, 'get_filecopy_info'): logger.debug('copying files to wd [execute=%s, linksonly=%s]' % (str(execute), str(linksonly))) if execute and linksonly: olddir = outdir outdir = op.join(outdir, '_tempinput') os.makedirs(outdir) - for info in self._interface._get_filecopy_info(): + for info in self.inputs.get_filecopy_info(): files = self.inputs.get().get(info['key']) if not isdefined(files): continue diff --git a/nipype/pipeline/engine/tests/test_engine.py b/nipype/pipeline/engine/tests/test_engine.py index 5eaaa81fbf..21dbbfebce 100644 --- a/nipype/pipeline/engine/tests/test_engine.py +++ b/nipype/pipeline/engine/tests/test_engine.py @@ -17,11 +17,10 @@ from ....interfaces import base as nib -class InputSpec(nib.TraitedSpec): +class InputSpec(nib.BaseInterfaceInputSpec): input1 = nib.traits.Int(desc='a random int') input2 = nib.traits.Int(desc='a random int') - class OutputSpec(nib.TraitedSpec): output1 = nib.traits.List(nib.traits.Int, desc='outputs') @@ -32,14 +31,9 @@ class TestInterface(nib.BaseInterface): def _run_interface(self, runtime): runtime.returncode = 0 + self.outputs.output1 = [1, self.inputs.input1] return runtime - def _list_outputs(self): - outputs = self._outputs().get() - outputs['output1'] = [1, self.inputs.input1] - return outputs - - def test_init(): yield assert_raises, Exception, pe.Workflow pipe = pe.Workflow(name='pipe') From 8d8826f97eaf73deb58ba99ae2395554985c9529 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Tue, 16 Feb 2016 20:12:59 -0800 Subject: [PATCH 22/73] fixing errors --- nipype/interfaces/base.py | 18 +- nipype/interfaces/fsl/base.py | 14 +- nipype/interfaces/fsl/dti.py | 519 ++++++++++++---------------- nipype/interfaces/fsl/preprocess.py | 176 ++++------ nipype/interfaces/specs.py | 50 ++- 5 files changed, 356 insertions(+), 421 deletions(-) diff --git a/nipype/interfaces/base.py b/nipype/interfaces/base.py index 42c9a1f172..9d45b4edd8 100644 --- a/nipype/interfaces/base.py +++ b/nipype/interfaces/base.py @@ -476,10 +476,10 @@ def _post_run(self): return None ns_outputs = {} - for ns, sp in list(self.inputs.namesource_items()): - ns_pointer = getattr(sp, 'out_name', None) + for ns_input, ns_spec in list(self.inputs.namesource_items()): + ns_pointer = getattr(ns_spec, 'out_name', None) if ns_pointer is not None: - ns_outputs[ns_pointer] = ns + ns_outputs[ns_pointer] = ns_input # Search for inputs with the same name for out_name, spec in list(self.outputs.items()): @@ -491,11 +491,13 @@ def _post_run(self): if isdefined(value): setattr(self.outputs, out_name, op.abspath(value)) - if spec.exists: - if not op.isfile(getattr(self.outputs, out_name)): - raise FileNotFoundError( - 'Output %s not found for interface %s.' % - (out_name, self.__class__)) + # Search for outputs with name source + for out_name, spec in self.outputs.namesource_items(): + if isdefined(getattr(self.outputs, out_name)): + continue + value = self.outputs.format_ns(spec.name_source, out_name, self.inputs) + setattr(self.outputs, out_name, value) + def run(self, **inputs): """Execute this interface. diff --git a/nipype/interfaces/fsl/base.py b/nipype/interfaces/fsl/base.py index b330f240d2..658e8d1ab7 100644 --- a/nipype/interfaces/fsl/base.py +++ b/nipype/interfaces/fsl/base.py @@ -150,10 +150,8 @@ def _overload_extension(self, value, name=None): return value + Info.output_type_to_ext(self.output_type) -class FSLCommand(CommandLine): - """Base support for FSL commands. - - """ +class FSLCommand(CommandLine): # pylint: disable=W0223 + """Base support for FSL commands.""" input_spec = FSLCommandInputSpec @@ -167,6 +165,14 @@ def _output_update(self): self._output_type = self.inputs.output_type self.inputs.environ.update({'FSLOUTPUTTYPE': self.inputs.output_type}) + def _get_ext(self): + return Info.output_type_to_ext(self.input_spec.output_type) + + def _gen_fname(self, basename, out_path=None, suffix=''): + if out_path is None: + out_path = os.getcwd() + return os.path.join(out_path, basename + suffix + self._get_ext()) + @classmethod def set_default_output_type(cls, output_type): """Set the default output type for FSL classes. diff --git a/nipype/interfaces/fsl/dti.py b/nipype/interfaces/fsl/dti.py index 5f799e0893..fc2899a4fc 100644 --- a/nipype/interfaces/fsl/dti.py +++ b/nipype/interfaces/fsl/dti.py @@ -6,8 +6,8 @@ Change directory to provide relative paths for doctests >>> import os - >>> filepath = os.path.dirname( os.path.realpath( __file__ ) ) - >>> datadir = os.path.realpath(os.path.join(filepath, '../../testing/data')) + >>> filepath = op.dirname( op.realpath( __file__ ) ) + >>> datadir = op.realpath(op.join(filepath, '../../testing/data')) >>> os.chdir(datadir) """ @@ -15,8 +15,8 @@ from builtins import range import os +import os.path as op import shutil -import warnings from ... import LooseVersion from ..base import (TraitedSpec, isdefined, File, Directory, @@ -24,13 +24,14 @@ from ..fsl.base import (FSLCommand, FSLCommandInputSpec, Info) from ...utils.filemanip import fname_presuffix, split_filename, copyfile -warn = warnings.warn +from ... import logging +IFLOGGER = logging.getLogger('interface') class DTIFitInputSpec(FSLCommandInputSpec): dwi = File(exists=True, desc='diffusion weighted image data file', argstr='-k %s', position=0, mandatory=True) - base_name = traits.Str("dtifit_", desc='base_name that all output files will start with', + base_name = traits.Str('dtifit_', desc='base_name that all output files will start with', argstr='-o %s', position=1, usedefault=True) mask = File(exists=True, desc='bet binary mask file', argstr='-m %s', position=2, mandatory=True) @@ -55,18 +56,28 @@ class DTIFitInputSpec(FSLCommandInputSpec): class DTIFitOutputSpec(TraitedSpec): - V1 = File(exists=True, desc='path/name of file with the 1st eigenvector') - V2 = File(exists=True, desc='path/name of file with the 2nd eigenvector') - V3 = File(exists=True, desc='path/name of file with the 3rd eigenvector') - L1 = File(exists=True, desc='path/name of file with the 1st eigenvalue') - L2 = File(exists=True, desc='path/name of file with the 2nd eigenvalue') - L3 = File(exists=True, desc='path/name of file with the 3rd eigenvalue') - MD = File(exists=True, desc='path/name of file with the mean diffusivity') - FA = File(exists=True, desc='path/name of file with the fractional anisotropy') - MO = File(exists=True, desc='path/name of file with the mode of anisotropy') - S0 = File(exists=True, desc='path/name of file with the raw T2 signal with no ' - 'diffusion weighting') - tensor = File(desc='path/name of file with the 4D tensor volume') + out_v1 = File(name_source='base_name', name_template='%s_V1', + exists=True, desc='1st eigenvector') + out_v2 = File(name_source='base_name', name_template='%s_V2', + exists=True, desc='2nd eigenvector') + out_v3 = File(name_source='base_name', name_template='%s_V3', + exists=True, desc='3rd eigenvector') + out_l1 = File(name_source='base_name', name_template='%s_L1', + exists=True, desc='1st eigenvalue') + out_l2 = File(name_source='base_name', name_template='%s_L2', + exists=True, desc='2nd eigenvalue') + out_l3 = File(name_source='base_name', name_template='%s_L3', + exists=True, desc='3rd eigenvalue') + out_md = File(name_source='base_name', name_template='%s_MD', + exists=True, desc='mean diffusivity') + out_fa = File(name_source='base_name', name_template='%s_FA', + exists=True, desc='fractional anisotropy') + out_mo = File(name_source='base_name', name_template='%s_MO', + exists=True, desc='mode of anisotropy') + out_s0 = File(name_source='base_name', name_template='%s_S0', + exists=True, desc='raw T2 signal with no diffusion weighting') + tensor = File(name_source='base_name', name_template='%s_tensor', + desc='path/name of file with the 4D tensor volume') class DTIFit(FSLCommand): @@ -96,7 +107,7 @@ def _post_run(self): for k, _ in list(self.outputs.items()): if k in ('outputtype', 'environ', 'args'): continue - value = os.path.abspath(self.inputs.base_name + '_%s' % k) + value = op.abspath(self.inputs.base_name + '_%s' % k) if k == 'tensor' and self.inputs.save_tensor: value = Undefined setattr(self.outputs, k, value) @@ -199,43 +210,33 @@ def _run_interface(self, runtime): return runtime def _post_run(self, out_dir=None): - outputs = self.output_spec().get() n_fibres = self.inputs.n_fibres if not out_dir: if isdefined(self.inputs.logdir): - out_dir = os.path.abspath(self.inputs.logdir) + out_dir = op.abspath(self.inputs.logdir) else: - out_dir = os.path.abspath('logdir') + out_dir = op.abspath('logdir') multi_out = ['dyads', 'fsamples', 'mean_fsamples', 'phsamples', 'thsamples'] single_out = ['mean_dsamples', 'mean_S0samples'] for k in single_out: - outputs[k] = self._gen_fname(k, cwd=out_dir) + setattr(self.outputs, k, self._gen_fname(k, out_dir)) if isdefined(self.inputs.rician) and self.inputs.rician: - outputs['mean_tausamples'] = self._gen_fname('mean_tausamples', - cwd=out_dir) + self.outputs.mean_tausamples = self._gen_fname('mean_tausamples', out_dir) for k in multi_out: - outputs[k] = [] + setattr(self.outputs, k, []) for i in range(1, n_fibres + 1): - outputs['fsamples'].append(self._gen_fname('f%dsamples' % i, - cwd=out_dir)) - outputs['mean_fsamples'].append(self._gen_fname(('mean_f%d' - 'samples') % i, cwd=out_dir)) + self.outputs.fsamples.append(self._gen_fname('f%dsamples' % i, out_dir)) + self.outputs.mean_fsamples.append(self._gen_fname('mean_f%dsamples' % i, out_dir)) - for i in range(1, n_fibres + 1): - outputs['dyads'].append(self._gen_fname('dyads%d' % i, - cwd=out_dir)) - outputs['phsamples'].append(self._gen_fname('ph%dsamples' % i, - cwd=out_dir)) - outputs['thsamples'].append(self._gen_fname('th%dsamples' % i, - cwd=out_dir)) - - return outputs + self.outputs.dyads.append(self._gen_fname('dyads%d' % i, out_dir)) + self.outputs.phsamples.append(self._gen_fname('ph%dsamples' % i, out_dir)) + self.outputs.thsamples.append(self._gen_fname('th%dsamples' % i, out_dir)) class BEDPOSTX5InputSpec(FSLXCommandInputSpec): @@ -270,24 +271,21 @@ class BEDPOSTX5InputSpec(FSLXCommandInputSpec): class BEDPOSTX5OutputSpec(TraitedSpec): mean_dsamples = File(exists=True, desc='Mean of distribution on diffusivity d') - mean_fsamples = OutputMultiPath(File(exists=True), desc=('Mean of ' - 'distribution on f anisotropy')) - mean_S0samples = File(exists=True, desc=('Mean of distribution on T2w' - 'baseline signal intensity S0')) - mean_phsamples = OutputMultiPath(File(exists=True), desc=('Mean of ' - 'distribution on phi')) - mean_thsamples = OutputMultiPath(File(exists=True), desc=('Mean of ' - 'distribution on theta')) - merged_thsamples = OutputMultiPath(File(exists=True), desc=('Samples from ' - 'the distribution on theta')) - merged_phsamples = OutputMultiPath(File(exists=True), desc=('Samples from ' - 'the distribution on phi')) - merged_fsamples = OutputMultiPath(File(exists=True), - desc=('Samples from the distribution on ' - 'anisotropic volume fraction')) - dyads = OutputMultiPath(File(exists=True), desc=('Mean of PDD distribution' - ' in vector form.')) - dyads_dispersion = OutputMultiPath(File(exists=True), desc=('Dispersion')) + mean_fsamples = OutputMultiPath( + File(exists=True), desc='Mean of distribution on f anisotropy') + mean_S0samples = File( + exists=True, desc='Mean of distribution on T2w baseline signal intensity S0') + mean_phsamples = OutputMultiPath(File(exists=True), desc='Mean of distribution on phi') + mean_thsamples = OutputMultiPath(File(exists=True), + desc='Mean of distribution on theta') + merged_thsamples = OutputMultiPath(File(exists=True), + desc='Samples from the distribution on theta') + merged_phsamples = OutputMultiPath(File(exists=True), + desc=('Samples from the distribution on phi')) + merged_fsamples = OutputMultiPath( + File(exists=True), desc='Samples from the distribution on anisotropic volume fraction') + dyads = OutputMultiPath(File(exists=True), desc='Mean of PDD distribution in vector form.') + dyads_dispersion = OutputMultiPath(File(exists=True), desc='Dispersion') class BEDPOSTX5(FSLXCommand): @@ -310,7 +308,7 @@ class BEDPOSTX5(FSLXCommand): >>> from nipype.interfaces import fsl >>> bedp = fsl.BEDPOSTX5(bvecs='bvecs', bvals='bvals', dwi='diffusion.nii', - ... mask='mask.nii', n_fibres=1) + ... mask='mask.nii', n_fibres=1) >>> bedp.cmdline 'bedpostx bedpostx --forcedir -n 1' @@ -334,63 +332,26 @@ def _cuda_update(self): def _run_interface(self, runtime): - subjectdir = os.path.abspath(self.inputs.out_dir) - if not os.path.exists(subjectdir): + subjectdir = op.abspath(self.inputs.out_dir) + if not op.exists(subjectdir): os.makedirs(subjectdir) _, _, ext = split_filename(self.inputs.mask) copyfile(self.inputs.mask, - os.path.join(subjectdir, + op.join(subjectdir, 'nodif_brain_mask' + ext)) _, _, ext = split_filename(self.inputs.dwi) copyfile(self.inputs.dwi, - os.path.join(subjectdir, 'data' + ext)) + op.join(subjectdir, 'data' + ext)) copyfile(self.inputs.bvals, - os.path.join(subjectdir, 'bvals')) + op.join(subjectdir, 'bvals')) copyfile(self.inputs.bvecs, - os.path.join(subjectdir, 'bvecs')) + op.join(subjectdir, 'bvecs')) retval = super(BEDPOSTX5, self)._run_interface(runtime) self._out_dir = subjectdir + '.bedpostX' return retval - def _post_run(self): - outputs = self.output_spec().get() - n_fibres = self.inputs.n_fibres - - multi_out = ['merged_thsamples', 'merged_fsamples', - 'merged_phsamples', 'mean_phsamples', - 'mean_thsamples', 'mean_fsamples', - 'dyads_dispersion', 'dyads'] - - single_out = ['mean_dsamples', 'mean_S0samples'] - - for k in single_out: - outputs[k] = self._gen_fname(k, cwd=self._out_dir) - - for k in multi_out: - outputs[k] = [] - - for i in range(1, n_fibres + 1): - outputs['merged_thsamples'].append(self._gen_fname('merged_th%dsamples' % i, - cwd=self._out_dir)) - outputs['merged_fsamples'].append(self._gen_fname('merged_f%dsamples' % i, - cwd=self._out_dir)) - outputs['merged_phsamples'].append(self._gen_fname('merged_ph%dsamples' % i, - cwd=self._out_dir)) - - outputs['mean_thsamples'].append(self._gen_fname('mean_th%dsamples' % i, - cwd=self._out_dir)) - outputs['mean_phsamples'].append(self._gen_fname('mean_ph%dsamples' % i, - cwd=self._out_dir)) - outputs['mean_fsamples'].append(self._gen_fname('mean_f%dsamples' % i, - cwd=self._out_dir)) - outputs['dyads'].append(self._gen_fname('dyads%d' % i, - cwd=self._out_dir)) - outputs['dyads_dispersion'].append(self._gen_fname('dyads%d_dispersion' % i, - cwd=self._out_dir)) - return outputs - class XFibres5InputSpec(FSLXCommandInputSpec): gradnonlin = File(exists=True, argstr='--gradnonlin=%s', @@ -413,7 +374,7 @@ class XFibres4InputSpec(FSLCommandInputSpec): gradnonlin = File(exists=True, argstr="--gradnonlin=%s") bvecs = File(exists=True, argstr="--bvecs=%s", mandatory=True) bvals = File(exists=True, argstr="--bvals=%s", mandatory=True) - logdir = Directory("logdir", argstr="--logdir=%s", usedefault=True) + logdir = Directory('logdir', argstr="--logdir=%s", usedefault=True) n_fibres = traits.Range(low=1, argstr="--nfibres=%d", desc="Maximum nukmber of fibres to fit in each voxel") fudge = traits.Int(argstr="--fudge=%d", @@ -466,40 +427,36 @@ class XFibres4(FSLCommand): """ - _cmd = "xfibres" + _cmd = 'xfibres' input_spec = XFibres4InputSpec output_spec = XFibres4OutputSpec def __init__(self, **inputs): - warnings.warn(('Deprecated: Please use XFIBERS5 instead. This ' - 'interface will be removed in version 0.11.'), - DeprecationWarning) + IFLOGGER.warn('Deprecated: Please use XFIBERS5 instead. This ' + 'interface will be removed in version 0.11.') super(XFibres4, self).__init__(**inputs) def _post_run(self): - outputs = self.output_spec().get() - outputs["mean_dsamples"] = self._gen_fname("mean_dsamples", - cwd=self.inputs.logdir) - outputs["mean_S0samples"] = self._gen_fname("mean_S0samples", - cwd=self.inputs.logdir) - outputs["dyads"] = [] - outputs["fsamples"] = [] - outputs["mean_fsamples"] = [] - outputs["phsamples"] = [] - outputs["thsamples"] = [] + self.outputs.mean_dsamples = self._gen_fname('mean_dsamples', + self.inputs.logdir) + self.outputs.mean_S0samples = self._gen_fname('mean_S0samples', + self.inputs.logdir) + self.outputs.dyads = [] + self.outputs.fsamples = [] + self.outputs.mean_fsamples = [] + self.outputs.phsamples = [] + self.outputs.thsamples = [] for i in range(1, self.inputs.n_fibres + 1): - outputs["dyads"].append(self._gen_fname("dyads%d" % i, - cwd=self.inputs.logdir)) - outputs["fsamples"].append(self._gen_fname("f%dsamples" % i, - cwd=self.inputs.logdir)) - outputs["mean_fsamples"].append(self._gen_fname("mean_f%dsamples" % i, - cwd=self.inputs.logdir)) - outputs["phsamples"].append(self._gen_fname("ph%dsamples" % i, - cwd=self.inputs.logdir)) - outputs["thsamples"].append(self._gen_fname("th%dsamples" % i, - cwd=self.inputs.logdir)) - - return outputs + self.outputs.dyads.append(self._gen_fname('dyads%d' % i, + self.inputs.logdir)) + self.outputs.fsamples.append(self._gen_fname('f%dsamples' % i, + self.inputs.logdir)) + self.outputs.mean_fsamples.append(self._gen_fname('mean_f%dsamples' % i, + self.inputs.logdir)) + self.outputs.phsamples.append(self._gen_fname('ph%dsamples' % i, + self.inputs.logdir)) + self.outputs.thsamples.append(self._gen_fname('th%dsamples' % i, + self.inputs.logdir)) class BEDPOSTX4InputSpec(XFibres4InputSpec): @@ -577,32 +534,32 @@ class BEDPOSTX4(FSLCommand): _can_resume = True def __init__(self, **inputs): - warnings.warn(('Deprecated: Please use BEDPOSTX5 or ' - 'create_bedpostx_pipeline instead. This interface will ' - 'be removed in version 0.11.'), DeprecationWarning) + IFLOGGER.warn('Deprecated: Please use BEDPOSTX5 or ' + 'create_bedpostx_pipeline instead. This interface will ' + 'be removed in version 0.11.') super(BEDPOSTX4, self).__init__(**inputs) def _get_bedpostx_dir(self): - return os.path.join(os.getcwd(), self.inputs.bpx_directory) + return op.join(os.getcwd(), self.inputs.bpx_directory) def _run_interface(self, runtime, correct_return_codes=[0]): # create the subject specific bpx_directory bpx_directory = self._get_bedpostx_dir() - if not os.path.exists(bpx_directory): + if not op.exists(bpx_directory): os.makedirs(bpx_directory) _, _, ext = split_filename(self.inputs.mask) shutil.copyfile(self.inputs.mask, - os.path.join(self.inputs.bpx_directory, + op.join(self.inputs.bpx_directory, 'nodif_brain_mask' + ext)) _, _, ext = split_filename(self.inputs.dwi) shutil.copyfile(self.inputs.dwi, - os.path.join(self.inputs.bpx_directory, 'data' + ext)) + op.join(self.inputs.bpx_directory, 'data' + ext)) shutil.copyfile(self.inputs.bvals, - os.path.join(self.inputs.bpx_directory, 'bvals')) + op.join(self.inputs.bpx_directory, 'bvals')) shutil.copyfile(self.inputs.bvecs, - os.path.join(self.inputs.bpx_directory, 'bvecs')) + op.join(self.inputs.bpx_directory, 'bvecs')) runtime = super(BEDPOSTX4, self)._run_interface(runtime, correct_return_codes) @@ -611,43 +568,34 @@ def _run_interface(self, runtime, correct_return_codes=[0]): return runtime def _post_run(self): - outputs = self.output_spec().get() - bpx_directory = self._get_bedpostx_dir() - outputs['bpx_out_directory'] = os.path.join(bpx_directory + '.bedpostX') - outputs['xfms_directory'] = os.path.join(bpx_directory + '.bedpostX', - 'xfms') + bpx_out_dir = op.abspath(self._get_bedpostx_dir() + '.bedpostX') + self.outputs.bpx_out_directory = bpx_out_dir + self.outputs.xfms_directory = op.join(bpx_out_dir, 'xfms') - for k in list(outputs.keys()): - if k not in ('outputtype', 'environ', 'args', 'bpx_out_directory', + for k, _ in list(self.outputs.items()): + if k in ('outputtype', 'environ', 'args', 'bpx_out_directory', 'xfms_directory'): - outputs[k] = [] - - for n in range(self.inputs.fibres): - outputs['merged_thsamples'].append(self._gen_fname( - 'merged_th' + repr(n + 1) + 'samples', - suffix='', cwd=outputs['bpx_out_directory'])) - outputs['merged_phsamples'].append(self._gen_fname( - 'merged_ph' + repr(n + 1) + 'samples', - suffix='', cwd=outputs['bpx_out_directory'])) - outputs['merged_fsamples'].append(self._gen_fname( - 'merged_f' + repr(n + 1) + 'samples', - suffix='', cwd=outputs['bpx_out_directory'])) - outputs['mean_thsamples'].append(self._gen_fname( - 'mean_th' + repr(n + 1) + 'samples', - suffix='', cwd=outputs['bpx_out_directory'])) - outputs['mean_phsamples'].append(self._gen_fname( - 'mean_ph' + repr(n + 1) + 'samples', - suffix='', cwd=outputs['bpx_out_directory'])) - outputs['mean_fsamples'].append(self._gen_fname( - 'mean_f' + repr(n + 1) + 'samples', - suffix='', cwd=outputs['bpx_out_directory'])) - outputs['dyads'].append(self._gen_fname( - 'dyads' + repr(n + 1), - suffix='', cwd=outputs['bpx_out_directory'])) - return outputs - - -if (Info.version() and LooseVersion(Info.version()) >= LooseVersion('5.0.0')): + continue + setattr(self.outputs, k, []) + + for i in [repr(n + 1) for n in range(self.inputs.fibres)]: + self.outputs.merged_thsamples.append( + self._gen_fname('merged_th' + repr(i + 1) + 'samples', bpx_out_dir)) + + self.outputs.merged_phsamples.append(self._gen_fname( + 'merged_ph' + repr(i + 1) + 'samples', bpx_out_dir), suffix='') + self.outputs.merged_fsamples.append(self._gen_fname( + 'merged_f' + repr(i + 1) + 'samples', bpx_out_dir), suffix='') + self.outputs.mean_thsamples.append(self._gen_fname( + 'mean_th' + repr(i + 1) + 'samples', bpx_out_dir), suffix='') + self.outputs.mean_phsamples.append(self._gen_fname( + 'mean_ph' + repr(i + 1) + 'samples', bpx_out_dir), suffix='') + self.outputs.mean_fsamples.append(self._gen_fname( + 'mean_f' + repr(i + 1) + 'samples', bpx_out_dir), suffix='') + self.outputs.dyads.append(self._gen_fname( + 'dyads' + repr(i + 1), bpx_out_dir), suffix='') + +if Info.version() and (LooseVersion(Info.version()) >= LooseVersion('5.0.0')): CurrentXFibres = XFibres5 CurrentBEDPOST = BEDPOSTX5 else: @@ -667,7 +615,7 @@ class ProbTrackXBaseInputSpec(FSLCommandInputSpec): thsamples = InputMultiPath(File(exists=True), mandatory=True) phsamples = InputMultiPath(File(exists=True), mandatory=True) fsamples = InputMultiPath(File(exists=True), mandatory=True) - samples_base_name = traits.Str("merged", desc='the rootname/base_name for samples files', + samples_base_name = traits.Str('merged', desc='the rootname/base_name for samples files', argstr='--samples=%s', usedefault=True) mask = File(exists=True, desc='bet binary mask file in diffusion space', argstr='-m %s', mandatory=True) @@ -732,9 +680,26 @@ class ProbTrackXBaseInputSpec(FSLCommandInputSpec): "Level 2 is required to output particle files.", argstr="--verbose=%d") + def _format_arg(self, name, spec=None, value=None): + if spec is None: + spec = self.traits()[name] + + if value is None: + value = getattr(self, name) + + if name == 'target_masks' and isdefined(value): + fname = 'targets.txt' + return super(ProbTrackXBaseInputSpec, self)._format_arg(name, spec, [fname]) + elif name == 'seed' and isinstance(value, list): + fname = 'seeds.txt' + return super(ProbTrackXBaseInputSpec, self)._format_arg(name, spec, fname) + else: + return super(ProbTrackXBaseInputSpec, self)._format_arg(name, spec, value) + + class ProbTrackXInputSpec(ProbTrackXBaseInputSpec): - mode = traits.Enum("simple", "two_mask_symm", "seedmask", + mode = traits.Enum('simple', 'two_mask_symm', 'seedmask', desc='options: simple (single seed voxel), seedmask (mask of seed voxels), ' + 'twomask_symm (two bet binary masks) ', argstr='--mode=%s', genfile=True) @@ -780,31 +745,31 @@ class ProbTrackX(FSLCommand): output_spec = ProbTrackXOutputSpec def __init__(self, **inputs): - warnings.warn("Deprecated: Please use create_bedpostx_pipeline instead", DeprecationWarning) - return super(ProbTrackX, self).__init__(**inputs) + IFLOGGER.warn('Deprecated: Please use create_bedpostx_pipeline instead') + super(ProbTrackX, self).__init__(**inputs) def _run_interface(self, runtime): for i in range(1, len(self.inputs.thsamples) + 1): _, _, ext = split_filename(self.inputs.thsamples[i - 1]) copyfile(self.inputs.thsamples[i - 1], - self.inputs.samples_base_name + "_th%dsamples" % i + ext, + self.inputs.samples_base_name + '_th%dsamples' % i + ext, copy=False) _, _, ext = split_filename(self.inputs.thsamples[i - 1]) copyfile(self.inputs.phsamples[i - 1], - self.inputs.samples_base_name + "_ph%dsamples" % i + ext, + self.inputs.samples_base_name + '_ph%dsamples' % i + ext, copy=False) _, _, ext = split_filename(self.inputs.thsamples[i - 1]) copyfile(self.inputs.fsamples[i - 1], - self.inputs.samples_base_name + "_f%dsamples" % i + ext, + self.inputs.samples_base_name + '_f%dsamples' % i + ext, copy=False) if isdefined(self.inputs.target_masks): - f = open("targets.txt", "w") + f = open('targets.txt', 'w') for target in self.inputs.target_masks: f.write("%s\n" % target) f.close() if isinstance(self.inputs.seed, list): - f = open("seeds.txt", "w") + f = open('seeds.txt', 'w') for seed in self.inputs.seed: if isinstance(seed, list): f.write("%s\n" % (" ".join([str(s) for s in seed]))) @@ -817,59 +782,48 @@ def _run_interface(self, runtime): self.raise_exception(runtime) return runtime - def _format_arg(self, name, spec, value): - if name == 'target_masks' and isdefined(value): - fname = "targets.txt" - return super(ProbTrackX, self)._format_arg(name, spec, [fname]) - elif name == 'seed' and isinstance(value, list): - fname = "seeds.txt" - return super(ProbTrackX, self)._format_arg(name, spec, fname) - else: - return super(ProbTrackX, self)._format_arg(name, spec, value) def _post_run(self): - outputs = self.output_spec().get() if not isdefined(self.inputs.out_dir): - out_dir = self._gen_filename("out_dir") + out_dir = self._gen_filename('out_dir') else: out_dir = self.inputs.out_dir - outputs['log'] = os.path.abspath(os.path.join(out_dir, 'probtrackx.log')) - # utputs['way_total'] = os.path.abspath(os.path.join(out_dir, 'waytotal')) + self.outputs.log = op.abspath(op.join(out_dir, 'probtrackx.log')) + # utputs['way_total'] = op.abspath(op.join(out_dir, 'waytotal')) if isdefined(self.inputs.opd is True): if isinstance(self.inputs.seed, list) and isinstance(self.inputs.seed[0], list): - outputs['fdt_paths'] = [] + self.outputs.fdt_paths = [] for seed in self.inputs.seed: - outputs['fdt_paths'].append( - os.path.abspath( - self._gen_fname("fdt_paths_%s" % ("_".join([str(s) for s in seed])), - cwd=out_dir, suffix=''))) + self.outputs.fdt_paths.append( + op.abspath( + self._gen_fname('fdt_paths_%s' % ('_'.join([str(s) for s in seed])), + out_dir, suffix=''))) else: - outputs['fdt_paths'] = os.path.abspath(self._gen_fname("fdt_paths", - cwd=out_dir, suffix='')) + self.outputs.fdt_paths = op.abspath(self._gen_fname('fdt_paths', + out_dir, suffix='')) # handle seeds-to-target output files if isdefined(self.inputs.target_masks): - outputs['targets'] = [] + self.outputs.targets = [] for target in self.inputs.target_masks: - outputs['targets'].append(os.path.abspath( - self._gen_fname('seeds_to_' + os.path.split(target)[1], - cwd=out_dir, + self.outputs.targets.append(op.abspath( + self._gen_fname('seeds_to_' + op.split(target)[1], + out_dir, suffix=''))) if isdefined(self.inputs.verbose) and self.inputs.verbose == 2: - outputs['particle_files'] = [os.path.abspath( - os.path.join(out_dir, 'particle%d' % i)) + self.outputs.particle_files = [op.abspath( + op.join(out_dir, 'particle%d' % i)) for i in range(self.inputs.n_samples)] - return outputs def _gen_filename(self, name): - if name == "out_dir": + if name == 'out_dir': return os.getcwd() - elif name == "mode": + elif name == 'mode': if isinstance(self.inputs.seed, list) and isinstance(self.inputs.seed[0], list): - return "simple" + return 'simple' else: - return "seedmask" + return 'seedmask' class ProbTrackX2InputSpec(ProbTrackXBaseInputSpec): @@ -877,8 +831,8 @@ class ProbTrackX2InputSpec(ProbTrackXBaseInputSpec): usedefault=False, argstr='--simple') fopd = File(exists=True, desc='Other mask for binning tract distribution', argstr='--fopd=%s') - waycond = traits.Enum("OR", "AND", argstr='--waycond=%s', - desc='Waypoint condition. Either "AND" (default) or "OR"') + waycond = traits.Enum('OR', 'AND', argstr='--waycond=%s', + desc='Waypoint condition. Either \'AND\' (default) or \'OR\'') wayorder = traits.Bool(desc='Reject streamlines that do not hit waypoints in given order. ' + 'Only valid if waycond=AND', argstr='--wayorder') onewaycondition = traits.Bool(desc='Apply waypoint conditions to each half tract separately', @@ -905,9 +859,9 @@ class ProbTrackX2InputSpec(ProbTrackXBaseInputSpec): colmask4 = File(exists=True, desc='Mask for columns of matrix4 (default=seed mask)', argstr='--colmask4=%s') target4 = File(exists=True, desc='Brain mask in DTI space', argstr='--target4=%s') - meshspace = traits.Enum("caret", "freesurfer", "first", "vox", argstr='--meshspace=%s', - desc='Mesh reference space - either "caret" (default) or ' + - '"freesurfer" or "first" or "vox"') + meshspace = traits.Enum('caret', 'freesurfer', 'first', 'vox', argstr='--meshspace=%s', + desc='Mesh reference space - either \'caret\' (default) or ' + + '\'freesurfer\' or \'first\' or \'vox\'') class ProbTrackX2OutputSpec(ProbTrackXOutputSpec): @@ -950,17 +904,16 @@ def _post_run(self): out_dir = self.inputs.out_dir if isdefined(self.inputs.omatrix1): - outputs['network_matrix'] = os.path.abspath(os.path.join(out_dir, 'fdt_network_matrix')) - outputs['matrix1_dot'] = os.path.abspath(os.path.join(out_dir, 'fdt_matrix1.dot')) + self.outputs.network_matrix = op.abspath(op.join(out_dir, 'fdt_network_matrix')) + self.outputs.matrix1_dot = op.abspath(op.join(out_dir, 'fdt_matrix1.dot')) if isdefined(self.inputs.omatrix2): - outputs['lookup_tractspace'] = \ - os.path.abspath(os.path.join(out_dir, 'lookup_tractspace_fdt_matrix2.nii.gz')) - outputs['matrix2_dot'] = os.path.abspath(os.path.join(out_dir, 'fdt_matrix2.dot')) + self.outputs.lookup_tractspace = \ + op.abspath(op.join(out_dir, 'lookup_tractspace_fdt_matrix2.nii.gz')) + self.outputs.matrix2_dot = op.abspath(op.join(out_dir, 'fdt_matrix2.dot')) if isdefined(self.inputs.omatrix3): - outputs['matrix3_dot'] = os.path.abspath(os.path.join(out_dir, 'fdt_matrix3.dot')) - return outputs + self.outputs.matrix3_dot = op.abspath(op.join(out_dir, 'fdt_matrix3.dot')) class VecRegInputSpec(FSLCommandInputSpec): @@ -980,7 +933,7 @@ class VecRegInputSpec(FSLCommandInputSpec): rotation_warp = File(exists=True, argstr='--rotwarp=%s', desc='filename for secondary warp field' + 'if set, this will be used for the rotation of the vector/tensor field') - interpolation = traits.Enum("nearestneighbour", "trilinear", "sinc", "spline", + interpolation = traits.Enum('nearestneighbour', 'trilinear', 'sinc', 'spline', argstr='--interp=%s', desc='interpolation method : ' + 'nearestneighbour, trilinear (default), sinc or spline') @@ -1017,20 +970,18 @@ class VecReg(FSLCommand): def _run_interface(self, runtime): if not isdefined(self.inputs.out_file): - pth, base_name = os.path.split(self.inputs.in_file) - self.inputs.out_file = self._gen_fname(base_name, cwd=os.path.abspath(pth), + pth, base_name = op.split(self.inputs.in_file) + self.inputs.out_file = self._gen_fname(base_name, op.abspath(pth), suffix='_vreg') return super(VecReg, self)._run_interface(runtime) def _post_run(self): - outputs = self.output_spec().get() - outputs['out_file'] = self.inputs.out_file - if not isdefined(outputs['out_file']) and isdefined(self.inputs.in_file): - pth, base_name = os.path.split(self.inputs.in_file) - outputs['out_file'] = self._gen_fname(base_name, cwd=os.path.abspath(pth), + self.outputs.out_file = self.inputs.out_file + if not isdefined(self.outputs.out_file) and isdefined(self.inputs.in_file): + pth, base_name = op.split(self.inputs.in_file) + self.outputs.out_file = self._gen_fname(base_name, op.abspath(pth), suffix='_vreg') - outputs['out_file'] = os.path.abspath(outputs['out_file']) - return outputs + self.outputs.out_file = op.abspath(self.outputs.out_file) def _gen_filename(self, name): if name is 'out_file': @@ -1073,14 +1024,12 @@ class ProjThresh(FSLCommand): output_spec = ProjThreshOuputSpec def _post_run(self): - outputs = self.output_spec().get() - outputs['out_files'] = [] + self.outputs.out_files = [] for name in self.inputs.in_files: - cwd, base_name = os.path.split(name) - outputs['out_files'].append(self._gen_fname(base_name, cwd=cwd, + cwd, base_name = op.split(name) + self.outputs.out_files.append(self._gen_fname(base_name, cwd, suffix='_proj_seg_thr_' + repr(self.inputs.threshold))) - return outputs class FindTheBiggestInputSpec(FSLCommandInputSpec): @@ -1122,12 +1071,10 @@ def _run_interface(self, runtime): return super(FindTheBiggest, self)._run_interface(runtime) def _post_run(self): - outputs = self.output_spec().get() - outputs['out_file'] = self.inputs.out_file - if not isdefined(outputs['out_file']): - outputs['out_file'] = self._gen_fname('biggestSegmentation', suffix='') - outputs['out_file'] = os.path.abspath(outputs['out_file']) - return outputs + self.outputs.out_file = self.inputs.out_file + if not isdefined(self.outputs.out_file): + self.outputs.out_file = self._gen_fname('biggestSegmentation', suffix='') + self.outputs.out_file = op.abspath(self.outputs.out_file) def _gen_filename(self, name): if name is 'out_file': @@ -1140,15 +1087,15 @@ class TractSkeletonInputSpec(FSLCommandInputSpec): in_file = File(exists=True, mandatory=True, argstr="-i %s", desc="input image (typcially mean FA volume)") - _proj_inputs = ["threshold", "distance_map", "data_file"] + _proj_inputs = ['threshold', 'distance_map', 'data_file'] project_data = traits.Bool(argstr="-p %.3f %s %s %s %s", requires=_proj_inputs, desc="project data onto skeleton") threshold = traits.Float(desc="skeleton threshold value") distance_map = File(exists=True, desc="distance map image") - search_mask_file = File(exists=True, xor=["use_cingulum_mask"], + search_mask_file = File(exists=True, xor=['use_cingulum_mask'], desc="mask in which to use alternate search rule") use_cingulum_mask = traits.Bool(True, usedefault=True, - xor=["search_mask_file"], + xor=['search_mask_file'], desc="perform alternate search using built-in cingulum mask") data_file = File(exists=True, desc="4D data to project onto skeleton (usually FA)") alt_data_file = File(exists=True, argstr="-a %s", desc="4D non-FA data to project onto skeleton") @@ -1179,58 +1126,56 @@ class TractSkeleton(FSLCommand): >>> import nipype.interfaces.fsl as fsl >>> skeletor = fsl.TractSkeleton() - >>> skeletor.inputs.in_file = "all_FA.nii.gz" + >>> skeletor.inputs.in_file = 'all_FA.nii.gz' >>> skeletor.inputs.skeleton_file = True >>> skeletor.run() # doctest: +SKIP """ - _cmd = "tbss_skeleton" + _cmd = 'tbss_skeleton' input_spec = TractSkeletonInputSpec output_spec = TractSkeletonOutputSpec def _format_arg(self, name, spec, value): - if name == "project_data": + if name == 'project_data': if isdefined(value) and value: _si = self.inputs if isdefined(_si.use_cingulum_mask) and _si.use_cingulum_mask: - mask_file = Info.standard_image("LowerCingulum_1mm.nii.gz") + mask_file = Info.standard_image('LowerCingulum_1mm.nii.gz') else: mask_file = _si.search_mask_file if not isdefined(_si.projected_data): - proj_file = self._post_run()["projected_data"] + proj_file = self.outputs.projected_data else: proj_file = _si.projected_data return spec.argstr % (_si.threshold, _si.distance_map, mask_file, _si.data_file, proj_file) - elif name == "skeleton_file": + elif name == 'skeleton_file': if isinstance(value, bool): - return spec.argstr % self._post_run()["skeleton_file"] + return spec.argstr % self.outputs.skeleton_file else: return spec.argstr % value return super(TractSkeleton, self)._format_arg(name, spec, value) def _post_run(self): - outputs = self.output_spec().get() _si = self.inputs if isdefined(_si.project_data) and _si.project_data: proj_data = _si.projected_data - outputs["projected_data"] = proj_data + self.outputs.projected_data = proj_data if not isdefined(proj_data): stem = _si.data_file if isdefined(_si.alt_data_file): stem = _si.alt_data_file - outputs["projected_data"] = fname_presuffix(stem, - suffix="_skeletonised", + self.outputs.projected_data = fname_presuffix(stem, + suffix='_skeletonised', newpath=os.getcwd(), use_ext=True) if isdefined(_si.skeleton_file) and _si.skeleton_file: - outputs["skeleton_file"] = _si.skeleton_file + self.outputs.skeleton_file = _si.skeleton_file if isinstance(_si.skeleton_file, bool): - outputs["skeleton_file"] = fname_presuffix(_si.in_file, - suffix="_skeleton", + self.outputs.skeleton_file = fname_presuffix(_si.in_file, + suffix='_skeleton', newpath=os.getcwd(), use_ext=True) - return outputs class DistanceMapInputSpec(FSLCommandInputSpec): @@ -1259,56 +1204,54 @@ class DistanceMap(FSLCommand): >>> import nipype.interfaces.fsl as fsl >>> mapper = fsl.DistanceMap() - >>> mapper.inputs.in_file = "skeleton_mask.nii.gz" + >>> mapper.inputs.in_file = 'skeleton_mask.nii.gz' >>> mapper.run() # doctest: +SKIP """ - _cmd = "distancemap" + _cmd = 'distancemap' input_spec = DistanceMapInputSpec output_spec = DistanceMapOutputSpec def _format_arg(self, name, spec, value): - if name == "local_max_file": + if name == 'local_max_file': if isinstance(value, bool): - return spec.argstr % self._post_run()["local_max_file"] + return spec.argstr % self.outputs.local_max_file return super(DistanceMap, self)._format_arg(name, spec, value) def _post_run(self): - outputs = self.output_spec().get() _si = self.inputs - outputs["distance_map"] = _si.distance_map + self.outputs.distance_map = _si.distance_map if not isdefined(_si.distance_map): - outputs["distance_map"] = fname_presuffix(_si.in_file, - suffix="_dstmap", + self.outputs.distance_map = fname_presuffix(_si.in_file, + suffix='_dstmap', use_ext=True, newpath=os.getcwd()) - outputs["distance_map"] = os.path.abspath(outputs["distance_map"]) + self.outputs.distance_map = op.abspath(self.outputs.distance_map) if isdefined(_si.local_max_file): - outputs["local_max_file"] = _si.local_max_file + self.outputs.local_max_file = _si.local_max_file if isinstance(_si.local_max_file, bool): - outputs["local_max_file"] = fname_presuffix(_si.in_file, - suffix="_lclmax", + self.outputs.local_max_file = fname_presuffix(_si.in_file, + suffix='_lclmax', use_ext=True, newpath=os.getcwd()) - outputs["local_max_file"] = os.path.abspath(outputs["local_max_file"]) - return outputs + self.outputs.local_max_file = op.abspath(self.outputs.local_max_file) def _gen_filename(self, name): - if name == "distance_map": - return self._post_run()["distance_map"] + if name == 'distance_map': + return self.outputs.distance_map return None class MakeDyadicVectorsInputSpec(FSLCommandInputSpec): - theta_vol = File(exists=True, mandatory=True, position=0, argstr="%s") - phi_vol = File(exists=True, mandatory=True, position=1, argstr="%s") - mask = File(exists=True, position=2, argstr="%s") - output = File("dyads", position=3, usedefault=True, argstr="%s", hash_files=False) + theta_vol = File(exists=True, mandatory=True, position=0, argstr='%s') + phi_vol = File(exists=True, mandatory=True, position=1, argstr='%s') + mask = File(exists=True, position=2, argstr='%s') + output = File('dyads', position=3, usedefault=True, argstr='%s', hash_files=False) perc = traits.Float(desc="the {perc}% angle of the output cone of \ uncertainty (output will be in degrees)", position=4, - argstr="%f") + argstr='%f') class MakeDyadicVectorsOutputSpec(TraitedSpec): @@ -1320,14 +1263,12 @@ class MakeDyadicVectors(FSLCommand): """Create vector volume representing mean principal diffusion direction and its uncertainty (dispersion)""" - _cmd = "make_dyadic_vectors" + _cmd = 'make_dyadic_vectors' input_spec = MakeDyadicVectorsInputSpec output_spec = MakeDyadicVectorsOutputSpec def _post_run(self): - outputs = self.output_spec().get() - outputs["dyads"] = self._gen_fname(self.inputs.output) - outputs["dispersion"] = self._gen_fname(self.inputs.output, - suffix="_dispersion") + self.outputs.dyads = self._gen_fname(self.inputs.output) + self.outputs.dispersion = self._gen_fname(self.inputs.output, + suffix='_dispersion') - return outputs diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index 9371eef108..26a61c6d8a 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -92,28 +92,26 @@ class BETInputSpec(FSLCommandInputSpec): class BETOutputSpec(TraitedSpec): - out_file = File( - desc="path/name of skullstripped file (if generated)") - mask_file = File( - desc="path/name of binary brain mask (if generated)") - outline_file = File( - desc="path/name of outline file (if generated)") - meshfile = File( - desc="path/name of vtk mesh file (if generated)") - inskull_mask_file = File( - desc="path/name of inskull mask (if generated)") - inskull_mesh_file = File( - desc="path/name of inskull mesh outline (if generated)") - outskull_mask_file = File( - desc="path/name of outskull mask (if generated)") - outskull_mesh_file = File( - desc="path/name of outskull mesh outline (if generated)") - outskin_mask_file = File( - desc="path/name of outskin mask (if generated)") - outskin_mesh_file = File( - desc="path/name of outskin mesh outline (if generated)") - skull_mask_file = File( - desc="path/name of skull mask (if generated)") + out_file = File(desc="path/name of skullstripped file") + mask_file = File(name_source='in_file', name_template='%s_mask', + desc="path/name of binary brain mask") + meshfile = File(name_source='in_file', name_template='%s_mesh.vtk', + keep_extension=False, desc="path/name of vtk mesh file") + outline_file = File(name_source='in_file', name_template='%s_overlay', + desc="path/name of outline file") + inskull_mask_file = File(name_source='in_file', name_template='%s_inskull_mask', + desc="path/name of inskull mask") + inskull_mesh_file = File(name_source='in_file', name_template='%s_inskull_mesh.vtk', + keep_extension=False, desc="path/name of inskull mesh outline") + outskull_mask_file = File(name_source='in_file', name_template='%s_outskull_mask', + desc="path/name of outskull mask") + outskull_mesh_file = File(name_source='in_file', name_template='%s_outskull_mesh.vtk', + keep_extension=False, desc="path/name of outskull mesh outline") + outskin_mask_file = File(name_source='in_file', name_template='%s_outskin_mask', + desc="path/name of outskin mask") + outskin_mesh_file = File(name_source='in_file', name_template='%s_outskin_mesh.vtk', + keep_extension=False, desc="path/name of outskin mesh outline") + skull_mask_file = File(desc="path/name of skull mask") class BET(FSLCommand): @@ -146,55 +144,6 @@ def _run_interface(self, runtime): self.raise_exception(runtime) return runtime - def _gen_outfilename(self): - out_file = self.inputs.out_file - if not isdefined(out_file) and isdefined(self.inputs.in_file): - out_file = self._gen_fname(self.inputs.in_file, - suffix='_brain') - return os.path.abspath(out_file) - - def _list_outputs(self): - outputs = self.output_spec().get() - outputs['out_file'] = self._gen_outfilename() - if ((isdefined(self.inputs.mesh) and self.inputs.mesh) or - (isdefined(self.inputs.surfaces) and self.inputs.surfaces)): - outputs['meshfile'] = self._gen_fname(outputs['out_file'], - suffix='_mesh.vtk', - change_ext=False) - if (isdefined(self.inputs.mask) and self.inputs.mask) or \ - (isdefined(self.inputs.reduce_bias) and - self.inputs.reduce_bias): - outputs['mask_file'] = self._gen_fname(outputs['out_file'], - suffix='_mask') - if isdefined(self.inputs.outline) and self.inputs.outline: - outputs['outline_file'] = self._gen_fname(outputs['out_file'], - suffix='_overlay') - if isdefined(self.inputs.surfaces) and self.inputs.surfaces: - outputs['inskull_mask_file'] = self._gen_fname(outputs['out_file'], - suffix='_inskull_mask') - outputs['inskull_mesh_file'] = self._gen_fname(outputs['out_file'], - suffix='_inskull_mesh') - outputs[ - 'outskull_mask_file'] = self._gen_fname(outputs['out_file'], - suffix='_outskull_mask') - outputs[ - 'outskull_mesh_file'] = self._gen_fname(outputs['out_file'], - suffix='_outskull_mesh') - outputs['outskin_mask_file'] = self._gen_fname(outputs['out_file'], - suffix='_outskin_mask') - outputs['outskin_mesh_file'] = self._gen_fname(outputs['out_file'], - suffix='_outskin_mesh') - outputs['skull_mask_file'] = self._gen_fname(outputs['out_file'], - suffix='_skull_mask') - if isdefined(self.inputs.no_output) and self.inputs.no_output: - outputs['out_file'] = Undefined - return outputs - - def _gen_filename(self, name): - if name == 'out_file': - return self._gen_outfilename() - return None - class FASTInputSpec(FSLCommandInputSpec): """ Defines inputs (trait classes) for FAST """ @@ -267,6 +216,15 @@ class FASTInputSpec(FSLCommandInputSpec): probability_maps = traits.Bool(desc='outputs individual probability maps', argstr='-p') + def _format_arg(self, name, spec, value): + # first do what should be done in general + formatted = super(FASTInputSpec, self)._format_arg(name, spec, value) + if name == 'in_files': + # FAST needs the -S parameter value to correspond to the number + # of input images, otherwise it will ignore all but the first + formatted = "-S %d %s" % (len(value), formatted) + return formatted + class FASTOutputSpec(TraitedSpec): """Specify possible outputs from FAST""" @@ -311,16 +269,8 @@ class FAST(FSLCommand): input_spec = FASTInputSpec output_spec = FASTOutputSpec - def _format_arg(self, name, spec, value): - # first do what should be done in general - formated = super(FAST, self)._format_arg(name, spec, value) - if name == 'in_files': - # FAST needs the -S parameter value to correspond to the number - # of input images, otherwise it will ignore all but the first - formated = "-S %d %s" % (len(value), formated) - return formated + def _post_run(self): - def _list_outputs(self): outputs = self.output_spec().get() if not isdefined(self.inputs.number_classes): nclasses = 3 @@ -510,6 +460,14 @@ class FLIRTInputSpec(FSLCommandInputSpec): argstr='-bbrslope %f', min_ver='5.0.0', desc='value of bbr slope') + def _parse_inputs(self, skip=None): + skip = [] + if isdefined(self.inputs.save_log) and self.inputs.save_log: + if not isdefined(self.inputs.verbose) or self.inputs.verbose == 0: + self.inputs.verbose = 1 + skip.append('save_log') + return super(FLIRTInputSpec, self)._parse_inputs(skip=skip) + class FLIRTOutputSpec(TraitedSpec): out_file = File(exists=True, @@ -546,21 +504,15 @@ class FLIRT(FSLCommand): input_spec = FLIRTInputSpec output_spec = FLIRTOutputSpec - def aggregate_outputs(self, runtime=None, needed_outputs=None): - outputs = super(FLIRT, self).aggregate_outputs( - runtime=runtime, needed_outputs=needed_outputs) + def _run_interface(self, runtime, **kwargs): + runtime = super(FLIRT, self)._run_interface(runtime, **kwargs) + if isdefined(self.inputs.save_log) and self.inputs.save_log: - with open(outputs.out_log, "a") as text_file: + with open(self.inputs.out_log, "a") as text_file: text_file.write(runtime.stdout + '\n') - return outputs - def _parse_inputs(self, skip=None): - skip = [] - if isdefined(self.inputs.save_log) and self.inputs.save_log: - if not isdefined(self.inputs.verbose) or self.inputs.verbose == 0: - self.inputs.verbose = 1 - skip.append('save_log') - return super(FLIRT, self)._parse_inputs(skip=skip) + return runtime + class ApplyXfmInputSpec(FLIRTInputSpec): @@ -633,6 +585,13 @@ class MCFLIRTInputSpec(FSLCommandInputSpec): ref_file = File(exists=True, argstr='-reffile %s', desc="target image for motion correction") + def _format_arg(self, name, spec, value): + if name == "interpolation": + if value == "trilinear": + return "" + else: + return spec.argstr % value + return super(MCFLIRTInputSpec, self)._format_arg(name, spec, value) class MCFLIRTOutputSpec(TraitedSpec): out_file = File(exists=True, desc="motion-corrected timeseries") @@ -664,18 +623,9 @@ class MCFLIRT(FSLCommand): input_spec = MCFLIRTInputSpec output_spec = MCFLIRTOutputSpec - def _format_arg(self, name, spec, value): - if name == "interpolation": - if value == "trilinear": - return "" - else: - return spec.argstr % value - return super(MCFLIRT, self)._format_arg(name, spec, value) + def _post_run(self): - def _list_outputs(self): cwd = os.getcwd() - outputs = self._outputs().get() - outputs['out_file'] = self._gen_outfilename() if isdefined(self.inputs.stats_imgs) and self.inputs.stats_imgs: @@ -891,7 +841,8 @@ class FNIRT(FSLCommand): 'log_file': 'log.txt', 'fieldcoeff_file': 'fieldwarp'} - def _list_outputs(self): + def _post_run(self): + outputs = self.output_spec().get() for key, suffix in list(self.filemap.items()): inval = getattr(self.inputs, key) @@ -1007,8 +958,8 @@ def _format_arg(self, name, spec, value): return spec.argstr % str(value) return super(ApplyWarp, self)._format_arg(name, spec, value) - def _list_outputs(self): - outputs = self._outputs().get() + def _post_run(self): + if not isdefined(self.inputs.out_file): outputs['out_file'] = self._gen_fname(self.inputs.in_file, suffix='_warp') @@ -1067,8 +1018,8 @@ class SliceTimer(FSLCommand): input_spec = SliceTimerInputSpec output_spec = SliceTimerOutputSpec - def _list_outputs(self): - outputs = self._outputs().get() + def _post_run(self): + out_file = self.inputs.out_file if not isdefined(out_file): out_file = self._gen_fname(self.inputs.in_file, @@ -1146,8 +1097,8 @@ def _format_arg(self, name, spec, value): return ' '.join(arglist) return super(SUSAN, self)._format_arg(name, spec, value) - def _list_outputs(self): - outputs = self._outputs().get() + def _post_run(self): + out_file = self.inputs.out_file if not isdefined(out_file): out_file = self._gen_fname(self.inputs.in_file, @@ -1455,8 +1406,8 @@ def __init__(self, **kwargs): super(PRELUDE, self).__init__(**kwargs) warn('This has not been fully tested. Please report any failures.') - def _list_outputs(self): - outputs = self._outputs().get() + def _post_run(self): + out_file = self.inputs.unwrapped_phase_file if not isdefined(out_file): if isdefined(self.inputs.phase_file): @@ -1546,7 +1497,8 @@ class FIRST(FSLCommand): input_spec = FIRSTInputSpec output_spec = FIRSTOutputSpec - def _list_outputs(self): + def _post_run(self): + outputs = self.output_spec().get() if isdefined(self.inputs.list_of_specific_structures): diff --git a/nipype/interfaces/specs.py b/nipype/interfaces/specs.py index 76097a1b6b..a1aee0e8e6 100644 --- a/nipype/interfaces/specs.py +++ b/nipype/interfaces/specs.py @@ -87,6 +87,12 @@ def items(self): for name in sorted(self.copyable_trait_names()): yield name, self.traits()[name] + def namesource_items(self): + """Get inputs that will generate outputs""" + meta = dict(name_source=lambda t: t is not None) + meta_ns = dict(ns=lambda t: t is not None) + return list(self.traits(**meta).items()) + list(self.traits(**meta_ns).items()) + def _check_deprecated(self, name, new): """ Generate a warning when a deprecated trait is set """ if isdefined(new): @@ -186,6 +192,40 @@ def _clean_container(self, obj, undefinedval=None, skipundefined=False): out = undefinedval return out + def format_ns(self, source_names, out_name, source_traits=None): + if source_traits is None: + source_traits = self + + if isinstance(source_names, string_types): + source_names = [source_names] + + values = [None] * len(source_names) + + ext = '' + for i, srcname in enumerate(source_names): + src_value = getattr(self, srcname) + + if isinstance(source_traits.traits()[srcname], File): + _, src_value, ext = split_filename(src_value) + values[i] = src_value + + out_spec = self.traits()[out_name] + keep_ext = not isdefined(out_spec.keep_extension) or out_spec.keep_extension + name_template = out_spec.name_template + if name_template is None: + name_template = '%s_generated' + + retval = name_template % tuple(values) + if isinstance(out_spec, File): + if keep_ext: + retval += ext + else: + retval = self._overload_extension(retval) + return retval + + def _overload_extension(self, value, name=None): + return value + def get_hashval(self, hash_method=None): """Return a dictionary of our items with hashes for each file. @@ -257,6 +297,8 @@ def _get_trait_desc(self, name, spec=None): requires = spec.requires argstr = spec.argstr name_source = spec.name_source + if name_source is None: + name_source = spec.ns manhelpstr = ['\t%s' % name] @@ -351,11 +393,6 @@ def optional_items(self): pass return allitems - def namesource_items(self): - """Get inputs that will generate outputs""" - metadata = dict(name_source=lambda t: t is not None) - return list(self.traits(**metadata).items()) - def _check_xor(self, obj, name, old, new): """ Checks inputs with xor list """ IFLOGGER.error('Called check_xorg with name %s' % name) @@ -512,9 +549,6 @@ def get_filecopy_info(self): info.append(dict(key=name, copy=spec.copyfile)) return info - def _overload_extension(self, value, name=None): - return value - def check_version(self, version, raise_exception=True): """ Raises an exception on version mismatch""" unavailable_traits = [] From 945fc3be8ee00592ad5b5dedfe51e5a95b9b7400 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 17 Feb 2016 08:40:58 -0800 Subject: [PATCH 23/73] replace old outputs references --- nipype/interfaces/afni/preprocess.py | 24 +-- nipype/interfaces/ants/legacy.py | 20 +- nipype/interfaces/ants/registration.py | 60 +++--- nipype/interfaces/ants/resampling.py | 8 +- nipype/interfaces/ants/segmentation.py | 42 ++-- nipype/interfaces/ants/utils.py | 10 +- nipype/interfaces/ants/visualization.py | 4 +- nipype/interfaces/camino/calib.py | 8 +- nipype/interfaces/camino/connectivity.py | 4 +- nipype/interfaces/camino/convert.py | 24 +-- nipype/interfaces/camino/dti.py | 20 +- nipype/interfaces/camino/odf.py | 8 +- nipype/interfaces/camino/utils.py | 2 +- nipype/interfaces/camino2trackvis/convert.py | 4 +- nipype/interfaces/cmtk/cmtk.py | 78 +++---- nipype/interfaces/cmtk/convert.py | 4 +- nipype/interfaces/cmtk/nbs.py | 6 +- nipype/interfaces/cmtk/nx.py | 36 ++-- nipype/interfaces/cmtk/parcellation.py | 18 +- nipype/interfaces/dcm2nii.py | 10 +- nipype/interfaces/dcmstack.py | 10 +- nipype/interfaces/diffusion_toolkit/dti.py | 28 +-- nipype/interfaces/diffusion_toolkit/odf.py | 14 +- .../interfaces/diffusion_toolkit/postproc.py | 4 +- nipype/interfaces/dipy/preprocess.py | 4 +- nipype/interfaces/dipy/simulate.py | 8 +- nipype/interfaces/dipy/tensors.py | 4 +- nipype/interfaces/dipy/tracks.py | 2 +- nipype/interfaces/elastix/registration.py | 26 +-- nipype/interfaces/elastix/utils.py | 2 +- nipype/interfaces/freesurfer/model.py | 60 +++--- nipype/interfaces/freesurfer/preprocess.py | 42 ++-- nipype/interfaces/freesurfer/utils.py | 46 ++-- nipype/interfaces/fsl/epi.py | 60 +++--- nipype/interfaces/fsl/maths.py | 6 +- nipype/interfaces/fsl/model.py | 146 ++++++------- nipype/interfaces/fsl/preprocess.py | 67 +++--- nipype/interfaces/fsl/utils.py | 72 +++---- nipype/interfaces/io.py | 4 +- nipype/interfaces/meshfix.py | 6 +- nipype/interfaces/minc/minc.py | 62 +++--- nipype/interfaces/mne/base.py | 2 +- nipype/interfaces/mrtrix/convert.py | 2 +- nipype/interfaces/mrtrix/preprocess.py | 74 +++---- nipype/interfaces/mrtrix/tensors.py | 26 +-- nipype/interfaces/mrtrix/tracking.py | 8 +- nipype/interfaces/mrtrix3/connectivity.py | 4 +- nipype/interfaces/mrtrix3/preprocess.py | 8 +- nipype/interfaces/mrtrix3/reconst.py | 4 +- nipype/interfaces/mrtrix3/tracking.py | 2 +- nipype/interfaces/mrtrix3/utils.py | 10 +- nipype/interfaces/nipy/model.py | 24 +-- nipype/interfaces/nipy/preprocess.py | 18 +- nipype/interfaces/nipy/utils.py | 2 +- nipype/interfaces/nitime/analysis.py | 12 +- nipype/interfaces/petpvc.py | 8 +- nipype/interfaces/spm/model.py | 28 +-- nipype/interfaces/spm/preprocess.py | 204 +++++++++--------- nipype/interfaces/spm/utils.py | 30 +-- nipype/interfaces/utility.py | 6 +- nipype/pipeline/engine/tests/test_join.py | 18 +- nipype/pipeline/engine/tests/test_utils.py | 2 +- nipype/pipeline/plugins/tests/test_debug.py | 2 +- nipype/pipeline/plugins/tests/test_linear.py | 2 +- .../pipeline/plugins/tests/test_multiproc.py | 2 +- nipype/pipeline/plugins/tests/test_oar.py | 2 +- nipype/pipeline/plugins/tests/test_pbs.py | 2 +- .../pipeline/plugins/tests/test_somaflow.py | 2 +- 68 files changed, 783 insertions(+), 784 deletions(-) diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index 631c857219..420c045c51 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -209,7 +209,7 @@ class Refit(AFNICommandBase): def _list_outputs(self): outputs = self.output_spec().get() - outputs["out_file"] = os.path.abspath(self.inputs.in_file) + self.outputs.out_file = os.path.abspath(self.inputs.in_file) return outputs @@ -1164,10 +1164,10 @@ def _format_arg(self, name, trait_spec, value): def _list_outputs(self): outputs = self.output_spec().get() if not isdefined(self.inputs.out_file): - outputs['out_file'] = self._gen_filename(self.inputs.in_file, + self.outputs.out_file = self._gen_filename(self.inputs.in_file, suffix=self.inputs.suffix) else: - outputs['out_file'] = os.path.abspath(self.inputs.out_file) + self.outputs.out_file = os.path.abspath(self.inputs.out_file) return outputs def _gen_filename(self, name): @@ -2195,9 +2195,9 @@ def _parse_inputs(self, skip=None): def _list_outputs(self): outputs = super(Hist, self)._list_outputs() - outputs['out_file'] += '.niml.hist' + self.outputs.out_file += '.niml.hist' if not self.inputs.showhist: - outputs['out_show'] = Undefined + self.outputs.out_show = Undefined return outputs @@ -2394,18 +2394,18 @@ def _list_outputs(self): if '.gz' in ext: _, ext2 = op.splitext(fname) ext = ext2 + ext - outputs['out_detrend'] += ext + self.outputs.out_detrend += ext else: - outputs['out_detrend'] = Undefined + self.outputs.out_detrend = Undefined - sout = np.loadtxt(outputs['out_file']) #pylint: disable=E1101 + sout = np.loadtxt(self.outputs.out_file) #pylint: disable=E1101 if self._acf: - outputs['acf_param'] = tuple(sout[1]) + self.outputs.acf_param = tuple(sout[1]) sout = tuple(sout[0]) - outputs['out_acf'] = op.abspath('3dFWHMx.1D') + self.outputs.out_acf = op.abspath('3dFWHMx.1D') if isinstance(self.inputs.acf, string_types): - outputs['out_acf'] = op.abspath(self.inputs.acf) + self.outputs.out_acf = op.abspath(self.inputs.acf) - outputs['fwhm'] = tuple(sout) + self.outputs.fwhm = tuple(sout) return outputs diff --git a/nipype/interfaces/ants/legacy.py b/nipype/interfaces/ants/legacy.py index b68e0f7ed8..2ee0817a1d 100644 --- a/nipype/interfaces/ants/legacy.py +++ b/nipype/interfaces/ants/legacy.py @@ -102,20 +102,20 @@ def _list_outputs(self): # When transform is set as 'RI'/'RA', wrap fields should not be expected # The default transformation is GR, which outputs the wrap fields if not isdefined(transmodel) or (isdefined(transmodel) and transmodel not in ['RI', 'RA']): - outputs['warp_field'] = os.path.join(os.getcwd(), + self.outputs.warp_field = os.path.join(os.getcwd(), self.inputs.out_prefix + 'Warp.nii.gz') - outputs['inverse_warp_field'] = os.path.join(os.getcwd(), + self.outputs.inverse_warp_field = os.path.join(os.getcwd(), self.inputs.out_prefix + 'InverseWarp.nii.gz') - outputs['affine_transformation'] = os.path.join(os.getcwd(), + self.outputs.affine_transformation = os.path.join(os.getcwd(), self.inputs.out_prefix + 'Affine.txt') - outputs['input_file'] = os.path.join(os.getcwd(), + self.outputs.input_file = os.path.join(os.getcwd(), self.inputs.out_prefix + 'repaired.nii.gz') - outputs['output_file'] = os.path.join(os.getcwd(), + self.outputs.output_file = os.path.join(os.getcwd(), self.inputs.out_prefix + 'deformed.nii.gz') @@ -229,7 +229,7 @@ def _format_arg(self, opt, spec, val): def _list_outputs(self): outputs = self._outputs().get() - outputs['template_files'] = [] + self.outputs.template_files = [] for i in range(len(glob(os.path.realpath('*iteration*')))): temp = os.path.realpath('%s_iteration_%d/%stemplate.nii.gz' % (self.inputs.transformation_model, @@ -247,15 +247,15 @@ def _list_outputs(self): self.inputs.out_prefix, i)) - outputs['template_files'].append(os.path.realpath(file_)) - outputs['final_template_file'] = \ + self.outputs.template_files.append(os.path.realpath(file_)) + self.outputs.final_template_file = \ os.path.realpath('%stemplate.nii.gz' % self.inputs.out_prefix) - outputs['subject_outfiles'] = [] + self.outputs.subject_outfiles = [] for filename in self.inputs.in_files: _, base, _ = split_filename(filename) temp = glob(os.path.realpath('%s%s*' % (self.inputs.out_prefix, base))) for file_ in temp: - outputs['subject_outfiles'].append(file_) + self.outputs.subject_outfiles.append(file_) return outputs diff --git a/nipype/interfaces/ants/registration.py b/nipype/interfaces/ants/registration.py index 89af092a33..9ab844242a 100644 --- a/nipype/interfaces/ants/registration.py +++ b/nipype/interfaces/ants/registration.py @@ -204,14 +204,14 @@ def _format_arg(self, opt, spec, val): def _list_outputs(self): outputs = self._outputs().get() - outputs['affine_transform'] = os.path.abspath( + self.outputs.affine_transform = os.path.abspath( self.inputs.output_transform_prefix + 'Affine.txt') - outputs['warp_transform'] = os.path.abspath( + self.outputs.warp_transform = os.path.abspath( self.inputs.output_transform_prefix + 'Warp.nii.gz') - outputs['inverse_warp_transform'] = os.path.abspath( + self.outputs.inverse_warp_transform = os.path.abspath( self.inputs.output_transform_prefix + 'InverseWarp.nii.gz') - # outputs['metaheader'] = os.path.abspath(self.inputs.output_transform_prefix + 'velocity.mhd') - # outputs['metaheader_raw'] = os.path.abspath(self.inputs.output_transform_prefix + 'velocity.raw') + # self.outputs.metaheader = os.path.abspath(self.inputs.output_transform_prefix + 'velocity.mhd') + # self.outputs.metaheader_raw = os.path.abspath(self.inputs.output_transform_prefix + 'velocity.raw') return outputs @@ -879,10 +879,10 @@ def _output_filenames(self, prefix, count, transform, inverse=False): def _list_outputs(self): outputs = self._outputs().get() - outputs['forward_transforms'] = [] - outputs['forward_invert_flags'] = [] - outputs['reverse_transforms'] = [] - outputs['reverse_invert_flags'] = [] + self.outputs.forward_transforms = [] + self.outputs.forward_invert_flags = [] + self.outputs.reverse_transforms = [] + self.outputs.reverse_invert_flags = [] # invert_initial_moving_transform should be always defined, even if # there's no initial transform @@ -892,18 +892,18 @@ def _list_outputs(self): if self.inputs.write_composite_transform: filename = self.inputs.output_transform_prefix + 'Composite.h5' - outputs['composite_transform'] = os.path.abspath(filename) + self.outputs.composite_transform = os.path.abspath(filename) filename = self.inputs.output_transform_prefix + \ 'InverseComposite.h5' - outputs['inverse_composite_transform'] = os.path.abspath(filename) + self.outputs.inverse_composite_transform = os.path.abspath(filename) else: # If composite transforms are written, then individuals are not written (as of 2014-10-26 if not self.inputs.collapse_output_transforms: transform_count = 0 if isdefined(self.inputs.initial_moving_transform): - outputs['forward_transforms'].append(self.inputs.initial_moving_transform) - outputs['forward_invert_flags'].append(invert_initial_moving_transform) - outputs['reverse_transforms'].insert(0, self.inputs.initial_moving_transform) - outputs['reverse_invert_flags'].insert(0, not invert_initial_moving_transform) # Prepend + self.outputs.forward_transforms.append(self.inputs.initial_moving_transform) + self.outputs.forward_invert_flags.append(invert_initial_moving_transform) + self.outputs.reverse_transforms.insert(0, self.inputs.initial_moving_transform) + self.outputs.reverse_invert_flags.insert(0, not invert_initial_moving_transform) # Prepend transform_count += 1 elif isdefined(self.inputs.initial_moving_transform_com): forward_filename, forward_inversemode = self._output_filenames( @@ -915,11 +915,11 @@ def _list_outputs(self): transform_count, 'Initial', True) - outputs['forward_transforms'].append(os.path.abspath(forward_filename)) - outputs['forward_invert_flags'].append(False) - outputs['reverse_transforms'].insert(0, + self.outputs.forward_transforms.append(os.path.abspath(forward_filename)) + self.outputs.forward_invert_flags.append(False) + self.outputs.reverse_transforms.insert(0, os.path.abspath(reverse_filename)) - outputs['reverse_invert_flags'].insert(0, True) + self.outputs.reverse_invert_flags.insert(0, True) transform_count += 1 for count in range(len(self.inputs.transforms)): @@ -929,10 +929,10 @@ def _list_outputs(self): reverse_filename, reverse_inversemode = self._output_filenames( self.inputs.output_transform_prefix, transform_count, self.inputs.transforms[count], True) - outputs['forward_transforms'].append(os.path.abspath(forward_filename)) - outputs['forward_invert_flags'].append(forward_inversemode) - outputs['reverse_transforms'].insert(0, os.path.abspath(reverse_filename)) - outputs['reverse_invert_flags'].insert(0, reverse_inversemode) + self.outputs.forward_transforms.append(os.path.abspath(forward_filename)) + self.outputs.forward_invert_flags.append(forward_inversemode) + self.outputs.reverse_transforms.insert(0, os.path.abspath(reverse_filename)) + self.outputs.reverse_invert_flags.insert(0, reverse_inversemode) transform_count += 1 else: transform_count = 0 @@ -960,18 +960,18 @@ def _list_outputs(self): transform_count, transform, inverse=True) - outputs['forward_transforms'].append(os.path.abspath(forward_filename)) - outputs['forward_invert_flags'].append(forward_inversemode) - outputs['reverse_transforms'].append(os.path.abspath(reverse_filename)) - outputs['reverse_invert_flags'].append(reverse_inversemode) + self.outputs.forward_transforms.append(os.path.abspath(forward_filename)) + self.outputs.forward_invert_flags.append(forward_inversemode) + self.outputs.reverse_transforms.append(os.path.abspath(reverse_filename)) + self.outputs.reverse_invert_flags.append(reverse_inversemode) transform_count += 1 out_filename = self._get_outputfilenames(inverse=False) inv_out_filename = self._get_outputfilenames(inverse=True) if out_filename: - outputs['warped_image'] = os.path.abspath(out_filename) + self.outputs.warped_image = os.path.abspath(out_filename) if inv_out_filename: - outputs['inverse_warped_image'] = os.path.abspath(inv_out_filename) + self.outputs.inverse_warped_image = os.path.abspath(inv_out_filename) if len(self.inputs.save_state): - outputs['save_state'] = os.path.abspath(self.inputs.save_state) + self.outputs.save_state = os.path.abspath(self.inputs.save_state) return outputs diff --git a/nipype/interfaces/ants/resampling.py b/nipype/interfaces/ants/resampling.py index 6191324771..6b3c98bf66 100644 --- a/nipype/interfaces/ants/resampling.py +++ b/nipype/interfaces/ants/resampling.py @@ -93,7 +93,7 @@ def _format_arg(self, opt, spec, val): def _list_outputs(self): outputs = self._outputs().get() _, name, ext = split_filename(os.path.abspath(self.inputs.input_image)) - outputs['output_image'] = os.path.join(os.getcwd(), + self.outputs.output_image = os.path.join(os.getcwd(), ''.join((name, self.inputs.out_postfix, ext))) @@ -202,9 +202,9 @@ def _format_arg(self, opt, spec, val): def _list_outputs(self): outputs = self._outputs().get() if isdefined(self.inputs.output_image): - outputs['output_image'] = os.path.abspath(self.inputs.output_image) + self.outputs.output_image = os.path.abspath(self.inputs.output_image) else: - outputs['output_image'] = os.path.abspath( + self.outputs.output_image = os.path.abspath( self._gen_filename('output_image')) return outputs @@ -351,7 +351,7 @@ def _format_arg(self, opt, spec, val): def _list_outputs(self): outputs = self._outputs().get() - outputs['output_image'] = os.path.abspath( + self.outputs.output_image = os.path.abspath( self._gen_filename('output_image')) return outputs diff --git a/nipype/interfaces/ants/segmentation.py b/nipype/interfaces/ants/segmentation.py index 7affe821d9..8d304555ad 100644 --- a/nipype/interfaces/ants/segmentation.py +++ b/nipype/interfaces/ants/segmentation.py @@ -164,12 +164,12 @@ def _gen_filename(self, name): def _list_outputs(self): outputs = self._outputs().get() - outputs['classified_image'] = os.path.abspath( + self.outputs.classified_image = os.path.abspath( self._gen_filename('out_classified_image_name')) if isdefined(self.inputs.save_posteriors) and self.inputs.save_posteriors: - outputs['posteriors'] = [] + self.outputs.posteriors = [] for i in range(self.inputs.number_of_tissue_classes): - outputs['posteriors'].append(os.path.abspath(self.inputs.output_posteriors_name_template % (i + 1))) + self.outputs.posteriors.append(os.path.abspath(self.inputs.output_posteriors_name_template % (i + 1))) return outputs @@ -227,7 +227,7 @@ def _gen_filename(self, name): def _list_outputs(self): outputs = self._outputs().get() _, name, ext = split_filename(os.path.abspath(self.inputs.input_wm)) - outputs['output_image'] = os.path.join(os.getcwd(), + self.outputs.output_image = os.path.join(os.getcwd(), ''.join((name, self.inputs.output_image, ext))) @@ -373,11 +373,11 @@ def _parse_inputs(self, skip=None): def _list_outputs(self): outputs = self._outputs().get() - outputs['output_image'] = os.path.abspath( + self.outputs.output_image = os.path.abspath( self._gen_filename('output_image')) if self.inputs.save_bias or isdefined(self.inputs.bias_image): - outputs['bias_image'] = os.path.abspath( + self.outputs.bias_image = os.path.abspath( self._gen_filename('bias_image')) return outputs @@ -547,15 +547,15 @@ def _run_interface(self, runtime, correct_return_codes=[0]): def _list_outputs(self): outputs = self._outputs().get() - outputs['BrainExtractionMask'] = os.path.join(os.getcwd(), + self.outputs.BrainExtractionMask = os.path.join(os.getcwd(), self.inputs.out_prefix + 'BrainExtractionMask.' + self.inputs.image_suffix) - outputs['BrainSegmentation'] = os.path.join(os.getcwd(), + self.outputs.BrainSegmentation = os.path.join(os.getcwd(), self.inputs.out_prefix + 'BrainSegmentation.' + self.inputs.image_suffix) - outputs['BrainSegmentationN4'] = os.path.join(os.getcwd(), + self.outputs.BrainSegmentationN4 = os.path.join(os.getcwd(), self.inputs.out_prefix + 'BrainSegmentation0N4.' + self.inputs.image_suffix) @@ -565,34 +565,34 @@ def _list_outputs(self): self.inputs.out_prefix + 'BrainSegmentationPosteriors%02d.' % (i + 1) + self.inputs.image_suffix)) - outputs['BrainSegmentationPosteriors'] = posteriors - outputs['CorticalThickness'] = os.path.join(os.getcwd(), + self.outputs.BrainSegmentationPosteriors = posteriors + self.outputs.CorticalThickness = os.path.join(os.getcwd(), self.inputs.out_prefix + 'CorticalThickness.' + self.inputs.image_suffix) - outputs['TemplateToSubject1GenericAffine'] = os.path.join(os.getcwd(), + self.outputs.TemplateToSubject1GenericAffine = os.path.join(os.getcwd(), self.inputs.out_prefix + 'TemplateToSubject1GenericAffine.mat') - outputs['TemplateToSubject0Warp'] = os.path.join(os.getcwd(), + self.outputs.TemplateToSubject0Warp = os.path.join(os.getcwd(), self.inputs.out_prefix + 'TemplateToSubject0Warp.' + self.inputs.image_suffix) - outputs['SubjectToTemplate1Warp'] = os.path.join(os.getcwd(), + self.outputs.SubjectToTemplate1Warp = os.path.join(os.getcwd(), self.inputs.out_prefix + 'SubjectToTemplate1Warp.' + self.inputs.image_suffix) - outputs['SubjectToTemplate0GenericAffine'] = os.path.join(os.getcwd(), + self.outputs.SubjectToTemplate0GenericAffine = os.path.join(os.getcwd(), self.inputs.out_prefix + 'SubjectToTemplate0GenericAffine.mat') - outputs['SubjectToTemplateLogJacobian'] = os.path.join(os.getcwd(), + self.outputs.SubjectToTemplateLogJacobian = os.path.join(os.getcwd(), self.inputs.out_prefix + 'SubjectToTemplateLogJacobian.' + self.inputs.image_suffix) - outputs['CorticalThicknessNormedToTemplate'] = os.path.join(os.getcwd(), + self.outputs.CorticalThicknessNormedToTemplate = os.path.join(os.getcwd(), self.inputs.out_prefix + 'CorticalThickness.' + self.inputs.image_suffix) - outputs['BrainVolumes'] = os.path.join(os.getcwd(), + self.outputs.BrainVolumes = os.path.join(os.getcwd(), self.inputs.out_prefix + 'brainvols.csv') return outputs @@ -673,11 +673,11 @@ class BrainExtraction(ANTSCommand): def _list_outputs(self): outputs = self._outputs().get() - outputs['BrainExtractionMask'] = os.path.join(os.getcwd(), + self.outputs.BrainExtractionMask = os.path.join(os.getcwd(), self.inputs.out_prefix + 'BrainExtractionMask.' + self.inputs.image_suffix) - outputs['BrainExtractionBrain'] = os.path.join(os.getcwd(), + self.outputs.BrainExtractionBrain = os.path.join(os.getcwd(), self.inputs.out_prefix + 'BrainExtractionBrain.' + self.inputs.image_suffix) @@ -792,7 +792,7 @@ def _format_arg(self, opt, spec, val): def _list_outputs(self): outputs = self._outputs().get() - outputs['output_label_image'] = os.path.abspath( + self.outputs.output_label_image = os.path.abspath( self.inputs.output_label_image) return outputs diff --git a/nipype/interfaces/ants/utils.py b/nipype/interfaces/ants/utils.py index c3253b7256..d6c33b1eb6 100644 --- a/nipype/interfaces/ants/utils.py +++ b/nipype/interfaces/ants/utils.py @@ -47,7 +47,7 @@ def _format_arg(self, opt, spec, val): def _list_outputs(self): outputs = self._outputs().get() - outputs['affine_transform'] = os.path.abspath( + self.outputs.affine_transform = os.path.abspath( self.inputs.output_affine_transform) return outputs @@ -89,7 +89,7 @@ def _format_arg(self, opt, spec, val): def _list_outputs(self): outputs = self._outputs().get() - outputs['output_average_image'] = os.path.realpath( + self.outputs.output_average_image = os.path.realpath( self.inputs.output_average_image) return outputs @@ -130,7 +130,7 @@ def _format_arg(self, opt, spec, val): def _list_outputs(self): outputs = self._outputs().get() - outputs['output_product_image'] = os.path.abspath( + self.outputs.output_product_image = os.path.abspath( self.inputs.output_product_image) return outputs @@ -190,9 +190,9 @@ def _gen_filename(self, name): def _list_outputs(self): outputs = self._outputs().get() if self.inputs.use_log == 1: - outputs['jacobian_image'] = os.path.abspath( + self.outputs.jacobian_image = os.path.abspath( self._gen_filename('output_prefix') + 'logjacobian.nii.gz') else: - outputs['jacobian_image'] = os.path.abspath( + self.outputs.jacobian_image = os.path.abspath( self._gen_filename('output_prefix') + 'jacobian.nii.gz') return outputs diff --git a/nipype/interfaces/ants/visualization.py b/nipype/interfaces/ants/visualization.py index 624f8e10b1..4ba743a029 100644 --- a/nipype/interfaces/ants/visualization.py +++ b/nipype/interfaces/ants/visualization.py @@ -66,7 +66,7 @@ def _format_arg(self, opt, spec, val): def _list_outputs(self): outputs = self._outputs().get() - outputs['output_image'] = os.path.join(os.getcwd(), + self.outputs.output_image = os.path.join(os.getcwd(), self.inputs.output_image) return outputs @@ -151,6 +151,6 @@ class CreateTiledMosaic(ANTSCommand): def _list_outputs(self): outputs = self._outputs().get() - outputs['output_image'] = os.path.join(os.getcwd(), + self.outputs.output_image = os.path.join(os.getcwd(), self.inputs.output_image) return outputs diff --git a/nipype/interfaces/camino/calib.py b/nipype/interfaces/camino/calib.py index a56e501e7c..02b6177004 100644 --- a/nipype/interfaces/camino/calib.py +++ b/nipype/interfaces/camino/calib.py @@ -122,8 +122,8 @@ class SFPICOCalibData(StdOutCommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['PICOCalib'] = os.path.abspath(self._gen_outfilename()) - outputs['calib_info'] = os.path.abspath(self.inputs.info_file) + self.outputs.PICOCalib = os.path.abspath(self._gen_outfilename()) + self.outputs.calib_info = os.path.abspath(self.inputs.info_file) return outputs def _gen_outfilename(self): @@ -229,8 +229,8 @@ class SFLUTGen(StdOutCommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['lut_one_fibre'] = self.inputs.outputstem + '_oneFibreSurfaceCoeffs.Bdouble' - outputs['lut_two_fibres'] = self.inputs.outputstem + '_twoFibreSurfaceCoeffs.Bdouble' + self.outputs.lut_one_fibre = self.inputs.outputstem + '_oneFibreSurfaceCoeffs.Bdouble' + self.outputs.lut_two_fibres = self.inputs.outputstem + '_twoFibreSurfaceCoeffs.Bdouble' return outputs def _gen_outfilename(self): diff --git a/nipype/interfaces/camino/connectivity.py b/nipype/interfaces/camino/connectivity.py index 3a41c801e2..3c3453e88e 100644 --- a/nipype/interfaces/camino/connectivity.py +++ b/nipype/interfaces/camino/connectivity.py @@ -135,8 +135,8 @@ class Conmat(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() output_root = self._gen_outputroot() - outputs['conmat_sc'] = os.path.abspath(output_root + "sc.csv") - outputs['conmat_ts'] = os.path.abspath(output_root + "ts.csv") + self.outputs.conmat_sc = os.path.abspath(output_root + "sc.csv") + self.outputs.conmat_ts = os.path.abspath(output_root + "ts.csv") return outputs def _gen_outfilename(self): diff --git a/nipype/interfaces/camino/convert.py b/nipype/interfaces/camino/convert.py index cdde8a2b88..fb530c1cc8 100644 --- a/nipype/interfaces/camino/convert.py +++ b/nipype/interfaces/camino/convert.py @@ -58,7 +58,7 @@ class Image2Voxel(StdOutCommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['voxel_order'] = os.path.abspath(self._gen_outfilename()) + self.outputs.voxel_order = os.path.abspath(self._gen_outfilename()) return outputs def _gen_outfilename(self): @@ -116,7 +116,7 @@ class FSL2Scheme(StdOutCommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['scheme'] = os.path.abspath(self._gen_outfilename()) + self.outputs.scheme = os.path.abspath(self._gen_outfilename()) return outputs def _gen_outfilename(self): @@ -172,7 +172,7 @@ class VtkStreamlines(StdOutCommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['vtk'] = os.path.abspath(self._gen_outfilename()) + self.outputs.vtk = os.path.abspath(self._gen_outfilename()) return outputs def _gen_outfilename(self): @@ -300,8 +300,8 @@ def _get_actual_outputroot(self, outputroot): def _list_outputs(self): outputs = self.output_spec().get() - outputs['proc'] = os.path.abspath(self._gen_outfilename()) - outputs['outputroot_files'] = self.outputroot_files + self.outputs.proc = os.path.abspath(self._gen_outfilename()) + self.outputs.outputroot_files = self.outputroot_files return outputs def _gen_outfilename(self): @@ -353,7 +353,7 @@ class TractShredder(StdOutCommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['shredded'] = os.path.abspath(self._gen_outfilename()) + self.outputs.shredded = os.path.abspath(self._gen_outfilename()) return outputs def _gen_outfilename(self): @@ -393,9 +393,9 @@ class DT2NIfTI(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() output_root = self._gen_outputroot() - outputs["dt"] = os.path.abspath(output_root + "dt.nii") - outputs["exitcode"] = os.path.abspath(output_root + "exitcode.nii") - outputs["lns0"] = os.path.abspath(output_root + "lns0.nii") + self.outputs.dt = os.path.abspath(output_root + "dt.nii") + self.outputs.exitcode = os.path.abspath(output_root + "exitcode.nii") + self.outputs.lns0 = os.path.abspath(output_root + "lns0.nii") return outputs def _gen_outfilename(self): @@ -475,7 +475,7 @@ class NIfTIDT2Camino(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs["out_file"] = self._gen_filename('out_file') + self.outputs.out_file = self._gen_filename('out_file') return outputs def _gen_filename(self, name): @@ -629,7 +629,7 @@ class AnalyzeHeader(StdOutCommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['header'] = os.path.abspath(self._gen_outfilename()) + self.outputs.header = os.path.abspath(self._gen_outfilename()) return outputs def _gen_outfilename(self): @@ -683,7 +683,7 @@ class Shredder(StdOutCommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['shredded_file'] = os.path.abspath(self._gen_outfilename()) + self.outputs.shredded_file = os.path.abspath(self._gen_outfilename()) return outputs def _gen_outfilename(self): diff --git a/nipype/interfaces/camino/dti.py b/nipype/interfaces/camino/dti.py index 8402fcf45f..68ca1a9e32 100644 --- a/nipype/interfaces/camino/dti.py +++ b/nipype/interfaces/camino/dti.py @@ -63,7 +63,7 @@ class DTIFit(StdOutCommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['tensor_fitted'] = os.path.abspath(self._gen_outfilename()) + self.outputs.tensor_fitted = os.path.abspath(self._gen_outfilename()) return outputs def _gen_outfilename(self): @@ -149,7 +149,7 @@ class DTMetric(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['metric_stats'] = os.path.abspath(self._gen_outfilename()) + self.outputs.metric_stats = os.path.abspath(self._gen_outfilename()) return outputs def _gen_outfilename(self): @@ -253,7 +253,7 @@ class ModelFit(StdOutCommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['fitted_data'] = os.path.abspath(self._gen_outfilename()) + self.outputs.fitted_data = os.path.abspath(self._gen_outfilename()) return outputs def _gen_outfilename(self): @@ -335,7 +335,7 @@ class DTLUTGen(StdOutCommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['dtLUT'] = os.path.abspath(self._gen_outfilename()) + self.outputs.dtLUT = os.path.abspath(self._gen_outfilename()) return outputs def _gen_outfilename(self): @@ -399,7 +399,7 @@ class PicoPDFs(StdOutCommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['pdfs'] = os.path.abspath(self._gen_outfilename()) + self.outputs.pdfs = os.path.abspath(self._gen_outfilename()) return outputs def _gen_outfilename(self): @@ -570,7 +570,7 @@ def _list_outputs(self): out_file_path = os.path.abspath(self.inputs.out_file) else: out_file_path = os.path.abspath(self._gen_outfilename()) - outputs['tracked'] = out_file_path + self.outputs.tracked = out_file_path return outputs def _gen_filename(self, name): @@ -874,7 +874,7 @@ class ComputeMeanDiffusivity(StdOutCommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs["md"] = os.path.abspath(self._gen_outfilename()) + self.outputs.md = os.path.abspath(self._gen_outfilename()) return outputs def _gen_outfilename(self): @@ -936,7 +936,7 @@ class ComputeFractionalAnisotropy(StdOutCommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['fa'] = os.path.abspath(self._gen_outfilename()) + self.outputs.fa = os.path.abspath(self._gen_outfilename()) return outputs def _gen_outfilename(self): @@ -1000,7 +1000,7 @@ class ComputeTensorTrace(StdOutCommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['trace'] = os.path.abspath(self._gen_outfilename()) + self.outputs.trace = os.path.abspath(self._gen_outfilename()) return outputs def _gen_outfilename(self): @@ -1060,7 +1060,7 @@ class ComputeEigensystem(StdOutCommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs["eigen"] = os.path.abspath(self._gen_outfilename()) + self.outputs.eigen = os.path.abspath(self._gen_outfilename()) return outputs def _gen_outfilename(self): diff --git a/nipype/interfaces/camino/odf.py b/nipype/interfaces/camino/odf.py index e39bc81117..ddab800071 100644 --- a/nipype/interfaces/camino/odf.py +++ b/nipype/interfaces/camino/odf.py @@ -84,7 +84,7 @@ class QBallMX(StdOutCommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['qmat'] = os.path.abspath(self._gen_outfilename()) + self.outputs.qmat = os.path.abspath(self._gen_outfilename()) return outputs def _gen_outfilename(self): @@ -161,7 +161,7 @@ class LinRecon(StdOutCommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['recon_data'] = os.path.abspath(self._gen_outfilename()) + self.outputs.recon_data = os.path.abspath(self._gen_outfilename()) return outputs def _gen_outfilename(self): @@ -285,7 +285,7 @@ class MESD(StdOutCommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['mesd_data'] = os.path.abspath(self._gen_outfilename()) + self.outputs.mesd_data = os.path.abspath(self._gen_outfilename()) return outputs def _gen_outfilename(self): @@ -432,7 +432,7 @@ class SFPeaks(StdOutCommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['peaks'] = os.path.abspath(self._gen_outfilename()) + self.outputs.peaks = os.path.abspath(self._gen_outfilename()) return outputs def _gen_outfilename(self): diff --git a/nipype/interfaces/camino/utils.py b/nipype/interfaces/camino/utils.py index 19fe6ac768..70b7138953 100644 --- a/nipype/interfaces/camino/utils.py +++ b/nipype/interfaces/camino/utils.py @@ -57,7 +57,7 @@ class ImageStats(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_file'] = os.path.abspath(self._gen_outfilename()) + self.outputs.out_file = os.path.abspath(self._gen_outfilename()) return outputs def _gen_outfilename(self): diff --git a/nipype/interfaces/camino2trackvis/convert.py b/nipype/interfaces/camino2trackvis/convert.py index 9075a06ee2..289c30855b 100644 --- a/nipype/interfaces/camino2trackvis/convert.py +++ b/nipype/interfaces/camino2trackvis/convert.py @@ -75,7 +75,7 @@ class Camino2Trackvis(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['trackvis'] = os.path.abspath(self._gen_outfilename()) + self.outputs.trackvis = os.path.abspath(self._gen_outfilename()) return outputs def _gen_filename(self, name): @@ -126,7 +126,7 @@ class Trackvis2Camino(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['camino'] = os.path.abspath(self._gen_outfilename()) + self.outputs.camino = os.path.abspath(self._gen_outfilename()) return outputs def _gen_filename(self, name): diff --git a/nipype/interfaces/cmtk/cmtk.py b/nipype/interfaces/cmtk/cmtk.py index f527cccc0a..16250baac7 100644 --- a/nipype/interfaces/cmtk/cmtk.py +++ b/nipype/interfaces/cmtk/cmtk.py @@ -506,8 +506,8 @@ def _list_outputs(self): out_matrix_file = op.abspath(self._gen_outfilename('.pck')) out_intersection_matrix_file = op.abspath(self._gen_outfilename('_intersections.pck')) - outputs['matrix_file'] = out_matrix_file - outputs['intersection_matrix_file'] = out_intersection_matrix_file + self.outputs.matrix_file = out_matrix_file + self.outputs.intersection_matrix_file = out_intersection_matrix_file matrix_mat_file = op.abspath(self.inputs.out_matrix_mat_file) path, name, ext = split_filename(matrix_mat_file) @@ -515,57 +515,57 @@ def _list_outputs(self): ext = '.mat' matrix_mat_file = matrix_mat_file + ext - outputs['matrix_mat_file'] = matrix_mat_file + self.outputs.matrix_mat_file = matrix_mat_file if isdefined(self.inputs.out_mean_fiber_length_matrix_mat_file): - outputs['mean_fiber_length_matrix_mat_file'] = op.abspath(self.inputs.out_mean_fiber_length_matrix_mat_file) + self.outputs.mean_fiber_length_matrix_mat_file = op.abspath(self.inputs.out_mean_fiber_length_matrix_mat_file) else: - outputs['mean_fiber_length_matrix_mat_file'] = op.abspath(self._gen_outfilename('_mean_fiber_length.mat')) + self.outputs.mean_fiber_length_matrix_mat_file = op.abspath(self._gen_outfilename('_mean_fiber_length.mat')) if isdefined(self.inputs.out_median_fiber_length_matrix_mat_file): - outputs['median_fiber_length_matrix_mat_file'] = op.abspath(self.inputs.out_median_fiber_length_matrix_mat_file) + self.outputs.median_fiber_length_matrix_mat_file = op.abspath(self.inputs.out_median_fiber_length_matrix_mat_file) else: - outputs['median_fiber_length_matrix_mat_file'] = op.abspath(self._gen_outfilename('_median_fiber_length.mat')) + self.outputs.median_fiber_length_matrix_mat_file = op.abspath(self._gen_outfilename('_median_fiber_length.mat')) if isdefined(self.inputs.out_fiber_length_std_matrix_mat_file): - outputs['fiber_length_std_matrix_mat_file'] = op.abspath(self.inputs.out_fiber_length_std_matrix_mat_file) + self.outputs.fiber_length_std_matrix_mat_file = op.abspath(self.inputs.out_fiber_length_std_matrix_mat_file) else: - outputs['fiber_length_std_matrix_mat_file'] = op.abspath(self._gen_outfilename('_fiber_length_std.mat')) + self.outputs.fiber_length_std_matrix_mat_file = op.abspath(self._gen_outfilename('_fiber_length_std.mat')) if isdefined(self.inputs.out_intersection_matrix_mat_file): - outputs['intersection_matrix_mat_file'] = op.abspath(self.inputs.out_intersection_matrix_mat_file) + self.outputs.intersection_matrix_mat_file = op.abspath(self.inputs.out_intersection_matrix_mat_file) else: - outputs['intersection_matrix_mat_file'] = op.abspath(self._gen_outfilename('_intersections.mat')) + self.outputs.intersection_matrix_mat_file = op.abspath(self._gen_outfilename('_intersections.mat')) if isdefined(self.inputs.out_endpoint_array_name): endpoint_name = self.inputs.out_endpoint_array_name - outputs['endpoint_file'] = op.abspath(self.inputs.out_endpoint_array_name + '_endpoints.npy') - outputs['endpoint_file_mm'] = op.abspath(self.inputs.out_endpoint_array_name + '_endpointsmm.npy') - outputs['fiber_length_file'] = op.abspath(self.inputs.out_endpoint_array_name + '_final_fiberslength.npy') - outputs['fiber_label_file'] = op.abspath(self.inputs.out_endpoint_array_name + '_filtered_fiberslabel.npy') - outputs['fiber_labels_noorphans'] = op.abspath(self.inputs.out_endpoint_array_name + '_final_fiberslabels.npy') + self.outputs.endpoint_file = op.abspath(self.inputs.out_endpoint_array_name + '_endpoints.npy') + self.outputs.endpoint_file_mm = op.abspath(self.inputs.out_endpoint_array_name + '_endpointsmm.npy') + self.outputs.fiber_length_file = op.abspath(self.inputs.out_endpoint_array_name + '_final_fiberslength.npy') + self.outputs.fiber_label_file = op.abspath(self.inputs.out_endpoint_array_name + '_filtered_fiberslabel.npy') + self.outputs.fiber_labels_noorphans = op.abspath(self.inputs.out_endpoint_array_name + '_final_fiberslabels.npy') else: _, endpoint_name, _ = split_filename(self.inputs.tract_file) - outputs['endpoint_file'] = op.abspath(endpoint_name + '_endpoints.npy') - outputs['endpoint_file_mm'] = op.abspath(endpoint_name + '_endpointsmm.npy') - outputs['fiber_length_file'] = op.abspath(endpoint_name + '_final_fiberslength.npy') - outputs['fiber_label_file'] = op.abspath(endpoint_name + '_filtered_fiberslabel.npy') - outputs['fiber_labels_noorphans'] = op.abspath(endpoint_name + '_final_fiberslabels.npy') + self.outputs.endpoint_file = op.abspath(endpoint_name + '_endpoints.npy') + self.outputs.endpoint_file_mm = op.abspath(endpoint_name + '_endpointsmm.npy') + self.outputs.fiber_length_file = op.abspath(endpoint_name + '_final_fiberslength.npy') + self.outputs.fiber_label_file = op.abspath(endpoint_name + '_filtered_fiberslabel.npy') + self.outputs.fiber_labels_noorphans = op.abspath(endpoint_name + '_final_fiberslabels.npy') if self.inputs.count_region_intersections: - outputs['matrix_files'] = [out_matrix_file, out_intersection_matrix_file] - outputs['matlab_matrix_files'] = [outputs['matrix_mat_file'], - outputs['mean_fiber_length_matrix_mat_file'], outputs['median_fiber_length_matrix_mat_file'], - outputs['fiber_length_std_matrix_mat_file'], outputs['intersection_matrix_mat_file']] + self.outputs.matrix_files = [out_matrix_file, out_intersection_matrix_file] + self.outputs.matlab_matrix_files = [self.outputs.matrix_mat_file, + self.outputs.mean_fiber_length_matrix_mat_file, self.outputs.median_fiber_length_matrix_mat_file, + self.outputs.fiber_length_std_matrix_mat_file, self.outputs.intersection_matrix_mat_file] else: - outputs['matrix_files'] = [out_matrix_file] - outputs['matlab_matrix_files'] = [outputs['matrix_mat_file'], - outputs['mean_fiber_length_matrix_mat_file'], outputs['median_fiber_length_matrix_mat_file'], - outputs['fiber_length_std_matrix_mat_file']] - - outputs['filtered_tractography'] = op.abspath(endpoint_name + '_streamline_final.trk') - outputs['filtered_tractography_by_intersections'] = op.abspath(endpoint_name + '_intersections_streamline_final.trk') - outputs['filtered_tractographies'] = [outputs['filtered_tractography'], outputs['filtered_tractography_by_intersections']] - outputs['stats_file'] = op.abspath(endpoint_name + '_statistics.mat') + self.outputs.matrix_files = [out_matrix_file] + self.outputs.matlab_matrix_files = [self.outputs.matrix_mat_file, + self.outputs.mean_fiber_length_matrix_mat_file, self.outputs.median_fiber_length_matrix_mat_file, + self.outputs.fiber_length_std_matrix_mat_file] + + self.outputs.filtered_tractography = op.abspath(endpoint_name + '_streamline_final.trk') + self.outputs.filtered_tractography_by_intersections = op.abspath(endpoint_name + '_intersections_streamline_final.trk') + self.outputs.filtered_tractographies = [self.outputs.filtered_tractography, self.outputs.filtered_tractography_by_intersections] + self.outputs.stats_file = op.abspath(endpoint_name + '_statistics.mat') return outputs def _gen_outfilename(self, ext): @@ -721,13 +721,13 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() if isdefined(self.inputs.out_roi_file): - outputs['roi_file'] = op.abspath(self.inputs.out_roi_file) + self.outputs.roi_file = op.abspath(self.inputs.out_roi_file) else: - outputs['roi_file'] = op.abspath(self._gen_outfilename('nii')) + self.outputs.roi_file = op.abspath(self._gen_outfilename('nii')) if isdefined(self.inputs.out_dict_file): - outputs['dict_file'] = op.abspath(self.inputs.out_dict_file) + self.outputs.dict_file = op.abspath(self.inputs.out_dict_file) else: - outputs['dict_file'] = op.abspath(self._gen_outfilename('pck')) + self.outputs.dict_file = op.abspath(self._gen_outfilename('pck')) return outputs def _gen_outfilename(self, ext): @@ -791,5 +791,5 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs['node_network'] = op.abspath(self.inputs.out_filename) + self.outputs.node_network = op.abspath(self.inputs.out_filename) return outputs diff --git a/nipype/interfaces/cmtk/convert.py b/nipype/interfaces/cmtk/convert.py index 33ee7616b9..52539314fc 100644 --- a/nipype/interfaces/cmtk/convert.py +++ b/nipype/interfaces/cmtk/convert.py @@ -202,7 +202,7 @@ def _list_outputs(self): _, name, ext = split_filename(self.inputs.out_file) if not ext == '.cff': ext = '.cff' - outputs['connectome_file'] = op.abspath(name + ext) + self.outputs.connectome_file = op.abspath(name + ext) return outputs @@ -264,5 +264,5 @@ def _list_outputs(self): _, name, ext = split_filename(self.inputs.out_file) if not ext == '.cff': ext = '.cff' - outputs['connectome_file'] = op.abspath(name + ext) + self.outputs.connectome_file = op.abspath(name + ext) return outputs diff --git a/nipype/interfaces/cmtk/nbs.py b/nipype/interfaces/cmtk/nbs.py index 8fd539691f..1d915410b0 100644 --- a/nipype/interfaces/cmtk/nbs.py +++ b/nipype/interfaces/cmtk/nbs.py @@ -138,9 +138,9 @@ def _list_outputs(self): path = op.abspath('NBS_Result_' + details) pval_path = op.abspath('NBS_P_vals_' + details) - outputs['nbs_network'] = path - outputs['nbs_pval_network'] = pval_path - outputs['network_files'] = [path, pval_path] + self.outputs.nbs_network = path + self.outputs.nbs_pval_network = pval_path + self.outputs.network_files = [path, pval_path] return outputs def _gen_outfilename(self, name, ext): diff --git a/nipype/interfaces/cmtk/nx.py b/nipype/interfaces/cmtk/nx.py index 64b817a746..fcfd686480 100644 --- a/nipype/interfaces/cmtk/nx.py +++ b/nipype/interfaces/cmtk/nx.py @@ -484,19 +484,19 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self.output_spec().get() - outputs["k_core"] = op.abspath(self._gen_outfilename(self.inputs.out_k_core, 'pck')) - outputs["k_shell"] = op.abspath(self._gen_outfilename(self.inputs.out_k_shell, 'pck')) - outputs["k_crust"] = op.abspath(self._gen_outfilename(self.inputs.out_k_crust, 'pck')) - outputs["gpickled_network_files"] = gpickled - outputs["k_networks"] = kntwks - outputs["node_measure_networks"] = nodentwks - outputs["edge_measure_networks"] = edgentwks - outputs["matlab_dict_measures"] = dicts - outputs["global_measures_matlab"] = op.abspath(self._gen_outfilename('globalmetrics', 'mat')) - outputs["node_measures_matlab"] = op.abspath(self._gen_outfilename('nodemetrics', 'mat')) - outputs["edge_measures_matlab"] = op.abspath(self._gen_outfilename('edgemetrics', 'mat')) - outputs["matlab_matrix_files"] = [outputs["global_measures_matlab"], outputs["node_measures_matlab"], outputs["edge_measures_matlab"]] - outputs["pickled_extra_measures"] = op.abspath(self._gen_outfilename(self.inputs.out_pickled_extra_measures, 'pck')) + self.outputs.k_core = op.abspath(self._gen_outfilename(self.inputs.out_k_core, 'pck')) + self.outputs.k_shell = op.abspath(self._gen_outfilename(self.inputs.out_k_shell, 'pck')) + self.outputs.k_crust = op.abspath(self._gen_outfilename(self.inputs.out_k_crust, 'pck')) + self.outputs.gpickled_network_files = gpickled + self.outputs.k_networks = kntwks + self.outputs.node_measure_networks = nodentwks + self.outputs.edge_measure_networks = edgentwks + self.outputs.matlab_dict_measures = dicts + self.outputs.global_measures_matlab = op.abspath(self._gen_outfilename('globalmetrics', 'mat')) + self.outputs.node_measures_matlab = op.abspath(self._gen_outfilename('nodemetrics', 'mat')) + self.outputs.edge_measures_matlab = op.abspath(self._gen_outfilename('edgemetrics', 'mat')) + self.outputs.matlab_matrix_files = [self.outputs.global_measures_matlab, self.outputs.node_measures_matlab, self.outputs.edge_measures_matlab] + self.outputs.pickled_extra_measures = op.abspath(self._gen_outfilename(self.inputs.out_pickled_extra_measures, 'pck')) return outputs def _gen_outfilename(self, name, ext): @@ -550,16 +550,16 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self.output_spec().get() if not isdefined(self.inputs.out_gpickled_groupavg): - outputs["gpickled_groupavg"] = op.abspath(self._gen_outfilename(self.inputs.group_id + '_average', 'pck')) + self.outputs.gpickled_groupavg = op.abspath(self._gen_outfilename(self.inputs.group_id + '_average', 'pck')) else: - outputs["gpickled_groupavg"] = op.abspath(self.inputs.out_gpickled_groupavg) + self.outputs.gpickled_groupavg = op.abspath(self.inputs.out_gpickled_groupavg) if not isdefined(self.inputs.out_gexf_groupavg): - outputs["gexf_groupavg"] = op.abspath(self._gen_outfilename(self.inputs.group_id + '_average', 'gexf')) + self.outputs.gexf_groupavg = op.abspath(self._gen_outfilename(self.inputs.group_id + '_average', 'gexf')) else: - outputs["gexf_groupavg"] = op.abspath(self.inputs.out_gexf_groupavg) + self.outputs.gexf_groupavg = op.abspath(self.inputs.out_gexf_groupavg) - outputs["matlab_groupavgs"] = matlab_network_list + self.outputs.matlab_groupavgs = matlab_network_list return outputs def _gen_outfilename(self, name, ext): diff --git a/nipype/interfaces/cmtk/parcellation.py b/nipype/interfaces/cmtk/parcellation.py index 80b0e72ab0..daa05ef9a7 100644 --- a/nipype/interfaces/cmtk/parcellation.py +++ b/nipype/interfaces/cmtk/parcellation.py @@ -584,21 +584,21 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() if isdefined(self.inputs.out_roi_file): - outputs['roi_file'] = op.abspath(self.inputs.out_roi_file) + self.outputs.roi_file = op.abspath(self.inputs.out_roi_file) else: - outputs['roi_file'] = op.abspath( + self.outputs.roi_file = op.abspath( self._gen_outfilename('nii.gz', 'ROI')) if self.inputs.dilation is True: - outputs['roiv_file'] = op.abspath(self._gen_outfilename( + self.outputs.roiv_file = op.abspath(self._gen_outfilename( 'nii.gz', 'ROIv')) - outputs['white_matter_mask_file'] = op.abspath('fsmask_1mm.nii.gz') - outputs['cc_unknown_file'] = op.abspath('cc_unknown.nii.gz') - outputs['ribbon_file'] = op.abspath('ribbon.nii.gz') - outputs['aseg_file'] = op.abspath('aseg.nii.gz') - outputs['roi_file_in_structural_space'] = op.abspath( + self.outputs.white_matter_mask_file = op.abspath('fsmask_1mm.nii.gz') + self.outputs.cc_unknown_file = op.abspath('cc_unknown.nii.gz') + self.outputs.ribbon_file = op.abspath('ribbon.nii.gz') + self.outputs.aseg_file = op.abspath('aseg.nii.gz') + self.outputs.roi_file_in_structural_space = op.abspath( 'ROI_HR_th.nii.gz') if self.inputs.dilation is True: - outputs['dilated_roi_file_in_structural_space'] = op.abspath( + self.outputs.dilated_roi_file_in_structural_space = op.abspath( 'ROIv_HR_th.nii.gz') return outputs diff --git a/nipype/interfaces/dcm2nii.py b/nipype/interfaces/dcm2nii.py index 5b022a3d04..ee12bd1f80 100644 --- a/nipype/interfaces/dcm2nii.py +++ b/nipype/interfaces/dcm2nii.py @@ -161,11 +161,11 @@ def _parse_stdout(self, stdout): def _list_outputs(self): outputs = self.output_spec().get() - outputs['converted_files'] = self.output_files - outputs['reoriented_files'] = self.reoriented_files - outputs['reoriented_and_cropped_files'] = self.reoriented_and_cropped_files - outputs['bvecs'] = self.bvecs - outputs['bvals'] = self.bvals + self.outputs.converted_files = self.output_files + self.outputs.reoriented_files = self.reoriented_files + self.outputs.reoriented_and_cropped_files = self.reoriented_and_cropped_files + self.outputs.bvecs = self.bvecs + self.outputs.bvals = self.bvals return outputs def _gen_filename(self, name): diff --git a/nipype/interfaces/dcmstack.py b/nipype/interfaces/dcmstack.py index a06065fa41..582ac6fc68 100644 --- a/nipype/interfaces/dcmstack.py +++ b/nipype/interfaces/dcmstack.py @@ -163,7 +163,7 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs["out_file"] = self.out_path + self.outputs.out_file = self.out_path return outputs @@ -195,7 +195,7 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs["out_list"] = self.out_list + self.outputs.out_list = self.out_list return outputs @@ -322,7 +322,7 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs['dest_file'] = self.out_path + self.outputs.dest_file = self.out_path return outputs @@ -380,7 +380,7 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs['out_file'] = self.out_path + self.outputs.out_file = self.out_path return outputs @@ -422,5 +422,5 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs['out_list'] = self.out_list + self.outputs.out_list = self.out_list return outputs diff --git a/nipype/interfaces/diffusion_toolkit/dti.py b/nipype/interfaces/diffusion_toolkit/dti.py index 554f2bf38a..0ad734961a 100644 --- a/nipype/interfaces/diffusion_toolkit/dti.py +++ b/nipype/interfaces/diffusion_toolkit/dti.py @@ -92,18 +92,18 @@ def _list_outputs(self): output_type = self.inputs.output_type outputs = self.output_spec().get() - outputs['ADC'] = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_adc.' + output_type)) - outputs['B0'] = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_b0.' + output_type)) - outputs['L1'] = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_e1.' + output_type)) - outputs['L2'] = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_e2.' + output_type)) - outputs['L3'] = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_e3.' + output_type)) - outputs['exp'] = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_exp.' + output_type)) - outputs['FA'] = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_fa.' + output_type)) - outputs['FA_color'] = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_fa_color.' + output_type)) - outputs['tensor'] = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_tensor.' + output_type)) - outputs['V1'] = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_v1.' + output_type)) - outputs['V2'] = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_v2.' + output_type)) - outputs['V3'] = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_v3.' + output_type)) + self.outputs.ADC = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_adc.' + output_type)) + self.outputs.B0 = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_b0.' + output_type)) + self.outputs.L1 = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_e1.' + output_type)) + self.outputs.L2 = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_e2.' + output_type)) + self.outputs.L3 = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_e3.' + output_type)) + self.outputs.exp = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_exp.' + output_type)) + self.outputs.FA = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_fa.' + output_type)) + self.outputs.FA_color = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_fa_color.' + output_type)) + self.outputs.tensor = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_tensor.' + output_type)) + self.outputs.V1 = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_v1.' + output_type)) + self.outputs.V2 = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_v2.' + output_type)) + self.outputs.V3 = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_v3.' + output_type)) return outputs @@ -165,8 +165,8 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self.output_spec().get() - outputs['track_file'] = os.path.abspath(self.inputs.output_file) + self.outputs.track_file = os.path.abspath(self.inputs.output_file) if isdefined(self.inputs.output_mask) and self.inputs.output_mask: - outputs['mask_file'] = os.path.abspath(self.inputs.output_mask) + self.outputs.mask_file = os.path.abspath(self.inputs.output_mask) return outputs diff --git a/nipype/interfaces/diffusion_toolkit/odf.py b/nipype/interfaces/diffusion_toolkit/odf.py index b2f0b2c6a7..8f0906f0fa 100644 --- a/nipype/interfaces/diffusion_toolkit/odf.py +++ b/nipype/interfaces/diffusion_toolkit/odf.py @@ -87,7 +87,7 @@ def _format_arg(self, name, spec, value): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_file'] = os.path.abspath(self.inputs.out_file) + self.outputs.out_file = os.path.abspath(self.inputs.out_file) return outputs @@ -143,12 +143,12 @@ def _list_outputs(self): output_type = self.inputs.output_type outputs = self.output_spec().get() - outputs['B0'] = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_b0.' + output_type)) - outputs['DWI'] = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_dwi.' + output_type)) - outputs['max'] = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_max.' + output_type)) - outputs['ODF'] = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_odf.' + output_type)) + self.outputs.B0 = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_b0.' + output_type)) + self.outputs.DWI = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_dwi.' + output_type)) + self.outputs.max = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_max.' + output_type)) + self.outputs.ODF = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_odf.' + output_type)) if isdefined(self.inputs.output_entropy): - outputs['entropy'] = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_entropy.' + output_type)) + self.outputs.entropy = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_entropy.' + output_type)) return outputs @@ -231,5 +231,5 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self.output_spec().get() - outputs['track_file'] = os.path.abspath(self.inputs.out_file) + self.outputs.track_file = os.path.abspath(self.inputs.out_file) return outputs diff --git a/nipype/interfaces/diffusion_toolkit/postproc.py b/nipype/interfaces/diffusion_toolkit/postproc.py index 60d5b11115..02ccd5dd51 100644 --- a/nipype/interfaces/diffusion_toolkit/postproc.py +++ b/nipype/interfaces/diffusion_toolkit/postproc.py @@ -52,7 +52,7 @@ class SplineFilter(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['smoothed_track_file'] = os.path.abspath(self.inputs.output_file) + self.outputs.smoothed_track_file = os.path.abspath(self.inputs.output_file) return outputs @@ -92,5 +92,5 @@ class TrackMerge(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['track_file'] = os.path.abspath(self.inputs.output_file) + self.outputs.track_file = os.path.abspath(self.inputs.output_file) return outputs diff --git a/nipype/interfaces/dipy/preprocess.py b/nipype/interfaces/dipy/preprocess.py index 5ecc49b957..e67595a0e2 100644 --- a/nipype/interfaces/dipy/preprocess.py +++ b/nipype/interfaces/dipy/preprocess.py @@ -74,7 +74,7 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs['out_file'] = op.abspath(self._gen_outfilename()) + self.outputs.out_file = op.abspath(self._gen_outfilename()) return outputs def _gen_outfilename(self): @@ -154,7 +154,7 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs['out_file'] = op.abspath(self._gen_outfilename()) + self.outputs.out_file = op.abspath(self._gen_outfilename()) return outputs def _gen_outfilename(self): diff --git a/nipype/interfaces/dipy/simulate.py b/nipype/interfaces/dipy/simulate.py index 939d7d15a4..6ba34a10cf 100644 --- a/nipype/interfaces/dipy/simulate.py +++ b/nipype/interfaces/dipy/simulate.py @@ -257,10 +257,10 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs['out_file'] = op.abspath(self.inputs.out_file) - outputs['out_mask'] = op.abspath(self.inputs.out_mask) - outputs['out_bvec'] = op.abspath(self.inputs.out_bvec) - outputs['out_bval'] = op.abspath(self.inputs.out_bval) + self.outputs.out_file = op.abspath(self.inputs.out_file) + self.outputs.out_mask = op.abspath(self.inputs.out_mask) + self.outputs.out_bvec = op.abspath(self.inputs.out_bvec) + self.outputs.out_bval = op.abspath(self.inputs.out_bval) return outputs diff --git a/nipype/interfaces/dipy/tensors.py b/nipype/interfaces/dipy/tensors.py index edafea1306..9ad312b80a 100644 --- a/nipype/interfaces/dipy/tensors.py +++ b/nipype/interfaces/dipy/tensors.py @@ -111,7 +111,7 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs['out_file'] = op.abspath(self._gen_outfilename()) + self.outputs.out_file = op.abspath(self._gen_outfilename()) return outputs def _gen_filename(self, name): @@ -180,7 +180,7 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs['out_file'] = op.abspath(self._gen_outfilename()) + self.outputs.out_file = op.abspath(self._gen_outfilename()) return outputs def _gen_filename(self, name): diff --git a/nipype/interfaces/dipy/tracks.py b/nipype/interfaces/dipy/tracks.py index 7daff72589..074b340c2c 100644 --- a/nipype/interfaces/dipy/tracks.py +++ b/nipype/interfaces/dipy/tracks.py @@ -109,5 +109,5 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs['out_file'] = op.abspath(self.inputs.out_filename) + self.outputs.out_file = op.abspath(self.inputs.out_filename) return outputs diff --git a/nipype/interfaces/elastix/registration.py b/nipype/interfaces/elastix/registration.py index b72123c321..5d23644cab 100644 --- a/nipype/interfaces/elastix/registration.py +++ b/nipype/interfaces/elastix/registration.py @@ -73,9 +73,9 @@ def _list_outputs(self): opts = ['WriteResultImage', 'ResultImageFormat'] regex = re.compile(r'^\((\w+)\s(.+)\)$') - outputs['transform'] = [] - outputs['warped_files'] = [] - outputs['warped_files_flags'] = [] + self.outputs.transform = [] + self.outputs.warped_files = [] + self.outputs.warped_files_flags = [] for i, params in enumerate(self.inputs.parameters): config = {} @@ -89,7 +89,7 @@ def _list_outputs(self): value = self._cast(m.group(2).strip()) config[m.group(1).strip()] = value - outputs['transform'].append(op.join(out_dir, + self.outputs.transform.append(op.join(out_dir, 'TransformParameters.%01d.txt' % i)) warped_file = None @@ -97,11 +97,11 @@ def _list_outputs(self): warped_file = op.join(out_dir, 'result.%01d.%s' % (i, config['ResultImageFormat'])) - outputs['warped_files'].append(warped_file) - outputs['warped_files_flags'].append(config['WriteResultImage']) + self.outputs.warped_files.append(warped_file) + self.outputs.warped_files_flags.append(config['WriteResultImage']) - if outputs['warped_files_flags'][-1]: - outputs['warped_file'] = outputs['warped_files'][-1] + if self.outputs.warped_files_flags[-1]: + self.outputs.warped_file = self.outputs.warped_files[-1] return outputs @@ -160,7 +160,7 @@ class ApplyWarp(CommandLine): def _list_outputs(self): outputs = self._outputs().get() out_dir = op.abspath(self.inputs.output_path) - outputs['warped_file'] = op.join(out_dir, 'result.nii.gz') + self.outputs.warped_file = op.join(out_dir, 'result.nii.gz') return outputs @@ -200,9 +200,9 @@ class AnalyzeWarp(CommandLine): def _list_outputs(self): outputs = self._outputs().get() out_dir = op.abspath(self.inputs.output_path) - outputs['disp_field'] = op.join(out_dir, 'deformationField.nii.gz') - outputs['jacdet_map'] = op.join(out_dir, 'spatialJacobian.nii.gz') - outputs['jacmat_map'] = op.join(out_dir, 'fullSpatialJacobian.nii.gz') + self.outputs.disp_field = op.join(out_dir, 'deformationField.nii.gz') + self.outputs.jacdet_map = op.join(out_dir, 'spatialJacobian.nii.gz') + self.outputs.jacmat_map = op.join(out_dir, 'fullSpatialJacobian.nii.gz') return outputs @@ -244,5 +244,5 @@ def _list_outputs(self): fname, ext = op.splitext(op.basename(self.inputs.points_file)) - outputs['warped_file'] = op.join(out_dir, 'outputpoints%s' % ext) + self.outputs.warped_file = op.join(out_dir, 'outputpoints%s' % ext) return outputs diff --git a/nipype/interfaces/elastix/utils.py b/nipype/interfaces/elastix/utils.py index ab034dac07..f52602d54e 100644 --- a/nipype/interfaces/elastix/utils.py +++ b/nipype/interfaces/elastix/utils.py @@ -132,7 +132,7 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self.output_spec().get() - outputs['output_file'] = getattr(self, '_out_file') + self.outputs.output_file = getattr(self, '_out_file') return outputs def _get_outfile(self): diff --git a/nipype/interfaces/freesurfer/model.py b/nipype/interfaces/freesurfer/model.py index eb570469fa..2116201c14 100644 --- a/nipype/interfaces/freesurfer/model.py +++ b/nipype/interfaces/freesurfer/model.py @@ -100,9 +100,9 @@ class MRISPreproc(FSCommand): def _list_outputs(self): outputs = self.output_spec().get() outfile = self.inputs.out_file - outputs['out_file'] = outfile + self.outputs.out_file = outfile if not isdefined(outfile): - outputs['out_file'] = os.path.join(os.getcwd(), + self.outputs.out_file = os.path.join(os.getcwd(), 'concat_%s_%s.mgz' % (self.inputs.hemi, self.inputs.target)) return outputs @@ -284,20 +284,20 @@ def _list_outputs(self): glmdir = os.getcwd() else: glmdir = os.path.abspath(self.inputs.glm_dir) - outputs["glm_dir"] = glmdir + self.outputs.glm_dir = glmdir # Assign the output files that always get created - outputs["beta_file"] = os.path.join(glmdir, "beta.mgh") - outputs["error_var_file"] = os.path.join(glmdir, "rvar.mgh") - outputs["error_stddev_file"] = os.path.join(glmdir, "rstd.mgh") - outputs["mask_file"] = os.path.join(glmdir, "mask.mgh") - outputs["fwhm_file"] = os.path.join(glmdir, "fwhm.dat") - outputs["dof_file"] = os.path.join(glmdir, "dof.dat") + self.outputs.beta_file = os.path.join(glmdir, "beta.mgh") + self.outputs.error_var_file = os.path.join(glmdir, "rvar.mgh") + self.outputs.error_stddev_file = os.path.join(glmdir, "rstd.mgh") + self.outputs.mask_file = os.path.join(glmdir, "mask.mgh") + self.outputs.fwhm_file = os.path.join(glmdir, "fwhm.dat") + self.outputs.dof_file = os.path.join(glmdir, "dof.dat") # Assign the conditional outputs if isdefined(self.inputs.save_residual) and self.inputs.save_residual: - outputs["error_file"] = os.path.join(glmdir, "eres.mgh") + self.outputs.error_file = os.path.join(glmdir, "eres.mgh") if isdefined(self.inputs.save_estimate) and self.inputs.save_estimate: - outputs["estimate_file"] = os.path.join(glmdir, "yhat.mgh") + self.outputs.estimate_file = os.path.join(glmdir, "yhat.mgh") # Get the contrast directory name(s) if isdefined(self.inputs.contrast): @@ -311,18 +311,18 @@ def _list_outputs(self): contrasts = ["osgm"] # Add in the contrast images - outputs["sig_file"] = [os.path.join(glmdir, c, "sig.mgh") for c in contrasts] - outputs["ftest_file"] = [os.path.join(glmdir, c, "F.mgh") for c in contrasts] - outputs["gamma_file"] = [os.path.join(glmdir, c, "gamma.mgh") for c in contrasts] - outputs["gamma_var_file"] = [os.path.join(glmdir, c, "gammavar.mgh") for c in contrasts] + self.outputs.sig_file = [os.path.join(glmdir, c, "sig.mgh") for c in contrasts] + self.outputs.ftest_file = [os.path.join(glmdir, c, "F.mgh") for c in contrasts] + self.outputs.gamma_file = [os.path.join(glmdir, c, "gamma.mgh") for c in contrasts] + self.outputs.gamma_var_file = [os.path.join(glmdir, c, "gammavar.mgh") for c in contrasts] # Add in the PCA results, if relevant if isdefined(self.inputs.pca) and self.inputs.pca: pcadir = os.path.join(glmdir, "pca-eres") - outputs["spatial_eigenvectors"] = os.path.join(pcadir, "v.mgh") - outputs["frame_eigenvectors"] = os.path.join(pcadir, "u.mtx") - outputs["singluar_values"] = os.path.join(pcadir, "sdiag.mat") - outputs["svd_stats_file"] = os.path.join(pcadir, "stats.dat") + self.outputs.spatial_eigenvectors = os.path.join(pcadir, "v.mgh") + self.outputs.frame_eigenvectors = os.path.join(pcadir, "u.mtx") + self.outputs.singluar_values = os.path.join(pcadir, "sdiag.mat") + self.outputs.svd_stats_file = os.path.join(pcadir, "stats.dat") return outputs @@ -431,17 +431,17 @@ def _list_outputs(self): outfile = fname_presuffix(self.inputs.in_file, newpath=os.getcwd(), suffix='_thresh') - outputs['binary_file'] = os.path.abspath(outfile) + self.outputs.binary_file = os.path.abspath(outfile) value = self.inputs.count_file if isdefined(value): if isinstance(value, bool): if value: - outputs['count_file'] = fname_presuffix(self.inputs.in_file, + self.outputs.count_file = fname_presuffix(self.inputs.in_file, suffix='_count.txt', newpath=os.getcwd(), use_ext=False) else: - outputs['count_file'] = value + self.outputs.count_file = value return outputs def _format_arg(self, name, spec, value): @@ -529,10 +529,10 @@ class Concatenate(FSCommand): def _list_outputs(self): outputs = self.output_spec().get() if not isdefined(self.inputs.concatenated_file): - outputs['concatenated_file'] = os.path.join(os.getcwd(), + self.outputs.concatenated_file = os.path.join(os.getcwd(), 'concat_output.nii.gz') else: - outputs['concatenated_file'] = self.inputs.concatenated_file + self.outputs.concatenated_file = self.inputs.concatenated_file return outputs def _gen_filename(self, name): @@ -637,9 +637,9 @@ class SegStats(FSCommand): def _list_outputs(self): outputs = self.output_spec().get() if isdefined(self.inputs.summary_file): - outputs['summary_file'] = os.path.abspath(self.inputs.summary_file) + self.outputs.summary_file = os.path.abspath(self.inputs.summary_file) else: - outputs['summary_file'] = os.path.join(os.getcwd(), 'summary.stats') + self.outputs.summary_file = os.path.join(os.getcwd(), 'summary.stats') suffices = dict(avgwf_txt_file='_avgwf.txt', avgwf_file='_avgwf.nii.gz', sf_avg_file='sfavg.txt') if isdefined(self.inputs.segmentation_file): @@ -768,7 +768,7 @@ def _list_outputs(self): outfile = fname_presuffix(src, suffix='_vol.nii.gz', newpath=os.getcwd(), use_ext=False) - outputs['vol_label_file'] = outfile + self.outputs.vol_label_file = outfile return outputs def _gen_filename(self, name): @@ -834,11 +834,11 @@ class MS_LDA(FSCommand): def _list_outputs(self): outputs = self._outputs().get() if isdefined(self.inputs.output_synth): - outputs['vol_synth_file'] = os.path.abspath(self.inputs.output_synth) + self.outputs.vol_synth_file = os.path.abspath(self.inputs.output_synth) else: - outputs['vol_synth_file'] = os.path.abspath(self.inputs.vol_synth_file) + self.outputs.vol_synth_file = os.path.abspath(self.inputs.vol_synth_file) if not isdefined(self.inputs.use_weights) or self.inputs.use_weights is False: - outputs['weight_file'] = os.path.abspath(self.inputs.weight_file) + self.outputs.weight_file = os.path.abspath(self.inputs.weight_file) return outputs def _verify_weights_file_exists(self): diff --git a/nipype/interfaces/freesurfer/preprocess.py b/nipype/interfaces/freesurfer/preprocess.py index 4eeb049be3..c11a324a13 100644 --- a/nipype/interfaces/freesurfer/preprocess.py +++ b/nipype/interfaces/freesurfer/preprocess.py @@ -69,7 +69,7 @@ class ParseDICOMDir(FSCommand): def _list_outputs(self): outputs = self.output_spec().get() if isdefined(self.inputs.dicom_info_file): - outputs['dicom_info_file'] = os.path.join(os.getcwd(), self.inputs.dicom_info_file) + self.outputs.dicom_info_file = os.path.join(os.getcwd(), self.inputs.dicom_info_file) return outputs @@ -411,7 +411,7 @@ def _list_outputs(self): outfiles.append(fname_presuffix(outfile, suffix='%03d' % (i + 1))) outfile = outfiles - outputs['out_file'] = outfile + self.outputs.out_file = outfile return outputs def _gen_filename(self, name): @@ -587,7 +587,7 @@ def _get_outfilename(self): def _list_outputs(self): outputs = self.output_spec().get() - outputs['resampled_file'] = self._get_outfilename() + self.outputs.resampled_file = self._get_outfilename() return outputs def _gen_filename(self, name): @@ -755,8 +755,8 @@ def _list_outputs(self): outputs.update(FreeSurferSource(subject_id=self.inputs.subject_id, subjects_dir=subjects_dir, hemi=hemi)._list_outputs()) - outputs['subject_id'] = self.inputs.subject_id - outputs['subjects_dir'] = subjects_dir + self.outputs.subject_id = self.inputs.subject_id + self.outputs.subjects_dir = subjects_dir return outputs def _is_resuming(self): @@ -874,19 +874,19 @@ def _list_outputs(self): _in = self.inputs if isdefined(_in.out_reg_file): - outputs['out_reg_file'] = op.abspath(_in.out_reg_file) + self.outputs.out_reg_file = op.abspath(_in.out_reg_file) elif _in.source_file: suffix = '_bbreg_%s.dat' % _in.subject_id - outputs['out_reg_file'] = fname_presuffix(_in.source_file, + self.outputs.out_reg_file = fname_presuffix(_in.source_file, suffix=suffix, use_ext=False) if isdefined(_in.registered_file): if isinstance(_in.registered_file, bool): - outputs['registered_file'] = fname_presuffix(_in.source_file, + self.outputs.registered_file = fname_presuffix(_in.source_file, suffix='_bbreg') else: - outputs['registered_file'] = op.abspath(_in.registered_file) + self.outputs.registered_file = op.abspath(_in.registered_file) if isdefined(_in.out_fsl_file): if isinstance(_in.out_fsl_file, bool): @@ -894,11 +894,11 @@ def _list_outputs(self): out_fsl_file = fname_presuffix(_in.source_file, suffix=suffix, use_ext=False) - outputs['out_fsl_file'] = out_fsl_file + self.outputs.out_fsl_file = out_fsl_file else: - outputs['out_fsl_file'] = op.abspath(_in.out_fsl_file) + self.outputs.out_fsl_file = op.abspath(_in.out_fsl_file) - outputs['min_cost_file'] = outputs['out_reg_file'] + '.mincost' + self.outputs.min_cost_file = self.outputs.out_reg_file + '.mincost' return outputs def _format_arg(self, name, spec, value): @@ -1019,7 +1019,7 @@ def _get_outfile(self): def _list_outputs(self): outputs = self.output_spec().get() - outputs['transformed_file'] = os.path.abspath(self._get_outfile()) + self.outputs.transformed_file = os.path.abspath(self._get_outfile()) return outputs def _gen_filename(self, name): @@ -1088,7 +1088,7 @@ def _list_outputs(self): if not isdefined(outfile): outfile = self._gen_fname(self.inputs.in_file, suffix='_smooth') - outputs['smoothed_file'] = outfile + self.outputs.smoothed_file = outfile return outputs def _gen_filename(self, name): @@ -1205,9 +1205,9 @@ def _format_arg(self, name, spec, value): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_reg_file'] = self.inputs.out_reg_file + self.outputs.out_reg_file = self.inputs.out_reg_file if not isdefined(self.inputs.out_reg_file) and self.inputs.source_file: - outputs['out_reg_file'] = fname_presuffix(self.inputs.source_file, + self.outputs.out_reg_file = fname_presuffix(self.inputs.source_file, suffix='_robustreg.lta', use_ext=False) prefices = dict(src=self.inputs.source_file, trg=self.inputs.target_file) suffices = dict(registered_file=("src", "_robustreg", True), @@ -1294,9 +1294,9 @@ def _list_outputs(self): out_dir = self._gen_filename("out_dir") else: out_dir = self.inputs.out_dir - outputs["t1_image"] = os.path.join(out_dir, "T1.mgz") - outputs["pd_image"] = os.path.join(out_dir, "PD.mgz") - outputs["t2star_image"] = os.path.join(out_dir, "T2star.mgz") + self.outputs.t1_image = os.path.join(out_dir, "T1.mgz") + self.outputs.pd_image = os.path.join(out_dir, "PD.mgz") + self.outputs.t2star_image = os.path.join(out_dir, "T2star.mgz") return outputs def _gen_filename(self, name): @@ -1348,9 +1348,9 @@ class SynthesizeFLASH(FSCommand): def _list_outputs(self): outputs = self.output_spec().get() if isdefined(self.inputs.out_file): - outputs["out_file"] = self.inputs.out_file + self.outputs.out_file = self.inputs.out_file else: - outputs["out_file"] = self._gen_fname("synth-flash_%02d.mgz" % self.inputs.flip_angle, + self.outputs.out_file = self._gen_fname("synth-flash_%02d.mgz" % self.inputs.flip_angle, suffix="") return outputs diff --git a/nipype/interfaces/freesurfer/utils.py b/nipype/interfaces/freesurfer/utils.py index 88f6d7365a..65e6397a52 100644 --- a/nipype/interfaces/freesurfer/utils.py +++ b/nipype/interfaces/freesurfer/utils.py @@ -200,10 +200,10 @@ def _get_outfilename(self, opt="out_file"): def _list_outputs(self): outputs = self._outputs().get() - outputs["out_file"] = os.path.abspath(self._get_outfilename()) + self.outputs.out_file = os.path.abspath(self._get_outfilename()) hitsfile = self.inputs.hits_file if isdefined(hitsfile): - outputs["hits_file"] = hitsfile + self.outputs.hits_file = hitsfile if isinstance(hitsfile, bool): hitsfile = self._get_outfilename("hits_file") voxfile = self.inputs.vox_file @@ -214,7 +214,7 @@ def _list_outputs(self): prefix=self.inputs.hemi + ".", suffix="_vox.txt", use_ext=False) - outputs["vox_file"] = voxfile + self.outputs.vox_file = voxfile return outputs def _gen_filename(self, name): @@ -275,14 +275,14 @@ class SurfaceSmooth(FSCommand): def _list_outputs(self): outputs = self._outputs().get() - outputs["out_file"] = self.inputs.out_file - if not isdefined(outputs["out_file"]): + self.outputs.out_file = self.inputs.out_file + if not isdefined(self.outputs.out_file): in_file = self.inputs.in_file if isdefined(self.inputs.fwhm): kernel = self.inputs.fwhm else: kernel = self.inputs.smooth_iters - outputs["out_file"] = fname_presuffix(in_file, + self.outputs.out_file = fname_presuffix(in_file, suffix="_smooth%d" % kernel, newpath=os.getcwd()) return outputs @@ -353,8 +353,8 @@ class SurfaceTransform(FSCommand): def _list_outputs(self): outputs = self._outputs().get() - outputs["out_file"] = self.inputs.out_file - if not isdefined(outputs["out_file"]): + self.outputs.out_file = self.inputs.out_file + if not isdefined(self.outputs.out_file): if isdefined(self.inputs.source_file): source = self.inputs.source_file else: @@ -373,12 +373,12 @@ def _list_outputs(self): if isdefined(self.inputs.target_type): ext = "." + filemap[self.inputs.target_type] use_ext = False - outputs["out_file"] = fname_presuffix(source, + self.outputs.out_file = fname_presuffix(source, suffix=".%s%s" % (self.inputs.target_subject, ext), newpath=os.getcwd(), use_ext=use_ext) else: - outputs["out_file"] = os.path.abspath(self.inputs.out_file) + self.outputs.out_file = os.path.abspath(self.inputs.out_file) return outputs def _gen_filename(self, name): @@ -487,14 +487,14 @@ class ApplyMask(FSCommand): def _list_outputs(self): outputs = self._outputs().get() - outputs["out_file"] = self.inputs.out_file - if not isdefined(outputs["out_file"]): - outputs["out_file"] = fname_presuffix(self.inputs.in_file, + self.outputs.out_file = self.inputs.out_file + if not isdefined(self.outputs.out_file): + self.outputs.out_file = fname_presuffix(self.inputs.in_file, suffix="_masked", newpath=os.getcwd(), use_ext=True) else: - outputs["out_file"] = os.path.abspath(outputs["out_file"]) + self.outputs.out_file = os.path.abspath(self.outputs.out_file) return outputs def _gen_filename(self, name): @@ -705,7 +705,7 @@ def _list_outputs(self): if self.inputs.six_images: snapshots.extend(["%s-pos.tif", "%s-ant.tif"]) snapshots = [self._gen_fname(f % stem, suffix="") for f in snapshots] - outputs["snapshots"] = snapshots + self.outputs.snapshots = snapshots return outputs def _gen_filename(self, name): @@ -847,7 +847,7 @@ class MRIsConvert(FSCommand): def _list_outputs(self): outputs = self.output_spec().get() - outputs["converted"] = os.path.abspath(self._gen_outfilename()) + self.outputs.converted = os.path.abspath(self._gen_outfilename()) return outputs def _gen_filename(self, name): @@ -913,7 +913,7 @@ class MRITessellate(FSCommand): def _list_outputs(self): outputs = self.output_spec().get() - outputs['surface'] = os.path.abspath(self._gen_outfilename()) + self.outputs.surface = os.path.abspath(self._gen_outfilename()) return outputs def _gen_filename(self, name): @@ -983,7 +983,7 @@ class MRIPretess(FSCommand): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_file'] = os.path.abspath(self._gen_outfilename()) + self.outputs.out_file = os.path.abspath(self._gen_outfilename()) return outputs def _gen_filename(self, name): @@ -1040,7 +1040,7 @@ class MRIMarchingCubes(FSCommand): def _list_outputs(self): outputs = self.output_spec().get() - outputs['surface'] = self._gen_outfilename() + self.outputs.surface = self._gen_outfilename() return outputs def _gen_filename(self, name): @@ -1111,7 +1111,7 @@ class SmoothTessellation(FSCommand): def _list_outputs(self): outputs = self.output_spec().get() - outputs['surface'] = self._gen_outfilename() + self.outputs.surface = self._gen_outfilename() return outputs def _gen_filename(self, name): @@ -1168,7 +1168,7 @@ class MakeAverageSubject(FSCommand): def _list_outputs(self): outputs = self.output_spec().get() - outputs['average_subject_name'] = self.inputs.out_name + self.outputs.average_subject_name = self.inputs.out_name return outputs @@ -1278,9 +1278,9 @@ class Tkregister2(FSCommand): def _list_outputs(self): outputs = self._outputs().get() - outputs['reg_file'] = os.path.abspath(self.inputs.reg_file) + self.outputs.reg_file = os.path.abspath(self.inputs.reg_file) if isdefined(self.inputs.fsl_out): - outputs['fsl_file'] = os.path.abspath(self.inputs.fsl_out) + self.outputs.fsl_file = os.path.abspath(self.inputs.fsl_out) return outputs def _gen_outfilename(self): diff --git a/nipype/interfaces/fsl/epi.py b/nipype/interfaces/fsl/epi.py index 30b1a2c330..2b41a35ab8 100644 --- a/nipype/interfaces/fsl/epi.py +++ b/nipype/interfaces/fsl/epi.py @@ -96,7 +96,7 @@ def _parse_inputs(self, skip=None): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_fieldmap'] = self.inputs.out_fieldmap + self.outputs.out_fieldmap = self.inputs.out_fieldmap return outputs def _run_interface(self, runtime): @@ -256,7 +256,7 @@ def _format_arg(self, name, trait_spec, value): def _list_outputs(self): outputs = super(TOPUP, self)._list_outputs() - del outputs['out_base'] + del self.outputs.out_base base_path = None if isdefined(self.inputs.out_base): base_path, base, _ = split_filename(self.inputs.out_base) @@ -264,13 +264,13 @@ def _list_outputs(self): base_path = None else: base = split_filename(self.inputs.in_file)[1] + '_base' - outputs['out_fieldcoef'] = self._gen_fname(base, suffix='_fieldcoef', + self.outputs.out_fieldcoef = self._gen_fname(base, suffix='_fieldcoef', cwd=base_path) - outputs['out_movpar'] = self._gen_fname(base, suffix='_movpar', + self.outputs.out_movpar = self._gen_fname(base, suffix='_movpar', ext='.txt', cwd=base_path) if isdefined(self.inputs.encoding_direction): - outputs['out_enc_file'] = self._get_encfilename() + self.outputs.out_enc_file = self._get_encfilename() return outputs def _get_encfilename(self): @@ -494,8 +494,8 @@ def _format_arg(self, name, spec, value): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_corrected'] = os.path.abspath('%s.nii.gz' % self.inputs.out_base) - outputs['out_parameter'] = os.path.abspath('%s.eddy_parameters' % self.inputs.out_base) + self.outputs.out_corrected = os.path.abspath('%s.nii.gz' % self.inputs.out_base) + self.outputs.out_parameter = os.path.abspath('%s.eddy_parameters' % self.inputs.out_base) return outputs @@ -547,10 +547,10 @@ class SigLoss(FSLCommand): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_file'] = self.inputs.out_file - if ((not isdefined(outputs['out_file'])) and + self.outputs.out_file = self.inputs.out_file + if ((not isdefined(self.outputs.out_file)) and (isdefined(self.inputs.in_file))): - outputs['out_file'] = self._gen_fname(self.inputs.in_file, + self.outputs.out_file = self._gen_fname(self.inputs.in_file, suffix='_sigloss') return outputs @@ -651,33 +651,33 @@ class EpiReg(FSLCommand): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_file'] = os.path.join(os.getcwd(), + self.outputs.out_file = os.path.join(os.getcwd(), self.inputs.out_base + '.nii.gz') if not (isdefined(self.inputs.no_fmapreg) and self.inputs.no_fmapreg) and isdefined(self.inputs.fmap): - outputs['out_1vol'] = os.path.join(os.getcwd(), + self.outputs.out_1vol = os.path.join(os.getcwd(), self.inputs.out_base + '_1vol.nii.gz') - outputs['fmap2str_mat'] = os.path.join(os.getcwd(), + self.outputs.fmap2str_mat = os.path.join(os.getcwd(), self.inputs.out_base + '_fieldmap2str.mat') - outputs['fmap2epi_mat'] = os.path.join(os.getcwd(), + self.outputs.fmap2epi_mat = os.path.join(os.getcwd(), self.inputs.out_base + '_fieldmaprads2epi.mat') - outputs['fmap_epi'] = os.path.join(os.getcwd(), + self.outputs.fmap_epi = os.path.join(os.getcwd(), self.inputs.out_base + '_fieldmaprads2epi.nii.gz') - outputs['fmap_str'] = os.path.join(os.getcwd(), + self.outputs.fmap_str = os.path.join(os.getcwd(), self.inputs.out_base + '_fieldmaprads2str.nii.gz') - outputs['fmapmag_str'] = os.path.join(os.getcwd(), + self.outputs.fmapmag_str = os.path.join(os.getcwd(), self.inputs.out_base + '_fieldmap2str.nii.gz') - outputs['shiftmap'] = os.path.join(os.getcwd(), + self.outputs.shiftmap = os.path.join(os.getcwd(), self.inputs.out_base + '_fieldmaprads2epi_shift.nii.gz') - outputs['fullwarp'] = os.path.join(os.getcwd(), + self.outputs.fullwarp = os.path.join(os.getcwd(), self.inputs.out_base + '_warp.nii.gz') - outputs['epi2str_inv'] = os.path.join(os.getcwd(), + self.outputs.epi2str_inv = os.path.join(os.getcwd(), self.inputs.out_base + '_inv.mat') - outputs['epi2str_mat'] = os.path.join(os.getcwd(), + self.outputs.epi2str_mat = os.path.join(os.getcwd(), self.inputs.out_base + '.mat') - outputs['wmedge'] = os.path.join(os.getcwd(), + self.outputs.wmedge = os.path.join(os.getcwd(), self.inputs.out_base + '_fast_wmedge.nii.gz') - outputs['wmseg'] = os.path.join(os.getcwd(), + self.outputs.wmseg = os.path.join(os.getcwd(), self.inputs.out_base + '_fast_wmseg.nii.gz') return outputs @@ -791,24 +791,24 @@ def _gen_filename(self, name): def _list_outputs(self): outputs = self.output_spec().get() if not isdefined(self.inputs.exfdw): - outputs['exfdw'] = self._gen_filename('exfdw') + self.outputs.exfdw = self._gen_filename('exfdw') else: - outputs['exfdw'] = self.inputs.exfdw + self.outputs.exfdw = self.inputs.exfdw if isdefined(self.inputs.epi_file): if isdefined(self.inputs.epidw): - outputs['unwarped_file'] = self.inputs.epidw + self.outputs.unwarped_file = self.inputs.epidw else: - outputs['unwarped_file'] = self._gen_filename('epidw') + self.outputs.unwarped_file = self._gen_filename('epidw') if not isdefined(self.inputs.vsm): - outputs['vsm_file'] = self._gen_filename('vsm') + self.outputs.vsm_file = self._gen_filename('vsm') else: - outputs['vsm_file'] = self._gen_fname(self.inputs.vsm) + self.outputs.vsm_file = self._gen_fname(self.inputs.vsm) if not isdefined(self.inputs.tmpdir): outputs[ 'exf_mask'] = self._gen_fname(cwd=self._gen_filename('tmpdir'), basename='maskexf') else: - outputs['exf_mask'] = self._gen_fname(cwd=self.inputs.tmpdir, + self.outputs.exf_mask = self._gen_fname(cwd=self.inputs.tmpdir, basename='maskexf') return outputs diff --git a/nipype/interfaces/fsl/maths.py b/nipype/interfaces/fsl/maths.py index c22874d13f..660d62a28c 100644 --- a/nipype/interfaces/fsl/maths.py +++ b/nipype/interfaces/fsl/maths.py @@ -49,10 +49,10 @@ class MathsCommand(FSLCommand): def _list_outputs(self): outputs = self.output_spec().get() - outputs["out_file"] = self.inputs.out_file + self.outputs.out_file = self.inputs.out_file if not isdefined(self.inputs.out_file): - outputs["out_file"] = self._gen_fname(self.inputs.in_file, suffix=self._suffix) - outputs["out_file"] = os.path.abspath(outputs["out_file"]) + self.outputs.out_file = self._gen_fname(self.inputs.in_file, suffix=self._suffix) + self.outputs.out_file = os.path.abspath(self.outputs.out_file) return outputs def _gen_filename(self, name): diff --git a/nipype/interfaces/fsl/model.py b/nipype/interfaces/fsl/model.py index 3d07fa21de..51978423b7 100644 --- a/nipype/interfaces/fsl/model.py +++ b/nipype/interfaces/fsl/model.py @@ -346,15 +346,15 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self.output_spec().get() cwd = os.getcwd() - outputs['fsf_files'] = [] - outputs['ev_files'] = [] + self.outputs.fsf_files = [] + self.outputs.ev_files = [] usetd = 0 basis_key = list(self.inputs.bases.keys())[0] if basis_key in ['dgamma', 'gamma']: usetd = int(self.inputs.bases[basis_key]['derivs']) for runno, runinfo in enumerate(self._format_session_info(self.inputs.session_info)): - outputs['fsf_files'].append(os.path.join(cwd, 'run%d.fsf' % runno)) - outputs['ev_files'].insert(runno, []) + self.outputs.fsf_files.append(os.path.join(cwd, 'run%d.fsf' % runno)) + self.outputs.ev_files.insert(runno, []) evname = [] for field in ['cond', 'regress']: for i, cond in enumerate(runinfo[field]): @@ -366,7 +366,7 @@ def _list_outputs(self): if field == 'cond': if usetd: evname.append(name + 'TD') - outputs['ev_files'][runno].append( + self.outputs.ev_files[runno].append( os.path.join(cwd, evfname)) return outputs @@ -390,7 +390,7 @@ class FEAT(FSLCommand): def _list_outputs(self): outputs = self._outputs().get() is_ica = False - outputs['feat_dir'] = None + self.outputs.feat_dir = None with open(self.inputs.fsf_file, 'rt') as fp: text = fp.read() if "set fmri(inmelodic) 1" in text: @@ -400,15 +400,15 @@ def _list_outputs(self): try: outputdir_spec = line.split('"')[-2] if os.path.exists(outputdir_spec): - outputs['feat_dir'] = outputdir_spec + self.outputs.feat_dir = outputdir_spec except: pass - if not outputs['feat_dir']: + if not self.outputs.feat_dir: if is_ica: - outputs['feat_dir'] = glob(os.path.join(os.getcwd(), '*ica'))[0] + self.outputs.feat_dir = glob(os.path.join(os.getcwd(), '*ica'))[0] else: - outputs['feat_dir'] = glob(os.path.join(os.getcwd(), '*feat'))[0] + self.outputs.feat_dir = glob(os.path.join(os.getcwd(), '*feat'))[0] print('Outputs from FEATmodel:', outputs) return outputs @@ -460,22 +460,22 @@ def _list_outputs(self): root = self._get_design_root(list_to_filename(self.inputs.fsf_file)) design_file = glob(os.path.join(os.getcwd(), '%s*.mat' % root)) assert len(design_file) == 1, 'No mat file generated by FEAT Model' - outputs['design_file'] = design_file[0] + self.outputs.design_file = design_file[0] design_image = glob(os.path.join(os.getcwd(), '%s.png' % root)) assert len( design_image) == 1, 'No design image generated by FEAT Model' - outputs['design_image'] = design_image[0] + self.outputs.design_image = design_image[0] design_cov = glob(os.path.join(os.getcwd(), '%s_cov.png' % root)) assert len( design_cov) == 1, 'No covariance image generated by FEAT Model' - outputs['design_cov'] = design_cov[0] + self.outputs.design_cov = design_cov[0] con_file = glob(os.path.join(os.getcwd(), '%s*.con' % root)) assert len(con_file) == 1, 'No con file generated by FEAT Model' - outputs['con_file'] = con_file[0] + self.outputs.con_file = con_file[0] fcon_file = glob(os.path.join(os.getcwd(), '%s*.fts' % root)) if fcon_file: assert len(fcon_file) == 1, 'No fts file generated by FEAT Model' - outputs['fcon_file'] = fcon_file[0] + self.outputs.fcon_file = fcon_file[0] return outputs @@ -697,20 +697,20 @@ def _list_outputs(self): outputs = self._outputs().get() cwd = os.getcwd() results_dir = os.path.join(cwd, self.inputs.results_dir) - outputs['results_dir'] = results_dir + self.outputs.results_dir = results_dir pe_files = self._get_pe_files(results_dir) if pe_files: - outputs['param_estimates'] = pe_files - outputs['residual4d'] = self._gen_fname('res4d.nii', cwd=results_dir) - outputs['dof_file'] = os.path.join(results_dir, 'dof') - outputs['sigmasquareds'] = self._gen_fname('sigmasquareds.nii', + self.outputs.param_estimates = pe_files + self.outputs.residual4d = self._gen_fname('res4d.nii', cwd=results_dir) + self.outputs.dof_file = os.path.join(results_dir, 'dof') + self.outputs.sigmasquareds = self._gen_fname('sigmasquareds.nii', cwd=results_dir) - outputs['thresholdac'] = self._gen_fname('threshac1.nii', + self.outputs.thresholdac = self._gen_fname('threshac1.nii', cwd=results_dir) if Info.version() and LooseVersion(Info.version()) < LooseVersion('5.0.7'): - outputs['corrections'] = self._gen_fname('corrections.nii', + self.outputs.corrections = self._gen_fname('corrections.nii', cwd=results_dir) - outputs['logfile'] = self._gen_fname('logfile', + self.outputs.logfile = self._gen_fname('logfile', change_ext=False, cwd=results_dir) @@ -734,10 +734,10 @@ def _list_outputs(self): tstats.append(self._gen_fname('tstat%d.nii' % (base_contrast + i), cwd=pth)) if copes: - outputs['copes'] = copes - outputs['varcopes'] = varcopes - outputs['zstats'] = zstats - outputs['tstats'] = tstats + self.outputs.copes = copes + self.outputs.varcopes = varcopes + self.outputs.zstats = zstats + self.outputs.tstats = tstats fstats = [] zfstats = [] for i in range(numfcons): @@ -747,8 +747,8 @@ def _list_outputs(self): self._gen_fname('zfstat%d.nii' % (base_contrast + i), cwd=pth)) if fstats: - outputs['fstats'] = fstats - outputs['zfstats'] = zfstats + self.outputs.fstats = fstats + self.outputs.zfstats = zfstats return outputs @@ -795,7 +795,7 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs['fsf_file'] = os.path.abspath( + self.outputs.fsf_file = os.path.abspath( os.path.join(os.getcwd(), 'register.fsf')) return outputs @@ -914,59 +914,59 @@ def _list_outputs(self): pes = human_order_sorted(glob(os.path.join(pth, 'pe[0-9]*.*'))) assert len(pes) >= 1, 'No pe volumes generated by FSL Estimate' - outputs['pes'] = pes + self.outputs.pes = pes res4d = human_order_sorted(glob(os.path.join(pth, 'res4d.*'))) assert len(res4d) == 1, 'No residual volume generated by FSL Estimate' - outputs['res4d'] = res4d[0] + self.outputs.res4d = res4d[0] copes = human_order_sorted(glob(os.path.join(pth, 'cope[0-9]*.*'))) assert len(copes) >= 1, 'No cope volumes generated by FSL CEstimate' - outputs['copes'] = copes + self.outputs.copes = copes var_copes = human_order_sorted( glob(os.path.join(pth, 'varcope[0-9]*.*'))) assert len( var_copes) >= 1, 'No varcope volumes generated by FSL CEstimate' - outputs['var_copes'] = var_copes + self.outputs.var_copes = var_copes zstats = human_order_sorted(glob(os.path.join(pth, 'zstat[0-9]*.*'))) assert len(zstats) >= 1, 'No zstat volumes generated by FSL CEstimate' - outputs['zstats'] = zstats + self.outputs.zstats = zstats if isdefined(self.inputs.f_con_file): zfstats = human_order_sorted( glob(os.path.join(pth, 'zfstat[0-9]*.*'))) assert len( zfstats) >= 1, 'No zfstat volumes generated by FSL CEstimate' - outputs['zfstats'] = zfstats + self.outputs.zfstats = zfstats fstats = human_order_sorted( glob(os.path.join(pth, 'fstat[0-9]*.*'))) assert len( fstats) >= 1, 'No fstat volumes generated by FSL CEstimate' - outputs['fstats'] = fstats + self.outputs.fstats = fstats tstats = human_order_sorted(glob(os.path.join(pth, 'tstat[0-9]*.*'))) assert len(tstats) >= 1, 'No tstat volumes generated by FSL CEstimate' - outputs['tstats'] = tstats + self.outputs.tstats = tstats mrefs = human_order_sorted( glob(os.path.join(pth, 'mean_random_effects_var[0-9]*.*'))) assert len( mrefs) >= 1, 'No mean random effects volumes generated by FLAMEO' - outputs['mrefvars'] = mrefs + self.outputs.mrefvars = mrefs tdof = human_order_sorted(glob(os.path.join(pth, 'tdof_t[0-9]*.*'))) assert len(tdof) >= 1, 'No T dof volumes generated by FLAMEO' - outputs['tdof'] = tdof + self.outputs.tdof = tdof weights = human_order_sorted( glob(os.path.join(pth, 'weights[0-9]*.*'))) assert len(weights) >= 1, 'No weight volumes generated by FLAMEO' - outputs['weights'] = weights + self.outputs.weights = weights - outputs['stats_dir'] = pth + self.outputs.stats_dir = pth return outputs @@ -1088,11 +1088,11 @@ def _list_outputs(self): neffs.append(self._gen_fname('neff%d.nii' % (base_contrast + i), cwd=pth)) if copes: - outputs['copes'] = copes - outputs['varcopes'] = varcopes - outputs['zstats'] = zstats - outputs['tstats'] = tstats - outputs['neffs'] = neffs + self.outputs.copes = copes + self.outputs.varcopes = varcopes + self.outputs.zstats = zstats + self.outputs.tstats = tstats + self.outputs.neffs = neffs fstats = [] zfstats = [] for i in range(numfcons): @@ -1102,8 +1102,8 @@ def _list_outputs(self): self._gen_fname('zfstat%d.nii' % (base_contrast + i), cwd=pth)) if fstats: - outputs['fstats'] = fstats - outputs['zfstats'] = zfstats + self.outputs.fstats = fstats + self.outputs.zfstats = zfstats return outputs @@ -1373,12 +1373,12 @@ class SMM(FSLCommand): def _list_outputs(self): outputs = self._outputs().get() # TODO get the true logdir from the stdout - outputs['null_p_map'] = self._gen_fname(basename="w1_mean", + self.outputs.null_p_map = self._gen_fname(basename="w1_mean", cwd="logdir") - outputs['activation_p_map'] = self._gen_fname( + self.outputs.activation_p_map = self._gen_fname( basename="w2_mean", cwd="logdir") if not isdefined(self.inputs.no_deactivation_class) or not self.inputs.no_deactivation_class: - outputs['deactivation_p_map'] = self._gen_fname( + self.outputs.deactivation_p_map = self._gen_fname( basename="w3_mean", cwd="logdir") return outputs @@ -1502,11 +1502,11 @@ class MELODIC(FSLCommand): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_dir'] = self.inputs.out_dir - if not isdefined(outputs['out_dir']): - outputs['out_dir'] = self._gen_filename("out_dir") + self.outputs.out_dir = self.inputs.out_dir + if not isdefined(self.outputs.out_dir): + self.outputs.out_dir = self._gen_filename("out_dir") if isdefined(self.inputs.report) and self.inputs.report: - outputs['report_dir'] = os.path.join( + self.outputs.report_dir = os.path.join( self._gen_filename("out_dir"), "report") return outputs @@ -1791,9 +1791,9 @@ class Randomise(FSLCommand): def _list_outputs(self): outputs = self.output_spec().get() - outputs['tstat_files'] = glob(self._gen_fname( + self.outputs.tstat_files = glob(self._gen_fname( '%s_tstat*.nii' % self.inputs.base_name)) - outputs['fstat_files'] = glob(self._gen_fname( + self.outputs.fstat_files = glob(self._gen_fname( '%s_fstat*.nii' % self.inputs.base_name)) prefix = False if self.inputs.tfce or self.inputs.tfce2D: @@ -1805,14 +1805,14 @@ def _list_outputs(self): elif self.inputs.cm_thresh or self.inputs.f_cm_thresh: prefix = 'clusterm' if prefix: - outputs['t_p_files'] = glob(self._gen_fname( + self.outputs.t_p_files = glob(self._gen_fname( '%s_%s_p_tstat*' % (self.inputs.base_name, prefix))) - outputs['t_corrected_p_files'] = glob(self._gen_fname( + self.outputs.t_corrected_p_files = glob(self._gen_fname( '%s_%s_corrp_tstat*.nii' % (self.inputs.base_name, prefix))) - outputs['f_p_files'] = glob(self._gen_fname( + self.outputs.f_p_files = glob(self._gen_fname( '%s_%s_p_fstat*.nii' % (self.inputs.base_name, prefix))) - outputs['f_corrected_p_files'] = glob(self._gen_fname( + self.outputs.f_corrected_p_files = glob(self._gen_fname( '%s_%s_corrp_fstat*.nii' % (self.inputs.base_name, prefix))) return outputs @@ -1929,37 +1929,37 @@ def _list_outputs(self): outputs = super(GLM, self)._list_outputs() if isdefined(self.inputs.out_cope): - outputs['out_cope'] = os.path.abspath(self.inputs.out_cope) + self.outputs.out_cope = os.path.abspath(self.inputs.out_cope) if isdefined(self.inputs.out_z_name): - outputs['out_z'] = os.path.abspath(self.inputs.out_z_name) + self.outputs.out_z = os.path.abspath(self.inputs.out_z_name) if isdefined(self.inputs.out_t_name): - outputs['out_t'] = os.path.abspath(self.inputs.out_t_name) + self.outputs.out_t = os.path.abspath(self.inputs.out_t_name) if isdefined(self.inputs.out_p_name): - outputs['out_p'] = os.path.abspath(self.inputs.out_p_name) + self.outputs.out_p = os.path.abspath(self.inputs.out_p_name) if isdefined(self.inputs.out_f_name): - outputs['out_f'] = os.path.abspath(self.inputs.out_f_name) + self.outputs.out_f = os.path.abspath(self.inputs.out_f_name) if isdefined(self.inputs.out_pf_name): - outputs['out_pf'] = os.path.abspath(self.inputs.out_pf_name) + self.outputs.out_pf = os.path.abspath(self.inputs.out_pf_name) if isdefined(self.inputs.out_res_name): - outputs['out_res'] = os.path.abspath(self.inputs.out_res_name) + self.outputs.out_res = os.path.abspath(self.inputs.out_res_name) if isdefined(self.inputs.out_varcb_name): - outputs['out_varcb'] = os.path.abspath(self.inputs.out_varcb_name) + self.outputs.out_varcb = os.path.abspath(self.inputs.out_varcb_name) if isdefined(self.inputs.out_sigsq_name): - outputs['out_sigsq'] = os.path.abspath(self.inputs.out_sigsq_name) + self.outputs.out_sigsq = os.path.abspath(self.inputs.out_sigsq_name) if isdefined(self.inputs.out_data_name): - outputs['out_data'] = os.path.abspath(self.inputs.out_data_name) + self.outputs.out_data = os.path.abspath(self.inputs.out_data_name) if isdefined(self.inputs.out_vnscales_name): - outputs['out_vnscales'] = os.path.abspath( + self.outputs.out_vnscales = os.path.abspath( self.inputs.out_vnscales_name) return outputs diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index 26a61c6d8a..ac8267006a 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -283,54 +283,54 @@ def _post_run(self): else: basefile = self.inputs.in_files[-1] - outputs['tissue_class_map'] = self._gen_fname(basefile, + self.outputs.tissue_class_map = self._gen_fname(basefile, suffix='_seg') if self.inputs.segments: - outputs['tissue_class_files'] = [] + self.outputs.tissue_class_files = [] for i in range(nclasses): - outputs['tissue_class_files'].append( + self.outputs.tissue_class_files.append( self._gen_fname(basefile, suffix='_seg_%d' % i)) if isdefined(self.inputs.output_biascorrected): - outputs['restored_image'] = [] + self.outputs.restored_image = [] if len(self.inputs.in_files) > 1: # for multi-image segmentation there is one corrected image # per input for val, f in enumerate(self.inputs.in_files): # image numbering is 1-based - outputs['restored_image'].append( + self.outputs.restored_image.append( self._gen_fname(basefile, suffix='_restore_%d' % (val + 1))) else: # single image segmentation has unnumbered output image - outputs['restored_image'].append( + self.outputs.restored_image.append( self._gen_fname(basefile, suffix='_restore')) - outputs['mixeltype'] = self._gen_fname(basefile, suffix='_mixeltype') + self.outputs.mixeltype = self._gen_fname(basefile, suffix='_mixeltype') if not self.inputs.no_pve: - outputs['partial_volume_map'] = self._gen_fname( + self.outputs.partial_volume_map = self._gen_fname( basefile, suffix='_pveseg') - outputs['partial_volume_files'] = [] + self.outputs.partial_volume_files = [] for i in range(nclasses): outputs[ 'partial_volume_files'].append(self._gen_fname(basefile, suffix='_pve_%d' % i)) if self.inputs.output_biasfield: - outputs['bias_field'] = [] + self.outputs.bias_field = [] if len(self.inputs.in_files) > 1: # for multi-image segmentation there is one bias field image # per input for val, f in enumerate(self.inputs.in_files): # image numbering is 1-based - outputs['bias_field'].append( + self.outputs.bias_field.append( self._gen_fname(basefile, suffix='_bias_%d' % (val + 1))) else: # single image segmentation has unnumbered output image - outputs['bias_field'].append( + self.outputs.bias_field.append( self._gen_fname(basefile, suffix='_bias')) if self.inputs.probability_maps: - outputs['probability_maps'] = [] + self.outputs.probability_maps = [] for i in range(nclasses): - outputs['probability_maps'].append( + self.outputs.probability_maps.append( self._gen_fname(basefile, suffix='_prob_%d' % i)) return outputs @@ -626,12 +626,12 @@ class MCFLIRT(FSLCommand): def _post_run(self): cwd = os.getcwd() - outputs['out_file'] = self._gen_outfilename() + self.outputs.out_file = self._gen_outfilename() if isdefined(self.inputs.stats_imgs) and self.inputs.stats_imgs: - outputs['variance_img'] = self._gen_fname(outputs['out_file'] + + self.outputs.variance_img = self._gen_fname(self.outputs.out_file + '_variance.ext', cwd=cwd) - outputs['std_img'] = self._gen_fname(outputs['out_file'] + + self.outputs.std_img = self._gen_fname(self.outputs.out_file + '_sigma.ext', cwd=cwd) # The mean image created if -stats option is specified ('meanvol') @@ -641,24 +641,24 @@ def _post_run(self): # 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'] + + self.outputs.mean_img = self._gen_fname(self.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']) + _, filename = os.path.split(self.outputs.out_file) matpathname = os.path.join(cwd, filename + '.mat') _, _, _, timepoints = load(self.inputs.in_file).shape - outputs['mat_file'] = [] + self.outputs.mat_file = [] for t in range(timepoints): - outputs['mat_file'].append(os.path.join(matpathname, + self.outputs.mat_file.append(os.path.join(matpathname, 'MAT_%04d' % t)) if isdefined(self.inputs.save_plots) and self.inputs.save_plots: # Note - if e.g. out_file has .nii.gz, you get .nii.gz.par, # which is what mcflirt does! - outputs['par_file'] = outputs['out_file'] + '.par' + self.outputs.par_file = self.outputs.out_file + '.par' if isdefined(self.inputs.save_rms) and self.inputs.save_rms: - outfile = outputs['out_file'] - outputs['rms_files'] = [outfile + '_abs.rms', outfile + '_rel.rms'] + outfile = self.outputs.out_file + self.outputs.rms_files = [outfile + '_abs.rms', outfile + '_rel.rms'] return outputs def _gen_filename(self, name): @@ -961,10 +961,10 @@ def _format_arg(self, name, spec, value): def _post_run(self): if not isdefined(self.inputs.out_file): - outputs['out_file'] = self._gen_fname(self.inputs.in_file, + self.outputs.out_file = self._gen_fname(self.inputs.in_file, suffix='_warp') else: - outputs['out_file'] = os.path.abspath(self.inputs.out_file) + self.outputs.out_file = os.path.abspath(self.inputs.out_file) return outputs def _gen_filename(self, name): @@ -1019,12 +1019,11 @@ class SliceTimer(FSLCommand): output_spec = SliceTimerOutputSpec def _post_run(self): - out_file = self.inputs.out_file if not isdefined(out_file): out_file = self._gen_fname(self.inputs.in_file, suffix='_st') - outputs['slice_time_corrected_file'] = os.path.abspath(out_file) + self.outputs.slice_time_corrected_file = os.path.abspath(out_file) return outputs def _gen_filename(self, name): @@ -1103,7 +1102,7 @@ def _post_run(self): if not isdefined(out_file): out_file = self._gen_fname(self.inputs.in_file, suffix='_smooth') - outputs['smoothed_file'] = os.path.abspath(out_file) + self.outputs.smoothed_file = os.path.abspath(out_file) return outputs def _gen_filename(self, name): @@ -1416,7 +1415,7 @@ def _post_run(self): elif isdefined(self.inputs.complex_phase_file): out_file = self._gen_fname(self.inputs.complex_phase_file, suffix='_phase_unwrapped') - outputs['unwrapped_phase_file'] = os.path.abspath(out_file) + self.outputs.unwrapped_phase_file = os.path.abspath(out_file) return outputs def _gen_filename(self, name): @@ -1512,12 +1511,12 @@ def _post_run(self): 'L_Puta', 'R_Puta', 'L_Thal', 'R_Thal', 'BrStem'] - outputs['original_segmentations'] = \ + self.outputs.original_segmentations = \ self._gen_fname('original_segmentations') - outputs['segmentation_file'] = self._gen_fname('segmentation_file') - outputs['vtk_surfaces'] = self._gen_mesh_names('vtk_surfaces', + self.outputs.segmentation_file = self._gen_fname('segmentation_file') + self.outputs.vtk_surfaces = self._gen_mesh_names('vtk_surfaces', structures) - outputs['bvars'] = self._gen_mesh_names('bvars', structures) + self.outputs.bvars = self._gen_mesh_names('bvars', structures) return outputs def _gen_fname(self, name): diff --git a/nipype/interfaces/fsl/utils.py b/nipype/interfaces/fsl/utils.py index 471f41a519..5d4acfc7f0 100644 --- a/nipype/interfaces/fsl/utils.py +++ b/nipype/interfaces/fsl/utils.py @@ -122,13 +122,13 @@ class ImageMeants(FSLCommand): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_file'] = self.inputs.out_file - if not isdefined(outputs['out_file']): - outputs['out_file'] = self._gen_fname(self.inputs.in_file, + self.outputs.out_file = self.inputs.out_file + if not isdefined(self.outputs.out_file): + self.outputs.out_file = self._gen_fname(self.inputs.in_file, suffix='_ts', ext='.txt', change_ext=True) - outputs['out_file'] = os.path.abspath(outputs['out_file']) + self.outputs.out_file = os.path.abspath(self.outputs.out_file) return outputs def _gen_filename(self, name): @@ -338,11 +338,11 @@ def _list_outputs(self): """ outputs = self._outputs().get() - outputs['roi_file'] = self.inputs.roi_file - if not isdefined(outputs['roi_file']): - outputs['roi_file'] = self._gen_fname(self.inputs.in_file, + self.outputs.roi_file = self.inputs.roi_file + if not isdefined(self.outputs.roi_file): + self.outputs.roi_file = self._gen_fname(self.inputs.in_file, suffix='_roi') - outputs['roi_file'] = os.path.abspath(outputs['roi_file']) + self.outputs.roi_file = os.path.abspath(self.outputs.roi_file) return outputs def _gen_filename(self, name): @@ -393,7 +393,7 @@ def _list_outputs(self): outbase = 'vol*' if isdefined(self.inputs.out_base_name): outbase = '%s*' % self.inputs.out_base_name - outputs['out_files'] = sorted(glob(os.path.join(os.getcwd(), + self.outputs.out_files = sorted(glob(os.path.join(os.getcwd(), outbase + ext))) return outputs @@ -450,11 +450,11 @@ def _list_outputs(self): if isdefined(self.inputs.suffix): suffix = self.inputs.suffix outputs = self._outputs().get() - outputs['out_file'] = self.inputs.out_file - if not isdefined(outputs['out_file']): - outputs['out_file'] = self._gen_fname(self.inputs.in_file, + self.outputs.out_file = self.inputs.out_file + if not isdefined(self.outputs.out_file): + self.outputs.out_file = self._gen_fname(self.inputs.in_file, suffix=suffix) - outputs['out_file'] = os.path.abspath(outputs['out_file']) + self.outputs.out_file = os.path.abspath(self.outputs.out_file) return outputs @@ -512,11 +512,11 @@ def _format_arg(self, name, trait_spec, value): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_file'] = self.inputs.out_file - if not isdefined(outputs['out_file']): - outputs['out_file'] = self._gen_fname( + self.outputs.out_file = self.inputs.out_file + if not isdefined(self.outputs.out_file): + self.outputs.out_file = self._gen_fname( self.inputs.in_file, suffix='_regfilt') - outputs['out_file'] = os.path.abspath(outputs['out_file']) + self.outputs.out_file = os.path.abspath(self.outputs.out_file) return outputs def _gen_filename(self, name): @@ -767,7 +767,7 @@ def _list_outputs(self): else: stem = split_filename(self.inputs.stat_image)[1] out_file = self._gen_fname(stem, suffix='_overlay') - outputs['out_file'] = os.path.abspath(out_file) + self.outputs.out_file = os.path.abspath(out_file) return outputs def _gen_filename(self, name): @@ -869,7 +869,7 @@ def _list_outputs(self): out_file = self.inputs.out_file if not isdefined(out_file): out_file = self._gen_fname(self.inputs.in_file, ext='.png') - outputs['out_file'] = os.path.abspath(out_file) + self.outputs.out_file = os.path.abspath(out_file) return outputs def _gen_filename(self, name): @@ -972,7 +972,7 @@ def _list_outputs(self): else: infile = self.inputs.in_file out_file = self._gen_fname(infile, ext='.png') - outputs['out_file'] = os.path.abspath(out_file) + self.outputs.out_file = os.path.abspath(out_file) return outputs def _gen_filename(self, name): @@ -1083,7 +1083,7 @@ def _list_outputs(self): self.inputs.plot_type[:3]] out_file = fname_presuffix( infile, suffix="_%s.png" % plttype, use_ext=False) - outputs['out_file'] = os.path.abspath(out_file) + self.outputs.out_file = os.path.abspath(out_file) return outputs def _gen_filename(self, name): @@ -1160,7 +1160,7 @@ def _list_outputs(self): suffix="_fix.mat", newpath=os.getcwd(), use_ext=False) - outputs["out_file"] = os.path.abspath(outfile) + self.outputs.out_file = os.path.abspath(outfile) return outputs def _gen_filename(self, name): @@ -1202,11 +1202,11 @@ class SwapDimensions(FSLCommand): def _list_outputs(self): outputs = self._outputs().get() - outputs["out_file"] = self.inputs.out_file + self.outputs.out_file = self.inputs.out_file if not isdefined(self.inputs.out_file): - outputs["out_file"] = self._gen_fname(self.inputs.in_file, + self.outputs.out_file = self._gen_fname(self.inputs.in_file, suffix='_newdims') - outputs["out_file"] = os.path.abspath(outputs["out_file"]) + self.outputs.out_file = os.path.abspath(self.outputs.out_file) return outputs def _gen_filename(self, name): @@ -1257,7 +1257,7 @@ def _gen_outfilename(self): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_file'] = os.path.abspath(self._gen_outfilename()) + self.outputs.out_file = os.path.abspath(self._gen_outfilename()) return outputs def _gen_filename(self, name): @@ -1309,10 +1309,10 @@ class SigLoss(FSLCommand): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_file'] = self.inputs.out_file - if not isdefined(outputs['out_file']) and \ + self.outputs.out_file = self.inputs.out_file + if not isdefined(self.outputs.out_file) and \ isdefined(self.inputs.in_file): - outputs['out_file'] = self._gen_fname(self.inputs.in_file, + self.outputs.out_file = self._gen_fname(self.inputs.in_file, suffix='_sigloss') return outputs @@ -1358,9 +1358,9 @@ def _gen_filename(self, name): def _list_outputs(self): outputs = self.output_spec().get() if not isdefined(self.inputs.out_file): - outputs['out_file'] = self._gen_filename('out_file') + self.outputs.out_file = self._gen_filename('out_file') else: - outputs['out_file'] = os.path.abspath(self.inputs.out_file) + self.outputs.out_file = os.path.abspath(self.inputs.out_file) return outputs @@ -1564,13 +1564,13 @@ def _list_outputs(self): outputs = self.output_spec().get() if self.inputs.complex_cartesian or self.inputs.complex_polar or \ self.inputs.complex_split or self.inputs.complex_merge: - outputs['complex_out_file'] = self._get_output('complex_out_file') + self.outputs.complex_out_file = self._get_output('complex_out_file') elif self.inputs.real_cartesian: - outputs['real_out_file'] = self._get_output('real_out_file') - outputs['imaginary_out_file'] = self._get_output('imaginary_out_file') + self.outputs.real_out_file = self._get_output('real_out_file') + self.outputs.imaginary_out_file = self._get_output('imaginary_out_file') elif self.inputs.real_polar: - outputs['magnitude_out_file'] = self._get_output('magnitude_out_file') - outputs['phase_out_file'] = self._get_output('phase_out_file') + self.outputs.magnitude_out_file = self._get_output('magnitude_out_file') + self.outputs.phase_out_file = self._get_output('phase_out_file') return outputs diff --git a/nipype/interfaces/io.py b/nipype/interfaces/io.py index 4370604eda..c70063969c 100644 --- a/nipype/interfaces/io.py +++ b/nipype/interfaces/io.py @@ -766,7 +766,7 @@ def _list_outputs(self): out_files.append(dst) # Return outputs dictionary - outputs['out_file'] = out_files + self.outputs.out_file = out_files return outputs @@ -2592,5 +2592,5 @@ def _list_outputs(self): with open(out_file, 'w') as f: simplejson.dump(out_dict, f) outputs = self.output_spec().get() - outputs['out_file'] = out_file + self.outputs.out_file = out_file return outputs diff --git a/nipype/interfaces/meshfix.py b/nipype/interfaces/meshfix.py index f5a891465e..e13b726e79 100644 --- a/nipype/interfaces/meshfix.py +++ b/nipype/interfaces/meshfix.py @@ -119,11 +119,11 @@ def _list_outputs(self): out_types = ['stl', 'msh', 'wrl', 'vrml', 'fs', 'off'] # Make sure that the output filename uses one of the possible file types if any(ext == out_type.lower() for out_type in out_types): - outputs['mesh_file'] = op.abspath(self.inputs.out_filename) + self.outputs.mesh_file = op.abspath(self.inputs.out_filename) else: - outputs['mesh_file'] = op.abspath(name + '.' + self.inputs.output_type) + self.outputs.mesh_file = op.abspath(name + '.' + self.inputs.output_type) else: - outputs['mesh_file'] = op.abspath(self._gen_outfilename()) + self.outputs.mesh_file = op.abspath(self._gen_outfilename()) return outputs def _gen_filename(self, name): diff --git a/nipype/interfaces/minc/minc.py b/nipype/interfaces/minc/minc.py index c54e855125..c8f23a45fa 100644 --- a/nipype/interfaces/minc/minc.py +++ b/nipype/interfaces/minc/minc.py @@ -1702,16 +1702,16 @@ def _list_outputs(self): output_file_base = self._gen_output_base() - outputs['output_file'] = output_file_base + '_blur.mnc' + self.outputs.output_file = output_file_base + '_blur.mnc' if isdefined(self.inputs.gradient): - outputs['gradient_dxyz'] = output_file_base + '_dxyz.mnc' + self.outputs.gradient_dxyz = output_file_base + '_dxyz.mnc' if isdefined(self.inputs.partial): - outputs['partial_dx'] = output_file_base + '_dx.mnc' - outputs['partial_dy'] = output_file_base + '_dy.mnc' - outputs['partial_dz'] = output_file_base + '_dz.mnc' - outputs['partial_dxyz'] = output_file_base + '_dxyz.mnc' + self.outputs.partial_dx = output_file_base + '_dx.mnc' + self.outputs.partial_dy = output_file_base + '_dy.mnc' + self.outputs.partial_dz = output_file_base + '_dz.mnc' + self.outputs.partial_dxyz = output_file_base + '_dxyz.mnc' return outputs @@ -2974,8 +2974,8 @@ class Gennlxfm(CommandLine): def _list_outputs(self): outputs = super(Gennlxfm, self)._list_outputs() - outputs['output_grid'] = re.sub( - '.(nlxfm|xfm)$', '_grid_0.mnc', outputs['output_file']) + self.outputs.output_grid = re.sub( + '.(nlxfm|xfm)$', '_grid_0.mnc', self.outputs.output_file) return outputs @@ -3039,13 +3039,13 @@ class XfmConcat(CommandLine): def _list_outputs(self): outputs = super(XfmConcat, self)._list_outputs() - if os.path.exists(outputs['output_file']): - if 'grid' in open(outputs['output_file'], 'r').read(): - outputs['output_grids'] = glob.glob( + if os.path.exists(self.outputs.output_file): + if 'grid' in open(self.outputs.output_file, 'r').read(): + self.outputs.output_grids = glob.glob( re.sub( '.(nlxfm|xfm)$', '_grid_*.mnc', - outputs['output_file'])) + self.outputs.output_file)) return outputs @@ -3234,13 +3234,13 @@ def _gen_filename(self, name): def _list_outputs(self): outputs = self.output_spec().get() - outputs['output_xfm'] = os.path.abspath( + self.outputs.output_xfm = os.path.abspath( self._gen_filename('output_xfm')) - assert os.path.exists(outputs['output_xfm']) - if 'grid' in open(outputs['output_xfm'], 'r').read(): - outputs['output_grid'] = re.sub( - '.(nlxfm|xfm)$', '_grid_0.mnc', outputs['output_xfm']) + assert os.path.exists(self.outputs.output_xfm) + if 'grid' in open(self.outputs.output_xfm, 'r').read(): + self.outputs.output_grid = re.sub( + '.(nlxfm|xfm)$', '_grid_0.mnc', self.outputs.output_xfm) return outputs @@ -3339,12 +3339,12 @@ def _gen_outfilename(self): def _list_outputs(self): outputs = self.output_spec().get() - outputs['output_file'] = os.path.abspath(self._gen_outfilename()) + self.outputs.output_file = os.path.abspath(self._gen_outfilename()) - assert os.path.exists(outputs['output_file']) - if 'grid' in open(outputs['output_file'], 'r').read(): - outputs['output_grid'] = re.sub( - '.(nlxfm|xfm)$', '_grid_0.mnc', outputs['output_file']) + assert os.path.exists(self.outputs.output_file) + if 'grid' in open(self.outputs.output_file, 'r').read(): + self.outputs.output_grid = re.sub( + '.(nlxfm|xfm)$', '_grid_0.mnc', self.outputs.output_file) return outputs @@ -3413,12 +3413,12 @@ def _gen_outfilename(self): def _list_outputs(self): outputs = self.output_spec().get() - outputs['output_file'] = os.path.abspath(self._gen_outfilename()) + self.outputs.output_file = os.path.abspath(self._gen_outfilename()) - assert os.path.exists(outputs['output_file']) - if 'grid' in open(outputs['output_file'], 'r').read(): - outputs['output_grid'] = re.sub( - '.(nlxfm|xfm)$', '_grid_0.mnc', outputs['output_file']) + assert os.path.exists(self.outputs.output_file) + if 'grid' in open(self.outputs.output_file, 'r').read(): + self.outputs.output_grid = re.sub( + '.(nlxfm|xfm)$', '_grid_0.mnc', self.outputs.output_file) return outputs @@ -3677,9 +3677,9 @@ def _list_outputs(self): outputs = super(VolSymm, self)._list_outputs() # Have to manually check for the grid files. - if os.path.exists(outputs['trans_file']): - if 'grid' in open(outputs['trans_file'], 'r').read(): - outputs['output_grid'] = re.sub( - '.(nlxfm|xfm)$', '_grid_0.mnc', outputs['trans_file']) + if os.path.exists(self.outputs.trans_file): + if 'grid' in open(self.outputs.trans_file, 'r').read(): + self.outputs.output_grid = re.sub( + '.(nlxfm|xfm)$', '_grid_0.mnc', self.outputs.trans_file) return outputs diff --git a/nipype/interfaces/mne/base.py b/nipype/interfaces/mne/base.py index 96d238f8ef..df4c754a9f 100644 --- a/nipype/interfaces/mne/base.py +++ b/nipype/interfaces/mne/base.py @@ -97,5 +97,5 @@ def _list_outputs(self): outputs[k] = out_files if not k.rfind('surface') == -1: mesh_paths.append(out_files) - outputs['mesh_files'] = mesh_paths + self.outputs.mesh_files = mesh_paths return outputs diff --git a/nipype/interfaces/mrtrix/convert.py b/nipype/interfaces/mrtrix/convert.py index 89cf1c2299..d5881c5cbe 100644 --- a/nipype/interfaces/mrtrix/convert.py +++ b/nipype/interfaces/mrtrix/convert.py @@ -241,7 +241,7 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs['out_file'] = op.abspath(self.inputs.out_filename) + self.outputs.out_file = op.abspath(self.inputs.out_filename) return outputs def _gen_filename(self, name): diff --git a/nipype/interfaces/mrtrix/preprocess.py b/nipype/interfaces/mrtrix/preprocess.py index 67242e9705..e56c7488ab 100644 --- a/nipype/interfaces/mrtrix/preprocess.py +++ b/nipype/interfaces/mrtrix/preprocess.py @@ -69,11 +69,11 @@ class MRConvert(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['converted'] = self.inputs.out_filename - if not isdefined(outputs['converted']): - outputs['converted'] = op.abspath(self._gen_outfilename()) + self.outputs.converted = self.inputs.out_filename + if not isdefined(self.outputs.converted): + self.outputs.converted = op.abspath(self._gen_outfilename()) else: - outputs['converted'] = op.abspath(outputs['converted']) + self.outputs.converted = op.abspath(self.outputs.converted) return outputs def _gen_filename(self, name): @@ -182,11 +182,11 @@ class Tensor2Vector(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['vector'] = self.inputs.out_filename - if not isdefined(outputs['vector']): - outputs['vector'] = op.abspath(self._gen_outfilename()) + self.outputs.vector = self.inputs.out_filename + if not isdefined(self.outputs.vector): + self.outputs.vector = op.abspath(self._gen_outfilename()) else: - outputs['vector'] = op.abspath(outputs['vector']) + self.outputs.vector = op.abspath(self.outputs.vector) return outputs def _gen_filename(self, name): @@ -231,11 +231,11 @@ class Tensor2FractionalAnisotropy(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['FA'] = self.inputs.out_filename - if not isdefined(outputs['FA']): - outputs['FA'] = op.abspath(self._gen_outfilename()) + self.outputs.FA = self.inputs.out_filename + if not isdefined(self.outputs.FA): + self.outputs.FA = op.abspath(self._gen_outfilename()) else: - outputs['FA'] = op.abspath(outputs['FA']) + self.outputs.FA = op.abspath(self.outputs.FA) return outputs def _gen_filename(self, name): @@ -280,11 +280,11 @@ class Tensor2ApparentDiffusion(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['ADC'] = self.inputs.out_filename - if not isdefined(outputs['ADC']): - outputs['ADC'] = op.abspath(self._gen_outfilename()) + self.outputs.ADC = self.inputs.out_filename + if not isdefined(self.outputs.ADC): + self.outputs.ADC = op.abspath(self._gen_outfilename()) else: - outputs['ADC'] = op.abspath(outputs['ADC']) + self.outputs.ADC = op.abspath(self.outputs.ADC) return outputs def _gen_filename(self, name): @@ -330,11 +330,11 @@ class MRMultiply(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_file'] = self.inputs.out_filename - if not isdefined(outputs['out_file']): - outputs['out_file'] = op.abspath(self._gen_outfilename()) + self.outputs.out_file = self.inputs.out_filename + if not isdefined(self.outputs.out_file): + self.outputs.out_file = op.abspath(self._gen_outfilename()) else: - outputs['out_file'] = op.abspath(outputs['out_file']) + self.outputs.out_file = op.abspath(self.outputs.out_file) return outputs def _gen_filename(self, name): @@ -444,7 +444,7 @@ class GenerateWhiteMatterMask(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['WMprobabilitymap'] = op.abspath(self._gen_outfilename()) + self.outputs.WMprobabilitymap = op.abspath(self._gen_outfilename()) return outputs def _gen_filename(self, name): @@ -490,11 +490,11 @@ class Erode(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_file'] = self.inputs.out_filename - if not isdefined(outputs['out_file']): - outputs['out_file'] = op.abspath(self._gen_outfilename()) + self.outputs.out_file = self.inputs.out_filename + if not isdefined(self.outputs.out_file): + self.outputs.out_file = op.abspath(self._gen_outfilename()) else: - outputs['out_file'] = op.abspath(outputs['out_file']) + self.outputs.out_file = op.abspath(self.outputs.out_file) return outputs def _gen_filename(self, name): @@ -548,11 +548,11 @@ class Threshold(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_file'] = self.inputs.out_filename - if not isdefined(outputs['out_file']): - outputs['out_file'] = op.abspath(self._gen_outfilename()) + self.outputs.out_file = self.inputs.out_filename + if not isdefined(self.outputs.out_file): + self.outputs.out_file = op.abspath(self._gen_outfilename()) else: - outputs['out_file'] = op.abspath(outputs['out_file']) + self.outputs.out_file = op.abspath(self.outputs.out_file) return outputs def _gen_filename(self, name): @@ -597,11 +597,11 @@ class MedianFilter3D(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_file'] = self.inputs.out_filename - if not isdefined(outputs['out_file']): - outputs['out_file'] = op.abspath(self._gen_outfilename()) + self.outputs.out_file = self.inputs.out_filename + if not isdefined(self.outputs.out_file): + self.outputs.out_file = op.abspath(self._gen_outfilename()) else: - outputs['out_file'] = op.abspath(outputs['out_file']) + self.outputs.out_file = op.abspath(self.outputs.out_file) return outputs def _gen_filename(self, name): @@ -655,11 +655,11 @@ class MRTransform(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_file'] = self.inputs.out_filename - if not isdefined(outputs['out_file']): - outputs['out_file'] = op.abspath(self._gen_outfilename()) + self.outputs.out_file = self.inputs.out_filename + if not isdefined(self.outputs.out_file): + self.outputs.out_file = op.abspath(self._gen_outfilename()) else: - outputs['out_file'] = op.abspath(outputs['out_file']) + self.outputs.out_file = op.abspath(self.outputs.out_file) return outputs def _gen_filename(self, name): diff --git a/nipype/interfaces/mrtrix/tensors.py b/nipype/interfaces/mrtrix/tensors.py index 3ef2ecc901..4383792d3b 100644 --- a/nipype/interfaces/mrtrix/tensors.py +++ b/nipype/interfaces/mrtrix/tensors.py @@ -77,11 +77,11 @@ class DWI2SphericalHarmonicsImage(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['spherical_harmonics_image'] = self.inputs.out_filename - if not isdefined(outputs['spherical_harmonics_image']): - outputs['spherical_harmonics_image'] = op.abspath(self._gen_outfilename()) + self.outputs.spherical_harmonics_image = self.inputs.out_filename + if not isdefined(self.outputs.spherical_harmonics_image): + self.outputs.spherical_harmonics_image = op.abspath(self._gen_outfilename()) else: - outputs['spherical_harmonics_image'] = op.abspath(outputs['spherical_harmonics_image']) + self.outputs.spherical_harmonics_image = op.abspath(self.outputs.spherical_harmonics_image) return outputs def _gen_filename(self, name): @@ -160,11 +160,11 @@ class ConstrainedSphericalDeconvolution(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['spherical_harmonics_image'] = self.inputs.out_filename - if not isdefined(outputs['spherical_harmonics_image']): - outputs['spherical_harmonics_image'] = op.abspath(self._gen_outfilename()) + self.outputs.spherical_harmonics_image = self.inputs.out_filename + if not isdefined(self.outputs.spherical_harmonics_image): + self.outputs.spherical_harmonics_image = op.abspath(self._gen_outfilename()) else: - outputs['spherical_harmonics_image'] = op.abspath(outputs['spherical_harmonics_image']) + self.outputs.spherical_harmonics_image = op.abspath(self.outputs.spherical_harmonics_image) return outputs def _gen_filename(self, name): @@ -214,11 +214,11 @@ class EstimateResponseForSH(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['response'] = self.inputs.out_filename - if not isdefined(outputs['response']): - outputs['response'] = op.abspath(self._gen_outfilename()) + self.outputs.response = self.inputs.out_filename + if not isdefined(self.outputs.response): + self.outputs.response = op.abspath(self._gen_outfilename()) else: - outputs['response'] = op.abspath(outputs['response']) + self.outputs.response = op.abspath(self.outputs.response) return outputs def _gen_filename(self, name): @@ -298,7 +298,7 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self.output_spec().get() - outputs['encoding_file'] = op.abspath(self._gen_filename('out_encoding_file')) + self.outputs.encoding_file = op.abspath(self._gen_filename('out_encoding_file')) return outputs def _gen_filename(self, name): diff --git a/nipype/interfaces/mrtrix/tracking.py b/nipype/interfaces/mrtrix/tracking.py index c4d49118a8..2191cd4079 100644 --- a/nipype/interfaces/mrtrix/tracking.py +++ b/nipype/interfaces/mrtrix/tracking.py @@ -109,11 +109,11 @@ class Tracks2Prob(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['tract_image'] = self.inputs.out_filename - if not isdefined(outputs['tract_image']): - outputs['tract_image'] = op.abspath(self._gen_outfilename()) + self.outputs.tract_image = self.inputs.out_filename + if not isdefined(self.outputs.tract_image): + self.outputs.tract_image = op.abspath(self._gen_outfilename()) else: - outputs['tract_image'] = os.path.abspath(outputs['tract_image']) + self.outputs.tract_image = os.path.abspath(self.outputs.tract_image) return outputs def _gen_filename(self, name): diff --git a/nipype/interfaces/mrtrix3/connectivity.py b/nipype/interfaces/mrtrix3/connectivity.py index 64e73f8069..d53c6eda3e 100644 --- a/nipype/interfaces/mrtrix3/connectivity.py +++ b/nipype/interfaces/mrtrix3/connectivity.py @@ -106,7 +106,7 @@ class BuildConnectome(MRTrix3Base): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_file'] = op.abspath(self.inputs.out_file) + self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs @@ -183,5 +183,5 @@ def _parse_inputs(self, skip=None): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_file'] = op.abspath(self.inputs.out_file) + self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs diff --git a/nipype/interfaces/mrtrix3/preprocess.py b/nipype/interfaces/mrtrix3/preprocess.py index e52c84071d..cb089a109c 100644 --- a/nipype/interfaces/mrtrix3/preprocess.py +++ b/nipype/interfaces/mrtrix3/preprocess.py @@ -107,10 +107,10 @@ class ResponseSD(MRTrix3Base): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_file'] = op.abspath(self.inputs.out_file) + self.outputs.out_file = op.abspath(self.inputs.out_file) if isdefined(self.inputs.out_sf): - outputs['out_sf'] = op.abspath(self.inputs.out_sf) + self.outputs.out_sf = op.abspath(self.inputs.out_sf) return outputs @@ -150,7 +150,7 @@ class ACTPrepareFSL(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_file'] = op.abspath(self.inputs.out_file) + self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs @@ -197,5 +197,5 @@ class ReplaceFSwithFIRST(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_file'] = op.abspath(self.inputs.out_file) + self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs diff --git a/nipype/interfaces/mrtrix3/reconst.py b/nipype/interfaces/mrtrix3/reconst.py index ce023fbdef..76920e8cd1 100644 --- a/nipype/interfaces/mrtrix3/reconst.py +++ b/nipype/interfaces/mrtrix3/reconst.py @@ -73,7 +73,7 @@ class FitTensor(MRTrix3Base): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_file'] = op.abspath(self.inputs.out_file) + self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs @@ -189,5 +189,5 @@ class EstimateFOD(MRTrix3Base): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_file'] = op.abspath(self.inputs.out_file) + self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs diff --git a/nipype/interfaces/mrtrix3/tracking.py b/nipype/interfaces/mrtrix3/tracking.py index 7495211543..586d934ad7 100644 --- a/nipype/interfaces/mrtrix3/tracking.py +++ b/nipype/interfaces/mrtrix3/tracking.py @@ -250,5 +250,5 @@ def _format_arg(self, name, trait_spec, value): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_file'] = op.abspath(self.inputs.out_file) + self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs diff --git a/nipype/interfaces/mrtrix3/utils.py b/nipype/interfaces/mrtrix3/utils.py index 6a5b68f521..9413fd8e6c 100644 --- a/nipype/interfaces/mrtrix3/utils.py +++ b/nipype/interfaces/mrtrix3/utils.py @@ -58,7 +58,7 @@ class BrainMask(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_file'] = op.abspath(self.inputs.out_file) + self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs @@ -105,7 +105,7 @@ class Mesh2PVE(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_file'] = op.abspath(self.inputs.out_file) + self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs @@ -152,7 +152,7 @@ class Generate5tt(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_file'] = op.abspath(self.inputs.out_file) + self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs @@ -349,7 +349,7 @@ class ComputeTDI(MRTrix3Base): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_file'] = op.abspath(self.inputs.out_file) + self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs @@ -400,5 +400,5 @@ class TCK2VTK(MRTrix3Base): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_file'] = op.abspath(self.inputs.out_file) + self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs diff --git a/nipype/interfaces/nipy/model.py b/nipype/interfaces/nipy/model.py index f6ff113530..75ea21790a 100644 --- a/nipype/interfaces/nipy/model.py +++ b/nipype/interfaces/nipy/model.py @@ -194,17 +194,17 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs["beta"] = self._beta_file - outputs["nvbeta"] = self._nvbeta - outputs["s2"] = self._s2_file - outputs["dof"] = self._dof - outputs["constants"] = self._constants - outputs["axis"] = self._axis - outputs["reg_names"] = self._reg_names + self.outputs.beta = self._beta_file + self.outputs.nvbeta = self._nvbeta + self.outputs.s2 = self._s2_file + self.outputs.dof = self._dof + self.outputs.constants = self._constants + self.outputs.axis = self._axis + self.outputs.reg_names = self._reg_names if self.inputs.model == "ar1": - outputs["a"] = self._a_file + self.outputs.a = self._a_file if self.inputs.save_residuals: - outputs["residuals"] = self._residuals_file + self.outputs.residuals = self._residuals_file return outputs @@ -314,7 +314,7 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs["stat_maps"] = self._stat_maps - outputs["p_maps"] = self._p_maps - outputs["z_maps"] = self._z_maps + self.outputs.stat_maps = self._stat_maps + self.outputs.p_maps = self._p_maps + self.outputs.z_maps = self._z_maps return outputs diff --git a/nipype/interfaces/nipy/preprocess.py b/nipype/interfaces/nipy/preprocess.py index 49a493f02c..b51e0b9465 100644 --- a/nipype/interfaces/nipy/preprocess.py +++ b/nipype/interfaces/nipy/preprocess.py @@ -72,7 +72,7 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs["brain_mask"] = self._brain_mask_path + self.outputs.brain_mask = self._brain_mask_path return outputs @@ -192,8 +192,8 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs['out_file'] = self._out_file_path - outputs['par_file'] = self._par_file_path + self.outputs.out_file = self._out_file_path + self.outputs.par_file = self._par_file_path return outputs @@ -323,8 +323,8 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs['out_file'] = self._out_file_path - outputs['par_file'] = self._par_file_path + self.outputs.out_file = self._out_file_path + self.outputs.par_file = self._par_file_path return outputs @@ -377,11 +377,11 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_file'] = self.inputs.out_file - if not isdefined(outputs['out_file']): - outputs['out_file'] = fname_presuffix( + self.outputs.out_file = self.inputs.out_file + if not isdefined(self.outputs.out_file): + self.outputs.out_file = fname_presuffix( self.inputs.in_file, newpath=os.getcwd(), suffix=self.inputs.suffix) - outputs['out_file'] = os.path.abspath(outputs['out_file']) + self.outputs.out_file = os.path.abspath(self.outputs.out_file) return outputs diff --git a/nipype/interfaces/nipy/utils.py b/nipype/interfaces/nipy/utils.py index 0e78111c0e..dba7273cb6 100644 --- a/nipype/interfaces/nipy/utils.py +++ b/nipype/interfaces/nipy/utils.py @@ -101,5 +101,5 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs['similarity'] = self._similarity + self.outputs.similarity = self._similarity return outputs diff --git a/nipype/interfaces/nitime/analysis.py b/nipype/interfaces/nitime/analysis.py index da76a5882f..67705417af 100644 --- a/nipype/interfaces/nitime/analysis.py +++ b/nipype/interfaces/nitime/analysis.py @@ -176,8 +176,8 @@ def _list_outputs(self): # file name + path) # Always defined (the arrays): - outputs['coherence_array'] = self.coherence - outputs['timedelay_array'] = self.delay + self.outputs.coherence_array = self.coherence + self.outputs.timedelay_array = self.delay # Conditional if isdefined(self.inputs.output_csv_file) and hasattr(self, 'coherence'): @@ -185,15 +185,15 @@ def _list_outputs(self): # coherence values to this file "coherence_csv" and makes the # time_delay csv file?? self._make_output_files() - outputs['coherence_csv'] = fname_presuffix(self.inputs.output_csv_file, suffix='_coherence') + self.outputs.coherence_csv = fname_presuffix(self.inputs.output_csv_file, suffix='_coherence') - outputs['timedelay_csv'] = fname_presuffix(self.inputs.output_csv_file, suffix='_delay') + self.outputs.timedelay_csv = fname_presuffix(self.inputs.output_csv_file, suffix='_delay') if isdefined(self.inputs.output_figure_file) and hasattr(self, 'coherence'): self._make_output_figures() - outputs['coherence_fig'] = fname_presuffix(self.inputs.output_figure_file, suffix='_coherence') - outputs['timedelay_fig'] = fname_presuffix(self.inputs.output_figure_file, suffix='_delay') + self.outputs.coherence_fig = fname_presuffix(self.inputs.output_figure_file, suffix='_coherence') + self.outputs.timedelay_fig = fname_presuffix(self.inputs.output_figure_file, suffix='_delay') return outputs diff --git a/nipype/interfaces/petpvc.py b/nipype/interfaces/petpvc.py index 00dbbfb3ea..738ec84964 100644 --- a/nipype/interfaces/petpvc.py +++ b/nipype/interfaces/petpvc.py @@ -164,13 +164,13 @@ class PETPVC(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() - outputs['out_file'] = self.inputs.out_file - if not isdefined(outputs['out_file']): + self.outputs.out_file = self.inputs.out_file + if not isdefined(self.outputs.out_file): method_name = self.inputs.pvc.lower() - outputs['out_file'] = self._gen_fname(self.inputs.in_file, + self.outputs.out_file = self._gen_fname(self.inputs.in_file, suffix='_{}_pvc'.format(method_name)) - outputs['out_file'] = os.path.abspath(outputs['out_file']) + self.outputs.out_file = os.path.abspath(self.outputs.out_file) return outputs def _gen_fname(self, basename, cwd=None, suffix=None, change_ext=True, diff --git a/nipype/interfaces/spm/model.py b/nipype/interfaces/spm/model.py index 2a3472a648..8a4c4948c7 100644 --- a/nipype/interfaces/spm/model.py +++ b/nipype/interfaces/spm/model.py @@ -155,7 +155,7 @@ def _make_matlab_command(self, content): def _list_outputs(self): outputs = self._outputs().get() spm = os.path.join(os.getcwd(), 'SPM.mat') - outputs['spm_mat_file'] = spm + self.outputs.spm_mat_file = spm return outputs @@ -222,25 +222,25 @@ def _list_outputs(self): mask = os.path.join(pth, 'mask.nii') else: mask = os.path.join(pth, 'mask.img') - outputs['mask_image'] = mask + self.outputs.mask_image = mask spm = sio.loadmat(self.inputs.spm_mat_file, struct_as_record=False) betas = [] for vbeta in spm['SPM'][0, 0].Vbeta[0]: betas.append(str(os.path.join(pth, vbeta.fname[0]))) if betas: - outputs['beta_images'] = betas + self.outputs.beta_images = betas if spm12: resms = os.path.join(pth, 'ResMS.nii') else: resms = os.path.join(pth, 'ResMS.img') - outputs['residual_image'] = resms + self.outputs.residual_image = resms if spm12: rpv = os.path.join(pth, 'RPV.nii') else: rpv = os.path.join(pth, 'RPV.img') - outputs['RPVimage'] = rpv + self.outputs.RPVimage = rpv spm = os.path.join(pth, 'SPM.mat') - outputs['spm_mat_file'] = spm + self.outputs.spm_mat_file = spm return outputs @@ -394,22 +394,22 @@ def _list_outputs(self): con_images.append(str(os.path.join(pth, con.Vcon[0, 0].fname[0]))) spmT_images.append(str(os.path.join(pth, con.Vspm[0, 0].fname[0]))) if con_images: - outputs['con_images'] = con_images - outputs['spmT_images'] = spmT_images + self.outputs.con_images = con_images + self.outputs.spmT_images = spmT_images spm12 = '12' in self.version.split('.')[0] if spm12: ess = glob(os.path.join(pth, 'ess*.nii')) else: ess = glob(os.path.join(pth, 'ess*.img')) if len(ess) > 0: - outputs['ess_images'] = sorted(ess) + self.outputs.ess_images = sorted(ess) if spm12: spmf = glob(os.path.join(pth, 'spmF*.nii')) else: spmf = glob(os.path.join(pth, 'spmF*.img')) if len(spmf) > 0: - outputs['spmF_images'] = sorted(spmf) - outputs['spm_mat_file'] = self.inputs.spm_mat_file + self.outputs.spmF_images = sorted(spmf) + self.outputs.spm_mat_file = self.inputs.spm_mat_file return outputs @@ -592,8 +592,8 @@ def aggregate_outputs(self, runtime=None): def _list_outputs(self): outputs = self._outputs().get() - outputs['thresholded_map'] = self._gen_thresholded_map_filename() - outputs['pre_topo_fdr_map'] = self._gen_pre_topo_map_filename() + self.outputs.thresholded_map = self._gen_thresholded_map_filename() + self.outputs.pre_topo_fdr_map = self._gen_pre_topo_map_filename() return outputs @@ -781,7 +781,7 @@ def _parse_inputs(self): def _list_outputs(self): outputs = self._outputs().get() spm = os.path.join(os.getcwd(), 'SPM.mat') - outputs['spm_mat_file'] = spm + self.outputs.spm_mat_file = spm return outputs diff --git a/nipype/interfaces/spm/preprocess.py b/nipype/interfaces/spm/preprocess.py index c1af8d025c..c5dc450f82 100644 --- a/nipype/interfaces/spm/preprocess.py +++ b/nipype/interfaces/spm/preprocess.py @@ -99,7 +99,7 @@ def _format_arg(self, opt, spec, val): def _list_outputs(self): outputs = self._outputs().get() - outputs['timecorrected_files'] = [] + self.outputs.timecorrected_files = [] filelist = filename_to_list(self.inputs.in_files) for f in filelist: @@ -107,7 +107,7 @@ def _list_outputs(self): run = [fname_presuffix(in_f, prefix=self.inputs.out_prefix) for in_f in f] else: run = fname_presuffix(f, prefix=self.inputs.out_prefix) - outputs['timecorrected_files'].append(run) + self.outputs.timecorrected_files.append(run) return outputs @@ -214,22 +214,22 @@ def _list_outputs(self): if self.inputs.jobtype != "write": if isdefined(self.inputs.in_files): - outputs['realignment_parameters'] = [] + self.outputs.realignment_parameters = [] for imgf in self.inputs.in_files: if isinstance(imgf, list): tmp_imgf = imgf[0] else: tmp_imgf = imgf - outputs['realignment_parameters'].append(fname_presuffix(tmp_imgf, + self.outputs.realignment_parameters.append(fname_presuffix(tmp_imgf, prefix='rp_', suffix='.txt', use_ext=False)) if not isinstance(imgf, list) and func_is_3d(imgf): break if self.inputs.jobtype == "estimate": - outputs['realigned_files'] = self.inputs.in_files + self.outputs.realigned_files = self.inputs.in_files if self.inputs.jobtype == "estimate" or self.inputs.jobtype == "estwrite": - outputs['modified_in_files'] = self.inputs.in_files + self.outputs.modified_in_files = self.inputs.in_files if self.inputs.jobtype == "write" or self.inputs.jobtype == "estwrite": if isinstance(self.inputs.in_files[0], list): first_image = self.inputs.in_files[0][0] @@ -237,10 +237,10 @@ def _list_outputs(self): first_image = self.inputs.in_files[0] if resliced_mean: - outputs['mean_image'] = fname_presuffix(first_image, prefix='mean') + self.outputs.mean_image = fname_presuffix(first_image, prefix='mean') if resliced_all: - outputs['realigned_files'] = [] + self.outputs.realigned_files = [] for idx, imgf in enumerate(filename_to_list(self.inputs.in_files)): realigned_run = [] if isinstance(imgf, list): @@ -251,7 +251,7 @@ def _list_outputs(self): else: realigned_run = fname_presuffix(imgf, prefix=self.inputs.out_prefix) - outputs['realigned_files'].append(realigned_run) + self.outputs.realigned_files.append(realigned_run) return outputs @@ -349,17 +349,17 @@ def _list_outputs(self): if self.inputs.jobtype == "estimate": if isdefined(self.inputs.apply_to_files): - outputs['coregistered_files'] = self.inputs.apply_to_files - outputs['coregistered_source'] = self.inputs.source + self.outputs.coregistered_files = self.inputs.apply_to_files + self.outputs.coregistered_source = self.inputs.source elif self.inputs.jobtype == "write" or self.inputs.jobtype == "estwrite": if isdefined(self.inputs.apply_to_files): - outputs['coregistered_files'] = [] + self.outputs.coregistered_files = [] for imgf in filename_to_list(self.inputs.apply_to_files): - outputs['coregistered_files'].append(fname_presuffix(imgf, prefix=self.inputs.out_prefix)) + self.outputs.coregistered_files.append(fname_presuffix(imgf, prefix=self.inputs.out_prefix)) - outputs['coregistered_source'] = [] + self.outputs.coregistered_source = [] for imgf in filename_to_list(self.inputs.source): - outputs['coregistered_source'].append(fname_presuffix(imgf, prefix=self.inputs.out_prefix)) + self.outputs.coregistered_source.append(fname_presuffix(imgf, prefix=self.inputs.out_prefix)) return outputs @@ -484,23 +484,23 @@ def _list_outputs(self): jobtype = self.inputs.jobtype if jobtype.startswith('est'): - outputs['normalization_parameters'] = [] + self.outputs.normalization_parameters = [] for imgf in filename_to_list(self.inputs.source): - outputs['normalization_parameters'].append(fname_presuffix(imgf, + self.outputs.normalization_parameters.append(fname_presuffix(imgf, suffix='_sn.mat', use_ext=False)) - outputs['normalization_parameters'] = list_to_filename(outputs['normalization_parameters']) + self.outputs.normalization_parameters = list_to_filename(self.outputs.normalization_parameters) if self.inputs.jobtype == "estimate": if isdefined(self.inputs.apply_to_files): - outputs['normalized_files'] = self.inputs.apply_to_files - outputs['normalized_source'] = self.inputs.source + self.outputs.normalized_files = self.inputs.apply_to_files + self.outputs.normalized_source = self.inputs.source elif 'write' in self.inputs.jobtype: if isdefined(self.inputs.write_preserve) and self.inputs.write_preserve: prefixNorm = ''.join(['m', self.inputs.out_prefix]) else: prefixNorm = self.inputs.out_prefix - outputs['normalized_files'] = [] + self.outputs.normalized_files = [] if isdefined(self.inputs.apply_to_files): filelist = filename_to_list(self.inputs.apply_to_files) for f in filelist: @@ -508,11 +508,11 @@ def _list_outputs(self): run = [fname_presuffix(in_f, prefix=prefixNorm) for in_f in f] else: run = [fname_presuffix(f, prefix=prefixNorm)] - outputs['normalized_files'].extend(run) + self.outputs.normalized_files.extend(run) if isdefined(self.inputs.source): - outputs['normalized_source'] = [] + self.outputs.normalized_source = [] for imgf in filename_to_list(self.inputs.source): - outputs['normalized_source'].append(fname_presuffix(imgf, + self.outputs.normalized_source.append(fname_presuffix(imgf, prefix=prefixNorm)) return outputs @@ -646,19 +646,19 @@ def _list_outputs(self): jobtype = self.inputs.jobtype if jobtype.startswith('est'): - outputs['deformation_field'] = [] + self.outputs.deformation_field = [] for imgf in filename_to_list(self.inputs.image_to_align): - outputs['deformation_field'].append(fname_presuffix(imgf, + self.outputs.deformation_field.append(fname_presuffix(imgf, prefix='y_')) - outputs['deformation_field'] = list_to_filename(outputs['deformation_field']) + self.outputs.deformation_field = list_to_filename(self.outputs.deformation_field) if self.inputs.jobtype == "estimate": if isdefined(self.inputs.apply_to_files): - outputs['normalized_files'] = self.inputs.apply_to_files - outputs['normalized_image'] = fname_presuffix(self.inputs.image_to_align, + self.outputs.normalized_files = self.inputs.apply_to_files + self.outputs.normalized_image = fname_presuffix(self.inputs.image_to_align, prefix='w') elif 'write' in self.inputs.jobtype: - outputs['normalized_files'] = [] + self.outputs.normalized_files = [] if isdefined(self.inputs.apply_to_files): filelist = filename_to_list(self.inputs.apply_to_files) for f in filelist: @@ -666,9 +666,9 @@ def _list_outputs(self): run = [fname_presuffix(in_f, prefix='w') for in_f in f] else: run = [fname_presuffix(f, prefix='w')] - outputs['normalized_files'].extend(run) + self.outputs.normalized_files.extend(run) if isdefined(self.inputs.image_to_align): - outputs['normalized_image'] = fname_presuffix(self.inputs.image_to_align, + self.outputs.normalized_image = fname_presuffix(self.inputs.image_to_align, prefix='w') return outputs @@ -814,11 +814,11 @@ def _list_outputs(self): tidx + 1)) if isdefined(self.inputs.save_bias_corrected) and \ self.inputs.save_bias_corrected: - outputs['bias_corrected_image'] = fname_presuffix(f, prefix='m') + self.outputs.bias_corrected_image = fname_presuffix(f, prefix='m') t_mat = fname_presuffix(f, suffix='_seg_sn.mat', use_ext=False) - outputs['transformation_mat'] = t_mat + self.outputs.transformation_mat = t_mat invt_mat = fname_presuffix(f, suffix='_seg_inv_sn.mat', use_ext=False) - outputs['inverse_transformation_mat'] = invt_mat + self.outputs.inverse_transformation_mat = invt_mat return outputs @@ -939,53 +939,53 @@ def _format_arg(self, opt, spec, val): def _list_outputs(self): outputs = self._outputs().get() - outputs['native_class_images'] = [] - outputs['dartel_input_images'] = [] - outputs['normalized_class_images'] = [] - outputs['modulated_class_images'] = [] - outputs['transformation_mat'] = [] - outputs['bias_corrected_images'] = [] - outputs['bias_field_images'] = [] - outputs['inverse_deformation_field'] = [] - outputs['forward_deformation_field'] = [] + self.outputs.native_class_images = [] + self.outputs.dartel_input_images = [] + self.outputs.normalized_class_images = [] + self.outputs.modulated_class_images = [] + self.outputs.transformation_mat = [] + self.outputs.bias_corrected_images = [] + self.outputs.bias_field_images = [] + self.outputs.inverse_deformation_field = [] + self.outputs.forward_deformation_field = [] n_classes = 5 if isdefined(self.inputs.tissues): n_classes = len(self.inputs.tissues) for i in range(n_classes): - outputs['native_class_images'].append([]) - outputs['dartel_input_images'].append([]) - outputs['normalized_class_images'].append([]) - outputs['modulated_class_images'].append([]) + self.outputs.native_class_images.append([]) + self.outputs.dartel_input_images.append([]) + self.outputs.normalized_class_images.append([]) + self.outputs.modulated_class_images.append([]) for filename in self.inputs.channel_files: pth, base, ext = split_filename(filename) if isdefined(self.inputs.tissues): for i, tissue in enumerate(self.inputs.tissues): if tissue[2][0]: - outputs['native_class_images'][i].append(os.path.join(pth, "c%d%s.nii" % (i + 1, base))) + self.outputs.native_class_images[i].append(os.path.join(pth, "c%d%s.nii" % (i + 1, base))) if tissue[2][1]: - outputs['dartel_input_images'][i].append(os.path.join(pth, "rc%d%s.nii" % (i + 1, base))) + self.outputs.dartel_input_images[i].append(os.path.join(pth, "rc%d%s.nii" % (i + 1, base))) if tissue[3][0]: - outputs['normalized_class_images'][i].append(os.path.join(pth, "wc%d%s.nii" % (i + 1, base))) + self.outputs.normalized_class_images[i].append(os.path.join(pth, "wc%d%s.nii" % (i + 1, base))) if tissue[3][1]: - outputs['modulated_class_images'][i].append(os.path.join(pth, "mwc%d%s.nii" % (i + 1, base))) + self.outputs.modulated_class_images[i].append(os.path.join(pth, "mwc%d%s.nii" % (i + 1, base))) else: for i in range(n_classes): - outputs['native_class_images'][i].append(os.path.join(pth, "c%d%s.nii" % (i + 1, base))) - outputs['transformation_mat'].append(os.path.join(pth, "%s_seg8.mat" % base)) + self.outputs.native_class_images[i].append(os.path.join(pth, "c%d%s.nii" % (i + 1, base))) + self.outputs.transformation_mat.append(os.path.join(pth, "%s_seg8.mat" % base)) if isdefined(self.inputs.write_deformation_fields): if self.inputs.write_deformation_fields[0]: - outputs['inverse_deformation_field'].append(os.path.join(pth, "iy_%s.nii" % base)) + self.outputs.inverse_deformation_field.append(os.path.join(pth, "iy_%s.nii" % base)) if self.inputs.write_deformation_fields[1]: - outputs['forward_deformation_field'].append(os.path.join(pth, "y_%s.nii" % base)) + self.outputs.forward_deformation_field.append(os.path.join(pth, "y_%s.nii" % base)) if isdefined(self.inputs.channel_info): if self.inputs.channel_info[2][0]: - outputs['bias_corrected_images'].append(os.path.join(pth, "m%s.nii" % (base))) + self.outputs.bias_corrected_images.append(os.path.join(pth, "m%s.nii" % (base))) if self.inputs.channel_info[2][1]: - outputs['bias_field_images'].append(os.path.join(pth, "BiasField_%s.nii" % (base))) + self.outputs.bias_field_images.append(os.path.join(pth, "BiasField_%s.nii" % (base))) return outputs @@ -1044,10 +1044,10 @@ def _format_arg(self, opt, spec, val): def _list_outputs(self): outputs = self._outputs().get() - outputs['smoothed_files'] = [] + self.outputs.smoothed_files = [] for imgf in filename_to_list(self.inputs.in_files): - outputs['smoothed_files'].append(fname_presuffix(imgf, prefix=self.inputs.out_prefix)) + self.outputs.smoothed_files.append(fname_presuffix(imgf, prefix=self.inputs.out_prefix)) return outputs @@ -1144,14 +1144,14 @@ def _format_arg(self, opt, spec, val): def _list_outputs(self): outputs = self._outputs().get() - outputs['template_files'] = [] + self.outputs.template_files = [] for i in range(6): - outputs['template_files'].append(os.path.realpath('%s_%d.nii' % (self.inputs.template_prefix, i + 1))) - outputs['final_template_file'] = os.path.realpath('%s_6.nii' % self.inputs.template_prefix) - outputs['dartel_flow_fields'] = [] + self.outputs.template_files.append(os.path.realpath('%s_%d.nii' % (self.inputs.template_prefix, i + 1))) + self.outputs.final_template_file = os.path.realpath('%s_6.nii' % self.inputs.template_prefix) + self.outputs.dartel_flow_fields = [] for filename in self.inputs.image_files[0]: pth, base, ext = split_filename(filename) - outputs['dartel_flow_fields'].append(os.path.realpath('u_%s_%s%s' % (base, + self.outputs.dartel_flow_fields.append(os.path.realpath('u_%s_%s%s' % (base, self.inputs.template_prefix, ext))) return outputs @@ -1234,8 +1234,8 @@ def _format_arg(self, opt, spec, val): def _list_outputs(self): outputs = self._outputs().get() pth, base, ext = split_filename(self.inputs.template_file) - outputs['normalization_parameter_file'] = os.path.realpath(base + '_2mni.mat') - outputs['normalized_files'] = [] + self.outputs.normalization_parameter_file = os.path.realpath(base + '_2mni.mat') + self.outputs.normalized_files = [] prefix = "w" if isdefined(self.inputs.modulate) and self.inputs.modulate: prefix = 'm' + prefix @@ -1243,7 +1243,7 @@ def _list_outputs(self): prefix = 's' + prefix for filename in self.inputs.apply_to_files: pth, base, ext = split_filename(filename) - outputs['normalized_files'].append(os.path.realpath('%s%s%s' % (prefix, + self.outputs.normalized_files.append(os.path.realpath('%s%s%s' % (prefix, base, ext))) @@ -1308,14 +1308,14 @@ def _format_arg(self, opt, spec, val): def _list_outputs(self): outputs = self._outputs().get() - outputs['warped_files'] = [] + self.outputs.warped_files = [] for filename in self.inputs.image_files: pth, base, ext = split_filename(filename) if isdefined(self.inputs.modulate) and self.inputs.modulate: - outputs['warped_files'].append(os.path.realpath('mw%s%s' % (base, + self.outputs.warped_files.append(os.path.realpath('mw%s%s' % (base, ext))) else: - outputs['warped_files'].append(os.path.realpath('w%s%s' % (base, + self.outputs.warped_files.append(os.path.realpath('w%s%s' % (base, ext))) return outputs @@ -1356,10 +1356,10 @@ def _format_arg(self, opt, spec, val): def _list_outputs(self): outputs = self._outputs().get() - outputs['out_files'] = [] + self.outputs.out_files = [] for filename in self.inputs.in_files: _, fname = os.path.split(filename) - outputs['out_files'].append(os.path.realpath('w%s' % fname)) + self.outputs.out_files.append(os.path.realpath('w%s' % fname)) return outputs @@ -1533,84 +1533,84 @@ def _list_outputs(self): if do_dartel: dartel_px = 'r' - outputs['native_class_images'] = [[], [], []] - outputs['dartel_input_images'] = [[], [], []] - outputs['normalized_class_images'] = [[], [], []] - outputs['modulated_class_images'] = [[], [], []] + self.outputs.native_class_images = [[], [], []] + self.outputs.dartel_input_images = [[], [], []] + self.outputs.normalized_class_images = [[], [], []] + self.outputs.modulated_class_images = [[], [], []] - outputs['transformation_mat'] = [] + self.outputs.transformation_mat = [] - outputs['bias_corrected_images'] = [] - outputs['normalized_bias_corrected_images'] = [] + self.outputs.bias_corrected_images = [] + self.outputs.normalized_bias_corrected_images = [] - outputs['inverse_deformation_field'] = [] - outputs['forward_deformation_field'] = [] - outputs['jacobian_determinant_images'] = [] + self.outputs.inverse_deformation_field = [] + self.outputs.forward_deformation_field = [] + self.outputs.jacobian_determinant_images = [] - outputs['pve_label_native_images'] = [] - outputs['pve_label_normalized_images'] = [] - outputs['pve_label_registered_images'] = [] + self.outputs.pve_label_native_images = [] + self.outputs.pve_label_normalized_images = [] + self.outputs.pve_label_registered_images = [] for filename in self.inputs.in_files: pth, base, ext = split_filename(filename) - outputs['transformation_mat'].append( + self.outputs.transformation_mat.append( os.path.join(pth, "%s_seg8.mat" % base)) for i, tis in enumerate(['gm', 'wm', 'csf']): # native space if getattr(self.inputs, '%s_native' % tis): - outputs['native_class_images'][i].append( + self.outputs.native_class_images[i].append( os.path.join(pth, "p%d%s.nii" % (i + 1, base))) if getattr(self.inputs, '%s_dartel' % tis) == 1: - outputs['dartel_input_images'][i].append( + self.outputs.dartel_input_images[i].append( os.path.join(pth, "rp%d%s.nii" % (i + 1, base))) elif getattr(self.inputs, '%s_dartel' % tis) == 2: - outputs['dartel_input_images'][i].append( + self.outputs.dartel_input_images[i].append( os.path.join(pth, "rp%d%s_affine.nii" % (i + 1, base))) # normalized space if getattr(self.inputs, '%s_normalized' % tis): - outputs['normalized_class_images'][i].append( + self.outputs.normalized_class_images[i].append( os.path.join(pth, "w%sp%d%s.nii" % (dartel_px, i + 1, base))) if getattr(self.inputs, '%s_modulated_normalized' % tis) == 1: - outputs['modulated_class_images'][i].append(os.path.join( + self.outputs.modulated_class_images[i].append(os.path.join( pth, "mw%sp%d%s.nii" % (dartel_px, i + 1, base))) elif getattr(self.inputs, '%s_modulated_normalized' % tis) == 2: - outputs['normalized_class_images'][i].append(os.path.join( + self.outputs.normalized_class_images[i].append(os.path.join( pth, "m0w%sp%d%s.nii" % (dartel_px, i + 1, base))) if self.inputs.pve_label_native: - outputs['pve_label_native_images'].append( + self.outputs.pve_label_native_images.append( os.path.join(pth, "p0%s.nii" % (base))) if self.inputs.pve_label_normalized: - outputs['pve_label_normalized_images'].append( + self.outputs.pve_label_normalized_images.append( os.path.join(pth, "w%sp0%s.nii" % (dartel_px, base))) if self.inputs.pve_label_dartel == 1: - outputs['pve_label_registered_images'].append( + self.outputs.pve_label_registered_images.append( os.path.join(pth, "rp0%s.nii" % (base))) elif self.inputs.pve_label_dartel == 2: - outputs['pve_label_registered_images'].append( + self.outputs.pve_label_registered_images.append( os.path.join(pth, "rp0%s_affine.nii" % (base))) if self.inputs.bias_corrected_native: - outputs['bias_corrected_images'].append( + self.outputs.bias_corrected_images.append( os.path.join(pth, "m%s.nii" % (base))) if self.inputs.bias_corrected_normalized: - outputs['normalized_bias_corrected_images'].append( + self.outputs.normalized_bias_corrected_images.append( os.path.join(pth, "wm%s%s.nii" % (dartel_px, base))) if self.inputs.deformation_field[0]: - outputs['forward_deformation_field'].append( + self.outputs.forward_deformation_field.append( os.path.join(pth, "y_%s%s.nii" % (dartel_px, base))) if self.inputs.deformation_field[1]: - outputs['inverse_deformation_field'].append( + self.outputs.inverse_deformation_field.append( os.path.join(pth, "iy_%s%s.nii" % (dartel_px, base))) if self.inputs.jacobian_determinant and do_dartel: - outputs['jacobian_determinant_images'].append( + self.outputs.jacobian_determinant_images.append( os.path.join(pth, "jac_wrp1%s.nii" % (base))) return outputs diff --git a/nipype/interfaces/spm/utils.py b/nipype/interfaces/spm/utils.py index 452727fa44..eb4f82a09f 100644 --- a/nipype/interfaces/spm/utils.py +++ b/nipype/interfaces/spm/utils.py @@ -37,7 +37,7 @@ def _make_matlab_command(self, _): def _list_outputs(self): outputs = self._outputs().get() - outputs['nifti_file'] = self.output_name + self.outputs.nifti_file = self.output_name return outputs @@ -117,8 +117,8 @@ def _make_matlab_command(self, _): def _list_outputs(self): outputs = self._outputs().get() - outputs['mat'] = os.path.abspath(self.inputs.mat) - outputs['invmat'] = os.path.abspath(self.inputs.invmat) + self.outputs.mat = os.path.abspath(self.inputs.mat) + self.outputs.invmat = os.path.abspath(self.inputs.invmat) return outputs @@ -154,7 +154,7 @@ class ApplyTransform(SPMCommand): def _make_matlab_command(self, _): """checks for SPM, generates script""" outputs = self._list_outputs() - self.inputs.out_file = outputs['out_file'] + self.inputs.out_file = self.outputs.out_file script = """ infile = '%s'; outfile = '%s' @@ -177,9 +177,9 @@ def _make_matlab_command(self, _): def _list_outputs(self): outputs = self.output_spec().get() if not isdefined(self.inputs.out_file): - outputs['out_file'] = os.path.abspath(self._gen_outfilename()) + self.outputs.out_file = os.path.abspath(self._gen_outfilename()) else: - outputs['out_file'] = os.path.abspath(self.inputs.out_file) + self.outputs.out_file = os.path.abspath(self.inputs.out_file) return outputs def _gen_outfilename(self): @@ -230,7 +230,7 @@ def _make_matlab_command(self, _): def _list_outputs(self): outputs = self._outputs().get() - outputs['out_file'] = os.path.abspath(self.inputs.out_file) + self.outputs.out_file = os.path.abspath(self.inputs.out_file) return outputs @@ -309,10 +309,10 @@ def _format_arg(self, opt, spec, val): def _list_outputs(self): outputs = self._outputs().get() - outputs['out_files'] = [] + self.outputs.out_files = [] for filename in self.inputs.in_files: _, fname = os.path.split(filename) - outputs['out_files'].append(os.path.realpath('w%s' % fname)) + self.outputs.out_files.append(os.path.realpath('w%s' % fname)) return outputs @@ -379,10 +379,10 @@ def _format_arg(self, opt, spec, val): def _list_outputs(self): outputs = self._outputs().get() - outputs['out_files'] = [] + self.outputs.out_files = [] for filename in self.inputs.in_files: _, fname = os.path.split(filename) - outputs['out_files'].append(os.path.realpath('w%s' % fname)) + self.outputs.out_files.append(os.path.realpath('w%s' % fname)) return outputs @@ -466,11 +466,11 @@ def _list_outputs(self): ext = self.inputs.format if self.inputs.output_dir_struct == "flat": - outputs['out_files'] = glob(os.path.join(od, '*.%s' % ext)) + self.outputs.out_files = glob(os.path.join(od, '*.%s' % ext)) elif self.inputs.output_dir_struct == 'series': - outputs['out_files'] = glob(os.path.join(od, os.path.join('*', '*.%s' % ext))) + self.outputs.out_files = glob(os.path.join(od, os.path.join('*', '*.%s' % ext))) elif self.inputs.output_dir_struct in ['patid', 'date_time', 'patname']: - outputs['out_files'] = glob(os.path.join(od, os.path.join('*', '*', '*.%s' % ext))) + self.outputs.out_files = glob(os.path.join(od, os.path.join('*', '*', '*.%s' % ext))) elif self.inputs.output_dir_struct == 'patid_date': - outputs['out_files'] = glob(os.path.join(od, os.path.join('*', '*', '*', '*.%s' % ext))) + self.outputs.out_files = glob(os.path.join(od, os.path.join('*', '*', '*', '*.%s' % ext))) return outputs diff --git a/nipype/interfaces/utility.py b/nipype/interfaces/utility.py index afb10d5b01..03243fe1e7 100644 --- a/nipype/interfaces/utility.py +++ b/nipype/interfaces/utility.py @@ -155,7 +155,7 @@ def _list_outputs(self): for j in range(self._numinputs): out[i].append(filename_to_list(getattr(self.inputs, 'in%d' % (j + 1)))[i]) if out: - outputs['out'] = out + self.outputs.out = out return outputs @@ -261,7 +261,7 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs["out_file"] = os.path.join(os.getcwd(), self._rename()) + self.outputs.out_file = os.path.join(os.getcwd(), self._rename()) return outputs @@ -354,7 +354,7 @@ class Select(IOBase): def _list_outputs(self): outputs = self._outputs().get() out = np.array(self.inputs.inlist)[np.array(self.inputs.index)].tolist() - outputs['out'] = out + self.outputs.out = out return outputs diff --git a/nipype/pipeline/engine/tests/test_join.py b/nipype/pipeline/engine/tests/test_join.py index b0882de91e..afa7f56ee0 100644 --- a/nipype/pipeline/engine/tests/test_join.py +++ b/nipype/pipeline/engine/tests/test_join.py @@ -33,7 +33,7 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs['output1'] = self.inputs.in_files[0] + self.outputs.output1 = self.inputs.in_files[0] return outputs @@ -56,7 +56,7 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs['output1'] = self.inputs.input1 + self.inputs.inc + self.outputs.output1 = self.inputs.input1 + self.inputs.inc return outputs _sums = [] @@ -85,10 +85,10 @@ def _list_outputs(self): global _sum global _sum_operands outputs = self._outputs().get() - outputs['operands'] = self.inputs.input1 - _sum_operands.append(outputs['operands']) - outputs['output1'] = sum(self.inputs.input1) - _sums.append(outputs['output1']) + self.outputs.operands = self.inputs.input1 + _sum_operands.append(self.outputs.operands) + self.outputs.output1 = sum(self.inputs.input1) + _sums.append(self.outputs.output1) return outputs @@ -115,7 +115,7 @@ def _run_interface(self, runtime): def _list_outputs(self): global _set_len outputs = self._outputs().get() - _set_len = outputs['output1'] = len(self.inputs.input1) + _set_len = self.outputs.output1 = len(self.inputs.input1) return outputs @@ -143,8 +143,8 @@ def _run_interface(self, runtime): def _list_outputs(self): global _products outputs = self._outputs().get() - outputs['output1'] = self.inputs.input1 * self.inputs.input2 - _products.append(outputs['output1']) + self.outputs.output1 = self.inputs.input1 * self.inputs.input2 + _products.append(self.outputs.output1) return outputs diff --git a/nipype/pipeline/engine/tests/test_utils.py b/nipype/pipeline/engine/tests/test_utils.py index 8420f587c2..76c3dfb2ab 100644 --- a/nipype/pipeline/engine/tests/test_utils.py +++ b/nipype/pipeline/engine/tests/test_utils.py @@ -150,7 +150,7 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs['output1'] = [1] + self.outputs.output1 = [1] return outputs diff --git a/nipype/pipeline/plugins/tests/test_debug.py b/nipype/pipeline/plugins/tests/test_debug.py index f15fc62939..82c6f82339 100644 --- a/nipype/pipeline/plugins/tests/test_debug.py +++ b/nipype/pipeline/plugins/tests/test_debug.py @@ -26,7 +26,7 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs['output1'] = [1, self.inputs.input1] + self.outputs.output1 = [1, self.inputs.input1] return outputs diff --git a/nipype/pipeline/plugins/tests/test_linear.py b/nipype/pipeline/plugins/tests/test_linear.py index a59c7c1981..d9f12e3aaf 100644 --- a/nipype/pipeline/plugins/tests/test_linear.py +++ b/nipype/pipeline/plugins/tests/test_linear.py @@ -26,7 +26,7 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs['output1'] = [1, self.inputs.input1] + self.outputs.output1 = [1, self.inputs.input1] return outputs diff --git a/nipype/pipeline/plugins/tests/test_multiproc.py b/nipype/pipeline/plugins/tests/test_multiproc.py index efa9ec4161..a7aed74d43 100644 --- a/nipype/pipeline/plugins/tests/test_multiproc.py +++ b/nipype/pipeline/plugins/tests/test_multiproc.py @@ -26,7 +26,7 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs['output1'] = [1, self.inputs.input1] + self.outputs.output1 = [1, self.inputs.input1] return outputs diff --git a/nipype/pipeline/plugins/tests/test_oar.py b/nipype/pipeline/plugins/tests/test_oar.py index a5ef97fee3..58feb89b27 100644 --- a/nipype/pipeline/plugins/tests/test_oar.py +++ b/nipype/pipeline/plugins/tests/test_oar.py @@ -26,7 +26,7 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs['output1'] = [1, self.inputs.input1] + self.outputs.output1 = [1, self.inputs.input1] return outputs diff --git a/nipype/pipeline/plugins/tests/test_pbs.py b/nipype/pipeline/plugins/tests/test_pbs.py index 8aa52e1163..8fde78883a 100644 --- a/nipype/pipeline/plugins/tests/test_pbs.py +++ b/nipype/pipeline/plugins/tests/test_pbs.py @@ -27,7 +27,7 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs['output1'] = [1, self.inputs.input1] + self.outputs.output1 = [1, self.inputs.input1] return outputs diff --git a/nipype/pipeline/plugins/tests/test_somaflow.py b/nipype/pipeline/plugins/tests/test_somaflow.py index 27b2e30a83..24d30c0e42 100644 --- a/nipype/pipeline/plugins/tests/test_somaflow.py +++ b/nipype/pipeline/plugins/tests/test_somaflow.py @@ -29,7 +29,7 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() - outputs['output1'] = [1, self.inputs.input1] + self.outputs.output1 = [1, self.inputs.input1] return outputs From 84d43479893e16e33a05ba349ae96de3d66eee39 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 17 Feb 2016 08:46:09 -0800 Subject: [PATCH 24/73] replace all outputs getters --- nipype/interfaces/afni/preprocess.py | 2 +- nipype/interfaces/freesurfer/model.py | 14 +++++++------- nipype/interfaces/freesurfer/preprocess.py | 12 ++++++------ nipype/interfaces/freesurfer/utils.py | 8 ++++---- nipype/interfaces/fsl/epi.py | 2 +- nipype/interfaces/fsl/maths.py | 2 +- nipype/interfaces/fsl/preprocess.py | 12 ++++++------ nipype/interfaces/fsl/utils.py | 22 +++++++++++----------- nipype/interfaces/nipy/preprocess.py | 2 +- nipype/interfaces/petpvc.py | 2 +- 10 files changed, 39 insertions(+), 39 deletions(-) diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index 420c045c51..dac15fc6b0 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -1172,7 +1172,7 @@ def _list_outputs(self): def _gen_filename(self, name): if name == 'out_file': - return self._list_outputs()[name] + return getattr(self.outputs, name) class MaskaveInputSpec(AFNICommandInputSpec): diff --git a/nipype/interfaces/freesurfer/model.py b/nipype/interfaces/freesurfer/model.py index 2116201c14..a4aac88d53 100644 --- a/nipype/interfaces/freesurfer/model.py +++ b/nipype/interfaces/freesurfer/model.py @@ -109,7 +109,7 @@ def _list_outputs(self): def _gen_filename(self, name): if name == 'out_file': - return self._list_outputs()[name] + return getattr(self.outputs, name) return None @@ -447,7 +447,7 @@ def _list_outputs(self): def _format_arg(self, name, spec, value): if name == 'count_file': if isinstance(value, bool): - fname = self._list_outputs()[name] + fname = getattr(self.outputs, name) else: fname = value return spec.argstr % fname @@ -457,7 +457,7 @@ def _format_arg(self, name, spec, value): def _gen_filename(self, name): if name == 'binary_file': - return self._list_outputs()[name] + return getattr(self.outputs, name) return None @@ -537,7 +537,7 @@ def _list_outputs(self): def _gen_filename(self, name): if name == 'concatenated_file': - return self._list_outputs()[name] + return getattr(self.outputs, name) return None @@ -662,7 +662,7 @@ def _list_outputs(self): def _format_arg(self, name, spec, value): if name in ['avgwf_txt_file', 'avgwf_file', 'sf_avg_file']: if isinstance(value, bool): - fname = self._list_outputs()[name] + fname = getattr(self.outputs, name) else: fname = value return spec.argstr % fname @@ -670,7 +670,7 @@ def _format_arg(self, name, spec, value): def _gen_filename(self, name): if name == 'summary_file': - return self._list_outputs()[name] + return getattr(self.outputs, name) return None @@ -773,7 +773,7 @@ def _list_outputs(self): def _gen_filename(self, name): if name == 'vol_label_file': - return self._list_outputs()[name] + return getattr(self.outputs, name) return None diff --git a/nipype/interfaces/freesurfer/preprocess.py b/nipype/interfaces/freesurfer/preprocess.py index c11a324a13..2d87ef2538 100644 --- a/nipype/interfaces/freesurfer/preprocess.py +++ b/nipype/interfaces/freesurfer/preprocess.py @@ -905,7 +905,7 @@ def _format_arg(self, name, spec, value): if name in ['registered_file', 'out_fsl_file']: if isinstance(value, bool): - fname = self._list_outputs()[name] + fname = getattr(self.outputs, name) else: fname = value return spec.argstr % fname @@ -914,7 +914,7 @@ def _format_arg(self, name, spec, value): def _gen_filename(self, name): if name == 'out_reg_file': - return self._list_outputs()[name] + return getattr(self.outputs, name) return None @@ -1093,7 +1093,7 @@ def _list_outputs(self): def _gen_filename(self, name): if name == 'smoothed_file': - return self._list_outputs()[name] + return getattr(self.outputs, name) return None @@ -1197,7 +1197,7 @@ def _format_arg(self, name, spec, value): "half_weights", "half_source_xfm", "half_targ_xfm"]: if name == option: if isinstance(value, bool): - fname = self._list_outputs()[name] + fname = getattr(self.outputs, name) else: fname = value return spec.argstr % fname @@ -1231,7 +1231,7 @@ def _list_outputs(self): def _gen_filename(self, name): if name == 'out_reg_file': - return self._list_outputs()[name] + return getattr(self.outputs, name) return None @@ -1356,5 +1356,5 @@ def _list_outputs(self): def _gen_filename(self, name): if name == "out_file": - return self._list_outputs()["out_file"] + return self.outputs.out_file return None diff --git a/nipype/interfaces/freesurfer/utils.py b/nipype/interfaces/freesurfer/utils.py index 65e6397a52..8664e4d02d 100644 --- a/nipype/interfaces/freesurfer/utils.py +++ b/nipype/interfaces/freesurfer/utils.py @@ -219,7 +219,7 @@ def _list_outputs(self): def _gen_filename(self, name): if name == "out_file": - return self._list_outputs()[name] + return getattr(self.outputs, name) return None @@ -289,7 +289,7 @@ def _list_outputs(self): def _gen_filename(self, name): if name == "out_file": - return self._list_outputs()[name] + return getattr(self.outputs, name) return None @@ -383,7 +383,7 @@ def _list_outputs(self): def _gen_filename(self, name): if name == "out_file": - return self._list_outputs()[name] + return getattr(self.outputs, name) return None @@ -499,7 +499,7 @@ def _list_outputs(self): def _gen_filename(self, name): if name == "out_file": - return self._list_outputs()[name] + return getattr(self.outputs, name) return None diff --git a/nipype/interfaces/fsl/epi.py b/nipype/interfaces/fsl/epi.py index 2b41a35ab8..a0f1580542 100644 --- a/nipype/interfaces/fsl/epi.py +++ b/nipype/interfaces/fsl/epi.py @@ -556,7 +556,7 @@ def _list_outputs(self): def _gen_filename(self, name): if name == 'out_file': - return self._list_outputs()['out_file'] + return self.outputs.out_file return None diff --git a/nipype/interfaces/fsl/maths.py b/nipype/interfaces/fsl/maths.py index 660d62a28c..e5a7e21f02 100644 --- a/nipype/interfaces/fsl/maths.py +++ b/nipype/interfaces/fsl/maths.py @@ -57,7 +57,7 @@ def _list_outputs(self): def _gen_filename(self, name): if name == "out_file": - return self._list_outputs()["out_file"] + return self.outputs.out_file return None diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index ac8267006a..49de1fc30c 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -868,12 +868,12 @@ def _post_run(self): def _format_arg(self, name, spec, value): if name in list(self.filemap.keys()): - return spec.argstr % self._list_outputs()[name] + return spec.argstr % getattr(self.outputs, name) return super(FNIRT, self)._format_arg(name, spec, value) def _gen_filename(self, name): if name in ['warped_file', 'log_file']: - return self._list_outputs()[name] + return getattr(self.outputs, name) return None def write_config(self, configfile): @@ -969,7 +969,7 @@ def _post_run(self): def _gen_filename(self, name): if name == 'out_file': - return self._list_outputs()[name] + return getattr(self.outputs, name) return None @@ -1028,7 +1028,7 @@ def _post_run(self): def _gen_filename(self, name): if name == 'out_file': - return self._list_outputs()['slice_time_corrected_file'] + return self.outputs.slice_time_corrected_file return None @@ -1107,7 +1107,7 @@ def _post_run(self): def _gen_filename(self, name): if name == 'out_file': - return self._list_outputs()['smoothed_file'] + return self.outputs.smoothed_file return None @@ -1420,7 +1420,7 @@ def _post_run(self): def _gen_filename(self, name): if name == 'unwrapped_phase_file': - return self._list_outputs()['unwrapped_phase_file'] + return self.outputs.unwrapped_phase_file return None diff --git a/nipype/interfaces/fsl/utils.py b/nipype/interfaces/fsl/utils.py index 5d4acfc7f0..22e7501468 100644 --- a/nipype/interfaces/fsl/utils.py +++ b/nipype/interfaces/fsl/utils.py @@ -133,7 +133,7 @@ def _list_outputs(self): def _gen_filename(self, name): if name == 'out_file': - return self._list_outputs()[name] + return getattr(self.outputs, name) return None @@ -347,7 +347,7 @@ def _list_outputs(self): def _gen_filename(self, name): if name == 'roi_file': - return self._list_outputs()[name] + return getattr(self.outputs, name) return None @@ -439,7 +439,7 @@ class ImageMaths(FSLCommand): def _gen_filename(self, name): if name == 'out_file': - return self._list_outputs()[name] + return getattr(self.outputs, name) return None def _parse_inputs(self, skip=None): @@ -521,7 +521,7 @@ def _list_outputs(self): def _gen_filename(self, name): if name == 'out_file': - return self._list_outputs()[name] + return getattr(self.outputs, name) return None @@ -772,7 +772,7 @@ def _list_outputs(self): def _gen_filename(self, name): if name == 'out_file': - return self._list_outputs()['out_file'] + return self.outputs.out_file return None @@ -874,7 +874,7 @@ def _list_outputs(self): def _gen_filename(self, name): if name == 'out_file': - return self._list_outputs()['out_file'] + return self.outputs.out_file return None @@ -977,7 +977,7 @@ def _list_outputs(self): def _gen_filename(self, name): if name == 'out_file': - return self._list_outputs()['out_file'] + return self.outputs.out_file return None @@ -1088,7 +1088,7 @@ def _list_outputs(self): def _gen_filename(self, name): if name == 'out_file': - return self._list_outputs()['out_file'] + return self.outputs.out_file return None @@ -1165,7 +1165,7 @@ def _list_outputs(self): def _gen_filename(self, name): if name == "out_file": - return self._list_outputs()["out_file"] + return self.outputs.out_file return None @@ -1211,7 +1211,7 @@ def _list_outputs(self): def _gen_filename(self, name): if name == "out_file": - return self._list_outputs()["out_file"] + return self.outputs.out_file return None @@ -1318,7 +1318,7 @@ def _list_outputs(self): def _gen_filename(self, name): if name == 'out_file': - return self._list_outputs()['out_file'] + return self.outputs.out_file return None diff --git a/nipype/interfaces/nipy/preprocess.py b/nipype/interfaces/nipy/preprocess.py index b51e0b9465..5cebec9ab2 100644 --- a/nipype/interfaces/nipy/preprocess.py +++ b/nipype/interfaces/nipy/preprocess.py @@ -365,7 +365,7 @@ class Trim(BaseInterface): output_spec = TrimOutputSpec def _run_interface(self, runtime): - out_file = self._list_outputs()['out_file'] + out_file = self.outputs.out_file nii = nb.load(self.inputs.in_file) if self.inputs.end_index == 0: s = slice(self.inputs.begin_index, nii.shape[3]) diff --git a/nipype/interfaces/petpvc.py b/nipype/interfaces/petpvc.py index 738ec84964..e891020908 100644 --- a/nipype/interfaces/petpvc.py +++ b/nipype/interfaces/petpvc.py @@ -220,5 +220,5 @@ def _gen_fname(self, basename, cwd=None, suffix=None, change_ext=True, def _gen_filename(self, name): if name == 'out_file': - return self._list_outputs()['out_file'] + return self.outputs.out_file return None From 17b3ece22c61b4914f568b1ba87de07df3fc2dee Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 17 Feb 2016 08:52:03 -0800 Subject: [PATCH 25/73] removing all output_spec().get() --- nipype/algorithms/misc.py | 6 +- nipype/interfaces/afni/base.py | 2 +- nipype/interfaces/afni/preprocess.py | 4 +- nipype/interfaces/base.py | 2 +- nipype/interfaces/camino/calib.py | 4 +- nipype/interfaces/camino/connectivity.py | 2 +- nipype/interfaces/camino/convert.py | 18 ++--- nipype/interfaces/camino/dti.py | 20 +++--- nipype/interfaces/camino/odf.py | 8 +-- nipype/interfaces/camino/utils.py | 2 +- nipype/interfaces/camino2trackvis/convert.py | 4 +- nipype/interfaces/cmtk/cmtk.py | 2 +- nipype/interfaces/cmtk/nbs.py | 2 +- nipype/interfaces/cmtk/nx.py | 4 +- nipype/interfaces/dcm2nii.py | 2 +- nipype/interfaces/diffusion_toolkit/dti.py | 4 +- nipype/interfaces/diffusion_toolkit/odf.py | 6 +- .../interfaces/diffusion_toolkit/postproc.py | 4 +- nipype/interfaces/dynamic_slicer.py | 8 +-- nipype/interfaces/elastix/utils.py | 2 +- nipype/interfaces/freesurfer/model.py | 16 ++--- nipype/interfaces/freesurfer/preprocess.py | 22 +++--- nipype/interfaces/freesurfer/utils.py | 12 ++-- nipype/interfaces/fsl/epi.py | 10 +-- nipype/interfaces/fsl/maths.py | 2 +- nipype/interfaces/fsl/model.py | 16 ++--- nipype/interfaces/fsl/preprocess.py | 14 ++-- nipype/interfaces/fsl/utils.py | 12 ++-- nipype/interfaces/io.py | 68 +++++++++---------- nipype/interfaces/meshfix.py | 2 +- nipype/interfaces/minc/minc.py | 8 +-- nipype/interfaces/mne/base.py | 4 +- nipype/interfaces/mrtrix/preprocess.py | 20 +++--- nipype/interfaces/mrtrix/tensors.py | 8 +-- nipype/interfaces/mrtrix/tracking.py | 2 +- nipype/interfaces/mrtrix3/connectivity.py | 4 +- nipype/interfaces/mrtrix3/preprocess.py | 6 +- nipype/interfaces/mrtrix3/reconst.py | 4 +- nipype/interfaces/mrtrix3/tracking.py | 2 +- nipype/interfaces/mrtrix3/utils.py | 14 ++-- nipype/interfaces/nipy/preprocess.py | 2 +- nipype/interfaces/nitime/analysis.py | 2 +- nipype/interfaces/petpvc.py | 2 +- nipype/interfaces/spm/preprocess.py | 2 +- nipype/interfaces/spm/utils.py | 2 +- nipype/interfaces/utility.py | 8 +-- nipype/pipeline/engine/utils.py | 4 +- 47 files changed, 187 insertions(+), 187 deletions(-) diff --git a/nipype/algorithms/misc.py b/nipype/algorithms/misc.py index 130099a43e..f0e4cff963 100644 --- a/nipype/algorithms/misc.py +++ b/nipype/algorithms/misc.py @@ -606,10 +606,10 @@ def __setattr__(self, key, value): if key not in self.copyable_trait_names(): if not isdefined(value): super(AddCSVRowInputSpec, self).__setattr__(key, value) - self._outputs[key] = value + self._setattr(self.outputs, key, value else: if key in self._outputs: - self._outputs[key] = value + self._setattr(self.outputs, key, value super(AddCSVRowInputSpec, self).__setattr__(key, value) @@ -655,7 +655,7 @@ def __init__(self, infields=None, force_run=True, **kwargs): if infields: for key in infields: self.inputs.add_trait(key, traits.Any) - self.inputs._outputs[key] = Undefined + self.inputs._setattr(self.outputs, key, Undefined undefined_traits[key] = Undefined self.inputs.trait_set(trait_change_notify=False, **undefined_traits) diff --git a/nipype/interfaces/afni/base.py b/nipype/interfaces/afni/base.py index b36c78012e..f1e071acca 100644 --- a/nipype/interfaces/afni/base.py +++ b/nipype/interfaces/afni/base.py @@ -190,7 +190,7 @@ def _post_run(self): if outputs[name]: _, _, ext = split_filename(outputs[name]) if ext == "": - outputs[name] = outputs[name] + "+orig.BRIK" + setattr(self.outputs, name, outputs[name] + "+orig.BRIK" def no_afni(): diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index dac15fc6b0..61f245c8fa 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -208,7 +208,7 @@ class Refit(AFNICommandBase): output_spec = AFNICommandOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = os.path.abspath(self.inputs.in_file) return outputs @@ -1162,7 +1162,7 @@ def _format_arg(self, name, trait_spec, value): return super(Allineate, self)._format_arg(name, trait_spec, value) def _list_outputs(self): - outputs = self.output_spec().get() + if not isdefined(self.inputs.out_file): self.outputs.out_file = self._gen_filename(self.inputs.in_file, suffix=self.inputs.suffix) diff --git a/nipype/interfaces/base.py b/nipype/interfaces/base.py index 9d45b4edd8..bb61c4a235 100644 --- a/nipype/interfaces/base.py +++ b/nipype/interfaces/base.py @@ -479,7 +479,7 @@ def _post_run(self): for ns_input, ns_spec in list(self.inputs.namesource_items()): ns_pointer = getattr(ns_spec, 'out_name', None) if ns_pointer is not None: - ns_outputs[ns_pointer] = ns_input + ns_setattr(self.outputs, ns_pointer, ns_input # Search for inputs with the same name for out_name, spec in list(self.outputs.items()): diff --git a/nipype/interfaces/camino/calib.py b/nipype/interfaces/camino/calib.py index 02b6177004..45437bb97d 100644 --- a/nipype/interfaces/camino/calib.py +++ b/nipype/interfaces/camino/calib.py @@ -121,7 +121,7 @@ class SFPICOCalibData(StdOutCommandLine): output_spec = SFPICOCalibDataOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.PICOCalib = os.path.abspath(self._gen_outfilename()) self.outputs.calib_info = os.path.abspath(self.inputs.info_file) return outputs @@ -228,7 +228,7 @@ class SFLUTGen(StdOutCommandLine): output_spec = SFLUTGenOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.lut_one_fibre = self.inputs.outputstem + '_oneFibreSurfaceCoeffs.Bdouble' self.outputs.lut_two_fibres = self.inputs.outputstem + '_twoFibreSurfaceCoeffs.Bdouble' return outputs diff --git a/nipype/interfaces/camino/connectivity.py b/nipype/interfaces/camino/connectivity.py index 3c3453e88e..ed488e4317 100644 --- a/nipype/interfaces/camino/connectivity.py +++ b/nipype/interfaces/camino/connectivity.py @@ -133,7 +133,7 @@ class Conmat(CommandLine): output_spec = ConmatOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + output_root = self._gen_outputroot() self.outputs.conmat_sc = os.path.abspath(output_root + "sc.csv") self.outputs.conmat_ts = os.path.abspath(output_root + "ts.csv") diff --git a/nipype/interfaces/camino/convert.py b/nipype/interfaces/camino/convert.py index fb530c1cc8..2ea1e33974 100644 --- a/nipype/interfaces/camino/convert.py +++ b/nipype/interfaces/camino/convert.py @@ -57,7 +57,7 @@ class Image2Voxel(StdOutCommandLine): output_spec = Image2VoxelOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.voxel_order = os.path.abspath(self._gen_outfilename()) return outputs @@ -115,7 +115,7 @@ class FSL2Scheme(StdOutCommandLine): output_spec = FSL2SchemeOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.scheme = os.path.abspath(self._gen_outfilename()) return outputs @@ -171,7 +171,7 @@ class VtkStreamlines(StdOutCommandLine): output_spec = VtkStreamlinesOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.vtk = os.path.abspath(self._gen_outfilename()) return outputs @@ -299,7 +299,7 @@ def _get_actual_outputroot(self, outputroot): return actual_outputroot def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.proc = os.path.abspath(self._gen_outfilename()) self.outputs.outputroot_files = self.outputroot_files return outputs @@ -352,7 +352,7 @@ class TractShredder(StdOutCommandLine): output_spec = TractShredderOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.shredded = os.path.abspath(self._gen_outfilename()) return outputs @@ -391,7 +391,7 @@ class DT2NIfTI(CommandLine): output_spec = DT2NIfTIOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + output_root = self._gen_outputroot() self.outputs.dt = os.path.abspath(output_root + "dt.nii") self.outputs.exitcode = os.path.abspath(output_root + "exitcode.nii") @@ -474,7 +474,7 @@ class NIfTIDT2Camino(CommandLine): output_spec = NIfTIDT2CaminoOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = self._gen_filename('out_file') return outputs @@ -628,7 +628,7 @@ class AnalyzeHeader(StdOutCommandLine): output_spec = AnalyzeHeaderOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.header = os.path.abspath(self._gen_outfilename()) return outputs @@ -682,7 +682,7 @@ class Shredder(StdOutCommandLine): output_spec = ShredderOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.shredded_file = os.path.abspath(self._gen_outfilename()) return outputs diff --git a/nipype/interfaces/camino/dti.py b/nipype/interfaces/camino/dti.py index 68ca1a9e32..e90710e0fe 100644 --- a/nipype/interfaces/camino/dti.py +++ b/nipype/interfaces/camino/dti.py @@ -62,7 +62,7 @@ class DTIFit(StdOutCommandLine): output_spec = DTIFitOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.tensor_fitted = os.path.abspath(self._gen_outfilename()) return outputs @@ -148,7 +148,7 @@ class DTMetric(CommandLine): output_spec = DTMetricOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.metric_stats = os.path.abspath(self._gen_outfilename()) return outputs @@ -252,7 +252,7 @@ class ModelFit(StdOutCommandLine): output_spec = ModelFitOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.fitted_data = os.path.abspath(self._gen_outfilename()) return outputs @@ -334,7 +334,7 @@ class DTLUTGen(StdOutCommandLine): output_spec = DTLUTGenOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.dtLUT = os.path.abspath(self._gen_outfilename()) return outputs @@ -398,7 +398,7 @@ class PicoPDFs(StdOutCommandLine): output_spec = PicoPDFsOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.pdfs = os.path.abspath(self._gen_outfilename()) return outputs @@ -565,7 +565,7 @@ class Track(CommandLine): output_spec = TrackOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + if isdefined(self.inputs.out_file): out_file_path = os.path.abspath(self.inputs.out_file) else: @@ -873,7 +873,7 @@ class ComputeMeanDiffusivity(StdOutCommandLine): output_spec = ComputeMeanDiffusivityOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.md = os.path.abspath(self._gen_outfilename()) return outputs @@ -935,7 +935,7 @@ class ComputeFractionalAnisotropy(StdOutCommandLine): output_spec = ComputeFractionalAnisotropyOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.fa = os.path.abspath(self._gen_outfilename()) return outputs @@ -999,7 +999,7 @@ class ComputeTensorTrace(StdOutCommandLine): output_spec = ComputeTensorTraceOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.trace = os.path.abspath(self._gen_outfilename()) return outputs @@ -1059,7 +1059,7 @@ class ComputeEigensystem(StdOutCommandLine): output_spec = ComputeEigensystemOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.eigen = os.path.abspath(self._gen_outfilename()) return outputs diff --git a/nipype/interfaces/camino/odf.py b/nipype/interfaces/camino/odf.py index ddab800071..34ca4f629b 100644 --- a/nipype/interfaces/camino/odf.py +++ b/nipype/interfaces/camino/odf.py @@ -83,7 +83,7 @@ class QBallMX(StdOutCommandLine): output_spec = QBallMXOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.qmat = os.path.abspath(self._gen_outfilename()) return outputs @@ -160,7 +160,7 @@ class LinRecon(StdOutCommandLine): output_spec = LinReconOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.recon_data = os.path.abspath(self._gen_outfilename()) return outputs @@ -284,7 +284,7 @@ class MESD(StdOutCommandLine): output_spec = MESDOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.mesd_data = os.path.abspath(self._gen_outfilename()) return outputs @@ -431,7 +431,7 @@ class SFPeaks(StdOutCommandLine): output_spec = SFPeaksOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.peaks = os.path.abspath(self._gen_outfilename()) return outputs diff --git a/nipype/interfaces/camino/utils.py b/nipype/interfaces/camino/utils.py index 70b7138953..451d726e42 100644 --- a/nipype/interfaces/camino/utils.py +++ b/nipype/interfaces/camino/utils.py @@ -56,7 +56,7 @@ class ImageStats(CommandLine): output_spec = ImageStatsOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = os.path.abspath(self._gen_outfilename()) return outputs diff --git a/nipype/interfaces/camino2trackvis/convert.py b/nipype/interfaces/camino2trackvis/convert.py index 289c30855b..36db947b15 100644 --- a/nipype/interfaces/camino2trackvis/convert.py +++ b/nipype/interfaces/camino2trackvis/convert.py @@ -74,7 +74,7 @@ class Camino2Trackvis(CommandLine): output_spec = Camino2TrackvisOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.trackvis = os.path.abspath(self._gen_outfilename()) return outputs @@ -125,7 +125,7 @@ class Trackvis2Camino(CommandLine): output_spec = Trackvis2CaminoOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.camino = os.path.abspath(self._gen_outfilename()) return outputs diff --git a/nipype/interfaces/cmtk/cmtk.py b/nipype/interfaces/cmtk/cmtk.py index 16250baac7..1b9ae281a3 100644 --- a/nipype/interfaces/cmtk/cmtk.py +++ b/nipype/interfaces/cmtk/cmtk.py @@ -497,7 +497,7 @@ def _run_interface(self, runtime): return runtime def _list_outputs(self): - outputs = self.output_spec().get() + if isdefined(self.inputs.out_matrix_file): path, name, _ = split_filename(self.inputs.out_matrix_file) out_matrix_file = op.abspath(name + '.pck') diff --git a/nipype/interfaces/cmtk/nbs.py b/nipype/interfaces/cmtk/nbs.py index 1d915410b0..5e00dbfc25 100644 --- a/nipype/interfaces/cmtk/nbs.py +++ b/nipype/interfaces/cmtk/nbs.py @@ -128,7 +128,7 @@ def _run_interface(self, runtime): return runtime def _list_outputs(self): - outputs = self.output_spec().get() + THRESH = self.inputs.threshold K = self.inputs.number_of_permutations diff --git a/nipype/interfaces/cmtk/nx.py b/nipype/interfaces/cmtk/nx.py index fcfd686480..f45aaf2c45 100644 --- a/nipype/interfaces/cmtk/nx.py +++ b/nipype/interfaces/cmtk/nx.py @@ -483,7 +483,7 @@ def _run_interface(self, runtime): return runtime def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.k_core = op.abspath(self._gen_outfilename(self.inputs.out_k_core, 'pck')) self.outputs.k_shell = op.abspath(self._gen_outfilename(self.inputs.out_k_shell, 'pck')) self.outputs.k_crust = op.abspath(self._gen_outfilename(self.inputs.out_k_crust, 'pck')) @@ -548,7 +548,7 @@ def _run_interface(self, runtime): return runtime def _list_outputs(self): - outputs = self.output_spec().get() + if not isdefined(self.inputs.out_gpickled_groupavg): self.outputs.gpickled_groupavg = op.abspath(self._gen_outfilename(self.inputs.group_id + '_average', 'pck')) else: diff --git a/nipype/interfaces/dcm2nii.py b/nipype/interfaces/dcm2nii.py index ee12bd1f80..72ff70a7fe 100644 --- a/nipype/interfaces/dcm2nii.py +++ b/nipype/interfaces/dcm2nii.py @@ -160,7 +160,7 @@ def _parse_stdout(self, stdout): return files, reoriented_files, reoriented_and_cropped_files, bvecs, bvals def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.converted_files = self.output_files self.outputs.reoriented_files = self.reoriented_files self.outputs.reoriented_and_cropped_files = self.reoriented_and_cropped_files diff --git a/nipype/interfaces/diffusion_toolkit/dti.py b/nipype/interfaces/diffusion_toolkit/dti.py index 0ad734961a..0b40e26b19 100644 --- a/nipype/interfaces/diffusion_toolkit/dti.py +++ b/nipype/interfaces/diffusion_toolkit/dti.py @@ -91,7 +91,7 @@ def _list_outputs(self): out_prefix = self.inputs.out_prefix output_type = self.inputs.output_type - outputs = self.output_spec().get() + self.outputs.ADC = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_adc.' + output_type)) self.outputs.B0 = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_b0.' + output_type)) self.outputs.L1 = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_e1.' + output_type)) @@ -164,7 +164,7 @@ def _run_interface(self, runtime): return super(DTITracker, self)._run_interface(runtime) def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.track_file = os.path.abspath(self.inputs.output_file) if isdefined(self.inputs.output_mask) and self.inputs.output_mask: self.outputs.mask_file = os.path.abspath(self.inputs.output_mask) diff --git a/nipype/interfaces/diffusion_toolkit/odf.py b/nipype/interfaces/diffusion_toolkit/odf.py index 8f0906f0fa..4383aa93f3 100644 --- a/nipype/interfaces/diffusion_toolkit/odf.py +++ b/nipype/interfaces/diffusion_toolkit/odf.py @@ -86,7 +86,7 @@ def _format_arg(self, name, spec, value): return super(HARDIMat, self)._format_arg(name, spec, value) def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = os.path.abspath(self.inputs.out_file) return outputs @@ -142,7 +142,7 @@ def _list_outputs(self): out_prefix = self.inputs.out_prefix output_type = self.inputs.output_type - outputs = self.output_spec().get() + self.outputs.B0 = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_b0.' + output_type)) self.outputs.DWI = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_dwi.' + output_type)) self.outputs.max = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_max.' + output_type)) @@ -230,6 +230,6 @@ def _run_interface(self, runtime): return super(ODFTracker, self)._run_interface(runtime) def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.track_file = os.path.abspath(self.inputs.out_file) return outputs diff --git a/nipype/interfaces/diffusion_toolkit/postproc.py b/nipype/interfaces/diffusion_toolkit/postproc.py index 02ccd5dd51..e32e23631e 100644 --- a/nipype/interfaces/diffusion_toolkit/postproc.py +++ b/nipype/interfaces/diffusion_toolkit/postproc.py @@ -51,7 +51,7 @@ class SplineFilter(CommandLine): _cmd = "spline_filter" def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.smoothed_track_file = os.path.abspath(self.inputs.output_file) return outputs @@ -91,6 +91,6 @@ class TrackMerge(CommandLine): _cmd = "track_merge" def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.track_file = os.path.abspath(self.inputs.output_file) return outputs diff --git a/nipype/interfaces/dynamic_slicer.py b/nipype/interfaces/dynamic_slicer.py index 1c26ef4acf..8d6fe05fd1 100644 --- a/nipype/interfaces/dynamic_slicer.py +++ b/nipype/interfaces/dynamic_slicer.py @@ -129,15 +129,15 @@ def _gen_filename_from_param(self, param): return base + ext def _list_outputs(self): - outputs = self.output_spec().get() + for output_node in self._outputs_nodes: name = output_node.getElementsByTagName('name')[0].firstChild.nodeValue - outputs[name] = getattr(self.inputs, name) + setattr(self.outputs, name, getattr(self.inputs, name) if isdefined(outputs[name]) and isinstance(outputs[name], bool): if outputs[name]: - outputs[name] = self._gen_filename(name) + setattr(self.outputs, name, self._gen_filename(name) else: - outputs[name] = Undefined + setattr(self.outputs, name, Undefined return outputs def _format_arg(self, name, spec, value): diff --git a/nipype/interfaces/elastix/utils.py b/nipype/interfaces/elastix/utils.py index f52602d54e..2979fff144 100644 --- a/nipype/interfaces/elastix/utils.py +++ b/nipype/interfaces/elastix/utils.py @@ -131,7 +131,7 @@ def _run_interface(self, runtime): return runtime def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.output_file = getattr(self, '_out_file') return outputs diff --git a/nipype/interfaces/freesurfer/model.py b/nipype/interfaces/freesurfer/model.py index a4aac88d53..4a83492446 100644 --- a/nipype/interfaces/freesurfer/model.py +++ b/nipype/interfaces/freesurfer/model.py @@ -98,7 +98,7 @@ class MRISPreproc(FSCommand): output_spec = MRISPreprocOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + outfile = self.inputs.out_file self.outputs.out_file = outfile if not isdefined(outfile): @@ -278,7 +278,7 @@ def _format_arg(self, name, spec, value): return super(GLMFit, self)._format_arg(name, spec, value) def _list_outputs(self): - outputs = self.output_spec().get() + # Get the top-level output directory if not isdefined(self.inputs.glm_dir): glmdir = os.getcwd() @@ -418,7 +418,7 @@ class Binarize(FSCommand): output_spec = BinarizeOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + outfile = self.inputs.binary_file if not isdefined(outfile): if isdefined(self.inputs.out_type): @@ -527,7 +527,7 @@ class Concatenate(FSCommand): output_spec = ConcatenateOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + if not isdefined(self.inputs.concatenated_file): self.outputs.concatenated_file = os.path.join(os.getcwd(), 'concat_output.nii.gz') @@ -635,7 +635,7 @@ class SegStats(FSCommand): output_spec = SegStatsOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + if isdefined(self.inputs.summary_file): self.outputs.summary_file = os.path.abspath(self.inputs.summary_file) else: @@ -652,11 +652,11 @@ def _list_outputs(self): value = getattr(self.inputs, name) if isdefined(value): if isinstance(value, bool): - outputs[name] = fname_presuffix(src, suffix=suffix, + setattr(self.outputs, name, fname_presuffix(src, suffix=suffix, newpath=os.getcwd(), use_ext=False) else: - outputs[name] = os.path.abspath(value) + setattr(self.outputs, name, os.path.abspath(value) return outputs def _format_arg(self, name, spec, value): @@ -754,7 +754,7 @@ class Label2Vol(FSCommand): output_spec = Label2VolOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + outfile = self.inputs.vol_label_file if not isdefined(outfile): for key in ['label_file', 'annot_file', 'seg_file']: diff --git a/nipype/interfaces/freesurfer/preprocess.py b/nipype/interfaces/freesurfer/preprocess.py index 2d87ef2538..ae700aed59 100644 --- a/nipype/interfaces/freesurfer/preprocess.py +++ b/nipype/interfaces/freesurfer/preprocess.py @@ -67,7 +67,7 @@ class ParseDICOMDir(FSCommand): output_spec = ParseDICOMDirOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + if isdefined(self.inputs.dicom_info_file): self.outputs.dicom_info_file = os.path.join(os.getcwd(), self.inputs.dicom_info_file) return outputs @@ -375,7 +375,7 @@ def _get_outfilename(self): return os.path.abspath(outfile) def _list_outputs(self): - outputs = self.output_spec().get() + outfile = self._get_outfilename() if isdefined(self.inputs.split) and self.inputs.split: size = load(self.inputs.in_file).shape @@ -586,7 +586,7 @@ def _get_outfilename(self): return outfile def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.resampled_file = self._get_outfilename() return outputs @@ -870,7 +870,7 @@ class BBRegister(FSCommand): def _list_outputs(self): - outputs = self.output_spec().get() + _in = self.inputs if isdefined(_in.out_reg_file): @@ -1018,7 +1018,7 @@ def _get_outfile(self): return outfile def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.transformed_file = os.path.abspath(self._get_outfile()) return outputs @@ -1083,7 +1083,7 @@ class Smooth(FSCommand): output_spec = SmoothOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + outfile = self.inputs.smoothed_file if not isdefined(outfile): outfile = self._gen_fname(self.inputs.in_file, @@ -1204,7 +1204,7 @@ def _format_arg(self, name, spec, value): return super(RobustRegister, self)._format_arg(name, spec, value) def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_reg_file = self.inputs.out_reg_file if not isdefined(self.inputs.out_reg_file) and self.inputs.source_file: self.outputs.out_reg_file = fname_presuffix(self.inputs.source_file, @@ -1221,12 +1221,12 @@ def _list_outputs(self): value = getattr(self.inputs, name) if isdefined(value): if isinstance(value, bool): - outputs[name] = fname_presuffix(prefices[sufftup[0]], + setattr(self.outputs, name, fname_presuffix(prefices[sufftup[0]], suffix=sufftup[1], newpath=os.getcwd(), use_ext=sufftup[2]) else: - outputs[name] = value + setattr(self.outputs, name, value return outputs def _gen_filename(self, name): @@ -1289,7 +1289,7 @@ def _format_arg(self, name, spec, value): return super(FitMSParams, self)._format_arg(name, spec, value) def _list_outputs(self): - outputs = self.output_spec().get() + if not isdefined(self.inputs.out_dir): out_dir = self._gen_filename("out_dir") else: @@ -1346,7 +1346,7 @@ class SynthesizeFLASH(FSCommand): output_spec = SynthesizeFLASHOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + if isdefined(self.inputs.out_file): self.outputs.out_file = self.inputs.out_file else: diff --git a/nipype/interfaces/freesurfer/utils.py b/nipype/interfaces/freesurfer/utils.py index 8664e4d02d..bcc60e4939 100644 --- a/nipype/interfaces/freesurfer/utils.py +++ b/nipype/interfaces/freesurfer/utils.py @@ -846,7 +846,7 @@ class MRIsConvert(FSCommand): output_spec = MRIsConvertOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.converted = os.path.abspath(self._gen_outfilename()) return outputs @@ -912,7 +912,7 @@ class MRITessellate(FSCommand): output_spec = MRITessellateOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.surface = os.path.abspath(self._gen_outfilename()) return outputs @@ -982,7 +982,7 @@ class MRIPretess(FSCommand): output_spec = MRIPretessOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = os.path.abspath(self._gen_outfilename()) return outputs @@ -1039,7 +1039,7 @@ class MRIMarchingCubes(FSCommand): output_spec = MRIMarchingCubesOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.surface = self._gen_outfilename() return outputs @@ -1110,7 +1110,7 @@ class SmoothTessellation(FSCommand): output_spec = SmoothTessellationOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.surface = self._gen_outfilename() return outputs @@ -1167,7 +1167,7 @@ class MakeAverageSubject(FSCommand): output_spec = MakeAverageSubjectOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.average_subject_name = self.inputs.out_name return outputs diff --git a/nipype/interfaces/fsl/epi.py b/nipype/interfaces/fsl/epi.py index a0f1580542..1ee9f64ebd 100644 --- a/nipype/interfaces/fsl/epi.py +++ b/nipype/interfaces/fsl/epi.py @@ -95,7 +95,7 @@ def _parse_inputs(self, skip=None): return super(PrepareFieldmap, self)._parse_inputs(skip=skip) def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_fieldmap = self.inputs.out_fieldmap return outputs @@ -493,7 +493,7 @@ def _format_arg(self, name, spec, value): return super(Eddy, self)._format_arg(name, spec, value) def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_corrected = os.path.abspath('%s.nii.gz' % self.inputs.out_base) self.outputs.out_parameter = os.path.abspath('%s.eddy_parameters' % self.inputs.out_base) return outputs @@ -546,7 +546,7 @@ class SigLoss(FSLCommand): _cmd = 'sigloss' def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = self.inputs.out_file if ((not isdefined(self.outputs.out_file)) and (isdefined(self.inputs.in_file))): @@ -650,7 +650,7 @@ class EpiReg(FSLCommand): output_spec = EpiRegOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = os.path.join(os.getcwd(), self.inputs.out_base + '.nii.gz') if not (isdefined(self.inputs.no_fmapreg) and self.inputs.no_fmapreg) and isdefined(self.inputs.fmap): @@ -789,7 +789,7 @@ def _gen_filename(self, name): return None def _list_outputs(self): - outputs = self.output_spec().get() + if not isdefined(self.inputs.exfdw): self.outputs.exfdw = self._gen_filename('exfdw') else: diff --git a/nipype/interfaces/fsl/maths.py b/nipype/interfaces/fsl/maths.py index e5a7e21f02..08382f1d9e 100644 --- a/nipype/interfaces/fsl/maths.py +++ b/nipype/interfaces/fsl/maths.py @@ -48,7 +48,7 @@ class MathsCommand(FSLCommand): _suffix = "_maths" def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = self.inputs.out_file if not isdefined(self.inputs.out_file): self.outputs.out_file = self._gen_fname(self.inputs.in_file, suffix=self._suffix) diff --git a/nipype/interfaces/fsl/model.py b/nipype/interfaces/fsl/model.py index 51978423b7..71234c4bf3 100644 --- a/nipype/interfaces/fsl/model.py +++ b/nipype/interfaces/fsl/model.py @@ -344,7 +344,7 @@ def _run_interface(self, runtime): return runtime def _list_outputs(self): - outputs = self.output_spec().get() + cwd = os.getcwd() self.outputs.fsf_files = [] self.outputs.ev_files = [] @@ -1177,7 +1177,7 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() for field in list(outputs.keys()): - outputs[field] = os.path.join(os.getcwd(), + setattr(self.outputs, field, os.path.join(os.getcwd(), field.replace('_', '.')) return outputs @@ -1339,7 +1339,7 @@ def _list_outputs(self): for field in list(outputs.keys()): if ('fts' in field) and (nfcons == 0): continue - outputs[field] = os.path.join(os.getcwd(), + setattr(self.outputs, field, os.path.join(os.getcwd(), field.replace('_', '.')) return outputs @@ -1501,7 +1501,7 @@ class MELODIC(FSLCommand): _cmd = 'melodic' def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_dir = self.inputs.out_dir if not isdefined(self.outputs.out_dir): self.outputs.out_dir = self._gen_filename("out_dir") @@ -1660,7 +1660,7 @@ class Cluster(FSLCommand): 'out_mean_file': 'mean', 'out_pval_file': 'pval'} def _list_outputs(self): - outputs = self.output_spec().get() + for key, suffix in list(self.filemap.items()): outkey = key[4:] inval = getattr(self.inputs, key) @@ -1670,11 +1670,11 @@ def _list_outputs(self): change_ext = True if suffix.endswith('.txt'): change_ext = False - outputs[outkey] = self._gen_fname(self.inputs.in_file, + setattr(self.outputs, outkey, self._gen_fname(self.inputs.in_file, suffix='_' + suffix, change_ext=change_ext) else: - outputs[outkey] = os.path.abspath(inval) + setattr(self.outputs, outkey, os.path.abspath(inval) return outputs def _format_arg(self, name, spec, value): @@ -1790,7 +1790,7 @@ class Randomise(FSLCommand): output_spec = RandomiseOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.tstat_files = glob(self._gen_fname( '%s_tstat*.nii' % self.inputs.base_name)) self.outputs.fstat_files = glob(self._gen_fname( diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index 49de1fc30c..225962b125 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -271,7 +271,7 @@ class FAST(FSLCommand): def _post_run(self): - outputs = self.output_spec().get() + if not isdefined(self.inputs.number_classes): nclasses = 3 else: @@ -843,7 +843,7 @@ class FNIRT(FSLCommand): def _post_run(self): - outputs = self.output_spec().get() + for key, suffix in list(self.filemap.items()): inval = getattr(self.inputs, key) change_ext = True @@ -851,19 +851,19 @@ def _post_run(self): if suffix.endswith('.txt'): change_ext = False if isdefined(inval): - outputs[key] = inval + setattr(self.outputs, key, inval) else: - outputs[key] = self._gen_fname(self.inputs.in_file, + setattr(self.outputs, key, self._gen_fname(self.inputs.in_file, suffix='_' + suffix, change_ext=change_ext) elif isdefined(inval): if isinstance(inval, bool): if inval: - outputs[key] = self._gen_fname(self.inputs.in_file, + setattr(self.outputs, key, self._gen_fname(self.inputs.in_file, suffix='_' + suffix, change_ext=change_ext) else: - outputs[key] = os.path.abspath(inval) + setattr(self.outputs, key, os.path.abspath(inval) return outputs def _format_arg(self, name, spec, value): @@ -1498,7 +1498,7 @@ class FIRST(FSLCommand): def _post_run(self): - outputs = self.output_spec().get() + if isdefined(self.inputs.list_of_specific_structures): structures = self.inputs.list_of_specific_structures diff --git a/nipype/interfaces/fsl/utils.py b/nipype/interfaces/fsl/utils.py index 22e7501468..96d2a0974f 100644 --- a/nipype/interfaces/fsl/utils.py +++ b/nipype/interfaces/fsl/utils.py @@ -121,7 +121,7 @@ class ImageMeants(FSLCommand): output_spec = ImageMeantsOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = self.inputs.out_file if not isdefined(self.outputs.out_file): self.outputs.out_file = self._gen_fname(self.inputs.in_file, @@ -511,7 +511,7 @@ def _format_arg(self, name, trait_spec, value): return super(FilterRegressor, self)._format_arg(name, trait_spec, value) def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = self.inputs.out_file if not isdefined(self.outputs.out_file): self.outputs.out_file = self._gen_fname( @@ -1256,7 +1256,7 @@ def _gen_outfilename(self): return out_file def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = os.path.abspath(self._gen_outfilename()) return outputs @@ -1308,7 +1308,7 @@ class SigLoss(FSLCommand): _cmd = 'sigloss' def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = self.inputs.out_file if not isdefined(self.outputs.out_file) and \ isdefined(self.inputs.in_file): @@ -1356,7 +1356,7 @@ def _gen_filename(self, name): return None def _list_outputs(self): - outputs = self.output_spec().get() + if not isdefined(self.inputs.out_file): self.outputs.out_file = self._gen_filename('out_file') else: @@ -1561,7 +1561,7 @@ def _get_output(self, name): return os.path.abspath(output) def _list_outputs(self): - outputs = self.output_spec().get() + if self.inputs.complex_cartesian or self.inputs.complex_polar or \ self.inputs.complex_split or self.inputs.complex_merge: self.outputs.complex_out_file = self._get_output('complex_out_file') diff --git a/nipype/interfaces/io.py b/nipype/interfaces/io.py index c70063969c..53b35fe424 100644 --- a/nipype/interfaces/io.py +++ b/nipype/interfaces/io.py @@ -223,10 +223,10 @@ def __setattr__(self, key, value): if key not in self.copyable_trait_names(): if not isdefined(value): super(DataSinkInputSpec, self).__setattr__(key, value) - self._outputs[key] = value + self._setattr(self.outputs, key, value else: if key in self._outputs: - self._outputs[key] = value + self._setattr(self.outputs, key, value super(DataSinkInputSpec, self).__setattr__(key, value) @@ -320,7 +320,7 @@ def __init__(self, infields=None, force_run=True, **kwargs): if infields: for key in infields: self.inputs.add_trait(key, traits.Any) - self.inputs._outputs[key] = Undefined + self.inputs._setattr(self.outputs, key, Undefined undefined_traits[key] = Undefined self.inputs.trait_set(trait_change_notify=False, **undefined_traits) if force_run: @@ -643,7 +643,7 @@ def _list_outputs(self): # Init variables iflogger = logging.getLogger('interface') - outputs = self.output_spec().get() + out_files = [] # Use hardlink use_hardlink = str2bool(config.get('execution', 'try_hard_link_datasink')) @@ -881,7 +881,7 @@ def _list_outputs(self): # keys are outfields, args are template args for the outfield for key, args in self.inputs.template_args.items(): - outputs[key] = [] + setattr(self.outputs, key, [] template = self.inputs.template if hasattr(self.inputs, 'field_template') and \ isdefined(self.inputs.field_template) and \ @@ -904,7 +904,7 @@ def _list_outputs(self): else: if self.inputs.sort_filelist: filelist = human_order_sorted(filelist) - outputs[key] = list_to_filename(filelist) + setattr(self.outputs, key, list_to_filename(filelist) for argnum, arglist in enumerate(args): maxlen = 1 for arg in arglist: @@ -947,11 +947,11 @@ def _list_outputs(self): outfiles = human_order_sorted(outfiles) outputs[key].append(list_to_filename(outfiles)) if any([val is None for val in outputs[key]]): - outputs[key] = [] + setattr(self.outputs, key, [] if len(outputs[key]) == 0: - outputs[key] = None + setattr(self.outputs, key, None elif len(outputs[key]) == 1: - outputs[key] = outputs[key][0] + setattr(self.outputs, key, outputs[key][0] # Outputs are currently stored as locations on S3. # We must convert to the local location specified # and download the files. @@ -965,7 +965,7 @@ def _list_outputs(self): for i,path in enumerate(val): outputs[key][i] = self.s3tolocal(path, bkt) else: - outputs[key] = self.s3tolocal(val, bkt) + setattr(self.outputs, key, self.s3tolocal(val, bkt) return outputs @@ -1120,7 +1120,7 @@ def _list_outputs(self): outputs = {} for key, args in list(self.inputs.template_args.items()): - outputs[key] = [] + setattr(self.outputs, key, [] template = self.inputs.template if hasattr(self.inputs, 'field_template') and \ isdefined(self.inputs.field_template) and \ @@ -1143,7 +1143,7 @@ def _list_outputs(self): else: if self.inputs.sort_filelist: filelist = human_order_sorted(filelist) - outputs[key] = list_to_filename(filelist) + setattr(self.outputs, key, list_to_filename(filelist) for argnum, arglist in enumerate(args): maxlen = 1 for arg in arglist: @@ -1183,11 +1183,11 @@ def _list_outputs(self): outfiles = human_order_sorted(outfiles) outputs[key].append(list_to_filename(outfiles)) if any([val is None for val in outputs[key]]): - outputs[key] = [] + setattr(self.outputs, key, [] if len(outputs[key]) == 0: - outputs[key] = None + setattr(self.outputs, key, None elif len(outputs[key]) == 1: - outputs[key] = outputs[key][0] + setattr(self.outputs, key, outputs[key][0] return outputs @@ -1330,7 +1330,7 @@ def _list_outputs(self): if field not in force_lists: filelist = list_to_filename(filelist) - outputs[field] = filelist + setattr(self.outputs, field, filelist return outputs @@ -1622,7 +1622,7 @@ def _list_outputs(self): output_traits.traits()[k].loc, output_traits.traits()[k].altkey) if val: - outputs[k] = list_to_filename(val) + setattr(self.outputs, k, list_to_filename(val) return outputs @@ -1762,7 +1762,7 @@ def _list_outputs(self): outputs = {} for key, args in list(self.inputs.query_template_args.items()): - outputs[key] = [] + setattr(self.outputs, key, [] template = self.inputs.query_template if hasattr(self.inputs, 'field_template') and \ isdefined(self.inputs.field_template) and \ @@ -1774,7 +1774,7 @@ def _list_outputs(self): raise IOError('Template %s returned no files' % template ) - outputs[key] = list_to_filename( + setattr(self.outputs, key, list_to_filename( [str(file_object.get()) for file_object in file_objects if file_object.exists() @@ -1834,9 +1834,9 @@ def _list_outputs(self): outputs[key].insert(i, outfiles) if len(outputs[key]) == 0: - outputs[key] = None + setattr(self.outputs, key, None elif len(outputs[key]) == 1: - outputs[key] = outputs[key][0] + setattr(self.outputs, key, outputs[key][0] return outputs @@ -1884,7 +1884,7 @@ class XNATSinkInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): def __setattr__(self, key, value): if key not in self.copyable_trait_names(): - self._outputs[key] = value + self._setattr(self.outputs, key, value else: super(XNATSinkInputSpec, self).__setattr__(key, value) @@ -2317,7 +2317,7 @@ def _list_outputs(self): outputs = {} for key, args in list(self.inputs.template_args.items()): - outputs[key] = [] + setattr(self.outputs, key, [] template = self.inputs.template if hasattr(self.inputs, 'field_template') and \ isdefined(self.inputs.field_template) and \ @@ -2345,7 +2345,7 @@ def _list_outputs(self): else: if self.inputs.sort_filelist: filelist = human_order_sorted(filelist) - outputs[key] = list_to_filename(filelist) + setattr(self.outputs, key, list_to_filename(filelist) if self.inputs.download_files: for f in filelist: sftp.get(f, f) @@ -2406,14 +2406,14 @@ def _list_outputs(self): except IOError: iflogger.info('remote file %s not found' % f) if any([val is None for val in outputs[key]]): - outputs[key] = [] + setattr(self.outputs, key, [] if len(outputs[key]) == 0: - outputs[key] = None + setattr(self.outputs, key, None elif len(outputs[key]) == 1: - outputs[key] = outputs[key][0] + setattr(self.outputs, key, outputs[key][0] for k, v in list(outputs.items()): - outputs[k] = os.path.join(os.getcwd(), v) + setattr(self.outputs, k, os.path.join(os.getcwd(), v) return outputs @@ -2481,13 +2481,13 @@ def _list_outputs(self): raise RuntimeError('JSON input has no dictionary structure') for key, value in data.items(): - outputs[key] = value + setattr(self.outputs, key, value if isdefined(self.inputs.defaults): defaults = self.inputs.defaults for key, value in defaults.items(): if key not in list(outputs.keys()): - outputs[key] = value + setattr(self.outputs, key, value return outputs @@ -2502,10 +2502,10 @@ def __setattr__(self, key, value): if key not in self.copyable_trait_names(): if not isdefined(value): super(JSONFileSinkInputSpec, self).__setattr__(key, value) - self._outputs[key] = value + self._setattr(self.outputs, key, value else: if key in self._outputs: - self._outputs[key] = value + self._setattr(self.outputs, key, value super(JSONFileSinkInputSpec, self).__setattr__(key, value) @@ -2552,7 +2552,7 @@ def __init__(self, infields=[], force_run=True, **inputs): undefined_traits = {} for key in infields: self.inputs.add_trait(key, traits.Any) - self.inputs._outputs[key] = Undefined + self.inputs._setattr(self.outputs, key, Undefined undefined_traits[key] = Undefined self.inputs.trait_set(trait_change_notify=False, **undefined_traits) @@ -2591,6 +2591,6 @@ def _list_outputs(self): with open(out_file, 'w') as f: simplejson.dump(out_dict, f) - outputs = self.output_spec().get() + self.outputs.out_file = out_file return outputs diff --git a/nipype/interfaces/meshfix.py b/nipype/interfaces/meshfix.py index e13b726e79..264f2d65e1 100644 --- a/nipype/interfaces/meshfix.py +++ b/nipype/interfaces/meshfix.py @@ -112,7 +112,7 @@ class MeshFix(CommandLine): output_spec = MeshFixOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + if isdefined(self.inputs.out_filename): path, name, ext = split_filename(self.inputs.out_filename) ext = ext.replace('.', '') diff --git a/nipype/interfaces/minc/minc.py b/nipype/interfaces/minc/minc.py index c8f23a45fa..5c6b7ee101 100644 --- a/nipype/interfaces/minc/minc.py +++ b/nipype/interfaces/minc/minc.py @@ -1698,7 +1698,7 @@ def _gen_output_base(self): return output_base def _list_outputs(self): - outputs = self.output_spec().get() + output_file_base = self._gen_output_base() @@ -3233,7 +3233,7 @@ def _gen_filename(self, name): raise NotImplemented def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.output_xfm = os.path.abspath( self._gen_filename('output_xfm')) @@ -3338,7 +3338,7 @@ def _gen_outfilename(self): return self._gen_filename('output_file') def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.output_file = os.path.abspath(self._gen_outfilename()) assert os.path.exists(self.outputs.output_file) @@ -3412,7 +3412,7 @@ def _gen_outfilename(self): return self._gen_filename('output_file') def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.output_file = os.path.abspath(self._gen_outfilename()) assert os.path.exists(self.outputs.output_file) diff --git a/nipype/interfaces/mne/base.py b/nipype/interfaces/mne/base.py index df4c754a9f..e70dc2960b 100644 --- a/nipype/interfaces/mne/base.py +++ b/nipype/interfaces/mne/base.py @@ -74,7 +74,7 @@ def _get_files(self, path, key, dirval, altkey=None): return glob.glob(globpattern) def _list_outputs(self): - outputs = self.output_spec().get() + subjects_dir = self.inputs.subjects_dir subject_path = op.join(subjects_dir, self.inputs.subject_id) output_traits = self._outputs() @@ -94,7 +94,7 @@ def _list_outputs(self): out_files = op.abspath(value_list) else: raise TypeError - outputs[k] = out_files + setattr(self.outputs, k, out_files if not k.rfind('surface') == -1: mesh_paths.append(out_files) self.outputs.mesh_files = mesh_paths diff --git a/nipype/interfaces/mrtrix/preprocess.py b/nipype/interfaces/mrtrix/preprocess.py index e56c7488ab..a907d8ab3b 100644 --- a/nipype/interfaces/mrtrix/preprocess.py +++ b/nipype/interfaces/mrtrix/preprocess.py @@ -68,7 +68,7 @@ class MRConvert(CommandLine): output_spec = MRConvertOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.converted = self.inputs.out_filename if not isdefined(self.outputs.converted): self.outputs.converted = op.abspath(self._gen_outfilename()) @@ -181,7 +181,7 @@ class Tensor2Vector(CommandLine): output_spec = Tensor2VectorOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.vector = self.inputs.out_filename if not isdefined(self.outputs.vector): self.outputs.vector = op.abspath(self._gen_outfilename()) @@ -230,7 +230,7 @@ class Tensor2FractionalAnisotropy(CommandLine): output_spec = Tensor2FractionalAnisotropyOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.FA = self.inputs.out_filename if not isdefined(self.outputs.FA): self.outputs.FA = op.abspath(self._gen_outfilename()) @@ -279,7 +279,7 @@ class Tensor2ApparentDiffusion(CommandLine): output_spec = Tensor2ApparentDiffusionOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.ADC = self.inputs.out_filename if not isdefined(self.outputs.ADC): self.outputs.ADC = op.abspath(self._gen_outfilename()) @@ -329,7 +329,7 @@ class MRMultiply(CommandLine): output_spec = MRMultiplyOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = self.inputs.out_filename if not isdefined(self.outputs.out_file): self.outputs.out_file = op.abspath(self._gen_outfilename()) @@ -443,7 +443,7 @@ class GenerateWhiteMatterMask(CommandLine): output_spec = GenerateWhiteMatterMaskOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.WMprobabilitymap = op.abspath(self._gen_outfilename()) return outputs @@ -489,7 +489,7 @@ class Erode(CommandLine): output_spec = ErodeOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = self.inputs.out_filename if not isdefined(self.outputs.out_file): self.outputs.out_file = op.abspath(self._gen_outfilename()) @@ -547,7 +547,7 @@ class Threshold(CommandLine): output_spec = ThresholdOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = self.inputs.out_filename if not isdefined(self.outputs.out_file): self.outputs.out_file = op.abspath(self._gen_outfilename()) @@ -596,7 +596,7 @@ class MedianFilter3D(CommandLine): output_spec = MedianFilter3DOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = self.inputs.out_filename if not isdefined(self.outputs.out_file): self.outputs.out_file = op.abspath(self._gen_outfilename()) @@ -654,7 +654,7 @@ class MRTransform(CommandLine): output_spec = MRTransformOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = self.inputs.out_filename if not isdefined(self.outputs.out_file): self.outputs.out_file = op.abspath(self._gen_outfilename()) diff --git a/nipype/interfaces/mrtrix/tensors.py b/nipype/interfaces/mrtrix/tensors.py index 4383792d3b..2d80d8e334 100644 --- a/nipype/interfaces/mrtrix/tensors.py +++ b/nipype/interfaces/mrtrix/tensors.py @@ -76,7 +76,7 @@ class DWI2SphericalHarmonicsImage(CommandLine): output_spec = DWI2SphericalHarmonicsImageOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.spherical_harmonics_image = self.inputs.out_filename if not isdefined(self.outputs.spherical_harmonics_image): self.outputs.spherical_harmonics_image = op.abspath(self._gen_outfilename()) @@ -159,7 +159,7 @@ class ConstrainedSphericalDeconvolution(CommandLine): output_spec = ConstrainedSphericalDeconvolutionOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.spherical_harmonics_image = self.inputs.out_filename if not isdefined(self.outputs.spherical_harmonics_image): self.outputs.spherical_harmonics_image = op.abspath(self._gen_outfilename()) @@ -213,7 +213,7 @@ class EstimateResponseForSH(CommandLine): output_spec = EstimateResponseForSHOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.response = self.inputs.out_filename if not isdefined(self.outputs.response): self.outputs.response = op.abspath(self._gen_outfilename()) @@ -297,7 +297,7 @@ def _run_interface(self, runtime): return runtime def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.encoding_file = op.abspath(self._gen_filename('out_encoding_file')) return outputs diff --git a/nipype/interfaces/mrtrix/tracking.py b/nipype/interfaces/mrtrix/tracking.py index 2191cd4079..ddc21eb095 100644 --- a/nipype/interfaces/mrtrix/tracking.py +++ b/nipype/interfaces/mrtrix/tracking.py @@ -108,7 +108,7 @@ class Tracks2Prob(CommandLine): output_spec = Tracks2ProbOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.tract_image = self.inputs.out_filename if not isdefined(self.outputs.tract_image): self.outputs.tract_image = op.abspath(self._gen_outfilename()) diff --git a/nipype/interfaces/mrtrix3/connectivity.py b/nipype/interfaces/mrtrix3/connectivity.py index d53c6eda3e..63497e7cc4 100644 --- a/nipype/interfaces/mrtrix3/connectivity.py +++ b/nipype/interfaces/mrtrix3/connectivity.py @@ -105,7 +105,7 @@ class BuildConnectome(MRTrix3Base): output_spec = BuildConnectomeOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs @@ -182,6 +182,6 @@ def _parse_inputs(self, skip=None): return super(LabelConfig, self)._parse_inputs(skip=skip) def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs diff --git a/nipype/interfaces/mrtrix3/preprocess.py b/nipype/interfaces/mrtrix3/preprocess.py index cb089a109c..d40476a00d 100644 --- a/nipype/interfaces/mrtrix3/preprocess.py +++ b/nipype/interfaces/mrtrix3/preprocess.py @@ -106,7 +106,7 @@ class ResponseSD(MRTrix3Base): output_spec = ResponseSDOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = op.abspath(self.inputs.out_file) if isdefined(self.inputs.out_sf): @@ -149,7 +149,7 @@ class ACTPrepareFSL(CommandLine): output_spec = ACTPrepareFSLOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs @@ -196,6 +196,6 @@ class ReplaceFSwithFIRST(CommandLine): output_spec = ReplaceFSwithFIRSTOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs diff --git a/nipype/interfaces/mrtrix3/reconst.py b/nipype/interfaces/mrtrix3/reconst.py index 76920e8cd1..a14fc13927 100644 --- a/nipype/interfaces/mrtrix3/reconst.py +++ b/nipype/interfaces/mrtrix3/reconst.py @@ -72,7 +72,7 @@ class FitTensor(MRTrix3Base): output_spec = FitTensorOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs @@ -188,6 +188,6 @@ class EstimateFOD(MRTrix3Base): output_spec = EstimateFODOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs diff --git a/nipype/interfaces/mrtrix3/tracking.py b/nipype/interfaces/mrtrix3/tracking.py index 586d934ad7..391fb6407f 100644 --- a/nipype/interfaces/mrtrix3/tracking.py +++ b/nipype/interfaces/mrtrix3/tracking.py @@ -249,6 +249,6 @@ def _format_arg(self, name, trait_spec, value): return super(Tractography, self)._format_arg(name, trait_spec, value) def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs diff --git a/nipype/interfaces/mrtrix3/utils.py b/nipype/interfaces/mrtrix3/utils.py index 9413fd8e6c..f54f3c0a29 100644 --- a/nipype/interfaces/mrtrix3/utils.py +++ b/nipype/interfaces/mrtrix3/utils.py @@ -57,7 +57,7 @@ class BrainMask(CommandLine): output_spec = BrainMaskOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs @@ -104,7 +104,7 @@ class Mesh2PVE(CommandLine): output_spec = Mesh2PVEOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs @@ -151,7 +151,7 @@ class Generate5tt(CommandLine): output_spec = Generate5ttOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs @@ -208,11 +208,11 @@ class TensorMetrics(CommandLine): output_spec = TensorMetricsOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + for k in list(outputs.keys()): if isdefined(getattr(self.inputs, k)): - outputs[k] = op.abspath(getattr(self.inputs, k)) + setattr(self.outputs, k, op.abspath(getattr(self.inputs, k)) return outputs @@ -348,7 +348,7 @@ class ComputeTDI(MRTrix3Base): output_spec = ComputeTDIOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs @@ -399,6 +399,6 @@ class TCK2VTK(MRTrix3Base): output_spec = TCK2VTKOutputSpec def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs diff --git a/nipype/interfaces/nipy/preprocess.py b/nipype/interfaces/nipy/preprocess.py index 5cebec9ab2..c6bfef63c4 100644 --- a/nipype/interfaces/nipy/preprocess.py +++ b/nipype/interfaces/nipy/preprocess.py @@ -376,7 +376,7 @@ def _run_interface(self, runtime): return runtime def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = self.inputs.out_file if not isdefined(self.outputs.out_file): self.outputs.out_file = fname_presuffix( diff --git a/nipype/interfaces/nitime/analysis.py b/nipype/interfaces/nitime/analysis.py index 67705417af..245cf2808f 100644 --- a/nipype/interfaces/nitime/analysis.py +++ b/nipype/interfaces/nitime/analysis.py @@ -168,7 +168,7 @@ def _run_interface(self, runtime): # Rewrite _list_outputs (look at BET) def _list_outputs(self): - outputs = self.output_spec().get() + # if isdefined(self.inputs.output_csv_file): diff --git a/nipype/interfaces/petpvc.py b/nipype/interfaces/petpvc.py index e891020908..76256bc4c1 100644 --- a/nipype/interfaces/petpvc.py +++ b/nipype/interfaces/petpvc.py @@ -163,7 +163,7 @@ class PETPVC(CommandLine): _cmd = 'petpvc' def _list_outputs(self): - outputs = self.output_spec().get() + self.outputs.out_file = self.inputs.out_file if not isdefined(self.outputs.out_file): method_name = self.inputs.pvc.lower() diff --git a/nipype/interfaces/spm/preprocess.py b/nipype/interfaces/spm/preprocess.py index c5dc450f82..9de94fd4f8 100644 --- a/nipype/interfaces/spm/preprocess.py +++ b/nipype/interfaces/spm/preprocess.py @@ -809,7 +809,7 @@ def _list_outputs(self): ('native', '')]): if getattr(self.inputs, outtype)[idx]: outfield = '%s_%s_image' % (image, tissue) - outputs[outfield] = fname_presuffix(f, + setattr(self.outputs, outfield, fname_presuffix(f, prefix='%sc%d' % (prefix, tidx + 1)) if isdefined(self.inputs.save_bias_corrected) and \ diff --git a/nipype/interfaces/spm/utils.py b/nipype/interfaces/spm/utils.py index eb4f82a09f..ca7fb260ff 100644 --- a/nipype/interfaces/spm/utils.py +++ b/nipype/interfaces/spm/utils.py @@ -175,7 +175,7 @@ def _make_matlab_command(self, _): return script def _list_outputs(self): - outputs = self.output_spec().get() + if not isdefined(self.inputs.out_file): self.outputs.out_file = os.path.abspath(self._gen_outfilename()) else: diff --git a/nipype/interfaces/utility.py b/nipype/interfaces/utility.py index 03243fe1e7..066a2b8ff5 100644 --- a/nipype/interfaces/utility.py +++ b/nipype/interfaces/utility.py @@ -100,7 +100,7 @@ def _list_outputs(self): for key in self._fields: val = getattr(self.inputs, key) if isdefined(val): - outputs[key] = val + setattr(self.outputs, key, val return outputs @@ -468,7 +468,7 @@ def _run_interface(self, runtime): def _list_outputs(self): outputs = self._outputs().get() for key in self._output_names: - outputs[key] = self._out[key] + setattr(self.outputs, key, self._out[key] return outputs @@ -556,10 +556,10 @@ def _add_output_traits(self, base): return add_traits(base, self._get_outfields()) def _list_outputs(self): - outputs = self.output_spec().get() + isHeader = True for key in self._outfields: - outputs[key] = [] # initialize outfields + setattr(self.outputs, key, [] # initialize outfields with open(self.inputs.in_file, 'r') as fid: for line in fid.readlines(): if self.inputs.header and isHeader: # skip header line diff --git a/nipype/pipeline/engine/utils.py b/nipype/pipeline/engine/utils.py index 4ed3209f0c..6d89381a50 100644 --- a/nipype/pipeline/engine/utils.py +++ b/nipype/pipeline/engine/utils.py @@ -618,7 +618,7 @@ def _node_ports(graph, node): else: srcport = src if srcport not in portoutputs: - portoutputs[srcport] = [] + portsetattr(self.outputs, srcport, [] portoutputs[srcport].append((v, dest, src)) return (portinputs, portoutputs) @@ -1238,7 +1238,7 @@ def write_workflow_prov(graph, filename=None, format='all'): for key, value in list(result.outputs.items()): values = getattr(result.outputs, key) if isdefined(values) and idx < len(values): - subresult.outputs[key] = values[idx] + subresult.setattr(self.outputs, key, values[idx] sub_doc = ProvStore().add_results(subresult) sub_bundle = pm.ProvBundle(sub_doc.get_records(), identifier=get_id()) From 96cd79988fa572ca0c297f087f324ea32671935b Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 17 Feb 2016 08:56:06 -0800 Subject: [PATCH 26/73] finishing with preprocess --- nipype/interfaces/fsl/preprocess.py | 210 ++++++++++++++-------------- 1 file changed, 105 insertions(+), 105 deletions(-) diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index 225962b125..53abe027b5 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -271,7 +271,7 @@ class FAST(FSLCommand): def _post_run(self): - + if not isdefined(self.inputs.number_classes): nclasses = 3 else: @@ -789,6 +789,12 @@ class FNIRTInputSpec(FSLCommandInputSpec): desc='Precision for representing Hessian, double or float. Default double') + def _format_arg(self, name, spec, value): + if name in list(self.filemap.keys()): + return spec.argstr % getattr(self.outputs, name) + return super(FSLCommandInputSpec, self)._format_arg(name, spec, value) + + class FNIRTOutputSpec(TraitedSpec): fieldcoeff_file = File(exists=True, desc='file with field coefficients') warped_file = File(exists=True, desc='warped image') @@ -842,8 +848,6 @@ class FNIRT(FSLCommand): 'fieldcoeff_file': 'fieldwarp'} def _post_run(self): - - for key, suffix in list(self.filemap.items()): inval = getattr(self.inputs, key) change_ext = True @@ -855,21 +859,15 @@ def _post_run(self): else: setattr(self.outputs, key, self._gen_fname(self.inputs.in_file, suffix='_' + suffix, - change_ext=change_ext) + change_ext=change_ext)) elif isdefined(inval): if isinstance(inval, bool): if inval: setattr(self.outputs, key, self._gen_fname(self.inputs.in_file, suffix='_' + suffix, - change_ext=change_ext) + change_ext=change_ext)) else: - setattr(self.outputs, key, os.path.abspath(inval) - return outputs - - def _format_arg(self, name, spec, value): - if name in list(self.filemap.keys()): - return spec.argstr % getattr(self.outputs, name) - return super(FNIRT, self)._format_arg(name, spec, value) + setattr(self.outputs, key, os.path.abspath(inval)) def _gen_filename(self, name): if name in ['warped_file', 'log_file']: @@ -929,6 +927,12 @@ class ApplyWarpInputSpec(FSLCommandInputSpec): desc='interpolation method') + def _format_arg(self, name, spec, value): + if name == 'superlevel': + return spec.argstr % str(value) + return super(ApplyWarpInputSpec, self)._format_arg(name, spec, value) + + class ApplyWarpOutputSpec(TraitedSpec): out_file = File(exists=True, desc='Warped output file') @@ -953,11 +957,6 @@ class ApplyWarp(FSLCommand): input_spec = ApplyWarpInputSpec output_spec = ApplyWarpOutputSpec - def _format_arg(self, name, spec, value): - if name == 'superlevel': - return spec.argstr % str(value) - return super(ApplyWarp, self)._format_arg(name, spec, value) - def _post_run(self): if not isdefined(self.inputs.out_file): @@ -1059,6 +1058,19 @@ class SUSANInputSpec(FSLCommandInputSpec): desc='output file name', hash_files=False) + def _format_arg(self, name, spec, value): + if name == 'fwhm': + return spec.argstr % (float(value) / np.sqrt(8 * np.log(2))) + if name == 'usans': + if not value: + return '0' + arglist = [str(len(value))] + for filename, thresh in value: + arglist.extend([filename, '%.10f' % thresh]) + return ' '.join(arglist) + return super(SUSANInputSpec, self)._format_arg(name, spec, value) + + class SUSANOutputSpec(TraitedSpec): smoothed_file = File(exists=True, desc='smoothed output file') @@ -1084,18 +1096,6 @@ class SUSAN(FSLCommand): input_spec = SUSANInputSpec output_spec = SUSANOutputSpec - def _format_arg(self, name, spec, value): - if name == 'fwhm': - return spec.argstr % (float(value) / np.sqrt(8 * np.log(2))) - if name == 'usans': - if not value: - return '0' - arglist = [str(len(value))] - for filename, thresh in value: - arglist.extend([filename, '%.10f' % thresh]) - return ' '.join(arglist) - return super(SUSAN, self)._format_arg(name, spec, value) - def _post_run(self): out_file = self.inputs.out_file @@ -1181,80 +1181,6 @@ class FUGUEInputSpec(FSLCommandInputSpec): save_unmasked_fmap = traits.Bool(False, argstr='--unmaskfmap', xor=['save_fmap'], desc='saves the unmasked fieldmap when using --savefmap') - -class FUGUEOutputSpec(TraitedSpec): - unwarped_file = File(desc='unwarped file') - warped_file = File(desc='forward warped file') - shift_out_file = File(desc='voxel shift map file') - fmap_out_file = File(desc='fieldmap file') - - -class FUGUE(FSLCommand): - """ - `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 - -------- - - - Unwarping an input image (shift map is known) - - >>> from nipype.interfaces.fsl.preprocess import FUGUE - >>> fugue = FUGUE() - >>> 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.inputs.output_type = "NIFTI_GZ" - >>> fugue.cmdline #doctest: +ELLIPSIS - 'fugue --in=epi.nii --mask=epi_mask.nii --loadshift=vsm.nii --unwarpdir=y --unwarp=epi_unwarped.nii.gz' - >>> fugue.run() #doctest: +SKIP - - - Warping an input image (shift map is known) - - >>> from nipype.interfaces.fsl.preprocess import FUGUE - >>> fugue = FUGUE() - >>> 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' - >>> fugue.inputs.output_type = "NIFTI_GZ" - >>> 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 - - - 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 * 3) / 2.46e-3 - >>> fugue.inputs.unwarp_direction = 'y' - >>> fugue.inputs.save_shift = True - >>> fugue.inputs.output_type = "NIFTI_GZ" - >>> fugue.cmdline #doctest: +ELLIPSIS - 'fugue --dwelltoasym=0.9390243902 --mask=epi_mask.nii --phasemap=epi_phasediff.nii --saveshift=epi_phasediff_vsm.nii.gz --unwarpdir=y' - >>> fugue.run() #doctest: +SKIP - - - """ - - _cmd = 'fugue' - input_spec = FUGUEInputSpec - output_spec = FUGUEOutputSpec - def _parse_inputs(self, skip=None): if skip is None: skip = [] @@ -1336,8 +1262,82 @@ def _parse_inputs(self, skip=None): else: skip += ['save_fmap', 'save_unmasked_fmap', 'fmap_out_file'] - return super(FUGUE, self)._parse_inputs(skip=skip) + return super(FUGUEInputSpec, self)._parse_inputs(skip=skip) + + + +class FUGUEOutputSpec(TraitedSpec): + unwarped_file = File(desc='unwarped file') + warped_file = File(desc='forward warped file') + shift_out_file = File(desc='voxel shift map file') + fmap_out_file = File(desc='fieldmap file') + + +class FUGUE(FSLCommand): + """ + `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 + -------- + + + Unwarping an input image (shift map is known) + + >>> from nipype.interfaces.fsl.preprocess import FUGUE + >>> fugue = FUGUE() + >>> 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.inputs.output_type = "NIFTI_GZ" + >>> fugue.cmdline #doctest: +ELLIPSIS + 'fugue --in=epi.nii --mask=epi_mask.nii --loadshift=vsm.nii --unwarpdir=y --unwarp=epi_unwarped.nii.gz' + >>> fugue.run() #doctest: +SKIP + + + Warping an input image (shift map is known) + + >>> from nipype.interfaces.fsl.preprocess import FUGUE + >>> fugue = FUGUE() + >>> 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' + >>> fugue.inputs.output_type = "NIFTI_GZ" + >>> 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 + + + 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 * 3) / 2.46e-3 + >>> fugue.inputs.unwarp_direction = 'y' + >>> fugue.inputs.save_shift = True + >>> fugue.inputs.output_type = "NIFTI_GZ" + >>> fugue.cmdline #doctest: +ELLIPSIS + 'fugue --dwelltoasym=0.9390243902 --mask=epi_mask.nii --phasemap=epi_phasediff.nii --saveshift=epi_phasediff_vsm.nii.gz --unwarpdir=y' + >>> fugue.run() #doctest: +SKIP + + """ + + _cmd = 'fugue' + input_spec = FUGUEInputSpec + output_spec = FUGUEOutputSpec class PRELUDEInputSpec(FSLCommandInputSpec): complex_phase_file = File(exists=True, argstr='--complex=%s', @@ -1498,7 +1498,7 @@ class FIRST(FSLCommand): def _post_run(self): - + if isdefined(self.inputs.list_of_specific_structures): structures = self.inputs.list_of_specific_structures From b070b0680ddb0cb452211774a4a03267b223cca7 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 17 Feb 2016 09:01:12 -0800 Subject: [PATCH 27/73] revert base, update preprocess --- nipype/interfaces/base.py | 2 +- nipype/interfaces/fsl/preprocess.py | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/nipype/interfaces/base.py b/nipype/interfaces/base.py index bb61c4a235..9d45b4edd8 100644 --- a/nipype/interfaces/base.py +++ b/nipype/interfaces/base.py @@ -479,7 +479,7 @@ def _post_run(self): for ns_input, ns_spec in list(self.inputs.namesource_items()): ns_pointer = getattr(ns_spec, 'out_name', None) if ns_pointer is not None: - ns_setattr(self.outputs, ns_pointer, ns_input + ns_outputs[ns_pointer] = ns_input # Search for inputs with the same name for out_name, spec in list(self.outputs.items()): diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index 53abe027b5..5bde570c17 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -13,22 +13,20 @@ from __future__ import print_function from __future__ import division -from builtins import range import os import os.path as op -import warnings - import numpy as np from nibabel import load +from builtins import range + +from ..base import (TraitedSpec, File, InputMultiPath, OutputMultiPath, traits, isdefined) from ..fsl.base import FSLCommand, FSLCommandInputSpec -from ..base import (TraitedSpec, File, InputMultiPath, - OutputMultiPath, Undefined, traits, - isdefined, OutputMultiPath) from ...utils.filemanip import split_filename -warn = warnings.warn +from ... import logging +IFLOGGER = logging.getLogger('interface') class BETInputSpec(FSLCommandInputSpec): @@ -1403,7 +1401,7 @@ class PRELUDE(FSLCommand): def __init__(self, **kwargs): super(PRELUDE, self).__init__(**kwargs) - warn('This has not been fully tested. Please report any failures.') + IFLOGGER.warn('This has not been fully tested. Please report any failures.') def _post_run(self): From 8525c1e93023e565219f0cfb4da8d1a9e9f6fc1b Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 17 Feb 2016 09:12:51 -0800 Subject: [PATCH 28/73] replace all docstrings with single quotes --- nipype/algorithms/icc.py | 30 +++++++++++---- nipype/algorithms/mesh.py | 15 +++----- nipype/algorithms/metrics.py | 4 +- nipype/algorithms/misc.py | 4 +- nipype/external/portalocker.py | 4 +- nipype/fixes/numpy/testing/noseclasses.py | 6 +-- nipype/fixes/numpy/testing/nosetester.py | 8 ++-- nipype/interfaces/afni/base.py | 4 +- nipype/interfaces/ants/segmentation.py | 4 +- nipype/interfaces/dcmstack.py | 30 +++++++-------- nipype/interfaces/freesurfer/base.py | 4 +- nipype/interfaces/fsl/base.py | 4 +- nipype/interfaces/fsl/model.py | 4 +- nipype/interfaces/io.py | 32 ++++++++-------- nipype/interfaces/nipy/model.py | 8 ++-- nipype/interfaces/spm/model.py | 8 ++-- nipype/interfaces/tests/test_io.py | 16 ++++---- nipype/interfaces/traits_extension.py | 4 +- nipype/pipeline/engine/tests/test_engine.py | 8 ++-- nipype/pipeline/engine/utils.py | 2 +- nipype/pipeline/plugins/slurm.py | 8 ++-- nipype/pipeline/plugins/tests/test_base.py | 4 +- .../plugins/tests/test_multiproc_nondaemon.py | 16 ++++---- nipype/pkg_info.py | 8 ++-- nipype/utils/config.py | 4 +- nipype/utils/docparse.py | 4 +- nipype/utils/matlabtools.py | 2 +- nipype/utils/nipype2boutiques.py | 24 ++++++------ setup.py | 8 ++-- tools/apigen.py | 38 +++++++++---------- tools/checkspecs.py | 18 ++++----- tools/gitwash_dumper.py | 10 ++--- tools/interfacedocgen.py | 38 +++++++++---------- 33 files changed, 196 insertions(+), 185 deletions(-) diff --git a/nipype/algorithms/icc.py b/nipype/algorithms/icc.py index 7db40370bf..79705dc172 100644 --- a/nipype/algorithms/icc.py +++ b/nipype/algorithms/icc.py @@ -1,13 +1,27 @@ +# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- +# vi: set ft=python sts=4 ts=4 sw=4 et: +""" +Algorithms to compute the Interclass Correlation Coefficient + + Change directory to provide relative paths for doctests + >>> import os + >>> filepath = os.path.dirname( os.path.realpath( __file__ ) ) + >>> datadir = os.path.realpath(os.path.join(filepath, '../testing/data')) + >>> os.chdir(datadir) + +""" + from __future__ import division -from builtins import range +import os +import numpy as np from numpy import ones, kron, mean, eye, hstack, dot, tile from scipy.linalg import pinv +import nibabel as nb + +from builtins import range from ..interfaces.traits_extension import traits, File from ..interfaces.specs import BaseInterfaceInputSpec, TraitedSpec from ..interfaces.base import BaseInterface -import nibabel as nb -import numpy as np -import os class ICCInputSpec(BaseInterfaceInputSpec): @@ -29,12 +43,12 @@ class ICCOutputSpec(TraitedSpec): class ICC(BaseInterface): - ''' + """ Calculates Interclass Correlation Coefficient (3,1) as defined in P. E. Shrout & Joseph L. Fleiss (1979). "Intraclass Correlations: Uses in Assessing Rater Reliability". Psychological Bulletin 86 (2): 420-428. This particular implementation is aimed at relaibility (test-retest) studies. - ''' + """ input_spec = ICCInputSpec output_spec = ICCOutputSpec @@ -78,7 +92,7 @@ def _run_interface(self, runtime): def ICC_rep_anova(data): - ''' + """ the data (Y) are entered as a 'table' ie subjects are in rows and repeated measures in columns @@ -87,7 +101,7 @@ def ICC_rep_anova(data): .. math:: Y = XB + E with X = [FaTor / Subjects] - ''' + """ [nb_subjects, nb_conditions] = data.shape dfc = nb_conditions - 1 diff --git a/nipype/algorithms/mesh.py b/nipype/algorithms/mesh.py index 5e33d50a7d..77e961662c 100644 --- a/nipype/algorithms/mesh.py +++ b/nipype/algorithms/mesh.py @@ -1,6 +1,6 @@ # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: -''' +""" Miscellaneous algorithms for 2D contours and 3D triangularized meshes handling Change directory to provide relative paths for doctests @@ -9,13 +9,11 @@ >>> datadir = os.path.realpath(os.path.join(filepath, '../testing/data')) >>> os.chdir(datadir) -''' +""" from __future__ import division from builtins import zip import os.path as op -from warnings import warn - import numpy as np from numpy import linalg as nla @@ -25,7 +23,7 @@ from ..interfaces.specs import BaseInterfaceInputSpec, TraitedSpec from ..interfaces.base import BaseInterface -iflogger = logging.getLogger('interface') +IFLOGGER = logging.getLogger('interface') class TVTKBaseInterface(BaseInterface): @@ -37,7 +35,7 @@ def __init__(self, **inputs): from tvtk.tvtk_classes.vtk_version import vtk_build_version self._vtk_major = int(vtk_build_version[0]) except ImportError: - iflogger.warning('VTK version-major inspection using tvtk failed.') + IFLOGGER.warning('VTK version-major inspection using tvtk failed.') super(TVTKBaseInterface, self).__init__(**inputs) @@ -404,6 +402,5 @@ class P2PDistance(ComputeMeshWarp): def __init__(self, **inputs): super(P2PDistance, self).__init__(**inputs) - warn(('This interface has been deprecated since 1.0, please use ' - 'ComputeMeshWarp'), - DeprecationWarning) + IFLOGGER.warn('This interface has been deprecated since 1.0, please use ' + 'ComputeMeshWarp') diff --git a/nipype/algorithms/metrics.py b/nipype/algorithms/metrics.py index 4e27f181fe..9996a78b8f 100644 --- a/nipype/algorithms/metrics.py +++ b/nipype/algorithms/metrics.py @@ -1,6 +1,6 @@ # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: -''' +""" Image assessment algorithms. Typical overlap and error computation measures to evaluate results from other processing units. @@ -10,7 +10,7 @@ >>> datadir = os.path.realpath(os.path.join(filepath, '../testing/data')) >>> os.chdir(datadir) -''' +""" from __future__ import division from builtins import zip from builtins import range diff --git a/nipype/algorithms/misc.py b/nipype/algorithms/misc.py index f0e4cff963..ab6afa3785 100644 --- a/nipype/algorithms/misc.py +++ b/nipype/algorithms/misc.py @@ -1,6 +1,6 @@ # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: -''' +""" Miscellaneous algorithms Change directory to provide relative paths for doctests @@ -9,7 +9,7 @@ >>> datadir = os.path.realpath(os.path.join(filepath, '../testing/data')) >>> os.chdir(datadir) -''' +""" from __future__ import print_function from __future__ import absolute_import from __future__ import division diff --git a/nipype/external/portalocker.py b/nipype/external/portalocker.py index 40b12b3cf3..2b7e60e2a5 100644 --- a/nipype/external/portalocker.py +++ b/nipype/external/portalocker.py @@ -1,6 +1,6 @@ # portalocker.py - Cross-platform (posix/nt) API for flock-style file locking. # Requires python 1.5.2 or better. -'''Cross-platform (posix/nt) API for flock-style file locking. +"""Cross-platform (posix/nt) API for flock-style file locking. Synopsis: @@ -47,7 +47,7 @@ Lowell Alleman Version: $Id: portalocker.py 5474 2008-05-16 20:53:50Z lowell $ -''' +""" from __future__ import print_function from __future__ import absolute_import diff --git a/nipype/fixes/numpy/testing/noseclasses.py b/nipype/fixes/numpy/testing/noseclasses.py index 9f69dc33db..aaa7350eda 100644 --- a/nipype/fixes/numpy/testing/noseclasses.py +++ b/nipype/fixes/numpy/testing/noseclasses.py @@ -304,16 +304,16 @@ def configure(self, options, config): class KnownFailureTest(Exception): - '''Raise this exception to mark a test as a known failing test.''' + """Raise this exception to mark a test as a known failing test.""" pass class KnownFailure(ErrorClassPlugin): - '''Plugin that installs a KNOWNFAIL error class for the + """Plugin that installs a KNOWNFAIL error class for the KnownFailureClass exception. When KnownFailureTest is raised, the exception will be logged in the knownfail attribute of the result, 'K' or 'KNOWNFAIL' (verbose) will be output, and the - exception will not be counted as an error or failure.''' + exception will not be counted as an error or failure.""" enabled = True knownfail = ErrorClass(KnownFailureTest, label='KNOWNFAIL', diff --git a/nipype/fixes/numpy/testing/nosetester.py b/nipype/fixes/numpy/testing/nosetester.py index 22c8d1a5ef..2a5c92333b 100644 --- a/nipype/fixes/numpy/testing/nosetester.py +++ b/nipype/fixes/numpy/testing/nosetester.py @@ -126,7 +126,7 @@ class NoseTester(object): 'swig_ext'] def __init__(self, package=None): - ''' Test class init + """ Test class init Parameters ---------- @@ -134,7 +134,7 @@ def __init__(self, package=None): If string, gives full path to package If None, extract calling module path Default is None - ''' + """ package_name = None if package is None: f = sys._getframe(1) @@ -158,7 +158,7 @@ def __init__(self, package=None): self.package_name = package_name def _test_argv(self, label, verbose, extra_argv): - ''' Generate argv for nosetest command + """ Generate argv for nosetest command Parameters ---------- @@ -173,7 +173,7 @@ def _test_argv(self, label, verbose, extra_argv): ------- argv : list command line arguments that will be passed to nose - ''' + """ argv = [__file__, self.package_path, '-s'] if label and label != 'full': if not isinstance(label, string_types): diff --git a/nipype/interfaces/afni/base.py b/nipype/interfaces/afni/base.py index f1e071acca..bb9d60ea74 100644 --- a/nipype/interfaces/afni/base.py +++ b/nipype/interfaces/afni/base.py @@ -104,9 +104,9 @@ def outputtype(cls): @staticmethod def standard_image(img_name): - '''Grab an image from the standard location. + """Grab an image from the standard location. - Could be made more fancy to allow for more relocatability''' + Could be made more fancy to allow for more relocatability""" clout = CommandLine('which afni', terminal_output='allatonce').run() if clout.runtime.returncode is not 0: diff --git a/nipype/interfaces/ants/segmentation.py b/nipype/interfaces/ants/segmentation.py index 7eede16032..423d323725 100644 --- a/nipype/interfaces/ants/segmentation.py +++ b/nipype/interfaces/ants/segmentation.py @@ -429,7 +429,7 @@ class CorticalThicknessInputSpec(ANTSCommandInputSpec): posterior_formulation = traits.Str(argstr='-b %s', desc=('Atropos posterior formulation and whether or not' 'to use mixture model proportions.' - '''e.g 'Socrates[1]' (default) or 'Aristotle[1]'.''' + """e.g 'Socrates[1]' (default) or 'Aristotle[1]'.""" 'Choose the latter if you' 'want use the distance priors (see also the -l option' 'for label propagation control).')) @@ -446,7 +446,7 @@ class CorticalThicknessInputSpec(ANTSCommandInputSpec): desc='Cortical ROI labels to use as a prior for ATITH.') label_propagation = traits.Str(argstr='-l %s', desc=('Incorporate a distance prior one the posterior formulation. Should be' - '''of the form 'label[lambda,boundaryProbability]' where label''' + """of the form 'label[lambda,boundaryProbability]' where label""" 'is a value of 1,2,3,... denoting label ID. The label' 'probability for anything outside the current label' ' = boundaryProbability * exp( -lambda * distanceFromBoundary )' diff --git a/nipype/interfaces/dcmstack.py b/nipype/interfaces/dcmstack.py index 70d93e0602..9a850018df 100644 --- a/nipype/interfaces/dcmstack.py +++ b/nipype/interfaces/dcmstack.py @@ -53,10 +53,10 @@ class NiftiGeneratorBaseInputSpec(TraitedSpec): class NiftiGeneratorBase(BaseInterface): - '''Base class for interfaces that produce Nifti files, potentially with - embedded meta data.''' + """Base class for interfaces that produce Nifti files, potentially with + embedded meta data.""" def _get_out_path(self, meta, idx=None): - '''Return the output path for the gernerated Nifti.''' + """Return the output path for the gernerated Nifti.""" if self.inputs.out_format: out_fmt = self.inputs.out_format else: @@ -112,7 +112,7 @@ class DcmStackOutputSpec(TraitedSpec): class DcmStack(NiftiGeneratorBase): - '''Create one Nifti file from a set of DICOM files. Can optionally embed + """Create one Nifti file from a set of DICOM files. Can optionally embed meta data. Example @@ -124,7 +124,7 @@ class DcmStack(NiftiGeneratorBase): >>> stacker.run() # doctest: +SKIP >>> result.outputs.out_file # doctest: +SKIP '/path/to/cwd/sequence.nii.gz' - ''' + """ input_spec = DcmStackInputSpec output_spec = DcmStackOutputSpec @@ -171,8 +171,8 @@ class GroupAndStackOutputSpec(TraitedSpec): class GroupAndStack(DcmStack): - '''Create (potentially) multiple Nifti files for a set of DICOM files. - ''' + """Create (potentially) multiple Nifti files for a set of DICOM files. + """ input_spec = DcmStackInputSpec output_spec = GroupAndStackOutputSpec @@ -211,7 +211,7 @@ class LookupMetaInputSpec(TraitedSpec): class LookupMeta(BaseInterface): - '''Lookup meta data values from a Nifti with embedded meta data. + """Lookup meta data values from a Nifti with embedded meta data. Example ------- @@ -226,7 +226,7 @@ class LookupMeta(BaseInterface): 9500.0 >>> result.outputs.TE # doctest: +SKIP 95.0 - ''' + """ input_spec = LookupMetaInputSpec output_spec = DynamicTraitedSpec @@ -281,8 +281,8 @@ class CopyMetaOutputSpec(TraitedSpec): class CopyMeta(BaseInterface): - '''Copy meta data from one Nifti file to another. Useful for preserving - meta data after some processing steps.''' + """Copy meta data from one Nifti file to another. Useful for preserving + meta data after some processing steps.""" input_spec = CopyMetaInputSpec output_spec = CopyMetaOutputSpec @@ -347,8 +347,8 @@ def key_func(src_nii): class MergeNifti(NiftiGeneratorBase): - '''Merge multiple Nifti files into one. Merges together meta data - extensions as well.''' + """Merge multiple Nifti files into one. Merges together meta data + extensions as well.""" input_spec = MergeNiftiInputSpec output_spec = MergeNiftiOutputSpec @@ -391,10 +391,10 @@ class SplitNiftiOutputSpec(TraitedSpec): class SplitNifti(NiftiGeneratorBase): - ''' + """ Split one Nifti file into many along the specified dimension. Each result has an updated meta data extension as well. - ''' + """ input_spec = SplitNiftiInputSpec output_spec = SplitNiftiOutputSpec diff --git a/nipype/interfaces/freesurfer/base.py b/nipype/interfaces/freesurfer/base.py index 54d1bb2c41..4498d88b84 100644 --- a/nipype/interfaces/freesurfer/base.py +++ b/nipype/interfaces/freesurfer/base.py @@ -128,7 +128,7 @@ def run(self, **inputs): def _gen_fname(self, basename, fname=None, cwd=None, suffix='_fs', use_ext=True): - '''Define a generic mapping for a single outfile + """Define a generic mapping for a single outfile The filename is potentially autogenerated by suffixing inputs.infile @@ -142,7 +142,7 @@ def _gen_fname(self, basename, fname=None, cwd=None, suffix='_fs', prefix paths with cwd, otherwise os.getcwd() suffix : string default suffix - ''' + """ if basename == '': msg = 'Unable to generate filename for command %s. ' % self.cmd msg += 'basename is not set!' diff --git a/nipype/interfaces/fsl/base.py b/nipype/interfaces/fsl/base.py index 658e8d1ab7..065cc771ae 100644 --- a/nipype/interfaces/fsl/base.py +++ b/nipype/interfaces/fsl/base.py @@ -116,11 +116,11 @@ def output_type(cls): @staticmethod def standard_image(img_name=None): - '''Grab an image from the standard location. + """Grab an image from the standard location. Returns a list of standard images if called without arguments. - Could be made more fancy to allow for more relocatability''' + Could be made more fancy to allow for more relocatability""" try: fsldir = os.environ['FSLDIR'] except KeyError: diff --git a/nipype/interfaces/fsl/model.py b/nipype/interfaces/fsl/model.py index f08456c91a..97b91d9358 100644 --- a/nipype/interfaces/fsl/model.py +++ b/nipype/interfaces/fsl/model.py @@ -1353,11 +1353,11 @@ class SMMOutputSpec(TraitedSpec): class SMM(FSLCommand): - ''' + """ Spatial Mixture Modelling. For more detail on the spatial mixture modelling see Mixture Models with Adaptive Spatial Regularisation for Segmentation with an Application to FMRI Data; Woolrich, M., Behrens, T., Beckmann, C., and Smith, S.; IEEE Trans. Medical Imaging, 24(1):1-11, 2005. - ''' + """ _cmd = 'mm --ld=logdir' input_spec = SMMInputSpec output_spec = SMMOutputSpec diff --git a/nipype/interfaces/io.py b/nipype/interfaces/io.py index 335c923b67..2ece05973d 100644 --- a/nipype/interfaces/io.py +++ b/nipype/interfaces/io.py @@ -137,14 +137,14 @@ def _add_output_traits(self, base): # Class to track percentage of S3 file upload class ProgressPercentage(object): - ''' + """ Callable class instsance (via __call__ method) that displays upload percentage of a file to S3 - ''' + """ def __init__(self, filename): - ''' - ''' + """ + """ # Import packages import threading @@ -156,8 +156,8 @@ def __init__(self, filename): self._lock = threading.Lock() def __call__(self, bytes_amount): - ''' - ''' + """ + """ # Import packages import sys @@ -179,8 +179,8 @@ def __call__(self, bytes_amount): # DataSink inputs class DataSinkInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): - ''' - ''' + """ + """ # Init inputspec data attributes base_directory = Directory( @@ -373,7 +373,7 @@ def _substitute(self, pathstr): # Check for s3 in base directory def _check_s3_base_dir(self): - ''' + """ Method to see if the datasink's base directory specifies an S3 bucket path; if it does, it parses the path for the bucket name in the form 's3://bucket_name/...' and returns it @@ -389,7 +389,7 @@ def _check_s3_base_dir(self): bucket_name : string name of the S3 bucket to connect to; if the base directory is not a valid S3 path, defaults to '' - ''' + """ # Init variables s3_str = 's3://' @@ -420,7 +420,7 @@ def _check_s3_base_dir(self): # Function to return AWS secure environment variables def _return_aws_keys(self): - ''' + """ Method to return AWS access key id and secret access key using credentials found in a local file. @@ -435,7 +435,7 @@ def _return_aws_keys(self): string of the AWS access key ID aws_secret_access_key : string string of the AWS secret access key - ''' + """ # Import packages import os @@ -475,7 +475,7 @@ def _return_aws_keys(self): # Fetch bucket object def _fetch_bucket(self, bucket_name): - ''' + """ Method to return a bucket object which can be used to interact with an AWS S3 bucket using credentials found in a local file. @@ -491,7 +491,7 @@ def _fetch_bucket(self, bucket_name): bucket : boto3.resources.factory.s3.Bucket boto3 s3 Bucket object which is used to interact with files in an S3 bucket on AWS - ''' + """ # Import packages import logging @@ -568,9 +568,9 @@ def _fetch_bucket(self, bucket_name): # Send up to S3 method def _upload_to_s3(self, bucket, src, dst): - ''' + """ Method to upload outputs to S3 bucket instead of on local disk - ''' + """ # Import packages import hashlib diff --git a/nipype/interfaces/nipy/model.py b/nipype/interfaces/nipy/model.py index eb7cb6a1d3..0a99bdb44f 100644 --- a/nipype/interfaces/nipy/model.py +++ b/nipype/interfaces/nipy/model.py @@ -73,9 +73,9 @@ class FitGLMOutputSpec(TraitedSpec): class FitGLM(BaseInterface): - ''' + """ Fit GLM model based on the specified design. Supports only single or concatenated runs. - ''' + """ input_spec = FitGLMInputSpec output_spec = FitGLMOutputSpec @@ -251,9 +251,9 @@ class EstimateContrastOutputSpec(TraitedSpec): class EstimateContrast(BaseInterface): - ''' + """ Estimate contrast of a fitted model. - ''' + """ input_spec = EstimateContrastInputSpec output_spec = EstimateContrastOutputSpec diff --git a/nipype/interfaces/spm/model.py b/nipype/interfaces/spm/model.py index cafb257e34..a586247710 100644 --- a/nipype/interfaces/spm/model.py +++ b/nipype/interfaces/spm/model.py @@ -433,7 +433,7 @@ class ThresholdOutputSpec(TraitedSpec): class Threshold(SPMCommand): - '''Topological FDR thresholding based on cluster extent/size. Smoothness is + """Topological FDR thresholding based on cluster extent/size. Smoothness is estimated from GLM residuals but is assumed to be the same for all of the voxels. @@ -446,7 +446,7 @@ class Threshold(SPMCommand): >>> thresh.inputs.contrast_index = 1 >>> thresh.inputs.extent_fdr_p_threshold = 0.05 >>> thresh.run() # doctest: +SKIP - ''' + """ input_spec = ThresholdInputSpec output_spec = ThresholdOutputSpec @@ -611,7 +611,7 @@ class ThresholdStatisticsOutputSpec(TraitedSpec): class ThresholdStatistics(SPMCommand): - '''Given height and cluster size threshold calculate theoretical probabilities + """Given height and cluster size threshold calculate theoretical probabilities concerning false positives Examples @@ -623,7 +623,7 @@ class ThresholdStatistics(SPMCommand): >>> thresh.inputs.contrast_index = 1 >>> thresh.inputs.height_threshold = 4.56 >>> thresh.run() # doctest: +SKIP - ''' + """ input_spec = ThresholdStatisticsInputSpec output_spec = ThresholdStatisticsOutputSpec diff --git a/nipype/interfaces/tests/test_io.py b/nipype/interfaces/tests/test_io.py index c1f4ec35f5..0455b1b47f 100644 --- a/nipype/interfaces/tests/test_io.py +++ b/nipype/interfaces/tests/test_io.py @@ -187,9 +187,9 @@ def test_datasink(): # Make dummy input file def _make_dummy_input(): - ''' + """ Function to create a dummy file - ''' + """ # Import packages import tempfile @@ -210,10 +210,10 @@ def _make_dummy_input(): # Test datasink writes to s3 properly @skipif(noboto3 or not fakes3) def test_datasink_to_s3(): - ''' + """ This function tests to see if the S3 functionality of a DataSink works properly - ''' + """ # Import packages import hashlib @@ -272,10 +272,10 @@ def test_datasink_to_s3(): # Test AWS creds read from env vars @skipif(noboto3 or not fakes3) def test_aws_keys_from_env(): - ''' + """ Function to ensure the DataSink can successfully read in AWS credentials from the environment variables - ''' + """ # Import packages import os @@ -300,10 +300,10 @@ def test_aws_keys_from_env(): # Test the local copy attribute def test_datasink_localcopy(): - ''' + """ Function to validate DataSink will make local copy via local_copy attribute - ''' + """ # Import packages import hashlib diff --git a/nipype/interfaces/traits_extension.py b/nipype/interfaces/traits_extension.py index 49af1db164..bba8feec83 100644 --- a/nipype/interfaces/traits_extension.py +++ b/nipype/interfaces/traits_extension.py @@ -235,9 +235,9 @@ def isdefined(object): def has_metadata(trait, metadata, value=None, recursive=True): - ''' + """ Checks if a given trait has a metadata (and optionally if it is set to particular value) - ''' + """ count = 0 if hasattr(trait, "_metadata") and metadata in list(trait._metadata.keys()) and (trait._metadata[metadata] == value or value is None): count += 1 diff --git a/nipype/pipeline/engine/tests/test_engine.py b/nipype/pipeline/engine/tests/test_engine.py index 21dbbfebce..ea9f6cf147 100644 --- a/nipype/pipeline/engine/tests/test_engine.py +++ b/nipype/pipeline/engine/tests/test_engine.py @@ -385,7 +385,7 @@ def test_doubleconnect(): yield assert_raises, Exception, x -''' +""" Test for order of iterables import nipype.pipeline.engine as pe @@ -415,9 +415,9 @@ def test_doubleconnect(): wf1.run(inseries=True, createdirsonly=True) wf1.write_graph(graph2use='exec') -''' +""" -''' +""" import nipype.pipeline.engine as pe import nipype.interfaces.spm as spm import os @@ -453,7 +453,7 @@ def test_doubleconnect(): workflow.run() workflow.run() -''' +""" # Node diff --git a/nipype/pipeline/engine/utils.py b/nipype/pipeline/engine/utils.py index 6d89381a50..df7fce7d96 100644 --- a/nipype/pipeline/engine/utils.py +++ b/nipype/pipeline/engine/utils.py @@ -329,7 +329,7 @@ def _get_valid_pathstr(pathstr): Replaces: ',' -> '.' """ pathstr = pathstr.replace(os.sep, '..') - pathstr = re.sub(r'''[][ (){}?:<>#!|"';]''', '', pathstr) + pathstr = re.sub(r"""[][ (){}?:<>#!|"';]""", '', pathstr) pathstr = pathstr.replace(',', '.') return pathstr diff --git a/nipype/pipeline/plugins/slurm.py b/nipype/pipeline/plugins/slurm.py index 4b22f853bd..99c6366372 100644 --- a/nipype/pipeline/plugins/slurm.py +++ b/nipype/pipeline/plugins/slurm.py @@ -1,10 +1,10 @@ -''' +""" Created on Aug 2, 2013 @author: chadcumba Parallel workflow execution with SLURM -''' +""" import os import re @@ -17,7 +17,7 @@ class SLURMPlugin(SGELikeBatchManagerBase): - ''' + """ Execute using SLURM The plugin_args input to run can be used to control the SLURM execution. @@ -28,7 +28,7 @@ class SLURMPlugin(SGELikeBatchManagerBase): - sbatch_args: arguments to pass prepend to the sbatch call - ''' + """ def __init__(self, **kwargs): diff --git a/nipype/pipeline/plugins/tests/test_base.py b/nipype/pipeline/plugins/tests/test_base.py index 243ae195c2..6801d5bb01 100644 --- a/nipype/pipeline/plugins/tests/test_base.py +++ b/nipype/pipeline/plugins/tests/test_base.py @@ -16,7 +16,7 @@ def test_scipy_sparse(): goo[goo.nonzero()] = 0 yield assert_equal, foo[0, 1], 0 -''' +""" Can use the following code to test that a mapnode crash continues successfully Need to put this into a nose-test with a timeout @@ -39,4 +39,4 @@ def func(arg1): wf.base_dir = '/tmp' wf.run(plugin='MultiProc') -''' +""" diff --git a/nipype/pipeline/plugins/tests/test_multiproc_nondaemon.py b/nipype/pipeline/plugins/tests/test_multiproc_nondaemon.py index 89336c2026..6b2c209c77 100644 --- a/nipype/pipeline/plugins/tests/test_multiproc_nondaemon.py +++ b/nipype/pipeline/plugins/tests/test_multiproc_nondaemon.py @@ -9,9 +9,9 @@ def mytestFunction(insum=0): - ''' + """ Run a multiprocessing job and spawn child processes. - ''' + """ # need to import here since this is executed as an external process import multiprocessing @@ -31,9 +31,9 @@ def mytestFunction(insum=0): f = [None] * numberOfThreads def dummyFunction(filename): - ''' + """ This function writes the value 45 to the given filename. - ''' + """ j = 0 for i in range(0, 10): j += i @@ -83,9 +83,9 @@ def dummyFunction(filename): def run_multiproc_nondaemon_with_flag(nondaemon_flag): - ''' + """ Start a pipe with two nodes using the multiproc plugin and passing the nondaemon_flag. - ''' + """ cur_dir = os.getcwd() temp_dir = mkdtemp(prefix='test_engine_') @@ -124,13 +124,13 @@ def run_multiproc_nondaemon_with_flag(nondaemon_flag): def test_run_multiproc_nondaemon_false(): - ''' + """ This is the entry point for the test. Two times a pipe of several multiprocessing jobs gets executed. First, without the nondaemon flag. Second, with the nondaemon flag. Since the processes of the pipe start child processes, the execution only succeeds when the non_daemon flag is on. - ''' + """ shouldHaveFailed = False try: # with nondaemon_flag = False, the execution should fail diff --git a/nipype/pkg_info.py b/nipype/pkg_info.py index 04ea874f7d..f32043ee61 100644 --- a/nipype/pkg_info.py +++ b/nipype/pkg_info.py @@ -14,7 +14,7 @@ def pkg_commit_hash(pkg_path): - ''' Get short form of commit hash given directory `pkg_path` + """ Get short form of commit hash given directory `pkg_path` There should be a file called 'COMMIT_INFO.txt' in `pkg_path`. This is a file in INI file format, with at least one section: ``commit hash``, and two @@ -42,7 +42,7 @@ def pkg_commit_hash(pkg_path): Where we got the hash from - description hash_str : str short form of hash - ''' + """ # Try and get commit from written commit text file pth = os.path.join(pkg_path, COMMIT_INFO_FNAME) if not os.path.isfile(pth): @@ -67,7 +67,7 @@ def pkg_commit_hash(pkg_path): def get_pkg_info(pkg_path): - ''' Return dict describing the context of this package + """ Return dict describing the context of this package Parameters ---------- @@ -78,7 +78,7 @@ def get_pkg_info(pkg_path): ------- context : dict with named parameters of interest - ''' + """ src, hsh = pkg_commit_hash(pkg_path) import networkx import nibabel diff --git a/nipype/utils/config.py b/nipype/utils/config.py index bd7ab032ef..a4885c8f18 100644 --- a/nipype/utils/config.py +++ b/nipype/utils/config.py @@ -1,13 +1,13 @@ # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: -''' +""" Created on 20 Apr 2010 logging options : INFO, DEBUG hash_method : content, timestamp @author: Chris Filo Gorgolewski -''' +""" from future import standard_library standard_library.install_aliases() from builtins import object diff --git a/nipype/utils/docparse.py b/nipype/utils/docparse.py index a445262a15..1bc6135acc 100644 --- a/nipype/utils/docparse.py +++ b/nipype/utils/docparse.py @@ -141,10 +141,10 @@ def insert_doc(doc, new_items): Examples -------- >>> from nipype.utils.docparse import insert_doc - >>> doc = '''Parameters + >>> doc = """Parameters ... ---------- ... outline : - ... something about an outline''' + ... something about an outline""" >>> new_items = ['infile : str', ' The name of the input file'] >>> new_items.extend(['outfile : str', ' The name of the output file']) diff --git a/nipype/utils/matlabtools.py b/nipype/utils/matlabtools.py index e272288b75..b32a013f43 100644 --- a/nipype/utils/matlabtools.py +++ b/nipype/utils/matlabtools.py @@ -13,7 +13,7 @@ def fltcols(vals): - ''' Trivial little function to make 1xN float vector ''' + """ Trivial little function to make 1xN float vector """ return np.atleast_2d(np.array(vals, dtype=float)) diff --git a/nipype/utils/nipype2boutiques.py b/nipype/utils/nipype2boutiques.py index 49fc1d755d..60a17b48ba 100644 --- a/nipype/utils/nipype2boutiques.py +++ b/nipype/utils/nipype2boutiques.py @@ -51,14 +51,14 @@ def main(argv): def generate_boutiques_descriptor(module, interface_name, ignored_template_inputs, docker_image, docker_index, verbose, ignore_template_numbers): - ''' + """ Returns a JSON string containing a JSON Boutiques description of a Nipype interface. Arguments: * module: module where the Nipype interface is declared. * interface: Nipype interface. * ignored_template_inputs: a list of input names that should be ignored in the generation of output path templates. * ignore_template_numbers: True if numbers must be ignored in output path creations. - ''' + """ if not module: raise Exception("Undefined module.") @@ -206,10 +206,10 @@ def get_boutiques_output(name, interface, tool_inputs, verbose=False): def get_type_from_spec_info(spec_info): - ''' + """ Returns an input type from the spec info. There must be a better way to get an input type in Nipype than to parse the spec info. - ''' + """ if ("an existing file name" in spec_info) or ("input volumes" in spec_info): return "File" elif ("an integer" in spec_info or "a float" in spec_info): @@ -220,21 +220,21 @@ def get_type_from_spec_info(spec_info): def is_list(spec_info): - ''' + """ Returns True if the spec info looks like it describes a list parameter. There must be a better way in Nipype to check if an input is a list. - ''' + """ if "a list" in spec_info: return True return False def get_unique_value(type, id): - ''' + """ Returns a unique value of type 'type', for input with id 'id', assuming id is unique. - ''' + """ return { "File": os.path.abspath(create_tempfile()), "Boolean": True, @@ -244,9 +244,9 @@ def get_unique_value(type, id): def create_tempfile(): - ''' + """ Creates a temp file and returns its name. - ''' + """ fileTemp = tempfile.NamedTemporaryFile(delete=False) fileTemp.write("hello") fileTemp.close() @@ -254,7 +254,7 @@ def create_tempfile(): def must_generate_value(name, type, ignored_template_inputs, spec_info, spec, ignore_template_numbers): - ''' + """ Return True if a temporary value must be generated for this input. Arguments: * name: input name. @@ -262,7 +262,7 @@ def must_generate_value(name, type, ignored_template_inputs, spec_info, spec, ig * ignored_template_inputs: a list of inputs names for which no value must be generated. * spec_info: spec info of the Nipype input * ignore_template_numbers: True if numbers must be ignored. - ''' + """ # Return false when type is number and numbers must be ignored. if ignore_template_numbers and type == "Number": return False diff --git a/setup.py b/setup.py index 2cae86461a..fc0c9e354d 100755 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ from distutils.core import setup # Commit hash writing, and dependency checking -''' Distutils / setuptools helpers from nibabel.nisext''' +""" Distutils / setuptools helpers from nibabel.nisext""" import os from os.path import join as pjoin @@ -89,7 +89,7 @@ def get_comrec_build(pkg_dir, build_cmd=build_py): package for an example. """ class MyBuildPy(build_cmd): - ''' Subclass to write commit data into installation tree ''' + """ Subclass to write commit data into installation tree """ def run(self): build_cmd.run(self) import subprocess @@ -129,7 +129,7 @@ def package_check(pkg_name, version=None, messages=None, setuptools_args=None ): - ''' Check if package `pkg_name` is present and has good enough version + """ Check if package `pkg_name` is present and has good enough version Has two modes of operation. If `setuptools_args` is None (the default), raise an error for missing non-optional dependencies and log warnings for @@ -171,7 +171,7 @@ def package_check(pkg_name, version=None, If None, raise errors / warnings for missing non-optional / optional dependencies. If dict fill key values ``install_requires`` and ``extras_require`` for non-optional and optional dependencies. - ''' + """ setuptools_mode = setuptools_args is not None optional_tf = bool(optional) if version_getter is None: diff --git a/tools/apigen.py b/tools/apigen.py index dba2ce0a37..6e2f645377 100644 --- a/tools/apigen.py +++ b/tools/apigen.py @@ -28,8 +28,8 @@ # Functions and classes class ApiDocWriter(object): - ''' Class for automatic detection and parsing of API docs - to Sphinx-parsable reST format''' + """ Class for automatic detection and parsing of API docs + to Sphinx-parsable reST format""" # only separating first two levels rst_section_levels = ['*', '=', '-', '~', '^'] @@ -40,7 +40,7 @@ def __init__(self, package_skip_patterns=None, module_skip_patterns=None, ): - ''' Initialize package for parsing + """ Initialize package for parsing Parameters ---------- @@ -65,7 +65,7 @@ def __init__(self, ``.util.console`` If is None, gives default. Default is: ['\.setup$', '\._'] - ''' + """ if package_skip_patterns is None: package_skip_patterns = ['\\.tests$'] if module_skip_patterns is None: @@ -79,7 +79,7 @@ def get_package_name(self): return self._package_name def set_package_name(self, package_name): - ''' Set package_name + """ Set package_name >>> docwriter = ApiDocWriter('sphinx') >>> import sphinx @@ -89,7 +89,7 @@ def set_package_name(self, package_name): >>> import docutils >>> docwriter.root_path == docutils.__path__[0] True - ''' + """ # It's also possible to imagine caching the module parsing here self._package_name = package_name self.root_module = __import__(package_name) @@ -100,7 +100,7 @@ def set_package_name(self, package_name): 'get/set package_name') def _get_object_name(self, line): - ''' Get second token in line + """ Get second token in line >>> docwriter = ApiDocWriter('sphinx') >>> docwriter._get_object_name(" def func(): ") 'func' @@ -108,14 +108,14 @@ def _get_object_name(self, line): 'Klass' >>> docwriter._get_object_name(" class Klass: ") 'Klass' - ''' + """ name = line.split()[1].split('(')[0].strip() # in case we have classes which are not derived from object # ie. old style classes return name.rstrip(':') def _uri2path(self, uri): - ''' Convert uri to absolute filepath + """ Convert uri to absolute filepath Parameters ---------- @@ -141,7 +141,7 @@ def _uri2path(self, uri): True >>> docwriter._uri2path('sphinx.does_not_exist') - ''' + """ if uri == self.package_name: return os.path.join(self.root_path, '__init__.py') path = uri.replace('.', os.path.sep) @@ -157,14 +157,14 @@ def _uri2path(self, uri): return path def _path2uri(self, dirpath): - ''' Convert directory path to uri ''' + """ Convert directory path to uri """ relpath = dirpath.replace(self.root_path, self.package_name) if relpath.startswith(os.path.sep): relpath = relpath[1:] return relpath.replace(os.path.sep, '.') def _parse_module(self, uri): - ''' Parse module defined in *uri* ''' + """ Parse module defined in *uri* """ filename = self._uri2path(uri) if filename is None: # nothing that we could handle here. @@ -175,7 +175,7 @@ def _parse_module(self, uri): return functions, classes def _parse_lines(self, linesource): - ''' Parse lines of text for functions and classes ''' + """ Parse lines of text for functions and classes """ functions = [] classes = [] for line in linesource: @@ -196,7 +196,7 @@ def _parse_lines(self, linesource): return functions, classes def generate_api_doc(self, uri): - '''Make autodoc documentation template string for a module + """Make autodoc documentation template string for a module Parameters ---------- @@ -207,7 +207,7 @@ def generate_api_doc(self, uri): ------- S : string Contents of API doc - ''' + """ # get the names of all classes and functions functions, classes = self._parse_module(uri) if not len(functions) and not len(classes): @@ -271,7 +271,7 @@ def generate_api_doc(self, uri): return ad def _survives_exclude(self, matchstr, match_type): - ''' Returns True if *matchstr* does not match patterns + """ Returns True if *matchstr* does not match patterns ``self.package_name`` removed from front of string if present @@ -290,7 +290,7 @@ def _survives_exclude(self, matchstr, match_type): >>> dw.module_skip_patterns.append('^\\.badmod$') >>> dw._survives_exclude('sphinx.badmod', 'module') False - ''' + """ if match_type == 'module': patterns = self.module_skip_patterns elif match_type == 'package': @@ -314,7 +314,7 @@ def _survives_exclude(self, matchstr, match_type): return True def discover_modules(self): - ''' Return module sequence discovered from ``self.package_name`` + """ Return module sequence discovered from ``self.package_name`` Parameters @@ -336,7 +336,7 @@ def discover_modules(self): >>> 'sphinx.util' in dw.discover_modules() False >>> - ''' + """ modules = [] # raw directory parsing for dirpath, dirnames, filenames in os.walk(self.root_path): diff --git a/tools/checkspecs.py b/tools/checkspecs.py index 8974428780..24ae1f9e1c 100644 --- a/tools/checkspecs.py +++ b/tools/checkspecs.py @@ -28,7 +28,7 @@ def __init__(self, module_skip_patterns=None, class_skip_patterns=None ): - ''' Initialize package for parsing + """ Initialize package for parsing Parameters ---------- @@ -55,7 +55,7 @@ def __init__(self, Sequence of strings giving classes to be excluded Default is: None - ''' + """ if package_skip_patterns is None: package_skip_patterns = ['\\.tests$'] if module_skip_patterns is None: @@ -117,14 +117,14 @@ def _uri2path(self, uri): return path def _path2uri(self, dirpath): - ''' Convert directory path to uri ''' + """ Convert directory path to uri """ relpath = dirpath.replace(self.root_path, self.package_name) if relpath.startswith(os.path.sep): relpath = relpath[1:] return relpath.replace(os.path.sep, '.') def _parse_module(self, uri): - ''' Parse module defined in *uri* ''' + """ Parse module defined in *uri* """ filename = self._uri2path(uri) if filename is None: # nothing that we could handle here. @@ -135,7 +135,7 @@ def _parse_module(self, uri): return functions, classes def _parse_lines(self, linesource, module): - ''' Parse lines of text for functions and classes ''' + """ Parse lines of text for functions and classes """ functions = [] classes = [] for line in linesource: @@ -293,7 +293,7 @@ def test_specs(self, uri): return bad_specs def _survives_exclude(self, matchstr, match_type): - ''' Returns True if *matchstr* does not match patterns + """ Returns True if *matchstr* does not match patterns ``self.package_name`` removed from front of string if present @@ -312,7 +312,7 @@ def _survives_exclude(self, matchstr, match_type): >>> dw.module_skip_patterns.append('^\\.badmod$') >>> dw._survives_exclude('sphinx.badmod', 'module') False - ''' + """ if match_type == 'module': patterns = self.module_skip_patterns elif match_type == 'package': @@ -336,7 +336,7 @@ def _survives_exclude(self, matchstr, match_type): return True def discover_modules(self): - ''' Return module sequence discovered from ``self.package_name`` + """ Return module sequence discovered from ``self.package_name`` Parameters @@ -350,7 +350,7 @@ def discover_modules(self): Examples -------- - ''' + """ modules = [self.package_name] # raw directory parsing for dirpath, dirnames, filenames in os.walk(self.root_path): diff --git a/tools/gitwash_dumper.py b/tools/gitwash_dumper.py index 8803786c8c..7e7e85d4b8 100755 --- a/tools/gitwash_dumper.py +++ b/tools/gitwash_dumper.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -''' Checkout gitwash repo into directory and do search replace on name ''' +""" Checkout gitwash repo into directory and do search replace on name """ from __future__ import print_function import os @@ -52,9 +52,9 @@ def cp_files(in_path, globs, out_path): def filename_search_replace(sr_pairs, filename, backup=False): - ''' Search and replace for expressions in files + """ Search and replace for expressions in files - ''' + """ in_txt = open(filename, 'rt').read(-1) out_txt = in_txt[:] for in_exp, out_exp in sr_pairs: @@ -153,13 +153,13 @@ def make_link_targets(proj_name, out_links.close() -USAGE = ''' +USAGE = """ If not set with options, the repository name is the same as the If not set with options, the main github user is the same as the -repository name.''' +repository name.""" GITWASH_CENTRAL = 'git://github.com/matthew-brett/gitwash.git' diff --git a/tools/interfacedocgen.py b/tools/interfacedocgen.py index eda0c6a8b5..745f7945e1 100644 --- a/tools/interfacedocgen.py +++ b/tools/interfacedocgen.py @@ -40,8 +40,8 @@ class InterfaceHelpWriter(object): - ''' Class for automatic detection and parsing of API docs - to Sphinx-parsable reST format''' + """ Class for automatic detection and parsing of API docs + to Sphinx-parsable reST format""" # only separating first two levels rst_section_levels = ['*', '=', '-', '~', '^'] @@ -53,7 +53,7 @@ def __init__(self, module_skip_patterns=None, class_skip_patterns=None ): - ''' Initialize package for parsing + """ Initialize package for parsing Parameters ---------- @@ -82,7 +82,7 @@ def __init__(self, Sequence of strings giving classes to be excluded Default is: None - ''' + """ if package_skip_patterns is None: package_skip_patterns = ['\\.tests$'] if module_skip_patterns is None: @@ -100,7 +100,7 @@ def get_package_name(self): return self._package_name def set_package_name(self, package_name): - ''' Set package_name + """ Set package_name >>> docwriter = ApiDocWriter('sphinx') >>> import sphinx @@ -110,7 +110,7 @@ def set_package_name(self, package_name): >>> import docutils >>> docwriter.root_path == docutils.__path__[0] True - ''' + """ # It's also possible to imagine caching the module parsing here self._package_name = package_name self.root_module = __import__(package_name) @@ -121,7 +121,7 @@ def set_package_name(self, package_name): 'get/set package_name') def _get_object_name(self, line): - ''' Get second token in line + """ Get second token in line >>> docwriter = ApiDocWriter('sphinx') >>> docwriter._get_object_name(" def func(): ") 'func' @@ -129,14 +129,14 @@ def _get_object_name(self, line): 'Klass' >>> docwriter._get_object_name(" class Klass: ") 'Klass' - ''' + """ name = line.split()[1].split('(')[0].strip() # in case we have classes which are not derived from object # ie. old style classes return name.rstrip(':') def _uri2path(self, uri): - ''' Convert uri to absolute filepath + """ Convert uri to absolute filepath Parameters ---------- @@ -162,7 +162,7 @@ def _uri2path(self, uri): True >>> docwriter._uri2path('sphinx.does_not_exist') - ''' + """ if uri == self.package_name: return os.path.join(self.root_path, '__init__.py') path = uri.replace('.', os.path.sep) @@ -178,14 +178,14 @@ def _uri2path(self, uri): return path def _path2uri(self, dirpath): - ''' Convert directory path to uri ''' + """ Convert directory path to uri """ relpath = dirpath.replace(self.root_path, self.package_name) if relpath.startswith(os.path.sep): relpath = relpath[1:] return relpath.replace(os.path.sep, '.') def _parse_module(self, uri): - ''' Parse module defined in *uri* ''' + """ Parse module defined in *uri* """ filename = self._uri2path(uri) if filename is None: # nothing that we could handle here. @@ -196,7 +196,7 @@ def _parse_module(self, uri): return functions, classes def _parse_lines(self, linesource, module): - ''' Parse lines of text for functions and classes ''' + """ Parse lines of text for functions and classes """ functions = [] classes = [] for line in linesource: @@ -231,7 +231,7 @@ def _write_graph_section(self, fname, title): return ad def generate_api_doc(self, uri): - '''Make autodoc documentation template string for a module + """Make autodoc documentation template string for a module Parameters ---------- @@ -242,7 +242,7 @@ def generate_api_doc(self, uri): ------- S : string Contents of API doc - ''' + """ # get the names of all classes and functions functions, classes = self._parse_module(uri) workflows = [] @@ -343,7 +343,7 @@ def generate_api_doc(self, uri): return ad def _survives_exclude(self, matchstr, match_type): - ''' Returns True if *matchstr* does not match patterns + """ Returns True if *matchstr* does not match patterns ``self.package_name`` removed from front of string if present @@ -362,7 +362,7 @@ def _survives_exclude(self, matchstr, match_type): >>> dw.module_skip_patterns.append('^\\.badmod$') >>> dw._survives_exclude('sphinx.badmod', 'module') False - ''' + """ if match_type == 'module': patterns = self.module_skip_patterns elif match_type == 'package': @@ -386,7 +386,7 @@ def _survives_exclude(self, matchstr, match_type): return True def discover_modules(self): - ''' Return module sequence discovered from ``self.package_name`` + """ Return module sequence discovered from ``self.package_name`` Parameters @@ -408,7 +408,7 @@ def discover_modules(self): >>> 'sphinx.util' in dw.discover_modules() False >>> - ''' + """ modules = [self.package_name] # raw directory parsing for dirpath, dirnames, filenames in os.walk(self.root_path): From 2d16732766bf7dfe83dc6192f359534d9a56e02a Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 17 Feb 2016 09:41:56 -0800 Subject: [PATCH 29/73] fixing errors generated with autoreplacement --- nipype/algorithms/misc.py | 99 ++++++++++------------ nipype/interfaces/io.py | 155 ++++++++++++++++------------------- nipype/interfaces/utility.py | 47 ++++------- 3 files changed, 134 insertions(+), 167 deletions(-) diff --git a/nipype/algorithms/misc.py b/nipype/algorithms/misc.py index ab6afa3785..75e24d31fe 100644 --- a/nipype/algorithms/misc.py +++ b/nipype/algorithms/misc.py @@ -28,19 +28,15 @@ import itertools import scipy.stats as stats -from nipype import logging - -import warnings - from . import metrics as nam - - +from ..utils.filemanip import fname_presuffix, split_filename from ..interfaces.traits_extension import traits, File, isdefined, Undefined from ..interfaces.specs import BaseInterfaceInputSpec, TraitedSpec, InputMultiPath, OutputMultiPath, DynamicTraitedSpec from ..interfaces.base import BaseInterface -from nipype.utils.filemanip import fname_presuffix, split_filename -iflogger = logging.getLogger('interface') + +from ... import logging +IFLOGGER = logging.getLogger('interface') class PickAtlasInputSpec(BaseInterfaceInputSpec): @@ -369,14 +365,14 @@ def _run_interface(self, runtime): if isinstance(in_dict[key][0], np.ndarray): saved_variables.append(key) else: - iflogger.info('One of the keys in the input file, {k}, is not a Numpy array'.format(k=key)) + IFLOGGER.info('One of the keys in the input file, {k}, is not a Numpy array'.format(k=key)) if len(saved_variables) > 1: - iflogger.info( + IFLOGGER.info( '{N} variables found:'.format(N=len(saved_variables))) - iflogger.info(saved_variables) + IFLOGGER.info(saved_variables) for variable in saved_variables: - iflogger.info( + IFLOGGER.info( '...Converting {var} - type {ty} - to\ CSV'.format(var=variable, ty=type(in_dict[variable])) ) @@ -385,13 +381,13 @@ def _run_interface(self, runtime): elif len(saved_variables) == 1: _, name, _ = split_filename(self.inputs.in_file) variable = saved_variables[0] - iflogger.info('Single variable found {var}, type {ty}:'.format( + IFLOGGER.info('Single variable found {var}, type {ty}:'.format( var=variable, ty=type(in_dict[variable]))) - iflogger.info('...Converting {var} to CSV from {f}'.format( + IFLOGGER.info('...Converting {var} to CSV from {f}'.format( var=variable, f=self.inputs.in_file)) matlab2csv(in_dict[variable], name, self.inputs.reshape_matrix) else: - iflogger.error('No values in the MATLAB file?!') + IFLOGGER.error('No values in the MATLAB file?!') return runtime def _post_run(self): @@ -404,7 +400,7 @@ def _post_run(self): if isinstance(in_dict[key][0], np.ndarray): saved_variables.append(key) else: - iflogger.error('One of the keys in the input file, {k}, is\ + IFLOGGER.error('One of the keys in the input file, {k}, is\ not a Numpy array'.format(k=key)) if len(saved_variables) > 1: @@ -413,7 +409,7 @@ def _post_run(self): _, name, ext = split_filename(self.inputs.in_file) self.outputs.csv_files = op.abspath(name + '.csv') else: - iflogger.error('No values in the MATLAB file?!') + IFLOGGER.error('No values in the MATLAB file?!') class MergeCSVFilesInputSpec(TraitedSpec): @@ -471,41 +467,41 @@ def _run_interface(self, runtime): This block defines the column headings. """ if isdefined(self.inputs.column_headings): - iflogger.info('Column headings have been provided:') + IFLOGGER.info('Column headings have been provided:') headings = self.inputs.column_headings else: - iflogger.info( + IFLOGGER.info( 'Column headings not provided! Pulled from input filenames:') headings = remove_identical_paths(self.inputs.in_files) if isdefined(self.inputs.extra_field): if isdefined(self.inputs.extra_column_heading): extraheading = self.inputs.extra_column_heading - iflogger.info('Extra column heading provided: {col}'.format( + IFLOGGER.info('Extra column heading provided: {col}'.format( col=extraheading)) else: extraheading = 'type' - iflogger.info( + IFLOGGER.info( 'Extra column heading was not defined. Using "type"') headings.append(extraheading) extraheadingBool = True if len(self.inputs.in_files) == 1: - iflogger.warn('Only one file input!') + IFLOGGER.warn('Only one file input!') if isdefined(self.inputs.row_headings): - iflogger.info('Row headings have been provided. Adding "labels"\ + IFLOGGER.info('Row headings have been provided. Adding "labels"\ column header.') prefix = '"{p}","'.format(p=self.inputs.row_heading_title) csv_headings = prefix + '","'.join(itertools.chain( headings)) + '"\n' rowheadingsBool = True else: - iflogger.info('Row headings have not been provided.') + IFLOGGER.info('Row headings have not been provided.') csv_headings = '"' + '","'.join(itertools.chain(headings)) + '"\n' - iflogger.info('Final Headings:') - iflogger.info(csv_headings) + IFLOGGER.info('Final Headings:') + IFLOGGER.info(csv_headings) """ Next we merge the arrays and define the output text file @@ -543,10 +539,10 @@ def _run_interface(self, runtime): mx = 1 for idx in range(0, mx): extrafieldlist.append(self.inputs.extra_field) - iflogger.info(len(extrafieldlist)) + IFLOGGER.info(len(extrafieldlist)) output[extraheading] = extrafieldlist - iflogger.info(output) - iflogger.info(fmt) + IFLOGGER.info(output) + IFLOGGER.info(fmt) np.savetxt(file_handle, output, fmt, delimiter=',') file_handle.close() return runtime @@ -606,10 +602,10 @@ def __setattr__(self, key, value): if key not in self.copyable_trait_names(): if not isdefined(value): super(AddCSVRowInputSpec, self).__setattr__(key, value) - self._setattr(self.outputs, key, value + self._outputs[key] = value else: if key in self._outputs: - self._setattr(self.outputs, key, value + self.outputs[key] = value super(AddCSVRowInputSpec, self).__setattr__(key, value) @@ -655,7 +651,7 @@ def __init__(self, infields=None, force_run=True, **kwargs): if infields: for key in infields: self.inputs.add_trait(key, traits.Any) - self.inputs._setattr(self.outputs, key, Undefined + self.inputs._outputs[key] = Undefined undefined_traits[key] = Undefined self.inputs.trait_set(trait_change_notify=False, **undefined_traits) @@ -673,9 +669,8 @@ def _run_interface(self, runtime): import lockfile as pl self._have_lock = True except ImportError: - from warnings import warn - warn(('Python module lockfile was not found: AddCSVRow will not be' - ' thread-safe in multi-processor execution')) + IFLOGGER.warn('Python module lockfile was not found: AddCSVRow will not be' + ' thread-safe in multi-processor execution') input_dict = {} for key, val in list(self.inputs._outputs.items()): @@ -997,7 +992,7 @@ def matlab2csv(in_array, name, reshape): if len(np.shape(output_array)) > 1: output_array = np.reshape(output_array, ( np.shape(output_array)[0] * np.shape(output_array)[1], 1)) - iflogger.info(np.shape(output_array)) + IFLOGGER.info(np.shape(output_array)) output_name = op.abspath(name + '.csv') np.savetxt(output_name, output_array, delimiter=',') return output_name @@ -1027,8 +1022,8 @@ def merge_csvs(in_list): else: out_array = np.dstack((out_array, in_array)) out_array = np.squeeze(out_array) - iflogger.info('Final output array shape:') - iflogger.info(np.shape(out_array)) + IFLOGGER.info('Final output array shape:') + IFLOGGER.info(np.shape(out_array)) return out_array @@ -1064,7 +1059,7 @@ def maketypelist(rowheadings, shape, extraheadingBool, extraheading): typelist.append((str(idx), float)) if extraheadingBool: typelist.append((extraheading, 'a40')) - iflogger.info(typelist) + IFLOGGER.info(typelist) return typelist @@ -1239,8 +1234,7 @@ def split_rois(in_file, mask=None, roishape=None): return out_files, out_mask, out_idxs -def merge_rois(in_files, in_idxs, in_ref, - dtype=None, out_file=None): +def merge_rois(in_files, in_idxs, in_ref, dtype=None, out_file=None): """ Re-builds an image resulting from a parallelized processing """ @@ -1259,7 +1253,7 @@ def merge_rois(in_files, in_idxs, in_ref, # to avoid memory errors if op.splitext(in_ref)[1] == '.gz': try: - iflogger.info('uncompress %i' % in_ref) + IFLOGGER.info('uncompress %i' % in_ref) sp.check_call(['gunzip', in_ref], stdout=sp.PIPE, shell=True) in_ref = op.splitext(in_ref)[0] except: @@ -1338,10 +1332,9 @@ class Distance(nam.Distance): Use :py:class:`nipype.algorithms.metrics.Distance` instead. """ def __init__(self, **inputs): - super(nam.Distance, self).__init__(**inputs) - warnings.warn(("This interface has been deprecated since 0.10.0," - " please use nipype.algorithms.metrics.Distance"), - DeprecationWarning) + super(Distance, self).__init__(**inputs) + IFLOGGER.warn("This interface has been deprecated since 0.10.0," + " please use nipype.algorithms.metrics.Distance") class Overlap(nam.Overlap): @@ -1351,10 +1344,9 @@ class Overlap(nam.Overlap): Use :py:class:`nipype.algorithms.metrics.Overlap` instead. """ def __init__(self, **inputs): - super(nam.Overlap, self).__init__(**inputs) - warnings.warn(("This interface has been deprecated since 0.10.0," - " please use nipype.algorithms.metrics.Overlap"), - DeprecationWarning) + super(Overlap, self).__init__(**inputs) + IFLOGGER.warn("This interface has been deprecated since 0.10.0," + " please use nipype.algorithms.metrics.Overlap") class FuzzyOverlap(nam.FuzzyOverlap): @@ -1365,7 +1357,6 @@ class FuzzyOverlap(nam.FuzzyOverlap): Use :py:class:`nipype.algorithms.metrics.FuzzyOverlap` instead. """ def __init__(self, **inputs): - super(nam.FuzzyOverlap, self).__init__(**inputs) - warnings.warn(("This interface has been deprecated since 0.10.0," - " please use nipype.algorithms.metrics.FuzzyOverlap"), - DeprecationWarning) + super(FuzzyOverlap, self).__init__(**inputs) + IFLOGGER.warn("This interface has been deprecated since 0.10.0," + " please use nipype.algorithms.metrics.FuzzyOverlap") diff --git a/nipype/interfaces/io.py b/nipype/interfaces/io.py index 2ece05973d..54028c1bf4 100644 --- a/nipype/interfaces/io.py +++ b/nipype/interfaces/io.py @@ -37,7 +37,7 @@ from .traits_extension import traits, Undefined, File, Directory, isdefined from .base import BaseInterface -from .specs import (TraitedSpec, DynamicTraitedSpec, +from .specs import (TraitedSpec, DynamicTraitedSpec, BaseInterfaceInputSpec, InputMultiPath, OutputMultiPath) from .. import config @@ -125,7 +125,7 @@ class IOBase(BaseInterface): def _run_interface(self, runtime): return runtime - def _list_outputs(self): + def _post_run(self): raise NotImplementedError def _outputs(self): @@ -223,10 +223,10 @@ def __setattr__(self, key, value): if key not in self.copyable_trait_names(): if not isdefined(value): super(DataSinkInputSpec, self).__setattr__(key, value) - self._setattr(self.outputs, key, value + self._outputs[key] = value else: if key in self._outputs: - self._setattr(self.outputs, key, value + self._outputs[key] = value super(DataSinkInputSpec, self).__setattr__(key, value) @@ -320,7 +320,7 @@ def __init__(self, infields=None, force_run=True, **kwargs): if infields: for key in infields: self.inputs.add_trait(key, traits.Any) - self.inputs._setattr(self.outputs, key, Undefined + self.inputs._outputs[key] = Undefined undefined_traits[key] = Undefined self.inputs.trait_set(trait_change_notify=False, **undefined_traits) if force_run: @@ -637,13 +637,13 @@ def _upload_to_s3(self, bucket, src, dst): Callback=ProgressPercentage(src_f)) # List outputs, main run routine - def _list_outputs(self): + def _post_run(self): """Execute this module. """ # Init variables iflogger = logging.getLogger('interface') - + out_files = [] # Use hardlink use_hardlink = str2bool(config.get('execution', 'try_hard_link_datasink')) @@ -768,8 +768,6 @@ def _list_outputs(self): # Return outputs dictionary self.outputs.out_file = out_files - return outputs - class S3DataGrabberInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): anon = traits.Bool(False, usedefault=True, @@ -862,7 +860,7 @@ def _add_output_traits(self, base): """ return add_traits(base, self.inputs.template_args.keys()) - def _list_outputs(self): + def _post_run(self): # infields are mandatory, however I could not figure out how to set 'mandatory' flag dynamically # hence manual check if self._infields: @@ -881,7 +879,7 @@ def _list_outputs(self): # keys are outfields, args are template args for the outfield for key, args in self.inputs.template_args.items(): - setattr(self.outputs, key, [] + setattr(self.outputs, key, []) template = self.inputs.template if hasattr(self.inputs, 'field_template') and \ isdefined(self.inputs.field_template) and \ @@ -904,7 +902,7 @@ def _list_outputs(self): else: if self.inputs.sort_filelist: filelist = human_order_sorted(filelist) - setattr(self.outputs, key, list_to_filename(filelist) + setattr(self.outputs, key, list_to_filename(filelist)) for argnum, arglist in enumerate(args): maxlen = 1 for arg in arglist: @@ -941,17 +939,17 @@ def _list_outputs(self): raise IOError(msg) else: warn(msg) - outputs[key].append(None) + getattr(self.outputs, key).append(None) else: if self.inputs.sort_filelist: outfiles = human_order_sorted(outfiles) - outputs[key].append(list_to_filename(outfiles)) - if any([val is None for val in outputs[key]]): - setattr(self.outputs, key, [] - if len(outputs[key]) == 0: - setattr(self.outputs, key, None - elif len(outputs[key]) == 1: - setattr(self.outputs, key, outputs[key][0] + getattr(self.outputs, key).append(list_to_filename(outfiles)) + if any([val is None for val in getattr(self.outputs, key)]): + setattr(self.outputs, key, []) + if len(getattr(self.outputs, key)) == 0: + setattr(self.outputs, key, None) + elif len(getattr(self.outputs, key)) == 1: + setattr(self.outputs, key, getattr(self.outputs, key)[0]) # Outputs are currently stored as locations on S3. # We must convert to the local location specified # and download the files. @@ -961,13 +959,15 @@ def _list_outputs(self): #tuple, numpy array) and we iterate through each of its #values. If it doesn't, it's string-like (string, #unicode), and we convert that value directly. + + cur_value = getattr(self.outputs, key) if hasattr(val,'__iter__'): for i,path in enumerate(val): - outputs[key][i] = self.s3tolocal(path, bkt) + cur_value[i] = self.s3tolocal(path, bkt) else: - setattr(self.outputs, key, self.s3tolocal(val, bkt) + cur_value[i] = self.s3tolocal(val, bkt) + setattr(self.outputs, key, cur_value) - return outputs # Takes an s3 address and downloads the file to a local # directory, returning the local path. @@ -1107,7 +1107,7 @@ def _add_output_traits(self, base): """ return add_traits(base, list(self.inputs.template_args.keys())) - def _list_outputs(self): + def _post_run(self): # infields are mandatory, however I could not figure out how to set 'mandatory' flag dynamically # hence manual check if self._infields: @@ -1120,7 +1120,7 @@ def _list_outputs(self): outputs = {} for key, args in list(self.inputs.template_args.items()): - setattr(self.outputs, key, [] + setattr(self.outputs, key, []) template = self.inputs.template if hasattr(self.inputs, 'field_template') and \ isdefined(self.inputs.field_template) and \ @@ -1143,7 +1143,7 @@ def _list_outputs(self): else: if self.inputs.sort_filelist: filelist = human_order_sorted(filelist) - setattr(self.outputs, key, list_to_filename(filelist) + setattr(self.outputs, key, list_to_filename(filelist)) for argnum, arglist in enumerate(args): maxlen = 1 for arg in arglist: @@ -1177,18 +1177,17 @@ def _list_outputs(self): raise IOError(msg) else: warn(msg) - outputs[key].append(None) + getattr(self.outputs, key).append(None) else: if self.inputs.sort_filelist: outfiles = human_order_sorted(outfiles) - outputs[key].append(list_to_filename(outfiles)) - if any([val is None for val in outputs[key]]): - setattr(self.outputs, key, [] - if len(outputs[key]) == 0: - setattr(self.outputs, key, None - elif len(outputs[key]) == 1: - setattr(self.outputs, key, outputs[key][0] - return outputs + getattr(self.outputs, key).append(list_to_filename(outfiles)) + if any([val is None for val in getattr(self.outputs, key)]): + setattr(self.outputs, key, []) + if len(getattr(self.outputs, key)) == 0: + setattr(self.outputs, key, None) + elif len(getattr(self.outputs, key)) == 1: + setattr(self.outputs, key, getattr(self.outputs, key)[0]) class SelectFilesInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): @@ -1282,7 +1281,7 @@ def _add_output_traits(self, base): """Add the dynamic output fields""" return add_traits(base, list(self._templates.keys())) - def _list_outputs(self): + def _post_run(self): """Find the files and expose them as interface outputs.""" outputs = {} info = dict([(k, v) for k, v in list(self.inputs.__dict__.items()) @@ -1330,9 +1329,7 @@ def _list_outputs(self): if field not in force_lists: filelist = list_to_filename(filelist) - setattr(self.outputs, field, filelist - - return outputs + setattr(self.outputs, field, filelist) class DataFinderInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): @@ -1474,12 +1471,9 @@ def _run_interface(self, runtime): if not self.result: raise RuntimeError("Regular expression did not match any files!") + self.outputs.update(self.result) return runtime - def _list_outputs(self): - outputs.update(self.result) - return outputs - class FSSourceInputSpec(BaseInterfaceInputSpec): subjects_dir = Directory(mandatory=True, @@ -1611,7 +1605,7 @@ def _get_files(self, path, key, dirval, altkey=None): keydir, ''.join((globprefix, key, globsuffix))) return [os.path.abspath(f) for f in glob.glob(globpattern)] - def _list_outputs(self): + def _post_run(self): subjects_dir = self.inputs.subjects_dir subject_path = os.path.join(subjects_dir, self.inputs.subject_id) output_traits = self._outputs() @@ -1621,8 +1615,7 @@ def _list_outputs(self): output_traits.traits()[k].loc, output_traits.traits()[k].altkey) if val: - setattr(self.outputs, k, list_to_filename(val) - return outputs + setattr(self.outputs, k, list_to_filename(val)) class XNATSourceInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): @@ -1734,7 +1727,7 @@ def _add_output_traits(self, base): """ return add_traits(base, list(self.inputs.query_template_args.keys())) - def _list_outputs(self): + def _post_run(self): # infields are mandatory, however I could not figure out # how to set 'mandatory' flag dynamically, hence manual check @@ -1761,7 +1754,7 @@ def _list_outputs(self): outputs = {} for key, args in list(self.inputs.query_template_args.items()): - setattr(self.outputs, key, [] + setattr(self.outputs, key, []) template = self.inputs.query_template if hasattr(self.inputs, 'field_template') and \ isdefined(self.inputs.field_template) and \ @@ -1777,7 +1770,7 @@ def _list_outputs(self): [str(file_object.get()) for file_object in file_objects if file_object.exists() - ]) + ])) for argnum, arglist in enumerate(args): maxlen = 1 for arg in arglist: @@ -1831,12 +1824,11 @@ def _list_outputs(self): ] ) - outputs[key].insert(i, outfiles) - if len(outputs[key]) == 0: - setattr(self.outputs, key, None - elif len(outputs[key]) == 1: - setattr(self.outputs, key, outputs[key][0] - return outputs + getattr(self.outputs, key).insert(i, outfiles) + if len(getattr(self.outputs, key)) == 0: + setattr(self.outputs, key, None) + elif len(getattr(self.outputs, key)) == 1: + setattr(self.outputs, key, getattr(self.outputs, key)[0]) class XNATSinkInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): @@ -1883,7 +1875,7 @@ class XNATSinkInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): def __setattr__(self, key, value): if key not in self.copyable_trait_names(): - self._setattr(self.outputs, key, value + self._outputs[key] = value else: super(XNATSinkInputSpec, self).__setattr__(key, value) @@ -1895,7 +1887,7 @@ class XNATSink(IOBase): """ input_spec = XNATSinkInputSpec - def _list_outputs(self): + def _post_run(self): """Execute this module. """ @@ -2099,7 +2091,7 @@ def __init__(self, input_names, **inputs): self._input_names = filename_to_list(input_names) add_traits(self.inputs, [name for name in self._input_names]) - def _list_outputs(self): + def _post_run(self): """Execute this module. """ conn = sqlite3.connect(self.inputs.database_file, @@ -2152,7 +2144,7 @@ def __init__(self, input_names, **inputs): self._input_names = filename_to_list(input_names) add_traits(self.inputs, [name for name in self._input_names]) - def _list_outputs(self): + def _post_run(self): """Execute this module. """ import MySQLdb @@ -2293,7 +2285,7 @@ def __init__(self, infields=None, outfields=None, **kwargs): ): self.inputs.template += '$' - def _list_outputs(self): + def _post_run(self): try: paramiko except NameError: @@ -2316,7 +2308,7 @@ def _list_outputs(self): outputs = {} for key, args in list(self.inputs.template_args.items()): - setattr(self.outputs, key, [] + setattr(self.outputs, key, []) template = self.inputs.template if hasattr(self.inputs, 'field_template') and \ isdefined(self.inputs.field_template) and \ @@ -2344,7 +2336,7 @@ def _list_outputs(self): else: if self.inputs.sort_filelist: filelist = human_order_sorted(filelist) - setattr(self.outputs, key, list_to_filename(filelist) + setattr(self.outputs, key, list_to_filename(filelist)) if self.inputs.download_files: for f in filelist: sftp.get(f, f) @@ -2393,28 +2385,26 @@ def _list_outputs(self): raise IOError(msg) else: warn(msg) - outputs[key].append(None) + getattr(self.outputs, key).append(None) else: if self.inputs.sort_filelist: outfiles = human_order_sorted(outfiles) - outputs[key].append(list_to_filename(outfiles)) + getattr(self.outputs, key).append(list_to_filename(outfiles)) if self.inputs.download_files: for f in outfiles: try: sftp.get(os.path.join(filledtemplate_dir, f), f) except IOError: iflogger.info('remote file %s not found' % f) - if any([val is None for val in outputs[key]]): - setattr(self.outputs, key, [] - if len(outputs[key]) == 0: - setattr(self.outputs, key, None - elif len(outputs[key]) == 1: - setattr(self.outputs, key, outputs[key][0] + if any([val is None for val in getattr(self.outputs, key)]): + setattr(self.outputs, key, []) + if len(getattr(self.outputs, key)) == 0: + setattr(self.outputs, key, None) + elif len(getattr(self.outputs, key)) == 1: + setattr(self.outputs, key, getattr(self.outputs, key)[0]) for k, v in list(outputs.items()): - setattr(self.outputs, k, os.path.join(os.getcwd(), v) - - return outputs + setattr(self.outputs, k, os.path.join(os.getcwd(), v)) def _get_ssh_client(self): config = paramiko.SSHConfig() @@ -2468,7 +2458,7 @@ class JSONFileGrabber(IOBase): output_spec = DynamicTraitedSpec _always_run = True - def _list_outputs(self): + def _post_run(self): import simplejson outputs = {} @@ -2480,15 +2470,13 @@ def _list_outputs(self): raise RuntimeError('JSON input has no dictionary structure') for key, value in data.items(): - setattr(self.outputs, key, value + setattr(self.outputs, key, value) if isdefined(self.inputs.defaults): defaults = self.inputs.defaults for key, value in defaults.items(): if key not in list(outputs.keys()): - setattr(self.outputs, key, value - - return outputs + setattr(self.outputs, key, value) class JSONFileSinkInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): @@ -2501,10 +2489,10 @@ def __setattr__(self, key, value): if key not in self.copyable_trait_names(): if not isdefined(value): super(JSONFileSinkInputSpec, self).__setattr__(key, value) - self._setattr(self.outputs, key, value + self._outputs[key] = value else: if key in self._outputs: - self._setattr(self.outputs, key, value + self._outputs[key] = value super(JSONFileSinkInputSpec, self).__setattr__(key, value) @@ -2551,7 +2539,7 @@ def __init__(self, infields=[], force_run=True, **inputs): undefined_traits = {} for key in infields: self.inputs.add_trait(key, traits.Any) - self.inputs._setattr(self.outputs, key, Undefined + self.inputs._setattr(self.outputs, key, Undefined) undefined_traits[key] = Undefined self.inputs.trait_set(trait_change_notify=False, **undefined_traits) @@ -2570,7 +2558,7 @@ def _process_name(self, name, val): return name, val - def _list_outputs(self): + def _post_run(self): import simplejson import os.path as op @@ -2590,6 +2578,5 @@ def _list_outputs(self): with open(out_file, 'w') as f: simplejson.dump(out_dict, f) - + self.outputs.out_file = out_file - return outputs diff --git a/nipype/interfaces/utility.py b/nipype/interfaces/utility.py index ad8bfad113..82421b86f4 100644 --- a/nipype/interfaces/utility.py +++ b/nipype/interfaces/utility.py @@ -23,7 +23,7 @@ from .traits_extension import traits, Undefined, File, isdefined from .base import BaseInterface -from .specs import (TraitedSpec, DynamicTraitedSpec, +from .specs import (TraitedSpec, DynamicTraitedSpec, BaseInterfaceInputSpec, InputMultiPath, OutputMultiPath) from .io import IOBase, add_traits @@ -85,7 +85,7 @@ def _add_output_traits(self, base): base.trait_set(trait_change_notify=False, **undefined_traits) return base - def _list_outputs(self): + def _post_run(self): # manual mandatory inputs check if self._fields and self._mandatory_inputs: for key in self._fields: @@ -96,11 +96,10 @@ def _list_outputs(self): (self.__class__.__name__, key) raise ValueError(msg) - for key in self._fields: + for key in self._fields: val = getattr(self.inputs, key) if isdefined(val): - setattr(self.outputs, key, val - return outputs + setattr(self.outputs, key, val) class MergeInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): @@ -137,8 +136,8 @@ def __init__(self, numinputs=0, **inputs): self._numinputs = numinputs add_traits(self.inputs, ['in%d' % (i + 1) for i in range(numinputs)]) - def _list_outputs(self): - out = [] + def _post_run(self): + out = [] if self.inputs.axis == 'vstack': for idx in range(self._numinputs): value = getattr(self.inputs, 'in%d' % (idx + 1)) @@ -154,7 +153,6 @@ def _list_outputs(self): out[i].append(filename_to_list(getattr(self.inputs, 'in%d' % (j + 1)))[i]) if out: self.outputs.out = out - return outputs class RenameInputSpec(DynamicTraitedSpec): @@ -257,9 +255,8 @@ def _run_interface(self, runtime): self._rename())) return runtime - def _list_outputs(self): - self.outputs.out_file = os.path.join(os.getcwd(), self._rename()) - return outputs + def _post_run(self): + self.outputs.out_file = os.path.join(os.getcwd(), self._rename()) class SplitInputSpec(BaseInterfaceInputSpec): @@ -298,8 +295,8 @@ def _add_output_traits(self, base): base.trait_set(trait_change_notify=False, **undefined_traits) return base - def _list_outputs(self): - if isdefined(self.inputs.splits): + def _post_run(self): + if isdefined(self.inputs.splits): if sum(self.inputs.splits) != len(self.inputs.inlist): raise RuntimeError('sum of splits != num of list elements') splits = [0] @@ -309,8 +306,7 @@ def _list_outputs(self): val = np.array(self.inputs.inlist)[splits[i]:splits[i + 1]].tolist() if self.inputs.squeeze and len(val) == 1: val = val[0] - outputs['out%d' % (i + 1)] = val - return outputs + setattr(self.outputs, 'out%d' % (i + 1), val) class SelectInputSpec(BaseInterfaceInputSpec): @@ -347,11 +343,8 @@ class Select(IOBase): input_spec = SelectInputSpec output_spec = SelectOutputSpec - def _list_outputs(self): - out = np.array(self.inputs.inlist)[np.array(self.inputs.index)].tolist() - self.outputs.out = out - return outputs - + def _post_run(self): + self.outputs.out = np.array(self.inputs.inlist)[np.array(self.inputs.index)].tolist() class FunctionInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): function_str = traits.Str(mandatory=True, desc='code for function') @@ -460,10 +453,9 @@ def _run_interface(self, runtime): return runtime - def _list_outputs(self): - for key in self._output_names: - setattr(self.outputs, key, self._out[key] - return outputs + def _post_run(self): + for key in self._output_names: + setattr(self.outputs, key, self._out[key]) class AssertEqualInputSpec(BaseInterfaceInputSpec): @@ -523,7 +515,6 @@ class CSVReader(BaseInterface): def _append_entry(self, outputs, entry): for key, value in zip(self._outfields, entry): outputs[key].append(value) - return outputs def _parse_line(self, line): line = line.replace('\n', '') @@ -549,11 +540,10 @@ def _outputs(self): def _add_output_traits(self, base): return add_traits(base, self._get_outfields()) - def _list_outputs(self): - + def _post_run(self): isHeader = True for key in self._outfields: - setattr(self.outputs, key, [] # initialize outfields + setattr(self.outputs, key, []) # initialize outfields with open(self.inputs.in_file, 'r') as fid: for line in fid.readlines(): if self.inputs.header and isHeader: # skip header line @@ -561,4 +551,3 @@ def _list_outputs(self): continue entry = self._parse_line(line) outputs = self._append_entry(outputs, entry) - return outputs From 303945d575129b2b0d73955b2345eadbe1d9c4dd Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 17 Feb 2016 09:43:06 -0800 Subject: [PATCH 30/73] revert back changes in utils --- nipype/pipeline/engine/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nipype/pipeline/engine/utils.py b/nipype/pipeline/engine/utils.py index df7fce7d96..4ed3209f0c 100644 --- a/nipype/pipeline/engine/utils.py +++ b/nipype/pipeline/engine/utils.py @@ -329,7 +329,7 @@ def _get_valid_pathstr(pathstr): Replaces: ',' -> '.' """ pathstr = pathstr.replace(os.sep, '..') - pathstr = re.sub(r"""[][ (){}?:<>#!|"';]""", '', pathstr) + pathstr = re.sub(r'''[][ (){}?:<>#!|"';]''', '', pathstr) pathstr = pathstr.replace(',', '.') return pathstr @@ -618,7 +618,7 @@ def _node_ports(graph, node): else: srcport = src if srcport not in portoutputs: - portsetattr(self.outputs, srcport, [] + portoutputs[srcport] = [] portoutputs[srcport].append((v, dest, src)) return (portinputs, portoutputs) @@ -1238,7 +1238,7 @@ def write_workflow_prov(graph, filename=None, format='all'): for key, value in list(result.outputs.items()): values = getattr(result.outputs, key) if isdefined(values) and idx < len(values): - subresult.setattr(self.outputs, key, values[idx] + subresult.outputs[key] = values[idx] sub_doc = ProvStore().add_results(subresult) sub_bundle = pm.ProvBundle(sub_doc.get_records(), identifier=get_id()) From cd828e798d81270541a67d4247c0276ca7a367f2 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 17 Feb 2016 09:59:08 -0800 Subject: [PATCH 31/73] correct wrongly indented _list_outputs --- nipype/interfaces/ants/legacy.py | 8 ++--- nipype/interfaces/ants/registration.py | 8 ++--- nipype/interfaces/ants/resampling.py | 12 +++---- nipype/interfaces/ants/segmentation.py | 28 +++++++-------- nipype/interfaces/ants/utils.py | 16 ++++----- nipype/interfaces/ants/visualization.py | 8 ++--- nipype/interfaces/cmtk/cmtk.py | 8 ++--- nipype/interfaces/cmtk/convert.py | 8 ++--- nipype/interfaces/cmtk/parcellation.py | 4 +-- nipype/interfaces/dcmstack.py | 24 ++++++------- nipype/interfaces/dipy/preprocess.py | 8 ++--- nipype/interfaces/dipy/reconstruction.py | 12 +++---- nipype/interfaces/dipy/simulate.py | 4 +-- nipype/interfaces/dipy/tracks.py | 8 ++--- nipype/interfaces/elastix/registration.py | 12 +++---- nipype/interfaces/freesurfer/model.py | 4 +-- nipype/interfaces/freesurfer/utils.py | 24 ++++++------- nipype/interfaces/fsl/model.py | 32 ++++++++--------- nipype/interfaces/fsl/utils.py | 24 ++++++------- nipype/interfaces/mrtrix/convert.py | 4 +-- nipype/interfaces/nipy/model.py | 8 ++--- nipype/interfaces/nipy/preprocess.py | 12 +++---- nipype/interfaces/nipy/utils.py | 4 +-- nipype/interfaces/spm/model.py | 20 +++++------ nipype/interfaces/spm/preprocess.py | 36 +++++++++---------- nipype/interfaces/spm/utils.py | 20 +++++------ nipype/pipeline/engine/tests/test_join.py | 8 ++--- nipype/pipeline/engine/tests/test_utils.py | 4 +-- nipype/pipeline/plugins/tests/test_debug.py | 4 +-- nipype/pipeline/plugins/tests/test_linear.py | 4 +-- .../pipeline/plugins/tests/test_multiproc.py | 4 +-- nipype/pipeline/plugins/tests/test_oar.py | 4 +-- nipype/pipeline/plugins/tests/test_pbs.py | 4 +-- .../pipeline/plugins/tests/test_somaflow.py | 4 +-- 34 files changed, 196 insertions(+), 196 deletions(-) diff --git a/nipype/interfaces/ants/legacy.py b/nipype/interfaces/ants/legacy.py index e9198ff4d9..b1c35ee4ac 100644 --- a/nipype/interfaces/ants/legacy.py +++ b/nipype/interfaces/ants/legacy.py @@ -95,8 +95,8 @@ class antsIntroduction(ANTSCommand): input_spec = antsIntroductionInputSpec output_spec = antsIntroductionOutputSpec - def _list_outputs(self): - transmodel = self.inputs.transformation_model + def _post_run(self): + transmodel = self.inputs.transformation_model # When transform is set as 'RI'/'RA', wrap fields should not be expected # The default transformation is GR, which outputs the wrap fields @@ -226,8 +226,8 @@ def _format_arg(self, opt, spec, val): return start + ' '.join(name for name in val) return super(buildtemplateparallel, self)._format_arg(opt, spec, val) - def _list_outputs(self): - self.outputs.template_files = [] + def _post_run(self): + self.outputs.template_files = [] for i in range(len(glob(os.path.realpath('*iteration*')))): temp = os.path.realpath('%s_iteration_%d/%stemplate.nii.gz' % (self.inputs.transformation_model, diff --git a/nipype/interfaces/ants/registration.py b/nipype/interfaces/ants/registration.py index 36bf67a4d4..30d4e250a7 100644 --- a/nipype/interfaces/ants/registration.py +++ b/nipype/interfaces/ants/registration.py @@ -202,8 +202,8 @@ def _format_arg(self, opt, spec, val): return '--use-Histogram-Matching 0' return super(ANTS, self)._format_arg(opt, spec, val) - def _list_outputs(self): - self.outputs.affine_transform = os.path.abspath( + def _post_run(self): + self.outputs.affine_transform = os.path.abspath( self.inputs.output_transform_prefix + 'Affine.txt') self.outputs.warp_transform = os.path.abspath( self.inputs.output_transform_prefix + 'Warp.nii.gz') @@ -876,8 +876,8 @@ def _output_filenames(self, prefix, count, transform, inverse=False): suffix = 'Warp.nii.gz' return '%s%d%s' % (prefix, count, suffix), inverse_mode - def _list_outputs(self): - self.outputs.forward_transforms = [] + def _post_run(self): + self.outputs.forward_transforms = [] self.outputs.forward_invert_flags = [] self.outputs.reverse_transforms = [] self.outputs.reverse_invert_flags = [] diff --git a/nipype/interfaces/ants/resampling.py b/nipype/interfaces/ants/resampling.py index a2fa1f32a5..4cbd333ef6 100644 --- a/nipype/interfaces/ants/resampling.py +++ b/nipype/interfaces/ants/resampling.py @@ -90,8 +90,8 @@ def _format_arg(self, opt, spec, val): return ' '.join(series) return super(WarpTimeSeriesImageMultiTransform, self)._format_arg(opt, spec, val) - def _list_outputs(self): - _, name, ext = split_filename(os.path.abspath(self.inputs.input_image)) + def _post_run(self): + _, name, ext = split_filename(os.path.abspath(self.inputs.input_image)) self.outputs.output_image = os.path.join(os.getcwd(), ''.join((name, self.inputs.out_postfix, @@ -198,8 +198,8 @@ def _format_arg(self, opt, spec, val): return ' '.join(series) return super(WarpImageMultiTransform, self)._format_arg(opt, spec, val) - def _list_outputs(self): - if isdefined(self.inputs.output_image): + def _post_run(self): + if isdefined(self.inputs.output_image): self.outputs.output_image = os.path.abspath(self.inputs.output_image) else: self.outputs.output_image = os.path.abspath( @@ -347,8 +347,8 @@ def _format_arg(self, opt, spec, val): return '--interpolation %s' % self.inputs.interpolation return super(ApplyTransforms, self)._format_arg(opt, spec, val) - def _list_outputs(self): - self.outputs.output_image = os.path.abspath( + def _post_run(self): + self.outputs.output_image = os.path.abspath( self._gen_filename('output_image')) return outputs diff --git a/nipype/interfaces/ants/segmentation.py b/nipype/interfaces/ants/segmentation.py index 423d323725..c0e4dc5da8 100644 --- a/nipype/interfaces/ants/segmentation.py +++ b/nipype/interfaces/ants/segmentation.py @@ -162,8 +162,8 @@ def _gen_filename(self, name): return output return None - def _list_outputs(self): - self.outputs.classified_image = os.path.abspath( + def _post_run(self): + self.outputs.classified_image = os.path.abspath( self._gen_filename('out_classified_image_name')) if isdefined(self.inputs.save_posteriors) and self.inputs.save_posteriors: self.outputs.posteriors = [] @@ -223,8 +223,8 @@ def _gen_filename(self, name): return output return None - def _list_outputs(self): - _, name, ext = split_filename(os.path.abspath(self.inputs.input_wm)) + def _post_run(self): + _, name, ext = split_filename(os.path.abspath(self.inputs.input_wm)) self.outputs.output_image = os.path.join(os.getcwd(), ''.join((name, self.inputs.output_image, @@ -369,8 +369,8 @@ def _parse_inputs(self, skip=None): skip += ['save_bias', 'bias_image'] return super(N4BiasFieldCorrection, self)._parse_inputs(skip=skip) - def _list_outputs(self): - self.outputs.output_image = os.path.abspath( + def _post_run(self): + self.outputs.output_image = os.path.abspath( self._gen_filename('output_image')) if self.inputs.save_bias or isdefined(self.inputs.bias_image): @@ -542,8 +542,8 @@ def _run_interface(self, runtime, correct_return_codes=[0]): runtime = super(CorticalThickness, self)._run_interface(runtime) return runtime - def _list_outputs(self): - self.outputs.BrainExtractionMask = os.path.join(os.getcwd(), + def _post_run(self): + self.outputs.BrainExtractionMask = os.path.join(os.getcwd(), self.inputs.out_prefix + 'BrainExtractionMask.' + self.inputs.image_suffix) @@ -667,8 +667,8 @@ class BrainExtraction(ANTSCommand): output_spec = BrainExtractionOutputSpec _cmd = 'antsBrainExtraction.sh' - def _list_outputs(self): - self.outputs.BrainExtractionMask = os.path.join(os.getcwd(), + def _post_run(self): + self.outputs.BrainExtractionMask = os.path.join(os.getcwd(), self.inputs.out_prefix + 'BrainExtractionMask.' + self.inputs.image_suffix) @@ -785,8 +785,8 @@ def _format_arg(self, opt, spec, val): return super(ANTSCommand, self)._format_arg(opt, spec, val) return retval - def _list_outputs(self): - self.outputs.output_label_image = os.path.abspath( + def _post_run(self): + self.outputs.output_label_image = os.path.abspath( self.inputs.output_label_image) return outputs @@ -1045,8 +1045,8 @@ def _format_arg(self, opt, spec, val): return super(ANTSCommand, self)._format_arg(opt, spec, val) return retval - def _list_outputs(self): - if isdefined(self.inputs.out_label_fusion): + def _post_run(self): + if isdefined(self.inputs.out_label_fusion): outputs['out_label_fusion'] = os.path.abspath( self.inputs.out_label_fusion) if isdefined(self.inputs.out_intensity_fusion_name_format): diff --git a/nipype/interfaces/ants/utils.py b/nipype/interfaces/ants/utils.py index 8cad0cf8ac..66dc532532 100644 --- a/nipype/interfaces/ants/utils.py +++ b/nipype/interfaces/ants/utils.py @@ -45,8 +45,8 @@ class AverageAffineTransform(ANTSCommand): def _format_arg(self, opt, spec, val): return super(AverageAffineTransform, self)._format_arg(opt, spec, val) - def _list_outputs(self): - self.outputs.affine_transform = os.path.abspath( + def _post_run(self): + self.outputs.affine_transform = os.path.abspath( self.inputs.output_affine_transform) return outputs @@ -86,8 +86,8 @@ class AverageImages(ANTSCommand): def _format_arg(self, opt, spec, val): return super(AverageImages, self)._format_arg(opt, spec, val) - def _list_outputs(self): - self.outputs.output_average_image = os.path.realpath( + def _post_run(self): + self.outputs.output_average_image = os.path.realpath( self.inputs.output_average_image) return outputs @@ -126,8 +126,8 @@ class MultiplyImages(ANTSCommand): def _format_arg(self, opt, spec, val): return super(MultiplyImages, self)._format_arg(opt, spec, val) - def _list_outputs(self): - self.outputs.output_product_image = os.path.abspath( + def _post_run(self): + self.outputs.output_product_image = os.path.abspath( self.inputs.output_product_image) return outputs @@ -184,8 +184,8 @@ def _gen_filename(self, name): return output return None - def _list_outputs(self): - if self.inputs.use_log == 1: + def _post_run(self): + if self.inputs.use_log == 1: self.outputs.jacobian_image = os.path.abspath( self._gen_filename('output_prefix') + 'logjacobian.nii.gz') else: diff --git a/nipype/interfaces/ants/visualization.py b/nipype/interfaces/ants/visualization.py index b4ef3eb27a..c4e66f9c53 100644 --- a/nipype/interfaces/ants/visualization.py +++ b/nipype/interfaces/ants/visualization.py @@ -64,8 +64,8 @@ class ConvertScalarImageToRGB(ANTSCommand): def _format_arg(self, opt, spec, val): return super(ConvertScalarImageToRGB, self)._format_arg(opt, spec, val) - def _list_outputs(self): - self.outputs.output_image = os.path.join(os.getcwd(), + def _post_run(self): + self.outputs.output_image = os.path.join(os.getcwd(), self.inputs.output_image) return outputs @@ -148,7 +148,7 @@ class CreateTiledMosaic(ANTSCommand): input_spec = CreateTiledMosaicInputSpec output_spec = CreateTiledMosaicOutputSpec - def _list_outputs(self): - self.outputs.output_image = os.path.join(os.getcwd(), + def _post_run(self): + self.outputs.output_image = os.path.join(os.getcwd(), self.inputs.output_image) return outputs diff --git a/nipype/interfaces/cmtk/cmtk.py b/nipype/interfaces/cmtk/cmtk.py index 42501f94dc..ad9fca76ad 100644 --- a/nipype/interfaces/cmtk/cmtk.py +++ b/nipype/interfaces/cmtk/cmtk.py @@ -718,8 +718,8 @@ def _run_interface(self, runtime): file.close() return runtime - def _list_outputs(self): - if isdefined(self.inputs.out_roi_file): + def _post_run(self): + if isdefined(self.inputs.out_roi_file): self.outputs.roi_file = op.abspath(self.inputs.out_roi_file) else: self.outputs.roi_file = op.abspath(self._gen_outfilename('nii')) @@ -788,6 +788,6 @@ def _run_interface(self, runtime): iflogger.info('Saving node network to {path}'.format(path=op.abspath(self.inputs.out_filename))) return runtime - def _list_outputs(self): - self.outputs.node_network = op.abspath(self.inputs.out_filename) + def _post_run(self): + self.outputs.node_network = op.abspath(self.inputs.out_filename) return outputs diff --git a/nipype/interfaces/cmtk/convert.py b/nipype/interfaces/cmtk/convert.py index b086638b22..86a699eabf 100644 --- a/nipype/interfaces/cmtk/convert.py +++ b/nipype/interfaces/cmtk/convert.py @@ -197,8 +197,8 @@ def _run_interface(self, runtime): return runtime - def _list_outputs(self): - _, name, ext = split_filename(self.inputs.out_file) + def _post_run(self): + _, name, ext = split_filename(self.inputs.out_file) if not ext == '.cff': ext = '.cff' self.outputs.connectome_file = op.abspath(name + ext) @@ -258,8 +258,8 @@ def _run_interface(self, runtime): return runtime - def _list_outputs(self): - _, name, ext = split_filename(self.inputs.out_file) + def _post_run(self): + _, name, ext = split_filename(self.inputs.out_file) if not ext == '.cff': ext = '.cff' self.outputs.connectome_file = op.abspath(name + ext) diff --git a/nipype/interfaces/cmtk/parcellation.py b/nipype/interfaces/cmtk/parcellation.py index 5b46f8032d..4fdfe10050 100644 --- a/nipype/interfaces/cmtk/parcellation.py +++ b/nipype/interfaces/cmtk/parcellation.py @@ -581,8 +581,8 @@ def _run_interface(self, runtime): crop_and_move_datasets(self.inputs.subject_id, self.inputs.subjects_dir, self.inputs.freesurfer_dir, self.inputs.parcellation_name, self.inputs.out_roi_file, self.inputs.dilation) return runtime - def _list_outputs(self): - if isdefined(self.inputs.out_roi_file): + def _post_run(self): + if isdefined(self.inputs.out_roi_file): self.outputs.roi_file = op.abspath(self.inputs.out_roi_file) else: self.outputs.roi_file = op.abspath( diff --git a/nipype/interfaces/dcmstack.py b/nipype/interfaces/dcmstack.py index 9a850018df..cb8b85f532 100644 --- a/nipype/interfaces/dcmstack.py +++ b/nipype/interfaces/dcmstack.py @@ -161,8 +161,8 @@ def _run_interface(self, runtime): nb.save(nii, self.out_path) return runtime - def _list_outputs(self): - self.outputs.out_file = self.out_path + def _post_run(self): + self.outputs.out_file = self.out_path return outputs @@ -192,8 +192,8 @@ def _run_interface(self, runtime): return runtime - def _list_outputs(self): - self.outputs.out_list = self.out_list + def _post_run(self): + self.outputs.out_list = self.out_list return outputs @@ -261,8 +261,8 @@ def _run_interface(self, runtime): return runtime - def _list_outputs(self): - outputs.update(self.result) + def _post_run(self): + outputs.update(self.result) return outputs @@ -317,8 +317,8 @@ def _run_interface(self, runtime): return runtime - def _list_outputs(self): - self.outputs.dest_file = self.out_path + def _post_run(self): + self.outputs.dest_file = self.out_path return outputs @@ -374,8 +374,8 @@ def _run_interface(self, runtime): nb.save(merged.nii_img, self.out_path) return runtime - def _list_outputs(self): - self.outputs.out_file = self.out_path + def _post_run(self): + self.outputs.out_file = self.out_path return outputs @@ -415,6 +415,6 @@ def _run_interface(self, runtime): return runtime - def _list_outputs(self): - self.outputs.out_list = self.out_list + def _post_run(self): + self.outputs.out_list = self.out_list return outputs diff --git a/nipype/interfaces/dipy/preprocess.py b/nipype/interfaces/dipy/preprocess.py index c1322d85e6..54490dbb4c 100644 --- a/nipype/interfaces/dipy/preprocess.py +++ b/nipype/interfaces/dipy/preprocess.py @@ -66,8 +66,8 @@ def _run_interface(self, runtime): IFLOGGER.info('Resliced image saved as {i}'.format(i=out_file)) return runtime - def _list_outputs(self): - self.outputs.out_file = op.abspath(self._gen_outfilename()) + def _post_run(self): + self.outputs.out_file = op.abspath(self._gen_outfilename()) return outputs def _gen_outfilename(self): @@ -157,8 +157,8 @@ def _run_interface(self, runtime): 'SNR={s}').format(i=out_file, s=str(s))) return runtime - def _list_outputs(self): - self.outputs.out_file = op.abspath(self._gen_outfilename()) + def _post_run(self): + self.outputs.out_file = op.abspath(self._gen_outfilename()) return outputs def _gen_outfilename(self): diff --git a/nipype/interfaces/dipy/reconstruction.py b/nipype/interfaces/dipy/reconstruction.py index 9c320c5f5c..7a5283fbf3 100644 --- a/nipype/interfaces/dipy/reconstruction.py +++ b/nipype/interfaces/dipy/reconstruction.py @@ -144,8 +144,8 @@ def _run_interface(self, runtime): return runtime - def _list_outputs(self): - for k in outputs.keys(): + def _post_run(self): + for k in outputs.keys(): outputs[k] = self._gen_filename(k) return outputs @@ -265,8 +265,8 @@ def _run_interface(self, runtime): None).to_filename(op.abspath(self.inputs.out_mask)) return runtime - def _list_outputs(self): - outputs['response'] = op.abspath(self.inputs.response) + def _post_run(self): + outputs['response'] = op.abspath(self.inputs.response) outputs['out_mask'] = op.abspath(self.inputs.out_mask) return outputs @@ -358,8 +358,8 @@ def _run_interface(self, runtime): return runtime - def _list_outputs(self): - outputs['model'] = self._gen_filename('csdmodel', ext='.pklz') + def _post_run(self): + outputs['model'] = self._gen_filename('csdmodel', ext='.pklz') if self.inputs.save_fods: outputs['out_fods'] = self._gen_filename('fods') return outputs diff --git a/nipype/interfaces/dipy/simulate.py b/nipype/interfaces/dipy/simulate.py index 76ce415be0..ea4e4a357f 100644 --- a/nipype/interfaces/dipy/simulate.py +++ b/nipype/interfaces/dipy/simulate.py @@ -246,8 +246,8 @@ def _run_interface(self, runtime): return runtime - def _list_outputs(self): - self.outputs.out_file = op.abspath(self.inputs.out_file) + def _post_run(self): + self.outputs.out_file = op.abspath(self.inputs.out_file) self.outputs.out_mask = op.abspath(self.inputs.out_mask) self.outputs.out_bvec = op.abspath(self.inputs.out_bvec) self.outputs.out_bval = op.abspath(self.inputs.out_bval) diff --git a/nipype/interfaces/dipy/tracks.py b/nipype/interfaces/dipy/tracks.py index a849b05cc9..047dd3f449 100644 --- a/nipype/interfaces/dipy/tracks.py +++ b/nipype/interfaces/dipy/tracks.py @@ -97,8 +97,8 @@ def _run_interface(self, runtime): return runtime - def _list_outputs(self): - self.outputs.out_file = op.abspath(self.inputs.out_filename) + def _post_run(self): + self.outputs.out_file = op.abspath(self.inputs.out_filename) return outputs @@ -271,8 +271,8 @@ def _run_interface(self, runtime): trkfilev.to_file(self._gen_filename('tracked', ext='.trk')) return runtime - def _list_outputs(self): - outputs['tracks'] = self._gen_filename('tracked', ext='.trk') + def _post_run(self): + outputs['tracks'] = self._gen_filename('tracked', ext='.trk') outputs['gfa'] = self._gen_filename('gfa') if self._save_peaks: outputs['odf_peaks'] = self._gen_filename('peaks', ext='.pklz') diff --git a/nipype/interfaces/elastix/registration.py b/nipype/interfaces/elastix/registration.py index 00baf6f19c..09145302a3 100644 --- a/nipype/interfaces/elastix/registration.py +++ b/nipype/interfaces/elastix/registration.py @@ -156,8 +156,8 @@ class ApplyWarp(CommandLine): input_spec = ApplyWarpInputSpec output_spec = ApplyWarpOutputSpec - def _list_outputs(self): - out_dir = op.abspath(self.inputs.output_path) + def _post_run(self): + out_dir = op.abspath(self.inputs.output_path) self.outputs.warped_file = op.join(out_dir, 'result.nii.gz') return outputs @@ -195,8 +195,8 @@ class AnalyzeWarp(CommandLine): input_spec = AnalyzeWarpInputSpec output_spec = AnalyzeWarpOutputSpec - def _list_outputs(self): - out_dir = op.abspath(self.inputs.output_path) + def _post_run(self): + out_dir = op.abspath(self.inputs.output_path) self.outputs.disp_field = op.join(out_dir, 'deformationField.nii.gz') self.outputs.jacdet_map = op.join(out_dir, 'spatialJacobian.nii.gz') self.outputs.jacmat_map = op.join(out_dir, 'fullSpatialJacobian.nii.gz') @@ -235,8 +235,8 @@ class PointsWarp(CommandLine): input_spec = PointsWarpInputSpec output_spec = PointsWarpOutputSpec - def _list_outputs(self): - out_dir = op.abspath(self.inputs.output_path) + def _post_run(self): + out_dir = op.abspath(self.inputs.output_path) fname, ext = op.splitext(op.basename(self.inputs.points_file)) diff --git a/nipype/interfaces/freesurfer/model.py b/nipype/interfaces/freesurfer/model.py index 1baf8ecd94..7cdab5a5d2 100644 --- a/nipype/interfaces/freesurfer/model.py +++ b/nipype/interfaces/freesurfer/model.py @@ -831,8 +831,8 @@ class MS_LDA(FSCommand): input_spec = MS_LDAInputSpec output_spec = MS_LDAOutputSpec - def _list_outputs(self): - if isdefined(self.inputs.output_synth): + def _post_run(self): + if isdefined(self.inputs.output_synth): self.outputs.vol_synth_file = os.path.abspath(self.inputs.output_synth) else: self.outputs.vol_synth_file = os.path.abspath(self.inputs.vol_synth_file) diff --git a/nipype/interfaces/freesurfer/utils.py b/nipype/interfaces/freesurfer/utils.py index f5d50b012b..222956ffa0 100644 --- a/nipype/interfaces/freesurfer/utils.py +++ b/nipype/interfaces/freesurfer/utils.py @@ -198,8 +198,8 @@ def _get_outfilename(self, opt="out_file"): use_ext=False) return outfile - def _list_outputs(self): - self.outputs.out_file = os.path.abspath(self._get_outfilename()) + def _post_run(self): + self.outputs.out_file = os.path.abspath(self._get_outfilename()) hitsfile = self.inputs.hits_file if isdefined(hitsfile): self.outputs.hits_file = hitsfile @@ -272,8 +272,8 @@ class SurfaceSmooth(FSCommand): input_spec = SurfaceSmoothInputSpec output_spec = SurfaceSmoothOutputSpec - def _list_outputs(self): - self.outputs.out_file = self.inputs.out_file + def _post_run(self): + self.outputs.out_file = self.inputs.out_file if not isdefined(self.outputs.out_file): in_file = self.inputs.in_file if isdefined(self.inputs.fwhm): @@ -349,8 +349,8 @@ class SurfaceTransform(FSCommand): input_spec = SurfaceTransformInputSpec output_spec = SurfaceTransformOutputSpec - def _list_outputs(self): - self.outputs.out_file = self.inputs.out_file + def _post_run(self): + self.outputs.out_file = self.inputs.out_file if not isdefined(self.outputs.out_file): if isdefined(self.inputs.source_file): source = self.inputs.source_file @@ -482,8 +482,8 @@ class ApplyMask(FSCommand): input_spec = ApplyMaskInputSpec output_spec = ApplyMaskOutputSpec - def _list_outputs(self): - self.outputs.out_file = self.inputs.out_file + def _post_run(self): + self.outputs.out_file = self.inputs.out_file if not isdefined(self.outputs.out_file): self.outputs.out_file = fname_presuffix(self.inputs.in_file, suffix="_masked", @@ -687,8 +687,8 @@ def _write_tcl_script(self): fid.write("\n".join(script)) fid.close() - def _list_outputs(self): - if not isdefined(self.inputs.screenshot_stem): + def _post_run(self): + if not isdefined(self.inputs.screenshot_stem): stem = "%s_%s_%s" % (self.inputs.subject_id, self.inputs.hemi, self.inputs.surface) else: stem = self.inputs.screenshot_stem @@ -1280,8 +1280,8 @@ class Tkregister2(FSCommand): input_spec = Tkregister2InputSpec output_spec = Tkregister2OutputSpec - def _list_outputs(self): - self.outputs.reg_file = os.path.abspath(self.inputs.reg_file) + def _post_run(self): + self.outputs.reg_file = os.path.abspath(self.inputs.reg_file) if isdefined(self.inputs.fsl_out): self.outputs.fsl_file = os.path.abspath(self.inputs.fsl_out) return outputs diff --git a/nipype/interfaces/fsl/model.py b/nipype/interfaces/fsl/model.py index 97b91d9358..38e3c0cbe7 100644 --- a/nipype/interfaces/fsl/model.py +++ b/nipype/interfaces/fsl/model.py @@ -387,8 +387,8 @@ class FEAT(FSLCommand): input_spec = FEATInputSpec output_spec = FEATOutputSpec - def _list_outputs(self): - is_ica = False + def _post_run(self): + is_ica = False self.outputs.feat_dir = None with open(self.inputs.fsf_file, 'rt') as fp: text = fp.read() @@ -691,8 +691,8 @@ def _get_numcons(self): fp.close() return numtcons, numfcons - def _list_outputs(self): - cwd = os.getcwd() + def _post_run(self): + cwd = os.getcwd() results_dir = os.path.join(cwd, self.inputs.results_dir) self.outputs.results_dir = results_dir pe_files = self._get_pe_files(results_dir) @@ -790,8 +790,8 @@ def _run_interface(self, runtime): return runtime - def _list_outputs(self): - self.outputs.fsf_file = os.path.abspath( + def _post_run(self): + self.outputs.fsf_file = os.path.abspath( os.path.join(os.getcwd(), 'register.fsf')) return outputs @@ -904,8 +904,8 @@ def _run_interface(self, runtime): # ohinds: 2010-04-06 # made these compatible with flameo - def _list_outputs(self): - pth = os.path.join(os.getcwd(), self.inputs.log_dir) + def _post_run(self): + pth = os.path.join(os.getcwd(), self.inputs.log_dir) pes = human_order_sorted(glob(os.path.join(pth, 'pe[0-9]*.*'))) assert len(pes) >= 1, 'No pe volumes generated by FSL Estimate' @@ -1058,8 +1058,8 @@ def _get_numcons(self): fp.close() return numtcons, numfcons - def _list_outputs(self): - pth, _ = os.path.split(self.inputs.sigmasquareds) + def _post_run(self): + pth, _ = os.path.split(self.inputs.sigmasquareds) numtcons, numfcons = self._get_numcons() base_contrast = 1 if isdefined(self.inputs.contrast_num): @@ -1168,8 +1168,8 @@ def _run_interface(self, runtime): return runtime - def _list_outputs(self): - for field in list(outputs.keys()): + def _post_run(self): + for field in list(outputs.keys()): setattr(self.outputs, field, os.path.join(os.getcwd(), field.replace('_', '.')) return outputs @@ -1326,8 +1326,8 @@ def _run_interface(self, runtime): return runtime - def _list_outputs(self): - nfcons = sum([1 for con in self.inputs.contrasts if con[1] == 'F']) + def _post_run(self): + nfcons = sum([1 for con in self.inputs.contrasts if con[1] == 'F']) for field in list(outputs.keys()): if ('fts' in field) and (nfcons == 0): continue @@ -1362,8 +1362,8 @@ class SMM(FSLCommand): input_spec = SMMInputSpec output_spec = SMMOutputSpec - def _list_outputs(self): - # TODO get the true logdir from the stdout + def _post_run(self): + # TODO get the true logdir from the stdout self.outputs.null_p_map = self._gen_fname(basename="w1_mean", cwd="logdir") self.outputs.activation_p_map = self._gen_fname( diff --git a/nipype/interfaces/fsl/utils.py b/nipype/interfaces/fsl/utils.py index cb7ad4bf68..bd151d00f8 100644 --- a/nipype/interfaces/fsl/utils.py +++ b/nipype/interfaces/fsl/utils.py @@ -752,8 +752,8 @@ def _format_arg(self, name, spec, value): self.inputs.stat_thresh[1] * -1) return super(Overlay, self)._format_arg(name, spec, value) - def _list_outputs(self): - out_file = self.inputs.out_file + def _post_run(self): + out_file = self.inputs.out_file if not isdefined(out_file): if isdefined(self.inputs.stat_image2) and ( not isdefined(self.inputs.show_negative_stats) or not @@ -860,8 +860,8 @@ def _format_arg(self, name, spec, value): return '' return super(Slicer, self)._format_arg(name, spec, value) - def _list_outputs(self): - out_file = self.inputs.out_file + def _post_run(self): + out_file = self.inputs.out_file if not isdefined(out_file): out_file = self._gen_fname(self.inputs.in_file, ext='.png') self.outputs.out_file = os.path.abspath(out_file) @@ -958,8 +958,8 @@ def _format_arg(self, name, spec, value): return "-h %d -w %d" % value return super(PlotTimeSeries, self)._format_arg(name, spec, value) - def _list_outputs(self): - out_file = self.inputs.out_file + def _post_run(self): + out_file = self.inputs.out_file if not isdefined(out_file): if isinstance(self.inputs.in_file, list): infile = self.inputs.in_file[0] @@ -1065,8 +1065,8 @@ def _format_arg(self, name, spec, value): return super(PlotMotionParams, self)._format_arg(name, spec, value) - def _list_outputs(self): - out_file = self.inputs.out_file + def _post_run(self): + out_file = self.inputs.out_file if not isdefined(out_file): if isinstance(self.inputs.in_file, list): infile = self.inputs.in_file[0] @@ -1131,8 +1131,8 @@ class ConvertXFM(FSLCommand): input_spec = ConvertXFMInputSpec output_spec = ConvertXFMOutputSpec - def _list_outputs(self): - outfile = self.inputs.out_file + def _post_run(self): + outfile = self.inputs.out_file if not isdefined(outfile): _, infile1, _ = split_filename(self.inputs.in_file) if self.inputs.invert_xfm: @@ -1192,8 +1192,8 @@ class SwapDimensions(FSLCommand): input_spec = SwapDimensionsInputSpec output_spec = SwapDimensionsOutputSpec - def _list_outputs(self): - self.outputs.out_file = self.inputs.out_file + def _post_run(self): + self.outputs.out_file = self.inputs.out_file if not isdefined(self.inputs.out_file): self.outputs.out_file = self._gen_fname(self.inputs.in_file, suffix='_newdims') diff --git a/nipype/interfaces/mrtrix/convert.py b/nipype/interfaces/mrtrix/convert.py index 36e0a4f970..b203200147 100644 --- a/nipype/interfaces/mrtrix/convert.py +++ b/nipype/interfaces/mrtrix/convert.py @@ -239,8 +239,8 @@ def _run_interface(self, runtime): iflogger.info(trk_header) return runtime - def _list_outputs(self): - self.outputs.out_file = op.abspath(self.inputs.out_filename) + def _post_run(self): + self.outputs.out_file = op.abspath(self.inputs.out_filename) return outputs def _gen_filename(self, name): diff --git a/nipype/interfaces/nipy/model.py b/nipype/interfaces/nipy/model.py index 0a99bdb44f..59c43af7a5 100644 --- a/nipype/interfaces/nipy/model.py +++ b/nipype/interfaces/nipy/model.py @@ -192,8 +192,8 @@ def _run_interface(self, runtime): return runtime - def _list_outputs(self): - self.outputs.beta = self._beta_file + def _post_run(self): + self.outputs.beta = self._beta_file self.outputs.nvbeta = self._nvbeta self.outputs.s2 = self._s2_file self.outputs.dof = self._dof @@ -311,8 +311,8 @@ def _run_interface(self, runtime): return runtime - def _list_outputs(self): - self.outputs.stat_maps = self._stat_maps + def _post_run(self): + self.outputs.stat_maps = self._stat_maps self.outputs.p_maps = self._p_maps self.outputs.z_maps = self._z_maps return outputs diff --git a/nipype/interfaces/nipy/preprocess.py b/nipype/interfaces/nipy/preprocess.py index 08b9430b91..a6b6937702 100644 --- a/nipype/interfaces/nipy/preprocess.py +++ b/nipype/interfaces/nipy/preprocess.py @@ -70,8 +70,8 @@ def _run_interface(self, runtime): return runtime - def _list_outputs(self): - self.outputs.brain_mask = self._brain_mask_path + def _post_run(self): + self.outputs.brain_mask = self._brain_mask_path return outputs @@ -189,8 +189,8 @@ def _run_interface(self, runtime): return runtime - def _list_outputs(self): - self.outputs.out_file = self._out_file_path + def _post_run(self): + self.outputs.out_file = self._out_file_path self.outputs.par_file = self._par_file_path return outputs @@ -319,8 +319,8 @@ def _run_interface(self, runtime): return runtime - def _list_outputs(self): - self.outputs.out_file = self._out_file_path + def _post_run(self): + self.outputs.out_file = self._out_file_path self.outputs.par_file = self._par_file_path return outputs diff --git a/nipype/interfaces/nipy/utils.py b/nipype/interfaces/nipy/utils.py index cc625e6aea..6b707afdcb 100644 --- a/nipype/interfaces/nipy/utils.py +++ b/nipype/interfaces/nipy/utils.py @@ -99,6 +99,6 @@ def _run_interface(self, runtime): return runtime - def _list_outputs(self): - self.outputs.similarity = self._similarity + def _post_run(self): + self.outputs.similarity = self._similarity return outputs diff --git a/nipype/interfaces/spm/model.py b/nipype/interfaces/spm/model.py index a586247710..54b2c54232 100644 --- a/nipype/interfaces/spm/model.py +++ b/nipype/interfaces/spm/model.py @@ -152,8 +152,8 @@ def _make_matlab_command(self, content): postscript = None return super(Level1Design, self)._make_matlab_command(content, postscript=postscript) - def _list_outputs(self): - spm = os.path.join(os.getcwd(), 'SPM.mat') + def _post_run(self): + spm = os.path.join(os.getcwd(), 'SPM.mat') self.outputs.spm_mat_file = spm return outputs @@ -213,8 +213,8 @@ def _parse_inputs(self): einputs[0].update(self.inputs.flags) return einputs - def _list_outputs(self): - pth, _ = os.path.split(self.inputs.spm_mat_file) + def _post_run(self): + pth, _ = os.path.split(self.inputs.spm_mat_file) spm12 = '12' in self.version.split('.')[0] if spm12: mask = os.path.join(pth, 'mask.nii') @@ -382,8 +382,8 @@ def _make_matlab_command(self, _): script += "spm_jobman('run',jobs);" return script - def _list_outputs(self): - pth, _ = os.path.split(self.inputs.spm_mat_file) + def _post_run(self): + pth, _ = os.path.split(self.inputs.spm_mat_file) spm = sio.loadmat(self.inputs.spm_mat_file, struct_as_record=False) con_images = [] spmT_images = [] @@ -587,8 +587,8 @@ def aggregate_outputs(self, runtime=None): setattr(outputs, 'cluster_forming_thr', float(line[len("cluster_forming_thr = "):].strip())) return outputs - def _list_outputs(self): - self.outputs.thresholded_map = self._gen_thresholded_map_filename() + def _post_run(self): + self.outputs.thresholded_map = self._gen_thresholded_map_filename() self.outputs.pre_topo_fdr_map = self._gen_pre_topo_map_filename() return outputs @@ -774,8 +774,8 @@ def _parse_inputs(self): einputs[0]['dir'] = np.array([str(os.getcwd())], dtype=object) return einputs - def _list_outputs(self): - spm = os.path.join(os.getcwd(), 'SPM.mat') + def _post_run(self): + spm = os.path.join(os.getcwd(), 'SPM.mat') self.outputs.spm_mat_file = spm return outputs diff --git a/nipype/interfaces/spm/preprocess.py b/nipype/interfaces/spm/preprocess.py index 5811bd89a3..b1bc4fa323 100644 --- a/nipype/interfaces/spm/preprocess.py +++ b/nipype/interfaces/spm/preprocess.py @@ -97,8 +97,8 @@ def _format_arg(self, opt, spec, val): separate_sessions=True) return super(SliceTiming, self)._format_arg(opt, spec, val) - def _list_outputs(self): - self.outputs.timecorrected_files = [] + def _post_run(self): + self.outputs.timecorrected_files = [] filelist = filename_to_list(self.inputs.in_files) for f in filelist: @@ -206,8 +206,8 @@ def _parse_inputs(self): einputs = super(Realign, self)._parse_inputs() return [{'%s' % (self.inputs.jobtype): einputs[0]}] - def _list_outputs(self): - resliced_all = self.inputs.write_which[0] > 0 + def _post_run(self): + resliced_all = self.inputs.write_which[0] > 0 resliced_mean = self.inputs.write_which[1] > 0 if self.inputs.jobtype != "write": @@ -792,8 +792,8 @@ def _format_arg(self, opt, spec, val): return clean_masks_dict[val] return super(Segment, self)._format_arg(opt, spec, val) - def _list_outputs(self): - f = self.inputs.data[0] + def _post_run(self): + f = self.inputs.data[0] for tidx, tissue in enumerate(['gm', 'wm', 'csf']): outtype = '%s_output_type' % tissue @@ -931,8 +931,8 @@ def _format_arg(self, opt, spec, val): else: return super(NewSegment, self)._format_arg(opt, spec, val) - def _list_outputs(self): - self.outputs.native_class_images = [] + def _post_run(self): + self.outputs.native_class_images = [] self.outputs.dartel_input_images = [] self.outputs.normalized_class_images = [] self.outputs.modulated_class_images = [] @@ -1035,8 +1035,8 @@ def _format_arg(self, opt, spec, val): return super(Smooth, self)._format_arg(opt, spec, val) - def _list_outputs(self): - self.outputs.smoothed_files = [] + def _post_run(self): + self.outputs.smoothed_files = [] for imgf in filename_to_list(self.inputs.in_files): self.outputs.smoothed_files.append(fname_presuffix(imgf, prefix=self.inputs.out_prefix)) @@ -1134,8 +1134,8 @@ def _format_arg(self, opt, spec, val): else: return super(DARTEL, self)._format_arg(opt, spec, val) - def _list_outputs(self): - self.outputs.template_files = [] + def _post_run(self): + self.outputs.template_files = [] for i in range(6): self.outputs.template_files.append(os.path.realpath('%s_%d.nii' % (self.inputs.template_prefix, i + 1))) self.outputs.final_template_file = os.path.realpath('%s_6.nii' % self.inputs.template_prefix) @@ -1222,8 +1222,8 @@ def _format_arg(self, opt, spec, val): else: return super(DARTELNorm2MNI, self)._format_arg(opt, spec, val) - def _list_outputs(self): - pth, base, ext = split_filename(self.inputs.template_file) + def _post_run(self): + pth, base, ext = split_filename(self.inputs.template_file) self.outputs.normalization_parameter_file = os.path.realpath(base + '_2mni.mat') self.outputs.normalized_files = [] prefix = "w" @@ -1296,8 +1296,8 @@ def _format_arg(self, opt, spec, val): else: return super(CreateWarped, self)._format_arg(opt, spec, val) - def _list_outputs(self): - self.outputs.warped_files = [] + def _post_run(self): + self.outputs.warped_files = [] for filename in self.inputs.image_files: pth, base, ext = split_filename(filename) if isdefined(self.inputs.modulate) and self.inputs.modulate: @@ -1343,8 +1343,8 @@ def _format_arg(self, opt, spec, val): else: return super(ApplyDeformations, self)._format_arg(opt, spec, val) - def _list_outputs(self): - self.outputs.out_files = [] + def _post_run(self): + self.outputs.out_files = [] for filename in self.inputs.in_files: _, fname = os.path.split(filename) self.outputs.out_files.append(os.path.realpath('w%s' % fname)) diff --git a/nipype/interfaces/spm/utils.py b/nipype/interfaces/spm/utils.py index a5302a5e8a..b7e3ea816b 100644 --- a/nipype/interfaces/spm/utils.py +++ b/nipype/interfaces/spm/utils.py @@ -35,8 +35,8 @@ def _make_matlab_command(self, _): return script - def _list_outputs(self): - self.outputs.nifti_file = self.output_name + def _post_run(self): + self.outputs.nifti_file = self.output_name return outputs @@ -114,8 +114,8 @@ def _make_matlab_command(self, _): self.inputs.invmat) return script - def _list_outputs(self): - self.outputs.mat = os.path.abspath(self.inputs.mat) + def _post_run(self): + self.outputs.mat = os.path.abspath(self.inputs.mat) self.outputs.invmat = os.path.abspath(self.inputs.invmat) return outputs @@ -226,8 +226,8 @@ def _make_matlab_command(self, _): self.inputs.in_file) return script - def _list_outputs(self): - self.outputs.out_file = os.path.abspath(self.inputs.out_file) + def _post_run(self): + self.outputs.out_file = os.path.abspath(self.inputs.out_file) return outputs @@ -304,8 +304,8 @@ def _format_arg(self, opt, spec, val): return np.array([list_to_filename(val)], dtype=object) return val - def _list_outputs(self): - self.outputs.out_files = [] + def _post_run(self): + self.outputs.out_files = [] for filename in self.inputs.in_files: _, fname = os.path.split(filename) self.outputs.out_files.append(os.path.realpath('w%s' % fname)) @@ -373,8 +373,8 @@ def _format_arg(self, opt, spec, val): return np.array([list_to_filename(val)], dtype=object) return val - def _list_outputs(self): - self.outputs.out_files = [] + def _post_run(self): + self.outputs.out_files = [] for filename in self.inputs.in_files: _, fname = os.path.split(filename) self.outputs.out_files.append(os.path.realpath('w%s' % fname)) diff --git a/nipype/pipeline/engine/tests/test_join.py b/nipype/pipeline/engine/tests/test_join.py index b8cff7b1fb..28e54fe4ac 100644 --- a/nipype/pipeline/engine/tests/test_join.py +++ b/nipype/pipeline/engine/tests/test_join.py @@ -31,8 +31,8 @@ def _run_interface(self, runtime): runtime.returncode = 0 return runtime - def _list_outputs(self): - self.outputs.output1 = self.inputs.in_files[0] + def _post_run(self): + self.outputs.output1 = self.inputs.in_files[0] return outputs @@ -53,8 +53,8 @@ def _run_interface(self, runtime): runtime.returncode = 0 return runtime - def _list_outputs(self): - self.outputs.output1 = self.inputs.input1 + self.inputs.inc + def _post_run(self): + self.outputs.output1 = self.inputs.input1 + self.inputs.inc return outputs _sums = [] diff --git a/nipype/pipeline/engine/tests/test_utils.py b/nipype/pipeline/engine/tests/test_utils.py index 4ab1b98cfe..fdf27bedfa 100644 --- a/nipype/pipeline/engine/tests/test_utils.py +++ b/nipype/pipeline/engine/tests/test_utils.py @@ -148,8 +148,8 @@ def _run_interface(self, runtime): runtime.returncode = 0 return runtime - def _list_outputs(self): - self.outputs.output1 = [1] + def _post_run(self): + self.outputs.output1 = [1] return outputs diff --git a/nipype/pipeline/plugins/tests/test_debug.py b/nipype/pipeline/plugins/tests/test_debug.py index 42f9c63f32..9e8a043e22 100644 --- a/nipype/pipeline/plugins/tests/test_debug.py +++ b/nipype/pipeline/plugins/tests/test_debug.py @@ -24,8 +24,8 @@ def _run_interface(self, runtime): runtime.returncode = 0 return runtime - def _list_outputs(self): - self.outputs.output1 = [1, self.inputs.input1] + def _post_run(self): + self.outputs.output1 = [1, self.inputs.input1] return outputs diff --git a/nipype/pipeline/plugins/tests/test_linear.py b/nipype/pipeline/plugins/tests/test_linear.py index c730114fe8..7aaa27adf3 100644 --- a/nipype/pipeline/plugins/tests/test_linear.py +++ b/nipype/pipeline/plugins/tests/test_linear.py @@ -24,8 +24,8 @@ def _run_interface(self, runtime): runtime.returncode = 0 return runtime - def _list_outputs(self): - self.outputs.output1 = [1, self.inputs.input1] + def _post_run(self): + self.outputs.output1 = [1, self.inputs.input1] return outputs diff --git a/nipype/pipeline/plugins/tests/test_multiproc.py b/nipype/pipeline/plugins/tests/test_multiproc.py index dd91c5cfe5..4d672cb3d5 100644 --- a/nipype/pipeline/plugins/tests/test_multiproc.py +++ b/nipype/pipeline/plugins/tests/test_multiproc.py @@ -24,8 +24,8 @@ def _run_interface(self, runtime): runtime.returncode = 0 return runtime - def _list_outputs(self): - self.outputs.output1 = [1, self.inputs.input1] + def _post_run(self): + self.outputs.output1 = [1, self.inputs.input1] return outputs diff --git a/nipype/pipeline/plugins/tests/test_oar.py b/nipype/pipeline/plugins/tests/test_oar.py index 005ea14a73..faadac0e14 100644 --- a/nipype/pipeline/plugins/tests/test_oar.py +++ b/nipype/pipeline/plugins/tests/test_oar.py @@ -24,8 +24,8 @@ def _run_interface(self, runtime): runtime.returncode = 0 return runtime - def _list_outputs(self): - self.outputs.output1 = [1, self.inputs.input1] + def _post_run(self): + self.outputs.output1 = [1, self.inputs.input1] return outputs diff --git a/nipype/pipeline/plugins/tests/test_pbs.py b/nipype/pipeline/plugins/tests/test_pbs.py index 579268492c..426d9c4da6 100644 --- a/nipype/pipeline/plugins/tests/test_pbs.py +++ b/nipype/pipeline/plugins/tests/test_pbs.py @@ -25,8 +25,8 @@ def _run_interface(self, runtime): runtime.returncode = 0 return runtime - def _list_outputs(self): - self.outputs.output1 = [1, self.inputs.input1] + def _post_run(self): + self.outputs.output1 = [1, self.inputs.input1] return outputs diff --git a/nipype/pipeline/plugins/tests/test_somaflow.py b/nipype/pipeline/plugins/tests/test_somaflow.py index db3bb69a6f..98d3315b78 100644 --- a/nipype/pipeline/plugins/tests/test_somaflow.py +++ b/nipype/pipeline/plugins/tests/test_somaflow.py @@ -27,8 +27,8 @@ def _run_interface(self, runtime): runtime.returncode = 0 return runtime - def _list_outputs(self): - self.outputs.output1 = [1, self.inputs.input1] + def _post_run(self): + self.outputs.output1 = [1, self.inputs.input1] return outputs From 84801d00764b150823520c84fa52ca1466cf076b Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 17 Feb 2016 10:01:58 -0800 Subject: [PATCH 32/73] fix syntax errors --- nipype/interfaces/afni/base.py | 7 +- nipype/interfaces/ants/registration.py | 147 +++++++++++++------------ 2 files changed, 79 insertions(+), 75 deletions(-) diff --git a/nipype/interfaces/afni/base.py b/nipype/interfaces/afni/base.py index bb9d60ea74..cd28aee1e7 100644 --- a/nipype/interfaces/afni/base.py +++ b/nipype/interfaces/afni/base.py @@ -187,10 +187,11 @@ def _post_run(self): out_names = list(self.inputs.traits(**metadata).keys()) if out_names: for name in out_names: - if outputs[name]: - _, _, ext = split_filename(outputs[name]) + value = getattr(self.outputs, name) + if value is not None: + _, _, ext = split_filename(value) if ext == "": - setattr(self.outputs, name, outputs[name] + "+orig.BRIK" + setattr(self.outputs, name, value + "+orig.BRIK") def no_afni(): diff --git a/nipype/interfaces/ants/registration.py b/nipype/interfaces/ants/registration.py index 30d4e250a7..6939adf0ba 100644 --- a/nipype/interfaces/ants/registration.py +++ b/nipype/interfaces/ants/registration.py @@ -85,6 +85,24 @@ class ANTSInputSpec(ANTSCommandInputSpec): traits.Int(), argstr='--number-of-affine-iterations %s', sep='x') + def _format_arg(self, opt, spec, val): + if opt == 'moving_image': + return self._image_metric_constructor() + elif opt == 'transformation_model': + return self._transformation_constructor() + elif opt == 'regularization': + return self._regularization_constructor() + elif opt == 'affine_gradient_descent_option': + return self._affine_gradient_descent_option_constructor() + elif opt == 'use_histogram_matching': + if self.inputs.use_histogram_matching: + return '--use-Histogram-Matching 1' + else: + return '--use-Histogram-Matching 0' + return super(ANTSInputSpec, self)._format_arg(opt, spec, val) + + + class ANTSOutputSpec(TraitedSpec): affine_transform = File(exists=True, desc='Affine transform file') warp_transform = File(exists=True, desc='Warping deformation field') @@ -186,22 +204,6 @@ def _affine_gradient_descent_option_constructor(self): retval = ['--affine-gradient-descent-option', parameters] return ' '.join(retval) - def _format_arg(self, opt, spec, val): - if opt == 'moving_image': - return self._image_metric_constructor() - elif opt == 'transformation_model': - return self._transformation_constructor() - elif opt == 'regularization': - return self._regularization_constructor() - elif opt == 'affine_gradient_descent_option': - return self._affine_gradient_descent_option_constructor() - elif opt == 'use_histogram_matching': - if self.inputs.use_histogram_matching: - return '--use-Histogram-Matching 1' - else: - return '--use-Histogram-Matching 0' - return super(ANTS, self)._format_arg(opt, spec, val) - def _post_run(self): self.outputs.affine_transform = os.path.abspath( self.inputs.output_transform_prefix + 'Affine.txt') @@ -211,7 +213,6 @@ def _post_run(self): self.inputs.output_transform_prefix + 'InverseWarp.nii.gz') # self.outputs.metaheader = os.path.abspath(self.inputs.output_transform_prefix + 'velocity.mhd') # self.outputs.metaheader_raw = os.path.abspath(self.inputs.output_transform_prefix + 'velocity.raw') - return outputs class RegistrationInputSpec(ANTSCommandInputSpec): @@ -379,6 +380,62 @@ class RegistrationInputSpec(ANTSCommandInputSpec): low=0.0, high=1.0, value=0.0, argstr='%s', usedefault=True, desc="The Lower quantile to clip image ranges") + def _format_arg(self, opt, spec, val): + if opt == 'fixed_image_mask': + if isdefined(self.inputs.moving_image_mask): + return '--masks [ %s, %s ]' % (self.inputs.fixed_image_mask, + self.inputs.moving_image_mask) + else: + return '--masks %s' % self.inputs.fixed_image_mask + elif opt == 'transforms': + return self._format_registration() + elif opt == 'initial_moving_transform': + try: + do_invert_transform = int(self.inputs.invert_initial_moving_transform) + except ValueError: + do_invert_transform = 0 # Just do the default behavior + return '--initial-moving-transform [ %s, %d ]' % (self.inputs.initial_moving_transform, + do_invert_transform) + elif opt == 'initial_moving_transform_com': + try: + do_center_of_mass_init = int(self.inputs.initial_moving_transform_com) + except ValueError: + do_center_of_mass_init = 0 # Just do the default behavior + return '--initial-moving-transform [ %s, %s, %d ]' % (self.inputs.fixed_image[0], + self.inputs.moving_image[0], + do_center_of_mass_init) + elif opt == 'interpolation': + if self.inputs.interpolation in ['BSpline', 'MultiLabel', 'Gaussian'] and \ + isdefined(self.inputs.interpolation_parameters): + return '--interpolation %s[ %s ]' % (self.inputs.interpolation, + ', '.join([str(param) + for param in self.inputs.interpolation_parameters])) + else: + return '--interpolation %s' % self.inputs.interpolation + elif opt == 'output_transform_prefix': + out_filename = self._get_outputfilenames(inverse=False) + inv_out_filename = self._get_outputfilenames(inverse=True) + if out_filename and inv_out_filename: + return '--output [ %s, %s, %s ]' % (self.inputs.output_transform_prefix, + out_filename, + inv_out_filename) + elif out_filename: + return '--output [ %s, %s ]' % (self.inputs.output_transform_prefix, + out_filename) + else: + return '--output %s' % self.inputs.output_transform_prefix + elif opt == 'winsorize_upper_quantile' or opt == 'winsorize_lower_quantile': + if not self._quantilesDone: + return self._format_winsorize_image_intensities() + else: + self._quantilesDone = False + return '' # Must return something for argstr! + # This feature was removed from recent versions of antsRegistration due to corrupt outputs. + # elif opt == 'collapse_linear_transforms_to_fixed_image_header': + # return self._formatCollapseLinearTransformsToFixedImageHeader() + return super(RegistrationInputSpec, self)._format_arg(opt, spec, val) + + class RegistrationOutputSpec(TraitedSpec): forward_transforms = traits.List( File(exists=True), desc='List of output transforms for forward registration') @@ -801,60 +858,6 @@ def _format_winsorize_image_intensities(self): return '--winsorize-image-intensities [ %s, %s ]' % (self.inputs.winsorize_lower_quantile, self.inputs.winsorize_upper_quantile) - def _format_arg(self, opt, spec, val): - if opt == 'fixed_image_mask': - if isdefined(self.inputs.moving_image_mask): - return '--masks [ %s, %s ]' % (self.inputs.fixed_image_mask, - self.inputs.moving_image_mask) - else: - return '--masks %s' % self.inputs.fixed_image_mask - elif opt == 'transforms': - return self._format_registration() - elif opt == 'initial_moving_transform': - try: - do_invert_transform = int(self.inputs.invert_initial_moving_transform) - except ValueError: - do_invert_transform = 0 # Just do the default behavior - return '--initial-moving-transform [ %s, %d ]' % (self.inputs.initial_moving_transform, - do_invert_transform) - elif opt == 'initial_moving_transform_com': - try: - do_center_of_mass_init = int(self.inputs.initial_moving_transform_com) - except ValueError: - do_center_of_mass_init = 0 # Just do the default behavior - return '--initial-moving-transform [ %s, %s, %d ]' % (self.inputs.fixed_image[0], - self.inputs.moving_image[0], - do_center_of_mass_init) - elif opt == 'interpolation': - if self.inputs.interpolation in ['BSpline', 'MultiLabel', 'Gaussian'] and \ - isdefined(self.inputs.interpolation_parameters): - return '--interpolation %s[ %s ]' % (self.inputs.interpolation, - ', '.join([str(param) - for param in self.inputs.interpolation_parameters])) - else: - return '--interpolation %s' % self.inputs.interpolation - elif opt == 'output_transform_prefix': - out_filename = self._get_outputfilenames(inverse=False) - inv_out_filename = self._get_outputfilenames(inverse=True) - if out_filename and inv_out_filename: - return '--output [ %s, %s, %s ]' % (self.inputs.output_transform_prefix, - out_filename, - inv_out_filename) - elif out_filename: - return '--output [ %s, %s ]' % (self.inputs.output_transform_prefix, - out_filename) - else: - return '--output %s' % self.inputs.output_transform_prefix - elif opt == 'winsorize_upper_quantile' or opt == 'winsorize_lower_quantile': - if not self._quantilesDone: - return self._format_winsorize_image_intensities() - else: - self._quantilesDone = False - return '' # Must return something for argstr! - # This feature was removed from recent versions of antsRegistration due to corrupt outputs. - # elif opt == 'collapse_linear_transforms_to_fixed_image_header': - # return self._formatCollapseLinearTransformsToFixedImageHeader() - return super(Registration, self)._format_arg(opt, spec, val) def _output_filenames(self, prefix, count, transform, inverse=False): self.low_dimensional_transform_map = {'Rigid': 'Rigid.mat', @@ -972,4 +975,4 @@ def _post_run(self): self.outputs.inverse_warped_image = os.path.abspath(inv_out_filename) if len(self.inputs.save_state): self.outputs.save_state = os.path.abspath(self.inputs.save_state) - return outputs + From e90f52c6b8c0b197337fad184e5a7587f4285dfa Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 17 Feb 2016 10:03:17 -0800 Subject: [PATCH 33/73] fix syntax errors --- nipype/algorithms/misc.py | 2 +- nipype/pipeline/engine/tests/test_engine.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nipype/algorithms/misc.py b/nipype/algorithms/misc.py index 75e24d31fe..716aa1ffd8 100644 --- a/nipype/algorithms/misc.py +++ b/nipype/algorithms/misc.py @@ -35,7 +35,7 @@ from ..interfaces.base import BaseInterface -from ... import logging +from .. import logging IFLOGGER = logging.getLogger('interface') diff --git a/nipype/pipeline/engine/tests/test_engine.py b/nipype/pipeline/engine/tests/test_engine.py index ea9f6cf147..c7e6392374 100644 --- a/nipype/pipeline/engine/tests/test_engine.py +++ b/nipype/pipeline/engine/tests/test_engine.py @@ -424,10 +424,10 @@ def test_doubleconnect(): from nipype.external.six import StringIO from nipype.utils.config import config -config.readfp(StringIO(""" +config.readfp(StringIO(''' [execution] remove_unnecessary_outputs = true -""")) +''')) segment = pe.Node(interface=spm.Segment(), name="segment") From 198e13b4cd6802b239235d98ff2a9259e0c85584 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 17 Feb 2016 10:04:57 -0800 Subject: [PATCH 34/73] fix syntax errors --- nipype/interfaces/dynamic_slicer.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/nipype/interfaces/dynamic_slicer.py b/nipype/interfaces/dynamic_slicer.py index 8d6fe05fd1..2c4ac9fd55 100644 --- a/nipype/interfaces/dynamic_slicer.py +++ b/nipype/interfaces/dynamic_slicer.py @@ -13,6 +13,16 @@ class SlicerCommandLineInputSpec(DynamicTraitedSpec, CommandLineInputSpec): module = traits.Str(desc="name of the Slicer command line module you want to use") + def _format_arg(self, name, spec, value): + if name in [output_node.getElementsByTagName('name')[0].firstChild.nodeValue for output_node in self._outputs_nodes]: + if isinstance(value, bool): + fname = self._gen_filename(name) + else: + fname = value + return spec.argstr % fname + return super(SlicerCommandLine, self)._format_arg(name, spec, value) + + class SlicerCommandLine(CommandLine): """Experimental Slicer wrapper. Work in progress. @@ -129,25 +139,17 @@ def _gen_filename_from_param(self, param): return base + ext def _list_outputs(self): - + for output_node in self._outputs_nodes: name = output_node.getElementsByTagName('name')[0].firstChild.nodeValue - setattr(self.outputs, name, getattr(self.inputs, name) + setattr(self.outputs, name, getattr(self.inputs, name)) if isdefined(outputs[name]) and isinstance(outputs[name], bool): if outputs[name]: - setattr(self.outputs, name, self._gen_filename(name) + setattr(self.outputs, name, self._gen_filename(name)) else: - setattr(self.outputs, name, Undefined + setattr(self.outputs, name, Undefined) return outputs - def _format_arg(self, name, spec, value): - if name in [output_node.getElementsByTagName('name')[0].firstChild.nodeValue for output_node in self._outputs_nodes]: - if isinstance(value, bool): - fname = self._gen_filename(name) - else: - fname = value - return spec.argstr % fname - return super(SlicerCommandLine, self)._format_arg(name, spec, value) # test = SlicerCommandLine(module="BRAINSFit") # test.inputs.fixedVolume = "/home/filo/workspace/fmri_tumour/data/pilot1/10_co_COR_3D_IR_PREP.nii" From bb8d3968e893d33d9e3a278d603da86d2ec6bab2 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 17 Feb 2016 10:06:00 -0800 Subject: [PATCH 35/73] replace all remaining list_outputs --- nipype/interfaces/afni/preprocess.py | 8 +++---- nipype/interfaces/camino/calib.py | 4 ++-- nipype/interfaces/camino/connectivity.py | 2 +- nipype/interfaces/camino/convert.py | 18 +++++++------- nipype/interfaces/camino/dti.py | 20 ++++++++-------- nipype/interfaces/camino/odf.py | 8 +++---- nipype/interfaces/camino/utils.py | 2 +- nipype/interfaces/camino2trackvis/convert.py | 4 ++-- nipype/interfaces/cmtk/cmtk.py | 2 +- nipype/interfaces/cmtk/nbs.py | 2 +- nipype/interfaces/cmtk/nx.py | 4 ++-- nipype/interfaces/dcm2nii.py | 2 +- nipype/interfaces/diffusion_toolkit/dti.py | 4 ++-- nipype/interfaces/diffusion_toolkit/odf.py | 6 ++--- .../interfaces/diffusion_toolkit/postproc.py | 4 ++-- nipype/interfaces/dipy/tensors.py | 4 ++-- nipype/interfaces/dynamic_slicer.py | 2 +- nipype/interfaces/elastix/registration.py | 2 +- nipype/interfaces/elastix/utils.py | 2 +- nipype/interfaces/freesurfer/model.py | 12 +++++----- nipype/interfaces/freesurfer/preprocess.py | 20 ++++++++-------- nipype/interfaces/freesurfer/utils.py | 12 +++++----- nipype/interfaces/fsl/epi.py | 12 +++++----- nipype/interfaces/fsl/maths.py | 4 ++-- nipype/interfaces/fsl/model.py | 12 +++++----- nipype/interfaces/fsl/utils.py | 18 +++++++------- nipype/interfaces/meshfix.py | 2 +- nipype/interfaces/minc/minc.py | 14 +++++------ nipype/interfaces/mne/base.py | 2 +- nipype/interfaces/mrtrix/preprocess.py | 24 +++++++++---------- nipype/interfaces/mrtrix/tensors.py | 8 +++---- nipype/interfaces/mrtrix/tracking.py | 2 +- nipype/interfaces/mrtrix3/connectivity.py | 4 ++-- nipype/interfaces/mrtrix3/preprocess.py | 6 ++--- nipype/interfaces/mrtrix3/reconst.py | 4 ++-- nipype/interfaces/mrtrix3/tracking.py | 2 +- nipype/interfaces/mrtrix3/utils.py | 12 +++++----- nipype/interfaces/nipy/preprocess.py | 2 +- nipype/interfaces/nitime/analysis.py | 2 +- nipype/interfaces/petpvc.py | 2 +- nipype/interfaces/spm/base.py | 2 +- nipype/interfaces/spm/preprocess.py | 8 +++---- nipype/interfaces/spm/utils.py | 4 ++-- nipype/interfaces/tests/test_base.py | 2 +- nipype/pipeline/engine/tests/test_join.py | 6 ++--- 45 files changed, 149 insertions(+), 149 deletions(-) diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index 61f245c8fa..6c19072bad 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -207,7 +207,7 @@ class Refit(AFNICommandBase): input_spec = RefitInputSpec output_spec = AFNICommandOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = os.path.abspath(self.inputs.in_file) return outputs @@ -1161,7 +1161,7 @@ def _format_arg(self, name, trait_spec, value): return arg return super(Allineate, self)._format_arg(name, trait_spec, value) - def _list_outputs(self): + def _post_run(self): if not isdefined(self.inputs.out_file): self.outputs.out_file = self._gen_filename(self.inputs.in_file, @@ -2193,7 +2193,7 @@ def _parse_inputs(self, skip=None): return super(Hist, self)._parse_inputs(skip=skip) - def _list_outputs(self): + def _post_run(self): outputs = super(Hist, self)._list_outputs() self.outputs.out_file += '.niml.hist' if not self.inputs.showhist: @@ -2386,7 +2386,7 @@ def _format_arg(self, name, trait_spec, value): return trait_spec.argstr + ' ' + value return super(FWHMx, self)._format_arg(name, trait_spec, value) - def _list_outputs(self): + def _post_run(self): outputs = super(FWHMx, self)._list_outputs() if self.inputs.detrend: diff --git a/nipype/interfaces/camino/calib.py b/nipype/interfaces/camino/calib.py index 45437bb97d..43671d7243 100644 --- a/nipype/interfaces/camino/calib.py +++ b/nipype/interfaces/camino/calib.py @@ -120,7 +120,7 @@ class SFPICOCalibData(StdOutCommandLine): input_spec = SFPICOCalibDataInputSpec output_spec = SFPICOCalibDataOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.PICOCalib = os.path.abspath(self._gen_outfilename()) self.outputs.calib_info = os.path.abspath(self.inputs.info_file) @@ -227,7 +227,7 @@ class SFLUTGen(StdOutCommandLine): input_spec = SFLUTGenInputSpec output_spec = SFLUTGenOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.lut_one_fibre = self.inputs.outputstem + '_oneFibreSurfaceCoeffs.Bdouble' self.outputs.lut_two_fibres = self.inputs.outputstem + '_twoFibreSurfaceCoeffs.Bdouble' diff --git a/nipype/interfaces/camino/connectivity.py b/nipype/interfaces/camino/connectivity.py index ed488e4317..1557fe3168 100644 --- a/nipype/interfaces/camino/connectivity.py +++ b/nipype/interfaces/camino/connectivity.py @@ -132,7 +132,7 @@ class Conmat(CommandLine): input_spec = ConmatInputSpec output_spec = ConmatOutputSpec - def _list_outputs(self): + def _post_run(self): output_root = self._gen_outputroot() self.outputs.conmat_sc = os.path.abspath(output_root + "sc.csv") diff --git a/nipype/interfaces/camino/convert.py b/nipype/interfaces/camino/convert.py index 2ea1e33974..1904503000 100644 --- a/nipype/interfaces/camino/convert.py +++ b/nipype/interfaces/camino/convert.py @@ -56,7 +56,7 @@ class Image2Voxel(StdOutCommandLine): input_spec = Image2VoxelInputSpec output_spec = Image2VoxelOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.voxel_order = os.path.abspath(self._gen_outfilename()) return outputs @@ -114,7 +114,7 @@ class FSL2Scheme(StdOutCommandLine): input_spec = FSL2SchemeInputSpec output_spec = FSL2SchemeOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.scheme = os.path.abspath(self._gen_outfilename()) return outputs @@ -170,7 +170,7 @@ class VtkStreamlines(StdOutCommandLine): input_spec = VtkStreamlinesInputSpec output_spec = VtkStreamlinesOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.vtk = os.path.abspath(self._gen_outfilename()) return outputs @@ -298,7 +298,7 @@ def _get_actual_outputroot(self, outputroot): actual_outputroot = os.path.join('procstream_outfiles', outputroot) return actual_outputroot - def _list_outputs(self): + def _post_run(self): self.outputs.proc = os.path.abspath(self._gen_outfilename()) self.outputs.outputroot_files = self.outputroot_files @@ -351,7 +351,7 @@ class TractShredder(StdOutCommandLine): input_spec = TractShredderInputSpec output_spec = TractShredderOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.shredded = os.path.abspath(self._gen_outfilename()) return outputs @@ -390,7 +390,7 @@ class DT2NIfTI(CommandLine): input_spec = DT2NIfTIInputSpec output_spec = DT2NIfTIOutputSpec - def _list_outputs(self): + def _post_run(self): output_root = self._gen_outputroot() self.outputs.dt = os.path.abspath(output_root + "dt.nii") @@ -473,7 +473,7 @@ class NIfTIDT2Camino(CommandLine): input_spec = NIfTIDT2CaminoInputSpec output_spec = NIfTIDT2CaminoOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = self._gen_filename('out_file') return outputs @@ -627,7 +627,7 @@ class AnalyzeHeader(StdOutCommandLine): input_spec = AnalyzeHeaderInputSpec output_spec = AnalyzeHeaderOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.header = os.path.abspath(self._gen_outfilename()) return outputs @@ -681,7 +681,7 @@ class Shredder(StdOutCommandLine): input_spec = ShredderInputSpec output_spec = ShredderOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.shredded_file = os.path.abspath(self._gen_outfilename()) return outputs diff --git a/nipype/interfaces/camino/dti.py b/nipype/interfaces/camino/dti.py index e90710e0fe..2c35664d0f 100644 --- a/nipype/interfaces/camino/dti.py +++ b/nipype/interfaces/camino/dti.py @@ -61,7 +61,7 @@ class DTIFit(StdOutCommandLine): input_spec = DTIFitInputSpec output_spec = DTIFitOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.tensor_fitted = os.path.abspath(self._gen_outfilename()) return outputs @@ -147,7 +147,7 @@ class DTMetric(CommandLine): input_spec = DTMetricInputSpec output_spec = DTMetricOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.metric_stats = os.path.abspath(self._gen_outfilename()) return outputs @@ -251,7 +251,7 @@ class ModelFit(StdOutCommandLine): input_spec = ModelFitInputSpec output_spec = ModelFitOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.fitted_data = os.path.abspath(self._gen_outfilename()) return outputs @@ -333,7 +333,7 @@ class DTLUTGen(StdOutCommandLine): input_spec = DTLUTGenInputSpec output_spec = DTLUTGenOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.dtLUT = os.path.abspath(self._gen_outfilename()) return outputs @@ -397,7 +397,7 @@ class PicoPDFs(StdOutCommandLine): input_spec = PicoPDFsInputSpec output_spec = PicoPDFsOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.pdfs = os.path.abspath(self._gen_outfilename()) return outputs @@ -564,7 +564,7 @@ class Track(CommandLine): input_spec = TrackInputSpec output_spec = TrackOutputSpec - def _list_outputs(self): + def _post_run(self): if isdefined(self.inputs.out_file): out_file_path = os.path.abspath(self.inputs.out_file) @@ -872,7 +872,7 @@ class ComputeMeanDiffusivity(StdOutCommandLine): input_spec = ComputeMeanDiffusivityInputSpec output_spec = ComputeMeanDiffusivityOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.md = os.path.abspath(self._gen_outfilename()) return outputs @@ -934,7 +934,7 @@ class ComputeFractionalAnisotropy(StdOutCommandLine): input_spec = ComputeFractionalAnisotropyInputSpec output_spec = ComputeFractionalAnisotropyOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.fa = os.path.abspath(self._gen_outfilename()) return outputs @@ -998,7 +998,7 @@ class ComputeTensorTrace(StdOutCommandLine): input_spec = ComputeTensorTraceInputSpec output_spec = ComputeTensorTraceOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.trace = os.path.abspath(self._gen_outfilename()) return outputs @@ -1058,7 +1058,7 @@ class ComputeEigensystem(StdOutCommandLine): input_spec = ComputeEigensystemInputSpec output_spec = ComputeEigensystemOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.eigen = os.path.abspath(self._gen_outfilename()) return outputs diff --git a/nipype/interfaces/camino/odf.py b/nipype/interfaces/camino/odf.py index 34ca4f629b..4e8c8453db 100644 --- a/nipype/interfaces/camino/odf.py +++ b/nipype/interfaces/camino/odf.py @@ -82,7 +82,7 @@ class QBallMX(StdOutCommandLine): input_spec = QBallMXInputSpec output_spec = QBallMXOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.qmat = os.path.abspath(self._gen_outfilename()) return outputs @@ -159,7 +159,7 @@ class LinRecon(StdOutCommandLine): input_spec = LinReconInputSpec output_spec = LinReconOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.recon_data = os.path.abspath(self._gen_outfilename()) return outputs @@ -283,7 +283,7 @@ class MESD(StdOutCommandLine): input_spec = MESDInputSpec output_spec = MESDOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.mesd_data = os.path.abspath(self._gen_outfilename()) return outputs @@ -430,7 +430,7 @@ class SFPeaks(StdOutCommandLine): input_spec = SFPeaksInputSpec output_spec = SFPeaksOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.peaks = os.path.abspath(self._gen_outfilename()) return outputs diff --git a/nipype/interfaces/camino/utils.py b/nipype/interfaces/camino/utils.py index 451d726e42..a8be3ff81f 100644 --- a/nipype/interfaces/camino/utils.py +++ b/nipype/interfaces/camino/utils.py @@ -55,7 +55,7 @@ class ImageStats(CommandLine): input_spec = ImageStatsInputSpec output_spec = ImageStatsOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = os.path.abspath(self._gen_outfilename()) return outputs diff --git a/nipype/interfaces/camino2trackvis/convert.py b/nipype/interfaces/camino2trackvis/convert.py index 36db947b15..c65da67d96 100644 --- a/nipype/interfaces/camino2trackvis/convert.py +++ b/nipype/interfaces/camino2trackvis/convert.py @@ -73,7 +73,7 @@ class Camino2Trackvis(CommandLine): input_spec = Camino2TrackvisInputSpec output_spec = Camino2TrackvisOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.trackvis = os.path.abspath(self._gen_outfilename()) return outputs @@ -124,7 +124,7 @@ class Trackvis2Camino(CommandLine): input_spec = Trackvis2CaminoInputSpec output_spec = Trackvis2CaminoOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.camino = os.path.abspath(self._gen_outfilename()) return outputs diff --git a/nipype/interfaces/cmtk/cmtk.py b/nipype/interfaces/cmtk/cmtk.py index ad9fca76ad..dfb9ecff3e 100644 --- a/nipype/interfaces/cmtk/cmtk.py +++ b/nipype/interfaces/cmtk/cmtk.py @@ -496,7 +496,7 @@ def _run_interface(self, runtime): matrix_file, matrix_mat_file, endpoint_name, self.inputs.count_region_intersections) return runtime - def _list_outputs(self): + def _post_run(self): if isdefined(self.inputs.out_matrix_file): path, name, _ = split_filename(self.inputs.out_matrix_file) diff --git a/nipype/interfaces/cmtk/nbs.py b/nipype/interfaces/cmtk/nbs.py index 5e00dbfc25..949461b158 100644 --- a/nipype/interfaces/cmtk/nbs.py +++ b/nipype/interfaces/cmtk/nbs.py @@ -127,7 +127,7 @@ def _run_interface(self, runtime): iflogger.info('Saving output p-value network as {out}'.format(out=pval_path)) return runtime - def _list_outputs(self): + def _post_run(self): THRESH = self.inputs.threshold diff --git a/nipype/interfaces/cmtk/nx.py b/nipype/interfaces/cmtk/nx.py index f45aaf2c45..1f8c53f934 100644 --- a/nipype/interfaces/cmtk/nx.py +++ b/nipype/interfaces/cmtk/nx.py @@ -482,7 +482,7 @@ def _run_interface(self, runtime): dicts.append(out_file) return runtime - def _list_outputs(self): + def _post_run(self): self.outputs.k_core = op.abspath(self._gen_outfilename(self.inputs.out_k_core, 'pck')) self.outputs.k_shell = op.abspath(self._gen_outfilename(self.inputs.out_k_shell, 'pck')) @@ -547,7 +547,7 @@ def _run_interface(self, runtime): network_name, matlab_network_list = average_networks(self.inputs.in_files, ntwk_res_file, self.inputs.group_id) return runtime - def _list_outputs(self): + def _post_run(self): if not isdefined(self.inputs.out_gpickled_groupavg): self.outputs.gpickled_groupavg = op.abspath(self._gen_outfilename(self.inputs.group_id + '_average', 'pck')) diff --git a/nipype/interfaces/dcm2nii.py b/nipype/interfaces/dcm2nii.py index 72ff70a7fe..e292fec6ad 100644 --- a/nipype/interfaces/dcm2nii.py +++ b/nipype/interfaces/dcm2nii.py @@ -159,7 +159,7 @@ def _parse_stdout(self, stdout): skip = False return files, reoriented_files, reoriented_and_cropped_files, bvecs, bvals - def _list_outputs(self): + def _post_run(self): self.outputs.converted_files = self.output_files self.outputs.reoriented_files = self.reoriented_files diff --git a/nipype/interfaces/diffusion_toolkit/dti.py b/nipype/interfaces/diffusion_toolkit/dti.py index 0b40e26b19..1da35568af 100644 --- a/nipype/interfaces/diffusion_toolkit/dti.py +++ b/nipype/interfaces/diffusion_toolkit/dti.py @@ -87,7 +87,7 @@ def _format_arg(self, name, spec, value): return super(DTIRecon, self)._format_arg("bvecs", spec, new_val) return super(DTIRecon, self)._format_arg(name, spec, value) - def _list_outputs(self): + def _post_run(self): out_prefix = self.inputs.out_prefix output_type = self.inputs.output_type @@ -163,7 +163,7 @@ def _run_interface(self, runtime): return super(DTITracker, self)._run_interface(runtime) - def _list_outputs(self): + def _post_run(self): self.outputs.track_file = os.path.abspath(self.inputs.output_file) if isdefined(self.inputs.output_mask) and self.inputs.output_mask: diff --git a/nipype/interfaces/diffusion_toolkit/odf.py b/nipype/interfaces/diffusion_toolkit/odf.py index 4383aa93f3..a7bcbedc28 100644 --- a/nipype/interfaces/diffusion_toolkit/odf.py +++ b/nipype/interfaces/diffusion_toolkit/odf.py @@ -85,7 +85,7 @@ def _format_arg(self, name, spec, value): return super(HARDIMat, self)._format_arg("bvecs", spec, new_val) return super(HARDIMat, self)._format_arg(name, spec, value) - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = os.path.abspath(self.inputs.out_file) return outputs @@ -138,7 +138,7 @@ class ODFRecon(CommandLine): _cmd = 'odf_recon' - def _list_outputs(self): + def _post_run(self): out_prefix = self.inputs.out_prefix output_type = self.inputs.output_type @@ -229,7 +229,7 @@ def _run_interface(self, runtime): return super(ODFTracker, self)._run_interface(runtime) - def _list_outputs(self): + def _post_run(self): self.outputs.track_file = os.path.abspath(self.inputs.out_file) return outputs diff --git a/nipype/interfaces/diffusion_toolkit/postproc.py b/nipype/interfaces/diffusion_toolkit/postproc.py index e32e23631e..4b485b48bc 100644 --- a/nipype/interfaces/diffusion_toolkit/postproc.py +++ b/nipype/interfaces/diffusion_toolkit/postproc.py @@ -50,7 +50,7 @@ class SplineFilter(CommandLine): _cmd = "spline_filter" - def _list_outputs(self): + def _post_run(self): self.outputs.smoothed_track_file = os.path.abspath(self.inputs.output_file) return outputs @@ -90,7 +90,7 @@ class TrackMerge(CommandLine): _cmd = "track_merge" - def _list_outputs(self): + def _post_run(self): self.outputs.track_file = os.path.abspath(self.inputs.output_file) return outputs diff --git a/nipype/interfaces/dipy/tensors.py b/nipype/interfaces/dipy/tensors.py index 6e02d0939c..c4f20761b2 100644 --- a/nipype/interfaces/dipy/tensors.py +++ b/nipype/interfaces/dipy/tensors.py @@ -62,7 +62,7 @@ def _run_interface(self, runtime): IFLOGGER.info('DTI parameters image saved as {i}'.format(i=out_file)) return runtime - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = self._gen_filename('dti') return outputs @@ -131,6 +131,6 @@ def _run_interface(self, runtime): IFLOGGER.info('Tensor mode image saved as {i}'.format(i=out_file)) return runtime - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = self._gen_filename('mode') return outputs diff --git a/nipype/interfaces/dynamic_slicer.py b/nipype/interfaces/dynamic_slicer.py index 2c4ac9fd55..579eb11370 100644 --- a/nipype/interfaces/dynamic_slicer.py +++ b/nipype/interfaces/dynamic_slicer.py @@ -138,7 +138,7 @@ def _gen_filename_from_param(self, param): ext = {'image': '.nii', 'transform': '.txt', 'file': ''}[param.nodeName] return base + ext - def _list_outputs(self): + def _post_run(self): for output_node in self._outputs_nodes: name = output_node.getElementsByTagName('name')[0].firstChild.nodeValue diff --git a/nipype/interfaces/elastix/registration.py b/nipype/interfaces/elastix/registration.py index 09145302a3..d11f6b7460 100644 --- a/nipype/interfaces/elastix/registration.py +++ b/nipype/interfaces/elastix/registration.py @@ -65,7 +65,7 @@ class Registration(CommandLine): input_spec = RegistrationInputSpec output_spec = RegistrationOutputSpec - def _list_outputs(self): + def _post_run(self): out_dir = op.abspath(self.inputs.output_path) diff --git a/nipype/interfaces/elastix/utils.py b/nipype/interfaces/elastix/utils.py index 2979fff144..f5b857e573 100644 --- a/nipype/interfaces/elastix/utils.py +++ b/nipype/interfaces/elastix/utils.py @@ -130,7 +130,7 @@ def _run_interface(self, runtime): return runtime - def _list_outputs(self): + def _post_run(self): self.outputs.output_file = getattr(self, '_out_file') return outputs diff --git a/nipype/interfaces/freesurfer/model.py b/nipype/interfaces/freesurfer/model.py index 7cdab5a5d2..90ecf7915c 100644 --- a/nipype/interfaces/freesurfer/model.py +++ b/nipype/interfaces/freesurfer/model.py @@ -97,7 +97,7 @@ class MRISPreproc(FSCommand): input_spec = MRISPreprocInputSpec output_spec = MRISPreprocOutputSpec - def _list_outputs(self): + def _post_run(self): outfile = self.inputs.out_file self.outputs.out_file = outfile @@ -277,7 +277,7 @@ def _format_arg(self, name, spec, value): return spec.argstr % (_si.subject_id, _si.hemi, _si.surf_geo) return super(GLMFit, self)._format_arg(name, spec, value) - def _list_outputs(self): + def _post_run(self): # Get the top-level output directory if not isdefined(self.inputs.glm_dir): @@ -417,7 +417,7 @@ class Binarize(FSCommand): input_spec = BinarizeInputSpec output_spec = BinarizeOutputSpec - def _list_outputs(self): + def _post_run(self): outfile = self.inputs.binary_file if not isdefined(outfile): @@ -526,7 +526,7 @@ class Concatenate(FSCommand): input_spec = ConcatenateInputSpec output_spec = ConcatenateOutputSpec - def _list_outputs(self): + def _post_run(self): if not isdefined(self.inputs.concatenated_file): self.outputs.concatenated_file = os.path.join(os.getcwd(), @@ -634,7 +634,7 @@ class SegStats(FSCommand): input_spec = SegStatsInputSpec output_spec = SegStatsOutputSpec - def _list_outputs(self): + def _post_run(self): if isdefined(self.inputs.summary_file): self.outputs.summary_file = os.path.abspath(self.inputs.summary_file) @@ -753,7 +753,7 @@ class Label2Vol(FSCommand): input_spec = Label2VolInputSpec output_spec = Label2VolOutputSpec - def _list_outputs(self): + def _post_run(self): outfile = self.inputs.vol_label_file if not isdefined(outfile): diff --git a/nipype/interfaces/freesurfer/preprocess.py b/nipype/interfaces/freesurfer/preprocess.py index fcde28c850..ca402aa59f 100644 --- a/nipype/interfaces/freesurfer/preprocess.py +++ b/nipype/interfaces/freesurfer/preprocess.py @@ -66,7 +66,7 @@ class ParseDICOMDir(FSCommand): input_spec = ParseDICOMDirInputSpec output_spec = ParseDICOMDirOutputSpec - def _list_outputs(self): + def _post_run(self): if isdefined(self.inputs.dicom_info_file): self.outputs.dicom_info_file = os.path.join(os.getcwd(), self.inputs.dicom_info_file) @@ -374,7 +374,7 @@ def _get_outfilename(self): use_ext=False) return os.path.abspath(outfile) - def _list_outputs(self): + def _post_run(self): outfile = self._get_outfilename() if isdefined(self.inputs.split) and self.inputs.split: @@ -585,7 +585,7 @@ def _get_outfilename(self): suffix='_resample') return outfile - def _list_outputs(self): + def _post_run(self): self.outputs.resampled_file = self._get_outfilename() return outputs @@ -736,7 +736,7 @@ def _gen_filename(self, name): return self._gen_subjects_dir() return None - def _list_outputs(self): + def _post_run(self): """ See io.FreeSurferSource.outputs for the list of outputs returned """ @@ -867,7 +867,7 @@ class BBRegister(FSCommand): input_spec = BBRegisterInputSpec output_spec = BBRegisterOutputSpec - def _list_outputs(self): + def _post_run(self): _in = self.inputs @@ -1016,7 +1016,7 @@ def _get_outfile(self): suffix='_warped') return outfile - def _list_outputs(self): + def _post_run(self): self.outputs.transformed_file = os.path.abspath(self._get_outfile()) return outputs @@ -1081,7 +1081,7 @@ class Smooth(FSCommand): input_spec = SmoothInputSpec output_spec = SmoothOutputSpec - def _list_outputs(self): + def _post_run(self): outfile = self.inputs.smoothed_file if not isdefined(outfile): @@ -1202,7 +1202,7 @@ def _format_arg(self, name, spec, value): return spec.argstr % fname return super(RobustRegister, self)._format_arg(name, spec, value) - def _list_outputs(self): + def _post_run(self): self.outputs.out_reg_file = self.inputs.out_reg_file if not isdefined(self.inputs.out_reg_file) and self.inputs.source_file: @@ -1287,7 +1287,7 @@ def _format_arg(self, name, spec, value): return cmd return super(FitMSParams, self)._format_arg(name, spec, value) - def _list_outputs(self): + def _post_run(self): if not isdefined(self.inputs.out_dir): out_dir = self._gen_filename("out_dir") @@ -1344,7 +1344,7 @@ class SynthesizeFLASH(FSCommand): input_spec = SynthesizeFLASHInputSpec output_spec = SynthesizeFLASHOutputSpec - def _list_outputs(self): + def _post_run(self): if isdefined(self.inputs.out_file): self.outputs.out_file = self.inputs.out_file diff --git a/nipype/interfaces/freesurfer/utils.py b/nipype/interfaces/freesurfer/utils.py index 222956ffa0..99c759d803 100644 --- a/nipype/interfaces/freesurfer/utils.py +++ b/nipype/interfaces/freesurfer/utils.py @@ -847,7 +847,7 @@ def _format_arg(self, name, spec, value): value = os.path.abspath(value) return super(MRIsConvert, self)._format_arg(name, spec, value) - def _list_outputs(self): + def _post_run(self): self.outputs.converted = os.path.abspath(self._gen_outfilename()) return outputs @@ -915,7 +915,7 @@ class MRITessellate(FSCommand): input_spec = MRITessellateInputSpec output_spec = MRITessellateOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.surface = os.path.abspath(self._gen_outfilename()) return outputs @@ -985,7 +985,7 @@ class MRIPretess(FSCommand): input_spec = MRIPretessInputSpec output_spec = MRIPretessOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = os.path.abspath(self._gen_outfilename()) return outputs @@ -1042,7 +1042,7 @@ class MRIMarchingCubes(FSCommand): input_spec = MRIMarchingCubesInputSpec output_spec = MRIMarchingCubesOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.surface = self._gen_outfilename() return outputs @@ -1113,7 +1113,7 @@ class SmoothTessellation(FSCommand): input_spec = SmoothTessellationInputSpec output_spec = SmoothTessellationOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.surface = self._gen_outfilename() return outputs @@ -1170,7 +1170,7 @@ class MakeAverageSubject(FSCommand): input_spec = MakeAverageSubjectInputSpec output_spec = MakeAverageSubjectOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.average_subject_name = self.inputs.out_name return outputs diff --git a/nipype/interfaces/fsl/epi.py b/nipype/interfaces/fsl/epi.py index 1ee9f64ebd..57b7543909 100644 --- a/nipype/interfaces/fsl/epi.py +++ b/nipype/interfaces/fsl/epi.py @@ -94,7 +94,7 @@ def _parse_inputs(self, skip=None): return super(PrepareFieldmap, self)._parse_inputs(skip=skip) - def _list_outputs(self): + def _post_run(self): self.outputs.out_fieldmap = self.inputs.out_fieldmap return outputs @@ -254,7 +254,7 @@ def _format_arg(self, name, trait_spec, value): raise ValueError('out_base path must exist if provided') return super(TOPUP, self)._format_arg(name, trait_spec, value) - def _list_outputs(self): + def _post_run(self): outputs = super(TOPUP, self)._list_outputs() del self.outputs.out_base base_path = None @@ -492,7 +492,7 @@ def _format_arg(self, name, spec, value): return spec.argstr % os.path.abspath(value) return super(Eddy, self)._format_arg(name, spec, value) - def _list_outputs(self): + def _post_run(self): self.outputs.out_corrected = os.path.abspath('%s.nii.gz' % self.inputs.out_base) self.outputs.out_parameter = os.path.abspath('%s.eddy_parameters' % self.inputs.out_base) @@ -545,7 +545,7 @@ class SigLoss(FSLCommand): output_spec = SigLossOuputSpec _cmd = 'sigloss' - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = self.inputs.out_file if ((not isdefined(self.outputs.out_file)) and @@ -649,7 +649,7 @@ class EpiReg(FSLCommand): input_spec = EpiRegInputSpec output_spec = EpiRegOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = os.path.join(os.getcwd(), self.inputs.out_base + '.nii.gz') @@ -788,7 +788,7 @@ def _gen_filename(self, name): return os.path.join(os.getcwd(), 'temp') return None - def _list_outputs(self): + def _post_run(self): if not isdefined(self.inputs.exfdw): self.outputs.exfdw = self._gen_filename('exfdw') diff --git a/nipype/interfaces/fsl/maths.py b/nipype/interfaces/fsl/maths.py index 08382f1d9e..84c37189a6 100644 --- a/nipype/interfaces/fsl/maths.py +++ b/nipype/interfaces/fsl/maths.py @@ -47,7 +47,7 @@ class MathsCommand(FSLCommand): output_spec = MathsOutput _suffix = "_maths" - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = self.inputs.out_file if not isdefined(self.inputs.out_file): @@ -264,7 +264,7 @@ class UnaryMaths(MathsCommand): """ input_spec = UnaryMathsInput - def _list_outputs(self): + def _post_run(self): self._suffix = "_" + self.inputs.operation return super(UnaryMaths, self)._list_outputs() diff --git a/nipype/interfaces/fsl/model.py b/nipype/interfaces/fsl/model.py index 38e3c0cbe7..6ec92797ee 100644 --- a/nipype/interfaces/fsl/model.py +++ b/nipype/interfaces/fsl/model.py @@ -343,7 +343,7 @@ def _run_interface(self, runtime): return runtime - def _list_outputs(self): + def _post_run(self): cwd = os.getcwd() self.outputs.fsf_files = [] @@ -453,7 +453,7 @@ def _get_design_root(self, infile): _, fname = os.path.split(infile) return fname.split('.')[0] - def _list_outputs(self): + def _post_run(self): # TODO: figure out file names and get rid off the globs root = self._get_design_root(list_to_filename(self.inputs.fsf_file)) design_file = glob(os.path.join(os.getcwd(), '%s*.mat' % root)) @@ -1491,7 +1491,7 @@ class MELODIC(FSLCommand): output_spec = MELODICOutputSpec _cmd = 'melodic' - def _list_outputs(self): + def _post_run(self): self.outputs.out_dir = self.inputs.out_dir if not isdefined(self.outputs.out_dir): @@ -1650,7 +1650,7 @@ class Cluster(FSLCommand): 'out_size_file': 'size', 'out_max_file': 'max', 'out_mean_file': 'mean', 'out_pval_file': 'pval'} - def _list_outputs(self): + def _post_run(self): for key, suffix in list(self.filemap.items()): outkey = key[4:] @@ -1780,7 +1780,7 @@ class Randomise(FSLCommand): input_spec = RandomiseInputSpec output_spec = RandomiseOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.tstat_files = glob(self._gen_fname( '%s_tstat*.nii' % self.inputs.base_name)) @@ -1916,7 +1916,7 @@ class GLM(FSLCommand): input_spec = GLMInputSpec output_spec = GLMOutputSpec - def _list_outputs(self): + def _post_run(self): outputs = super(GLM, self)._list_outputs() if isdefined(self.inputs.out_cope): diff --git a/nipype/interfaces/fsl/utils.py b/nipype/interfaces/fsl/utils.py index bd151d00f8..ac4d4a15ec 100644 --- a/nipype/interfaces/fsl/utils.py +++ b/nipype/interfaces/fsl/utils.py @@ -120,7 +120,7 @@ class ImageMeants(FSLCommand): input_spec = ImageMeantsInputSpec output_spec = ImageMeantsOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = self.inputs.out_file if not isdefined(self.outputs.out_file): @@ -320,7 +320,7 @@ def _format_arg(self, name, spec, value): return " ".join(map(str, sum(list(map(list, value)), []))) return super(ExtractROI, self)._format_arg(name, spec, value) - def _list_outputs(self): + def _post_run(self): """Create a Bunch which contains all possible files generated by running the interface. Some files are always generated, others depending on which ``inputs`` options are set. @@ -371,7 +371,7 @@ class Split(FSLCommand): input_spec = SplitInputSpec output_spec = SplitOutputSpec - def _list_outputs(self): + def _post_run(self): """Create a Bunch which contains all possible files generated by running the interface. Some files are always generated, others depending on which ``inputs`` options are set. @@ -443,7 +443,7 @@ def _gen_filename(self, name): def _parse_inputs(self, skip=None): return super(ImageMaths, self)._parse_inputs(skip=['suffix']) - def _list_outputs(self): + def _post_run(self): suffix = '_maths' # ohinds: build suffix if isdefined(self.inputs.suffix): suffix = self.inputs.suffix @@ -507,7 +507,7 @@ def _format_arg(self, name, trait_spec, value): return trait_spec.argstr % ",".join(map(str, list(range(1, n_cols + 1)))) return super(FilterRegressor, self)._format_arg(name, trait_spec, value) - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = self.inputs.out_file if not isdefined(self.outputs.out_file): @@ -1246,7 +1246,7 @@ def _gen_outfilename(self): suffix='_ps') return out_file - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = os.path.abspath(self._gen_outfilename()) return outputs @@ -1298,7 +1298,7 @@ class SigLoss(FSLCommand): output_spec = SigLossOuputSpec _cmd = 'sigloss' - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = self.inputs.out_file if not isdefined(self.outputs.out_file) and \ @@ -1346,7 +1346,7 @@ def _gen_filename(self, name): suffix="_reoriented") return None - def _list_outputs(self): + def _post_run(self): if not isdefined(self.inputs.out_file): self.outputs.out_file = self._gen_filename('out_file') @@ -1551,7 +1551,7 @@ def _get_output(self, name): output = self._gen_filename(name) return os.path.abspath(output) - def _list_outputs(self): + def _post_run(self): if self.inputs.complex_cartesian or self.inputs.complex_polar or \ self.inputs.complex_split or self.inputs.complex_merge: diff --git a/nipype/interfaces/meshfix.py b/nipype/interfaces/meshfix.py index 264f2d65e1..0e476be7ec 100644 --- a/nipype/interfaces/meshfix.py +++ b/nipype/interfaces/meshfix.py @@ -111,7 +111,7 @@ class MeshFix(CommandLine): input_spec = MeshFixInputSpec output_spec = MeshFixOutputSpec - def _list_outputs(self): + def _post_run(self): if isdefined(self.inputs.out_filename): path, name, ext = split_filename(self.inputs.out_filename) diff --git a/nipype/interfaces/minc/minc.py b/nipype/interfaces/minc/minc.py index 5c6b7ee101..7a66ed54ea 100644 --- a/nipype/interfaces/minc/minc.py +++ b/nipype/interfaces/minc/minc.py @@ -1697,7 +1697,7 @@ def _gen_output_base(self): # '_bluroutput' return output_base - def _list_outputs(self): + def _post_run(self): output_file_base = self._gen_output_base() @@ -2972,7 +2972,7 @@ class Gennlxfm(CommandLine): output_spec = GennlxfmOutputSpec _cmd = 'gennlxfm' - def _list_outputs(self): + def _post_run(self): outputs = super(Gennlxfm, self)._list_outputs() self.outputs.output_grid = re.sub( '.(nlxfm|xfm)$', '_grid_0.mnc', self.outputs.output_file) @@ -3036,7 +3036,7 @@ class XfmConcat(CommandLine): output_spec = XfmConcatOutputSpec _cmd = 'xfmconcat' - def _list_outputs(self): + def _post_run(self): outputs = super(XfmConcat, self)._list_outputs() if os.path.exists(self.outputs.output_file): @@ -3232,7 +3232,7 @@ def _gen_filename(self, name): else: raise NotImplemented - def _list_outputs(self): + def _post_run(self): self.outputs.output_xfm = os.path.abspath( self._gen_filename('output_xfm')) @@ -3337,7 +3337,7 @@ def _gen_filename(self, name): def _gen_outfilename(self): return self._gen_filename('output_file') - def _list_outputs(self): + def _post_run(self): self.outputs.output_file = os.path.abspath(self._gen_outfilename()) @@ -3411,7 +3411,7 @@ def _gen_filename(self, name): def _gen_outfilename(self): return self._gen_filename('output_file') - def _list_outputs(self): + def _post_run(self): self.outputs.output_file = os.path.abspath(self._gen_outfilename()) @@ -3673,7 +3673,7 @@ class VolSymm(CommandLine): output_spec = VolSymmOutputSpec _cmd = 'volsymm' - def _list_outputs(self): + def _post_run(self): outputs = super(VolSymm, self)._list_outputs() # Have to manually check for the grid files. diff --git a/nipype/interfaces/mne/base.py b/nipype/interfaces/mne/base.py index e70dc2960b..bb8d162843 100644 --- a/nipype/interfaces/mne/base.py +++ b/nipype/interfaces/mne/base.py @@ -73,7 +73,7 @@ def _get_files(self, path, key, dirval, altkey=None): globpattern = op.join(keydir, ''.join((globprefix, key, globsuffix))) return glob.glob(globpattern) - def _list_outputs(self): + def _post_run(self): subjects_dir = self.inputs.subjects_dir subject_path = op.join(subjects_dir, self.inputs.subject_id) diff --git a/nipype/interfaces/mrtrix/preprocess.py b/nipype/interfaces/mrtrix/preprocess.py index a907d8ab3b..6d32dda6b5 100644 --- a/nipype/interfaces/mrtrix/preprocess.py +++ b/nipype/interfaces/mrtrix/preprocess.py @@ -67,7 +67,7 @@ class MRConvert(CommandLine): input_spec = MRConvertInputSpec output_spec = MRConvertOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.converted = self.inputs.out_filename if not isdefined(self.outputs.converted): @@ -180,7 +180,7 @@ class Tensor2Vector(CommandLine): input_spec = Tensor2VectorInputSpec output_spec = Tensor2VectorOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.vector = self.inputs.out_filename if not isdefined(self.outputs.vector): @@ -229,7 +229,7 @@ class Tensor2FractionalAnisotropy(CommandLine): input_spec = Tensor2FractionalAnisotropyInputSpec output_spec = Tensor2FractionalAnisotropyOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.FA = self.inputs.out_filename if not isdefined(self.outputs.FA): @@ -278,7 +278,7 @@ class Tensor2ApparentDiffusion(CommandLine): input_spec = Tensor2ApparentDiffusionInputSpec output_spec = Tensor2ApparentDiffusionOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.ADC = self.inputs.out_filename if not isdefined(self.outputs.ADC): @@ -328,7 +328,7 @@ class MRMultiply(CommandLine): input_spec = MRMultiplyInputSpec output_spec = MRMultiplyOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = self.inputs.out_filename if not isdefined(self.outputs.out_file): @@ -377,7 +377,7 @@ class MRTrixViewer(CommandLine): input_spec = MRTrixViewerInputSpec output_spec = MRTrixViewerOutputSpec - def _list_outputs(self): + def _post_run(self): return @@ -407,7 +407,7 @@ class MRTrixInfo(CommandLine): input_spec = MRTrixInfoInputSpec output_spec = MRTrixInfoOutputSpec - def _list_outputs(self): + def _post_run(self): return @@ -442,7 +442,7 @@ class GenerateWhiteMatterMask(CommandLine): input_spec = GenerateWhiteMatterMaskInputSpec output_spec = GenerateWhiteMatterMaskOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.WMprobabilitymap = op.abspath(self._gen_outfilename()) return outputs @@ -488,7 +488,7 @@ class Erode(CommandLine): input_spec = ErodeInputSpec output_spec = ErodeOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = self.inputs.out_filename if not isdefined(self.outputs.out_file): @@ -546,7 +546,7 @@ class Threshold(CommandLine): input_spec = ThresholdInputSpec output_spec = ThresholdOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = self.inputs.out_filename if not isdefined(self.outputs.out_file): @@ -595,7 +595,7 @@ class MedianFilter3D(CommandLine): input_spec = MedianFilter3DInputSpec output_spec = MedianFilter3DOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = self.inputs.out_filename if not isdefined(self.outputs.out_file): @@ -653,7 +653,7 @@ class MRTransform(CommandLine): input_spec = MRTransformInputSpec output_spec = MRTransformOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = self.inputs.out_filename if not isdefined(self.outputs.out_file): diff --git a/nipype/interfaces/mrtrix/tensors.py b/nipype/interfaces/mrtrix/tensors.py index 2d80d8e334..e675434107 100644 --- a/nipype/interfaces/mrtrix/tensors.py +++ b/nipype/interfaces/mrtrix/tensors.py @@ -75,7 +75,7 @@ class DWI2SphericalHarmonicsImage(CommandLine): input_spec = DWI2SphericalHarmonicsImageInputSpec output_spec = DWI2SphericalHarmonicsImageOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.spherical_harmonics_image = self.inputs.out_filename if not isdefined(self.outputs.spherical_harmonics_image): @@ -158,7 +158,7 @@ class ConstrainedSphericalDeconvolution(CommandLine): input_spec = ConstrainedSphericalDeconvolutionInputSpec output_spec = ConstrainedSphericalDeconvolutionOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.spherical_harmonics_image = self.inputs.out_filename if not isdefined(self.outputs.spherical_harmonics_image): @@ -212,7 +212,7 @@ class EstimateResponseForSH(CommandLine): input_spec = EstimateResponseForSHInputSpec output_spec = EstimateResponseForSHOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.response = self.inputs.out_filename if not isdefined(self.outputs.response): @@ -296,7 +296,7 @@ def _run_interface(self, runtime): encoding = concat_files(self.inputs.bvec_file, self.inputs.bval_file, self.inputs.invert_x, self.inputs.invert_y, self.inputs.invert_z) return runtime - def _list_outputs(self): + def _post_run(self): self.outputs.encoding_file = op.abspath(self._gen_filename('out_encoding_file')) return outputs diff --git a/nipype/interfaces/mrtrix/tracking.py b/nipype/interfaces/mrtrix/tracking.py index ddc21eb095..807dea3b64 100644 --- a/nipype/interfaces/mrtrix/tracking.py +++ b/nipype/interfaces/mrtrix/tracking.py @@ -107,7 +107,7 @@ class Tracks2Prob(CommandLine): input_spec = Tracks2ProbInputSpec output_spec = Tracks2ProbOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.tract_image = self.inputs.out_filename if not isdefined(self.outputs.tract_image): diff --git a/nipype/interfaces/mrtrix3/connectivity.py b/nipype/interfaces/mrtrix3/connectivity.py index 63497e7cc4..7d90ec97c1 100644 --- a/nipype/interfaces/mrtrix3/connectivity.py +++ b/nipype/interfaces/mrtrix3/connectivity.py @@ -104,7 +104,7 @@ class BuildConnectome(MRTrix3Base): input_spec = BuildConnectomeInputSpec output_spec = BuildConnectomeOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs @@ -181,7 +181,7 @@ def _parse_inputs(self, skip=None): return super(LabelConfig, self)._parse_inputs(skip=skip) - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs diff --git a/nipype/interfaces/mrtrix3/preprocess.py b/nipype/interfaces/mrtrix3/preprocess.py index d40476a00d..f09af47af0 100644 --- a/nipype/interfaces/mrtrix3/preprocess.py +++ b/nipype/interfaces/mrtrix3/preprocess.py @@ -105,7 +105,7 @@ class ResponseSD(MRTrix3Base): input_spec = ResponseSDInputSpec output_spec = ResponseSDOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = op.abspath(self.inputs.out_file) @@ -148,7 +148,7 @@ class ACTPrepareFSL(CommandLine): input_spec = ACTPrepareFSLInputSpec output_spec = ACTPrepareFSLOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs @@ -195,7 +195,7 @@ class ReplaceFSwithFIRST(CommandLine): input_spec = ReplaceFSwithFIRSTInputSpec output_spec = ReplaceFSwithFIRSTOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs diff --git a/nipype/interfaces/mrtrix3/reconst.py b/nipype/interfaces/mrtrix3/reconst.py index a14fc13927..6a6d4023b2 100644 --- a/nipype/interfaces/mrtrix3/reconst.py +++ b/nipype/interfaces/mrtrix3/reconst.py @@ -71,7 +71,7 @@ class FitTensor(MRTrix3Base): input_spec = FitTensorInputSpec output_spec = FitTensorOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs @@ -187,7 +187,7 @@ class EstimateFOD(MRTrix3Base): input_spec = EstimateFODInputSpec output_spec = EstimateFODOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs diff --git a/nipype/interfaces/mrtrix3/tracking.py b/nipype/interfaces/mrtrix3/tracking.py index 391fb6407f..a1aaad27fd 100644 --- a/nipype/interfaces/mrtrix3/tracking.py +++ b/nipype/interfaces/mrtrix3/tracking.py @@ -248,7 +248,7 @@ def _format_arg(self, name, trait_spec, value): return super(Tractography, self)._format_arg(name, trait_spec, value) - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs diff --git a/nipype/interfaces/mrtrix3/utils.py b/nipype/interfaces/mrtrix3/utils.py index f54f3c0a29..219826529d 100644 --- a/nipype/interfaces/mrtrix3/utils.py +++ b/nipype/interfaces/mrtrix3/utils.py @@ -56,7 +56,7 @@ class BrainMask(CommandLine): input_spec = BrainMaskInputSpec output_spec = BrainMaskOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs @@ -103,7 +103,7 @@ class Mesh2PVE(CommandLine): input_spec = Mesh2PVEInputSpec output_spec = Mesh2PVEOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs @@ -150,7 +150,7 @@ class Generate5tt(CommandLine): input_spec = Generate5ttInputSpec output_spec = Generate5ttOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs @@ -207,7 +207,7 @@ class TensorMetrics(CommandLine): input_spec = TensorMetricsInputSpec output_spec = TensorMetricsOutputSpec - def _list_outputs(self): + def _post_run(self): for k in list(outputs.keys()): @@ -347,7 +347,7 @@ class ComputeTDI(MRTrix3Base): input_spec = ComputeTDIInputSpec output_spec = ComputeTDIOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs @@ -398,7 +398,7 @@ class TCK2VTK(MRTrix3Base): input_spec = TCK2VTKInputSpec output_spec = TCK2VTKOutputSpec - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = op.abspath(self.inputs.out_file) return outputs diff --git a/nipype/interfaces/nipy/preprocess.py b/nipype/interfaces/nipy/preprocess.py index a6b6937702..a30713c2f3 100644 --- a/nipype/interfaces/nipy/preprocess.py +++ b/nipype/interfaces/nipy/preprocess.py @@ -372,7 +372,7 @@ def _run_interface(self, runtime): nb.save(nii2, out_file) return runtime - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = self.inputs.out_file if not isdefined(self.outputs.out_file): diff --git a/nipype/interfaces/nitime/analysis.py b/nipype/interfaces/nitime/analysis.py index 245cf2808f..c21805358d 100644 --- a/nipype/interfaces/nitime/analysis.py +++ b/nipype/interfaces/nitime/analysis.py @@ -167,7 +167,7 @@ def _run_interface(self, runtime): return runtime # Rewrite _list_outputs (look at BET) - def _list_outputs(self): + def _post_run(self): # if isdefined(self.inputs.output_csv_file): diff --git a/nipype/interfaces/petpvc.py b/nipype/interfaces/petpvc.py index 76256bc4c1..7e3fc16291 100644 --- a/nipype/interfaces/petpvc.py +++ b/nipype/interfaces/petpvc.py @@ -162,7 +162,7 @@ class PETPVC(CommandLine): output_spec = PETPVCOutputSpec _cmd = 'petpvc' - def _list_outputs(self): + def _post_run(self): self.outputs.out_file = self.inputs.out_file if not isdefined(self.outputs.out_file): diff --git a/nipype/interfaces/spm/base.py b/nipype/interfaces/spm/base.py index 0ca470d0ed..ee16b52846 100644 --- a/nipype/interfaces/spm/base.py +++ b/nipype/interfaces/spm/base.py @@ -318,7 +318,7 @@ def _run_interface(self, runtime): runtime.merged = results.runtime.merged return runtime - def _list_outputs(self): + def _post_run(self): """Determine the expected outputs based on inputs.""" raise NotImplementedError diff --git a/nipype/interfaces/spm/preprocess.py b/nipype/interfaces/spm/preprocess.py index b1bc4fa323..81dd1ab016 100644 --- a/nipype/interfaces/spm/preprocess.py +++ b/nipype/interfaces/spm/preprocess.py @@ -342,7 +342,7 @@ def _parse_inputs(self): jobtype = self.inputs.jobtype return [{'%s' % (jobtype): einputs[0]}] - def _list_outputs(self): + def _post_run(self): if self.inputs.jobtype == "estimate": if isdefined(self.inputs.apply_to_files): @@ -476,7 +476,7 @@ def _parse_inputs(self): einputs[0]['subj']['resample'] = scans_for_fname(self.inputs.source) return [{'%s' % (jobtype): einputs[0]}] - def _list_outputs(self): + def _post_run(self): jobtype = self.inputs.jobtype if jobtype.startswith('est'): @@ -637,7 +637,7 @@ def _parse_inputs(self, skip=()): einputs[0]['subj']['resample'] = scans_for_fname(self.inputs.image_to_align) return [{'%s' % (jobtype): einputs[0]}] - def _list_outputs(self): + def _post_run(self): jobtype = self.inputs.jobtype if jobtype.startswith('est'): @@ -1513,7 +1513,7 @@ class VBMSegment(SPMCommand): _jobtype = 'tools' _jobname = 'vbm8' - def _list_outputs(self): + def _post_run(self): do_dartel = self.inputs.spatial_normalization dartel_px = '' diff --git a/nipype/interfaces/spm/utils.py b/nipype/interfaces/spm/utils.py index b7e3ea816b..8b60cdbc1f 100644 --- a/nipype/interfaces/spm/utils.py +++ b/nipype/interfaces/spm/utils.py @@ -172,7 +172,7 @@ def _make_matlab_command(self, _): # spm_get_space(infile, transform.M * img_space); return script - def _list_outputs(self): + def _post_run(self): if not isdefined(self.inputs.out_file): self.outputs.out_file = os.path.abspath(self._gen_outfilename()) @@ -454,7 +454,7 @@ def _run_interface(self, runtime): os.mkdir(od) return super(DicomImport, self)._run_interface(runtime) - def _list_outputs(self): + def _post_run(self): from glob import glob od = os.path.abspath(self.inputs.output_dir) diff --git a/nipype/interfaces/tests/test_base.py b/nipype/interfaces/tests/test_base.py index 92f7759087..b5844a795e 100644 --- a/nipype/interfaces/tests/test_base.py +++ b/nipype/interfaces/tests/test_base.py @@ -568,7 +568,7 @@ class DerivedInterface1(nib.BaseInterface): def _run_interface(self, runtime): return runtime - def _list_outputs(self): + def _post_run(self): return {'foo': 1} obj = DerivedInterface1() yield assert_raises, KeyError, obj.run diff --git a/nipype/pipeline/engine/tests/test_join.py b/nipype/pipeline/engine/tests/test_join.py index 28e54fe4ac..a494ee946d 100644 --- a/nipype/pipeline/engine/tests/test_join.py +++ b/nipype/pipeline/engine/tests/test_join.py @@ -79,7 +79,7 @@ def _run_interface(self, runtime): runtime.returncode = 0 return runtime - def _list_outputs(self): + def _post_run(self): global _sum global _sum_operands self.outputs.operands = self.inputs.input1 @@ -109,7 +109,7 @@ def _run_interface(self, runtime): runtime.returncode = 0 return runtime - def _list_outputs(self): + def _post_run(self): global _set_len _set_len = self.outputs.output1 = len(self.inputs.input1) return outputs @@ -136,7 +136,7 @@ def _run_interface(self, runtime): runtime.returncode = 0 return runtime - def _list_outputs(self): + def _post_run(self): global _products self.outputs.output1 = self.inputs.input1 * self.inputs.input2 _products.append(self.outputs.output1) From 40a67731330e41aaff8773770616d75a05bbe65b Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 17 Feb 2016 10:07:01 -0800 Subject: [PATCH 36/73] remove all return outputs --- nipype/interfaces/afni/preprocess.py | 20 +++----- nipype/interfaces/ants/legacy.py | 5 +- nipype/interfaces/ants/resampling.py | 9 ++-- nipype/interfaces/ants/segmentation.py | 20 +++----- nipype/interfaces/ants/utils.py | 11 ++-- nipype/interfaces/ants/visualization.py | 5 +- nipype/interfaces/camino/calib.py | 6 +-- nipype/interfaces/camino/connectivity.py | 3 +- nipype/interfaces/camino/convert.py | 27 ++++------ nipype/interfaces/camino/dti.py | 30 ++++------- nipype/interfaces/camino/odf.py | 12 ++--- nipype/interfaces/camino/utils.py | 3 +- nipype/interfaces/camino2trackvis/convert.py | 6 +-- nipype/interfaces/cmtk/cmtk.py | 8 ++- nipype/interfaces/cmtk/convert.py | 5 +- nipype/interfaces/cmtk/nbs.py | 3 +- nipype/interfaces/cmtk/nx.py | 6 +-- nipype/interfaces/cmtk/parcellation.py | 3 +- nipype/interfaces/dcm2nii.py | 3 +- nipype/interfaces/dcmstack.py | 20 +++----- nipype/interfaces/diffusion_toolkit/dti.py | 5 +- nipype/interfaces/diffusion_toolkit/odf.py | 8 ++- .../interfaces/diffusion_toolkit/postproc.py | 5 +- nipype/interfaces/dipy/preprocess.py | 6 +-- nipype/interfaces/dipy/reconstruction.py | 8 ++- nipype/interfaces/dipy/simulate.py | 3 +- nipype/interfaces/dipy/tensors.py | 5 +- nipype/interfaces/dipy/tracks.py | 6 +-- nipype/interfaces/dynamic_slicer.py | 3 +- nipype/interfaces/elastix/registration.py | 11 ++-- nipype/interfaces/elastix/utils.py | 3 +- nipype/interfaces/freesurfer/model.py | 21 +++----- nipype/interfaces/freesurfer/preprocess.py | 30 ++++------- nipype/interfaces/freesurfer/utils.py | 39 +++++--------- nipype/interfaces/fsl/epi.py | 18 +++---- nipype/interfaces/fsl/maths.py | 3 +- nipype/interfaces/fsl/model.py | 44 ++++++---------- nipype/interfaces/fsl/preprocess.py | 21 +++----- nipype/interfaces/fsl/utils.py | 51 +++++++------------ nipype/interfaces/meshfix.py | 3 +- nipype/interfaces/minc/minc.py | 20 +++----- nipype/interfaces/mne/base.py | 2 +- nipype/interfaces/mrtrix/convert.py | 3 +- nipype/interfaces/mrtrix/preprocess.py | 30 ++++------- nipype/interfaces/mrtrix/tensors.py | 12 ++--- nipype/interfaces/mrtrix/tracking.py | 3 +- nipype/interfaces/mrtrix3/connectivity.py | 5 +- nipype/interfaces/mrtrix3/preprocess.py | 8 ++- nipype/interfaces/mrtrix3/reconst.py | 5 +- nipype/interfaces/mrtrix3/tracking.py | 2 +- nipype/interfaces/mrtrix3/utils.py | 17 +++---- nipype/interfaces/nipy/model.py | 5 +- nipype/interfaces/nipy/preprocess.py | 11 ++-- nipype/interfaces/nipy/utils.py | 2 +- nipype/interfaces/nitime/analysis.py | 3 +- nipype/interfaces/petpvc.py | 3 +- nipype/interfaces/spm/model.py | 21 +++----- nipype/interfaces/spm/preprocess.py | 39 +++++--------- nipype/interfaces/spm/utils.py | 20 +++----- nipype/pipeline/engine/tests/test_join.py | 15 ++---- nipype/pipeline/engine/tests/test_utils.py | 3 +- nipype/pipeline/engine/utils.py | 3 +- nipype/pipeline/plugins/tests/test_debug.py | 3 +- nipype/pipeline/plugins/tests/test_linear.py | 3 +- .../pipeline/plugins/tests/test_multiproc.py | 3 +- nipype/pipeline/plugins/tests/test_oar.py | 3 +- nipype/pipeline/plugins/tests/test_pbs.py | 3 +- .../pipeline/plugins/tests/test_somaflow.py | 3 +- 68 files changed, 258 insertions(+), 490 deletions(-) diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index 6c19072bad..aa31c85cec 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -210,8 +210,7 @@ class Refit(AFNICommandBase): def _post_run(self): self.outputs.out_file = os.path.abspath(self.inputs.in_file) - return outputs - + class WarpInputSpec(AFNICommandInputSpec): @@ -1168,8 +1167,7 @@ def _post_run(self): suffix=self.inputs.suffix) else: self.outputs.out_file = os.path.abspath(self.inputs.out_file) - return outputs - + def _gen_filename(self, name): if name == 'out_file': return getattr(self.outputs, name) @@ -1535,8 +1533,7 @@ def aggregate_outputs(self, runtime=None, needed_outputs=None): save_json(outfile, dict(stat=min_val)) outputs.min_val = min_val - return outputs - + class ROIStatsInputSpec(CommandLineInputSpec): in_file = File(desc='input file to 3dROIstats', @@ -1600,8 +1597,7 @@ def aggregate_outputs(self, runtime=None, needed_outputs=None): f.close() outputs.stats = os.path.abspath(output_filename) - return outputs - + class CalcInputSpec(AFNICommandInputSpec): in_file_a = File(desc='input file to 3dcalc', @@ -1893,8 +1889,7 @@ def aggregate_outputs(self, runtime=None, needed_outputs=None): d[k] = int(d[k]) outputs.set(**d) outputs.set(out_file=self._gen_filename('out_file')) - return outputs - + def _gen_filename(self, name): if name == 'out_file' and (not isdefined(self.inputs.out_file)): return Undefined @@ -2198,8 +2193,7 @@ def _post_run(self): self.outputs.out_file += '.niml.hist' if not self.inputs.showhist: self.outputs.out_show = Undefined - return outputs - + class FWHMxInputSpec(CommandLineInputSpec): in_file = File(desc='input dataset', argstr='-input %s', mandatory=True, exists=True) @@ -2408,4 +2402,4 @@ def _post_run(self): self.outputs.out_acf = op.abspath(self.inputs.acf) self.outputs.fwhm = tuple(sout) - return outputs + \ No newline at end of file diff --git a/nipype/interfaces/ants/legacy.py b/nipype/interfaces/ants/legacy.py index b1c35ee4ac..8e8e1f00b5 100644 --- a/nipype/interfaces/ants/legacy.py +++ b/nipype/interfaces/ants/legacy.py @@ -118,8 +118,7 @@ def _post_run(self): self.inputs.out_prefix + 'deformed.nii.gz') - return outputs - + # How do we make a pass through so that GenWarpFields is just an alias for antsIntroduction ? @@ -256,4 +255,4 @@ def _post_run(self): base))) for file_ in temp: self.outputs.subject_outfiles.append(file_) - return outputs + \ No newline at end of file diff --git a/nipype/interfaces/ants/resampling.py b/nipype/interfaces/ants/resampling.py index 4cbd333ef6..edd242fba2 100644 --- a/nipype/interfaces/ants/resampling.py +++ b/nipype/interfaces/ants/resampling.py @@ -96,8 +96,7 @@ def _post_run(self): ''.join((name, self.inputs.out_postfix, ext))) - return outputs - + def _run_interface(self, runtime, correct_return_codes=[0]): runtime = super(WarpTimeSeriesImageMultiTransform, self)._run_interface(runtime, correct_return_codes=[0, 1]) if "100 % complete" not in runtime.stdout: @@ -204,8 +203,7 @@ def _post_run(self): else: self.outputs.output_image = os.path.abspath( self._gen_filename('output_image')) - return outputs - + class ApplyTransformsInputSpec(ANTSCommandInputSpec): dimension = traits.Enum(2, 3, 4, argstr='--dimensionality %d', @@ -350,8 +348,7 @@ def _format_arg(self, opt, spec, val): def _post_run(self): self.outputs.output_image = os.path.abspath( self._gen_filename('output_image')) - return outputs - + class ApplyTransformsToPointsInputSpec(ANTSCommandInputSpec): dimension = traits.Enum(2, 3, 4, argstr='--dimensionality %d', diff --git a/nipype/interfaces/ants/segmentation.py b/nipype/interfaces/ants/segmentation.py index c0e4dc5da8..e9662136e1 100644 --- a/nipype/interfaces/ants/segmentation.py +++ b/nipype/interfaces/ants/segmentation.py @@ -169,8 +169,7 @@ def _post_run(self): self.outputs.posteriors = [] for i in range(self.inputs.number_of_tissue_classes): self.outputs.posteriors.append(os.path.abspath(self.inputs.output_posteriors_name_template % (i + 1))) - return outputs - + class LaplacianThicknessInputSpec(ANTSCommandInputSpec): input_wm = File(argstr='%s', mandatory=True, copyfile=True, @@ -229,8 +228,7 @@ def _post_run(self): ''.join((name, self.inputs.output_image, ext))) - return outputs - + class N4BiasFieldCorrectionInputSpec(ANTSCommandInputSpec): dimension = traits.Enum(3, 2, argstr='-d %d', @@ -376,8 +374,7 @@ def _post_run(self): if self.inputs.save_bias or isdefined(self.inputs.bias_image): self.outputs.bias_image = os.path.abspath( self._gen_filename('bias_image')) - return outputs - + class CorticalThicknessInputSpec(ANTSCommandInputSpec): dimension = traits.Enum(3, 2, argstr='-d %d', usedefault=True, @@ -591,8 +588,7 @@ def _post_run(self): self.outputs.BrainVolumes = os.path.join(os.getcwd(), self.inputs.out_prefix + 'brainvols.csv') - return outputs - + class antsCorticalThickness(CorticalThickness): DeprecationWarning('This class has been replaced by CorticalThickness and will be removed in version 0.13') @@ -676,8 +672,7 @@ def _post_run(self): self.inputs.out_prefix + 'BrainExtractionBrain.' + self.inputs.image_suffix) - return outputs - + class antsBrainExtraction(BrainExtraction): DeprecationWarning('This class has been replaced by BrainExtraction and will be removed in version 0.13') @@ -788,8 +783,7 @@ def _format_arg(self, opt, spec, val): def _post_run(self): self.outputs.output_label_image = os.path.abspath( self.inputs.output_label_image) - return outputs - + class DenoiseImageInputSpec(ANTSCommandInputSpec): dimension = traits.Enum(2, 3, 4, argstr='-d %d', usedefault=False, @@ -1059,4 +1053,4 @@ def _post_run(self): outputs['out_atlas_voting_weight_name_format'] = os.path.abspath( self.inputs.out_atlas_voting_weight_name_format) - return outputs + \ No newline at end of file diff --git a/nipype/interfaces/ants/utils.py b/nipype/interfaces/ants/utils.py index 66dc532532..8dd99f5b96 100644 --- a/nipype/interfaces/ants/utils.py +++ b/nipype/interfaces/ants/utils.py @@ -48,8 +48,7 @@ def _format_arg(self, opt, spec, val): def _post_run(self): self.outputs.affine_transform = os.path.abspath( self.inputs.output_affine_transform) - return outputs - + class AverageImagesInputSpec(ANTSCommandInputSpec): dimension = traits.Enum(3, 2, argstr='%d', mandatory=True, @@ -89,8 +88,7 @@ def _format_arg(self, opt, spec, val): def _post_run(self): self.outputs.output_average_image = os.path.realpath( self.inputs.output_average_image) - return outputs - + class MultiplyImagesInputSpec(ANTSCommandInputSpec): dimension = traits.Enum(3, 2, argstr='%d', usedefault=False, mandatory=True, position=0, @@ -129,8 +127,7 @@ def _format_arg(self, opt, spec, val): def _post_run(self): self.outputs.output_product_image = os.path.abspath( self.inputs.output_product_image) - return outputs - + class JacobianDeterminantInputSpec(ANTSCommandInputSpec): dimension = traits.Enum(3, 2, argstr='%d', usedefault=False, mandatory=True, @@ -191,4 +188,4 @@ def _post_run(self): else: self.outputs.jacobian_image = os.path.abspath( self._gen_filename('output_prefix') + 'jacobian.nii.gz') - return outputs + \ No newline at end of file diff --git a/nipype/interfaces/ants/visualization.py b/nipype/interfaces/ants/visualization.py index c4e66f9c53..98efd559e5 100644 --- a/nipype/interfaces/ants/visualization.py +++ b/nipype/interfaces/ants/visualization.py @@ -67,8 +67,7 @@ def _format_arg(self, opt, spec, val): def _post_run(self): self.outputs.output_image = os.path.join(os.getcwd(), self.inputs.output_image) - return outputs - + class CreateTiledMosaicInputSpec(ANTSCommandInputSpec): input_image = File(argstr='-i %s', exists=True, @@ -151,4 +150,4 @@ class CreateTiledMosaic(ANTSCommand): def _post_run(self): self.outputs.output_image = os.path.join(os.getcwd(), self.inputs.output_image) - return outputs + \ No newline at end of file diff --git a/nipype/interfaces/camino/calib.py b/nipype/interfaces/camino/calib.py index 43671d7243..d74b103599 100644 --- a/nipype/interfaces/camino/calib.py +++ b/nipype/interfaces/camino/calib.py @@ -124,8 +124,7 @@ def _post_run(self): self.outputs.PICOCalib = os.path.abspath(self._gen_outfilename()) self.outputs.calib_info = os.path.abspath(self.inputs.info_file) - return outputs - + def _gen_outfilename(self): _, name, _ = split_filename(self.inputs.scheme_file) return name + '_PICOCalib.Bfloat' @@ -231,7 +230,6 @@ def _post_run(self): self.outputs.lut_one_fibre = self.inputs.outputstem + '_oneFibreSurfaceCoeffs.Bdouble' self.outputs.lut_two_fibres = self.inputs.outputstem + '_twoFibreSurfaceCoeffs.Bdouble' - return outputs - + def _gen_outfilename(self): return '/dev/null' diff --git a/nipype/interfaces/camino/connectivity.py b/nipype/interfaces/camino/connectivity.py index 1557fe3168..099b2d92b4 100644 --- a/nipype/interfaces/camino/connectivity.py +++ b/nipype/interfaces/camino/connectivity.py @@ -137,8 +137,7 @@ def _post_run(self): output_root = self._gen_outputroot() self.outputs.conmat_sc = os.path.abspath(output_root + "sc.csv") self.outputs.conmat_ts = os.path.abspath(output_root + "ts.csv") - return outputs - + def _gen_outfilename(self): return self._gen_outputroot() diff --git a/nipype/interfaces/camino/convert.py b/nipype/interfaces/camino/convert.py index 1904503000..2ea8a8446a 100644 --- a/nipype/interfaces/camino/convert.py +++ b/nipype/interfaces/camino/convert.py @@ -59,8 +59,7 @@ class Image2Voxel(StdOutCommandLine): def _post_run(self): self.outputs.voxel_order = os.path.abspath(self._gen_outfilename()) - return outputs - + def _gen_outfilename(self): _, name, _ = split_filename(self.inputs.in_file) return name + '.B' + self.inputs.out_type @@ -117,8 +116,7 @@ class FSL2Scheme(StdOutCommandLine): def _post_run(self): self.outputs.scheme = os.path.abspath(self._gen_outfilename()) - return outputs - + def _gen_outfilename(self): _, name, _ = split_filename(self.inputs.bvec_file) return name + '.scheme' @@ -173,8 +171,7 @@ class VtkStreamlines(StdOutCommandLine): def _post_run(self): self.outputs.vtk = os.path.abspath(self._gen_outfilename()) - return outputs - + def _gen_outfilename(self): _, name, _ = split_filename(self.inputs.in_file) return name + '.vtk' @@ -302,8 +299,7 @@ def _post_run(self): self.outputs.proc = os.path.abspath(self._gen_outfilename()) self.outputs.outputroot_files = self.outputroot_files - return outputs - + def _gen_outfilename(self): _, name, _ = split_filename(self.inputs.in_file) return name + '_proc' @@ -354,8 +350,7 @@ class TractShredder(StdOutCommandLine): def _post_run(self): self.outputs.shredded = os.path.abspath(self._gen_outfilename()) - return outputs - + def _gen_outfilename(self): _, name, _ = split_filename(self.inputs.in_file) return name + "_shredded" @@ -396,8 +391,7 @@ def _post_run(self): self.outputs.dt = os.path.abspath(output_root + "dt.nii") self.outputs.exitcode = os.path.abspath(output_root + "exitcode.nii") self.outputs.lns0 = os.path.abspath(output_root + "lns0.nii") - return outputs - + def _gen_outfilename(self): return self._gen_outputroot() @@ -476,8 +470,7 @@ class NIfTIDT2Camino(CommandLine): def _post_run(self): self.outputs.out_file = self._gen_filename('out_file') - return outputs - + def _gen_filename(self, name): if name == 'out_file': _, filename, _ = split_filename(self.inputs.in_file) @@ -630,8 +623,7 @@ class AnalyzeHeader(StdOutCommandLine): def _post_run(self): self.outputs.header = os.path.abspath(self._gen_outfilename()) - return outputs - + def _gen_outfilename(self): _, name, _ = split_filename(self.inputs.in_file) return name + ".hdr" @@ -684,8 +676,7 @@ class Shredder(StdOutCommandLine): def _post_run(self): self.outputs.shredded_file = os.path.abspath(self._gen_outfilename()) - return outputs - + def _gen_outfilename(self): _, name, _ = split_filename(self.inputs.in_file) return name + "_shredded" diff --git a/nipype/interfaces/camino/dti.py b/nipype/interfaces/camino/dti.py index 2c35664d0f..1702f31fdc 100644 --- a/nipype/interfaces/camino/dti.py +++ b/nipype/interfaces/camino/dti.py @@ -64,8 +64,7 @@ class DTIFit(StdOutCommandLine): def _post_run(self): self.outputs.tensor_fitted = os.path.abspath(self._gen_outfilename()) - return outputs - + def _gen_outfilename(self): _, name, _ = split_filename(self.inputs.in_file) return name + '_DT.Bdouble' @@ -150,8 +149,7 @@ class DTMetric(CommandLine): def _post_run(self): self.outputs.metric_stats = os.path.abspath(self._gen_outfilename()) - return outputs - + def _gen_outfilename(self): return self._gen_outputfile() @@ -254,8 +252,7 @@ class ModelFit(StdOutCommandLine): def _post_run(self): self.outputs.fitted_data = os.path.abspath(self._gen_outfilename()) - return outputs - + def _gen_outfilename(self): _, name, _ = split_filename(self.inputs.in_file) return name + '_fit.Bdouble' @@ -336,8 +333,7 @@ class DTLUTGen(StdOutCommandLine): def _post_run(self): self.outputs.dtLUT = os.path.abspath(self._gen_outfilename()) - return outputs - + def _gen_outfilename(self): _, name, _ = split_filename(self.inputs.scheme_file) return name + '.dat' @@ -400,8 +396,7 @@ class PicoPDFs(StdOutCommandLine): def _post_run(self): self.outputs.pdfs = os.path.abspath(self._gen_outfilename()) - return outputs - + def _gen_outfilename(self): _, name, _ = split_filename(self.inputs.in_file) return name + '_pdfs.Bdouble' @@ -571,8 +566,7 @@ def _post_run(self): else: out_file_path = os.path.abspath(self._gen_outfilename()) self.outputs.tracked = out_file_path - return outputs - + def _gen_filename(self, name): if name is 'out_file': return self._gen_outfilename() @@ -875,8 +869,7 @@ class ComputeMeanDiffusivity(StdOutCommandLine): def _post_run(self): self.outputs.md = os.path.abspath(self._gen_outfilename()) - return outputs - + def _gen_outfilename(self): _, name, _ = split_filename(self.inputs.in_file) return name + "_MD.img" # Need to change to self.inputs.outputdatatype @@ -937,8 +930,7 @@ class ComputeFractionalAnisotropy(StdOutCommandLine): def _post_run(self): self.outputs.fa = os.path.abspath(self._gen_outfilename()) - return outputs - + def _gen_outfilename(self): _, name, _ = split_filename(self.inputs.in_file) return name + '_FA.Bdouble' # Need to change to self.inputs.outputdatatype @@ -1001,8 +993,7 @@ class ComputeTensorTrace(StdOutCommandLine): def _post_run(self): self.outputs.trace = os.path.abspath(self._gen_outfilename()) - return outputs - + def _gen_outfilename(self): _, name, _ = split_filename(self.inputs.in_file) return name + '_TrD.img' # Need to change to self.inputs.outputdatatype @@ -1061,8 +1052,7 @@ class ComputeEigensystem(StdOutCommandLine): def _post_run(self): self.outputs.eigen = os.path.abspath(self._gen_outfilename()) - return outputs - + def _gen_outfilename(self): _, name, _ = split_filename(self.inputs.in_file) datatype = self.inputs.outputdatatype diff --git a/nipype/interfaces/camino/odf.py b/nipype/interfaces/camino/odf.py index 4e8c8453db..2d8d6f1754 100644 --- a/nipype/interfaces/camino/odf.py +++ b/nipype/interfaces/camino/odf.py @@ -85,8 +85,7 @@ class QBallMX(StdOutCommandLine): def _post_run(self): self.outputs.qmat = os.path.abspath(self._gen_outfilename()) - return outputs - + def _gen_outfilename(self): _, name, _ = split_filename(self.inputs.scheme_file) return name + '_qmat.Bdouble' @@ -162,8 +161,7 @@ class LinRecon(StdOutCommandLine): def _post_run(self): self.outputs.recon_data = os.path.abspath(self._gen_outfilename()) - return outputs - + def _gen_outfilename(self): _, name, _ = split_filename(self.inputs.scheme_file) return name + '_recondata.Bdouble' @@ -286,8 +284,7 @@ class MESD(StdOutCommandLine): def _post_run(self): self.outputs.mesd_data = os.path.abspath(self._gen_outfilename()) - return outputs - + def _gen_outfilename(self): _, name, _ = split_filename(self.inputs.scheme_file) return name + '_MESD.Bdouble' @@ -433,8 +430,7 @@ class SFPeaks(StdOutCommandLine): def _post_run(self): self.outputs.peaks = os.path.abspath(self._gen_outfilename()) - return outputs - + def _gen_outfilename(self): _, name, _ = split_filename(self.inputs.in_file) return name + '_peaks.Bdouble' diff --git a/nipype/interfaces/camino/utils.py b/nipype/interfaces/camino/utils.py index a8be3ff81f..da68872341 100644 --- a/nipype/interfaces/camino/utils.py +++ b/nipype/interfaces/camino/utils.py @@ -58,8 +58,7 @@ class ImageStats(CommandLine): def _post_run(self): self.outputs.out_file = os.path.abspath(self._gen_outfilename()) - return outputs - + def _gen_outfilename(self): output_root = self.inputs.output_root first_file = self.inputs.in_files[0] diff --git a/nipype/interfaces/camino2trackvis/convert.py b/nipype/interfaces/camino2trackvis/convert.py index c65da67d96..94291a55b2 100644 --- a/nipype/interfaces/camino2trackvis/convert.py +++ b/nipype/interfaces/camino2trackvis/convert.py @@ -76,8 +76,7 @@ class Camino2Trackvis(CommandLine): def _post_run(self): self.outputs.trackvis = os.path.abspath(self._gen_outfilename()) - return outputs - + def _gen_filename(self, name): if name is 'out_file': return self._gen_outfilename() @@ -127,8 +126,7 @@ class Trackvis2Camino(CommandLine): def _post_run(self): self.outputs.camino = os.path.abspath(self._gen_outfilename()) - return outputs - + def _gen_filename(self, name): if name is 'out_file': return self._gen_outfilename() diff --git a/nipype/interfaces/cmtk/cmtk.py b/nipype/interfaces/cmtk/cmtk.py index dfb9ecff3e..ff293f3912 100644 --- a/nipype/interfaces/cmtk/cmtk.py +++ b/nipype/interfaces/cmtk/cmtk.py @@ -566,8 +566,7 @@ def _post_run(self): self.outputs.filtered_tractography_by_intersections = op.abspath(endpoint_name + '_intersections_streamline_final.trk') self.outputs.filtered_tractographies = [self.outputs.filtered_tractography, self.outputs.filtered_tractography_by_intersections] self.outputs.stats_file = op.abspath(endpoint_name + '_statistics.mat') - return outputs - + def _gen_outfilename(self, ext): if ext.endswith("mat") and isdefined(self.inputs.out_matrix_mat_file): _, name, _ = split_filename(self.inputs.out_matrix_mat_file) @@ -727,8 +726,7 @@ def _post_run(self): self.outputs.dict_file = op.abspath(self.inputs.out_dict_file) else: self.outputs.dict_file = op.abspath(self._gen_outfilename('pck')) - return outputs - + def _gen_outfilename(self, ext): _, name, _ = split_filename(self.inputs.aparc_aseg_file) if self.inputs.use_freesurfer_LUT: @@ -790,4 +788,4 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.node_network = op.abspath(self.inputs.out_filename) - return outputs + \ No newline at end of file diff --git a/nipype/interfaces/cmtk/convert.py b/nipype/interfaces/cmtk/convert.py index 86a699eabf..efbc48063a 100644 --- a/nipype/interfaces/cmtk/convert.py +++ b/nipype/interfaces/cmtk/convert.py @@ -202,8 +202,7 @@ def _post_run(self): if not ext == '.cff': ext = '.cff' self.outputs.connectome_file = op.abspath(name + ext) - return outputs - + class MergeCNetworksInputSpec(BaseInterfaceInputSpec): in_files = InputMultiPath(File(exists=True), mandatory=True, desc='List of CFF files to extract networks from') @@ -263,4 +262,4 @@ def _post_run(self): if not ext == '.cff': ext = '.cff' self.outputs.connectome_file = op.abspath(name + ext) - return outputs + \ No newline at end of file diff --git a/nipype/interfaces/cmtk/nbs.py b/nipype/interfaces/cmtk/nbs.py index 949461b158..03e3b01893 100644 --- a/nipype/interfaces/cmtk/nbs.py +++ b/nipype/interfaces/cmtk/nbs.py @@ -141,7 +141,6 @@ def _post_run(self): self.outputs.nbs_network = path self.outputs.nbs_pval_network = pval_path self.outputs.network_files = [path, pval_path] - return outputs - + def _gen_outfilename(self, name, ext): return name + '.' + ext diff --git a/nipype/interfaces/cmtk/nx.py b/nipype/interfaces/cmtk/nx.py index 1f8c53f934..6138204a70 100644 --- a/nipype/interfaces/cmtk/nx.py +++ b/nipype/interfaces/cmtk/nx.py @@ -497,8 +497,7 @@ def _post_run(self): self.outputs.edge_measures_matlab = op.abspath(self._gen_outfilename('edgemetrics', 'mat')) self.outputs.matlab_matrix_files = [self.outputs.global_measures_matlab, self.outputs.node_measures_matlab, self.outputs.edge_measures_matlab] self.outputs.pickled_extra_measures = op.abspath(self._gen_outfilename(self.inputs.out_pickled_extra_measures, 'pck')) - return outputs - + def _gen_outfilename(self, name, ext): return name + '.' + ext @@ -560,7 +559,6 @@ def _post_run(self): self.outputs.gexf_groupavg = op.abspath(self.inputs.out_gexf_groupavg) self.outputs.matlab_groupavgs = matlab_network_list - return outputs - + def _gen_outfilename(self, name, ext): return name + '.' + ext diff --git a/nipype/interfaces/cmtk/parcellation.py b/nipype/interfaces/cmtk/parcellation.py index 4fdfe10050..8a664053e9 100644 --- a/nipype/interfaces/cmtk/parcellation.py +++ b/nipype/interfaces/cmtk/parcellation.py @@ -599,7 +599,6 @@ def _post_run(self): if self.inputs.dilation is True: self.outputs.dilated_roi_file_in_structural_space = op.abspath( 'ROIv_HR_th.nii.gz') - return outputs - + def _gen_outfilename(self, ext, prefix='ROI'): return prefix + '_' + self.inputs.parcellation_name + '.' + ext diff --git a/nipype/interfaces/dcm2nii.py b/nipype/interfaces/dcm2nii.py index e292fec6ad..d5d91cd061 100644 --- a/nipype/interfaces/dcm2nii.py +++ b/nipype/interfaces/dcm2nii.py @@ -166,8 +166,7 @@ def _post_run(self): self.outputs.reoriented_and_cropped_files = self.reoriented_and_cropped_files self.outputs.bvecs = self.bvecs self.outputs.bvals = self.bvals - return outputs - + def _gen_filename(self, name): if name == 'output_dir': return os.getcwd() diff --git a/nipype/interfaces/dcmstack.py b/nipype/interfaces/dcmstack.py index cb8b85f532..18dc39bed9 100644 --- a/nipype/interfaces/dcmstack.py +++ b/nipype/interfaces/dcmstack.py @@ -163,8 +163,7 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.out_file = self.out_path - return outputs - + class GroupAndStackOutputSpec(TraitedSpec): out_list = traits.List(desc="List of output nifti files") @@ -194,8 +193,7 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.out_list = self.out_list - return outputs - + class LookupMetaInputSpec(TraitedSpec): in_file = File(mandatory=True, @@ -249,8 +247,7 @@ def _outputs(self): # Not sure why this is needed for out_name in list(self._meta_keys.values()): _ = getattr(outputs, out_name) - return outputs - + def _run_interface(self, runtime): # If the 'meta_keys' input is a list, covert it to a dict self._make_name_map() @@ -263,8 +260,7 @@ def _run_interface(self, runtime): def _post_run(self): outputs.update(self.result) - return outputs - + class CopyMetaInputSpec(TraitedSpec): src_file = File(mandatory=True, exists=True) @@ -319,8 +315,7 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.dest_file = self.out_path - return outputs - + class MergeNiftiInputSpec(NiftiGeneratorBaseInputSpec): in_files = traits.List(mandatory=True, @@ -376,8 +371,7 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.out_file = self.out_path - return outputs - + class SplitNiftiInputSpec(NiftiGeneratorBaseInputSpec): in_file = File(exists=True, mandatory=True, desc="Nifti file to split") @@ -417,4 +411,4 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.out_list = self.out_list - return outputs + \ No newline at end of file diff --git a/nipype/interfaces/diffusion_toolkit/dti.py b/nipype/interfaces/diffusion_toolkit/dti.py index 1da35568af..921c6a225a 100644 --- a/nipype/interfaces/diffusion_toolkit/dti.py +++ b/nipype/interfaces/diffusion_toolkit/dti.py @@ -105,8 +105,7 @@ def _post_run(self): self.outputs.V2 = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_v2.' + output_type)) self.outputs.V3 = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_v3.' + output_type)) - return outputs - + class DTITrackerInputSpec(CommandLineInputSpec): tensor_file = File(exists=True, desc="reconstructed tensor file") @@ -169,4 +168,4 @@ def _post_run(self): if isdefined(self.inputs.output_mask) and self.inputs.output_mask: self.outputs.mask_file = os.path.abspath(self.inputs.output_mask) - return outputs + \ No newline at end of file diff --git a/nipype/interfaces/diffusion_toolkit/odf.py b/nipype/interfaces/diffusion_toolkit/odf.py index a7bcbedc28..501b67d288 100644 --- a/nipype/interfaces/diffusion_toolkit/odf.py +++ b/nipype/interfaces/diffusion_toolkit/odf.py @@ -88,8 +88,7 @@ def _format_arg(self, name, spec, value): def _post_run(self): self.outputs.out_file = os.path.abspath(self.inputs.out_file) - return outputs - + class ODFReconInputSpec(CommandLineInputSpec): DWI = File(desc='Input raw data', argstr='%s', exists=True, mandatory=True, position=1) @@ -150,8 +149,7 @@ def _post_run(self): if isdefined(self.inputs.output_entropy): self.outputs.entropy = os.path.abspath(fname_presuffix("", prefix=out_prefix, suffix='_entropy.' + output_type)) - return outputs - + class ODFTrackerInputSpec(CommandLineInputSpec): max = File(exists=True, mandatory=True) @@ -232,4 +230,4 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.track_file = os.path.abspath(self.inputs.out_file) - return outputs + \ No newline at end of file diff --git a/nipype/interfaces/diffusion_toolkit/postproc.py b/nipype/interfaces/diffusion_toolkit/postproc.py index 4b485b48bc..55af4a4bb4 100644 --- a/nipype/interfaces/diffusion_toolkit/postproc.py +++ b/nipype/interfaces/diffusion_toolkit/postproc.py @@ -53,8 +53,7 @@ class SplineFilter(CommandLine): def _post_run(self): self.outputs.smoothed_track_file = os.path.abspath(self.inputs.output_file) - return outputs - + class TrackMergeInputSpec(CommandLineInputSpec): track_files = InputMultiPath(File(exists=True), desc="file containing tracks to be filtered", position=0, argstr="%s...", mandatory=True) @@ -93,4 +92,4 @@ class TrackMerge(CommandLine): def _post_run(self): self.outputs.track_file = os.path.abspath(self.inputs.output_file) - return outputs + \ No newline at end of file diff --git a/nipype/interfaces/dipy/preprocess.py b/nipype/interfaces/dipy/preprocess.py index 54490dbb4c..cb168458be 100644 --- a/nipype/interfaces/dipy/preprocess.py +++ b/nipype/interfaces/dipy/preprocess.py @@ -68,8 +68,7 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.out_file = op.abspath(self._gen_outfilename()) - return outputs - + def _gen_outfilename(self): fname, fext = op.splitext(op.basename(self.inputs.in_file)) if fext == '.gz': @@ -159,8 +158,7 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.out_file = op.abspath(self._gen_outfilename()) - return outputs - + def _gen_outfilename(self): fname, fext = op.splitext(op.basename(self.inputs.in_file)) if fext == '.gz': diff --git a/nipype/interfaces/dipy/reconstruction.py b/nipype/interfaces/dipy/reconstruction.py index 7a5283fbf3..75c0e56de4 100644 --- a/nipype/interfaces/dipy/reconstruction.py +++ b/nipype/interfaces/dipy/reconstruction.py @@ -147,8 +147,7 @@ def _run_interface(self, runtime): def _post_run(self): for k in outputs.keys(): outputs[k] = self._gen_filename(k) - return outputs - + class EstimateResponseSHInputSpec(DipyBaseInterfaceInputSpec): in_evals = File( @@ -268,8 +267,7 @@ def _run_interface(self, runtime): def _post_run(self): outputs['response'] = op.abspath(self.inputs.response) outputs['out_mask'] = op.abspath(self.inputs.out_mask) - return outputs - + class CSDInputSpec(DipyBaseInterfaceInputSpec): in_mask = File(exists=True, desc=('input mask in which compute tensors')) @@ -362,4 +360,4 @@ def _post_run(self): outputs['model'] = self._gen_filename('csdmodel', ext='.pklz') if self.inputs.save_fods: outputs['out_fods'] = self._gen_filename('fods') - return outputs + \ No newline at end of file diff --git a/nipype/interfaces/dipy/simulate.py b/nipype/interfaces/dipy/simulate.py index ea4e4a357f..0e26b1d999 100644 --- a/nipype/interfaces/dipy/simulate.py +++ b/nipype/interfaces/dipy/simulate.py @@ -252,8 +252,7 @@ def _post_run(self): self.outputs.out_bvec = op.abspath(self.inputs.out_bvec) self.outputs.out_bval = op.abspath(self.inputs.out_bval) - return outputs - + def _compute_voxel(args): """ diff --git a/nipype/interfaces/dipy/tensors.py b/nipype/interfaces/dipy/tensors.py index c4f20761b2..455124e5fa 100644 --- a/nipype/interfaces/dipy/tensors.py +++ b/nipype/interfaces/dipy/tensors.py @@ -64,8 +64,7 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.out_file = self._gen_filename('dti') - return outputs - + class TensorModeInputSpec(DipyBaseInterfaceInputSpec): mask_file = File(exists=True, @@ -133,4 +132,4 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.out_file = self._gen_filename('mode') - return outputs + \ No newline at end of file diff --git a/nipype/interfaces/dipy/tracks.py b/nipype/interfaces/dipy/tracks.py index 047dd3f449..45e5524be0 100644 --- a/nipype/interfaces/dipy/tracks.py +++ b/nipype/interfaces/dipy/tracks.py @@ -99,8 +99,7 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.out_file = op.abspath(self.inputs.out_filename) - return outputs - + class StreamlineTractographyInputSpec(BaseInterfaceInputSpec): in_file = File(exists=True, mandatory=True, desc=('input diffusion data')) @@ -283,8 +282,7 @@ def _post_run(self): outputs['out_seeds'] = self._gen_filename('seeds', ext='.txt') - return outputs - + def _gen_filename(self, name, ext=None): fname, fext = op.splitext(op.basename(self.inputs.in_file)) if fext == '.gz': diff --git a/nipype/interfaces/dynamic_slicer.py b/nipype/interfaces/dynamic_slicer.py index 579eb11370..277c86d35d 100644 --- a/nipype/interfaces/dynamic_slicer.py +++ b/nipype/interfaces/dynamic_slicer.py @@ -148,8 +148,7 @@ def _post_run(self): setattr(self.outputs, name, self._gen_filename(name)) else: setattr(self.outputs, name, Undefined) - return outputs - + # test = SlicerCommandLine(module="BRAINSFit") # test.inputs.fixedVolume = "/home/filo/workspace/fmri_tumour/data/pilot1/10_co_COR_3D_IR_PREP.nii" diff --git a/nipype/interfaces/elastix/registration.py b/nipype/interfaces/elastix/registration.py index d11f6b7460..9aa38e4b66 100644 --- a/nipype/interfaces/elastix/registration.py +++ b/nipype/interfaces/elastix/registration.py @@ -102,8 +102,7 @@ def _post_run(self): if self.outputs.warped_files_flags[-1]: self.outputs.warped_file = self.outputs.warped_files[-1] - return outputs - + def _cast(self, val): if val.startswith('"') and val.endswith('"'): if val == '"true"': @@ -159,8 +158,7 @@ class ApplyWarp(CommandLine): def _post_run(self): out_dir = op.abspath(self.inputs.output_path) self.outputs.warped_file = op.join(out_dir, 'result.nii.gz') - return outputs - + class AnalyzeWarpInputSpec(ElastixBaseInputSpec): transform_file = File(exists=True, mandatory=True, argstr='-tp %s', @@ -200,8 +198,7 @@ def _post_run(self): self.outputs.disp_field = op.join(out_dir, 'deformationField.nii.gz') self.outputs.jacdet_map = op.join(out_dir, 'spatialJacobian.nii.gz') self.outputs.jacmat_map = op.join(out_dir, 'fullSpatialJacobian.nii.gz') - return outputs - + class PointsWarpInputSpec(ElastixBaseInputSpec): points_file = File(exists=True, argstr='-def %s', mandatory=True, @@ -241,4 +238,4 @@ def _post_run(self): fname, ext = op.splitext(op.basename(self.inputs.points_file)) self.outputs.warped_file = op.join(out_dir, 'outputpoints%s' % ext) - return outputs + \ No newline at end of file diff --git a/nipype/interfaces/elastix/utils.py b/nipype/interfaces/elastix/utils.py index f5b857e573..3573559aad 100644 --- a/nipype/interfaces/elastix/utils.py +++ b/nipype/interfaces/elastix/utils.py @@ -133,8 +133,7 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.output_file = getattr(self, '_out_file') - return outputs - + def _get_outfile(self): val = getattr(self, '_out_file') if val is not None and val != '': diff --git a/nipype/interfaces/freesurfer/model.py b/nipype/interfaces/freesurfer/model.py index 90ecf7915c..c1dc8f2b74 100644 --- a/nipype/interfaces/freesurfer/model.py +++ b/nipype/interfaces/freesurfer/model.py @@ -105,8 +105,7 @@ def _post_run(self): self.outputs.out_file = os.path.join(os.getcwd(), 'concat_%s_%s.mgz' % (self.inputs.hemi, self.inputs.target)) - return outputs - + def _gen_filename(self, name): if name == 'out_file': return getattr(self.outputs, name) @@ -324,8 +323,7 @@ def _post_run(self): self.outputs.singluar_values = os.path.join(pcadir, "sdiag.mat") self.outputs.svd_stats_file = os.path.join(pcadir, "stats.dat") - return outputs - + def _gen_filename(self, name): if name == 'glm_dir': return os.getcwd() @@ -442,8 +440,7 @@ def _post_run(self): use_ext=False) else: self.outputs.count_file = value - return outputs - + def _format_arg(self, name, spec, value): if name == 'count_file': if isinstance(value, bool): @@ -533,8 +530,7 @@ def _post_run(self): 'concat_output.nii.gz') else: self.outputs.concatenated_file = self.inputs.concatenated_file - return outputs - + def _gen_filename(self, name): if name == 'concatenated_file': return getattr(self.outputs, name) @@ -657,8 +653,7 @@ def _post_run(self): use_ext=False) else: setattr(self.outputs, name, os.path.abspath(value) - return outputs - + def _format_arg(self, name, spec, value): if name in ['avgwf_txt_file', 'avgwf_file', 'sf_avg_file']: if isinstance(value, bool): @@ -769,8 +764,7 @@ def _post_run(self): newpath=os.getcwd(), use_ext=False) self.outputs.vol_label_file = outfile - return outputs - + def _gen_filename(self, name): if name == 'vol_label_file': return getattr(self.outputs, name) @@ -838,8 +832,7 @@ def _post_run(self): self.outputs.vol_synth_file = os.path.abspath(self.inputs.vol_synth_file) if not isdefined(self.inputs.use_weights) or self.inputs.use_weights is False: self.outputs.weight_file = os.path.abspath(self.inputs.weight_file) - return outputs - + def _verify_weights_file_exists(self): if not os.path.exists(os.path.abspath(self.inputs.weight_file)): raise traits.TraitError("MS_LDA: use_weights must accompany an existing weights file") diff --git a/nipype/interfaces/freesurfer/preprocess.py b/nipype/interfaces/freesurfer/preprocess.py index ca402aa59f..ecc01b4541 100644 --- a/nipype/interfaces/freesurfer/preprocess.py +++ b/nipype/interfaces/freesurfer/preprocess.py @@ -70,8 +70,7 @@ def _post_run(self): if isdefined(self.inputs.dicom_info_file): self.outputs.dicom_info_file = os.path.join(os.getcwd(), self.inputs.dicom_info_file) - return outputs - + class UnpackSDICOMDirInputSpec(FSTraitedSpec): source_dir = Directory(exists=True, argstr='-src %s', @@ -412,8 +411,7 @@ def _post_run(self): suffix='%03d' % (i + 1))) outfile = outfiles self.outputs.out_file = outfile - return outputs - + def _gen_filename(self, name): if name == 'out_file': return self._get_outfilename() @@ -588,8 +586,7 @@ def _get_outfilename(self): def _post_run(self): self.outputs.resampled_file = self._get_outfilename() - return outputs - + def _gen_filename(self, name): if name == 'resampled_file': return self._get_outfilename() @@ -756,8 +753,7 @@ def _post_run(self): hemi=hemi)._list_outputs()) self.outputs.subject_id = self.inputs.subject_id self.outputs.subjects_dir = subjects_dir - return outputs - + def _is_resuming(self): subjects_dir = self.inputs.subjects_dir if not isdefined(subjects_dir): @@ -898,8 +894,7 @@ def _post_run(self): self.outputs.out_fsl_file = op.abspath(_in.out_fsl_file) self.outputs.min_cost_file = self.outputs.out_reg_file + '.mincost' - return outputs - + def _format_arg(self, name, spec, value): if name in ['registered_file', 'out_fsl_file']: @@ -1019,8 +1014,7 @@ def _get_outfile(self): def _post_run(self): self.outputs.transformed_file = os.path.abspath(self._get_outfile()) - return outputs - + def _gen_filename(self, name): if name == 'transformed_file': return self._get_outfile() @@ -1088,8 +1082,7 @@ def _post_run(self): outfile = self._gen_fname(self.inputs.in_file, suffix='_smooth') self.outputs.smoothed_file = outfile - return outputs - + def _gen_filename(self, name): if name == 'smoothed_file': return getattr(self.outputs, name) @@ -1226,8 +1219,7 @@ def _post_run(self): use_ext=sufftup[2]) else: setattr(self.outputs, name, value - return outputs - + def _gen_filename(self, name): if name == 'out_reg_file': return getattr(self.outputs, name) @@ -1296,8 +1288,7 @@ def _post_run(self): self.outputs.t1_image = os.path.join(out_dir, "T1.mgz") self.outputs.pd_image = os.path.join(out_dir, "PD.mgz") self.outputs.t2star_image = os.path.join(out_dir, "T2star.mgz") - return outputs - + def _gen_filename(self, name): if name == "out_dir": return os.getcwd() @@ -1351,8 +1342,7 @@ def _post_run(self): else: self.outputs.out_file = self._gen_fname("synth-flash_%02d.mgz" % self.inputs.flip_angle, suffix="") - return outputs - + def _gen_filename(self, name): if name == "out_file": return self.outputs.out_file diff --git a/nipype/interfaces/freesurfer/utils.py b/nipype/interfaces/freesurfer/utils.py index 99c759d803..03aac946b0 100644 --- a/nipype/interfaces/freesurfer/utils.py +++ b/nipype/interfaces/freesurfer/utils.py @@ -214,8 +214,7 @@ def _post_run(self): suffix="_vox.txt", use_ext=False) self.outputs.vox_file = voxfile - return outputs - + def _gen_filename(self, name): if name == "out_file": return getattr(self.outputs, name) @@ -283,8 +282,7 @@ def _post_run(self): self.outputs.out_file = fname_presuffix(in_file, suffix="_smooth%d" % kernel, newpath=os.getcwd()) - return outputs - + def _gen_filename(self, name): if name == "out_file": return getattr(self.outputs, name) @@ -376,8 +374,7 @@ def _post_run(self): use_ext=use_ext) else: self.outputs.out_file = os.path.abspath(self.inputs.out_file) - return outputs - + def _gen_filename(self, name): if name == "out_file": return getattr(self.outputs, name) @@ -491,8 +488,7 @@ def _post_run(self): use_ext=True) else: self.outputs.out_file = os.path.abspath(self.outputs.out_file) - return outputs - + def _gen_filename(self, name): if name == "out_file": return getattr(self.outputs, name) @@ -701,8 +697,7 @@ def _post_run(self): snapshots.extend(["%s-pos.tif", "%s-ant.tif"]) snapshots = [self._gen_fname(f % stem, suffix="") for f in snapshots] self.outputs.snapshots = snapshots - return outputs - + def _gen_filename(self, name): if name == "tcl_script": return "snapshots.tcl" @@ -770,8 +765,7 @@ def aggregate_outputs(self, runtime=None, needed_outputs=None): outputs.file_format = ftype outputs.data_type = dtype - return outputs - + class MRIsConvertInputSpec(FSTraitedSpec): """ @@ -850,8 +844,7 @@ def _format_arg(self, name, spec, value): def _post_run(self): self.outputs.converted = os.path.abspath(self._gen_outfilename()) - return outputs - + def _gen_filename(self, name): if name is 'out_file': return os.path.abspath(self._gen_outfilename()) @@ -918,8 +911,7 @@ class MRITessellate(FSCommand): def _post_run(self): self.outputs.surface = os.path.abspath(self._gen_outfilename()) - return outputs - + def _gen_filename(self, name): if name is 'out_file': return self._gen_outfilename() @@ -988,8 +980,7 @@ class MRIPretess(FSCommand): def _post_run(self): self.outputs.out_file = os.path.abspath(self._gen_outfilename()) - return outputs - + def _gen_filename(self, name): if name is 'out_file': return self._gen_outfilename() @@ -1045,8 +1036,7 @@ class MRIMarchingCubes(FSCommand): def _post_run(self): self.outputs.surface = self._gen_outfilename() - return outputs - + def _gen_filename(self, name): if name is 'out_file': return self._gen_outfilename() @@ -1116,8 +1106,7 @@ class SmoothTessellation(FSCommand): def _post_run(self): self.outputs.surface = self._gen_outfilename() - return outputs - + def _gen_filename(self, name): if name is 'out_file': return self._gen_outfilename() @@ -1173,8 +1162,7 @@ class MakeAverageSubject(FSCommand): def _post_run(self): self.outputs.average_subject_name = self.inputs.out_name - return outputs - + class ExtractMainComponentInputSpec(CommandLineInputSpec): in_file = File(exists=True, mandatory=True, argstr='%s', position=1, @@ -1284,8 +1272,7 @@ def _post_run(self): self.outputs.reg_file = os.path.abspath(self.inputs.reg_file) if isdefined(self.inputs.fsl_out): self.outputs.fsl_file = os.path.abspath(self.inputs.fsl_out) - return outputs - + def _gen_outfilename(self): if isdefined(self.inputs.out_file): return os.path.abspath(self.inputs.out_file) diff --git a/nipype/interfaces/fsl/epi.py b/nipype/interfaces/fsl/epi.py index 57b7543909..708d2f2b40 100644 --- a/nipype/interfaces/fsl/epi.py +++ b/nipype/interfaces/fsl/epi.py @@ -97,8 +97,7 @@ def _parse_inputs(self, skip=None): def _post_run(self): self.outputs.out_fieldmap = self.inputs.out_fieldmap - return outputs - + def _run_interface(self, runtime): runtime = super(PrepareFieldmap, self)._run_interface(runtime) @@ -271,8 +270,7 @@ def _post_run(self): if isdefined(self.inputs.encoding_direction): self.outputs.out_enc_file = self._get_encfilename() - return outputs - + def _get_encfilename(self): out_file = os.path.join(os.getcwd(), ('%s_encfile.txt' % @@ -496,8 +494,7 @@ def _post_run(self): self.outputs.out_corrected = os.path.abspath('%s.nii.gz' % self.inputs.out_base) self.outputs.out_parameter = os.path.abspath('%s.eddy_parameters' % self.inputs.out_base) - return outputs - + class SigLossInputSpec(FSLCommandInputSpec): in_file = File(mandatory=True, @@ -552,8 +549,7 @@ def _post_run(self): (isdefined(self.inputs.in_file))): self.outputs.out_file = self._gen_fname(self.inputs.in_file, suffix='_sigloss') - return outputs - + def _gen_filename(self, name): if name == 'out_file': return self.outputs.out_file @@ -680,8 +676,7 @@ def _post_run(self): self.outputs.wmseg = os.path.join(os.getcwd(), self.inputs.out_base + '_fast_wmseg.nii.gz') - return outputs - + ####################################### # deprecated interfaces @@ -810,8 +805,7 @@ def _post_run(self): else: self.outputs.exf_mask = self._gen_fname(cwd=self.inputs.tmpdir, basename='maskexf') - return outputs - + class EddyCorrectInputSpec(FSLCommandInputSpec): in_file = File(exists=True, desc='4D input file', argstr='%s', position=0, diff --git a/nipype/interfaces/fsl/maths.py b/nipype/interfaces/fsl/maths.py index 84c37189a6..314aa576dc 100644 --- a/nipype/interfaces/fsl/maths.py +++ b/nipype/interfaces/fsl/maths.py @@ -53,8 +53,7 @@ def _post_run(self): if not isdefined(self.inputs.out_file): self.outputs.out_file = self._gen_fname(self.inputs.in_file, suffix=self._suffix) self.outputs.out_file = os.path.abspath(self.outputs.out_file) - return outputs - + def _gen_filename(self, name): if name == "out_file": return self.outputs.out_file diff --git a/nipype/interfaces/fsl/model.py b/nipype/interfaces/fsl/model.py index 6ec92797ee..bc168b8798 100644 --- a/nipype/interfaces/fsl/model.py +++ b/nipype/interfaces/fsl/model.py @@ -368,8 +368,7 @@ def _post_run(self): evname.append(name + 'TD') self.outputs.ev_files[runno].append( os.path.join(cwd, evfname)) - return outputs - + class FEATInputSpec(FSLCommandInputSpec): fsf_file = File(exists=True, mandatory=True, argstr="%s", position=0, @@ -409,8 +408,7 @@ def _post_run(self): else: self.outputs.feat_dir = glob(os.path.join(os.getcwd(), '*feat'))[0] print('Outputs from FEATmodel:', outputs) - return outputs - + class FEATModelInputSpec(FSLCommandInputSpec): fsf_file = File(exists=True, mandatory=True, argstr="%s", position=0, @@ -474,8 +472,7 @@ def _post_run(self): if fcon_file: assert len(fcon_file) == 1, 'No fts file generated by FEAT Model' self.outputs.fcon_file = fcon_file[0] - return outputs - + class FILMGLSInputSpec(FSLCommandInputSpec): in_file = File(exists=True, mandatory=True, position=-3, @@ -746,8 +743,7 @@ def _post_run(self): if fstats: self.outputs.fstats = fstats self.outputs.zfstats = zfstats - return outputs - + class FEATRegisterInputSpec(BaseInterfaceInputSpec): feat_dirs = InputMultiPath( @@ -793,8 +789,7 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.fsf_file = os.path.abspath( os.path.join(os.getcwd(), 'register.fsf')) - return outputs - + class FLAMEOInputSpec(FSLCommandInputSpec): cope_file = File(exists=True, argstr='--copefile=%s', mandatory=True, @@ -963,8 +958,7 @@ def _post_run(self): self.outputs.stats_dir = pth - return outputs - + class ContrastMgrInputSpec(FSLCommandInputSpec): tcon_file = File(exists=True, mandatory=True, @@ -1098,8 +1092,7 @@ def _post_run(self): if fstats: self.outputs.fstats = fstats self.outputs.zfstats = zfstats - return outputs - + class L2ModelInputSpec(BaseInterfaceInputSpec): num_copes = traits.Range(low=1, mandatory=True, @@ -1172,8 +1165,7 @@ def _post_run(self): for field in list(outputs.keys()): setattr(self.outputs, field, os.path.join(os.getcwd(), field.replace('_', '.')) - return outputs - + class MultipleRegressDesignInputSpec(BaseInterfaceInputSpec): contrasts = traits.List( @@ -1333,8 +1325,7 @@ def _post_run(self): continue setattr(self.outputs, field, os.path.join(os.getcwd(), field.replace('_', '.')) - return outputs - + class SMMInputSpec(FSLCommandInputSpec): spatial_data_file = File( @@ -1371,8 +1362,7 @@ def _post_run(self): if not isdefined(self.inputs.no_deactivation_class) or not self.inputs.no_deactivation_class: self.outputs.deactivation_p_map = self._gen_fname( basename="w3_mean", cwd="logdir") - return outputs - + class MELODICInputSpec(FSLCommandInputSpec): in_files = InputMultiPath( @@ -1499,8 +1489,7 @@ def _post_run(self): if isdefined(self.inputs.report) and self.inputs.report: self.outputs.report_dir = os.path.join( self._gen_filename("out_dir"), "report") - return outputs - + def _gen_filename(self, name): if name == "out_dir": return os.getcwd() @@ -1551,8 +1540,7 @@ def aggregate_outputs(self, runtime=None, needed_outputs=None): outputs.dlh = float(stdout[0].split()[1]) outputs.volume = int(stdout[1].split()[1]) outputs.resels = float(stdout[2].split()[1]) - return outputs - + class ClusterInputSpec(FSLCommandInputSpec): in_file = File(argstr='--in=%s', mandatory=True, @@ -1666,8 +1654,7 @@ def _post_run(self): change_ext=change_ext) else: setattr(self.outputs, outkey, os.path.abspath(inval) - return outputs - + def _format_arg(self, name, spec, value): if name in list(self.filemap.keys()): if isinstance(value, bool): @@ -1805,8 +1792,7 @@ def _post_run(self): '%s_%s_p_fstat*.nii' % (self.inputs.base_name, prefix))) self.outputs.f_corrected_p_files = glob(self._gen_fname( '%s_%s_corrp_fstat*.nii' % (self.inputs.base_name, prefix))) - return outputs - + class GLMInputSpec(FSLCommandInputSpec): in_file = File(exists=True, argstr='-i %s', mandatory=True, position=1, @@ -1953,4 +1939,4 @@ def _post_run(self): self.outputs.out_vnscales = os.path.abspath( self.inputs.out_vnscales_name) - return outputs + \ No newline at end of file diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index 5bde570c17..5a0084574a 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -330,8 +330,7 @@ def _post_run(self): for i in range(nclasses): self.outputs.probability_maps.append( self._gen_fname(basefile, suffix='_prob_%d' % i)) - return outputs - + class FLIRTInputSpec(FSLCommandInputSpec): in_file = File(exists=True, argstr='-in %s', mandatory=True, @@ -657,8 +656,7 @@ def _post_run(self): if isdefined(self.inputs.save_rms) and self.inputs.save_rms: outfile = self.outputs.out_file self.outputs.rms_files = [outfile + '_abs.rms', outfile + '_rel.rms'] - return outputs - + def _gen_filename(self, name): if name == 'out_file': return self._gen_outfilename() @@ -962,8 +960,7 @@ def _post_run(self): suffix='_warp') else: self.outputs.out_file = os.path.abspath(self.inputs.out_file) - return outputs - + def _gen_filename(self, name): if name == 'out_file': return getattr(self.outputs, name) @@ -1021,8 +1018,7 @@ def _post_run(self): out_file = self._gen_fname(self.inputs.in_file, suffix='_st') self.outputs.slice_time_corrected_file = os.path.abspath(out_file) - return outputs - + def _gen_filename(self, name): if name == 'out_file': return self.outputs.slice_time_corrected_file @@ -1101,8 +1097,7 @@ def _post_run(self): out_file = self._gen_fname(self.inputs.in_file, suffix='_smooth') self.outputs.smoothed_file = os.path.abspath(out_file) - return outputs - + def _gen_filename(self, name): if name == 'out_file': return self.outputs.smoothed_file @@ -1414,8 +1409,7 @@ def _post_run(self): out_file = self._gen_fname(self.inputs.complex_phase_file, suffix='_phase_unwrapped') self.outputs.unwrapped_phase_file = os.path.abspath(out_file) - return outputs - + def _gen_filename(self, name): if name == 'unwrapped_phase_file': return self.outputs.unwrapped_phase_file @@ -1515,8 +1509,7 @@ def _post_run(self): self.outputs.vtk_surfaces = self._gen_mesh_names('vtk_surfaces', structures) self.outputs.bvars = self._gen_mesh_names('bvars', structures) - return outputs - + def _gen_fname(self, name): path, outname, ext = split_filename(self.inputs.out_file) diff --git a/nipype/interfaces/fsl/utils.py b/nipype/interfaces/fsl/utils.py index ac4d4a15ec..b10308d9eb 100644 --- a/nipype/interfaces/fsl/utils.py +++ b/nipype/interfaces/fsl/utils.py @@ -129,8 +129,7 @@ def _post_run(self): ext='.txt', change_ext=True) self.outputs.out_file = os.path.abspath(self.outputs.out_file) - return outputs - + def _gen_filename(self, name): if name == 'out_file': return getattr(self.outputs, name) @@ -342,8 +341,7 @@ def _post_run(self): self.outputs.roi_file = self._gen_fname(self.inputs.in_file, suffix='_roi') self.outputs.roi_file = os.path.abspath(self.outputs.roi_file) - return outputs - + def _gen_filename(self, name): if name == 'roi_file': return getattr(self.outputs, name) @@ -393,8 +391,7 @@ def _post_run(self): outbase = '%s*' % self.inputs.out_base_name self.outputs.out_files = sorted(glob(os.path.join(os.getcwd(), outbase + ext))) - return outputs - + class ImageMathsInputSpec(FSLCommandInputSpec): in_file = File(exists=True, argstr="%s", mandatory=True, position=1) @@ -452,8 +449,7 @@ def _post_run(self): self.outputs.out_file = self._gen_fname(self.inputs.in_file, suffix=suffix) self.outputs.out_file = os.path.abspath(self.outputs.out_file) - return outputs - + class FilterRegressorInputSpec(FSLCommandInputSpec): in_file = File(exists=True, argstr="-i %s", @@ -514,8 +510,7 @@ def _post_run(self): self.outputs.out_file = self._gen_fname( self.inputs.in_file, suffix='_regfilt') self.outputs.out_file = os.path.abspath(self.outputs.out_file) - return outputs - + def _gen_filename(self, name): if name == 'out_file': return getattr(self.outputs, name) @@ -597,8 +592,7 @@ def aggregate_outputs(self, runtime=None, needed_outputs=None): out_stat = out_stat[0] save_json(outfile, dict(stat=out_stat)) outputs.out_stat = out_stat - return outputs - + class AvScaleInputSpec(FSLCommandInputSpec): mat_file = File(exists=True, argstr="%s", @@ -662,8 +656,7 @@ def lines_to_float(lines): outputs.forward_half_transform = lines_to_float(out[16:20]) outputs.backward_half_transform = lines_to_float(out[22:-1]) - return outputs - + class OverlayInputSpec(FSLCommandInputSpec): transparency = traits.Bool(desc='make overlay colors semi-transparent', @@ -764,8 +757,7 @@ def _post_run(self): stem = split_filename(self.inputs.stat_image)[1] out_file = self._gen_fname(stem, suffix='_overlay') self.outputs.out_file = os.path.abspath(out_file) - return outputs - + def _gen_filename(self, name): if name == 'out_file': return self.outputs.out_file @@ -865,8 +857,7 @@ def _post_run(self): if not isdefined(out_file): out_file = self._gen_fname(self.inputs.in_file, ext='.png') self.outputs.out_file = os.path.abspath(out_file) - return outputs - + def _gen_filename(self, name): if name == 'out_file': return self.outputs.out_file @@ -967,8 +958,7 @@ def _post_run(self): infile = self.inputs.in_file out_file = self._gen_fname(infile, ext='.png') self.outputs.out_file = os.path.abspath(out_file) - return outputs - + def _gen_filename(self, name): if name == 'out_file': return self.outputs.out_file @@ -1077,8 +1067,7 @@ def _post_run(self): out_file = fname_presuffix( infile, suffix="_%s.png" % plttype, use_ext=False) self.outputs.out_file = os.path.abspath(out_file) - return outputs - + def _gen_filename(self, name): if name == 'out_file': return self.outputs.out_file @@ -1153,8 +1142,7 @@ def _post_run(self): newpath=os.getcwd(), use_ext=False) self.outputs.out_file = os.path.abspath(outfile) - return outputs - + def _gen_filename(self, name): if name == "out_file": return self.outputs.out_file @@ -1198,8 +1186,7 @@ def _post_run(self): self.outputs.out_file = self._gen_fname(self.inputs.in_file, suffix='_newdims') self.outputs.out_file = os.path.abspath(self.outputs.out_file) - return outputs - + def _gen_filename(self, name): if name == "out_file": return self.outputs.out_file @@ -1249,8 +1236,7 @@ def _gen_outfilename(self): def _post_run(self): self.outputs.out_file = os.path.abspath(self._gen_outfilename()) - return outputs - + def _gen_filename(self, name): if name == 'out_file': return self._gen_outfilename() @@ -1305,8 +1291,7 @@ def _post_run(self): isdefined(self.inputs.in_file): self.outputs.out_file = self._gen_fname(self.inputs.in_file, suffix='_sigloss') - return outputs - + def _gen_filename(self, name): if name == 'out_file': return self.outputs.out_file @@ -1352,8 +1337,7 @@ def _post_run(self): self.outputs.out_file = self._gen_filename('out_file') else: self.outputs.out_file = os.path.abspath(self.inputs.out_file) - return outputs - + class InvWarpInputSpec(FSLCommandInputSpec): warp = File(exists=True, argstr='--warp=%s', mandatory=True, @@ -1562,8 +1546,7 @@ def _post_run(self): elif self.inputs.real_polar: self.outputs.magnitude_out_file = self._get_output('magnitude_out_file') self.outputs.phase_out_file = self._get_output('phase_out_file') - return outputs - + class WarpUtilsInputSpec(FSLCommandInputSpec): in_file = File(exists=True, argstr='--in=%s', mandatory=True, diff --git a/nipype/interfaces/meshfix.py b/nipype/interfaces/meshfix.py index 0e476be7ec..21f85aaab3 100644 --- a/nipype/interfaces/meshfix.py +++ b/nipype/interfaces/meshfix.py @@ -124,8 +124,7 @@ def _post_run(self): self.outputs.mesh_file = op.abspath(name + '.' + self.inputs.output_type) else: self.outputs.mesh_file = op.abspath(self._gen_outfilename()) - return outputs - + def _gen_filename(self, name): if name is 'out_filename': return self._gen_outfilename() diff --git a/nipype/interfaces/minc/minc.py b/nipype/interfaces/minc/minc.py index 7a66ed54ea..ebd014eff6 100644 --- a/nipype/interfaces/minc/minc.py +++ b/nipype/interfaces/minc/minc.py @@ -1713,8 +1713,7 @@ def _post_run(self): self.outputs.partial_dz = output_file_base + '_dz.mnc' self.outputs.partial_dxyz = output_file_base + '_dxyz.mnc' - return outputs - + @property def cmdline(self): output_file_base = self.inputs.output_file_base @@ -2976,8 +2975,7 @@ def _post_run(self): outputs = super(Gennlxfm, self)._list_outputs() self.outputs.output_grid = re.sub( '.(nlxfm|xfm)$', '_grid_0.mnc', self.outputs.output_file) - return outputs - + class XfmConcatInputSpec(CommandLineInputSpec): input_files = InputMultiPath( @@ -3047,8 +3045,7 @@ def _post_run(self): '_grid_*.mnc', self.outputs.output_file)) - return outputs - + class BestLinRegInputSpec(CommandLineInputSpec): source = File( @@ -3242,8 +3239,7 @@ def _post_run(self): self.outputs.output_grid = re.sub( '.(nlxfm|xfm)$', '_grid_0.mnc', self.outputs.output_xfm) - return outputs - + class XfmAvgInputSpec(CommandLineInputSpec): input_files = InputMultiPath( @@ -3346,8 +3342,7 @@ def _post_run(self): self.outputs.output_grid = re.sub( '.(nlxfm|xfm)$', '_grid_0.mnc', self.outputs.output_file) - return outputs - + class XfmInvertInputSpec(CommandLineInputSpec): input_file = traits.File( @@ -3420,8 +3415,7 @@ def _post_run(self): self.outputs.output_grid = re.sub( '.(nlxfm|xfm)$', '_grid_0.mnc', self.outputs.output_file) - return outputs - + class BigAverageInputSpec(CommandLineInputSpec): input_files = InputMultiPath( @@ -3682,4 +3676,4 @@ def _post_run(self): self.outputs.output_grid = re.sub( '.(nlxfm|xfm)$', '_grid_0.mnc', self.outputs.trans_file) - return outputs + \ No newline at end of file diff --git a/nipype/interfaces/mne/base.py b/nipype/interfaces/mne/base.py index bb8d162843..6da4809de0 100644 --- a/nipype/interfaces/mne/base.py +++ b/nipype/interfaces/mne/base.py @@ -98,4 +98,4 @@ def _post_run(self): if not k.rfind('surface') == -1: mesh_paths.append(out_files) self.outputs.mesh_files = mesh_paths - return outputs + \ No newline at end of file diff --git a/nipype/interfaces/mrtrix/convert.py b/nipype/interfaces/mrtrix/convert.py index b203200147..ce7aecf8e2 100644 --- a/nipype/interfaces/mrtrix/convert.py +++ b/nipype/interfaces/mrtrix/convert.py @@ -241,8 +241,7 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.out_file = op.abspath(self.inputs.out_filename) - return outputs - + def _gen_filename(self, name): if name is 'out_filename': return self._gen_outfilename() diff --git a/nipype/interfaces/mrtrix/preprocess.py b/nipype/interfaces/mrtrix/preprocess.py index 6d32dda6b5..a12632bd9d 100644 --- a/nipype/interfaces/mrtrix/preprocess.py +++ b/nipype/interfaces/mrtrix/preprocess.py @@ -74,8 +74,7 @@ def _post_run(self): self.outputs.converted = op.abspath(self._gen_outfilename()) else: self.outputs.converted = op.abspath(self.outputs.converted) - return outputs - + def _gen_filename(self, name): if name is 'out_filename': return self._gen_outfilename() @@ -187,8 +186,7 @@ def _post_run(self): self.outputs.vector = op.abspath(self._gen_outfilename()) else: self.outputs.vector = op.abspath(self.outputs.vector) - return outputs - + def _gen_filename(self, name): if name is 'out_filename': return self._gen_outfilename() @@ -236,8 +234,7 @@ def _post_run(self): self.outputs.FA = op.abspath(self._gen_outfilename()) else: self.outputs.FA = op.abspath(self.outputs.FA) - return outputs - + def _gen_filename(self, name): if name is 'out_filename': return self._gen_outfilename() @@ -285,8 +282,7 @@ def _post_run(self): self.outputs.ADC = op.abspath(self._gen_outfilename()) else: self.outputs.ADC = op.abspath(self.outputs.ADC) - return outputs - + def _gen_filename(self, name): if name is 'out_filename': return self._gen_outfilename() @@ -335,8 +331,7 @@ def _post_run(self): self.outputs.out_file = op.abspath(self._gen_outfilename()) else: self.outputs.out_file = op.abspath(self.outputs.out_file) - return outputs - + def _gen_filename(self, name): if name is 'out_filename': return self._gen_outfilename() @@ -445,8 +440,7 @@ class GenerateWhiteMatterMask(CommandLine): def _post_run(self): self.outputs.WMprobabilitymap = op.abspath(self._gen_outfilename()) - return outputs - + def _gen_filename(self, name): if name is 'out_WMProb_filename': return self._gen_outfilename() @@ -495,8 +489,7 @@ def _post_run(self): self.outputs.out_file = op.abspath(self._gen_outfilename()) else: self.outputs.out_file = op.abspath(self.outputs.out_file) - return outputs - + def _gen_filename(self, name): if name is 'out_filename': return self._gen_outfilename() @@ -553,8 +546,7 @@ def _post_run(self): self.outputs.out_file = op.abspath(self._gen_outfilename()) else: self.outputs.out_file = op.abspath(self.outputs.out_file) - return outputs - + def _gen_filename(self, name): if name is 'out_filename': return self._gen_outfilename() @@ -602,8 +594,7 @@ def _post_run(self): self.outputs.out_file = op.abspath(self._gen_outfilename()) else: self.outputs.out_file = op.abspath(self.outputs.out_file) - return outputs - + def _gen_filename(self, name): if name is 'out_filename': return self._gen_outfilename() @@ -660,8 +651,7 @@ def _post_run(self): self.outputs.out_file = op.abspath(self._gen_outfilename()) else: self.outputs.out_file = op.abspath(self.outputs.out_file) - return outputs - + def _gen_filename(self, name): if name is 'out_filename': return self._gen_outfilename() diff --git a/nipype/interfaces/mrtrix/tensors.py b/nipype/interfaces/mrtrix/tensors.py index e675434107..98b7a556a6 100644 --- a/nipype/interfaces/mrtrix/tensors.py +++ b/nipype/interfaces/mrtrix/tensors.py @@ -82,8 +82,7 @@ def _post_run(self): self.outputs.spherical_harmonics_image = op.abspath(self._gen_outfilename()) else: self.outputs.spherical_harmonics_image = op.abspath(self.outputs.spherical_harmonics_image) - return outputs - + def _gen_filename(self, name): if name is 'out_filename': return self._gen_outfilename() @@ -165,8 +164,7 @@ def _post_run(self): self.outputs.spherical_harmonics_image = op.abspath(self._gen_outfilename()) else: self.outputs.spherical_harmonics_image = op.abspath(self.outputs.spherical_harmonics_image) - return outputs - + def _gen_filename(self, name): if name is 'out_filename': return self._gen_outfilename() @@ -219,8 +217,7 @@ def _post_run(self): self.outputs.response = op.abspath(self._gen_outfilename()) else: self.outputs.response = op.abspath(self.outputs.response) - return outputs - + def _gen_filename(self, name): if name is 'out_filename': return self._gen_outfilename() @@ -299,8 +296,7 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.encoding_file = op.abspath(self._gen_filename('out_encoding_file')) - return outputs - + def _gen_filename(self, name): if name is 'out_encoding_file': return self._gen_outfilename() diff --git a/nipype/interfaces/mrtrix/tracking.py b/nipype/interfaces/mrtrix/tracking.py index 807dea3b64..db3141320e 100644 --- a/nipype/interfaces/mrtrix/tracking.py +++ b/nipype/interfaces/mrtrix/tracking.py @@ -114,8 +114,7 @@ def _post_run(self): self.outputs.tract_image = op.abspath(self._gen_outfilename()) else: self.outputs.tract_image = os.path.abspath(self.outputs.tract_image) - return outputs - + def _gen_filename(self, name): if name is 'out_filename': return self._gen_outfilename() diff --git a/nipype/interfaces/mrtrix3/connectivity.py b/nipype/interfaces/mrtrix3/connectivity.py index 7d90ec97c1..f5b917fb2b 100644 --- a/nipype/interfaces/mrtrix3/connectivity.py +++ b/nipype/interfaces/mrtrix3/connectivity.py @@ -107,8 +107,7 @@ class BuildConnectome(MRTrix3Base): def _post_run(self): self.outputs.out_file = op.abspath(self.inputs.out_file) - return outputs - + class LabelConfigInputSpec(CommandLineInputSpec): in_file = File(exists=True, argstr='%s', mandatory=True, position=-3, @@ -184,4 +183,4 @@ def _parse_inputs(self, skip=None): def _post_run(self): self.outputs.out_file = op.abspath(self.inputs.out_file) - return outputs + \ No newline at end of file diff --git a/nipype/interfaces/mrtrix3/preprocess.py b/nipype/interfaces/mrtrix3/preprocess.py index f09af47af0..252efecc98 100644 --- a/nipype/interfaces/mrtrix3/preprocess.py +++ b/nipype/interfaces/mrtrix3/preprocess.py @@ -111,8 +111,7 @@ def _post_run(self): if isdefined(self.inputs.out_sf): self.outputs.out_sf = op.abspath(self.inputs.out_sf) - return outputs - + class ACTPrepareFSLInputSpec(CommandLineInputSpec): in_file = File(exists=True, argstr='%s', mandatory=True, position=-2, @@ -151,8 +150,7 @@ class ACTPrepareFSL(CommandLine): def _post_run(self): self.outputs.out_file = op.abspath(self.inputs.out_file) - return outputs - + class ReplaceFSwithFIRSTInputSpec(CommandLineInputSpec): in_file = File(exists=True, argstr='%s', mandatory=True, position=-4, @@ -198,4 +196,4 @@ class ReplaceFSwithFIRST(CommandLine): def _post_run(self): self.outputs.out_file = op.abspath(self.inputs.out_file) - return outputs + \ No newline at end of file diff --git a/nipype/interfaces/mrtrix3/reconst.py b/nipype/interfaces/mrtrix3/reconst.py index 6a6d4023b2..ba83ee8b55 100644 --- a/nipype/interfaces/mrtrix3/reconst.py +++ b/nipype/interfaces/mrtrix3/reconst.py @@ -74,8 +74,7 @@ class FitTensor(MRTrix3Base): def _post_run(self): self.outputs.out_file = op.abspath(self.inputs.out_file) - return outputs - + class EstimateFODInputSpec(MRTrix3BaseInputSpec): in_file = File(exists=True, argstr='%s', mandatory=True, position=-3, @@ -190,4 +189,4 @@ class EstimateFOD(MRTrix3Base): def _post_run(self): self.outputs.out_file = op.abspath(self.inputs.out_file) - return outputs + \ No newline at end of file diff --git a/nipype/interfaces/mrtrix3/tracking.py b/nipype/interfaces/mrtrix3/tracking.py index a1aaad27fd..b92ed88a09 100644 --- a/nipype/interfaces/mrtrix3/tracking.py +++ b/nipype/interfaces/mrtrix3/tracking.py @@ -251,4 +251,4 @@ def _format_arg(self, name, trait_spec, value): def _post_run(self): self.outputs.out_file = op.abspath(self.inputs.out_file) - return outputs + \ No newline at end of file diff --git a/nipype/interfaces/mrtrix3/utils.py b/nipype/interfaces/mrtrix3/utils.py index 219826529d..1782365016 100644 --- a/nipype/interfaces/mrtrix3/utils.py +++ b/nipype/interfaces/mrtrix3/utils.py @@ -59,8 +59,7 @@ class BrainMask(CommandLine): def _post_run(self): self.outputs.out_file = op.abspath(self.inputs.out_file) - return outputs - + class Mesh2PVEInputSpec(CommandLineInputSpec): in_file = File(exists=True, argstr='%s', mandatory=True, position=-3, @@ -106,8 +105,7 @@ class Mesh2PVE(CommandLine): def _post_run(self): self.outputs.out_file = op.abspath(self.inputs.out_file) - return outputs - + class Generate5ttInputSpec(CommandLineInputSpec): in_fast = InputMultiPath( @@ -153,8 +151,7 @@ class Generate5tt(CommandLine): def _post_run(self): self.outputs.out_file = op.abspath(self.inputs.out_file) - return outputs - + class TensorMetricsInputSpec(CommandLineInputSpec): in_file = File(exists=True, argstr='%s', mandatory=True, position=-1, @@ -214,8 +211,7 @@ def _post_run(self): if isdefined(getattr(self.inputs, k)): setattr(self.outputs, k, op.abspath(getattr(self.inputs, k)) - return outputs - + class ComputeTDIInputSpec(CommandLineInputSpec): in_file = File(exists=True, argstr='%s', mandatory=True, position=-2, @@ -350,8 +346,7 @@ class ComputeTDI(MRTrix3Base): def _post_run(self): self.outputs.out_file = op.abspath(self.inputs.out_file) - return outputs - + class TCK2VTKInputSpec(CommandLineInputSpec): in_file = File(exists=True, argstr='%s', mandatory=True, position=-2, @@ -401,4 +396,4 @@ class TCK2VTK(MRTrix3Base): def _post_run(self): self.outputs.out_file = op.abspath(self.inputs.out_file) - return outputs + \ No newline at end of file diff --git a/nipype/interfaces/nipy/model.py b/nipype/interfaces/nipy/model.py index 59c43af7a5..168bd3f9a5 100644 --- a/nipype/interfaces/nipy/model.py +++ b/nipype/interfaces/nipy/model.py @@ -204,8 +204,7 @@ def _post_run(self): self.outputs.a = self._a_file if self.inputs.save_residuals: self.outputs.residuals = self._residuals_file - return outputs - + class EstimateContrastInputSpec(BaseInterfaceInputSpec): contrasts = traits.List( @@ -315,4 +314,4 @@ def _post_run(self): self.outputs.stat_maps = self._stat_maps self.outputs.p_maps = self._p_maps self.outputs.z_maps = self._z_maps - return outputs + \ No newline at end of file diff --git a/nipype/interfaces/nipy/preprocess.py b/nipype/interfaces/nipy/preprocess.py index a30713c2f3..106931e2b2 100644 --- a/nipype/interfaces/nipy/preprocess.py +++ b/nipype/interfaces/nipy/preprocess.py @@ -72,8 +72,7 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.brain_mask = self._brain_mask_path - return outputs - + class FmriRealign4dInputSpec(BaseInterfaceInputSpec): @@ -192,8 +191,7 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.out_file = self._out_file_path self.outputs.par_file = self._par_file_path - return outputs - + class SpaceTimeRealignerInputSpec(BaseInterfaceInputSpec): @@ -322,8 +320,7 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.out_file = self._out_file_path self.outputs.par_file = self._par_file_path - return outputs - + class TrimInputSpec(BaseInterfaceInputSpec): in_file = File( @@ -381,4 +378,4 @@ def _post_run(self): newpath=os.getcwd(), suffix=self.inputs.suffix) self.outputs.out_file = os.path.abspath(self.outputs.out_file) - return outputs + \ No newline at end of file diff --git a/nipype/interfaces/nipy/utils.py b/nipype/interfaces/nipy/utils.py index 6b707afdcb..84e8ae9715 100644 --- a/nipype/interfaces/nipy/utils.py +++ b/nipype/interfaces/nipy/utils.py @@ -101,4 +101,4 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.similarity = self._similarity - return outputs + \ No newline at end of file diff --git a/nipype/interfaces/nitime/analysis.py b/nipype/interfaces/nitime/analysis.py index c21805358d..8d206411d7 100644 --- a/nipype/interfaces/nitime/analysis.py +++ b/nipype/interfaces/nitime/analysis.py @@ -195,8 +195,7 @@ def _post_run(self): self.outputs.coherence_fig = fname_presuffix(self.inputs.output_figure_file, suffix='_coherence') self.outputs.timedelay_fig = fname_presuffix(self.inputs.output_figure_file, suffix='_delay') - return outputs - + def _make_output_files(self): """ Generate the output csv files. diff --git a/nipype/interfaces/petpvc.py b/nipype/interfaces/petpvc.py index 7e3fc16291..c21edfc638 100644 --- a/nipype/interfaces/petpvc.py +++ b/nipype/interfaces/petpvc.py @@ -171,8 +171,7 @@ def _post_run(self): suffix='_{}_pvc'.format(method_name)) self.outputs.out_file = os.path.abspath(self.outputs.out_file) - return outputs - + def _gen_fname(self, basename, cwd=None, suffix=None, change_ext=True, ext='.nii.gz'): """Generate a filename based on the given parameters. diff --git a/nipype/interfaces/spm/model.py b/nipype/interfaces/spm/model.py index 54b2c54232..8c3cc66eb7 100644 --- a/nipype/interfaces/spm/model.py +++ b/nipype/interfaces/spm/model.py @@ -155,8 +155,7 @@ def _make_matlab_command(self, content): def _post_run(self): spm = os.path.join(os.getcwd(), 'SPM.mat') self.outputs.spm_mat_file = spm - return outputs - + class EstimateModelInputSpec(SPMCommandInputSpec): spm_mat_file = File(exists=True, field='spmmat', desc='absolute path to SPM.mat', @@ -239,8 +238,7 @@ def _post_run(self): self.outputs.RPVimage = rpv spm = os.path.join(pth, 'SPM.mat') self.outputs.spm_mat_file = spm - return outputs - + class EstimateContrastInputSpec(SPMCommandInputSpec): spm_mat_file = File(exists=True, field='spmmat', @@ -407,8 +405,7 @@ def _post_run(self): if len(spmf) > 0: self.outputs.spmF_images = sorted(spmf) self.outputs.spm_mat_file = self.inputs.spm_mat_file - return outputs - + class ThresholdInputSpec(SPMCommandInputSpec): spm_mat_file = File(exists=True, desc='absolute path to SPM.mat', copyfile=True, mandatory=True) @@ -585,13 +582,11 @@ def aggregate_outputs(self, runtime=None): setattr(outputs, 'pre_topo_n_clusters', int(line[len("pre_topo_n_clusters = "):].strip())) elif line.startswith("cluster_forming_thr = "): setattr(outputs, 'cluster_forming_thr', float(line[len("cluster_forming_thr = "):].strip())) - return outputs - + def _post_run(self): self.outputs.thresholded_map = self._gen_thresholded_map_filename() self.outputs.pre_topo_fdr_map = self._gen_pre_topo_map_filename() - return outputs - + class ThresholdStatisticsInputSpec(SPMCommandInputSpec): spm_mat_file = File(exists=True, desc='absolute path to SPM.mat', copyfile=True, mandatory=True) @@ -694,8 +689,7 @@ def aggregate_outputs(self, runtime=None, needed_outputs=None): cur_output = line.split()[0] continue - return outputs - + class FactorialDesignInputSpec(SPMCommandInputSpec): spm_mat_dir = Directory(exists=True, field='dir', desc='directory to store SPM.mat file (opt)') @@ -777,8 +771,7 @@ def _parse_inputs(self): def _post_run(self): spm = os.path.join(os.getcwd(), 'SPM.mat') self.outputs.spm_mat_file = spm - return outputs - + class OneSampleTTestDesignInputSpec(FactorialDesignInputSpec): in_files = traits.List(File(exists=True), field='des.t1.scans', diff --git a/nipype/interfaces/spm/preprocess.py b/nipype/interfaces/spm/preprocess.py index 81dd1ab016..b51ddae1fb 100644 --- a/nipype/interfaces/spm/preprocess.py +++ b/nipype/interfaces/spm/preprocess.py @@ -107,8 +107,7 @@ def _post_run(self): else: run = fname_presuffix(f, prefix=self.inputs.out_prefix) self.outputs.timecorrected_files.append(run) - return outputs - + class RealignInputSpec(SPMCommandInputSpec): in_files = InputMultiPath(traits.Either(traits.List(File(exists=True)), @@ -250,8 +249,7 @@ def _post_run(self): realigned_run = fname_presuffix(imgf, prefix=self.inputs.out_prefix) self.outputs.realigned_files.append(realigned_run) - return outputs - + class CoregisterInputSpec(SPMCommandInputSpec): target = File(exists=True, field='ref', mandatory=True, @@ -358,8 +356,7 @@ def _post_run(self): for imgf in filename_to_list(self.inputs.source): self.outputs.coregistered_source.append(fname_presuffix(imgf, prefix=self.inputs.out_prefix)) - return outputs - + class NormalizeInputSpec(SPMCommandInputSpec): template = File(exists=True, field='eoptions.template', @@ -511,8 +508,7 @@ def _post_run(self): self.outputs.normalized_source.append(fname_presuffix(imgf, prefix=prefixNorm)) - return outputs - + class Normalize12InputSpec(SPMCommandInputSpec): image_to_align = File(exists=True, field='subj.vol', @@ -666,8 +662,7 @@ def _post_run(self): self.outputs.normalized_image = fname_presuffix(self.inputs.image_to_align, prefix='w') - return outputs - + class SegmentInputSpec(SPMCommandInputSpec): data = InputMultiPath(File(exists=True), field='data', desc='one scan per subject', @@ -813,8 +808,7 @@ def _post_run(self): self.outputs.transformation_mat = t_mat invt_mat = fname_presuffix(f, suffix='_seg_inv_sn.mat', use_ext=False) self.outputs.inverse_transformation_mat = invt_mat - return outputs - + class NewSegmentInputSpec(SPMCommandInputSpec): channel_files = InputMultiPath(File(exists=True), @@ -979,8 +973,7 @@ def _post_run(self): self.outputs.bias_corrected_images.append(os.path.join(pth, "m%s.nii" % (base))) if self.inputs.channel_info[2][1]: self.outputs.bias_field_images.append(os.path.join(pth, "BiasField_%s.nii" % (base))) - return outputs - + class SmoothInputSpec(SPMCommandInputSpec): in_files = InputMultiPath(File(exists=True), field='data', @@ -1040,8 +1033,7 @@ def _post_run(self): for imgf in filename_to_list(self.inputs.in_files): self.outputs.smoothed_files.append(fname_presuffix(imgf, prefix=self.inputs.out_prefix)) - return outputs - + class DARTELInputSpec(SPMCommandInputSpec): image_files = traits.List(traits.List(File(exists=True)), @@ -1145,8 +1137,7 @@ def _post_run(self): self.outputs.dartel_flow_fields.append(os.path.realpath('u_%s_%s%s' % (base, self.inputs.template_prefix, ext))) - return outputs - + class DARTELNorm2MNIInputSpec(SPMCommandInputSpec): template_file = File(exists=True, @@ -1237,8 +1228,7 @@ def _post_run(self): base, ext))) - return outputs - + class CreateWarpedInputSpec(SPMCommandInputSpec): image_files = InputMultiPath(File(exists=True), @@ -1306,8 +1296,7 @@ def _post_run(self): else: self.outputs.warped_files.append(os.path.realpath('w%s%s' % (base, ext))) - return outputs - + class ApplyDeformationFieldInputSpec(SPMCommandInputSpec): in_files = InputMultiPath(File(exists=True), mandatory=True, field='fnames') @@ -1348,8 +1337,7 @@ def _post_run(self): for filename in self.inputs.in_files: _, fname = os.path.split(filename) self.outputs.out_files.append(os.path.realpath('w%s' % fname)) - return outputs - + class VBMSegmentInputSpec(SPMCommandInputSpec): @@ -1599,8 +1587,7 @@ def _post_run(self): if self.inputs.jacobian_determinant and do_dartel: self.outputs.jacobian_determinant_images.append( os.path.join(pth, "jac_wrp1%s.nii" % (base))) - return outputs - + def _format_arg(self, opt, spec, val): """Convert input to appropriate format for spm """ diff --git a/nipype/interfaces/spm/utils.py b/nipype/interfaces/spm/utils.py index 8b60cdbc1f..7beb521617 100644 --- a/nipype/interfaces/spm/utils.py +++ b/nipype/interfaces/spm/utils.py @@ -37,8 +37,7 @@ def _make_matlab_command(self, _): def _post_run(self): self.outputs.nifti_file = self.output_name - return outputs - + class CalcCoregAffineInputSpec(SPMCommandInputSpec): target = File(exists=True, mandatory=True, @@ -117,8 +116,7 @@ def _make_matlab_command(self, _): def _post_run(self): self.outputs.mat = os.path.abspath(self.inputs.mat) self.outputs.invmat = os.path.abspath(self.inputs.invmat) - return outputs - + class ApplyTransformInputSpec(SPMCommandInputSpec): in_file = File(exists=True, mandatory=True, copyfile=True, @@ -178,8 +176,7 @@ def _post_run(self): self.outputs.out_file = os.path.abspath(self._gen_outfilename()) else: self.outputs.out_file = os.path.abspath(self.inputs.out_file) - return outputs - + def _gen_outfilename(self): _, name, _ = split_filename(self.inputs.in_file) return name + '_trans.nii' @@ -228,8 +225,7 @@ def _make_matlab_command(self, _): def _post_run(self): self.outputs.out_file = os.path.abspath(self.inputs.out_file) - return outputs - + class ApplyInverseDeformationInput(SPMCommandInputSpec): in_files = InputMultiPath( @@ -309,8 +305,7 @@ def _post_run(self): for filename in self.inputs.in_files: _, fname = os.path.split(filename) self.outputs.out_files.append(os.path.realpath('w%s' % fname)) - return outputs - + class ResliceToReferenceInput(SPMCommandInputSpec): in_files = InputMultiPath( @@ -378,8 +373,7 @@ def _post_run(self): for filename in self.inputs.in_files: _, fname = os.path.split(filename) self.outputs.out_files.append(os.path.realpath('w%s' % fname)) - return outputs - + class DicomImportInputSpec(SPMCommandInputSpec): in_files = InputMultiPath( @@ -467,4 +461,4 @@ def _post_run(self): self.outputs.out_files = glob(os.path.join(od, os.path.join('*', '*', '*.%s' % ext))) elif self.inputs.output_dir_struct == 'patid_date': self.outputs.out_files = glob(os.path.join(od, os.path.join('*', '*', '*', '*.%s' % ext))) - return outputs + \ No newline at end of file diff --git a/nipype/pipeline/engine/tests/test_join.py b/nipype/pipeline/engine/tests/test_join.py index a494ee946d..4b0215e3a9 100644 --- a/nipype/pipeline/engine/tests/test_join.py +++ b/nipype/pipeline/engine/tests/test_join.py @@ -33,8 +33,7 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.output1 = self.inputs.in_files[0] - return outputs - + class IncrementInputSpec(nib.TraitedSpec): input1 = nib.traits.Int(mandatory=True, desc='input') @@ -55,8 +54,7 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.output1 = self.inputs.input1 + self.inputs.inc - return outputs - + _sums = [] _sum_operands = [] @@ -86,8 +84,7 @@ def _post_run(self): _sum_operands.append(self.outputs.operands) self.outputs.output1 = sum(self.inputs.input1) _sums.append(self.outputs.output1) - return outputs - + _set_len = None """The Set interface execution result.""" @@ -112,8 +109,7 @@ def _run_interface(self, runtime): def _post_run(self): global _set_len _set_len = self.outputs.output1 = len(self.inputs.input1) - return outputs - + _products = [] """The Products interface execution results.""" @@ -140,8 +136,7 @@ def _post_run(self): global _products self.outputs.output1 = self.inputs.input1 * self.inputs.input2 _products.append(self.outputs.output1) - return outputs - + def test_join_expansion(): cwd = os.getcwd() diff --git a/nipype/pipeline/engine/tests/test_utils.py b/nipype/pipeline/engine/tests/test_utils.py index fdf27bedfa..8865249b39 100644 --- a/nipype/pipeline/engine/tests/test_utils.py +++ b/nipype/pipeline/engine/tests/test_utils.py @@ -150,8 +150,7 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.output1 = [1] - return outputs - + def test_inputs_removal(): out_dir = mkdtemp() diff --git a/nipype/pipeline/engine/utils.py b/nipype/pipeline/engine/utils.py index 4ed3209f0c..b60e46db8a 100644 --- a/nipype/pipeline/engine/utils.py +++ b/nipype/pipeline/engine/utils.py @@ -1159,8 +1159,7 @@ def clean_working_directory(outputs, cwd, inputs, needed_outputs, config, for key in outputs.copyable_trait_names(): if key not in outputs_to_keep: setattr(outputs, key, Undefined) - return outputs - + def merge_dict(d1, d2, merge=lambda x, y: y): """ diff --git a/nipype/pipeline/plugins/tests/test_debug.py b/nipype/pipeline/plugins/tests/test_debug.py index 9e8a043e22..4a8484cbd1 100644 --- a/nipype/pipeline/plugins/tests/test_debug.py +++ b/nipype/pipeline/plugins/tests/test_debug.py @@ -26,8 +26,7 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.output1 = [1, self.inputs.input1] - return outputs - + def callme(node, graph): pass diff --git a/nipype/pipeline/plugins/tests/test_linear.py b/nipype/pipeline/plugins/tests/test_linear.py index 7aaa27adf3..1b049771e3 100644 --- a/nipype/pipeline/plugins/tests/test_linear.py +++ b/nipype/pipeline/plugins/tests/test_linear.py @@ -26,8 +26,7 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.output1 = [1, self.inputs.input1] - return outputs - + def test_run_in_series(): cur_dir = os.getcwd() diff --git a/nipype/pipeline/plugins/tests/test_multiproc.py b/nipype/pipeline/plugins/tests/test_multiproc.py index 4d672cb3d5..9cba7d1efe 100644 --- a/nipype/pipeline/plugins/tests/test_multiproc.py +++ b/nipype/pipeline/plugins/tests/test_multiproc.py @@ -26,8 +26,7 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.output1 = [1, self.inputs.input1] - return outputs - + def test_run_multiproc(): cur_dir = os.getcwd() diff --git a/nipype/pipeline/plugins/tests/test_oar.py b/nipype/pipeline/plugins/tests/test_oar.py index faadac0e14..59d6e45452 100644 --- a/nipype/pipeline/plugins/tests/test_oar.py +++ b/nipype/pipeline/plugins/tests/test_oar.py @@ -26,8 +26,7 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.output1 = [1, self.inputs.input1] - return outputs - + @skipif(True) def test_run_oar(): diff --git a/nipype/pipeline/plugins/tests/test_pbs.py b/nipype/pipeline/plugins/tests/test_pbs.py index 426d9c4da6..5fbaa1b7e8 100644 --- a/nipype/pipeline/plugins/tests/test_pbs.py +++ b/nipype/pipeline/plugins/tests/test_pbs.py @@ -27,8 +27,7 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.output1 = [1, self.inputs.input1] - return outputs - + @skipif(True) def test_run_pbsgraph(): diff --git a/nipype/pipeline/plugins/tests/test_somaflow.py b/nipype/pipeline/plugins/tests/test_somaflow.py index 98d3315b78..0025d214c3 100644 --- a/nipype/pipeline/plugins/tests/test_somaflow.py +++ b/nipype/pipeline/plugins/tests/test_somaflow.py @@ -29,8 +29,7 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.output1 = [1, self.inputs.input1] - return outputs - + @skipif(soma_not_loaded) def test_run_somaflow(): From 0e3e29c8a042dabf0f898b4387fc847cf0341ef0 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 17 Feb 2016 10:24:55 -0800 Subject: [PATCH 37/73] fix syntax errors --- nipype/interfaces/dynamic_slicer.py | 4 +- nipype/interfaces/freesurfer/model.py | 30 ++++++------- nipype/interfaces/freesurfer/preprocess.py | 44 +++++++++--------- nipype/interfaces/freesurfer/utils.py | 40 ++++++++--------- nipype/interfaces/fsl/model.py | 50 ++++++++++----------- nipype/interfaces/fsl/utils.py | 52 +++++++++++----------- nipype/interfaces/io.py | 2 +- nipype/interfaces/mne/base.py | 6 +-- nipype/interfaces/mrtrix3/utils.py | 26 +++++------ nipype/interfaces/spm/preprocess.py | 36 +++++++-------- nipype/pipeline/engine/tests/test_join.py | 12 ++--- nipype/utils/docparse.py | 4 +- 12 files changed, 151 insertions(+), 155 deletions(-) diff --git a/nipype/interfaces/dynamic_slicer.py b/nipype/interfaces/dynamic_slicer.py index 277c86d35d..e5d9225d2f 100644 --- a/nipype/interfaces/dynamic_slicer.py +++ b/nipype/interfaces/dynamic_slicer.py @@ -20,7 +20,7 @@ def _format_arg(self, name, spec, value): else: fname = value return spec.argstr % fname - return super(SlicerCommandLine, self)._format_arg(name, spec, value) + return super(SlicerCommandLineInputSpec, self)._format_arg(name, spec, value) class SlicerCommandLine(CommandLine): @@ -148,7 +148,7 @@ def _post_run(self): setattr(self.outputs, name, self._gen_filename(name)) else: setattr(self.outputs, name, Undefined) - + # test = SlicerCommandLine(module="BRAINSFit") # test.inputs.fixedVolume = "/home/filo/workspace/fmri_tumour/data/pilot1/10_co_COR_3D_IR_PREP.nii" diff --git a/nipype/interfaces/freesurfer/model.py b/nipype/interfaces/freesurfer/model.py index c1dc8f2b74..deb156f96e 100644 --- a/nipype/interfaces/freesurfer/model.py +++ b/nipype/interfaces/freesurfer/model.py @@ -98,14 +98,14 @@ class MRISPreproc(FSCommand): output_spec = MRISPreprocOutputSpec def _post_run(self): - + outfile = self.inputs.out_file self.outputs.out_file = outfile if not isdefined(outfile): self.outputs.out_file = os.path.join(os.getcwd(), 'concat_%s_%s.mgz' % (self.inputs.hemi, self.inputs.target)) - + def _gen_filename(self, name): if name == 'out_file': return getattr(self.outputs, name) @@ -277,7 +277,7 @@ def _format_arg(self, name, spec, value): return super(GLMFit, self)._format_arg(name, spec, value) def _post_run(self): - + # Get the top-level output directory if not isdefined(self.inputs.glm_dir): glmdir = os.getcwd() @@ -323,7 +323,7 @@ def _post_run(self): self.outputs.singluar_values = os.path.join(pcadir, "sdiag.mat") self.outputs.svd_stats_file = os.path.join(pcadir, "stats.dat") - + def _gen_filename(self, name): if name == 'glm_dir': return os.getcwd() @@ -416,7 +416,7 @@ class Binarize(FSCommand): output_spec = BinarizeOutputSpec def _post_run(self): - + outfile = self.inputs.binary_file if not isdefined(outfile): if isdefined(self.inputs.out_type): @@ -440,7 +440,7 @@ def _post_run(self): use_ext=False) else: self.outputs.count_file = value - + def _format_arg(self, name, spec, value): if name == 'count_file': if isinstance(value, bool): @@ -524,13 +524,13 @@ class Concatenate(FSCommand): output_spec = ConcatenateOutputSpec def _post_run(self): - + if not isdefined(self.inputs.concatenated_file): self.outputs.concatenated_file = os.path.join(os.getcwd(), 'concat_output.nii.gz') else: self.outputs.concatenated_file = self.inputs.concatenated_file - + def _gen_filename(self, name): if name == 'concatenated_file': return getattr(self.outputs, name) @@ -631,7 +631,7 @@ class SegStats(FSCommand): output_spec = SegStatsOutputSpec def _post_run(self): - + if isdefined(self.inputs.summary_file): self.outputs.summary_file = os.path.abspath(self.inputs.summary_file) else: @@ -650,10 +650,10 @@ def _post_run(self): if isinstance(value, bool): setattr(self.outputs, name, fname_presuffix(src, suffix=suffix, newpath=os.getcwd(), - use_ext=False) + use_ext=False)) else: - setattr(self.outputs, name, os.path.abspath(value) - + setattr(self.outputs, name, os.path.abspath(value)) + def _format_arg(self, name, spec, value): if name in ['avgwf_txt_file', 'avgwf_file', 'sf_avg_file']: if isinstance(value, bool): @@ -749,7 +749,7 @@ class Label2Vol(FSCommand): output_spec = Label2VolOutputSpec def _post_run(self): - + outfile = self.inputs.vol_label_file if not isdefined(outfile): for key in ['label_file', 'annot_file', 'seg_file']: @@ -764,7 +764,7 @@ def _post_run(self): newpath=os.getcwd(), use_ext=False) self.outputs.vol_label_file = outfile - + def _gen_filename(self, name): if name == 'vol_label_file': return getattr(self.outputs, name) @@ -832,7 +832,7 @@ def _post_run(self): self.outputs.vol_synth_file = os.path.abspath(self.inputs.vol_synth_file) if not isdefined(self.inputs.use_weights) or self.inputs.use_weights is False: self.outputs.weight_file = os.path.abspath(self.inputs.weight_file) - + def _verify_weights_file_exists(self): if not os.path.exists(os.path.abspath(self.inputs.weight_file)): raise traits.TraitError("MS_LDA: use_weights must accompany an existing weights file") diff --git a/nipype/interfaces/freesurfer/preprocess.py b/nipype/interfaces/freesurfer/preprocess.py index ecc01b4541..60b9f167aa 100644 --- a/nipype/interfaces/freesurfer/preprocess.py +++ b/nipype/interfaces/freesurfer/preprocess.py @@ -67,10 +67,10 @@ class ParseDICOMDir(FSCommand): output_spec = ParseDICOMDirOutputSpec def _post_run(self): - + if isdefined(self.inputs.dicom_info_file): self.outputs.dicom_info_file = os.path.join(os.getcwd(), self.inputs.dicom_info_file) - + class UnpackSDICOMDirInputSpec(FSTraitedSpec): source_dir = Directory(exists=True, argstr='-src %s', @@ -374,7 +374,7 @@ def _get_outfilename(self): return os.path.abspath(outfile) def _post_run(self): - + outfile = self._get_outfilename() if isdefined(self.inputs.split) and self.inputs.split: size = load(self.inputs.in_file).shape @@ -411,7 +411,7 @@ def _post_run(self): suffix='%03d' % (i + 1))) outfile = outfiles self.outputs.out_file = outfile - + def _gen_filename(self, name): if name == 'out_file': return self._get_outfilename() @@ -584,9 +584,9 @@ def _get_outfilename(self): return outfile def _post_run(self): - + self.outputs.resampled_file = self._get_outfilename() - + def _gen_filename(self, name): if name == 'resampled_file': return self._get_outfilename() @@ -747,13 +747,13 @@ def _post_run(self): else: hemi = 'both' - + outputs.update(FreeSurferSource(subject_id=self.inputs.subject_id, subjects_dir=subjects_dir, hemi=hemi)._list_outputs()) self.outputs.subject_id = self.inputs.subject_id self.outputs.subjects_dir = subjects_dir - + def _is_resuming(self): subjects_dir = self.inputs.subjects_dir if not isdefined(subjects_dir): @@ -865,7 +865,7 @@ class BBRegister(FSCommand): def _post_run(self): - + _in = self.inputs if isdefined(_in.out_reg_file): @@ -894,7 +894,7 @@ def _post_run(self): self.outputs.out_fsl_file = op.abspath(_in.out_fsl_file) self.outputs.min_cost_file = self.outputs.out_reg_file + '.mincost' - + def _format_arg(self, name, spec, value): if name in ['registered_file', 'out_fsl_file']: @@ -1012,9 +1012,9 @@ def _get_outfile(self): return outfile def _post_run(self): - + self.outputs.transformed_file = os.path.abspath(self._get_outfile()) - + def _gen_filename(self, name): if name == 'transformed_file': return self._get_outfile() @@ -1076,13 +1076,13 @@ class Smooth(FSCommand): output_spec = SmoothOutputSpec def _post_run(self): - + outfile = self.inputs.smoothed_file if not isdefined(outfile): outfile = self._gen_fname(self.inputs.in_file, suffix='_smooth') self.outputs.smoothed_file = outfile - + def _gen_filename(self, name): if name == 'smoothed_file': return getattr(self.outputs, name) @@ -1196,7 +1196,7 @@ def _format_arg(self, name, spec, value): return super(RobustRegister, self)._format_arg(name, spec, value) def _post_run(self): - + self.outputs.out_reg_file = self.inputs.out_reg_file if not isdefined(self.inputs.out_reg_file) and self.inputs.source_file: self.outputs.out_reg_file = fname_presuffix(self.inputs.source_file, @@ -1216,10 +1216,10 @@ def _post_run(self): setattr(self.outputs, name, fname_presuffix(prefices[sufftup[0]], suffix=sufftup[1], newpath=os.getcwd(), - use_ext=sufftup[2]) + use_ext=sufftup[2])) else: - setattr(self.outputs, name, value - + setattr(self.outputs, name, value) + def _gen_filename(self, name): if name == 'out_reg_file': return getattr(self.outputs, name) @@ -1280,7 +1280,7 @@ def _format_arg(self, name, spec, value): return super(FitMSParams, self)._format_arg(name, spec, value) def _post_run(self): - + if not isdefined(self.inputs.out_dir): out_dir = self._gen_filename("out_dir") else: @@ -1288,7 +1288,7 @@ def _post_run(self): self.outputs.t1_image = os.path.join(out_dir, "T1.mgz") self.outputs.pd_image = os.path.join(out_dir, "PD.mgz") self.outputs.t2star_image = os.path.join(out_dir, "T2star.mgz") - + def _gen_filename(self, name): if name == "out_dir": return os.getcwd() @@ -1336,13 +1336,13 @@ class SynthesizeFLASH(FSCommand): output_spec = SynthesizeFLASHOutputSpec def _post_run(self): - + if isdefined(self.inputs.out_file): self.outputs.out_file = self.inputs.out_file else: self.outputs.out_file = self._gen_fname("synth-flash_%02d.mgz" % self.inputs.flip_angle, suffix="") - + def _gen_filename(self, name): if name == "out_file": return self.outputs.out_file diff --git a/nipype/interfaces/freesurfer/utils.py b/nipype/interfaces/freesurfer/utils.py index 03aac946b0..1d94211e0e 100644 --- a/nipype/interfaces/freesurfer/utils.py +++ b/nipype/interfaces/freesurfer/utils.py @@ -214,7 +214,7 @@ def _post_run(self): suffix="_vox.txt", use_ext=False) self.outputs.vox_file = voxfile - + def _gen_filename(self, name): if name == "out_file": return getattr(self.outputs, name) @@ -282,7 +282,7 @@ def _post_run(self): self.outputs.out_file = fname_presuffix(in_file, suffix="_smooth%d" % kernel, newpath=os.getcwd()) - + def _gen_filename(self, name): if name == "out_file": return getattr(self.outputs, name) @@ -374,7 +374,7 @@ def _post_run(self): use_ext=use_ext) else: self.outputs.out_file = os.path.abspath(self.inputs.out_file) - + def _gen_filename(self, name): if name == "out_file": return getattr(self.outputs, name) @@ -488,7 +488,7 @@ def _post_run(self): use_ext=True) else: self.outputs.out_file = os.path.abspath(self.outputs.out_file) - + def _gen_filename(self, name): if name == "out_file": return getattr(self.outputs, name) @@ -697,7 +697,7 @@ def _post_run(self): snapshots.extend(["%s-pos.tif", "%s-ant.tif"]) snapshots = [self._gen_fname(f % stem, suffix="") for f in snapshots] self.outputs.snapshots = snapshots - + def _gen_filename(self, name): if name == "tcl_script": return "snapshots.tcl" @@ -765,7 +765,7 @@ def aggregate_outputs(self, runtime=None, needed_outputs=None): outputs.file_format = ftype outputs.data_type = dtype - + class MRIsConvertInputSpec(FSTraitedSpec): """ @@ -840,11 +840,11 @@ def _format_arg(self, name, spec, value): if name == "out_file" and not os.path.isabs(value): value = os.path.abspath(value) return super(MRIsConvert, self)._format_arg(name, spec, value) - + def _post_run(self): - + self.outputs.converted = os.path.abspath(self._gen_outfilename()) - + def _gen_filename(self, name): if name is 'out_file': return os.path.abspath(self._gen_outfilename()) @@ -909,9 +909,9 @@ class MRITessellate(FSCommand): output_spec = MRITessellateOutputSpec def _post_run(self): - + self.outputs.surface = os.path.abspath(self._gen_outfilename()) - + def _gen_filename(self, name): if name is 'out_file': return self._gen_outfilename() @@ -978,9 +978,9 @@ class MRIPretess(FSCommand): output_spec = MRIPretessOutputSpec def _post_run(self): - + self.outputs.out_file = os.path.abspath(self._gen_outfilename()) - + def _gen_filename(self, name): if name is 'out_file': return self._gen_outfilename() @@ -1034,9 +1034,9 @@ class MRIMarchingCubes(FSCommand): output_spec = MRIMarchingCubesOutputSpec def _post_run(self): - + self.outputs.surface = self._gen_outfilename() - + def _gen_filename(self, name): if name is 'out_file': return self._gen_outfilename() @@ -1104,9 +1104,9 @@ class SmoothTessellation(FSCommand): output_spec = SmoothTessellationOutputSpec def _post_run(self): - + self.outputs.surface = self._gen_outfilename() - + def _gen_filename(self, name): if name is 'out_file': return self._gen_outfilename() @@ -1160,9 +1160,9 @@ class MakeAverageSubject(FSCommand): output_spec = MakeAverageSubjectOutputSpec def _post_run(self): - + self.outputs.average_subject_name = self.inputs.out_name - + class ExtractMainComponentInputSpec(CommandLineInputSpec): in_file = File(exists=True, mandatory=True, argstr='%s', position=1, @@ -1272,7 +1272,7 @@ def _post_run(self): self.outputs.reg_file = os.path.abspath(self.inputs.reg_file) if isdefined(self.inputs.fsl_out): self.outputs.fsl_file = os.path.abspath(self.inputs.fsl_out) - + def _gen_outfilename(self): if isdefined(self.inputs.out_file): return os.path.abspath(self.inputs.out_file) diff --git a/nipype/interfaces/fsl/model.py b/nipype/interfaces/fsl/model.py index bc168b8798..e62586e375 100644 --- a/nipype/interfaces/fsl/model.py +++ b/nipype/interfaces/fsl/model.py @@ -344,7 +344,7 @@ def _run_interface(self, runtime): return runtime def _post_run(self): - + cwd = os.getcwd() self.outputs.fsf_files = [] self.outputs.ev_files = [] @@ -368,7 +368,7 @@ def _post_run(self): evname.append(name + 'TD') self.outputs.ev_files[runno].append( os.path.join(cwd, evfname)) - + class FEATInputSpec(FSLCommandInputSpec): fsf_file = File(exists=True, mandatory=True, argstr="%s", position=0, @@ -408,7 +408,7 @@ def _post_run(self): else: self.outputs.feat_dir = glob(os.path.join(os.getcwd(), '*feat'))[0] print('Outputs from FEATmodel:', outputs) - + class FEATModelInputSpec(FSLCommandInputSpec): fsf_file = File(exists=True, mandatory=True, argstr="%s", position=0, @@ -453,7 +453,7 @@ def _get_design_root(self, infile): def _post_run(self): # TODO: figure out file names and get rid off the globs - root = self._get_design_root(list_to_filename(self.inputs.fsf_file)) + root = self._get_design_root(list_to_filename(self.inputs.fsf_file)) design_file = glob(os.path.join(os.getcwd(), '%s*.mat' % root)) assert len(design_file) == 1, 'No mat file generated by FEAT Model' self.outputs.design_file = design_file[0] @@ -472,7 +472,7 @@ def _post_run(self): if fcon_file: assert len(fcon_file) == 1, 'No fts file generated by FEAT Model' self.outputs.fcon_file = fcon_file[0] - + class FILMGLSInputSpec(FSLCommandInputSpec): in_file = File(exists=True, mandatory=True, position=-3, @@ -743,7 +743,7 @@ def _post_run(self): if fstats: self.outputs.fstats = fstats self.outputs.zfstats = zfstats - + class FEATRegisterInputSpec(BaseInterfaceInputSpec): feat_dirs = InputMultiPath( @@ -789,7 +789,7 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.fsf_file = os.path.abspath( os.path.join(os.getcwd(), 'register.fsf')) - + class FLAMEOInputSpec(FSLCommandInputSpec): cope_file = File(exists=True, argstr='--copefile=%s', mandatory=True, @@ -958,7 +958,7 @@ def _post_run(self): self.outputs.stats_dir = pth - + class ContrastMgrInputSpec(FSLCommandInputSpec): tcon_file = File(exists=True, mandatory=True, @@ -1092,7 +1092,7 @@ def _post_run(self): if fstats: self.outputs.fstats = fstats self.outputs.zfstats = zfstats - + class L2ModelInputSpec(BaseInterfaceInputSpec): num_copes = traits.Range(low=1, mandatory=True, @@ -1163,9 +1163,8 @@ def _run_interface(self, runtime): def _post_run(self): for field in list(outputs.keys()): - setattr(self.outputs, field, os.path.join(os.getcwd(), - field.replace('_', '.')) - + setattr(self.outputs, field, os.path.join(os.getcwd(), field.replace('_', '.'))) + class MultipleRegressDesignInputSpec(BaseInterfaceInputSpec): contrasts = traits.List( @@ -1323,9 +1322,8 @@ def _post_run(self): for field in list(outputs.keys()): if ('fts' in field) and (nfcons == 0): continue - setattr(self.outputs, field, os.path.join(os.getcwd(), - field.replace('_', '.')) - + setattr(self.outputs, field, os.path.join(os.getcwd(), field.replace('_', '.'))) + class SMMInputSpec(FSLCommandInputSpec): spatial_data_file = File( @@ -1362,7 +1360,7 @@ def _post_run(self): if not isdefined(self.inputs.no_deactivation_class) or not self.inputs.no_deactivation_class: self.outputs.deactivation_p_map = self._gen_fname( basename="w3_mean", cwd="logdir") - + class MELODICInputSpec(FSLCommandInputSpec): in_files = InputMultiPath( @@ -1482,14 +1480,14 @@ class MELODIC(FSLCommand): _cmd = 'melodic' def _post_run(self): - + self.outputs.out_dir = self.inputs.out_dir if not isdefined(self.outputs.out_dir): self.outputs.out_dir = self._gen_filename("out_dir") if isdefined(self.inputs.report) and self.inputs.report: self.outputs.report_dir = os.path.join( self._gen_filename("out_dir"), "report") - + def _gen_filename(self, name): if name == "out_dir": return os.getcwd() @@ -1540,7 +1538,7 @@ def aggregate_outputs(self, runtime=None, needed_outputs=None): outputs.dlh = float(stdout[0].split()[1]) outputs.volume = int(stdout[1].split()[1]) outputs.resels = float(stdout[2].split()[1]) - + class ClusterInputSpec(FSLCommandInputSpec): in_file = File(argstr='--in=%s', mandatory=True, @@ -1639,7 +1637,7 @@ class Cluster(FSLCommand): 'out_mean_file': 'mean', 'out_pval_file': 'pval'} def _post_run(self): - + for key, suffix in list(self.filemap.items()): outkey = key[4:] inval = getattr(self.inputs, key) @@ -1651,10 +1649,10 @@ def _post_run(self): change_ext = False setattr(self.outputs, outkey, self._gen_fname(self.inputs.in_file, suffix='_' + suffix, - change_ext=change_ext) + change_ext=change_ext)) else: - setattr(self.outputs, outkey, os.path.abspath(inval) - + setattr(self.outputs, outkey, os.path.abspath(inval)) + def _format_arg(self, name, spec, value): if name in list(self.filemap.keys()): if isinstance(value, bool): @@ -1768,7 +1766,7 @@ class Randomise(FSLCommand): output_spec = RandomiseOutputSpec def _post_run(self): - + self.outputs.tstat_files = glob(self._gen_fname( '%s_tstat*.nii' % self.inputs.base_name)) self.outputs.fstat_files = glob(self._gen_fname( @@ -1792,7 +1790,7 @@ def _post_run(self): '%s_%s_p_fstat*.nii' % (self.inputs.base_name, prefix))) self.outputs.f_corrected_p_files = glob(self._gen_fname( '%s_%s_corrp_fstat*.nii' % (self.inputs.base_name, prefix))) - + class GLMInputSpec(FSLCommandInputSpec): in_file = File(exists=True, argstr='-i %s', mandatory=True, position=1, @@ -1939,4 +1937,4 @@ def _post_run(self): self.outputs.out_vnscales = os.path.abspath( self.inputs.out_vnscales_name) - \ No newline at end of file + diff --git a/nipype/interfaces/fsl/utils.py b/nipype/interfaces/fsl/utils.py index b10308d9eb..974678b950 100644 --- a/nipype/interfaces/fsl/utils.py +++ b/nipype/interfaces/fsl/utils.py @@ -121,7 +121,7 @@ class ImageMeants(FSLCommand): output_spec = ImageMeantsOutputSpec def _post_run(self): - + self.outputs.out_file = self.inputs.out_file if not isdefined(self.outputs.out_file): self.outputs.out_file = self._gen_fname(self.inputs.in_file, @@ -129,7 +129,7 @@ def _post_run(self): ext='.txt', change_ext=True) self.outputs.out_file = os.path.abspath(self.outputs.out_file) - + def _gen_filename(self, name): if name == 'out_file': return getattr(self.outputs, name) @@ -336,12 +336,12 @@ def _post_run(self): Else, contains path, filename of generated outputfile """ - self.outputs.roi_file = self.inputs.roi_file + self.outputs.roi_file = self.inputs.roi_file if not isdefined(self.outputs.roi_file): self.outputs.roi_file = self._gen_fname(self.inputs.in_file, suffix='_roi') self.outputs.roi_file = os.path.abspath(self.outputs.roi_file) - + def _gen_filename(self, name): if name == 'roi_file': return getattr(self.outputs, name) @@ -385,13 +385,13 @@ def _post_run(self): Else, contains path, filename of generated outputfile """ - ext = Info.output_type_to_ext(self.inputs.output_type) + ext = Info.output_type_to_ext(self.inputs.output_type) outbase = 'vol*' if isdefined(self.inputs.out_base_name): outbase = '%s*' % self.inputs.out_base_name self.outputs.out_files = sorted(glob(os.path.join(os.getcwd(), outbase + ext))) - + class ImageMathsInputSpec(FSLCommandInputSpec): in_file = File(exists=True, argstr="%s", mandatory=True, position=1) @@ -444,12 +444,12 @@ def _post_run(self): suffix = '_maths' # ohinds: build suffix if isdefined(self.inputs.suffix): suffix = self.inputs.suffix - self.outputs.out_file = self.inputs.out_file + if not isdefined(self.outputs.out_file): self.outputs.out_file = self._gen_fname(self.inputs.in_file, suffix=suffix) self.outputs.out_file = os.path.abspath(self.outputs.out_file) - + class FilterRegressorInputSpec(FSLCommandInputSpec): in_file = File(exists=True, argstr="-i %s", @@ -504,13 +504,13 @@ def _format_arg(self, name, trait_spec, value): return super(FilterRegressor, self)._format_arg(name, trait_spec, value) def _post_run(self): - + self.outputs.out_file = self.inputs.out_file if not isdefined(self.outputs.out_file): self.outputs.out_file = self._gen_fname( self.inputs.in_file, suffix='_regfilt') self.outputs.out_file = os.path.abspath(self.outputs.out_file) - + def _gen_filename(self, name): if name == 'out_file': return getattr(self.outputs, name) @@ -592,7 +592,7 @@ def aggregate_outputs(self, runtime=None, needed_outputs=None): out_stat = out_stat[0] save_json(outfile, dict(stat=out_stat)) outputs.out_stat = out_stat - + class AvScaleInputSpec(FSLCommandInputSpec): mat_file = File(exists=True, argstr="%s", @@ -656,7 +656,7 @@ def lines_to_float(lines): outputs.forward_half_transform = lines_to_float(out[16:20]) outputs.backward_half_transform = lines_to_float(out[22:-1]) - + class OverlayInputSpec(FSLCommandInputSpec): transparency = traits.Bool(desc='make overlay colors semi-transparent', @@ -757,7 +757,7 @@ def _post_run(self): stem = split_filename(self.inputs.stat_image)[1] out_file = self._gen_fname(stem, suffix='_overlay') self.outputs.out_file = os.path.abspath(out_file) - + def _gen_filename(self, name): if name == 'out_file': return self.outputs.out_file @@ -857,7 +857,7 @@ def _post_run(self): if not isdefined(out_file): out_file = self._gen_fname(self.inputs.in_file, ext='.png') self.outputs.out_file = os.path.abspath(out_file) - + def _gen_filename(self, name): if name == 'out_file': return self.outputs.out_file @@ -958,7 +958,7 @@ def _post_run(self): infile = self.inputs.in_file out_file = self._gen_fname(infile, ext='.png') self.outputs.out_file = os.path.abspath(out_file) - + def _gen_filename(self, name): if name == 'out_file': return self.outputs.out_file @@ -1067,7 +1067,7 @@ def _post_run(self): out_file = fname_presuffix( infile, suffix="_%s.png" % plttype, use_ext=False) self.outputs.out_file = os.path.abspath(out_file) - + def _gen_filename(self, name): if name == 'out_file': return self.outputs.out_file @@ -1142,7 +1142,7 @@ def _post_run(self): newpath=os.getcwd(), use_ext=False) self.outputs.out_file = os.path.abspath(outfile) - + def _gen_filename(self, name): if name == "out_file": return self.outputs.out_file @@ -1186,7 +1186,7 @@ def _post_run(self): self.outputs.out_file = self._gen_fname(self.inputs.in_file, suffix='_newdims') self.outputs.out_file = os.path.abspath(self.outputs.out_file) - + def _gen_filename(self, name): if name == "out_file": return self.outputs.out_file @@ -1234,9 +1234,9 @@ def _gen_outfilename(self): return out_file def _post_run(self): - + self.outputs.out_file = os.path.abspath(self._gen_outfilename()) - + def _gen_filename(self, name): if name == 'out_file': return self._gen_outfilename() @@ -1285,13 +1285,13 @@ class SigLoss(FSLCommand): _cmd = 'sigloss' def _post_run(self): - + self.outputs.out_file = self.inputs.out_file if not isdefined(self.outputs.out_file) and \ isdefined(self.inputs.in_file): self.outputs.out_file = self._gen_fname(self.inputs.in_file, suffix='_sigloss') - + def _gen_filename(self, name): if name == 'out_file': return self.outputs.out_file @@ -1332,12 +1332,12 @@ def _gen_filename(self, name): return None def _post_run(self): - + if not isdefined(self.inputs.out_file): self.outputs.out_file = self._gen_filename('out_file') else: self.outputs.out_file = os.path.abspath(self.inputs.out_file) - + class InvWarpInputSpec(FSLCommandInputSpec): warp = File(exists=True, argstr='--warp=%s', mandatory=True, @@ -1536,7 +1536,7 @@ def _get_output(self, name): return os.path.abspath(output) def _post_run(self): - + if self.inputs.complex_cartesian or self.inputs.complex_polar or \ self.inputs.complex_split or self.inputs.complex_merge: self.outputs.complex_out_file = self._get_output('complex_out_file') @@ -1546,7 +1546,7 @@ def _post_run(self): elif self.inputs.real_polar: self.outputs.magnitude_out_file = self._get_output('magnitude_out_file') self.outputs.phase_out_file = self._get_output('phase_out_file') - + class WarpUtilsInputSpec(FSLCommandInputSpec): in_file = File(exists=True, argstr='--in=%s', mandatory=True, diff --git a/nipype/interfaces/io.py b/nipype/interfaces/io.py index 54028c1bf4..378ec9d730 100644 --- a/nipype/interfaces/io.py +++ b/nipype/interfaces/io.py @@ -2539,7 +2539,7 @@ def __init__(self, infields=[], force_run=True, **inputs): undefined_traits = {} for key in infields: self.inputs.add_trait(key, traits.Any) - self.inputs._setattr(self.outputs, key, Undefined) + self.inputs._outputs[key] = Undefined undefined_traits[key] = Undefined self.inputs.trait_set(trait_change_notify=False, **undefined_traits) diff --git a/nipype/interfaces/mne/base.py b/nipype/interfaces/mne/base.py index 6da4809de0..40d0ea50ec 100644 --- a/nipype/interfaces/mne/base.py +++ b/nipype/interfaces/mne/base.py @@ -74,7 +74,7 @@ def _get_files(self, path, key, dirval, altkey=None): return glob.glob(globpattern) def _post_run(self): - + subjects_dir = self.inputs.subjects_dir subject_path = op.join(subjects_dir, self.inputs.subject_id) output_traits = self._outputs() @@ -94,8 +94,8 @@ def _post_run(self): out_files = op.abspath(value_list) else: raise TypeError - setattr(self.outputs, k, out_files + setattr(self.outputs, k, out_files) if not k.rfind('surface') == -1: mesh_paths.append(out_files) self.outputs.mesh_files = mesh_paths - \ No newline at end of file + diff --git a/nipype/interfaces/mrtrix3/utils.py b/nipype/interfaces/mrtrix3/utils.py index 1782365016..1b10842651 100644 --- a/nipype/interfaces/mrtrix3/utils.py +++ b/nipype/interfaces/mrtrix3/utils.py @@ -57,9 +57,9 @@ class BrainMask(CommandLine): output_spec = BrainMaskOutputSpec def _post_run(self): - + self.outputs.out_file = op.abspath(self.inputs.out_file) - + class Mesh2PVEInputSpec(CommandLineInputSpec): in_file = File(exists=True, argstr='%s', mandatory=True, position=-3, @@ -103,9 +103,9 @@ class Mesh2PVE(CommandLine): output_spec = Mesh2PVEOutputSpec def _post_run(self): - + self.outputs.out_file = op.abspath(self.inputs.out_file) - + class Generate5ttInputSpec(CommandLineInputSpec): in_fast = InputMultiPath( @@ -149,9 +149,9 @@ class Generate5tt(CommandLine): output_spec = Generate5ttOutputSpec def _post_run(self): - + self.outputs.out_file = op.abspath(self.inputs.out_file) - + class TensorMetricsInputSpec(CommandLineInputSpec): in_file = File(exists=True, argstr='%s', mandatory=True, position=-1, @@ -205,13 +205,11 @@ class TensorMetrics(CommandLine): output_spec = TensorMetricsOutputSpec def _post_run(self): - - for k in list(outputs.keys()): if isdefined(getattr(self.inputs, k)): - setattr(self.outputs, k, op.abspath(getattr(self.inputs, k)) + setattr(self.outputs, k, op.abspath(getattr(self.inputs, k))) + - class ComputeTDIInputSpec(CommandLineInputSpec): in_file = File(exists=True, argstr='%s', mandatory=True, position=-2, @@ -344,9 +342,9 @@ class ComputeTDI(MRTrix3Base): output_spec = ComputeTDIOutputSpec def _post_run(self): - + self.outputs.out_file = op.abspath(self.inputs.out_file) - + class TCK2VTKInputSpec(CommandLineInputSpec): in_file = File(exists=True, argstr='%s', mandatory=True, position=-2, @@ -394,6 +392,6 @@ class TCK2VTK(MRTrix3Base): output_spec = TCK2VTKOutputSpec def _post_run(self): - + self.outputs.out_file = op.abspath(self.inputs.out_file) - \ No newline at end of file + diff --git a/nipype/interfaces/spm/preprocess.py b/nipype/interfaces/spm/preprocess.py index b51ddae1fb..217ab6ba78 100644 --- a/nipype/interfaces/spm/preprocess.py +++ b/nipype/interfaces/spm/preprocess.py @@ -107,7 +107,7 @@ def _post_run(self): else: run = fname_presuffix(f, prefix=self.inputs.out_prefix) self.outputs.timecorrected_files.append(run) - + class RealignInputSpec(SPMCommandInputSpec): in_files = InputMultiPath(traits.Either(traits.List(File(exists=True)), @@ -249,7 +249,7 @@ def _post_run(self): realigned_run = fname_presuffix(imgf, prefix=self.inputs.out_prefix) self.outputs.realigned_files.append(realigned_run) - + class CoregisterInputSpec(SPMCommandInputSpec): target = File(exists=True, field='ref', mandatory=True, @@ -341,7 +341,7 @@ def _parse_inputs(self): return [{'%s' % (jobtype): einputs[0]}] def _post_run(self): - + if self.inputs.jobtype == "estimate": if isdefined(self.inputs.apply_to_files): self.outputs.coregistered_files = self.inputs.apply_to_files @@ -356,7 +356,7 @@ def _post_run(self): for imgf in filename_to_list(self.inputs.source): self.outputs.coregistered_source.append(fname_presuffix(imgf, prefix=self.inputs.out_prefix)) - + class NormalizeInputSpec(SPMCommandInputSpec): template = File(exists=True, field='eoptions.template', @@ -474,7 +474,7 @@ def _parse_inputs(self): return [{'%s' % (jobtype): einputs[0]}] def _post_run(self): - + jobtype = self.inputs.jobtype if jobtype.startswith('est'): self.outputs.normalization_parameters = [] @@ -508,7 +508,7 @@ def _post_run(self): self.outputs.normalized_source.append(fname_presuffix(imgf, prefix=prefixNorm)) - + class Normalize12InputSpec(SPMCommandInputSpec): image_to_align = File(exists=True, field='subj.vol', @@ -634,7 +634,7 @@ def _parse_inputs(self, skip=()): return [{'%s' % (jobtype): einputs[0]}] def _post_run(self): - + jobtype = self.inputs.jobtype if jobtype.startswith('est'): self.outputs.deformation_field = [] @@ -662,7 +662,7 @@ def _post_run(self): self.outputs.normalized_image = fname_presuffix(self.inputs.image_to_align, prefix='w') - + class SegmentInputSpec(SPMCommandInputSpec): data = InputMultiPath(File(exists=True), field='data', desc='one scan per subject', @@ -800,7 +800,7 @@ def _post_run(self): outfield = '%s_%s_image' % (image, tissue) setattr(self.outputs, outfield, fname_presuffix(f, prefix='%sc%d' % (prefix, - tidx + 1)) + tidx + 1))) if isdefined(self.inputs.save_bias_corrected) and \ self.inputs.save_bias_corrected: self.outputs.bias_corrected_image = fname_presuffix(f, prefix='m') @@ -808,7 +808,7 @@ def _post_run(self): self.outputs.transformation_mat = t_mat invt_mat = fname_presuffix(f, suffix='_seg_inv_sn.mat', use_ext=False) self.outputs.inverse_transformation_mat = invt_mat - + class NewSegmentInputSpec(SPMCommandInputSpec): channel_files = InputMultiPath(File(exists=True), @@ -973,7 +973,7 @@ def _post_run(self): self.outputs.bias_corrected_images.append(os.path.join(pth, "m%s.nii" % (base))) if self.inputs.channel_info[2][1]: self.outputs.bias_field_images.append(os.path.join(pth, "BiasField_%s.nii" % (base))) - + class SmoothInputSpec(SPMCommandInputSpec): in_files = InputMultiPath(File(exists=True), field='data', @@ -1033,7 +1033,7 @@ def _post_run(self): for imgf in filename_to_list(self.inputs.in_files): self.outputs.smoothed_files.append(fname_presuffix(imgf, prefix=self.inputs.out_prefix)) - + class DARTELInputSpec(SPMCommandInputSpec): image_files = traits.List(traits.List(File(exists=True)), @@ -1137,7 +1137,7 @@ def _post_run(self): self.outputs.dartel_flow_fields.append(os.path.realpath('u_%s_%s%s' % (base, self.inputs.template_prefix, ext))) - + class DARTELNorm2MNIInputSpec(SPMCommandInputSpec): template_file = File(exists=True, @@ -1228,7 +1228,7 @@ def _post_run(self): base, ext))) - + class CreateWarpedInputSpec(SPMCommandInputSpec): image_files = InputMultiPath(File(exists=True), @@ -1296,7 +1296,7 @@ def _post_run(self): else: self.outputs.warped_files.append(os.path.realpath('w%s%s' % (base, ext))) - + class ApplyDeformationFieldInputSpec(SPMCommandInputSpec): in_files = InputMultiPath(File(exists=True), mandatory=True, field='fnames') @@ -1337,7 +1337,7 @@ def _post_run(self): for filename in self.inputs.in_files: _, fname = os.path.split(filename) self.outputs.out_files.append(os.path.realpath('w%s' % fname)) - + class VBMSegmentInputSpec(SPMCommandInputSpec): @@ -1502,7 +1502,7 @@ class VBMSegment(SPMCommand): _jobname = 'vbm8' def _post_run(self): - + do_dartel = self.inputs.spatial_normalization dartel_px = '' if do_dartel: @@ -1587,7 +1587,7 @@ def _post_run(self): if self.inputs.jacobian_determinant and do_dartel: self.outputs.jacobian_determinant_images.append( os.path.join(pth, "jac_wrp1%s.nii" % (base))) - + def _format_arg(self, opt, spec, val): """Convert input to appropriate format for spm """ diff --git a/nipype/pipeline/engine/tests/test_join.py b/nipype/pipeline/engine/tests/test_join.py index 4b0215e3a9..2933406144 100644 --- a/nipype/pipeline/engine/tests/test_join.py +++ b/nipype/pipeline/engine/tests/test_join.py @@ -33,7 +33,7 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.output1 = self.inputs.in_files[0] - + class IncrementInputSpec(nib.TraitedSpec): input1 = nib.traits.Int(mandatory=True, desc='input') @@ -54,7 +54,7 @@ def _run_interface(self, runtime): def _post_run(self): self.outputs.output1 = self.inputs.input1 + self.inputs.inc - + _sums = [] _sum_operands = [] @@ -80,11 +80,11 @@ def _run_interface(self, runtime): def _post_run(self): global _sum global _sum_operands - self.outputs.operands = self.inputs.input1 + self.outputs.operands = self.inputs.input1 _sum_operands.append(self.outputs.operands) self.outputs.output1 = sum(self.inputs.input1) _sums.append(self.outputs.output1) - + _set_len = None """The Set interface execution result.""" @@ -109,7 +109,7 @@ def _run_interface(self, runtime): def _post_run(self): global _set_len _set_len = self.outputs.output1 = len(self.inputs.input1) - + _products = [] """The Products interface execution results.""" @@ -136,7 +136,7 @@ def _post_run(self): global _products self.outputs.output1 = self.inputs.input1 * self.inputs.input2 _products.append(self.outputs.output1) - + def test_join_expansion(): cwd = os.getcwd() diff --git a/nipype/utils/docparse.py b/nipype/utils/docparse.py index 1bc6135acc..a445262a15 100644 --- a/nipype/utils/docparse.py +++ b/nipype/utils/docparse.py @@ -141,10 +141,10 @@ def insert_doc(doc, new_items): Examples -------- >>> from nipype.utils.docparse import insert_doc - >>> doc = """Parameters + >>> doc = '''Parameters ... ---------- ... outline : - ... something about an outline""" + ... something about an outline''' >>> new_items = ['infile : str', ' The name of the input file'] >>> new_items.extend(['outfile : str', ' The name of the output file']) From 838940c28bbe3cc34f40f060cef4455e81dc87f6 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 17 Feb 2016 16:52:26 -0800 Subject: [PATCH 38/73] fixing AFNI --- nipype/interfaces/afni/base.py | 115 +--- nipype/interfaces/afni/preprocess.py | 599 +++++++----------- .../afni/tests/test_auto_AFNICommand.py | 1 + .../afni/tests/test_auto_Allineate.py | 3 +- .../afni/tests/test_auto_AutoTcorrelate.py | 1 + .../afni/tests/test_auto_BrickStat.py | 1 + .../interfaces/afni/tests/test_auto_Copy.py | 2 +- .../interfaces/afni/tests/test_auto_Hist.py | 4 +- .../afni/tests/test_auto_Maskave.py | 2 +- .../interfaces/afni/tests/test_auto_Refit.py | 6 +- .../afni/tests/test_auto_TCorr1D.py | 2 +- .../afni/tests/test_auto_TCorrMap.py | 1 + .../interfaces/afni/tests/test_auto_Volreg.py | 6 +- .../ants/tests/test_auto_ANTSCommand.py | 8 + nipype/interfaces/base.py | 2 + .../camino/tests/test_auto_AnalyzeHeader.py | 2 +- .../tests/test_auto_ComputeEigensystem.py | 2 +- .../test_auto_ComputeFractionalAnisotropy.py | 2 +- .../tests/test_auto_ComputeTensorTrace.py | 2 +- .../camino/tests/test_auto_DTIFit.py | 2 +- .../camino/tests/test_auto_DTLUTGen.py | 2 +- .../camino/tests/test_auto_FSL2Scheme.py | 2 +- .../camino/tests/test_auto_Image2Voxel.py | 2 +- .../camino/tests/test_auto_LinRecon.py | 2 +- .../interfaces/camino/tests/test_auto_MESD.py | 2 +- .../camino/tests/test_auto_ModelFit.py | 2 +- .../camino/tests/test_auto_NIfTIDT2Camino.py | 2 +- .../camino/tests/test_auto_PicoPDFs.py | 2 +- .../camino/tests/test_auto_ProcStreamlines.py | 2 +- .../camino/tests/test_auto_QBallMX.py | 2 +- .../camino/tests/test_auto_SFLUTGen.py | 2 +- .../camino/tests/test_auto_SFPICOCalibData.py | 2 +- .../camino/tests/test_auto_SFPeaks.py | 2 +- .../camino/tests/test_auto_Shredder.py | 2 +- .../camino/tests/test_auto_TractShredder.py | 2 +- .../camino/tests/test_auto_VtkStreamlines.py | 2 +- .../dipy/tests/test_auto_DipyBaseInterface.py | 8 + .../tests/test_auto_DipyDiffusionInterface.py | 8 + .../tests/test_auto_DICOMConvert.py | 8 + .../freesurfer/tests/test_auto_FSCommand.py | 8 + .../freesurfer/tests/test_auto_MRIsConvert.py | 4 +- .../tests/test_auto_UnpackSDICOMDir.py | 8 + nipype/interfaces/fsl/model.py | 60 +- .../fsl/tests/test_auto_ApplyMask.py | 3 +- .../fsl/tests/test_auto_ApplyTOPUP.py | 3 +- .../fsl/tests/test_auto_ApplyWarp.py | 3 +- .../fsl/tests/test_auto_ApplyXfm.py | 3 +- .../interfaces/fsl/tests/test_auto_AvScale.py | 3 +- .../fsl/tests/test_auto_BEDPOSTX4.py | 3 +- .../fsl/tests/test_auto_BEDPOSTX5.py | 3 +- nipype/interfaces/fsl/tests/test_auto_BET.py | 43 +- .../fsl/tests/test_auto_BinaryMaths.py | 3 +- .../fsl/tests/test_auto_ChangeDataType.py | 3 +- .../interfaces/fsl/tests/test_auto_Cluster.py | 3 +- .../interfaces/fsl/tests/test_auto_Complex.py | 3 +- .../fsl/tests/test_auto_ContrastMgr.py | 3 +- .../fsl/tests/test_auto_ConvertWarp.py | 3 +- .../fsl/tests/test_auto_ConvertXFM.py | 3 +- .../fsl/tests/test_auto_CopyGeom.py | 3 +- .../interfaces/fsl/tests/test_auto_DTIFit.py | 48 +- .../fsl/tests/test_auto_DilateImage.py | 3 +- .../fsl/tests/test_auto_DistanceMap.py | 3 +- .../fsl/tests/test_auto_EPIDeWarp.py | 3 +- nipype/interfaces/fsl/tests/test_auto_Eddy.py | 3 +- .../fsl/tests/test_auto_EddyCorrect.py | 3 +- .../interfaces/fsl/tests/test_auto_EpiReg.py | 3 +- .../fsl/tests/test_auto_ErodeImage.py | 3 +- .../fsl/tests/test_auto_ExtractROI.py | 3 +- nipype/interfaces/fsl/tests/test_auto_FAST.py | 3 +- nipype/interfaces/fsl/tests/test_auto_FEAT.py | 3 +- .../fsl/tests/test_auto_FEATModel.py | 3 +- .../interfaces/fsl/tests/test_auto_FIRST.py | 3 +- .../interfaces/fsl/tests/test_auto_FLAMEO.py | 3 +- .../interfaces/fsl/tests/test_auto_FLIRT.py | 3 +- .../interfaces/fsl/tests/test_auto_FNIRT.py | 3 +- .../fsl/tests/test_auto_FSLCommand.py | 11 +- .../fsl/tests/test_auto_FSLXCommand.py | 3 +- .../interfaces/fsl/tests/test_auto_FUGUE.py | 3 +- .../fsl/tests/test_auto_FilterRegressor.py | 3 +- .../fsl/tests/test_auto_FindTheBiggest.py | 3 +- nipype/interfaces/fsl/tests/test_auto_GLM.py | 3 +- .../fsl/tests/test_auto_ImageMaths.py | 3 +- .../fsl/tests/test_auto_ImageMeants.py | 3 +- .../fsl/tests/test_auto_ImageStats.py | 3 +- .../interfaces/fsl/tests/test_auto_InvWarp.py | 3 +- .../fsl/tests/test_auto_IsotropicSmooth.py | 3 +- .../interfaces/fsl/tests/test_auto_MCFLIRT.py | 3 +- .../interfaces/fsl/tests/test_auto_MELODIC.py | 3 +- .../fsl/tests/test_auto_MakeDyadicVectors.py | 3 +- .../fsl/tests/test_auto_MathsCommand.py | 3 +- .../fsl/tests/test_auto_MaxImage.py | 3 +- .../fsl/tests/test_auto_MeanImage.py | 3 +- .../interfaces/fsl/tests/test_auto_Merge.py | 3 +- .../fsl/tests/test_auto_MotionOutliers.py | 3 +- .../fsl/tests/test_auto_MultiImageMaths.py | 3 +- .../interfaces/fsl/tests/test_auto_Overlay.py | 3 +- .../interfaces/fsl/tests/test_auto_PRELUDE.py | 3 +- .../fsl/tests/test_auto_PlotMotionParams.py | 3 +- .../fsl/tests/test_auto_PlotTimeSeries.py | 3 +- .../fsl/tests/test_auto_PowerSpectrum.py | 3 +- .../fsl/tests/test_auto_PrepareFieldmap.py | 3 +- .../fsl/tests/test_auto_ProbTrackX.py | 3 +- .../fsl/tests/test_auto_ProbTrackX2.py | 3 +- .../fsl/tests/test_auto_ProjThresh.py | 3 +- .../fsl/tests/test_auto_Randomise.py | 3 +- .../fsl/tests/test_auto_Reorient2Std.py | 3 +- .../fsl/tests/test_auto_RobustFOV.py | 3 +- nipype/interfaces/fsl/tests/test_auto_SMM.py | 3 +- .../interfaces/fsl/tests/test_auto_SUSAN.py | 3 +- .../interfaces/fsl/tests/test_auto_SigLoss.py | 3 +- .../fsl/tests/test_auto_SliceTimer.py | 3 +- .../interfaces/fsl/tests/test_auto_Slicer.py | 3 +- .../interfaces/fsl/tests/test_auto_Smooth.py | 3 +- .../fsl/tests/test_auto_SmoothEstimate.py | 3 +- .../fsl/tests/test_auto_SpatialFilter.py | 3 +- .../interfaces/fsl/tests/test_auto_Split.py | 3 +- .../fsl/tests/test_auto_SwapDimensions.py | 3 +- .../interfaces/fsl/tests/test_auto_TOPUP.py | 3 +- .../fsl/tests/test_auto_TemporalFilter.py | 3 +- .../fsl/tests/test_auto_Threshold.py | 3 +- .../fsl/tests/test_auto_TractSkeleton.py | 3 +- .../fsl/tests/test_auto_UnaryMaths.py | 3 +- .../interfaces/fsl/tests/test_auto_VecReg.py | 3 +- .../fsl/tests/test_auto_WarpUtils.py | 3 +- .../fsl/tests/test_auto_XFibres4.py | 3 +- .../fsl/tests/test_auto_XFibres5.py | 3 +- .../interfaces/minc/tests/test_auto_BBox.py | 2 +- .../interfaces/minc/tests/test_auto_Dump.py | 2 +- .../minc/tests/test_auto_Extract.py | 2 +- .../interfaces/minc/tests/test_auto_ToRaw.py | 2 +- .../mrtrix3/tests/test_auto_MRTrix3Base.py | 8 + .../tests/test_auto_SlicerCommandLine.py | 8 + nipype/interfaces/specs.py | 8 +- .../spm/tests/test_auto_SPMCommand.py | 8 + nipype/interfaces/spm/utils.py | 75 ++- .../interfaces/tests/test_auto_AssertEqual.py | 8 + .../tests/test_auto_BaseInterface.py | 8 + .../interfaces/tests/test_auto_CommandLine.py | 8 + nipype/interfaces/tests/test_auto_IOBase.py | 8 + .../tests/test_auto_MatlabCommand.py | 8 + .../tests/test_auto_MpiCommandLine.py | 8 + .../interfaces/tests/test_auto_MySQLSink.py | 8 + .../tests/test_auto_NiftiGeneratorBase.py | 8 + .../tests/test_auto_SEMLikeCommandLine.py | 8 + .../interfaces/tests/test_auto_SQLiteSink.py | 8 + .../tests/test_auto_StdOutCommandLine.py | 11 +- nipype/interfaces/tests/test_auto_XNATSink.py | 8 + nipype/pipeline/engine/nodes.py | 2 +- 148 files changed, 777 insertions(+), 680 deletions(-) diff --git a/nipype/interfaces/afni/base.py b/nipype/interfaces/afni/base.py index cd28aee1e7..01ddd3dd70 100644 --- a/nipype/interfaces/afni/base.py +++ b/nipype/interfaces/afni/base.py @@ -3,26 +3,21 @@ """Provide interface to AFNI commands.""" import os -from sys import platform from builtins import object from ... import logging from ...utils.filemanip import split_filename -from ..traits_extension import traits, isdefined, File +from ..traits_extension import traits, File from ..specs import CommandLineInputSpec, TraitedSpec from ..base import CommandLine # Use nipype's logging system IFLOGGER = logging.getLogger('interface') +AFNI_FTYPES = {'NIFTI': '.nii', 'AFNI': '', 'NIFTI_GZ': '.nii.gz'} class Info(object): - """Handle afni output type and version information. - """ - __outputtype = 'AFNI' - ftypes = {'NIFTI': '.nii', - 'AFNI': '', - 'NIFTI_GZ': '.nii.gz'} + """Handle afni output type and version information. """ @staticmethod def version(): @@ -48,23 +43,23 @@ def version(): # If afni_vcheck is not present, return None IFLOGGER.warn('afni_vcheck executable not found.') return None - except RuntimeError as e: + except RuntimeError as err: # If AFNI is outdated, afni_vcheck throws error. # Show new version, but parse current anyways. - currv = str(e).split('\n')[4].split('=', 1)[1].strip() - nextv = str(e).split('\n')[6].split('=', 1)[1].strip() + currv = str(err).split('\n')[4].split('=', 1)[1].strip() + nextv = str(err).split('\n')[6].split('=', 1)[1].strip() IFLOGGER.warn( - 'AFNI is outdated, detected version %s and %s is available.' % (currv, nextv)) + 'AFNI is outdated, detected version %s and %s is available.', currv, nextv) if currv.startswith('AFNI_'): currv = currv[5:] - v = currv.split('.') + version = currv.split('.') try: - v = [int(n) for n in v] + version = [int(n) for n in version] except ValueError: return currv - return tuple(v) + return tuple(version) @classmethod def outputtype_to_ext(cls, outputtype): @@ -80,35 +75,15 @@ def outputtype_to_ext(cls, outputtype): extension : str The file extension for the output type. """ - - try: - return cls.ftypes[outputtype] - except KeyError: - msg = 'Invalid AFNIOUTPUTTYPE: ', outputtype - raise KeyError(msg) - - @classmethod - def outputtype(cls): - """AFNI has no environment variables, - Output filetypes get set in command line calls - Nipype uses AFNI as default + return AFNI_FTYPES.get(outputtype, 'AFNI') - Returns - ------- - None - """ - # warn(('AFNI has no environment variable that sets filetype ' - # 'Nipype uses NIFTI_GZ as default')) - return 'AFNI' - @staticmethod def standard_image(img_name): """Grab an image from the standard location. Could be made more fancy to allow for more relocatability""" - clout = CommandLine('which afni', - terminal_output='allatonce').run() + clout = CommandLine('which afni', terminal_output='allatonce').run() if clout.runtime.returncode is not 0: return None @@ -123,17 +98,24 @@ class AFNICommandBase(CommandLine): See http://afni.nimh.nih.gov/afni/community/board/read.php?1,145346,145347#msg-145347 """ def _run_interface(self, runtime): - if platform == 'darwin': + if runtime.platform == 'darwin': runtime.environ['DYLD_FALLBACK_LIBRARY_PATH'] = '/usr/local/afni/' return super(AFNICommandBase, self)._run_interface(runtime) class AFNICommandInputSpec(CommandLineInputSpec): - outputtype = traits.Enum('AFNI', list(Info.ftypes.keys()), - desc='AFNI output filetype') - out_file = File(name_template="%s_afni", desc='output image file name', + outputtype = traits.Enum(tuple(AFNI_FTYPES.keys()), desc='AFNI output filetype') + out_file = File(name_template="%s_afni", desc='output image file name', keep_extension=False, name_source=["in_file"], argstr='-prefix %s') + def _overload_extension(self, value, name=None, ext=None): + IFLOGGER.info('Current out type: %s', self.outputtype) + if value.endswith('+orig.BRIK'): + return value + if value.endswith('.1D'): + return value + return value + AFNI_FTYPES.get(self.outputtype, '') + class AFNICommandOutputSpec(TraitedSpec): out_file = File(desc='output file', exists=True) @@ -142,57 +124,6 @@ class AFNICommandOutputSpec(TraitedSpec): class AFNICommand(AFNICommandBase): """Shared options for several AFNI commands """ input_spec = AFNICommandInputSpec - _outputtype = None - - def __init__(self, **inputs): - super(AFNICommand, self).__init__(**inputs) - self.inputs.on_trait_change(self._output_update, 'outputtype') - - if self._outputtype is None: - self._outputtype = Info.outputtype() - - if not isdefined(self.inputs.outputtype): - self.inputs.outputtype = self._outputtype - else: - self._output_update() - - def _output_update(self): - """ i think? updates class private attribute based on instance input - in fsl also updates ENVIRON variable....not valid in afni - as it uses no environment variables - """ - self._outputtype = self.inputs.outputtype - - @classmethod - def set_default_output_type(cls, outputtype): - """Set the default output type for AFNI classes. - - This method is used to set the default output type for all afni - subclasses. However, setting this will not update the output - type for any existing instances. For these, assign the - .inputs.outputtype. - """ - - if outputtype in Info.ftypes: - cls._outputtype = outputtype - else: - raise AttributeError('Invalid AFNI outputtype: %s' % outputtype) - - def _overload_extension(self, value, name=None): - path, base, _ = split_filename(value) - return os.path.join(path, base + Info.outputtype_to_ext(self.inputs.outputtype)) - - def _post_run(self): - metadata = dict(name_source=lambda t: t is not None) - out_names = list(self.inputs.traits(**metadata).keys()) - if out_names: - for name in out_names: - value = getattr(self.outputs, name) - if value is not None: - _, _, ext = split_filename(value) - if ext == "": - setattr(self.outputs, name, value + "+orig.BRIK") - def no_afni(): """ Checks if AFNI is available """ diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index aa31c85cec..cd2125f410 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -80,46 +80,25 @@ class To3D(AFNICommand): class TShiftInputSpec(AFNICommandInputSpec): - in_file = File(desc='input file to 3dTShift', - argstr='%s', - position=-1, - mandatory=True, - exists=True, - copyfile=False) - + in_file = File(desc='input file to 3dTShift', argstr='%s', position=-1, mandatory=True, + exists=True, copyfile=False) out_file = File(name_template="%s_tshift", desc='output image file name', argstr='-prefix %s', name_source="in_file") - - tr = traits.Str(desc='manually set the TR' + - 'You can attach suffix "s" for seconds or "ms" for milliseconds.', - argstr='-TR %s') - - tzero = traits.Float(desc='align each slice to given time offset', - argstr='-tzero %s', - xor=['tslice']) - - tslice = traits.Int(desc='align each slice to time offset of given slice', - argstr='-slice %s', - xor=['tzero']) - + tr = traits.Str(argstr='-TR %s', desc='manually set the TR You can attach suffix "s" for ' + 'seconds or "ms" for milliseconds.') + tzero = traits.Float(argstr='-tzero %s', xor=['tslice'], + desc='align each slice to given time offset') + tslice = traits.Int(argstr='-slice %s', xor=['tzero'], + desc='align each slice to time offset of given slice') ignore = traits.Int(desc='ignore the first set of points specified', argstr='-ignore %s') - - interp = traits.Enum(('Fourier', 'linear', 'cubic', 'quintic', 'heptic'), - desc='different interpolation methods (see 3dTShift for details)' + - ' default = Fourier', argstr='-%s') - - tpattern = traits.Str(desc='use specified slice time pattern rather than one in header', - argstr='-tpattern %s') - - rlt = traits.Bool(desc='Before shifting, remove the mean and linear trend', - argstr="-rlt") - - rltplus = traits.Bool(desc='Before shifting,' + - ' remove the mean and linear trend and ' + - 'later put back the mean', - argstr="-rlt+") - + interp = traits.Enum('Fourier', 'linear', 'cubic', 'quintic', 'heptic', argstr='-%s', + desc='different interpolation methods (see 3dTShift for details)') + tpattern = traits.Str(argstr='-tpattern %s', + desc='use specified slice time pattern rather than one in header') + rlt = traits.Bool(argstr="-rlt", desc='Before shifting, remove the mean and linear trend') + rltplus = traits.Bool(argstr="-rlt+", desc='Before shifting, remove the mean and linear trend' + ' and later put back the mean') class TShift(AFNICommand): @@ -150,38 +129,24 @@ class TShift(AFNICommand): class RefitInputSpec(CommandLineInputSpec): - in_file = File(desc='input file to 3drefit', - argstr='%s', - position=-1, - mandatory=True, - exists=True, - copyfile=True) - - deoblique = traits.Bool(desc='replace current transformation' + - ' matrix with cardinal matrix', - argstr='-deoblique') - - xorigin = traits.Str(desc='x distance for edge voxel offset', - argstr='-xorigin %s') - - yorigin = traits.Str(desc='y distance for edge voxel offset', - argstr='-yorigin %s') - zorigin = traits.Str(desc='z distance for edge voxel offset', - argstr='-zorigin %s') - - xdel = traits.Float(desc='new x voxel dimension in mm', - argstr='-xdel %f') - - ydel = traits.Float(desc='new y voxel dimension in mm', - argstr='-ydel %f') - - zdel = traits.Float(desc='new z voxel dimension in mm', - argstr='-zdel %f') - - space = traits.Enum('TLRC', 'MNI', 'ORIG', - argstr='-space %s', - desc='Associates the dataset with a specific' + - ' template type, e.g. TLRC, MNI, ORIG') + in_file = File(argstr='%s', position=-1, mandatory=True, exists=True, + copyfile=True, desc='input file to 3drefit') + deoblique = traits.Bool( + False, usedefault=True, argstr='-deoblique', + desc='replace current transformation matrix with cardinal matrix') + xorigin = traits.Str(argstr='-xorigin %s', desc='x distance for edge voxel offset') + yorigin = traits.Str(argstr='-yorigin %s', desc='y distance for edge voxel offset') + zorigin = traits.Str(argstr='-zorigin %s', desc='z distance for edge voxel offset') + xdel = traits.Float(argstr='-xdel %f', desc='new x voxel dimension in mm') + ydel = traits.Float(argstr='-ydel %f', desc='new y voxel dimension in mm') + zdel = traits.Float(argstr='-zdel %f', desc='new z voxel dimension in mm') + space = traits.Enum( + 'TLRC', 'MNI', 'ORIG', argstr='-space %s', + desc='Associates the dataset with a specific template type, e.g. TLRC, MNI, ORIG') + +class RefitOutputSpec(TraitedSpec): + out_file = File(name_source='in_file', name_template='%s', keep_extension=False, + desc='output file') class Refit(AFNICommandBase): @@ -205,51 +170,27 @@ class Refit(AFNICommandBase): _cmd = '3drefit' input_spec = RefitInputSpec - output_spec = AFNICommandOutputSpec + output_spec = RefitOutputSpec - def _post_run(self): - - self.outputs.out_file = os.path.abspath(self.inputs.in_file) - class WarpInputSpec(AFNICommandInputSpec): - - in_file = File(desc='input file to 3dWarp', - argstr='%s', - position=-1, - mandatory=True, - exists=True, - copyfile=False) - - out_file = File(name_template="%s_warp", desc='output image file name', - argstr='-prefix %s', name_source="in_file") - + in_file = File(argstr='%s', position=-1, mandatory=True, exists=True, copyfile=False, + desc='input file to 3dWarp') + out_file = File(name_template="%s_warp", argstr='-prefix %s', name_source="in_file", + desc='output image file name') tta2mni = traits.Bool(desc='transform dataset from Talairach to MNI152', argstr='-tta2mni') - mni2tta = traits.Bool(desc='transform dataset from MNI152 to Talaraich', argstr='-mni2tta') - matparent = File(desc="apply transformation from 3dWarpDrive", - argstr="-matparent %s", - exists=True) - + argstr="-matparent %s", exists=True) deoblique = traits.Bool(desc='transform dataset from oblique to cardinal', argstr='-deoblique') - - interp = traits.Enum(('linear', 'cubic', 'NN', 'quintic'), - desc='spatial interpolation methods [default = linear]', - argstr='-%s') - - gridset = File(desc="copy grid of specified dataset", - argstr="-gridset %s", - exists=True) - - newgrid = traits.Float(desc="specify grid of this size (mm)", - argstr="-newgrid %f") - - zpad = traits.Int(desc="pad input dataset with N planes" + - " of zero on all sides.", + interp = traits.Enum('linear', 'cubic', 'NN', 'quintic', argstr='-%s', + desc='spatial interpolation methods [default = linear]') + gridset = File(desc="copy grid of specified dataset", argstr="-gridset %s", exists=True) + newgrid = traits.Float(desc="specify grid of this size (mm)", argstr="-newgrid %f") + zpad = traits.Int(desc="pad input dataset with N planes of zero on all sides.", argstr="-zpad %d") @@ -286,28 +227,17 @@ class Warp(AFNICommand): class ResampleInputSpec(AFNICommandInputSpec): - - in_file = File(desc='input file to 3dresample', - argstr='-inset %s', - position=-1, - mandatory=True, - exists=True, - copyfile=False) - - out_file = File(name_template="%s_resample", desc='output image file name', - argstr='-prefix %s', name_source="in_file") - - orientation = traits.Str(desc='new orientation code', - argstr='-orient %s') - - resample_mode = traits.Enum('NN', 'Li', 'Cu', 'Bk', - argstr='-rmode %s', - desc="resampling method from set {'NN', 'Li', 'Cu', 'Bk'}. These are for 'Nearest Neighbor', 'Linear', 'Cubic' and 'Blocky' interpolation, respectively. Default is NN.") - - voxel_size = traits.Tuple(*[traits.Float()] * 3, - argstr='-dxyz %f %f %f', + in_file = File(argstr='-inset %s', position=-1, mandatory=True, exists=True, copyfile=False, + desc='input file to 3dresample') + out_file = File(name_template="%s_resample", argstr='-prefix %s', name_source="in_file", + desc='output image file name') + orientation = traits.Str(desc='new orientation code', argstr='-orient %s') + resample_mode = traits.Enum( + 'NN', 'Li', 'Cu', 'Bk', argstr='-rmode %s', + desc="resampling method from set {'NN', 'Li', 'Cu', 'Bk'}. These are for 'Nearest " + "Neighbor', 'Linear', 'Cubic' and 'Blocky' interpolation, respectively.") + voxel_size = traits.Tuple(*[traits.Float()] * 3, argstr='-dxyz %f %f %f', desc="resample to new dx, dy and dz") - master = traits.File(argstr='-master %s', desc='align dataset grid to a reference file') @@ -339,31 +269,27 @@ class Resample(AFNICommand): class AutoTcorrelateInputSpec(AFNICommandInputSpec): - in_file = File(desc='timeseries x space (volume or surface) file', - argstr='%s', - position=-1, - mandatory=True, - exists=True, - copyfile=False) - - polort = traits.Int( - desc='Remove polynomical trend of order m or -1 for no detrending', - argstr="-polort %d") - eta2 = traits.Bool(desc='eta^2 similarity', - argstr="-eta2") - mask = File(exists=True, desc="mask of voxels", - argstr="-mask %s") - mask_only_targets = traits.Bool(desc="use mask only on targets voxels", - argstr="-mask_only_targets", - xor=['mask_source']) - mask_source = File(exists=True, - desc="mask for source voxels", - argstr="-mask_source %s", - xor=['mask_only_targets']) - + in_file = File(argstr='%s', position=-1, mandatory=True, exists=True, copyfile=False, + desc='timeseries x space (volume or surface) file') + polort = traits.Int(argstr="-polort %d", + desc='Remove polynomical trend of order m or -1 for no detrending') + eta2 = traits.Bool(desc='eta^2 similarity', argstr="-eta2") + mask = File(exists=True, desc="mask of voxels", argstr="-mask %s") + mask_only_targets = traits.Bool( + False, usedefault=True, argstr="-mask_only_targets", xor=['mask_source'], + desc="use mask only on targets voxels") + mask_source = File(exists=True, argstr="-mask_source %s", xor=['mask_only_targets'], + desc="mask for source voxels") out_file = File(name_template="%s_similarity_matrix.1D", desc='output image file name', argstr='-prefix %s', name_source="in_file", keep_extension=False) + def _overload_extension(self, value, name=None, ext=None): + _, _, ext = split_filename(value) + + if ext.lower() not in [".1d", ".nii.gz", ".nii"]: + return value + ".1D" + return value + class AutoTcorrelate(AFNICommand): @@ -389,29 +315,14 @@ class AutoTcorrelate(AFNICommand): output_spec = AFNICommandOutputSpec _cmd = '3dAutoTcorrelate' - def _overload_extension(self, value, name=None): - path, base, ext = split_filename(value) - if ext.lower() not in [".1d", ".nii.gz", ".nii"]: - ext = ext + ".1D" - return os.path.join(path, base + ext) - class TStatInputSpec(AFNICommandInputSpec): - in_file = File(desc='input file to 3dTstat', - argstr='%s', - position=-1, - mandatory=True, - exists=True, - copyfile=False) - + in_file = File(argstr='%s', position=-1, mandatory=True, exists=True, copyfile=False, + desc='input file to 3dTstat') out_file = File(name_template="%s_tstat", desc='output image file name', argstr='-prefix %s', name_source="in_file") - - mask = File(desc='mask file', - argstr='-mask %s', - exists=True) - options = traits.Str(desc='selected statistical output', - argstr='%s') + mask = File(desc='mask file', argstr='-mask %s', exists=True) + options = traits.Str(desc='selected statistical output', argstr='%s') class TStat(AFNICommand): @@ -441,13 +352,8 @@ class TStat(AFNICommand): class DetrendInputSpec(AFNICommandInputSpec): - in_file = File(desc='input file to 3dDetrend', - argstr='%s', - position=-1, - mandatory=True, - exists=True, - copyfile=False) - + in_file = File(argstr='%s', position=-1, mandatory=True, exists=True, copyfile=False, + desc='input file to 3dDetrend') out_file = File(name_template="%s_detrend", desc='output image file name', argstr='-prefix %s', name_source="in_file") @@ -480,13 +386,8 @@ class Detrend(AFNICommand): class DespikeInputSpec(AFNICommandInputSpec): - in_file = File(desc='input file to 3dDespike', - argstr='%s', - position=-1, - mandatory=True, - exists=True, - copyfile=False) - + in_file = File(argstr='%s', position=-1, mandatory=True, exists=True, copyfile=False, + desc='input file to 3dDespike') out_file = File(name_template="%s_despike", desc='output image file name', argstr='-prefix %s', name_source="in_file") @@ -516,29 +417,20 @@ class Despike(AFNICommand): class AutomaskInputSpec(AFNICommandInputSpec): - in_file = File(desc='input file to 3dAutomask', - argstr='%s', - position=-1, - mandatory=True, - exists=True, - copyfile=False) - + in_file = File(argstr='%s', position=-1, mandatory=True, exists=True, copyfile=False, + desc='input file to 3dAutomask',) out_file = File(name_template="%s_mask", desc='output image file name', argstr='-prefix %s', name_source="in_file") - brain_file = File(name_template="%s_masked", desc="output file from 3dAutomask", argstr='-apply_prefix %s', name_source="in_file") - clfrac = traits.Float(desc='sets the clip level fraction' + ' (must be 0.1-0.9). ' + 'A small value will tend to make the mask larger [default = 0.5].', argstr="-clfrac %s") - dilate = traits.Int(desc='dilate the mask outwards', argstr="-dilate %s") - erode = traits.Int(desc='erode the mask inwards', argstr="-erode %s") @@ -546,7 +438,6 @@ class AutomaskInputSpec(AFNICommandInputSpec): class AutomaskOutputSpec(TraitedSpec): out_file = File(desc='mask file', exists=True) - brain_file = File(desc='brain file (skull stripped)', exists=True) @@ -577,30 +468,23 @@ class Automask(AFNICommand): class VolregInputSpec(AFNICommandInputSpec): - - in_file = File(desc='input file to 3dvolreg', - argstr='%s', - position=-1, - mandatory=True, - exists=True, - copyfile=False) + in_file = File(argstr='%s', position=-1, mandatory=True, exists=True, copyfile=False, + desc='input file to 3dvolreg') out_file = File(name_template="%s_volreg", desc='output image file name', argstr='-prefix %s', name_source="in_file") - basefile = File(desc='base file for registration', - argstr='-base %s', - position=-6, - exists=True) + basefile = File(argstr='-base %s', position=-6, exists=True, + desc='base file for registration') zpad = traits.Int(desc='Zeropad around the edges' + ' by \'n\' voxels during rotations', argstr='-zpad %d', position=-5) md1d_file = File(name_template='%s_md.1D', desc='max displacement output file', argstr='-maxdisp1D %s', name_source="in_file", - keep_extension=True, position=-4) + keep_extension=False, position=-4) oned_file = File(name_template='%s.1D', desc='1D movement parameters output file', argstr='-1Dfile %s', name_source="in_file", - keep_extension=True) + keep_extension=False) verbose = traits.Bool(desc='more detailed description of the process', argstr='-verbose') timeshift = traits.Bool(desc='time shift to mean slice time offset', @@ -610,7 +494,7 @@ class VolregInputSpec(AFNICommandInputSpec): oned_matrix_save = File(name_template='%s.aff12.1D', desc='Save the matrix transformation', argstr='-1Dmatrix_save %s', - keep_extension=True, + keep_extension=False, name_source="in_file") @@ -691,15 +575,11 @@ class Merge(AFNICommand): class CopyInputSpec(AFNICommandInputSpec): - in_file = File(desc='input file to 3dcopy', - argstr='%s', - position=-2, - mandatory=True, - exists=True, - copyfile=False) + in_file = File(desc='input file to 3dcopy', argstr='%s', position=-2, mandatory=True, + exists=True, copyfile=False) out_file = File( name_template="%s_copy", desc='output image file name', argstr='%s', - position=-1, name_source="in_file", keep_extension=True) + position=-1, name_source="in_file", keep_extension=False) class Copy(AFNICommand): @@ -720,17 +600,20 @@ class Copy(AFNICommand): '3dcopy functional.nii functional_copy' >>> from copy import deepcopy - >>> copy3d_2 = deepcopy(copy3d) + >>> copy3d_2 = afni.Copy() + >>> copy3d_2.inputs.in_file = 'functional.nii' >>> copy3d_2.inputs.outputtype = 'NIFTI' >>> copy3d_2.cmdline '3dcopy functional.nii functional_copy.nii' - >>> copy3d_3 = deepcopy(copy3d) + >>> copy3d_3 = afni.Copy() + >>> copy3d_3.inputs.in_file = 'functional.nii' >>> copy3d_3.inputs.outputtype = 'NIFTI_GZ' >>> copy3d_3.cmdline '3dcopy functional.nii functional_copy.nii.gz' - >>> copy3d_4 = deepcopy(copy3d) + >>> copy3d_4 = afni.Copy() + >>> copy3d_4.inputs.in_file = 'functional.nii' >>> copy3d_4.inputs.out_file = 'new_func.nii' >>> copy3d_4.cmdline '3dcopy functional.nii new_func.nii' @@ -950,7 +833,8 @@ class AllineateInputSpec(AFNICommandInputSpec): desc='output file from 3dAllineate', argstr='-prefix %s', position=-2, - name_source='%s_allineate', + name_source='in_file', + name_template='%s_allineate', genfile=True) out_param_file = File( @@ -1126,6 +1010,13 @@ class AllineateInputSpec(AFNICommandInputSpec): desc='To fix non-linear warp dependency along directions.') + def _format_arg(self, name, trait_spec, value): + if name == 'nwarp_fixmot' or name == 'nwarp_fixdep': + arg = ' '.join([trait_spec.argstr % v for v in value]) + return arg + return super(AllineateInputSpec, self)._format_arg(name, trait_spec, value) + + class AllineateOutputSpec(TraitedSpec): out_file = File(desc='output image file name') matrix = File(desc='matrix to align input file') @@ -1154,35 +1045,13 @@ class Allineate(AFNICommand): input_spec = AllineateInputSpec output_spec = AllineateOutputSpec - def _format_arg(self, name, trait_spec, value): - if name == 'nwarp_fixmot' or name == 'nwarp_fixdep': - arg = ' '.join([trait_spec.argstr % v for v in value]) - return arg - return super(Allineate, self)._format_arg(name, trait_spec, value) - - def _post_run(self): - - if not isdefined(self.inputs.out_file): - self.outputs.out_file = self._gen_filename(self.inputs.in_file, - suffix=self.inputs.suffix) - else: - self.outputs.out_file = os.path.abspath(self.inputs.out_file) - - def _gen_filename(self, name): - if name == 'out_file': - return getattr(self.outputs, name) - class MaskaveInputSpec(AFNICommandInputSpec): - in_file = File(desc='input file to 3dmaskave', - argstr='%s', - position=-2, - mandatory=True, - exists=True, - copyfile=False) + in_file = File(argstr='%s', position=-2, mandatory=True, exists=True, + copyfile=False, desc='input file to 3dmaskave') out_file = File(name_template="%s_maskave.1D", desc='output image file name', - keep_extension=True, - argstr="> %s", name_source="in_file", position=-1) + keep_extension=False, argstr="> %s", name_source="in_file", + position=-1) mask = File(desc='matrix to align input file', argstr='-mask %s', position=1, @@ -1400,22 +1269,13 @@ class TCorrelate(AFNICommand): class TCorr1DInputSpec(AFNICommandInputSpec): - xset = File(desc='3d+time dataset input', - argstr=' %s', - position=-2, - mandatory=True, - exists=True, - copyfile=False) - y_1d = File(desc='1D time series file input', - argstr=' %s', - position=-1, - mandatory=True, - exists=True) - out_file = File(desc='output filename prefix', - name_template='%s_correlation.nii.gz', - argstr='-prefix %s', - name_source='xset', - keep_extension=True) + xset = File(argstr=' %s', position=-2, mandatory=True, exists=True, + copyfile=False, desc='3d+time dataset input') + y_1d = File(argstr=' %s', position=-1, mandatory=True, exists=True, + desc='1D time series file input') + out_file = File(name_template='%s_correlation.nii.gz', argstr='-prefix %s', + name_source='xset', keep_extension=False, + desc='output filename prefix') pearson = traits.Bool(desc='Correlation is the normal' + ' Pearson correlation coefficient', argstr=' -pearson', @@ -1465,20 +1325,12 @@ class TCorr1D(AFNICommand): class BrickStatInputSpec(AFNICommandInputSpec): - in_file = File(desc='input file to 3dmaskave', - argstr='%s', - position=-1, - mandatory=True, - exists=True) - - mask = File(desc='-mask dset = use dset as mask to include/exclude voxels', - argstr='-mask %s', - position=2, - exists=True) - - min = traits.Bool(desc='print the minimum value in dataset', - argstr='-min', - position=1) + in_file = File(argstr='%s', position=-1, mandatory=True, exists=True, + desc='input file to 3dmaskave') + mask = File(argstr='-mask %s', position=2, exists=True, + desc='-mask dset = use dset as mask to include/exclude voxels') + min = traits.Bool(argstr='-min', position=1, + desc='print the minimum value in dataset') class BrickStatOutputSpec(TraitedSpec): @@ -1533,7 +1385,7 @@ def aggregate_outputs(self, runtime=None, needed_outputs=None): save_json(outfile, dict(stat=min_val)) outputs.min_val = min_val - + class ROIStatsInputSpec(CommandLineInputSpec): in_file = File(desc='input file to 3dROIstats', @@ -1597,7 +1449,7 @@ def aggregate_outputs(self, runtime=None, needed_outputs=None): f.close() outputs.stats = os.path.abspath(output_filename) - + class CalcInputSpec(AFNICommandInputSpec): in_file_a = File(desc='input file to 3dcalc', @@ -1617,6 +1469,17 @@ class CalcInputSpec(AFNICommandInputSpec): single_idx = traits.Int(desc='volume index for in_file_a') other = File(desc='other options', argstr='') + def _format_arg(self, name, trait_spec, value): + if name == 'in_file_a': + arg = trait_spec.argstr % value + if isdefined(self.start_idx): + arg += '[%d..%d]' % (self.start_idx, + self.stop_idx) + if isdefined(self.single_idx): + arg += '[%d]' % (self.single_idx) + return arg + return super(CalcInputSpec, self)._format_arg(name, trait_spec, value) + class Calc(AFNICommand): @@ -1644,23 +1507,6 @@ class Calc(AFNICommand): input_spec = CalcInputSpec output_spec = AFNICommandOutputSpec - def _format_arg(self, name, trait_spec, value): - if name == 'in_file_a': - arg = trait_spec.argstr % value - if isdefined(self.inputs.start_idx): - arg += '[%d..%d]' % (self.inputs.start_idx, - self.inputs.stop_idx) - if isdefined(self.inputs.single_idx): - arg += '[%d]' % (self.inputs.single_idx) - return arg - return super(Calc, self)._format_arg(name, trait_spec, value) - - def _parse_inputs(self, skip=None): - """Skip the arguments without argstr metadata - """ - return super(Calc, self)._parse_inputs( - skip=('start_idx', 'stop_idx', 'other')) - class BlurInMaskInputSpec(AFNICommandInputSpec): in_file = File( @@ -1773,9 +1619,19 @@ class TCorrMapInputSpec(AFNICommandInputSpec): histogram = File( name_source='in_file', argstr='-Hist %d %s', suffix='_hist') + def _format_arg(self, name, trait_spec, value): + if name in self._thresh_opts: + return trait_spec.argstr % self.thresholds + [value] + elif name in self._expr_opts: + return trait_spec.argstr % (self.expr, value) + elif name == 'histogram': + return trait_spec.argstr % (self.histogram_bin_numbers, + value) + else: + return super(TCorrMapInputSpec, self)._format_arg(name, trait_spec, value) + class TCorrMapOutputSpec(TraitedSpec): - mean_file = File() zmean = File() qmean = File() @@ -1817,16 +1673,6 @@ class TCorrMap(AFNICommand): output_spec = TCorrMapOutputSpec _additional_metadata = ['suffix'] - def _format_arg(self, name, trait_spec, value): - if name in self.inputs._thresh_opts: - return trait_spec.argstr % self.inputs.thresholds + [value] - elif name in self.inputs._expr_opts: - return trait_spec.argstr % (self.inputs.expr, value) - elif name == 'histogram': - return trait_spec.argstr % (self.inputs.histogram_bin_numbers, - value) - else: - return super(TCorrMap, self)._format_arg(name, trait_spec, value) class AutoboxInputSpec(AFNICommandInputSpec): @@ -1889,7 +1735,7 @@ def aggregate_outputs(self, runtime=None, needed_outputs=None): d[k] = int(d[k]) outputs.set(**d) outputs.set(out_file=self._gen_filename('out_file')) - + def _gen_filename(self, name): if name == 'out_file' and (not isdefined(self.inputs.out_file)): return Undefined @@ -1978,6 +1824,11 @@ class AFNItoNIFTIInputSpec(AFNICommandInputSpec): argstr='-prefix %s', name_source="in_file", keep_extension=False) hash_files = False + def _overload_extension(self, value, name=None, ext=None): + path, base, ext = split_filename(value) + if ext.lower() not in [".1d", ".nii.gz", ".1D"]: + ext = ext + ".nii" + return os.path.join(path, base + ext) class AFNItoNIFTI(AFNICommand): @@ -2002,15 +1853,6 @@ class AFNItoNIFTI(AFNICommand): input_spec = AFNItoNIFTIInputSpec output_spec = AFNICommandOutputSpec - def _overload_extension(self, value): - path, base, ext = split_filename(value) - if ext.lower() not in [".1d", ".nii.gz", ".1D"]: - ext = ext + ".nii" - return os.path.join(path, base + ext) - - def _gen_filename(self, name): - return os.path.abspath(super(AFNItoNIFTI, self)._gen_filename(name)) - class EvalInputSpec(AFNICommandInputSpec): in_file_a = File(desc='input file to 1deval', @@ -2032,6 +1874,23 @@ class EvalInputSpec(AFNICommandInputSpec): single_idx = traits.Int(desc='volume index for in_file_a') other = File(desc='other options', argstr='') + def _format_arg(self, name, trait_spec, value): + if name == 'in_file_a': + arg = trait_spec.argstr % value + if isdefined(self.start_idx): + arg += '[%d..%d]' % (self.start_idx, + self.stop_idx) + if isdefined(self.single_idx): + arg += '[%d]' % (self.single_idx) + return arg + return super(EvalInputSpec, self)._format_arg(name, trait_spec, value) + + def _parse_inputs(self, skip=None): + """Skip the arguments without argstr metadata + """ + return super(EvalInputSpec, self)._parse_inputs( + skip=('start_idx', 'stop_idx', 'out1D', 'other')) + class Eval(AFNICommand): @@ -2058,23 +1917,6 @@ class Eval(AFNICommand): input_spec = EvalInputSpec output_spec = AFNICommandOutputSpec - def _format_arg(self, name, trait_spec, value): - if name == 'in_file_a': - arg = trait_spec.argstr % value - if isdefined(self.inputs.start_idx): - arg += '[%d..%d]' % (self.inputs.start_idx, - self.inputs.stop_idx) - if isdefined(self.inputs.single_idx): - arg += '[%d]' % (self.inputs.single_idx) - return arg - return super(Eval, self)._format_arg(name, trait_spec, value) - - def _parse_inputs(self, skip=None): - """Skip the arguments without argstr metadata - """ - return super(Eval, self)._parse_inputs( - skip=('start_idx', 'stop_idx', 'out1D', 'other')) - class MeansInputSpec(AFNICommandInputSpec): in_file_a = File(desc='input file to 3dMean', @@ -2142,8 +1984,15 @@ class HistInputSpec(CommandLineInputSpec): min_value = traits.Float(argstr='-min %f', desc='minimum intensity value') bin_width = traits.Float(argstr='-binwidth %f', desc='bin width') + def _parse_inputs(self, skip=None): + if not self.showhist: + if skip is None: + skip = [] + skip += ['out_show'] + return super(HistInputSpec, self)._parse_inputs(skip=skip) + class HistOutputSpec(TraitedSpec): - out_file = File(desc='output file', exists=True) + out_file = File(desc='output file', mandatory=True, suffix='.niml.hist') out_show = File(desc='output visual histogram') @@ -2180,20 +2029,11 @@ def __init__(self, **inputs): if isinstance(version[0], int) and version[0] > 15: self._redirect_x = False - def _parse_inputs(self, skip=None): - if not self.inputs.showhist: - if skip is None: - skip = [] - skip += ['out_show'] - return super(Hist, self)._parse_inputs(skip=skip) - def _post_run(self): - outputs = super(Hist, self)._list_outputs() - self.outputs.out_file += '.niml.hist' if not self.inputs.showhist: self.outputs.out_show = Undefined - + class FWHMxInputSpec(CommandLineInputSpec): in_file = File(desc='input dataset', argstr='-input %s', mandatory=True, exists=True) @@ -2228,8 +2068,46 @@ class FWHMxInputSpec(CommandLineInputSpec): combine = traits.Bool(argstr='-combine', desc='combine the final measurements along each axis') compat = traits.Bool(argstr='-compat', desc='be compatible with the older 3dFWHM') acf = traits.Either( - traits.Bool(), File(), traits.Tuple(File(exists=True), traits.Float()), - default=False, usedefault=True, argstr='-acf', desc='computes the spatial autocorrelation') + False, traits.Bool(), File(), traits.Tuple(File(exists=True), traits.Float()), + usedefault=True, argstr='-acf', desc='computes the spatial autocorrelation') + + def _parse_inputs(self, skip=None): + if not self.detrend: + if skip is None: + skip = [] + skip += ['out_detrend'] + return super(FWHMxInputSpec, self)._parse_inputs(skip=skip) + + def arg_used(self, name): + return self._format_arg(name) is None + + def _format_arg(self, name, trait_spec=None, value=None): + if trait_spec is None: + trait_spec = self.traits()[name] + + if value is None: + value = getattr(self, name) + + if name == 'detrend': + if isinstance(value, bool): + if value: + return trait_spec.argstr + else: + return None + elif isinstance(value, int): + return trait_spec.argstr + ' %d' % value + + if name == 'acf': + if isinstance(value, bool): + if value: + return trait_spec.argstr + else: + return None + elif isinstance(value, tuple): + return trait_spec.argstr + ' %s %f' % value + elif isinstance(value, string_types): + return trait_spec.argstr + ' ' + value + return super(FWHMxInputSpec, self)._format_arg(name, trait_spec, value) class FWHMxOutputSpec(TraitedSpec): @@ -2348,40 +2226,9 @@ class FWHMx(AFNICommandBase): _cmd = '3dFWHMx' input_spec = FWHMxInputSpec output_spec = FWHMxOutputSpec - _acf = True - - def _parse_inputs(self, skip=None): - if not self.inputs.detrend: - if skip is None: - skip = [] - skip += ['out_detrend'] - return super(FWHMx, self)._parse_inputs(skip=skip) - - def _format_arg(self, name, trait_spec, value): - if name == 'detrend': - if isinstance(value, bool): - if value: - return trait_spec.argstr - else: - return None - elif isinstance(value, int): - return trait_spec.argstr + ' %d' % value - - if name == 'acf': - if isinstance(value, bool): - if value: - return trait_spec.argstr - else: - self._acf = False - return None - elif isinstance(value, tuple): - return trait_spec.argstr + ' %s %f' % value - elif isinstance(value, string_types): - return trait_spec.argstr + ' ' + value - return super(FWHMx, self)._format_arg(name, trait_spec, value) def _post_run(self): - outputs = super(FWHMx, self)._list_outputs() + super(FWHMx, self)._post_run() if self.inputs.detrend: fname, ext = op.splitext(self.inputs.in_file) @@ -2393,7 +2240,7 @@ def _post_run(self): self.outputs.out_detrend = Undefined sout = np.loadtxt(self.outputs.out_file) #pylint: disable=E1101 - if self._acf: + if self.inputs.arg_used('acf'): self.outputs.acf_param = tuple(sout[1]) sout = tuple(sout[0]) @@ -2402,4 +2249,4 @@ def _post_run(self): self.outputs.out_acf = op.abspath(self.inputs.acf) self.outputs.fwhm = tuple(sout) - \ No newline at end of file + diff --git a/nipype/interfaces/afni/tests/test_auto_AFNICommand.py b/nipype/interfaces/afni/tests/test_auto_AFNICommand.py index 38c422e34c..bc1b49380e 100644 --- a/nipype/interfaces/afni/tests/test_auto_AFNICommand.py +++ b/nipype/interfaces/afni/tests/test_auto_AFNICommand.py @@ -13,6 +13,7 @@ def test_AFNICommand_inputs(): usedefault=True, ), out_file=dict(argstr='-prefix %s', + keep_extension=False, name_source=['in_file'], name_template='%s_afni', ), diff --git a/nipype/interfaces/afni/tests/test_auto_Allineate.py b/nipype/interfaces/afni/tests/test_auto_Allineate.py index 27a1cc5dae..49f00463e1 100644 --- a/nipype/interfaces/afni/tests/test_auto_Allineate.py +++ b/nipype/interfaces/afni/tests/test_auto_Allineate.py @@ -64,7 +64,8 @@ def test_Allineate_inputs(): ), out_file=dict(argstr='-prefix %s', genfile=True, - name_source='%s_allineate', + name_source='in_file', + name_template='%s_allineate', position=-2, ), out_matrix=dict(argstr='-1Dmatrix_save %s', diff --git a/nipype/interfaces/afni/tests/test_auto_AutoTcorrelate.py b/nipype/interfaces/afni/tests/test_auto_AutoTcorrelate.py index a904f58e8a..593d05259f 100644 --- a/nipype/interfaces/afni/tests/test_auto_AutoTcorrelate.py +++ b/nipype/interfaces/afni/tests/test_auto_AutoTcorrelate.py @@ -22,6 +22,7 @@ def test_AutoTcorrelate_inputs(): mask=dict(argstr='-mask %s', ), mask_only_targets=dict(argstr='-mask_only_targets', + usedefault=True, xor=['mask_source'], ), mask_source=dict(argstr='-mask_source %s', diff --git a/nipype/interfaces/afni/tests/test_auto_BrickStat.py b/nipype/interfaces/afni/tests/test_auto_BrickStat.py index 0c47101656..3562fdacee 100644 --- a/nipype/interfaces/afni/tests/test_auto_BrickStat.py +++ b/nipype/interfaces/afni/tests/test_auto_BrickStat.py @@ -23,6 +23,7 @@ def test_BrickStat_inputs(): position=1, ), out_file=dict(argstr='-prefix %s', + keep_extension=False, name_source=['in_file'], name_template='%s_afni', ), diff --git a/nipype/interfaces/afni/tests/test_auto_Copy.py b/nipype/interfaces/afni/tests/test_auto_Copy.py index 53922cac1a..6cfcb857ae 100644 --- a/nipype/interfaces/afni/tests/test_auto_Copy.py +++ b/nipype/interfaces/afni/tests/test_auto_Copy.py @@ -18,7 +18,7 @@ def test_Copy_inputs(): position=-2, ), out_file=dict(argstr='%s', - keep_extension=True, + keep_extension=False, name_source='in_file', name_template='%s_copy', position=-1, diff --git a/nipype/interfaces/afni/tests/test_auto_Hist.py b/nipype/interfaces/afni/tests/test_auto_Hist.py index 0024e5f186..028d7ed938 100644 --- a/nipype/interfaces/afni/tests/test_auto_Hist.py +++ b/nipype/interfaces/afni/tests/test_auto_Hist.py @@ -52,7 +52,9 @@ def test_Hist_inputs(): def test_Hist_outputs(): - output_map = dict(out_file=dict(), + output_map = dict(out_file=dict(mandatory=True, + suffix='.niml.hist', + ), out_show=dict(), ) outputs = Hist.output_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_Maskave.py b/nipype/interfaces/afni/tests/test_auto_Maskave.py index dbff513cc8..9553282304 100644 --- a/nipype/interfaces/afni/tests/test_auto_Maskave.py +++ b/nipype/interfaces/afni/tests/test_auto_Maskave.py @@ -21,7 +21,7 @@ def test_Maskave_inputs(): position=1, ), out_file=dict(argstr='> %s', - keep_extension=True, + keep_extension=False, name_source='in_file', name_template='%s_maskave.1D', position=-1, diff --git a/nipype/interfaces/afni/tests/test_auto_Refit.py b/nipype/interfaces/afni/tests/test_auto_Refit.py index 124655276a..ad53e8b159 100644 --- a/nipype/interfaces/afni/tests/test_auto_Refit.py +++ b/nipype/interfaces/afni/tests/test_auto_Refit.py @@ -7,6 +7,7 @@ def test_Refit_inputs(): input_map = dict(args=dict(argstr='%s', ), deoblique=dict(argstr='-deoblique', + usedefault=True, ), environ=dict(nohash=True, usedefault=True, @@ -44,7 +45,10 @@ def test_Refit_inputs(): def test_Refit_outputs(): - output_map = dict(out_file=dict(), + output_map = dict(out_file=dict(keep_extension=False, + name_source='in_file', + name_template='%s', + ), ) outputs = Refit.output_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_TCorr1D.py b/nipype/interfaces/afni/tests/test_auto_TCorr1D.py index 96ebdbe3a6..6944276a2c 100644 --- a/nipype/interfaces/afni/tests/test_auto_TCorr1D.py +++ b/nipype/interfaces/afni/tests/test_auto_TCorr1D.py @@ -17,7 +17,7 @@ def test_TCorr1D_inputs(): xor=['pearson', 'spearman', 'quadrant'], ), out_file=dict(argstr='-prefix %s', - keep_extension=True, + keep_extension=False, name_source='xset', name_template='%s_correlation.nii.gz', ), diff --git a/nipype/interfaces/afni/tests/test_auto_TCorrMap.py b/nipype/interfaces/afni/tests/test_auto_TCorrMap.py index 15c98d2aac..d2c19bbc1d 100644 --- a/nipype/interfaces/afni/tests/test_auto_TCorrMap.py +++ b/nipype/interfaces/afni/tests/test_auto_TCorrMap.py @@ -56,6 +56,7 @@ def test_TCorrMap_inputs(): suffix='_mean', ), out_file=dict(argstr='-prefix %s', + keep_extension=False, name_source=['in_file'], name_template='%s_afni', ), diff --git a/nipype/interfaces/afni/tests/test_auto_Volreg.py b/nipype/interfaces/afni/tests/test_auto_Volreg.py index f97afe6366..10dc45e76e 100644 --- a/nipype/interfaces/afni/tests/test_auto_Volreg.py +++ b/nipype/interfaces/afni/tests/test_auto_Volreg.py @@ -23,18 +23,18 @@ def test_Volreg_inputs(): position=-1, ), md1d_file=dict(argstr='-maxdisp1D %s', - keep_extension=True, + keep_extension=False, name_source='in_file', name_template='%s_md.1D', position=-4, ), oned_file=dict(argstr='-1Dfile %s', - keep_extension=True, + keep_extension=False, name_source='in_file', name_template='%s.1D', ), oned_matrix_save=dict(argstr='-1Dmatrix_save %s', - keep_extension=True, + keep_extension=False, name_source='in_file', name_template='%s.aff12.1D', ), diff --git a/nipype/interfaces/ants/tests/test_auto_ANTSCommand.py b/nipype/interfaces/ants/tests/test_auto_ANTSCommand.py index 1c2a67f3bb..d930db7d72 100644 --- a/nipype/interfaces/ants/tests/test_auto_ANTSCommand.py +++ b/nipype/interfaces/ants/tests/test_auto_ANTSCommand.py @@ -24,3 +24,11 @@ def test_ANTSCommand_inputs(): for metakey, value in list(metadata.items()): yield assert_equal, getattr(inputs.traits()[key], metakey), value + +def test_ANTSCommand_outputs(): + output_map = dict() + outputs = ANTSCommand.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/base.py b/nipype/interfaces/base.py index 9d45b4edd8..d28f9ebe93 100644 --- a/nipype/interfaces/base.py +++ b/nipype/interfaces/base.py @@ -464,6 +464,7 @@ def _run_interface(self, runtime, *kwargs): raise NotImplementedError def _pre_run(self, **inputs): + self.outputs = self.output_spec() self.inputs.set(**inputs) self.inputs.check_inputs() self.inputs.update_autonames() @@ -833,6 +834,7 @@ def cmd(self): def cmdline(self): """ `command` plus any arguments (args) validates arguments and generates command line""" + self.outputs = self.output_spec() self.inputs.check_inputs() self.inputs.update_autonames() allargs = self.inputs.parse_args() diff --git a/nipype/interfaces/camino/tests/test_auto_AnalyzeHeader.py b/nipype/interfaces/camino/tests/test_auto_AnalyzeHeader.py index 324fe35d1b..2339ef9c65 100644 --- a/nipype/interfaces/camino/tests/test_auto_AnalyzeHeader.py +++ b/nipype/interfaces/camino/tests/test_auto_AnalyzeHeader.py @@ -44,8 +44,8 @@ def test_AnalyzeHeader_inputs(): units='NA', ), out_file=dict(argstr='> %s', - genfile=True, position=-1, + usedefault=True, ), picoseed=dict(argstr='-picoseed %s', units='mm', diff --git a/nipype/interfaces/camino/tests/test_auto_ComputeEigensystem.py b/nipype/interfaces/camino/tests/test_auto_ComputeEigensystem.py index d62e37c212..9dccbfc586 100644 --- a/nipype/interfaces/camino/tests/test_auto_ComputeEigensystem.py +++ b/nipype/interfaces/camino/tests/test_auto_ComputeEigensystem.py @@ -24,8 +24,8 @@ def test_ComputeEigensystem_inputs(): maxcomponents=dict(argstr='-maxcomponents %d', ), out_file=dict(argstr='> %s', - genfile=True, position=-1, + usedefault=True, ), outputdatatype=dict(argstr='-outputdatatype %s', usedefault=True, diff --git a/nipype/interfaces/camino/tests/test_auto_ComputeFractionalAnisotropy.py b/nipype/interfaces/camino/tests/test_auto_ComputeFractionalAnisotropy.py index 0a022eb1c3..63b5199358 100644 --- a/nipype/interfaces/camino/tests/test_auto_ComputeFractionalAnisotropy.py +++ b/nipype/interfaces/camino/tests/test_auto_ComputeFractionalAnisotropy.py @@ -21,8 +21,8 @@ def test_ComputeFractionalAnisotropy_inputs(): inputmodel=dict(argstr='-inputmodel %s', ), out_file=dict(argstr='> %s', - genfile=True, position=-1, + usedefault=True, ), outputdatatype=dict(argstr='-outputdatatype %s', ), diff --git a/nipype/interfaces/camino/tests/test_auto_ComputeTensorTrace.py b/nipype/interfaces/camino/tests/test_auto_ComputeTensorTrace.py index b7d7561cdb..e98e5e7b16 100644 --- a/nipype/interfaces/camino/tests/test_auto_ComputeTensorTrace.py +++ b/nipype/interfaces/camino/tests/test_auto_ComputeTensorTrace.py @@ -21,8 +21,8 @@ def test_ComputeTensorTrace_inputs(): inputmodel=dict(argstr='-inputmodel %s', ), out_file=dict(argstr='> %s', - genfile=True, position=-1, + usedefault=True, ), outputdatatype=dict(argstr='-outputdatatype %s', ), diff --git a/nipype/interfaces/camino/tests/test_auto_DTIFit.py b/nipype/interfaces/camino/tests/test_auto_DTIFit.py index 8607d3d7ae..3720d95f58 100644 --- a/nipype/interfaces/camino/tests/test_auto_DTIFit.py +++ b/nipype/interfaces/camino/tests/test_auto_DTIFit.py @@ -22,8 +22,8 @@ def test_DTIFit_inputs(): position=3, ), out_file=dict(argstr='> %s', - genfile=True, position=-1, + usedefault=True, ), scheme_file=dict(argstr='%s', mandatory=True, diff --git a/nipype/interfaces/camino/tests/test_auto_DTLUTGen.py b/nipype/interfaces/camino/tests/test_auto_DTLUTGen.py index 6cae7fee81..30e884b1c1 100644 --- a/nipype/interfaces/camino/tests/test_auto_DTLUTGen.py +++ b/nipype/interfaces/camino/tests/test_auto_DTLUTGen.py @@ -28,8 +28,8 @@ def test_DTLUTGen_inputs(): units='NA', ), out_file=dict(argstr='> %s', - genfile=True, position=-1, + usedefault=True, ), samples=dict(argstr='-samples %d', units='NA', diff --git a/nipype/interfaces/camino/tests/test_auto_FSL2Scheme.py b/nipype/interfaces/camino/tests/test_auto_FSL2Scheme.py index b182c5a862..70432d5936 100644 --- a/nipype/interfaces/camino/tests/test_auto_FSL2Scheme.py +++ b/nipype/interfaces/camino/tests/test_auto_FSL2Scheme.py @@ -38,8 +38,8 @@ def test_FSL2Scheme_inputs(): units='NA', ), out_file=dict(argstr='> %s', - genfile=True, position=-1, + usedefault=True, ), terminal_output=dict(nohash=True, ), diff --git a/nipype/interfaces/camino/tests/test_auto_Image2Voxel.py b/nipype/interfaces/camino/tests/test_auto_Image2Voxel.py index 57da324d6c..c55f9189de 100644 --- a/nipype/interfaces/camino/tests/test_auto_Image2Voxel.py +++ b/nipype/interfaces/camino/tests/test_auto_Image2Voxel.py @@ -17,8 +17,8 @@ def test_Image2Voxel_inputs(): position=1, ), out_file=dict(argstr='> %s', - genfile=True, position=-1, + usedefault=True, ), out_type=dict(argstr='-outputdatatype %s', position=2, diff --git a/nipype/interfaces/camino/tests/test_auto_LinRecon.py b/nipype/interfaces/camino/tests/test_auto_LinRecon.py index 311bd70fdf..3e3aa55fad 100644 --- a/nipype/interfaces/camino/tests/test_auto_LinRecon.py +++ b/nipype/interfaces/camino/tests/test_auto_LinRecon.py @@ -23,8 +23,8 @@ def test_LinRecon_inputs(): normalize=dict(argstr='-normalize', ), out_file=dict(argstr='> %s', - genfile=True, position=-1, + usedefault=True, ), qball_mat=dict(argstr='%s', mandatory=True, diff --git a/nipype/interfaces/camino/tests/test_auto_MESD.py b/nipype/interfaces/camino/tests/test_auto_MESD.py index 018d820a96..3fd26c8ae5 100644 --- a/nipype/interfaces/camino/tests/test_auto_MESD.py +++ b/nipype/interfaces/camino/tests/test_auto_MESD.py @@ -36,8 +36,8 @@ def test_MESD_inputs(): units='NA', ), out_file=dict(argstr='> %s', - genfile=True, position=-1, + usedefault=True, ), scheme_file=dict(argstr='-schemefile %s', mandatory=True, diff --git a/nipype/interfaces/camino/tests/test_auto_ModelFit.py b/nipype/interfaces/camino/tests/test_auto_ModelFit.py index f56a605962..64f0d1cdfa 100644 --- a/nipype/interfaces/camino/tests/test_auto_ModelFit.py +++ b/nipype/interfaces/camino/tests/test_auto_ModelFit.py @@ -33,8 +33,8 @@ def test_ModelFit_inputs(): noisemap=dict(argstr='-noisemap %s', ), out_file=dict(argstr='> %s', - genfile=True, position=-1, + usedefault=True, ), outlier=dict(argstr='-outliermap %s', ), diff --git a/nipype/interfaces/camino/tests/test_auto_NIfTIDT2Camino.py b/nipype/interfaces/camino/tests/test_auto_NIfTIDT2Camino.py index dd710905b2..ca4c47a787 100644 --- a/nipype/interfaces/camino/tests/test_auto_NIfTIDT2Camino.py +++ b/nipype/interfaces/camino/tests/test_auto_NIfTIDT2Camino.py @@ -21,8 +21,8 @@ def test_NIfTIDT2Camino_inputs(): lns0_file=dict(argstr='-lns0 %s', ), out_file=dict(argstr='> %s', - genfile=True, position=-1, + usedefault=True, ), s0_file=dict(argstr='-s0 %s', ), diff --git a/nipype/interfaces/camino/tests/test_auto_PicoPDFs.py b/nipype/interfaces/camino/tests/test_auto_PicoPDFs.py index 4f4a0b75be..3a855b7ccf 100644 --- a/nipype/interfaces/camino/tests/test_auto_PicoPDFs.py +++ b/nipype/interfaces/camino/tests/test_auto_PicoPDFs.py @@ -32,8 +32,8 @@ def test_PicoPDFs_inputs(): units='NA', ), out_file=dict(argstr='> %s', - genfile=True, position=-1, + usedefault=True, ), pdf=dict(argstr='-pdf %s', position=4, diff --git a/nipype/interfaces/camino/tests/test_auto_ProcStreamlines.py b/nipype/interfaces/camino/tests/test_auto_ProcStreamlines.py index 99ecff3624..560074ecb8 100644 --- a/nipype/interfaces/camino/tests/test_auto_ProcStreamlines.py +++ b/nipype/interfaces/camino/tests/test_auto_ProcStreamlines.py @@ -53,8 +53,8 @@ def test_ProcStreamlines_inputs(): noresample=dict(argstr='-noresample', ), out_file=dict(argstr='> %s', - genfile=True, position=-1, + usedefault=True, ), outputacm=dict(argstr='-outputacm', requires=['outputroot', 'seedfile'], diff --git a/nipype/interfaces/camino/tests/test_auto_QBallMX.py b/nipype/interfaces/camino/tests/test_auto_QBallMX.py index 9a4b2375c8..c73e15921c 100644 --- a/nipype/interfaces/camino/tests/test_auto_QBallMX.py +++ b/nipype/interfaces/camino/tests/test_auto_QBallMX.py @@ -19,8 +19,8 @@ def test_QBallMX_inputs(): units='NA', ), out_file=dict(argstr='> %s', - genfile=True, position=-1, + usedefault=True, ), rbfpointset=dict(argstr='-rbfpointset %d', units='NA', diff --git a/nipype/interfaces/camino/tests/test_auto_SFLUTGen.py b/nipype/interfaces/camino/tests/test_auto_SFLUTGen.py index 6d59c40c3e..5b2811235d 100644 --- a/nipype/interfaces/camino/tests/test_auto_SFLUTGen.py +++ b/nipype/interfaces/camino/tests/test_auto_SFLUTGen.py @@ -30,8 +30,8 @@ def test_SFLUTGen_inputs(): units='NA', ), out_file=dict(argstr='> %s', - genfile=True, position=-1, + usedefault=True, ), outputstem=dict(argstr='-outputstem %s', usedefault=True, diff --git a/nipype/interfaces/camino/tests/test_auto_SFPICOCalibData.py b/nipype/interfaces/camino/tests/test_auto_SFPICOCalibData.py index 4adfe50709..e187704b71 100644 --- a/nipype/interfaces/camino/tests/test_auto_SFPICOCalibData.py +++ b/nipype/interfaces/camino/tests/test_auto_SFPICOCalibData.py @@ -24,8 +24,8 @@ def test_SFPICOCalibData_inputs(): units='NA', ), out_file=dict(argstr='> %s', - genfile=True, position=-1, + usedefault=True, ), scheme_file=dict(argstr='-schemefile %s', mandatory=True, diff --git a/nipype/interfaces/camino/tests/test_auto_SFPeaks.py b/nipype/interfaces/camino/tests/test_auto_SFPeaks.py index 69c85404c1..632547c793 100644 --- a/nipype/interfaces/camino/tests/test_auto_SFPeaks.py +++ b/nipype/interfaces/camino/tests/test_auto_SFPeaks.py @@ -33,8 +33,8 @@ def test_SFPeaks_inputs(): units='NA', ), out_file=dict(argstr='> %s', - genfile=True, position=-1, + usedefault=True, ), pdthresh=dict(argstr='-pdthresh %f', units='NA', diff --git a/nipype/interfaces/camino/tests/test_auto_Shredder.py b/nipype/interfaces/camino/tests/test_auto_Shredder.py index 7f36415c0c..347daf4e14 100644 --- a/nipype/interfaces/camino/tests/test_auto_Shredder.py +++ b/nipype/interfaces/camino/tests/test_auto_Shredder.py @@ -25,8 +25,8 @@ def test_Shredder_inputs(): units='NA', ), out_file=dict(argstr='> %s', - genfile=True, position=-1, + usedefault=True, ), space=dict(argstr='%d', position=3, diff --git a/nipype/interfaces/camino/tests/test_auto_TractShredder.py b/nipype/interfaces/camino/tests/test_auto_TractShredder.py index d18ec2e9ca..91286e9b64 100644 --- a/nipype/interfaces/camino/tests/test_auto_TractShredder.py +++ b/nipype/interfaces/camino/tests/test_auto_TractShredder.py @@ -25,8 +25,8 @@ def test_TractShredder_inputs(): units='NA', ), out_file=dict(argstr='> %s', - genfile=True, position=-1, + usedefault=True, ), space=dict(argstr='%d', position=3, diff --git a/nipype/interfaces/camino/tests/test_auto_VtkStreamlines.py b/nipype/interfaces/camino/tests/test_auto_VtkStreamlines.py index 805f4709cb..68b16ea128 100644 --- a/nipype/interfaces/camino/tests/test_auto_VtkStreamlines.py +++ b/nipype/interfaces/camino/tests/test_auto_VtkStreamlines.py @@ -26,8 +26,8 @@ def test_VtkStreamlines_inputs(): interpolatescalars=dict(argstr='-interpolatescalars', ), out_file=dict(argstr='> %s', - genfile=True, position=-1, + usedefault=True, ), scalar_file=dict(argstr='-scalarfile %s', position=3, diff --git a/nipype/interfaces/dipy/tests/test_auto_DipyBaseInterface.py b/nipype/interfaces/dipy/tests/test_auto_DipyBaseInterface.py index ce3bd17584..cf1a9f0169 100644 --- a/nipype/interfaces/dipy/tests/test_auto_DipyBaseInterface.py +++ b/nipype/interfaces/dipy/tests/test_auto_DipyBaseInterface.py @@ -14,3 +14,11 @@ def test_DipyBaseInterface_inputs(): for metakey, value in list(metadata.items()): yield assert_equal, getattr(inputs.traits()[key], metakey), value + +def test_DipyBaseInterface_outputs(): + output_map = dict() + outputs = DipyBaseInterface.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/dipy/tests/test_auto_DipyDiffusionInterface.py b/nipype/interfaces/dipy/tests/test_auto_DipyDiffusionInterface.py index e785433355..287b1720e6 100644 --- a/nipype/interfaces/dipy/tests/test_auto_DipyDiffusionInterface.py +++ b/nipype/interfaces/dipy/tests/test_auto_DipyDiffusionInterface.py @@ -23,3 +23,11 @@ def test_DipyDiffusionInterface_inputs(): for metakey, value in list(metadata.items()): yield assert_equal, getattr(inputs.traits()[key], metakey), value + +def test_DipyDiffusionInterface_outputs(): + output_map = dict() + outputs = DipyDiffusionInterface.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/freesurfer/tests/test_auto_DICOMConvert.py b/nipype/interfaces/freesurfer/tests/test_auto_DICOMConvert.py index 1551f3e44c..102c4e6dd9 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_DICOMConvert.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_DICOMConvert.py @@ -37,3 +37,11 @@ def test_DICOMConvert_inputs(): for metakey, value in list(metadata.items()): yield assert_equal, getattr(inputs.traits()[key], metakey), value + +def test_DICOMConvert_outputs(): + output_map = dict() + outputs = DICOMConvert.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/freesurfer/tests/test_auto_FSCommand.py b/nipype/interfaces/freesurfer/tests/test_auto_FSCommand.py index f463310c33..77f1b3b5ad 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_FSCommand.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_FSCommand.py @@ -22,3 +22,11 @@ def test_FSCommand_inputs(): for metakey, value in list(metadata.items()): yield assert_equal, getattr(inputs.traits()[key], metakey), value + +def test_FSCommand_outputs(): + output_map = dict() + outputs = FSCommand.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/freesurfer/tests/test_auto_MRIsConvert.py b/nipype/interfaces/freesurfer/tests/test_auto_MRIsConvert.py index 86c949f645..c7ac846849 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_MRIsConvert.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_MRIsConvert.py @@ -30,10 +30,12 @@ def test_MRIsConvert_inputs(): ), origname=dict(argstr='-o %s', ), - out_datatype=dict(xor=['out_file'], + out_datatype=dict(mandatory=True, + xor=['out_file'], ), out_file=dict(argstr='%s', genfile=True, + mandatory=True, position=-1, xor=['out_datatype'], ), diff --git a/nipype/interfaces/freesurfer/tests/test_auto_UnpackSDICOMDir.py b/nipype/interfaces/freesurfer/tests/test_auto_UnpackSDICOMDir.py index 40e1c65378..366af91387 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_UnpackSDICOMDir.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_UnpackSDICOMDir.py @@ -51,3 +51,11 @@ def test_UnpackSDICOMDir_inputs(): for metakey, value in list(metadata.items()): yield assert_equal, getattr(inputs.traits()[key], metakey), value + +def test_UnpackSDICOMDir_outputs(): + output_map = dict() + outputs = UnpackSDICOMDir.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/fsl/model.py b/nipype/interfaces/fsl/model.py index e62586e375..90c2b4d004 100644 --- a/nipype/interfaces/fsl/model.py +++ b/nipype/interfaces/fsl/model.py @@ -32,7 +32,8 @@ from ...utils.filemanip import (list_to_filename, filename_to_list) from ...utils.misc import human_order_sorted -warn = warnings.warn +from ... import logging +IFLOGGER = logging.getLogger('interface') class Level1DesignInputSpec(BaseInterfaceInputSpec): @@ -407,7 +408,7 @@ def _post_run(self): self.outputs.feat_dir = glob(os.path.join(os.getcwd(), '*ica'))[0] else: self.outputs.feat_dir = glob(os.path.join(os.getcwd(), '*feat'))[0] - print('Outputs from FEATmodel:', outputs) + IFLOGGER.info('Outputs from FEATmodel: %s', self.outputs) class FEATModelInputSpec(FSLCommandInputSpec): @@ -419,8 +420,17 @@ class FEATModelInputSpec(FSLCommandInputSpec): desc="Event spec files generated by level1design", position=1, copyfile=False) + def _format_arg(self, name, trait_spec, value): + if name == 'fsf_file': + return super(FEATModelInputSpec, self)._format_arg( + name, trait_spec, self._get_design_root(value)) + elif name == 'ev_files': + return '' + else: + return super(FEATModelInputSpec, self)._format_arg(name, trait_spec, value) + -class FEATModelOutpuSpec(TraitedSpec): +class FEATModelOutputSpec(TraitedSpec): design_file = File( exists=True, desc='Mat file containing ascii matrix for design') design_image = File( @@ -437,15 +447,7 @@ class FEATModel(FSLCommand): """ _cmd = 'feat_model' input_spec = FEATModelInputSpec - output_spec = FEATModelOutpuSpec - - def _format_arg(self, name, trait_spec, value): - if name == 'fsf_file': - return super(FEATModel, self)._format_arg(name, trait_spec, self._get_design_root(value)) - elif name == 'ev_files': - return '' - else: - return super(FEATModel, self)._format_arg(name, trait_spec, value) + output_spec = FEATModelOutputSpec def _get_design_root(self, infile): _, fname = os.path.split(infile) @@ -1307,19 +1309,19 @@ def _run_interface(self, runtime): 'design.grp': grp_txt} # write design files - for key, val in list(txt.items()): - if ('fts' in key) and (nfcons == 0): - continue - filename = key.replace('_', '.') - f = open(os.path.join(cwd, filename), 'wt') - f.write(val) - f.close() + with open(os.path.join(cwd, filename), 'wt') as out_file: + for key, val in list(txt.items()): + if ('fts' in key) and (nfcons == 0): + continue + filename = key.replace('_', '.') + + out_file.write(val) return runtime def _post_run(self): nfcons = sum([1 for con in self.inputs.contrasts if con[1] == 'F']) - for field in list(outputs.keys()): + for field, _ in list(self.outputs.items()): if ('fts' in field) and (nfcons == 0): continue setattr(self.outputs, field, os.path.join(os.getcwd(), field.replace('_', '.'))) @@ -1600,6 +1602,15 @@ class ClusterInputSpec(FSLCommandInputSpec): warpfield_file = File(argstr='--warpvol=%s', desc='file contining warpfield') + def _format_arg(self, name, spec, value): + if name in list(self.filemap.keys()): + if isinstance(value, bool): + fname = self._list_outputs()[name[4:]] + else: + fname = value + return spec.argstr % fname + return super(ClusterInputSpec, self)._format_arg(name, spec, value) + class ClusterOutputSpec(TraitedSpec): index_file = File(desc='output of cluster index (in size order)') @@ -1653,15 +1664,6 @@ def _post_run(self): else: setattr(self.outputs, outkey, os.path.abspath(inval)) - def _format_arg(self, name, spec, value): - if name in list(self.filemap.keys()): - if isinstance(value, bool): - fname = self._list_outputs()[name[4:]] - else: - fname = value - return spec.argstr % fname - return super(Cluster, self)._format_arg(name, spec, value) - class RandomiseInputSpec(FSLCommandInputSpec): in_file = File(exists=True, desc='4D input file', argstr='-i %s', diff --git a/nipype/interfaces/fsl/tests/test_auto_ApplyMask.py b/nipype/interfaces/fsl/tests/test_auto_ApplyMask.py index d374567662..d69086641d 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ApplyMask.py +++ b/nipype/interfaces/fsl/tests/test_auto_ApplyMask.py @@ -34,7 +34,8 @@ def test_ApplyMask_inputs(): output_datatype=dict(argstr='-odt %s', position=-1, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_ApplyTOPUP.py b/nipype/interfaces/fsl/tests/test_auto_ApplyTOPUP.py index 77a11e3232..5ad4aa766d 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ApplyTOPUP.py +++ b/nipype/interfaces/fsl/tests/test_auto_ApplyTOPUP.py @@ -40,7 +40,8 @@ def test_ApplyTOPUP_inputs(): name_source=['in_files'], name_template='%s_corrected', ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_ApplyWarp.py b/nipype/interfaces/fsl/tests/test_auto_ApplyWarp.py index 47e2703cb6..3a62d1c873 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ApplyWarp.py +++ b/nipype/interfaces/fsl/tests/test_auto_ApplyWarp.py @@ -33,7 +33,8 @@ def test_ApplyWarp_inputs(): hash_files=False, position=2, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), postmat=dict(argstr='--postmat=%s', ), premat=dict(argstr='--premat=%s', diff --git a/nipype/interfaces/fsl/tests/test_auto_ApplyXfm.py b/nipype/interfaces/fsl/tests/test_auto_ApplyXfm.py index 897d6478ed..b5ee6dcf7b 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ApplyXfm.py +++ b/nipype/interfaces/fsl/tests/test_auto_ApplyXfm.py @@ -97,7 +97,8 @@ def test_ApplyXfm_inputs(): name_template='%s_flirt.mat', position=3, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), padding_size=dict(argstr='-paddingsize %d', units='voxels', ), diff --git a/nipype/interfaces/fsl/tests/test_auto_AvScale.py b/nipype/interfaces/fsl/tests/test_auto_AvScale.py index 0d750ddbc0..1ff5de7fe3 100644 --- a/nipype/interfaces/fsl/tests/test_auto_AvScale.py +++ b/nipype/interfaces/fsl/tests/test_auto_AvScale.py @@ -15,7 +15,8 @@ def test_AvScale_inputs(): mat_file=dict(argstr='%s', position=0, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX4.py b/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX4.py index ca71395c20..83fe61490b 100644 --- a/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX4.py +++ b/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX4.py @@ -65,7 +65,8 @@ def test_BEDPOSTX4_inputs(): non_linear=dict(argstr='--nonlinear', xor=('no_spat', 'non_linear'), ), - output_type=dict(), + output_type=dict(usedefault=True, + ), sample_every=dict(argstr='--sampleevery=%d', ), sampling=dict(argstr='-s %d', diff --git a/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX5.py b/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX5.py index 48f229eabd..9b941413b0 100644 --- a/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX5.py +++ b/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX5.py @@ -67,7 +67,8 @@ def test_BEDPOSTX5_inputs(): position=1, usedefault=True, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), rician=dict(argstr='--rician', ), sample_every=dict(argstr='-s %d', diff --git a/nipype/interfaces/fsl/tests/test_auto_BET.py b/nipype/interfaces/fsl/tests/test_auto_BET.py index 90a498a43f..427e3e09e2 100644 --- a/nipype/interfaces/fsl/tests/test_auto_BET.py +++ b/nipype/interfaces/fsl/tests/test_auto_BET.py @@ -38,7 +38,8 @@ def test_BET_inputs(): ), outline=dict(argstr='-o', ), - output_type=dict(), + output_type=dict(usedefault=True, + ), padding=dict(argstr='-Z', xor=('functional', 'reduce_bias', 'robust', 'padding', 'remove_eyes', 'surfaces', 't2_guided'), ), @@ -77,16 +78,38 @@ def test_BET_inputs(): def test_BET_outputs(): - output_map = dict(inskull_mask_file=dict(), - inskull_mesh_file=dict(), - mask_file=dict(), - meshfile=dict(), + output_map = dict(inskull_mask_file=dict(name_source='in_file', + name_template='%s_inskull_mask', + ), + inskull_mesh_file=dict(keep_extension=False, + name_source='in_file', + name_template='%s_inskull_mesh.vtk', + ), + mask_file=dict(name_source='in_file', + name_template='%s_mask', + ), + meshfile=dict(keep_extension=False, + name_source='in_file', + name_template='%s_mesh.vtk', + ), out_file=dict(), - outline_file=dict(), - outskin_mask_file=dict(), - outskin_mesh_file=dict(), - outskull_mask_file=dict(), - outskull_mesh_file=dict(), + outline_file=dict(name_source='in_file', + name_template='%s_overlay', + ), + outskin_mask_file=dict(name_source='in_file', + name_template='%s_outskin_mask', + ), + outskin_mesh_file=dict(keep_extension=False, + name_source='in_file', + name_template='%s_outskin_mesh.vtk', + ), + outskull_mask_file=dict(name_source='in_file', + name_template='%s_outskull_mask', + ), + outskull_mesh_file=dict(keep_extension=False, + name_source='in_file', + name_template='%s_outskull_mesh.vtk', + ), skull_mask_file=dict(), ) outputs = BET.output_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_BinaryMaths.py b/nipype/interfaces/fsl/tests/test_auto_BinaryMaths.py index dfc8dcec09..8d55795fc0 100644 --- a/nipype/interfaces/fsl/tests/test_auto_BinaryMaths.py +++ b/nipype/interfaces/fsl/tests/test_auto_BinaryMaths.py @@ -44,7 +44,8 @@ def test_BinaryMaths_inputs(): output_datatype=dict(argstr='-odt %s', position=-1, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_ChangeDataType.py b/nipype/interfaces/fsl/tests/test_auto_ChangeDataType.py index 4de7103895..9cf46c3704 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ChangeDataType.py +++ b/nipype/interfaces/fsl/tests/test_auto_ChangeDataType.py @@ -31,7 +31,8 @@ def test_ChangeDataType_inputs(): mandatory=True, position=-1, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_Cluster.py b/nipype/interfaces/fsl/tests/test_auto_Cluster.py index 7b460a5fd6..7b380dd066 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Cluster.py +++ b/nipype/interfaces/fsl/tests/test_auto_Cluster.py @@ -52,7 +52,8 @@ def test_Cluster_inputs(): out_threshold_file=dict(argstr='--othresh=%s', hash_files=False, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), peak_distance=dict(argstr='--peakdist=%.10f', ), pthreshold=dict(argstr='--pthresh=%.10f', diff --git a/nipype/interfaces/fsl/tests/test_auto_Complex.py b/nipype/interfaces/fsl/tests/test_auto_Complex.py index eae95be846..67d448de7e 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Complex.py +++ b/nipype/interfaces/fsl/tests/test_auto_Complex.py @@ -58,7 +58,8 @@ def test_Complex_inputs(): position=-4, xor=['complex_out_file', 'real_out_file', 'imaginary_out_file', 'real_cartesian', 'complex_cartesian', 'complex_polar', 'complex_split', 'complex_merge'], ), - output_type=dict(), + output_type=dict(usedefault=True, + ), phase_in_file=dict(argstr='%s', position=3, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_ContrastMgr.py b/nipype/interfaces/fsl/tests/test_auto_ContrastMgr.py index 361f9cd086..add2dc41d9 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ContrastMgr.py +++ b/nipype/interfaces/fsl/tests/test_auto_ContrastMgr.py @@ -23,7 +23,8 @@ def test_ContrastMgr_inputs(): ignore_exception=dict(nohash=True, usedefault=True, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), param_estimates=dict(argstr='', copyfile=False, mandatory=True, diff --git a/nipype/interfaces/fsl/tests/test_auto_ConvertWarp.py b/nipype/interfaces/fsl/tests/test_auto_ConvertWarp.py index d140396548..00e49ab1b8 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ConvertWarp.py +++ b/nipype/interfaces/fsl/tests/test_auto_ConvertWarp.py @@ -35,7 +35,8 @@ def test_ConvertWarp_inputs(): out_relwarp=dict(argstr='--relout', xor=['out_abswarp'], ), - output_type=dict(), + output_type=dict(usedefault=True, + ), postmat=dict(argstr='--postmat=%s', ), premat=dict(argstr='--premat=%s', diff --git a/nipype/interfaces/fsl/tests/test_auto_ConvertXFM.py b/nipype/interfaces/fsl/tests/test_auto_ConvertXFM.py index 21bfe5ff1c..7653189e3b 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ConvertXFM.py +++ b/nipype/interfaces/fsl/tests/test_auto_ConvertXFM.py @@ -38,7 +38,8 @@ def test_ConvertXFM_inputs(): hash_files=False, position=1, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_CopyGeom.py b/nipype/interfaces/fsl/tests/test_auto_CopyGeom.py index 75e58ee331..6c56a28cff 100644 --- a/nipype/interfaces/fsl/tests/test_auto_CopyGeom.py +++ b/nipype/interfaces/fsl/tests/test_auto_CopyGeom.py @@ -27,7 +27,8 @@ def test_CopyGeom_inputs(): mandatory=True, position=0, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_DTIFit.py b/nipype/interfaces/fsl/tests/test_auto_DTIFit.py index 803a78b930..47727bf97b 100644 --- a/nipype/interfaces/fsl/tests/test_auto_DTIFit.py +++ b/nipype/interfaces/fsl/tests/test_auto_DTIFit.py @@ -50,8 +50,10 @@ def test_DTIFit_inputs(): ), min_z=dict(argstr='-z %d', ), - output_type=dict(), + output_type=dict(usedefault=True, + ), save_tensor=dict(argstr='--save_tensor', + usedefault=True, ), sse=dict(argstr='--sse', ), @@ -66,17 +68,39 @@ def test_DTIFit_inputs(): def test_DTIFit_outputs(): - output_map = dict(FA=dict(), - L1=dict(), - L2=dict(), - L3=dict(), - MD=dict(), - MO=dict(), - S0=dict(), - V1=dict(), - V2=dict(), - V3=dict(), - tensor=dict(), + output_map = dict(out_fa=dict(name_source='base_name', + name_template='%s_FA', + ), + out_l1=dict(name_source='base_name', + name_template='%s_L1', + ), + out_l2=dict(name_source='base_name', + name_template='%s_L2', + ), + out_l3=dict(name_source='base_name', + name_template='%s_L3', + ), + out_md=dict(name_source='base_name', + name_template='%s_MD', + ), + out_mo=dict(name_source='base_name', + name_template='%s_MO', + ), + out_s0=dict(name_source='base_name', + name_template='%s_S0', + ), + out_v1=dict(name_source='base_name', + name_template='%s_V1', + ), + out_v2=dict(name_source='base_name', + name_template='%s_V2', + ), + out_v3=dict(name_source='base_name', + name_template='%s_V3', + ), + tensor=dict(name_source='base_name', + name_template='%s_tensor', + ), ) outputs = DTIFit.output_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_DilateImage.py b/nipype/interfaces/fsl/tests/test_auto_DilateImage.py index 7c0f3e9823..93352f4bd8 100644 --- a/nipype/interfaces/fsl/tests/test_auto_DilateImage.py +++ b/nipype/interfaces/fsl/tests/test_auto_DilateImage.py @@ -45,7 +45,8 @@ def test_DilateImage_inputs(): output_datatype=dict(argstr='-odt %s', position=-1, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_DistanceMap.py b/nipype/interfaces/fsl/tests/test_auto_DistanceMap.py index 083590ed5d..ee72ba05dc 100644 --- a/nipype/interfaces/fsl/tests/test_auto_DistanceMap.py +++ b/nipype/interfaces/fsl/tests/test_auto_DistanceMap.py @@ -26,7 +26,8 @@ def test_DistanceMap_inputs(): ), mask_file=dict(argstr='--mask=%s', ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_EPIDeWarp.py b/nipype/interfaces/fsl/tests/test_auto_EPIDeWarp.py index 2f1eaf2522..38ff561c6e 100644 --- a/nipype/interfaces/fsl/tests/test_auto_EPIDeWarp.py +++ b/nipype/interfaces/fsl/tests/test_auto_EPIDeWarp.py @@ -37,7 +37,8 @@ def test_EPIDeWarp_inputs(): nocleanup=dict(argstr='--nocleanup', usedefault=True, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), sigma=dict(argstr='--sigma %s', usedefault=True, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_Eddy.py b/nipype/interfaces/fsl/tests/test_auto_Eddy.py index 07b17244c9..727b6cb8ed 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Eddy.py +++ b/nipype/interfaces/fsl/tests/test_auto_Eddy.py @@ -49,7 +49,8 @@ def test_Eddy_inputs(): out_base=dict(argstr='--out=%s', usedefault=True, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), repol=dict(argstr='--repol', ), session=dict(argstr='--session=%s', diff --git a/nipype/interfaces/fsl/tests/test_auto_EddyCorrect.py b/nipype/interfaces/fsl/tests/test_auto_EddyCorrect.py index b7f93f0b52..a1091313e9 100644 --- a/nipype/interfaces/fsl/tests/test_auto_EddyCorrect.py +++ b/nipype/interfaces/fsl/tests/test_auto_EddyCorrect.py @@ -22,7 +22,8 @@ def test_EddyCorrect_inputs(): output_name='eddy_corrected', position=1, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), ref_num=dict(argstr='%d', mandatory=True, position=2, diff --git a/nipype/interfaces/fsl/tests/test_auto_EpiReg.py b/nipype/interfaces/fsl/tests/test_auto_EpiReg.py index 10014e521a..cfeefa30a8 100644 --- a/nipype/interfaces/fsl/tests/test_auto_EpiReg.py +++ b/nipype/interfaces/fsl/tests/test_auto_EpiReg.py @@ -33,7 +33,8 @@ def test_EpiReg_inputs(): position=-1, usedefault=True, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), pedir=dict(argstr='--pedir=%s', ), t1_brain=dict(argstr='--t1brain=%s', diff --git a/nipype/interfaces/fsl/tests/test_auto_ErodeImage.py b/nipype/interfaces/fsl/tests/test_auto_ErodeImage.py index 3981afc1a5..e7db3aca70 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ErodeImage.py +++ b/nipype/interfaces/fsl/tests/test_auto_ErodeImage.py @@ -45,7 +45,8 @@ def test_ErodeImage_inputs(): output_datatype=dict(argstr='-odt %s', position=-1, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_ExtractROI.py b/nipype/interfaces/fsl/tests/test_auto_ExtractROI.py index 4368a41256..edf17e9225 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ExtractROI.py +++ b/nipype/interfaces/fsl/tests/test_auto_ExtractROI.py @@ -20,7 +20,8 @@ def test_ExtractROI_inputs(): mandatory=True, position=0, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), roi_file=dict(argstr='%s', genfile=True, hash_files=False, diff --git a/nipype/interfaces/fsl/tests/test_auto_FAST.py b/nipype/interfaces/fsl/tests/test_auto_FAST.py index 3dc8ca73f2..4f88c5724b 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FAST.py +++ b/nipype/interfaces/fsl/tests/test_auto_FAST.py @@ -50,7 +50,8 @@ def test_FAST_inputs(): ), output_biasfield=dict(argstr='-b', ), - output_type=dict(), + output_type=dict(usedefault=True, + ), probability_maps=dict(argstr='-p', ), segment_iters=dict(argstr='-W %d', diff --git a/nipype/interfaces/fsl/tests/test_auto_FEAT.py b/nipype/interfaces/fsl/tests/test_auto_FEAT.py index 8500302502..a6ebeb9d08 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FEAT.py +++ b/nipype/interfaces/fsl/tests/test_auto_FEAT.py @@ -16,7 +16,8 @@ def test_FEAT_inputs(): ignore_exception=dict(nohash=True, usedefault=True, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_FEATModel.py b/nipype/interfaces/fsl/tests/test_auto_FEATModel.py index 06cbe57d84..ca076465d6 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FEATModel.py +++ b/nipype/interfaces/fsl/tests/test_auto_FEATModel.py @@ -22,7 +22,8 @@ def test_FEATModel_inputs(): ignore_exception=dict(nohash=True, usedefault=True, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_FIRST.py b/nipype/interfaces/fsl/tests/test_auto_FIRST.py index 876f89f5b6..6ad2da8452 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FIRST.py +++ b/nipype/interfaces/fsl/tests/test_auto_FIRST.py @@ -44,7 +44,8 @@ def test_FIRST_inputs(): position=-1, usedefault=True, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), verbose=dict(argstr='-v', diff --git a/nipype/interfaces/fsl/tests/test_auto_FLAMEO.py b/nipype/interfaces/fsl/tests/test_auto_FLAMEO.py index bd4d938ffb..e93e1d08f0 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FLAMEO.py +++ b/nipype/interfaces/fsl/tests/test_auto_FLAMEO.py @@ -43,7 +43,8 @@ def test_FLAMEO_inputs(): ), outlier_iter=dict(argstr='--ioni=%d', ), - output_type=dict(), + output_type=dict(usedefault=True, + ), run_mode=dict(argstr='--runmode=%s', mandatory=True, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_FLIRT.py b/nipype/interfaces/fsl/tests/test_auto_FLIRT.py index 8bba532da8..e5d56fda1d 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FLIRT.py +++ b/nipype/interfaces/fsl/tests/test_auto_FLIRT.py @@ -96,7 +96,8 @@ def test_FLIRT_inputs(): name_template='%s_flirt.mat', position=3, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), padding_size=dict(argstr='-paddingsize %d', units='voxels', ), diff --git a/nipype/interfaces/fsl/tests/test_auto_FNIRT.py b/nipype/interfaces/fsl/tests/test_auto_FNIRT.py index f37e3b7eb2..83bd3b300b 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FNIRT.py +++ b/nipype/interfaces/fsl/tests/test_auto_FNIRT.py @@ -77,7 +77,8 @@ def test_FNIRT_inputs(): out_intensitymap_file=dict(argstr='--intout=%s', hash_files=False, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), ref_file=dict(argstr='--ref=%s', mandatory=True, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_FSLCommand.py b/nipype/interfaces/fsl/tests/test_auto_FSLCommand.py index c5b0bb63a2..df99aef52d 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FSLCommand.py +++ b/nipype/interfaces/fsl/tests/test_auto_FSLCommand.py @@ -12,7 +12,8 @@ def test_FSLCommand_inputs(): ignore_exception=dict(nohash=True, usedefault=True, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) @@ -22,3 +23,11 @@ def test_FSLCommand_inputs(): for metakey, value in list(metadata.items()): yield assert_equal, getattr(inputs.traits()[key], metakey), value + +def test_FSLCommand_outputs(): + output_map = dict() + outputs = FSLCommand.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/fsl/tests/test_auto_FSLXCommand.py b/nipype/interfaces/fsl/tests/test_auto_FSLXCommand.py index 57b06760d5..2f53eae322 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FSLXCommand.py +++ b/nipype/interfaces/fsl/tests/test_auto_FSLXCommand.py @@ -65,7 +65,8 @@ def test_FSLXCommand_inputs(): non_linear=dict(argstr='--nonlinear', xor=('no_spat', 'non_linear', 'cnlinear'), ), - output_type=dict(), + output_type=dict(usedefault=True, + ), rician=dict(argstr='--rician', ), sample_every=dict(argstr='--sampleevery=%d', diff --git a/nipype/interfaces/fsl/tests/test_auto_FUGUE.py b/nipype/interfaces/fsl/tests/test_auto_FUGUE.py index 84de7126df..657da0bd0c 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FUGUE.py +++ b/nipype/interfaces/fsl/tests/test_auto_FUGUE.py @@ -48,7 +48,8 @@ def test_FUGUE_inputs(): ), nokspace=dict(argstr='--nokspace', ), - output_type=dict(), + output_type=dict(usedefault=True, + ), pava=dict(argstr='--pava', ), phase_conjugate=dict(argstr='--phaseconj', diff --git a/nipype/interfaces/fsl/tests/test_auto_FilterRegressor.py b/nipype/interfaces/fsl/tests/test_auto_FilterRegressor.py index 2904b70798..a28e89fb25 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FilterRegressor.py +++ b/nipype/interfaces/fsl/tests/test_auto_FilterRegressor.py @@ -39,7 +39,8 @@ def test_FilterRegressor_inputs(): ), out_vnscales=dict(argstr='--out_vnscales', ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), var_norm=dict(argstr='--vn', diff --git a/nipype/interfaces/fsl/tests/test_auto_FindTheBiggest.py b/nipype/interfaces/fsl/tests/test_auto_FindTheBiggest.py index 0fd902dbf0..46d13ddf9e 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FindTheBiggest.py +++ b/nipype/interfaces/fsl/tests/test_auto_FindTheBiggest.py @@ -21,7 +21,8 @@ def test_FindTheBiggest_inputs(): hash_files=False, position=2, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_GLM.py b/nipype/interfaces/fsl/tests/test_auto_GLM.py index 3aeef972c0..fc14205028 100644 --- a/nipype/interfaces/fsl/tests/test_auto_GLM.py +++ b/nipype/interfaces/fsl/tests/test_auto_GLM.py @@ -60,7 +60,8 @@ def test_GLM_inputs(): ), out_z_name=dict(argstr='--out_z=%s', ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), var_norm=dict(argstr='--vn', diff --git a/nipype/interfaces/fsl/tests/test_auto_ImageMaths.py b/nipype/interfaces/fsl/tests/test_auto_ImageMaths.py index 008516f571..bc9a9670e2 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ImageMaths.py +++ b/nipype/interfaces/fsl/tests/test_auto_ImageMaths.py @@ -30,7 +30,8 @@ def test_ImageMaths_inputs(): hash_files=False, position=4, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), suffix=dict(), terminal_output=dict(nohash=True, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_ImageMeants.py b/nipype/interfaces/fsl/tests/test_auto_ImageMeants.py index 2a07ee64f0..58e2b57dc8 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ImageMeants.py +++ b/nipype/interfaces/fsl/tests/test_auto_ImageMeants.py @@ -29,7 +29,8 @@ def test_ImageMeants_inputs(): genfile=True, hash_files=False, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), show_all=dict(argstr='--showall', ), spatial_coord=dict(argstr='-c %s', diff --git a/nipype/interfaces/fsl/tests/test_auto_ImageStats.py b/nipype/interfaces/fsl/tests/test_auto_ImageStats.py index 86be9772c4..aea8533e56 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ImageStats.py +++ b/nipype/interfaces/fsl/tests/test_auto_ImageStats.py @@ -22,7 +22,8 @@ def test_ImageStats_inputs(): mandatory=True, position=3, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), split_4d=dict(argstr='-t', position=1, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_InvWarp.py b/nipype/interfaces/fsl/tests/test_auto_InvWarp.py index ad367bf904..bd29137d3f 100644 --- a/nipype/interfaces/fsl/tests/test_auto_InvWarp.py +++ b/nipype/interfaces/fsl/tests/test_auto_InvWarp.py @@ -28,7 +28,8 @@ def test_InvWarp_inputs(): ), noconstraint=dict(argstr='--noconstraint', ), - output_type=dict(), + output_type=dict(usedefault=True, + ), reference=dict(argstr='--ref=%s', mandatory=True, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_IsotropicSmooth.py b/nipype/interfaces/fsl/tests/test_auto_IsotropicSmooth.py index 2d1023d674..b96935037e 100644 --- a/nipype/interfaces/fsl/tests/test_auto_IsotropicSmooth.py +++ b/nipype/interfaces/fsl/tests/test_auto_IsotropicSmooth.py @@ -35,7 +35,8 @@ def test_IsotropicSmooth_inputs(): output_datatype=dict(argstr='-odt %s', position=-1, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), sigma=dict(argstr='-s %.5f', mandatory=True, position=4, diff --git a/nipype/interfaces/fsl/tests/test_auto_MCFLIRT.py b/nipype/interfaces/fsl/tests/test_auto_MCFLIRT.py index 355c9ab527..88c7a5e079 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MCFLIRT.py +++ b/nipype/interfaces/fsl/tests/test_auto_MCFLIRT.py @@ -32,7 +32,8 @@ def test_MCFLIRT_inputs(): genfile=True, hash_files=False, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), ref_file=dict(argstr='-reffile %s', ), ref_vol=dict(argstr='-refvol %d', diff --git a/nipype/interfaces/fsl/tests/test_auto_MELODIC.py b/nipype/interfaces/fsl/tests/test_auto_MELODIC.py index 3f4c0047ca..dbfb447911 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MELODIC.py +++ b/nipype/interfaces/fsl/tests/test_auto_MELODIC.py @@ -74,7 +74,8 @@ def test_MELODIC_inputs(): ), out_white=dict(argstr='--Owhite', ), - output_type=dict(), + output_type=dict(usedefault=True, + ), pbsc=dict(argstr='--pbsc', ), rem_cmp=dict(argstr='-f %d', diff --git a/nipype/interfaces/fsl/tests/test_auto_MakeDyadicVectors.py b/nipype/interfaces/fsl/tests/test_auto_MakeDyadicVectors.py index cbc35e34c9..3d42ba2ec2 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MakeDyadicVectors.py +++ b/nipype/interfaces/fsl/tests/test_auto_MakeDyadicVectors.py @@ -20,7 +20,8 @@ def test_MakeDyadicVectors_inputs(): position=3, usedefault=True, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), perc=dict(argstr='%f', position=4, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_MathsCommand.py b/nipype/interfaces/fsl/tests/test_auto_MathsCommand.py index 3c3eee3d14..7608c9ce3f 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MathsCommand.py +++ b/nipype/interfaces/fsl/tests/test_auto_MathsCommand.py @@ -30,7 +30,8 @@ def test_MathsCommand_inputs(): output_datatype=dict(argstr='-odt %s', position=-1, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_MaxImage.py b/nipype/interfaces/fsl/tests/test_auto_MaxImage.py index 4edd2cfb13..6f5520a74f 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MaxImage.py +++ b/nipype/interfaces/fsl/tests/test_auto_MaxImage.py @@ -34,7 +34,8 @@ def test_MaxImage_inputs(): output_datatype=dict(argstr='-odt %s', position=-1, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_MeanImage.py b/nipype/interfaces/fsl/tests/test_auto_MeanImage.py index f6792d368d..fa3127ec9a 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MeanImage.py +++ b/nipype/interfaces/fsl/tests/test_auto_MeanImage.py @@ -34,7 +34,8 @@ def test_MeanImage_inputs(): output_datatype=dict(argstr='-odt %s', position=-1, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_Merge.py b/nipype/interfaces/fsl/tests/test_auto_Merge.py index 621d43dd65..6230c7dc0a 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Merge.py +++ b/nipype/interfaces/fsl/tests/test_auto_Merge.py @@ -26,7 +26,8 @@ def test_Merge_inputs(): name_template='%s_merged', position=1, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), tr=dict(argstr='%.2f', diff --git a/nipype/interfaces/fsl/tests/test_auto_MotionOutliers.py b/nipype/interfaces/fsl/tests/test_auto_MotionOutliers.py index d8d88d809e..0a1d1f0a0c 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MotionOutliers.py +++ b/nipype/interfaces/fsl/tests/test_auto_MotionOutliers.py @@ -41,7 +41,8 @@ def test_MotionOutliers_inputs(): name_source='in_file', name_template='%s_metrics.txt', ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), threshold=dict(argstr='--thresh=%g', diff --git a/nipype/interfaces/fsl/tests/test_auto_MultiImageMaths.py b/nipype/interfaces/fsl/tests/test_auto_MultiImageMaths.py index 91b5f03657..328acd04d6 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MultiImageMaths.py +++ b/nipype/interfaces/fsl/tests/test_auto_MultiImageMaths.py @@ -36,7 +36,8 @@ def test_MultiImageMaths_inputs(): output_datatype=dict(argstr='-odt %s', position=-1, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_Overlay.py b/nipype/interfaces/fsl/tests/test_auto_Overlay.py index 14257803be..4a64710474 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Overlay.py +++ b/nipype/interfaces/fsl/tests/test_auto_Overlay.py @@ -40,7 +40,8 @@ def test_Overlay_inputs(): position=2, usedefault=True, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), show_negative_stats=dict(argstr='%s', position=8, xor=['stat_image2'], diff --git a/nipype/interfaces/fsl/tests/test_auto_PRELUDE.py b/nipype/interfaces/fsl/tests/test_auto_PRELUDE.py index 434322da60..4e60b70dc8 100644 --- a/nipype/interfaces/fsl/tests/test_auto_PRELUDE.py +++ b/nipype/interfaces/fsl/tests/test_auto_PRELUDE.py @@ -31,7 +31,8 @@ def test_PRELUDE_inputs(): ), num_partitions=dict(argstr='--numphasesplit=%d', ), - output_type=dict(), + output_type=dict(usedefault=True, + ), phase_file=dict(argstr='--phase=%s', mandatory=True, xor=['complex_phase_file'], diff --git a/nipype/interfaces/fsl/tests/test_auto_PlotMotionParams.py b/nipype/interfaces/fsl/tests/test_auto_PlotMotionParams.py index 75d376e32e..2b5e981e46 100644 --- a/nipype/interfaces/fsl/tests/test_auto_PlotMotionParams.py +++ b/nipype/interfaces/fsl/tests/test_auto_PlotMotionParams.py @@ -22,7 +22,8 @@ def test_PlotMotionParams_inputs(): genfile=True, hash_files=False, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), plot_size=dict(argstr='%s', ), plot_type=dict(argstr='%s', diff --git a/nipype/interfaces/fsl/tests/test_auto_PlotTimeSeries.py b/nipype/interfaces/fsl/tests/test_auto_PlotTimeSeries.py index e8c28c68de..e48a6bae01 100644 --- a/nipype/interfaces/fsl/tests/test_auto_PlotTimeSeries.py +++ b/nipype/interfaces/fsl/tests/test_auto_PlotTimeSeries.py @@ -24,7 +24,8 @@ def test_PlotTimeSeries_inputs(): genfile=True, hash_files=False, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), plot_finish=dict(argstr='--finish=%d', xor=('plot_range',), ), diff --git a/nipype/interfaces/fsl/tests/test_auto_PowerSpectrum.py b/nipype/interfaces/fsl/tests/test_auto_PowerSpectrum.py index bacda34c21..8df00e2afc 100644 --- a/nipype/interfaces/fsl/tests/test_auto_PowerSpectrum.py +++ b/nipype/interfaces/fsl/tests/test_auto_PowerSpectrum.py @@ -21,7 +21,8 @@ def test_PowerSpectrum_inputs(): hash_files=False, position=1, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_PrepareFieldmap.py b/nipype/interfaces/fsl/tests/test_auto_PrepareFieldmap.py index 01aea929dc..42d1c20388 100644 --- a/nipype/interfaces/fsl/tests/test_auto_PrepareFieldmap.py +++ b/nipype/interfaces/fsl/tests/test_auto_PrepareFieldmap.py @@ -32,7 +32,8 @@ def test_PrepareFieldmap_inputs(): out_fieldmap=dict(argstr='%s', position=4, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), scanner=dict(argstr='%s', position=1, usedefault=True, diff --git a/nipype/interfaces/fsl/tests/test_auto_ProbTrackX.py b/nipype/interfaces/fsl/tests/test_auto_ProbTrackX.py index a4b60ff6f6..b890fc5294 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ProbTrackX.py +++ b/nipype/interfaces/fsl/tests/test_auto_ProbTrackX.py @@ -58,7 +58,8 @@ def test_ProbTrackX_inputs(): out_dir=dict(argstr='--dir=%s', genfile=True, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), phsamples=dict(mandatory=True, ), rand_fib=dict(argstr='--randfib=%d', diff --git a/nipype/interfaces/fsl/tests/test_auto_ProbTrackX2.py b/nipype/interfaces/fsl/tests/test_auto_ProbTrackX2.py index df69f76670..967c90788d 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ProbTrackX2.py +++ b/nipype/interfaces/fsl/tests/test_auto_ProbTrackX2.py @@ -75,7 +75,8 @@ def test_ProbTrackX2_inputs(): out_dir=dict(argstr='--dir=%s', genfile=True, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), phsamples=dict(mandatory=True, ), rand_fib=dict(argstr='--randfib=%d', diff --git a/nipype/interfaces/fsl/tests/test_auto_ProjThresh.py b/nipype/interfaces/fsl/tests/test_auto_ProjThresh.py index a8fbd352a9..44fda21420 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ProjThresh.py +++ b/nipype/interfaces/fsl/tests/test_auto_ProjThresh.py @@ -16,7 +16,8 @@ def test_ProjThresh_inputs(): mandatory=True, position=0, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), threshold=dict(argstr='%d', diff --git a/nipype/interfaces/fsl/tests/test_auto_Randomise.py b/nipype/interfaces/fsl/tests/test_auto_Randomise.py index 72a38393fd..46dbce71ff 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Randomise.py +++ b/nipype/interfaces/fsl/tests/test_auto_Randomise.py @@ -43,7 +43,8 @@ def test_Randomise_inputs(): ), one_sample_group_mean=dict(argstr='-1', ), - output_type=dict(), + output_type=dict(usedefault=True, + ), p_vec_n_dist_files=dict(argstr='-P', ), raw_stats_imgs=dict(argstr='-R', diff --git a/nipype/interfaces/fsl/tests/test_auto_Reorient2Std.py b/nipype/interfaces/fsl/tests/test_auto_Reorient2Std.py index 0f252d5d61..eb8c62e295 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Reorient2Std.py +++ b/nipype/interfaces/fsl/tests/test_auto_Reorient2Std.py @@ -19,7 +19,8 @@ def test_Reorient2Std_inputs(): genfile=True, hash_files=False, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_RobustFOV.py b/nipype/interfaces/fsl/tests/test_auto_RobustFOV.py index d28c8845dd..5ed6438faa 100644 --- a/nipype/interfaces/fsl/tests/test_auto_RobustFOV.py +++ b/nipype/interfaces/fsl/tests/test_auto_RobustFOV.py @@ -21,7 +21,8 @@ def test_RobustFOV_inputs(): name_source=['in_file'], name_template='%s_ROI', ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_SMM.py b/nipype/interfaces/fsl/tests/test_auto_SMM.py index b2440eaa7e..4cef44c665 100644 --- a/nipype/interfaces/fsl/tests/test_auto_SMM.py +++ b/nipype/interfaces/fsl/tests/test_auto_SMM.py @@ -20,7 +20,8 @@ def test_SMM_inputs(): no_deactivation_class=dict(argstr='--zfstatmode', position=2, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), spatial_data_file=dict(argstr='--sdf="%s"', copyfile=False, mandatory=True, diff --git a/nipype/interfaces/fsl/tests/test_auto_SUSAN.py b/nipype/interfaces/fsl/tests/test_auto_SUSAN.py index 0b813fc31e..247a062106 100644 --- a/nipype/interfaces/fsl/tests/test_auto_SUSAN.py +++ b/nipype/interfaces/fsl/tests/test_auto_SUSAN.py @@ -33,7 +33,8 @@ def test_SUSAN_inputs(): hash_files=False, position=-1, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), usans=dict(argstr='', diff --git a/nipype/interfaces/fsl/tests/test_auto_SigLoss.py b/nipype/interfaces/fsl/tests/test_auto_SigLoss.py index e42dc4ba88..237246c252 100644 --- a/nipype/interfaces/fsl/tests/test_auto_SigLoss.py +++ b/nipype/interfaces/fsl/tests/test_auto_SigLoss.py @@ -22,7 +22,8 @@ def test_SigLoss_inputs(): out_file=dict(argstr='-s %s', genfile=True, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), slice_direction=dict(argstr='-d %s', ), terminal_output=dict(nohash=True, diff --git a/nipype/interfaces/fsl/tests/test_auto_SliceTimer.py b/nipype/interfaces/fsl/tests/test_auto_SliceTimer.py index c02b80cf3b..b4c91745ba 100644 --- a/nipype/interfaces/fsl/tests/test_auto_SliceTimer.py +++ b/nipype/interfaces/fsl/tests/test_auto_SliceTimer.py @@ -30,7 +30,8 @@ def test_SliceTimer_inputs(): genfile=True, hash_files=False, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), slice_direction=dict(argstr='--direction=%d', ), terminal_output=dict(nohash=True, diff --git a/nipype/interfaces/fsl/tests/test_auto_Slicer.py b/nipype/interfaces/fsl/tests/test_auto_Slicer.py index edcaafaa30..b92c161eda 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Slicer.py +++ b/nipype/interfaces/fsl/tests/test_auto_Slicer.py @@ -52,7 +52,8 @@ def test_Slicer_inputs(): hash_files=False, position=-1, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), sample_axial=dict(argstr='-S %d', position=10, requires=['image_width'], diff --git a/nipype/interfaces/fsl/tests/test_auto_Smooth.py b/nipype/interfaces/fsl/tests/test_auto_Smooth.py index f1cebc39d7..dff30c3a26 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Smooth.py +++ b/nipype/interfaces/fsl/tests/test_auto_Smooth.py @@ -21,7 +21,8 @@ def test_Smooth_inputs(): mandatory=True, position=0, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), sigma=dict(argstr='-kernel gauss %.03f -fmean', mandatory=True, position=1, diff --git a/nipype/interfaces/fsl/tests/test_auto_SmoothEstimate.py b/nipype/interfaces/fsl/tests/test_auto_SmoothEstimate.py index 5c3f8c46b0..d703e308ed 100644 --- a/nipype/interfaces/fsl/tests/test_auto_SmoothEstimate.py +++ b/nipype/interfaces/fsl/tests/test_auto_SmoothEstimate.py @@ -19,7 +19,8 @@ def test_SmoothEstimate_inputs(): mask_file=dict(argstr='--mask=%s', mandatory=True, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), residual_fit_file=dict(argstr='--res=%s', requires=['dof'], ), diff --git a/nipype/interfaces/fsl/tests/test_auto_SpatialFilter.py b/nipype/interfaces/fsl/tests/test_auto_SpatialFilter.py index ab605fed0b..5b232a50b8 100644 --- a/nipype/interfaces/fsl/tests/test_auto_SpatialFilter.py +++ b/nipype/interfaces/fsl/tests/test_auto_SpatialFilter.py @@ -45,7 +45,8 @@ def test_SpatialFilter_inputs(): output_datatype=dict(argstr='-odt %s', position=-1, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_Split.py b/nipype/interfaces/fsl/tests/test_auto_Split.py index a7469eca48..d889d8678f 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Split.py +++ b/nipype/interfaces/fsl/tests/test_auto_Split.py @@ -23,7 +23,8 @@ def test_Split_inputs(): out_base_name=dict(argstr='%s', position=1, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_SwapDimensions.py b/nipype/interfaces/fsl/tests/test_auto_SwapDimensions.py index 60dd31a304..8a1165062c 100644 --- a/nipype/interfaces/fsl/tests/test_auto_SwapDimensions.py +++ b/nipype/interfaces/fsl/tests/test_auto_SwapDimensions.py @@ -23,7 +23,8 @@ def test_SwapDimensions_inputs(): genfile=True, hash_files=False, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_TOPUP.py b/nipype/interfaces/fsl/tests/test_auto_TOPUP.py index 3e097b26ab..5661248c5f 100644 --- a/nipype/interfaces/fsl/tests/test_auto_TOPUP.py +++ b/nipype/interfaces/fsl/tests/test_auto_TOPUP.py @@ -60,7 +60,8 @@ def test_TOPUP_inputs(): name_source=['in_file'], name_template='%s_topup.log', ), - output_type=dict(), + output_type=dict(usedefault=True, + ), readout_times=dict(mandatory=True, requires=['encoding_direction'], xor=['encoding_file'], diff --git a/nipype/interfaces/fsl/tests/test_auto_TemporalFilter.py b/nipype/interfaces/fsl/tests/test_auto_TemporalFilter.py index 049af8bd52..f052a4248e 100644 --- a/nipype/interfaces/fsl/tests/test_auto_TemporalFilter.py +++ b/nipype/interfaces/fsl/tests/test_auto_TemporalFilter.py @@ -38,7 +38,8 @@ def test_TemporalFilter_inputs(): output_datatype=dict(argstr='-odt %s', position=-1, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_Threshold.py b/nipype/interfaces/fsl/tests/test_auto_Threshold.py index dfaa3594bb..b778c98d67 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Threshold.py +++ b/nipype/interfaces/fsl/tests/test_auto_Threshold.py @@ -32,7 +32,8 @@ def test_Threshold_inputs(): output_datatype=dict(argstr='-odt %s', position=-1, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), thresh=dict(argstr='%s', diff --git a/nipype/interfaces/fsl/tests/test_auto_TractSkeleton.py b/nipype/interfaces/fsl/tests/test_auto_TractSkeleton.py index 3808504b9d..9fcad4e22c 100644 --- a/nipype/interfaces/fsl/tests/test_auto_TractSkeleton.py +++ b/nipype/interfaces/fsl/tests/test_auto_TractSkeleton.py @@ -21,7 +21,8 @@ def test_TractSkeleton_inputs(): in_file=dict(argstr='-i %s', mandatory=True, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), project_data=dict(argstr='-p %.3f %s %s %s %s', requires=['threshold', 'distance_map', 'data_file'], ), diff --git a/nipype/interfaces/fsl/tests/test_auto_UnaryMaths.py b/nipype/interfaces/fsl/tests/test_auto_UnaryMaths.py index 9bc209e532..9b3356bcec 100644 --- a/nipype/interfaces/fsl/tests/test_auto_UnaryMaths.py +++ b/nipype/interfaces/fsl/tests/test_auto_UnaryMaths.py @@ -34,7 +34,8 @@ def test_UnaryMaths_inputs(): output_datatype=dict(argstr='-odt %s', position=-1, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_VecReg.py b/nipype/interfaces/fsl/tests/test_auto_VecReg.py index 55c84c1164..503d6c5ea5 100644 --- a/nipype/interfaces/fsl/tests/test_auto_VecReg.py +++ b/nipype/interfaces/fsl/tests/test_auto_VecReg.py @@ -25,7 +25,8 @@ def test_VecReg_inputs(): genfile=True, hash_files=False, ), - output_type=dict(), + output_type=dict(usedefault=True, + ), ref_mask=dict(argstr='--refmask=%s', ), ref_vol=dict(argstr='-r %s', diff --git a/nipype/interfaces/fsl/tests/test_auto_WarpUtils.py b/nipype/interfaces/fsl/tests/test_auto_WarpUtils.py index d5591ea4cd..7457df2102 100644 --- a/nipype/interfaces/fsl/tests/test_auto_WarpUtils.py +++ b/nipype/interfaces/fsl/tests/test_auto_WarpUtils.py @@ -27,7 +27,8 @@ def test_WarpUtils_inputs(): ), out_jacobian=dict(argstr='--jac=%s', ), - output_type=dict(), + output_type=dict(usedefault=True, + ), reference=dict(argstr='--ref=%s', mandatory=True, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_XFibres4.py b/nipype/interfaces/fsl/tests/test_auto_XFibres4.py index 5fa46bb954..448b30884b 100644 --- a/nipype/interfaces/fsl/tests/test_auto_XFibres4.py +++ b/nipype/interfaces/fsl/tests/test_auto_XFibres4.py @@ -56,7 +56,8 @@ def test_XFibres4_inputs(): non_linear=dict(argstr='--nonlinear', xor=('no_spat', 'non_linear'), ), - output_type=dict(), + output_type=dict(usedefault=True, + ), sample_every=dict(argstr='--sampleevery=%d', ), seed=dict(argstr='--seed=%d', diff --git a/nipype/interfaces/fsl/tests/test_auto_XFibres5.py b/nipype/interfaces/fsl/tests/test_auto_XFibres5.py index f877d894e5..c19137b938 100644 --- a/nipype/interfaces/fsl/tests/test_auto_XFibres5.py +++ b/nipype/interfaces/fsl/tests/test_auto_XFibres5.py @@ -67,7 +67,8 @@ def test_XFibres5_inputs(): non_linear=dict(argstr='--nonlinear', xor=('no_spat', 'non_linear', 'cnlinear'), ), - output_type=dict(), + output_type=dict(usedefault=True, + ), rician=dict(argstr='--rician', ), sample_every=dict(argstr='--sampleevery=%d', diff --git a/nipype/interfaces/minc/tests/test_auto_BBox.py b/nipype/interfaces/minc/tests/test_auto_BBox.py index 8ea5f0b34b..d2a05db604 100644 --- a/nipype/interfaces/minc/tests/test_auto_BBox.py +++ b/nipype/interfaces/minc/tests/test_auto_BBox.py @@ -26,8 +26,8 @@ def test_BBox_inputs(): xor=('one_line', 'two_lines'), ), out_file=dict(argstr='> %s', - genfile=True, position=-1, + usedefault=True, ), output_file=dict(hash_files=False, keep_extension=False, diff --git a/nipype/interfaces/minc/tests/test_auto_Dump.py b/nipype/interfaces/minc/tests/test_auto_Dump.py index 0a41c74c90..9eda182ce9 100644 --- a/nipype/interfaces/minc/tests/test_auto_Dump.py +++ b/nipype/interfaces/minc/tests/test_auto_Dump.py @@ -34,8 +34,8 @@ def test_Dump_inputs(): netcdf_name=dict(argstr='-n %s', ), out_file=dict(argstr='> %s', - genfile=True, position=-1, + usedefault=True, ), output_file=dict(hash_files=False, keep_extension=False, diff --git a/nipype/interfaces/minc/tests/test_auto_Extract.py b/nipype/interfaces/minc/tests/test_auto_Extract.py index 04ecb3b7d3..a87c127a2e 100644 --- a/nipype/interfaces/minc/tests/test_auto_Extract.py +++ b/nipype/interfaces/minc/tests/test_auto_Extract.py @@ -68,8 +68,8 @@ def test_Extract_inputs(): xor=('normalize', 'nonormalize'), ), out_file=dict(argstr='> %s', - genfile=True, position=-1, + usedefault=True, ), output_file=dict(hash_files=False, keep_extension=False, diff --git a/nipype/interfaces/minc/tests/test_auto_ToRaw.py b/nipype/interfaces/minc/tests/test_auto_ToRaw.py index a647ed48d0..059962d84a 100644 --- a/nipype/interfaces/minc/tests/test_auto_ToRaw.py +++ b/nipype/interfaces/minc/tests/test_auto_ToRaw.py @@ -23,8 +23,8 @@ def test_ToRaw_inputs(): xor=('normalize', 'nonormalize'), ), out_file=dict(argstr='> %s', - genfile=True, position=-1, + usedefault=True, ), output_file=dict(hash_files=False, keep_extension=False, diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_MRTrix3Base.py b/nipype/interfaces/mrtrix3/tests/test_auto_MRTrix3Base.py index c03da343e2..8349b13b9d 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_MRTrix3Base.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_MRTrix3Base.py @@ -21,3 +21,11 @@ def test_MRTrix3Base_inputs(): for metakey, value in list(metadata.items()): yield assert_equal, getattr(inputs.traits()[key], metakey), value + +def test_MRTrix3Base_outputs(): + output_map = dict() + outputs = MRTrix3Base.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/slicer/tests/test_auto_SlicerCommandLine.py b/nipype/interfaces/slicer/tests/test_auto_SlicerCommandLine.py index e480e76324..003a27e3e3 100644 --- a/nipype/interfaces/slicer/tests/test_auto_SlicerCommandLine.py +++ b/nipype/interfaces/slicer/tests/test_auto_SlicerCommandLine.py @@ -21,3 +21,11 @@ def test_SlicerCommandLine_inputs(): for metakey, value in list(metadata.items()): yield assert_equal, getattr(inputs.traits()[key], metakey), value + +def test_SlicerCommandLine_outputs(): + output_map = dict() + outputs = SlicerCommandLine.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/specs.py b/nipype/interfaces/specs.py index a1aee0e8e6..3e52bd31bd 100644 --- a/nipype/interfaces/specs.py +++ b/nipype/interfaces/specs.py @@ -220,10 +220,10 @@ def format_ns(self, source_names, out_name, source_traits=None): if keep_ext: retval += ext else: - retval = self._overload_extension(retval) + retval = self._overload_extension(retval, out_name, ext) return retval - def _overload_extension(self, value, name=None): + def _overload_extension(self, value, name=None, ext=None): return value def get_hashval(self, hash_method=None): @@ -455,7 +455,6 @@ def _resolve_namesource(self, name, chain=None): if chain is None: chain = [] - spec = self.traits()[name] retval = getattr(self, name) @@ -515,8 +514,7 @@ def _resolve_namesource(self, name, chain=None): if keep_ext: retval += ext else: - retval = self._overload_extension(retval, name) - + retval = self._overload_extension(retval, name, ext) return retval def update_autonames(self): diff --git a/nipype/interfaces/spm/tests/test_auto_SPMCommand.py b/nipype/interfaces/spm/tests/test_auto_SPMCommand.py index 76676dd1ab..b0df440742 100644 --- a/nipype/interfaces/spm/tests/test_auto_SPMCommand.py +++ b/nipype/interfaces/spm/tests/test_auto_SPMCommand.py @@ -22,3 +22,11 @@ def test_SPMCommand_inputs(): for metakey, value in list(metadata.items()): yield assert_equal, getattr(inputs.traits()[key], metakey), value + +def test_SPMCommand_outputs(): + output_map = dict() + outputs = SPMCommand.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/spm/utils.py b/nipype/interfaces/spm/utils.py index 7beb521617..7077876897 100644 --- a/nipype/interfaces/spm/utils.py +++ b/nipype/interfaces/spm/utils.py @@ -37,7 +37,7 @@ def _make_matlab_command(self, _): def _post_run(self): self.outputs.nifti_file = self.output_name - + class CalcCoregAffineInputSpec(SPMCommandInputSpec): target = File(exists=True, mandatory=True, @@ -116,7 +116,7 @@ def _make_matlab_command(self, _): def _post_run(self): self.outputs.mat = os.path.abspath(self.inputs.mat) self.outputs.invmat = os.path.abspath(self.inputs.invmat) - + class ApplyTransformInputSpec(SPMCommandInputSpec): in_file = File(exists=True, mandatory=True, copyfile=True, @@ -171,12 +171,12 @@ def _make_matlab_command(self, _): return script def _post_run(self): - + if not isdefined(self.inputs.out_file): self.outputs.out_file = os.path.abspath(self._gen_outfilename()) else: self.outputs.out_file = os.path.abspath(self.inputs.out_file) - + def _gen_outfilename(self): _, name, _ = split_filename(self.inputs.in_file) return name + '_trans.nii' @@ -225,7 +225,7 @@ def _make_matlab_command(self, _): def _post_run(self): self.outputs.out_file = os.path.abspath(self.inputs.out_file) - + class ApplyInverseDeformationInput(SPMCommandInputSpec): in_files = InputMultiPath( @@ -260,6 +260,19 @@ class ApplyInverseDeformationInput(SPMCommandInputSpec): minlen=3, maxlen=3, desc='3-element list (opt)') + def _format_arg(self, opt, spec, val): + """Convert input to appropriate format for spm + """ + if opt == 'in_files': + return scans_for_fnames(filename_to_list(val)) + if opt == 'target': + return scans_for_fname(filename_to_list(val)) + if opt == 'deformation': + return np.array([list_to_filename(val)], dtype=object) + if opt == 'deformation_field': + return np.array([list_to_filename(val)], dtype=object) + return val + class ApplyInverseDeformationOutput(TraitedSpec): out_files = OutputMultiPath(File(exists=True), @@ -287,25 +300,12 @@ class ApplyInverseDeformation(SPMCommand): _jobtype = 'util' _jobname = 'defs' - def _format_arg(self, opt, spec, val): - """Convert input to appropriate format for spm - """ - if opt == 'in_files': - return scans_for_fnames(filename_to_list(val)) - if opt == 'target': - return scans_for_fname(filename_to_list(val)) - if opt == 'deformation': - return np.array([list_to_filename(val)], dtype=object) - if opt == 'deformation_field': - return np.array([list_to_filename(val)], dtype=object) - return val - def _post_run(self): self.outputs.out_files = [] for filename in self.inputs.in_files: _, fname = os.path.split(filename) self.outputs.out_files.append(os.path.realpath('w%s' % fname)) - + class ResliceToReferenceInput(SPMCommandInputSpec): in_files = InputMultiPath( @@ -373,7 +373,7 @@ def _post_run(self): for filename in self.inputs.in_files: _, fname = os.path.split(filename) self.outputs.out_files.append(os.path.realpath('w%s' % fname)) - + class DicomImportInputSpec(SPMCommandInputSpec): in_files = InputMultiPath( @@ -404,6 +404,21 @@ class DicomImportInputSpec(SPMCommandInputSpec): exactly the same file names.') + def _format_arg(self, opt, spec, val): + """Convert input to appropriate format for spm + """ + if opt == 'in_files': + return np.array(val, dtype=object) + if opt == 'output_dir': + return np.array([val], dtype=object) + if opt == 'output_dir': + return os.path.abspath(val) + if opt == 'icedims': + if val: + return 1 + return 0 + return super(DicomImportInputSpec, self)._format_arg(opt, spec, val) + class DicomImportOutputSpec(TraitedSpec): out_files = OutputMultiPath(File(exists=True), desc='converted files') @@ -427,21 +442,6 @@ class DicomImport(SPMCommand): _jobtype = 'util' _jobname = 'dicom' - def _format_arg(self, opt, spec, val): - """Convert input to appropriate format for spm - """ - if opt == 'in_files': - return np.array(val, dtype=object) - if opt == 'output_dir': - return np.array([val], dtype=object) - if opt == 'output_dir': - return os.path.abspath(val) - if opt == 'icedims': - if val: - return 1 - return 0 - return super(DicomImport, self)._format_arg(opt, spec, val) - def _run_interface(self, runtime): od = os.path.abspath(self.inputs.output_dir) if not os.path.isdir(od): @@ -450,8 +450,7 @@ def _run_interface(self, runtime): def _post_run(self): from glob import glob - od = os.path.abspath(self.inputs.output_dir) - + od = os.path.abspath(self.inputs.output_dir) ext = self.inputs.format if self.inputs.output_dir_struct == "flat": self.outputs.out_files = glob(os.path.join(od, '*.%s' % ext)) @@ -461,4 +460,4 @@ def _post_run(self): self.outputs.out_files = glob(os.path.join(od, os.path.join('*', '*', '*.%s' % ext))) elif self.inputs.output_dir_struct == 'patid_date': self.outputs.out_files = glob(os.path.join(od, os.path.join('*', '*', '*', '*.%s' % ext))) - \ No newline at end of file + diff --git a/nipype/interfaces/tests/test_auto_AssertEqual.py b/nipype/interfaces/tests/test_auto_AssertEqual.py index 4a1d763e43..ffc246f825 100644 --- a/nipype/interfaces/tests/test_auto_AssertEqual.py +++ b/nipype/interfaces/tests/test_auto_AssertEqual.py @@ -18,3 +18,11 @@ def test_AssertEqual_inputs(): for metakey, value in list(metadata.items()): yield assert_equal, getattr(inputs.traits()[key], metakey), value + +def test_AssertEqual_outputs(): + output_map = dict() + outputs = AssertEqual.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/tests/test_auto_BaseInterface.py b/nipype/interfaces/tests/test_auto_BaseInterface.py index 5851add1da..2b5c863729 100644 --- a/nipype/interfaces/tests/test_auto_BaseInterface.py +++ b/nipype/interfaces/tests/test_auto_BaseInterface.py @@ -14,3 +14,11 @@ def test_BaseInterface_inputs(): for metakey, value in list(metadata.items()): yield assert_equal, getattr(inputs.traits()[key], metakey), value + +def test_BaseInterface_outputs(): + output_map = dict() + outputs = BaseInterface.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/tests/test_auto_CommandLine.py b/nipype/interfaces/tests/test_auto_CommandLine.py index 9ea4f08937..1ebbd2c135 100644 --- a/nipype/interfaces/tests/test_auto_CommandLine.py +++ b/nipype/interfaces/tests/test_auto_CommandLine.py @@ -21,3 +21,11 @@ def test_CommandLine_inputs(): for metakey, value in list(metadata.items()): yield assert_equal, getattr(inputs.traits()[key], metakey), value + +def test_CommandLine_outputs(): + output_map = dict() + outputs = CommandLine.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/tests/test_auto_IOBase.py b/nipype/interfaces/tests/test_auto_IOBase.py index 548b613986..bbdff9f5f5 100644 --- a/nipype/interfaces/tests/test_auto_IOBase.py +++ b/nipype/interfaces/tests/test_auto_IOBase.py @@ -14,3 +14,11 @@ def test_IOBase_inputs(): for metakey, value in list(metadata.items()): yield assert_equal, getattr(inputs.traits()[key], metakey), value + +def test_IOBase_outputs(): + output_map = dict() + outputs = IOBase.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/tests/test_auto_MatlabCommand.py b/nipype/interfaces/tests/test_auto_MatlabCommand.py index bfc24cb064..66b9d5335f 100644 --- a/nipype/interfaces/tests/test_auto_MatlabCommand.py +++ b/nipype/interfaces/tests/test_auto_MatlabCommand.py @@ -50,3 +50,11 @@ def test_MatlabCommand_inputs(): for metakey, value in list(metadata.items()): yield assert_equal, getattr(inputs.traits()[key], metakey), value + +def test_MatlabCommand_outputs(): + output_map = dict() + outputs = MatlabCommand.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/tests/test_auto_MpiCommandLine.py b/nipype/interfaces/tests/test_auto_MpiCommandLine.py index 57d1611f4d..0137c6ccf5 100644 --- a/nipype/interfaces/tests/test_auto_MpiCommandLine.py +++ b/nipype/interfaces/tests/test_auto_MpiCommandLine.py @@ -24,3 +24,11 @@ def test_MpiCommandLine_inputs(): for metakey, value in list(metadata.items()): yield assert_equal, getattr(inputs.traits()[key], metakey), value + +def test_MpiCommandLine_outputs(): + output_map = dict() + outputs = MpiCommandLine.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/tests/test_auto_MySQLSink.py b/nipype/interfaces/tests/test_auto_MySQLSink.py index 7b4ff10c0c..15193ac116 100644 --- a/nipype/interfaces/tests/test_auto_MySQLSink.py +++ b/nipype/interfaces/tests/test_auto_MySQLSink.py @@ -28,3 +28,11 @@ def test_MySQLSink_inputs(): for metakey, value in list(metadata.items()): yield assert_equal, getattr(inputs.traits()[key], metakey), value + +def test_MySQLSink_outputs(): + output_map = dict() + outputs = MySQLSink.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/tests/test_auto_NiftiGeneratorBase.py b/nipype/interfaces/tests/test_auto_NiftiGeneratorBase.py index 762c862ed8..86476c3d30 100644 --- a/nipype/interfaces/tests/test_auto_NiftiGeneratorBase.py +++ b/nipype/interfaces/tests/test_auto_NiftiGeneratorBase.py @@ -14,3 +14,11 @@ def test_NiftiGeneratorBase_inputs(): for metakey, value in list(metadata.items()): yield assert_equal, getattr(inputs.traits()[key], metakey), value + +def test_NiftiGeneratorBase_outputs(): + output_map = dict() + outputs = NiftiGeneratorBase.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/tests/test_auto_SEMLikeCommandLine.py b/nipype/interfaces/tests/test_auto_SEMLikeCommandLine.py index 8afc2cdec2..da5784fce6 100644 --- a/nipype/interfaces/tests/test_auto_SEMLikeCommandLine.py +++ b/nipype/interfaces/tests/test_auto_SEMLikeCommandLine.py @@ -21,3 +21,11 @@ def test_SEMLikeCommandLine_inputs(): for metakey, value in list(metadata.items()): yield assert_equal, getattr(inputs.traits()[key], metakey), value + +def test_SEMLikeCommandLine_outputs(): + output_map = dict() + outputs = SEMLikeCommandLine.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/tests/test_auto_SQLiteSink.py b/nipype/interfaces/tests/test_auto_SQLiteSink.py index f215e3e424..c92ac25985 100644 --- a/nipype/interfaces/tests/test_auto_SQLiteSink.py +++ b/nipype/interfaces/tests/test_auto_SQLiteSink.py @@ -18,3 +18,11 @@ def test_SQLiteSink_inputs(): for metakey, value in list(metadata.items()): yield assert_equal, getattr(inputs.traits()[key], metakey), value + +def test_SQLiteSink_outputs(): + output_map = dict() + outputs = SQLiteSink.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/tests/test_auto_StdOutCommandLine.py b/nipype/interfaces/tests/test_auto_StdOutCommandLine.py index 6c91c5de40..da5bbd3cc9 100644 --- a/nipype/interfaces/tests/test_auto_StdOutCommandLine.py +++ b/nipype/interfaces/tests/test_auto_StdOutCommandLine.py @@ -13,8 +13,8 @@ def test_StdOutCommandLine_inputs(): usedefault=True, ), out_file=dict(argstr='> %s', - genfile=True, position=-1, + usedefault=True, ), terminal_output=dict(nohash=True, ), @@ -25,3 +25,12 @@ def test_StdOutCommandLine_inputs(): for metakey, value in list(metadata.items()): yield assert_equal, getattr(inputs.traits()[key], metakey), value + +def test_StdOutCommandLine_outputs(): + output_map = dict(out_file=dict(), + ) + outputs = StdOutCommandLine.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/tests/test_auto_XNATSink.py b/nipype/interfaces/tests/test_auto_XNATSink.py index dd681af29f..a774d1e13d 100644 --- a/nipype/interfaces/tests/test_auto_XNATSink.py +++ b/nipype/interfaces/tests/test_auto_XNATSink.py @@ -38,3 +38,11 @@ def test_XNATSink_inputs(): for metakey, value in list(metadata.items()): yield assert_equal, getattr(inputs.traits()[key], metakey), value + +def test_XNATSink_outputs(): + output_map = dict() + outputs = XNATSink.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/pipeline/engine/nodes.py b/nipype/pipeline/engine/nodes.py index 332ffa98ab..cf3cef0381 100644 --- a/nipype/pipeline/engine/nodes.py +++ b/nipype/pipeline/engine/nodes.py @@ -207,7 +207,7 @@ def inputs(self): @property def outputs(self): """Return the output fields of the underlying interface""" - return self._interface._outputs() + return self._interface.outputs def output_dir(self): """Return the location of the output directory for the node""" From 97d4c3eff2701ddbb0c654a012436d02ce7f6af5 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 17 Feb 2016 17:06:56 -0800 Subject: [PATCH 39/73] AFNI passing tests --- nipype/interfaces/afni/base.py | 6 ++---- nipype/interfaces/afni/preprocess.py | 16 ++++++++------- nipype/interfaces/ants/segmentation.py | 4 ++-- nipype/interfaces/fsl/epi.py | 4 ++-- nipype/interfaces/fsl/preprocess.py | 8 ++++---- nipype/interfaces/fsl/utils.py | 16 +++++++-------- nipype/interfaces/minc/minc.py | 6 +++--- nipype/interfaces/mrtrix3/base.py | 4 ++-- nipype/interfaces/mrtrix3/connectivity.py | 4 ++-- nipype/interfaces/specs.py | 2 +- nipype/interfaces/spm/base.py | 6 +++--- nipype/interfaces/spm/model.py | 12 ++++++------ nipype/interfaces/spm/preprocess.py | 24 +++++++++++------------ nipype/interfaces/spm/tests/test_base.py | 4 ++-- nipype/interfaces/tests/test_base.py | 8 ++++---- 15 files changed, 62 insertions(+), 62 deletions(-) diff --git a/nipype/interfaces/afni/base.py b/nipype/interfaces/afni/base.py index 01ddd3dd70..8c0ad4c2f6 100644 --- a/nipype/interfaces/afni/base.py +++ b/nipype/interfaces/afni/base.py @@ -109,10 +109,8 @@ class AFNICommandInputSpec(CommandLineInputSpec): name_source=["in_file"], argstr='-prefix %s') def _overload_extension(self, value, name=None, ext=None): - IFLOGGER.info('Current out type: %s', self.outputtype) - if value.endswith('+orig.BRIK'): - return value - if value.endswith('.1D'): + # Do not overload certain extensions + if value.endswith('+orig.BRIK') or value.endswith('.1D'): return value return value + AFNI_FTYPES.get(self.outputtype, '') diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index cd2125f410..8c6616b51a 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -1885,10 +1885,10 @@ def _format_arg(self, name, trait_spec, value): return arg return super(EvalInputSpec, self)._format_arg(name, trait_spec, value) - def _parse_inputs(self, skip=None): + def parse_args(self, skip=None): """Skip the arguments without argstr metadata """ - return super(EvalInputSpec, self)._parse_inputs( + return super(EvalInputSpec, self).parse_args( skip=('start_idx', 'stop_idx', 'out1D', 'other')) @@ -1984,12 +1984,12 @@ class HistInputSpec(CommandLineInputSpec): min_value = traits.Float(argstr='-min %f', desc='minimum intensity value') bin_width = traits.Float(argstr='-binwidth %f', desc='bin width') - def _parse_inputs(self, skip=None): + def parse_args(self, skip=None): if not self.showhist: if skip is None: skip = [] skip += ['out_show'] - return super(HistInputSpec, self)._parse_inputs(skip=skip) + return super(HistInputSpec, self).parse_args(skip=skip) class HistOutputSpec(TraitedSpec): out_file = File(desc='output file', mandatory=True, suffix='.niml.hist') @@ -2068,15 +2068,15 @@ class FWHMxInputSpec(CommandLineInputSpec): combine = traits.Bool(argstr='-combine', desc='combine the final measurements along each axis') compat = traits.Bool(argstr='-compat', desc='be compatible with the older 3dFWHM') acf = traits.Either( - False, traits.Bool(), File(), traits.Tuple(File(exists=True), traits.Float()), + traits.Bool(), File(), traits.Tuple(File(exists=True), traits.Float()), default=False, usedefault=True, argstr='-acf', desc='computes the spatial autocorrelation') - def _parse_inputs(self, skip=None): + def parse_args(self, skip=None): if not self.detrend: if skip is None: skip = [] skip += ['out_detrend'] - return super(FWHMxInputSpec, self)._parse_inputs(skip=skip) + return super(FWHMxInputSpec, self).parse_args(skip=skip) def arg_used(self, name): return self._format_arg(name) is None @@ -2098,6 +2098,8 @@ def _format_arg(self, name, trait_spec=None, value=None): return trait_spec.argstr + ' %d' % value if name == 'acf': + if value is None: + return None if isinstance(value, bool): if value: return trait_spec.argstr diff --git a/nipype/interfaces/ants/segmentation.py b/nipype/interfaces/ants/segmentation.py index e9662136e1..525c19664e 100644 --- a/nipype/interfaces/ants/segmentation.py +++ b/nipype/interfaces/ants/segmentation.py @@ -361,11 +361,11 @@ def _format_arg(self, name, trait_spec, value): return super(N4BiasFieldCorrection, self)._format_arg(name, trait_spec, value) - def _parse_inputs(self, skip=None): + def parse_args(self, skip=None): if skip is None: skip = [] skip += ['save_bias', 'bias_image'] - return super(N4BiasFieldCorrection, self)._parse_inputs(skip=skip) + return super(N4BiasFieldCorrection, self).parse_args(skip=skip) def _post_run(self): self.outputs.output_image = os.path.abspath( diff --git a/nipype/interfaces/fsl/epi.py b/nipype/interfaces/fsl/epi.py index 708d2f2b40..5d80466ab8 100644 --- a/nipype/interfaces/fsl/epi.py +++ b/nipype/interfaces/fsl/epi.py @@ -81,7 +81,7 @@ class PrepareFieldmap(FSLCommand): input_spec = PrepareFieldmapInputSpec output_spec = PrepareFieldmapOutputSpec - def _parse_inputs(self, skip=None): + def parse_args(self, skip=None): if skip is None: skip = [] @@ -92,7 +92,7 @@ def _parse_inputs(self, skip=None): if not isdefined(self.inputs.nocheck) or not self.inputs.nocheck: skip += ['nocheck'] - return super(PrepareFieldmap, self)._parse_inputs(skip=skip) + return super(PrepareFieldmap, self).parse_args(skip=skip) def _post_run(self): diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index 5a0084574a..f0c5be3a20 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -457,13 +457,13 @@ class FLIRTInputSpec(FSLCommandInputSpec): argstr='-bbrslope %f', min_ver='5.0.0', desc='value of bbr slope') - def _parse_inputs(self, skip=None): + def parse_args(self, skip=None): skip = [] if isdefined(self.inputs.save_log) and self.inputs.save_log: if not isdefined(self.inputs.verbose) or self.inputs.verbose == 0: self.inputs.verbose = 1 skip.append('save_log') - return super(FLIRTInputSpec, self)._parse_inputs(skip=skip) + return super(FLIRTInputSpec, self).parse_args(skip=skip) class FLIRTOutputSpec(TraitedSpec): @@ -1174,7 +1174,7 @@ class FUGUEInputSpec(FSLCommandInputSpec): save_unmasked_fmap = traits.Bool(False, argstr='--unmaskfmap', xor=['save_fmap'], desc='saves the unmasked fieldmap when using --savefmap') - def _parse_inputs(self, skip=None): + def parse_args(self, skip=None): if skip is None: skip = [] @@ -1255,7 +1255,7 @@ def _parse_inputs(self, skip=None): else: skip += ['save_fmap', 'save_unmasked_fmap', 'fmap_out_file'] - return super(FUGUEInputSpec, self)._parse_inputs(skip=skip) + return super(FUGUEInputSpec, self).parse_args(skip=skip) diff --git a/nipype/interfaces/fsl/utils.py b/nipype/interfaces/fsl/utils.py index 974678b950..7bcd833160 100644 --- a/nipype/interfaces/fsl/utils.py +++ b/nipype/interfaces/fsl/utils.py @@ -437,8 +437,8 @@ def _gen_filename(self, name): return getattr(self.outputs, name) return None - def _parse_inputs(self, skip=None): - return super(ImageMaths, self)._parse_inputs(skip=['suffix']) + def parse_args(self, skip=None): + return super(ImageMaths, self).parse_args(skip=['suffix']) def _post_run(self): suffix = '_maths' # ohinds: build suffix @@ -1497,7 +1497,7 @@ class Complex(FSLCommand): input_spec = ComplexInputSpec output_spec = ComplexOuputSpec - def _parse_inputs(self, skip=None): + def parse_args(self, skip=None): if skip is None: skip = [] if self.inputs.real_cartesian: @@ -1506,7 +1506,7 @@ def _parse_inputs(self, skip=None): skip += self.inputs._ofs[:1] + self.inputs._ofs[3:] else: skip += self.inputs._ofs[1:] - return super(Complex, self)._parse_inputs(skip) + return super(Complex, self).parse_args(skip) def _gen_filename(self, name): if name == 'complex_out_file': @@ -1639,7 +1639,7 @@ class WarpUtils(FSLCommand): _cmd = 'fnirtfileutils' - def _parse_inputs(self, skip=None): + def parse_args(self, skip=None): if skip is None: skip = [] @@ -1660,7 +1660,7 @@ def _parse_inputs(self, skip=None): skip += ['out_jacobian'] skip += ['write_jacobian'] - return super(WarpUtils, self)._parse_inputs(skip=skip) + return super(WarpUtils, self).parse_args(skip=skip) class ConvertWarpInputSpec(FSLCommandInputSpec): @@ -1841,13 +1841,13 @@ def _format_arg(self, name, trait_spec, value): else: return super(WarpPoints, self)._format_arg(name, trait_spec, value) - def _parse_inputs(self, skip=None): + def parse_args(self, skip=None): import os.path as op fname, ext = op.splitext(self.inputs.in_coords) setattr(self, '_in_file', fname) setattr(self, '_outformat', ext[1:]) - first_args = super(WarpPoints, self)._parse_inputs(skip=['in_coords', 'out_file']) + first_args = super(WarpPoints, self).parse_args(skip=['in_coords', 'out_file']) second_args = fname + '.txt' diff --git a/nipype/interfaces/minc/minc.py b/nipype/interfaces/minc/minc.py index ebd014eff6..4490ef52f3 100644 --- a/nipype/interfaces/minc/minc.py +++ b/nipype/interfaces/minc/minc.py @@ -1967,7 +1967,7 @@ class MathInputSpec(CommandLineInputSpec): 'segment', 'nsegment', 'isnan', - 'isnan'] # FIXME enforce this in _parse_inputs and check for other members + 'isnan'] # FIXME enforce this in parse_args and check for other members invert = traits.Either( traits.Float(), @@ -2093,7 +2093,7 @@ def _format_arg(self, name, spec, value): return super(Math, self)._format_arg(name, spec, value) - def _parse_inputs(self): + def parse_args(self): """A number of the command line options expect precisely one or two files. """ @@ -2145,7 +2145,7 @@ def _parse_inputs(self): 'Due to the %s option we expected at least one file but input_files is of length %d' % (n, nr_input_files,)) - return super(Math, self)._parse_inputs() + return super(Math, self).parse_args() class ResampleInputSpec(CommandLineInputSpec): diff --git a/nipype/interfaces/mrtrix3/base.py b/nipype/interfaces/mrtrix3/base.py index 40a8e93a88..615e97b0f7 100644 --- a/nipype/interfaces/mrtrix3/base.py +++ b/nipype/interfaces/mrtrix3/base.py @@ -64,7 +64,7 @@ def _format_arg(self, name, trait_spec, value): return super(MRTrix3Base, self)._format_arg(name, trait_spec, value) - def _parse_inputs(self, skip=None): + def parse_args(self, skip=None): if skip is None: skip = [] @@ -83,4 +83,4 @@ def _parse_inputs(self, skip=None): except AttributeError: pass - return super(MRTrix3Base, self)._parse_inputs(skip=skip) + return super(MRTrix3Base, self).parse_args(skip=skip) diff --git a/nipype/interfaces/mrtrix3/connectivity.py b/nipype/interfaces/mrtrix3/connectivity.py index f5b917fb2b..3b0142a0fb 100644 --- a/nipype/interfaces/mrtrix3/connectivity.py +++ b/nipype/interfaces/mrtrix3/connectivity.py @@ -162,7 +162,7 @@ class LabelConfig(MRTrix3Base): input_spec = LabelConfigInputSpec output_spec = LabelConfigOutputSpec - def _parse_inputs(self, skip=None): + def parse_args(self, skip=None): if skip is None: skip = [] @@ -178,7 +178,7 @@ def _parse_inputs(self, skip=None): path, 'src/dwi/tractography/connectomics/' 'example_configs/fs_default.txt') - return super(LabelConfig, self)._parse_inputs(skip=skip) + return super(LabelConfig, self).parse_args(skip=skip) def _post_run(self): diff --git a/nipype/interfaces/specs.py b/nipype/interfaces/specs.py index 3e52bd31bd..af232202dc 100644 --- a/nipype/interfaces/specs.py +++ b/nipype/interfaces/specs.py @@ -672,7 +672,7 @@ def _format_arg(self, name, spec=None, value=None): value = getattr(self, name) argstr = spec.argstr - IFLOGGER.debug('%s_%s' % (name, str(value))) + IFLOGGER.debug('Formatting %s, value=%s' % (name, str(value))) if spec.is_trait_type(traits.Bool) and "%" not in argstr: if value: # Boolean options have no format string. Just append options diff --git a/nipype/interfaces/spm/base.py b/nipype/interfaces/spm/base.py index ee16b52846..8581d1da12 100644 --- a/nipype/interfaces/spm/base.py +++ b/nipype/interfaces/spm/base.py @@ -307,7 +307,7 @@ def _check_mlab_inputs(self): def _run_interface(self, runtime): """Executes the SPM function using MATLAB.""" self.mlab.inputs.script = self._make_matlab_command( - deepcopy(self._parse_inputs())) + deepcopy(self.parse_args())) results = self.mlab.run() runtime.returncode = results.runtime.returncode if self.mlab.inputs.uses_mcr: @@ -330,7 +330,7 @@ def _format_arg(self, opt, spec, val): else: return val - def _parse_inputs(self, skip=()): + def parse_args(self, skip=()): spmdict = {} metadata = dict(field=lambda t: t is not None) for name, spec in list(self.inputs.traits(**metadata).items()): @@ -447,7 +447,7 @@ def _make_matlab_command(self, contents, postscript=None): ---------- contents : list - a list of dicts generated by _parse_inputs + a list of dicts generated by parse_args in each subclass cwd : string diff --git a/nipype/interfaces/spm/model.py b/nipype/interfaces/spm/model.py index 8c3cc66eb7..1ff3175a8f 100644 --- a/nipype/interfaces/spm/model.py +++ b/nipype/interfaces/spm/model.py @@ -123,10 +123,10 @@ def _format_arg(self, opt, spec, val): return val return super(Level1Design, self)._format_arg(opt, spec, val) - def _parse_inputs(self): + def parse_args(self): """validate spm realign options if set to None ignore """ - einputs = super(Level1Design, self)._parse_inputs(skip=('mask_threshold')) + einputs = super(Level1Design, self).parse_args(skip=('mask_threshold')) for sessinfo in einputs[0]['sess']: sessinfo['scans'] = scans_for_fnames(filename_to_list(sessinfo['scans']), keep4d=False) if not isdefined(self.inputs.spm_mat_dir): @@ -204,10 +204,10 @@ def _format_arg(self, opt, spec, val): return val return super(EstimateModel, self)._format_arg(opt, spec, val) - def _parse_inputs(self): + def parse_args(self): """validate spm realign options if set to None ignore """ - einputs = super(EstimateModel, self)._parse_inputs(skip=('flags')) + einputs = super(EstimateModel, self).parse_args(skip=('flags')) if isdefined(self.inputs.flags): einputs[0].update(self.inputs.flags) return einputs @@ -760,10 +760,10 @@ def _format_arg(self, opt, spec, val): return outlist return super(FactorialDesign, self)._format_arg(opt, spec, val) - def _parse_inputs(self): + def parse_args(self): """validate spm realign options if set to None ignore """ - einputs = super(FactorialDesign, self)._parse_inputs() + einputs = super(FactorialDesign, self).parse_args() if not isdefined(self.inputs.spm_mat_dir): einputs[0]['dir'] = np.array([str(os.getcwd())], dtype=object) return einputs diff --git a/nipype/interfaces/spm/preprocess.py b/nipype/interfaces/spm/preprocess.py index 217ab6ba78..5f56621c4a 100644 --- a/nipype/interfaces/spm/preprocess.py +++ b/nipype/interfaces/spm/preprocess.py @@ -199,10 +199,10 @@ def _format_arg(self, opt, spec, val): separate_sessions=separate_sessions) return super(Realign, self)._format_arg(opt, spec, val) - def _parse_inputs(self): + def parse_args(self): """validate spm realign options if set to None ignore """ - einputs = super(Realign, self)._parse_inputs() + einputs = super(Realign, self).parse_args() return [{'%s' % (self.inputs.jobtype): einputs[0]}] def _post_run(self): @@ -330,13 +330,13 @@ def _format_arg(self, opt, spec, val): return scans_for_fnames(val) return super(Coregister, self)._format_arg(opt, spec, val) - def _parse_inputs(self): + def parse_args(self): """validate spm coregister options if set to None ignore """ if self.inputs.jobtype == "write": - einputs = super(Coregister, self)._parse_inputs(skip=('jobtype', 'apply_to_files')) + einputs = super(Coregister, self).parse_args(skip=('jobtype', 'apply_to_files')) else: - einputs = super(Coregister, self)._parse_inputs(skip=('jobtype')) + einputs = super(Coregister, self).parse_args(skip=('jobtype')) jobtype = self.inputs.jobtype return [{'%s' % (jobtype): einputs[0]}] @@ -456,10 +456,10 @@ def _format_arg(self, opt, spec, val): raise ValueError('%s must have 3 elements' % opt) return super(Normalize, self)._format_arg(opt, spec, val) - def _parse_inputs(self): + def parse_args(self): """validate spm normalize options if set to None ignore """ - einputs = super(Normalize, self)._parse_inputs(skip=('jobtype', + einputs = super(Normalize, self).parse_args(skip=('jobtype', 'apply_to_files')) if isdefined(self.inputs.apply_to_files): inputfiles = deepcopy(self.inputs.apply_to_files) @@ -616,10 +616,10 @@ def _format_arg(self, opt, spec, val): raise ValueError('%s must have 5 elements' % opt) return super(Normalize12, self)._format_arg(opt, spec, val) - def _parse_inputs(self, skip=()): + def parse_args(self, skip=()): """validate spm normalize options if set to None ignore """ - einputs = super(Normalize12, self)._parse_inputs(skip=('jobtype', + einputs = super(Normalize12, self).parse_args(skip=('jobtype', 'apply_to_files')) if isdefined(self.inputs.apply_to_files): inputfiles = deepcopy(self.inputs.apply_to_files) @@ -1603,11 +1603,11 @@ def _format_arg(self, opt, spec, val): else: return super(VBMSegment, self)._format_arg(opt, spec, val) - def _parse_inputs(self): + def parse_args(self): if self.inputs.spatial_normalization == 'low': - einputs = super(VBMSegment, self)._parse_inputs( + einputs = super(VBMSegment, self).parse_args( skip=('spatial_normalization', 'dartel_template')) einputs[0]['estwrite']['extopts']['dartelwarp'] = {'normlow': 1} return einputs else: - return super(VBMSegment, self)._parse_inputs(skip=('spatial_normalization')) + return super(VBMSegment, self).parse_args(skip=('spatial_normalization')) diff --git a/nipype/interfaces/spm/tests/test_base.py b/nipype/interfaces/spm/tests/test_base.py index 73e8ad9c12..ec376113a6 100644 --- a/nipype/interfaces/spm/tests/test_base.py +++ b/nipype/interfaces/spm/tests/test_base.py @@ -163,10 +163,10 @@ class TestClass(spm.SPMCommand): _jobname = 'jobname' dc = TestClass() # dc = derived_class dc.inputs.test_in = True - out = dc._make_matlab_command(dc._parse_inputs()) + out = dc._make_matlab_command(dc.parse_args()) yield assert_equal, out.find('jobs{1}.spm.jobtype.jobname.testfield = 1;') > 0, 1 dc.inputs.use_v8struct = False - out = dc._make_matlab_command(dc._parse_inputs()) + out = dc._make_matlab_command(dc.parse_args()) yield assert_equal, out.find('jobs{1}.jobtype{1}.jobname{1}.testfield = 1;') > 0, 1 diff --git a/nipype/interfaces/tests/test_base.py b/nipype/interfaces/tests/test_base.py index b5844a795e..5c18bcfcd7 100644 --- a/nipype/interfaces/tests/test_base.py +++ b/nipype/interfaces/tests/test_base.py @@ -605,20 +605,20 @@ class CommandLineInputSpec1(nib.CommandLineInputSpec): ci4.inputs.noo = 0 ci4.inputs.roo = 'hello' ci4.inputs.soo = False - cmd = ci4._parse_inputs() + cmd = ci4.parse_args() yield assert_equal, cmd[0], '-g' yield assert_equal, cmd[-1], '-i 1 -i 2 -i 3' yield assert_true, 'hello' not in ' '.join(cmd) yield assert_true, '-soo' not in ' '.join(cmd) ci4.inputs.soo = True - cmd = ci4._parse_inputs() + cmd = ci4.parse_args() yield assert_true, '-soo' in ' '.join(cmd) class CommandLineInputSpec2(nib.CommandLineInputSpec): foo = nib.File(argstr='%s', desc='a str', genfile=True) nib.CommandLine.input_spec = CommandLineInputSpec2 ci5 = nib.CommandLine(command='cmd') - yield assert_raises, NotImplementedError, ci5._parse_inputs + yield assert_raises, NotImplementedError, ci5.parse_args class DerivedClass(nib.CommandLine): input_spec = CommandLineInputSpec2 @@ -627,7 +627,7 @@ def _gen_filename(self, name): return 'filename' ci6 = DerivedClass(command='cmd') - yield assert_equal, ci6._parse_inputs()[0], 'filename' + yield assert_equal, ci6.parse_args()[0], 'filename' nib.CommandLine.input_spec = nib.CommandLineInputSpec From 8cca288da41af1e2e1ff9612a3f66572806df8e6 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 17 Feb 2016 18:53:41 -0800 Subject: [PATCH 40/73] ants almost passing --- nipype/interfaces/ants/base.py | 11 +- nipype/interfaces/ants/registration.py | 588 +++++++++--------- nipype/interfaces/ants/resampling.py | 243 +++----- nipype/interfaces/ants/segmentation.py | 412 ++++++------ .../interfaces/ants/tests/test_auto_ANTS.py | 15 +- .../ants/tests/test_auto_ApplyTransforms.py | 6 +- .../ants/tests/test_auto_Atropos.py | 13 +- .../ants/tests/test_auto_DenoiseImage.py | 3 +- .../tests/test_auto_N4BiasFieldCorrection.py | 10 +- .../test_auto_WarpImageMultiTransform.py | 11 +- ..._auto_WarpTimeSeriesImageMultiTransform.py | 8 +- .../ants/tests/test_spec_JointFusion.py | 4 +- 12 files changed, 644 insertions(+), 680 deletions(-) diff --git a/nipype/interfaces/ants/base.py b/nipype/interfaces/ants/base.py index 20fab05881..70902faa1d 100644 --- a/nipype/interfaces/ants/base.py +++ b/nipype/interfaces/ants/base.py @@ -33,6 +33,12 @@ class ANTSCommandInputSpec(CommandLineInputSpec): nohash=True, desc="Number of ITK threads to use") + @staticmethod + def _format_xarray(val): + """ Convenience method for converting input arrays [1,2,3] to commandline format '1x2x3' """ + return 'x'.join([str(x) for x in val]) + + class ANTSCommand(CommandLine): """Base class for ANTS interfaces """ @@ -69,11 +75,6 @@ def _num_threads_update(self): self.inputs.environ.update({PREFERED_ITKv4_THREAD_LIMIT_VARIABLE: '%s' % self.inputs.num_threads}) - @staticmethod - def _format_xarray(val): - """ Convenience method for converting input arrays [1,2,3] to commandline format '1x2x3' """ - return 'x'.join([str(x) for x in val]) - @classmethod def set_default_num_threads(cls, num_threads): """Set the default number of threads for ITK calls diff --git a/nipype/interfaces/ants/registration.py b/nipype/interfaces/ants/registration.py index 6939adf0ba..ccb5b47efd 100644 --- a/nipype/interfaces/ants/registration.py +++ b/nipype/interfaces/ants/registration.py @@ -95,19 +95,80 @@ def _format_arg(self, opt, spec, val): elif opt == 'affine_gradient_descent_option': return self._affine_gradient_descent_option_constructor() elif opt == 'use_histogram_matching': - if self.inputs.use_histogram_matching: + if self.use_histogram_matching: return '--use-Histogram-Matching 1' else: return '--use-Histogram-Matching 0' return super(ANTSInputSpec, self)._format_arg(opt, spec, val) + def _image_metric_constructor(self): + retval = [] + intensity_based = ['CC', 'MI', 'SMI', 'PR', 'SSD', 'MSQ'] + point_set_based = ['PSE', 'JTB'] + for ii in range(len(self.moving_image)): + if self.metric[ii] in intensity_based: + retval.append( + '--image-metric %s[ %s, %s, %g, %d ]' % (self.metric[ii], + self.fixed_image[ + ii], + self.moving_image[ + ii], + self.metric_weight[ + ii], + self.radius[ii])) + elif self.metric[ii] == point_set_based: + pass + # retval.append('--image-metric %s[%s, %s, ...'.format(self.metric[ii], + # self.fixed_image[ii], self.moving_image[ii], ...)) + return ' '.join(retval) + + def _transformation_constructor(self): + model = self.transformation_model + step_length = self.gradient_step_length + time_step = self.number_of_time_steps + delta_time = self.delta_time + symmetry_type = self.symmetry_type + retval = ['--transformation-model %s' % model] + parameters = [] + for elem in (step_length, time_step, delta_time, symmetry_type): + if elem is not traits.Undefined: + parameters.append('%#.2g' % elem) + if len(parameters) > 0: + if len(parameters) > 1: + parameters = ','.join(parameters) + else: + parameters = ''.join(parameters) + retval.append('[%s]' % parameters) + return ''.join(retval) + + def _regularization_constructor(self): + return '--regularization {0}[{1},{2}]'.format(self.regularization, + self.regularization_gradient_field_sigma, + self.regularization_deformation_field_sigma) + + def _affine_gradient_descent_option_constructor(self): + values = self.affine_gradient_descent_option + defaults = [0.1, 0.5, 1.e-4, 1.e-4] + for ii in range(len(defaults)): + try: + defaults[ii] = values[ii] + except IndexError: + break + parameters = self._format_xarray([('%g' % defaults[index]) for index in range(4)]) + retval = ['--affine-gradient-descent-option', parameters] + return ' '.join(retval) class ANTSOutputSpec(TraitedSpec): - affine_transform = File(exists=True, desc='Affine transform file') - warp_transform = File(exists=True, desc='Warping deformation field') + affine_transform = File( + name_source='output_transform_prefix', name_template='%sAffine.txt', + keep_extension=False, desc='Affine transform file') + warp_transform = File( + name_source='output_transform_prefix', name_template='%sWarp.nii.gz', + keep_extension=False, desc='Warping deformation field') inverse_warp_transform = File( - exists=True, desc='Inverse warping deformation field') + name_source='output_transform_prefix', name_template='%sInverseWarp.nii.gz', + keep_extension=False, desc='Inverse warping deformation field') metaheader = File(exists=True, desc='VTK metaheader .mhd file') metaheader_raw = File(exists=True, desc='VTK metaheader .raw file') @@ -147,73 +208,6 @@ class ANTS(ANTSCommand): input_spec = ANTSInputSpec output_spec = ANTSOutputSpec - def _image_metric_constructor(self): - retval = [] - intensity_based = ['CC', 'MI', 'SMI', 'PR', 'SSD', 'MSQ'] - point_set_based = ['PSE', 'JTB'] - for ii in range(len(self.inputs.moving_image)): - if self.inputs.metric[ii] in intensity_based: - retval.append( - '--image-metric %s[ %s, %s, %g, %d ]' % (self.inputs.metric[ii], - self.inputs.fixed_image[ - ii], - self.inputs.moving_image[ - ii], - self.inputs.metric_weight[ - ii], - self.inputs.radius[ii])) - elif self.inputs.metric[ii] == point_set_based: - pass - # retval.append('--image-metric %s[%s, %s, ...'.format(self.inputs.metric[ii], - # self.inputs.fixed_image[ii], self.inputs.moving_image[ii], ...)) - return ' '.join(retval) - - def _transformation_constructor(self): - model = self.inputs.transformation_model - step_length = self.inputs.gradient_step_length - time_step = self.inputs.number_of_time_steps - delta_time = self.inputs.delta_time - symmetry_type = self.inputs.symmetry_type - retval = ['--transformation-model %s' % model] - parameters = [] - for elem in (step_length, time_step, delta_time, symmetry_type): - if elem is not traits.Undefined: - parameters.append('%#.2g' % elem) - if len(parameters) > 0: - if len(parameters) > 1: - parameters = ','.join(parameters) - else: - parameters = ''.join(parameters) - retval.append('[%s]' % parameters) - return ''.join(retval) - - def _regularization_constructor(self): - return '--regularization {0}[{1},{2}]'.format(self.inputs.regularization, - self.inputs.regularization_gradient_field_sigma, - self.inputs.regularization_deformation_field_sigma) - - def _affine_gradient_descent_option_constructor(self): - values = self.inputs.affine_gradient_descent_option - defaults = [0.1, 0.5, 1.e-4, 1.e-4] - for ii in range(len(defaults)): - try: - defaults[ii] = values[ii] - except IndexError: - break - parameters = self._format_xarray([('%g' % defaults[index]) for index in range(4)]) - retval = ['--affine-gradient-descent-option', parameters] - return ' '.join(retval) - - def _post_run(self): - self.outputs.affine_transform = os.path.abspath( - self.inputs.output_transform_prefix + 'Affine.txt') - self.outputs.warp_transform = os.path.abspath( - self.inputs.output_transform_prefix + 'Warp.nii.gz') - self.outputs.inverse_warp_transform = os.path.abspath( - self.inputs.output_transform_prefix + 'InverseWarp.nii.gz') - # self.outputs.metaheader = os.path.abspath(self.inputs.output_transform_prefix + 'velocity.mhd') - # self.outputs.metaheader_raw = os.path.abspath(self.inputs.output_transform_prefix + 'velocity.raw') - class RegistrationInputSpec(ANTSCommandInputSpec): dimension = traits.Enum(3, 2, argstr='--dimensionality %d', @@ -380,62 +374,254 @@ class RegistrationInputSpec(ANTSCommandInputSpec): low=0.0, high=1.0, value=0.0, argstr='%s', usedefault=True, desc="The Lower quantile to clip image ranges") + def parse_args(self, skip=None): + if skip is None: + skip = [] + + if (isdefined(self.winsorize_upper_quantile) and + isdefined(self.winsorize_lower_quantile)): + skip += ['winsorize_upper_quantile'] + return super(RegistrationInputSpec, self).parse_args(skip) + def _format_arg(self, opt, spec, val): if opt == 'fixed_image_mask': - if isdefined(self.inputs.moving_image_mask): - return '--masks [ %s, %s ]' % (self.inputs.fixed_image_mask, - self.inputs.moving_image_mask) + if isdefined(self.moving_image_mask): + return '--masks [ %s, %s ]' % (self.fixed_image_mask, + self.moving_image_mask) else: - return '--masks %s' % self.inputs.fixed_image_mask + return '--masks %s' % self.fixed_image_mask elif opt == 'transforms': return self._format_registration() elif opt == 'initial_moving_transform': try: - do_invert_transform = int(self.inputs.invert_initial_moving_transform) + do_invert_transform = int(self.invert_initial_moving_transform) except ValueError: do_invert_transform = 0 # Just do the default behavior - return '--initial-moving-transform [ %s, %d ]' % (self.inputs.initial_moving_transform, + return '--initial-moving-transform [ %s, %d ]' % (self.initial_moving_transform, do_invert_transform) elif opt == 'initial_moving_transform_com': try: - do_center_of_mass_init = int(self.inputs.initial_moving_transform_com) + do_center_of_mass_init = int(self.initial_moving_transform_com) except ValueError: do_center_of_mass_init = 0 # Just do the default behavior - return '--initial-moving-transform [ %s, %s, %d ]' % (self.inputs.fixed_image[0], - self.inputs.moving_image[0], + return '--initial-moving-transform [ %s, %s, %d ]' % (self.fixed_image[0], + self.moving_image[0], do_center_of_mass_init) elif opt == 'interpolation': - if self.inputs.interpolation in ['BSpline', 'MultiLabel', 'Gaussian'] and \ - isdefined(self.inputs.interpolation_parameters): - return '--interpolation %s[ %s ]' % (self.inputs.interpolation, + if self.interpolation in ['BSpline', 'MultiLabel', 'Gaussian'] and \ + isdefined(self.interpolation_parameters): + return '--interpolation %s[ %s ]' % (self.interpolation, ', '.join([str(param) - for param in self.inputs.interpolation_parameters])) + for param in self.interpolation_parameters])) else: - return '--interpolation %s' % self.inputs.interpolation + return '--interpolation %s' % self.interpolation elif opt == 'output_transform_prefix': out_filename = self._get_outputfilenames(inverse=False) inv_out_filename = self._get_outputfilenames(inverse=True) if out_filename and inv_out_filename: - return '--output [ %s, %s, %s ]' % (self.inputs.output_transform_prefix, + return '--output [ %s, %s, %s ]' % (self.output_transform_prefix, out_filename, inv_out_filename) elif out_filename: - return '--output [ %s, %s ]' % (self.inputs.output_transform_prefix, + return '--output [ %s, %s ]' % (self.output_transform_prefix, out_filename) else: - return '--output %s' % self.inputs.output_transform_prefix + return '--output %s' % self.output_transform_prefix elif opt == 'winsorize_upper_quantile' or opt == 'winsorize_lower_quantile': - if not self._quantilesDone: - return self._format_winsorize_image_intensities() - else: - self._quantilesDone = False - return '' # Must return something for argstr! + return self._format_winsorize_image_intensities() + # This feature was removed from recent versions of antsRegistration due to corrupt outputs. # elif opt == 'collapse_linear_transforms_to_fixed_image_header': # return self._formatCollapseLinearTransformsToFixedImageHeader() return super(RegistrationInputSpec, self)._format_arg(opt, spec, val) + def _format_metric(self, index): + """ + Format the antsRegistration -m metric argument(s). + + Parameters + ---------- + index: the stage index + """ + # The metric name input for the current stage. + name_input = self.metric[index] + # The stage-specific input dictionary. + stage_inputs = dict( + fixed_image=self.fixed_image[0], + moving_image=self.moving_image[0], + metric=name_input, + weight=self.metric_weight[index], + radius_or_bins=self.radius_or_number_of_bins[index], + optional=self.radius_or_number_of_bins[index] + ) + # The optional sampling strategy and percentage. + if isdefined(self.sampling_strategy) and self.sampling_strategy: + sampling_strategy = self.sampling_strategy[index] + if sampling_strategy: + stage_inputs['sampling_strategy'] = sampling_strategy + if isdefined(self.sampling_percentage) and self.sampling_percentage: + sampling_percentage = self.sampling_percentage[index] + if sampling_percentage: + stage_inputs['sampling_percentage'] = sampling_percentage + + # Make a list of metric specifications, one per -m command line + # argument for the current stage. + # If there are multiple inputs for this stage, then convert the + # dictionary of list inputs into a list of metric specifications. + # Otherwise, make a singleton list of the metric specification + # from the non-list inputs. + if isinstance(name_input, list): + items = list(stage_inputs.items()) + indexes = list(range(0, len(name_input))) + specs = list() + for i in indexes: + temp = dict([(k, v[i]) for k, v in items]) + if len(self.fixed_image) == 1: + temp["fixed_image"] = self.fixed_image[0] + else: + temp["fixed_image"] = self.fixed_image[i] + + if len(self.moving_image) == 1: + temp["moving_image"] = self.moving_image[0] + else: + temp["moving_image"] = self.moving_image[i] + + specs.append(temp) + else: + specs = [stage_inputs] + + # Format the --metric command line metric arguments, one per + # specification. + return [self._format_metric_argument(**spec) for spec in specs] + + @staticmethod + def _format_metric_argument(**kwargs): + retval = '%s[ %s, %s, %g, %d' % (kwargs['metric'], + kwargs['fixed_image'], + kwargs['moving_image'], + kwargs['weight'], + kwargs['radius_or_bins']) + + # The optional sampling strategy. + if 'sampling_strategy' in kwargs: + sampling_strategy = kwargs['sampling_strategy'] + elif 'sampling_percentage' in kwargs: + # The sampling percentage is specified but not the + # sampling strategy. Use the default strategy. + sampling_strategy = Registration.DEF_SAMPLING_STRATEGY + else: + sampling_strategy = None + # Format the optional sampling arguments. + if sampling_strategy: + retval += ', %s' % sampling_strategy + if 'sampling_percentage' in kwargs: + retval += ', %g' % kwargs['sampling_percentage'] + + retval += ' ]' + + return retval + + def _format_transform(self, index): + retval = [] + retval.append('%s[ ' % self.transforms[index]) + parameters = ', '.join([str( + element) for element in self.transform_parameters[index]]) + retval.append('%s' % parameters) + retval.append(' ]') + return "".join(retval) + + def _format_registration(self): + retval = [] + for ii in range(len(self.transforms)): + retval.append('--transform %s' % (self._format_transform(ii))) + for metric in self._format_metric(ii): + retval.append('--metric %s' % metric) + retval.append('--convergence %s' % self._format_convergence(ii)) + if isdefined(self.sigma_units): + retval.append('--smoothing-sigmas %s%s' % + (self._format_xarray(self.smoothing_sigmas[ii]), + self.sigma_units[ii])) + else: + retval.append('--smoothing-sigmas %s' % + self._format_xarray(self.smoothing_sigmas[ii])) + retval.append('--shrink-factors %s' % + self._format_xarray(self.shrink_factors[ii])) + if isdefined(self.use_estimate_learning_rate_once): + retval.append('--use-estimate-learning-rate-once %d' % + self.use_estimate_learning_rate_once[ii]) + if isdefined(self.use_histogram_matching): + # use_histogram_matching is either a common flag for all transforms + # or a list of transform-specific flags + if isinstance(self.use_histogram_matching, bool): + histval = self.use_histogram_matching + else: + histval = self.use_histogram_matching[ii] + retval.append('--use-histogram-matching %d' % histval) + return " ".join(retval) + + def _get_outputfilenames(self, inverse=False): + output_filename = None + if not inverse: + if isdefined(self.output_warped_image) and \ + self.output_warped_image: + output_filename = self.output_warped_image + if isinstance(output_filename, bool): + output_filename = '%s_Warped.nii.gz' % self.output_transform_prefix + else: + output_filename = output_filename + return output_filename + inv_output_filename = None + if isdefined(self.output_inverse_warped_image) and \ + self.output_inverse_warped_image: + inv_output_filename = self.output_inverse_warped_image + if isinstance(inv_output_filename, bool): + inv_output_filename = '%s_InverseWarped.nii.gz' % self.output_transform_prefix + else: + inv_output_filename = inv_output_filename + return inv_output_filename + + def _format_convergence(self, ii): + convergence_iter = self._format_xarray(self.number_of_iterations[ii]) + if len(self.convergence_threshold) > ii: + convergence_value = self.convergence_threshold[ii] + else: + convergence_value = self.convergence_threshold[0] + if len(self.convergence_window_size) > ii: + convergence_ws = self.convergence_window_size[ii] + else: + convergence_ws = self.convergence_window_size[0] + return '[ %s, %g, %d ]' % (convergence_iter, convergence_value, convergence_ws) + + def _format_winsorize_image_intensities(self): + if not self.winsorize_upper_quantile > self.winsorize_lower_quantile: + raise RuntimeError("Upper bound MUST be more than lower bound: %g > %g" + % (self.winsorize_upper_quantile, self.winsorize_lower_quantile)) + return '--winsorize-image-intensities [ %s, %s ]' % (self.winsorize_lower_quantile, + self.winsorize_upper_quantile) + + + def _output_filenames(self, prefix, count, transform, inverse=False): + self.low_dimensional_transform_map = {'Rigid': 'Rigid.mat', + 'Affine': 'Affine.mat', + 'GenericAffine': 'GenericAffine.mat', + 'CompositeAffine': 'Affine.mat', + 'Similarity': 'Similarity.mat', + 'Translation': 'Translation.mat', + 'BSpline': 'BSpline.txt', + 'Initial': 'DerivedInitialMovingTranslation.mat'} + if transform in list(self.low_dimensional_transform_map.keys()): + suffix = self.low_dimensional_transform_map[transform] + inverse_mode = inverse + else: + inverse_mode = False # These are not analytically invertable + if inverse: + suffix = 'InverseWarp.nii.gz' + else: + suffix = 'Warp.nii.gz' + return '%s%d%s' % (prefix, count, suffix), inverse_mode + + class RegistrationOutputSpec(TraitedSpec): forward_transforms = traits.List( File(exists=True), desc='List of output transforms for forward registration') @@ -496,7 +682,7 @@ class Registration(ANTSCommand): --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] \ --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] \ --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 \ ---use-histogram-matching 1 --winsorize-image-intensities [ 0.025, 1.0 ] --write-composite-transform 1' +--use-histogram-matching 1 --winsorize-image-intensities [ 0.025, 1.0 ] --write-composite-transform 1' >>> reg1.run() # doctest: +SKIP >>> reg2 = copy.deepcopy(reg) @@ -509,7 +695,7 @@ class Registration(ANTSCommand): --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] \ --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] \ --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 \ ---use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 0.975 ] --write-composite-transform 1' +--use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 0.975 ] --write-composite-transform 1' >>> reg3 = copy.deepcopy(reg) >>> reg3.inputs.winsorize_lower_quantile = 0.025 @@ -522,7 +708,7 @@ class Registration(ANTSCommand): --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] \ --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] \ --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 \ ---use-histogram-matching 1 --winsorize-image-intensities [ 0.025, 0.975 ] --write-composite-transform 1' +--use-histogram-matching 1 --winsorize-image-intensities [ 0.025, 0.975 ] --write-composite-transform 1' >>> reg3a = copy.deepcopy(reg) >>> reg3a.inputs.float = True @@ -534,7 +720,7 @@ class Registration(ANTSCommand): --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 \ --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] \ --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 \ ---use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] \ +--use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] \ --write-composite-transform 1' >>> reg3b = copy.deepcopy(reg) @@ -547,7 +733,7 @@ class Registration(ANTSCommand): --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 \ --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] \ --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 \ ---use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] \ +--use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] \ --write-composite-transform 1' >>> # Test collapse transforms flag @@ -556,8 +742,7 @@ class Registration(ANTSCommand): >>> reg4.inputs.restore_state = 'trans.mat' >>> reg4.inputs.initialize_transforms_per_stage = True >>> reg4.inputs.collapse_output_transforms = True - >>> outputs = reg4._list_outputs() - >>> pprint.pprint(outputs) # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE + >>> pprint.pprint(reg4.outputs) # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE {'composite_transform': '.../nipype/testing/data/output_Composite.h5', 'forward_invert_flags': [], 'forward_transforms': [], @@ -575,14 +760,14 @@ class Registration(ANTSCommand): --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 \ --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] \ --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 \ ---use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] \ +--use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] \ --write-composite-transform 1' >>> # Test collapse transforms flag >>> reg4b = copy.deepcopy(reg4) >>> reg4b.inputs.write_composite_transform = False >>> outputs = reg4b._list_outputs() - >>> pprint.pprint(outputs) # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE + >>> pprint.pprint(reg4b.outputs) # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE {'composite_transform': , 'forward_invert_flags': [False, False], 'forward_transforms': ['.../nipype/testing/data/output_0GenericAffine.mat', @@ -603,7 +788,7 @@ class Registration(ANTSCommand): --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 \ --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] \ --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 \ ---use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] \ +--use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] \ --write-composite-transform 0' >>> # Test multiple metrics per stage @@ -624,7 +809,7 @@ class Registration(ANTSCommand): --metric Mattes[ fixed1.nii, moving1.nii, 0.5, 32, None, 0.05 ] \ --metric CC[ fixed1.nii, moving1.nii, 0.5, 4, None, 0.1 ] --convergence [ 100x50x30, 1e-09, 20 ] \ --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 \ ---use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' +--use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' >>> # Test multiple inputs >>> reg6 = copy.deepcopy(reg5) @@ -639,7 +824,7 @@ class Registration(ANTSCommand): --metric Mattes[ fixed1.nii, moving1.nii, 0.5, 32, None, 0.05 ] \ --metric CC[ fixed2.nii, moving2.nii, 0.5, 4, None, 0.1 ] --convergence [ 100x50x30, 1e-09, 20 ] \ --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 \ ---use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' +--use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' >>> # Test Interpolation Parameters (BSpline) >>> reg7a = copy.deepcopy(reg) @@ -653,7 +838,7 @@ class Registration(ANTSCommand): --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] \ --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] \ --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 \ ---use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' +--use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' >>> # Test Interpolation Parameters (MultiLabel/Gaussian) >>> reg7b = copy.deepcopy(reg) @@ -667,7 +852,7 @@ class Registration(ANTSCommand): --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 \ --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] \ --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 \ ---use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] \ +--use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] \ --write-composite-transform 1' >>> # Test Extended Transform Parameters @@ -682,7 +867,7 @@ class Registration(ANTSCommand): --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform BSplineSyN[ 0.25, 26, 0, 3 ] \ --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] \ --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 \ ---use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' +--use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' """ DEF_SAMPLING_STRATEGY = 'None' """The default sampling strategy argument.""" @@ -690,195 +875,8 @@ class Registration(ANTSCommand): _cmd = 'antsRegistration' input_spec = RegistrationInputSpec output_spec = RegistrationOutputSpec - _quantilesDone = False _linear_transform_names = ['Rigid', 'Affine', 'Translation', 'CompositeAffine', 'Similarity'] - def _format_metric(self, index): - """ - Format the antsRegistration -m metric argument(s). - - Parameters - ---------- - index: the stage index - """ - # The metric name input for the current stage. - name_input = self.inputs.metric[index] - # The stage-specific input dictionary. - stage_inputs = dict( - fixed_image=self.inputs.fixed_image[0], - moving_image=self.inputs.moving_image[0], - metric=name_input, - weight=self.inputs.metric_weight[index], - radius_or_bins=self.inputs.radius_or_number_of_bins[index], - optional=self.inputs.radius_or_number_of_bins[index] - ) - # The optional sampling strategy and percentage. - if isdefined(self.inputs.sampling_strategy) and self.inputs.sampling_strategy: - sampling_strategy = self.inputs.sampling_strategy[index] - if sampling_strategy: - stage_inputs['sampling_strategy'] = sampling_strategy - if isdefined(self.inputs.sampling_percentage) and self.inputs.sampling_percentage: - sampling_percentage = self.inputs.sampling_percentage[index] - if sampling_percentage: - stage_inputs['sampling_percentage'] = sampling_percentage - - # Make a list of metric specifications, one per -m command line - # argument for the current stage. - # If there are multiple inputs for this stage, then convert the - # dictionary of list inputs into a list of metric specifications. - # Otherwise, make a singleton list of the metric specification - # from the non-list inputs. - if isinstance(name_input, list): - items = list(stage_inputs.items()) - indexes = list(range(0, len(name_input))) - specs = list() - for i in indexes: - temp = dict([(k, v[i]) for k, v in items]) - if len(self.inputs.fixed_image) == 1: - temp["fixed_image"] = self.inputs.fixed_image[0] - else: - temp["fixed_image"] = self.inputs.fixed_image[i] - - if len(self.inputs.moving_image) == 1: - temp["moving_image"] = self.inputs.moving_image[0] - else: - temp["moving_image"] = self.inputs.moving_image[i] - - specs.append(temp) - else: - specs = [stage_inputs] - - # Format the --metric command line metric arguments, one per - # specification. - return [self._format_metric_argument(**spec) for spec in specs] - - @staticmethod - def _format_metric_argument(**kwargs): - retval = '%s[ %s, %s, %g, %d' % (kwargs['metric'], - kwargs['fixed_image'], - kwargs['moving_image'], - kwargs['weight'], - kwargs['radius_or_bins']) - - # The optional sampling strategy. - if 'sampling_strategy' in kwargs: - sampling_strategy = kwargs['sampling_strategy'] - elif 'sampling_percentage' in kwargs: - # The sampling percentage is specified but not the - # sampling strategy. Use the default strategy. - sampling_strategy = Registration.DEF_SAMPLING_STRATEGY - else: - sampling_strategy = None - # Format the optional sampling arguments. - if sampling_strategy: - retval += ', %s' % sampling_strategy - if 'sampling_percentage' in kwargs: - retval += ', %g' % kwargs['sampling_percentage'] - - retval += ' ]' - - return retval - - def _format_transform(self, index): - retval = [] - retval.append('%s[ ' % self.inputs.transforms[index]) - parameters = ', '.join([str( - element) for element in self.inputs.transform_parameters[index]]) - retval.append('%s' % parameters) - retval.append(' ]') - return "".join(retval) - - def _format_registration(self): - retval = [] - for ii in range(len(self.inputs.transforms)): - retval.append('--transform %s' % (self._format_transform(ii))) - for metric in self._format_metric(ii): - retval.append('--metric %s' % metric) - retval.append('--convergence %s' % self._format_convergence(ii)) - if isdefined(self.inputs.sigma_units): - retval.append('--smoothing-sigmas %s%s' % - (self._format_xarray(self.inputs.smoothing_sigmas[ii]), - self.inputs.sigma_units[ii])) - else: - retval.append('--smoothing-sigmas %s' % - self._format_xarray(self.inputs.smoothing_sigmas[ii])) - retval.append('--shrink-factors %s' % - self._format_xarray(self.inputs.shrink_factors[ii])) - if isdefined(self.inputs.use_estimate_learning_rate_once): - retval.append('--use-estimate-learning-rate-once %d' % - self.inputs.use_estimate_learning_rate_once[ii]) - if isdefined(self.inputs.use_histogram_matching): - # use_histogram_matching is either a common flag for all transforms - # or a list of transform-specific flags - if isinstance(self.inputs.use_histogram_matching, bool): - histval = self.inputs.use_histogram_matching - else: - histval = self.inputs.use_histogram_matching[ii] - retval.append('--use-histogram-matching %d' % histval) - return " ".join(retval) - - def _get_outputfilenames(self, inverse=False): - output_filename = None - if not inverse: - if isdefined(self.inputs.output_warped_image) and \ - self.inputs.output_warped_image: - output_filename = self.inputs.output_warped_image - if isinstance(output_filename, bool): - output_filename = '%s_Warped.nii.gz' % self.inputs.output_transform_prefix - else: - output_filename = output_filename - return output_filename - inv_output_filename = None - if isdefined(self.inputs.output_inverse_warped_image) and \ - self.inputs.output_inverse_warped_image: - inv_output_filename = self.inputs.output_inverse_warped_image - if isinstance(inv_output_filename, bool): - inv_output_filename = '%s_InverseWarped.nii.gz' % self.inputs.output_transform_prefix - else: - inv_output_filename = inv_output_filename - return inv_output_filename - - def _format_convergence(self, ii): - convergence_iter = self._format_xarray(self.inputs.number_of_iterations[ii]) - if len(self.inputs.convergence_threshold) > ii: - convergence_value = self.inputs.convergence_threshold[ii] - else: - convergence_value = self.inputs.convergence_threshold[0] - if len(self.inputs.convergence_window_size) > ii: - convergence_ws = self.inputs.convergence_window_size[ii] - else: - convergence_ws = self.inputs.convergence_window_size[0] - return '[ %s, %g, %d ]' % (convergence_iter, convergence_value, convergence_ws) - - def _format_winsorize_image_intensities(self): - if not self.inputs.winsorize_upper_quantile > self.inputs.winsorize_lower_quantile: - raise RuntimeError("Upper bound MUST be more than lower bound: %g > %g" - % (self.inputs.winsorize_upper_quantile, self.inputs.winsorize_lower_quantile)) - self._quantilesDone = True - return '--winsorize-image-intensities [ %s, %s ]' % (self.inputs.winsorize_lower_quantile, - self.inputs.winsorize_upper_quantile) - - - def _output_filenames(self, prefix, count, transform, inverse=False): - self.low_dimensional_transform_map = {'Rigid': 'Rigid.mat', - 'Affine': 'Affine.mat', - 'GenericAffine': 'GenericAffine.mat', - 'CompositeAffine': 'Affine.mat', - 'Similarity': 'Similarity.mat', - 'Translation': 'Translation.mat', - 'BSpline': 'BSpline.txt', - 'Initial': 'DerivedInitialMovingTranslation.mat'} - if transform in list(self.low_dimensional_transform_map.keys()): - suffix = self.low_dimensional_transform_map[transform] - inverse_mode = inverse - else: - inverse_mode = False # These are not analytically invertable - if inverse: - suffix = 'InverseWarp.nii.gz' - else: - suffix = 'Warp.nii.gz' - return '%s%d%s' % (prefix, count, suffix), inverse_mode - def _post_run(self): self.outputs.forward_transforms = [] self.outputs.forward_invert_flags = [] diff --git a/nipype/interfaces/ants/resampling.py b/nipype/interfaces/ants/resampling.py index edd242fba2..ece2a0803a 100644 --- a/nipype/interfaces/ants/resampling.py +++ b/nipype/interfaces/ants/resampling.py @@ -18,12 +18,14 @@ class WarpTimeSeriesImageMultiTransformInputSpec(ANTSCommandInputSpec): dimension = traits.Enum(4, 3, argstr='%d', usedefault=True, desc='image dimension (3 or 4)', position=1) - input_image = File(argstr='%s', mandatory=True, copyfile=True, - desc=('image to apply transformation to (generally a ' - 'coregistered functional)')) - out_postfix = traits.Str('_wtsimt', argstr='%s', usedefault=True, - desc=('Postfix that is prepended to all output ' - 'files (default = _wtsimt)')) + input_image = File( + argstr='%s', mandatory=True, copyfile=True, + desc='image to apply transformation to (generally a coregistered functional)') + output_image = File(name_source='input_image', name_template='%s_wtsimt', argstr='%s', + keep_extension=True, desc='filename of output warped image') + out_postfix = traits.Str( + '_wtsimt', argstr='%s', deprecated=True, new_name='output_image', + desc='Postfix that is prepended to all output files (default = _wtsimt)') reference_image = File(argstr='-R %s', xor=['tightest_box'], desc='reference image space that you wish to warp INTO') tightest_box = traits.Bool(argstr='--tightest-bounding-box', @@ -46,6 +48,20 @@ class WarpTimeSeriesImageMultiTransformInputSpec(ANTSCommandInputSpec): 'E.g.: [1,4,5] inverts the 1st, 4th, and 5th Affines ' 'found in transformation_series')) + def _format_arg(self, opt, spec, val): + if opt == 'transformation_series': + series = [] + affine_counter = 0 + for transformation in val: + if 'Affine' in transformation and \ + isdefined(self.invert_affine): + affine_counter += 1 + if affine_counter in self.invert_affine: + series += ['-i'], + series += [transformation] + return ' '.join(series) + return super( + WarpTimeSeriesImageMultiTransformInputSpec, self)._format_arg(opt, spec, val) class WarpTimeSeriesImageMultiTransformOutputSpec(TraitedSpec): output_image = File(exists=True, desc='Warped image') @@ -72,31 +88,6 @@ class WarpTimeSeriesImageMultiTransform(ANTSCommand): input_spec = WarpTimeSeriesImageMultiTransformInputSpec output_spec = WarpTimeSeriesImageMultiTransformOutputSpec - def _format_arg(self, opt, spec, val): - if opt == 'out_postfix': - _, name, ext = split_filename( - os.path.abspath(self.inputs.input_image)) - return name + val + ext - if opt == 'transformation_series': - series = [] - affine_counter = 0 - for transformation in val: - if 'Affine' in transformation and \ - isdefined(self.inputs.invert_affine): - affine_counter += 1 - if affine_counter in self.inputs.invert_affine: - series += ['-i'], - series += [transformation] - return ' '.join(series) - return super(WarpTimeSeriesImageMultiTransform, self)._format_arg(opt, spec, val) - - def _post_run(self): - _, name, ext = split_filename(os.path.abspath(self.inputs.input_image)) - self.outputs.output_image = os.path.join(os.getcwd(), - ''.join((name, - self.inputs.out_postfix, - ext))) - def _run_interface(self, runtime, correct_return_codes=[0]): runtime = super(WarpTimeSeriesImageMultiTransform, self)._run_interface(runtime, correct_return_codes=[0, 1]) if "100 % complete" not in runtime.stdout: @@ -110,11 +101,12 @@ class WarpImageMultiTransformInputSpec(ANTSCommandInputSpec): input_image = File(argstr='%s', mandatory=True, desc=('image to apply transformation to (generally a ' 'coregistered functional)'), position=2) - output_image = File(genfile=True, hash_files=False, argstr='%s', - desc='name of the output warped image', position=3, xor=['out_postfix']) - out_postfix = File("_wimt", usedefault=True, hash_files=False, - desc=('Postfix that is prepended to all output ' - 'files (default = _wimt)'), xor=['output_image']) + output_image = File(name_source='input_image', name_template='%s_wimt', argstr='%s', + keep_extension=True, desc='filename of output warped image') + out_postfix = File( + "_wimt", usedefault=True, hash_files=False, deprecated=True, new_name='output_image', + desc=('Postfix that is prepended to all output files (default = _wimt)'), + xor=['output_image']) reference_image = File(argstr='-R %s', xor=['tightest_box'], desc='reference image space that you wish to warp INTO') tightest_box = traits.Bool(argstr='--tightest-bounding-box', @@ -140,6 +132,20 @@ class WarpImageMultiTransformInputSpec(ANTSCommandInputSpec): 'transformations are distinguished ' 'from warp fields by the word "affine" included in their filenames.')) + def _format_arg(self, opt, spec, val): + if opt == 'transformation_series': + series = [] + affine_counter = 0 + for transformation in val: + if "affine" in transformation.lower() and \ + isdefined(self.invert_affine): + affine_counter += 1 + if affine_counter in self.invert_affine: + series += '-i', + series += [transformation] + return ' '.join(series) + return super(WarpImageMultiTransformInputSpec, self)._format_arg(opt, spec, val) + class WarpImageMultiTransformOutputSpec(TraitedSpec): output_image = File(exists=True, desc='Warped image') @@ -176,34 +182,6 @@ class WarpImageMultiTransform(ANTSCommand): input_spec = WarpImageMultiTransformInputSpec output_spec = WarpImageMultiTransformOutputSpec - def _gen_filename(self, name): - if name == 'output_image': - _, name, ext = split_filename( - os.path.abspath(self.inputs.input_image)) - return ''.join((name, self.inputs.out_postfix, ext)) - return None - - def _format_arg(self, opt, spec, val): - if opt == 'transformation_series': - series = [] - affine_counter = 0 - for transformation in val: - if "affine" in transformation.lower() and \ - isdefined(self.inputs.invert_affine): - affine_counter += 1 - if affine_counter in self.inputs.invert_affine: - series += '-i', - series += [transformation] - return ' '.join(series) - return super(WarpImageMultiTransform, self)._format_arg(opt, spec, val) - - def _post_run(self): - if isdefined(self.inputs.output_image): - self.outputs.output_image = os.path.abspath(self.inputs.output_image) - else: - self.outputs.output_image = os.path.abspath( - self._gen_filename('output_image')) - class ApplyTransformsInputSpec(ANTSCommandInputSpec): dimension = traits.Enum(2, 3, 4, argstr='--dimensionality %d', @@ -220,8 +198,8 @@ class ApplyTransformsInputSpec(ANTSCommandInputSpec): desc=('image to apply transformation to (generally a ' 'coregistered functional)'), exists=True) - output_image = traits.Str(argstr='--output %s', desc='output file name', - genfile=True, hash_files=False) + output_image = File(name_source='input_image', name_template='%s_warped', keep_extension=True, + argstr='--output %s', desc='output file name', hash_files=False) out_postfix = traits.Str("_trans", usedefault=True, desc=('Postfix that is appended to all output ' 'files (default = _trans)')) @@ -246,10 +224,46 @@ class ApplyTransformsInputSpec(ANTSCommandInputSpec): File(exists=True), argstr='%s', mandatory=True, desc='transform files: will be applied in reverse order. For example, the last specified transform will be applied first') invert_transform_flags = InputMultiPath(traits.Bool()) default_value = traits.Float(0.0, argstr='--default-value %g', usedefault=True) - print_out_composite_warp_file = traits.Bool(False, requires=["output_image"], - desc='output a composite warp file instead of a transformed image') + print_out_composite_warp_file = traits.Bool( + False, usedefault=True, desc='output a composite warp file instead of a transformed image') float = traits.Bool(argstr='--float %d', default=False, desc='Use float instead of double for computations.') + def _get_transform_filenames(self): + retval = [] + for ii in range(len(self.transforms)): + if isdefined(self.invert_transform_flags): + if len(self.transforms) == len(self.invert_transform_flags): + invert_code = 1 if self.invert_transform_flags[ + ii] else 0 + retval.append("--transform [ %s, %d ]" % + (self.transforms[ii], invert_code)) + else: + raise Exception(("ERROR: The useInverse list must have the same number " + "of entries as the transformsFileName list.")) + else: + retval.append("--transform %s" % self.transforms[ii]) + return " ".join(retval) + + def _format_arg(self, opt, spec, val): + retval = super(ApplyTransformsInputSpec, self)._format_arg(opt, spec, val) + + if opt == "output_image": + if self.print_out_composite_warp_file: + modval = super(ApplyTransformsInputSpec, + self)._format_arg('print_out_composite_warp_file') + return '--output [ ' + retval[6:] + ', ' + modval + ' ]' + elif opt == "transforms": + return self._get_transform_filenames() + elif opt == 'interpolation': + if self.interpolation in ['BSpline', 'MultiLabel', 'Gaussian'] and \ + isdefined(self.interpolation_parameters): + return '--interpolation %s[ %s ]' % (self.interpolation, + ', '.join([str(param) + for param in self.interpolation_parameters])) + else: + return '--interpolation %s' % self.interpolation + return retval + class ApplyTransformsOutputSpec(TraitedSpec): output_image = File(exists=True, desc='Warped image') @@ -298,57 +312,6 @@ class ApplyTransforms(ANTSCommand): input_spec = ApplyTransformsInputSpec output_spec = ApplyTransformsOutputSpec - def _gen_filename(self, name): - if name == 'output_image': - output = self.inputs.output_image - if not isdefined(output): - _, name, ext = split_filename(self.inputs.input_image) - output = name + self.inputs.out_postfix + ext - return output - return None - - def _get_transform_filenames(self): - retval = [] - for ii in range(len(self.inputs.transforms)): - if isdefined(self.inputs.invert_transform_flags): - if len(self.inputs.transforms) == len(self.inputs.invert_transform_flags): - invert_code = 1 if self.inputs.invert_transform_flags[ - ii] else 0 - retval.append("--transform [ %s, %d ]" % - (self.inputs.transforms[ii], invert_code)) - else: - raise Exception(("ERROR: The useInverse list must have the same number " - "of entries as the transformsFileName list.")) - else: - retval.append("--transform %s" % self.inputs.transforms[ii]) - return " ".join(retval) - - def _get_output_warped_filename(self): - if isdefined(self.inputs.print_out_composite_warp_file): - return "--output [ %s, %d ]" % (self._gen_filename("output_image"), - int(self.inputs.print_out_composite_warp_file)) - else: - return "--output %s" % (self._gen_filename("output_image")) - - def _format_arg(self, opt, spec, val): - if opt == "output_image": - return self._get_output_warped_filename() - elif opt == "transforms": - return self._get_transform_filenames() - elif opt == 'interpolation': - if self.inputs.interpolation in ['BSpline', 'MultiLabel', 'Gaussian'] and \ - isdefined(self.inputs.interpolation_parameters): - return '--interpolation %s[ %s ]' % (self.inputs.interpolation, - ', '.join([str(param) - for param in self.inputs.interpolation_parameters])) - else: - return '--interpolation %s' % self.inputs.interpolation - return super(ApplyTransforms, self)._format_arg(opt, spec, val) - - def _post_run(self): - self.outputs.output_image = os.path.abspath( - self._gen_filename('output_image')) - class ApplyTransformsToPointsInputSpec(ANTSCommandInputSpec): dimension = traits.Enum(2, 3, 4, argstr='--dimensionality %d', @@ -375,6 +338,27 @@ class ApplyTransformsToPointsInputSpec(ANTSCommandInputSpec): invert_transform_flags = traits.List(traits.Bool(), desc='list indicating if a transform should be reversed') + def _get_transform_filenames(self): + retval = [] + for ii in range(len(self.transforms)): + if isdefined(self.invert_transform_flags): + if len(self.transforms) == len(self.invert_transform_flags): + invert_code = 1 if self.invert_transform_flags[ + ii] else 0 + retval.append("--transform [ %s, %d ]" % + (self.transforms[ii], invert_code)) + else: + raise Exception(("ERROR: The useInverse list must have the same number " + "of entries as the transformsFileName list.")) + else: + retval.append("--transform %s" % self.transforms[ii]) + return " ".join(retval) + + def _format_arg(self, opt, spec, val): + if opt == "transforms": + return self._get_transform_filenames() + return super(ApplyTransformsToPointsInputSpec, self)._format_arg(opt, spec, val) + class ApplyTransformsToPointsOutputSpec(TraitedSpec): output_file = File(exists=True, desc='csv file with transformed coordinates') @@ -402,24 +386,3 @@ class ApplyTransformsToPoints(ANTSCommand): _cmd = 'antsApplyTransformsToPoints' input_spec = ApplyTransformsToPointsInputSpec output_spec = ApplyTransformsToPointsOutputSpec - - def _get_transform_filenames(self): - retval = [] - for ii in range(len(self.inputs.transforms)): - if isdefined(self.inputs.invert_transform_flags): - if len(self.inputs.transforms) == len(self.inputs.invert_transform_flags): - invert_code = 1 if self.inputs.invert_transform_flags[ - ii] else 0 - retval.append("--transform [ %s, %d ]" % - (self.inputs.transforms[ii], invert_code)) - else: - raise Exception(("ERROR: The useInverse list must have the same number " - "of entries as the transformsFileName list.")) - else: - retval.append("--transform %s" % self.inputs.transforms[ii]) - return " ".join(retval) - - def _format_arg(self, opt, spec, val): - if opt == "transforms": - return self._get_transform_filenames() - return super(ApplyTransformsToPoints, self)._format_arg(opt, spec, val) diff --git a/nipype/interfaces/ants/segmentation.py b/nipype/interfaces/ants/segmentation.py index 525c19664e..cd9bf36795 100644 --- a/nipype/interfaces/ants/segmentation.py +++ b/nipype/interfaces/ants/segmentation.py @@ -47,11 +47,57 @@ class AtroposInputSpec(ANTSCommandInputSpec): usedefault=True) use_mixture_model_proportions = traits.Bool( requires=['posterior_formulation']) - out_classified_image_name = File(argstr="%s", genfile=True, - hash_files=False) - save_posteriors = traits.Bool() - output_posteriors_name_template = traits.Str('POSTERIOR_%02d.nii.gz', - usedefault=True) + out_classified_image_name = File( + name_source='intensity_images', name_template='%s_labeled', keep_extension=True, + argstr='--output [%s]', hash_files=False) + save_posteriors = traits.Bool(False, usedefault=True, desc='save posterior probability maps') + posteriors = File('posterior_%02d.nii.gz', usedefault=True) + + def _format_arg(self, opt, spec, val): + if opt == 'initialization': + retval = "--initialization %s[%d" % (val, + self.number_of_tissue_classes) + if val == "PriorProbabilityImages": + _, _, ext = split_filename( + self.prior_probability_images[0]) + retval += ",priors/priorProbImages%02d" + \ + ext + ",%g" % self.prior_weighting + if isdefined(self.prior_probability_threshold): + retval += ",%g" % self.prior_probability_threshold + return retval + "]" + if opt == 'mrf_smoothing_factor': + retval = "--mrf [%g" % val + if isdefined(self.mrf_radius): + retval += ",%s" % self._format_xarray([str(s) for s in self.mrf_radius]) + return retval + "]" + if opt == "icm_use_synchronous_update": + retval = "--icm [%d" % val + if isdefined(self.maximum_number_of_icm_terations): + retval += ",%g" % self.maximum_number_of_icm_terations + return retval + "]" + if opt == "n_iterations": + retval = "--convergence [%d" % val + if isdefined(self.convergence_threshold): + retval += ",%g" % self.convergence_threshold + return retval + "]" + if opt == "posterior_formulation": + retval = "--posterior-formulation %s" % val + if isdefined(self.use_mixture_model_proportions): + retval += "[%d]" % self.use_mixture_model_proportions + return retval + if opt == "out_classified_image_name": + retval = super(AtroposInputSpec, self)._format_arg(opt, spec, val) + if self.save_posteriors: + retval = retval[:-1] + ', ' + super( + AtroposInputSpec, self)._format_arg('posteriors') + ']' + return retval + return super(AtroposInputSpec, self)._format_arg(opt, spec, val) + + def parse_args(self, skip=None): + if skip is None: + skip = [] + skip += ['save_posteriors', 'posteriors'] + return super(AtroposInputSpec, self).parse_args(skip=skip) class AtroposOutputSpec(TraitedSpec): @@ -99,45 +145,6 @@ class Atropos(ANTSCommand): output_spec = AtroposOutputSpec _cmd = 'Atropos' - def _format_arg(self, opt, spec, val): - if opt == 'initialization': - retval = "--initialization %s[%d" % (val, - self.inputs.number_of_tissue_classes) - if val == "PriorProbabilityImages": - _, _, ext = split_filename( - self.inputs.prior_probability_images[0]) - retval += ",priors/priorProbImages%02d" + \ - ext + ",%g" % self.inputs.prior_weighting - if isdefined(self.inputs.prior_probability_threshold): - retval += ",%g" % self.inputs.prior_probability_threshold - return retval + "]" - if opt == 'mrf_smoothing_factor': - retval = "--mrf [%g" % val - if isdefined(self.inputs.mrf_radius): - retval += ",%s" % self._format_xarray([str(s) for s in self.inputs.mrf_radius]) - return retval + "]" - if opt == "icm_use_synchronous_update": - retval = "--icm [%d" % val - if isdefined(self.inputs.maximum_number_of_icm_terations): - retval += ",%g" % self.inputs.maximum_number_of_icm_terations - return retval + "]" - if opt == "n_iterations": - retval = "--convergence [%d" % val - if isdefined(self.inputs.convergence_threshold): - retval += ",%g" % self.inputs.convergence_threshold - return retval + "]" - if opt == "posterior_formulation": - retval = "--posterior-formulation %s" % val - if isdefined(self.inputs.use_mixture_model_proportions): - retval += "[%d]" % self.inputs.use_mixture_model_proportions - return retval - if opt == "out_classified_image_name": - retval = "--output [%s" % val - if isdefined(self.inputs.save_posteriors): - retval += ",%s" % self.inputs.output_posteriors_name_template - return retval + "]" - return super(ANTSCommand, self)._format_arg(opt, spec, val) - def _run_interface(self, runtime, correct_return_codes=[0]): if self.inputs.initialization == "PriorProbabilityImages": priors_directory = os.path.join(os.getcwd(), "priors") @@ -153,23 +160,6 @@ def _run_interface(self, runtime, correct_return_codes=[0]): runtime = super(Atropos, self)._run_interface(runtime) return runtime - def _gen_filename(self, name): - if name == 'out_classified_image_name': - output = self.inputs.out_classified_image_name - if not isdefined(output): - _, name, ext = split_filename(self.inputs.intensity_images[0]) - output = name + '_labeled' + ext - return output - return None - - def _post_run(self): - self.outputs.classified_image = os.path.abspath( - self._gen_filename('out_classified_image_name')) - if isdefined(self.inputs.save_posteriors) and self.inputs.save_posteriors: - self.outputs.posteriors = [] - for i in range(self.inputs.number_of_tissue_classes): - self.outputs.posteriors.append(os.path.abspath(self.inputs.output_posteriors_name_template % (i + 1))) - class LaplacianThicknessInputSpec(ANTSCommandInputSpec): input_wm = File(argstr='%s', mandatory=True, copyfile=True, @@ -228,7 +218,7 @@ def _post_run(self): ''.join((name, self.inputs.output_image, ext))) - + class N4BiasFieldCorrectionInputSpec(ANTSCommandInputSpec): dimension = traits.Enum(3, 2, argstr='-d %d', @@ -239,9 +229,10 @@ class N4BiasFieldCorrectionInputSpec(ANTSCommandInputSpec): 'coregistered functional)')) mask_image = File(argstr='--mask-image %s') weight_image = File(argstr='--weight-image %s') - output_image = traits.Str(argstr='--output %s', - desc='output file name', genfile=True, - hash_files=False) + output_image = File( + name_source='input_image', name_template='%s_corrected', + argstr='--output %s', desc='output file name', keep_extension=True, + hash_files=False) bspline_fitting_distance = traits.Float(argstr="--bspline-fitting %s") bspline_order = traits.Int(requires=['bspline_fitting_distance']) shrink_factor = traits.Int(argstr="--shrink-factor %d") @@ -250,9 +241,41 @@ class N4BiasFieldCorrectionInputSpec(ANTSCommandInputSpec): save_bias = traits.Bool(False, mandatory=True, usedefault=True, desc=('True if the estimated bias should be saved' ' to file.'), xor=['bias_image']) - bias_image = File(desc='Filename for the estimated bias.', - hash_files=False) + bias_image = File(name_source='input_image', name_template='%s_bias', + keep_extension=True, hash_files=False, argstr='%s', + desc='Filename for the estimated bias.') + def _format_arg(self, name, trait_spec, value): + if name == 'bspline_fitting_distance': + if isdefined(self.bspline_order): + newval = '[ %g, %d ]' % (value, self.bspline_order) + else: + newval = '[ %g ]' % value + return trait_spec.argstr % newval + + if name == 'n_iterations': + if isdefined(self.convergence_threshold): + newval = '[ %s, %g ]' % (self._format_xarray([str(elt) for elt in value]), + self.convergence_threshold) + else: + newval = '[ %s ]' % self._format_xarray([str(elt) for elt in value]) + return trait_spec.argstr % newval + + if name == 'output_image' and self.save_bias: + val_out = super(N4BiasFieldCorrectionInputSpec, self)._format_arg( + name, trait_spec, value) + val_bias = super(N4BiasFieldCorrectionInputSpec, self)._format_arg('bias_image') + retval = '[ ' + val_out[9:] + ', ' + val_bias + ' ]' + return trait_spec.argstr % retval + + return super(N4BiasFieldCorrectionInputSpec, + self)._format_arg(name, trait_spec, value) + + def parse_args(self, skip=None): + if skip is None: + skip = [] + skip += ['save_bias', 'bias_image'] + return super(N4BiasFieldCorrectionInputSpec, self).parse_args(skip=skip) class N4BiasFieldCorrectionOutputSpec(TraitedSpec): output_image = File(exists=True, desc='Warped image') @@ -319,62 +342,6 @@ class N4BiasFieldCorrection(ANTSCommand): input_spec = N4BiasFieldCorrectionInputSpec output_spec = N4BiasFieldCorrectionOutputSpec - def _gen_filename(self, name): - if name == 'output_image': - output = self.inputs.output_image - if not isdefined(output): - _, name, ext = split_filename(self.inputs.input_image) - output = name + '_corrected' + ext - return output - - if name == 'bias_image': - output = self.inputs.bias_image - if not isdefined(output): - _, name, ext = split_filename(self.inputs.input_image) - output = name + '_bias' + ext - return output - return None - - def _format_arg(self, name, trait_spec, value): - if ((name == 'output_image') and - (self.inputs.save_bias or isdefined(self.inputs.bias_image))): - bias_image = self._gen_filename('bias_image') - output = self._gen_filename('output_image') - newval = '[ %s, %s ]' % (output, bias_image) - return trait_spec.argstr % newval - - if name == 'bspline_fitting_distance': - if isdefined(self.inputs.bspline_order): - newval = '[ %g, %d ]' % (value, self.inputs.bspline_order) - else: - newval = '[ %g ]' % value - return trait_spec.argstr % newval - - if name == 'n_iterations': - if isdefined(self.inputs.convergence_threshold): - newval = '[ %s, %g ]' % (self._format_xarray([str(elt) for elt in value]), - self.inputs.convergence_threshold) - else: - newval = '[ %s ]' % self._format_xarray([str(elt) for elt in value]) - return trait_spec.argstr % newval - - return super(N4BiasFieldCorrection, - self)._format_arg(name, trait_spec, value) - - def parse_args(self, skip=None): - if skip is None: - skip = [] - skip += ['save_bias', 'bias_image'] - return super(N4BiasFieldCorrection, self).parse_args(skip=skip) - - def _post_run(self): - self.outputs.output_image = os.path.abspath( - self._gen_filename('output_image')) - - if self.inputs.save_bias or isdefined(self.inputs.bias_image): - self.outputs.bias_image = os.path.abspath( - self._gen_filename('bias_image')) - class CorticalThicknessInputSpec(ANTSCommandInputSpec): dimension = traits.Enum(3, 2, argstr='-d %d', usedefault=True, @@ -461,6 +428,29 @@ class CorticalThicknessInputSpec(ANTSCommandInputSpec): 'Requires single thread computation for complete reproducibility.')) + def _format_arg(self, opt, spec, val): + if opt == 'anatomical_image': + retval = '-a %s' % val + return retval + if opt == 'brain_template': + retval = '-e %s' % val + return retval + if opt == 'brain_probability_mask': + retval = '-m %s' % val + return retval + if opt == 'out_prefix': + retval = '-o %s' % val + return retval + if opt == 't1_registration_template': + retval = '-t %s' % val + return retval + if opt == 'segmentation_priors': + _, _, ext = split_filename(self.segmentation_priors[0]) + retval = "-p nipype_priors/BrainSegmentationPrior%02d" + ext + return retval + return super(CorticalThicknessInputSpec, self)._format_arg(opt, spec, val) + + class CorticalThicknessOutputSpec(TraitedSpec): BrainExtractionMask = File(exists=True, desc='brain extraction mask') BrainSegmentation = File(exists=True, desc='brain segmentaion image') @@ -504,28 +494,6 @@ class CorticalThickness(ANTSCommand): output_spec = CorticalThicknessOutputSpec _cmd = 'antsCorticalThickness.sh' - def _format_arg(self, opt, spec, val): - if opt == 'anatomical_image': - retval = '-a %s' % val - return retval - if opt == 'brain_template': - retval = '-e %s' % val - return retval - if opt == 'brain_probability_mask': - retval = '-m %s' % val - return retval - if opt == 'out_prefix': - retval = '-o %s' % val - return retval - if opt == 't1_registration_template': - retval = '-t %s' % val - return retval - if opt == 'segmentation_priors': - _, _, ext = split_filename(self.inputs.segmentation_priors[0]) - retval = "-p nipype_priors/BrainSegmentationPrior%02d" + ext - return retval - return super(ANTSCommand, self)._format_arg(opt, spec, val) - def _run_interface(self, runtime, correct_return_codes=[0]): priors_directory = os.path.join(os.getcwd(), "nipype_priors") if not os.path.exists(priors_directory): @@ -588,7 +556,7 @@ def _post_run(self): self.outputs.BrainVolumes = os.path.join(os.getcwd(), self.inputs.out_prefix + 'brainvols.csv') - + class antsCorticalThickness(CorticalThickness): DeprecationWarning('This class has been replaced by CorticalThickness and will be removed in version 0.13') @@ -672,7 +640,7 @@ def _post_run(self): self.inputs.out_prefix + 'BrainExtractionBrain.' + self.inputs.image_suffix) - + class antsBrainExtraction(BrainExtraction): DeprecationWarning('This class has been replaced by BrainExtraction and will be removed in version 0.13') @@ -719,6 +687,24 @@ class JointFusionInputSpec(ANTSCommandInputSpec): atlas_group_weights = traits.ListInt(argstr='-gpw %d...', desc=('Assign the voting weights to ' 'each atlas group')) + def _format_arg(self, opt, spec, val): + if opt == 'method': + if '[' in val: + retval = '-m {0}'.format(val) + else: + retval = '-m {0}[{1},{2}]'.format( + self.method, self.alpha, self.beta) + elif opt == 'patch_radius': + retval = '-rp {0}'.format(self._format_xarray(val)) + elif opt == 'search_radius': + retval = '-rs {0}'.format(self._format_xarray(val)) + else: + if opt == 'warped_intensity_images': + assert len(val) == self.modalities * len(self.warped_label_images), \ + "Number of intensity images and label maps must be the same {0}!={1}".format( + len(val), len(self.warped_label_images)) + return super(JointFusionInputSpec, self)._format_arg(opt, spec, val) + return retval class JointFusionOutputSpec(TraitedSpec): @@ -761,29 +747,10 @@ class JointFusion(ANTSCommand): output_spec = JointFusionOutputSpec _cmd = 'jointfusion' - def _format_arg(self, opt, spec, val): - if opt == 'method': - if '[' in val: - retval = '-m {0}'.format(val) - else: - retval = '-m {0}[{1},{2}]'.format( - self.inputs.method, self.inputs.alpha, self.inputs.beta) - elif opt == 'patch_radius': - retval = '-rp {0}'.format(self._format_xarray(val)) - elif opt == 'search_radius': - retval = '-rs {0}'.format(self._format_xarray(val)) - else: - if opt == 'warped_intensity_images': - assert len(val) == self.inputs.modalities * len(self.inputs.warped_label_images), \ - "Number of intensity images and label maps must be the same {0}!={1}".format( - len(val), len(self.inputs.warped_label_images)) - return super(ANTSCommand, self)._format_arg(opt, spec, val) - return retval - def _post_run(self): self.outputs.output_label_image = os.path.abspath( self.inputs.output_label_image) - + class DenoiseImageInputSpec(ANTSCommandInputSpec): dimension = traits.Enum(2, 3, 4, argstr='-d %d', usedefault=False, @@ -808,11 +775,28 @@ class DenoiseImageInputSpec(ANTSCommandInputSpec): save_noise = traits.Bool(False, mandatory=True, usedefault=True, desc=('True if the estimated noise should be saved ' 'to file.'), xor=['noise_image']) - noise_image = File(name_source=['input_image'], hash_files=False, + noise_image = File(name_source=['input_image'], hash_files=False, argstr='%s', keep_extension=True, name_template='%s_noise', desc='Filename for the estimated noise.') verbose = traits.Bool(False, argstr="-v", desc=('Verbose output.')) + def _format_arg(self, name, trait_spec, value): + if (name == 'output_image') and self.save_noise: + val_out = super(DenoiseImageInputSpec, self)._format_arg( + name, trait_spec, value) + val_noise = super(DenoiseImageInputSpec, self)._format_arg('noise_image') + newval = '[ ' + val_out[3:] + ', ' + val_noise + ' ]' + return trait_spec.argstr % newval + + return super(DenoiseImageInputSpec, + self)._format_arg(name, trait_spec, value) + + def parse_args(self, skip=None): + if skip is None: + skip = [] + skip += ['save_noise', 'noise_image'] + return super(DenoiseImageInputSpec, self).parse_args(skip) + class DenoiseImageOutputSpec(TraitedSpec): output_image = File(exists=True) @@ -848,16 +832,6 @@ class DenoiseImage(ANTSCommand): output_spec = DenoiseImageOutputSpec _cmd = 'DenoiseImage' - def _format_arg(self, name, trait_spec, value): - if ((name == 'output_image') and - (self.inputs.save_noise or isdefined(self.inputs.noise_image))): - newval = '[ %s, %s ]' % (self._filename_from_source('output_image'), - self._filename_from_source('noise_image')) - return trait_spec.argstr % newval - - return super(DenoiseImage, - self)._format_arg(name, trait_spec, value) - class AntsJointFusionInputSpec(ANTSCommandInputSpec): dimension = traits.Enum(3, 2, 4, argstr='-d %d', usedefault=False, @@ -926,6 +900,46 @@ class AntsJointFusionInputSpec(ANTSCommandInputSpec): 'file name format.') verbose = traits.Bool(False, argstr="-v", desc=('Verbose output.')) + def _format_arg(self, opt, spec, val): + if opt == 'exclusion_image_label': + retval = [] + for ii in range(len(self.exclusion_image_label)): + retval.append('-e {0}[{1}]'.format( + self.exclusion_image_label[ii], + self.exclusion_image[ii])) + retval = ' '.join(retval) + elif opt == 'patch_radius': + retval = '-p {0}'.format(self._format_xarray(val)) + elif opt == 'search_radius': + retval = '-s {0}'.format(self._format_xarray(val)) + elif opt == 'out_label_fusion': + if isdefined(self.out_intensity_fusion_name_format): + if isdefined(self.out_label_post_prob_name_format): + if isdefined(self.out_atlas_voting_weight_name_format): + retval = '-o [{0}, {1}, {2}, {3}]'.format(self.out_label_fusion, + self.out_intensity_fusion_name_format, + self.out_label_post_prob_name_format, + self.out_atlas_voting_weight_name_format) + else: + retval = '-o [{0}, {1}, {2}]'.format(self.out_label_fusion, + self.out_intensity_fusion_name_format, + self.out_label_post_prob_name_format) + else: + retval = '-o [{0}, {1}]'.format(self.out_label_fusion, + self.out_intensity_fusion_name_format) + else: + retval = '-o {0}'.format(self.out_label_fusion) + elif opt == 'out_intensity_fusion_name_format': + retval = '' + if not isdefined(self.out_label_fusion): + retval = '-o {0}'.format(self.out_intensity_fusion_name_format) + else: + if opt == 'atlas_segmentation_image': + assert len(val) == len(self.atlas_image), "Number of specified " \ + "segmentations should be identical to the number of atlas image " \ + "sets {0}!={1}".format(len(val), len(self.atlas_image)) + return super(AntsJointFusionInputSpec, self)._format_arg(opt, spec, val) + return retval class AntsJointFusionOutputSpec(TraitedSpec): out_label_fusion = File(exists=True) @@ -998,46 +1012,6 @@ class AntsJointFusion(ANTSCommand): output_spec = AntsJointFusionOutputSpec _cmd = 'antsJointFusion' - def _format_arg(self, opt, spec, val): - if opt == 'exclusion_image_label': - retval = [] - for ii in range(len(self.inputs.exclusion_image_label)): - retval.append('-e {0}[{1}]'.format( - self.inputs.exclusion_image_label[ii], - self.inputs.exclusion_image[ii])) - retval = ' '.join(retval) - elif opt == 'patch_radius': - retval = '-p {0}'.format(self._format_xarray(val)) - elif opt == 'search_radius': - retval = '-s {0}'.format(self._format_xarray(val)) - elif opt == 'out_label_fusion': - if isdefined(self.inputs.out_intensity_fusion_name_format): - if isdefined(self.inputs.out_label_post_prob_name_format): - if isdefined(self.inputs.out_atlas_voting_weight_name_format): - retval = '-o [{0}, {1}, {2}, {3}]'.format(self.inputs.out_label_fusion, - self.inputs.out_intensity_fusion_name_format, - self.inputs.out_label_post_prob_name_format, - self.inputs.out_atlas_voting_weight_name_format) - else: - retval = '-o [{0}, {1}, {2}]'.format(self.inputs.out_label_fusion, - self.inputs.out_intensity_fusion_name_format, - self.inputs.out_label_post_prob_name_format) - else: - retval = '-o [{0}, {1}]'.format(self.inputs.out_label_fusion, - self.inputs.out_intensity_fusion_name_format) - else: - retval = '-o {0}'.format(self.inputs.out_label_fusion) - elif opt == 'out_intensity_fusion_name_format': - retval = '' - if not isdefined(self.inputs.out_label_fusion): - retval = '-o {0}'.format(self.inputs.out_intensity_fusion_name_format) - else: - if opt == 'atlas_segmentation_image': - assert len(val) == len(self.inputs.atlas_image), "Number of specified " \ - "segmentations should be identical to the number of atlas image " \ - "sets {0}!={1}".format(len(val), len(self.inputs.atlas_image)) - return super(ANTSCommand, self)._format_arg(opt, spec, val) - return retval def _post_run(self): if isdefined(self.inputs.out_label_fusion): @@ -1053,4 +1027,4 @@ def _post_run(self): outputs['out_atlas_voting_weight_name_format'] = os.path.abspath( self.inputs.out_atlas_voting_weight_name_format) - \ No newline at end of file + diff --git a/nipype/interfaces/ants/tests/test_auto_ANTS.py b/nipype/interfaces/ants/tests/test_auto_ANTS.py index 36f153c532..ca316c4589 100644 --- a/nipype/interfaces/ants/tests/test_auto_ANTS.py +++ b/nipype/interfaces/ants/tests/test_auto_ANTS.py @@ -82,11 +82,20 @@ def test_ANTS_inputs(): def test_ANTS_outputs(): - output_map = dict(affine_transform=dict(), - inverse_warp_transform=dict(), + output_map = dict(affine_transform=dict(keep_extension=False, + name_source='output_transform_prefix', + name_template='%sAffine.txt', + ), + inverse_warp_transform=dict(keep_extension=False, + name_source='output_transform_prefix', + name_template='%sInverseWarp.nii.gz', + ), metaheader=dict(), metaheader_raw=dict(), - warp_transform=dict(), + warp_transform=dict(keep_extension=False, + name_source='output_transform_prefix', + name_template='%sWarp.nii.gz', + ), ) outputs = ANTS.output_spec() diff --git a/nipype/interfaces/ants/tests/test_auto_ApplyTransforms.py b/nipype/interfaces/ants/tests/test_auto_ApplyTransforms.py index 63d4f78e08..a483727bc5 100644 --- a/nipype/interfaces/ants/tests/test_auto_ApplyTransforms.py +++ b/nipype/interfaces/ants/tests/test_auto_ApplyTransforms.py @@ -35,10 +35,12 @@ def test_ApplyTransforms_inputs(): out_postfix=dict(usedefault=True, ), output_image=dict(argstr='--output %s', - genfile=True, hash_files=False, + keep_extension=True, + name_source='input_image', + name_template='%s_warped', ), - print_out_composite_warp_file=dict(requires=['output_image'], + print_out_composite_warp_file=dict(usedefault=True, ), reference_image=dict(argstr='--reference-image %s', mandatory=True, diff --git a/nipype/interfaces/ants/tests/test_auto_Atropos.py b/nipype/interfaces/ants/tests/test_auto_Atropos.py index e19aa5591c..ccf48272be 100644 --- a/nipype/interfaces/ants/tests/test_auto_Atropos.py +++ b/nipype/interfaces/ants/tests/test_auto_Atropos.py @@ -44,19 +44,22 @@ def test_Atropos_inputs(): ), number_of_tissue_classes=dict(mandatory=True, ), - out_classified_image_name=dict(argstr='%s', - genfile=True, + out_classified_image_name=dict(argstr='--output [%s]', hash_files=False, - ), - output_posteriors_name_template=dict(usedefault=True, + keep_extension=True, + name_source='intensity_images', + name_template='%s_labeled', ), posterior_formulation=dict(argstr='%s', ), + posteriors=dict(usedefault=True, + ), prior_probability_images=dict(), prior_probability_threshold=dict(requires=['prior_weighting'], ), prior_weighting=dict(), - save_posteriors=dict(), + save_posteriors=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), use_mixture_model_proportions=dict(requires=['posterior_formulation'], diff --git a/nipype/interfaces/ants/tests/test_auto_DenoiseImage.py b/nipype/interfaces/ants/tests/test_auto_DenoiseImage.py index 01b610ea30..ec4ea18dc4 100644 --- a/nipype/interfaces/ants/tests/test_auto_DenoiseImage.py +++ b/nipype/interfaces/ants/tests/test_auto_DenoiseImage.py @@ -18,7 +18,8 @@ def test_DenoiseImage_inputs(): input_image=dict(argstr='-i %s', mandatory=True, ), - noise_image=dict(hash_files=False, + noise_image=dict(argstr='%s', + hash_files=False, keep_extension=True, name_source=['input_image'], name_template='%s_noise', diff --git a/nipype/interfaces/ants/tests/test_auto_N4BiasFieldCorrection.py b/nipype/interfaces/ants/tests/test_auto_N4BiasFieldCorrection.py index 18921d811c..dc0e97f6b1 100644 --- a/nipype/interfaces/ants/tests/test_auto_N4BiasFieldCorrection.py +++ b/nipype/interfaces/ants/tests/test_auto_N4BiasFieldCorrection.py @@ -6,7 +6,11 @@ def test_N4BiasFieldCorrection_inputs(): input_map = dict(args=dict(argstr='%s', ), - bias_image=dict(hash_files=False, + bias_image=dict(argstr='%s', + hash_files=False, + keep_extension=True, + name_source='input_image', + name_template='%s_bias', ), bspline_fitting_distance=dict(argstr='--bspline-fitting %s', ), @@ -34,8 +38,10 @@ def test_N4BiasFieldCorrection_inputs(): usedefault=True, ), output_image=dict(argstr='--output %s', - genfile=True, hash_files=False, + keep_extension=True, + name_source='input_image', + name_template='%s_corrected', ), save_bias=dict(mandatory=True, usedefault=True, diff --git a/nipype/interfaces/ants/tests/test_auto_WarpImageMultiTransform.py b/nipype/interfaces/ants/tests/test_auto_WarpImageMultiTransform.py index 09770d9d0f..96a8f71d8f 100644 --- a/nipype/interfaces/ants/tests/test_auto_WarpImageMultiTransform.py +++ b/nipype/interfaces/ants/tests/test_auto_WarpImageMultiTransform.py @@ -24,15 +24,16 @@ def test_WarpImageMultiTransform_inputs(): num_threads=dict(nohash=True, usedefault=True, ), - out_postfix=dict(hash_files=False, + out_postfix=dict(deprecated=True, + hash_files=False, + new_name='output_image', usedefault=True, xor=['output_image'], ), output_image=dict(argstr='%s', - genfile=True, - hash_files=False, - position=3, - xor=['out_postfix'], + keep_extension=True, + name_source='input_image', + name_template='%s_wimt', ), reference_image=dict(argstr='-R %s', xor=['tightest_box'], diff --git a/nipype/interfaces/ants/tests/test_auto_WarpTimeSeriesImageMultiTransform.py b/nipype/interfaces/ants/tests/test_auto_WarpTimeSeriesImageMultiTransform.py index 0e46ce34a5..364a9e7e9f 100644 --- a/nipype/interfaces/ants/tests/test_auto_WarpTimeSeriesImageMultiTransform.py +++ b/nipype/interfaces/ants/tests/test_auto_WarpTimeSeriesImageMultiTransform.py @@ -25,7 +25,13 @@ def test_WarpTimeSeriesImageMultiTransform_inputs(): usedefault=True, ), out_postfix=dict(argstr='%s', - usedefault=True, + deprecated=True, + new_name='output_image', + ), + output_image=dict(argstr='%s', + keep_extension=True, + name_source='input_image', + name_template='%s_wtsimt', ), reference_image=dict(argstr='-R %s', xor=['tightest_box'], diff --git a/nipype/interfaces/ants/tests/test_spec_JointFusion.py b/nipype/interfaces/ants/tests/test_spec_JointFusion.py index ed6d283032..470c394613 100644 --- a/nipype/interfaces/ants/tests/test_spec_JointFusion.py +++ b/nipype/interfaces/ants/tests/test_spec_JointFusion.py @@ -47,7 +47,7 @@ def test_JointFusion_radius(): for attr in ['patch_radius', 'search_radius']: for x in range(5): set_radius(attr, x, x + 1, x**x) - yield assert_equal, at._format_arg(attr, None, getattr(at.inputs, attr))[4:], '{0}x{1}x{2}'.format(x, x + 1, x**x) + yield assert_equal, at.inputs._format_arg(attr, None, getattr(at.inputs, attr))[4:], '{0}x{1}x{2}'.format(x, x + 1, x**x) def test_JointFusion_cmd(): @@ -75,4 +75,4 @@ def test_JointFusion_cmd(): segmentation_images[1]) yield assert_equal, at.cmdline, expected_command # setting intensity or labels with unequal lengths raises error - yield assert_raises, AssertionError, at._format_arg, 'warped_intensity_images', InputMultiPath, warped_intensity_images + [example_data('im3.nii')] + yield assert_raises, AssertionError, at.inputs._format_arg, 'warped_intensity_images', InputMultiPath, warped_intensity_images + [example_data('im3.nii')] From ce6eb1eb70c78682ca28d8d79322f7d1b9e6cf4d Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 17 Feb 2016 23:02:59 -0800 Subject: [PATCH 41/73] added new trait GenFile --- nipype/algorithms/misc.py | 10 +-- nipype/interfaces/traits_extension.py | 107 ++++++++++++++++++++++++++ 2 files changed, 112 insertions(+), 5 deletions(-) diff --git a/nipype/algorithms/misc.py b/nipype/algorithms/misc.py index 716aa1ffd8..0110f13b35 100644 --- a/nipype/algorithms/misc.py +++ b/nipype/algorithms/misc.py @@ -30,7 +30,7 @@ from . import metrics as nam from ..utils.filemanip import fname_presuffix, split_filename -from ..interfaces.traits_extension import traits, File, isdefined, Undefined +from ..interfaces.traits_extension import traits, File, GenFile, isdefined, Undefined from ..interfaces.specs import BaseInterfaceInputSpec, TraitedSpec, InputMultiPath, OutputMultiPath, DynamicTraitedSpec from ..interfaces.base import BaseInterface @@ -56,8 +56,8 @@ class PickAtlasInputSpec(BaseInterfaceInputSpec): desc="Defines how much the mask will be dilated (expanded in 3D).") output_file = File(deprecated=True, new_name='mask_file', desc="Where to store the output mask.") - mask_file = File(name_source='atlas', name_template='%s_mask', keep_extension=True, - desc="Where to store the output mask.") + mask_file = GenFile(ns='atlas', template='%s_mask', + desc="Where to store the output mask.") class PickAtlasOutputSpec(TraitedSpec): mask_file = File(exists=True, desc="output mask file") @@ -183,8 +183,8 @@ class CreateNiftiInputSpec(BaseInterfaceInputSpec): header_file = File( exists=True, mandatory=True, desc="corresponding ANALYZE hdr file") affine = traits.Array(desc="affine transformation array") - nifti_file = File(name_source='data_file', name_template='%s_nifti.nii', - keep_extension=False, desc='output nifti file') + nifti_file = GenFile(ns='data_file', template='%s_nifti.nii', + keep_extension=False, desc='output nifti file') class CreateNiftiOutputSpec(TraitedSpec): diff --git a/nipype/interfaces/traits_extension.py b/nipype/interfaces/traits_extension.py index bba8feec83..1ff05de2c7 100644 --- a/nipype/interfaces/traits_extension.py +++ b/nipype/interfaces/traits_extension.py @@ -17,6 +17,7 @@ """ import os +from ..external.six import string_types # perform all external trait imports here import traits if traits.__version__ < '3.7.0': @@ -26,6 +27,10 @@ from traits.trait_errors import TraitError from traits.trait_base import _Undefined +from ..utils.filemanip import split_filename + +from .. import logging +IFLOGGER = logging.getLogger('interface') class BaseFile (traits.BaseStr): """ Defines a trait whose value must be the name of a file. @@ -114,6 +119,108 @@ def __init__(self, value='', filter=None, auto_set=False, super(File, self).__init__(value, filter, auto_set, entries, exists, **metadata) + +class GenFile(File): + """ A file which default name is automatically generated from other + traits. + """ + def __init__(self, name_source=None, ns=None, template='%s_generated', + keep_extension=True, value='', filter=None, auto_set=False, + entries=0, exists=False, **metadata): + """ Creates a File trait. + + Parameters + ---------- + value : string + The default value for the trait + filter : string + A wildcard string to filter filenames in the file dialog box used by + the attribute trait editor. + auto_set : boolean + Indicates whether the file editor updates the trait value after + every key stroke. + exists : boolean + Indicates whether the trait value must be an existing file or + not. + + Default Value + ------------- + *value* or '' + """ + + if name_source is None and ns is None: + raise TraitError('GenFile requires a name_source') + + if ns is not None and name_source is None: + name_source = ns + + self.name_source = name_source + if isinstance(name_source, string_types): + self.name_source = [name_source] + elif isinstance(name_source, tuple): + self.name_source = list(name_source) + + if not isinstance(self.name_source, list): + raise TraitError('name_source should be a string, or a ' + 'tuple/list of strings. Got %s' % name_source) + + for nsrc in self.name_source: + if not isinstance(nsrc, string_types): + raise TraitError('name_source contains an invalid name_source ' + 'entry (found %s).' % nsrc) + self.keep_ext = keep_extension + self.template = template + + super(GenFile, self).__init__(value, filter, auto_set, entries, exists, + **metadata) + + + def validate(self, object, name, value): + """ Validates that a specified value is valid for this trait. + + Note: The 'fast validator' version performs this check in C. + """ + if not isdefined(value): + return value + + validated_value = super(BaseFile, self).validate(object, name, value) + if not self.exists: + return validated_value + elif os.path.isfile(value): + return validated_value + + self.error(object, name, value) + + def get(self, obj, name): + if self.value is None: + srcvals = [] + ext = '' + for nsrc in self.name_source: + val = getattr(obj, nsrc) + + IFLOGGER.debug('Object class is %s' % type(obj.traits()[nsrc]).__name__) + try: + _, val, ext = split_filename(val) + except: + pass + srcvals.append(val) + + if all(isdefined(v) for v in srcvals): + retval = self.template % tuple(srcvals) + if self.keep_ext: + retval += ext + return retval + else: + return Undefined + return self.value + + def set(self, obj, name, value): + if isdefined(value): + self.value = value + else: + self.value = None + + # ------------------------------------------------------------------------------- # 'BaseDirectory' and 'Directory' traits: # ------------------------------------------------------------------------------- From 99225becb199f00ee12ebaa276083fdac6e8cdb2 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 17 Feb 2016 23:25:27 -0800 Subject: [PATCH 42/73] adapted some interfaces to the new GenFile trait --- nipype/algorithms/misc.py | 24 ++++++++++++------------ nipype/interfaces/traits_extension.py | 3 +-- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/nipype/algorithms/misc.py b/nipype/algorithms/misc.py index 0110f13b35..3b7802475a 100644 --- a/nipype/algorithms/misc.py +++ b/nipype/algorithms/misc.py @@ -216,14 +216,14 @@ class TSNRInputSpec(BaseInterfaceInputSpec): in_file = InputMultiPath(File(exists=True), mandatory=True, desc='realigned 4D file or a list of 3D files') regress_poly = traits.Range(low=1, desc='Remove polynomials') - tsnr_file = File(name_source='in_file', name_template='%s_tsnr', keep_extension=True, - hash_files=False, desc='output tSNR file') - mean_file = File(name_source='in_file', name_template='%s_mean', keep_extension=True, - hash_files=False, desc='output mean file') - stddev_file = File(name_source='in_file', name_template='%s_stdev', - keep_extension=True, hash_files=False, desc='output std deviation file') - detrended_file = File( - name_source='in_file', name_template='%s_detrend', keep_extension=True, hash_files=False, + tsnr_file = GenFile(ns='in_file', template='%s_tsnr', + hash_files=False, desc='output tSNR file') + mean_file = GenFile(ns='in_file', template='%s_mean', + hash_files=False, desc='output mean file') + stddev_file = GenFile(ns='in_file', template='%s_stdev', + hash_files=False, desc='output std deviation file') + detrended_file = GenFile( + ns='in_file', template='%s_detrend', hash_files=False, desc='input file after detrending') @@ -295,7 +295,7 @@ def _run_interface(self, runtime): class GunzipInputSpec(BaseInterfaceInputSpec): in_file = File(exists=True, mandatory=True) - out_file = File(name_source='in_file', name_template='%s', name_remove='.gz', + out_file = GenFile(ns='in_file', template='%s', name_remove='.gz', keep_extension=False, desc='output file') @@ -551,8 +551,8 @@ def _run_interface(self, runtime): class AddCSVColumnInputSpec(TraitedSpec): in_file = File(exists=True, mandatory=True, desc='Input comma-separated value (CSV) files') - out_file = File(name_source='in_file', name_template='%s_col_added', keep_extension=True, - output_name='csv_file', desc='Output filename for merged CSV file') + out_file = GenFile(ns='in_file', template='%s_col_added', output_name='csv_file', + desc='Output filename for merged CSV file') extra_column_heading = traits.Str( desc='New heading to add for the added field.') extra_field = traits.Str( @@ -763,7 +763,7 @@ class AddNoiseInputSpec(TraitedSpec): bg_dist = traits.Enum('normal', 'rayleigh', usedefault=True, mandatory=True, desc='desired noise distribution, currently ' 'only normal is implemented') - out_file = File(name_source=['in_file', 'snr'], name_template='%s_SNR%.02f', + out_file = GenFile(ns=['in_file', 'snr'], template='%s_SNR%.02f', keep_extension=True, desc='desired output filename') diff --git a/nipype/interfaces/traits_extension.py b/nipype/interfaces/traits_extension.py index 1ff05de2c7..4615570089 100644 --- a/nipype/interfaces/traits_extension.py +++ b/nipype/interfaces/traits_extension.py @@ -180,6 +180,7 @@ def validate(self, object, name, value): Note: The 'fast validator' version performs this check in C. """ + # Allow unsetting the input if not isdefined(value): return value @@ -197,8 +198,6 @@ def get(self, obj, name): ext = '' for nsrc in self.name_source: val = getattr(obj, nsrc) - - IFLOGGER.debug('Object class is %s' % type(obj.traits()[nsrc]).__name__) try: _, val, ext = split_filename(val) except: From 39c309cafef9fef58cb36b0baaef0c5c87416a69 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 17 Feb 2016 23:45:50 -0800 Subject: [PATCH 43/73] removed namesource code from specs, update BET --- nipype/interfaces/base.py | 2 - nipype/interfaces/fsl/preprocess.py | 105 +++++++++++++----------- nipype/interfaces/specs.py | 120 ---------------------------- 3 files changed, 58 insertions(+), 169 deletions(-) diff --git a/nipype/interfaces/base.py b/nipype/interfaces/base.py index d28f9ebe93..1c9f3e3f74 100644 --- a/nipype/interfaces/base.py +++ b/nipype/interfaces/base.py @@ -467,7 +467,6 @@ def _pre_run(self, **inputs): self.outputs = self.output_spec() self.inputs.set(**inputs) self.inputs.check_inputs() - self.inputs.update_autonames() if self.version: self.inputs.check_version(LooseVersion(str(self.version))) @@ -836,7 +835,6 @@ def cmdline(self): validates arguments and generates command line""" self.outputs = self.output_spec() self.inputs.check_inputs() - self.inputs.update_autonames() allargs = self.inputs.parse_args() allargs.insert(0, self.cmd) return ' '.join(allargs) diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index f0c5be3a20..3ab9ad3473 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -21,7 +21,7 @@ from builtins import range -from ..base import (TraitedSpec, File, InputMultiPath, OutputMultiPath, traits, isdefined) +from ..base import (TraitedSpec, File, GenFile, InputMultiPath, OutputMultiPath, traits, isdefined) from ..fsl.base import FSLCommand, FSLCommandInputSpec from ...utils.filemanip import split_filename @@ -32,33 +32,28 @@ class BETInputSpec(FSLCommandInputSpec): # We use position args here as list indices - so a negative number # will put something on the end - in_file = File(exists=True, - desc='input file to skull strip', - argstr='%s', position=0, mandatory=True) - out_file = File(desc='name of output skull stripped image', - argstr='%s', position=1, name_source=['in_file'], - name_template='%s_brain', hash_files=False) - outline = traits.Bool(desc='create surface outline image', - argstr='-o') - mask = traits.Bool(desc='create binary mask image', - argstr='-m') - skull = traits.Bool(desc='create skull image', - argstr='-s') - no_output = traits.Bool(argstr='-n', + in_file = File(exists=True, argstr='%s', position=0, mandatory=True, + desc='input file to skull strip') + out_file = GenFile(argstr='%s', position=1, ns=['in_file'], template='%s_brain', + hash_files=False, desc='name of output skull stripped image') + outline = traits.Bool(False, usedefault=True, argstr='-o', + desc='create surface outline image') + mask = traits.Bool(False, usedefault=True, argstr='-m', + desc='create binary mask image') + skull = traits.Bool(False, usedefault=True, argstr='-s', + desc='create skull image') + no_output = traits.Bool(False, usedefault=True, argstr='-n', desc="Don't generate segmented output") - frac = traits.Float(desc='fractional intensity threshold', - argstr='-f %.2f') - vertical_gradient = traits.Float(argstr='-g %.2f', - desc='vertical gradient in fractional intensity ' - 'threshold (-1, 1)') - radius = traits.Int(argstr='-r %d', units='mm', - desc="head radius") - center = traits.List(traits.Int, desc='center of gravity in voxels', - argstr='-c %s', minlen=0, maxlen=3, - units='voxels') - threshold = traits.Bool(argstr='-t', + frac = traits.Float(desc='fractional intensity threshold', argstr='-f %.2f') + vertical_gradient = traits.Float( + argstr='-g %.2f', desc='vertical gradient in fractional intensity ' + 'threshold (-1, 1)') + radius = traits.Int(argstr='-r %d', units='mm', desc="head radius") + center = traits.List(traits.Int, argstr='-c %s', minlen=0, maxlen=3, units='voxels', + desc='center of gravity in voxels') + threshold = traits.Bool(False, usedefault=True, argstr='-t', desc="apply thresholding to segmented brain image and mask") - mesh = traits.Bool(argstr='-e', + mesh = traits.Bool(False, usedefault=True, argstr='-e', desc="generate a vtk mesh brain surface") # the remaining 'options' are more like modes (mutually exclusive) that # FSL actually implements in a shell script wrapper around the bet binary. @@ -67,9 +62,9 @@ class BETInputSpec(FSLCommandInputSpec): # supported _xor_inputs = ('functional', 'reduce_bias', 'robust', 'padding', 'remove_eyes', 'surfaces', 't2_guided') - robust = traits.Bool(desc='robust brain centre estimation ' - '(iterates BET several times)', - argstr='-R', xor=_xor_inputs) + robust = traits.Bool(False, usedefault=True, argstr='-R', xor=_xor_inputs, + desc='robust brain centre estimation ' + '(iterates BET several times)') padding = traits.Bool(desc='improve BET if FOV is very small in Z ' '(by temporarily padding end slices)', argstr='-Z', xor=_xor_inputs) @@ -87,28 +82,44 @@ class BETInputSpec(FSLCommandInputSpec): desc="apply to 4D fMRI data") reduce_bias = traits.Bool(argstr='-B', xor=_xor_inputs, desc="bias field and neck cleanup") + mask_file = GenFile(ns='in_file', template='%s_mask', + desc="path/name of binary brain mask") + meshfile = GenFile( + ns='in_file', template='%s_mesh.vtk', keep_extension=False, + desc="path/name of vtk mesh file") + outline_file = GenFile(ns='in_file', template='%s_overlay', + desc="path/name of outline file") + inskull_mask_file = GenFile(ns='in_file', template='%s_inskull_mask', + desc="path/name of inskull mask") + inskull_mesh_file = GenFile( + ns='in_file', template='%s_inskull_mesh.vtk', keep_extension=False, + desc="path/name of inskull mesh outline") + outskull_mask_file = GenFile(ns='in_file', template='%s_outskull_mask', + desc="path/name of outskull mask") + outskull_mesh_file = GenFile( + ns='in_file', template='%s_outskull_mesh.vtk', keep_extension=False, + desc="path/name of outskull mesh outline") + outskin_mask_file = GenFile(ns='in_file', template='%s_outskin_mask', + desc="path/name of outskin mask") + outskin_mesh_file = GenFile( + ns='in_file', template='%s_outskin_mesh.vtk', keep_extension=False, + desc="path/name of outskin mesh outline") + skull_mask_file = GenFile(ns='in_file', template='%s_skull_mask', + desc="path/name of skull mask") + class BETOutputSpec(TraitedSpec): out_file = File(desc="path/name of skullstripped file") - mask_file = File(name_source='in_file', name_template='%s_mask', - desc="path/name of binary brain mask") - meshfile = File(name_source='in_file', name_template='%s_mesh.vtk', - keep_extension=False, desc="path/name of vtk mesh file") - outline_file = File(name_source='in_file', name_template='%s_overlay', - desc="path/name of outline file") - inskull_mask_file = File(name_source='in_file', name_template='%s_inskull_mask', - desc="path/name of inskull mask") - inskull_mesh_file = File(name_source='in_file', name_template='%s_inskull_mesh.vtk', - keep_extension=False, desc="path/name of inskull mesh outline") - outskull_mask_file = File(name_source='in_file', name_template='%s_outskull_mask', - desc="path/name of outskull mask") - outskull_mesh_file = File(name_source='in_file', name_template='%s_outskull_mesh.vtk', - keep_extension=False, desc="path/name of outskull mesh outline") - outskin_mask_file = File(name_source='in_file', name_template='%s_outskin_mask', - desc="path/name of outskin mask") - outskin_mesh_file = File(name_source='in_file', name_template='%s_outskin_mesh.vtk', - keep_extension=False, desc="path/name of outskin mesh outline") + mask_file = File(desc="path/name of binary brain mask") + meshfile = File(desc="path/name of vtk mesh file") + outline_file = File(desc="path/name of outline file") + inskull_mask_file = File(desc="path/name of inskull mask") + inskull_mesh_file = File(desc="path/name of inskull mesh outline") + outskull_mask_file = File(desc="path/name of outskull mask") + outskull_mesh_file = File(desc="path/name of outskull mesh outline") + outskin_mask_file = File(desc="path/name of outskin mask") + outskin_mesh_file = File(desc="path/name of outskin mesh outline") skull_mask_file = File(desc="path/name of skull mask") diff --git a/nipype/interfaces/specs.py b/nipype/interfaces/specs.py index af232202dc..125ee4c79a 100644 --- a/nipype/interfaces/specs.py +++ b/nipype/interfaces/specs.py @@ -192,40 +192,6 @@ def _clean_container(self, obj, undefinedval=None, skipundefined=False): out = undefinedval return out - def format_ns(self, source_names, out_name, source_traits=None): - if source_traits is None: - source_traits = self - - if isinstance(source_names, string_types): - source_names = [source_names] - - values = [None] * len(source_names) - - ext = '' - for i, srcname in enumerate(source_names): - src_value = getattr(self, srcname) - - if isinstance(source_traits.traits()[srcname], File): - _, src_value, ext = split_filename(src_value) - values[i] = src_value - - out_spec = self.traits()[out_name] - keep_ext = not isdefined(out_spec.keep_extension) or out_spec.keep_extension - name_template = out_spec.name_template - if name_template is None: - name_template = '%s_generated' - - retval = name_template % tuple(values) - if isinstance(out_spec, File): - if keep_ext: - retval += ext - else: - retval = self._overload_extension(retval, out_name, ext) - return retval - - def _overload_extension(self, value, name=None, ext=None): - return value - def get_hashval(self, hash_method=None): """Return a dictionary of our items with hashes for each file. @@ -451,92 +417,6 @@ def check_inputs(self): for elem in list(self.optional_items()): self._check_requires(*elem) - def _resolve_namesource(self, name, chain=None): - if chain is None: - chain = [] - - spec = self.traits()[name] - retval = getattr(self, name) - - name_template = spec.name_template - # Default name template - if name_template is None: - if '%' in retval: - name_template = retval - retval = Undefined - else: - name_template = "%s_generated" - - # If input is already set, do nothing - if isdefined(retval): - return retval - - # Prevent entering here twice - if name in chain: - raise InterfaceInputsError('Mutually pointing name_sources') - chain.append(name) - - keep_ext = not isdefined(spec.keep_extension) or spec.keep_extension - name_source = spec.name_source - if isinstance(name_source, string_types): - name_source = [name_source] - if isinstance(name_source, tuple): - name_source = list(name_source) - - if not isinstance(name_source, list): - raise ValueError( - 'name_source of input \'%s\' sould be a string, or list/tuple of ' - 'strings denoting input trait names, but got %s' % (name, name_source)) - - sourced_values = [None] * len(name_source) - - for i, nsrc in enumerate(name_source): - if not isinstance(nsrc, string_types): - raise ValueError(('name_source \'%s\' of \'%s\' trait sould be an ' - 'input trait name') % (nsrc, name)) - - src_value = getattr(self, nsrc) - if not isdefined(src_value): - sourced_values[i] = self._resolve_namesource(nsrc, chain) - else: - if isinstance(src_value, list): - raise NotImplementedError('Multiple sourced values not allowed yet') - - try: - # special treatment for files - _, base, ext = split_filename(src_value) - except AttributeError: - base = src_value - ext = '' - sourced_values[i] = base - - retval = name_template % tuple(sourced_values) - if keep_ext: - retval += ext - else: - retval = self._overload_extension(retval, name, ext) - return retval - - def update_autonames(self): - """ - Checks for inputs undefined but providing name_source - """ - - metadata = dict(name_source=lambda t: t is not None) - for name, spec in self.traits(**metadata).items(): - value = getattr(self, name) - - if isdefined(value): - continue - - name_source = spec.name_source - if name_source is not None: - value = self._resolve_namesource(name) - - if isdefined(value): - setattr(self, name, value) - - def get_filecopy_info(self): """ Provides information about file inputs to copy or link to cwd. Necessary for pipeline operation From e94a7000d31a2c680d4df982fda60d19318f6884 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Thu, 18 Feb 2016 09:33:04 -0800 Subject: [PATCH 44/73] use new template parameter --- nipype/interfaces/fsl/base.py | 53 +------------------ nipype/interfaces/fsl/preprocess.py | 73 +++++++++++++++------------ nipype/interfaces/traits_extension.py | 51 +++++++++---------- nipype/utils/filemanip.py | 5 +- 4 files changed, 69 insertions(+), 113 deletions(-) diff --git a/nipype/interfaces/fsl/base.py b/nipype/interfaces/fsl/base.py index 065cc771ae..9db547fb80 100644 --- a/nipype/interfaces/fsl/base.py +++ b/nipype/interfaces/fsl/base.py @@ -79,27 +79,6 @@ def version(): out = vfile.read().strip('\n') return out - @classmethod - def output_type_to_ext(cls, output_type): - """Get the file extension for the given output type. - - Parameters - ---------- - output_type : {'NIFTI', 'NIFTI_GZ', 'NIFTI_PAIR', 'NIFTI_PAIR_GZ'} - String specifying the output type. - - Returns - ------- - extension : str - The file extension for the output type. - """ - - try: - return cls.ftypes[output_type] - except KeyError: - msg = 'Invalid FSLOUTPUTTYPE: ', output_type - raise KeyError(msg) - @classmethod def output_type(cls): """Get the global FSL output file type FSLOUTPUTTYPE. @@ -143,11 +122,8 @@ class FSLCommandInputSpec(CommandLineInputSpec): ------- fsl.ExtractRoi(tmin=42, tsize=1, output_type='NIFTI') """ - output_type = traits.Enum(FSLOUTPUTTYPE, list(Info.ftypes.keys()), usedefault=True, - desc='FSL output type') - - def _overload_extension(self, value, name=None): - return value + Info.output_type_to_ext(self.output_type) + output_type = traits.Trait(FSLOUTPUTTYPE, Info.ftypes, usedefault=True, + desc='FSL output type') class FSLCommand(CommandLine): # pylint: disable=W0223 @@ -158,36 +134,11 @@ class FSLCommand(CommandLine): # pylint: disable=W0223 def __init__(self, **inputs): super(FSLCommand, self).__init__(**inputs) self.inputs.on_trait_change(self._output_update, 'output_type') - self._output_type = FSLOUTPUTTYPE self.inputs.environ.update({'FSLOUTPUTTYPE': FSLOUTPUTTYPE}) def _output_update(self): - self._output_type = self.inputs.output_type self.inputs.environ.update({'FSLOUTPUTTYPE': self.inputs.output_type}) - def _get_ext(self): - return Info.output_type_to_ext(self.input_spec.output_type) - - def _gen_fname(self, basename, out_path=None, suffix=''): - if out_path is None: - out_path = os.getcwd() - return os.path.join(out_path, basename + suffix + self._get_ext()) - - @classmethod - def set_default_output_type(cls, output_type): - """Set the default output type for FSL classes. - - This method is used to set the default output type for all fSL - subclasses. However, setting this will not update the output - type for any existing instances. For these, assign the - .inputs.output_type. - """ - - if output_type in Info.ftypes: - cls._output_type = output_type - else: - raise AttributeError('Invalid FSL output_type: %s' % output_type) - @property def version(self): return Info.version() diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index 3ab9ad3473..0e8c92096d 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -34,8 +34,6 @@ class BETInputSpec(FSLCommandInputSpec): # will put something on the end in_file = File(exists=True, argstr='%s', position=0, mandatory=True, desc='input file to skull strip') - out_file = GenFile(argstr='%s', position=1, ns=['in_file'], template='%s_brain', - hash_files=False, desc='name of output skull stripped image') outline = traits.Bool(False, usedefault=True, argstr='-o', desc='create surface outline image') mask = traits.Bool(False, usedefault=True, argstr='-m', @@ -82,33 +80,36 @@ class BETInputSpec(FSLCommandInputSpec): desc="apply to 4D fMRI data") reduce_bias = traits.Bool(argstr='-B', xor=_xor_inputs, desc="bias field and neck cleanup") - mask_file = GenFile(ns='in_file', template='%s_mask', + + # Automatically generated input names + out_file = GenFile(argstr='%s', position=1, template='{in_file}_brain{output_type_}', + hash_files=False, desc='name of output skull stripped image') + mask_file = GenFile(template='{in_file}_mask{output_type_}', desc="path/name of binary brain mask") meshfile = GenFile( - ns='in_file', template='%s_mesh.vtk', keep_extension=False, + template='{in_file}_mesh.vtk', keep_extension=False, desc="path/name of vtk mesh file") - outline_file = GenFile(ns='in_file', template='%s_overlay', + outline_file = GenFile(template='{in_file}_overlay{output_type_}', desc="path/name of outline file") - inskull_mask_file = GenFile(ns='in_file', template='%s_inskull_mask', + inskull_mask_file = GenFile(template='{in_file}_inskull_mask{output_type_}', desc="path/name of inskull mask") inskull_mesh_file = GenFile( - ns='in_file', template='%s_inskull_mesh.vtk', keep_extension=False, + template='{in_file}_inskull_mesh.vtk', keep_extension=False, desc="path/name of inskull mesh outline") - outskull_mask_file = GenFile(ns='in_file', template='%s_outskull_mask', + outskull_mask_file = GenFile(template='{in_file}_outskull_mask{output_type_}', desc="path/name of outskull mask") outskull_mesh_file = GenFile( - ns='in_file', template='%s_outskull_mesh.vtk', keep_extension=False, + template='{in_file}_outskull_mesh.vtk', keep_extension=False, desc="path/name of outskull mesh outline") - outskin_mask_file = GenFile(ns='in_file', template='%s_outskin_mask', + outskin_mask_file = GenFile(template='{in_file}_outskin_mask{output_type_}', desc="path/name of outskin mask") outskin_mesh_file = GenFile( - ns='in_file', template='%s_outskin_mesh.vtk', keep_extension=False, + template='{in_file}_outskin_mesh.vtk', keep_extension=False, desc="path/name of outskin mesh outline") - skull_mask_file = GenFile(ns='in_file', template='%s_skull_mask', + skull_mask_file = GenFile(template='{in_file}_skull_mask{output_type_}', desc="path/name of skull mask") - class BETOutputSpec(TraitedSpec): out_file = File(desc="path/name of skullstripped file") mask_file = File(desc="path/name of binary brain mask") @@ -160,8 +161,6 @@ class FASTInputSpec(FSLCommandInputSpec): desc='image, or multi-channel set of images, ' 'to be segmented', argstr='%s', position=-1, mandatory=True) - out_basename = File(desc='base name of output files', - argstr='-o %s') # uses in_file name as basename if none given number_classes = traits.Range(low=1, high=10, argstr='-n %d', desc='number of tissue-type classes') output_biasfield = traits.Bool(desc='output estimated bias field', @@ -225,6 +224,20 @@ class FASTInputSpec(FSLCommandInputSpec): probability_maps = traits.Bool(desc='outputs individual probability maps', argstr='-p') + out_basename = GenFile( + ns='in_files', template='%s', keep_extension=False, argstr='-o %s', + desc='base name of output files') + + tissue_class_map = GenFile( + ns=['out_basename', 'output_type_'], template='%s_seg%s', + desc='binary segmented volume file one val for each class') + partial_volume_map = GenFile( + ns=['out_basename', 'output_type_'], template='%s_pveseg%s', + desc="segmentation corresponding to the partial volume files") + mixeltype = GenFile( + ns=['out_basename', 'output_type_'], template='%s_mixeltype%s', + desc="path/name of mixeltype volume file ") + def _format_arg(self, name, spec, value): # first do what should be done in general formatted = super(FASTInputSpec, self)._format_arg(name, spec, value) @@ -237,20 +250,17 @@ def _format_arg(self, name, spec, value): class FASTOutputSpec(TraitedSpec): """Specify possible outputs from FAST""" - tissue_class_map = File(exists=True, - desc='path/name of binary segmented volume file' - ' one val for each class _seg') + tissue_class_map = File( + desc='path/name of binary segmented volume file one val for each class _seg') + partial_volume_map = File(desc="path/name of partial volume file _pveseg") + mixeltype = File(desc="path/name of mixeltype volume file _mixeltype") + tissue_class_files = OutputMultiPath(File(desc='path/name of binary segmented volumes ' 'one file for each class _seg_x')) restored_image = OutputMultiPath(File(desc='restored images (one for each input image) ' 'named according to the input images _restore')) - - mixeltype = File(desc="path/name of mixeltype volume file _mixeltype") - - partial_volume_map = File(desc="path/name of partial volume file _pveseg") partial_volume_files = OutputMultiPath(File(desc='path/name of partial volumes files ' 'one for each class, _pve_x')) - bias_field = OutputMultiPath(File(desc='Estimated bias field _bias')) probability_maps = OutputMultiPath(File(desc='filenames, one for each class, for each ' 'input, prob_x')) @@ -292,8 +302,6 @@ def _post_run(self): else: basefile = self.inputs.in_files[-1] - self.outputs.tissue_class_map = self._gen_fname(basefile, - suffix='_seg') if self.inputs.segments: self.outputs.tissue_class_files = [] for i in range(nclasses): @@ -313,7 +321,6 @@ def _post_run(self): self.outputs.restored_image.append( self._gen_fname(basefile, suffix='_restore')) - self.outputs.mixeltype = self._gen_fname(basefile, suffix='_mixeltype') if not self.inputs.no_pve: self.outputs.partial_volume_map = self._gen_fname( basefile, suffix='_pveseg') @@ -341,7 +348,7 @@ def _post_run(self): for i in range(nclasses): self.outputs.probability_maps.append( self._gen_fname(basefile, suffix='_prob_%d' % i)) - + class FLIRTInputSpec(FSLCommandInputSpec): in_file = File(exists=True, argstr='-in %s', mandatory=True, @@ -667,7 +674,7 @@ def _post_run(self): if isdefined(self.inputs.save_rms) and self.inputs.save_rms: outfile = self.outputs.out_file self.outputs.rms_files = [outfile + '_abs.rms', outfile + '_rel.rms'] - + def _gen_filename(self, name): if name == 'out_file': return self._gen_outfilename() @@ -971,7 +978,7 @@ def _post_run(self): suffix='_warp') else: self.outputs.out_file = os.path.abspath(self.inputs.out_file) - + def _gen_filename(self, name): if name == 'out_file': return getattr(self.outputs, name) @@ -1029,7 +1036,7 @@ def _post_run(self): out_file = self._gen_fname(self.inputs.in_file, suffix='_st') self.outputs.slice_time_corrected_file = os.path.abspath(out_file) - + def _gen_filename(self, name): if name == 'out_file': return self.outputs.slice_time_corrected_file @@ -1108,7 +1115,7 @@ def _post_run(self): out_file = self._gen_fname(self.inputs.in_file, suffix='_smooth') self.outputs.smoothed_file = os.path.abspath(out_file) - + def _gen_filename(self, name): if name == 'out_file': return self.outputs.smoothed_file @@ -1420,7 +1427,7 @@ def _post_run(self): out_file = self._gen_fname(self.inputs.complex_phase_file, suffix='_phase_unwrapped') self.outputs.unwrapped_phase_file = os.path.abspath(out_file) - + def _gen_filename(self, name): if name == 'unwrapped_phase_file': return self.outputs.unwrapped_phase_file @@ -1520,7 +1527,7 @@ def _post_run(self): self.outputs.vtk_surfaces = self._gen_mesh_names('vtk_surfaces', structures) self.outputs.bvars = self._gen_mesh_names('bvars', structures) - + def _gen_fname(self, name): path, outname, ext = split_filename(self.inputs.out_file) diff --git a/nipype/interfaces/traits_extension.py b/nipype/interfaces/traits_extension.py index 4615570089..46d6e54afb 100644 --- a/nipype/interfaces/traits_extension.py +++ b/nipype/interfaces/traits_extension.py @@ -16,6 +16,7 @@ """ import os +import re from ..external.six import string_types # perform all external trait imports here @@ -124,9 +125,8 @@ class GenFile(File): """ A file which default name is automatically generated from other traits. """ - def __init__(self, name_source=None, ns=None, template='%s_generated', - keep_extension=True, value='', filter=None, auto_set=False, - entries=0, exists=False, **metadata): + def __init__(self, template=None, keep_extension=True, value='', + filter=None, auto_set=False, entries=0, exists=False, **metadata): """ Creates a File trait. Parameters @@ -148,28 +148,21 @@ def __init__(self, name_source=None, ns=None, template='%s_generated', *value* or '' """ - if name_source is None and ns is None: - raise TraitError('GenFile requires a name_source') - - if ns is not None and name_source is None: - name_source = ns + if template is None or not isinstance(template, string_types): + raise TraitError('GenFile requires a valid template argument') - self.name_source = name_source - if isinstance(name_source, string_types): - self.name_source = [name_source] - elif isinstance(name_source, tuple): - self.name_source = list(name_source) - - if not isinstance(self.name_source, list): - raise TraitError('name_source should be a string, or a ' - 'tuple/list of strings. Got %s' % name_source) + self.name_source = [i[1:-1].split('!')[0].split(':')[0].split('[')[0] + for i in re.findall('\{.*?\}', template)] + self.template = template.format + self.keep_ext = keep_extension for nsrc in self.name_source: if not isinstance(nsrc, string_types): - raise TraitError('name_source contains an invalid name_source ' + raise TraitError('template contains an invalid name_source ' 'entry (found %s).' % nsrc) - self.keep_ext = keep_extension - self.template = template + if '%' in nsrc or len(nsrc) == 0: + raise TraitError( + 'invalid source field found in template \'%s\'' % nsrc) super(GenFile, self).__init__(value, filter, auto_set, entries, exists, **metadata) @@ -184,7 +177,7 @@ def validate(self, object, name, value): if not isdefined(value): return value - validated_value = super(BaseFile, self).validate(object, name, value) + validated_value = super(GenFile, self).validate(object, name, value) if not self.exists: return validated_value elif os.path.isfile(value): @@ -193,19 +186,25 @@ def validate(self, object, name, value): self.error(object, name, value) def get(self, obj, name): + # Compute expected name iff trait is not set if self.value is None: - srcvals = [] + srcvals = {} ext = '' for nsrc in self.name_source: + IFLOGGER.debug('nsrc=%s', nsrc) val = getattr(obj, nsrc) try: _, val, ext = split_filename(val) except: pass - srcvals.append(val) - - if all(isdefined(v) for v in srcvals): - retval = self.template % tuple(srcvals) + + if isdefined(val): + srcvals.update({nsrc: val}) + + # Check that no source is missing + missing = list(set(self.name_source) - set(srcvals.keys())) + if not missing: + retval = self.template(**srcvals) if self.keep_ext: retval += ext return retval diff --git a/nipype/utils/filemanip.py b/nipype/utils/filemanip.py index 6723946c5e..18f659d63e 100644 --- a/nipype/utils/filemanip.py +++ b/nipype/utils/filemanip.py @@ -20,7 +20,6 @@ from .misc import is_container from ..external.six import string_types -from ..interfaces.traits_extension import isdefined from .. import logging, config fmlogger = logging.getLogger("filemanip") @@ -134,7 +133,7 @@ def fname_presuffix(fname, prefix='', suffix='', newpath=None, use_ext=True): pth, fname, ext = split_filename(fname) if not use_ext: ext = '' - if newpath and isdefined(newpath): + if newpath is not None: pth = os.path.abspath(newpath) return os.path.join(pth, prefix + fname + suffix + ext) @@ -172,7 +171,7 @@ def auto_hash(afile, hash_method=None, chunk_len=8192, crypto=hashlib.md5): """Checks the hash method and calls the appropriate function""" if hash_method is None: hash_method = config.get('execution', 'hash_method').lower() - + if hash_method not in ['content', 'timestamp']: raise ValueError("Unknown hash method: %s" % hash_method) func = getattr(sys.modules[__name__], 'hash_' + hash_method) From 9f059ee466583e195b00c6a11375c7f9fae6ac72 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Thu, 18 Feb 2016 12:02:35 -0800 Subject: [PATCH 45/73] added new GenMultiFile --- nipype/interfaces/fsl/preprocess.py | 45 ++-- nipype/interfaces/io.py | 7 +- nipype/interfaces/specs.py | 108 --------- nipype/interfaces/traits_extension.py | 314 +++++++++++++++++++++++--- nipype/interfaces/utility.py | 6 +- nipype/pipeline/engine/nodes.py | 8 +- 6 files changed, 315 insertions(+), 173 deletions(-) diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index 0e8c92096d..431db9c224 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -21,7 +21,8 @@ from builtins import range -from ..base import (TraitedSpec, File, GenFile, InputMultiPath, OutputMultiPath, traits, isdefined) +from ..base import (TraitedSpec, File, GenFile, GenMultiFile, + InputMultiPath, OutputMultiPath, traits, isdefined) from ..fsl.base import FSLCommand, FSLCommandInputSpec from ...utils.filemanip import split_filename @@ -157,10 +158,9 @@ def _run_interface(self, runtime): class FASTInputSpec(FSLCommandInputSpec): """ Defines inputs (trait classes) for FAST """ - in_files = InputMultiPath(File(exists=True), copyfile=False, - desc='image, or multi-channel set of images, ' - 'to be segmented', - argstr='%s', position=-1, mandatory=True) + in_files = InputMultiPath( + File(exists=True), copyfile=False, argstr='%s', position=-1, mandatory=True, + desc='image, or multi-channel set of images, to be segmented') number_classes = traits.Range(low=1, high=10, argstr='-n %d', desc='number of tissue-type classes') output_biasfield = traits.Bool(desc='output estimated bias field', @@ -224,19 +224,21 @@ class FASTInputSpec(FSLCommandInputSpec): probability_maps = traits.Bool(desc='outputs individual probability maps', argstr='-p') - out_basename = GenFile( - ns='in_files', template='%s', keep_extension=False, argstr='-o %s', - desc='base name of output files') - - tissue_class_map = GenFile( - ns=['out_basename', 'output_type_'], template='%s_seg%s', - desc='binary segmented volume file one val for each class') - partial_volume_map = GenFile( - ns=['out_basename', 'output_type_'], template='%s_pveseg%s', - desc="segmentation corresponding to the partial volume files") - mixeltype = GenFile( - ns=['out_basename', 'output_type_'], template='%s_mixeltype%s', - desc="path/name of mixeltype volume file ") + # Automatically generated names + out_basename = GenFile(template='{in_files[0]}', argstr='-o %s', keep_extension=False, + desc='base name of output files') + tissue_class_map = GenFile(template='{out_basename}_seg{output_type_}', + desc='binary segmented volume file one val for each class') + partial_volume_map = GenFile(template='{out_basename}_pveseg{output_type_}', + desc="segmentation corresponding to the partial volume files") + mixeltype = GenFile(template='{out_basename}_mixeltype{output_type_}', + desc="path/name of mixeltype volume file ") + + restored_image = GenMultiFile( + template='{in_files}_restore{output_type_}', + desc='restored images (one for each input image) named according to the input images') + bias_field = GenMultiFile( + template='{in_files}_bias{output_type_}', desc='Estimated bias field') def _format_arg(self, name, spec, value): # first do what should be done in general @@ -255,13 +257,14 @@ class FASTOutputSpec(TraitedSpec): partial_volume_map = File(desc="path/name of partial volume file _pveseg") mixeltype = File(desc="path/name of mixeltype volume file _mixeltype") - tissue_class_files = OutputMultiPath(File(desc='path/name of binary segmented volumes ' - 'one file for each class _seg_x')) restored_image = OutputMultiPath(File(desc='restored images (one for each input image) ' 'named according to the input images _restore')) + bias_field = OutputMultiPath(File(desc='Estimated bias field _bias')) + + tissue_class_files = OutputMultiPath(File(desc='path/name of binary segmented volumes ' + 'one file for each class _seg_x')) partial_volume_files = OutputMultiPath(File(desc='path/name of partial volumes files ' 'one for each class, _pve_x')) - bias_field = OutputMultiPath(File(desc='Estimated bias field _bias')) probability_maps = OutputMultiPath(File(desc='filenames, one for each class, for each ' 'input, prob_x')) diff --git a/nipype/interfaces/io.py b/nipype/interfaces/io.py index 378ec9d730..a6135edf95 100644 --- a/nipype/interfaces/io.py +++ b/nipype/interfaces/io.py @@ -35,11 +35,10 @@ import sqlite3 -from .traits_extension import traits, Undefined, File, Directory, isdefined +from .traits_extension import (traits, Undefined, File, Directory, isdefined, InputMultiPath, + OutputMultiPath) from .base import BaseInterface -from .specs import (TraitedSpec, DynamicTraitedSpec, - BaseInterfaceInputSpec, InputMultiPath, - OutputMultiPath) +from .specs import (TraitedSpec, DynamicTraitedSpec, BaseInterfaceInputSpec) from .. import config from ..external.six import string_types from ..utils.filemanip import (copyfile, list_to_filename, diff --git a/nipype/interfaces/specs.py b/nipype/interfaces/specs.py index 125ee4c79a..6d02fffa4e 100644 --- a/nipype/interfaces/specs.py +++ b/nipype/interfaces/specs.py @@ -656,111 +656,3 @@ def _format_arg(self, name, spec=None, value=None): else: return "" return super(SEMLikeCommandLineInputSpec, self)._format_arg(name, spec, value) - - -class MultiPath(traits.List): - """ Abstract class - shared functionality of input and output MultiPath - """ - - def validate(self, obj, name, value): - if not isdefined(value) or \ - (isinstance(value, list) and len(value) == 0): - return Undefined - newvalue = value - - if not isinstance(value, list) \ - or (self.inner_traits() and - isinstance(self.inner_traits()[0].trait_type, - traits.List) and not - isinstance(self.inner_traits()[0].trait_type, - InputMultiPath) and - isinstance(value, list) and - value and not - isinstance(value[0], list)): - newvalue = [value] - value = super(MultiPath, self).validate(obj, name, newvalue) - - if len(value) > 0: - return value - - self.error(obj, name, value) - - -class OutputMultiPath(MultiPath): - """ Implements a user friendly traits that accepts one or more - paths to files or directories. This is the output version which - return a single string whenever possible (when it was set to a - single value or a list of length 1). Default value of this trait - is _Undefined. It does not accept empty lists. - - XXX This should only be used as a final resort. We should stick to - established Traits to the extent possible. - - XXX This needs to be vetted by somebody who understands traits - - >>> from nipype.interfaces.base import OutputMultiPath - >>> class A(TraitedSpec): - ... foo = OutputMultiPath(File(exists=False)) - >>> a = A() - >>> a.foo - - - >>> a.foo = '/software/temp/foo.txt' - >>> a.foo - '/software/temp/foo.txt' - - >>> a.foo = ['/software/temp/foo.txt'] - >>> a.foo - '/software/temp/foo.txt' - - >>> a.foo = ['/software/temp/foo.txt', '/software/temp/goo.txt'] - >>> a.foo - ['/software/temp/foo.txt', '/software/temp/goo.txt'] - - """ - - def get(self, obj, name): - value = self.get_value(obj, name) - if len(value) == 0: - return Undefined - elif len(value) == 1: - return value[0] - else: - return value - - def set(self, obj, name, value): - self.set_value(obj, name, value) - - -class InputMultiPath(MultiPath): - """ Implements a user friendly traits that accepts one or more - paths to files or directories. This is the input version which - always returns a list. Default value of this trait - is _Undefined. It does not accept empty lists. - - XXX This should only be used as a final resort. We should stick to - established Traits to the extent possible. - - XXX This needs to be vetted by somebody who understands traits - - >>> from nipype.interfaces.base import InputMultiPath - >>> class A(TraitedSpec): - ... foo = InputMultiPath(File(exists=False)) - >>> a = A() - >>> a.foo - - - >>> a.foo = '/software/temp/foo.txt' - >>> a.foo - ['/software/temp/foo.txt'] - - >>> a.foo = ['/software/temp/foo.txt'] - >>> a.foo - ['/software/temp/foo.txt'] - - >>> a.foo = ['/software/temp/foo.txt', '/software/temp/goo.txt'] - >>> a.foo - ['/software/temp/foo.txt', '/software/temp/goo.txt'] - - """ - pass diff --git a/nipype/interfaces/traits_extension.py b/nipype/interfaces/traits_extension.py index 46d6e54afb..617937dff2 100644 --- a/nipype/interfaces/traits_extension.py +++ b/nipype/interfaces/traits_extension.py @@ -17,6 +17,7 @@ """ import os import re +import itertools as itools from ..external.six import string_types # perform all external trait imports here @@ -124,29 +125,43 @@ def __init__(self, value='', filter=None, auto_set=False, class GenFile(File): """ A file which default name is automatically generated from other traits. + + >>> # The traits start undefined + >>> from nipype.interfaces.base import GenFile, Undefined + >>> class A(TraitedSpec): + ... src = File(exists=False) + ... foo = GenFile(template='{src}_foo') + >>> a = A() + >>> a.src + + >>> a.foo + + + >>> # If the source trait is set, foo can be sourced ... + >>> a.src = '/software/temp/src.txt' + >>> a.foo + 'src_foo.txt' + + >>> # ... and updates with the update of src ... + >>> a.src = '/software/temp/foo.txt' + >>> a.foo + 'foo_foo.txt' + + >>> # ... util it is explicitly set. + >>> a.foo = '/software/temp/goo.txt' + >>> a.foo + '/software/temp/goo.txt' + + >>> # Setting it Undefined will restore the sourcing behavior + >>> a.foo = Undefined + >>> a.foo + 'foo_foo.txt' + """ + def __init__(self, template=None, keep_extension=True, value='', filter=None, auto_set=False, entries=0, exists=False, **metadata): - """ Creates a File trait. - - Parameters - ---------- - value : string - The default value for the trait - filter : string - A wildcard string to filter filenames in the file dialog box used by - the attribute trait editor. - auto_set : boolean - Indicates whether the file editor updates the trait value after - every key stroke. - exists : boolean - Indicates whether the trait value must be an existing file or - not. - - Default Value - ------------- - *value* or '' - """ + """ Creates a GenFile trait. """ if template is None or not isinstance(template, string_types): raise TraitError('GenFile requires a valid template argument') @@ -165,7 +180,7 @@ def __init__(self, template=None, keep_extension=True, value='', 'invalid source field found in template \'%s\'' % nsrc) super(GenFile, self).__init__(value, filter, auto_set, entries, exists, - **metadata) + **metadata) def validate(self, object, name, value): @@ -187,19 +202,40 @@ def validate(self, object, name, value): def get(self, obj, name): # Compute expected name iff trait is not set + if self.value is None: srcvals = {} ext = '' for nsrc in self.name_source: - IFLOGGER.debug('nsrc=%s', nsrc) - val = getattr(obj, nsrc) - try: - _, val, ext = split_filename(val) - except: - pass + srcvalue = getattr(obj, nsrc) - if isdefined(val): - srcvals.update({nsrc: val}) + if not isdefined(srcvalue): + return Undefined + + if isinstance(srcvalue, string_types): + vallist = [srcvalue] + else: + vallist = list(srcvalue) + + outvals = [] + for val in vallist: + try: + _, val, ext = split_filename(val) + except: + pass + + if isdefined(val): + outvals.append(val) + + if not outvals: + continue + + if isinstance(srcvalue, string_types): + srcvals.update({nsrc: outvals[0]}) + elif isinstance(srcvalue, tuple): + srcvals.update({nsrc: tuple(outvals)}) + else: + srcvals.update({nsrc: outvals}) # Check that no source is missing missing = list(set(self.name_source) - set(srcvals.keys())) @@ -210,13 +246,225 @@ def get(self, obj, name): return retval else: return Undefined - return self.value + return self.get_value(obj, name) def set(self, obj, name, value): - if isdefined(value): - self.value = value + self.set_value(obj, name, value) + + +class MultiPath(traits.List): + """ Abstract class - shared functionality of input and output MultiPath + """ + + def validate(self, obj, name, value): + if not isdefined(value) or \ + (isinstance(value, list) and len(value) == 0): + return Undefined + newvalue = value + + if not isinstance(value, list) \ + or (self.inner_traits() and + isinstance(self.inner_traits()[0].trait_type, + traits.List) and not + isinstance(self.inner_traits()[0].trait_type, + InputMultiPath) and + isinstance(value, list) and + value and not + isinstance(value[0], list)): + newvalue = [value] + value = super(MultiPath, self).validate(obj, name, newvalue) + + if len(value) > 0: + return value + + self.error(obj, name, value) + + +class GenMultiFile(traits.List): + def __init__(self, template=None, keep_extension=True, **metadata): + if template is None or not isinstance(template, string_types): + raise TraitError('GenMultiFile requires a valid template argument') + + self.name_source = [i[1:-1].split('!')[0].split(':')[0].split('[')[0] + for i in re.findall('\{.*?\}', template)] + self.template = template.format + self.keep_ext = keep_extension + + for nsrc in self.name_source: + if not isinstance(nsrc, string_types): + raise TraitError('template contains an invalid name_source ' + 'entry (found %s).' % nsrc) + if '%' in nsrc or len(nsrc) == 0: + raise TraitError( + 'invalid source field found in template \'%s\'' % nsrc) + super(GenMultiFile, self).__init__(**metadata) + + def validate(self, obj, name, value): + if not isdefined(value) or \ + (isinstance(value, list) and len(value) == 0): + return Undefined + newvalue = value + + if not isinstance(value, list) \ + or (self.inner_traits() and + isinstance(self.inner_traits()[0].trait_type, + traits.List) and not + isinstance(self.inner_traits()[0].trait_type, + InputMultiPath) and + isinstance(value, list) and + value and not + isinstance(value[0], list)): + newvalue = [value] + value = super(GenMultiFile, self).validate(obj, name, newvalue) + + if len(value) > 0: + return value + + self.error(obj, name, value) + + def get(self, obj, name): + # Compute expected name iff trait is not set + value = self.get_value(obj, name) + + if not isdefined(value) or not value: + srcvals = {} + ext = '' + for nsrc in self.name_source: + srcvalue = getattr(obj, nsrc) + + if not isdefined(srcvalue): + return Undefined + + if isinstance(srcvalue, string_types): + vallist = [srcvalue] + else: + vallist = list(srcvalue) + + outvals = [] + for val in vallist: + try: + _, val, ext = split_filename(val) + except: + pass + + if isdefined(val): + outvals.append(val) + + if outvals: + srcvals.update({nsrc: outvals}) + + # Check that no source is missing + missing = list(set(self.name_source) - set(srcvals.keys())) + if not missing: + results = [] + combs = list(itools.product(*tuple(srcvals[k] for k in self.name_source))) + + # Get the formatting dictionaries ready + dlist = [{self.name_source[i]: v for i, v in enumerate(kvalues)} + for kvalues in combs] + # ... and create a formatted entry for each of them + for fmtdict in dlist: + retval = self.template(**fmtdict) + if self.keep_ext: + retval += ext + results.append(retval) + + if results: + if len(results) == 1: + return results[0] + return results + + return Undefined + + if len(value) == 0: + return Undefined + elif len(value) == 1: + return value[0] else: - self.value = None + return value + + def set(self, obj, name, value): + self.set_value(obj, name, value) + + +class OutputMultiPath(MultiPath): + """ Implements a user friendly traits that accepts one or more + paths to files or directories. This is the output version which + return a single string whenever possible (when it was set to a + single value or a list of length 1). Default value of this trait + is _Undefined. It does not accept empty lists. + + XXX This should only be used as a final resort. We should stick to + established Traits to the extent possible. + + XXX This needs to be vetted by somebody who understands traits + + >>> from nipype.interfaces.base import OutputMultiPath + >>> class A(TraitedSpec): + ... foo = OutputMultiPath(File(exists=False)) + >>> a = A() + >>> a.foo + + + >>> a.foo = '/software/temp/foo.txt' + >>> a.foo + '/software/temp/foo.txt' + + >>> a.foo = ['/software/temp/foo.txt'] + >>> a.foo + '/software/temp/foo.txt' + + >>> a.foo = ['/software/temp/foo.txt', '/software/temp/goo.txt'] + >>> a.foo + ['/software/temp/foo.txt', '/software/temp/goo.txt'] + + """ + + def get(self, obj, name): + value = self.get_value(obj, name) + if len(value) == 0: + return Undefined + elif len(value) == 1: + return value[0] + else: + return value + + def set(self, obj, name, value): + self.set_value(obj, name, value) + + +class InputMultiPath(MultiPath): + """ Implements a user friendly traits that accepts one or more + paths to files or directories. This is the input version which + always returns a list. Default value of this trait + is _Undefined. It does not accept empty lists. + + XXX This should only be used as a final resort. We should stick to + established Traits to the extent possible. + + XXX This needs to be vetted by somebody who understands traits + + >>> from nipype.interfaces.base import InputMultiPath + >>> class A(TraitedSpec): + ... foo = InputMultiPath(File(exists=False)) + >>> a = A() + >>> a.foo + + + >>> a.foo = '/software/temp/foo.txt' + >>> a.foo + ['/software/temp/foo.txt'] + + >>> a.foo = ['/software/temp/foo.txt'] + >>> a.foo + ['/software/temp/foo.txt'] + + >>> a.foo = ['/software/temp/foo.txt', '/software/temp/goo.txt'] + >>> a.foo + ['/software/temp/foo.txt', '/software/temp/goo.txt'] + + """ + pass # ------------------------------------------------------------------------------- diff --git a/nipype/interfaces/utility.py b/nipype/interfaces/utility.py index 82421b86f4..35e89a63a5 100644 --- a/nipype/interfaces/utility.py +++ b/nipype/interfaces/utility.py @@ -21,11 +21,11 @@ import numpy as np import nibabel as nb -from .traits_extension import traits, Undefined, File, isdefined +from .traits_extension import (traits, Undefined, File, isdefined, InputMultiPath, + OutputMultiPath) from .base import BaseInterface from .specs import (TraitedSpec, DynamicTraitedSpec, - BaseInterfaceInputSpec, InputMultiPath, - OutputMultiPath) + BaseInterfaceInputSpec) from .io import IOBase, add_traits from ..external.six import string_types from ..testing import assert_equal diff --git a/nipype/pipeline/engine/nodes.py b/nipype/pipeline/engine/nodes.py index cf3cef0381..e06ea9b92c 100644 --- a/nipype/pipeline/engine/nodes.py +++ b/nipype/pipeline/engine/nodes.py @@ -47,6 +47,7 @@ import numpy as np import networkx as nx +from ...external.six import string_types from ...utils.misc import package_check, str2bool from ... import config, logging @@ -55,11 +56,10 @@ list_to_filename, copyfiles, fnames_presuffix, loadpkl, split_filename, load_json, \ savepkl, write_rst_header, write_rst_dict, write_rst_list -from ...interfaces.traits_extension import traits, Undefined, isdefined -from ...interfaces.specs import InputMultiPath, DynamicTraitedSpec -from ...interfaces.base import CommandLine, Bunch, InterfaceResult, Interface +from ...interfaces.base import (traits, Undefined, isdefined, + InputMultiPath, DynamicTraitedSpec, + CommandLine, Bunch, InterfaceResult, Interface) -from ...external.six import string_types from .utils import (modify_paths, make_output_dir, write_workflow_prov, clean_working_directory, format_dot, topological_sort, get_print_name, merge_dict, evaluate_connect_function) From 5657fbdb35d9488726eafa6779a3094d82da2588 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Thu, 18 Feb 2016 13:44:07 -0800 Subject: [PATCH 46/73] finished the automated generation of multipaths --- nipype/interfaces/fsl/preprocess.py | 16 +++++- nipype/interfaces/traits_extension.py | 78 +++++++++++++++++++++++++-- 2 files changed, 90 insertions(+), 4 deletions(-) diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index 431db9c224..0326577ccf 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -161,7 +161,7 @@ class FASTInputSpec(FSLCommandInputSpec): in_files = InputMultiPath( File(exists=True), copyfile=False, argstr='%s', position=-1, mandatory=True, desc='image, or multi-channel set of images, to be segmented') - number_classes = traits.Range(low=1, high=10, argstr='-n %d', + number_classes = traits.Range(low=1, high=10, argstr='-n %d', usedefault=True, default=3, desc='number of tissue-type classes') output_biasfield = traits.Bool(desc='output estimated bias field', argstr='-b') @@ -234,12 +234,25 @@ class FASTInputSpec(FSLCommandInputSpec): mixeltype = GenFile(template='{out_basename}_mixeltype{output_type_}', desc="path/name of mixeltype volume file ") + # Automatically generated lists of names, one element per in_files restored_image = GenMultiFile( template='{in_files}_restore{output_type_}', desc='restored images (one for each input image) named according to the input images') bias_field = GenMultiFile( template='{in_files}_bias{output_type_}', desc='Estimated bias field') + # Automatically generated lists of names, using range + tissue_class_files = GenMultiFile( + template='{out_basename}_seg_{number_classes:d}{output_type_}', range_source='number_classes', + desc='path/name of binary segmented volumes one file for each class _seg_x') + partial_volume_files = GenMultiFile( + template='{out_basename}_pve_{number_classes:d}{output_type_}', range_source='number_classes', + desc='path/name of partial volumes files one for each class, _pve_x') + probability_maps_files = GenMultiFile( + template='{out_basename}_prob_{number_classes:d}{output_type_}', range_source='number_classes', + desc='filenames, one for each class, for each input, prob_x', output_name='probability_maps') + + def _format_arg(self, name, spec, value): # first do what should be done in general formatted = super(FASTInputSpec, self)._format_arg(name, spec, value) @@ -261,6 +274,7 @@ class FASTOutputSpec(TraitedSpec): 'named according to the input images _restore')) bias_field = OutputMultiPath(File(desc='Estimated bias field _bias')) + tissue_class_files = OutputMultiPath(File(desc='path/name of binary segmented volumes ' 'one file for each class _seg_x')) partial_volume_files = OutputMultiPath(File(desc='path/name of partial volumes files ' diff --git a/nipype/interfaces/traits_extension.py b/nipype/interfaces/traits_extension.py index 617937dff2..bb9d145efc 100644 --- a/nipype/interfaces/traits_extension.py +++ b/nipype/interfaces/traits_extension.py @@ -166,7 +166,7 @@ def __init__(self, template=None, keep_extension=True, value='', if template is None or not isinstance(template, string_types): raise TraitError('GenFile requires a valid template argument') - self.name_source = [i[1:-1].split('!')[0].split(':')[0].split('[')[0] + self.name_source = [i[1:-1].split('.')[0].split('!')[0].split(':')[0].split('[')[0] for i in re.findall('\{.*?\}', template)] self.template = template.format self.keep_ext = keep_extension @@ -281,11 +281,66 @@ def validate(self, obj, name, value): class GenMultiFile(traits.List): - def __init__(self, template=None, keep_extension=True, **metadata): + """ Traits to generate lists of files. + + >>> # The traits start undefined + >>> from nipype.interfaces.base import GenFile, Undefined, traits + >>> class A(TraitedSpec): + ... src = InputMultiPath(File(exists=False)) + ... foo = GenMultiFile(template='{src}_foo') + >>> a = A() + >>> a.src + + >>> a.foo + + + >>> # If the source trait is set, foo can be sourced ... + >>> a.src = ['/software/temp/src1.txt', '/software/temp/src2.txt'] + >>> a.foo + ['src1_foo.txt', 'src2_foo.txt'] + + >>> # ... and updates with the update of src ... + >>> a.src = ['/software/temp/foo1.txt', '/software/temp/foo2.txt'] + >>> a.foo + ['foo1_foo.txt', 'foo2_foo.txt'] + + >>> # ... util it is explicitly set. + >>> a.foo = ['/software/temp/goo1.txt', '/software/temp/goo2.txt'] + >>> a.foo + ['/software/temp/goo1.txt', '/software/temp/goo2.txt'] + + >>> # Setting it Undefined will restore the sourcing behavior + >>> a.foo = Undefined + >>> a.foo + ['foo1_foo.txt', 'foo2_foo.txt'] + + >>> # It works with several replacements and defining ranges + >>> class B(TraitedSpec): + ... src = File(exists=False) + ... num = traits.Int() + ... foo = GenMultiFile(template='{src}_foo_{num:03d}', range_source='num') + >>> a.src = '/software/temp/source.txt' + >>> a.num = 3 + >>> a.foo + ['source_foo_000.txt', 'source_foo_001.txt', 'source_foo_002.txt'] + + >>> # And altogether with InputMultiPaths + >>> class B(TraitedSpec): + ... src = InputMultiPath(File(exists=False)) + ... num = traits.Int() + ... foo = GenMultiFile(template='{src}_foo_{num:03d}', range_source='num') + >>> a.src = ['/software/temp/source.txt', '/software/temp/alt.txt'] + >>> a.num = 2 + >>> a.foo + ['source_foo_000.txt', 'alt_foo_000.txt', 'source_foo_001.txt', 'alt_foo_001.txt'] + + + """ + def __init__(self, template=None, keep_extension=True, range_source=None, **metadata): if template is None or not isinstance(template, string_types): raise TraitError('GenMultiFile requires a valid template argument') - self.name_source = [i[1:-1].split('!')[0].split(':')[0].split('[')[0] + self.name_source = [i[1:-1].split('.')[0].split('!')[0].split(':')[0].split('[')[0] for i in re.findall('\{.*?\}', template)] self.template = template.format self.keep_ext = keep_extension @@ -297,6 +352,19 @@ def __init__(self, template=None, keep_extension=True, **metadata): if '%' in nsrc or len(nsrc) == 0: raise TraitError( 'invalid source field found in template \'%s\'' % nsrc) + + self.range_source = None + if range_source is not None: + if not isinstance(range_source, string_types): + raise TraitError( + 'range_source is not valid (found %s).' % range_source) + + if range_source not in self.name_source: + raise TraitError( + 'range_source field should also be found in the' + ' template (valid fields = %s).' % self.name_source) + self.range_source = range_source + super(GenMultiFile, self).__init__(**metadata) def validate(self, obj, name, value): @@ -335,6 +403,10 @@ def get(self, obj, name): if not isdefined(srcvalue): return Undefined + if self.range_source is not None and nsrc == self.range_source: + srcvalue = range(int(srcvalue)) + vallist = srcvalue + if isinstance(srcvalue, string_types): vallist = [srcvalue] else: From 4c58ad7eac977d02965e5fdceaff94ba7f897f26 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Thu, 18 Feb 2016 14:35:57 -0800 Subject: [PATCH 47/73] updated specs, algorithms updated --- nipype/algorithms/icc.py | 6 +- nipype/algorithms/mesh.py | 20 +++---- nipype/algorithms/metrics.py | 9 ++- nipype/algorithms/misc.py | 20 +++---- nipype/algorithms/modelgen.py | 5 +- nipype/algorithms/rapidart.py | 11 ++-- .../tests/test_auto_AddCSVColumn.py | 4 +- nipype/algorithms/tests/test_auto_AddNoise.py | 4 +- .../algorithms/tests/test_auto_CreateNifti.py | 4 +- nipype/algorithms/tests/test_auto_ErrorMap.py | 35 +++++++++++ nipype/algorithms/tests/test_auto_Gunzip.py | 6 +- .../tests/test_auto_MeshWarpMaths.py | 10 +--- .../tests/test_auto_ModifyAffine.py | 5 +- .../test_auto_NormalizeProbabilityMapSet.py | 5 +- nipype/algorithms/tests/test_auto_Overlap.py | 47 +++++++++++++++ .../algorithms/tests/test_auto_PickAtlas.py | 4 +- .../tests/test_auto_SimpleThreshold.py | 5 +- .../tests/test_auto_StimulusCorrelation.py | 5 +- nipype/algorithms/tests/test_auto_TSNR.py | 16 ++--- .../algorithms/tests/test_auto_WarpPoints.py | 5 +- nipype/interfaces/afni/base.py | 4 +- nipype/interfaces/afni/preprocess.py | 5 +- nipype/interfaces/afni/svm.py | 4 +- nipype/interfaces/fsl/tests/test_auto_BET.py | 59 ++++++++----------- nipype/interfaces/fsl/tests/test_auto_FAST.py | 10 ++++ nipype/interfaces/io.py | 8 +-- nipype/interfaces/utility.py | 8 +-- 27 files changed, 174 insertions(+), 150 deletions(-) create mode 100644 nipype/algorithms/tests/test_auto_ErrorMap.py create mode 100644 nipype/algorithms/tests/test_auto_Overlap.py diff --git a/nipype/algorithms/icc.py b/nipype/algorithms/icc.py index 79705dc172..5c1faff0b7 100644 --- a/nipype/algorithms/icc.py +++ b/nipype/algorithms/icc.py @@ -19,10 +19,8 @@ import nibabel as nb from builtins import range -from ..interfaces.traits_extension import traits, File -from ..interfaces.specs import BaseInterfaceInputSpec, TraitedSpec -from ..interfaces.base import BaseInterface - +from ..interfaces.base import (traits, File, BaseInterface, BaseInterfaceInputSpec, + TraitedSpec) class ICCInputSpec(BaseInterfaceInputSpec): subjects_sessions = traits.List(traits.List(File(exists=True)), diff --git a/nipype/algorithms/mesh.py b/nipype/algorithms/mesh.py index 77e961662c..72fe267481 100644 --- a/nipype/algorithms/mesh.py +++ b/nipype/algorithms/mesh.py @@ -19,9 +19,7 @@ from .. import logging from ..external.six import string_types -from ..interfaces.traits_extension import traits, File -from ..interfaces.specs import BaseInterfaceInputSpec, TraitedSpec -from ..interfaces.base import BaseInterface +from ..interfaces.base import traits, File, GenFile, BaseInterface, BaseInterfaceInputSpec, TraitedSpec IFLOGGER = logging.getLogger('interface') @@ -47,8 +45,8 @@ class WarpPointsInputSpec(BaseInterfaceInputSpec): desc=('dense deformation field to be applied')) interp = traits.Enum('cubic', 'nearest', 'linear', usedefault=True, mandatory=True, desc='interpolation') - out_points = File(name_source='points', name_template='%s_warped', keep_extension=True, - desc='the warped point set') + out_points = GenFile(template='{points}_warped', keep_extension=True, + desc='the warped point set') class WarpPointsOutputSpec(TraitedSpec): @@ -273,18 +271,16 @@ class MeshWarpMathsInputSpec(BaseInterfaceInputSpec): operation = traits.Enum('sum', 'sub', 'mul', 'div', usedefault=True, desc=('operation to be performed')) - out_warp = File(name_source='in_surf', name_template='%s_warp', keep_extension=True, - usedefault=True, desc='vtk file based on in_surf and warpings mapping it ' - 'to out_file') - out_file = File(name_source='in_surf', name_template='%s_warped', keep_extension=True, - usedefault=True, desc='vtk with surface warped') + out_warp = GenFile(template='{in_surf}_warping', keep_extension=True, + desc='vtk file based on in_surf and warpings mapping it to out_file') + out_file = File(template='{in_surf}_warped', keep_extension=True, + desc='vtk with surface warped') class MeshWarpMathsOutputSpec(TraitedSpec): out_warp = File(exists=True, desc=('vtk file with the vertex-wise ' 'mapping of surface1 to surface2')) - out_file = File(exists=True, - desc='vtk with surface warped') + out_file = File(exists=True, desc='vtk with surface warped') class MeshWarpMaths(TVTKBaseInterface): diff --git a/nipype/algorithms/metrics.py b/nipype/algorithms/metrics.py index 9996a78b8f..d2365ce92b 100644 --- a/nipype/algorithms/metrics.py +++ b/nipype/algorithms/metrics.py @@ -27,9 +27,8 @@ from .. import logging from ..utils.misc import package_check -from ..interfaces.traits_extension import traits, File, isdefined -from ..interfaces.specs import BaseInterfaceInputSpec, TraitedSpec, InputMultiPath -from ..interfaces.base import BaseInterface +from ..interfaces.base import (traits, File, GenFile, isdefined, BaseInterfaceInputSpec, + TraitedSpec, InputMultiPath, BaseInterface) iflogger = logging.getLogger('interface') @@ -464,8 +463,8 @@ class ErrorMapInputSpec(BaseInterfaceInputSpec): metric = traits.Enum("sqeuclidean", "euclidean", desc='error map metric (as implemented in scipy cdist)', usedefault=True, mandatory=True) - out_map = File(name_source='in_tst', name_template='%s_errormap', keep_extension=True, - desc="Name for the output file") + out_map = GenFile(template='{in_tst}_errormap', keep_extension=True, + desc="Name for the output file") class ErrorMapOutputSpec(TraitedSpec): diff --git a/nipype/algorithms/misc.py b/nipype/algorithms/misc.py index 3b7802475a..a36ce10592 100644 --- a/nipype/algorithms/misc.py +++ b/nipype/algorithms/misc.py @@ -30,9 +30,9 @@ from . import metrics as nam from ..utils.filemanip import fname_presuffix, split_filename -from ..interfaces.traits_extension import traits, File, GenFile, isdefined, Undefined -from ..interfaces.specs import BaseInterfaceInputSpec, TraitedSpec, InputMultiPath, OutputMultiPath, DynamicTraitedSpec -from ..interfaces.base import BaseInterface +from ..interfaces.base import (traits, File, GenFile, GenMultiFile, isdefined, Undefined, + BaseInterfaceInputSpec, TraitedSpec, InputMultiPath, + OutputMultiPath, DynamicTraitedSpec, BaseInterface) from .. import logging @@ -115,9 +115,8 @@ class SimpleThresholdInputSpec(BaseInterfaceInputSpec): desc='volumes to be thresholded') threshold = traits.Float(mandatory=True, desc='volumes to be thresholdedeverything below ' 'this value will be set to zero') - thresholded_volumes = OutputMultiPath( - File(exists=True), name_source='volumes', name_template='%s_thresholded', - keep_extension=True, desc="thresholded volumes") + thresholded_volumes = GenMultiFile(template='{volumes}_thresholded', keep_extension=True, + desc="thresholded volumes") class SimpleThresholdOutputSpec(TraitedSpec): @@ -153,9 +152,8 @@ class ModifyAffineInputSpec(BaseInterfaceInputSpec): transformation_matrix = traits.Array( value=np.eye(4), shape=(4, 4), usedefault=True, desc='transformation matrix that will be left multiplied by the affine matrix') - transformed_volumes = OutputMultiPath( - File(exist=True), name_source='volumes', name_template='%s_transformed', - keep_extension=True, desc='output transformed files') + transformed_volumes = GenMultiFile(template='{volumes}_transformed', keep_extension=True, + desc='output transformed files') class ModifyAffineOutputSpec(TraitedSpec): @@ -852,8 +850,8 @@ def gen_noise(self, image, mask=None, snr_db=10.0, dist='normal', bg_dist='norma class NormalizeProbabilityMapSetInputSpec(TraitedSpec): in_files = InputMultiPath(File(exists=True, mandatory=True, desc='The tpms to be normalized')) - out_files = OutputMultiPath(File(), name_source='in_files', name_template='%s_norm', - keep_extension=True, desc="normalized maps") + out_files = GenMultiFile(template='{in_files}_norm', keep_extension=True, + desc="normalized maps") in_mask = File(exists=True, desc='Masked voxels must sum up 1.0, 0.0 otherwise.') diff --git a/nipype/algorithms/modelgen.py b/nipype/algorithms/modelgen.py index 1285e9c76e..52daa0da1c 100644 --- a/nipype/algorithms/modelgen.py +++ b/nipype/algorithms/modelgen.py @@ -30,9 +30,8 @@ from ..external.six import string_types -from ..interfaces.traits_extension import traits, File, isdefined, Undefined -from ..interfaces.specs import BaseInterfaceInputSpec, TraitedSpec, InputMultiPath -from ..interfaces.base import BaseInterface, Bunch +from ..interfaces.base import (traits, File, isdefined, Undefined, BaseInterfaceInputSpec, + TraitedSpec, InputMultiPath, BaseInterface, Bunch) from ..utils.filemanip import filename_to_list from .. import config, logging diff --git a/nipype/algorithms/rapidart.py b/nipype/algorithms/rapidart.py index 9ceedc24b9..fb1ee0a354 100644 --- a/nipype/algorithms/rapidart.py +++ b/nipype/algorithms/rapidart.py @@ -33,10 +33,8 @@ from ..utils.filemanip import filename_to_list, save_json, split_filename from ..utils.misc import find_indices - -from ..interfaces.traits_extension import traits, File, isdefined -from ..interfaces.specs import BaseInterfaceInputSpec, TraitedSpec, InputMultiPath, OutputMultiPath -from ..interfaces.base import BaseInterface +from ..interfaces.base import (traits, File, GenMultiFile, isdefined, BaseInterfaceInputSpec, + TraitedSpec, InputMultiPath, OutputMultiPath, BaseInterface) from .. import logging, config iflogger = logging.getLogger('interface') @@ -438,9 +436,8 @@ class StimCorrInputSpec(BaseInterfaceInputSpec): desc='SPM mat file (use pre-estimate SPM.mat file)') concatenated_design = traits.Bool( mandatory=True, desc='state if the design matrix contains concatenated sessions') - stimcorr_files = OutputMultiPath(File(exists=True), name_source='realignment_parameters', - name_template='qa.%s_stimcorr.txt', keep_extension=False, - desc='List of files containing correlation values') + stimcorr_files = GenMultiFile(template='qa.{realignment_parameters}_stimcorr.txt', + keep_extension=False, desc='List of files containing correlation values') class StimCorrOutputSpec(TraitedSpec): stimcorr_files = OutputMultiPath( diff --git a/nipype/algorithms/tests/test_auto_AddCSVColumn.py b/nipype/algorithms/tests/test_auto_AddCSVColumn.py index f37f8e6001..1cf26d7c2b 100644 --- a/nipype/algorithms/tests/test_auto_AddCSVColumn.py +++ b/nipype/algorithms/tests/test_auto_AddCSVColumn.py @@ -8,9 +8,7 @@ def test_AddCSVColumn_inputs(): extra_field=dict(), in_file=dict(mandatory=True, ), - out_file=dict(keep_extension=True, - name_source='in_file', - name_template='%s_col_added', + out_file=dict(ns='in_file', output_name='csv_file', ), ) diff --git a/nipype/algorithms/tests/test_auto_AddNoise.py b/nipype/algorithms/tests/test_auto_AddNoise.py index 80e4f943a1..0dc3fcabcc 100644 --- a/nipype/algorithms/tests/test_auto_AddNoise.py +++ b/nipype/algorithms/tests/test_auto_AddNoise.py @@ -13,9 +13,7 @@ def test_AddNoise_inputs(): in_file=dict(mandatory=True, ), in_mask=dict(), - out_file=dict(keep_extension=True, - name_source=['in_file', 'snr'], - name_template='%s_SNR%.02f', + out_file=dict(ns=['in_file', 'snr'], ), snr=dict(usedefault=True, ), diff --git a/nipype/algorithms/tests/test_auto_CreateNifti.py b/nipype/algorithms/tests/test_auto_CreateNifti.py index 3db3ff8abb..ce76d6e26d 100644 --- a/nipype/algorithms/tests/test_auto_CreateNifti.py +++ b/nipype/algorithms/tests/test_auto_CreateNifti.py @@ -12,9 +12,7 @@ def test_CreateNifti_inputs(): ignore_exception=dict(nohash=True, usedefault=True, ), - nifti_file=dict(keep_extension=False, - name_source='data_file', - name_template='%s_nifti.nii', + nifti_file=dict(ns='data_file', ), ) inputs = CreateNifti.input_spec() diff --git a/nipype/algorithms/tests/test_auto_ErrorMap.py b/nipype/algorithms/tests/test_auto_ErrorMap.py new file mode 100644 index 0000000000..69484529dd --- /dev/null +++ b/nipype/algorithms/tests/test_auto_ErrorMap.py @@ -0,0 +1,35 @@ +# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT +from ...testing import assert_equal +from ..metrics import ErrorMap + + +def test_ErrorMap_inputs(): + input_map = dict(ignore_exception=dict(nohash=True, + usedefault=True, + ), + in_ref=dict(mandatory=True, + ), + in_tst=dict(mandatory=True, + ), + mask=dict(), + metric=dict(mandatory=True, + usedefault=True, + ), + out_map=dict(), + ) + inputs = ErrorMap.input_spec() + + for key, metadata in list(input_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(inputs.traits()[key], metakey), value + + +def test_ErrorMap_outputs(): + output_map = dict(distance=dict(), + out_map=dict(), + ) + outputs = ErrorMap.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/algorithms/tests/test_auto_Gunzip.py b/nipype/algorithms/tests/test_auto_Gunzip.py index a0813cb089..35e4572913 100644 --- a/nipype/algorithms/tests/test_auto_Gunzip.py +++ b/nipype/algorithms/tests/test_auto_Gunzip.py @@ -9,10 +9,8 @@ def test_Gunzip_inputs(): ), in_file=dict(mandatory=True, ), - out_file=dict(keep_extension=False, - name_remove='.gz', - name_source='in_file', - name_template='%s', + out_file=dict(name_remove='.gz', + ns='in_file', ), ) inputs = Gunzip.input_spec() diff --git a/nipype/algorithms/tests/test_auto_MeshWarpMaths.py b/nipype/algorithms/tests/test_auto_MeshWarpMaths.py index 453d08ff37..a1ae3d5525 100644 --- a/nipype/algorithms/tests/test_auto_MeshWarpMaths.py +++ b/nipype/algorithms/tests/test_auto_MeshWarpMaths.py @@ -15,15 +15,9 @@ def test_MeshWarpMaths_inputs(): operator=dict(mandatory=True, ), out_file=dict(keep_extension=True, - name_source='in_surf', - name_template='%s_warped', - usedefault=True, - ), - out_warp=dict(keep_extension=True, - name_source='in_surf', - name_template='%s_warp', - usedefault=True, + template='{in_surf}_warped', ), + out_warp=dict(), ) inputs = MeshWarpMaths.input_spec() diff --git a/nipype/algorithms/tests/test_auto_ModifyAffine.py b/nipype/algorithms/tests/test_auto_ModifyAffine.py index 066e873f3d..1d16433b83 100644 --- a/nipype/algorithms/tests/test_auto_ModifyAffine.py +++ b/nipype/algorithms/tests/test_auto_ModifyAffine.py @@ -9,10 +9,7 @@ def test_ModifyAffine_inputs(): ), transformation_matrix=dict(usedefault=True, ), - transformed_volumes=dict(keep_extension=True, - name_source='volumes', - name_template='%s_transformed', - ), + transformed_volumes=dict(), volumes=dict(mandatory=True, ), ) diff --git a/nipype/algorithms/tests/test_auto_NormalizeProbabilityMapSet.py b/nipype/algorithms/tests/test_auto_NormalizeProbabilityMapSet.py index 87ad729c6a..66382d723c 100644 --- a/nipype/algorithms/tests/test_auto_NormalizeProbabilityMapSet.py +++ b/nipype/algorithms/tests/test_auto_NormalizeProbabilityMapSet.py @@ -6,10 +6,7 @@ def test_NormalizeProbabilityMapSet_inputs(): input_map = dict(in_files=dict(), in_mask=dict(), - out_files=dict(keep_extension=True, - name_source='in_files', - name_template='%s_norm', - ), + out_files=dict(), ) inputs = NormalizeProbabilityMapSet.input_spec() diff --git a/nipype/algorithms/tests/test_auto_Overlap.py b/nipype/algorithms/tests/test_auto_Overlap.py new file mode 100644 index 0000000000..a5a3874bd1 --- /dev/null +++ b/nipype/algorithms/tests/test_auto_Overlap.py @@ -0,0 +1,47 @@ +# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT +from ...testing import assert_equal +from ..misc import Overlap + + +def test_Overlap_inputs(): + input_map = dict(bg_overlap=dict(mandatory=True, + usedefault=True, + ), + ignore_exception=dict(nohash=True, + usedefault=True, + ), + mask_volume=dict(), + out_file=dict(usedefault=True, + ), + vol_units=dict(mandatory=True, + usedefault=True, + ), + volume1=dict(mandatory=True, + ), + volume2=dict(mandatory=True, + ), + weighting=dict(usedefault=True, + ), + ) + inputs = Overlap.input_spec() + + for key, metadata in list(input_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(inputs.traits()[key], metakey), value + + +def test_Overlap_outputs(): + output_map = dict(dice=dict(), + diff_file=dict(), + jaccard=dict(), + labels=dict(), + roi_di=dict(), + roi_ji=dict(), + roi_voldiff=dict(), + volume_difference=dict(), + ) + outputs = Overlap.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/algorithms/tests/test_auto_PickAtlas.py b/nipype/algorithms/tests/test_auto_PickAtlas.py index 4c4cb7042f..c4db574d2a 100644 --- a/nipype/algorithms/tests/test_auto_PickAtlas.py +++ b/nipype/algorithms/tests/test_auto_PickAtlas.py @@ -15,9 +15,7 @@ def test_PickAtlas_inputs(): ), labels=dict(mandatory=True, ), - mask_file=dict(keep_extension=True, - name_source='atlas', - name_template='%s_mask', + mask_file=dict(ns='atlas', ), output_file=dict(deprecated=True, new_name='mask_file', diff --git a/nipype/algorithms/tests/test_auto_SimpleThreshold.py b/nipype/algorithms/tests/test_auto_SimpleThreshold.py index 6214f10bb9..f2ab4fa0c6 100644 --- a/nipype/algorithms/tests/test_auto_SimpleThreshold.py +++ b/nipype/algorithms/tests/test_auto_SimpleThreshold.py @@ -9,10 +9,7 @@ def test_SimpleThreshold_inputs(): ), threshold=dict(mandatory=True, ), - thresholded_volumes=dict(keep_extension=True, - name_source='volumes', - name_template='%s_thresholded', - ), + thresholded_volumes=dict(), volumes=dict(mandatory=True, ), ) diff --git a/nipype/algorithms/tests/test_auto_StimulusCorrelation.py b/nipype/algorithms/tests/test_auto_StimulusCorrelation.py index ad079c6a61..e806c3ee88 100644 --- a/nipype/algorithms/tests/test_auto_StimulusCorrelation.py +++ b/nipype/algorithms/tests/test_auto_StimulusCorrelation.py @@ -15,10 +15,7 @@ def test_StimulusCorrelation_inputs(): ), spm_mat_file=dict(mandatory=True, ), - stimcorr_files=dict(keep_extension=False, - name_source='realignment_parameters', - name_template='qa.%s_stimcorr.txt', - ), + stimcorr_files=dict(), ) inputs = StimulusCorrelation.input_spec() diff --git a/nipype/algorithms/tests/test_auto_TSNR.py b/nipype/algorithms/tests/test_auto_TSNR.py index bfad5902ba..9cec72a0ca 100644 --- a/nipype/algorithms/tests/test_auto_TSNR.py +++ b/nipype/algorithms/tests/test_auto_TSNR.py @@ -5,9 +5,7 @@ def test_TSNR_inputs(): input_map = dict(detrended_file=dict(hash_files=False, - keep_extension=True, - name_source='in_file', - name_template='%s_detrend', + ns='in_file', ), ignore_exception=dict(nohash=True, usedefault=True, @@ -15,20 +13,14 @@ def test_TSNR_inputs(): in_file=dict(mandatory=True, ), mean_file=dict(hash_files=False, - keep_extension=True, - name_source='in_file', - name_template='%s_mean', + ns='in_file', ), regress_poly=dict(), stddev_file=dict(hash_files=False, - keep_extension=True, - name_source='in_file', - name_template='%s_stdev', + ns='in_file', ), tsnr_file=dict(hash_files=False, - keep_extension=True, - name_source='in_file', - name_template='%s_tsnr', + ns='in_file', ), ) inputs = TSNR.input_spec() diff --git a/nipype/algorithms/tests/test_auto_WarpPoints.py b/nipype/algorithms/tests/test_auto_WarpPoints.py index 70648877f3..554bc8cdfb 100644 --- a/nipype/algorithms/tests/test_auto_WarpPoints.py +++ b/nipype/algorithms/tests/test_auto_WarpPoints.py @@ -10,10 +10,7 @@ def test_WarpPoints_inputs(): interp=dict(mandatory=True, usedefault=True, ), - out_points=dict(keep_extension=True, - name_source='points', - name_template='%s_warped', - ), + out_points=dict(), points=dict(mandatory=True, ), warp=dict(mandatory=True, diff --git a/nipype/interfaces/afni/base.py b/nipype/interfaces/afni/base.py index 8c0ad4c2f6..ec0c764059 100644 --- a/nipype/interfaces/afni/base.py +++ b/nipype/interfaces/afni/base.py @@ -7,9 +7,7 @@ from ... import logging from ...utils.filemanip import split_filename -from ..traits_extension import traits, File -from ..specs import CommandLineInputSpec, TraitedSpec -from ..base import CommandLine +from ..base import traits, File, CommandLine, CommandLineInputSpec, TraitedSpec # Use nipype's logging system IFLOGGER = logging.getLogger('interface') diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index 8c6616b51a..dfa678642c 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -14,11 +14,10 @@ import re import numpy as np +from ..base import (Directory, traits, isdefined,File, Undefined, + CommandLineInputSpec, TraitedSpec, InputMultiPath) from .base import (AFNICommandBase, AFNICommand, AFNICommandInputSpec, AFNICommandOutputSpec, Info, no_afni) -from ..specs import CommandLineInputSpec, TraitedSpec, InputMultiPath -from ..traits_extension import (Directory, traits, isdefined, - File, Undefined) from ...external.six import string_types from ...utils.filemanip import (load_json, save_json, split_filename) diff --git a/nipype/interfaces/afni/svm.py b/nipype/interfaces/afni/svm.py index a49a37bbeb..a7ef1b5b44 100644 --- a/nipype/interfaces/afni/svm.py +++ b/nipype/interfaces/afni/svm.py @@ -9,9 +9,7 @@ >>> os.chdir(datadir) """ - -from ..traits_extension import traits, File -from ..specs import TraitedSpec +from ..base import traits, File, TraitedSpec from .base import AFNICommand, AFNICommandInputSpec, AFNICommandOutputSpec from ... import logging diff --git a/nipype/interfaces/fsl/tests/test_auto_BET.py b/nipype/interfaces/fsl/tests/test_auto_BET.py index 427e3e09e2..04e4db99c5 100644 --- a/nipype/interfaces/fsl/tests/test_auto_BET.py +++ b/nipype/interfaces/fsl/tests/test_auto_BET.py @@ -24,22 +24,33 @@ def test_BET_inputs(): mandatory=True, position=0, ), + inskull_mask_file=dict(), + inskull_mesh_file=dict(), mask=dict(argstr='-m', + usedefault=True, ), + mask_file=dict(), mesh=dict(argstr='-e', + usedefault=True, ), + meshfile=dict(), no_output=dict(argstr='-n', + usedefault=True, ), out_file=dict(argstr='%s', hash_files=False, - name_source=['in_file'], - name_template='%s_brain', position=1, ), outline=dict(argstr='-o', + usedefault=True, ), + outline_file=dict(), output_type=dict(usedefault=True, ), + outskin_mask_file=dict(), + outskin_mesh_file=dict(), + outskull_mask_file=dict(), + outskull_mesh_file=dict(), padding=dict(argstr='-Z', xor=('functional', 'reduce_bias', 'robust', 'padding', 'remove_eyes', 'surfaces', 't2_guided'), ), @@ -53,10 +64,13 @@ def test_BET_inputs(): xor=('functional', 'reduce_bias', 'robust', 'padding', 'remove_eyes', 'surfaces', 't2_guided'), ), robust=dict(argstr='-R', + usedefault=True, xor=('functional', 'reduce_bias', 'robust', 'padding', 'remove_eyes', 'surfaces', 't2_guided'), ), skull=dict(argstr='-s', + usedefault=True, ), + skull_mask_file=dict(), surfaces=dict(argstr='-A', xor=('functional', 'reduce_bias', 'robust', 'padding', 'remove_eyes', 'surfaces', 't2_guided'), ), @@ -66,6 +80,7 @@ def test_BET_inputs(): terminal_output=dict(nohash=True, ), threshold=dict(argstr='-t', + usedefault=True, ), vertical_gradient=dict(argstr='-g %.2f', ), @@ -78,38 +93,16 @@ def test_BET_inputs(): def test_BET_outputs(): - output_map = dict(inskull_mask_file=dict(name_source='in_file', - name_template='%s_inskull_mask', - ), - inskull_mesh_file=dict(keep_extension=False, - name_source='in_file', - name_template='%s_inskull_mesh.vtk', - ), - mask_file=dict(name_source='in_file', - name_template='%s_mask', - ), - meshfile=dict(keep_extension=False, - name_source='in_file', - name_template='%s_mesh.vtk', - ), + output_map = dict(inskull_mask_file=dict(), + inskull_mesh_file=dict(), + mask_file=dict(), + meshfile=dict(), out_file=dict(), - outline_file=dict(name_source='in_file', - name_template='%s_overlay', - ), - outskin_mask_file=dict(name_source='in_file', - name_template='%s_outskin_mask', - ), - outskin_mesh_file=dict(keep_extension=False, - name_source='in_file', - name_template='%s_outskin_mesh.vtk', - ), - outskull_mask_file=dict(name_source='in_file', - name_template='%s_outskull_mask', - ), - outskull_mesh_file=dict(keep_extension=False, - name_source='in_file', - name_template='%s_outskull_mesh.vtk', - ), + outline_file=dict(), + outskin_mask_file=dict(), + outskin_mesh_file=dict(), + outskull_mask_file=dict(), + outskull_mesh_file=dict(), skull_mask_file=dict(), ) outputs = BET.output_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_FAST.py b/nipype/interfaces/fsl/tests/test_auto_FAST.py index 4f88c5724b..0249ee415c 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FAST.py +++ b/nipype/interfaces/fsl/tests/test_auto_FAST.py @@ -6,6 +6,7 @@ def test_FAST_inputs(): input_map = dict(args=dict(argstr='%s', ), + bias_field=dict(), bias_iters=dict(argstr='-I %d', ), bias_lowpass=dict(argstr='-l %d', @@ -36,11 +37,13 @@ def test_FAST_inputs(): ), mixel_smooth=dict(argstr='-R %.2f', ), + mixeltype=dict(), no_bias=dict(argstr='-N', ), no_pve=dict(argstr='--nopve', ), number_classes=dict(argstr='-n %d', + usedefault=True, ), other_priors=dict(argstr='-A %s', ), @@ -52,14 +55,21 @@ def test_FAST_inputs(): ), output_type=dict(usedefault=True, ), + partial_volume_files=dict(), + partial_volume_map=dict(), probability_maps=dict(argstr='-p', ), + probability_maps_files=dict(output_name='probability_maps', + ), + restored_image=dict(), segment_iters=dict(argstr='-W %d', ), segments=dict(argstr='-g', ), terminal_output=dict(nohash=True, ), + tissue_class_files=dict(), + tissue_class_map=dict(), use_priors=dict(argstr='-P', ), verbose=dict(argstr='-v', diff --git a/nipype/interfaces/io.py b/nipype/interfaces/io.py index a6135edf95..7747580fc4 100644 --- a/nipype/interfaces/io.py +++ b/nipype/interfaces/io.py @@ -34,11 +34,9 @@ from warnings import warn import sqlite3 - -from .traits_extension import (traits, Undefined, File, Directory, isdefined, InputMultiPath, - OutputMultiPath) -from .base import BaseInterface -from .specs import (TraitedSpec, DynamicTraitedSpec, BaseInterfaceInputSpec) +from .base import (traits, Undefined, File, Directory, isdefined, InputMultiPath, + OutputMultiPath, TraitedSpec, DynamicTraitedSpec, + BaseInterfaceInputSpec, BaseInterface) from .. import config from ..external.six import string_types from ..utils.filemanip import (copyfile, list_to_filename, diff --git a/nipype/interfaces/utility.py b/nipype/interfaces/utility.py index 35e89a63a5..5cd117fccf 100644 --- a/nipype/interfaces/utility.py +++ b/nipype/interfaces/utility.py @@ -21,11 +21,9 @@ import numpy as np import nibabel as nb -from .traits_extension import (traits, Undefined, File, isdefined, InputMultiPath, - OutputMultiPath) -from .base import BaseInterface -from .specs import (TraitedSpec, DynamicTraitedSpec, - BaseInterfaceInputSpec) +from .base import (traits, Undefined, File, isdefined, InputMultiPath, + OutputMultiPath, TraitedSpec, DynamicTraitedSpec, + BaseInterfaceInputSpec, BaseInterface) from .io import IOBase, add_traits from ..external.six import string_types from ..testing import assert_equal From 507af7c4a2d273229640470704dfdf8de60f02a8 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Thu, 18 Feb 2016 14:38:11 -0800 Subject: [PATCH 48/73] minor fixes afni --- nipype/interfaces/afni/base.py | 1 - nipype/interfaces/afni/preprocess.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/nipype/interfaces/afni/base.py b/nipype/interfaces/afni/base.py index ec0c764059..e1e23768ab 100644 --- a/nipype/interfaces/afni/base.py +++ b/nipype/interfaces/afni/base.py @@ -6,7 +6,6 @@ from builtins import object from ... import logging -from ...utils.filemanip import split_filename from ..base import traits, File, CommandLine, CommandLineInputSpec, TraitedSpec # Use nipype's logging system diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index dfa678642c..7c4fa8bdb9 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -14,7 +14,7 @@ import re import numpy as np -from ..base import (Directory, traits, isdefined,File, Undefined, +from ..base import (Directory, traits, isdefined, File, GenFile, Undefined, CommandLineInputSpec, TraitedSpec, InputMultiPath) from .base import (AFNICommandBase, AFNICommand, AFNICommandInputSpec, AFNICommandOutputSpec, Info, no_afni) From a5859a3436e06d2ccfd3c43fc621d711506e610c Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Thu, 18 Feb 2016 14:42:34 -0800 Subject: [PATCH 49/73] fix test that generated files in-place --- nipype/algorithms/tests/test_errormap.py | 1 + 1 file changed, 1 insertion(+) diff --git a/nipype/algorithms/tests/test_errormap.py b/nipype/algorithms/tests/test_errormap.py index 361646add0..7c58fac2e0 100644 --- a/nipype/algorithms/tests/test_errormap.py +++ b/nipype/algorithms/tests/test_errormap.py @@ -12,6 +12,7 @@ def test_errormap(): tempdir = mkdtemp() + os.chdir(tempdir) # Single-Spectual # Make two fake 2*2*2 voxel volumes volume1 = np.array([[[2.0, 8.0], [1.0, 2.0]], [[1.0, 9.0], [0.0, 3.0]]]) # John von Neumann's birthday From 88d4bec0cdb32293cfd8201ba02dd88ac56e44eb Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Thu, 18 Feb 2016 18:51:02 -0800 Subject: [PATCH 50/73] fixed afni (except for one test of copy3d) --- nipype/algorithms/tests/test_auto_ErrorMap.py | 35 ---- nipype/algorithms/tests/test_auto_Overlap.py | 47 ----- nipype/interfaces/afni/base.py | 33 +--- nipype/interfaces/afni/preprocess.py | 182 +++++++++--------- .../afni/tests/test_auto_AFNICommand.py | 6 +- .../afni/tests/test_auto_AFNItoNIFTI.py | 3 +- .../afni/tests/test_auto_Allineate.py | 3 +- .../afni/tests/test_auto_AutoTcorrelate.py | 6 +- .../afni/tests/test_auto_Autobox.py | 3 +- .../afni/tests/test_auto_Automask.py | 9 +- .../afni/tests/test_auto_Bandpass.py | 3 +- .../afni/tests/test_auto_BlurInMask.py | 10 +- .../afni/tests/test_auto_BrickStat.py | 6 +- .../interfaces/afni/tests/test_auto_Calc.py | 3 +- .../interfaces/afni/tests/test_auto_Copy.py | 6 +- .../afni/tests/test_auto_Despike.py | 8 +- .../afni/tests/test_auto_Detrend.py | 8 +- .../interfaces/afni/tests/test_auto_Eval.py | 3 +- .../interfaces/afni/tests/test_auto_FWHMx.py | 6 - nipype/interfaces/afni/tests/test_auto_Fim.py | 3 +- .../afni/tests/test_auto_Fourier.py | 3 +- .../interfaces/afni/tests/test_auto_Hist.py | 12 +- .../afni/tests/test_auto_Maskave.py | 6 +- .../interfaces/afni/tests/test_auto_Means.py | 3 +- .../interfaces/afni/tests/test_auto_Merge.py | 5 +- .../interfaces/afni/tests/test_auto_Refit.py | 8 +- .../afni/tests/test_auto_Resample.py | 8 +- .../afni/tests/test_auto_Retroicor.py | 3 +- .../afni/tests/test_auto_SVMTest.py | 3 +- .../afni/tests/test_auto_SVMTrain.py | 3 +- .../afni/tests/test_auto_SkullStrip.py | 3 +- .../interfaces/afni/tests/test_auto_TCat.py | 3 +- .../afni/tests/test_auto_TCorr1D.py | 15 +- .../afni/tests/test_auto_TCorrMap.py | 6 +- .../afni/tests/test_auto_TCorrelate.py | 3 +- .../interfaces/afni/tests/test_auto_TShift.py | 8 +- .../interfaces/afni/tests/test_auto_TStat.py | 8 +- .../interfaces/afni/tests/test_auto_To3D.py | 9 +- .../interfaces/afni/tests/test_auto_Volreg.py | 14 +- .../interfaces/afni/tests/test_auto_Warp.py | 8 +- .../interfaces/afni/tests/test_auto_ZCutUp.py | 3 +- 41 files changed, 187 insertions(+), 330 deletions(-) delete mode 100644 nipype/algorithms/tests/test_auto_ErrorMap.py delete mode 100644 nipype/algorithms/tests/test_auto_Overlap.py diff --git a/nipype/algorithms/tests/test_auto_ErrorMap.py b/nipype/algorithms/tests/test_auto_ErrorMap.py deleted file mode 100644 index 69484529dd..0000000000 --- a/nipype/algorithms/tests/test_auto_ErrorMap.py +++ /dev/null @@ -1,35 +0,0 @@ -# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT -from ...testing import assert_equal -from ..metrics import ErrorMap - - -def test_ErrorMap_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - in_ref=dict(mandatory=True, - ), - in_tst=dict(mandatory=True, - ), - mask=dict(), - metric=dict(mandatory=True, - usedefault=True, - ), - out_map=dict(), - ) - inputs = ErrorMap.input_spec() - - for key, metadata in list(input_map.items()): - for metakey, value in list(metadata.items()): - yield assert_equal, getattr(inputs.traits()[key], metakey), value - - -def test_ErrorMap_outputs(): - output_map = dict(distance=dict(), - out_map=dict(), - ) - outputs = ErrorMap.output_spec() - - for key, metadata in list(output_map.items()): - for metakey, value in list(metadata.items()): - yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/algorithms/tests/test_auto_Overlap.py b/nipype/algorithms/tests/test_auto_Overlap.py deleted file mode 100644 index a5a3874bd1..0000000000 --- a/nipype/algorithms/tests/test_auto_Overlap.py +++ /dev/null @@ -1,47 +0,0 @@ -# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT -from ...testing import assert_equal -from ..misc import Overlap - - -def test_Overlap_inputs(): - input_map = dict(bg_overlap=dict(mandatory=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), - mask_volume=dict(), - out_file=dict(usedefault=True, - ), - vol_units=dict(mandatory=True, - usedefault=True, - ), - volume1=dict(mandatory=True, - ), - volume2=dict(mandatory=True, - ), - weighting=dict(usedefault=True, - ), - ) - inputs = Overlap.input_spec() - - for key, metadata in list(input_map.items()): - for metakey, value in list(metadata.items()): - yield assert_equal, getattr(inputs.traits()[key], metakey), value - - -def test_Overlap_outputs(): - output_map = dict(dice=dict(), - diff_file=dict(), - jaccard=dict(), - labels=dict(), - roi_di=dict(), - roi_ji=dict(), - roi_voldiff=dict(), - volume_difference=dict(), - ) - outputs = Overlap.output_spec() - - for key, metadata in list(output_map.items()): - for metakey, value in list(metadata.items()): - yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/afni/base.py b/nipype/interfaces/afni/base.py index e1e23768ab..489f99fb82 100644 --- a/nipype/interfaces/afni/base.py +++ b/nipype/interfaces/afni/base.py @@ -6,7 +6,7 @@ from builtins import object from ... import logging -from ..base import traits, File, CommandLine, CommandLineInputSpec, TraitedSpec +from ..base import traits, File, GenFile, CommandLine, CommandLineInputSpec, TraitedSpec # Use nipype's logging system IFLOGGER = logging.getLogger('interface') @@ -58,23 +58,6 @@ def version(): return currv return tuple(version) - @classmethod - def outputtype_to_ext(cls, outputtype): - """Get the file extension for the given output type. - - Parameters - ---------- - outputtype : {'NIFTI', 'NIFTI_GZ', 'AFNI'} - String specifying the output type. - - Returns - ------- - extension : str - The file extension for the output type. - """ - return AFNI_FTYPES.get(outputtype, 'AFNI') - - @staticmethod def standard_image(img_name): """Grab an image from the standard location. @@ -101,19 +84,11 @@ def _run_interface(self, runtime): class AFNICommandInputSpec(CommandLineInputSpec): - outputtype = traits.Enum(tuple(AFNI_FTYPES.keys()), desc='AFNI output filetype') - out_file = File(name_template="%s_afni", desc='output image file name', keep_extension=False, - name_source=["in_file"], argstr='-prefix %s') - - def _overload_extension(self, value, name=None, ext=None): - # Do not overload certain extensions - if value.endswith('+orig.BRIK') or value.endswith('.1D'): - return value - return value + AFNI_FTYPES.get(self.outputtype, '') - + outputtype = traits.Trait('AFNI', AFNI_FTYPES, usedefault=True, + desc='AFNI output filetype') class AFNICommandOutputSpec(TraitedSpec): - out_file = File(desc='output file', exists=True) + out_file = File(exists=True, desc='output file') class AFNICommand(AFNICommandBase): diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index 7c4fa8bdb9..051a38c150 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -23,8 +23,10 @@ class To3DInputSpec(AFNICommandInputSpec): - out_file = File(name_template="%s", desc='output image file name', - argstr='-prefix %s', name_source=["in_folder"]) + prefix = traits.Str('afni_to3d', usedefault='true', argstr='-prefix %s', + desc='output files prefix') + out_file = GenFile(template='{prefix}{outputtype_}', keep_extension=False, + desc='output image file name') in_folder = Directory(desc='folder with DICOM images to convert', argstr='%s/*.dcm', position=-1, @@ -68,7 +70,7 @@ class To3D(AFNICommand): >>> To3D.inputs.out_file = 'dicomdir.nii' >>> To3D.inputs.filetype = "anat" >>> To3D.cmdline #doctest: +ELLIPSIS - 'to3d -datum float -anat -prefix dicomdir.nii ./*.dcm' + 'to3d -datum float -anat -prefix afni_to3d ./*.dcm' >>> res = To3D.run() #doctest: +SKIP """ @@ -81,8 +83,9 @@ class To3D(AFNICommand): class TShiftInputSpec(AFNICommandInputSpec): in_file = File(desc='input file to 3dTShift', argstr='%s', position=-1, mandatory=True, exists=True, copyfile=False) - out_file = File(name_template="%s_tshift", desc='output image file name', - argstr='-prefix %s', name_source="in_file") + prefix = GenFile(template='{in_file}_tshift', keep_extension=False, argstr='-prefix %s', + desc='output files prefix') + out_file = GenFile(template='{prefix}{outputtype_}', desc='output image file name') tr = traits.Str(argstr='-TR %s', desc='manually set the TR You can attach suffix "s" for ' 'seconds or "ms" for milliseconds.') tzero = traits.Float(argstr='-tzero %s', xor=['tslice'], @@ -127,9 +130,10 @@ class TShift(AFNICommand): output_spec = AFNICommandOutputSpec -class RefitInputSpec(CommandLineInputSpec): +class RefitInputSpec(AFNICommandInputSpec): in_file = File(argstr='%s', position=-1, mandatory=True, exists=True, copyfile=True, desc='input file to 3drefit') + out_file = GenFile(template='{in_file}{outputtype_}', desc='output file') deoblique = traits.Bool( False, usedefault=True, argstr='-deoblique', desc='replace current transformation matrix with cardinal matrix') @@ -144,8 +148,7 @@ class RefitInputSpec(CommandLineInputSpec): desc='Associates the dataset with a specific template type, e.g. TLRC, MNI, ORIG') class RefitOutputSpec(TraitedSpec): - out_file = File(name_source='in_file', name_template='%s', keep_extension=False, - desc='output file') + out_file = File(exists=True, desc='output file') class Refit(AFNICommandBase): @@ -175,8 +178,9 @@ class Refit(AFNICommandBase): class WarpInputSpec(AFNICommandInputSpec): in_file = File(argstr='%s', position=-1, mandatory=True, exists=True, copyfile=False, desc='input file to 3dWarp') - out_file = File(name_template="%s_warp", argstr='-prefix %s', name_source="in_file", - desc='output image file name') + prefix = GenFile(template='{in_file}_warp', keep_extension=False, argstr='-prefix %s', + desc='output files prefix') + out_file = GenFile(template="{prefix}{outputtype_}", desc='output image file name') tta2mni = traits.Bool(desc='transform dataset from Talairach to MNI152', argstr='-tta2mni') mni2tta = traits.Bool(desc='transform dataset from MNI152 to Talaraich', @@ -207,16 +211,14 @@ class Warp(AFNICommand): >>> warp = afni.Warp() >>> warp.inputs.in_file = 'structural.nii' >>> warp.inputs.deoblique = True - >>> warp.inputs.out_file = "trans.nii.gz" >>> warp.cmdline - '3dWarp -deoblique -prefix trans.nii.gz structural.nii' + '3dWarp -deoblique -prefix structural_warp structural.nii' >>> warp_2 = afni.Warp() >>> warp_2.inputs.in_file = 'structural.nii' >>> warp_2.inputs.newgrid = 1.0 - >>> warp_2.inputs.out_file = "trans.nii.gz" >>> warp_2.cmdline - '3dWarp -newgrid 1.000000 -prefix trans.nii.gz structural.nii' + '3dWarp -newgrid 1.000000 -prefix structural_warp structural.nii' """ @@ -228,8 +230,10 @@ class Warp(AFNICommand): class ResampleInputSpec(AFNICommandInputSpec): in_file = File(argstr='-inset %s', position=-1, mandatory=True, exists=True, copyfile=False, desc='input file to 3dresample') - out_file = File(name_template="%s_resample", argstr='-prefix %s', name_source="in_file", - desc='output image file name') + prefix = GenFile(template='{in_file}_resample', keep_extension=False, argstr='-prefix %s', + desc='output files prefix') + out_file = GenFile(template="{prefix}{outputtype_}", keep_extension=False, + desc='output image file name') orientation = traits.Str(desc='new orientation code', argstr='-orient %s') resample_mode = traits.Enum( 'NN', 'Li', 'Cu', 'Bk', argstr='-rmode %s', @@ -257,7 +261,7 @@ class Resample(AFNICommand): >>> resample.inputs.orientation= 'RPI' >>> resample.inputs.outputtype = "NIFTI" >>> resample.cmdline - '3dresample -orient RPI -prefix functional_resample.nii -inset functional.nii' + '3dresample -orient RPI -prefix functional_resample -inset functional.nii' >>> res = resample.run() # doctest: +SKIP """ @@ -279,15 +283,8 @@ class AutoTcorrelateInputSpec(AFNICommandInputSpec): desc="use mask only on targets voxels") mask_source = File(exists=True, argstr="-mask_source %s", xor=['mask_only_targets'], desc="mask for source voxels") - out_file = File(name_template="%s_similarity_matrix.1D", desc='output image file name', - argstr='-prefix %s', name_source="in_file", keep_extension=False) - - def _overload_extension(self, value, name=None, ext=None): - _, _, ext = split_filename(value) - - if ext.lower() not in [".1d", ".nii.gz", ".nii"]: - return value + ".1D" - return value + out_file = GenFile(template="{in_file}_similarity_matrix.1D", argstr='-prefix %s', + keep_extension=False, desc='output image file name') class AutoTcorrelate(AFNICommand): @@ -318,8 +315,10 @@ class AutoTcorrelate(AFNICommand): class TStatInputSpec(AFNICommandInputSpec): in_file = File(argstr='%s', position=-1, mandatory=True, exists=True, copyfile=False, desc='input file to 3dTstat') - out_file = File(name_template="%s_tstat", desc='output image file name', - argstr='-prefix %s', name_source="in_file") + prefix = GenFile(template='{in_file}_tstat', keep_extension=False, argstr='-prefix %s', + desc='output files prefix') + out_file = GenFile(template="{in_file}{outputtype_}", keep_extension=False, + desc='output image file name') mask = File(desc='mask file', argstr='-mask %s', exists=True) options = traits.Str(desc='selected statistical output', argstr='%s') @@ -340,7 +339,7 @@ class TStat(AFNICommand): >>> tstat.inputs.args= '-mean' >>> tstat.inputs.out_file = "stats" >>> tstat.cmdline - '3dTstat -mean -prefix stats functional.nii' + '3dTstat -mean -prefix functional_tstat functional.nii' >>> res = tstat.run() # doctest: +SKIP """ @@ -353,8 +352,10 @@ class TStat(AFNICommand): class DetrendInputSpec(AFNICommandInputSpec): in_file = File(argstr='%s', position=-1, mandatory=True, exists=True, copyfile=False, desc='input file to 3dDetrend') - out_file = File(name_template="%s_detrend", desc='output image file name', - argstr='-prefix %s', name_source="in_file") + prefix = GenFile(template='{in_file}_detrend', keep_extension=False, argstr='-prefix %s', + desc='output files prefix') + out_file = GenFile(template="{prefix}{outputtype_}", keep_extension=False, + desc='output image file name') class Detrend(AFNICommand): @@ -387,8 +388,10 @@ class Detrend(AFNICommand): class DespikeInputSpec(AFNICommandInputSpec): in_file = File(argstr='%s', position=-1, mandatory=True, exists=True, copyfile=False, desc='input file to 3dDespike') - out_file = File(name_template="%s_despike", desc='output image file name', - argstr='-prefix %s', name_source="in_file") + prefix = GenFile(template='{in_file}_despike', keep_extension=False, argstr='-prefix %s', + desc='output files prefix') + out_file = GenFile(template="{prefix}{outputtype_}", keep_extension=False, + desc='output image file name') class Despike(AFNICommand): @@ -418,25 +421,19 @@ class Despike(AFNICommand): class AutomaskInputSpec(AFNICommandInputSpec): in_file = File(argstr='%s', position=-1, mandatory=True, exists=True, copyfile=False, desc='input file to 3dAutomask',) - out_file = File(name_template="%s_mask", desc='output image file name', - argstr='-prefix %s', name_source="in_file") - brain_file = File(name_template="%s_masked", - desc="output file from 3dAutomask", - argstr='-apply_prefix %s', - name_source="in_file") - clfrac = traits.Float(desc='sets the clip level fraction' + - ' (must be 0.1-0.9). ' + - 'A small value will tend to make the mask larger [default = 0.5].', - argstr="-clfrac %s") - dilate = traits.Int(desc='dilate the mask outwards', - argstr="-dilate %s") - erode = traits.Int(desc='erode the mask inwards', - argstr="-erode %s") + out_file = GenFile(template="{in_file}_mask", argstr='-prefix %s', + desc='output image file name') + brain_file = GenFile(template="{in_file}_masked", argstr='-apply_prefix %s', + desc="output file from 3dAutomask") + clfrac = traits.Range(low=0.1, high=0.9, argstr='-clfrac %.2f', + desc='sets the clip level fraction. A small value will tend ' + 'to make the mask larger [default = 0.5].') + dilate = traits.Int(argstr="-dilate %s", desc='dilate the mask outwards') + erode = traits.Int(argstr="-erode %s", desc='erode the mask inwards') class AutomaskOutputSpec(TraitedSpec): - out_file = File(desc='mask file', - exists=True) + out_file = File(exists=True, desc='mask file') brain_file = File(desc='brain file (skull stripped)', exists=True) @@ -469,32 +466,24 @@ class Automask(AFNICommand): class VolregInputSpec(AFNICommandInputSpec): in_file = File(argstr='%s', position=-1, mandatory=True, exists=True, copyfile=False, desc='input file to 3dvolreg') - out_file = File(name_template="%s_volreg", desc='output image file name', - argstr='-prefix %s', name_source="in_file") + out_file = GenFile(template="{in_file}_volreg", argstr='-prefix %s', + desc='output image file name') basefile = File(argstr='-base %s', position=-6, exists=True, desc='base file for registration') - zpad = traits.Int(desc='Zeropad around the edges' + - ' by \'n\' voxels during rotations', - argstr='-zpad %d', - position=-5) - md1d_file = File(name_template='%s_md.1D', desc='max displacement output file', - argstr='-maxdisp1D %s', name_source="in_file", - keep_extension=False, position=-4) - oned_file = File(name_template='%s.1D', desc='1D movement parameters output file', - argstr='-1Dfile %s', - name_source="in_file", - keep_extension=False) + zpad = traits.Int(argstr='-zpad %d', position=-5, + desc='Zeropad around the edges by \'n\' voxels during rotations') + md1d_file = GenFile(template='{in_file}_md.1D', argstr='-maxdisp1D %s', keep_extension=False, + position=-4, desc='max displacement output file') + oned_file = GenFile(template='{in_file}.1D', argstr='-1Dfile %s', keep_extension=False, + desc='1D movement parameters output file') verbose = traits.Bool(desc='more detailed description of the process', argstr='-verbose') timeshift = traits.Bool(desc='time shift to mean slice time offset', argstr='-tshift 0') copyorigin = traits.Bool(desc='copy base file origin coords to output', argstr='-twodup') - oned_matrix_save = File(name_template='%s.aff12.1D', - desc='Save the matrix transformation', - argstr='-1Dmatrix_save %s', - keep_extension=False, - name_source="in_file") + oned_matrix_save = GenFile(template='{in_file}.aff12.1D', argstr='-1Dmatrix_save %s', + keep_extension=False, desc='Save the matrix transformation') class VolregOutputSpec(TraitedSpec): @@ -539,8 +528,8 @@ class MergeInputSpec(AFNICommandInputSpec): position=-1, mandatory=True, copyfile=False) - out_file = File(name_template="%s_merge", desc='output image file name', - argstr='-prefix %s', name_source="in_file") + out_file = GenFile(template="{in_file}_merge", argstr='-prefix %s', + desc='output image file name') doall = traits.Bool(desc='apply options to all sub-bricks in dataset', argstr='-doall') blurfwhm = traits.Int(desc='FWHM blur value (mm)', @@ -576,9 +565,9 @@ class Merge(AFNICommand): class CopyInputSpec(AFNICommandInputSpec): in_file = File(desc='input file to 3dcopy', argstr='%s', position=-2, mandatory=True, exists=True, copyfile=False) - out_file = File( - name_template="%s_copy", desc='output image file name', argstr='%s', - position=-1, name_source="in_file", keep_extension=False) + out_file = GenFile( + template='{in_file}_copy{outputtype_}', position=-1, + argstr='%s', desc='output image file name') class Copy(AFNICommand): @@ -1048,9 +1037,9 @@ class Allineate(AFNICommand): class MaskaveInputSpec(AFNICommandInputSpec): in_file = File(argstr='%s', position=-2, mandatory=True, exists=True, copyfile=False, desc='input file to 3dmaskave') - out_file = File(name_template="%s_maskave.1D", desc='output image file name', - keep_extension=False, argstr="> %s", name_source="in_file", - position=-1) + out_file = GenFile( + template="{in_file}_maskave.1D", keep_extension=False, argstr="> %s", position=-1, + desc='output image file name',) mask = File(desc='matrix to align input file', argstr='-mask %s', position=1, @@ -1255,7 +1244,6 @@ class TCorrelate(AFNICommand): >>> tcorrelate = afni.TCorrelate() >>> tcorrelate.inputs.xset= 'u_rc1s1_Template.nii' >>> tcorrelate.inputs.yset = 'u_rc1s2_Template.nii' - >>> tcorrelate.inputs.out_file = 'functional_tcorrelate.nii.gz' >>> tcorrelate.inputs.polort = -1 >>> tcorrelate.inputs.pearson = True >>> res = tcarrelate.run() # doctest: +SKIP @@ -1268,12 +1256,13 @@ class TCorrelate(AFNICommand): class TCorr1DInputSpec(AFNICommandInputSpec): - xset = File(argstr=' %s', position=-2, mandatory=True, exists=True, + xset = File(argstr='%s', position=-2, mandatory=True, exists=True, copyfile=False, desc='3d+time dataset input') - y_1d = File(argstr=' %s', position=-1, mandatory=True, exists=True, + prefix = GenFile(template='{xset}_correlation', keep_extension=False, + argstr='-prefix %s', desc='output files prefix') + y_1d = File(argstr='%s', position=-1, mandatory=True, exists=True, desc='1D time series file input') - out_file = File(name_template='%s_correlation.nii.gz', argstr='-prefix %s', - name_source='xset', keep_extension=False, + out_file = File(name_template='{prefix}{outputtype_}', keep_extension=False, desc='output filename prefix') pearson = traits.Bool(desc='Correlation is the normal' + ' Pearson correlation coefficient', @@ -1314,7 +1303,7 @@ class TCorr1D(AFNICommand): >>> tcorr1D.inputs.xset= 'u_rc1s1_Template.nii' >>> tcorr1D.inputs.y_1d = 'seed.1D' >>> tcorr1D.cmdline - '3dTcorr1D -prefix u_rc1s1_Template_correlation.nii.gz u_rc1s1_Template.nii seed.1D' + '3dTcorr1D -prefix u_rc1s1_Template_correlation u_rc1s1_Template.nii seed.1D' >>> res = tcorr1D.run() # doctest: +SKIP """ @@ -1515,8 +1504,10 @@ class BlurInMaskInputSpec(AFNICommandInputSpec): mandatory=True, exists=True, copyfile=False) - out_file = File(name_template='%s_blur', desc='output to the file', argstr='-prefix %s', - name_source='in_file', position=-1, keep_extension=False) + prefix = GenFile(template='{in_file}_blur', keep_extension=False, argstr='-prefix %s', + desc='output files prefix') + out_file = GenFile(template='{prefix}{outputtype_}', keep_extension=False, + desc='output to the file') mask = File( desc='Mask dataset, if desired. Blurring will occur only within the mask. Voxels NOT in the mask will be set to zero in the output.', argstr='-mask %s') @@ -1823,11 +1814,6 @@ class AFNItoNIFTIInputSpec(AFNICommandInputSpec): argstr='-prefix %s', name_source="in_file", keep_extension=False) hash_files = False - def _overload_extension(self, value, name=None, ext=None): - path, base, ext = split_filename(value) - if ext.lower() not in [".1d", ".nii.gz", ".1D"]: - ext = ext + ".nii" - return os.path.join(path, base + ext) class AFNItoNIFTI(AFNICommand): @@ -1969,9 +1955,12 @@ class HistInputSpec(CommandLineInputSpec): in_file = File( desc='input file to 3dHist', argstr='-input %s', position=1, mandatory=True, exists=True, copyfile=False) - out_file = File( - desc='Write histogram to niml file with this prefix', name_template='%s_hist', - keep_extension=False, argstr='-prefix %s', name_source=['in_file']) + prefix = GenFile( + template='{in_file}_hist', keep_extension=False, argstr='-prefix %s', + desc='Write histogram to niml file with this prefix') + out_file = GenFile( + template='{prefix}.niml.hist', keep_extension=False, + desc='Write histogram to niml file with this prefix') showhist = traits.Bool(False, usedefault=True, desc='write a text visual histogram', argstr='-showhist') out_show = File( @@ -1991,7 +1980,7 @@ def parse_args(self, skip=None): return super(HistInputSpec, self).parse_args(skip=skip) class HistOutputSpec(TraitedSpec): - out_file = File(desc='output file', mandatory=True, suffix='.niml.hist') + out_file = File(desc='output file') out_show = File(desc='output visual histogram') @@ -2036,10 +2025,11 @@ def _post_run(self): class FWHMxInputSpec(CommandLineInputSpec): in_file = File(desc='input dataset', argstr='-input %s', mandatory=True, exists=True) - out_file = File(argstr='> %s', name_source='in_file', name_template='%s_fwhmx.out', - position=-1, keep_extension=False, desc='output file') - out_subbricks = File(argstr='-out %s', name_source='in_file', name_template='%s_subbricks.out', - keep_extension=False, desc='output file listing the subbricks FWHM') + out_file = GenFile(argstr='> %s', template='{in_file}_fwhmx.out', position=-1, + keep_extension=False, desc='output file') + out_subbricks = GenFile( + argstr='-out %s', template='{in_file}_subbricks.out', + keep_extension=False, desc='output file listing the subbricks FWHM') mask = File(desc='use only voxels that are nonzero in mask', argstr='-mask %s', exists=True) automask = traits.Bool(False, usedefault=True, argstr='-automask', desc='compute a mask from THIS dataset, a la 3dAutomask') diff --git a/nipype/interfaces/afni/tests/test_auto_AFNICommand.py b/nipype/interfaces/afni/tests/test_auto_AFNICommand.py index bc1b49380e..cc1d14c481 100644 --- a/nipype/interfaces/afni/tests/test_auto_AFNICommand.py +++ b/nipype/interfaces/afni/tests/test_auto_AFNICommand.py @@ -12,12 +12,8 @@ def test_AFNICommand_inputs(): ignore_exception=dict(nohash=True, usedefault=True, ), - out_file=dict(argstr='-prefix %s', - keep_extension=False, - name_source=['in_file'], - name_template='%s_afni', + outputtype=dict(usedefault=True, ), - outputtype=dict(), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/afni/tests/test_auto_AFNItoNIFTI.py b/nipype/interfaces/afni/tests/test_auto_AFNItoNIFTI.py index f98ba4e67c..945af37be8 100644 --- a/nipype/interfaces/afni/tests/test_auto_AFNItoNIFTI.py +++ b/nipype/interfaces/afni/tests/test_auto_AFNItoNIFTI.py @@ -22,7 +22,8 @@ def test_AFNItoNIFTI_inputs(): name_source='in_file', name_template='%s.nii', ), - outputtype=dict(), + outputtype=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/afni/tests/test_auto_Allineate.py b/nipype/interfaces/afni/tests/test_auto_Allineate.py index 49f00463e1..66d44c24e7 100644 --- a/nipype/interfaces/afni/tests/test_auto_Allineate.py +++ b/nipype/interfaces/afni/tests/test_auto_Allineate.py @@ -74,7 +74,8 @@ def test_Allineate_inputs(): ), out_weight_file=dict(argstr='-wtprefix %s', ), - outputtype=dict(), + outputtype=dict(usedefault=True, + ), reference=dict(argstr='-base %s', ), replacebase=dict(argstr='-replacebase', diff --git a/nipype/interfaces/afni/tests/test_auto_AutoTcorrelate.py b/nipype/interfaces/afni/tests/test_auto_AutoTcorrelate.py index 593d05259f..e1f50719dc 100644 --- a/nipype/interfaces/afni/tests/test_auto_AutoTcorrelate.py +++ b/nipype/interfaces/afni/tests/test_auto_AutoTcorrelate.py @@ -29,11 +29,9 @@ def test_AutoTcorrelate_inputs(): xor=['mask_only_targets'], ), out_file=dict(argstr='-prefix %s', - keep_extension=False, - name_source='in_file', - name_template='%s_similarity_matrix.1D', ), - outputtype=dict(), + outputtype=dict(usedefault=True, + ), polort=dict(argstr='-polort %d', ), terminal_output=dict(nohash=True, diff --git a/nipype/interfaces/afni/tests/test_auto_Autobox.py b/nipype/interfaces/afni/tests/test_auto_Autobox.py index 3a23e751a3..8bb5ccc343 100644 --- a/nipype/interfaces/afni/tests/test_auto_Autobox.py +++ b/nipype/interfaces/afni/tests/test_auto_Autobox.py @@ -21,7 +21,8 @@ def test_Autobox_inputs(): out_file=dict(argstr='-prefix %s', name_source='in_file', ), - outputtype=dict(), + outputtype=dict(usedefault=True, + ), padding=dict(argstr='-npad %d', ), terminal_output=dict(nohash=True, diff --git a/nipype/interfaces/afni/tests/test_auto_Automask.py b/nipype/interfaces/afni/tests/test_auto_Automask.py index 5ee4b08162..06289c30f5 100644 --- a/nipype/interfaces/afni/tests/test_auto_Automask.py +++ b/nipype/interfaces/afni/tests/test_auto_Automask.py @@ -7,10 +7,8 @@ def test_Automask_inputs(): input_map = dict(args=dict(argstr='%s', ), brain_file=dict(argstr='-apply_prefix %s', - name_source='in_file', - name_template='%s_masked', ), - clfrac=dict(argstr='-clfrac %s', + clfrac=dict(argstr='-clfrac %.2f', ), dilate=dict(argstr='-dilate %s', ), @@ -28,10 +26,9 @@ def test_Automask_inputs(): position=-1, ), out_file=dict(argstr='-prefix %s', - name_source='in_file', - name_template='%s_mask', ), - outputtype=dict(), + outputtype=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/afni/tests/test_auto_Bandpass.py b/nipype/interfaces/afni/tests/test_auto_Bandpass.py index 519d8fd501..670f03cfdf 100644 --- a/nipype/interfaces/afni/tests/test_auto_Bandpass.py +++ b/nipype/interfaces/afni/tests/test_auto_Bandpass.py @@ -54,7 +54,8 @@ def test_Bandpass_inputs(): name_template='%s_bp', position=1, ), - outputtype=dict(), + outputtype=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), tr=dict(argstr='-dt %f', diff --git a/nipype/interfaces/afni/tests/test_auto_BlurInMask.py b/nipype/interfaces/afni/tests/test_auto_BlurInMask.py index af2498a4a6..45636f2ea2 100644 --- a/nipype/interfaces/afni/tests/test_auto_BlurInMask.py +++ b/nipype/interfaces/afni/tests/test_auto_BlurInMask.py @@ -31,13 +31,11 @@ def test_BlurInMask_inputs(): options=dict(argstr='%s', position=2, ), - out_file=dict(argstr='-prefix %s', - keep_extension=False, - name_source='in_file', - name_template='%s_blur', - position=-1, + out_file=dict(), + outputtype=dict(usedefault=True, + ), + prefix=dict(argstr='-prefix %s', ), - outputtype=dict(), preserve=dict(argstr='-preserve', ), terminal_output=dict(nohash=True, diff --git a/nipype/interfaces/afni/tests/test_auto_BrickStat.py b/nipype/interfaces/afni/tests/test_auto_BrickStat.py index 3562fdacee..9bc240fe6a 100644 --- a/nipype/interfaces/afni/tests/test_auto_BrickStat.py +++ b/nipype/interfaces/afni/tests/test_auto_BrickStat.py @@ -22,12 +22,8 @@ def test_BrickStat_inputs(): min=dict(argstr='-min', position=1, ), - out_file=dict(argstr='-prefix %s', - keep_extension=False, - name_source=['in_file'], - name_template='%s_afni', + outputtype=dict(usedefault=True, ), - outputtype=dict(), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/afni/tests/test_auto_Calc.py b/nipype/interfaces/afni/tests/test_auto_Calc.py index c15431a5a8..b6d937b41a 100644 --- a/nipype/interfaces/afni/tests/test_auto_Calc.py +++ b/nipype/interfaces/afni/tests/test_auto_Calc.py @@ -32,7 +32,8 @@ def test_Calc_inputs(): name_source='in_file_a', name_template='%s_calc', ), - outputtype=dict(), + outputtype=dict(usedefault=True, + ), single_idx=dict(), start_idx=dict(requires=['stop_idx'], ), diff --git a/nipype/interfaces/afni/tests/test_auto_Copy.py b/nipype/interfaces/afni/tests/test_auto_Copy.py index 6cfcb857ae..10fea3394b 100644 --- a/nipype/interfaces/afni/tests/test_auto_Copy.py +++ b/nipype/interfaces/afni/tests/test_auto_Copy.py @@ -18,12 +18,10 @@ def test_Copy_inputs(): position=-2, ), out_file=dict(argstr='%s', - keep_extension=False, - name_source='in_file', - name_template='%s_copy', position=-1, ), - outputtype=dict(), + outputtype=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/afni/tests/test_auto_Despike.py b/nipype/interfaces/afni/tests/test_auto_Despike.py index 0e8c5876f9..52cb9de3ac 100644 --- a/nipype/interfaces/afni/tests/test_auto_Despike.py +++ b/nipype/interfaces/afni/tests/test_auto_Despike.py @@ -17,11 +17,11 @@ def test_Despike_inputs(): mandatory=True, position=-1, ), - out_file=dict(argstr='-prefix %s', - name_source='in_file', - name_template='%s_despike', + out_file=dict(), + outputtype=dict(usedefault=True, + ), + prefix=dict(argstr='-prefix %s', ), - outputtype=dict(), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/afni/tests/test_auto_Detrend.py b/nipype/interfaces/afni/tests/test_auto_Detrend.py index 2fd8bf3d6f..277392d541 100644 --- a/nipype/interfaces/afni/tests/test_auto_Detrend.py +++ b/nipype/interfaces/afni/tests/test_auto_Detrend.py @@ -17,11 +17,11 @@ def test_Detrend_inputs(): mandatory=True, position=-1, ), - out_file=dict(argstr='-prefix %s', - name_source='in_file', - name_template='%s_detrend', + out_file=dict(), + outputtype=dict(usedefault=True, + ), + prefix=dict(argstr='-prefix %s', ), - outputtype=dict(), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/afni/tests/test_auto_Eval.py b/nipype/interfaces/afni/tests/test_auto_Eval.py index 0ca8e85bc0..50951737be 100644 --- a/nipype/interfaces/afni/tests/test_auto_Eval.py +++ b/nipype/interfaces/afni/tests/test_auto_Eval.py @@ -34,7 +34,8 @@ def test_Eval_inputs(): name_source='in_file_a', name_template='%s_calc', ), - outputtype=dict(), + outputtype=dict(usedefault=True, + ), single_idx=dict(), start_idx=dict(requires=['stop_idx'], ), diff --git a/nipype/interfaces/afni/tests/test_auto_FWHMx.py b/nipype/interfaces/afni/tests/test_auto_FWHMx.py index f35aa66b62..dc2d67879f 100644 --- a/nipype/interfaces/afni/tests/test_auto_FWHMx.py +++ b/nipype/interfaces/afni/tests/test_auto_FWHMx.py @@ -46,15 +46,9 @@ def test_FWHMx_inputs(): name_template='%s_detrend', ), out_file=dict(argstr='> %s', - keep_extension=False, - name_source='in_file', - name_template='%s_fwhmx.out', position=-1, ), out_subbricks=dict(argstr='-out %s', - keep_extension=False, - name_source='in_file', - name_template='%s_subbricks.out', ), terminal_output=dict(nohash=True, ), diff --git a/nipype/interfaces/afni/tests/test_auto_Fim.py b/nipype/interfaces/afni/tests/test_auto_Fim.py index 60aa963b28..9cf495629a 100644 --- a/nipype/interfaces/afni/tests/test_auto_Fim.py +++ b/nipype/interfaces/afni/tests/test_auto_Fim.py @@ -31,7 +31,8 @@ def test_Fim_inputs(): name_source='in_file', name_template='%s_fim', ), - outputtype=dict(), + outputtype=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/afni/tests/test_auto_Fourier.py b/nipype/interfaces/afni/tests/test_auto_Fourier.py index 0bc9e03b6c..0013f320e4 100644 --- a/nipype/interfaces/afni/tests/test_auto_Fourier.py +++ b/nipype/interfaces/afni/tests/test_auto_Fourier.py @@ -29,7 +29,8 @@ def test_Fourier_inputs(): name_source='in_file', name_template='%s_fourier', ), - outputtype=dict(), + outputtype=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/afni/tests/test_auto_Hist.py b/nipype/interfaces/afni/tests/test_auto_Hist.py index 028d7ed938..60b38fdcab 100644 --- a/nipype/interfaces/afni/tests/test_auto_Hist.py +++ b/nipype/interfaces/afni/tests/test_auto_Hist.py @@ -27,17 +27,15 @@ def test_Hist_inputs(): ), nbin=dict(argstr='-nbin %d', ), - out_file=dict(argstr='-prefix %s', - keep_extension=False, - name_source=['in_file'], - name_template='%s_hist', - ), + out_file=dict(), out_show=dict(argstr='> %s', keep_extension=False, name_source='in_file', name_template='%s_hist.out', position=-1, ), + prefix=dict(argstr='-prefix %s', + ), showhist=dict(argstr='-showhist', usedefault=True, ), @@ -52,9 +50,7 @@ def test_Hist_inputs(): def test_Hist_outputs(): - output_map = dict(out_file=dict(mandatory=True, - suffix='.niml.hist', - ), + output_map = dict(out_file=dict(), out_show=dict(), ) outputs = Hist.output_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_Maskave.py b/nipype/interfaces/afni/tests/test_auto_Maskave.py index 9553282304..6dec4e3d4e 100644 --- a/nipype/interfaces/afni/tests/test_auto_Maskave.py +++ b/nipype/interfaces/afni/tests/test_auto_Maskave.py @@ -21,12 +21,10 @@ def test_Maskave_inputs(): position=1, ), out_file=dict(argstr='> %s', - keep_extension=False, - name_source='in_file', - name_template='%s_maskave.1D', position=-1, ), - outputtype=dict(), + outputtype=dict(usedefault=True, + ), quiet=dict(argstr='-quiet', position=2, ), diff --git a/nipype/interfaces/afni/tests/test_auto_Means.py b/nipype/interfaces/afni/tests/test_auto_Means.py index de764464b5..1114573eb1 100644 --- a/nipype/interfaces/afni/tests/test_auto_Means.py +++ b/nipype/interfaces/afni/tests/test_auto_Means.py @@ -31,7 +31,8 @@ def test_Means_inputs(): name_source='in_file_a', name_template='%s_mean', ), - outputtype=dict(), + outputtype=dict(usedefault=True, + ), scale=dict(argstr='-%sscale', ), sqr=dict(argstr='-sqr', diff --git a/nipype/interfaces/afni/tests/test_auto_Merge.py b/nipype/interfaces/afni/tests/test_auto_Merge.py index 9851b90b9c..ec0eaa3b03 100644 --- a/nipype/interfaces/afni/tests/test_auto_Merge.py +++ b/nipype/interfaces/afni/tests/test_auto_Merge.py @@ -23,10 +23,9 @@ def test_Merge_inputs(): position=-1, ), out_file=dict(argstr='-prefix %s', - name_source='in_file', - name_template='%s_merge', ), - outputtype=dict(), + outputtype=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/afni/tests/test_auto_Refit.py b/nipype/interfaces/afni/tests/test_auto_Refit.py index ad53e8b159..ec345d4b58 100644 --- a/nipype/interfaces/afni/tests/test_auto_Refit.py +++ b/nipype/interfaces/afni/tests/test_auto_Refit.py @@ -20,6 +20,9 @@ def test_Refit_inputs(): mandatory=True, position=-1, ), + out_file=dict(), + outputtype=dict(usedefault=True, + ), space=dict(argstr='-space %s', ), terminal_output=dict(nohash=True, @@ -45,10 +48,7 @@ def test_Refit_inputs(): def test_Refit_outputs(): - output_map = dict(out_file=dict(keep_extension=False, - name_source='in_file', - name_template='%s', - ), + output_map = dict(out_file=dict(), ) outputs = Refit.output_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_Resample.py b/nipype/interfaces/afni/tests/test_auto_Resample.py index 8aa40f92ee..d133cebc3c 100644 --- a/nipype/interfaces/afni/tests/test_auto_Resample.py +++ b/nipype/interfaces/afni/tests/test_auto_Resample.py @@ -21,11 +21,11 @@ def test_Resample_inputs(): ), orientation=dict(argstr='-orient %s', ), - out_file=dict(argstr='-prefix %s', - name_source='in_file', - name_template='%s_resample', + out_file=dict(), + outputtype=dict(usedefault=True, + ), + prefix=dict(argstr='-prefix %s', ), - outputtype=dict(), resample_mode=dict(argstr='-rmode %s', ), terminal_output=dict(nohash=True, diff --git a/nipype/interfaces/afni/tests/test_auto_Retroicor.py b/nipype/interfaces/afni/tests/test_auto_Retroicor.py index 2d5fb74175..48c3b78ccb 100644 --- a/nipype/interfaces/afni/tests/test_auto_Retroicor.py +++ b/nipype/interfaces/afni/tests/test_auto_Retroicor.py @@ -31,7 +31,8 @@ def test_Retroicor_inputs(): mandatory=True, position=1, ), - outputtype=dict(), + outputtype=dict(usedefault=True, + ), resp=dict(argstr='-resp %s', position=-3, ), diff --git a/nipype/interfaces/afni/tests/test_auto_SVMTest.py b/nipype/interfaces/afni/tests/test_auto_SVMTest.py index a1566c59f7..8a1a071763 100644 --- a/nipype/interfaces/afni/tests/test_auto_SVMTest.py +++ b/nipype/interfaces/afni/tests/test_auto_SVMTest.py @@ -31,7 +31,8 @@ def test_SVMTest_inputs(): out_file=dict(argstr='-predictions %s', name_template='%s_predictions', ), - outputtype=dict(), + outputtype=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), testlabels=dict(argstr='-testlabels %s', diff --git a/nipype/interfaces/afni/tests/test_auto_SVMTrain.py b/nipype/interfaces/afni/tests/test_auto_SVMTrain.py index eb13dcb531..2604a841e0 100644 --- a/nipype/interfaces/afni/tests/test_auto_SVMTrain.py +++ b/nipype/interfaces/afni/tests/test_auto_SVMTrain.py @@ -45,7 +45,8 @@ def test_SVMTrain_inputs(): name_template='%s_vectors', suffix='_bucket', ), - outputtype=dict(), + outputtype=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), trainlabels=dict(argstr='-trainlabels %s', diff --git a/nipype/interfaces/afni/tests/test_auto_SkullStrip.py b/nipype/interfaces/afni/tests/test_auto_SkullStrip.py index 12449c331f..5b2334fed0 100644 --- a/nipype/interfaces/afni/tests/test_auto_SkullStrip.py +++ b/nipype/interfaces/afni/tests/test_auto_SkullStrip.py @@ -21,7 +21,8 @@ def test_SkullStrip_inputs(): name_source='in_file', name_template='%s_skullstrip', ), - outputtype=dict(), + outputtype=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/afni/tests/test_auto_TCat.py b/nipype/interfaces/afni/tests/test_auto_TCat.py index ce1e8fbaac..bd02538439 100644 --- a/nipype/interfaces/afni/tests/test_auto_TCat.py +++ b/nipype/interfaces/afni/tests/test_auto_TCat.py @@ -21,7 +21,8 @@ def test_TCat_inputs(): name_source='in_files', name_template='%s_tcat', ), - outputtype=dict(), + outputtype=dict(usedefault=True, + ), rlt=dict(argstr='-rlt%s', position=1, ), diff --git a/nipype/interfaces/afni/tests/test_auto_TCorr1D.py b/nipype/interfaces/afni/tests/test_auto_TCorr1D.py index 6944276a2c..a60372482e 100644 --- a/nipype/interfaces/afni/tests/test_auto_TCorr1D.py +++ b/nipype/interfaces/afni/tests/test_auto_TCorr1D.py @@ -16,16 +16,17 @@ def test_TCorr1D_inputs(): position=1, xor=['pearson', 'spearman', 'quadrant'], ), - out_file=dict(argstr='-prefix %s', - keep_extension=False, - name_source='xset', - name_template='%s_correlation.nii.gz', + out_file=dict(keep_extension=False, + name_template='{prefix}{outputtype_}', + ), + outputtype=dict(usedefault=True, ), - outputtype=dict(), pearson=dict(argstr=' -pearson', position=1, xor=['spearman', 'quadrant', 'ktaub'], ), + prefix=dict(argstr='-prefix %s', + ), quadrant=dict(argstr=' -quadrant', position=1, xor=['pearson', 'spearman', 'ktaub'], @@ -36,12 +37,12 @@ def test_TCorr1D_inputs(): ), terminal_output=dict(nohash=True, ), - xset=dict(argstr=' %s', + xset=dict(argstr='%s', copyfile=False, mandatory=True, position=-2, ), - y_1d=dict(argstr=' %s', + y_1d=dict(argstr='%s', mandatory=True, position=-1, ), diff --git a/nipype/interfaces/afni/tests/test_auto_TCorrMap.py b/nipype/interfaces/afni/tests/test_auto_TCorrMap.py index d2c19bbc1d..6a126d2daa 100644 --- a/nipype/interfaces/afni/tests/test_auto_TCorrMap.py +++ b/nipype/interfaces/afni/tests/test_auto_TCorrMap.py @@ -55,12 +55,8 @@ def test_TCorrMap_inputs(): name_source='in_file', suffix='_mean', ), - out_file=dict(argstr='-prefix %s', - keep_extension=False, - name_source=['in_file'], - name_template='%s_afni', + outputtype=dict(usedefault=True, ), - outputtype=dict(), pmean=dict(argstr='-Pmean %s', name_source='in_file', suffix='_pmean', diff --git a/nipype/interfaces/afni/tests/test_auto_TCorrelate.py b/nipype/interfaces/afni/tests/test_auto_TCorrelate.py index 4a5d68f9e9..3fbd091430 100644 --- a/nipype/interfaces/afni/tests/test_auto_TCorrelate.py +++ b/nipype/interfaces/afni/tests/test_auto_TCorrelate.py @@ -16,7 +16,8 @@ def test_TCorrelate_inputs(): name_source='xset', name_template='%s_tcorr', ), - outputtype=dict(), + outputtype=dict(usedefault=True, + ), pearson=dict(argstr='-pearson', position=1, ), diff --git a/nipype/interfaces/afni/tests/test_auto_TShift.py b/nipype/interfaces/afni/tests/test_auto_TShift.py index a67893c811..eefd89e4d7 100644 --- a/nipype/interfaces/afni/tests/test_auto_TShift.py +++ b/nipype/interfaces/afni/tests/test_auto_TShift.py @@ -21,11 +21,11 @@ def test_TShift_inputs(): ), interp=dict(argstr='-%s', ), - out_file=dict(argstr='-prefix %s', - name_source='in_file', - name_template='%s_tshift', + out_file=dict(), + outputtype=dict(usedefault=True, + ), + prefix=dict(argstr='-prefix %s', ), - outputtype=dict(), rlt=dict(argstr='-rlt', ), rltplus=dict(argstr='-rlt+', diff --git a/nipype/interfaces/afni/tests/test_auto_TStat.py b/nipype/interfaces/afni/tests/test_auto_TStat.py index f7a60ca78c..ce224b221c 100644 --- a/nipype/interfaces/afni/tests/test_auto_TStat.py +++ b/nipype/interfaces/afni/tests/test_auto_TStat.py @@ -21,11 +21,11 @@ def test_TStat_inputs(): ), options=dict(argstr='%s', ), - out_file=dict(argstr='-prefix %s', - name_source='in_file', - name_template='%s_tstat', + out_file=dict(), + outputtype=dict(usedefault=True, + ), + prefix=dict(argstr='-prefix %s', ), - outputtype=dict(), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/afni/tests/test_auto_To3D.py b/nipype/interfaces/afni/tests/test_auto_To3D.py index 4357ee96da..565a235505 100644 --- a/nipype/interfaces/afni/tests/test_auto_To3D.py +++ b/nipype/interfaces/afni/tests/test_auto_To3D.py @@ -24,11 +24,12 @@ def test_To3D_inputs(): mandatory=True, position=-1, ), - out_file=dict(argstr='-prefix %s', - name_source=['in_folder'], - name_template='%s', + out_file=dict(), + outputtype=dict(usedefault=True, + ), + prefix=dict(argstr='-prefix %s', + usedefault='true', ), - outputtype=dict(), skipoutliers=dict(argstr='-skip_outliers', ), terminal_output=dict(nohash=True, diff --git a/nipype/interfaces/afni/tests/test_auto_Volreg.py b/nipype/interfaces/afni/tests/test_auto_Volreg.py index 10dc45e76e..c59b13efe3 100644 --- a/nipype/interfaces/afni/tests/test_auto_Volreg.py +++ b/nipype/interfaces/afni/tests/test_auto_Volreg.py @@ -23,26 +23,16 @@ def test_Volreg_inputs(): position=-1, ), md1d_file=dict(argstr='-maxdisp1D %s', - keep_extension=False, - name_source='in_file', - name_template='%s_md.1D', position=-4, ), oned_file=dict(argstr='-1Dfile %s', - keep_extension=False, - name_source='in_file', - name_template='%s.1D', ), oned_matrix_save=dict(argstr='-1Dmatrix_save %s', - keep_extension=False, - name_source='in_file', - name_template='%s.aff12.1D', ), out_file=dict(argstr='-prefix %s', - name_source='in_file', - name_template='%s_volreg', ), - outputtype=dict(), + outputtype=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), timeshift=dict(argstr='-tshift 0', diff --git a/nipype/interfaces/afni/tests/test_auto_Warp.py b/nipype/interfaces/afni/tests/test_auto_Warp.py index c749d7fade..ab570f9287 100644 --- a/nipype/interfaces/afni/tests/test_auto_Warp.py +++ b/nipype/interfaces/afni/tests/test_auto_Warp.py @@ -29,11 +29,11 @@ def test_Warp_inputs(): ), newgrid=dict(argstr='-newgrid %f', ), - out_file=dict(argstr='-prefix %s', - name_source='in_file', - name_template='%s_warp', + out_file=dict(), + outputtype=dict(usedefault=True, + ), + prefix=dict(argstr='-prefix %s', ), - outputtype=dict(), terminal_output=dict(nohash=True, ), tta2mni=dict(argstr='-tta2mni', diff --git a/nipype/interfaces/afni/tests/test_auto_ZCutUp.py b/nipype/interfaces/afni/tests/test_auto_ZCutUp.py index f3ede54b3e..bd59594d21 100644 --- a/nipype/interfaces/afni/tests/test_auto_ZCutUp.py +++ b/nipype/interfaces/afni/tests/test_auto_ZCutUp.py @@ -23,7 +23,8 @@ def test_ZCutUp_inputs(): name_source='in_file', name_template='%s_zcupup', ), - outputtype=dict(), + outputtype=dict(usedefault=True, + ), terminal_output=dict(nohash=True, ), ) From c17c343d3434abd9310013f4a6d2412d9f4be440 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Fri, 19 Feb 2016 17:35:40 -0800 Subject: [PATCH 51/73] investigating the extension stripping problem --- nipype/interfaces/afni/base.py | 2 +- nipype/interfaces/fsl/base.py | 23 +- nipype/interfaces/fsl/dti.py | 166 +-- nipype/interfaces/fsl/epi.py | 448 ++---- .../fsl/tests/test_auto_BEDPOSTX5.py | 20 +- .../fsl/tests/test_auto_ConvertXFM.py | 14 +- .../fsl/tests/test_auto_CopyGeom.py | 5 +- .../interfaces/fsl/tests/test_auto_DTIFit.py | 55 +- .../fsl/tests/test_auto_EPIDeWarp.py | 43 +- .../fsl/tests/test_auto_EddyCorrect.py | 18 +- .../interfaces/fsl/tests/test_auto_EpiReg.py | 15 +- .../fsl/tests/test_auto_ExtractROI.py | 2 +- .../fsl/tests/test_auto_FSLXCommand.py | 9 + .../fsl/tests/test_auto_FilterRegressor.py | 2 +- .../fsl/tests/test_auto_ImageMaths.py | 4 +- .../fsl/tests/test_auto_ImageMeants.py | 1 - .../fsl/tests/test_auto_ImageStats.py | 2 +- .../interfaces/fsl/tests/test_auto_Merge.py | 2 - .../interfaces/fsl/tests/test_auto_Overlay.py | 1 - .../fsl/tests/test_auto_PlotMotionParams.py | 7 +- .../fsl/tests/test_auto_PlotTimeSeries.py | 25 +- .../fsl/tests/test_auto_RobustFOV.py | 2 - .../interfaces/fsl/tests/test_auto_Slicer.py | 10 +- .../interfaces/fsl/tests/test_auto_Smooth.py | 2 - .../fsl/tests/test_auto_SwapDimensions.py | 2 +- .../interfaces/fsl/tests/test_auto_TOPUP.py | 18 +- .../fsl/tests/test_auto_XFibres5.py | 9 + nipype/interfaces/fsl/tests/test_base.py | 40 +- nipype/interfaces/fsl/tests/test_epi.py | 63 - nipype/interfaces/fsl/tests/test_maths.py | 131 +- nipype/interfaces/fsl/utils.py | 1234 +++++++---------- nipype/interfaces/traits_extension.py | 21 +- 32 files changed, 929 insertions(+), 1467 deletions(-) delete mode 100644 nipype/interfaces/fsl/tests/test_epi.py diff --git a/nipype/interfaces/afni/base.py b/nipype/interfaces/afni/base.py index 489f99fb82..1f1fb48474 100644 --- a/nipype/interfaces/afni/base.py +++ b/nipype/interfaces/afni/base.py @@ -6,7 +6,7 @@ from builtins import object from ... import logging -from ..base import traits, File, GenFile, CommandLine, CommandLineInputSpec, TraitedSpec +from ..base import traits, File, CommandLine, CommandLineInputSpec, TraitedSpec # Use nipype's logging system IFLOGGER = logging.getLogger('interface') diff --git a/nipype/interfaces/fsl/base.py b/nipype/interfaces/fsl/base.py index 9db547fb80..465ffc6242 100644 --- a/nipype/interfaces/fsl/base.py +++ b/nipype/interfaces/fsl/base.py @@ -79,20 +79,6 @@ def version(): out = vfile.read().strip('\n') return out - @classmethod - def output_type(cls): - """Get the global FSL output file type FSLOUTPUTTYPE. - - This returns the value of the environment variable - FSLOUTPUTTYPE. An exception is raised if it is not defined. - - Returns - ------- - fsl_ftype : string - Represents the current environment setting of FSLOUTPUTTYPE - """ - return FSLOUTPUTTYPE - @staticmethod def standard_image(img_name=None): """Grab an image from the standard location. @@ -118,9 +104,11 @@ class FSLCommandInputSpec(CommandLineInputSpec): All command support specifying FSLOUTPUTTYPE dynamically via output_type. - Example - ------- - fsl.ExtractRoi(tmin=42, tsize=1, output_type='NIFTI') + Example:: + + fsl.ExtractRoi(tmin=42, tsize=1, output_type='NIFTI') + + """ output_type = traits.Trait(FSLOUTPUTTYPE, Info.ftypes, usedefault=True, desc='FSL output type') @@ -134,7 +122,6 @@ class FSLCommand(CommandLine): # pylint: disable=W0223 def __init__(self, **inputs): super(FSLCommand, self).__init__(**inputs) self.inputs.on_trait_change(self._output_update, 'output_type') - self.inputs.environ.update({'FSLOUTPUTTYPE': FSLOUTPUTTYPE}) def _output_update(self): self.inputs.environ.update({'FSLOUTPUTTYPE': self.inputs.output_type}) diff --git a/nipype/interfaces/fsl/dti.py b/nipype/interfaces/fsl/dti.py index fc2899a4fc..af44d21f05 100644 --- a/nipype/interfaces/fsl/dti.py +++ b/nipype/interfaces/fsl/dti.py @@ -19,7 +19,7 @@ import shutil from ... import LooseVersion -from ..base import (TraitedSpec, isdefined, File, Directory, +from ..base import (TraitedSpec, isdefined, File, GenFile, GenMultiFile, Directory, InputMultiPath, OutputMultiPath, traits, Undefined) from ..fsl.base import (FSLCommand, FSLCommandInputSpec, Info) from ...utils.filemanip import fname_presuffix, split_filename, copyfile @@ -54,30 +54,43 @@ class DTIFitInputSpec(FSLCommandInputSpec): gradnonlin = File(exists=True, argstr='--gradnonlin=%s', desc='gradient non linearities') + # Auto-generated outputs + out_v1 = GenFile(template='{base_name}V1{output_type_}', + keep_extension=False, desc='1st eigenvector') + out_v2 = GenFile(template='{base_name}V2{output_type_}', + keep_extension=False, desc='2nd eigenvector') + out_v3 = GenFile(template='{base_name}V3{output_type_}', + keep_extension=False, desc='3rd eigenvector') + out_l1 = GenFile(template='{base_name}L1{output_type_}', + keep_extension=False, desc='1st eigenvalue') + out_l2 = GenFile(template='{base_name}L2{output_type_}', + keep_extension=False, desc='2nd eigenvalue') + out_l3 = GenFile(template='{base_name}L3{output_type_}', + keep_extension=False, desc='3rd eigenvalue') + out_md = GenFile(template='{base_name}MD{output_type_}', + keep_extension=False, desc='mean diffusivity') + out_fa = GenFile(template='{base_name}FA{output_type_}', + keep_extension=False, desc='fractional anisotropy') + out_mo = GenFile(template='{base_name}MO{output_type_}', + keep_extension=False, desc='mode of anisotropy') + out_s0 = GenFile(template='{base_name}S0{output_type_}', + keep_extension=False, desc='raw T2 signal with no diffusion weighting') + tensor = GenFile(template='{base_name}tensor{output_type_}', + keep_extension=False, desc='path/name of file with the 4D tensor volume') + class DTIFitOutputSpec(TraitedSpec): - out_v1 = File(name_source='base_name', name_template='%s_V1', - exists=True, desc='1st eigenvector') - out_v2 = File(name_source='base_name', name_template='%s_V2', - exists=True, desc='2nd eigenvector') - out_v3 = File(name_source='base_name', name_template='%s_V3', - exists=True, desc='3rd eigenvector') - out_l1 = File(name_source='base_name', name_template='%s_L1', - exists=True, desc='1st eigenvalue') - out_l2 = File(name_source='base_name', name_template='%s_L2', - exists=True, desc='2nd eigenvalue') - out_l3 = File(name_source='base_name', name_template='%s_L3', - exists=True, desc='3rd eigenvalue') - out_md = File(name_source='base_name', name_template='%s_MD', - exists=True, desc='mean diffusivity') - out_fa = File(name_source='base_name', name_template='%s_FA', - exists=True, desc='fractional anisotropy') - out_mo = File(name_source='base_name', name_template='%s_MO', - exists=True, desc='mode of anisotropy') - out_s0 = File(name_source='base_name', name_template='%s_S0', - exists=True, desc='raw T2 signal with no diffusion weighting') - tensor = File(name_source='base_name', name_template='%s_tensor', - desc='path/name of file with the 4D tensor volume') + out_v1 = File(exists=True, desc='1st eigenvector') + out_v2 = File(exists=True, desc='2nd eigenvector') + out_v3 = File(exists=True, desc='3rd eigenvector') + out_l1 = File(exists=True, desc='1st eigenvalue') + out_l2 = File(exists=True, desc='2nd eigenvalue') + out_l3 = File(exists=True, desc='3rd eigenvalue') + out_md = File(exists=True, desc='mean diffusivity') + out_fa = File(exists=True, desc='fractional anisotropy') + out_mo = File(exists=True, desc='mode of anisotropy') + out_s0 = File(exists=True, desc='raw T2 signal with no diffusion weighting') + tensor = File(desc='path/name of file with the 4D tensor volume') class DTIFit(FSLCommand): @@ -104,13 +117,8 @@ class DTIFit(FSLCommand): output_spec = DTIFitOutputSpec def _post_run(self): - for k, _ in list(self.outputs.items()): - if k in ('outputtype', 'environ', 'args'): - continue - value = op.abspath(self.inputs.base_name + '_%s' % k) - if k == 'tensor' and self.inputs.save_tensor: - value = Undefined - setattr(self.outputs, k, value) + if not self.inputs.save_tensor: + self.outputs.tensor = Undefined class FSLXCommandInputSpec(FSLCommandInputSpec): @@ -125,7 +133,7 @@ class FSLXCommandInputSpec(FSLCommandInputSpec): logdir = Directory('.', argstr='--logdir=%s', usedefault=True) n_fibres = traits.Range( - usedefault=True, low=1, default=2, argstr='--nfibres=%d', + usedefault=True, low=1, value=2, argstr='--nfibres=%d', desc=('Maximum number of fibres to fit in each voxel'), mandatory=True) model = traits.Enum(1, 2, 3, argstr='--model=%d', desc=('use monoexponential (1, default, required for ' @@ -165,7 +173,7 @@ class FSLXCommandInputSpec(FSLCommandInputSpec): cnlinear = traits.Bool(argstr='--cnonlinear', xor=_xor_inputs2, desc=('Initialise with constrained nonlinear ' 'fitting')) - rician = traits.Bool(argstr='--rician', desc=('use Rician noise modeling')) + rician = traits.Bool(False, usedefault=True, argstr='--rician', desc='use Rician noise modeling') _xor_inputs3 = ['f0_noard', 'f0_ard'] f0_noard = traits.Bool(argstr='--f0', xor=_xor_inputs3, @@ -178,21 +186,37 @@ class FSLXCommandInputSpec(FSLCommandInputSpec): desc=('use the actual directory name given ' '(do not add + to make a new directory)')) + mean_dsamples = GenFile(template='mean_dsamples{output_type_}', keep_extension=False, + desc='Mean of distribution on diffusivity d') + mean_S0samples = GenFile(template='mean_S0samples{output_type_}', keep_extension=False, + desc='Mean of distribution on T2w baseline signal intensity S0') + mean_tausamples = GenFile(template='mean_tausamples{output_type_}', keep_extension=False, + desc='Mean of distribution on tau samples (only with rician noise)') + dyads = GenMultiFile(template='dyads{n_fibres:d}{output_type_}', range_source='n_fibres+1', + keep_extension=False, desc='Mean of PDD distribution in vector form.') + fsamples = GenMultiFile(template='f{n_fibres:d}samples{output_type_}', range_source='n_fibres+1', + keep_extension=False, desc='Samples from the distribution on f anisotropy') + mean_fsamples = GenMultiFile(template='mean_f{n_fibres:d}samples{output_type_}', range_source='n_fibres+1', + keep_extension=False, desc='Mean of distribution on f anisotropy') + phsamples = GenMultiFile(template='ph{n_fibres:d}samples{output_type_}', range_source='n_fibres+1', + keep_extension=False, desc='phi samples, per fiber') + thsamples = GenMultiFile(template='th{n_fibres:d}samples{output_type_}', range_source='n_fibres+1', + keep_extension=False, desc='theta samples, per fiber') + class FSLXCommandOutputSpec(TraitedSpec): - dyads = OutputMultiPath(File(exists=True), desc=('Mean of PDD distribution' - ' in vector form.')) - fsamples = OutputMultiPath(File(exists=True), desc=('Samples from the ' - 'distribution on f anisotropy')) mean_dsamples = File(exists=True, desc='Mean of distribution on diffusivity d') - mean_fsamples = OutputMultiPath(File(exists=True), desc=('Mean of ' - 'distribution on f anisotropy')) - mean_S0samples = File(exists=True, desc=('Mean of distribution on T2w' - 'baseline signal intensity S0')) - mean_tausamples = File(exists=True, desc=('Mean of distribution on ' - 'tau samples (only with rician noise)')) - phsamples = OutputMultiPath(File(exists=True), desc=('phi samples, per fiber')) - thsamples = OutputMultiPath(File(exists=True), desc=('theta samples, per fiber')) + mean_S0samples = File( + exists=True, desc='Mean of distribution on T2w baseline signal intensity S0') + mean_tausamples = File( + exists=True, desc='Mean of distribution on tau samples (only with rician noise)') + dyads = OutputMultiPath(File(exists=True), desc='Mean of PDD distribution in vector form.') + fsamples = OutputMultiPath(File(exists=True), + desc='Samples from the distribution on f anisotropy') + mean_fsamples = OutputMultiPath(File(exists=True), + desc='Mean of distribution on f anisotropy') + phsamples = OutputMultiPath(File(exists=True), desc='phi samples, per fiber') + thsamples = OutputMultiPath(File(exists=True), desc='theta samples, per fiber') class FSLXCommand(FSLCommand): @@ -203,40 +227,13 @@ class FSLXCommand(FSLCommand): output_spec = FSLXCommandOutputSpec def _run_interface(self, runtime): - self._out_dir = os.getcwd() runtime = super(FSLXCommand, self)._run_interface(runtime) if runtime.stderr: self.raise_exception(runtime) - return runtime - - def _post_run(self, out_dir=None): - n_fibres = self.inputs.n_fibres - if not out_dir: - if isdefined(self.inputs.logdir): - out_dir = op.abspath(self.inputs.logdir) - else: - out_dir = op.abspath('logdir') - - multi_out = ['dyads', 'fsamples', 'mean_fsamples', - 'phsamples', 'thsamples'] - single_out = ['mean_dsamples', 'mean_S0samples'] - for k in single_out: - setattr(self.outputs, k, self._gen_fname(k, out_dir)) - - if isdefined(self.inputs.rician) and self.inputs.rician: - self.outputs.mean_tausamples = self._gen_fname('mean_tausamples', out_dir) - - for k in multi_out: - setattr(self.outputs, k, []) - - for i in range(1, n_fibres + 1): - self.outputs.fsamples.append(self._gen_fname('f%dsamples' % i, out_dir)) - self.outputs.mean_fsamples.append(self._gen_fname('mean_f%dsamples' % i, out_dir)) - - self.outputs.dyads.append(self._gen_fname('dyads%d' % i, out_dir)) - self.outputs.phsamples.append(self._gen_fname('ph%dsamples' % i, out_dir)) - self.outputs.thsamples.append(self._gen_fname('th%dsamples' % i, out_dir)) + if not self.inputs.rician: + self.outputs.mean_tausamples = Undefined + return runtime class BEDPOSTX5InputSpec(FSLXCommandInputSpec): @@ -268,23 +265,12 @@ class BEDPOSTX5InputSpec(FSLXCommandInputSpec): 'nonlinearities, default off')) use_gpu = traits.Bool(False, desc='Use the GPU version of bedpostx') + # Add dyads dispersion + dyads_dispersion = GenMultiFile( + template='{n_fibres:d}{output_type_}', keep_extension=False, source_range='n_fibres+1', + desc='Dispersion') -class BEDPOSTX5OutputSpec(TraitedSpec): - mean_dsamples = File(exists=True, desc='Mean of distribution on diffusivity d') - mean_fsamples = OutputMultiPath( - File(exists=True), desc='Mean of distribution on f anisotropy') - mean_S0samples = File( - exists=True, desc='Mean of distribution on T2w baseline signal intensity S0') - mean_phsamples = OutputMultiPath(File(exists=True), desc='Mean of distribution on phi') - mean_thsamples = OutputMultiPath(File(exists=True), - desc='Mean of distribution on theta') - merged_thsamples = OutputMultiPath(File(exists=True), - desc='Samples from the distribution on theta') - merged_phsamples = OutputMultiPath(File(exists=True), - desc=('Samples from the distribution on phi')) - merged_fsamples = OutputMultiPath( - File(exists=True), desc='Samples from the distribution on anisotropic volume fraction') - dyads = OutputMultiPath(File(exists=True), desc='Mean of PDD distribution in vector form.') +class BEDPOSTX5OutputSpec(FSLXCommandOutputSpec): dyads_dispersion = OutputMultiPath(File(exists=True), desc='Dispersion') diff --git a/nipype/interfaces/fsl/epi.py b/nipype/interfaces/fsl/epi.py index 5d80466ab8..4d25549089 100644 --- a/nipype/interfaces/fsl/epi.py +++ b/nipype/interfaces/fsl/epi.py @@ -13,19 +13,18 @@ """ import os -import warnings from glob import glob import numpy as np import nibabel as nib from ..fsl.base import FSLCommand, FSLCommandInputSpec, Info -from ..base import (traits, TraitedSpec, InputMultiPath, File, +from ..base import (traits, TraitedSpec, InputMultiPath, File, GenFile, isdefined, Undefined) from ...utils.filemanip import (load_json, save_json, split_filename, fname_presuffix) - -warn = warnings.warn +from ... import logging +IFLOGGER = logging.getLogger('interface') class PrepareFieldmapInputSpec(FSLCommandInputSpec): @@ -41,12 +40,11 @@ class PrepareFieldmapInputSpec(FSLCommandInputSpec): desc=('echo time difference of the ' 'fieldmap sequence in ms. (usually 2.46ms in' ' Siemens)')) - nocheck = traits.Bool(False, position=-1, argstr='--nocheck', - usedefault=True, + nocheck = traits.Bool(False, position=-1, argstr='--nocheck', usedefault=True, desc=('do not perform sanity checks for image ' 'size/range/dimensions')) - out_fieldmap = File(argstr='%s', position=4, - desc='output name for prepared fieldmap') + out_fieldmap = GenFile(template='{in_phase}_fslprepared{output_type_}', argstr='%s', + position=4, desc='output name for prepared fieldmap') class PrepareFieldmapOutputSpec(TraitedSpec): @@ -72,7 +70,7 @@ class PrepareFieldmap(FSLCommand): >>> prepare.inputs.output_type = "NIFTI_GZ" >>> prepare.cmdline #doctest: +ELLIPSIS 'fsl_prepare_fieldmap SIEMENS phase.nii magnitude.nii \ -.../phase_fslprepared.nii.gz 2.460000' +phase_fslprepared.nii.gz 2.460000' >>> res = prepare.run() # doctest: +SKIP @@ -81,27 +79,12 @@ class PrepareFieldmap(FSLCommand): input_spec = PrepareFieldmapInputSpec output_spec = PrepareFieldmapOutputSpec - def parse_args(self, skip=None): - if skip is None: - skip = [] - - if not isdefined(self.inputs.out_fieldmap): - self.inputs.out_fieldmap = self._gen_fname( - self.inputs.in_phase, suffix='_fslprepared') - - if not isdefined(self.inputs.nocheck) or not self.inputs.nocheck: - skip += ['nocheck'] - - return super(PrepareFieldmap, self).parse_args(skip=skip) - - def _post_run(self): - - self.outputs.out_fieldmap = self.inputs.out_fieldmap - def _run_interface(self, runtime): runtime = super(PrepareFieldmap, self)._run_interface(runtime) if runtime.returncode == 0: + # Add an empty volume to the output, since downstream software + # expects two GRE images to compute the difference out_file = self.inputs.out_fieldmap im = nib.load(out_file) dumb_img = nib.Nifti1Image(np.zeros(im.shape), im.affine, @@ -115,35 +98,19 @@ def _run_interface(self, runtime): class TOPUPInputSpec(FSLCommandInputSpec): in_file = File(exists=True, mandatory=True, desc='name of 4D file with images', argstr='--imain=%s') - encoding_file = File(exists=True, mandatory=True, - xor=['encoding_direction'], - desc='name of text file with PE directions/times', - argstr='--datain=%s') - encoding_direction = traits.List(traits.Enum('y', 'x', 'z', 'x-', 'y-', - 'z-'), mandatory=True, - xor=['encoding_file'], - requires=['readout_times'], - argstr='--datain=%s', - desc=('encoding direction for automatic ' - 'generation of encoding_file')) - readout_times = InputMultiPath(traits.Float, - requires=['encoding_direction'], - xor=['encoding_file'], mandatory=True, - desc=('readout times (dwell times by # ' - 'phase-encode steps minus 1)')) - out_base = File(desc=('base-name of output files (spline ' - 'coefficients (Hz) and movement parameters)'), - name_source=['in_file'], name_template='%s_base', - argstr='--out=%s', hash_files=False) - out_field = File(argstr='--fout=%s', hash_files=False, - name_source=['in_file'], name_template='%s_field', - desc='name of image file with field (Hz)') - out_corrected = File(argstr='--iout=%s', hash_files=False, - name_source=['in_file'], name_template='%s_corrected', - desc='name of 4D image file with unwarped images') - out_logfile = File(argstr='--logout=%s', desc='name of log-file', - name_source=['in_file'], name_template='%s_topup.log', - keep_extension=True, hash_files=False) + encoding_file = File( + template='{in_file}_encfile.txt', hash_files=False, + output_name='out_enc_file', mandatory=True, xor=['encoding_direction'], + argstr='--datain=%s', desc='name of text file with PE directions/times') + + encoding_direction = traits.List(traits.Enum( + 'y', 'x', 'z', 'x-', 'y-', 'z-'), mandatory=True, xor=['encoding_file'], + requires=['readout_times'], desc='encoding direction for automatic ' + 'generation of encoding_file') + readout_times = InputMultiPath( + traits.Float, requires=['encoding_direction'], xor=['encoding_file'], + mandatory=True, desc='readout times (dwell times by # phase-encode ' + 'steps minus 1)') # TODO: the following traits admit values separated by commas, one value # per registration level inside topup. @@ -203,6 +170,23 @@ class TOPUPInputSpec(FSLCommandInputSpec): desc=('If set (=1), the calculations are done in a ' 'different grid')) + # Outputs + out_base = GenFile( + template='{in_file}_base', argstr='--out=%s', hash_files=False, + desc='base-name of output files (spline coefficients (Hz) and movement parameters)') + out_field = GenFile( + template='{in_file}_field{output_type_}', argstr='--fout=%s', hash_files=False, + desc='name of image file with field (Hz)') + out_corrected = GenFile( + template='{in_file}_corrected{output_type_}', argstr='--iout=%s', hash_files=False, + desc='name of 4D image file with unwarped images') + out_logfile = GenFile( + template='{in_file}_topup.log', argstr='--logout=%s', hash_files=False, + desc='name of log-file') + out_fieldcoef = GenFile( + template='{in_file}_fieldcoef{output_type_}', argstr='--fout=%s', hash_files=False, + desc='name of image file with field (Hz)') + class TOPUPOutputSpec(TraitedSpec): out_fieldcoef = File(exists=True, @@ -243,66 +227,13 @@ class TOPUP(FSLCommand): input_spec = TOPUPInputSpec output_spec = TOPUPOutputSpec - def _format_arg(self, name, trait_spec, value): - if name == 'encoding_direction': - return trait_spec.argstr % self._generate_encfile() - if name == 'out_base': - path, name, ext = split_filename(value) - if path != '': - if not os.path.exists(path): - raise ValueError('out_base path must exist if provided') - return super(TOPUP, self)._format_arg(name, trait_spec, value) - - def _post_run(self): - outputs = super(TOPUP, self)._list_outputs() - del self.outputs.out_base - base_path = None - if isdefined(self.inputs.out_base): - base_path, base, _ = split_filename(self.inputs.out_base) - if base_path == '': - base_path = None - else: - base = split_filename(self.inputs.in_file)[1] + '_base' - self.outputs.out_fieldcoef = self._gen_fname(base, suffix='_fieldcoef', - cwd=base_path) - self.outputs.out_movpar = self._gen_fname(base, suffix='_movpar', - ext='.txt', cwd=base_path) - - if isdefined(self.inputs.encoding_direction): - self.outputs.out_enc_file = self._get_encfilename() - - def _get_encfilename(self): - out_file = os.path.join(os.getcwd(), - ('%s_encfile.txt' % - split_filename(self.inputs.in_file)[1])) - return out_file - - def _generate_encfile(self): - """Generate a topup compatible encoding file based on given directions - """ - out_file = self._get_encfilename() - durations = self.inputs.readout_times - if len(self.inputs.encoding_direction) != len(durations): - if len(self.inputs.readout_times) != 1: - raise ValueError(('Readout time must be a float or match the' - 'length of encoding directions')) - durations = durations * len(self.inputs.encoding_direction) - - lines = [] - for idx, encdir in enumerate(self.inputs.encoding_direction): - direction = 1.0 - if encdir.endswith('-'): - direction = -1.0 - line = [float(val[0] == encdir[0]) * direction - for val in ['x', 'y', 'z']] + [durations[idx]] - lines.append(line) - np.savetxt(out_file, np.array(lines), fmt='%d %d %d %.8f') - return out_file - - def _overload_extension(self, value, name=None): - if name == 'out_base': - return value - return super(TOPUP, self)._overload_extension(value, name) + def _run_interface(self, runtime): + if not os.path.isfile(self.inputs.encoding_file): + topup_generate_encfile( + self.inputs.readout_times, + self.inputs.encoding_direction, + self.inputs.encoding_file) + return super(TOPUP, self)._run_interface(runtime) class ApplyTOPUPInputSpec(FSLCommandInputSpec): @@ -323,10 +254,9 @@ class ApplyTOPUPInputSpec(FSLCommandInputSpec): 'coefficients')) in_topup_movpar = File(exists=True, requires=['in_topup_fieldcoef'], copyfile=False, desc='topup movpar.txt file') - out_corrected = File(desc='output (warped) image', - name_source=['in_files'], - name_template='%s_corrected', - argstr='--out=%s') + out_corrected = GenFile( + template='{in_files[0]}_corrected{output_type_}', argstr='--out=%s', + desc='output (warped) image') method = traits.Enum('jac', 'lsr', argstr='--method=%s', desc=('use jacobian modulation (jac) or least-squares' ' resampling (lsr)')) @@ -336,6 +266,11 @@ class ApplyTOPUPInputSpec(FSLCommandInputSpec): argstr='-d=%s', desc='force output data type') + def _format_arg(self, name, spec, value): + if name == 'in_topup_fieldcoef': + return spec.argstr % value.split('_fieldcoef')[0] + return super(ApplyTOPUPInputSpec, self)._format_arg(name, spec, value) + class ApplyTOPUPOutputSpec(TraitedSpec): out_corrected = File(exists=True, desc=('name of 4D image file with ' 'unwarped images')) @@ -372,11 +307,6 @@ class ApplyTOPUP(FSLCommand): input_spec = ApplyTOPUPInputSpec output_spec = ApplyTOPUPOutputSpec - def _format_arg(self, name, spec, value): - if name == 'in_topup_fieldcoef': - return spec.argstr % value.split('_fieldcoef')[0] - return super(ApplyTOPUP, self)._format_arg(name, spec, value) - class EddyInputSpec(FSLCommandInputSpec): in_file = File(exists=True, mandatory=True, argstr='--imain=%s', @@ -456,7 +386,7 @@ class Eddy(FSLCommand): >>> eddy.cmdline #doctest: +ELLIPSIS 'eddy --acqp=epi_acqp.txt --bvals=bvals.scheme --bvecs=bvecs.scheme \ --imain=epi.nii --index=epi_index.txt --mask=epi_mask.nii \ ---out=.../eddy_corrected' +--out=eddy_corrected' >>> res = eddy.run() # doctest: +SKIP """ @@ -491,19 +421,19 @@ def _format_arg(self, name, spec, value): return super(Eddy, self)._format_arg(name, spec, value) def _post_run(self): - + self.outputs.out_corrected = os.path.abspath('%s.nii.gz' % self.inputs.out_base) self.outputs.out_parameter = os.path.abspath('%s.eddy_parameters' % self.inputs.out_base) - + class SigLossInputSpec(FSLCommandInputSpec): in_file = File(mandatory=True, exists=True, argstr='-i %s', desc='b0 fieldmap file') - out_file = File(argstr='-s %s', - desc='output signal loss estimate file', - genfile=True) + out_file = GenFile( + template='{in_file}_sigloss{output_type_}', argstr='-s %s', + desc='output signal loss estimate file') mask_file = File(exists=True, argstr='-m %s', @@ -533,7 +463,7 @@ class SigLoss(FSLCommand): >>> sigloss.inputs.echo_time = 0.03 >>> sigloss.inputs.output_type = "NIFTI_GZ" >>> sigloss.cmdline #doctest: +ELLIPSIS - 'sigloss --te=0.030000 -i phase.nii -s .../phase_sigloss.nii.gz' + 'sigloss --te=0.030000 -i phase.nii -s phase_sigloss.nii.gz' >>> res = sigloss.run() # doctest: +SKIP @@ -543,13 +473,13 @@ class SigLoss(FSLCommand): _cmd = 'sigloss' def _post_run(self): - + self.outputs.out_file = self.inputs.out_file if ((not isdefined(self.outputs.out_file)) and (isdefined(self.inputs.in_file))): self.outputs.out_file = self._gen_fname(self.inputs.in_file, suffix='_sigloss') - + def _gen_filename(self, name): if name == 'out_file': return self.outputs.out_file @@ -582,12 +512,38 @@ class EpiRegInputSpec(FSLCommandInputSpec): weight_image = File(exists=True, argstr='--weight=%s', desc='weighting image (in T1 space)') - no_fmapreg = traits.Bool(False, argstr='--nofmapreg', - desc='do not perform registration of fmap to T1 \ - (use if fmap already registered)') + no_fmapreg = traits.Bool(False, usedefault=True, argstr='--nofmapreg', + desc='do not perform registration of fmap to T1 ' + '(use if fmap already registered).') no_clean = traits.Bool(True, argstr='--noclean', usedefault=True, desc='do not clean up intermediate files') + out_file = GenFile(template='{out_base}{output_type_}', keep_extension=False, + desc='output file name') + epi2str_mat = GenFile(template='{out_base}.mat', keep_extension=False, + desc='rigid epi-to-structural transform') + wmedge = GenFile(template='{out_base}_fast_wmedge{output_type_}', keep_extension=False, + desc='output file name') + wmseg = GenFile(template='{out_base}_fast_wmseg{output_type_}', keep_extension=False, + desc='output file name') + # Optional outputs + out_1vol = GenFile(template='{out_base}_1vol{output_type_}', keep_extension=False, + desc='output file name') + fmap2str_mat = GenFile(template='{out_base}_fieldmap2str.mat', keep_extension=False, + desc='output file name') + fmap2epi_mat = GenFile(template='{out_base}_fieldmaprads2epi.mat', keep_extension=False, + desc='output file name') + fmap_epi = GenFile(template='{out_base}_fieldmaprads2epi{output_type_}', keep_extension=False, + desc='output file name') + fmap_str = GenFile(template='{out_base}_fieldmaprads2str{output_type_}', keep_extension=False, + desc='output file name') + shiftmap = GenFile(template='{out_base}_fieldmaprads2epi_shift{output_type_}', + keep_extension=False, desc='output file name') + fullwarp = GenFile(template='{out_base}_warp{output_type_}', keep_extension=False, + desc='output file name') + epi2str_inv = GenFile(template='{out_base}_inv.mat', keep_extension=False, + desc='output file name') + class EpiRegOutputSpec(TraitedSpec): out_file = File(exists=True, @@ -613,6 +569,18 @@ class EpiRegOutputSpec(TraitedSpec): wmseg = File(exists=True, desc='white matter segmentation used in flirt bbr') wmedge = File(exists=True, desc='white matter edges for visualization') + def _post_run(self): + if self.inputs.no_fmapreg or not isdefined(self.inputs.fmap): + self.outputs.out_1vol = Undefined + self.outputs.fmap2str_mat = Undefined + self.outputs.fmap2epi_mat = Undefined + self.outputs.fmap_epi = Undefined + self.outputs.fmap_str = Undefined + self.outputs.fmapmag_str = Undefined + self.outputs.shiftmap = Undefined + self.outputs.fullwarp = Undefined + self.outputs.epi2str_inv = Undefined + class EpiReg(FSLCommand): """ @@ -645,86 +613,32 @@ class EpiReg(FSLCommand): input_spec = EpiRegInputSpec output_spec = EpiRegOutputSpec - def _post_run(self): - - self.outputs.out_file = os.path.join(os.getcwd(), - self.inputs.out_base + '.nii.gz') - if not (isdefined(self.inputs.no_fmapreg) and self.inputs.no_fmapreg) and isdefined(self.inputs.fmap): - self.outputs.out_1vol = os.path.join(os.getcwd(), - self.inputs.out_base + '_1vol.nii.gz') - self.outputs.fmap2str_mat = os.path.join(os.getcwd(), - self.inputs.out_base + '_fieldmap2str.mat') - self.outputs.fmap2epi_mat = os.path.join(os.getcwd(), - self.inputs.out_base + '_fieldmaprads2epi.mat') - self.outputs.fmap_epi = os.path.join(os.getcwd(), - self.inputs.out_base + '_fieldmaprads2epi.nii.gz') - self.outputs.fmap_str = os.path.join(os.getcwd(), - self.inputs.out_base + '_fieldmaprads2str.nii.gz') - self.outputs.fmapmag_str = os.path.join(os.getcwd(), - self.inputs.out_base + '_fieldmap2str.nii.gz') - self.outputs.shiftmap = os.path.join(os.getcwd(), - self.inputs.out_base + '_fieldmaprads2epi_shift.nii.gz') - self.outputs.fullwarp = os.path.join(os.getcwd(), - self.inputs.out_base + '_warp.nii.gz') - self.outputs.epi2str_inv = os.path.join(os.getcwd(), - self.inputs.out_base + '_inv.mat') - - self.outputs.epi2str_mat = os.path.join(os.getcwd(), - self.inputs.out_base + '.mat') - self.outputs.wmedge = os.path.join(os.getcwd(), - self.inputs.out_base + '_fast_wmedge.nii.gz') - self.outputs.wmseg = os.path.join(os.getcwd(), - self.inputs.out_base + '_fast_wmseg.nii.gz') - - + +# Helper functions ------------------------ +def topup_generate_encfile(durations, encoding_direction, out_file): + """Generate a topup compatible encoding file based on given directions + """ + if len(encoding_direction) != len(durations): + if len(durations) != 1: + raise ValueError('Readout time must be a float or match the ' + 'length of encoding directions') + durations = durations * len(encoding_direction) + + lines = [] + for idx, encdir in enumerate(encoding_direction): + direction = 1.0 + if encdir.endswith('-'): + direction = -1.0 + line = [float(val[0] == encdir[0]) * direction + for val in ['x', 'y', 'z']] + [durations[idx]] + lines.append(line) + np.savetxt(out_file, np.array(lines), fmt='%d %d %d %.8f') ####################################### # deprecated interfaces ####################################### -class EPIDeWarpInputSpec(FSLCommandInputSpec): - mag_file = File(exists=True, - desc='Magnitude file', - argstr='--mag %s', position=0, mandatory=True) - dph_file = File(exists=True, - desc='Phase file assumed to be scaled from 0 to 4095', - argstr='--dph %s', mandatory=True) - exf_file = File(exists=True, - desc='example func volume (or use epi)', - argstr='--exf %s') - epi_file = File(exists=True, - desc='EPI volume to unwarp', - argstr='--epi %s') - tediff = traits.Float(2.46, usedefault=True, - desc='difference in B0 field map TEs', - argstr='--tediff %s') - esp = traits.Float(0.58, desc='EPI echo spacing', - argstr='--esp %s', usedefault=True) - sigma = traits.Int(2, usedefault=True, argstr='--sigma %s', - desc="2D spatial gaussing smoothing \ - stdev (default = 2mm)") - vsm = traits.String(genfile=True, desc='voxel shift map', - argstr='--vsm %s') - exfdw = traits.String(desc='dewarped example func volume', genfile=True, - argstr='--exfdw %s') - epidw = traits.String(desc='dewarped epi volume', genfile=False, - argstr='--epidw %s') - tmpdir = traits.String(genfile=True, desc='tmpdir', - argstr='--tmpdir %s') - nocleanup = traits.Bool(True, usedefault=True, desc='no cleanup', - argstr='--nocleanup') - cleanup = traits.Bool(desc='cleanup', - argstr='--cleanup') - - -class EPIDeWarpOutputSpec(TraitedSpec): - unwarped_file = File(desc="unwarped epi file") - vsm_file = File(desc="voxel shift map") - exfdw = File(desc="dewarped functional volume example") - exf_mask = File(desc="Mask from example functional volume") - - class EPIDeWarp(FSLCommand): """ Wraps the unwarping script `epidewarp.fsl @@ -733,93 +647,18 @@ class EPIDeWarp(FSLCommand): .. warning:: deprecated in FSL, please use :func:`nipype.workflows.dmri.preprocess.epi.sdc_fmb` instead. - Examples - -------- - - >>> from nipype.interfaces.fsl import EPIDeWarp - >>> dewarp = EPIDeWarp() - >>> dewarp.inputs.epi_file = "functional.nii" - >>> dewarp.inputs.mag_file = "magnitude.nii" - >>> dewarp.inputs.dph_file = "phase.nii" - >>> dewarp.inputs.output_type = "NIFTI_GZ" - >>> dewarp.cmdline #doctest: +ELLIPSIS - 'epidewarp.fsl --mag magnitude.nii --dph phase.nii --epi functional.nii \ ---esp 0.58 --exfdw .../exfdw.nii.gz --nocleanup --sigma 2 --tediff 2.46 \ ---tmpdir .../temp --vsm .../vsm.nii.gz' - >>> res = dewarp.run() # doctest: +SKIP - + >>> from nipype.interfaces import fsl + >>> fsl.EPIDeWarp() + Traceback (most recent call last): + ... + NotImplementedError: deprecated, please use nipype.workflows.dmri.preprocess.epi.sdc_fmb instead """ _cmd = 'epidewarp.fsl' - input_spec = EPIDeWarpInputSpec - output_spec = EPIDeWarpOutputSpec def __init__(self, **inputs): - warnings.warn(("Deprecated: Please use " - "nipype.workflows.dmri.preprocess.epi.sdc_fmb instead"), - DeprecationWarning) - return super(EPIDeWarp, self).__init__(**inputs) - - def _run_interface(self, runtime): - runtime = super(EPIDeWarp, self)._run_interface(runtime) - if runtime.stderr: - self.raise_exception(runtime) - return runtime - - def _gen_filename(self, name): - if name == 'exfdw': - if isdefined(self.inputs.exf_file): - return self._gen_fname(self.inputs.exf_file, - suffix="_exfdw") - else: - return self._gen_fname("exfdw") - if name == 'epidw': - if isdefined(self.inputs.epi_file): - return self._gen_fname(self.inputs.epi_file, - suffix="_epidw") - if name == 'vsm': - return self._gen_fname('vsm') - if name == 'tmpdir': - return os.path.join(os.getcwd(), 'temp') - return None - - def _post_run(self): - - if not isdefined(self.inputs.exfdw): - self.outputs.exfdw = self._gen_filename('exfdw') - else: - self.outputs.exfdw = self.inputs.exfdw - if isdefined(self.inputs.epi_file): - if isdefined(self.inputs.epidw): - self.outputs.unwarped_file = self.inputs.epidw - else: - self.outputs.unwarped_file = self._gen_filename('epidw') - if not isdefined(self.inputs.vsm): - self.outputs.vsm_file = self._gen_filename('vsm') - else: - self.outputs.vsm_file = self._gen_fname(self.inputs.vsm) - if not isdefined(self.inputs.tmpdir): - outputs[ - 'exf_mask'] = self._gen_fname(cwd=self._gen_filename('tmpdir'), - basename='maskexf') - else: - self.outputs.exf_mask = self._gen_fname(cwd=self.inputs.tmpdir, - basename='maskexf') - - -class EddyCorrectInputSpec(FSLCommandInputSpec): - in_file = File(exists=True, desc='4D input file', argstr='%s', position=0, - mandatory=True) - out_file = File(desc='4D output file', argstr='%s', position=1, - name_source=['in_file'], name_template='%s_edc', - output_name='eddy_corrected') - ref_num = traits.Int(0, argstr='%d', position=2, desc='reference number', - mandatory=True, usedefault=True) - - -class EddyCorrectOutputSpec(TraitedSpec): - eddy_corrected = File(exists=True, - desc='path/name of 4D eddy corrected output file') + raise NotImplementedError( + 'deprecated, please use nipype.workflows.dmri.preprocess.epi.sdc_fmb instead') class EddyCorrect(FSLCommand): @@ -828,27 +667,16 @@ class EddyCorrect(FSLCommand): .. warning:: Deprecated in FSL. Please use :class:`nipype.interfaces.fsl.epi.Eddy` instead - Example - ------- - - >>> from nipype.interfaces.fsl import EddyCorrect - >>> eddyc = EddyCorrect(in_file='diffusion.nii', - ... out_file="diffusion_edc.nii", ref_num=0) - >>> eddyc.cmdline - 'eddy_correct diffusion.nii diffusion_edc.nii 0' + >>> from nipype.interfaces import fsl + >>> fsl.EddyCorrect() + Traceback (most recent call last): + ... + NotImplementedError: deprecated, please use nipype.interfaces.fsl.epi.Eddy instead """ _cmd = 'eddy_correct' - input_spec = EddyCorrectInputSpec - output_spec = EddyCorrectOutputSpec def __init__(self, **inputs): - warnings.warn(("Deprecated: Please use nipype.interfaces.fsl.epi.Eddy " - "instead"), DeprecationWarning) - return super(EddyCorrect, self).__init__(**inputs) + raise NotImplementedError( + 'deprecated, please use nipype.interfaces.fsl.epi.Eddy instead') - def _run_interface(self, runtime): - runtime = super(EddyCorrect, self)._run_interface(runtime) - if runtime.stderr: - self.raise_exception(runtime) - return runtime diff --git a/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX5.py b/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX5.py index 9b941413b0..f3b1d373cb 100644 --- a/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX5.py +++ b/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX5.py @@ -22,6 +22,9 @@ def test_BEDPOSTX5_inputs(): ), dwi=dict(mandatory=True, ), + dyads=dict(), + dyads_dispersion=dict(source_range='n_fibres+1', + ), environ=dict(nohash=True, usedefault=True, ), @@ -34,6 +37,7 @@ def test_BEDPOSTX5_inputs(): force_dir=dict(argstr='--forcedir', usedefault=True, ), + fsamples=dict(), fudge=dict(argstr='-w %d', ), gradnonlin=dict(argstr='-g', @@ -45,6 +49,10 @@ def test_BEDPOSTX5_inputs(): ), mask=dict(mandatory=True, ), + mean_S0samples=dict(), + mean_dsamples=dict(), + mean_fsamples=dict(), + mean_tausamples=dict(), model=dict(argstr='-model %d', ), n_fibres=dict(argstr='-n %d', @@ -69,7 +77,9 @@ def test_BEDPOSTX5_inputs(): ), output_type=dict(usedefault=True, ), + phsamples=dict(), rician=dict(argstr='--rician', + usedefault=True, ), sample_every=dict(argstr='-s %d', ), @@ -77,6 +87,7 @@ def test_BEDPOSTX5_inputs(): ), terminal_output=dict(nohash=True, ), + thsamples=dict(), update_proposal_every=dict(argstr='--updateproposalevery=%d', ), use_gpu=dict(), @@ -91,14 +102,13 @@ def test_BEDPOSTX5_inputs(): def test_BEDPOSTX5_outputs(): output_map = dict(dyads=dict(), dyads_dispersion=dict(), + fsamples=dict(), mean_S0samples=dict(), mean_dsamples=dict(), mean_fsamples=dict(), - mean_phsamples=dict(), - mean_thsamples=dict(), - merged_fsamples=dict(), - merged_phsamples=dict(), - merged_thsamples=dict(), + mean_tausamples=dict(), + phsamples=dict(), + thsamples=dict(), ) outputs = BEDPOSTX5.output_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_ConvertXFM.py b/nipype/interfaces/fsl/tests/test_auto_ConvertXFM.py index 7653189e3b..3999e6dacc 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ConvertXFM.py +++ b/nipype/interfaces/fsl/tests/test_auto_ConvertXFM.py @@ -9,7 +9,7 @@ def test_ConvertXFM_inputs(): concat_xfm=dict(argstr='-concat', position=-3, requires=['in_file2'], - xor=['invert_xfm', 'concat_xfm', 'fix_scale_skew'], + xor=['invert_xfm', 'concat_xfm', 'fix_scale_skew', 'operation'], ), environ=dict(nohash=True, usedefault=True, @@ -17,7 +17,7 @@ def test_ConvertXFM_inputs(): fix_scale_skew=dict(argstr='-fixscaleskew', position=-3, requires=['in_file2'], - xor=['invert_xfm', 'concat_xfm', 'fix_scale_skew'], + xor=['invert_xfm', 'concat_xfm', 'fix_scale_skew', 'operation'], ), ignore_exception=dict(nohash=True, usedefault=True, @@ -31,12 +31,18 @@ def test_ConvertXFM_inputs(): ), invert_xfm=dict(argstr='-inverse', position=-3, - xor=['invert_xfm', 'concat_xfm', 'fix_scale_skew'], + xor=['invert_xfm', 'concat_xfm', 'fix_scale_skew', 'operation'], + ), + operation=dict(argstr='-%s', + mandatory=True, + position=-3, + usedefault=True, + xor=['invert_xfm', 'concat_xfm', 'fix_scale_skew', 'operation'], ), out_file=dict(argstr='-omat %s', - genfile=True, hash_files=False, position=1, + template='{in_file}_{operation[:5]}.mat', ), output_type=dict(usedefault=True, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_CopyGeom.py b/nipype/interfaces/fsl/tests/test_auto_CopyGeom.py index 6c56a28cff..830af5cfa2 100644 --- a/nipype/interfaces/fsl/tests/test_auto_CopyGeom.py +++ b/nipype/interfaces/fsl/tests/test_auto_CopyGeom.py @@ -9,8 +9,6 @@ def test_CopyGeom_inputs(): dest_file=dict(argstr='%s', copyfile=True, mandatory=True, - name_source='dest_file', - name_template='%s', output_name='out_file', position=1, ), @@ -18,7 +16,8 @@ def test_CopyGeom_inputs(): usedefault=True, ), ignore_dims=dict(argstr='-d', - position='-1', + position=-1, + usedefault=True, ), ignore_exception=dict(nohash=True, usedefault=True, diff --git a/nipype/interfaces/fsl/tests/test_auto_DTIFit.py b/nipype/interfaces/fsl/tests/test_auto_DTIFit.py index 47727bf97b..83d48e1262 100644 --- a/nipype/interfaces/fsl/tests/test_auto_DTIFit.py +++ b/nipype/interfaces/fsl/tests/test_auto_DTIFit.py @@ -50,6 +50,16 @@ def test_DTIFit_inputs(): ), min_z=dict(argstr='-z %d', ), + out_fa=dict(), + out_l1=dict(), + out_l2=dict(), + out_l3=dict(), + out_md=dict(), + out_mo=dict(), + out_s0=dict(), + out_v1=dict(), + out_v2=dict(), + out_v3=dict(), output_type=dict(usedefault=True, ), save_tensor=dict(argstr='--save_tensor', @@ -57,6 +67,7 @@ def test_DTIFit_inputs(): ), sse=dict(argstr='--sse', ), + tensor=dict(), terminal_output=dict(nohash=True, ), ) @@ -68,39 +79,17 @@ def test_DTIFit_inputs(): def test_DTIFit_outputs(): - output_map = dict(out_fa=dict(name_source='base_name', - name_template='%s_FA', - ), - out_l1=dict(name_source='base_name', - name_template='%s_L1', - ), - out_l2=dict(name_source='base_name', - name_template='%s_L2', - ), - out_l3=dict(name_source='base_name', - name_template='%s_L3', - ), - out_md=dict(name_source='base_name', - name_template='%s_MD', - ), - out_mo=dict(name_source='base_name', - name_template='%s_MO', - ), - out_s0=dict(name_source='base_name', - name_template='%s_S0', - ), - out_v1=dict(name_source='base_name', - name_template='%s_V1', - ), - out_v2=dict(name_source='base_name', - name_template='%s_V2', - ), - out_v3=dict(name_source='base_name', - name_template='%s_V3', - ), - tensor=dict(name_source='base_name', - name_template='%s_tensor', - ), + output_map = dict(out_fa=dict(), + out_l1=dict(), + out_l2=dict(), + out_l3=dict(), + out_md=dict(), + out_mo=dict(), + out_s0=dict(), + out_v1=dict(), + out_v2=dict(), + out_v3=dict(), + tensor=dict(), ) outputs = DTIFit.output_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_EPIDeWarp.py b/nipype/interfaces/fsl/tests/test_auto_EPIDeWarp.py index 38ff561c6e..5f4f574f0f 100644 --- a/nipype/interfaces/fsl/tests/test_auto_EPIDeWarp.py +++ b/nipype/interfaces/fsl/tests/test_auto_EPIDeWarp.py @@ -6,53 +6,16 @@ def test_EPIDeWarp_inputs(): input_map = dict(args=dict(argstr='%s', ), - cleanup=dict(argstr='--cleanup', - ), - dph_file=dict(argstr='--dph %s', - mandatory=True, - ), environ=dict(nohash=True, usedefault=True, ), - epi_file=dict(argstr='--epi %s', - ), - epidw=dict(argstr='--epidw %s', - genfile=False, - ), - esp=dict(argstr='--esp %s', - usedefault=True, - ), - exf_file=dict(argstr='--exf %s', - ), - exfdw=dict(argstr='--exfdw %s', - genfile=True, - ), ignore_exception=dict(nohash=True, usedefault=True, ), - mag_file=dict(argstr='--mag %s', - mandatory=True, - position=0, - ), - nocleanup=dict(argstr='--nocleanup', - usedefault=True, - ), output_type=dict(usedefault=True, ), - sigma=dict(argstr='--sigma %s', - usedefault=True, - ), - tediff=dict(argstr='--tediff %s', - usedefault=True, - ), terminal_output=dict(nohash=True, ), - tmpdir=dict(argstr='--tmpdir %s', - genfile=True, - ), - vsm=dict(argstr='--vsm %s', - genfile=True, - ), ) inputs = EPIDeWarp.input_spec() @@ -62,11 +25,7 @@ def test_EPIDeWarp_inputs(): def test_EPIDeWarp_outputs(): - output_map = dict(exf_mask=dict(), - exfdw=dict(), - unwarped_file=dict(), - vsm_file=dict(), - ) + output_map = dict() outputs = EPIDeWarp.output_spec() for key, metadata in list(output_map.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_EddyCorrect.py b/nipype/interfaces/fsl/tests/test_auto_EddyCorrect.py index a1091313e9..1974200634 100644 --- a/nipype/interfaces/fsl/tests/test_auto_EddyCorrect.py +++ b/nipype/interfaces/fsl/tests/test_auto_EddyCorrect.py @@ -12,23 +12,8 @@ def test_EddyCorrect_inputs(): ignore_exception=dict(nohash=True, usedefault=True, ), - in_file=dict(argstr='%s', - mandatory=True, - position=0, - ), - out_file=dict(argstr='%s', - name_source=['in_file'], - name_template='%s_edc', - output_name='eddy_corrected', - position=1, - ), output_type=dict(usedefault=True, ), - ref_num=dict(argstr='%d', - mandatory=True, - position=2, - usedefault=True, - ), terminal_output=dict(nohash=True, ), ) @@ -40,8 +25,7 @@ def test_EddyCorrect_inputs(): def test_EddyCorrect_outputs(): - output_map = dict(eddy_corrected=dict(), - ) + output_map = dict() outputs = EddyCorrect.output_spec() for key, metadata in list(output_map.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_EpiReg.py b/nipype/interfaces/fsl/tests/test_auto_EpiReg.py index cfeefa30a8..82440ecebb 100644 --- a/nipype/interfaces/fsl/tests/test_auto_EpiReg.py +++ b/nipype/interfaces/fsl/tests/test_auto_EpiReg.py @@ -15,12 +15,19 @@ def test_EpiReg_inputs(): mandatory=True, position=-4, ), + epi2str_inv=dict(), + epi2str_mat=dict(), fmap=dict(argstr='--fmap=%s', ), + fmap2epi_mat=dict(), + fmap2str_mat=dict(), + fmap_epi=dict(), + fmap_str=dict(), fmapmag=dict(argstr='--fmapmag=%s', ), fmapmagbrain=dict(argstr='--fmapmagbrain=%s', ), + fullwarp=dict(), ignore_exception=dict(nohash=True, usedefault=True, ), @@ -28,15 +35,19 @@ def test_EpiReg_inputs(): usedefault=True, ), no_fmapreg=dict(argstr='--nofmapreg', + usedefault=True, ), + out_1vol=dict(), out_base=dict(argstr='--out=%s', position=-1, usedefault=True, ), + out_file=dict(), output_type=dict(usedefault=True, ), pedir=dict(argstr='--pedir=%s', ), + shiftmap=dict(), t1_brain=dict(argstr='--t1brain=%s', mandatory=True, position=-2, @@ -49,8 +60,8 @@ def test_EpiReg_inputs(): ), weight_image=dict(argstr='--weight=%s', ), - wmseg=dict(argstr='--wmseg=%s', - ), + wmedge=dict(), + wmseg=dict(), ) inputs = EpiReg.input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_ExtractROI.py b/nipype/interfaces/fsl/tests/test_auto_ExtractROI.py index edf17e9225..c594b3d50a 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ExtractROI.py +++ b/nipype/interfaces/fsl/tests/test_auto_ExtractROI.py @@ -23,9 +23,9 @@ def test_ExtractROI_inputs(): output_type=dict(usedefault=True, ), roi_file=dict(argstr='%s', - genfile=True, hash_files=False, position=1, + template='{in_file}_roi{output_type_}', ), t_min=dict(argstr='%d', position=8, diff --git a/nipype/interfaces/fsl/tests/test_auto_FSLXCommand.py b/nipype/interfaces/fsl/tests/test_auto_FSLXCommand.py index 2f53eae322..929e4109a3 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FSLXCommand.py +++ b/nipype/interfaces/fsl/tests/test_auto_FSLXCommand.py @@ -25,6 +25,7 @@ def test_FSLXCommand_inputs(): dwi=dict(argstr='--data=%s', mandatory=True, ), + dyads=dict(), environ=dict(nohash=True, usedefault=True, ), @@ -37,6 +38,7 @@ def test_FSLXCommand_inputs(): force_dir=dict(argstr='--forcedir', usedefault=True, ), + fsamples=dict(), fudge=dict(argstr='--fudge=%d', ), ignore_exception=dict(nohash=True, @@ -48,6 +50,10 @@ def test_FSLXCommand_inputs(): mask=dict(argstr='--mask=%s', mandatory=True, ), + mean_S0samples=dict(), + mean_dsamples=dict(), + mean_fsamples=dict(), + mean_tausamples=dict(), model=dict(argstr='--model=%d', ), n_fibres=dict(argstr='--nfibres=%d', @@ -67,7 +73,9 @@ def test_FSLXCommand_inputs(): ), output_type=dict(usedefault=True, ), + phsamples=dict(), rician=dict(argstr='--rician', + usedefault=True, ), sample_every=dict(argstr='--sampleevery=%d', ), @@ -75,6 +83,7 @@ def test_FSLXCommand_inputs(): ), terminal_output=dict(nohash=True, ), + thsamples=dict(), update_proposal_every=dict(argstr='--updateproposalevery=%d', ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_FilterRegressor.py b/nipype/interfaces/fsl/tests/test_auto_FilterRegressor.py index a28e89fb25..546ff54ff4 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FilterRegressor.py +++ b/nipype/interfaces/fsl/tests/test_auto_FilterRegressor.py @@ -33,9 +33,9 @@ def test_FilterRegressor_inputs(): mask=dict(argstr='-m %s', ), out_file=dict(argstr='-o %s', - genfile=True, hash_files=False, position=2, + template='{in_file}_regfilt{output_type_}', ), out_vnscales=dict(argstr='--out_vnscales', ), diff --git a/nipype/interfaces/fsl/tests/test_auto_ImageMaths.py b/nipype/interfaces/fsl/tests/test_auto_ImageMaths.py index bc9a9670e2..ae1c0f83cc 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ImageMaths.py +++ b/nipype/interfaces/fsl/tests/test_auto_ImageMaths.py @@ -26,13 +26,13 @@ def test_ImageMaths_inputs(): position=5, ), out_file=dict(argstr='%s', - genfile=True, hash_files=False, position=4, ), output_type=dict(usedefault=True, ), - suffix=dict(), + suffix=dict(deprecated=True, + ), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_ImageMeants.py b/nipype/interfaces/fsl/tests/test_auto_ImageMeants.py index 58e2b57dc8..1441f68c05 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ImageMeants.py +++ b/nipype/interfaces/fsl/tests/test_auto_ImageMeants.py @@ -26,7 +26,6 @@ def test_ImageMeants_inputs(): usedefault=True, ), out_file=dict(argstr='-o %s', - genfile=True, hash_files=False, ), output_type=dict(usedefault=True, diff --git a/nipype/interfaces/fsl/tests/test_auto_ImageStats.py b/nipype/interfaces/fsl/tests/test_auto_ImageStats.py index aea8533e56..6f393c07d9 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ImageStats.py +++ b/nipype/interfaces/fsl/tests/test_auto_ImageStats.py @@ -16,7 +16,7 @@ def test_ImageStats_inputs(): mandatory=True, position=2, ), - mask_file=dict(argstr='', + mask_file=dict(argstr='-k %s', ), op_string=dict(argstr='%s', mandatory=True, diff --git a/nipype/interfaces/fsl/tests/test_auto_Merge.py b/nipype/interfaces/fsl/tests/test_auto_Merge.py index 6230c7dc0a..c08bc799c6 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Merge.py +++ b/nipype/interfaces/fsl/tests/test_auto_Merge.py @@ -22,8 +22,6 @@ def test_Merge_inputs(): ), merged_file=dict(argstr='%s', hash_files=False, - name_source='in_files', - name_template='%s_merged', position=1, ), output_type=dict(usedefault=True, diff --git a/nipype/interfaces/fsl/tests/test_auto_Overlay.py b/nipype/interfaces/fsl/tests/test_auto_Overlay.py index 4a64710474..9452550394 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Overlay.py +++ b/nipype/interfaces/fsl/tests/test_auto_Overlay.py @@ -32,7 +32,6 @@ def test_Overlay_inputs(): usedefault=True, ), out_file=dict(argstr='%s', - genfile=True, hash_files=False, position=-1, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_PlotMotionParams.py b/nipype/interfaces/fsl/tests/test_auto_PlotMotionParams.py index 2b5e981e46..6e29b0d067 100644 --- a/nipype/interfaces/fsl/tests/test_auto_PlotMotionParams.py +++ b/nipype/interfaces/fsl/tests/test_auto_PlotMotionParams.py @@ -12,19 +12,20 @@ def test_PlotMotionParams_inputs(): ignore_exception=dict(nohash=True, usedefault=True, ), - in_file=dict(argstr='%s', + in_file=dict(argstr='-i %s', mandatory=True, position=1, + sep=',', ), in_source=dict(mandatory=True, ), out_file=dict(argstr='-o %s', - genfile=True, hash_files=False, + template='{in_file}_{plot_type[:5]}.png', ), output_type=dict(usedefault=True, ), - plot_size=dict(argstr='%s', + plot_size=dict(argstr='-h %d -w %d', ), plot_type=dict(argstr='%s', mandatory=True, diff --git a/nipype/interfaces/fsl/tests/test_auto_PlotTimeSeries.py b/nipype/interfaces/fsl/tests/test_auto_PlotTimeSeries.py index e48a6bae01..02a746708a 100644 --- a/nipype/interfaces/fsl/tests/test_auto_PlotTimeSeries.py +++ b/nipype/interfaces/fsl/tests/test_auto_PlotTimeSeries.py @@ -15,33 +15,34 @@ def test_PlotTimeSeries_inputs(): in_file=dict(argstr='%s', mandatory=True, position=1, + sep=',', ), - labels=dict(argstr='%s', + labels=dict(argstr='-a %s', ), legend_file=dict(argstr='--legend=%s', ), out_file=dict(argstr='-o %s', - genfile=True, hash_files=False, + template='{in_file}.png', ), output_type=dict(usedefault=True, ), plot_finish=dict(argstr='--finish=%d', - xor=('plot_range',), + xor=['plot_range'], ), - plot_range=dict(argstr='%s', - xor=('plot_start', 'plot_finish'), + plot_range=dict(argstr='--start=%d --finish=%d', + xor=['plot_start', 'plot_finish'], ), - plot_size=dict(argstr='%s', + plot_size=dict(argstr='-h %d -w %d', ), plot_start=dict(argstr='--start=%d', - xor=('plot_range',), + xor=['plot_range'], ), sci_notation=dict(argstr='--sci', ), terminal_output=dict(nohash=True, ), - title=dict(argstr='%s', + title=dict(argstr="-t '%s'", ), x_precision=dict(argstr='--precision=%d', ), @@ -49,13 +50,13 @@ def test_PlotTimeSeries_inputs(): usedefault=True, ), y_max=dict(argstr='--ymax=%.2f', - xor=('y_range',), + xor=['y_range'], ), y_min=dict(argstr='--ymin=%.2f', - xor=('y_range',), + xor=['y_range'], ), - y_range=dict(argstr='%s', - xor=('y_min', 'y_max'), + y_range=dict(argstr='--ymin=%.2f --ymax=%.2f', + xor=['y_min', 'y_max'], ), ) inputs = PlotTimeSeries.input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_RobustFOV.py b/nipype/interfaces/fsl/tests/test_auto_RobustFOV.py index 5ed6438faa..6ed9cecdd7 100644 --- a/nipype/interfaces/fsl/tests/test_auto_RobustFOV.py +++ b/nipype/interfaces/fsl/tests/test_auto_RobustFOV.py @@ -18,8 +18,6 @@ def test_RobustFOV_inputs(): ), out_roi=dict(argstr='-r %s', hash_files=False, - name_source=['in_file'], - name_template='%s_ROI', ), output_type=dict(usedefault=True, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_Slicer.py b/nipype/interfaces/fsl/tests/test_auto_Slicer.py index b92c161eda..230ef4a45f 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Slicer.py +++ b/nipype/interfaces/fsl/tests/test_auto_Slicer.py @@ -20,6 +20,10 @@ def test_Slicer_inputs(): environ=dict(nohash=True, usedefault=True, ), + hide_orientation=dict(argstr='-u', + position=9, + usedefault=True, + ), ignore_exception=dict(nohash=True, usedefault=True, ), @@ -37,6 +41,7 @@ def test_Slicer_inputs(): position=5, ), label_slices=dict(argstr='-L', + mandatory=True, position=3, usedefault=True, ), @@ -48,7 +53,6 @@ def test_Slicer_inputs(): position=8, ), out_file=dict(argstr='%s', - genfile=True, hash_files=False, position=-1, ), @@ -62,9 +66,9 @@ def test_Slicer_inputs(): scaling=dict(argstr='-s %f', position=0, ), - show_orientation=dict(argstr='%s', + show_orientation=dict(deprecated=True, + new_name='hide_orientation', position=9, - usedefault=True, ), single_slice=dict(argstr='-%s', position=10, diff --git a/nipype/interfaces/fsl/tests/test_auto_Smooth.py b/nipype/interfaces/fsl/tests/test_auto_Smooth.py index dff30c3a26..247008db52 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Smooth.py +++ b/nipype/interfaces/fsl/tests/test_auto_Smooth.py @@ -30,8 +30,6 @@ def test_Smooth_inputs(): ), smoothed_file=dict(argstr='%s', hash_files=False, - name_source=['in_file'], - name_template='%s_smooth', position=2, ), terminal_output=dict(nohash=True, diff --git a/nipype/interfaces/fsl/tests/test_auto_SwapDimensions.py b/nipype/interfaces/fsl/tests/test_auto_SwapDimensions.py index 8a1165062c..cbe9b3e0a8 100644 --- a/nipype/interfaces/fsl/tests/test_auto_SwapDimensions.py +++ b/nipype/interfaces/fsl/tests/test_auto_SwapDimensions.py @@ -14,7 +14,7 @@ def test_SwapDimensions_inputs(): ), in_file=dict(argstr='%s', mandatory=True, - position='1', + position=1, ), new_dims=dict(argstr='%s %s %s', mandatory=True, diff --git a/nipype/interfaces/fsl/tests/test_auto_TOPUP.py b/nipype/interfaces/fsl/tests/test_auto_TOPUP.py index 5661248c5f..0273ceefc0 100644 --- a/nipype/interfaces/fsl/tests/test_auto_TOPUP.py +++ b/nipype/interfaces/fsl/tests/test_auto_TOPUP.py @@ -9,13 +9,15 @@ def test_TOPUP_inputs(): config=dict(argstr='--config=%s', usedefault=True, ), - encoding_direction=dict(argstr='--datain=%s', - mandatory=True, + encoding_direction=dict(mandatory=True, requires=['readout_times'], xor=['encoding_file'], ), encoding_file=dict(argstr='--datain=%s', + hash_files=False, mandatory=True, + output_name='out_enc_file', + template='{in_file}_encfile.txt', xor=['encoding_direction'], ), environ=dict(nohash=True, @@ -41,24 +43,18 @@ def test_TOPUP_inputs(): ), out_base=dict(argstr='--out=%s', hash_files=False, - name_source=['in_file'], - name_template='%s_base', ), out_corrected=dict(argstr='--iout=%s', hash_files=False, - name_source=['in_file'], - name_template='%s_corrected', ), out_field=dict(argstr='--fout=%s', hash_files=False, - name_source=['in_file'], - name_template='%s_field', + ), + out_fieldcoef=dict(argstr='--fout=%s', + hash_files=False, ), out_logfile=dict(argstr='--logout=%s', hash_files=False, - keep_extension=True, - name_source=['in_file'], - name_template='%s_topup.log', ), output_type=dict(usedefault=True, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_XFibres5.py b/nipype/interfaces/fsl/tests/test_auto_XFibres5.py index c19137b938..29361e2571 100644 --- a/nipype/interfaces/fsl/tests/test_auto_XFibres5.py +++ b/nipype/interfaces/fsl/tests/test_auto_XFibres5.py @@ -25,6 +25,7 @@ def test_XFibres5_inputs(): dwi=dict(argstr='--data=%s', mandatory=True, ), + dyads=dict(), environ=dict(nohash=True, usedefault=True, ), @@ -37,6 +38,7 @@ def test_XFibres5_inputs(): force_dir=dict(argstr='--forcedir', usedefault=True, ), + fsamples=dict(), fudge=dict(argstr='--fudge=%d', ), gradnonlin=dict(argstr='--gradnonlin=%s', @@ -50,6 +52,10 @@ def test_XFibres5_inputs(): mask=dict(argstr='--mask=%s', mandatory=True, ), + mean_S0samples=dict(), + mean_dsamples=dict(), + mean_fsamples=dict(), + mean_tausamples=dict(), model=dict(argstr='--model=%d', ), n_fibres=dict(argstr='--nfibres=%d', @@ -69,7 +75,9 @@ def test_XFibres5_inputs(): ), output_type=dict(usedefault=True, ), + phsamples=dict(), rician=dict(argstr='--rician', + usedefault=True, ), sample_every=dict(argstr='--sampleevery=%d', ), @@ -77,6 +85,7 @@ def test_XFibres5_inputs(): ), terminal_output=dict(nohash=True, ), + thsamples=dict(), update_proposal_every=dict(argstr='--updateproposalevery=%d', ), ) diff --git a/nipype/interfaces/fsl/tests/test_base.py b/nipype/interfaces/fsl/tests/test_base.py index 7ceb0184c2..03a211dcde 100644 --- a/nipype/interfaces/fsl/tests/test_base.py +++ b/nipype/interfaces/fsl/tests/test_base.py @@ -4,36 +4,29 @@ from nipype.testing import (assert_equal, assert_true, assert_raises, assert_not_equal, skipif) -import nipype.interfaces.fsl as fsl +from ... import fsl +from ..base import FSLCommandInputSpec from nipype.interfaces.base import InterfaceResult from nipype.interfaces.fsl import check_fsl, no_fsl -@skipif(no_fsl) # skip if fsl not installed) def test_fslversion(): ver = fsl.Info.version() - if ver: + if check_fsl(): # If ver is None, fsl is not installed ver = ver.split('.') yield assert_true, ver[0] in ['4', '5'] + else: + yield assert_equal, None, ver -@skipif(no_fsl) # skip if fsl not installed) def test_fsloutputtype(): types = list(fsl.Info.ftypes.keys()) orig_out_type = fsl.Info.output_type() yield assert_true, orig_out_type in types + yield assert_raises, KeyError, lambda: fsl.Info.ftypes['JUNK'] -def test_outputtype_to_ext(): - for ftype, ext in fsl.Info.ftypes.items(): - res = fsl.Info.output_type_to_ext(ftype) - yield assert_equal, res, ext - - yield assert_raises, KeyError, fsl.Info.output_type_to_ext, 'JUNK' - - -@skipif(no_fsl) # skip if fsl not installed) def test_FSLCommand(): # Most methods in FSLCommand are tested in the subclasses. Only # testing the one item that is not. @@ -42,19 +35,14 @@ def test_FSLCommand(): yield assert_equal, type(res), InterfaceResult -@skipif(no_fsl) # skip if fsl not installed) -def test_FSLCommand2(): +def test_FSLCommandInputSpec(): # Check default output type and environ - cmd = fsl.FSLCommand(command='junk') - yield assert_equal, cmd._output_type, fsl.Info.output_type() - yield assert_equal, cmd.inputs.environ['FSLOUTPUTTYPE'], cmd._output_type - yield assert_true, cmd._output_type in fsl.Info.ftypes + fslspec = FSLCommandInputSpec() + yield assert_equal, fslspec.output_type, lambda: os.getenv('FSLOUTPUTTYPE', 'NIFTI') - cmd = fsl.FSLCommand - cmdinst = fsl.FSLCommand(command='junk') +def test_FSLCommand2(): + cmd = fsl.FSLCommand(command='junk') + yield assert_equal, cmd.inputs.environ['FSLOUTPUTTYPE'], cmd.inputs.output_type for out_type in fsl.Info.ftypes: - cmd.set_default_output_type(out_type) - yield assert_equal, cmd._output_type, out_type - if out_type != fsl.Info.output_type(): - # Setting class outputtype should not effect existing instances - yield assert_not_equal, cmdinst.inputs.output_type, out_type + cmd.inputs.output_type = out_type + yield assert_equal, cmd.inputs.output_type_, fsl.Info.ftypes[out_type] diff --git a/nipype/interfaces/fsl/tests/test_epi.py b/nipype/interfaces/fsl/tests/test_epi.py deleted file mode 100644 index 4f2b0ed2c3..0000000000 --- a/nipype/interfaces/fsl/tests/test_epi.py +++ /dev/null @@ -1,63 +0,0 @@ -# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- -# vi: set ft=python sts=4 ts=4 sw=4 et: -import os - -from tempfile import mkdtemp -from shutil import rmtree - -import numpy as np - -import nibabel as nb - -from nipype.testing import (assert_equal, assert_not_equal, - assert_raises, skipif) -import nipype.interfaces.fsl.epi as fsl -from nipype.interfaces.fsl import no_fsl - - -def create_files_in_directory(): - outdir = os.path.realpath(mkdtemp()) - cwd = os.getcwd() - os.chdir(outdir) - filelist = ['a.nii', 'b.nii'] - for f in filelist: - hdr = nb.Nifti1Header() - shape = (3, 3, 3, 4) - hdr.set_data_shape(shape) - img = np.random.random(shape) - nb.save(nb.Nifti1Image(img, np.eye(4), hdr), - os.path.join(outdir, f)) - return filelist, outdir, cwd - - -def clean_directory(outdir, old_wd): - if os.path.exists(outdir): - rmtree(outdir) - os.chdir(old_wd) - - -# test eddy_correct -@skipif(no_fsl) -def test_eddy_correct2(): - filelist, outdir, cwd = create_files_in_directory() - eddy = fsl.EddyCorrect() - - # make sure command gets called - yield assert_equal, eddy.cmd, 'eddy_correct' - - # test raising error with mandatory args absent - yield assert_raises, ValueError, eddy.run - - # .inputs based parameters setting - eddy.inputs.in_file = filelist[0] - eddy.inputs.out_file = 'foo_eddc.nii' - eddy.inputs.ref_num = 100 - yield assert_equal, eddy.cmdline, 'eddy_correct %s foo_eddc.nii 100' % filelist[0] - - # .run based parameter setting - eddy2 = fsl.EddyCorrect(in_file=filelist[0], out_file='foo_ec.nii', ref_num=20) - yield assert_equal, eddy2.cmdline, 'eddy_correct %s foo_ec.nii 20' % filelist[0] - - # test arguments for opt_map - # eddy_correct class doesn't have opt_map{} - clean_directory(outdir, cwd) diff --git a/nipype/interfaces/fsl/tests/test_maths.py b/nipype/interfaces/fsl/tests/test_maths.py index d4003e8d74..e9a245e56b 100644 --- a/nipype/interfaces/fsl/tests/test_maths.py +++ b/nipype/interfaces/fsl/tests/test_maths.py @@ -16,19 +16,6 @@ from nipype.interfaces.fsl.base import FSLCommand -def set_output_type(fsl_output_type): - prev_output_type = os.environ.get('FSLOUTPUTTYPE', None) - - if fsl_output_type is not None: - os.environ['FSLOUTPUTTYPE'] = fsl_output_type - elif 'FSLOUTPUTTYPE' in os.environ: - del os.environ['FSLOUTPUTTYPE'] - - FSLCommand.set_default_output_type(Info.output_type()) - - return prev_output_type - - def create_files_in_directory(): testdir = os.path.realpath(mkdtemp()) origdir = os.getcwd() @@ -43,7 +30,7 @@ def create_files_in_directory(): nb.save(nb.Nifti1Image(img, np.eye(4), hdr), os.path.join(testdir, f)) - out_ext = Info.output_type_to_ext(Info.output_type()) + out_ext = Info.ftypes[Info.output_type()] return filelist, testdir, origdir, out_ext @@ -54,12 +41,11 @@ def clean_directory(testdir, origdir): @skipif(no_fsl) -def test_maths_base(fsl_output_type=None): - prev_type = set_output_type(fsl_output_type) +def test_maths_base(fsl_output_type='NIFTI'): files, testdir, origdir, out_ext = create_files_in_directory() # Get some fslmaths - maths = fsl.MathsCommand() + maths = fsl.MathsCommand(output_type=fsl_output_type) # Test that we got what we wanted yield assert_equal, maths.cmd, "fslmaths" @@ -80,11 +66,11 @@ def test_maths_base(fsl_output_type=None): out_cmdline = "fslmaths a.nii " + os.path.join(testdir, out_file) + " -odt %s" duo_cmdline = "fslmaths -dt %s a.nii " + os.path.join(testdir, out_file) + " -odt %s" for dtype in dtypes: - foo = fsl.MathsCommand(in_file="a.nii", internal_datatype=dtype) + foo = fsl.MathsCommand(in_file="a.nii", internal_datatype=dtype, output_type=fsl_output_type) yield assert_equal, foo.cmdline, int_cmdline % dtype - bar = fsl.MathsCommand(in_file="a.nii", output_datatype=dtype) + bar = fsl.MathsCommand(in_file="a.nii", output_datatype=dtype, output_type=fsl_output_type) yield assert_equal, bar.cmdline, out_cmdline % dtype - foobar = fsl.MathsCommand(in_file="a.nii", internal_datatype=dtype, output_datatype=dtype) + foobar = fsl.MathsCommand(in_file="a.nii", internal_datatype=dtype, output_datatype=dtype, output_type=fsl_output_type) yield assert_equal, foobar.cmdline, duo_cmdline % (dtype, dtype) # Test that we can ask for an outfile name @@ -93,16 +79,14 @@ def test_maths_base(fsl_output_type=None): # Clean up our mess clean_directory(testdir, origdir) - set_output_type(prev_type) @skipif(no_fsl) -def test_changedt(fsl_output_type=None): - prev_type = set_output_type(fsl_output_type) +def test_changedt(fsl_output_type='NIFTI'): files, testdir, origdir, out_ext = create_files_in_directory() # Get some fslmaths - cdt = fsl.ChangeDataType() + cdt = fsl.ChangeDataType(output_type=fsl_output_type) # Test that we got what we wanted yield assert_equal, cdt.cmd, "fslmaths" @@ -121,21 +105,19 @@ def test_changedt(fsl_output_type=None): dtypes = ["float", "char", "int", "short", "double", "input"] cmdline = "fslmaths a.nii b.nii -odt %s" for dtype in dtypes: - foo = fsl.MathsCommand(in_file="a.nii", out_file="b.nii", output_datatype=dtype) + foo = fsl.MathsCommand(in_file="a.nii", out_file="b.nii", output_datatype=dtype, output_type=fsl_output_type) yield assert_equal, foo.cmdline, cmdline % dtype # Clean up our mess clean_directory(testdir, origdir) - set_output_type(prev_type) @skipif(no_fsl) -def test_threshold(fsl_output_type=None): - prev_type = set_output_type(fsl_output_type) +def test_threshold(fsl_output_type='NIFTI'): files, testdir, origdir, out_ext = create_files_in_directory() # Get the command - thresh = fsl.Threshold(in_file="a.nii", out_file="b.nii") + thresh = fsl.Threshold(in_file="a.nii", out_file="b.nii", output_type=fsl_output_type) # Test the underlying command yield assert_equal, thresh.cmd, "fslmaths" @@ -150,11 +132,11 @@ def test_threshold(fsl_output_type=None): yield assert_equal, thresh.cmdline, cmdline % "-thr %.10f" % val val = "%.10f" % 42 - thresh = fsl.Threshold(in_file="a.nii", out_file="b.nii", thresh=42, use_robust_range=True) + thresh = fsl.Threshold(in_file="a.nii", out_file="b.nii", thresh=42, use_robust_range=True, output_type=fsl_output_type) yield assert_equal, thresh.cmdline, cmdline % ("-thrp " + val) thresh.inputs.use_nonzero_voxels = True yield assert_equal, thresh.cmdline, cmdline % ("-thrP " + val) - thresh = fsl.Threshold(in_file="a.nii", out_file="b.nii", thresh=42, direction="above") + thresh = fsl.Threshold(in_file="a.nii", out_file="b.nii", thresh=42, direction="above", output_type=fsl_output_type) yield assert_equal, thresh.cmdline, cmdline % ("-uthr " + val) thresh.inputs.use_robust_range = True yield assert_equal, thresh.cmdline, cmdline % ("-uthrp " + val) @@ -163,16 +145,14 @@ def test_threshold(fsl_output_type=None): # Clean up our mess clean_directory(testdir, origdir) - set_output_type(prev_type) @skipif(no_fsl) -def test_meanimage(fsl_output_type=None): - prev_type = set_output_type(fsl_output_type) +def test_meanimage(fsl_output_type='NIFTI'): files, testdir, origdir, out_ext = create_files_in_directory() # Get the command - meaner = fsl.MeanImage(in_file="a.nii", out_file="b.nii") + meaner = fsl.MeanImage(in_file="a.nii", out_file="b.nii", output_type=fsl_output_type) # Test the underlying command yield assert_equal, meaner.cmd, "fslmaths" @@ -187,21 +167,19 @@ def test_meanimage(fsl_output_type=None): yield assert_equal, meaner.cmdline, cmdline % dim # Test the auto naming - meaner = fsl.MeanImage(in_file="a.nii") + meaner = fsl.MeanImage(in_file="a.nii", output_type=fsl_output_type) yield assert_equal, meaner.cmdline, "fslmaths a.nii -Tmean %s" % os.path.join(testdir, "a_mean%s" % out_ext) # Clean up our mess clean_directory(testdir, origdir) - set_output_type(prev_type) @skipif(no_fsl) -def test_maximage(fsl_output_type=None): - prev_type = set_output_type(fsl_output_type) +def test_maximage(fsl_output_type='NIFTI'): files, testdir, origdir, out_ext = create_files_in_directory() # Get the command - maxer = fsl.MaxImage(in_file="a.nii", out_file="b.nii") + maxer = fsl.MaxImage(in_file="a.nii", out_file="b.nii", output_type=fsl_output_type) # Test the underlying command yield assert_equal, maxer.cmd, "fslmaths" @@ -216,21 +194,19 @@ def test_maximage(fsl_output_type=None): yield assert_equal, maxer.cmdline, cmdline % dim # Test the auto naming - maxer = fsl.MaxImage(in_file="a.nii") + maxer = fsl.MaxImage(in_file="a.nii", output_type=fsl_output_type) yield assert_equal, maxer.cmdline, "fslmaths a.nii -Tmax %s" % os.path.join(testdir, "a_max%s" % out_ext) # Clean up our mess clean_directory(testdir, origdir) - set_output_type(prev_type) @skipif(no_fsl) -def test_smooth(fsl_output_type=None): - prev_type = set_output_type(fsl_output_type) +def test_smooth(fsl_output_type='NIFTI'): files, testdir, origdir, out_ext = create_files_in_directory() # Get the command - smoother = fsl.IsotropicSmooth(in_file="a.nii", out_file="b.nii") + smoother = fsl.IsotropicSmooth(in_file="a.nii", out_file="b.nii", output_type=fsl_output_type) # Test the underlying command yield assert_equal, smoother.cmd, "fslmaths" @@ -248,21 +224,19 @@ def test_smooth(fsl_output_type=None): yield assert_equal, smoother.cmdline, cmdline % val # Test automatic naming - smoother = fsl.IsotropicSmooth(in_file="a.nii", sigma=5) + smoother = fsl.IsotropicSmooth(in_file="a.nii", sigma=5, output_type=fsl_output_type) yield assert_equal, smoother.cmdline, "fslmaths a.nii -s %.5f %s" % (5, os.path.join(testdir, "a_smooth%s" % out_ext)) # Clean up our mess clean_directory(testdir, origdir) - set_output_type(prev_type) @skipif(no_fsl) -def test_mask(fsl_output_type=None): - prev_type = set_output_type(fsl_output_type) +def test_mask(fsl_output_type='NIFTI'): files, testdir, origdir, out_ext = create_files_in_directory() # Get the command - masker = fsl.ApplyMask(in_file="a.nii", out_file="c.nii") + masker = fsl.ApplyMask(in_file="a.nii", out_file="c.nii", output_type=fsl_output_type) # Test the underlying command yield assert_equal, masker.cmd, "fslmaths" @@ -275,21 +249,19 @@ def test_mask(fsl_output_type=None): yield assert_equal, masker.cmdline, "fslmaths a.nii -mas b.nii c.nii" # Test auto name generation - masker = fsl.ApplyMask(in_file="a.nii", mask_file="b.nii") + masker = fsl.ApplyMask(in_file="a.nii", mask_file="b.nii", output_type=fsl_output_type) yield assert_equal, masker.cmdline, "fslmaths a.nii -mas b.nii " + os.path.join(testdir, "a_masked%s" % out_ext) # Clean up our mess clean_directory(testdir, origdir) - set_output_type(prev_type) @skipif(no_fsl) def test_dilation(fsl_output_type=None): - prev_type = set_output_type(fsl_output_type) files, testdir, origdir, out_ext = create_files_in_directory() # Get the command - diller = fsl.DilateImage(in_file="a.nii", out_file="b.nii") + diller = fsl.DilateImage(in_file="a.nii", out_file="b.nii", output_type=fsl_output_type) # Test the underlying command yield assert_equal, diller.cmd, "fslmaths" @@ -319,21 +291,19 @@ def test_dilation(fsl_output_type=None): yield assert_equal, diller.cmdline, "fslmaths a.nii -kernel file kernel.txt -dilF b.nii" # Test that we don't need to request an out name - dil = fsl.DilateImage(in_file="a.nii", operation="max") + dil = fsl.DilateImage(in_file="a.nii", operation="max", output_type=fsl_output_type) yield assert_equal, dil.cmdline, "fslmaths a.nii -dilF %s" % os.path.join(testdir, "a_dil%s" % out_ext) # Clean up our mess clean_directory(testdir, origdir) - set_output_type(prev_type) @skipif(no_fsl) def test_erosion(fsl_output_type=None): - prev_type = set_output_type(fsl_output_type) files, testdir, origdir, out_ext = create_files_in_directory() # Get the command - erode = fsl.ErodeImage(in_file="a.nii", out_file="b.nii") + erode = fsl.ErodeImage(in_file="a.nii", out_file="b.nii", output_type=fsl_output_type) # Test the underlying command yield assert_equal, erode.cmd, "fslmaths" @@ -346,49 +316,45 @@ def test_erosion(fsl_output_type=None): yield assert_equal, erode.cmdline, "fslmaths a.nii -eroF b.nii" # Test that we don't need to request an out name - erode = fsl.ErodeImage(in_file="a.nii") + erode = fsl.ErodeImage(in_file="a.nii", output_type=fsl_output_type) yield assert_equal, erode.cmdline, "fslmaths a.nii -ero %s" % os.path.join(testdir, "a_ero%s" % out_ext) # Clean up our mess clean_directory(testdir, origdir) - set_output_type(prev_type) @skipif(no_fsl) def test_spatial_filter(fsl_output_type=None): - prev_type = set_output_type(fsl_output_type) files, testdir, origdir, out_ext = create_files_in_directory() # Get the command - filter = fsl.SpatialFilter(in_file="a.nii", out_file="b.nii") + spfilt = fsl.SpatialFilter(in_file="a.nii", out_file="b.nii", output_type=fsl_output_type) # Test the underlying command - yield assert_equal, filter.cmd, "fslmaths" + yield assert_equal, spfilt.cmd, "fslmaths" # Test that it fails without an operation - yield assert_raises, ValueError, filter.run + yield assert_raises, ValueError, spfilt.run # Test the different operations for op in ["mean", "meanu", "median"]: - filter.inputs.operation = op - yield assert_equal, filter.cmdline, "fslmaths a.nii -f%s b.nii" % op + spfilt.inputs.operation = op + yield assert_equal, spfilt.cmdline, "fslmaths a.nii -f%s b.nii" % op # Test that we don't need to ask for an out name - filter = fsl.SpatialFilter(in_file="a.nii", operation="mean") - yield assert_equal, filter.cmdline, "fslmaths a.nii -fmean %s" % os.path.join(testdir, "a_filt%s" % out_ext) + spfilt = fsl.SpatialFilter(in_file="a.nii", operation="mean", output_type=fsl_output_type) + yield assert_equal, spfilt.cmdline, "fslmaths a.nii -fmean %s" % os.path.join(testdir, "a_filt%s" % out_ext) # Clean up our mess clean_directory(testdir, origdir) - set_output_type(prev_type) @skipif(no_fsl) def test_unarymaths(fsl_output_type=None): - prev_type = set_output_type(fsl_output_type) files, testdir, origdir, out_ext = create_files_in_directory() # Get the command - maths = fsl.UnaryMaths(in_file="a.nii", out_file="b.nii") + maths = fsl.UnaryMaths(in_file="a.nii", out_file="b.nii", output_type=fsl_output_type) # Test the underlying command yield assert_equal, maths.cmd, "fslmaths" @@ -404,21 +370,19 @@ def test_unarymaths(fsl_output_type=None): # Test that we don't need to ask for an out file for op in ops: - maths = fsl.UnaryMaths(in_file="a.nii", operation=op) + maths = fsl.UnaryMaths(in_file="a.nii", operation=op, output_type=fsl_output_type) yield assert_equal, maths.cmdline, "fslmaths a.nii -%s %s" % (op, os.path.join(testdir, "a_%s%s" % (op, out_ext))) # Clean up our mess clean_directory(testdir, origdir) - set_output_type(prev_type) @skipif(no_fsl) def test_binarymaths(fsl_output_type=None): - prev_type = set_output_type(fsl_output_type) files, testdir, origdir, out_ext = create_files_in_directory() # Get the command - maths = fsl.BinaryMaths(in_file="a.nii", out_file="c.nii") + maths = fsl.BinaryMaths(in_file="a.nii", out_file="c.nii", output_type=fsl_output_type) # Test the underlying command yield assert_equal, maths.cmd, "fslmaths" @@ -431,7 +395,7 @@ def test_binarymaths(fsl_output_type=None): operands = ["b.nii", -2, -0.5, 0, .123456, np.pi, 500] for op in ops: for ent in operands: - maths = fsl.BinaryMaths(in_file="a.nii", out_file="c.nii", operation=op) + maths = fsl.BinaryMaths(in_file="a.nii", out_file="c.nii", operation=op, output_type=fsl_output_type) if ent == "b.nii": maths.inputs.operand_file = ent yield assert_equal, maths.cmdline, "fslmaths a.nii -%s b.nii c.nii" % op @@ -441,21 +405,19 @@ def test_binarymaths(fsl_output_type=None): # Test that we don't need to ask for an out file for op in ops: - maths = fsl.BinaryMaths(in_file="a.nii", operation=op, operand_file="b.nii") + maths = fsl.BinaryMaths(in_file="a.nii", operation=op, operand_file="b.nii", output_type=fsl_output_type) yield assert_equal, maths.cmdline, "fslmaths a.nii -%s b.nii %s" % (op, os.path.join(testdir, "a_maths%s" % out_ext)) # Clean up our mess clean_directory(testdir, origdir) - set_output_type(prev_type) @skipif(no_fsl) def test_multimaths(fsl_output_type=None): - prev_type = set_output_type(fsl_output_type) files, testdir, origdir, out_ext = create_files_in_directory() # Get the command - maths = fsl.MultiImageMaths(in_file="a.nii", out_file="c.nii") + maths = fsl.MultiImageMaths(in_file="a.nii", out_file="c.nii", output_type=fsl_output_type) # Test the underlying command yield assert_equal, maths.cmd, "fslmaths" @@ -473,22 +435,20 @@ def test_multimaths(fsl_output_type=None): yield assert_equal, maths.cmdline, "fslmaths a.nii %s c.nii" % ostr % ("a.nii", "b.nii") # Test that we don't need to ask for an out file - maths = fsl.MultiImageMaths(in_file="a.nii", op_string="-add %s -mul 5", operand_files=["b.nii"]) + maths = fsl.MultiImageMaths(in_file="a.nii", op_string="-add %s -mul 5", operand_files=["b.nii"], output_type=fsl_output_type) yield assert_equal, maths.cmdline, \ "fslmaths a.nii -add b.nii -mul 5 %s" % os.path.join(testdir, "a_maths%s" % out_ext) # Clean up our mess clean_directory(testdir, origdir) - set_output_type(prev_type) @skipif(no_fsl) def test_tempfilt(fsl_output_type=None): - prev_type = set_output_type(fsl_output_type) files, testdir, origdir, out_ext = create_files_in_directory() # Get the command - filt = fsl.TemporalFilter(in_file="a.nii", out_file="b.nii") + filt = fsl.TemporalFilter(in_file="a.nii", out_file="b.nii", output_type=fsl_output_type) # Test the underlying command yield assert_equal, filt.cmd, "fslmaths" @@ -504,13 +464,12 @@ def test_tempfilt(fsl_output_type=None): yield assert_equal, filt.cmdline, "fslmaths a.nii -bptf %.6f %.6f b.nii" % win # Test that we don't need to ask for an out file - filt = fsl.TemporalFilter(in_file="a.nii", highpass_sigma=64) + filt = fsl.TemporalFilter(in_file="a.nii", highpass_sigma=64, output_type=fsl_output_type) yield assert_equal, filt.cmdline, \ "fslmaths a.nii -bptf 64.000000 -1.000000 %s" % os.path.join(testdir, "a_filt%s" % out_ext) # Clean up our mess clean_directory(testdir, origdir) - set_output_type(prev_type) @skipif(no_fsl) diff --git a/nipype/interfaces/fsl/utils.py b/nipype/interfaces/fsl/utils.py index 7bcd833160..bc36e7ce2b 100644 --- a/nipype/interfaces/fsl/utils.py +++ b/nipype/interfaces/fsl/utils.py @@ -27,8 +27,9 @@ import numpy as np from .base import FSLCommand, FSLCommandInputSpec, Info -from ..base import (traits, TraitedSpec, OutputMultiPath, File, - CommandLine, CommandLineInputSpec, isdefined) +from ..base import (traits, TraitedSpec, InputMultiPath, OutputMultiPath, + File, GenFile, CommandLine, CommandLineInputSpec, + isdefined, Undefined) from ...utils.filemanip import (load_json, save_json, split_filename, fname_presuffix, copyfile) @@ -36,17 +37,17 @@ class CopyGeomInputSpec(FSLCommandInputSpec): - in_file = File(exists=True, mandatory=True, argstr="%s", position=0, - desc="source image") - dest_file = File(exists=True, mandatory=True, argstr="%s", position=1, - desc="destination image", copyfile=True, output_name='out_file', - name_source='dest_file', name_template='%s') - ignore_dims = traits.Bool(desc=('Do not copy image dimensions'), - argstr='-d', position="-1") + in_file = File(exists=True, mandatory=True, argstr='%s', position=0, + desc='source image') + dest_file = File(exists=True, mandatory=True, argstr='%s', position=1, + desc='destination image', copyfile=True, + output_name='out_file') + ignore_dims = traits.Bool(False, usedefault=True, argstr='-d', position=-1, + desc='Do not copy image dimensions') class CopyGeomOutputSpec(TraitedSpec): - out_file = File(exists=True, desc="image with new geometry header") + out_file = File(exists=True, desc='image with new geometry header') class CopyGeom(FSLCommand): @@ -57,22 +58,20 @@ class CopyGeom(FSLCommand): or Nifti to Nifti will work properly. Copying from different files will result in loss of information or potentially incorrect settings. """ - _cmd = "fslcpgeom" + _cmd = 'fslcpgeom' input_spec = CopyGeomInputSpec output_spec = CopyGeomOutputSpec class RobustFOVInputSpec(FSLCommandInputSpec): - in_file = File(exists=True, - desc='input filename', - argstr='-i %s', position=0, mandatory=True) - out_roi = File(desc="ROI volume output name", argstr="-r %s", - name_source=['in_file'], hash_files=False, - name_template='%s_ROI') + in_file = File(exists=True, argstr='-i %s', position=0, mandatory=True, + desc='input filename') + out_roi = GenFile(template='{in_file}_ROI{output_type_}', argstr='-r %s', + hash_files=False, desc='ROI volume output name') class RobustFOVOutputSpec(TraitedSpec): - out_roi = File(exists=True, desc="ROI volume output name") + out_roi = File(exists=True, desc='ROI volume output name') class RobustFOV(FSLCommand): @@ -82,28 +81,27 @@ class RobustFOV(FSLCommand): class ImageMeantsInputSpec(FSLCommandInputSpec): - in_file = File(exists=True, - desc='input file for computing the average timeseries', - argstr='-i %s', position=0, mandatory=True) - out_file = File(desc='name of output text matrix', - argstr='-o %s', genfile=True, hash_files=False) + in_file = File(exists=True, argstr='-i %s', position=0, mandatory=True, + desc='input file for computing the average timeseries') + out_file = GenFile(template='{in_file}_ts.txt', argstr='-o %s', + hash_files=False, desc='name of output text matrix') mask = File(exists=True, desc='input 3D mask', argstr='-m %s') spatial_coord = traits.List(traits.Int, - desc=(' requested spatial coordinate ' - '(instead of mask)'), + desc=' requested spatial coordinate ' + '(instead of mask)', argstr='-c %s') - use_mm = traits.Bool(desc=('use mm instead of voxel coordinates (for -c ' - 'option)'), argstr='--usemm') - show_all = traits.Bool(desc=('show all voxel time series (within mask) ' - 'instead of averaging'), argstr='--showall') - eig = traits.Bool(desc=('calculate Eigenvariate(s) instead of mean (output ' - 'will have 0 mean)'), argstr='--eig') + use_mm = traits.Bool(desc='use mm instead of voxel coordinates (for -c ' + 'option)', argstr='--usemm') + show_all = traits.Bool(desc='show all voxel time series (within mask) ' + 'instead of averaging', argstr='--showall') + eig = traits.Bool(desc='calculate Eigenvariate(s) instead of mean (output ' + 'will have 0 mean)', argstr='--eig') order = traits.Int(1, desc='select number of Eigenvariates', argstr='--order=%d', usedefault=True) - nobin = traits.Bool(desc=('do not binarise the mask for calculation of ' - 'Eigenvariates'), argstr='--no_bin') - transpose = traits.Bool(desc=('output results in transpose format (one row ' - 'per voxel/mean)'), argstr='--transpose') + nobin = traits.Bool(desc='do not binarise the mask for calculation of ' + 'Eigenvariates', argstr='--no_bin') + transpose = traits.Bool(desc='output results in transpose format (one row ' + 'per voxel/mean)', argstr='--transpose') class ImageMeantsOutputSpec(TraitedSpec): @@ -120,33 +118,23 @@ class ImageMeants(FSLCommand): input_spec = ImageMeantsInputSpec output_spec = ImageMeantsOutputSpec - def _post_run(self): - - self.outputs.out_file = self.inputs.out_file - if not isdefined(self.outputs.out_file): - self.outputs.out_file = self._gen_fname(self.inputs.in_file, - suffix='_ts', - ext='.txt', - change_ext=True) - self.outputs.out_file = os.path.abspath(self.outputs.out_file) - - def _gen_filename(self, name): - if name == 'out_file': - return getattr(self.outputs, name) - return None - class SmoothInputSpec(FSLCommandInputSpec): - in_file = File(exists=True, argstr="%s", position=0, mandatory=True) + in_file = File(exists=True, argstr='%s', position=0, mandatory=True) + smoothed_file = GenFile(template='{in_file}_smooth{output_type_}', argstr='%s', + position=2, hash_files=False, desc='smoothed, output file') sigma = traits.Float( - argstr="-kernel gauss %.03f -fmean", position=1, xor=['fwhm'], mandatory=True, + argstr='-kernel gauss %.03f -fmean', position=1, xor=['fwhm'], mandatory=True, desc='gaussian kernel sigma in mm (not voxels)') fwhm = traits.Float( - argstr="-kernel gauss %.03f -fmean", position=1, xor=['sigma'], mandatory=True, + argstr='-kernel gauss %.03f -fmean', position=1, xor=['sigma'], mandatory=True, desc='gaussian kernel fwhm, will be converted to sigma in mm (not voxels)') - smoothed_file = File( - argstr="%s", position=2, name_source=['in_file'], name_template='%s_smooth', hash_files=False) + def _format_arg(self, name, trait_spec, value): + if name == 'fwhm': + sigma = float(value) / np.sqrt(8 * np.log(2)) + return super(SmoothInputSpec, self)._format_arg(name, trait_spec, sigma) + return super(SmoothInputSpec, self)._format_arg(name, trait_spec, value) class SmoothOutputSpec(TraitedSpec): smoothed_file = File(exists=True) @@ -191,29 +179,33 @@ class Smooth(FSLCommand): output_spec = SmoothOutputSpec _cmd = 'fslmaths' - def _format_arg(self, name, trait_spec, value): - if name == 'fwhm': - sigma = float(value) / np.sqrt(8 * np.log(2)) - return super(Smooth, self)._format_arg(name, trait_spec, sigma) - return super(Smooth, self)._format_arg(name, trait_spec, value) - class MergeInputSpec(FSLCommandInputSpec): - in_files = traits.List(File(exists=True), argstr="%s", position=2, + in_files = traits.List(File(exists=True), argstr='%s', position=2, mandatory=True) - dimension = traits.Enum('t', 'x', 'y', 'z', 'a', argstr="-%s", position=0, - desc=("dimension along which to merge, optionally " - "set tr input when dimension is t"), - mandatory=True) + dimension = traits.Enum( + 't', 'x', 'y', 'z', 'a', argstr='-%s', position=0, mandatory=True, + desc='dimension along which to merge, optionally set tr input when' + ' dimension is t') tr = traits.Float(position=-1, argstr='%.2f', - desc=('use to specify TR in seconds (default is 1.00 ' - 'sec), overrides dimension and sets it to tr')) - merged_file = File(argstr="%s", position=1, name_source='in_files', - name_template='%s_merged', hash_files=False) + desc='use to specify TR in seconds (default is 1.00 sec), ' + 'overrides dimension and sets it to tr') + merged_file = GenFile(template='{in_files[0]}_merged', argstr='%s', position=1, + hash_files=False, desc='output, merged file') + def _format_arg(self, name, spec, value): + if name == 'tr': + if self.dimension != 't': + raise ValueError('When TR is specified, dimension must be t') + return spec.argstr % value + if name == 'dimension': + if isdefined(self.tr): + return '-tr' + return spec.argstr % value + return super(MergeInputSpec, self)._format_arg(name, spec, value) class MergeOutputSpec(TraitedSpec): - merged_file = File(exists=True) + merged_file = File(exists=True, desc='output, merged file') class Merge(FSLCommand): @@ -247,40 +239,34 @@ class Merge(FSLCommand): input_spec = MergeInputSpec output_spec = MergeOutputSpec - def _format_arg(self, name, spec, value): - if name == 'tr': - if self.inputs.dimension != 't': - raise ValueError('When TR is specified, dimension must be t') - return spec.argstr % value - if name == 'dimension': - if isdefined(self.inputs.tr): - return '-tr' - return spec.argstr % value - return super(Merge, self)._format_arg(name, spec, value) - class ExtractROIInputSpec(FSLCommandInputSpec): - in_file = File(exists=True, argstr="%s", - position=0, desc="input file", mandatory=True) - roi_file = File(argstr="%s", position=1, - desc="output file", genfile=True, hash_files=False) - x_min = traits.Int(argstr="%d", position=2) - x_size = traits.Int(argstr="%d", position=3) - y_min = traits.Int(argstr="%d", position=4) - y_size = traits.Int(argstr="%d", position=5) - z_min = traits.Int(argstr="%d", position=6) - z_size = traits.Int(argstr="%d", position=7) - t_min = traits.Int(argstr="%d", position=8) - t_size = traits.Int(argstr="%d", position=9) + in_file = File(exists=True, argstr='%s', + position=0, desc='input file', mandatory=True) + roi_file = File(template='{in_file}_roi{output_type_}', + argstr='%s', position=1, hash_files=False, + desc='output file') + x_min = traits.Int(argstr='%d', position=2) + x_size = traits.Int(argstr='%d', position=3) + y_min = traits.Int(argstr='%d', position=4) + y_size = traits.Int(argstr='%d', position=5) + z_min = traits.Int(argstr='%d', position=6) + z_size = traits.Int(argstr='%d', position=7) + t_min = traits.Int(argstr='%d', position=8) + t_size = traits.Int(argstr='%d', position=9) _crop_xor = ['x_min', 'x_size', 'y_min', 'y_size', 'z_min', 'z_size', 't_min', 't_size'] crop_list = traits.List(traits.Tuple(traits.Int, traits.Int), - argstr="%s", position=2, xor=_crop_xor, - desc="list of two tuples specifying crop options") + argstr='%s', position=2, xor=_crop_xor, + desc='list of two tuples specifying crop options') + def _format_arg(self, name, spec, value): + if name == 'crop_list': + return ' '.join(map(str, sum(list(map(list, value)), []))) + return super(ExtractROIInputSpec, self)._format_arg(name, spec, value) class ExtractROIOutputSpec(TraitedSpec): - roi_file = File(exists=True) + roi_file = File(exists=True, desc='output file') class ExtractROI(FSLCommand): @@ -300,11 +286,12 @@ class ExtractROI(FSLCommand): -------- >>> from nipype.interfaces.fsl import ExtractROI - >>> from nipype.testing import anatfile - >>> fslroi = ExtractROI(in_file=anatfile, roi_file='bar.nii', t_min=0, - ... t_size=1) - >>> fslroi.cmdline == 'fslroi %s bar.nii 0 1' % anatfile - True + >>> fslroi = ExtractROI() + >>> fslroi.inputs.in_file = 'functional.nii' + >>> fslroi.inputs.t_min = 0 + >>> fslroi.inputs.t_size = 1 + >>> fslroi.cmdline + 'fslroi functional.nii functional_roi.nii.gz 0 1' """ @@ -313,48 +300,14 @@ class ExtractROI(FSLCommand): input_spec = ExtractROIInputSpec output_spec = ExtractROIOutputSpec - def _format_arg(self, name, spec, value): - - if name == "crop_list": - return " ".join(map(str, sum(list(map(list, value)), []))) - return super(ExtractROI, self)._format_arg(name, spec, value) - - def _post_run(self): - """Create a Bunch which contains all possible files generated - by running the interface. Some files are always generated, others - depending on which ``inputs`` options are set. - - - Returns - ------- - - outputs : Bunch object - Bunch object containing all possible files generated by - interface object. - - If None, file was not generated - Else, contains path, filename of generated outputfile - - """ - self.outputs.roi_file = self.inputs.roi_file - if not isdefined(self.outputs.roi_file): - self.outputs.roi_file = self._gen_fname(self.inputs.in_file, - suffix='_roi') - self.outputs.roi_file = os.path.abspath(self.outputs.roi_file) - - def _gen_filename(self, name): - if name == 'roi_file': - return getattr(self.outputs, name) - return None - class SplitInputSpec(FSLCommandInputSpec): - in_file = File(exists=True, argstr="%s", position=0, mandatory=True, - desc="input filename") - out_base_name = traits.Str(argstr="%s", position=1, desc="outputs prefix") - dimension = traits.Enum('t', 'x', 'y', 'z', argstr="-%s", position=2, + in_file = File(exists=True, argstr='%s', position=0, mandatory=True, + desc='input filename') + out_base_name = traits.Str(argstr='%s', position=1, desc='outputs prefix') + dimension = traits.Enum('t', 'x', 'y', 'z', argstr='-%s', position=2, mandatory=True, - desc="dimension along which the file will be split") + desc='dimension along which the file will be split') class SplitOutputSpec(TraitedSpec): @@ -370,40 +323,27 @@ class Split(FSLCommand): output_spec = SplitOutputSpec def _post_run(self): - """Create a Bunch which contains all possible files generated - by running the interface. Some files are always generated, others - depending on which ``inputs`` options are set. - - Returns - ------- - - outputs : Bunch object - Bunch object containing all possible files generated by - interface object. - - If None, file was not generated - Else, contains path, filename of generated outputfile - - """ - ext = Info.output_type_to_ext(self.inputs.output_type) + ext = self.inputs.output_type_ outbase = 'vol*' if isdefined(self.inputs.out_base_name): outbase = '%s*' % self.inputs.out_base_name self.outputs.out_files = sorted(glob(os.path.join(os.getcwd(), - outbase + ext))) + outbase + ext))) class ImageMathsInputSpec(FSLCommandInputSpec): - in_file = File(exists=True, argstr="%s", mandatory=True, position=1) - in_file2 = File(exists=True, argstr="%s", position=3) - out_file = File(argstr="%s", position=4, genfile=True, hash_files=False) - op_string = traits.Str(argstr="%s", position=2, - desc="string defining the operation, i. e. -add") - suffix = traits.Str(desc="out_file suffix") - out_data_type = traits.Enum('char', 'short', 'int', 'float', 'double', - 'input', argstr="-odt %s", position=5, - desc=("output datatype, one of (char, short, " - "int, float, double, input)")) + in_file = File(exists=True, argstr='%s', mandatory=True, position=1) + in_file2 = File(exists=True, argstr='%s', position=3) + out_file = GenFile( + template='{in_file}_maths{output_type_}', argstr='%s', position=4, + hash_files=False) + op_string = traits.Str(argstr='%s', position=2, + desc='string defining the operation, i. e. -add') + suffix = traits.Str(desc='out_file suffix', deprecated=True) + out_data_type = traits.Enum('char', 'short', 'int', 'float', 'double', 'input', + argstr='-odt %s', position=5, + desc='output datatype, one of (char, short, ' + 'int, float, double, input)') class ImageMathsOutputSpec(TraitedSpec): @@ -420,66 +360,60 @@ class ImageMaths(FSLCommand): >>> from nipype.interfaces import fsl >>> from nipype.testing import anatfile - >>> maths = fsl.ImageMaths(in_file=anatfile, op_string= '-add 5', - ... out_file='foo_maths.nii') - >>> maths.cmdline == 'fslmaths %s -add 5 foo_maths.nii' % anatfile - True + >>> maths = fsl.ImageMaths() + >>> maths.inputs.in_file = anatomical.nii + >>> maths.inputs.op_string= '-add 5' + >>> maths.cmdline + 'fslmaths anatomical.nii -add 5 anatomical_maths.nii.gz' """ input_spec = ImageMathsInputSpec output_spec = ImageMathsOutputSpec - _cmd = 'fslmaths' - def _gen_filename(self, name): - if name == 'out_file': - return getattr(self.outputs, name) - return None - - def parse_args(self, skip=None): - return super(ImageMaths, self).parse_args(skip=['suffix']) - - def _post_run(self): - suffix = '_maths' # ohinds: build suffix - if isdefined(self.inputs.suffix): - suffix = self.inputs.suffix - - if not isdefined(self.outputs.out_file): - self.outputs.out_file = self._gen_fname(self.inputs.in_file, - suffix=suffix) - self.outputs.out_file = os.path.abspath(self.outputs.out_file) - class FilterRegressorInputSpec(FSLCommandInputSpec): - in_file = File(exists=True, argstr="-i %s", - desc="input file name (4D image)", mandatory=True, + in_file = File(exists=True, argstr='-i %s', + desc='input file name (4D image)', mandatory=True, position=1) - out_file = File(argstr="-o %s", - desc="output file name for the filtered data", - genfile=True, position=2, hash_files=False) - design_file = File(exists=True, argstr="-d %s", position=3, mandatory=True, - desc=("name of the matrix with time courses (e.g. GLM " - "design or MELODIC mixing matrix)")) - filter_columns = traits.List(traits.Int, argstr="-f '%s'", - xor=["filter_all"], mandatory=True, + out_file = File(template='{in_file}_regfilt{output_type_}', + argstr='-o %s', position=2, hash_files=False, + desc='output file name for the filtered data') + design_file = File(exists=True, argstr='-d %s', position=3, mandatory=True, + desc='name of the matrix with time courses (e.g. GLM ' + 'design or MELODIC mixing matrix)') + filter_columns = traits.List(traits.Int, argstr='-f \'%s\'', + xor=['filter_all'], mandatory=True, position=4, - desc=("(1-based) column indices to filter out " - "of the data")) - filter_all = traits.Bool(mandatory=True, argstr="-f '%s'", - xor=["filter_columns"], position=4, - desc=("use all columns in the design file in " - "denoising")) - mask = File(exists=True, argstr="-m %s", desc="mask image file name") - var_norm = traits.Bool(argstr="--vn", - desc="perform variance-normalization on data") - out_vnscales = traits.Bool(argstr="--out_vnscales", - desc=("output scaling factors for variance " - "normalization")) + desc='(1-based) column indices to filter out ' + 'of the data') + filter_all = traits.Bool(mandatory=True, argstr='-f \'%s\'', + xor=['filter_columns'], position=4, + desc='use all columns in the design file in ' + 'denoising') + mask = File(exists=True, argstr='-m %s', desc='mask image file name') + var_norm = traits.Bool(argstr='--vn', + desc='perform variance-normalization on data') + out_vnscales = traits.Bool(argstr='--out_vnscales', + desc='output scaling factors for variance ' + 'normalization') + + def _format_arg(self, name, trait_spec, value): + if name == 'filter_columns': + return trait_spec.argstr % ','.join(map(str, value)) + elif name == 'filter_all': + design = np.loadtxt(self.design_file) + try: + n_cols = design.shape[1] + except IndexError: + n_cols = 1 + return trait_spec.argstr % ','.join(map(str, list(range(1, n_cols + 1)))) + return super(FilterRegressorInputSpec, self)._format_arg(name, trait_spec, value) class FilterRegressorOutputSpec(TraitedSpec): - out_file = File(exists=True, desc="output file name for the filtered data") + out_file = File(exists=True, desc='output file name for the filtered data') class FilterRegressor(FSLCommand): @@ -491,46 +425,33 @@ class FilterRegressor(FSLCommand): output_spec = FilterRegressorOutputSpec _cmd = 'fsl_regfilt' - def _format_arg(self, name, trait_spec, value): - if name == 'filter_columns': - return trait_spec.argstr % ",".join(map(str, value)) - elif name == "filter_all": - design = np.loadtxt(self.inputs.design_file) - try: - n_cols = design.shape[1] - except IndexError: - n_cols = 1 - return trait_spec.argstr % ",".join(map(str, list(range(1, n_cols + 1)))) - return super(FilterRegressor, self)._format_arg(name, trait_spec, value) - - def _post_run(self): - - self.outputs.out_file = self.inputs.out_file - if not isdefined(self.outputs.out_file): - self.outputs.out_file = self._gen_fname( - self.inputs.in_file, suffix='_regfilt') - self.outputs.out_file = os.path.abspath(self.outputs.out_file) - - def _gen_filename(self, name): - if name == 'out_file': - return getattr(self.outputs, name) - return None - class ImageStatsInputSpec(FSLCommandInputSpec): split_4d = traits.Bool(argstr='-t', position=1, - desc=('give a separate output line for each 3D ' - 'volume of a 4D timeseries')) - in_file = File(exists=True, argstr="%s", mandatory=True, position=2, + desc='give a separate output line for each 3D ' + 'volume of a 4D timeseries') + in_file = File(exists=True, argstr='%s', mandatory=True, position=2, desc='input file to generate stats of') - op_string = traits.Str(argstr="%s", mandatory=True, position=3, - desc=("string defining the operation, options are " - "applied in order, e.g. -M -l 10 -M will " - "report the non-zero mean, apply a threshold " - "and then report the new nonzero mean")) - mask_file = File(exists=True, argstr="", + op_string = traits.Str(argstr='%s', mandatory=True, position=3, + desc='string defining the operation, options are ' + 'applied in order, e.g. -M -l 10 -M will ' + 'report the non-zero mean, apply a threshold ' + 'and then report the new nonzero mean') + mask_file = File(exists=True, argstr='-k %s', desc='mask file used for option -k %s') + def _format_arg(self, name, trait_spec, value): + if name == 'mask_file': + return '' + if name == 'op_string': + if '-k %s' in value: + if isdefined(self.mask_file): + return self.op_string % self.mask_file + else: + raise ValueError( + '-k %s option in op_string requires mask_file') + return super(ImageStatsInputSpec, self)._format_arg(name, trait_spec, value) + class ImageStatsOutputSpec(TraitedSpec): out_stat = traits.Any(desc='stats output') @@ -558,17 +479,7 @@ class ImageStats(FSLCommand): _cmd = 'fslstats' - def _format_arg(self, name, trait_spec, value): - if name == 'mask_file': - return '' - if name == 'op_string': - if '-k %s' in self.inputs.op_string: - if isdefined(self.inputs.mask_file): - return self.inputs.op_string % self.inputs.mask_file - else: - raise ValueError( - '-k %s option in op_string requires mask_file') - return super(ImageStats, self)._format_arg(name, trait_spec, value) + def aggregate_outputs(self, runtime=None, needed_outputs=None): outputs = self._outputs() @@ -595,7 +506,7 @@ def aggregate_outputs(self, runtime=None, needed_outputs=None): class AvScaleInputSpec(FSLCommandInputSpec): - mat_file = File(exists=True, argstr="%s", + mat_file = File(exists=True, argstr='%s', desc='mat file to read', position=0) @@ -645,11 +556,11 @@ def lines_to_float(lines): out = runtime.stdout.split('\n') outputs.rotation_translation_matrix = lines_to_float(out[1:5]) - outputs.scales = lines_to_float([out[6].split(" = ")[1]]) - outputs.skews = lines_to_float([out[8].split(" = ")[1]]) - outputs.average_scaling = lines_to_float([out[10].split(" = ")[1]]) - outputs.determinant = lines_to_float([out[12].split(" = ")[1]]) - if out[13].split(": ")[1] == 'preserved': + outputs.scales = lines_to_float([out[6].split(' = ')[1]]) + outputs.skews = lines_to_float([out[8].split(' = ')[1]]) + outputs.average_scaling = lines_to_float([out[10].split(' = ')[1]]) + outputs.determinant = lines_to_float([out[12].split(' = ')[1]]) + if out[13].split(': ')[1] == 'preserved': outputs.left_right_orientation_preserved = True else: outputs.left_right_orientation_preserved = False @@ -670,8 +581,8 @@ class OverlayInputSpec(FSLCommandInputSpec): background_image = File(exists=True, position=4, mandatory=True, argstr='%s', desc='image to use as background') _xor_inputs = ('auto_thresh_bg', 'full_bg_range', 'bg_thresh') - auto_thresh_bg = traits.Bool(desc=('automatically threshold the background ' - 'image'), + auto_thresh_bg = traits.Bool(desc='automatically threshold the background ' + 'image', argstr='-a', position=5, xor=_xor_inputs, mandatory=True) full_bg_range = traits.Bool(desc='use full range of background image', @@ -685,20 +596,38 @@ class OverlayInputSpec(FSLCommandInputSpec): desc='statistical image to overlay in color') stat_thresh = traits.Tuple(traits.Float, traits.Float, position=7, mandatory=True, argstr='%.2f %.2f', - desc=('min and max values for the statistical ' - 'overlay')) - show_negative_stats = traits.Bool(desc=('display negative statistics in ' - 'overlay'), xor=['stat_image2'], + desc='min and max values for the statistical ' + 'overlay') + show_negative_stats = traits.Bool(desc='display negative statistics in ' + 'overlay', xor=['stat_image2'], argstr='%s', position=8) stat_image2 = File(exists=True, position=9, xor=['show_negative_stats'], argstr='%s', desc='second statistical image to overlay in color') stat_thresh2 = traits.Tuple(traits.Float, traits.Float, position=10, - desc=('min and max values for second ' - 'statistical overlay'), + desc='min and max values for second ' + 'statistical overlay', argstr='%.2f %.2f') - out_file = File(desc='combined image volume', - position=-1, argstr='%s', genfile=True, hash_files=False) + out_file = GenFile(template='overlay{output_type_}', position=-1, argstr='%s', + hash_files=False, desc='combined image volume') + + + def _format_arg(self, name, spec, value): + if name == 'transparency': + if value: + return '1' + else: + return '0' + if name == 'out_type': + if value == 'float': + return '0' + else: + return '1' + if name == 'show_negative_stats': + return '%s %.2f %.2f' % (self.stat_image, + self.stat_thresh[0] * -1, + self.stat_thresh[1] * -1) + return super(OverlayInputSpec, self)._format_arg(name, spec, value) class OverlayOutputSpec(TraitedSpec): @@ -720,6 +649,8 @@ class Overlay(FSLCommand): >>> combine.inputs.stat_image = 'zstat1.nii.gz' >>> combine.inputs.stat_thresh = (3.5, 10) >>> combine.inputs.show_negative_stats = True + >>> combine.cmdline + '' >>> res = combine.run() #doctest: +SKIP @@ -728,91 +659,65 @@ class Overlay(FSLCommand): input_spec = OverlayInputSpec output_spec = OverlayOutputSpec - def _format_arg(self, name, spec, value): - if name == 'transparency': - if value: - return '1' - else: - return '0' - if name == 'out_type': - if value == 'float': - return '0' - else: - return '1' - if name == 'show_negative_stats': - return '%s %.2f %.2f' % (self.inputs.stat_image, - self.inputs.stat_thresh[0] * -1, - self.inputs.stat_thresh[1] * -1) - return super(Overlay, self)._format_arg(name, spec, value) - - def _post_run(self): - out_file = self.inputs.out_file - if not isdefined(out_file): - if isdefined(self.inputs.stat_image2) and ( - not isdefined(self.inputs.show_negative_stats) or not - self.inputs.show_negative_stats): - stem = "%s_and_%s" % (split_filename(self.inputs.stat_image)[1], - split_filename(self.inputs.stat_image2)[1]) - else: - stem = split_filename(self.inputs.stat_image)[1] - out_file = self._gen_fname(stem, suffix='_overlay') - self.outputs.out_file = os.path.abspath(out_file) - - def _gen_filename(self, name): - if name == 'out_file': - return self.outputs.out_file - return None - class SlicerInputSpec(FSLCommandInputSpec): in_file = File(exists=True, position=1, argstr='%s', mandatory=True, desc='input volume') image_edges = File(exists=True, position=2, argstr='%s', - desc=('volume to display edge overlay for (useful for ' - 'checking registration')) + desc='volume to display edge overlay for (useful for ' + 'checking registration') label_slices = traits.Bool( - position=3, argstr='-L', desc='display slice number', - usedefault=True, default_value=True) + True, position=3, argstr='-L', desc='display slice number', + usedefault=True, mandatory=True) colour_map = File(exists=True, position=4, argstr='-l %s', - desc=('use different colour map from that stored in ' - 'nifti header')) + desc='use different colour map from that stored in ' + 'nifti header') intensity_range = traits.Tuple(traits.Float, traits.Float, position=5, argstr='-i %.3f %.3f', desc='min and max intensities to display') threshold_edges = traits.Float(position=6, argstr='-e %.3f', desc='use threshold for edges') dither_edges = traits.Bool(position=7, argstr='-t', - desc=('produce semi-transparent (dithered) ' - 'edges')) + desc='produce semi-transparent (dithered) ' + 'edges') nearest_neighbour = traits.Bool(position=8, argstr='-n', - desc=('use nearest neighbor interpolation ' - 'for output')) - show_orientation = traits.Bool(position=9, argstr='%s', usedefault=True, - default_value=True, + desc='use nearest neighbor interpolation ' + 'for output') + hide_orientation = traits.Bool(False, position=9, argstr='-u', usedefault=True, desc='label left-right orientation') + show_orientation = traits.Bool(True, position=9, deprecated=True, + new_name='hide_orientation') + _xor_options = ('single_slice', 'middle_slices', 'all_axial', 'sample_axial') single_slice = traits.Enum('x', 'y', 'z', position=10, argstr='-%s', xor=_xor_options, requires=['slice_number'], - desc=('output picture of single slice in the x, ' - 'y, or z plane')) + desc='output picture of single slice in the x, ' + 'y, or z plane') slice_number = traits.Int(position=11, argstr='-%d', desc='slice number to save in picture') middle_slices = traits.Bool(position=10, argstr='-a', xor=_xor_options, - desc=('output picture of mid-sagittal, axial, ' - 'and coronal slices')) + desc='output picture of mid-sagittal, axial, ' + 'and coronal slices') all_axial = traits.Bool(position=10, argstr='-A', xor=_xor_options, requires=['image_width'], desc='output all axial slices into one picture') sample_axial = traits.Int(position=10, argstr='-S %d', xor=_xor_options, requires=['image_width'], - desc=('output every n axial slices into one ' - 'picture')) + desc='output every n axial slices into one ' + 'picture') image_width = traits.Int(position=-2, argstr='%d', desc='max picture width') - out_file = File(position=-1, genfile=True, argstr='%s', - desc='picture to write', hash_files=False) scaling = traits.Float(position=0, argstr='-s %f', desc='image scale') + out_file = GenFile(template='{in_file}.png', position=-1, argstr='%s', + desc='picture to write', hash_files=False) + + + def _format_arg(self, name, spec, value): + if name == 'show_orientation': + return None if value else '-u' + return super(Slicer, self)._format_arg(name, spec, value) + class SlicerOutputSpec(TraitedSpec): out_file = File(exists=True, desc='picture to write') @@ -826,11 +731,12 @@ class Slicer(FSLCommand): -------- >>> from nipype.interfaces import fsl - >>> from nipype.testing import example_data >>> slice = fsl.Slicer() - >>> slice.inputs.in_file = example_data('functional.nii') + >>> slice.inputs.in_file = 'functional.nii' >>> slice.inputs.all_axial = True >>> slice.inputs.image_width = 750 + >>> slice.cmdline + '' >>> res = slice.run() #doctest: +SKIP @@ -839,71 +745,46 @@ class Slicer(FSLCommand): input_spec = SlicerInputSpec output_spec = SlicerOutputSpec - def _format_arg(self, name, spec, value): - if name == 'show_orientation': - if value: - return '' - else: - return '-u' - elif name == "label_slices": - if value: - return '-L' - else: - return '' - return super(Slicer, self)._format_arg(name, spec, value) - - def _post_run(self): - out_file = self.inputs.out_file - if not isdefined(out_file): - out_file = self._gen_fname(self.inputs.in_file, ext='.png') - self.outputs.out_file = os.path.abspath(out_file) - - def _gen_filename(self, name): - if name == 'out_file': - return self.outputs.out_file - return None - class PlotTimeSeriesInputSpec(FSLCommandInputSpec): - in_file = traits.Either(File(exists=True), traits.List(File(exists=True)), - mandatory=True, argstr="%s", position=1, - desc=("file or list of files with columns of " - "timecourse information")) - plot_start = traits.Int(argstr="--start=%d", xor=("plot_range",), - desc="first column from in-file to plot") - plot_finish = traits.Int(argstr="--finish=%d", xor=("plot_range",), - desc="final column from in-file to plot") - plot_range = traits.Tuple(traits.Int, traits.Int, argstr="%s", - xor=("plot_start", "plot_finish"), - desc=("first and last columns from the in-file " - "to plot")) - title = traits.Str(argstr="%s", desc="plot title") - legend_file = File(exists=True, argstr="--legend=%s", desc="legend file") - labels = traits.Either(traits.Str, traits.List(traits.Str), - argstr="%s", desc="label or list of labels") - y_min = traits.Float(argstr="--ymin=%.2f", desc="minumum y value", - xor=("y_range",)) - y_max = traits.Float(argstr="--ymax=%.2f", desc="maximum y value", - xor=("y_range",)) - y_range = traits.Tuple(traits.Float, traits.Float, argstr="%s", - xor=("y_min", "y_max"), - desc="min and max y axis values") - x_units = traits.Int(argstr="-u %d", usedefault=True, default_value=1, - desc=("scaling units for x-axis (between 1 and length " - "of in file)")) - plot_size = traits.Tuple(traits.Int, traits.Int, argstr="%s", - desc="plot image height and width") - x_precision = traits.Int(argstr="--precision=%d", - desc="precision of x-axis labels") - sci_notation = traits.Bool(argstr="--sci", - desc="switch on scientific notation") - out_file = File(argstr="-o %s", genfile=True, - desc="image to write", hash_files=False) + in_file = InputMultiPath( + File(exists=True), sep=',', mandatory=True, argstr='%s', position=1, + desc='file or list of files with columns of timecourse information') + plot_start = traits.Int(argstr='--start=%d', xor=['plot_range'], + desc='first column from in-file to plot') + plot_finish = traits.Int(argstr='--finish=%d', xor=['plot_range',], + desc='final column from in-file to plot') + plot_range = traits.Tuple( + traits.Int, traits.Int, argstr='--start=%d --finish=%d', + xor=['plot_start', 'plot_finish'], + desc='first and last columns from the in-file to plot') + title = traits.Str(argstr='-t \'%s\'', desc='plot title') + legend_file = File(exists=True, argstr='--legend=%s', desc='legend file') + labels = traits.Either(traits.Str, traits.List(traits.Str), sep=',', + argstr='-a %s', desc='label or list of labels') + y_min = traits.Float(argstr="--ymin=%.2f", desc='minumum y value', + xor=['y_range']) + y_max = traits.Float(argstr="--ymax=%.2f", desc='maximum y value', + xor=['y_range']) + y_range = traits.Tuple( + traits.Float, traits.Float, argstr='--ymin=%.2f --ymax=%.2f', + xor=['y_min', 'y_max'], desc='min and max y axis values') + x_units = traits.Int(argstr='-u %d', usedefault=True, default_value=1, + desc='scaling units for x-axis (between 1 and length ' + 'of in file)') + plot_size = traits.Tuple( + traits.Int, traits.Int, argstr='-h %d -w %d', + desc='plot image height and width') + x_precision = traits.Int(argstr='--precision=%d', + desc='precision of x-axis labels') + sci_notation = traits.Bool(argstr='--sci', + desc='switch on scientific notation') + out_file = File(template='{in_file}.png', argstr='-o %s', + desc='image to write', hash_files=False) class PlotTimeSeriesOutputSpec(TraitedSpec): - out_file = File(exists=True, desc='image to write') @@ -915,76 +796,66 @@ class PlotTimeSeries(FSLCommand): >>> import nipype.interfaces.fsl as fsl >>> plotter = fsl.PlotTimeSeries() - >>> plotter.inputs.in_file = 'functional.par' + >>> plotter.inputs.in_file = ['functional.par', 'functional.par'] >>> plotter.inputs.title = 'Functional timeseries' >>> plotter.inputs.labels = ['run1', 'run2'] + >>> plotter.cmdline + 'fsl_tsplot functional.par,functional.par -a run1,run2 -t 'Functional timeseries' -u 1' >>> plotter.run() #doctest: +SKIP """ - _cmd = "fsl_tsplot" + _cmd = 'fsl_tsplot' input_spec = PlotTimeSeriesInputSpec output_spec = PlotTimeSeriesOutputSpec + +class PlotMotionParamsInputSpec(FSLCommandInputSpec): + in_file = InputMultiPath( + File(exists=True), mandatory=True, argstr='-i %s', sep=',', position=1, + desc='file with motion parameters') + in_source = traits.Enum('spm', 'fsl', mandatory=True, + desc='which program generated the motion ' + 'parameter file - fsl, spm') + plot_type = traits.Enum('rotations', 'translations', 'displacement', + argstr='%s', mandatory=True, + desc='which motion type to plot - rotations, ' + 'translations, displacement') + plot_size = traits.Tuple(traits.Int, traits.Int, argstr='-h %d -w %d', + desc='plot image height and width') + out_file = File(template='{in_file}_{plot_type[:5]}.png', argstr='-o %s', + desc='image to write', hash_files=False) + + def _format_arg(self, name, spec, value): - if name == "in_file": - if isinstance(value, list): - args = ",".join(value) - return "-i %s" % args - else: - return "-i %s" % value - elif name == "labels": - if isinstance(value, list): - args = ",".join(value) - return "-a %s" % args - else: - return "-a %s" % value - elif name == "title": - return "-t \'%s\'" % value - elif name == "plot_range": - return "--start=%d --finish=%d" % value - elif name == "y_range": - return "--ymin=%d --ymax=%d" % value - elif name == "plot_size": - return "-h %d -w %d" % value - return super(PlotTimeSeries, self)._format_arg(name, spec, value) - def _post_run(self): - out_file = self.inputs.out_file - if not isdefined(out_file): - if isinstance(self.inputs.in_file, list): - infile = self.inputs.in_file[0] - else: - infile = self.inputs.in_file - out_file = self._gen_fname(infile, ext='.png') - self.outputs.out_file = os.path.abspath(out_file) + if name == 'plot_type': + source = self.in_source - def _gen_filename(self, name): - if name == 'out_file': - return self.outputs.out_file - return None + if self.plot_type == 'displacement': + title = '-t \'MCFLIRT estimated mean displacement (mm)\'' + labels = '-a abs,rel' + return '%s %s' % (title, labels) + # Get the right starting and ending position depending on source + # package + sfdict = dict(fsl_rot=(1, 3), fsl_tra=( + 4, 6), spm_rot=(4, 6), spm_tra=(1, 3)) -class PlotMotionParamsInputSpec(FSLCommandInputSpec): + # Format the title properly + sfstr = "--start=%d --finish=%d" % sfdict[ + '%s_%s' % (source, value[:3])] + titledict = dict(fsl='MCFLIRT', spm='Realign') + unitdict = dict(rot='radians', tra='mm') + + title = "\'%s estimated %s (%s)\'" % ( + titledict[source], value, unitdict[value[:3]]) - in_file = traits.Either(File(exists=True), traits.List(File(exists=True)), - mandatory=True, argstr="%s", position=1, - desc="file with motion parameters") - in_source = traits.Enum("spm", "fsl", mandatory=True, - desc=("which program generated the motion " - "parameter file - fsl, spm")) - plot_type = traits.Enum("rotations", "translations", "displacement", - argstr="%s", mandatory=True, - desc=("which motion type to plot - rotations, " - "translations, displacement")) - plot_size = traits.Tuple(traits.Int, traits.Int, argstr="%s", - desc="plot image height and width") - out_file = File(argstr="-o %s", genfile=True, - desc="image to write", hash_files=False) + return '-t %s %s -a x,y,z' % (title, sfstr) + return super(PlotMotionParamsInputSpec, self)._format_arg(name, spec, value) class PlotMotionParamsOutputSpec(TraitedSpec): - out_file = File(exists=True, desc='image to write') @@ -1001,6 +872,7 @@ class PlotMotionParams(FSLCommand): >>> plotter.inputs.in_file = 'functional.par' >>> plotter.inputs.in_source = 'fsl' >>> plotter.inputs.plot_type = 'rotations' + >>> plotter.cmdline >>> res = plotter.run() #doctest: +SKIP @@ -1019,84 +891,51 @@ class PlotMotionParams(FSLCommand): input_spec = PlotMotionParamsInputSpec output_spec = PlotMotionParamsOutputSpec - def _format_arg(self, name, spec, value): - - if name == "plot_type": - source = self.inputs.in_source - if self.inputs.plot_type == 'displacement': - title = '-t \'MCFLIRT estimated mean displacement (mm)\'' - labels = '-a abs,rel' - return '%s %s' % (title, labels) - - # Get the right starting and ending position depending on source - # package - sfdict = dict(fsl_rot=(1, 3), fsl_tra=( - 4, 6), spm_rot=(4, 6), spm_tra=(1, 3)) - - # Format the title properly - sfstr = "--start=%d --finish=%d" % sfdict[ - "%s_%s" % (source, value[:3])] - titledict = dict(fsl="MCFLIRT", spm="Realign") - unitdict = dict(rot="radians", tra="mm") - - title = "\'%s estimated %s (%s)\'" % ( - titledict[source], value, unitdict[value[:3]]) - - return "-t %s %s -a x,y,z" % (title, sfstr) - elif name == "plot_size": - return "-h %d -w %d" % value - elif name == "in_file": - if isinstance(value, list): - args = ",".join(value) - return "-i %s" % args - else: - return "-i %s" % value - - return super(PlotMotionParams, self)._format_arg(name, spec, value) - - def _post_run(self): - out_file = self.inputs.out_file - if not isdefined(out_file): - if isinstance(self.inputs.in_file, list): - infile = self.inputs.in_file[0] - else: - infile = self.inputs.in_file - plttype = dict(rot="rot", tra="trans", dis="disp")[ - self.inputs.plot_type[:3]] - out_file = fname_presuffix( - infile, suffix="_%s.png" % plttype, use_ext=False) - self.outputs.out_file = os.path.abspath(out_file) +class ConvertXFMInputSpec(FSLCommandInputSpec): + in_file = File(exists=True, mandatory=True, argstr='%s', position=-1, + desc='input transformation matrix') + in_file2 = File(exists=True, argstr='%s', position=-2, + desc='second input matrix (for use with fix_scale_skew or ' + 'concat_xfm') + operation = traits.Enum( + 'invert', 'concat', 'fixscaleskew', usedefault=True, mandatory=True, + argstr='-%s', position=-3, desc='operation mode') + + _options = ['invert_xfm', 'concat_xfm', 'fix_scale_skew'] + invert_xfm = traits.Bool(argstr='-inverse', position=-3, xor=_options, + desc='invert input transformation') + concat_xfm = traits.Bool(argstr='-concat', position=-3, xor=_options, + requires=['in_file2'], + desc='write joint transformation of two input ' + 'matrices') + fix_scale_skew = traits.Bool(argstr='-fixscaleskew', position=-3, + xor=_options, requires=['in_file2'], + desc='use secondary matrix to fix scale and ' + 'skew') + out_file = File(template='{in_file}_{operation[:5]}.mat', argstr='-omat %s', position=1, + desc='final transformation matrix', hash_files=False) - def _gen_filename(self, name): - if name == 'out_file': - return self.outputs.out_file - return None + def parse_args(self, skip=None): + if skip is None: + skip = [] + if isdefined(self.inputs.invert_xfm) and self.inputs.invert_xfm: + self.inputs.invert_xfm = Undefined + self.inputs.operation = 'invert' + if isdefined(self.inputs.concat_xfm) and self.inputs.concat_xfm: + self.inputs.concat_xfm = Undefined + self.inputs.operation = 'concat' + if isdefined(self.inputs.fix_scale_skew) and self.inputs.fix_scale_skew: + self.inputs.fix_scale_skew = Undefined + self.inputs.operation = 'fixscaleskew' -class ConvertXFMInputSpec(FSLCommandInputSpec): - in_file = File(exists=True, mandatory=True, argstr="%s", position=-1, - desc="input transformation matrix") - in_file2 = File(exists=True, argstr="%s", position=-2, - desc=("second input matrix (for use with fix_scale_skew or " - "concat_xfm")) - _options = ["invert_xfm", "concat_xfm", "fix_scale_skew"] - invert_xfm = traits.Bool(argstr="-inverse", position=-3, xor=_options, - desc="invert input transformation") - concat_xfm = traits.Bool(argstr="-concat", position=-3, xor=_options, - requires=["in_file2"], - desc=("write joint transformation of two input " - "matrices")) - fix_scale_skew = traits.Bool(argstr="-fixscaleskew", position=-3, - xor=_options, requires=["in_file2"], - desc=("use secondary matrix to fix scale and " - "skew")) - out_file = File(genfile=True, argstr="-omat %s", position=1, - desc="final transformation matrix", hash_files=False) + skip += ['invert_xfm', 'concat_xfm', 'fix_scale_skew'] + return super(ConvertXFMInputSpec, self).parse_args(skip) class ConvertXFMOutputSpec(TraitedSpec): - out_file = File(exists=True, desc="output transformation matrix") + out_file = File(exists=True, desc='output transformation matrix') class ConvertXFM(FSLCommand): @@ -1107,65 +946,35 @@ class ConvertXFM(FSLCommand): >>> import nipype.interfaces.fsl as fsl >>> invt = fsl.ConvertXFM() - >>> invt.inputs.in_file = "flirt.mat" + >>> invt.inputs.in_file = 'flirt.mat' >>> invt.inputs.invert_xfm = True - >>> invt.inputs.out_file = 'flirt_inv.mat' >>> invt.cmdline - 'convert_xfm -omat flirt_inv.mat -inverse flirt.mat' + 'convert_xfm -omat flirt_converted.mat -inverse flirt.mat' """ - _cmd = "convert_xfm" + _cmd = 'convert_xfm' input_spec = ConvertXFMInputSpec output_spec = ConvertXFMOutputSpec - def _post_run(self): - outfile = self.inputs.out_file - if not isdefined(outfile): - _, infile1, _ = split_filename(self.inputs.in_file) - if self.inputs.invert_xfm: - outfile = fname_presuffix(infile1, - suffix="_inv.mat", - newpath=os.getcwd(), - use_ext=False) - else: - if self.inputs.concat_xfm: - _, infile2, _ = split_filename(self.inputs.in_file2) - outfile = fname_presuffix("%s_%s" % (infile1, infile2), - suffix=".mat", - newpath=os.getcwd(), - use_ext=False) - else: - outfile = fname_presuffix(infile1, - suffix="_fix.mat", - newpath=os.getcwd(), - use_ext=False) - self.outputs.out_file = os.path.abspath(outfile) - - def _gen_filename(self, name): - if name == "out_file": - return self.outputs.out_file - return None - class SwapDimensionsInputSpec(FSLCommandInputSpec): - in_file = File(exists=True, mandatory=True, argstr="%s", position="1", - desc="input image") - _dims = ["x", "-x", "y", "-y", "z", - "-z", "RL", "LR", "AP", "PA", "IS", "SI"] + in_file = File(exists=True, mandatory=True, argstr='%s', position=1, + desc='input image') + _dims = ['x', '-x', 'y', '-y', 'z', + '-z', 'RL', 'LR', 'AP', 'PA', 'IS', 'SI'] new_dims = traits.Tuple(traits.Enum(_dims), traits.Enum(_dims), - traits.Enum(_dims), argstr="%s %s %s", + traits.Enum(_dims), argstr='%s %s %s', mandatory=True, - desc="3-tuple of new dimension order") - out_file = File(genfile=True, argstr="%s", - desc="image to write", hash_files=False) + desc='3-tuple of new dimension order') + out_file = File(genfile=True, argstr='%s', + desc='image to write', hash_files=False) class SwapDimensionsOutputSpec(TraitedSpec): - - out_file = File(exists=True, desc="image with new dimensions") + out_file = File(exists=True, desc='image with new dimensions') class SwapDimensions(FSLCommand): @@ -1176,7 +985,7 @@ class SwapDimensions(FSLCommand): (-)x, (-)y, or (-z), or nifti-syle dimension codes (RL, LR, AP, PA, IS, SI). """ - _cmd = "fslswapdim" + _cmd = 'fslswapdim' input_spec = SwapDimensionsInputSpec output_spec = SwapDimensionsOutputSpec @@ -1188,7 +997,7 @@ def _post_run(self): self.outputs.out_file = os.path.abspath(self.outputs.out_file) def _gen_filename(self, name): - if name == "out_file": + if name == 'out_file': return self.outputs.out_file return None @@ -1197,7 +1006,7 @@ class PowerSpectrumInputSpec(FSLCommandInputSpec): # We use position args here as list indices - so a negative number # will put something on the end in_file = File(exists=True, - desc="input 4D file to estimate the power spectrum", + desc='input 4D file to estimate the power spectrum', argstr='%s', position=0, mandatory=True) out_file = File(desc='name of output 4D file for power spectrum', argstr='%s', position=1, genfile=True, hash_files=False) @@ -1274,7 +1083,7 @@ class SigLoss(FSLCommand): -------- >>> sigloss = SigLoss() - >>> sigloss.inputs.in_file = "phase.nii" + >>> sigloss.inputs.in_file = 'phase.nii' >>> sigloss.inputs.echo_time = 0.03 >>> res = sigloss.run() # doctest: +SKIP @@ -1299,8 +1108,8 @@ def _gen_filename(self, name): class Reorient2StdInputSpec(FSLCommandInputSpec): - in_file = File(exists=True, mandatory=True, argstr="%s") - out_file = File(genfile=True, hash_files=False, argstr="%s") + in_file = File(exists=True, mandatory=True, argstr='%s') + out_file = File(genfile=True, hash_files=False, argstr='%s') class Reorient2StdOutputSpec(TraitedSpec): @@ -1316,7 +1125,7 @@ class Reorient2Std(FSLCommand): -------- >>> reorient = Reorient2Std() - >>> reorient.inputs.in_file = "functional.nii" + >>> reorient.inputs.in_file = 'functional.nii' >>> res = reorient.run() # doctest: +SKIP @@ -1328,7 +1137,7 @@ class Reorient2Std(FSLCommand): def _gen_filename(self, name): if name == 'out_file': return self._gen_fname(self.inputs.in_file, - suffix="_reoriented") + suffix='_reoriented') return None def _post_run(self): @@ -1341,57 +1150,57 @@ def _post_run(self): class InvWarpInputSpec(FSLCommandInputSpec): warp = File(exists=True, argstr='--warp=%s', mandatory=True, - desc=('Name of file containing warp-coefficients/fields. This ' + desc='Name of file containing warp-coefficients/fields. This ' 'would typically be the output from the --cout switch of ' 'fnirt (but can also use fields, like the output from ' - '--fout).')) + '--fout).') reference = File(exists=True, argstr='--ref=%s', mandatory=True, - desc=('Name of a file in target space. Note that the ' + desc='Name of a file in target space. Note that the ' 'target space is now different from the target ' 'space that was used to create the --warp file. It ' 'would typically be the file that was specified ' - 'with the --in argument when running fnirt.')) + 'with the --in argument when running fnirt.') inverse_warp = File(argstr='--out=%s', name_source=['warp'], hash_files=False, name_template='%s_inverse', - desc=('Name of output file, containing warps that are ' - 'the "reverse" of those in --warp. This will be ' + desc='Name of output file, containing warps that are ' + 'the \'reverse\' of those in --warp. This will be ' 'a field-file (rather than a file of spline ' 'coefficients), and it will have any affine ' 'component included as part of the ' - 'displacements.')) + 'displacements.') absolute = traits.Bool(argstr='--abs', xor=['relative'], - desc=('If set it indicates that the warps in --warp ' + desc='If set it indicates that the warps in --warp ' 'should be interpreted as absolute, provided ' 'that it is not created by fnirt (which ' 'always uses relative warps). If set it also ' 'indicates that the output --out should be ' - 'absolute.')) + 'absolute.') relative = traits.Bool(argstr='--rel', xor=['absolute'], - desc=('If set it indicates that the warps in --warp ' + desc='If set it indicates that the warps in --warp ' 'should be interpreted as relative. I.e. the ' 'values in --warp are displacements from the ' 'coordinates in the --ref space. If set it ' 'also indicates that the output --out should ' - 'be relative.')) + 'be relative.') niter = traits.Int(argstr='--niter=%d', - desc=('Determines how many iterations of the ' - 'gradient-descent search that should be run.')) + desc='Determines how many iterations of the ' + 'gradient-descent search that should be run.') regularise = traits.Float(argstr='--regularise=%f', desc='Regularization strength (deafult=1.0).') noconstraint = traits.Bool(argstr='--noconstraint', desc='Do not apply Jacobian constraint') jacobian_min = traits.Float(argstr='--jmin=%f', - desc=('Minimum acceptable Jacobian value for ' - 'constraint (default 0.01)')) + desc='Minimum acceptable Jacobian value for ' + 'constraint (default 0.01)') jacobian_max = traits.Float(argstr='--jmax=%f', - desc=('Maximum acceptable Jacobian value for ' - 'constraint (default 100.0)')) + desc='Maximum acceptable Jacobian value for ' + 'constraint (default 100.0)') class InvWarpOutputSpec(TraitedSpec): inverse_warp = File(exists=True, - desc=('Name of output file, containing warps that are ' - 'the "reverse" of those in --warp.')) + desc='Name of output file, containing warps that are ' + 'the \'reverse\' of those in --warp.') class InvWarp(FSLCommand): @@ -1404,9 +1213,9 @@ class InvWarp(FSLCommand): >>> from nipype.interfaces.fsl import InvWarp >>> invwarp = InvWarp() - >>> invwarp.inputs.warp = "struct2mni.nii" - >>> invwarp.inputs.reference = "anatomical.nii" - >>> invwarp.inputs.output_type = "NIFTI_GZ" + >>> invwarp.inputs.warp = 'struct2mni.nii' + >>> invwarp.inputs.reference = 'anatomical.nii' + >>> invwarp.inputs.output_type = 'NIFTI_GZ' >>> invwarp.cmdline 'invwarp --out=struct2mni_inverse.nii.gz --ref=anatomical.nii --warp=struct2mni.nii' >>> res = invwarp.run() # doctest: +SKIP @@ -1421,12 +1230,12 @@ class InvWarp(FSLCommand): class ComplexInputSpec(FSLCommandInputSpec): - complex_in_file = File(exists=True, argstr="%s", position=2) - complex_in_file2 = File(exists=True, argstr="%s", position=3) + complex_in_file = File(exists=True, argstr='%s', position=2) + complex_in_file2 = File(exists=True, argstr='%s', position=3) - real_in_file = File(exists=True, argstr="%s", position=2) - imaginary_in_file = File(exists=True, argstr="%s", position=3) - magnitude_in_file = File(exists=True, argstr="%s", position=2) + real_in_file = File(exists=True, argstr='%s', position=2) + imaginary_in_file = File(exists=True, argstr='%s', position=3) + magnitude_in_file = File(exists=True, argstr='%s', position=2) phase_in_file = File(exists=True, argstr='%s', position=3) _ofs = ['complex_out_file', @@ -1436,15 +1245,15 @@ class ComplexInputSpec(FSLCommandInputSpec): 'complex_cartesian', 'complex_polar', 'complex_split', 'complex_merge', ] - complex_out_file = File(genfile=True, argstr="%s", position=-3, + complex_out_file = File(genfile=True, argstr='%s', position=-3, xor=_ofs + _conversion[:2]) - magnitude_out_file = File(genfile=True, argstr="%s", position=-4, + magnitude_out_file = File(genfile=True, argstr='%s', position=-4, xor=_ofs[:1] + _ofs[3:] + _conversion[1:]) - phase_out_file = File(genfile=True, argstr="%s", position=-3, + phase_out_file = File(genfile=True, argstr='%s', position=-3, xor=_ofs[:1] + _ofs[3:] + _conversion[1:]) - real_out_file = File(genfile=True, argstr="%s", position=-4, + real_out_file = File(genfile=True, argstr='%s', position=-4, xor=_ofs[:3] + _conversion[:1] + _conversion[2:]) - imaginary_out_file = File(genfile=True, argstr="%s", position=-3, + imaginary_out_file = File(genfile=True, argstr='%s', position=-3, xor=_ofs[:3] + _conversion[:1] + _conversion[2:]) start_vol = traits.Int(position=-2, argstr='%d') @@ -1471,6 +1280,16 @@ class ComplexInputSpec(FSLCommandInputSpec): position=1,) # requires=['complex_in_file','complex_in_file2','complex_out_file']) + def parse_args(self, skip=None): + if skip is None: + skip = [] + if self.real_cartesian: + skip += self._ofs[:3] + elif self.real_polar: + skip += self._ofs[:1] + self._ofs[3:] + else: + skip += self._ofs[1:] + return super(ComplexInputSpec, self).parse_args(skip) class ComplexOuputSpec(TraitedSpec): magnitude_out_file = File() @@ -1487,7 +1306,7 @@ class Complex(FSLCommand): -------- >>> cplx = Complex() - >>> cplx.inputs.complex_in_file = "complex.nii" + >>> cplx.inputs.complex_in_file = 'complex.nii' >>> cplx.real_polar = True >>> res = cplx.run() # doctest: +SKIP @@ -1497,16 +1316,6 @@ class Complex(FSLCommand): input_spec = ComplexInputSpec output_spec = ComplexOuputSpec - def parse_args(self, skip=None): - if skip is None: - skip = [] - if self.inputs.real_cartesian: - skip += self.inputs._ofs[:3] - elif self.inputs.real_polar: - skip += self.inputs._ofs[:1] + self.inputs._ofs[3:] - else: - skip += self.inputs._ofs[1:] - return super(Complex, self).parse_args(skip) def _gen_filename(self, name): if name == 'complex_out_file': @@ -1518,15 +1327,15 @@ def _gen_filename(self, name): in_file = self.inputs.complex_in_file else: return None - return self._gen_fname(in_file, suffix="_cplx") + return self._gen_fname(in_file, suffix='_cplx') elif name == 'magnitude_out_file': - return self._gen_fname(self.inputs.complex_in_file, suffix="_mag") + return self._gen_fname(self.inputs.complex_in_file, suffix='_mag') elif name == 'phase_out_file': - return self._gen_fname(self.inputs.complex_in_file, suffix="_phase") + return self._gen_fname(self.inputs.complex_in_file, suffix='_phase') elif name == 'real_out_file': - return self._gen_fname(self.inputs.complex_in_file, suffix="_real") + return self._gen_fname(self.inputs.complex_in_file, suffix='_real') elif name == 'imaginary_out_file': - return self._gen_fname(self.inputs.complex_in_file, suffix="_imag") + return self._gen_fname(self.inputs.complex_in_file, suffix='_imag') return None def _get_output(self, name): @@ -1550,25 +1359,25 @@ def _post_run(self): class WarpUtilsInputSpec(FSLCommandInputSpec): in_file = File(exists=True, argstr='--in=%s', mandatory=True, - desc=('Name of file containing warp-coefficients/fields. This ' + desc='Name of file containing warp-coefficients/fields. This ' 'would typically be the output from the --cout switch of ' 'fnirt (but can also use fields, like the output from ' - '--fout).')) + '--fout).') reference = File(exists=True, argstr='--ref=%s', mandatory=True, - desc=('Name of a file in target space. Note that the ' + desc='Name of a file in target space. Note that the ' 'target space is now different from the target ' 'space that was used to create the --warp file. It ' 'would typically be the file that was specified ' - 'with the --in argument when running fnirt.')) + 'with the --in argument when running fnirt.') out_format = traits.Enum('spline', 'field', argstr='--outformat=%s', - desc=('Specifies the output format. If set to field (default) ' + desc='Specifies the output format. If set to field (default) ' 'the output will be a (4D) field-file. If set to spline ' - 'the format will be a (4D) file of spline coefficients.')) + 'the format will be a (4D) file of spline coefficients.') warp_resolution = traits.Tuple(traits.Float, traits.Float, traits.Float, argstr='--warpres=%0.4f,%0.4f,%0.4f', - desc=('Specifies the resolution/knot-spacing of the splines pertaining ' + desc='Specifies the resolution/knot-spacing of the splines pertaining ' 'to the coefficients in the --out file. This parameter is only ' 'relevant if --outformat is set to spline. It should be noted ' 'that if the --in file has a higher resolution, the resulting ' @@ -1576,40 +1385,50 @@ class WarpUtilsInputSpec(FSLCommandInputSpec): ' sense) file in the space of fields with the --warpres' ' resolution. It should also be noted that the resolution ' 'will always be an integer multiple of the voxel ' - 'size.')) + 'size.') knot_space = traits.Tuple(traits.Int, traits.Int, traits.Int, argstr='--knotspace=%d,%d,%d', - desc=('Alternative (to --warpres) specification of the resolution of ' - 'the output spline-field.')) + desc='Alternative (to --warpres) specification of the resolution of ' + 'the output spline-field.') - out_file = File( - argstr='--out=%s', position=-1, name_source=['in_file'], name_template='%s_coeffs', keep_extension=True, - desc=('Name of output file. The format of the output depends on what other ' + out_file = GenFile( + template='{in_file}_{out_format}{output_type_}', argstr='--out=%s', position=-1, + desc='Name of output file. The format of the output depends on what other ' 'parameters are set. The default format is a (4D) field-file. If the ' '--outformat is set to spline the format will be a (4D) file of spline ' - 'coefficients.')) + 'coefficients.') write_jacobian = traits.Bool(False, mandatory=True, usedefault=True, desc='Switch on --jac flag with automatically generated filename') - out_jacobian = File(argstr='--jac=%s', - desc=('Specifies that a (3D) file of Jacobian determinants corresponding ' - 'to --in should be produced and written to filename.')) + out_jacobian = GenFile(template='{in_file}_jac{output_type_}', argstr='--jac=%s', + desc='Specifies that a (3D) file of Jacobian determinants corresponding ' + 'to --in should be produced and written to filename.') with_affine = traits.Bool(False, argstr='--withaff', - desc=('Specifies that the affine transform (i.e. that which was ' + desc='Specifies that the affine transform (i.e. that which was ' 'specified for the --aff parameter in fnirt) should be ' 'included as displacements in the --out file. That can be ' 'useful for interfacing with software that cannot decode ' 'FSL/fnirt coefficient-files (where the affine transform is ' - 'stored separately from the displacements).')) + 'stored separately from the displacements).') + def parse_args(self, skip=None): + if skip is None: + skip = [] + if not self.write_jacobian: + skip += ['out_jacobian'] + return super(WarpUtilsInputSpec, self).parse_args(skip) class WarpUtilsOutputSpec(TraitedSpec): - out_file = File(desc=('Name of output file, containing the warp as field or coefficients.')) - out_jacobian = File(desc=('Name of output file, containing the map of the determinant of ' - 'the Jacobian')) + out_file = File(desc='Name of output file, containing the warp as field or coefficients.') + out_jacobian = File(desc='Name of output file, containing the map of the determinant of ' + 'the Jacobian') + + def post_run(self): + if not self.inputs.write_jacobian: + self.outputs.out_jacobian = Undefined class WarpUtils(FSLCommand): @@ -1622,13 +1441,13 @@ class WarpUtils(FSLCommand): >>> from nipype.interfaces.fsl import WarpUtils >>> warputils = WarpUtils() - >>> warputils.inputs.in_file = "warpfield.nii" - >>> warputils.inputs.reference = "T1.nii" + >>> warputils.inputs.in_file = 'warpfield.nii' + >>> warputils.inputs.reference = 'T1.nii' >>> warputils.inputs.out_format = 'spline' >>> warputils.inputs.warp_resolution = (10,10,10) - >>> warputils.inputs.output_type = "NIFTI_GZ" + >>> warputils.inputs.output_type = 'NIFTI_GZ' >>> warputils.cmdline # doctest: +ELLIPSIS - 'fnirtfileutils --in=warpfield.nii --outformat=spline --ref=T1.nii --warpres=10.0000,10.0000,10.0000 --out=warpfield_coeffs.nii.gz' + 'fnirtfileutils --in=warpfield.nii --outformat=spline --ref=T1.nii --warpres=10.0000,10.0000,10.0000 --out=warpfield_spline.nii.gz' >>> res = invwarp.run() # doctest: +SKIP @@ -1639,109 +1458,86 @@ class WarpUtils(FSLCommand): _cmd = 'fnirtfileutils' - def parse_args(self, skip=None): - if skip is None: - skip = [] - - suffix = 'field' - if isdefined(self.inputs.out_format) and self.inputs.out_format == 'spline': - suffix = 'coeffs' - - trait_spec = self.inputs.trait('out_file') - trait_spec.name_template = "%s_" + suffix - - if self.inputs.write_jacobian: - if not isdefined(self.inputs.out_jacobian): - jac_spec = self.inputs.trait('out_jacobian') - jac_spec.name_source = ['in_file'] - jac_spec.name_template = '%s_jac' - jac_spec.output_name = 'out_jacobian' - else: - skip += ['out_jacobian'] - - skip += ['write_jacobian'] - return super(WarpUtils, self).parse_args(skip=skip) - class ConvertWarpInputSpec(FSLCommandInputSpec): reference = File(exists=True, argstr='--ref=%s', mandatory=True, position=1, - desc=('Name of a file in target space of the full transform.')) + desc='Name of a file in target space of the full transform.') out_file = File(argstr='--out=%s', position=-1, name_source=['reference'], name_template='%s_concatwarp', output_name='out_file', - desc=('Name of output file, containing warps that are the combination of all ' + desc='Name of output file, containing warps that are the combination of all ' 'those given as arguments. The format of this will be a field-file (rather ' - 'than spline coefficients) with any affine components included.')) + 'than spline coefficients) with any affine components included.') premat = File(exists=True, argstr='--premat=%s', desc='filename for pre-transform (affine matrix)') warp1 = File(exists=True, argstr='--warp1=%s', - desc=('Name of file containing initial warp-fields/coefficients (follows premat). This could e.g. be a ' + desc='Name of file containing initial warp-fields/coefficients (follows premat). This could e.g. be a ' 'fnirt-transform from a subjects structural scan to an average of a group ' - 'of subjects.')) + 'of subjects.') - midmat = File(exists=True, argstr="--midmat=%s", - desc="Name of file containing mid-warp-affine transform") + midmat = File(exists=True, argstr='--midmat=%s', + desc='Name of file containing mid-warp-affine transform') warp2 = File(exists=True, argstr='--warp2=%s', - desc=('Name of file containing secondary warp-fields/coefficients (after warp1/midmat but before postmat). This could e.g. be a ' + desc='Name of file containing secondary warp-fields/coefficients (after warp1/midmat but before postmat). This could e.g. be a ' 'fnirt-transform from the average of a group of subjects to some standard ' - 'space (e.g. MNI152).')) + 'space (e.g. MNI152).') postmat = File(exists=True, argstr='--postmat=%s', - desc=('Name of file containing an affine transform (applied last). It could e.g. be an affine ' + desc='Name of file containing an affine transform (applied last). It could e.g. be an affine ' 'transform that maps the MNI152-space into a better approximation to the ' - 'Talairach-space (if indeed there is one).')) + 'Talairach-space (if indeed there is one).') shift_in_file = File(exists=True, argstr='--shiftmap=%s', - desc=('Name of file containing a "shiftmap", a non-linear transform with ' + desc='Name of file containing a \'shiftmap\', a non-linear transform with ' 'displacements only in one direction (applied first, before premat). This would typically be a ' 'fieldmap that has been pre-processed using fugue that maps a ' 'subjects functional (EPI) data onto an undistorted space (i.e. a space ' - 'that corresponds to his/her true anatomy).')) + 'that corresponds to his/her true anatomy).') shift_direction = traits.Enum('y-', 'y', 'x', 'x-', 'z', 'z-', - argstr="--shiftdir=%s", requires=['shift_in_file'], - desc=('Indicates the direction that the distortions from ' + argstr='--shiftdir=%s', requires=['shift_in_file'], + desc='Indicates the direction that the distortions from ' '--shiftmap goes. It depends on the direction and ' - 'polarity of the phase-encoding in the EPI sequence.')) + 'polarity of the phase-encoding in the EPI sequence.') cons_jacobian = traits.Bool(False, argstr='--constrainj', - desc=('Constrain the Jacobian of the warpfield to lie within specified ' - 'min/max limits.')) + desc='Constrain the Jacobian of the warpfield to lie within specified ' + 'min/max limits.') jacobian_min = traits.Float(argstr='--jmin=%f', - desc=('Minimum acceptable Jacobian value for ' - 'constraint (default 0.01)')) + desc='Minimum acceptable Jacobian value for ' + 'constraint (default 0.01)') jacobian_max = traits.Float(argstr='--jmax=%f', - desc=('Maximum acceptable Jacobian value for ' - 'constraint (default 100.0)')) + desc='Maximum acceptable Jacobian value for ' + 'constraint (default 100.0)') abswarp = traits.Bool(argstr='--abs', xor=['relwarp'], - desc=('If set it indicates that the warps in --warp1 and --warp2 should be ' + desc='If set it indicates that the warps in --warp1 and --warp2 should be ' 'interpreted as absolute. I.e. the values in --warp1/2 are the ' 'coordinates in the next space, rather than displacements. This flag ' 'is ignored if --warp1/2 was created by fnirt, which always creates ' - 'relative displacements.')) + 'relative displacements.') relwarp = traits.Bool(argstr='--rel', xor=['abswarp'], - desc=('If set it indicates that the warps in --warp1/2 should be interpreted ' + desc='If set it indicates that the warps in --warp1/2 should be interpreted ' 'as relative. I.e. the values in --warp1/2 are displacements from the ' - 'coordinates in the next space.')) + 'coordinates in the next space.') out_abswarp = traits.Bool(argstr='--absout', xor=['out_relwarp'], - desc=('If set it indicates that the warps in --out should be absolute, i.e. ' - 'the values in --out are displacements from the coordinates in --ref.')) + desc='If set it indicates that the warps in --out should be absolute, i.e. ' + 'the values in --out are displacements from the coordinates in --ref.') out_relwarp = traits.Bool(argstr='--relout', xor=['out_abswarp'], - desc=('If set it indicates that the warps in --out should be relative, i.e. ' - 'the values in --out are displacements from the coordinates in --ref.')) + desc='If set it indicates that the warps in --out should be relative, i.e. ' + 'the values in --out are displacements from the coordinates in --ref.') class ConvertWarpOutputSpec(TraitedSpec): out_file = File(exists=True, - desc=('Name of output file, containing the warp as field or coefficients.')) + desc='Name of output file, containing the warp as field or coefficients.') class ConvertWarp(FSLCommand): @@ -1754,10 +1550,10 @@ class ConvertWarp(FSLCommand): >>> from nipype.interfaces.fsl import ConvertWarp >>> warputils = ConvertWarp() - >>> warputils.inputs.warp1 = "warpfield.nii" - >>> warputils.inputs.reference = "T1.nii" + >>> warputils.inputs.warp1 = 'warpfield.nii' + >>> warputils.inputs.reference = 'T1.nii' >>> warputils.inputs.relwarp = True - >>> warputils.inputs.output_type = "NIFTI_GZ" + >>> warputils.inputs.output_type = 'NIFTI_GZ' >>> warputils.cmdline # doctest: +ELLIPSIS 'convertwarp --ref=T1.nii --rel --warp1=warpfield.nii --out=T1_concatwarp.nii.gz' >>> res = invwarp.run() # doctest: +SKIP @@ -1772,16 +1568,16 @@ class ConvertWarp(FSLCommand): class WarpPointsBaseInputSpec(CommandLineInputSpec): in_coords = File(exists=True, position=-1, argstr='%s', mandatory=True, - desc=('filename of file containing coordinates')) + desc='filename of file containing coordinates') xfm_file = File(exists=True, argstr='-xfm %s', xor=['warp_file'], - desc=('filename of affine transform (e.g. source2dest.mat)')) + desc='filename of affine transform (e.g. source2dest.mat)') warp_file = File(exists=True, argstr='-warp %s', xor=['xfm_file'], - desc=('filename of warpfield (e.g. ' - 'intermediate2dest_warp.nii.gz)')) + desc='filename of warpfield (e.g. ' + 'intermediate2dest_warp.nii.gz)') coord_vox = traits.Bool(True, argstr='-vox', xor=['coord_mm'], - desc=('all coordinates in voxels - default')) + desc='all coordinates in voxels - default') coord_mm = traits.Bool(False, argstr='-mm', xor=['coord_vox'], - desc=('all coordinates in mm')) + desc='all coordinates in mm') out_file = File(name_source='in_coords', name_template='%s_warped', output_name='out_file', desc='output file name') @@ -1789,14 +1585,14 @@ class WarpPointsBaseInputSpec(CommandLineInputSpec): class WarpPointsInputSpec(WarpPointsBaseInputSpec): src_file = File(exists=True, argstr='-src %s', mandatory=True, - desc=('filename of source image')) + desc='filename of source image') dest_file = File(exists=True, argstr='-dest %s', mandatory=True, - desc=('filename of destination image')) + desc='filename of destination image') class WarpPointsOutputSpec(TraitedSpec): out_file = File(exists=True, - desc=('Name of output file, containing the warp as field or coefficients.')) + desc='Name of output file, containing the warp as field or coefficients.') class WarpPoints(CommandLine): @@ -1844,7 +1640,7 @@ def _format_arg(self, name, trait_spec, value): def parse_args(self, skip=None): import os.path as op - fname, ext = op.splitext(self.inputs.in_coords) + fname, ext = op.splitext(self.in_coords) setattr(self, '_in_file', fname) setattr(self, '_outformat', ext[1:]) first_args = super(WarpPoints, self).parse_args(skip=['in_coords', 'out_file']) @@ -1970,12 +1766,12 @@ def _run_interface(self, runtime): class WarpPointsToStdInputSpec(WarpPointsBaseInputSpec): img_file = File(exists=True, argstr='-img %s', mandatory=True, - desc=('filename of input image')) + desc='filename of input image') std_file = File(exists=True, argstr='-std %s', mandatory=True, - desc=('filename of destination image')) + desc='filename of destination image') premat_file = File(exists=True, argstr='-premat %s', - desc=('filename of pre-warp affine transform ' - '(e.g. example_func2highres.mat)')) + desc='filename of pre-warp affine transform ' + '(e.g. example_func2highres.mat)') class WarpPointsToStd(WarpPoints): @@ -2010,21 +1806,21 @@ class WarpPointsToStd(WarpPoints): class MotionOutliersInputSpec(FSLCommandInputSpec): - in_file = File(exists=True, mandatory=True, desc="unfiltered 4D image", argstr="-i %s") - out_file = File(argstr="-o %s", name_source='in_file', name_template='%s_outliers.txt', + in_file = File(exists=True, mandatory=True, desc='unfiltered 4D image', argstr='-i %s') + out_file = File(argstr='-o %s', name_source='in_file', name_template='%s_outliers.txt', keep_extension=True, desc='output outlier file name', hash_files=False) - mask = File(exists=True, argstr="-m %s", desc="mask image for calculating metric") - metric = traits.Enum('refrms', ['refrms', 'dvars', 'refmse', 'fd', 'fdrms'], argstr="--%s", desc="metrics: refrms - RMS intensity difference to reference volume as metric [default metric],\ + mask = File(exists=True, argstr='-m %s', desc='mask image for calculating metric') + metric = traits.Enum('refrms', ['refrms', 'dvars', 'refmse', 'fd', 'fdrms'], argstr='--%s', desc="metrics: refrms - RMS intensity difference to reference volume as metric [default metric],\ refmse - Mean Square Error version of refrms (used in original version of fsl_motion_outliers) \ dvars - DVARS \ fd - frame displacement \ fdrms - FD with RMS matrix calculation") - threshold = traits.Float(argstr="--thresh=%g", desc="specify absolute threshold value (otherwise use box-plot cutoff = P75 + 1.5*IQR)") - no_motion_correction = traits.Bool(argstr="--nomoco", desc="do not run motion correction (assumed already done)") - dummy = traits.Int(argstr="--dummy=%d", desc='number of dummy scans to delete (before running anything and creating EVs)') - out_metric_values = File(argstr="-s %s", name_source='in_file', name_template='%s_metrics.txt', + threshold = traits.Float(argstr='--thresh=%g', desc="specify absolute threshold value (otherwise use box-plot cutoff = P75 + 1.5*IQR)") + no_motion_correction = traits.Bool(argstr='--nomoco', desc='do not run motion correction (assumed already done)') + dummy = traits.Int(argstr='--dummy=%d', desc='number of dummy scans to delete (before running anything and creating EVs)') + out_metric_values = File(argstr='-s %s', name_source='in_file', name_template='%s_metrics.txt', keep_extension=True, desc='output metric values (DVARS etc.) file name', hash_files=False) - out_metric_plot = File(argstr="-p %s", name_source='in_file', name_template='%s_metrics.png', + out_metric_plot = File(argstr='-p %s', name_source='in_file', name_template='%s_metrics.png', keep_extension=True, desc='output metric values plot (DVARS etc.) file name', hash_files=False) @@ -2041,7 +1837,7 @@ class MotionOutliers(FSLCommand): -------- >>> from nipype.interfaces.fsl import MotionOutliers >>> mo = MotionOutliers() - >>> mo.inputs.in_file = "epi.nii" + >>> mo.inputs.in_file = 'epi.nii' >>> mo.cmdline # doctest: +ELLIPSIS 'fsl_motion_outliers -i epi.nii -o epi_outliers.txt -p epi_metrics.png -s epi_metrics.txt' >>> res = mo.run() # doctest: +SKIP diff --git a/nipype/interfaces/traits_extension.py b/nipype/interfaces/traits_extension.py index bb9d145efc..b1051b9515 100644 --- a/nipype/interfaces/traits_extension.py +++ b/nipype/interfaces/traits_extension.py @@ -121,6 +121,9 @@ def __init__(self, value='', filter=None, auto_set=False, super(File, self).__init__(value, filter, auto_set, entries, exists, **metadata) + def isfile(self, obj, name): + return True + class GenFile(File): """ A file which default name is automatically generated from other @@ -159,7 +162,7 @@ class GenFile(File): """ - def __init__(self, template=None, keep_extension=True, value='', + def __init__(self, template=None, keep_extension=False, value='', filter=None, auto_set=False, entries=0, exists=False, **metadata): """ Creates a GenFile trait. """ @@ -208,7 +211,6 @@ def get(self, obj, name): ext = '' for nsrc in self.name_source: srcvalue = getattr(obj, nsrc) - if not isdefined(srcvalue): return Undefined @@ -336,7 +338,7 @@ class GenMultiFile(traits.List): """ - def __init__(self, template=None, keep_extension=True, range_source=None, **metadata): + def __init__(self, template=None, keep_extension=False, range_source=None, **metadata): if template is None or not isinstance(template, string_types): raise TraitError('GenMultiFile requires a valid template argument') @@ -359,6 +361,12 @@ def __init__(self, template=None, keep_extension=True, range_source=None, **meta raise TraitError( 'range_source is not valid (found %s).' % range_source) + try: + range_source, offset = range_source.split('+') + self.offset = int(offset) + except ValueError: + self.offset = 0 + if range_source not in self.name_source: raise TraitError( 'range_source field should also be found in the' @@ -399,13 +407,16 @@ def get(self, obj, name): ext = '' for nsrc in self.name_source: srcvalue = getattr(obj, nsrc) - + IFLOGGER.debug('Parsing source (%s) = %s', nsrc, obj.traits()[nsrc].trait_type()) if not isdefined(srcvalue): return Undefined + IFLOGGER.debug('Autogenerating output for: %s (%s=%s)', name, nsrc, srcvalue) + IFLOGGER.debug('range_source=%s', self.range_source) if self.range_source is not None and nsrc == self.range_source: - srcvalue = range(int(srcvalue)) + srcvalue = range(self.offset, int(srcvalue) + self.offset) vallist = srcvalue + IFLOGGER.debug('Generating range of outputs: %s', vallist) if isinstance(srcvalue, string_types): vallist = [srcvalue] From 933cc40410abb82998620223ed3185f56742cb76 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Fri, 19 Feb 2016 21:00:13 -0800 Subject: [PATCH 52/73] advancing in refactoring fsl --- nipype/algorithms/tests/test_auto_ErrorMap.py | 35 ++++ nipype/algorithms/tests/test_auto_Overlap.py | 47 +++++ nipype/interfaces/fsl/base.py | 1 + nipype/interfaces/fsl/dti.py | 2 +- nipype/interfaces/fsl/epi.py | 9 +- nipype/interfaces/fsl/maths.py | 198 ++++++++---------- nipype/interfaces/fsl/model.py | 64 +++--- nipype/interfaces/fsl/preprocess.py | 40 ++-- .../fsl/tests/test_auto_ApplyMask.py | 2 +- .../fsl/tests/test_auto_ApplyTOPUP.py | 2 - .../fsl/tests/test_auto_BEDPOSTX5.py | 3 +- .../fsl/tests/test_auto_BinaryMaths.py | 2 +- .../fsl/tests/test_auto_ChangeDataType.py | 2 +- .../fsl/tests/test_auto_ConvertWarp.py | 3 - .../fsl/tests/test_auto_ConvertXFM.py | 8 +- .../fsl/tests/test_auto_DilateImage.py | 2 +- .../fsl/tests/test_auto_ErodeImage.py | 4 +- .../fsl/tests/test_auto_ExtractROI.py | 1 - .../interfaces/fsl/tests/test_auto_InvWarp.py | 2 - .../fsl/tests/test_auto_IsotropicSmooth.py | 2 +- .../fsl/tests/test_auto_MathsCommand.py | 2 +- .../fsl/tests/test_auto_MaxImage.py | 2 +- .../fsl/tests/test_auto_MeanImage.py | 2 +- .../fsl/tests/test_auto_MotionOutliers.py | 9 - .../fsl/tests/test_auto_MultiImageMaths.py | 2 +- .../fsl/tests/test_auto_PlotTimeSeries.py | 1 + .../fsl/tests/test_auto_SpatialFilter.py | 2 +- .../interfaces/fsl/tests/test_auto_TOPUP.py | 5 +- .../fsl/tests/test_auto_TemporalFilter.py | 2 +- .../fsl/tests/test_auto_Threshold.py | 2 +- .../fsl/tests/test_auto_UnaryMaths.py | 2 +- .../fsl/tests/test_auto_WarpUtils.py | 3 - nipype/interfaces/fsl/tests/test_base.py | 9 +- nipype/interfaces/fsl/utils.py | 98 +++++---- nipype/interfaces/specs.py | 6 +- nipype/interfaces/traits_extension.py | 17 +- nipype/utils/filemanip.py | 18 +- 37 files changed, 312 insertions(+), 299 deletions(-) create mode 100644 nipype/algorithms/tests/test_auto_ErrorMap.py create mode 100644 nipype/algorithms/tests/test_auto_Overlap.py diff --git a/nipype/algorithms/tests/test_auto_ErrorMap.py b/nipype/algorithms/tests/test_auto_ErrorMap.py new file mode 100644 index 0000000000..69484529dd --- /dev/null +++ b/nipype/algorithms/tests/test_auto_ErrorMap.py @@ -0,0 +1,35 @@ +# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT +from ...testing import assert_equal +from ..metrics import ErrorMap + + +def test_ErrorMap_inputs(): + input_map = dict(ignore_exception=dict(nohash=True, + usedefault=True, + ), + in_ref=dict(mandatory=True, + ), + in_tst=dict(mandatory=True, + ), + mask=dict(), + metric=dict(mandatory=True, + usedefault=True, + ), + out_map=dict(), + ) + inputs = ErrorMap.input_spec() + + for key, metadata in list(input_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(inputs.traits()[key], metakey), value + + +def test_ErrorMap_outputs(): + output_map = dict(distance=dict(), + out_map=dict(), + ) + outputs = ErrorMap.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/algorithms/tests/test_auto_Overlap.py b/nipype/algorithms/tests/test_auto_Overlap.py new file mode 100644 index 0000000000..a5a3874bd1 --- /dev/null +++ b/nipype/algorithms/tests/test_auto_Overlap.py @@ -0,0 +1,47 @@ +# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT +from ...testing import assert_equal +from ..misc import Overlap + + +def test_Overlap_inputs(): + input_map = dict(bg_overlap=dict(mandatory=True, + usedefault=True, + ), + ignore_exception=dict(nohash=True, + usedefault=True, + ), + mask_volume=dict(), + out_file=dict(usedefault=True, + ), + vol_units=dict(mandatory=True, + usedefault=True, + ), + volume1=dict(mandatory=True, + ), + volume2=dict(mandatory=True, + ), + weighting=dict(usedefault=True, + ), + ) + inputs = Overlap.input_spec() + + for key, metadata in list(input_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(inputs.traits()[key], metakey), value + + +def test_Overlap_outputs(): + output_map = dict(dice=dict(), + diff_file=dict(), + jaccard=dict(), + labels=dict(), + roi_di=dict(), + roi_ji=dict(), + roi_voldiff=dict(), + volume_difference=dict(), + ) + outputs = Overlap.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/fsl/base.py b/nipype/interfaces/fsl/base.py index 465ffc6242..59281cc081 100644 --- a/nipype/interfaces/fsl/base.py +++ b/nipype/interfaces/fsl/base.py @@ -122,6 +122,7 @@ class FSLCommand(CommandLine): # pylint: disable=W0223 def __init__(self, **inputs): super(FSLCommand, self).__init__(**inputs) self.inputs.on_trait_change(self._output_update, 'output_type') + self.inputs.output_type = FSLOUTPUTTYPE def _output_update(self): self.inputs.environ.update({'FSLOUTPUTTYPE': self.inputs.output_type}) diff --git a/nipype/interfaces/fsl/dti.py b/nipype/interfaces/fsl/dti.py index af44d21f05..26031122d9 100644 --- a/nipype/interfaces/fsl/dti.py +++ b/nipype/interfaces/fsl/dti.py @@ -267,7 +267,7 @@ class BEDPOSTX5InputSpec(FSLXCommandInputSpec): # Add dyads dispersion dyads_dispersion = GenMultiFile( - template='{n_fibres:d}{output_type_}', keep_extension=False, source_range='n_fibres+1', + template='{n_fibres:d}{output_type_}', keep_extension=False, range_source='n_fibres+1', desc='Dispersion') class BEDPOSTX5OutputSpec(FSLXCommandOutputSpec): diff --git a/nipype/interfaces/fsl/epi.py b/nipype/interfaces/fsl/epi.py index 4d25549089..cadc2f48b8 100644 --- a/nipype/interfaces/fsl/epi.py +++ b/nipype/interfaces/fsl/epi.py @@ -183,10 +183,13 @@ class TOPUPInputSpec(FSLCommandInputSpec): out_logfile = GenFile( template='{in_file}_topup.log', argstr='--logout=%s', hash_files=False, desc='name of log-file') - out_fieldcoef = GenFile( - template='{in_file}_fieldcoef{output_type_}', argstr='--fout=%s', hash_files=False, - desc='name of image file with field (Hz)') + out_fieldcoef = GenFile( + template='{out_base}_fieldcoef{output_type_}', hash_files=False, + desc='file containing the field coefficients') + out_movpar = GenFile( + template='{out_base}_movpar.txt', hash_files=False, + desc='file containing the field coefficients') class TOPUPOutputSpec(TraitedSpec): out_fieldcoef = File(exists=True, diff --git a/nipype/interfaces/fsl/maths.py b/nipype/interfaces/fsl/maths.py index 314aa576dc..a7cbfb2f6b 100644 --- a/nipype/interfaces/fsl/maths.py +++ b/nipype/interfaces/fsl/maths.py @@ -12,55 +12,42 @@ """ from __future__ import division -import os import numpy as np -from ..base import (TraitedSpec, File, traits, InputMultiPath, isdefined) +from ..base import (TraitedSpec, File, GenFile, traits, InputMultiPath, isdefined) from ..fsl.base import FSLCommand, FSLCommandInputSpec class MathsInput(FSLCommandInputSpec): - in_file = File(position=2, argstr="%s", exists=True, mandatory=True, desc="image to operate on") - out_file = File(genfile=True, position=-2, argstr="%s", desc="image to write", hash_files=False) + out_file = GenFile( + template='{in_file}_maths{output_type_}', position=-2, argstr="%s", hash_files=False, + desc="image to write") _dtypes = ["float", "char", "int", "short", "double", "input"] internal_datatype = traits.Enum(*_dtypes, position=1, argstr="-dt %s", desc="datatype to use for calculations (default is float)") output_datatype = traits.Enum(*_dtypes, position=-1, argstr="-odt %s", desc="datatype to use for output (default uses input type)") - - nan2zeros = traits.Bool(position=3, argstr='-nan', + nan2zeros = traits.Bool(False, usedefault=True, position=3, argstr='-nan', desc='change NaNs to zeros before doing anything') class MathsOutput(TraitedSpec): - out_file = File(exists=True, desc="image written after calculations") class MathsCommand(FSLCommand): - _cmd = "fslmaths" input_spec = MathsInput output_spec = MathsOutput - _suffix = "_maths" - - def _post_run(self): - - self.outputs.out_file = self.inputs.out_file - if not isdefined(self.inputs.out_file): - self.outputs.out_file = self._gen_fname(self.inputs.in_file, suffix=self._suffix) - self.outputs.out_file = os.path.abspath(self.outputs.out_file) - - def _gen_filename(self, name): - if name == "out_file": - return self.outputs.out_file - return None class ChangeDataTypeInput(MathsInput): + out_file = GenFile( + template='{in_file}_chdt{output_type_}', position=-2, argstr="%s", hash_files=False, + desc="image to write") _dtypes = ["float", "char", "int", "short", "double", "input"] output_datatype = traits.Enum(*_dtypes, @@ -69,15 +56,14 @@ class ChangeDataTypeInput(MathsInput): class ChangeDataType(MathsCommand): - """Use fslmaths to change the datatype of an image. - - """ + """Use fslmaths to change the datatype of an image.""" input_spec = ChangeDataTypeInput - _suffix = "_chdt" class ThresholdInputSpec(MathsInput): - + out_file = GenFile( + template='{in_file}_thresh{output_type_}', position=-2, argstr="%s", hash_files=False, + desc="image to write") thresh = traits.Float(mandatory=True, position=4, argstr="%s", desc="threshold value") direction = traits.Enum("below", "above", usedefault=True, @@ -86,53 +72,50 @@ class ThresholdInputSpec(MathsInput): use_nonzero_voxels = traits.Bool(desc="use nonzero voxels to calculate robust range", requires=["use_robust_range"]) - -class Threshold(MathsCommand): - """Use fslmaths to apply a threshold to an image in a variety of ways. - - """ - input_spec = ThresholdInputSpec - _suffix = "_thresh" - def _format_arg(self, name, spec, value): if name == "thresh": arg = "-" - _si = self.inputs - if self.inputs.direction == "above": + if self.direction == "above": arg += "u" arg += "thr" - if isdefined(_si.use_robust_range) and _si.use_robust_range: - if isdefined(_si.use_nonzero_voxels) and _si.use_nonzero_voxels: + if isdefined(self.use_robust_range) and self.use_robust_range: + if isdefined(self.use_nonzero_voxels) and self.use_nonzero_voxels: arg += "P" else: arg += "p" arg += " %.10f" % value return arg - return super(Threshold, self)._format_arg(name, spec, value) + return super(ThresholdInputSpec, self)._format_arg(name, spec, value) +class Threshold(MathsCommand): + """Use fslmaths to apply a threshold to an image in a variety of ways.""" + input_spec = ThresholdInputSpec -class MeanImageInput(MathsInput): +class MeanImageInput(MathsInput): + out_file = GenFile( + template='{in_file}_mean{output_type_}', position=-2, argstr="%s", hash_files=False, + desc="image to write") dimension = traits.Enum("T", "X", "Y", "Z", usedefault=True, argstr="-%smean", position=4, desc="dimension to mean across") class MeanImage(MathsCommand): - """Use fslmaths to generate a mean image across a given dimension. - - """ + """Use fslmaths to generate a mean image across a given dimension.""" input_spec = MeanImageInput - _suffix = "_mean" class MaxImageInput(MathsInput): - + out_file = GenFile( + template='{in_file}_max{output_type_}', position=-2, argstr="%s", hash_files=False, + desc="image to write") dimension = traits.Enum("T", "X", "Y", "Z", usedefault=True, argstr="-%smax", position=4, desc="dimension to max across") class MaxImage(MathsCommand): - """Use fslmaths to generate a max image across a given dimension. + """ + Use fslmaths to generate a max image across a given dimension. Examples -------- @@ -145,47 +128,42 @@ class MaxImage(MathsCommand): """ input_spec = MaxImageInput - _suffix = "_max" class IsotropicSmoothInput(MathsInput): - + out_file = GenFile( + template='{in_file}_smooth{output_type_}', position=-2, argstr="%s", hash_files=False, + desc="image to write") fwhm = traits.Float(mandatory=True, xor=["sigma"], position=4, argstr="-s %.5f", desc="fwhm of smoothing kernel [mm]") sigma = traits.Float(mandatory=True, xor=["fwhm"], position=4, argstr="-s %.5f", desc="sigma of smoothing kernel [mm]") - -class IsotropicSmooth(MathsCommand): - """Use fslmaths to spatially smooth an image with a gaussian kernel. - - """ - input_spec = IsotropicSmoothInput - _suffix = "_smooth" - def _format_arg(self, name, spec, value): if name == "fwhm": sigma = float(value) / np.sqrt(8 * np.log(2)) return spec.argstr % sigma - return super(IsotropicSmooth, self)._format_arg(name, spec, value) + return super(IsotropicSmoothInput, self)._format_arg(name, spec, value) +class IsotropicSmooth(MathsCommand): + """Use fslmaths to spatially smooth an image with a gaussian kernel.""" + input_spec = IsotropicSmoothInput -class ApplyMaskInput(MathsInput): +class ApplyMaskInput(MathsInput): + out_file = GenFile( + template='{in_file}_masked{output_type_}', position=-2, argstr="%s", hash_files=False, + desc="image to write") mask_file = File(exists=True, mandatory=True, argstr="-mas %s", position=4, desc="binary image defining mask space") class ApplyMask(MathsCommand): - """Use fslmaths to apply a binary mask to another image. - - """ + """Use fslmaths to apply a binary mask to another image.""" input_spec = ApplyMaskInput - _suffix = "_masked" class KernelInput(MathsInput): - kernel_shape = traits.Enum("3D", "2D", "box", "boxv", "gauss", "sphere", "file", argstr="-kernel %s", position=4, desc="kernel shape to use") kernel_size = traits.Float(argstr="%.4f", position=5, xor=["kernel_file"], @@ -195,61 +173,59 @@ class KernelInput(MathsInput): class DilateInput(KernelInput): - + out_file = GenFile( + template='{in_file}_dil{output_type_}', position=-2, argstr="%s", hash_files=False, + desc="image to write") operation = traits.Enum("mean", "modal", "max", argstr="-dil%s", position=6, mandatory=True, desc="filtering operation to perfoem in dilation") - -class DilateImage(MathsCommand): - """Use fslmaths to perform a spatial dilation of an image. - - """ - input_spec = DilateInput - _suffix = "_dil" - def _format_arg(self, name, spec, value): if name == "operation": return spec.argstr % dict(mean="M", modal="D", max="F")[value] - return super(DilateImage, self)._format_arg(name, spec, value) - + return super(DilateInput, self)._format_arg(name, spec, value) -class ErodeInput(KernelInput): - - minimum_filter = traits.Bool(argstr="%s", position=6, usedefault=True, default_value=False, - desc="if true, minimum filter rather than erosion by zeroing-out") +class DilateImage(MathsCommand): + """Use fslmaths to perform a spatial dilation of an image.""" + input_spec = DilateInput -class ErodeImage(MathsCommand): - """Use fslmaths to perform a spatial erosion of an image. - """ - input_spec = ErodeInput - _suffix = "_ero" +class ErodeInput(KernelInput): + out_file = GenFile( + template='{in_file}_ero{output_type_}', position=-2, argstr="%s", hash_files=False, + desc="image to write") + minimum_filter = traits.Bool( + False, argstr="-eroF", position=6, usedefault=True, + desc="if true, minimum filter rather than erosion by zeroing-out") def _format_arg(self, name, spec, value): if name == "minimum_filter": - if value: - return "-eroF" - return "-ero" - return super(ErodeImage, self)._format_arg(name, spec, value) + if not value: + return "-ero" + return super(ErodeInput, self)._format_arg(name, spec, value) +class ErodeImage(MathsCommand): + """Use fslmaths to perform a spatial erosion of an image.""" + input_spec = ErodeInput -class SpatialFilterInput(KernelInput): +class SpatialFilterInput(KernelInput): + out_file = GenFile( + template='{in_file}_{operation}{output_type_}', position=-2, argstr="%s", hash_files=False, + desc="image to write") operation = traits.Enum("mean", "median", "meanu", argstr="-f%s", position=6, mandatory=True, desc="operation to filter with") class SpatialFilter(MathsCommand): - """Use fslmaths to spatially filter an image. - - """ + """Use fslmaths to spatially filter an image.""" input_spec = SpatialFilterInput - _suffix = "_filt" class UnaryMathsInput(MathsInput): - + out_file = GenFile( + template='{in_file}_{operation}{output_type_}', position=-2, argstr="%s", hash_files=False, + desc="image to write") operation = traits.Enum("exp", "log", "sin", "cos", "tan", "asin", "acos", "atan", "sqr", "sqrt", "recip", "abs", "bin", "binv", "fillh", "fillh26", "index", "edge", "nan", "nanm", "rand", "randn", "range", @@ -258,18 +234,11 @@ class UnaryMathsInput(MathsInput): class UnaryMaths(MathsCommand): - """Use fslmaths to perorm a variety of mathematical operations on an image. - - """ + """Use fslmaths to perorm a variety of mathematical operations on an image.""" input_spec = UnaryMathsInput - def _post_run(self): - self._suffix = "_" + self.inputs.operation - return super(UnaryMaths, self)._list_outputs() - class BinaryMathsInput(MathsInput): - operation = traits.Enum("add", "sub", "mul", "div", "rem", "max", "min", mandatory=True, argstr="-%s", position=4, desc="operation to perform") @@ -280,19 +249,23 @@ class BinaryMathsInput(MathsInput): class BinaryMaths(MathsCommand): - """Use fslmaths to perform mathematical operations using a second image or a numeric value. - + """ + Use fslmaths to perform mathematical operations using a second + image or a numeric value. """ input_spec = BinaryMathsInput class MultiImageMathsInput(MathsInput): - op_string = traits.String(position=4, argstr="%s", mandatory=True, desc="python formatted string of operations to perform") operand_files = InputMultiPath(File(exists=True), mandatory=True, desc="list of file names to plug into op string") + def _format_arg(self, name, spec, value): + if name == "op_string": + return value % tuple(self.operand_files) + return super(MultiImageMathsInput, self)._format_arg(name, spec, value) class MultiImageMaths(MathsCommand): """Use fslmaths to perform a sequence of mathematical operations. @@ -304,21 +277,17 @@ class MultiImageMaths(MathsCommand): >>> maths.inputs.in_file = "functional.nii" >>> maths.inputs.op_string = "-add %s -mul -1 -div %s" >>> maths.inputs.operand_files = ["functional2.nii", "functional3.nii"] - >>> maths.inputs.out_file = "functional4.nii" >>> maths.cmdline - 'fslmaths functional.nii -add functional2.nii -mul -1 -div functional3.nii functional4.nii' + 'fslmaths functional.nii -add functional2.nii -mul -1 -div functional3.nii functional_maths.nii.gz' """ input_spec = MultiImageMathsInput - def _format_arg(self, name, spec, value): - if name == "op_string": - return value % tuple(self.inputs.operand_files) - return super(MultiImageMaths, self)._format_arg(name, spec, value) - class TemporalFilterInput(MathsInput): - + out_file = GenFile( + template='{in_file}_filt{output_type_}', position=-2, argstr="%s", hash_files=False, + desc="image to write") lowpass_sigma = traits.Float(-1, argstr="%.6f", position=5, usedefault=True, desc="lowpass filter sigma (in volumes)") highpass_sigma = traits.Float(-1, argstr="-bptf %.6f", position=4, usedefault=True, @@ -326,8 +295,5 @@ class TemporalFilterInput(MathsInput): class TemporalFilter(MathsCommand): - """Use fslmaths to apply a low, high, or bandpass temporal filter to a timeseries. - - """ + """Use fslmaths to apply a low, high, or bandpass temporal filter to a timeseries. """ input_spec = TemporalFilterInput - _suffix = "_filt" diff --git a/nipype/interfaces/fsl/model.py b/nipype/interfaces/fsl/model.py index 90c2b4d004..e713125e61 100644 --- a/nipype/interfaces/fsl/model.py +++ b/nipype/interfaces/fsl/model.py @@ -1548,30 +1548,6 @@ class ClusterInputSpec(FSLCommandInputSpec): threshold = traits.Float(argstr='--thresh=%.10f', mandatory=True, desc='threshold for input volume') - out_index_file = traits.Either(traits.Bool, File, - argstr='--oindex=%s', - desc='output of cluster index (in size order)', hash_files=False) - out_threshold_file = traits.Either(traits.Bool, File, - argstr='--othresh=%s', - desc='thresholded image', hash_files=False) - out_localmax_txt_file = traits.Either(traits.Bool, File, - argstr='--olmax=%s', - desc='local maxima text file', hash_files=False) - out_localmax_vol_file = traits.Either(traits.Bool, File, - argstr='--olmaxim=%s', - desc='output of local maxima volume', hash_files=False) - out_size_file = traits.Either(traits.Bool, File, - argstr='--osize=%s', - desc='filename for output of size image', hash_files=False) - out_max_file = traits.Either(traits.Bool, File, - argstr='--omax=%s', - desc='filename for output of max image', hash_files=False) - out_mean_file = traits.Either(traits.Bool, File, - argstr='--omean=%s', - desc='filename for output of mean image', hash_files=False) - out_pval_file = traits.Either(traits.Bool, File, - argstr='--opvals=%s', - desc='filename for image output of log pvals', hash_files=False) pthreshold = traits.Float(argstr='--pthresh=%.10f', requires=['dlh', 'volume'], desc='p-threshold for clusters') @@ -1602,8 +1578,40 @@ class ClusterInputSpec(FSLCommandInputSpec): warpfield_file = File(argstr='--warpvol=%s', desc='file contining warpfield') + + out_index_file = traits.Either(traits.Bool, File, + argstr='--oindex=%s', + desc='output of cluster index (in size order)', hash_files=False) + out_threshold_file = traits.Either(traits.Bool, File, + argstr='--othresh=%s', + desc='thresholded image', hash_files=False) + out_localmax_txt_file = traits.Either(traits.Bool, File, + argstr='--olmax=%s', + desc='local maxima text file', hash_files=False) + out_localmax_vol_file = traits.Either(traits.Bool, File, + argstr='--olmaxim=%s', + desc='output of local maxima volume', hash_files=False) + out_size_file = traits.Either(traits.Bool, File, + argstr='--osize=%s', + desc='filename for output of size image', hash_files=False) + out_max_file = traits.Either(traits.Bool, File, + argstr='--omax=%s', + desc='filename for output of max image', hash_files=False) + out_mean_file = traits.Either(traits.Bool, File, + argstr='--omean=%s', + desc='filename for output of mean image', hash_files=False) + out_pval_file = traits.Either(traits.Bool, File, + argstr='--opvals=%s', + desc='filename for image output of log pvals', hash_files=False) + def _format_arg(self, name, spec, value): - if name in list(self.filemap.keys()): + filemap = {'out_index_file': 'index', 'out_threshold_file': 'threshold', + 'out_localmax_txt_file': 'localmax.txt', + 'out_localmax_vol_file': 'localmax', + 'out_size_file': 'size', 'out_max_file': 'max', + 'out_mean_file': 'mean', 'out_pval_file': 'pval'} + + if name in list(filemap.keys()): if isinstance(value, bool): fname = self._list_outputs()[name[4:]] else: @@ -1641,12 +1649,6 @@ class Cluster(FSLCommand): output_spec = ClusterOutputSpec _cmd = 'cluster' - filemap = {'out_index_file': 'index', 'out_threshold_file': 'threshold', - 'out_localmax_txt_file': 'localmax.txt', - 'out_localmax_vol_file': 'localmax', - 'out_size_file': 'size', 'out_max_file': 'max', - 'out_mean_file': 'mean', 'out_pval_file': 'pval'} - def _post_run(self): for key, suffix in list(self.filemap.items()): diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index 0326577ccf..e9812089b4 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -494,9 +494,9 @@ class FLIRTInputSpec(FSLCommandInputSpec): def parse_args(self, skip=None): skip = [] - if isdefined(self.inputs.save_log) and self.inputs.save_log: - if not isdefined(self.inputs.verbose) or self.inputs.verbose == 0: - self.inputs.verbose = 1 + if isdefined(self.save_log) and self.save_log: + if not isdefined(self.verbose) or self.verbose == 0: + self.verbose = 1 skip.append('save_log') return super(FLIRTInputSpec, self).parse_args(skip=skip) @@ -1213,37 +1213,37 @@ def parse_args(self, skip=None): if skip is None: skip = [] - input_phase = isdefined(self.inputs.phasemap_in_file) - input_vsm = isdefined(self.inputs.shift_in_file) - input_fmap = isdefined(self.inputs.fmap_in_file) + input_phase = isdefined(self.phasemap_in_file) + input_vsm = isdefined(self.shift_in_file) + input_fmap = isdefined(self.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): + if not isdefined(self.in_file): skip += ['unwarped_file', 'warped_file'] else: - if self.inputs.forward_warping: + if self.forward_warping: skip += ['unwarped_file'] - trait_spec = self.inputs.trait('warped_file') + trait_spec = self.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 = self.trait('unwarped_file') trait_spec.name_template = "%s_unwarped" trait_spec.name_source = 'in_file' trait_spec.output_name = 'unwarped_file' # Handle shift output - 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 not isdefined(self.shift_out_file): + vsm_save_masked = (isdefined(self.save_shift) and self.save_shift) + vsm_save_unmasked = (isdefined(self.save_unmasked_shift) and + self.save_unmasked_shift) if (vsm_save_masked or vsm_save_unmasked): - trait_spec = self.inputs.trait('shift_out_file') + trait_spec = self.trait('shift_out_file') trait_spec.output_name = 'shift_out_file' if input_fmap: @@ -1264,13 +1264,13 @@ def parse_args(self, skip=None): skip += ['save_shift', 'save_unmasked_shift', 'shift_out_file'] # Handle fieldmap output - 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 not isdefined(self.fmap_out_file): + fmap_save_masked = (isdefined(self.save_fmap) and self.save_fmap) + fmap_save_unmasked = (isdefined(self.save_unmasked_fmap) and + self.save_unmasked_fmap) if (fmap_save_masked or fmap_save_unmasked): - trait_spec = self.inputs.trait('fmap_out_file') + trait_spec = self.trait('fmap_out_file') trait_spec.output_name = 'fmap_out_file' if input_vsm: diff --git a/nipype/interfaces/fsl/tests/test_auto_ApplyMask.py b/nipype/interfaces/fsl/tests/test_auto_ApplyMask.py index d69086641d..3463489616 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ApplyMask.py +++ b/nipype/interfaces/fsl/tests/test_auto_ApplyMask.py @@ -25,9 +25,9 @@ def test_ApplyMask_inputs(): ), nan2zeros=dict(argstr='-nan', position=3, + usedefault=True, ), out_file=dict(argstr='%s', - genfile=True, hash_files=False, position=-2, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_ApplyTOPUP.py b/nipype/interfaces/fsl/tests/test_auto_ApplyTOPUP.py index 5ad4aa766d..6a9d904f8a 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ApplyTOPUP.py +++ b/nipype/interfaces/fsl/tests/test_auto_ApplyTOPUP.py @@ -37,8 +37,6 @@ def test_ApplyTOPUP_inputs(): method=dict(argstr='--method=%s', ), out_corrected=dict(argstr='--out=%s', - name_source=['in_files'], - name_template='%s_corrected', ), output_type=dict(usedefault=True, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX5.py b/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX5.py index f3b1d373cb..ffc8e96abb 100644 --- a/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX5.py +++ b/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX5.py @@ -23,8 +23,7 @@ def test_BEDPOSTX5_inputs(): dwi=dict(mandatory=True, ), dyads=dict(), - dyads_dispersion=dict(source_range='n_fibres+1', - ), + dyads_dispersion=dict(), environ=dict(nohash=True, usedefault=True, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_BinaryMaths.py b/nipype/interfaces/fsl/tests/test_auto_BinaryMaths.py index 8d55795fc0..86d19884cd 100644 --- a/nipype/interfaces/fsl/tests/test_auto_BinaryMaths.py +++ b/nipype/interfaces/fsl/tests/test_auto_BinaryMaths.py @@ -21,6 +21,7 @@ def test_BinaryMaths_inputs(): ), nan2zeros=dict(argstr='-nan', position=3, + usedefault=True, ), operand_file=dict(argstr='%s', mandatory=True, @@ -37,7 +38,6 @@ def test_BinaryMaths_inputs(): position=4, ), out_file=dict(argstr='%s', - genfile=True, hash_files=False, position=-2, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_ChangeDataType.py b/nipype/interfaces/fsl/tests/test_auto_ChangeDataType.py index 9cf46c3704..cd647821d9 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ChangeDataType.py +++ b/nipype/interfaces/fsl/tests/test_auto_ChangeDataType.py @@ -21,9 +21,9 @@ def test_ChangeDataType_inputs(): ), nan2zeros=dict(argstr='-nan', position=3, + usedefault=True, ), out_file=dict(argstr='%s', - genfile=True, hash_files=False, position=-2, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_ConvertWarp.py b/nipype/interfaces/fsl/tests/test_auto_ConvertWarp.py index 00e49ab1b8..5103834ff6 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ConvertWarp.py +++ b/nipype/interfaces/fsl/tests/test_auto_ConvertWarp.py @@ -27,9 +27,6 @@ def test_ConvertWarp_inputs(): xor=['out_relwarp'], ), out_file=dict(argstr='--out=%s', - name_source=['reference'], - name_template='%s_concatwarp', - output_name='out_file', position=-1, ), out_relwarp=dict(argstr='--relout', diff --git a/nipype/interfaces/fsl/tests/test_auto_ConvertXFM.py b/nipype/interfaces/fsl/tests/test_auto_ConvertXFM.py index 3999e6dacc..65edd5c25c 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ConvertXFM.py +++ b/nipype/interfaces/fsl/tests/test_auto_ConvertXFM.py @@ -9,7 +9,7 @@ def test_ConvertXFM_inputs(): concat_xfm=dict(argstr='-concat', position=-3, requires=['in_file2'], - xor=['invert_xfm', 'concat_xfm', 'fix_scale_skew', 'operation'], + xor=['invert_xfm', 'concat_xfm', 'fix_scale_skew'], ), environ=dict(nohash=True, usedefault=True, @@ -17,7 +17,7 @@ def test_ConvertXFM_inputs(): fix_scale_skew=dict(argstr='-fixscaleskew', position=-3, requires=['in_file2'], - xor=['invert_xfm', 'concat_xfm', 'fix_scale_skew', 'operation'], + xor=['invert_xfm', 'concat_xfm', 'fix_scale_skew'], ), ignore_exception=dict(nohash=True, usedefault=True, @@ -31,18 +31,16 @@ def test_ConvertXFM_inputs(): ), invert_xfm=dict(argstr='-inverse', position=-3, - xor=['invert_xfm', 'concat_xfm', 'fix_scale_skew', 'operation'], + xor=['invert_xfm', 'concat_xfm', 'fix_scale_skew'], ), operation=dict(argstr='-%s', mandatory=True, position=-3, usedefault=True, - xor=['invert_xfm', 'concat_xfm', 'fix_scale_skew', 'operation'], ), out_file=dict(argstr='-omat %s', hash_files=False, position=1, - template='{in_file}_{operation[:5]}.mat', ), output_type=dict(usedefault=True, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_DilateImage.py b/nipype/interfaces/fsl/tests/test_auto_DilateImage.py index 93352f4bd8..044ba1c605 100644 --- a/nipype/interfaces/fsl/tests/test_auto_DilateImage.py +++ b/nipype/interfaces/fsl/tests/test_auto_DilateImage.py @@ -32,13 +32,13 @@ def test_DilateImage_inputs(): ), nan2zeros=dict(argstr='-nan', position=3, + usedefault=True, ), operation=dict(argstr='-dil%s', mandatory=True, position=6, ), out_file=dict(argstr='%s', - genfile=True, hash_files=False, position=-2, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_ErodeImage.py b/nipype/interfaces/fsl/tests/test_auto_ErodeImage.py index e7db3aca70..98fe5f4b0b 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ErodeImage.py +++ b/nipype/interfaces/fsl/tests/test_auto_ErodeImage.py @@ -30,15 +30,15 @@ def test_ErodeImage_inputs(): position=5, xor=['kernel_file'], ), - minimum_filter=dict(argstr='%s', + minimum_filter=dict(argstr='-eroF', position=6, usedefault=True, ), nan2zeros=dict(argstr='-nan', position=3, + usedefault=True, ), out_file=dict(argstr='%s', - genfile=True, hash_files=False, position=-2, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_ExtractROI.py b/nipype/interfaces/fsl/tests/test_auto_ExtractROI.py index c594b3d50a..6a6f971128 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ExtractROI.py +++ b/nipype/interfaces/fsl/tests/test_auto_ExtractROI.py @@ -25,7 +25,6 @@ def test_ExtractROI_inputs(): roi_file=dict(argstr='%s', hash_files=False, position=1, - template='{in_file}_roi{output_type_}', ), t_min=dict(argstr='%d', position=8, diff --git a/nipype/interfaces/fsl/tests/test_auto_InvWarp.py b/nipype/interfaces/fsl/tests/test_auto_InvWarp.py index bd29137d3f..6d6fd72689 100644 --- a/nipype/interfaces/fsl/tests/test_auto_InvWarp.py +++ b/nipype/interfaces/fsl/tests/test_auto_InvWarp.py @@ -17,8 +17,6 @@ def test_InvWarp_inputs(): ), inverse_warp=dict(argstr='--out=%s', hash_files=False, - name_source=['warp'], - name_template='%s_inverse', ), jacobian_max=dict(argstr='--jmax=%f', ), diff --git a/nipype/interfaces/fsl/tests/test_auto_IsotropicSmooth.py b/nipype/interfaces/fsl/tests/test_auto_IsotropicSmooth.py index b96935037e..8c05b34ed4 100644 --- a/nipype/interfaces/fsl/tests/test_auto_IsotropicSmooth.py +++ b/nipype/interfaces/fsl/tests/test_auto_IsotropicSmooth.py @@ -26,9 +26,9 @@ def test_IsotropicSmooth_inputs(): ), nan2zeros=dict(argstr='-nan', position=3, + usedefault=True, ), out_file=dict(argstr='%s', - genfile=True, hash_files=False, position=-2, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_MathsCommand.py b/nipype/interfaces/fsl/tests/test_auto_MathsCommand.py index 7608c9ce3f..740604db08 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MathsCommand.py +++ b/nipype/interfaces/fsl/tests/test_auto_MathsCommand.py @@ -21,9 +21,9 @@ def test_MathsCommand_inputs(): ), nan2zeros=dict(argstr='-nan', position=3, + usedefault=True, ), out_file=dict(argstr='%s', - genfile=True, hash_files=False, position=-2, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_MaxImage.py b/nipype/interfaces/fsl/tests/test_auto_MaxImage.py index 6f5520a74f..e71e5018bb 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MaxImage.py +++ b/nipype/interfaces/fsl/tests/test_auto_MaxImage.py @@ -25,9 +25,9 @@ def test_MaxImage_inputs(): ), nan2zeros=dict(argstr='-nan', position=3, + usedefault=True, ), out_file=dict(argstr='%s', - genfile=True, hash_files=False, position=-2, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_MeanImage.py b/nipype/interfaces/fsl/tests/test_auto_MeanImage.py index fa3127ec9a..dfc34fc27c 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MeanImage.py +++ b/nipype/interfaces/fsl/tests/test_auto_MeanImage.py @@ -25,9 +25,9 @@ def test_MeanImage_inputs(): ), nan2zeros=dict(argstr='-nan', position=3, + usedefault=True, ), out_file=dict(argstr='%s', - genfile=True, hash_files=False, position=-2, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_MotionOutliers.py b/nipype/interfaces/fsl/tests/test_auto_MotionOutliers.py index 0a1d1f0a0c..7c6565c4ef 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MotionOutliers.py +++ b/nipype/interfaces/fsl/tests/test_auto_MotionOutliers.py @@ -25,21 +25,12 @@ def test_MotionOutliers_inputs(): ), out_file=dict(argstr='-o %s', hash_files=False, - keep_extension=True, - name_source='in_file', - name_template='%s_outliers.txt', ), out_metric_plot=dict(argstr='-p %s', hash_files=False, - keep_extension=True, - name_source='in_file', - name_template='%s_metrics.png', ), out_metric_values=dict(argstr='-s %s', hash_files=False, - keep_extension=True, - name_source='in_file', - name_template='%s_metrics.txt', ), output_type=dict(usedefault=True, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_MultiImageMaths.py b/nipype/interfaces/fsl/tests/test_auto_MultiImageMaths.py index 328acd04d6..bb4247c08d 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MultiImageMaths.py +++ b/nipype/interfaces/fsl/tests/test_auto_MultiImageMaths.py @@ -21,6 +21,7 @@ def test_MultiImageMaths_inputs(): ), nan2zeros=dict(argstr='-nan', position=3, + usedefault=True, ), op_string=dict(argstr='%s', mandatory=True, @@ -29,7 +30,6 @@ def test_MultiImageMaths_inputs(): operand_files=dict(mandatory=True, ), out_file=dict(argstr='%s', - genfile=True, hash_files=False, position=-2, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_PlotTimeSeries.py b/nipype/interfaces/fsl/tests/test_auto_PlotTimeSeries.py index 02a746708a..680f90c272 100644 --- a/nipype/interfaces/fsl/tests/test_auto_PlotTimeSeries.py +++ b/nipype/interfaces/fsl/tests/test_auto_PlotTimeSeries.py @@ -18,6 +18,7 @@ def test_PlotTimeSeries_inputs(): sep=',', ), labels=dict(argstr='-a %s', + sep=',', ), legend_file=dict(argstr='--legend=%s', ), diff --git a/nipype/interfaces/fsl/tests/test_auto_SpatialFilter.py b/nipype/interfaces/fsl/tests/test_auto_SpatialFilter.py index 5b232a50b8..3c02cef908 100644 --- a/nipype/interfaces/fsl/tests/test_auto_SpatialFilter.py +++ b/nipype/interfaces/fsl/tests/test_auto_SpatialFilter.py @@ -32,13 +32,13 @@ def test_SpatialFilter_inputs(): ), nan2zeros=dict(argstr='-nan', position=3, + usedefault=True, ), operation=dict(argstr='-f%s', mandatory=True, position=6, ), out_file=dict(argstr='%s', - genfile=True, hash_files=False, position=-2, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_TOPUP.py b/nipype/interfaces/fsl/tests/test_auto_TOPUP.py index 0273ceefc0..80520511fe 100644 --- a/nipype/interfaces/fsl/tests/test_auto_TOPUP.py +++ b/nipype/interfaces/fsl/tests/test_auto_TOPUP.py @@ -50,12 +50,13 @@ def test_TOPUP_inputs(): out_field=dict(argstr='--fout=%s', hash_files=False, ), - out_fieldcoef=dict(argstr='--fout=%s', - hash_files=False, + out_fieldcoef=dict(hash_files=False, ), out_logfile=dict(argstr='--logout=%s', hash_files=False, ), + out_movpar=dict(hash_files=False, + ), output_type=dict(usedefault=True, ), readout_times=dict(mandatory=True, diff --git a/nipype/interfaces/fsl/tests/test_auto_TemporalFilter.py b/nipype/interfaces/fsl/tests/test_auto_TemporalFilter.py index f052a4248e..b53f74ed23 100644 --- a/nipype/interfaces/fsl/tests/test_auto_TemporalFilter.py +++ b/nipype/interfaces/fsl/tests/test_auto_TemporalFilter.py @@ -29,9 +29,9 @@ def test_TemporalFilter_inputs(): ), nan2zeros=dict(argstr='-nan', position=3, + usedefault=True, ), out_file=dict(argstr='%s', - genfile=True, hash_files=False, position=-2, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_Threshold.py b/nipype/interfaces/fsl/tests/test_auto_Threshold.py index b778c98d67..866f5a93a7 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Threshold.py +++ b/nipype/interfaces/fsl/tests/test_auto_Threshold.py @@ -23,9 +23,9 @@ def test_Threshold_inputs(): ), nan2zeros=dict(argstr='-nan', position=3, + usedefault=True, ), out_file=dict(argstr='%s', - genfile=True, hash_files=False, position=-2, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_UnaryMaths.py b/nipype/interfaces/fsl/tests/test_auto_UnaryMaths.py index 9b3356bcec..7836d0ca3a 100644 --- a/nipype/interfaces/fsl/tests/test_auto_UnaryMaths.py +++ b/nipype/interfaces/fsl/tests/test_auto_UnaryMaths.py @@ -21,13 +21,13 @@ def test_UnaryMaths_inputs(): ), nan2zeros=dict(argstr='-nan', position=3, + usedefault=True, ), operation=dict(argstr='-%s', mandatory=True, position=4, ), out_file=dict(argstr='%s', - genfile=True, hash_files=False, position=-2, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_WarpUtils.py b/nipype/interfaces/fsl/tests/test_auto_WarpUtils.py index 7457df2102..06b90eddfe 100644 --- a/nipype/interfaces/fsl/tests/test_auto_WarpUtils.py +++ b/nipype/interfaces/fsl/tests/test_auto_WarpUtils.py @@ -18,9 +18,6 @@ def test_WarpUtils_inputs(): knot_space=dict(argstr='--knotspace=%d,%d,%d', ), out_file=dict(argstr='--out=%s', - keep_extension=True, - name_source=['in_file'], - name_template='%s_coeffs', position=-1, ), out_format=dict(argstr='--outformat=%s', diff --git a/nipype/interfaces/fsl/tests/test_base.py b/nipype/interfaces/fsl/tests/test_base.py index 03a211dcde..06366a6139 100644 --- a/nipype/interfaces/fsl/tests/test_base.py +++ b/nipype/interfaces/fsl/tests/test_base.py @@ -20,13 +20,6 @@ def test_fslversion(): yield assert_equal, None, ver -def test_fsloutputtype(): - types = list(fsl.Info.ftypes.keys()) - orig_out_type = fsl.Info.output_type() - yield assert_true, orig_out_type in types - yield assert_raises, KeyError, lambda: fsl.Info.ftypes['JUNK'] - - def test_FSLCommand(): # Most methods in FSLCommand are tested in the subclasses. Only # testing the one item that is not. @@ -42,7 +35,7 @@ def test_FSLCommandInputSpec(): def test_FSLCommand2(): cmd = fsl.FSLCommand(command='junk') - yield assert_equal, cmd.inputs.environ['FSLOUTPUTTYPE'], cmd.inputs.output_type + yield assert_equal, cmd.inputs.environ.get('FSLOUTPUTTYPE'), cmd.inputs.output_type for out_type in fsl.Info.ftypes: cmd.inputs.output_type = out_type yield assert_equal, cmd.inputs.output_type_, fsl.Info.ftypes[out_type] diff --git a/nipype/interfaces/fsl/utils.py b/nipype/interfaces/fsl/utils.py index bc36e7ce2b..c5b5130ecc 100644 --- a/nipype/interfaces/fsl/utils.py +++ b/nipype/interfaces/fsl/utils.py @@ -32,8 +32,8 @@ isdefined, Undefined) from ...utils.filemanip import (load_json, save_json, split_filename, fname_presuffix, copyfile) - -warn = warnings.warn +from ... import logging +IFLOGGER = logging.getLogger('interface') class CopyGeomInputSpec(FSLCommandInputSpec): @@ -132,8 +132,7 @@ class SmoothInputSpec(FSLCommandInputSpec): def _format_arg(self, name, trait_spec, value): if name == 'fwhm': - sigma = float(value) / np.sqrt(8 * np.log(2)) - return super(SmoothInputSpec, self)._format_arg(name, trait_spec, sigma) + value = float(value) / np.sqrt(8 * np.log(2)) return super(SmoothInputSpec, self)._format_arg(name, trait_spec, value) class SmoothOutputSpec(TraitedSpec): @@ -149,6 +148,7 @@ class Smooth(FSLCommand): Setting the kernel width using sigma: + >>> from nipype.interfaces.fsl import Smooth >>> sm = Smooth() >>> sm.inputs.in_file = 'functional2.nii' >>> sm.inputs.sigma = 8.0 @@ -165,13 +165,12 @@ class Smooth(FSLCommand): One of sigma or fwhm must be set: - >>> from nipype.interfaces.fsl import Smooth >>> sm = Smooth() >>> sm.inputs.in_file = 'functional2.nii' >>> sm.cmdline #doctest: +ELLIPSIS Traceback (most recent call last): ... - ValueError: Smooth requires a value for one of the inputs ... + ValueError: ... """ @@ -181,8 +180,8 @@ class Smooth(FSLCommand): class MergeInputSpec(FSLCommandInputSpec): - in_files = traits.List(File(exists=True), argstr='%s', position=2, - mandatory=True) + in_files = InputMultiPath(File(exists=True), argstr='%s', position=2, + mandatory=True) dimension = traits.Enum( 't', 'x', 'y', 'z', 'a', argstr='-%s', position=0, mandatory=True, desc='dimension along which to merge, optionally set tr input when' @@ -190,8 +189,9 @@ class MergeInputSpec(FSLCommandInputSpec): tr = traits.Float(position=-1, argstr='%.2f', desc='use to specify TR in seconds (default is 1.00 sec), ' 'overrides dimension and sets it to tr') - merged_file = GenFile(template='{in_files[0]}_merged', argstr='%s', position=1, - hash_files=False, desc='output, merged file') + merged_file = GenFile( + template='{in_files[0]}_merged{output_type_}', argstr='%s', position=1, + hash_files=False, desc='output, merged file') def _format_arg(self, name, spec, value): if name == 'tr': @@ -243,9 +243,8 @@ class Merge(FSLCommand): class ExtractROIInputSpec(FSLCommandInputSpec): in_file = File(exists=True, argstr='%s', position=0, desc='input file', mandatory=True) - roi_file = File(template='{in_file}_roi{output_type_}', - argstr='%s', position=1, hash_files=False, - desc='output file') + roi_file = GenFile(template='{in_file}_roi{output_type_}', argstr='%s', position=1, + hash_files=False, desc='output file') x_min = traits.Int(argstr='%d', position=2) x_size = traits.Int(argstr='%d', position=3) y_min = traits.Int(argstr='%d', position=4) @@ -361,7 +360,7 @@ class ImageMaths(FSLCommand): >>> from nipype.interfaces import fsl >>> from nipype.testing import anatfile >>> maths = fsl.ImageMaths() - >>> maths.inputs.in_file = anatomical.nii + >>> maths.inputs.in_file = 'anatomical.nii' >>> maths.inputs.op_string= '-add 5' >>> maths.cmdline 'fslmaths anatomical.nii -add 5 anatomical_maths.nii.gz' @@ -650,7 +649,7 @@ class Overlay(FSLCommand): >>> combine.inputs.stat_thresh = (3.5, 10) >>> combine.inputs.show_negative_stats = True >>> combine.cmdline - '' + 'overlay 1 0 mean_func.nii.gz -a zstat1.nii.gz 3.50 10.00 zstat1.nii.gz -3.50 -10.00 overlay.nii.gz' >>> res = combine.run() #doctest: +SKIP @@ -716,7 +715,7 @@ class SlicerInputSpec(FSLCommandInputSpec): def _format_arg(self, name, spec, value): if name == 'show_orientation': return None if value else '-u' - return super(Slicer, self)._format_arg(name, spec, value) + return super(SlicerInputSpec, self)._format_arg(name, spec, value) class SlicerOutputSpec(TraitedSpec): @@ -736,7 +735,7 @@ class Slicer(FSLCommand): >>> slice.inputs.all_axial = True >>> slice.inputs.image_width = 750 >>> slice.cmdline - '' + 'slicer functional.nii -L -A 750 functional.png' >>> res = slice.run() #doctest: +SKIP @@ -800,7 +799,7 @@ class PlotTimeSeries(FSLCommand): >>> plotter.inputs.title = 'Functional timeseries' >>> plotter.inputs.labels = ['run1', 'run2'] >>> plotter.cmdline - 'fsl_tsplot functional.par,functional.par -a run1,run2 -t 'Functional timeseries' -u 1' + "fsl_tsplot functional.par,functional.par -a run1,run2 -t 'Functional timeseries' -u 1" >>> plotter.run() #doctest: +SKIP @@ -873,6 +872,7 @@ class PlotMotionParams(FSLCommand): >>> plotter.inputs.in_source = 'fsl' >>> plotter.inputs.plot_type = 'rotations' >>> plotter.cmdline + "fsl_tsplot -i functional.par -t 'MCFLIRT estimated rotations (radians)' --start=1 --finish=3 -a x,y,z" >>> res = plotter.run() #doctest: +SKIP @@ -899,7 +899,7 @@ class ConvertXFMInputSpec(FSLCommandInputSpec): desc='second input matrix (for use with fix_scale_skew or ' 'concat_xfm') operation = traits.Enum( - 'invert', 'concat', 'fixscaleskew', usedefault=True, mandatory=True, + 'inverse', 'concat', 'fixscaleskew', usedefault=True, mandatory=True, argstr='-%s', position=-3, desc='operation mode') _options = ['invert_xfm', 'concat_xfm', 'fix_scale_skew'] @@ -913,22 +913,22 @@ class ConvertXFMInputSpec(FSLCommandInputSpec): xor=_options, requires=['in_file2'], desc='use secondary matrix to fix scale and ' 'skew') - out_file = File(template='{in_file}_{operation[:5]}.mat', argstr='-omat %s', position=1, - desc='final transformation matrix', hash_files=False) + out_file = GenFile(template='{in_file}_{operation[:5]}.mat', argstr='-omat %s', position=1, + desc='final transformation matrix', hash_files=False) def parse_args(self, skip=None): if skip is None: skip = [] - if isdefined(self.inputs.invert_xfm) and self.inputs.invert_xfm: - self.inputs.invert_xfm = Undefined - self.inputs.operation = 'invert' - if isdefined(self.inputs.concat_xfm) and self.inputs.concat_xfm: - self.inputs.concat_xfm = Undefined - self.inputs.operation = 'concat' - if isdefined(self.inputs.fix_scale_skew) and self.inputs.fix_scale_skew: - self.inputs.fix_scale_skew = Undefined - self.inputs.operation = 'fixscaleskew' + if isdefined(self.invert_xfm) and self.invert_xfm: + self.invert_xfm = Undefined + self.operation = 'inverse' + if isdefined(self.concat_xfm) and self.concat_xfm: + self.concat_xfm = Undefined + self.operation = 'concat' + if isdefined(self.fix_scale_skew) and self.fix_scale_skew: + self.fix_scale_skew = Undefined + self.operation = 'fixscaleskew' skip += ['invert_xfm', 'concat_xfm', 'fix_scale_skew'] return super(ConvertXFMInputSpec, self).parse_args(skip) @@ -949,7 +949,7 @@ class ConvertXFM(FSLCommand): >>> invt.inputs.in_file = 'flirt.mat' >>> invt.inputs.invert_xfm = True >>> invt.cmdline - 'convert_xfm -omat flirt_converted.mat -inverse flirt.mat' + 'convert_xfm -omat flirt_inverse.mat -inverse flirt.mat' """ @@ -1160,14 +1160,6 @@ class InvWarpInputSpec(FSLCommandInputSpec): 'space that was used to create the --warp file. It ' 'would typically be the file that was specified ' 'with the --in argument when running fnirt.') - inverse_warp = File(argstr='--out=%s', name_source=['warp'], - hash_files=False, name_template='%s_inverse', - desc='Name of output file, containing warps that are ' - 'the \'reverse\' of those in --warp. This will be ' - 'a field-file (rather than a file of spline ' - 'coefficients), and it will have any affine ' - 'component included as part of the ' - 'displacements.') absolute = traits.Bool(argstr='--abs', xor=['relative'], desc='If set it indicates that the warps in --warp ' 'should be interpreted as absolute, provided ' @@ -1195,6 +1187,11 @@ class InvWarpInputSpec(FSLCommandInputSpec): jacobian_max = traits.Float(argstr='--jmax=%f', desc='Maximum acceptable Jacobian value for ' 'constraint (default 100.0)') + inverse_warp = GenFile( + template='{warp}_inverse{output_type_}', argstr='--out=%s', hash_files=False, + desc='Name of output file, containing warps that are the \'reverse\' of those in' + ' --warp. This will be a field-file (rather than a file of spline coefficients),' + ' and it will have any affine component included as part of the displacements.') class InvWarpOutputSpec(TraitedSpec): @@ -1463,11 +1460,11 @@ class ConvertWarpInputSpec(FSLCommandInputSpec): reference = File(exists=True, argstr='--ref=%s', mandatory=True, position=1, desc='Name of a file in target space of the full transform.') - out_file = File(argstr='--out=%s', position=-1, name_source=['reference'], - name_template='%s_concatwarp', output_name='out_file', - desc='Name of output file, containing warps that are the combination of all ' - 'those given as arguments. The format of this will be a field-file (rather ' - 'than spline coefficients) with any affine components included.') + out_file = GenFile( + template='{reference}_concatwarp{output_type_}', argstr='--out=%s', position=-1, + desc='Name of output file, containing warps that are the combination of all ' + 'those given as arguments. The format of this will be a field-file (rather ' + 'than spline coefficients) with any affine components included.') premat = File(exists=True, argstr='--premat=%s', desc='filename for pre-transform (affine matrix)') @@ -1807,8 +1804,6 @@ class WarpPointsToStd(WarpPoints): class MotionOutliersInputSpec(FSLCommandInputSpec): in_file = File(exists=True, mandatory=True, desc='unfiltered 4D image', argstr='-i %s') - out_file = File(argstr='-o %s', name_source='in_file', name_template='%s_outliers.txt', - keep_extension=True, desc='output outlier file name', hash_files=False) mask = File(exists=True, argstr='-m %s', desc='mask image for calculating metric') metric = traits.Enum('refrms', ['refrms', 'dvars', 'refmse', 'fd', 'fdrms'], argstr='--%s', desc="metrics: refrms - RMS intensity difference to reference volume as metric [default metric],\ refmse - Mean Square Error version of refrms (used in original version of fsl_motion_outliers) \ @@ -1818,10 +1813,13 @@ class MotionOutliersInputSpec(FSLCommandInputSpec): threshold = traits.Float(argstr='--thresh=%g', desc="specify absolute threshold value (otherwise use box-plot cutoff = P75 + 1.5*IQR)") no_motion_correction = traits.Bool(argstr='--nomoco', desc='do not run motion correction (assumed already done)') dummy = traits.Int(argstr='--dummy=%d', desc='number of dummy scans to delete (before running anything and creating EVs)') - out_metric_values = File(argstr='-s %s', name_source='in_file', name_template='%s_metrics.txt', - keep_extension=True, desc='output metric values (DVARS etc.) file name', hash_files=False) - out_metric_plot = File(argstr='-p %s', name_source='in_file', name_template='%s_metrics.png', - keep_extension=True, desc='output metric values plot (DVARS etc.) file name', hash_files=False) + + out_file = GenFile(template='{in_file}_outliers.txt', argstr='-o %s', hash_files=False, + desc='output outlier file name') + out_metric_values = GenFile(template='{in_file}_metrics.txt', argstr='-s %s', hash_files=False, + desc='output metric values (DVARS etc.) file name') + out_metric_plot = GenFile(template='{in_file}_metrics.png', argstr='-p %s', hash_files=False, + desc='output metric values plot (DVARS etc.) file name') class MotionOutliersOutputSpec(TraitedSpec): diff --git a/nipype/interfaces/specs.py b/nipype/interfaces/specs.py index 6d02fffa4e..ac165cf783 100644 --- a/nipype/interfaces/specs.py +++ b/nipype/interfaces/specs.py @@ -408,10 +408,10 @@ def check_inputs(self): if xor_spec is None: xor_spec = [] - if not any([isdefined(xname) for xname in xor_spec]): + if xor_spec and not any([isdefined(getattr(self, xname)) for xname in xor_spec]): raise ValueError( - '%s requires a value for one of these inputs \'%s\'. For a list of required inputs, ' - 'see %s.help()' % (self.__class__.__name__, xor_spec, self.__class__.__name__)) + '%s requires a value for one of these inputs %s. For a list of required inputs, ' + 'see %s.help()' % (self.__class__.__name__, [name] + xor_spec, self.__class__.__name__)) self._check_requires(name) for elem in list(self.optional_items()): diff --git a/nipype/interfaces/traits_extension.py b/nipype/interfaces/traits_extension.py index b1051b9515..8eaf73800f 100644 --- a/nipype/interfaces/traits_extension.py +++ b/nipype/interfaces/traits_extension.py @@ -121,9 +121,6 @@ def __init__(self, value='', filter=None, auto_set=False, super(File, self).__init__(value, filter, auto_set, entries, exists, **metadata) - def isfile(self, obj, name): - return True - class GenFile(File): """ A file which default name is automatically generated from other @@ -220,11 +217,12 @@ def get(self, obj, name): vallist = list(srcvalue) outvals = [] + + isfile = obj.trait(nsrc).is_trait_type(( + File, MultiPath, GenMultiFile)) for val in vallist: - try: + if isfile: _, val, ext = split_filename(val) - except: - pass if isdefined(val): outvals.append(val) @@ -424,11 +422,12 @@ def get(self, obj, name): vallist = list(srcvalue) outvals = [] + + isfile = obj.trait(nsrc).is_trait_type(( + File, MultiPath, GenMultiFile)) for val in vallist: - try: + if isfile: _, val, ext = split_filename(val) - except: - pass if isdefined(val): outvals.append(val) diff --git a/nipype/utils/filemanip.py b/nipype/utils/filemanip.py index 18f659d63e..c5a83e86b7 100644 --- a/nipype/utils/filemanip.py +++ b/nipype/utils/filemanip.py @@ -84,22 +84,12 @@ def split_filename(fname): """ - special_extensions = [".nii.gz", ".tar.gz"] - pth = os.path.dirname(fname) fname = os.path.basename(fname) - - ext = None - for special_ext in special_extensions: - ext_len = len(special_ext) - if (len(fname) > ext_len) and \ - (fname[-ext_len:].lower() == special_ext.lower()): - ext = fname[-ext_len:] - fname = fname[:-ext_len] - break - if not ext: - fname, ext = os.path.splitext(fname) - + fname, ext = os.path.splitext(fname) + if ext == '.gz': + fname, ext2 = os.path.splitext(fname) + ext = ext2 + ext return pth, fname, ext From cac167ab2f0915399bd2afc8b625ced25ef299f7 Mon Sep 17 00:00:00 2001 From: oesteban Date: Fri, 19 Feb 2016 21:20:46 -0800 Subject: [PATCH 53/73] fix Cluster --- nipype/interfaces/fsl/model.py | 93 +++++++++---------- .../interfaces/fsl/tests/test_auto_Cluster.py | 28 ++++-- 2 files changed, 67 insertions(+), 54 deletions(-) diff --git a/nipype/interfaces/fsl/model.py b/nipype/interfaces/fsl/model.py index e713125e61..f8287be3cf 100644 --- a/nipype/interfaces/fsl/model.py +++ b/nipype/interfaces/fsl/model.py @@ -25,7 +25,7 @@ from ... import LooseVersion from .base import (FSLCommand, FSLCommandInputSpec, Info) -from ..base import (load_template, File, traits, isdefined, +from ..base import (load_template, File, GenFile, traits, isdefined, TraitedSpec, BaseInterface, Directory, InputMultiPath, OutputMultiPath, BaseInterfaceInputSpec) @@ -1579,56 +1579,55 @@ class ClusterInputSpec(FSLCommandInputSpec): desc='file contining warpfield') - out_index_file = traits.Either(traits.Bool, File, - argstr='--oindex=%s', - desc='output of cluster index (in size order)', hash_files=False) - out_threshold_file = traits.Either(traits.Bool, File, - argstr='--othresh=%s', - desc='thresholded image', hash_files=False) - out_localmax_txt_file = traits.Either(traits.Bool, File, - argstr='--olmax=%s', - desc='local maxima text file', hash_files=False) - out_localmax_vol_file = traits.Either(traits.Bool, File, - argstr='--olmaxim=%s', - desc='output of local maxima volume', hash_files=False) - out_size_file = traits.Either(traits.Bool, File, - argstr='--osize=%s', - desc='filename for output of size image', hash_files=False) - out_max_file = traits.Either(traits.Bool, File, - argstr='--omax=%s', - desc='filename for output of max image', hash_files=False) - out_mean_file = traits.Either(traits.Bool, File, - argstr='--omean=%s', - desc='filename for output of mean image', hash_files=False) - out_pval_file = traits.Either(traits.Bool, File, - argstr='--opvals=%s', - desc='filename for image output of log pvals', hash_files=False) - - def _format_arg(self, name, spec, value): - filemap = {'out_index_file': 'index', 'out_threshold_file': 'threshold', - 'out_localmax_txt_file': 'localmax.txt', - 'out_localmax_vol_file': 'localmax', - 'out_size_file': 'size', 'out_max_file': 'max', - 'out_mean_file': 'mean', 'out_pval_file': 'pval'} - - if name in list(filemap.keys()): - if isinstance(value, bool): - fname = self._list_outputs()[name[4:]] - else: - fname = value - return spec.argstr % fname - return super(ClusterInputSpec, self)._format_arg(name, spec, value) + out_index_file = GenFile( + template='{in_file}_index{output_type_}', argstr='--oindex=%s', hash_files=False, + desc='output of cluster index (in size order)') + out_threshold_file = GenFile( + template='{in_file}_threshold{output_type_}', argstr='--othresh=%s', hash_files=False, + desc='thresholded image') + out_localmax_txt_file = GenFile(template='{in_file}_localmax.txt', argstr='--olmax=%s', + hash_files=False, desc='local maxima text file') + out_localmax_vol_file = GenFile( + template='{in_file}_localmax{output_type_}', argstr='--olmaxim=%s', hash_files=False, + desc='output of local maxima volume') + out_size_file = GenFile(template='{in_file}_size{output_type_}', argstr='--osize=%s', + hash_files=False, desc='filename for output of size image') + out_max_file = GenFile(template='{in_file}_max{output_type_}', argstr='--omax=%s', + hash_files=False, desc='filename for output of max image') + out_mean_file = GenFile(template='{in_file}_mean{output_type_}', argstr='--omean=%s', + hash_files=False, desc='filename for output of mean image') + out_pval_file = GenFile(template='{in_file}_pval{output_type_}', argstr='--opvals=%s', + hash_files=False, desc='filename for image output of log pvals') + + save_threshold_file = traits.Bool(False, usedefault=True, desc='enable this output') + save_localmax_txt_file = traits.Bool(False, usedefault=True, desc='enable this output') + save_localmax_vol_file = traits.Bool(False, usedefault=True, desc='enable this output') + save_size_file = traits.Bool(False, usedefault=True, desc='enable this output') + save_max_file = traits.Bool(False, usedefault=True, desc='enable this output') + save_mean_file = traits.Bool(False, usedefault=True, desc='enable this output') + save_pval_file = traits.Bool(False, usedefault=True, desc='enable this output') + + def parse_args(self, skip=None): + if skip is None: + skip = [] + + for name, _ in list(self.items()): + if not name.startswith('save_'): + continue + if getattr(self, name): + skip += ['out_' + name[5:]] + return super(ClusterInputSpec, self).parse_args(skip) class ClusterOutputSpec(TraitedSpec): index_file = File(desc='output of cluster index (in size order)') - threshold_file = File(desc='thresholded image') - localmax_txt_file = File(desc='local maxima text file') - localmax_vol_file = File(desc='output of local maxima volume') - size_file = File(desc='filename for output of size image') - max_file = File(desc='filename for output of max image') - mean_file = File(desc='filename for output of mean image') - pval_file = File(desc='filename for image output of log pvals') + out_threshold_file = File(desc='thresholded image') + out_localmax_txt_file = File(desc='local maxima text file') + out_localmax_vol_file = File(desc='output of local maxima volume') + out_size_file = File(desc='filename for output of size image') + out_max_file = File(desc='filename for output of max image') + out_mean_file = File(desc='filename for output of mean image') + out_pval_file = File(desc='filename for image output of log pvals') class Cluster(FSLCommand): diff --git a/nipype/interfaces/fsl/tests/test_auto_Cluster.py b/nipype/interfaces/fsl/tests/test_auto_Cluster.py index 7b380dd066..598a08969d 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Cluster.py +++ b/nipype/interfaces/fsl/tests/test_auto_Cluster.py @@ -59,6 +59,20 @@ def test_Cluster_inputs(): pthreshold=dict(argstr='--pthresh=%.10f', requires=['dlh', 'volume'], ), + save_localmax_txt_file=dict(usedefault=True, + ), + save_localmax_vol_file=dict(usedefault=True, + ), + save_max_file=dict(usedefault=True, + ), + save_mean_file=dict(usedefault=True, + ), + save_pval_file=dict(usedefault=True, + ), + save_size_file=dict(usedefault=True, + ), + save_threshold_file=dict(usedefault=True, + ), std_space_file=dict(argstr='--stdvol=%s', ), terminal_output=dict(nohash=True, @@ -83,13 +97,13 @@ def test_Cluster_inputs(): def test_Cluster_outputs(): output_map = dict(index_file=dict(), - localmax_txt_file=dict(), - localmax_vol_file=dict(), - max_file=dict(), - mean_file=dict(), - pval_file=dict(), - size_file=dict(), - threshold_file=dict(), + out_localmax_txt_file=dict(), + out_localmax_vol_file=dict(), + out_max_file=dict(), + out_mean_file=dict(), + out_pval_file=dict(), + out_size_file=dict(), + out_threshold_file=dict(), ) outputs = Cluster.output_spec() From 95e973429f13480f704b1e83087b0bad85545fb4 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Sat, 20 Feb 2016 11:28:15 -0800 Subject: [PATCH 54/73] minor fixes in fsl.model --- nipype/interfaces/fsl/model.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nipype/interfaces/fsl/model.py b/nipype/interfaces/fsl/model.py index f8287be3cf..d953ca8b40 100644 --- a/nipype/interfaces/fsl/model.py +++ b/nipype/interfaces/fsl/model.py @@ -1581,7 +1581,7 @@ class ClusterInputSpec(FSLCommandInputSpec): out_index_file = GenFile( template='{in_file}_index{output_type_}', argstr='--oindex=%s', hash_files=False, - desc='output of cluster index (in size order)') + desc='output of cluster index (in size order)', output_name='index_file') out_threshold_file = GenFile( template='{in_file}_threshold{output_type_}', argstr='--othresh=%s', hash_files=False, desc='thresholded image') @@ -1599,6 +1599,7 @@ class ClusterInputSpec(FSLCommandInputSpec): out_pval_file = GenFile(template='{in_file}_pval{output_type_}', argstr='--opvals=%s', hash_files=False, desc='filename for image output of log pvals') + save_index_file = traits.Bool(False, usedefault=True, desc='enable this output') save_threshold_file = traits.Bool(False, usedefault=True, desc='enable this output') save_localmax_txt_file = traits.Bool(False, usedefault=True, desc='enable this output') save_localmax_vol_file = traits.Bool(False, usedefault=True, desc='enable this output') @@ -1614,9 +1615,8 @@ def parse_args(self, skip=None): for name, _ in list(self.items()): if not name.startswith('save_'): continue - if getattr(self, name): + if not getattr(self, name): skip += ['out_' + name[5:]] - return super(ClusterInputSpec, self).parse_args(skip) class ClusterOutputSpec(TraitedSpec): From ef0caf594de639cf9d50343ce2faffdbf9294166 Mon Sep 17 00:00:00 2001 From: oesteban Date: Sat, 20 Feb 2016 13:33:41 -0800 Subject: [PATCH 55/73] added complex substring indexing in replacement --- .../interfaces/fsl/tests/test_auto_Cluster.py | 3 + nipype/interfaces/traits_extension.py | 72 ++++++++++--------- 2 files changed, 43 insertions(+), 32 deletions(-) diff --git a/nipype/interfaces/fsl/tests/test_auto_Cluster.py b/nipype/interfaces/fsl/tests/test_auto_Cluster.py index 598a08969d..dc374701ef 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Cluster.py +++ b/nipype/interfaces/fsl/tests/test_auto_Cluster.py @@ -30,6 +30,7 @@ def test_Cluster_inputs(): ), out_index_file=dict(argstr='--oindex=%s', hash_files=False, + output_name='index_file', ), out_localmax_txt_file=dict(argstr='--olmax=%s', hash_files=False, @@ -59,6 +60,8 @@ def test_Cluster_inputs(): pthreshold=dict(argstr='--pthresh=%.10f', requires=['dlh', 'volume'], ), + save_index_file=dict(usedefault=True, + ), save_localmax_txt_file=dict(usedefault=True, ), save_localmax_vol_file=dict(usedefault=True, diff --git a/nipype/interfaces/traits_extension.py b/nipype/interfaces/traits_extension.py index 8eaf73800f..154b0e602a 100644 --- a/nipype/interfaces/traits_extension.py +++ b/nipype/interfaces/traits_extension.py @@ -19,6 +19,7 @@ import re import itertools as itools +from ast import literal_eval from ..external.six import string_types # perform all external trait imports here import traits @@ -166,19 +167,14 @@ def __init__(self, template=None, keep_extension=False, value='', if template is None or not isinstance(template, string_types): raise TraitError('GenFile requires a valid template argument') - self.name_source = [i[1:-1].split('.')[0].split('!')[0].split(':')[0].split('[')[0] - for i in re.findall('\{.*?\}', template)] + self.name_source = list(_parse_name_source(template)) + # Remove range indexing tokens (not allowed by string.Formatter) + for _, itoken, _ in self.name_source: + if itoken: + template = template.replace(itoken, '') + self.template = template.format self.keep_ext = keep_extension - - for nsrc in self.name_source: - if not isinstance(nsrc, string_types): - raise TraitError('template contains an invalid name_source ' - 'entry (found %s).' % nsrc) - if '%' in nsrc or len(nsrc) == 0: - raise TraitError( - 'invalid source field found in template \'%s\'' % nsrc) - super(GenFile, self).__init__(value, filter, auto_set, entries, exists, **metadata) @@ -206,7 +202,7 @@ def get(self, obj, name): if self.value is None: srcvals = {} ext = '' - for nsrc in self.name_source: + for nsrc, indexing, fstr in self.name_source: srcvalue = getattr(obj, nsrc) if not isdefined(srcvalue): return Undefined @@ -223,7 +219,10 @@ def get(self, obj, name): for val in vallist: if isfile: _, val, ext = split_filename(val) - + elif indexing: + # eval should be safe since we only + # accept indexing elements + val = literal_eval(val+indexing[0]) if isdefined(val): outvals.append(val) @@ -238,7 +237,7 @@ def get(self, obj, name): srcvals.update({nsrc: outvals}) # Check that no source is missing - missing = list(set(self.name_source) - set(srcvals.keys())) + missing = list(set([ns[0] for ns in self.name_source]) - set(srcvals.keys())) if not missing: retval = self.template(**srcvals) if self.keep_ext: @@ -340,19 +339,13 @@ def __init__(self, template=None, keep_extension=False, range_source=None, **met if template is None or not isinstance(template, string_types): raise TraitError('GenMultiFile requires a valid template argument') - self.name_source = [i[1:-1].split('.')[0].split('!')[0].split(':')[0].split('[')[0] - for i in re.findall('\{.*?\}', template)] - self.template = template.format + self.name_source = list(_parse_name_source(template)) + # Remove range indexing tokens (not allowed by string.Formatter) + for _, itoken, _ in self.name_source: + if itoken: + template = template.replace(itoken, '') + self.template = template self.keep_ext = keep_extension - - for nsrc in self.name_source: - if not isinstance(nsrc, string_types): - raise TraitError('template contains an invalid name_source ' - 'entry (found %s).' % nsrc) - if '%' in nsrc or len(nsrc) == 0: - raise TraitError( - 'invalid source field found in template \'%s\'' % nsrc) - self.range_source = None if range_source is not None: if not isinstance(range_source, string_types): @@ -365,7 +358,7 @@ def __init__(self, template=None, keep_extension=False, range_source=None, **met except ValueError: self.offset = 0 - if range_source not in self.name_source: + if range_source not in [nsrc[0] for nsrc in self.name_source]: raise TraitError( 'range_source field should also be found in the' ' template (valid fields = %s).' % self.name_source) @@ -403,7 +396,7 @@ def get(self, obj, name): if not isdefined(value) or not value: srcvals = {} ext = '' - for nsrc in self.name_source: + for nsrc, indexing, fstr in self.name_source: srcvalue = getattr(obj, nsrc) IFLOGGER.debug('Parsing source (%s) = %s', nsrc, obj.traits()[nsrc].trait_type()) if not isdefined(srcvalue): @@ -436,17 +429,17 @@ def get(self, obj, name): srcvals.update({nsrc: outvals}) # Check that no source is missing - missing = list(set(self.name_source) - set(srcvals.keys())) + missing = list(set([ns[0] for ns in self.name_source]) - set(srcvals.keys())) if not missing: results = [] - combs = list(itools.product(*tuple(srcvals[k] for k in self.name_source))) + combs = list(itools.product(*tuple(srcvals[k[0]] for k in self.name_source))) # Get the formatting dictionaries ready - dlist = [{self.name_source[i]: v for i, v in enumerate(kvalues)} + dlist = [{self.name_source[i][0]: v for i, v in enumerate(kvalues)} for kvalues in combs] # ... and create a formatted entry for each of them for fmtdict in dlist: - retval = self.template(**fmtdict) + retval = self.template.format(**fmtdict) if self.keep_ext: retval += ext results.append(retval) @@ -685,3 +678,18 @@ def has_metadata(trait, metadata, value=None, recursive=True): count += has_metadata(handler, metadata, recursive) return count > 0 + +def _parse_name_source(name_source): + """Parse template strings""" + format_str = [i[1:-1] for i in re.findall(r'\{.*?\}', name_source)] + + for fchunk in format_str: + indexing = [i for i in re.findall(r'\[[0-9]*:[0-9]*\]', fchunk)] + # Only one complex indexing replacement is allowed + if indexing: + indexing = indexing[0] + + name = fchunk.split('.')[0].split('!')[0].split(':')[0].split('[')[0] + yield (name, indexing, fchunk) + + From 5f1df92ca47c9b529fa74821ed72020e38b7e6a1 Mon Sep 17 00:00:00 2001 From: oesteban Date: Sat, 20 Feb 2016 15:03:58 -0800 Subject: [PATCH 56/73] first use of the first optional substitution pattern --- nipype/interfaces/fsl/preprocess.py | 88 ++++----------- nipype/interfaces/fsl/utils.py | 148 ++++++-------------------- nipype/interfaces/traits_extension.py | 58 ++++++---- 3 files changed, 92 insertions(+), 202 deletions(-) diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index e9812089b4..46f73f74b9 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -1148,10 +1148,12 @@ class FUGUEInputSpec(FSLCommandInputSpec): 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', - xor=['warped_file'], requires=['in_file']) - warped_file = File(argstr='--warp=%s', desc='apply forward warping and save as filename', - xor=['unwarped_file'], requires=['in_file']) + unwarped_file = GenFile( + template='{in_file}_unwarped{output_type_}', argstr='--unwarp=%s', xor=['warped_file'], + requires=['in_file'], desc='apply unwarping and save as filename') + warped_file = GenFile( + template='{in_file}_warped{output_type_}', argstr='--warp=%s', xor=['unwarped_file'], + requires=['in_file'], desc='apply forward warping and save as filename') forward_warping = traits.Bool(False, usedefault=True, desc='apply forward warping instead of unwarping') @@ -1196,18 +1198,22 @@ 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, xor=['save_unmasked_shift'], + save_shift = traits.Bool(False, xor=['save_unmasked_shift'], usedefault=True, 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') + shift_out_file = GenFile( + template='{fmap_in_file|phasemap_in_file|shift_in_file}_vsm{output_type_}', + argstr='--saveshift=%s', desc='filename for saving pixel shift volume') # Special outputs: fieldmap (fmap) - save_fmap = traits.Bool(False, xor=['save_unmasked_fmap'], + save_fmap = traits.Bool(False, xor=['save_unmasked_fmap'], usedefault=True, 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') + fmap_out_file = GenFile( + template='{shift_in_file|phasemap_in_file|fmap_in_file}_fieldmap{output_type_}', + argstr='--savefmap=%s', desc='filename for saving fieldmap (rad/s)') def parse_args(self, skip=None): if skip is None: @@ -1225,75 +1231,19 @@ def parse_args(self, skip=None): else: if self.forward_warping: skip += ['unwarped_file'] - trait_spec = self.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.trait('unwarped_file') - trait_spec.name_template = "%s_unwarped" - trait_spec.name_source = 'in_file' - trait_spec.output_name = 'unwarped_file' # Handle shift output - if not isdefined(self.shift_out_file): - vsm_save_masked = (isdefined(self.save_shift) and self.save_shift) - vsm_save_unmasked = (isdefined(self.save_unmasked_shift) and - self.save_unmasked_shift) - - if (vsm_save_masked or vsm_save_unmasked): - trait_spec = self.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' - else: - trait_spec.name_template = '%s_vsm' - else: - skip += ['save_shift', 'save_unmasked_shift', 'shift_out_file'] - - # Handle fieldmap output - if not isdefined(self.fmap_out_file): - fmap_save_masked = (isdefined(self.save_fmap) and self.save_fmap) - fmap_save_unmasked = (isdefined(self.save_unmasked_fmap) and - self.save_unmasked_fmap) - - if (fmap_save_masked or fmap_save_unmasked): - trait_spec = self.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 not self.save_shift and not self.save_unmasked_shift: + skip += ['save_shift', 'save_unmasked_shift', 'shift_out_file'] - if fmap_save_unmasked: - trait_spec.name_template = '%s_fieldmap_unmasked' - else: - trait_spec.name_template = '%s_fieldmap' - else: - skip += ['save_fmap', 'save_unmasked_fmap', 'fmap_out_file'] + if not self.save_fmap and not self.save_unmasked_fmap: + skip += ['save_fmap', 'save_unmasked_fmap', 'fmap_out_file'] return super(FUGUEInputSpec, self).parse_args(skip=skip) - class FUGUEOutputSpec(TraitedSpec): unwarped_file = File(desc='unwarped file') warped_file = File(desc='forward warped file') @@ -1362,11 +1312,11 @@ class FUGUE(FSLCommand): """ - _cmd = 'fugue' input_spec = FUGUEInputSpec output_spec = FUGUEOutputSpec + class PRELUDEInputSpec(FSLCommandInputSpec): complex_phase_file = File(exists=True, argstr='--complex=%s', mandatory=True, xor=[ diff --git a/nipype/interfaces/fsl/utils.py b/nipype/interfaces/fsl/utils.py index c5b5130ecc..b05d6ce46f 100644 --- a/nipype/interfaces/fsl/utils.py +++ b/nipype/interfaces/fsl/utils.py @@ -897,7 +897,7 @@ class ConvertXFMInputSpec(FSLCommandInputSpec): desc='input transformation matrix') in_file2 = File(exists=True, argstr='%s', position=-2, desc='second input matrix (for use with fix_scale_skew or ' - 'concat_xfm') + 'concat_xfm') operation = traits.Enum( 'inverse', 'concat', 'fixscaleskew', usedefault=True, mandatory=True, argstr='-%s', position=-3, desc='operation mode') @@ -913,7 +913,7 @@ class ConvertXFMInputSpec(FSLCommandInputSpec): xor=_options, requires=['in_file2'], desc='use secondary matrix to fix scale and ' 'skew') - out_file = GenFile(template='{in_file}_{operation[:5]}.mat', argstr='-omat %s', position=1, + out_file = GenFile(template='{in_file}_{operation[:3]}.mat', argstr='-omat %s', position=1, desc='final transformation matrix', hash_files=False) def parse_args(self, skip=None): @@ -949,7 +949,13 @@ class ConvertXFM(FSLCommand): >>> invt.inputs.in_file = 'flirt.mat' >>> invt.inputs.invert_xfm = True >>> invt.cmdline - 'convert_xfm -omat flirt_inverse.mat -inverse flirt.mat' + 'convert_xfm -omat flirt_inv.mat -inverse flirt.mat' + + >>> invt.inputs.in_file2 = 'flirt.mat' + >>> invt.inputs.invert_xfm = False + >>> invt.inputs.operation = 'concat' + >>> invt.cmdline + 'convert_xfm -omat flirt_con.mat -concat flirt.mat flirt.mat' """ @@ -969,8 +975,9 @@ class SwapDimensionsInputSpec(FSLCommandInputSpec): traits.Enum(_dims), argstr='%s %s %s', mandatory=True, desc='3-tuple of new dimension order') - out_file = File(genfile=True, argstr='%s', - desc='image to write', hash_files=False) + out_file = GenFile( + template='{in_file}_newdims{output_type_}', argstr='%s', + desc='image to write', hash_files=False) class SwapDimensionsOutputSpec(TraitedSpec): @@ -989,18 +996,6 @@ class SwapDimensions(FSLCommand): input_spec = SwapDimensionsInputSpec output_spec = SwapDimensionsOutputSpec - def _post_run(self): - self.outputs.out_file = self.inputs.out_file - if not isdefined(self.inputs.out_file): - self.outputs.out_file = self._gen_fname(self.inputs.in_file, - suffix='_newdims') - self.outputs.out_file = os.path.abspath(self.outputs.out_file) - - def _gen_filename(self, name): - if name == 'out_file': - return self.outputs.out_file - return None - class PowerSpectrumInputSpec(FSLCommandInputSpec): # We use position args here as list indices - so a negative number @@ -1008,8 +1003,9 @@ class PowerSpectrumInputSpec(FSLCommandInputSpec): in_file = File(exists=True, desc='input 4D file to estimate the power spectrum', argstr='%s', position=0, mandatory=True) - out_file = File(desc='name of output 4D file for power spectrum', - argstr='%s', position=1, genfile=True, hash_files=False) + out_file = GenFile( + template='{in_file}_ps{output_type_}', argstr='%s', position=1, hash_files=False, + desc='name of output 4D file for power spectrum') class PowerSpectrumOutputSpec(TraitedSpec): @@ -1035,31 +1031,15 @@ class PowerSpectrum(FSLCommand): input_spec = PowerSpectrumInputSpec output_spec = PowerSpectrumOutputSpec - def _gen_outfilename(self): - out_file = self.inputs.out_file - if not isdefined(out_file) and isdefined(self.inputs.in_file): - out_file = self._gen_fname(self.inputs.in_file, - suffix='_ps') - return out_file - - def _post_run(self): - - self.outputs.out_file = os.path.abspath(self._gen_outfilename()) - - def _gen_filename(self, name): - if name == 'out_file': - return self._gen_outfilename() - return None - class SigLossInputSpec(FSLCommandInputSpec): in_file = File(mandatory=True, exists=True, argstr='-i %s', desc='b0 fieldmap file') - out_file = File(argstr='-s %s', - desc='output signal loss estimate file', - genfile=True) + out_file = GenFile( + template='{in_file}_sigloss{output_type_}', argstr='-s %s', hash_files=False, + desc='output signal loss estimate file') mask_file = File(exists=True, argstr='-m %s', @@ -1093,23 +1073,11 @@ class SigLoss(FSLCommand): output_spec = SigLossOuputSpec _cmd = 'sigloss' - def _post_run(self): - - self.outputs.out_file = self.inputs.out_file - if not isdefined(self.outputs.out_file) and \ - isdefined(self.inputs.in_file): - self.outputs.out_file = self._gen_fname(self.inputs.in_file, - suffix='_sigloss') - - def _gen_filename(self, name): - if name == 'out_file': - return self.outputs.out_file - return None - class Reorient2StdInputSpec(FSLCommandInputSpec): in_file = File(exists=True, mandatory=True, argstr='%s') - out_file = File(genfile=True, hash_files=False, argstr='%s') + out_file = GenFile(template='{in_file}_reoriented{output_type_}', + hash_files=False, argstr='%s') class Reorient2StdOutputSpec(TraitedSpec): @@ -1134,19 +1102,6 @@ class Reorient2Std(FSLCommand): input_spec = Reorient2StdInputSpec output_spec = Reorient2StdOutputSpec - def _gen_filename(self, name): - if name == 'out_file': - return self._gen_fname(self.inputs.in_file, - suffix='_reoriented') - return None - - def _post_run(self): - - if not isdefined(self.inputs.out_file): - self.outputs.out_file = self._gen_filename('out_file') - else: - self.outputs.out_file = os.path.abspath(self.inputs.out_file) - class InvWarpInputSpec(FSLCommandInputSpec): warp = File(exists=True, argstr='--warp=%s', mandatory=True, @@ -1242,16 +1197,6 @@ class ComplexInputSpec(FSLCommandInputSpec): 'complex_cartesian', 'complex_polar', 'complex_split', 'complex_merge', ] - complex_out_file = File(genfile=True, argstr='%s', position=-3, - xor=_ofs + _conversion[:2]) - magnitude_out_file = File(genfile=True, argstr='%s', position=-4, - xor=_ofs[:1] + _ofs[3:] + _conversion[1:]) - phase_out_file = File(genfile=True, argstr='%s', position=-3, - xor=_ofs[:1] + _ofs[3:] + _conversion[1:]) - real_out_file = File(genfile=True, argstr='%s', position=-4, - xor=_ofs[:3] + _conversion[:1] + _conversion[2:]) - imaginary_out_file = File(genfile=True, argstr='%s', position=-3, - xor=_ofs[:3] + _conversion[:1] + _conversion[2:]) start_vol = traits.Int(position=-2, argstr='%d') end_vol = traits.Int(position=-1, argstr='%d') @@ -1277,6 +1222,19 @@ class ComplexInputSpec(FSLCommandInputSpec): position=1,) # requires=['complex_in_file','complex_in_file2','complex_out_file']) + # Auto-generate output file names + complex_out_file = GenFile( + template='generated_cplx{output_type_}', argstr='%s', position=-3) + magnitude_out_file = GenFile( + template='{complex_in_file}_mag{output_type_}', argstr='%s', position=-4) + phase_out_file = GenFile( + template='{complex_in_file}_phase{output_type_}', argstr='%s', position=-3) + real_out_file = GenFile( + template='{complex_in_file}_real{output_type_}', argstr='%s', position=-4) + imaginary_out_file = GenFile( + template='{complex_in_file}_imag{output_type_}', argstr='%s', position=-3) + + def parse_args(self, skip=None): if skip is None: skip = [] @@ -1314,46 +1272,6 @@ class Complex(FSLCommand): output_spec = ComplexOuputSpec - def _gen_filename(self, name): - if name == 'complex_out_file': - if self.inputs.complex_cartesian: - in_file = self.inputs.real_in_file - elif self.inputs.complex_polar: - in_file = self.inputs.magnitude_in_file - elif self.inputs.complex_split or self.inputs.complex_merge: - in_file = self.inputs.complex_in_file - else: - return None - return self._gen_fname(in_file, suffix='_cplx') - elif name == 'magnitude_out_file': - return self._gen_fname(self.inputs.complex_in_file, suffix='_mag') - elif name == 'phase_out_file': - return self._gen_fname(self.inputs.complex_in_file, suffix='_phase') - elif name == 'real_out_file': - return self._gen_fname(self.inputs.complex_in_file, suffix='_real') - elif name == 'imaginary_out_file': - return self._gen_fname(self.inputs.complex_in_file, suffix='_imag') - return None - - def _get_output(self, name): - output = getattr(self.inputs, name) - if not isdefined(output): - output = self._gen_filename(name) - return os.path.abspath(output) - - def _post_run(self): - - if self.inputs.complex_cartesian or self.inputs.complex_polar or \ - self.inputs.complex_split or self.inputs.complex_merge: - self.outputs.complex_out_file = self._get_output('complex_out_file') - elif self.inputs.real_cartesian: - self.outputs.real_out_file = self._get_output('real_out_file') - self.outputs.imaginary_out_file = self._get_output('imaginary_out_file') - elif self.inputs.real_polar: - self.outputs.magnitude_out_file = self._get_output('magnitude_out_file') - self.outputs.phase_out_file = self._get_output('phase_out_file') - - class WarpUtilsInputSpec(FSLCommandInputSpec): in_file = File(exists=True, argstr='--in=%s', mandatory=True, desc='Name of file containing warp-coefficients/fields. This ' diff --git a/nipype/interfaces/traits_extension.py b/nipype/interfaces/traits_extension.py index 154b0e602a..049af41cb6 100644 --- a/nipype/interfaces/traits_extension.py +++ b/nipype/interfaces/traits_extension.py @@ -173,7 +173,7 @@ def __init__(self, template=None, keep_extension=False, value='', if itoken: template = template.replace(itoken, '') - self.template = template.format + self.template = template self.keep_ext = keep_extension super(GenFile, self).__init__(value, filter, auto_set, entries, exists, **metadata) @@ -198,15 +198,25 @@ def validate(self, object, name, value): def get(self, obj, name): # Compute expected name iff trait is not set - + template = self.template if self.value is None: srcvals = {} ext = '' - for nsrc, indexing, fstr in self.name_source: - srcvalue = getattr(obj, nsrc) + final_nsrcs = [] + for nsrc_list, indexing, fstr in self.name_source: + for nel in nsrc_list: + srcvalue = getattr(obj, nel) + if isdefined(srcvalue): + nsrc = nel + break + if not isdefined(srcvalue): return Undefined + template = template.replace('|'.join(nsrc_list), nsrc) + IFLOGGER.debug('replacing %s with %s. Result=%s', '|'.join(nsrc_list), nsrc, template) + final_nsrcs.append(nsrc) + if isinstance(srcvalue, string_types): vallist = [srcvalue] else: @@ -221,8 +231,8 @@ def get(self, obj, name): _, val, ext = split_filename(val) elif indexing: # eval should be safe since we only - # accept indexing elements - val = literal_eval(val+indexing[0]) + # accept indexing elements with format [n:n] + val = eval('val%s' % indexing) # pylint: disable=W0123 if isdefined(val): outvals.append(val) @@ -237,9 +247,10 @@ def get(self, obj, name): srcvals.update({nsrc: outvals}) # Check that no source is missing - missing = list(set([ns[0] for ns in self.name_source]) - set(srcvals.keys())) + IFLOGGER.debug('Final sources: %s and values %s', final_nsrcs, srcvals) + missing = list(set(final_nsrcs) - set(srcvals.keys())) if not missing: - retval = self.template(**srcvals) + retval = template.format(**srcvals) if self.keep_ext: retval += ext return retval @@ -358,7 +369,7 @@ def __init__(self, template=None, keep_extension=False, range_source=None, **met except ValueError: self.offset = 0 - if range_source not in [nsrc[0] for nsrc in self.name_source]: + if range_source not in [n for nsrc in self.name_source for n in nsrc[0]]: raise TraitError( 'range_source field should also be found in the' ' template (valid fields = %s).' % self.name_source) @@ -392,16 +403,26 @@ def validate(self, obj, name, value): def get(self, obj, name): # Compute expected name iff trait is not set value = self.get_value(obj, name) - + template = self.template if not isdefined(value) or not value: srcvals = {} ext = '' - for nsrc, indexing, fstr in self.name_source: - srcvalue = getattr(obj, nsrc) - IFLOGGER.debug('Parsing source (%s) = %s', nsrc, obj.traits()[nsrc].trait_type()) + + final_nsrcs = [] + for nsrc_list, indexing, fstr in self.name_source: + for nel in nsrc_list: + srcvalue = getattr(obj, nel) + if isdefined(srcvalue): + nsrc = nel + break + if not isdefined(srcvalue): return Undefined + template = template.replace('|'.join(nsrc_list), nsrc) + IFLOGGER.debug('replacing %s with %s. Result=%s', '|'.join(nsrc_list), nsrc, template) + final_nsrcs.append(nsrc) + IFLOGGER.debug('Autogenerating output for: %s (%s=%s)', name, nsrc, srcvalue) IFLOGGER.debug('range_source=%s', self.range_source) if self.range_source is not None and nsrc == self.range_source: @@ -428,18 +449,19 @@ def get(self, obj, name): if outvals: srcvals.update({nsrc: outvals}) + IFLOGGER.debug('Final sources: %s and values %s', final_nsrcs, srcvals) # Check that no source is missing - missing = list(set([ns[0] for ns in self.name_source]) - set(srcvals.keys())) + missing = list(set(final_nsrcs) - set(srcvals.keys())) if not missing: results = [] - combs = list(itools.product(*tuple(srcvals[k[0]] for k in self.name_source))) + combs = list(itools.product(*tuple(srcvals[k] for k in final_nsrcs))) # Get the formatting dictionaries ready - dlist = [{self.name_source[i][0]: v for i, v in enumerate(kvalues)} + dlist = [{final_nsrcs[i]: v for i, v in enumerate(kvalues)} for kvalues in combs] # ... and create a formatted entry for each of them for fmtdict in dlist: - retval = self.template.format(**fmtdict) + retval = template.format(**fmtdict) if self.keep_ext: retval += ext results.append(retval) @@ -690,6 +712,6 @@ def _parse_name_source(name_source): indexing = indexing[0] name = fchunk.split('.')[0].split('!')[0].split(':')[0].split('[')[0] - yield (name, indexing, fchunk) + yield (name.split('|'), indexing, fchunk) From 573e3a5229b77556da9edbce5f829adac479e6f4 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Sun, 21 Feb 2016 08:07:13 -0800 Subject: [PATCH 57/73] base code for new nipype 2.0 --- nipype/algorithms/tests/test_auto_ErrorMap.py | 35 - nipype/algorithms/tests/test_auto_Overlap.py | 47 - .../tests/test_auto_TVTKBaseInterface.py | 24 - nipype/interfaces/__init__.py | 1 + nipype/interfaces/base.py | 986 ------------------ nipype/interfaces/base/__init__.py | 11 + nipype/interfaces/base/interfaces.py | 462 ++++++++ nipype/interfaces/base/runtime.py | 448 ++++++++ nipype/interfaces/{ => base}/specs.py | 73 +- .../interfaces/{ => base}/traits_extension.py | 64 +- nipype/interfaces/fsl/base.py | 8 +- nipype/interfaces/fsl/dti.py | 17 +- nipype/interfaces/fsl/model.py | 45 +- nipype/interfaces/fsl/preprocess.py | 18 +- .../interfaces/fsl/tests/test_auto_Complex.py | 10 - .../interfaces/fsl/tests/test_auto_FUGUE.py | 6 +- .../fsl/tests/test_auto_PowerSpectrum.py | 1 - .../fsl/tests/test_auto_Reorient2Std.py | 1 - .../interfaces/fsl/tests/test_auto_SigLoss.py | 2 +- .../fsl/tests/test_auto_SwapDimensions.py | 1 - nipype/interfaces/fsl/tests/test_dti.py | 2 +- setup.py | 2 + 22 files changed, 1069 insertions(+), 1195 deletions(-) delete mode 100644 nipype/algorithms/tests/test_auto_ErrorMap.py delete mode 100644 nipype/algorithms/tests/test_auto_Overlap.py delete mode 100644 nipype/interfaces/base.py create mode 100644 nipype/interfaces/base/__init__.py create mode 100644 nipype/interfaces/base/interfaces.py create mode 100644 nipype/interfaces/base/runtime.py rename nipype/interfaces/{ => base}/specs.py (94%) rename nipype/interfaces/{ => base}/traits_extension.py (91%) diff --git a/nipype/algorithms/tests/test_auto_ErrorMap.py b/nipype/algorithms/tests/test_auto_ErrorMap.py deleted file mode 100644 index 69484529dd..0000000000 --- a/nipype/algorithms/tests/test_auto_ErrorMap.py +++ /dev/null @@ -1,35 +0,0 @@ -# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT -from ...testing import assert_equal -from ..metrics import ErrorMap - - -def test_ErrorMap_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - in_ref=dict(mandatory=True, - ), - in_tst=dict(mandatory=True, - ), - mask=dict(), - metric=dict(mandatory=True, - usedefault=True, - ), - out_map=dict(), - ) - inputs = ErrorMap.input_spec() - - for key, metadata in list(input_map.items()): - for metakey, value in list(metadata.items()): - yield assert_equal, getattr(inputs.traits()[key], metakey), value - - -def test_ErrorMap_outputs(): - output_map = dict(distance=dict(), - out_map=dict(), - ) - outputs = ErrorMap.output_spec() - - for key, metadata in list(output_map.items()): - for metakey, value in list(metadata.items()): - yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/algorithms/tests/test_auto_Overlap.py b/nipype/algorithms/tests/test_auto_Overlap.py deleted file mode 100644 index a5a3874bd1..0000000000 --- a/nipype/algorithms/tests/test_auto_Overlap.py +++ /dev/null @@ -1,47 +0,0 @@ -# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT -from ...testing import assert_equal -from ..misc import Overlap - - -def test_Overlap_inputs(): - input_map = dict(bg_overlap=dict(mandatory=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), - mask_volume=dict(), - out_file=dict(usedefault=True, - ), - vol_units=dict(mandatory=True, - usedefault=True, - ), - volume1=dict(mandatory=True, - ), - volume2=dict(mandatory=True, - ), - weighting=dict(usedefault=True, - ), - ) - inputs = Overlap.input_spec() - - for key, metadata in list(input_map.items()): - for metakey, value in list(metadata.items()): - yield assert_equal, getattr(inputs.traits()[key], metakey), value - - -def test_Overlap_outputs(): - output_map = dict(dice=dict(), - diff_file=dict(), - jaccard=dict(), - labels=dict(), - roi_di=dict(), - roi_ji=dict(), - roi_voldiff=dict(), - volume_difference=dict(), - ) - outputs = Overlap.output_spec() - - for key, metadata in list(output_map.items()): - for metakey, value in list(metadata.items()): - yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/algorithms/tests/test_auto_TVTKBaseInterface.py b/nipype/algorithms/tests/test_auto_TVTKBaseInterface.py index 02fedd0e30..e69de29bb2 100644 --- a/nipype/algorithms/tests/test_auto_TVTKBaseInterface.py +++ b/nipype/algorithms/tests/test_auto_TVTKBaseInterface.py @@ -1,24 +0,0 @@ -# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT -from ...testing import assert_equal -from ..mesh import TVTKBaseInterface - - -def test_TVTKBaseInterface_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - ) - inputs = TVTKBaseInterface.input_spec() - - for key, metadata in list(input_map.items()): - for metakey, value in list(metadata.items()): - yield assert_equal, getattr(inputs.traits()[key], metakey), value - - -def test_TVTKBaseInterface_outputs(): - output_map = dict() - outputs = TVTKBaseInterface.output_spec() - - for key, metadata in list(output_map.items()): - for metakey, value in list(metadata.items()): - yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/__init__.py b/nipype/interfaces/__init__.py index c9ff7936ba..4ef022803f 100644 --- a/nipype/interfaces/__init__.py +++ b/nipype/interfaces/__init__.py @@ -9,5 +9,6 @@ from __future__ import absolute_import __docformat__ = 'restructuredtext' +from . import base from .io import DataGrabber, DataSink, SelectFiles from .utility import IdentityInterface, Rename, Function, Select, Merge diff --git a/nipype/interfaces/base.py b/nipype/interfaces/base.py deleted file mode 100644 index 1c9f3e3f74..0000000000 --- a/nipype/interfaces/base.py +++ /dev/null @@ -1,986 +0,0 @@ -# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- -# vi: set ft=python sts=4 ts=4 sw=4 et: -""" -Package contains interfaces for using existing functionality in other packages - -Exaples FSL, matlab/SPM , afni - -Requires Packages to be installed -""" - -from __future__ import print_function -from __future__ import division - -from copy import deepcopy -import errno -import os -import os.path as op -import platform -from socket import getfqdn -from string import Template -import select -import subprocess -import sys -from datetime import datetime as dt -from dateutil.parser import parse as parseutc - -from future import standard_library -standard_library.install_aliases() -from builtins import range -from builtins import object - -from configparser import NoOptionError -from ..utils.filemanip import md5, FileNotFoundError -from ..utils.misc import trim, str2bool, is_container - -# Make all the traits and spec interfaces available through base -# for backwards compatibility, even though import * is discouraged -# in production environments. -from .traits_extension import * # pylint: disable=W0611 -from .specs import * # pylint: disable=W0611 -#from .traits_extension import isdefined, Undefined -# from .specs import (BaseInterfaceInputSpec, CommandLineInputSpec, -# StdOutCommandLineInputSpec, StdOutCommandLineOutputSpec, -# MpiCommandLineInputSpec, -# SEMLikeCommandLineInputSpec, TraitedSpec) -from ..utils.provenance import write_provenance -from .. import config, logging, LooseVersion -from .. import __version__ -from ..external.six import string_types - -IFLOGGER = logging.getLogger('interface') -__docformat__ = 'restructuredtext' - - -def _unlock_display(ndisplay): - lockf = op.join('/tmp', '.X%d-lock' % ndisplay) - try: - os.remove(lockf) - except: - return False - - return True - - -def _exists_in_path(cmd, environ): - """ - Based on a code snippet from - http://orip.org/2009/08/python-checking-if-executable-exists-in.html - """ - # Read environ fron variable, use system's environ as failback - input_environ = environ.get("PATH", os.environ.get("PATH", "")) - extensions = os.environ.get("PATHEXT", "").split(os.pathsep) - for directory in input_environ.split(os.pathsep): - base = op.join(directory, cmd) - options = [base] + [(base + ext) for ext in extensions] - for filename in options: - if op.exists(filename): - return True, filename - return False, None - - -def load_template(name): - """Load a template from the script_templates directory - - Parameters - ---------- - name : str - The name of the file to load - - Returns - ------- - template : string.Template - - """ - - full_fname = op.join(op.dirname(__file__), - 'script_templates', name) - template_file = open(full_fname) - template = Template(template_file.read()) - template_file.close() - return template - - -class Bunch(object): - """Dictionary-like class that provides attribute-style access to it's items. - - A `Bunch` is a simple container that stores it's items as class - attributes. Internally all items are stored in a dictionary and - the class exposes several of the dictionary methods. - - Examples - -------- - >>> from nipype.interfaces.specs import Bunch - >>> inputs = Bunch(infile='subj.nii', fwhm=6.0, register_to_mean=True) - >>> inputs - Bunch(fwhm=6.0, infile='subj.nii', register_to_mean=True) - >>> inputs.register_to_mean = False - >>> inputs - Bunch(fwhm=6.0, infile='subj.nii', register_to_mean=False) - - - Notes - ----- - The Bunch pattern came from the Python Cookbook: - - .. [1] A. Martelli, D. Hudgeon, "Collecting a Bunch of Named - Items", Python Cookbook, 2nd Ed, Chapter 4.18, 2005. - - """ - - def __init__(self, *args, **kwargs): - self.__dict__.update(*args, **kwargs) - - def update(self, *args, **kwargs): - """update existing attribute, or create new attribute - - Note: update is very much like HasTraits.set""" - self.__dict__.update(*args, **kwargs) - - def items(self): - """iterates over bunch attributes as key, value pairs""" - return list(self.__dict__.items()) - - def iteritems(self): - """iterates over bunch attributes as key, value pairs""" - IFLOGGER.warn('iteritems is deprecated, use items instead') - return list(self.items()) - - def get(self, *args): - """Support dictionary get() functionality - """ - return self.__dict__.get(*args) - - def set(self, **kwargs): - """Support dictionary get() functionality - """ - return self.__dict__.update(**kwargs) - - def dictcopy(self): - """returns a deep copy of existing Bunch as a dictionary""" - return deepcopy(self.__dict__) - - def __repr__(self): - """representation of the sorted Bunch as a string - - Currently, this string representation of the `inputs` Bunch of - interfaces is hashed to determine if the process' dirty-bit - needs setting or not. Till that mechanism changes, only alter - this after careful consideration. - """ - outstr = ['Bunch('] - first = True - for k, input_value in sorted(self.items()): - if not first: - outstr.append(', ') - if isinstance(input_value, dict): - pairs = [] - for key, value in sorted(input_value.items()): - pairs.append("'%s': %s" % (key, value)) - input_value = '{' + ', '.join(pairs) + '}' - outstr.append('%s=%s' % (k, input_value)) - else: - outstr.append('%s=%r' % (k, input_value)) - first = False - outstr.append(')') - return ''.join(outstr) - - def _get_bunch_hash(self): - """Return a dictionary of our items with hashes for each file. - - Searches through dictionary items and if an item is a file, it - calculates the md5 hash of the file contents and stores the - file name and hash value as the new key value. - - However, the overall bunch hash is calculated only on the hash - value of a file. The path and name of the file are not used in - the overall hash calculation. - - Returns - ------- - dict_withhash : dict - Copy of our dictionary with the new file hashes included - with each file. - hashvalue : str - The md5 hash value of the `dict_withhash` - - """ - - infile_list = [] - for key, val in list(self.items()): - if is_container(val): - # XXX - SG this probably doesn't catch numpy arrays - # containing embedded file names either. - if isinstance(val, dict): - # XXX - SG should traverse dicts, but ignoring for now - item = None - else: - if len(val) == 0: - raise AttributeError('%s attribute is empty' % key) - item = val[0] - else: - item = val - try: - if op.isfile(item): - infile_list.append(key) - except TypeError: - # `item` is not a file or string. - continue - dict_withhash = self.dictcopy() - dict_nofilename = self.dictcopy() - for item in infile_list: - dict_withhash[item] = self._hash_infile(dict_withhash, item) - dict_nofilename[item] = [val[1] for val in dict_withhash[item]] - # Sort the items of the dictionary, before hashing the string - # representation so we get a predictable order of the - # dictionary. - sorted_dict = str(sorted(dict_nofilename.items())) - return dict_withhash, md5(sorted_dict.encode()).hexdigest() - - def _hash_infile(self, adict, key): - """Compute hashes of files""" - # Inject file hashes into adict[key] - stuff = adict[key] - if not is_container(stuff): - stuff = [stuff] - file_list = [] - for fname in stuff: - if op.isfile(fname): - md5obj = md5() - with open(fname, 'rb') as filep: - while True: - data = filep.read(8192) - if not data: - break - md5obj.update(data) - md5hex = md5obj.hexdigest() - else: - md5hex = None - file_list.append((fname, md5hex)) - return file_list - - def __pretty__(self, p, cycle): - """Support for the pretty module - - pretty is included in ipython.externals for ipython > 0.10""" - if cycle: - p.text('Bunch(...)') - else: - p.begin_group(6, 'Bunch(') - first = True - for k, input_value in sorted(self.items()): - if not first: - p.text(',') - p.breakable() - p.text(k + '=') - p.pretty(input_value) - first = False - p.end_group(6, ')') - - -class InterfaceResult(object): - """Object that contains the results of running a particular Interface. - - Attributes - ---------- - version : version of this Interface result object (a readonly property) - interface : class type - A copy of the `Interface` class that was run to generate this result. - inputs : a traits free representation of the inputs - outputs : Bunch - An `Interface` specific Bunch that contains all possible files - that are generated by the interface. The `outputs` are used - as the `inputs` to another node when interfaces are used in - the pipeline. - runtime : Bunch - - Contains attributes that describe the runtime environment when - the `Interface` was run. Contains the attributes: - - * cmdline : The command line string that was executed - * cwd : The directory the ``cmdline`` was executed in. - * stdout : The output of running the ``cmdline``. - * stderr : Any error messages output from running ``cmdline``. - * returncode : The code returned from running the ``cmdline``. - - """ - - def __init__(self, interface, runtime, inputs=None, outputs=None, - provenance=None): - self._version = 2.0 - self.interface = interface - self.runtime = runtime - self.inputs = inputs - self.outputs = outputs - self.provenance = provenance - - @property - def version(self): - return self._version - - -class Interface(object): - """This is an abstract definition for Interface objects. - - It provides no functionality. It defines the necessary attributes - and methods all Interface objects should have. - - """ - - input_spec = None # A traited input specification - output_spec = None # A traited output specification - - # defines if the interface can reuse partial results after interruption - _can_resume = False - - @property - def can_resume(self): - return self._can_resume - - # should the interface be always run even if the inputs were not changed? - _always_run = False - - @property - def always_run(self): - return self._always_run - - def __init__(self, **inputs): - """Initialize command with given args and inputs.""" - raise NotImplementedError - - @classmethod - def help(cls, returnhelp=False): - """ Prints class help""" - raise NotImplementedError - - @classmethod - def _inputs_help(cls): - """ Prints inputs help""" - raise NotImplementedError - - @classmethod - def _outputs_help(cls): - """ Prints outputs help""" - raise NotImplementedError - - @property - def version(self): - raise NotImplementedError - - def _pre_run(self, **inputs): - raise NotImplementedError - - def _post_run(self, **inputs): - raise NotImplementedError - - - def run(self): - """Execute the command.""" - raise NotImplementedError - - -class BaseInterface(Interface): - """Implements common interface functionality. - - Implements - ---------- - - * Initializes inputs/outputs from input_spec/output_spec - * Provides help based on input_spec and output_spec - * Checks for mandatory inputs before running an interface - * Runs an interface and returns results - * Determines which inputs should be copied or linked to cwd - - This class does not implement aggregate_outputs, input_spec or - output_spec. These should be defined by derived classes. - - This class cannot be instantiated. - - """ - input_spec = BaseInterfaceInputSpec - output_spec = TraitedSpec - _version = None - _additional_metadata = [] - _redirect_x = False - - def __init__(self, **inputs): - if not self.input_spec: - raise Exception('No input_spec in class: %s' % - self.__class__.__name__) - self.inputs = self.input_spec(**inputs) - self.outputs = self.output_spec() - - @classmethod - def help(cls, returnhelp=False): - """ Prints class help """ - - if cls.__doc__: - # docstring = cls.__doc__.split('\n') - # docstring = [trim(line, '') for line in docstring] - docstring = trim(cls.__doc__).split('\n') + [''] - else: - docstring = [''] - - allhelp = '\n'.join(docstring + ['Inputs::'] + cls.input_spec().help() + [''] + - ['Outputs::', ''] + cls.output_spec().help() + ['']) - if returnhelp: - return allhelp - else: - print(allhelp) - - def _run_wrapper(self, runtime): - sysdisplay = os.getenv('DISPLAY') - if self._redirect_x: - try: - from xvfbwrapper import Xvfb - except ImportError: - IFLOGGER.error('Xvfb wrapper could not be imported') - raise - - vdisp = Xvfb(nolisten='tcp') - vdisp.start() - vdisp_num = vdisp.vdisplay_num - - IFLOGGER.info('Redirecting X to :%d', vdisp_num) - runtime.environ['DISPLAY'] = ':%d' % vdisp_num - - runtime = self._run_interface(runtime) - - if self._redirect_x: - if sysdisplay is None: - os.unsetenv('DISPLAY') - else: - os.environ['DISPLAY'] = sysdisplay - - IFLOGGER.info('Freeing X :%d', vdisp_num) - vdisp.stop() - _unlock_display(vdisp_num) - - return runtime - - def _run_interface(self, runtime, *kwargs): - """ Core function that executes interface - """ - raise NotImplementedError - - def _pre_run(self, **inputs): - self.outputs = self.output_spec() - self.inputs.set(**inputs) - self.inputs.check_inputs() - if self.version: - self.inputs.check_version(LooseVersion(str(self.version))) - - def _post_run(self): - if self.output_spec is None: - IFLOGGER.warn('Interface does not have an output specification') - return None - - ns_outputs = {} - for ns_input, ns_spec in list(self.inputs.namesource_items()): - ns_pointer = getattr(ns_spec, 'out_name', None) - if ns_pointer is not None: - ns_outputs[ns_pointer] = ns_input - - # Search for inputs with the same name - for out_name, spec in list(self.outputs.items()): - if out_name in ns_outputs.keys(): - value = getattr(self.inputs, ns_outputs[out_name], Undefined) - else: - value = getattr(self.inputs, out_name, Undefined) - - if isdefined(value): - setattr(self.outputs, out_name, op.abspath(value)) - - # Search for outputs with name source - for out_name, spec in self.outputs.namesource_items(): - if isdefined(getattr(self.outputs, out_name)): - continue - value = self.outputs.format_ns(spec.name_source, out_name, self.inputs) - setattr(self.outputs, out_name, value) - - - def run(self, **inputs): - """Execute this interface. - - This interface will not raise an exception if runtime.returncode is - non-zero. - - Parameters - ---------- - inputs : allows the interface settings to be updated - - Returns - ------- - results : an InterfaceResult object containing a copy of the instance - that was executed, provenance information and, if successful, results - """ - interface = self.__class__ - self._pre_run(**inputs) - # initialize provenance tracking - env = deepcopy(dict(os.environ)) - runtime = Bunch( - cwd=os.getcwd(), returncode=None, duration=None, environ=env, - startTime=dt.isoformat(dt.utcnow()), endTime=None, traceback=None, - platform=platform.platform(), hostname=getfqdn(), version=self.version) - - try: - runtime = self._run_wrapper(runtime) - except Exception as e: # pylint: disable=W0703 - if len(e.args) == 0: - e.args = ("") - - message = "\nInterface %s failed to run." % self.__class__.__name__ - - if config.has_option('logging', 'interface_level') and \ - config.get('logging', 'interface_level').lower() == 'debug': - inputs_str = "Inputs:" + str(self.inputs) + "\n" - else: - inputs_str = '' - - if len(e.args) == 1 and isinstance(e.args[0], string_types): - e.args = (e.args[0] + " ".join([message, inputs_str]),) - else: - e.args += (message, ) - if inputs_str != '': - e.args += (inputs_str, ) - - # exception raising inhibition for special cases - import traceback - runtime.traceback = traceback.format_exc() - runtime.traceback_args = e.args # pylint: disable=W0201 - - runtime.endTime = dt.isoformat(dt.utcnow()) - timediff = parseutc(runtime.endTime) - parseutc(runtime.startTime) - runtime.duration = (timediff.days * 86400 + timediff.seconds + - timediff.microseconds / 1e5) - results = InterfaceResult(interface, runtime, - inputs=self.inputs.get_traitsfree()) - - if runtime.traceback is None: - self._post_run() - results.outputs = self.outputs - - prov_record = None - if str2bool(config.get('execution', 'write_provenance')): - prov_record = write_provenance(results) - results.provenance = prov_record - - if (runtime.traceback is not None and - not getattr(self.inputs, 'ignore_exception', False)): - raise - return results - - @property - def version(self): - if self._version is None: - if str2bool(config.get('execution', 'stop_on_unknown_version')): - raise ValueError('Interface %s has no version information' % - self.__class__.__name__) - return self._version - - -class Stream(object): - """Function to capture stdout and stderr streams with timestamps - - stackoverflow.com/questions/4984549/merge-and-sync-stdout-and-stderr/5188359 - """ - - def __init__(self, name, impl): - self._name = name - self._impl = impl - self._buf = '' - self._rows = [] - self._lastidx = 0 - - def fileno(self): - "Pass-through for file descriptor." - return self._impl.fileno() - - def read(self, drain=0): - "Read from the file descriptor. If 'drain' set, read until EOF." - while self._read(drain) is not None: - if not drain: - break - - def _read(self, drain): - "Read from the file descriptor" - fd = self.fileno() - buf = os.read(fd, 4096).decode() - if not buf and not self._buf: - return None - if '\n' not in buf: - if not drain: - self._buf += buf - return [] - - # prepend any data previously read, then split into lines and format - buf = self._buf + buf - if '\n' in buf: - tmp, rest = buf.rsplit('\n', 1) - else: - tmp = buf - rest = None - self._buf = rest - now = dt.now().isoformat() - rows = tmp.split('\n') - self._rows += [(now, '%s %s:%s' % (self._name, now, r), r) - for r in rows] - for idx in range(self._lastidx, len(self._rows)): - IFLOGGER.info(self._rows[idx][1]) - self._lastidx = len(self._rows) - - -def run_command(runtime, output=None, timeout=0.01, redirect_x=False): - """Run a command, read stdout and stderr, prefix with timestamp. - - The returned runtime contains a merged stdout+stderr log with timestamps - """ - PIPE = subprocess.PIPE - - cmdline = runtime.cmdline - if redirect_x: - exist_xvfb, _ = _exists_in_path('xvfb-run', runtime.environ) - if not exist_xvfb: - raise RuntimeError('Xvfb was not found, X redirection aborted') - cmdline = 'xvfb-run -a ' + cmdline - - if output == 'file': - errfile = op.join(runtime.cwd, 'stderr.nipype') - outfile = op.join(runtime.cwd, 'stdout.nipype') - stderr = open(errfile, 'wt') # t=='text'===default - stdout = open(outfile, 'wt') - - proc = subprocess.Popen(cmdline, - stdout=stdout, - stderr=stderr, - shell=True, - cwd=runtime.cwd, - env=runtime.environ) - else: - proc = subprocess.Popen(cmdline, - stdout=PIPE, - stderr=PIPE, - shell=True, - cwd=runtime.cwd, - env=runtime.environ) - result = {} - errfile = op.join(runtime.cwd, 'stderr.nipype') - outfile = op.join(runtime.cwd, 'stdout.nipype') - if output == 'stream': - streams = [Stream('stdout', proc.stdout), Stream('stderr', proc.stderr)] - - def _process(drain=0): - try: - res = select.select(streams, [], [], timeout) - except select.error as e: - IFLOGGER.info(str(e)) - if e[0] == errno.EINTR: - return - else: - raise - else: - for stream in res[0]: - stream.read(drain) - - while proc.returncode is None: - proc.poll() - _process() - _process(drain=1) - - # collect results, merge and return - result = {} - temp = [] - for stream in streams: - rows = stream._rows - temp += rows - result[stream._name] = [r[2] for r in rows] - temp.sort() - result['merged'] = [r[1] for r in temp] - if output == 'allatonce': - stdout, stderr = proc.communicate() - if stdout and isinstance(stdout, bytes): - try: - stdout = stdout.decode() - except UnicodeDecodeError: - stdout = stdout.decode("ISO-8859-1") - if stderr and isinstance(stderr, bytes): - try: - stderr = stderr.decode() - except UnicodeDecodeError: - stderr = stderr.decode("ISO-8859-1") - - result['stdout'] = str(stdout).split('\n') - result['stderr'] = str(stderr).split('\n') - result['merged'] = '' - if output == 'file': - ret_code = proc.wait() - stderr.flush() - stdout.flush() - result['stdout'] = [line.strip() for line in open(outfile).readlines()] - result['stderr'] = [line.strip() for line in open(errfile).readlines()] - result['merged'] = '' - if output == 'none': - proc.communicate() - result['stdout'] = [] - result['stderr'] = [] - result['merged'] = '' - runtime.stderr = '\n'.join(result['stderr']) - runtime.stdout = '\n'.join(result['stdout']) - runtime.merged = result['merged'] - runtime.returncode = proc.returncode - return runtime - - -def get_dependencies(name, environ): - """Return library dependencies of a dynamically linked executable - - Uses otool on darwin, ldd on linux. Currently doesn't support windows. - - """ - PIPE = subprocess.PIPE - if sys.platform == 'darwin': - proc = subprocess.Popen( - 'otool -L `which %s`' % name, stdout=PIPE, stderr=PIPE, shell=True, env=environ) - elif 'linux' in sys.platform: - proc = subprocess.Popen( - 'ldd `which %s`' % name, stdout=PIPE, stderr=PIPE, shell=True, env=environ) - else: - return 'Platform %s not supported' % sys.platform - o, _ = proc.communicate() - return o.rstrip() - - -class CommandLine(BaseInterface): - """Implements functionality to interact with command line programs - class must be instantiated with a command argument - - Parameters - ---------- - - command : string - define base immutable `command` you wish to run - - args : string, optional - optional arguments passed to base `command` - - - Examples - -------- - >>> import pprint - >>> from nipype.interfaces.base import CommandLine - >>> cli = CommandLine(command='ls', environ={'DISPLAY': ':1'}) - >>> cli.inputs.args = '-al' - >>> cli.cmdline - 'ls -al' - - >>> pprint.pprint(cli.inputs.trait_get()) # doctest: +NORMALIZE_WHITESPACE - {'args': '-al', - 'environ': {'DISPLAY': ':1'}, - 'ignore_exception': False, - 'terminal_output': 'stream'} - - >>> cli.inputs.get_hashval() - ([('args', '-al')], '11c37f97649cd61627f4afe5136af8c0') - - """ - - input_spec = CommandLineInputSpec - _cmd = None - _version = None - _terminal_output = 'stream' - - def __init__(self, command=None, **inputs): - super(CommandLine, self).__init__(**inputs) - self._environ = None - if not hasattr(self, '_cmd'): - self._cmd = None - if self.cmd is None and command is None: - raise Exception("Missing command") - if command: - self._cmd = command - self.inputs.on_trait_change(self._terminal_output_update, - 'terminal_output') - if not isdefined(self.inputs.terminal_output): - self.inputs.terminal_output = self._terminal_output - else: - self._terminal_output_update() - - def _terminal_output_update(self): - self._terminal_output = self.inputs.terminal_output - - @classmethod - def set_default_terminal_output(cls, output_type): - """Set the default terminal output for CommandLine Interfaces. - - This method is used to set default terminal output for - CommandLine Interfaces. However, setting this will not - update the output type for any existing instances. For these, - assign the .inputs.terminal_output. - """ - - if output_type in ['stream', 'allatonce', 'file', 'none']: - cls._terminal_output = output_type - else: - raise AttributeError('Invalid terminal output_type: %s' % - output_type) - - @property - def cmd(self): - """sets base command, immutable""" - return self._cmd - - @property - def cmdline(self): - """ `command` plus any arguments (args) - validates arguments and generates command line""" - self.outputs = self.output_spec() - self.inputs.check_inputs() - allargs = self.inputs.parse_args() - allargs.insert(0, self.cmd) - return ' '.join(allargs) - - def raise_exception(self, runtime): - message = "Command:\n" + runtime.cmdline + "\n" - message += "Standard output:\n" + runtime.stdout + "\n" - message += "Standard error:\n" + runtime.stderr + "\n" - message += "Return code: " + str(runtime.returncode) - raise RuntimeError(message) - - @classmethod - def help(cls, returnhelp=False): - allhelp = super(CommandLine, cls).help(returnhelp=True) - allhelp = "Wraps command ``%s``\n\n" % cls._cmd + allhelp - - if returnhelp: - return allhelp - print(allhelp) - - def _get_environ(self): - out_environ = {} - if not self._redirect_x: - try: - display_var = config.get('execution', 'display_variable') - out_environ = {'DISPLAY': display_var} - except NoOptionError: - pass - IFLOGGER.debug(out_environ) - if isdefined(self.inputs.environ): - out_environ.update(self.inputs.environ) - return out_environ - - def version_from_command(self, flag='-v'): - cmdname = self.cmd.split()[0] - env = dict(os.environ) - if _exists_in_path(cmdname, env): - out_environ = self._get_environ() - env.update(out_environ) - proc = subprocess.Popen(' '.join((cmdname, flag)), shell=True, env=env, - stdout=subprocess.PIPE, stderr=subprocess.PIPE,) - out, _ = proc.communicate() - return out - - def _run_wrapper(self, runtime): - runtime = self._run_interface(runtime) - return runtime - - def _run_interface(self, runtime, **kwargs): - """Execute command via subprocess - - Parameters - ---------- - runtime : passed by the run function - - Returns - ------- - runtime : updated runtime information - adds stdout, stderr, merged, cmdline, dependencies, command_path - - """ - correct_return_codes = [0] - if 'correct_return_codes' in kwargs.keys(): - correct_return_codes = kwargs[correct_return_codes] - - setattr(runtime, 'stdout', None) - setattr(runtime, 'stderr', None) - setattr(runtime, 'cmdline', self.cmdline) - out_environ = self._get_environ() - runtime.environ.update(out_environ) - executable_name = self.cmd.split()[0] - exist_val, cmd_path = _exists_in_path(executable_name, - runtime.environ) - if not exist_val: - raise IOError("command '%s' could not be found on host %s" % - (self.cmd.split()[0], runtime.hostname)) - setattr(runtime, 'command_path', cmd_path) - setattr(runtime, 'dependencies', get_dependencies(executable_name, - runtime.environ)) - runtime = run_command(runtime, output=self.inputs.terminal_output, - redirect_x=self._redirect_x) - if runtime.returncode is None or \ - runtime.returncode not in correct_return_codes: - self.raise_exception(runtime) - - return runtime - - -class StdOutCommandLine(CommandLine): - """A command line that writes into the output stream""" - input_spec = StdOutCommandLineInputSpec - output_spec = StdOutCommandLineOutputSpec - - -class MpiCommandLine(CommandLine): - """Implements functionality to interact with command line programs - that can be run with MPI (i.e. using 'mpiexec'). - - Examples - -------- - >>> from nipype.interfaces.base import MpiCommandLine - >>> mpi_cli = MpiCommandLine(command='my_mpi_prog') - >>> mpi_cli.inputs.args = '-v' - >>> mpi_cli.cmdline - 'my_mpi_prog -v' - - >>> mpi_cli.inputs.use_mpi = True - >>> mpi_cli.inputs.n_procs = 8 - >>> mpi_cli.cmdline - 'mpiexec -n 8 my_mpi_prog -v' - """ - input_spec = MpiCommandLineInputSpec - - @property - def cmdline(self): - """Adds 'mpiexec' to begining of command""" - result = [] - if self.inputs.use_mpi: - result.append('mpiexec') - if isdefined(self.inputs.n_procs): - result.append('-n %d' % self.inputs.n_procs) - result.append(super(MpiCommandLine, self).cmdline) - return ' '.join(result) - - -class SEMLikeCommandLine(CommandLine): - """In SEM derived interface all outputs have corresponding inputs. - However, some SEM commands create outputs that are not defined in the XML. - In those cases one has to create a subclass of the autogenerated one and - overload the _list_outputs method. _outputs_from_inputs should still be - used but only for the reduced (by excluding those that do not have - corresponding inputs list of outputs. - """ - input_spec = SEMLikeCommandLineInputSpec - - def _post_run(self): - for name in list(self.outputs.keys()): - corresponding_input = getattr(self.inputs, name) - if isdefined(corresponding_input): - if (isinstance(corresponding_input, bool) and - corresponding_input): - setattr(self.outputs, name, op.abspath( - self._outputs_filenames[name])) - else: - if isinstance(corresponding_input, list): - setattr(self.outputs, name, - [op.abspath(inp) for inp in corresponding_input]) - else: - setattr(self.outputs, name, op.abspath(corresponding_input)) diff --git a/nipype/interfaces/base/__init__.py b/nipype/interfaces/base/__init__.py new file mode 100644 index 0000000000..6283bb3653 --- /dev/null +++ b/nipype/interfaces/base/__init__.py @@ -0,0 +1,11 @@ +# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- +# vi: set ft=python sts=4 ts=4 sw=4 et: +""" +The nipype.interface.base module provides the inputs/outputs specifications +and interface structures +""" + +from .interfaces import * +from .specs import * +from .traits_extension import * +from .runtime import * \ No newline at end of file diff --git a/nipype/interfaces/base/interfaces.py b/nipype/interfaces/base/interfaces.py new file mode 100644 index 0000000000..236697b1ea --- /dev/null +++ b/nipype/interfaces/base/interfaces.py @@ -0,0 +1,462 @@ +# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- +# vi: set ft=python sts=4 ts=4 sw=4 et: +""" +Base interfaces that will be implemented with installed packages +with implementation in nipype (:module:`nipype.interfaces`) or +pure python implementations (:module:`nipype.algorithms`). + +""" + +from __future__ import print_function +from __future__ import division + +from copy import deepcopy +import os +import os.path as op +import platform +from socket import getfqdn +import subprocess +from datetime import datetime as dt +from dateutil.parser import parse as parseutc + +from future import standard_library +standard_library.install_aliases() +from builtins import range +from builtins import object + +from configparser import NoOptionError +from traits.api import Interface, Instance, provides, HasTraits +from .traits_extension import traits +from ...utils.misc import trim, str2bool +from ...utils.provenance import write_provenance +from ... import config, logging, LooseVersion +from ... import __version__ +from ...external.six import string_types + +# Make all the traits and spec interfaces available through base +# for backwards compatibility, even though import * is discouraged +# in production environments. +from .traits_extension import isdefined, Command, _exists_in_path +from .specs import (IInputSpec, IOutputSpec, IInputCommandLineSpec, + BaseInterfaceInputSpec, CommandLineInputSpec, + StdOutCommandLineInputSpec, StdOutCommandLineOutputSpec, + MpiCommandLineInputSpec, + SEMLikeCommandLineInputSpec) +from .runtime import (Bunch, InterfaceResult, get_dependencies, + run_command, raise_exception) + +IFLOGGER = logging.getLogger('interface') +__docformat__ = 'restructuredtext' + + +class IBase(Interface): + """This is an abstract definition for Interface objects. + + It provides no functionality. It defines the necessary attributes + and methods all Interface objects should have. + + """ + + @classmethod + def help(cls, returnhelp=False): + """Prints class help""" + + def version(self): + """Provides the underlying interface version""" + + def pre_run(self, **inputs): + """Hook executed before running""" + + def run(self, **inputs): + """ + The interface runner + + Parameters + ---------- + inputs : allows the interface settings to be updated + + Returns + ------- + results : an InterfaceResult object containing a copy of the instance + that was executed, provenance information and, if successful, results + """ + + def post_run(self): + """Hook executed after running""" + + +@provides(IBase) +class BaseInterface(HasTraits): + """Implements common interface functionality. + + """ + inputs = Instance(IInputSpec) + outputs = Instance(IOutputSpec) + _input_spec = BaseInterfaceInputSpec + # _output_spec = + status = traits.Enum('waiting', 'starting', 'running', 'ending', + 'errored', 'finished') + version = traits.Str + redirect_x = traits.Bool + can_resume = traits.Bool(True) + always_run = traits.Bool + + def __init__(self, **inputs): + self.inputs = self._input_spec() + self.inputs.set(**inputs) + + @classmethod + def help(cls, returnhelp=False): + """ Prints class help """ + + docstring = [''] + if cls.__doc__: + docstring = trim(cls.__doc__).split('\n') + docstring + + allhelp = '\n'.join(docstring + cls._input_spec.help() + cls._output_spec.help()) + if returnhelp: + return allhelp + print(allhelp) + + def _run_wrapper(self, runtime): + sysdisplay = os.getenv('DISPLAY') + if self.redirect_x: + try: + from xvfbwrapper import Xvfb + except ImportError: + IFLOGGER.error('Xvfb wrapper could not be imported') + raise + + vdisp = Xvfb(nolisten='tcp') + vdisp.start() + vdisp_num = vdisp.vdisplay_num + + IFLOGGER.info('Redirecting X to :%d', vdisp_num) + runtime.environ['DISPLAY'] = ':%d' % vdisp_num + + runtime = self._run_interface(runtime) + + if self.redirect_x: + if sysdisplay is None: + os.unsetenv('DISPLAY') + else: + os.environ['DISPLAY'] = sysdisplay + + IFLOGGER.info('Freeing X :%d', vdisp_num) + vdisp.stop() + _unlock_display(vdisp_num) + + return runtime + + def _run_interface(self, runtime, *kwargs): + """ Core function that executes interface + """ + raise NotImplementedError + + def pre_run(self, **inputs): + """ Implementation of the pre-execution hook""" + self.inputs.set(**inputs) + self.inputs.check_inputs() + if not self.version: + if str2bool(config.get('execution', 'stop_on_unknown_version')): + raise ValueError('Interface %s has no version information' % + self.__class__.__name__) + else: + self.inputs.check_version(LooseVersion(str(self.version))) + + def post_run(self): + """ Implementation of the post-execution hook""" + # ns_outputs = {} + # for ns_input, ns_spec in list(self.inputs.namesource_items()): + # ns_pointer = getattr(ns_spec, 'out_name', None) + # if ns_pointer is not None: + # ns_outputs[ns_pointer] = ns_input + + # # Search for inputs with the same name + # for out_name, spec in list(self.outputs.items()): + # if out_name in ns_outputs.keys(): + # value = getattr(self.inputs, ns_outputs[out_name], Undefined) + # else: + # value = getattr(self.inputs, out_name, Undefined) + + # if isdefined(value): + # setattr(self.outputs, out_name, op.abspath(value)) + + # # Search for outputs with name source + # for out_name, spec in self.outputs.namesource_items(): + # if isdefined(getattr(self.outputs, out_name)): + # continue + # value = self.outputs.format_ns(spec.name_source, out_name, self.inputs) + # setattr(self.outputs, out_name, value) + pass + + def run(self, **inputs): + """Basic implementation of the interface runner""" + self.status = 'starting' + self.pre_run(**inputs) + # initialize provenance tracking + + runtime = Bunch( + cwd=os.getcwd(), returncode=None, duration=None, environ=deepcopy(dict(os.environ)), + startTime=dt.isoformat(dt.utcnow()), endTime=None, traceback=None, + platform=platform.platform(), hostname=getfqdn(), version=self.version) + + self.status = 'running' + try: + runtime = self._run_wrapper(runtime) + except Exception as e: # pylint: disable=W0703 + self.status = 'errored' + if len(e.args) == 0: + e.args = ("") + + message = "\nInterface %s failed to run." % self.__class__.__name__ + + if config.has_option('logging', 'interface_level') and \ + config.get('logging', 'interface_level').lower() == 'debug': + inputs_str = "Inputs:" + str(self.inputs) + "\n" + else: + inputs_str = '' + + if len(e.args) == 1 and isinstance(e.args[0], string_types): + e.args = (e.args[0] + " ".join([message, inputs_str]),) + else: + e.args += (message, ) + if inputs_str != '': + e.args += (inputs_str, ) + + # exception raising inhibition for special cases + import traceback + runtime.traceback = traceback.format_exc() + runtime.traceback_args = e.args # pylint: disable=W0201 + + runtime.endTime = dt.isoformat(dt.utcnow()) + timediff = parseutc(runtime.endTime) - parseutc(runtime.startTime) + runtime.duration = (timediff.days * 86400 + timediff.seconds + + timediff.microseconds / 1e5) + results = InterfaceResult(self.__class__, runtime, + inputs=self.inputs.get_traitsfree()) + + if runtime.traceback is None: + self.status = 'ending' + self.post_run() + results.outputs = self.outputs + + prov_record = None + if str2bool(config.get('execution', 'write_provenance')): + prov_record = write_provenance(results) + results.provenance = prov_record + + if self.status == 'errored': + if not getattr(self.inputs, 'ignore_exception', False): + raise + else: + self.status = 'finished' + return results + + +@provides(IBase) +class CommandLine(BaseInterface): + """Implements functionality to interact with command line programs + class must be instantiated with a command argument + + Parameters + ---------- + + command : string + define base immutable `command` you wish to run + + args : string, optional + optional arguments passed to base `command` + + + Examples + -------- + >>> import pprint + >>> from nipype.interfaces.base import CommandLine + >>> cli = CommandLine(command='ls', environ={'DISPLAY': ':1'}) + >>> cli.inputs.args = '-al' + >>> cli.cmdline + 'ls -al' + + >>> pprint.pprint(cli.inputs.trait_get()) # doctest: +NORMALIZE_WHITESPACE + {'args': '-al', + 'environ': {'DISPLAY': ':1'}, + 'ignore_exception': False, + 'terminal_output': 'stream'} + + >>> cli.inputs.get_hashval() + ([('args', '-al')], '11c37f97649cd61627f4afe5136af8c0') + + """ + + _cmd = None + _input_spec = CommandLineInputSpec + #_output_spec = OutputSpec + inputs = Instance(IInputCommandLineSpec) + outputs = Instance(IOutputSpec) + environ = traits.DictStrStr(dict(os.environ), desc='Environment variables') + command = Command + terminal_output = traits.Enum( + 'stream', 'allatonce', 'file', 'none', + desc='Control terminal output: `stream` - displays to terminal immediately (default), ' + '`allatonce` - waits till command is finished to display output, `file` - ' + 'writes output to file, `none` - output is ignored') + + def _environ_default(self): + return dict(os.environ) + + def _redirect_x_changed(self, new): + if not new: + try: + display_var = config.get('execution', 'display_variable') + except NoOptionError: + return + out_environ = {'DISPLAY': display_var} + self.environ.update(out_environ) + + def __init__(self, command=None, **inputs): + if command is not None: + self.command = command + elif self._cmd is not None: + self.command = self._cmd + else: + raise RuntimeError('CommandLine interfaces require' + ' the definition of a command') + self._redirect_x_changed(self.redirect_x) + self.inputs = self._input_spec() + self.inputs.set(environ=self.environ, + terminal_output=self.terminal_output, + **inputs) + + @property + def cmdline(self): + """ `command` plus any arguments (args) + validates arguments and generates command line""" + self.inputs.check_inputs() + allargs = self.inputs.parse_args() + allargs.insert(0, self._cmd) + return ' '.join(allargs) + + @classmethod + def help(cls, returnhelp=False): + allhelp = super(CommandLine, cls).help(returnhelp=True) + allhelp = "Wraps command ``%s``\n\n" % cls.command + allhelp + + if returnhelp: + return allhelp + print(allhelp) + + def version_from_command(self, flag='-v'): + """Call command -v to get version""" + cmdname = self.command.split()[0] + proc = subprocess.Popen( + ' '.join((cmdname, flag)), shell=True, env=self.environ, + stdout=subprocess.PIPE, stderr=subprocess.PIPE,) + out, _ = proc.communicate() + return out + + def _run_wrapper(self, runtime): + runtime = self._run_interface(runtime) + return runtime + + def _run_interface(self, runtime, **kwargs): + """Execute command via subprocess + + Parameters + ---------- + runtime : passed by the run function + + Returns + ------- + runtime : updated runtime information + adds stdout, stderr, merged, cmdline, dependencies, command_path + + """ + correct_return_codes = [0] + if 'correct_return_codes' in kwargs.keys(): + correct_return_codes = kwargs[correct_return_codes] + + runtime.environ.update(self.environ) + setattr(runtime, 'stdout', None) + setattr(runtime, 'stderr', None) + setattr(runtime, 'cmdline', self.cmdline) + setattr(runtime, 'command_path', self.trait('command').path) + setattr(runtime, 'dependencies', get_dependencies( + self.command.split()[0], runtime.environ)) + runtime = run_command(runtime, output=self.terminal_output, + redirect_x=self.redirect_x) + if runtime.returncode is None or \ + runtime.returncode not in correct_return_codes: + raise_exception(runtime) + return runtime + + +class StdOutCommandLine(CommandLine): + """A command line that writes into the output stream""" + _input_spec = StdOutCommandLineInputSpec + _output_spec = StdOutCommandLineOutputSpec + + +class MpiCommandLine(CommandLine): + """Implements functionality to interact with command line programs + that can be run with MPI (i.e. using 'mpiexec'). + + Examples + -------- + >>> from nipype.interfaces.base import MpiCommandLine + >>> mpi_cli = MpiCommandLine(command='my_mpi_prog') + >>> mpi_cli.inputs.args = '-v' + >>> mpi_cli.cmdline + 'my_mpi_prog -v' + + >>> mpi_cli.inputs.use_mpi = True + >>> mpi_cli.inputs.n_procs = 8 + >>> mpi_cli.cmdline + 'mpiexec -n 8 my_mpi_prog -v' + """ + _input_spec = MpiCommandLineInputSpec + + @property + def cmdline(self): + """Adds 'mpiexec' to begining of command""" + result = [] + if self.inputs.use_mpi: + result.append('mpiexec') + if isdefined(self.inputs.n_procs): + result.append('-n %d' % self.inputs.n_procs) + result.append(super(MpiCommandLine, self).cmdline) + return ' '.join(result) + + +class SEMLikeCommandLine(CommandLine): + """In SEM derived interface all outputs have corresponding inputs. + However, some SEM commands create outputs that are not defined in the XML. + In those cases one has to create a subclass of the autogenerated one and + overload the _list_outputs method. _outputs_from_inputs should still be + used but only for the reduced (by excluding those that do not have + corresponding inputs list of outputs. + """ + _input_spec = SEMLikeCommandLineInputSpec + + def post_run(self): + for name in list(self.outputs.keys()): + corresponding_input = getattr(self.inputs, name) + if isdefined(corresponding_input): + if (isinstance(corresponding_input, bool) and + corresponding_input): + setattr(self.outputs, name, op.abspath( + self._outputs_filenames[name])) + else: + if isinstance(corresponding_input, list): + setattr(self.outputs, name, + [op.abspath(inp) for inp in corresponding_input]) + else: + setattr(self.outputs, name, op.abspath(corresponding_input)) + +def _unlock_display(ndisplay): + lockf = op.join('/tmp', '.X%d-lock' % ndisplay) + try: + os.remove(lockf) + except: + return False + return True diff --git a/nipype/interfaces/base/runtime.py b/nipype/interfaces/base/runtime.py new file mode 100644 index 0000000000..3ed48a83c0 --- /dev/null +++ b/nipype/interfaces/base/runtime.py @@ -0,0 +1,448 @@ +# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- +# vi: set ft=python sts=4 ts=4 sw=4 et: +""" +Implementation for the InterfaceResult type and other requirements +""" +from __future__ import print_function +from __future__ import division + +from copy import deepcopy +import os +import os.path as op +import sys +import select +import errno +import subprocess +from datetime import datetime as dt + +from string import Template + +from future import standard_library +standard_library.install_aliases() +from builtins import range +from builtins import object + +from ...utils.misc import is_container +from ...utils.filemanip import md5 +from ... import logging + + +IFLOGGER = logging.getLogger('interface') +__docformat__ = 'restructuredtext' + + +def load_template(name): + """Load a template from the script_templates directory + + Parameters + ---------- + name : str + The name of the file to load + + Returns + ------- + template : string.Template + + """ + + full_fname = op.join(op.dirname(__file__), + 'script_templates', name) + template_file = open(full_fname) + template = Template(template_file.read()) + template_file.close() + return template + + +class Bunch(object): + """Dictionary-like class that provides attribute-style access to it's items. + + A `Bunch` is a simple container that stores it's items as class + attributes. Internally all items are stored in a dictionary and + the class exposes several of the dictionary methods. + + Examples + -------- + >>> from nipype.interfaces.base import Bunch + >>> inputs = Bunch(infile='subj.nii', fwhm=6.0, register_to_mean=True) + >>> inputs + Bunch(fwhm=6.0, infile='subj.nii', register_to_mean=True) + >>> inputs.register_to_mean = False + >>> inputs + Bunch(fwhm=6.0, infile='subj.nii', register_to_mean=False) + + + Notes + ----- + The Bunch pattern came from the Python Cookbook: + + .. [1] A. Martelli, D. Hudgeon, "Collecting a Bunch of Named + Items", Python Cookbook, 2nd Ed, Chapter 4.18, 2005. + + """ + + def __init__(self, *args, **kwargs): + self.__dict__.update(*args, **kwargs) + + def update(self, *args, **kwargs): + """update existing attribute, or create new attribute + + Note: update is very much like HasTraits.set""" + self.__dict__.update(*args, **kwargs) + + def items(self): + """iterates over bunch attributes as key, value pairs""" + return list(self.__dict__.items()) + + def iteritems(self): + """iterates over bunch attributes as key, value pairs""" + IFLOGGER.warn('iteritems is deprecated, use items instead') + return list(self.items()) + + def get(self, *args): + """Support dictionary get() functionality + """ + return self.__dict__.get(*args) + + def set(self, **kwargs): + """Support dictionary get() functionality + """ + return self.__dict__.update(**kwargs) + + def dictcopy(self): + """returns a deep copy of existing Bunch as a dictionary""" + return deepcopy(self.__dict__) + + def __repr__(self): + """representation of the sorted Bunch as a string + + Currently, this string representation of the `inputs` Bunch of + interfaces is hashed to determine if the process' dirty-bit + needs setting or not. Till that mechanism changes, only alter + this after careful consideration. + """ + outstr = ['Bunch('] + first = True + for k, input_value in sorted(self.items()): + if not first: + outstr.append(', ') + if isinstance(input_value, dict): + pairs = [] + for key, value in sorted(input_value.items()): + pairs.append("'%s': %s" % (key, value)) + input_value = '{' + ', '.join(pairs) + '}' + outstr.append('%s=%s' % (k, input_value)) + else: + outstr.append('%s=%r' % (k, input_value)) + first = False + outstr.append(')') + return ''.join(outstr) + + def _get_bunch_hash(self): + """Return a dictionary of our items with hashes for each file. + + Searches through dictionary items and if an item is a file, it + calculates the md5 hash of the file contents and stores the + file name and hash value as the new key value. + + However, the overall bunch hash is calculated only on the hash + value of a file. The path and name of the file are not used in + the overall hash calculation. + + Returns + ------- + dict_withhash : dict + Copy of our dictionary with the new file hashes included + with each file. + hashvalue : str + The md5 hash value of the `dict_withhash` + + """ + + infile_list = [] + for key, val in list(self.items()): + if is_container(val): + # XXX - SG this probably doesn't catch numpy arrays + # containing embedded file names either. + if isinstance(val, dict): + # XXX - SG should traverse dicts, but ignoring for now + item = None + else: + if len(val) == 0: + raise AttributeError('%s attribute is empty' % key) + item = val[0] + else: + item = val + try: + if op.isfile(item): + infile_list.append(key) + except TypeError: + # `item` is not a file or string. + continue + dict_withhash = self.dictcopy() + dict_nofilename = self.dictcopy() + for item in infile_list: + dict_withhash[item] = self._hash_infile(dict_withhash, item) + dict_nofilename[item] = [val[1] for val in dict_withhash[item]] + # Sort the items of the dictionary, before hashing the string + # representation so we get a predictable order of the + # dictionary. + sorted_dict = str(sorted(dict_nofilename.items())) + return dict_withhash, md5(sorted_dict.encode()).hexdigest() + + def _hash_infile(self, adict, key): + """Compute hashes of files""" + # Inject file hashes into adict[key] + stuff = adict[key] + if not is_container(stuff): + stuff = [stuff] + file_list = [] + for fname in stuff: + if op.isfile(fname): + md5obj = md5() + with open(fname, 'rb') as filep: + while True: + data = filep.read(8192) + if not data: + break + md5obj.update(data) + md5hex = md5obj.hexdigest() + else: + md5hex = None + file_list.append((fname, md5hex)) + return file_list + + def __pretty__(self, p, cycle): + """Support for the pretty module + + pretty is included in ipython.externals for ipython > 0.10""" + if cycle: + p.text('Bunch(...)') + else: + p.begin_group(6, 'Bunch(') + first = True + for k, input_value in sorted(self.items()): + if not first: + p.text(',') + p.breakable() + p.text(k + '=') + p.pretty(input_value) + first = False + p.end_group(6, ')') + + +class InterfaceResult(object): + """Object that contains the results of running a particular Interface. + + Attributes + ---------- + version : version of this Interface result object (a readonly property) + interface : class type + A copy of the `Interface` class that was run to generate this result. + inputs : a traits free representation of the inputs + outputs : Bunch + An `Interface` specific Bunch that contains all possible files + that are generated by the interface. The `outputs` are used + as the `inputs` to another node when interfaces are used in + the pipeline. + runtime : Bunch + + Contains attributes that describe the runtime environment when + the `Interface` was run. Contains the attributes: + + * cmdline : The command line string that was executed + * cwd : The directory the ``cmdline`` was executed in. + * stdout : The output of running the ``cmdline``. + * stderr : Any error messages output from running ``cmdline``. + * returncode : The code returned from running the ``cmdline``. + + """ + + def __init__(self, interface, runtime, inputs=None, outputs=None, + provenance=None): + self._version = 2.0 + self.interface = interface + self.runtime = runtime + self.inputs = inputs + self.outputs = outputs + self.provenance = provenance + + @property + def version(self): + return self._version + +class Stream(object): + """Function to capture stdout and stderr streams with timestamps + + stackoverflow.com/questions/4984549/merge-and-sync-stdout-and-stderr/5188359 + """ + + def __init__(self, name, impl): + self._name = name + self._impl = impl + self._buf = '' + self._rows = [] + self._lastidx = 0 + + def fileno(self): + "Pass-through for file descriptor." + return self._impl.fileno() + + def read(self, drain=0): + "Read from the file descriptor. If 'drain' set, read until EOF." + while self._read(drain) is not None: + if not drain: + break + + def _read(self, drain): + "Read from the file descriptor" + fd = self.fileno() + buf = os.read(fd, 4096).decode() + if not buf and not self._buf: + return None + if '\n' not in buf: + if not drain: + self._buf += buf + return [] + + # prepend any data previously read, then split into lines and format + buf = self._buf + buf + if '\n' in buf: + tmp, rest = buf.rsplit('\n', 1) + else: + tmp = buf + rest = None + self._buf = rest + now = dt.now().isoformat() + rows = tmp.split('\n') + self._rows += [(now, '%s %s:%s' % (self._name, now, r), r) + for r in rows] + for idx in range(self._lastidx, len(self._rows)): + IFLOGGER.info(self._rows[idx][1]) + self._lastidx = len(self._rows) + + +def run_command(runtime, output=None, timeout=0.01, redirect_x=False): + """Run a command, read stdout and stderr, prefix with timestamp. + + The returned runtime contains a merged stdout+stderr log with timestamps + """ + PIPE = subprocess.PIPE + + cmdline = runtime.cmdline + if redirect_x: + exist_xvfb, _ = _exists_in_path('xvfb-run', runtime.environ) + if not exist_xvfb: + raise RuntimeError('Xvfb was not found, X redirection aborted') + cmdline = 'xvfb-run -a ' + cmdline + + if output == 'file': + errfile = op.join(runtime.cwd, 'stderr.nipype') + outfile = op.join(runtime.cwd, 'stdout.nipype') + stderr = open(errfile, 'wt') # t=='text'===default + stdout = open(outfile, 'wt') + + proc = subprocess.Popen(cmdline, + stdout=stdout, + stderr=stderr, + shell=True, + cwd=runtime.cwd, + env=runtime.environ) + else: + proc = subprocess.Popen(cmdline, + stdout=PIPE, + stderr=PIPE, + shell=True, + cwd=runtime.cwd, + env=runtime.environ) + result = {} + errfile = op.join(runtime.cwd, 'stderr.nipype') + outfile = op.join(runtime.cwd, 'stdout.nipype') + if output == 'stream': + streams = [Stream('stdout', proc.stdout), Stream('stderr', proc.stderr)] + + def _process(drain=0): + try: + res = select.select(streams, [], [], timeout) + except select.error as e: + IFLOGGER.info(str(e)) + if e[0] == errno.EINTR: + return + else: + raise + else: + for stream in res[0]: + stream.read(drain) + + while proc.returncode is None: + proc.poll() + _process() + _process(drain=1) + + # collect results, merge and return + result = {} + temp = [] + for stream in streams: + rows = stream._rows + temp += rows + result[stream._name] = [r[2] for r in rows] + temp.sort() + result['merged'] = [r[1] for r in temp] + if output == 'allatonce': + stdout, stderr = proc.communicate() + if stdout and isinstance(stdout, bytes): + try: + stdout = stdout.decode() + except UnicodeDecodeError: + stdout = stdout.decode("ISO-8859-1") + if stderr and isinstance(stderr, bytes): + try: + stderr = stderr.decode() + except UnicodeDecodeError: + stderr = stderr.decode("ISO-8859-1") + + result['stdout'] = str(stdout).split('\n') + result['stderr'] = str(stderr).split('\n') + result['merged'] = '' + if output == 'file': + ret_code = proc.wait() + stderr.flush() + stdout.flush() + result['stdout'] = [line.strip() for line in open(outfile).readlines()] + result['stderr'] = [line.strip() for line in open(errfile).readlines()] + result['merged'] = '' + if output == 'none': + proc.communicate() + result['stdout'] = [] + result['stderr'] = [] + result['merged'] = '' + runtime.stderr = '\n'.join(result['stderr']) + runtime.stdout = '\n'.join(result['stdout']) + runtime.merged = result['merged'] + runtime.returncode = proc.returncode + return runtime + + +def get_dependencies(name, environ): + """Return library dependencies of a dynamically linked executable + + Uses otool on darwin, ldd on linux. Currently doesn't support windows. + + """ + PIPE = subprocess.PIPE + if sys.platform == 'darwin': + proc = subprocess.Popen( + 'otool -L `which %s`' % name, stdout=PIPE, stderr=PIPE, shell=True, env=environ) + elif 'linux' in sys.platform: + proc = subprocess.Popen( + 'ldd `which %s`' % name, stdout=PIPE, stderr=PIPE, shell=True, env=environ) + else: + return 'Platform %s not supported' % sys.platform + o, _ = proc.communicate() + return o.rstrip() + +def raise_exception(runtime): + message = "Command:\n" + runtime.cmdline + "\n" + message += "Standard output:\n" + runtime.stdout + "\n" + message += "Standard error:\n" + runtime.stderr + "\n" + message += "Return code: " + str(runtime.returncode) + raise RuntimeError(message) diff --git a/nipype/interfaces/specs.py b/nipype/interfaces/base/specs.py similarity index 94% rename from nipype/interfaces/specs.py rename to nipype/interfaces/base/specs.py index ac165cf783..ca87e0db7a 100644 --- a/nipype/interfaces/specs.py +++ b/nipype/interfaces/base/specs.py @@ -17,20 +17,60 @@ from builtins import range from builtins import object +from traits.api import Interface, provides +from ...utils.filemanip import md5, auto_hash, split_filename +from ...utils.misc import is_container +from ...utils.errors import InterfaceInputsError +from ... import logging, LooseVersion +from ... import __version__ +from ...external.six import string_types + from .traits_extension import (traits, Undefined, TraitDictObject, TraitListObject, TraitError, isdefined, File, has_metadata) -from ..utils.filemanip import md5, auto_hash, split_filename -from ..utils.misc import is_container -from ..utils.errors import InterfaceInputsError -from .. import logging, LooseVersion -from .. import __version__ -from ..external.six import string_types + NIPYPE_VERSION = LooseVersion(__version__) IFLOGGER = logging.getLogger('interface') __docformat__ = 'restructuredtext' +class IInputSpec(Interface): + """The abstract interface for inputs specifications""" + def items(self): + """Name, trait generator for user modifiable traits""" + + def check_inputs(self): + """Checks the correctness of inputs set""" + + def check_version(self): + """ + Checks if the version the implemented interface + matches that of the installed software + """ + + def get_outputs(self): + """Infers the outputs and returns a dictionary of results""" + + @classmethod + def help(cls): + """Print help of these traits""" + + +class IOutputSpec(Interface): + """The abstract interface for outputs specifications""" + def items(self): + """Name, trait generator for user modifiable traits""" + + @classmethod + def help(cls): + """Print help of these traits""" + + +class IInputCommandLineSpec(Interface): + def parse_args(self): + """Parse inputs to commandline arguments""" + +@provides(IInputSpec) class BaseTraitedSpec(traits.HasTraits): """Provide a few methods necessary to support nipype interface api @@ -87,12 +127,6 @@ def items(self): for name in sorted(self.copyable_trait_names()): yield name, self.traits()[name] - def namesource_items(self): - """Get inputs that will generate outputs""" - meta = dict(name_source=lambda t: t is not None) - meta_ns = dict(ns=lambda t: t is not None) - return list(self.traits(**meta).items()) + list(self.traits(**meta_ns).items()) - def _check_deprecated(self, name, new): """ Generate a warning when a deprecated trait is set """ if isdefined(new): @@ -331,6 +365,7 @@ class TraitedSpec(BaseTraitedSpec): _ = traits.Disallow +@provides(IInputSpec) class BaseInputSpec(BaseTraitedSpec): """ Base class for InputSpecs with strict traits """ _ = traits.Disallow @@ -489,6 +524,7 @@ def help(self): return helpstr +@provides(IInputSpec) class DynamicTraitedSpec(BaseTraitedSpec): """ A subclass to handle dynamic traits @@ -520,6 +556,7 @@ def __deepcopy__(self, memo): return dup +@provides(IInputSpec) class BaseInterfaceInputSpec(BaseInputSpec): """ BaseInputSpec with an input added to ignore exceptions """ ignore_exception = traits.Bool(False, usedefault=True, nohash=True, @@ -527,18 +564,10 @@ class BaseInterfaceInputSpec(BaseInputSpec): ' in case the interface fails to run') +@provides(IInputSpec, IInputCommandLineSpec) class CommandLineInputSpec(BaseInterfaceInputSpec): """ The InputSpec for interfaces wrapping a command line """ args = traits.Str(argstr='%s', desc='Additional parameters to the command') - environ = traits.DictStrStr(desc='Environment variables', usedefault=True, - nohash=True) - # This input does not have a "usedefault=True" so the set_default_terminal_output() - # method would work - terminal_output = traits.Enum( - 'stream', 'allatonce', 'file', 'none', nohash=True, - desc='Control terminal output: `stream` - displays to terminal immediately (default), ' - '`allatonce` - waits till command is finished to display output, `file` - ' - 'writes output to file, `none` - output is ignored') def _format_arg(self, name, spec=None, value=None): """A helper function for parse_args @@ -637,6 +666,7 @@ class StdOutCommandLineOutputSpec(TraitedSpec): out_file = File(exists=True, desc='file containing the standard output') +@provides(IInputSpec, IInputCommandLineSpec) class MpiCommandLineInputSpec(CommandLineInputSpec): """Appends the necessary inputs to run MpiCommandLine interfaces""" use_mpi = traits.Bool(False, usedefault=True, @@ -645,6 +675,7 @@ class MpiCommandLineInputSpec(CommandLineInputSpec): 'is managed externally (e.g. through SGE)') +@provides(IInputSpec, IInputCommandLineSpec) class SEMLikeCommandLineInputSpec(CommandLineInputSpec): """Redefines the formatting of outputs""" diff --git a/nipype/interfaces/traits_extension.py b/nipype/interfaces/base/traits_extension.py similarity index 91% rename from nipype/interfaces/traits_extension.py rename to nipype/interfaces/base/traits_extension.py index 049af41cb6..c353df120a 100644 --- a/nipype/interfaces/traits_extension.py +++ b/nipype/interfaces/base/traits_extension.py @@ -16,11 +16,11 @@ """ import os +import os.path as op import re import itertools as itools -from ast import literal_eval -from ..external.six import string_types +from ...external.six import string_types # perform all external trait imports here import traits if traits.__version__ < '3.7.0': @@ -30,11 +30,12 @@ from traits.trait_errors import TraitError from traits.trait_base import _Undefined -from ..utils.filemanip import split_filename +from ...utils.filemanip import split_filename -from .. import logging +from ... import logging IFLOGGER = logging.getLogger('interface') + class BaseFile (traits.BaseStr): """ Defines a trait whose value must be the name of a file. """ @@ -82,7 +83,7 @@ def validate(self, object, name, value): validated_value = super(BaseFile, self).validate(object, name, value) if not self.exists: return validated_value - elif os.path.isfile(value): + elif op.isfile(value): return validated_value self.error(object, name, value) @@ -191,7 +192,7 @@ def validate(self, object, name, value): validated_value = super(GenFile, self).validate(object, name, value) if not self.exists: return validated_value - elif os.path.isfile(value): + elif op.isfile(value): return validated_value self.error(object, name, value) @@ -613,7 +614,7 @@ def validate(self, object, name, value): if not self.exists: return validated_value - if os.path.isdir(value): + if op.isdir(value): return validated_value self.error(object, name, value) @@ -651,6 +652,37 @@ def __init__(self, value='', auto_set=False, entries=0, super(Directory, self).__init__(value, auto_set, entries, exists, **metadata) +class Command(traits.BaseStr): + """ Defines a trait whose value must be an executable command + """ + + # A description of the type of value this trait accepts: + info_text = 'an executable file' + + def __init__(self, path='', **metadata): + super(Command, self).__init__(path, **metadata) + self.metadata['path'] = path + + def validate(self, obj, name, value): + """ Validates that a specified value is valid for this trait. + + Note: The 'fast validator' version performs this check in C. + """ + validated_value = super(Command, self).validate(object, name, value) + env = getattr(obj, 'environ', None) + if self.metadata['path']: + valid = op.isfile(op.join(self.metadata['path'], + validated_value.split()[0])) + else: + valid, cmdpath = _exists_in_path(validated_value.split()[0], env) + self.metadata['path'] = cmdpath + if valid: + return validated_value + raise TraitError( + 'The \'%s\' trait of an interface must be an executable ' + 'file, but \'%s\' was not found in the system\'s PATH.' % + (name, value)) + """ The functions that pop-up the Traits GUIs, edit_traits and @@ -715,3 +747,21 @@ def _parse_name_source(name_source): yield (name.split('|'), indexing, fchunk) +def _exists_in_path(cmd, environ=None): + """ + Based on a code snippet from + http://orip.org/2009/08/python-checking-if-executable-exists-in.html + """ + # Read environ from variable, use system's environ as failback + if environ is not None: + environ = {} + + input_environ = environ.get("PATH", os.environ.get("PATH", "")) + extensions = os.environ.get("PATHEXT", "").split(os.pathsep) + for directory in input_environ.split(os.pathsep): + base = op.join(directory, cmd) + options = [base] + [(base + ext) for ext in extensions] + for filename in options: + if op.exists(filename): + return True, filename + return False, None diff --git a/nipype/interfaces/fsl/base.py b/nipype/interfaces/fsl/base.py index 59281cc081..f8b564b42d 100644 --- a/nipype/interfaces/fsl/base.py +++ b/nipype/interfaces/fsl/base.py @@ -113,6 +113,9 @@ class FSLCommandInputSpec(CommandLineInputSpec): output_type = traits.Trait(FSLOUTPUTTYPE, Info.ftypes, usedefault=True, desc='FSL output type') + # This is the easiest way to manage both synchronized + def _output_type_changed(self, new): + self.environ.update({'FSLOUTPUTTYPE': new}) class FSLCommand(CommandLine): # pylint: disable=W0223 """Base support for FSL commands.""" @@ -121,11 +124,8 @@ class FSLCommand(CommandLine): # pylint: disable=W0223 def __init__(self, **inputs): super(FSLCommand, self).__init__(**inputs) - self.inputs.on_trait_change(self._output_update, 'output_type') self.inputs.output_type = FSLOUTPUTTYPE - - def _output_update(self): - self.inputs.environ.update({'FSLOUTPUTTYPE': self.inputs.output_type}) + self.inputs.environ.update({'FSLOUTPUTTYPE': FSLOUTPUTTYPE}) @property def version(self): diff --git a/nipype/interfaces/fsl/dti.py b/nipype/interfaces/fsl/dti.py index 26031122d9..733663edae 100644 --- a/nipype/interfaces/fsl/dti.py +++ b/nipype/interfaces/fsl/dti.py @@ -1165,7 +1165,6 @@ def _post_run(self): class DistanceMapInputSpec(FSLCommandInputSpec): - in_file = File(exists=True, mandatory=True, argstr="--in=%s", desc="image to calculate distance values for") mask_file = File(exists=True, argstr="--mask=%s", @@ -1173,7 +1172,15 @@ class DistanceMapInputSpec(FSLCommandInputSpec): invert_input = traits.Bool(argstr="--invert", desc="invert input image") local_max_file = traits.Either(traits.Bool, File, argstr="--localmax=%s", desc="write an image of the local maxima", hash_files=False) - distance_map = File(genfile=True, argstr="--out=%s", desc="distance map to write", hash_files=False) + distance_map = GenFile(template='{in_file}_dstmap{output_type_}', argstr="--out=%s", + hash_files=False, desc="distance map to write") + + + def _format_arg(self, name, spec, value): + if name == 'local_max_file': + if isinstance(value, bool): + return spec.argstr % self.outputs.local_max_file + return super(DistanceMap, self)._format_arg(name, spec, value) class DistanceMapOutputSpec(TraitedSpec): @@ -1199,12 +1206,6 @@ class DistanceMap(FSLCommand): input_spec = DistanceMapInputSpec output_spec = DistanceMapOutputSpec - def _format_arg(self, name, spec, value): - if name == 'local_max_file': - if isinstance(value, bool): - return spec.argstr % self.outputs.local_max_file - return super(DistanceMap, self)._format_arg(name, spec, value) - def _post_run(self): _si = self.inputs self.outputs.distance_map = _si.distance_map diff --git a/nipype/interfaces/fsl/model.py b/nipype/interfaces/fsl/model.py index d953ca8b40..5074182a46 100644 --- a/nipype/interfaces/fsl/model.py +++ b/nipype/interfaces/fsl/model.py @@ -1328,14 +1328,26 @@ def _post_run(self): class SMMInputSpec(FSLCommandInputSpec): + logdir = traits.Directory('logdir', argstr='--ld=%s', usedefault=True, mandatory=True, + position=0, desc='output directory base') spatial_data_file = File( - exists=True, position=0, argstr='--sdf="%s"', mandatory=True, + exists=True, position=1, argstr='--sdf="%s"', mandatory=True, desc="statistics spatial map", copyfile=False) - mask = File(exists=True, position=1, argstr='--mask="%s"', mandatory=True, + mask = File(exists=True, position=2, argstr='--mask="%s"', mandatory=True, desc="mask file", copyfile=False) no_deactivation_class = traits.Bool(position=2, argstr="--zfstatmode", desc="enforces no deactivation class") + null_p_map = GenFile( + template='{logdir}/{spatial_data_file}_w1mean.txt', hash_files=False, + desc='output null p-values map') + activation_p_map = GenFile( + template='{logdir}/{spatial_data_file}_w2mean.txt', hash_files=False, + desc='output activation p-values map') + deactivation_p_map = GenFile( + template='{logdir}/{spatial_data_file}_w3mean.txt', hash_files=False, + desc='output deactivation p-values map') + class SMMOutputSpec(TraitedSpec): null_p_map = File(exists=True) @@ -1349,20 +1361,10 @@ class SMM(FSLCommand): Mixture Models with Adaptive Spatial Regularisation for Segmentation with an Application to FMRI Data; Woolrich, M., Behrens, T., Beckmann, C., and Smith, S.; IEEE Trans. Medical Imaging, 24(1):1-11, 2005. """ - _cmd = 'mm --ld=logdir' + _cmd = 'mm' input_spec = SMMInputSpec output_spec = SMMOutputSpec - def _post_run(self): - # TODO get the true logdir from the stdout - self.outputs.null_p_map = self._gen_fname(basename="w1_mean", - cwd="logdir") - self.outputs.activation_p_map = self._gen_fname( - basename="w2_mean", cwd="logdir") - if not isdefined(self.inputs.no_deactivation_class) or not self.inputs.no_deactivation_class: - self.outputs.deactivation_p_map = self._gen_fname( - basename="w3_mean", cwd="logdir") - class MELODICInputSpec(FSLCommandInputSpec): in_files = InputMultiPath( @@ -1648,23 +1650,6 @@ class Cluster(FSLCommand): output_spec = ClusterOutputSpec _cmd = 'cluster' - def _post_run(self): - - for key, suffix in list(self.filemap.items()): - outkey = key[4:] - inval = getattr(self.inputs, key) - if isdefined(inval): - if isinstance(inval, bool): - if inval: - change_ext = True - if suffix.endswith('.txt'): - change_ext = False - setattr(self.outputs, outkey, self._gen_fname(self.inputs.in_file, - suffix='_' + suffix, - change_ext=change_ext)) - else: - setattr(self.outputs, outkey, os.path.abspath(inval)) - class RandomiseInputSpec(FSLCommandInputSpec): in_file = File(exists=True, desc='4D input file', argstr='-i %s', diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index 46f73f74b9..92b1b630e8 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -580,8 +580,8 @@ class ApplyXfm(FLIRT): class MCFLIRTInputSpec(FSLCommandInputSpec): in_file = File(exists=True, position=0, argstr="-in %s", mandatory=True, desc="timeseries to motion-correct") - out_file = File(argstr='-out %s', genfile=True, - desc="file to write", hash_files=False) + out_file = GenFile(template='{in_file}_mcf{output_type_}', argstr='-out %s', + hash_files=False, desc="file to write") cost = traits.Enum( 'mutualinfo', 'woods', 'corratio', 'normcorr', 'normmi', 'leastsquares', argstr='-cost %s', desc="cost function to optimize") @@ -692,20 +692,6 @@ def _post_run(self): outfile = self.outputs.out_file self.outputs.rms_files = [outfile + '_abs.rms', outfile + '_rel.rms'] - def _gen_filename(self, name): - if name == 'out_file': - return self._gen_outfilename() - return None - - def _gen_outfilename(self): - out_file = self.inputs.out_file - if isdefined(out_file): - out_file = os.path.realpath(out_file) - if not isdefined(out_file) and isdefined(self.inputs.in_file): - out_file = self._gen_fname(self.inputs.in_file, - suffix='_mcf') - return os.path.abspath(out_file) - class FNIRTInputSpec(FSLCommandInputSpec): ref_file = File(exists=True, argstr='--ref=%s', mandatory=True, diff --git a/nipype/interfaces/fsl/tests/test_auto_Complex.py b/nipype/interfaces/fsl/tests/test_auto_Complex.py index 67d448de7e..955788fff3 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Complex.py +++ b/nipype/interfaces/fsl/tests/test_auto_Complex.py @@ -21,9 +21,7 @@ def test_Complex_inputs(): xor=['real_polar', 'real_cartesian', 'complex_cartesian', 'complex_polar', 'complex_split', 'complex_merge', 'start_vol', 'end_vol'], ), complex_out_file=dict(argstr='%s', - genfile=True, position=-3, - xor=['complex_out_file', 'magnitude_out_file', 'phase_out_file', 'real_out_file', 'imaginary_out_file', 'real_polar', 'real_cartesian'], ), complex_polar=dict(argstr='-complexpolar', position=1, @@ -46,17 +44,13 @@ def test_Complex_inputs(): position=3, ), imaginary_out_file=dict(argstr='%s', - genfile=True, position=-3, - xor=['complex_out_file', 'magnitude_out_file', 'phase_out_file', 'real_polar', 'complex_cartesian', 'complex_polar', 'complex_split', 'complex_merge'], ), magnitude_in_file=dict(argstr='%s', position=2, ), magnitude_out_file=dict(argstr='%s', - genfile=True, position=-4, - xor=['complex_out_file', 'real_out_file', 'imaginary_out_file', 'real_cartesian', 'complex_cartesian', 'complex_polar', 'complex_split', 'complex_merge'], ), output_type=dict(usedefault=True, ), @@ -64,9 +58,7 @@ def test_Complex_inputs(): position=3, ), phase_out_file=dict(argstr='%s', - genfile=True, position=-3, - xor=['complex_out_file', 'real_out_file', 'imaginary_out_file', 'real_cartesian', 'complex_cartesian', 'complex_polar', 'complex_split', 'complex_merge'], ), real_cartesian=dict(argstr='-realcartesian', position=1, @@ -76,9 +68,7 @@ def test_Complex_inputs(): position=2, ), real_out_file=dict(argstr='%s', - genfile=True, position=-4, - xor=['complex_out_file', 'magnitude_out_file', 'phase_out_file', 'real_polar', 'complex_cartesian', 'complex_polar', 'complex_split', 'complex_merge'], ), real_polar=dict(argstr='-realpolar', position=1, diff --git a/nipype/interfaces/fsl/tests/test_auto_FUGUE.py b/nipype/interfaces/fsl/tests/test_auto_FUGUE.py index 657da0bd0c..3719e1e285 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FUGUE.py +++ b/nipype/interfaces/fsl/tests/test_auto_FUGUE.py @@ -58,9 +58,11 @@ def test_FUGUE_inputs(): ), poly_order=dict(argstr='--poly=%d', ), - save_fmap=dict(xor=['save_unmasked_fmap'], + save_fmap=dict(usedefault=True, + xor=['save_unmasked_fmap'], ), - save_shift=dict(xor=['save_unmasked_shift'], + save_shift=dict(usedefault=True, + xor=['save_unmasked_shift'], ), save_unmasked_fmap=dict(argstr='--unmaskfmap', xor=['save_fmap'], diff --git a/nipype/interfaces/fsl/tests/test_auto_PowerSpectrum.py b/nipype/interfaces/fsl/tests/test_auto_PowerSpectrum.py index 8df00e2afc..9cb97a67f0 100644 --- a/nipype/interfaces/fsl/tests/test_auto_PowerSpectrum.py +++ b/nipype/interfaces/fsl/tests/test_auto_PowerSpectrum.py @@ -17,7 +17,6 @@ def test_PowerSpectrum_inputs(): position=0, ), out_file=dict(argstr='%s', - genfile=True, hash_files=False, position=1, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_Reorient2Std.py b/nipype/interfaces/fsl/tests/test_auto_Reorient2Std.py index eb8c62e295..2e4cb224e1 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Reorient2Std.py +++ b/nipype/interfaces/fsl/tests/test_auto_Reorient2Std.py @@ -16,7 +16,6 @@ def test_Reorient2Std_inputs(): mandatory=True, ), out_file=dict(argstr='%s', - genfile=True, hash_files=False, ), output_type=dict(usedefault=True, diff --git a/nipype/interfaces/fsl/tests/test_auto_SigLoss.py b/nipype/interfaces/fsl/tests/test_auto_SigLoss.py index 237246c252..49e1928af2 100644 --- a/nipype/interfaces/fsl/tests/test_auto_SigLoss.py +++ b/nipype/interfaces/fsl/tests/test_auto_SigLoss.py @@ -20,7 +20,7 @@ def test_SigLoss_inputs(): mask_file=dict(argstr='-m %s', ), out_file=dict(argstr='-s %s', - genfile=True, + hash_files=False, ), output_type=dict(usedefault=True, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_SwapDimensions.py b/nipype/interfaces/fsl/tests/test_auto_SwapDimensions.py index cbe9b3e0a8..12370a1fdc 100644 --- a/nipype/interfaces/fsl/tests/test_auto_SwapDimensions.py +++ b/nipype/interfaces/fsl/tests/test_auto_SwapDimensions.py @@ -20,7 +20,6 @@ def test_SwapDimensions_inputs(): mandatory=True, ), out_file=dict(argstr='%s', - genfile=True, hash_files=False, ), output_type=dict(usedefault=True, diff --git a/nipype/interfaces/fsl/tests/test_dti.py b/nipype/interfaces/fsl/tests/test_dti.py index 43a3e4becf..99db9470ba 100644 --- a/nipype/interfaces/fsl/tests/test_dti.py +++ b/nipype/interfaces/fsl/tests/test_dti.py @@ -476,7 +476,7 @@ def test_distancemap(): mapper.inputs.in_file = "a.nii" # It should - yield assert_equal, mapper.cmdline, "distancemap --out=%s --in=a.nii" % os.path.join(newdir, "a_dstmap.nii") + yield assert_equal, mapper.cmdline, "distancemap --in=a.nii --out=a_dstmap.nii" # And we should be able to write out a maxima map mapper.inputs.local_max_file = True diff --git a/setup.py b/setup.py index fc0c9e354d..51ce7bb570 100755 --- a/setup.py +++ b/setup.py @@ -312,6 +312,8 @@ def main(**extra_args): 'nipype.interfaces.afni.tests', 'nipype.interfaces.ants', 'nipype.interfaces.ants.tests', + 'nipype.interfaces.base', + 'nipype.interfaces.base.tests', 'nipype.interfaces.camino', 'nipype.interfaces.camino.tests', 'nipype.interfaces.camino2trackvis', From 12ad12c381f34e8dfd2d8b33b34ff7e507fd86e5 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Sun, 21 Feb 2016 09:17:13 -0800 Subject: [PATCH 58/73] fix error in commandline --- nipype/interfaces/base/interfaces.py | 98 +++++++++++++--------- nipype/interfaces/base/traits_extension.py | 80 +++++++----------- 2 files changed, 89 insertions(+), 89 deletions(-) diff --git a/nipype/interfaces/base/interfaces.py b/nipype/interfaces/base/interfaces.py index 236697b1ea..c57f37da63 100644 --- a/nipype/interfaces/base/interfaces.py +++ b/nipype/interfaces/base/interfaces.py @@ -84,6 +84,13 @@ def run(self, **inputs): def post_run(self): """Hook executed after running""" +class ICommandBase(Interface): + """Abstract class for interfaces wrapping a command line""" + + @property + def cmdline(self): + """The command line that is to be executed""" + @provides(IBase) class BaseInterface(HasTraits): @@ -105,19 +112,6 @@ def __init__(self, **inputs): self.inputs = self._input_spec() self.inputs.set(**inputs) - @classmethod - def help(cls, returnhelp=False): - """ Prints class help """ - - docstring = [''] - if cls.__doc__: - docstring = trim(cls.__doc__).split('\n') + docstring - - allhelp = '\n'.join(docstring + cls._input_spec.help() + cls._output_spec.help()) - if returnhelp: - return allhelp - print(allhelp) - def _run_wrapper(self, runtime): sysdisplay = os.getenv('DISPLAY') if self.redirect_x: @@ -253,8 +247,21 @@ def run(self, **inputs): self.status = 'finished' return results + @classmethod + def help(cls, returnhelp=False): + """ Prints class help """ -@provides(IBase) + docstring = [''] + if cls.__doc__: + docstring = trim(cls.__doc__).split('\n') + docstring + + allhelp = '\n'.join(docstring + cls._input_spec.help() + cls._output_spec.help()) + if returnhelp: + return allhelp + print(allhelp) + + +@provides(IBase, ICommandBase) class CommandLine(BaseInterface): """Implements functionality to interact with command line programs class must be instantiated with a command argument @@ -309,12 +316,21 @@ def _redirect_x_changed(self, new): if not new: try: display_var = config.get('execution', 'display_variable') + self.environ['DISPLAY'] = display_var except NoOptionError: - return - out_environ = {'DISPLAY': display_var} - self.environ.update(out_environ) + pass - def __init__(self, command=None, **inputs): + + def __init__(self, command=None, environ=None, **inputs): + # Force refresh of the redirect_x trait + self._redirect_x_changed(self.redirect_x) + + # First modify environment variables if passed + if environ is not None: + for k, v in list(environ.items()): + self.environ[k] = v + + # Set command to force validation if command is not None: self.command = command elif self._cmd is not None: @@ -322,11 +338,9 @@ def __init__(self, command=None, **inputs): else: raise RuntimeError('CommandLine interfaces require' ' the definition of a command') - self._redirect_x_changed(self.redirect_x) - self.inputs = self._input_spec() - self.inputs.set(environ=self.environ, - terminal_output=self.terminal_output, - **inputs) + + super(CommandLine, self).__init__(**inputs) + @property def cmdline(self): @@ -337,24 +351,6 @@ def cmdline(self): allargs.insert(0, self._cmd) return ' '.join(allargs) - @classmethod - def help(cls, returnhelp=False): - allhelp = super(CommandLine, cls).help(returnhelp=True) - allhelp = "Wraps command ``%s``\n\n" % cls.command + allhelp - - if returnhelp: - return allhelp - print(allhelp) - - def version_from_command(self, flag='-v'): - """Call command -v to get version""" - cmdname = self.command.split()[0] - proc = subprocess.Popen( - ' '.join((cmdname, flag)), shell=True, env=self.environ, - stdout=subprocess.PIPE, stderr=subprocess.PIPE,) - out, _ = proc.communicate() - return out - def _run_wrapper(self, runtime): runtime = self._run_interface(runtime) return runtime @@ -390,13 +386,32 @@ def _run_interface(self, runtime, **kwargs): raise_exception(runtime) return runtime + def version_from_command(self, flag='-v'): + """Call command -v to get version""" + cmdname = self.command.split()[0] + proc = subprocess.Popen( + ' '.join((cmdname, flag)), shell=True, env=self.environ, + stdout=subprocess.PIPE, stderr=subprocess.PIPE,) + out, _ = proc.communicate() + return out + + @classmethod + def help(cls, returnhelp=False): + allhelp = super(CommandLine, cls).help(returnhelp=True) + allhelp = "Wraps command ``%s``\n\n" % cls.command + allhelp + + if returnhelp: + return allhelp + print(allhelp) +@provides(IBase, ICommandBase) class StdOutCommandLine(CommandLine): """A command line that writes into the output stream""" _input_spec = StdOutCommandLineInputSpec _output_spec = StdOutCommandLineOutputSpec +@provides(IBase, ICommandBase) class MpiCommandLine(CommandLine): """Implements functionality to interact with command line programs that can be run with MPI (i.e. using 'mpiexec'). @@ -428,6 +443,7 @@ def cmdline(self): return ' '.join(result) +@provides(IBase, ICommandBase) class SEMLikeCommandLine(CommandLine): """In SEM derived interface all outputs have corresponding inputs. However, some SEM commands create outputs that are not defined in the XML. diff --git a/nipype/interfaces/base/traits_extension.py b/nipype/interfaces/base/traits_extension.py index c353df120a..6aae5cd7c6 100644 --- a/nipype/interfaces/base/traits_extension.py +++ b/nipype/interfaces/base/traits_extension.py @@ -19,8 +19,6 @@ import os.path as op import re import itertools as itools - -from ...external.six import string_types # perform all external trait imports here import traits if traits.__version__ < '3.7.0': @@ -30,8 +28,8 @@ from traits.trait_errors import TraitError from traits.trait_base import _Undefined +from ...external.six import string_types from ...utils.filemanip import split_filename - from ... import logging IFLOGGER = logging.getLogger('interface') @@ -75,18 +73,18 @@ def __init__(self, value='', filter=None, auto_set=False, super(BaseFile, self).__init__(value, **metadata) - def validate(self, object, name, value): + def validate(self, obj, name, value): """ Validates that a specified value is valid for this trait. Note: The 'fast validator' version performs this check in C. """ - validated_value = super(BaseFile, self).validate(object, name, value) + validated_value = super(BaseFile, self).validate(obj, name, value) if not self.exists: return validated_value elif op.isfile(value): return validated_value - self.error(object, name, value) + self.error(obj, name, value) class File (BaseFile): @@ -180,7 +178,7 @@ def __init__(self, template=None, keep_extension=False, value='', **metadata) - def validate(self, object, name, value): + def validate(self, obj, name, value): """ Validates that a specified value is valid for this trait. Note: The 'fast validator' version performs this check in C. @@ -189,13 +187,13 @@ def validate(self, object, name, value): if not isdefined(value): return value - validated_value = super(GenFile, self).validate(object, name, value) + validated_value = super(GenFile, self).validate(obj, name, value) if not self.exists: return validated_value elif op.isfile(value): return validated_value - self.error(object, name, value) + self.error(obj, name, value) def get(self, obj, name): # Compute expected name iff trait is not set @@ -260,6 +258,7 @@ def get(self, obj, name): return self.get_value(obj, name) def set(self, obj, name, value): + """Implement set so that the trait is modifiable""" self.set_value(obj, name, value) @@ -605,19 +604,19 @@ def __init__(self, value='', auto_set=False, entries=0, super(BaseDirectory, self).__init__(value, **metadata) - def validate(self, object, name, value): + def validate(self, obj, name, value): """ Validates that a specified value is valid for this trait. Note: The 'fast validator' version performs this check in C. """ - validated_value = super(BaseDirectory, self).validate(object, name, value) + validated_value = super(BaseDirectory, self).validate(obj, name, value) if not self.exists: return validated_value if op.isdir(value): return validated_value - self.error(object, name, value) + self.error(obj, name, value) class Directory (BaseDirectory): @@ -658,24 +657,17 @@ class Command(traits.BaseStr): # A description of the type of value this trait accepts: info_text = 'an executable file' - - def __init__(self, path='', **metadata): - super(Command, self).__init__(path, **metadata) - self.metadata['path'] = path def validate(self, obj, name, value): """ Validates that a specified value is valid for this trait. Note: The 'fast validator' version performs this check in C. """ - validated_value = super(Command, self).validate(object, name, value) - env = getattr(obj, 'environ', None) - if self.metadata['path']: - valid = op.isfile(op.join(self.metadata['path'], - validated_value.split()[0])) - else: - valid, cmdpath = _exists_in_path(validated_value.split()[0], env) - self.metadata['path'] = cmdpath + validated_value = super(Command, self).validate(obj, name, value) + env = obj.environ + IFLOGGER.debug('Environ now: %s', env) + valid, _ = _exists_in_path(validated_value.split()[0], env) + if valid: return validated_value raise TraitError( @@ -684,37 +676,30 @@ def validate(self, obj, name, value): (name, value)) -""" -The functions that pop-up the Traits GUIs, edit_traits and -configure_traits, were failing because all of our inputs default to -Undefined deep and down in traits/ui/wx/list_editor.py it checks for -the len() of the elements of the list. The _Undefined class in traits -does not define the __len__ method and would error. I tried defining -our own Undefined and even sublassing Undefined, but both of those -failed with a TraitError in our initializer when we assign the -Undefined to the inputs because of an incompatible type: - -TraitError: The 'vertical_gradient' trait of a BetInputSpec instance must be a float, but a value of was specified. - -So... in order to keep the same type but add the missing method, I -monkey patched. -""" +# The functions that pop-up the Traits GUIs, edit_traits and +# configure_traits, were failing because all of our inputs default to +# Undefined deep and down in traits/ui/wx/list_editor.py it checks for +# the len() of the elements of the list. The _Undefined class in traits +# does not define the __len__ method and would error. I tried defining +# our own Undefined and even sublassing Undefined, but both of those +# failed with a TraitError in our initializer when we assign the +# Undefined to the inputs because of an incompatible type: -def length(self): - return 0 +# TraitError: The 'vertical_gradient' trait of a BetInputSpec instance must be a float, but a value of was specified. +# So... in order to keep the same type but add the missing method, I +# monkey patched. ########################################################################## # Apply monkeypatch here -_Undefined.__len__ = length +_Undefined.__len__ = lambda cls: 0 ########################################################################## Undefined = _Undefined() - -def isdefined(object): - return not isinstance(object, _Undefined) - +def isdefined(obj): + """Checks if a certain trait was set""" + return not isinstance(obj, _Undefined) def has_metadata(trait, metadata, value=None, recursive=True): """ @@ -746,14 +731,13 @@ def _parse_name_source(name_source): name = fchunk.split('.')[0].split('!')[0].split(':')[0].split('[')[0] yield (name.split('|'), indexing, fchunk) - def _exists_in_path(cmd, environ=None): """ Based on a code snippet from http://orip.org/2009/08/python-checking-if-executable-exists-in.html """ # Read environ from variable, use system's environ as failback - if environ is not None: + if environ is None: environ = {} input_environ = environ.get("PATH", os.environ.get("PATH", "")) From 0b31176b7bee7e5c217bc0ffcb6ca82a81b92985 Mon Sep 17 00:00:00 2001 From: oesteban Date: Sun, 21 Feb 2016 11:21:19 -0800 Subject: [PATCH 59/73] move ignore_exception to interface level --- nipype/algorithms/icc.py | 4 +- nipype/algorithms/mesh.py | 8 +- nipype/algorithms/metrics.py | 12 +- nipype/algorithms/misc.py | 16 +-- nipype/algorithms/modelgen.py | 4 +- nipype/algorithms/rapidart.py | 6 +- nipype/algorithms/tests/test_auto_ICC.py | 12 -- nipype/interfaces/base/interfaces.py | 124 +++++++++--------- nipype/interfaces/base/specs.py | 10 +- .../interfaces/{ => base}/tests/test_base.py | 0 nipype/interfaces/cmtk/cmtk.py | 6 +- nipype/interfaces/cmtk/convert.py | 6 +- nipype/interfaces/cmtk/nbs.py | 4 +- nipype/interfaces/cmtk/nx.py | 6 +- nipype/interfaces/cmtk/parcellation.py | 4 +- nipype/interfaces/dipy/base.py | 6 +- nipype/interfaces/dipy/reconstruction.py | 8 +- nipype/interfaces/dipy/simulate.py | 4 +- nipype/interfaces/dipy/tensors.py | 6 +- nipype/interfaces/dipy/tracks.py | 6 +- nipype/interfaces/elastix/utils.py | 4 +- nipype/interfaces/fsl/model.py | 10 +- nipype/interfaces/io.py | 26 ++-- nipype/interfaces/mrtrix/convert.py | 2 +- nipype/interfaces/mrtrix/tensors.py | 2 +- nipype/interfaces/nipy/model.py | 6 +- nipype/interfaces/nipy/preprocess.py | 12 +- nipype/interfaces/nipy/utils.py | 4 +- nipype/interfaces/nitime/analysis.py | 4 +- nipype/interfaces/spm/base.py | 4 +- nipype/interfaces/spm/utils.py | 2 +- nipype/interfaces/utility.py | 12 +- nipype/pipeline/engine/tests/test_engine.py | 2 +- 33 files changed, 163 insertions(+), 179 deletions(-) rename nipype/interfaces/{ => base}/tests/test_base.py (100%) diff --git a/nipype/algorithms/icc.py b/nipype/algorithms/icc.py index 5c1faff0b7..0772d7d0b7 100644 --- a/nipype/algorithms/icc.py +++ b/nipype/algorithms/icc.py @@ -19,10 +19,10 @@ import nibabel as nb from builtins import range -from ..interfaces.base import (traits, File, BaseInterface, BaseInterfaceInputSpec, +from ..interfaces.base import (traits, File, BaseInterface, BaseInputSpec, TraitedSpec) -class ICCInputSpec(BaseInterfaceInputSpec): +class ICCInputSpec(BaseInputSpec): subjects_sessions = traits.List(traits.List(File(exists=True)), desc="n subjects m sessions 3D stat files", mandatory=True) diff --git a/nipype/algorithms/mesh.py b/nipype/algorithms/mesh.py index 72fe267481..7b12904ac6 100644 --- a/nipype/algorithms/mesh.py +++ b/nipype/algorithms/mesh.py @@ -19,7 +19,7 @@ from .. import logging from ..external.six import string_types -from ..interfaces.base import traits, File, GenFile, BaseInterface, BaseInterfaceInputSpec, TraitedSpec +from ..interfaces.base import traits, File, GenFile, BaseInterface, BaseInputSpec, TraitedSpec IFLOGGER = logging.getLogger('interface') @@ -38,7 +38,7 @@ def __init__(self, **inputs): super(TVTKBaseInterface, self).__init__(**inputs) -class WarpPointsInputSpec(BaseInterfaceInputSpec): +class WarpPointsInputSpec(BaseInputSpec): points = File(exists=True, mandatory=True, desc=('file containing the point set')) warp = File(exists=True, mandatory=True, @@ -123,7 +123,7 @@ def _run_interface(self, runtime): return runtime -class ComputeMeshWarpInputSpec(BaseInterfaceInputSpec): +class ComputeMeshWarpInputSpec(BaseInputSpec): surface1 = File(exists=True, mandatory=True, desc=('Reference surface (vtk format) to which compute ' 'distance.')) @@ -257,7 +257,7 @@ def _run_interface(self, runtime): return runtime -class MeshWarpMathsInputSpec(BaseInterfaceInputSpec): +class MeshWarpMathsInputSpec(BaseInputSpec): in_surf = File(exists=True, mandatory=True, desc=('Input surface in vtk format, with associated warp ' 'field as point data (ie. from ComputeMeshWarp')) diff --git a/nipype/algorithms/metrics.py b/nipype/algorithms/metrics.py index d2365ce92b..34aaca242f 100644 --- a/nipype/algorithms/metrics.py +++ b/nipype/algorithms/metrics.py @@ -27,13 +27,13 @@ from .. import logging from ..utils.misc import package_check -from ..interfaces.base import (traits, File, GenFile, isdefined, BaseInterfaceInputSpec, +from ..interfaces.base import (traits, File, GenFile, isdefined, BaseInputSpec, TraitedSpec, InputMultiPath, BaseInterface) iflogger = logging.getLogger('interface') -class DistanceInputSpec(BaseInterfaceInputSpec): +class DistanceInputSpec(BaseInputSpec): volume1 = File(exists=True, mandatory=True, desc="Has to have the same dimensions as volume2.") volume2 = File( @@ -209,7 +209,7 @@ def _run_interface(self, runtime): return runtime -class OverlapInputSpec(BaseInterfaceInputSpec): +class OverlapInputSpec(BaseInputSpec): volume1 = File(exists=True, mandatory=True, desc='Has to have the same dimensions as volume2.') volume2 = File(exists=True, mandatory=True, @@ -347,7 +347,7 @@ def _run_interface(self, runtime): return runtime -class FuzzyOverlapInputSpec(BaseInterfaceInputSpec): +class FuzzyOverlapInputSpec(BaseInputSpec): in_ref = InputMultiPath(File(exists=True), mandatory=True, desc='Reference image. Requires the same dimensions as in_tst.') in_tst = InputMultiPath(File(exists=True), mandatory=True, @@ -454,7 +454,7 @@ def _run_interface(self, runtime): return runtime -class ErrorMapInputSpec(BaseInterfaceInputSpec): +class ErrorMapInputSpec(BaseInputSpec): in_ref = File(exists=True, mandatory=True, desc="Reference image. Requires the same dimensions as in_tst.") in_tst = File(exists=True, mandatory=True, @@ -546,7 +546,7 @@ def _run_interface(self, runtime): return runtime -class SimilarityInputSpec(BaseInterfaceInputSpec): +class SimilarityInputSpec(BaseInputSpec): volume1 = File(exists=True, desc="3D/4D volume", mandatory=True) volume2 = File(exists=True, desc="3D/4D volume", mandatory=True) mask1 = File(exists=True, desc="3D volume") diff --git a/nipype/algorithms/misc.py b/nipype/algorithms/misc.py index a36ce10592..5cb108253b 100644 --- a/nipype/algorithms/misc.py +++ b/nipype/algorithms/misc.py @@ -31,7 +31,7 @@ from . import metrics as nam from ..utils.filemanip import fname_presuffix, split_filename from ..interfaces.base import (traits, File, GenFile, GenMultiFile, isdefined, Undefined, - BaseInterfaceInputSpec, TraitedSpec, InputMultiPath, + BaseInputSpec, TraitedSpec, InputMultiPath, OutputMultiPath, DynamicTraitedSpec, BaseInterface) @@ -39,7 +39,7 @@ IFLOGGER = logging.getLogger('interface') -class PickAtlasInputSpec(BaseInterfaceInputSpec): +class PickAtlasInputSpec(BaseInputSpec): atlas = File(exists=True, desc="Location of the atlas that will be used.", mandatory=True) labels = traits.Either( @@ -110,7 +110,7 @@ def _get_brodmann_area(self): return nb.Nifti1Image(newdata, nii.affine, nii.header) -class SimpleThresholdInputSpec(BaseInterfaceInputSpec): +class SimpleThresholdInputSpec(BaseInputSpec): volumes = InputMultiPath(File(exists=True), mandatory=True, desc='volumes to be thresholded') threshold = traits.Float(mandatory=True, desc='volumes to be thresholdedeverything below ' @@ -145,7 +145,7 @@ def _run_interface(self, runtime): return runtime -class ModifyAffineInputSpec(BaseInterfaceInputSpec): +class ModifyAffineInputSpec(BaseInputSpec): volumes = InputMultiPath( File(exists=True), mandatory=True, desc='volumes which affine matrices will be modified') @@ -176,7 +176,7 @@ def _run_interface(self, runtime): return runtime -class CreateNiftiInputSpec(BaseInterfaceInputSpec): +class CreateNiftiInputSpec(BaseInputSpec): data_file = File(exists=True, mandatory=True, desc="ANALYZE img file") header_file = File( exists=True, mandatory=True, desc="corresponding ANALYZE hdr file") @@ -210,7 +210,7 @@ def _run_interface(self, runtime): return runtime -class TSNRInputSpec(BaseInterfaceInputSpec): +class TSNRInputSpec(BaseInputSpec): in_file = InputMultiPath(File(exists=True), mandatory=True, desc='realigned 4D file or a list of 3D files') regress_poly = traits.Range(low=1, desc='Remove polynomials') @@ -291,7 +291,7 @@ def _run_interface(self, runtime): return runtime -class GunzipInputSpec(BaseInterfaceInputSpec): +class GunzipInputSpec(BaseInputSpec): in_file = File(exists=True, mandatory=True) out_file = GenFile(ns='in_file', template='%s', name_remove='.gz', keep_extension=False, desc='output file') @@ -592,7 +592,7 @@ def _run_interface(self, runtime): return runtime -class AddCSVRowInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): +class AddCSVRowInputSpec(DynamicTraitedSpec, BaseInputSpec): in_file = File(mandatory=True, desc='Input comma-separated value (CSV) files') _outputs = traits.Dict(traits.Any, value={}, usedefault=True) diff --git a/nipype/algorithms/modelgen.py b/nipype/algorithms/modelgen.py index 52daa0da1c..03ce6b54ce 100644 --- a/nipype/algorithms/modelgen.py +++ b/nipype/algorithms/modelgen.py @@ -30,7 +30,7 @@ from ..external.six import string_types -from ..interfaces.base import (traits, File, isdefined, Undefined, BaseInterfaceInputSpec, +from ..interfaces.base import (traits, File, isdefined, Undefined, BaseInputSpec, TraitedSpec, InputMultiPath, BaseInterface, Bunch) from ..utils.filemanip import filename_to_list @@ -176,7 +176,7 @@ def gen_info(run_event_files): return info -class SpecifyModelInputSpec(BaseInterfaceInputSpec): +class SpecifyModelInputSpec(BaseInputSpec): subject_info = InputMultiPath(Bunch, mandatory=True, xor=['subject_info', 'event_files'], desc=("Bunch or List(Bunch) subject specific condition information. " diff --git a/nipype/algorithms/rapidart.py b/nipype/algorithms/rapidart.py index fb1ee0a354..e3cb4768d5 100644 --- a/nipype/algorithms/rapidart.py +++ b/nipype/algorithms/rapidart.py @@ -33,14 +33,14 @@ from ..utils.filemanip import filename_to_list, save_json, split_filename from ..utils.misc import find_indices -from ..interfaces.base import (traits, File, GenMultiFile, isdefined, BaseInterfaceInputSpec, +from ..interfaces.base import (traits, File, GenMultiFile, isdefined, BaseInputSpec, TraitedSpec, InputMultiPath, OutputMultiPath, BaseInterface) from .. import logging, config iflogger = logging.getLogger('interface') -class ArtifactDetectInputSpec(BaseInterfaceInputSpec): +class ArtifactDetectInputSpec(BaseInputSpec): realigned_files = InputMultiPath(File(exists=True), desc="Names of realigned functional data files", mandatory=True) @@ -426,7 +426,7 @@ def _run_interface(self, runtime): return runtime -class StimCorrInputSpec(BaseInterfaceInputSpec): +class StimCorrInputSpec(BaseInputSpec): realignment_parameters = InputMultiPath( File(exists=True), mandatory=True, desc='Names of realignment parameters corresponding to the functional data files') diff --git a/nipype/algorithms/tests/test_auto_ICC.py b/nipype/algorithms/tests/test_auto_ICC.py index 4c32fe9a29..a11e8936e4 100644 --- a/nipype/algorithms/tests/test_auto_ICC.py +++ b/nipype/algorithms/tests/test_auto_ICC.py @@ -22,15 +22,3 @@ def test_ICC_inputs(): for metakey, value in list(metadata.items()): yield assert_equal, getattr(inputs.traits()[key], metakey), value - -def test_ICC_outputs(): - output_map = dict(icc_map=dict(), - session_F_map=dict(), - session_var_map=dict(), - subject_var_map=dict(), - ) - outputs = ICC.output_spec() - - for key, metadata in list(output_map.items()): - for metakey, value in list(metadata.items()): - yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/base/interfaces.py b/nipype/interfaces/base/interfaces.py index c57f37da63..c7b59b0da3 100644 --- a/nipype/interfaces/base/interfaces.py +++ b/nipype/interfaces/base/interfaces.py @@ -36,9 +36,9 @@ # Make all the traits and spec interfaces available through base # for backwards compatibility, even though import * is discouraged # in production environments. -from .traits_extension import isdefined, Command, _exists_in_path +from .traits_extension import isdefined, Command from .specs import (IInputSpec, IOutputSpec, IInputCommandLineSpec, - BaseInterfaceInputSpec, CommandLineInputSpec, + BaseInputSpec, CommandLineInputSpec, StdOutCommandLineInputSpec, StdOutCommandLineOutputSpec, MpiCommandLineInputSpec, SEMLikeCommandLineInputSpec) @@ -67,7 +67,7 @@ def version(self): def pre_run(self, **inputs): """Hook executed before running""" - def run(self, **inputs): + def run(self, dry_run=False, **inputs): """ The interface runner @@ -84,12 +84,15 @@ def run(self, **inputs): def post_run(self): """Hook executed after running""" + def _aggregate_outputs(self): + """Fill in ouputs after running interface""" + class ICommandBase(Interface): """Abstract class for interfaces wrapping a command line""" @property def cmdline(self): - """The command line that is to be executed""" + """The command line that is to be executed""" @provides(IBase) @@ -99,14 +102,15 @@ class BaseInterface(HasTraits): """ inputs = Instance(IInputSpec) outputs = Instance(IOutputSpec) - _input_spec = BaseInterfaceInputSpec - # _output_spec = - status = traits.Enum('waiting', 'starting', 'running', 'ending', + _input_spec = BaseInputSpec + # _output_spec = + status = traits.Enum('waiting', 'starting', 'running', 'ending', 'errored', 'finished') version = traits.Str redirect_x = traits.Bool can_resume = traits.Bool(True) always_run = traits.Bool + ignore_exception = traits.Bool def __init__(self, **inputs): self.inputs = self._input_spec() @@ -160,6 +164,9 @@ def pre_run(self, **inputs): def post_run(self): """ Implementation of the post-execution hook""" + pass + + def _aggregate_outputs(self): # ns_outputs = {} # for ns_input, ns_spec in list(self.inputs.namesource_items()): # ns_pointer = getattr(ns_spec, 'out_name', None) @@ -184,69 +191,66 @@ def post_run(self): # setattr(self.outputs, out_name, value) pass - def run(self, **inputs): + def run(self, dry_run=False, **inputs): """Basic implementation of the interface runner""" self.status = 'starting' self.pre_run(**inputs) # initialize provenance tracking - runtime = Bunch( cwd=os.getcwd(), returncode=None, duration=None, environ=deepcopy(dict(os.environ)), startTime=dt.isoformat(dt.utcnow()), endTime=None, traceback=None, platform=platform.platform(), hostname=getfqdn(), version=self.version) - + self.status = 'running' + exception = None try: - runtime = self._run_wrapper(runtime) - except Exception as e: # pylint: disable=W0703 - self.status = 'errored' - if len(e.args) == 0: - e.args = ("") - - message = "\nInterface %s failed to run." % self.__class__.__name__ - - if config.has_option('logging', 'interface_level') and \ - config.get('logging', 'interface_level').lower() == 'debug': - inputs_str = "Inputs:" + str(self.inputs) + "\n" - else: - inputs_str = '' - - if len(e.args) == 1 and isinstance(e.args[0], string_types): - e.args = (e.args[0] + " ".join([message, inputs_str]),) + if not dry_run: + runtime = self._run_wrapper(runtime) else: - e.args += (message, ) - if inputs_str != '': - e.args += (inputs_str, ) - - # exception raising inhibition for special cases - import traceback - runtime.traceback = traceback.format_exc() - runtime.traceback_args = e.args # pylint: disable=W0201 - - runtime.endTime = dt.isoformat(dt.utcnow()) - timediff = parseutc(runtime.endTime) - parseutc(runtime.startTime) - runtime.duration = (timediff.days * 86400 + timediff.seconds + - timediff.microseconds / 1e5) - results = InterfaceResult(self.__class__, runtime, - inputs=self.inputs.get_traitsfree()) - - if runtime.traceback is None: - self.status = 'ending' - self.post_run() - results.outputs = self.outputs - - prov_record = None - if str2bool(config.get('execution', 'write_provenance')): - prov_record = write_provenance(results) - results.provenance = prov_record - - if self.status == 'errored': - if not getattr(self.inputs, 'ignore_exception', False): + runtime = self._dry_run(runtime) + except Exception as error: # pylint: disable=W0703 + runtime, exception = self.handle_error(runtime, error) + if not self.ignore_exception: raise - else: + finally: + runtime.endTime = dt.isoformat(dt.utcnow()) + timediff = parseutc(runtime.endTime) - parseutc(runtime.startTime) + runtime.duration = (timediff.days * 86400 + timediff.seconds + + timediff.microseconds / 1e5) + results = InterfaceResult(self.__class__, runtime, + inputs=self.inputs.get_traitsfree()) + + if exception is None: + self.status = 'ending' + self._aggregate_outputs() + self.post_run() + results.outputs = self.outputs + + prov_record = None + if str2bool(config.get('execution', 'write_provenance')): + prov_record = write_provenance(results) + results.provenance = prov_record + + if exception is None: self.status = 'finished' return results + def handle_error(self, runtime, exception): + import traceback + self.status = 'errored' + message = ["Interface %s failed to run." % self.__class__.__name__] + if config.get('logging', 'interface_level', 'info').lower() == 'debug': + message += ["Inputs:\n%s\n" % str(self.inputs)] + + if len(exception.args) == 1 and isinstance(exception.args[0], string_types): + message.insert(0, exception.args[0]) + else: + message += list(exception.args) + # exception raising inhibition for special cases + runtime.traceback = traceback.format_exc() + runtime.traceback_args = message # pylint: disable=W0201 + return runtime, message + @classmethod def help(cls, returnhelp=False): """ Prints class help """ @@ -254,7 +258,7 @@ def help(cls, returnhelp=False): docstring = [''] if cls.__doc__: docstring = trim(cls.__doc__).split('\n') + docstring - + allhelp = '\n'.join(docstring + cls._input_spec.help() + cls._output_spec.help()) if returnhelp: return allhelp @@ -321,7 +325,7 @@ def _redirect_x_changed(self, new): pass - def __init__(self, command=None, environ=None, **inputs): + def __init__(self, command=None, environ=None, **inputs): # Force refresh of the redirect_x trait self._redirect_x_changed(self.redirect_x) @@ -338,9 +342,9 @@ def __init__(self, command=None, environ=None, **inputs): else: raise RuntimeError('CommandLine interfaces require' ' the definition of a command') - + super(CommandLine, self).__init__(**inputs) - + @property def cmdline(self): @@ -371,7 +375,7 @@ def _run_interface(self, runtime, **kwargs): correct_return_codes = [0] if 'correct_return_codes' in kwargs.keys(): correct_return_codes = kwargs[correct_return_codes] - + runtime.environ.update(self.environ) setattr(runtime, 'stdout', None) setattr(runtime, 'stderr', None) diff --git a/nipype/interfaces/base/specs.py b/nipype/interfaces/base/specs.py index ca87e0db7a..1869a4d6b0 100644 --- a/nipype/interfaces/base/specs.py +++ b/nipype/interfaces/base/specs.py @@ -556,16 +556,8 @@ def __deepcopy__(self, memo): return dup -@provides(IInputSpec) -class BaseInterfaceInputSpec(BaseInputSpec): - """ BaseInputSpec with an input added to ignore exceptions """ - ignore_exception = traits.Bool(False, usedefault=True, nohash=True, - desc='Print an error message instead of throwing an exception' - ' in case the interface fails to run') - - @provides(IInputSpec, IInputCommandLineSpec) -class CommandLineInputSpec(BaseInterfaceInputSpec): +class CommandLineInputSpec(BaseInputSpec): """ The InputSpec for interfaces wrapping a command line """ args = traits.Str(argstr='%s', desc='Additional parameters to the command') diff --git a/nipype/interfaces/tests/test_base.py b/nipype/interfaces/base/tests/test_base.py similarity index 100% rename from nipype/interfaces/tests/test_base.py rename to nipype/interfaces/base/tests/test_base.py diff --git a/nipype/interfaces/cmtk/cmtk.py b/nipype/interfaces/cmtk/cmtk.py index ff293f3912..064e771dd4 100644 --- a/nipype/interfaces/cmtk/cmtk.py +++ b/nipype/interfaces/cmtk/cmtk.py @@ -21,7 +21,7 @@ import networkx as nx import scipy.io as sio -from ..base import (BaseInterface, BaseInterfaceInputSpec, traits, +from ..base import (BaseInterface, BaseInputSpec, traits, File, TraitedSpec, InputMultiPath, Directory, OutputMultiPath, isdefined) from ...utils.filemanip import split_filename @@ -577,7 +577,7 @@ def _gen_outfilename(self, ext): return name + ext -class ROIGenInputSpec(BaseInterfaceInputSpec): +class ROIGenInputSpec(BaseInputSpec): aparc_aseg_file = File(exists=True, mandatory=True, desc='Freesurfer aparc+aseg file') LUT_file = File(exists=True, xor=['use_freesurfer_LUT'], desc='Custom lookup table (cf. FreeSurferColorLUT.txt)') use_freesurfer_LUT = traits.Bool(xor=['LUT_file'], desc='Boolean value; Set to True to use default Freesurfer LUT, False for custom LUT') @@ -753,7 +753,7 @@ def create_nodes(roi_file, resolution_network_file, out_filename): return out_filename -class CreateNodesInputSpec(BaseInterfaceInputSpec): +class CreateNodesInputSpec(BaseInputSpec): roi_file = File(exists=True, mandatory=True, desc='Region of interest file') resolution_network_file = File(exists=True, mandatory=True, desc='Parcellation file from Connectome Mapping Toolkit') out_filename = File('nodenetwork.pck', usedefault=True, desc='Output gpickled network with the nodes defined.') diff --git a/nipype/interfaces/cmtk/convert.py b/nipype/interfaces/cmtk/convert.py index efbc48063a..548894b116 100644 --- a/nipype/interfaces/cmtk/convert.py +++ b/nipype/interfaces/cmtk/convert.py @@ -14,7 +14,7 @@ import warnings import networkx as nx -from nipype.interfaces.base import (BaseInterface, BaseInterfaceInputSpec, traits, +from nipype.interfaces.base import (BaseInterface, BaseInputSpec, traits, File, TraitedSpec, InputMultiPath, isdefined) from nipype.utils.filemanip import split_filename from nipype.utils.misc import package_check @@ -28,7 +28,7 @@ import cfflib as cf -class CFFConverterInputSpec(BaseInterfaceInputSpec): +class CFFConverterInputSpec(BaseInputSpec): graphml_networks = InputMultiPath(File(exists=True), desc='list of graphML networks') gpickled_networks = InputMultiPath(File(exists=True), desc='list of gpickled Networkx graphs') @@ -204,7 +204,7 @@ def _post_run(self): self.outputs.connectome_file = op.abspath(name + ext) -class MergeCNetworksInputSpec(BaseInterfaceInputSpec): +class MergeCNetworksInputSpec(BaseInputSpec): in_files = InputMultiPath(File(exists=True), mandatory=True, desc='List of CFF files to extract networks from') out_file = File('merged_network_connectome.cff', usedefault=True, desc='Output CFF file with all the networks added') diff --git a/nipype/interfaces/cmtk/nbs.py b/nipype/interfaces/cmtk/nbs.py index 03e3b01893..e7b0d27b63 100644 --- a/nipype/interfaces/cmtk/nbs.py +++ b/nipype/interfaces/cmtk/nbs.py @@ -7,7 +7,7 @@ import numpy as np import networkx as nx -from ..base import (BaseInterface, BaseInterfaceInputSpec, traits, +from ..base import (BaseInterface, BaseInputSpec, traits, File, TraitedSpec, InputMultiPath, OutputMultiPath, isdefined) from ...utils.misc import package_check @@ -36,7 +36,7 @@ def ntwks_to_matrices(in_files, edge_key): return matrix -class NetworkBasedStatisticInputSpec(BaseInterfaceInputSpec): +class NetworkBasedStatisticInputSpec(BaseInputSpec): in_group1 = InputMultiPath(File(exists=True), mandatory=True, desc='Networks for the first group of subjects') in_group2 = InputMultiPath(File(exists=True), mandatory=True, desc='Networks for the second group of subjects') node_position_network = File(desc='An optional network used to position the nodes for the output networks') diff --git a/nipype/interfaces/cmtk/nx.py b/nipype/interfaces/cmtk/nx.py index 6138204a70..ecea701cce 100644 --- a/nipype/interfaces/cmtk/nx.py +++ b/nipype/interfaces/cmtk/nx.py @@ -19,7 +19,7 @@ import networkx as nx import scipy.io as sio -from ..base import (BaseInterface, BaseInterfaceInputSpec, traits, File, +from ..base import (BaseInterface, BaseInputSpec, traits, File, TraitedSpec, InputMultiPath, OutputMultiPath, isdefined) from ...utils.filemanip import split_filename from ...utils.misc import package_check @@ -343,7 +343,7 @@ def add_edge_data(edge_array, ntwk, above=0, below=0): return edge_ntwk -class NetworkXMetricsInputSpec(BaseInterfaceInputSpec): +class NetworkXMetricsInputSpec(BaseInputSpec): in_file = File(exists=True, mandatory=True, desc='Input network') out_k_core = File('k_core', usedefault=True, desc='Computed k-core network stored as a NetworkX pickle.') out_k_shell = File('k_shell', usedefault=True, desc='Computed k-shell network stored as a NetworkX pickle.') @@ -502,7 +502,7 @@ def _gen_outfilename(self, name, ext): return name + '.' + ext -class AverageNetworksInputSpec(BaseInterfaceInputSpec): +class AverageNetworksInputSpec(BaseInputSpec): in_files = InputMultiPath(File(exists=True), mandatory=True, desc='Networks for a group of subjects') resolution_network_file = File(exists=True, desc='Parcellation files from Connectome Mapping Toolkit. This is not necessary' ', but if included, the interface will output the statistical maps as networkx graphs.') diff --git a/nipype/interfaces/cmtk/parcellation.py b/nipype/interfaces/cmtk/parcellation.py index 8a664053e9..a0ddde7866 100644 --- a/nipype/interfaces/cmtk/parcellation.py +++ b/nipype/interfaces/cmtk/parcellation.py @@ -20,7 +20,7 @@ import nibabel as nb import networkx as nx -from ..base import (BaseInterface, BaseInterfaceInputSpec, traits, +from ..base import (BaseInterface, BaseInputSpec, traits, File, TraitedSpec, Directory, isdefined) from ...utils.misc import package_check from ... import logging @@ -513,7 +513,7 @@ def extract(Z, shape, position, fill): return R -class ParcellateInputSpec(BaseInterfaceInputSpec): +class ParcellateInputSpec(BaseInputSpec): subject_id = traits.String(mandatory=True, desc='Subject ID') parcellation_name = traits.Enum('scale500', ['scale33', 'scale60', 'scale125', 'scale250', 'scale500'], usedefault=True) freesurfer_dir = Directory(exists=True, desc='Freesurfer main directory') diff --git a/nipype/interfaces/dipy/base.py b/nipype/interfaces/dipy/base.py index d760172710..4051b3cf7d 100644 --- a/nipype/interfaces/dipy/base.py +++ b/nipype/interfaces/dipy/base.py @@ -3,7 +3,7 @@ import os.path as op import numpy as np from nipype.interfaces.base import (traits, File, isdefined, - BaseInterface, BaseInterfaceInputSpec) + BaseInterface, BaseInputSpec) from ... import logging IFLOGGER = logging.getLogger('interface') @@ -41,7 +41,7 @@ def __init__(self, **inputs): super(DipyBaseInterface, self).__init__(**inputs) -class DipyBaseInterfaceInputSpec(BaseInterfaceInputSpec): +class DipyBaseInputSpec(BaseInputSpec): in_file = File(exists=True, mandatory=True, desc=('input diffusion data')) in_bval = File(exists=True, mandatory=True, desc=('input b-values table')) in_bvec = File(exists=True, mandatory=True, desc=('input b-vectors table')) @@ -54,7 +54,7 @@ class DipyDiffusionInterface(DipyBaseInterface): """ A base interface for py:mod:`dipy` computations """ - input_spec = DipyBaseInterfaceInputSpec + input_spec = DipyBaseInputSpec def _get_gradient_table(self): bval = np.loadtxt(self.inputs.in_bval) diff --git a/nipype/interfaces/dipy/reconstruction.py b/nipype/interfaces/dipy/reconstruction.py index 75c0e56de4..4525d3af24 100644 --- a/nipype/interfaces/dipy/reconstruction.py +++ b/nipype/interfaces/dipy/reconstruction.py @@ -9,13 +9,13 @@ import nibabel as nb from nipype.interfaces.base import TraitedSpec, File, traits, isdefined -from .base import DipyDiffusionInterface, DipyBaseInterfaceInputSpec +from .base import DipyDiffusionInterface, DipyBaseInputSpec from nipype import logging IFLOGGER = logging.getLogger('interface') -class RESTOREInputSpec(DipyBaseInterfaceInputSpec): +class RESTOREInputSpec(DipyBaseInputSpec): in_mask = File(exists=True, desc=('input mask in which compute tensors')) noise_mask = File( exists=True, desc=('input mask in which compute noise variance')) @@ -149,7 +149,7 @@ def _post_run(self): outputs[k] = self._gen_filename(k) -class EstimateResponseSHInputSpec(DipyBaseInterfaceInputSpec): +class EstimateResponseSHInputSpec(DipyBaseInputSpec): in_evals = File( exists=True, mandatory=True, desc=('input eigenvalues file')) in_mask = File( @@ -269,7 +269,7 @@ def _post_run(self): outputs['out_mask'] = op.abspath(self.inputs.out_mask) -class CSDInputSpec(DipyBaseInterfaceInputSpec): +class CSDInputSpec(DipyBaseInputSpec): in_mask = File(exists=True, desc=('input mask in which compute tensors')) response = File(exists=True, desc=('single fiber estimated response')) sh_order = traits.Int(8, exists=True, usedefault=True, diff --git a/nipype/interfaces/dipy/simulate.py b/nipype/interfaces/dipy/simulate.py index 0e26b1d999..17f14b680b 100644 --- a/nipype/interfaces/dipy/simulate.py +++ b/nipype/interfaces/dipy/simulate.py @@ -14,14 +14,14 @@ import nibabel as nb -from ..base import (traits, TraitedSpec, BaseInterfaceInputSpec, +from ..base import (traits, TraitedSpec, BaseInputSpec, File, InputMultiPath, isdefined) from .base import DipyBaseInterface from ... import logging IFLOGGER = logging.getLogger('interface') -class SimulateMultiTensorInputSpec(BaseInterfaceInputSpec): +class SimulateMultiTensorInputSpec(BaseInputSpec): in_dirs = InputMultiPath(File(exists=True), mandatory=True, desc='list of fibers (principal directions)') in_frac = InputMultiPath(File(exists=True), mandatory=True, diff --git a/nipype/interfaces/dipy/tensors.py b/nipype/interfaces/dipy/tensors.py index 455124e5fa..17ce947578 100644 --- a/nipype/interfaces/dipy/tensors.py +++ b/nipype/interfaces/dipy/tensors.py @@ -8,13 +8,13 @@ import nibabel as nb from ..base import TraitedSpec, File, isdefined -from .base import DipyDiffusionInterface, DipyBaseInterfaceInputSpec +from .base import DipyDiffusionInterface, DipyBaseInputSpec from ... import logging IFLOGGER = logging.getLogger('interface') -class DTIInputSpec(DipyBaseInterfaceInputSpec): +class DTIInputSpec(DipyBaseInputSpec): mask_file = File(exists=True, desc='An optional white matter mask') @@ -66,7 +66,7 @@ def _post_run(self): self.outputs.out_file = self._gen_filename('dti') -class TensorModeInputSpec(DipyBaseInterfaceInputSpec): +class TensorModeInputSpec(DipyBaseInputSpec): mask_file = File(exists=True, desc='An optional white matter mask') diff --git a/nipype/interfaces/dipy/tracks.py b/nipype/interfaces/dipy/tracks.py index 45e5524be0..58f4cda1f5 100644 --- a/nipype/interfaces/dipy/tracks.py +++ b/nipype/interfaces/dipy/tracks.py @@ -11,14 +11,14 @@ import nibabel as nb import nibabel.trackvis as nbt -from ..base import (TraitedSpec, BaseInterfaceInputSpec, +from ..base import (TraitedSpec, BaseInputSpec, File, isdefined, traits) from .base import DipyBaseInterface from ... import logging IFLOGGER = logging.getLogger('interface') -class TrackDensityMapInputSpec(BaseInterfaceInputSpec): +class TrackDensityMapInputSpec(BaseInputSpec): in_file = File(exists=True, mandatory=True, desc='The input TrackVis track file') reference = File(exists=True, @@ -101,7 +101,7 @@ def _post_run(self): self.outputs.out_file = op.abspath(self.inputs.out_filename) -class StreamlineTractographyInputSpec(BaseInterfaceInputSpec): +class StreamlineTractographyInputSpec(BaseInputSpec): in_file = File(exists=True, mandatory=True, desc=('input diffusion data')) in_model = File(exists=True, desc=('input f/d-ODF model extracted from.')) tracking_mask = File(exists=True, diff --git a/nipype/interfaces/elastix/utils.py b/nipype/interfaces/elastix/utils.py index 3573559aad..fb5fb28779 100644 --- a/nipype/interfaces/elastix/utils.py +++ b/nipype/interfaces/elastix/utils.py @@ -10,13 +10,13 @@ import os.path as op import re -from ..base import (BaseInterface, BaseInterfaceInputSpec, isdefined, +from ..base import (BaseInterface, BaseInputSpec, isdefined, TraitedSpec, File, traits, InputMultiPath) from ... import logging logger = logging.getLogger('interface') -class EditTransformInputSpec(BaseInterfaceInputSpec): +class EditTransformInputSpec(BaseInputSpec): transform_file = File(exists=True, mandatory=True, desc='transform-parameter file, only 1') reference_image = File(exists=True, diff --git a/nipype/interfaces/fsl/model.py b/nipype/interfaces/fsl/model.py index 5074182a46..3ff17b9591 100644 --- a/nipype/interfaces/fsl/model.py +++ b/nipype/interfaces/fsl/model.py @@ -28,7 +28,7 @@ from ..base import (load_template, File, GenFile, traits, isdefined, TraitedSpec, BaseInterface, Directory, InputMultiPath, OutputMultiPath, - BaseInterfaceInputSpec) + BaseInputSpec) from ...utils.filemanip import (list_to_filename, filename_to_list) from ...utils.misc import human_order_sorted @@ -36,7 +36,7 @@ IFLOGGER = logging.getLogger('interface') -class Level1DesignInputSpec(BaseInterfaceInputSpec): +class Level1DesignInputSpec(BaseInputSpec): interscan_interval = traits.Float(mandatory=True, desc='Interscan interval (in secs)') session_info = traits.Any(mandatory=True, @@ -747,7 +747,7 @@ def _post_run(self): self.outputs.zfstats = zfstats -class FEATRegisterInputSpec(BaseInterfaceInputSpec): +class FEATRegisterInputSpec(BaseInputSpec): feat_dirs = InputMultiPath( Directory(exists=True), desc="Lower level feat dirs", mandatory=True) @@ -1096,7 +1096,7 @@ def _post_run(self): self.outputs.zfstats = zfstats -class L2ModelInputSpec(BaseInterfaceInputSpec): +class L2ModelInputSpec(BaseInputSpec): num_copes = traits.Range(low=1, mandatory=True, desc='number of copes to be combined') @@ -1168,7 +1168,7 @@ def _post_run(self): setattr(self.outputs, field, os.path.join(os.getcwd(), field.replace('_', '.'))) -class MultipleRegressDesignInputSpec(BaseInterfaceInputSpec): +class MultipleRegressDesignInputSpec(BaseInputSpec): contrasts = traits.List( traits.Either(traits.Tuple(traits.Str, traits.Enum('T'), diff --git a/nipype/interfaces/io.py b/nipype/interfaces/io.py index 7747580fc4..64da8c9ffc 100644 --- a/nipype/interfaces/io.py +++ b/nipype/interfaces/io.py @@ -36,7 +36,7 @@ import sqlite3 from .base import (traits, Undefined, File, Directory, isdefined, InputMultiPath, OutputMultiPath, TraitedSpec, DynamicTraitedSpec, - BaseInterfaceInputSpec, BaseInterface) + BaseInputSpec, BaseInterface) from .. import config from ..external.six import string_types from ..utils.filemanip import (copyfile, list_to_filename, @@ -175,7 +175,7 @@ def __call__(self, bytes_amount): # DataSink inputs -class DataSinkInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): +class DataSinkInputSpec(DynamicTraitedSpec, BaseInputSpec): """ """ @@ -766,7 +766,7 @@ def _post_run(self): self.outputs.out_file = out_files -class S3DataGrabberInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): +class S3DataGrabberInputSpec(DynamicTraitedSpec, BaseInputSpec): anon = traits.Bool(False, usedefault=True, desc='Use anonymous connection to s3. If this is set to True, boto may print' + ' a urlopen error, but this does not prevent data from being downloaded.') @@ -987,7 +987,7 @@ def s3tolocal(self, s3path, bkt): return localpath -class DataGrabberInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): +class DataGrabberInputSpec(DynamicTraitedSpec, BaseInputSpec): base_directory = Directory(exists=True, desc='Path to the base directory consisting of subject data.') raise_on_empty = traits.Bool(True, usedefault=True, @@ -1187,7 +1187,7 @@ def _post_run(self): setattr(self.outputs, key, getattr(self.outputs, key)[0]) -class SelectFilesInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): +class SelectFilesInputSpec(DynamicTraitedSpec, BaseInputSpec): base_directory = Directory(exists=True, desc="Root path common to templates.") @@ -1329,7 +1329,7 @@ def _post_run(self): setattr(self.outputs, field, filelist) -class DataFinderInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): +class DataFinderInputSpec(DynamicTraitedSpec, BaseInputSpec): root_paths = traits.Either(traits.List(), traits.Str(), mandatory=True,) @@ -1472,7 +1472,7 @@ def _run_interface(self, runtime): return runtime -class FSSourceInputSpec(BaseInterfaceInputSpec): +class FSSourceInputSpec(BaseInputSpec): subjects_dir = Directory(mandatory=True, desc='Freesurfer subjects directory.') subject_id = traits.Str(mandatory=True, @@ -1615,7 +1615,7 @@ def _post_run(self): setattr(self.outputs, k, list_to_filename(val)) -class XNATSourceInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): +class XNATSourceInputSpec(DynamicTraitedSpec, BaseInputSpec): query_template = traits.Str( mandatory=True, @@ -1828,7 +1828,7 @@ def _post_run(self): setattr(self.outputs, key, getattr(self.outputs, key)[0]) -class XNATSinkInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): +class XNATSinkInputSpec(DynamicTraitedSpec, BaseInputSpec): _outputs = traits.Dict(traits.Str, value={}, usedefault=True) @@ -2055,7 +2055,7 @@ def push_provenance(): pass -class SQLiteSinkInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): +class SQLiteSinkInputSpec(DynamicTraitedSpec, BaseInputSpec): database_file = File(exists=True, mandatory=True) table_name = traits.Str(mandatory=True) @@ -2103,7 +2103,7 @@ def _post_run(self): return None -class MySQLSinkInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): +class MySQLSinkInputSpec(DynamicTraitedSpec, BaseInputSpec): host = traits.Str('localhost', mandatory=True, requires=['username', 'password'], xor=['config'], usedefault=True) @@ -2422,7 +2422,7 @@ def _get_ssh_client(self): return client -class JSONFileGrabberInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): +class JSONFileGrabberInputSpec(DynamicTraitedSpec, BaseInputSpec): in_file = File(exists=True, desc='JSON source file') defaults = traits.Dict(desc=('JSON dictionary that sets default output' 'values, overridden by values found in in_file')) @@ -2476,7 +2476,7 @@ def _post_run(self): setattr(self.outputs, key, value) -class JSONFileSinkInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): +class JSONFileSinkInputSpec(DynamicTraitedSpec, BaseInputSpec): out_file = File(desc='JSON sink file') in_dict = traits.Dict(value={}, usedefault=True, desc='input JSON dictionary') diff --git a/nipype/interfaces/mrtrix/convert.py b/nipype/interfaces/mrtrix/convert.py index ce7aecf8e2..0963b206a3 100644 --- a/nipype/interfaces/mrtrix/convert.py +++ b/nipype/interfaces/mrtrix/convert.py @@ -19,7 +19,7 @@ from nibabel.trackvis import HeaderError from nibabel.volumeutils import native_code -from ..base import (TraitedSpec, BaseInterface, BaseInterfaceInputSpec, +from ..base import (TraitedSpec, BaseInterface, BaseInputSpec, File, isdefined, traits) from ...utils.filemanip import split_filename from ...utils.misc import package_check diff --git a/nipype/interfaces/mrtrix/tensors.py b/nipype/interfaces/mrtrix/tensors.py index 98b7a556a6..7b262cf1be 100644 --- a/nipype/interfaces/mrtrix/tensors.py +++ b/nipype/interfaces/mrtrix/tensors.py @@ -13,7 +13,7 @@ import numpy as np from ..base import (CommandLineInputSpec, CommandLine, BaseInterface, - BaseInterfaceInputSpec, traits, File, TraitedSpec, + BaseInputSpec, traits, File, TraitedSpec, Directory, InputMultiPath, OutputMultiPath, isdefined) from ...utils.filemanip import split_filename from ... import logging diff --git a/nipype/interfaces/nipy/model.py b/nipype/interfaces/nipy/model.py index 168bd3f9a5..dd6c7a8f7c 100644 --- a/nipype/interfaces/nipy/model.py +++ b/nipype/interfaces/nipy/model.py @@ -24,10 +24,10 @@ from nipy.modalities.fmri.experimental_paradigm import BlockParadigm from ..base import (BaseInterface, TraitedSpec, traits, File, OutputMultiPath, - BaseInterfaceInputSpec, isdefined) + BaseInputSpec, isdefined) -class FitGLMInputSpec(BaseInterfaceInputSpec): +class FitGLMInputSpec(BaseInputSpec): session_info = traits.List(minlen=1, maxlen=1, mandatory=True, desc=('Session specific information generated by' ' ``modelgen.SpecifyModel``, FitGLM does ' @@ -206,7 +206,7 @@ def _post_run(self): self.outputs.residuals = self._residuals_file -class EstimateContrastInputSpec(BaseInterfaceInputSpec): +class EstimateContrastInputSpec(BaseInputSpec): contrasts = traits.List( traits.Either(traits.Tuple(traits.Str, traits.Enum('T'), diff --git a/nipype/interfaces/nipy/preprocess.py b/nipype/interfaces/nipy/preprocess.py index 106931e2b2..1cf0f676d9 100644 --- a/nipype/interfaces/nipy/preprocess.py +++ b/nipype/interfaces/nipy/preprocess.py @@ -27,11 +27,11 @@ nipy_version = nipy.__version__ from ..base import (TraitedSpec, BaseInterface, traits, - BaseInterfaceInputSpec, isdefined, File, + BaseInputSpec, isdefined, File, InputMultiPath, OutputMultiPath) -class ComputeMaskInputSpec(BaseInterfaceInputSpec): +class ComputeMaskInputSpec(BaseInputSpec): mean_volume = File(exists=True, mandatory=True, desc="mean EPI image, used to compute the threshold for the mask") reference_volume = File(exists=True, @@ -54,7 +54,7 @@ def _run_interface(self, runtime): from nipy.labs.mask import compute_mask args = {} for key in [k for k, _ in list(self.inputs.items()) - if k not in BaseInterfaceInputSpec().trait_names()]: + if k not in BaseInputSpec().trait_names()]: value = getattr(self.inputs, key) if isdefined(value): if key in ['mean_volume', 'reference_volume']: @@ -74,7 +74,7 @@ def _post_run(self): self.outputs.brain_mask = self._brain_mask_path -class FmriRealign4dInputSpec(BaseInterfaceInputSpec): +class FmriRealign4dInputSpec(BaseInputSpec): in_file = InputMultiPath(File(exists=True), mandatory=True, @@ -193,7 +193,7 @@ def _post_run(self): self.outputs.par_file = self._par_file_path -class SpaceTimeRealignerInputSpec(BaseInterfaceInputSpec): +class SpaceTimeRealignerInputSpec(BaseInputSpec): in_file = InputMultiPath(File(exists=True), mandatory=True, min_ver='0.4.0.dev', @@ -322,7 +322,7 @@ def _post_run(self): self.outputs.par_file = self._par_file_path -class TrimInputSpec(BaseInterfaceInputSpec): +class TrimInputSpec(BaseInputSpec): in_file = File( exists=True, mandatory=True, desc="EPI image to trim") diff --git a/nipype/interfaces/nipy/utils.py b/nipype/interfaces/nipy/utils.py index 84e8ae9715..1b9cec9123 100644 --- a/nipype/interfaces/nipy/utils.py +++ b/nipype/interfaces/nipy/utils.py @@ -22,10 +22,10 @@ from nipy.algorithms.registration.affine import Affine from ..base import (TraitedSpec, BaseInterface, traits, - BaseInterfaceInputSpec, File, isdefined) + BaseInputSpec, File, isdefined) -class SimilarityInputSpec(BaseInterfaceInputSpec): +class SimilarityInputSpec(BaseInputSpec): volume1 = File(exists=True, desc="3D volume", mandatory=True) volume2 = File(exists=True, desc="3D volume", mandatory=True) mask1 = File(exists=True, desc="3D volume") diff --git a/nipype/interfaces/nitime/analysis.py b/nipype/interfaces/nitime/analysis.py index 8d206411d7..5308008e25 100644 --- a/nipype/interfaces/nitime/analysis.py +++ b/nipype/interfaces/nitime/analysis.py @@ -19,7 +19,7 @@ from ...utils.misc import package_check from ..base import (TraitedSpec, File, Undefined, traits, - BaseInterface, isdefined, BaseInterfaceInputSpec) + BaseInterface, isdefined, BaseInputSpec) from ...utils.filemanip import fname_presuffix @@ -34,7 +34,7 @@ import nitime.viz as viz -class CoherenceAnalyzerInputSpec(BaseInterfaceInputSpec): +class CoherenceAnalyzerInputSpec(BaseInputSpec): # Input either csv file, or time-series object and use _xor_inputs to # discriminate diff --git a/nipype/interfaces/spm/base.py b/nipype/interfaces/spm/base.py index 8581d1da12..8d776da9ac 100644 --- a/nipype/interfaces/spm/base.py +++ b/nipype/interfaces/spm/base.py @@ -31,7 +31,7 @@ # Local imports from ..base import (BaseInterface, traits, isdefined, InputMultiPath, - BaseInterfaceInputSpec, Directory, Undefined) + BaseInputSpec, Directory, Undefined) from ..matlab import MatlabCommand from ...utils import spm_docs as sd from ...external.six import string_types @@ -209,7 +209,7 @@ def no_spm(): return False -class SPMCommandInputSpec(BaseInterfaceInputSpec): +class SPMCommandInputSpec(BaseInputSpec): matlab_cmd = traits.Str(desc='matlab command to use') paths = InputMultiPath(Directory(), desc='Paths to add to matlabpath') mfile = traits.Bool(True, desc='Run m-code using m-file', diff --git a/nipype/interfaces/spm/utils.py b/nipype/interfaces/spm/utils.py index 7077876897..dcf6dce7b2 100644 --- a/nipype/interfaces/spm/utils.py +++ b/nipype/interfaces/spm/utils.py @@ -6,7 +6,7 @@ from .base import SPMCommandInputSpec, SPMCommand, Info, scans_for_fnames, scans_for_fname from ..matlab import MatlabCommand from ..base import (TraitedSpec, BaseInterface, - BaseInterfaceInputSpec, isdefined, + BaseInputSpec, isdefined, OutputMultiPath, InputMultiPath) from ..base import File, traits from ...utils.filemanip import split_filename, fname_presuffix, filename_to_list, list_to_filename diff --git a/nipype/interfaces/utility.py b/nipype/interfaces/utility.py index 5cd117fccf..ef0d0eac95 100644 --- a/nipype/interfaces/utility.py +++ b/nipype/interfaces/utility.py @@ -23,7 +23,7 @@ from .base import (traits, Undefined, File, isdefined, InputMultiPath, OutputMultiPath, TraitedSpec, DynamicTraitedSpec, - BaseInterfaceInputSpec, BaseInterface) + BaseInputSpec, BaseInterface) from .io import IOBase, add_traits from ..external.six import string_types from ..testing import assert_equal @@ -100,7 +100,7 @@ def _post_run(self): setattr(self.outputs, key, val) -class MergeInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): +class MergeInputSpec(DynamicTraitedSpec, BaseInputSpec): axis = traits.Enum('vstack', 'hstack', usedefault=True, desc='direction in which to merge, hstack requires same number of elements in each input') no_flatten = traits.Bool(False, usedefault=True, desc='append to outlist instead of extending in vstack mode') @@ -257,7 +257,7 @@ def _post_run(self): self.outputs.out_file = os.path.join(os.getcwd(), self._rename()) -class SplitInputSpec(BaseInterfaceInputSpec): +class SplitInputSpec(BaseInputSpec): inlist = traits.List(traits.Any, mandatory=True, desc='list of values to split') splits = traits.List(traits.Int, mandatory=True, @@ -307,7 +307,7 @@ def _post_run(self): setattr(self.outputs, 'out%d' % (i + 1), val) -class SelectInputSpec(BaseInterfaceInputSpec): +class SelectInputSpec(BaseInputSpec): inlist = InputMultiPath(traits.Any, mandatory=True, desc='list of values to choose from') index = InputMultiPath(traits.Int, mandatory=True, @@ -344,7 +344,7 @@ class Select(IOBase): def _post_run(self): self.outputs.out = np.array(self.inputs.inlist)[np.array(self.inputs.index)].tolist() -class FunctionInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): +class FunctionInputSpec(DynamicTraitedSpec, BaseInputSpec): function_str = traits.Str(mandatory=True, desc='code for function') @@ -456,7 +456,7 @@ def _post_run(self): setattr(self.outputs, key, self._out[key]) -class AssertEqualInputSpec(BaseInterfaceInputSpec): +class AssertEqualInputSpec(BaseInputSpec): volume1 = File(exists=True, mandatory=True) volume2 = File(exists=True, mandatory=True) diff --git a/nipype/pipeline/engine/tests/test_engine.py b/nipype/pipeline/engine/tests/test_engine.py index c7e6392374..846ab23112 100644 --- a/nipype/pipeline/engine/tests/test_engine.py +++ b/nipype/pipeline/engine/tests/test_engine.py @@ -17,7 +17,7 @@ from ....interfaces import base as nib -class InputSpec(nib.BaseInterfaceInputSpec): +class InputSpec(nib.BaseInputSpec): input1 = nib.traits.Int(desc='a random int') input2 = nib.traits.Int(desc='a random int') From 75b5bf4a10ff1b0222d7a936121557556329c4c8 Mon Sep 17 00:00:00 2001 From: oesteban Date: Sun, 21 Feb 2016 17:09:54 -0800 Subject: [PATCH 60/73] test_base.py passing --- nipype/interfaces/base/interfaces.py | 85 +-- nipype/interfaces/base/specs.py | 348 +++++++------ nipype/interfaces/base/tests/test_base.py | 493 +++++++++--------- nipype/interfaces/base/traits_extension.py | 32 +- .../tests => testing/data}/realign_json.json | 0 nipype/utils/config.py | 4 +- 6 files changed, 506 insertions(+), 456 deletions(-) rename nipype/{interfaces/tests => testing/data}/realign_json.json (100%) diff --git a/nipype/interfaces/base/interfaces.py b/nipype/interfaces/base/interfaces.py index c7b59b0da3..23ff5c9e92 100644 --- a/nipype/interfaces/base/interfaces.py +++ b/nipype/interfaces/base/interfaces.py @@ -38,7 +38,7 @@ # in production environments. from .traits_extension import isdefined, Command from .specs import (IInputSpec, IOutputSpec, IInputCommandLineSpec, - BaseInputSpec, CommandLineInputSpec, + BaseInputSpec, BaseOutputSpec, CommandLineInputSpec, StdOutCommandLineInputSpec, StdOutCommandLineOutputSpec, MpiCommandLineInputSpec, SEMLikeCommandLineInputSpec) @@ -56,14 +56,6 @@ class IBase(Interface): and methods all Interface objects should have. """ - - @classmethod - def help(cls, returnhelp=False): - """Prints class help""" - - def version(self): - """Provides the underlying interface version""" - def pre_run(self, **inputs): """Hook executed before running""" @@ -85,7 +77,7 @@ def post_run(self): """Hook executed after running""" def _aggregate_outputs(self): - """Fill in ouputs after running interface""" + """Fill in the ouputs after running the interface""" class ICommandBase(Interface): """Abstract class for interfaces wrapping a command line""" @@ -103,7 +95,7 @@ class BaseInterface(HasTraits): inputs = Instance(IInputSpec) outputs = Instance(IOutputSpec) _input_spec = BaseInputSpec - # _output_spec = + _output_spec = BaseOutputSpec status = traits.Enum('waiting', 'starting', 'running', 'ending', 'errored', 'finished') version = traits.Str @@ -115,6 +107,7 @@ class BaseInterface(HasTraits): def __init__(self, **inputs): self.inputs = self._input_spec() self.inputs.set(**inputs) + self.outputs = self._output_spec() def _run_wrapper(self, runtime): sysdisplay = os.getenv('DISPLAY') @@ -144,23 +137,37 @@ def _run_wrapper(self, runtime): vdisp.stop() _unlock_display(vdisp_num) + self._aggregate_outputs() + return runtime + + + def _dry_run(self, runtime, *kwargs): + """ + A fake runner which creates empty files when they do not exist, + but required by the output + + """ + self._aggregate_outputs() + + for name, spec in list(self.outputs.items()): + if spec.exists: + value = getattr(self.outputs, name) + if not op.isfile(value): + with open(value, 'a'): + os.utime(value) return runtime def _run_interface(self, runtime, *kwargs): """ Core function that executes interface """ - raise NotImplementedError + raise NotImplementedError('BaseInterface running is disabled.') def pre_run(self, **inputs): """ Implementation of the pre-execution hook""" + inputs.pop('dry_run', None) # Remove the dry_run key self.inputs.set(**inputs) self.inputs.check_inputs() - if not self.version: - if str2bool(config.get('execution', 'stop_on_unknown_version')): - raise ValueError('Interface %s has no version information' % - self.__class__.__name__) - else: - self.inputs.check_version(LooseVersion(str(self.version))) + self.check_version() def post_run(self): """ Implementation of the post-execution hook""" @@ -222,7 +229,6 @@ def run(self, dry_run=False, **inputs): if exception is None: self.status = 'ending' - self._aggregate_outputs() self.post_run() results.outputs = self.outputs @@ -259,11 +265,20 @@ def help(cls, returnhelp=False): if cls.__doc__: docstring = trim(cls.__doc__).split('\n') + docstring - allhelp = '\n'.join(docstring + cls._input_spec.help() + cls._output_spec.help()) + allhelp = '\n'.join(docstring + cls._input_spec().help()) if returnhelp: return allhelp print(allhelp) + def check_version(self): + if not self.version: + if str2bool(config.get('execution', 'stop_on_unknown_version')): + raise ValueError('Interface %s has no version information' % + self.__class__.__name__) + return [] + + return self.inputs.check_version(LooseVersion(str(self.version))) + @provides(IBase, ICommandBase) class CommandLine(BaseInterface): @@ -290,10 +305,7 @@ class must be instantiated with a command argument 'ls -al' >>> pprint.pprint(cli.inputs.trait_get()) # doctest: +NORMALIZE_WHITESPACE - {'args': '-al', - 'environ': {'DISPLAY': ':1'}, - 'ignore_exception': False, - 'terminal_output': 'stream'} + {'args': '-al'} >>> cli.inputs.get_hashval() ([('args', '-al')], '11c37f97649cd61627f4afe5136af8c0') @@ -331,29 +343,38 @@ def __init__(self, command=None, environ=None, **inputs): # First modify environment variables if passed if environ is not None: - for k, v in list(environ.items()): - self.environ[k] = v + for k, value in list(environ.items()): + self.environ[k] = value + args = [] # Set command to force validation if command is not None: - self.command = command + cmdchunks = command.split() + self.command = cmdchunks[0] + if len(cmdchunks) > 1: + args += cmdchunks[1:] elif self._cmd is not None: self.command = self._cmd else: raise RuntimeError('CommandLine interfaces require' ' the definition of a command') - super(CommandLine, self).__init__(**inputs) + newargs = inputs.pop('args', []) + if newargs: + if not isinstance(newargs, list): + newargs = [newargs] + args += newargs + if args: + self.inputs.args = ' '.join(args) + @property def cmdline(self): """ `command` plus any arguments (args) validates arguments and generates command line""" self.inputs.check_inputs() - allargs = self.inputs.parse_args() - allargs.insert(0, self._cmd) - return ' '.join(allargs) + return ' '.join([self.command] + self.inputs.parse_args()) def _run_wrapper(self, runtime): runtime = self._run_interface(runtime) @@ -402,7 +423,7 @@ def version_from_command(self, flag='-v'): @classmethod def help(cls, returnhelp=False): allhelp = super(CommandLine, cls).help(returnhelp=True) - allhelp = "Wraps command ``%s``\n\n" % cls.command + allhelp + allhelp = "Wraps command ``%s``\n\n" % cls._cmd + allhelp if returnhelp: return allhelp diff --git a/nipype/interfaces/base/specs.py b/nipype/interfaces/base/specs.py index 1869a4d6b0..6e51a156b3 100644 --- a/nipype/interfaces/base/specs.py +++ b/nipype/interfaces/base/specs.py @@ -18,9 +18,8 @@ from builtins import object from traits.api import Interface, provides -from ...utils.filemanip import md5, auto_hash, split_filename +from ...utils.filemanip import md5, auto_hash from ...utils.misc import is_container -from ...utils.errors import InterfaceInputsError from ... import logging, LooseVersion from ... import __version__ from ...external.six import string_types @@ -47,8 +46,11 @@ def check_version(self): matches that of the installed software """ - def get_outputs(self): - """Infers the outputs and returns a dictionary of results""" + def get(self, **kwargs): + """ Returns traited class as a dict""" + + def get_traitsfree(self, **kwargs): + """ Returns traited class as a dict without traits""" @classmethod def help(cls): @@ -60,18 +62,178 @@ class IOutputSpec(Interface): def items(self): """Name, trait generator for user modifiable traits""" + def get(self, **kwargs): + """ Returns traited class as a dict""" + + def get_traitsfree(self, **kwargs): + """ Returns traited class as a dict without traits""" + @classmethod def help(cls): """Print help of these traits""" class IInputCommandLineSpec(Interface): + """An interface definition for command line interfaces""" def parse_args(self): """Parse inputs to commandline arguments""" +@provides(IOutputSpec) +class BaseSpec(traits.HasTraits): + """A common interface for inputs and outputs""" + + def __repr__(self): + """ Return a well-formatted representation of the traits """ + outstr = [] + for name, value in sorted(self.trait_get().items()): + outstr.append('%s = %s' % (name, value)) + return '\n' + '\n'.join(outstr) + '\n' + + def items(self): + """ Name, trait generator for user modifiable traits + """ + for name in sorted(self.copyable_trait_names()): + yield name, self.traits()[name] + + @classmethod + def help(cls): + """Print help of these traits""" + helpstr = [] + for name, spec in sorted(cls().traits(transient=None).items()): + helpstr += cls._get_trait_desc(name, spec) + if len(helpstr) == 0: + helpstr += ['\tNone'] + return helpstr + + def get(self, **kwargs): + """ Returns traited class as a dict + + Augments the trait get function to return a dictionary without + notification handles + """ + out = super(BaseSpec, self).get(**kwargs) + out = self._clean_container(out, Undefined) + return out + + def get_traitsfree(self, **kwargs): + """ Returns traited class as a dict + + Augments the trait get function to return a dictionary without + any traits. The dictionary does not contain any attributes that + were Undefined + """ + out = super(BaseSpec, self).get(**kwargs) + out = self._clean_container(out, skipundefined=True) + return out + + def _clean_container(self, obj, undefinedval=None, skipundefined=False): + """Convert a traited obejct into a pure python representation. + """ + if isinstance(obj, TraitDictObject) or isinstance(obj, dict): + outdict = {} + for key, val in list(obj.items()): + if isdefined(val): + outdict[key] = self._clean_container(val, undefinedval) + else: + if not skipundefined: + outdict[key] = undefinedval + return outdict + elif (isinstance(obj, TraitListObject) or + isinstance(obj, list) or isinstance(obj, tuple)): + out = [] + for val in obj: + if isdefined(val): + out.append(self._clean_container(val, undefinedval)) + else: + if not skipundefined: + out.append(undefinedval) + else: + out.append(None) + if isinstance(obj, tuple): + return tuple(out) + else: + if isdefined(obj): + out = obj + else: + if not skipundefined: + out = undefinedval + return out + + @classmethod + def _get_trait_desc(cls, name, spec=None): + obj = cls() + if spec is None: + spec = obj.traits()[name] + + desc = spec.desc + xor = spec.xor + requires = spec.requires + argstr = spec.argstr + name_source = spec.name_source + if name_source is None: + name_source = spec.ns + + manhelpstr = ['\t%s' % name] + + type_info = spec.full_info(obj, name, None) + + default = '' + if spec.usedefault: + default = ', nipype default value: %s' % str(spec.default_value()[1]) + line = "(%s%s)" % (type_info, default) + + manhelpstr = wrap(line, 70, + initial_indent=manhelpstr[0] + ': ', + subsequent_indent='\t\t ') + + if desc: + for line in desc.split('\n'): + line = re.sub(r'\s+', ' ', line) + manhelpstr += wrap(line, 70, initial_indent='\t\t', + subsequent_indent='\t\t') + + if argstr: + pos = spec.position + if pos is not None: + manhelpstr += wrap('flag: %s, position: %s' % (argstr, pos), 70, + initial_indent='\t\t', subsequent_indent='\t\t') + else: + manhelpstr += wrap('flag: %s' % argstr, 70, initial_indent='\t\t', + subsequent_indent='\t\t') + + if xor: + line = '%s' % ', '.join(xor) + manhelpstr += wrap(line, 70, initial_indent='\t\tmutually_exclusive: ', + subsequent_indent='\t\t ') + + if requires: + others = [field for field in requires if field != name] + line = '%s' % ', '.join(others) + manhelpstr += wrap(line, 70, initial_indent='\t\trequires: ', + subsequent_indent='\t\t ') + + if name_source: + tpl = ', name_template not defined' + if spec.name_template: + tpl = ', name_template is \'%s\'' % spec.name_template + manhelpstr += wrap(('name source: %s' % name_source) + tpl, 70, + initial_indent='\t\t', subsequent_indent='\t\t ') + return manhelpstr + + +@provides(IOutputSpec) +class BaseOutputSpec(BaseSpec): + """ Base class for OutputSpecs with strict traits """ + _ = traits.Disallow + + @classmethod + def help(cls): + return ['Outputs ::', ''] + super(BaseOutputSpec, cls).help() + + @provides(IInputSpec) -class BaseTraitedSpec(traits.HasTraits): +class BaseTraitedSpec(BaseSpec): """Provide a few methods necessary to support nipype interface api The inputs attribute of interfaces call certain methods that are not @@ -121,14 +283,9 @@ def __repr__(self): outstr.append('%s = %s' % (name, value)) return '\n' + '\n'.join(outstr) + '\n' - def items(self): - """ Name, trait generator for user modifiable traits - """ - for name in sorted(self.copyable_trait_names()): - yield name, self.traits()[name] - def _check_deprecated(self, name, new): """ Generate a warning when a deprecated trait is set """ + warn = False if isdefined(new): spec = self.traits()[name] msg1 = ('Input %s in interface %s is deprecated.' % @@ -151,10 +308,12 @@ def _check_deprecated(self, name, new): msg += 'Unsetting old value %s; setting new value %s.' % ( name, spec.new_name) IFLOGGER.warn(msg) + warn = True if spec.new_name: self.trait_set(trait_change_notify=False, **{'%s' % name: Undefined, '%s' % spec.new_name: new}) + return warn def _hash_infile(self, adict, key): """ Inject file hashes into adict[key]""" @@ -172,60 +331,6 @@ def _hash_infile(self, adict, key): file_list.append((afile, hashval)) return file_list - def get(self, **kwargs): - """ Returns traited class as a dict - - Augments the trait get function to return a dictionary without - notification handles - """ - out = super(BaseTraitedSpec, self).get(**kwargs) - out = self._clean_container(out, Undefined) - return out - - def get_traitsfree(self, **kwargs): - """ Returns traited class as a dict - - Augments the trait get function to return a dictionary without - any traits. The dictionary does not contain any attributes that - were Undefined - """ - out = super(BaseTraitedSpec, self).get(**kwargs) - out = self._clean_container(out, skipundefined=True) - return out - - def _clean_container(self, obj, undefinedval=None, skipundefined=False): - """Convert a traited obejct into a pure python representation. - """ - if isinstance(obj, TraitDictObject) or isinstance(obj, dict): - outdict = {} - for key, val in list(obj.items()): - if isdefined(val): - outdict[key] = self._clean_container(val, undefinedval) - else: - if not skipundefined: - outdict[key] = undefinedval - return outdict - elif (isinstance(obj, TraitListObject) or - isinstance(obj, list) or isinstance(obj, tuple)): - out = [] - for val in obj: - if isdefined(val): - out.append(self._clean_container(val, undefinedval)) - else: - if not skipundefined: - out.append(undefinedval) - else: - out.append(None) - if isinstance(obj, tuple): - return tuple(out) - else: - if isdefined(obj): - out = obj - else: - if not skipundefined: - out = undefinedval - return out - def get_hashval(self, hash_method=None): """Return a dictionary of our items with hashes for each file. @@ -288,82 +393,6 @@ def _get_sorteddict(self, obj, dictwithhash=False, hash_method=None, out = obj return out - def _get_trait_desc(self, name, spec=None): - if spec is None: - spec = self.traits()[name] - - desc = spec.desc - xor = spec.xor - requires = spec.requires - argstr = spec.argstr - name_source = spec.name_source - if name_source is None: - name_source = spec.ns - - manhelpstr = ['\t%s' % name] - - type_info = spec.full_info(self, name, None) - - default = '' - if spec.usedefault: - default = ', nipype default value: %s' % str(spec.default_value()[1]) - line = "(%s%s)" % (type_info, default) - - manhelpstr = wrap(line, 70, - initial_indent=manhelpstr[0] + ': ', - subsequent_indent='\t\t ') - - if desc: - for line in desc.split('\n'): - line = re.sub(r'\s+', ' ', line) - manhelpstr += wrap(line, 70, initial_indent='\t\t', - subsequent_indent='\t\t') - - if argstr: - pos = spec.position - if pos is not None: - manhelpstr += wrap('flag: %s, position: %s' % (argstr, pos), 70, - initial_indent='\t\t', subsequent_indent='\t\t') - else: - manhelpstr += wrap('flag: %s' % argstr, 70, initial_indent='\t\t', - subsequent_indent='\t\t') - - if xor: - line = '%s' % ', '.join(xor) - manhelpstr += wrap(line, 70, initial_indent='\t\tmutually_exclusive: ', - subsequent_indent='\t\t ') - - if requires: - others = [field for field in requires if field != name] - line = '%s' % ', '.join(others) - manhelpstr += wrap(line, 70, initial_indent='\t\trequires: ', - subsequent_indent='\t\t ') - - if name_source: - tpl = ', name_template not defined' - if spec.name_template: - tpl = ', name_template is \'%s\'' % spec.name_template - manhelpstr += wrap(('name source: %s' % name_source) + tpl, 70, - initial_indent='\t\t', subsequent_indent='\t\t ') - return manhelpstr - - def help(self): - """Print help of these traits""" - helpstr = [] - for name, spec in sorted(self.traits(transient=None).items()): - helpstr += self._get_trait_desc(name, spec) - if len(helpstr) == 0: - helpstr += ['\tNone'] - return helpstr - - -class TraitedSpec(BaseTraitedSpec): - """ Create a subclass with strict traits. - - This is used in 90% of the cases. - """ - _ = traits.Disallow - @provides(IInputSpec) class BaseInputSpec(BaseTraitedSpec): @@ -396,7 +425,7 @@ def optional_items(self): def _check_xor(self, obj, name, old, new): """ Checks inputs with xor list """ - IFLOGGER.error('Called check_xorg with name %s' % name) + IFLOGGER.debug('Called check_xorg with name %s', name) if isdefined(getattr(self, name)): xor_list = self.traits()[name].xor if not isinstance(xor_list, list): @@ -443,7 +472,7 @@ def check_inputs(self): if xor_spec is None: xor_spec = [] - if xor_spec and not any([isdefined(getattr(self, xname)) for xname in xor_spec]): + if not any([isdefined(getattr(self, xname)) for xname in xor_spec]): raise ValueError( '%s requires a value for one of these inputs %s. For a list of required inputs, ' 'see %s.help()' % (self.__class__.__name__, [name] + xor_spec, self.__class__.__name__)) @@ -464,10 +493,12 @@ def get_filecopy_info(self): def check_version(self, version, raise_exception=True): """ Raises an exception on version mismatch""" + if not version or version is None: + return + unavailable_traits = [] # check minimum version check = dict(min_ver=lambda t: t is not None) - for name in self.trait_names(**check): min_ver = LooseVersion(str(self.traits()[name].min_ver)) if min_ver > version: @@ -499,16 +530,17 @@ def check_version(self, version, raise_exception=True): return unavailable_traits - def help(self): + @classmethod + def help(cls): """Print inputs formatted""" manhelpstr = [] - for name, spec in sorted(self.mandatory_items()): - manhelpstr += self._get_trait_desc(name, spec) + for name, spec in sorted(cls().mandatory_items()): + manhelpstr += cls()._get_trait_desc(name, spec) opthelpstr = [] - for name, spec in sorted(self.optional_items()): - opthelpstr += self._get_trait_desc(name, spec) + for name, spec in sorted(cls().optional_items()): + opthelpstr += cls()._get_trait_desc(name, spec) - helpstr = [] + helpstr = ['Inputs ::'] if manhelpstr: manhelpstr.insert(0, '') manhelpstr.insert(1, '\t[Mandatory]') @@ -519,10 +551,17 @@ def help(self): helpstr += opthelpstr if not helpstr: - return ['', '\tNone'] - + helpstr = ['', '\tNone'] return helpstr +@provides(IOutputSpec) +class TraitedSpec(BaseTraitedSpec): + """ Create a subclass with strict traits. + + This is used in 90% of the cases. + """ + _ = traits.Disallow + @provides(IInputSpec) class DynamicTraitedSpec(BaseTraitedSpec): @@ -573,7 +612,6 @@ def _format_arg(self, name, spec=None, value=None): value = getattr(self, name) argstr = spec.argstr - IFLOGGER.debug('Formatting %s, value=%s' % (name, str(value))) if spec.is_trait_type(traits.Bool) and "%" not in argstr: if value: # Boolean options have no format string. Just append options @@ -635,7 +673,7 @@ def parse_args(self, skip=None): continue arg = self._format_arg(name, spec, value) - if arg is None: + if arg is None or not arg: continue pos = spec.position if pos is not None: @@ -677,5 +715,5 @@ def _format_arg(self, name, spec=None, value=None): if value: value = os.path.abspath(self._outputs_filenames[name]) else: - return "" + return None return super(SEMLikeCommandLineInputSpec, self)._format_arg(name, spec, value) diff --git a/nipype/interfaces/base/tests/test_base.py b/nipype/interfaces/base/tests/test_base.py index 5c18bcfcd7..d44605cd67 100644 --- a/nipype/interfaces/base/tests/test_base.py +++ b/nipype/interfaces/base/tests/test_base.py @@ -1,17 +1,18 @@ # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: + from __future__ import print_function from future import standard_library standard_library.install_aliases() import os +import sys import tempfile import shutil -import warnings from nipype.testing import (assert_equal, assert_not_equal, assert_raises, assert_true, assert_false, with_setup, package_check, - skipif) + skipif, example_data) import nipype.interfaces.base as nib from nipype.utils.filemanip import split_filename from nipype.interfaces.base import Undefined, config @@ -54,7 +55,7 @@ def test_bunch_hash(): # NOTE: Since the path to the json file is included in the Bunch, # the hash will be unique to each machine. pth = os.path.split(os.path.abspath(__file__))[0] - json_pth = os.path.join(pth, 'realign_json.json') + json_pth = example_data('realign_json.json') b = nib.Bunch(infile=json_pth, otherthing='blue', yat=True) @@ -86,10 +87,10 @@ def teardown_file(tmp_dir): def test_TraitedSpec(): - yield assert_true, nib.TraitedSpec().get_hashval() - yield assert_equal, nib.TraitedSpec().__repr__(), '\n\n' + yield assert_true, nib.BaseInputSpec().get_hashval() + yield assert_equal, nib.BaseInputSpec().__repr__(), '\n\n' - class spec(nib.TraitedSpec): + class spec(nib.BaseInputSpec): foo = nib.traits.Int goo = nib.traits.Float(usedefault=True) @@ -119,7 +120,7 @@ def test_TraitedSpec_dynamic(): def test_TraitedSpec_logic(): - class spec3(nib.TraitedSpec): + class spec3(nib.BaseInputSpec): _xor_inputs = ('foo', 'bar') foo = nib.traits.Int(xor=_xor_inputs, @@ -134,82 +135,79 @@ class out3(nib.TraitedSpec): output = nib.traits.Int class MyInterface(nib.BaseInterface): - input_spec = spec3 - output_spec = out3 + _input_spec = spec3 + _output_spec = out3 myif = MyInterface() - yield assert_raises, TypeError, setattr(myif.inputs, 'kung', 10.0) + set_kung = lambda: setattr(myif.inputs, 'kung', 'b') + yield assert_raises, nib.TraitError, set_kung myif.inputs.foo = 1 yield assert_equal, myif.inputs.foo, 1 set_bar = lambda: setattr(myif.inputs, 'bar', 1) - yield assert_raises, IOError, set_bar + yield assert_raises, nib.TraitError, set_bar yield assert_equal, myif.inputs.foo, 1 myif.inputs.kung = 2 yield assert_equal, myif.inputs.kung, 2.0 - -def test_deprecation(): - with warnings.catch_warnings(record=True) as w: - warnings.filterwarnings('always', '', UserWarning) - - class DeprecationSpec1(nib.TraitedSpec): - foo = nib.traits.Int(deprecated='0.1') - spec_instance = DeprecationSpec1() - set_foo = lambda: setattr(spec_instance, 'foo', 1) - yield assert_raises, nib.TraitError, set_foo - yield assert_equal, len(w), 0, 'no warnings, just errors' - - with warnings.catch_warnings(record=True) as w: - warnings.filterwarnings('always', '', UserWarning) - - class DeprecationSpec1numeric(nib.TraitedSpec): - foo = nib.traits.Int(deprecated='0.1') - spec_instance = DeprecationSpec1numeric() - set_foo = lambda: setattr(spec_instance, 'foo', 1) - yield assert_raises, nib.TraitError, set_foo - yield assert_equal, len(w), 0, 'no warnings, just errors' - - with warnings.catch_warnings(record=True) as w: - warnings.filterwarnings('always', '', UserWarning) - - class DeprecationSpec2(nib.TraitedSpec): - foo = nib.traits.Int(deprecated='100', new_name='bar') - spec_instance = DeprecationSpec2() - set_foo = lambda: setattr(spec_instance, 'foo', 1) - yield assert_raises, nib.TraitError, set_foo - yield assert_equal, len(w), 0, 'no warnings, just errors' - - with warnings.catch_warnings(record=True) as w: - warnings.filterwarnings('always', '', UserWarning) - - class DeprecationSpec3(nib.TraitedSpec): - foo = nib.traits.Int(deprecated='1000', new_name='bar') - bar = nib.traits.Int() - spec_instance = DeprecationSpec3() - not_raised = True - try: - spec_instance.foo = 1 - except nib.TraitError: - not_raised = False - yield assert_true, not_raised - yield assert_equal, len(w), 1, 'deprecated warning 1 %s' % [w1.message for w1 in w] - - with warnings.catch_warnings(record=True) as w: - warnings.filterwarnings('always', '', UserWarning) - - class DeprecationSpec3(nib.TraitedSpec): - foo = nib.traits.Int(deprecated='1000', new_name='bar') - bar = nib.traits.Int() - spec_instance = DeprecationSpec3() - not_raised = True - try: - spec_instance.foo = 1 - except nib.TraitError: - not_raised = False - yield assert_true, not_raised - yield assert_equal, spec_instance.foo, Undefined - yield assert_equal, spec_instance.bar, 1 - yield assert_equal, len(w), 1, 'deprecated warning 2 %s' % [w1.message for w1 in w] +# Now warnings are sent to the log file. Therefore, these tests +# need be rewritten to check the log file. +# +# def test_deprecation(): +# with warnings.catch_warnings(record=True) as w: +# warnings.filterwarnings('always', '', UserWarning) +# +# class DeprecationSpec1(nib.BaseInputSpec): +# foo = nib.traits.Int(deprecated='0.1') +# spec_instance = DeprecationSpec1() +# set_foo = lambda: setattr(spec_instance, 'foo', 1) +# yield assert_raises, nib.TraitError, set_foo +# yield assert_equal, len(w), 0, 'no warnings, just errors' +# +# with warnings.catch_warnings(record=True) as w: +# warnings.filterwarnings('always', '', UserWarning) +# +# class DeprecationSpec1numeric(nib.BaseInputSpec): +# foo = nib.traits.Int(deprecated='0.1') +# spec_instance = DeprecationSpec1numeric() +# set_foo = lambda: setattr(spec_instance, 'foo', 1) +# yield assert_raises, nib.TraitError, set_foo +# yield assert_equal, len(w), 0, 'no warnings, just errors' +# +# with warnings.catch_warnings(record=True) as w: +# warnings.filterwarnings('always', '', UserWarning) +# +# class DeprecationSpec2(nib.BaseInputSpec): +# foo = nib.traits.Int(deprecated='100', new_name='bar') +# spec_instance = DeprecationSpec2() +# set_foo = lambda: setattr(spec_instance, 'foo', 1) +# yield assert_raises, nib.TraitError, set_foo +# yield assert_equal, len(w), 0, 'no warnings, just errors' +# +# with warnings.catch_warnings(record=True) as w: +# warnings.filterwarnings('always', '', UserWarning) +# +# class DeprecationSpec3(nib.BaseInputSpec): +# foo = nib.traits.Int(deprecated='1000', new_name='bar') +# bar = nib.traits.Int() +# spec_instance = DeprecationSpec3() +# yield assert_true, spec_instance._check_deprecated('foo', 1) +# +# with warnings.catch_warnings(record=True) as w: +# warnings.filterwarnings('always', '', UserWarning) +# +# class DeprecationSpec3(nib.BaseInputSpec): +# foo = nib.traits.Int(deprecated='1000', new_name='bar') +# bar = nib.traits.Int() +# spec_instance = DeprecationSpec3() +# not_raised = True +# try: +# spec_instance.foo = 1 +# except nib.TraitError: +# not_raised = False +# yield assert_true, not_raised +# yield assert_equal, spec_instance.foo, Undefined +# yield assert_equal, spec_instance.bar, 1 +# yield assert_equal, len(w), 1, 'deprecated warning 2 %s' % [w1.message for w1 in w] def test_namesource(): @@ -219,21 +217,37 @@ def test_namesource(): os.chdir(tmpd) class spec2(nib.CommandLineInputSpec): - moo = nib.File(name_source=['doo'], hash_files=False, argstr="%s", - position=2) doo = nib.File(exists=True, argstr="%s", position=1) - goo = traits.Int(argstr="%d", position=4) - poo = nib.File(name_source=['goo'], hash_files=False, argstr="%s", position=3) + goo = traits.Int(argstr="-n %d", position=3) + moo = nib.GenFile(template='{doo}_generated', keep_extension=True, + hash_files=False, argstr="%s", position=2) class TestName(nib.CommandLine): - _cmd = "mycommand" - input_spec = spec2 + _cmd = 'cp' + _input_spec = spec2 + testobj = TestName() testobj.inputs.doo = tmp_infile - testobj.inputs.goo = 99 yield assert_true, '%s_generated' % nme in testobj.cmdline - testobj.inputs.moo = "my_%s_template" - yield assert_true, 'my_%s_template' % nme in testobj.cmdline + testobj.inputs.goo = 99 + testobj.inputs.moo = "my_file.txt" + yield assert_true, 'my_file.txt' in testobj.cmdline + + class spec2(nib.CommandLineInputSpec): + doo = nib.File(exists=True, argstr="%s", position=1) + goo = traits.Int(argstr="%d", position=4) + moo = nib.GenFile(template='{doo}_generated', keep_extension=True, + hash_files=False, argstr="%s", position=2) + poo = nib.GenFile(template='file{goo:02d}.txt', hash_files=False, argstr="%s", position=3) + + class TestName(nib.CommandLine): + _cmd = 'ls' + _input_spec = spec2 + + testobj = TestName() + testobj.inputs.goo = 5 + yield assert_true, 'file05.txt' in testobj.cmdline + os.chdir(pwd) teardown_file(tmpd) @@ -246,14 +260,14 @@ def test_chained_namesource(): class spec2(nib.CommandLineInputSpec): doo = nib.File(exists=True, argstr="%s", position=1) - moo = nib.File(name_source=['doo'], hash_files=False, argstr="%s", - position=2, name_template='%s_mootpl') - poo = nib.File(name_source=['moo'], hash_files=False, - argstr="%s", position=3) + moo = nib.GenFile(template='{doo}_mootpl', hash_files=False, argstr="%s", + position=2) + poo = nib.GenFile(template='{moo}_generated', hash_files=False, + argstr="%s", position=3) class TestName(nib.CommandLine): - _cmd = "mycommand" - input_spec = spec2 + _cmd = "ls" # An existing command is necessary + _input_spec = spec2 testobj = TestName() testobj.inputs.doo = tmp_infile @@ -273,26 +287,28 @@ def test_cycle_namesource1(): os.chdir(tmpd) class spec3(nib.CommandLineInputSpec): - moo = nib.File(name_source=['doo'], hash_files=False, argstr="%s", - position=1, name_template='%s_mootpl') - poo = nib.File(name_source=['moo'], hash_files=False, - argstr="%s", position=2) - doo = nib.File(name_source=['poo'], hash_files=False, - argstr="%s", position=3) + doo = nib.GenFile(template='{poo}_tpl', hash_files=False, + argstr="%s", position=1) + moo = nib.GenFile(template='{doo}_mootpl', hash_files=False, + argstr="%s", position=2) + poo = nib.GenFile(template='{moo}_generated', hash_files=False, + argstr="%s", position=3) class TestCycle(nib.CommandLine): - _cmd = "mycommand" - input_spec = spec3 + _cmd = 'cp' + _input_spec = spec3 # Check that an exception is raised - to0 = TestCycle() - not_raised = True + to0 = TestCycle(command='ls') + oldrec = sys.getrecursionlimit() + raised = False try: + sys.setrecursionlimit(100) # Set this to fail early to0.cmdline - except nib.NipypeInterfaceError: - not_raised = False - yield assert_false, not_raised - + except RuntimeError: + raised = True + sys.setrecursionlimit(oldrec) + yield assert_true, raised os.chdir(pwd) teardown_file(tmpd) @@ -304,32 +320,31 @@ def test_cycle_namesource2(): os.chdir(tmpd) class spec3(nib.CommandLineInputSpec): - moo = nib.File(name_source=['doo'], hash_files=False, argstr="%s", - position=1, name_template='%s_mootpl') - poo = nib.File(name_source=['moo'], hash_files=False, - argstr="%s", position=2) - doo = nib.File(name_source=['poo'], hash_files=False, - argstr="%s", position=3) + doo = nib.GenFile(template='{poo}_tpl', hash_files=False, + argstr="%s", position=1) + moo = nib.GenFile(template='{doo}_mootpl', hash_files=False, + argstr="%s", position=2) + poo = nib.GenFile(template='{moo}_generated', hash_files=False, + argstr="%s", position=3) class TestCycle(nib.CommandLine): - _cmd = "mycommand" - input_spec = spec3 + _cmd = 'ls' + _input_spec = spec3 # Check that loop can be broken by setting one of the inputs - to1 = TestCycle() + to1 = TestCycle(command='ls') to1.inputs.poo = tmp_infile - not_raised = True + raised = False try: res = to1.cmdline - except nib.NipypeInterfaceError: - not_raised = False - print(res) + except RuntimeError: + raised = True - yield assert_true, not_raised + yield assert_false, raised yield assert_true, '%s' % tmp_infile in res - yield assert_true, '%s_generated' % nme in res - yield assert_true, '%s_generated_mootpl' % nme in res + yield assert_true, '%s_tpl' % nme in res + yield assert_true, '%s_tpl_mootpl' % nme in res os.chdir(pwd) teardown_file(tmpd) @@ -350,7 +365,7 @@ def test_TraitedSpec_withFile(): tmpd, nme = os.path.split(tmp_infile) yield assert_true, os.path.exists(tmp_infile) - class spec2(nib.TraitedSpec): + class spec2(nib.BaseInputSpec): moo = nib.File(exists=True) doo = nib.traits.List(nib.File(exists=True)) infields = spec2(moo=tmp_infile, doo=[tmp_infile]) @@ -367,20 +382,20 @@ def test_TraitedSpec_withNoFileHashing(): os.chdir(tmpd) yield assert_true, os.path.exists(tmp_infile) - class spec2(nib.TraitedSpec): + class spec2(nib.BaseInputSpec): moo = nib.File(exists=True, hash_files=False) doo = nib.traits.List(nib.File(exists=True)) infields = spec2(moo=nme, doo=[tmp_infile]) hashval = infields.get_hashval(hash_method='content') yield assert_equal, hashval[1], '8da4669ff5d72f670a46ea3e7a203215' - class spec3(nib.TraitedSpec): + class spec3(nib.BaseInputSpec): moo = nib.File(exists=True, name_source="doo") doo = nib.traits.List(nib.File(exists=True)) infields = spec3(moo=nme, doo=[tmp_infile]) hashval1 = infields.get_hashval(hash_method='content') - class spec4(nib.TraitedSpec): + class spec4(nib.BaseInputSpec): moo = nib.File(exists=True) doo = nib.traits.List(nib.File(exists=True)) infields = spec4(moo=nme, doo=[tmp_infile]) @@ -391,31 +406,11 @@ class spec4(nib.TraitedSpec): teardown_file(tmpd) -def test_Interface(): - yield assert_equal, nib.Interface.input_spec, None - yield assert_equal, nib.Interface.output_spec, None - yield assert_raises, NotImplementedError, nib.Interface - yield assert_raises, NotImplementedError, nib.Interface.help - yield assert_raises, NotImplementedError, nib.Interface._inputs_help - yield assert_raises, NotImplementedError, nib.Interface._outputs_help - yield assert_raises, NotImplementedError, nib.Interface._outputs - - class DerivedInterface(nib.Interface): - def __init__(self): - pass - - nif = DerivedInterface() - yield assert_raises, NotImplementedError, nif.run - yield assert_raises, NotImplementedError, nif.aggregate_outputs - yield assert_raises, NotImplementedError, nif._list_outputs - yield assert_raises, NotImplementedError, nif.inputs.get_filecopy_info - - def test_BaseInterface(): yield assert_equal, nib.BaseInterface.help(), None - yield assert_equal, nib.BaseInterface.inputs.get_filecopy_info(), [] + yield assert_equal, nib.BaseInputSpec().get_filecopy_info(), [] - class InputSpec(nib.TraitedSpec): + class InputSpec(nib.BaseInputSpec): foo = nib.traits.Int(desc='a random int') goo = nib.traits.Int(desc='a random int', mandatory=True) moo = nib.traits.Int(desc='a random int', mandatory=False) @@ -427,165 +422,155 @@ class OutputSpec(nib.TraitedSpec): foo = nib.traits.Int(desc='a random int') class DerivedInterface(nib.BaseInterface): - input_spec = InputSpec + _input_spec = InputSpec yield assert_equal, DerivedInterface.help(), None - yield assert_true, 'moo' in ''.join(DerivedInterface._inputs_help()) - yield assert_equal, DerivedInterface()._outputs(), None - yield assert_equal, DerivedInterface.inputs.get_filecopy_info()[0]['key'], 'woo' - yield assert_true, DerivedInterface.inputs.get_filecopy_info()[0]['copy'] - yield assert_equal, DerivedInterface.inputs.get_filecopy_info()[1]['key'], 'zoo' - yield assert_false, DerivedInterface.inputs.get_filecopy_info()[1]['copy'] + yield assert_equal, DerivedInterface().inputs.get_filecopy_info()[0]['key'], 'woo' + yield assert_true, DerivedInterface().inputs.get_filecopy_info()[0]['copy'] + yield assert_equal, DerivedInterface().inputs.get_filecopy_info()[1]['key'], 'zoo' + yield assert_false, DerivedInterface().inputs.get_filecopy_info()[1]['copy'] yield assert_equal, DerivedInterface().inputs.foo, Undefined - yield assert_raises, ValueError, DerivedInterface()._check_mandatory_inputs - yield assert_equal, DerivedInterface(goo=1)._check_mandatory_inputs(), None + yield assert_raises, ValueError, DerivedInterface().inputs.check_inputs + yield assert_equal, DerivedInterface(goo=1).inputs.check_inputs(), None yield assert_raises, ValueError, DerivedInterface().run yield assert_raises, NotImplementedError, DerivedInterface(goo=1).run class DerivedInterface2(DerivedInterface): - output_spec = OutputSpec - - def _run_interface(self, runtime): - return runtime + _output_spec = OutputSpec yield assert_equal, DerivedInterface2.help(), None - yield assert_equal, DerivedInterface2()._outputs().foo, Undefined + yield assert_equal, DerivedInterface2().outputs.foo, Undefined yield assert_raises, NotImplementedError, DerivedInterface2(goo=1).run - nib.BaseInterface.input_spec = None + nib.BaseInterface._input_spec = None yield assert_raises, Exception, nib.BaseInterface -def assert_not_raises(fn, *args, **kwargs): - fn(*args, **kwargs) - return True - - def test_input_version(): - class InputSpec(nib.TraitedSpec): + class InputSpec(nib.BaseInputSpec): foo = nib.traits.Int(desc='a random int', min_ver='0.9') class DerivedInterface1(nib.BaseInterface): - input_spec = InputSpec + _input_spec = InputSpec obj = DerivedInterface1() - yield assert_not_raises, obj._check_version_requirements, obj.inputs + yield assert_equal, obj.check_version(), [] config.set('execution', 'stop_on_unknown_version', True) - yield assert_raises, Exception, obj._check_version_requirements, obj.inputs - + yield assert_raises, Exception, lambda: obj.check_version() config.set_default_config() - class InputSpec(nib.TraitedSpec): + class InputSpec(nib.BaseInputSpec): foo = nib.traits.Int(desc='a random int', min_ver='0.9') class DerivedInterface1(nib.BaseInterface): - input_spec = InputSpec - _version = '0.8' + _input_spec = InputSpec + version = '0.8' obj = DerivedInterface1() obj.inputs.foo = 1 - yield assert_raises, Exception, obj._check_version_requirements + yield assert_raises, Exception, lambda: obj.check_version() - class InputSpec(nib.TraitedSpec): + class InputSpec(nib.BaseInputSpec): foo = nib.traits.Int(desc='a random int', min_ver='0.9') class DerivedInterface1(nib.BaseInterface): - input_spec = InputSpec - _version = '0.10' + _input_spec = InputSpec + version = '0.10' obj = DerivedInterface1() - yield assert_not_raises, obj._check_version_requirements, obj.inputs + yield assert_equal, obj.check_version(), [] - class InputSpec(nib.TraitedSpec): + class InputSpec(nib.BaseInputSpec): foo = nib.traits.Int(desc='a random int', min_ver='0.9') class DerivedInterface1(nib.BaseInterface): - input_spec = InputSpec - _version = '0.9' + _input_spec = InputSpec + version = '0.9' obj = DerivedInterface1() obj.inputs.foo = 1 not_raised = True - yield assert_not_raises, obj._check_version_requirements, obj.inputs + yield assert_equal, obj.check_version(), [] - class InputSpec(nib.TraitedSpec): + class InputSpec(nib.BaseInputSpec): foo = nib.traits.Int(desc='a random int', max_ver='0.7') class DerivedInterface2(nib.BaseInterface): - input_spec = InputSpec - _version = '0.8' + _input_spec = InputSpec + version = '0.8' obj = DerivedInterface2() obj.inputs.foo = 1 - yield assert_raises, Exception, obj._check_version_requirements + yield assert_raises, Exception, lambda: obj.check_version() - class InputSpec(nib.TraitedSpec): + class InputSpec(nib.BaseInputSpec): foo = nib.traits.Int(desc='a random int', max_ver='0.9') class DerivedInterface1(nib.BaseInterface): - input_spec = InputSpec - _version = '0.9' + _input_spec = InputSpec + version = '0.9' obj = DerivedInterface1() obj.inputs.foo = 1 not_raised = True - yield assert_not_raises, obj._check_version_requirements, obj.inputs + yield assert_equal, obj.check_version(), [] def test_output_version(): - class InputSpec(nib.TraitedSpec): + class InputSpec(nib.BaseInputSpec): foo = nib.traits.Int(desc='a random int') class OutputSpec(nib.TraitedSpec): foo = nib.traits.Int(desc='a random int', min_ver='0.9') class DerivedInterface1(nib.BaseInterface): - input_spec = InputSpec - output_spec = OutputSpec - _version = '0.10' - obj = DerivedInterface1() - yield assert_equal, obj._check_version_requirements(obj._outputs()), [] - - class InputSpec(nib.TraitedSpec): - foo = nib.traits.Int(desc='a random int') - - class OutputSpec(nib.TraitedSpec): - foo = nib.traits.Int(desc='a random int', min_ver='0.11') - - class DerivedInterface1(nib.BaseInterface): - input_spec = InputSpec - output_spec = OutputSpec - _version = '0.10' + _input_spec = InputSpec + _output_spec = OutputSpec + version = '0.10' obj = DerivedInterface1() - yield assert_equal, obj._check_version_requirements(obj._outputs()), ['foo'] - - class InputSpec(nib.TraitedSpec): - foo = nib.traits.Int(desc='a random int') - - class OutputSpec(nib.TraitedSpec): - foo = nib.traits.Int(desc='a random int', min_ver='0.11') - - class DerivedInterface1(nib.BaseInterface): - input_spec = InputSpec - output_spec = OutputSpec - _version = '0.10' - - def _run_interface(self, runtime): - return runtime - - def _post_run(self): - return {'foo': 1} - obj = DerivedInterface1() - yield assert_raises, KeyError, obj.run + res = obj.check_version() + yield assert_equal, res, [] + +# TODO Enable checking version on outputs +# class InputSpec(nib.BaseInputSpec): +# foo = nib.traits.Int(desc='a random int') +# +# class OutputSpec(nib.TraitedSpec): +# foo = nib.traits.Int(desc='a random int', min_ver='0.11') +# +# class DerivedInterface1(nib.BaseInterface): +# _input_spec = InputSpec +# _output_spec = OutputSpec +# version = '0.10' +# obj = DerivedInterface1() +# yield assert_equal, obj.check_version(), ['foo'] +# +# class InputSpec(nib.BaseInputSpec): +# foo = nib.traits.Int(desc='a random int') +# +# class OutputSpec(nib.TraitedSpec): +# foo = nib.traits.Int(desc='a random int', min_ver='0.11') +# +# class DerivedInterface1(nib.BaseInterface): +# _input_spec = InputSpec +# _output_spec = OutputSpec +# version = '0.10' +# +# def _run_interface(self, runtime): +# self.outputs.foo = 1 +# return runtime +# +# obj = DerivedInterface1() +# yield assert_raises, KeyError, obj.run def test_Commandline(): yield assert_raises, Exception, nib.CommandLine ci = nib.CommandLine(command='which') - yield assert_equal, ci.cmd, 'which' + yield assert_equal, ci.cmdline, 'which' yield assert_equal, ci.inputs.args, Undefined ci2 = nib.CommandLine(command='which', args='ls') yield assert_equal, ci2.cmdline, 'which ls' ci3 = nib.CommandLine(command='echo') - ci3.inputs.environ = {'MYENV': 'foo'} + ci3.environ['MYENV'] = 'foo' res = ci3.run() yield assert_equal, res.runtime.environ['MYENV'], 'foo' - yield assert_equal, res.outputs, None + yield assert_equal, res.outputs.get_traitsfree(), {} class CommandLineInputSpec1(nib.CommandLineInputSpec): foo = nib.traits.Str(argstr='%s', desc='a str') @@ -596,8 +581,8 @@ class CommandLineInputSpec1(nib.CommandLineInputSpec): noo = nib.traits.Int(argstr='-x %d', desc='an int') roo = nib.traits.Str(desc='not on command line') soo = nib.traits.Bool(argstr="-soo") - nib.CommandLine.input_spec = CommandLineInputSpec1 - ci4 = nib.CommandLine(command='cmd') + nib.CommandLine._input_spec = CommandLineInputSpec1 + ci4 = nib.CommandLine(command='ls') ci4.inputs.foo = 'foo' ci4.inputs.goo = True ci4.inputs.hoo = ['a', 'b'] @@ -605,30 +590,28 @@ class CommandLineInputSpec1(nib.CommandLineInputSpec): ci4.inputs.noo = 0 ci4.inputs.roo = 'hello' ci4.inputs.soo = False - cmd = ci4.parse_args() + cmd = ci4.inputs.parse_args() yield assert_equal, cmd[0], '-g' yield assert_equal, cmd[-1], '-i 1 -i 2 -i 3' yield assert_true, 'hello' not in ' '.join(cmd) yield assert_true, '-soo' not in ' '.join(cmd) ci4.inputs.soo = True - cmd = ci4.parse_args() + cmd = ci4.inputs.parse_args() yield assert_true, '-soo' in ' '.join(cmd) class CommandLineInputSpec2(nib.CommandLineInputSpec): - foo = nib.File(argstr='%s', desc='a str', genfile=True) - nib.CommandLine.input_spec = CommandLineInputSpec2 - ci5 = nib.CommandLine(command='cmd') - yield assert_raises, NotImplementedError, ci5.parse_args + foo = nib.File('filename', argstr='%s', usedefault=True, desc='a str') - class DerivedClass(nib.CommandLine): - input_spec = CommandLineInputSpec2 + nib.CommandLine._input_spec = CommandLineInputSpec2 + ci5 = nib.CommandLine(command='ls') + yield assert_equal, 'ls filename', ci5.cmdline - def _gen_filename(self, name): - return 'filename' + class DerivedClass(nib.CommandLine): + _input_spec = CommandLineInputSpec2 - ci6 = DerivedClass(command='cmd') - yield assert_equal, ci6.parse_args()[0], 'filename' - nib.CommandLine.input_spec = nib.CommandLineInputSpec + ci6 = DerivedClass(command='ls') + yield assert_equal, ci6.inputs.parse_args()[0], 'filename' + nib.CommandLine._input_spec = nib.CommandLineInputSpec def test_Commandline_environ(): @@ -638,10 +621,14 @@ def test_Commandline_environ(): res = ci3.run() yield assert_equal, res.runtime.environ['DISPLAY'], ':1' config.set('execution', 'display_variable', ':3') + ci3 = nib.CommandLine(command='echo') + ci3.environ.pop('DISPLAY', None) + res = ci3.run() + yield assert_false, 'DISPLAY' in ci3.environ + ci3.environ['DISPLAY'] = ':3' res = ci3.run() - yield assert_false, 'DISPLAY' in ci3.inputs.environ yield assert_equal, res.runtime.environ['DISPLAY'], ':3' - ci3.inputs.environ = {'DISPLAY': ':2'} + ci3.environ = {'DISPLAY': ':2'} res = ci3.run() yield assert_equal, res.runtime.environ['DISPLAY'], ':2' @@ -653,17 +640,17 @@ def test_CommandLine_output(): os.chdir(tmpd) yield assert_true, os.path.exists(tmp_infile) ci = nib.CommandLine(command='ls -l') - ci.inputs.terminal_output = 'allatonce' + ci.terminal_output = 'allatonce' res = ci.run() yield assert_equal, res.runtime.merged, '' yield assert_true, name in res.runtime.stdout ci = nib.CommandLine(command='ls -l') - ci.inputs.terminal_output = 'file' + ci.terminal_output = 'file' res = ci.run() yield assert_true, 'stdout.nipype' in res.runtime.stdout yield assert_equal, type(res.runtime.stdout), type('hi') ci = nib.CommandLine(command='ls -l') - ci.inputs.terminal_output = 'none' + ci.terminal_output = 'none' res = ci.run() yield assert_equal, res.runtime.stdout, '' ci = nib.CommandLine(command='ls -l') @@ -682,17 +669,17 @@ def test_global_CommandLine_output(): res = ci.run() yield assert_true, name in res.runtime.stdout yield assert_true, os.path.exists(tmp_infile) - nib.CommandLine.set_default_terminal_output('allatonce') ci = nib.CommandLine(command='ls -l') + ci.terminal_output = 'allatonce' res = ci.run() yield assert_equal, res.runtime.merged, '' yield assert_true, name in res.runtime.stdout - nib.CommandLine.set_default_terminal_output('file') ci = nib.CommandLine(command='ls -l') + ci.terminal_output = 'file' res = ci.run() yield assert_true, 'stdout.nipype' in res.runtime.stdout - nib.CommandLine.set_default_terminal_output('none') ci = nib.CommandLine(command='ls -l') + ci.terminal_output = 'none' res = ci.run() yield assert_equal, res.runtime.stdout, '' os.chdir(pwd) diff --git a/nipype/interfaces/base/traits_extension.py b/nipype/interfaces/base/traits_extension.py index 6aae5cd7c6..2cd44042b1 100644 --- a/nipype/interfaces/base/traits_extension.py +++ b/nipype/interfaces/base/traits_extension.py @@ -198,7 +198,8 @@ def validate(self, obj, name, value): def get(self, obj, name): # Compute expected name iff trait is not set template = self.template - if self.value is None: + value = self.get_value(obj, name) + if not value or not isdefined(value) or value is None: srcvals = {} ext = '' final_nsrcs = [] @@ -216,10 +217,11 @@ def get(self, obj, name): IFLOGGER.debug('replacing %s with %s. Result=%s', '|'.join(nsrc_list), nsrc, template) final_nsrcs.append(nsrc) - if isinstance(srcvalue, string_types): + if isinstance(srcvalue, tuple): + vallist = list(tuple) + + if not isinstance(srcvalue, list): vallist = [srcvalue] - else: - vallist = list(srcvalue) outvals = [] @@ -238,12 +240,12 @@ def get(self, obj, name): if not outvals: continue - if isinstance(srcvalue, string_types): - srcvals.update({nsrc: outvals[0]}) + if isinstance(srcvalue, list): + srcvals.update({nsrc: outvals}) elif isinstance(srcvalue, tuple): srcvals.update({nsrc: tuple(outvals)}) else: - srcvals.update({nsrc: outvals}) + srcvals.update({nsrc: outvals[0]}) # Check that no source is missing IFLOGGER.debug('Final sources: %s and values %s', final_nsrcs, srcvals) @@ -401,10 +403,10 @@ def validate(self, obj, name, value): self.error(obj, name, value) def get(self, obj, name): + template = self.template # Compute expected name iff trait is not set value = self.get_value(obj, name) - template = self.template - if not isdefined(value) or not value: + if not value or not isdefined(value) or value is None: srcvals = {} ext = '' @@ -430,10 +432,12 @@ def get(self, obj, name): vallist = srcvalue IFLOGGER.debug('Generating range of outputs: %s', vallist) - if isinstance(srcvalue, string_types): + + if isinstance(srcvalue, tuple): + vallist = list(tuple) + + if not isinstance(srcvalue, list): vallist = [srcvalue] - else: - vallist = list(srcvalue) outvals = [] @@ -665,9 +669,9 @@ def validate(self, obj, name, value): """ validated_value = super(Command, self).validate(obj, name, value) env = obj.environ - IFLOGGER.debug('Environ now: %s', env) + # IFLOGGER.debug('Environ now: %s', env) valid, _ = _exists_in_path(validated_value.split()[0], env) - + if valid: return validated_value raise TraitError( diff --git a/nipype/interfaces/tests/realign_json.json b/nipype/testing/data/realign_json.json similarity index 100% rename from nipype/interfaces/tests/realign_json.json rename to nipype/testing/data/realign_json.json diff --git a/nipype/utils/config.py b/nipype/utils/config.py index a4885c8f18..f54b5a8d81 100644 --- a/nipype/utils/config.py +++ b/nipype/utils/config.py @@ -121,8 +121,8 @@ def set_log_dir(self, log_dir): """ self._config.set('logging', 'log_directory', log_dir) - def get(self, section, option): - return self._config.get(section, option) + def get(self, section, option, default=None): + return self._config.get(section, option, default) def set(self, section, option, value): if isinstance(value, bool): From 45748422038fb14f8bf79f26c0b6f8a2347f9df3 Mon Sep 17 00:00:00 2001 From: oesteban Date: Sun, 21 Feb 2016 17:14:39 -0800 Subject: [PATCH 61/73] enabling back make specs --- .../algorithms/tests/test_auto_ComputeMeshWarp.py | 5 +---- nipype/algorithms/tests/test_auto_ICC.py | 15 ++++++++++++--- .../algorithms/tests/test_auto_MeshWarpMaths.py | 3 --- nipype/algorithms/tests/test_auto_P2PDistance.py | 5 +---- nipype/interfaces/base/interfaces.py | 6 ++++-- 5 files changed, 18 insertions(+), 16 deletions(-) diff --git a/nipype/algorithms/tests/test_auto_ComputeMeshWarp.py b/nipype/algorithms/tests/test_auto_ComputeMeshWarp.py index e0a2d5f85c..8039868765 100644 --- a/nipype/algorithms/tests/test_auto_ComputeMeshWarp.py +++ b/nipype/algorithms/tests/test_auto_ComputeMeshWarp.py @@ -4,10 +4,7 @@ def test_ComputeMeshWarp_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - metric=dict(usedefault=True, + input_map = dict(metric=dict(usedefault=True, ), out_file=dict(usedefault=True, ), diff --git a/nipype/algorithms/tests/test_auto_ICC.py b/nipype/algorithms/tests/test_auto_ICC.py index a11e8936e4..6cbd23b27e 100644 --- a/nipype/algorithms/tests/test_auto_ICC.py +++ b/nipype/algorithms/tests/test_auto_ICC.py @@ -5,9 +5,6 @@ def test_ICC_inputs(): input_map = dict(icc_map=dict(), - ignore_exception=dict(nohash=True, - usedefault=True, - ), mask=dict(mandatory=True, ), session_F_map=dict(), @@ -22,3 +19,15 @@ def test_ICC_inputs(): for metakey, value in list(metadata.items()): yield assert_equal, getattr(inputs.traits()[key], metakey), value + +def test_ICC_outputs(): + output_map = dict(icc_map=dict(), + session_F_map=dict(), + session_var_map=dict(), + subject_var_map=dict(), + ) + outputs = ICC.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/algorithms/tests/test_auto_MeshWarpMaths.py b/nipype/algorithms/tests/test_auto_MeshWarpMaths.py index a1ae3d5525..4e56879147 100644 --- a/nipype/algorithms/tests/test_auto_MeshWarpMaths.py +++ b/nipype/algorithms/tests/test_auto_MeshWarpMaths.py @@ -5,9 +5,6 @@ def test_MeshWarpMaths_inputs(): input_map = dict(float_trait=dict(), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_surf=dict(mandatory=True, ), operation=dict(usedefault=True, diff --git a/nipype/algorithms/tests/test_auto_P2PDistance.py b/nipype/algorithms/tests/test_auto_P2PDistance.py index 0a30a382c9..2cca025b72 100644 --- a/nipype/algorithms/tests/test_auto_P2PDistance.py +++ b/nipype/algorithms/tests/test_auto_P2PDistance.py @@ -4,10 +4,7 @@ def test_P2PDistance_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - metric=dict(usedefault=True, + input_map = dict(metric=dict(usedefault=True, ), out_file=dict(usedefault=True, ), diff --git a/nipype/interfaces/base/interfaces.py b/nipype/interfaces/base/interfaces.py index 23ff5c9e92..410a7cb95b 100644 --- a/nipype/interfaces/base/interfaces.py +++ b/nipype/interfaces/base/interfaces.py @@ -92,10 +92,12 @@ class BaseInterface(HasTraits): """Implements common interface functionality. """ - inputs = Instance(IInputSpec) - outputs = Instance(IOutputSpec) + _additional_metadata = [] _input_spec = BaseInputSpec _output_spec = BaseOutputSpec + + inputs = Instance(IInputSpec) + outputs = Instance(IOutputSpec) status = traits.Enum('waiting', 'starting', 'running', 'ending', 'errored', 'finished') version = traits.Str From 0c4f17017013e3deb5f84a7284d0d176803c5ef4 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Sun, 21 Feb 2016 18:35:49 -0800 Subject: [PATCH 62/73] fix doctests in the nipype.interfaces.base module --- nipype/interfaces/base/interfaces.py | 6 ++-- nipype/interfaces/base/traits_extension.py | 39 +++++++++++++--------- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/nipype/interfaces/base/interfaces.py b/nipype/interfaces/base/interfaces.py index 410a7cb95b..dcf3744cf5 100644 --- a/nipype/interfaces/base/interfaces.py +++ b/nipype/interfaces/base/interfaces.py @@ -446,15 +446,15 @@ class MpiCommandLine(CommandLine): Examples -------- >>> from nipype.interfaces.base import MpiCommandLine - >>> mpi_cli = MpiCommandLine(command='my_mpi_prog') + >>> mpi_cli = MpiCommandLine(command='ls') >>> mpi_cli.inputs.args = '-v' >>> mpi_cli.cmdline - 'my_mpi_prog -v' + 'ls -v' >>> mpi_cli.inputs.use_mpi = True >>> mpi_cli.inputs.n_procs = 8 >>> mpi_cli.cmdline - 'mpiexec -n 8 my_mpi_prog -v' + 'mpiexec -n 8 ls -v' """ _input_spec = MpiCommandLineInputSpec diff --git a/nipype/interfaces/base/traits_extension.py b/nipype/interfaces/base/traits_extension.py index 2cd44042b1..910f2843bc 100644 --- a/nipype/interfaces/base/traits_extension.py +++ b/nipype/interfaces/base/traits_extension.py @@ -127,10 +127,10 @@ class GenFile(File): traits. >>> # The traits start undefined - >>> from nipype.interfaces.base import GenFile, Undefined - >>> class A(TraitedSpec): + >>> from nipype.interfaces.base import GenFile, Undefined, BaseInputSpec + >>> class A(BaseInputSpec): ... src = File(exists=False) - ... foo = GenFile(template='{src}_foo') + ... foo = GenFile(template='{src}_foo', keep_extension=True) >>> a = A() >>> a.src @@ -296,10 +296,10 @@ class GenMultiFile(traits.List): """ Traits to generate lists of files. >>> # The traits start undefined - >>> from nipype.interfaces.base import GenFile, Undefined, traits - >>> class A(TraitedSpec): + >>> from nipype.interfaces.base import GenFile, Undefined, traits, BaseInputSpec + >>> class A(BaseInputSpec): ... src = InputMultiPath(File(exists=False)) - ... foo = GenMultiFile(template='{src}_foo') + ... foo = GenMultiFile(template='{src}_foo', keep_extension=True) >>> a = A() >>> a.src @@ -327,24 +327,28 @@ class GenMultiFile(traits.List): ['foo1_foo.txt', 'foo2_foo.txt'] >>> # It works with several replacements and defining ranges - >>> class B(TraitedSpec): + >>> class B(BaseInputSpec): ... src = File(exists=False) ... num = traits.Int() - ... foo = GenMultiFile(template='{src}_foo_{num:03d}', range_source='num') + ... foo = GenMultiFile(template='{src}_foo_{num:03d}', range_source='num', + ... keep_extension=True) + >>> a = B() >>> a.src = '/software/temp/source.txt' >>> a.num = 3 >>> a.foo ['source_foo_000.txt', 'source_foo_001.txt', 'source_foo_002.txt'] >>> # And altogether with InputMultiPaths - >>> class B(TraitedSpec): + >>> class B(BaseInputSpec): ... src = InputMultiPath(File(exists=False)) ... num = traits.Int() - ... foo = GenMultiFile(template='{src}_foo_{num:03d}', range_source='num') + ... foo = GenMultiFile(template='{src}_foo_{num:03d}', range_source='num', + ... keep_extension=True) + >>> a = B() >>> a.src = ['/software/temp/source.txt', '/software/temp/alt.txt'] >>> a.num = 2 >>> a.foo - ['source_foo_000.txt', 'alt_foo_000.txt', 'source_foo_001.txt', 'alt_foo_001.txt'] + ['source_foo_000.txt', 'source_foo_001.txt', 'alt_foo_000.txt', 'alt_foo_001.txt'] """ @@ -433,11 +437,14 @@ def get(self, obj, name): IFLOGGER.debug('Generating range of outputs: %s', vallist) + if isinstance(srcvalue, tuple): - vallist = list(tuple) + vallist = list(srcvalue) if not isinstance(srcvalue, list): vallist = [srcvalue] + else: + vallist = srcvalue outvals = [] @@ -500,8 +507,8 @@ class OutputMultiPath(MultiPath): XXX This needs to be vetted by somebody who understands traits - >>> from nipype.interfaces.base import OutputMultiPath - >>> class A(TraitedSpec): + >>> from nipype.interfaces.base import OutputMultiPath, BaseInputSpec + >>> class A(BaseInputSpec): ... foo = OutputMultiPath(File(exists=False)) >>> a = A() >>> a.foo @@ -545,8 +552,8 @@ class InputMultiPath(MultiPath): XXX This needs to be vetted by somebody who understands traits - >>> from nipype.interfaces.base import InputMultiPath - >>> class A(TraitedSpec): + >>> from nipype.interfaces.base import InputMultiPath, BaseInputSpec + >>> class A(BaseInputSpec): ... foo = InputMultiPath(File(exists=False)) >>> a = A() >>> a.foo From ef7d3799fef2146c01ac260e9a71da78430b9b9b Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Sun, 21 Feb 2016 23:25:13 -0800 Subject: [PATCH 63/73] implementation of dry run --- nipype/interfaces/base/interfaces.py | 158 ++++++++++------ nipype/interfaces/base/specs.py | 13 +- nipype/interfaces/base/traits_extension.py | 205 +++++++++++---------- 3 files changed, 213 insertions(+), 163 deletions(-) diff --git a/nipype/interfaces/base/interfaces.py b/nipype/interfaces/base/interfaces.py index dcf3744cf5..278b7f5e0d 100644 --- a/nipype/interfaces/base/interfaces.py +++ b/nipype/interfaces/base/interfaces.py @@ -5,6 +5,16 @@ with implementation in nipype (:module:`nipype.interfaces`) or pure python implementations (:module:`nipype.algorithms`). + .. testsetup:: + + >>> import os + >>> filepath = op.dirname(op.realpath( __file__ )) + >>> datadir = op.realpath(op.join(filepath, '../../testing/data')) + >>> os.chdir(datadir) + >>> from nipype.interfaces.base.specs import BaseInputSpec, BaseOutputSpec + >>> from nipype.interfaces.base import traits_extension as traits + >>> import pprint + """ from __future__ import print_function @@ -26,7 +36,7 @@ from configparser import NoOptionError from traits.api import Interface, Instance, provides, HasTraits -from .traits_extension import traits +from .traits_extension import traits, Undefined, File, MultiPath from ...utils.misc import trim, str2bool from ...utils.provenance import write_provenance from ... import config, logging, LooseVersion @@ -36,7 +46,7 @@ # Make all the traits and spec interfaces available through base # for backwards compatibility, even though import * is discouraged # in production environments. -from .traits_extension import isdefined, Command +from .traits_extension import isdefined, Command, File, BaseFile from .specs import (IInputSpec, IOutputSpec, IInputCommandLineSpec, BaseInputSpec, BaseOutputSpec, CommandLineInputSpec, StdOutCommandLineInputSpec, StdOutCommandLineOutputSpec, @@ -89,8 +99,39 @@ def cmdline(self): @provides(IBase) class BaseInterface(HasTraits): - """Implements common interface functionality. + """ + Implements common interface functionality. + + To implement an interface, one should define the input and + output specification types (`_input_spec` and `_output_spec`). + + The input interface will be available in thorugh the `inputs` trait. + The behavior is the same for outputs. + + Examples + -------- + >>> class IfaceAInputSpec(BaseInputSpec): + ... foo = File(exists=True) + ... bar = traits.Int(10, usedefault=True) + ... out_foo = File('out_file.txt', usedefault=True) + + >>> class IfaceAOutputSpec(BaseOutputSpec): + ... out_foo = File(exists=True) + + >>> class IfaceA(BaseInterface): + ... _input_spec = IfaceAInputSpec + ... _output_spec = IfaceAOutputSpec + ... version = 1.0 + + >>> new_a = IfaceA() + >>> new_a.inputs.foo = 'functional.nii' + >>> new_a.inputs.get_traitsfree() + {'foo': 'functional.nii', 'bar': 10, 'out_foo': 'out_file.txt'} + + >>> new_a.run(dry_run=True) # doctest: +SKIP + + """ _additional_metadata = [] _input_spec = BaseInputSpec @@ -98,7 +139,7 @@ class BaseInterface(HasTraits): inputs = Instance(IInputSpec) outputs = Instance(IOutputSpec) - status = traits.Enum('waiting', 'starting', 'running', 'ending', + status = traits.Enum('ready', 'starting', 'running', 'ending', 'errored', 'finished') version = traits.Str redirect_x = traits.Bool @@ -111,7 +152,10 @@ def __init__(self, **inputs): self.inputs.set(**inputs) self.outputs = self._output_spec() - def _run_wrapper(self, runtime): + def _run_wrapper(self, runtime, dry_run=False): + if dry_run: + return runtime + sysdisplay = os.getenv('DISPLAY') if self.redirect_x: try: @@ -138,32 +182,12 @@ def _run_wrapper(self, runtime): IFLOGGER.info('Freeing X :%d', vdisp_num) vdisp.stop() _unlock_display(vdisp_num) - - self._aggregate_outputs() - return runtime - - - def _dry_run(self, runtime, *kwargs): - """ - A fake runner which creates empty files when they do not exist, - but required by the output - - """ - self._aggregate_outputs() - - for name, spec in list(self.outputs.items()): - if spec.exists: - value = getattr(self.outputs, name) - if not op.isfile(value): - with open(value, 'a'): - os.utime(value) return runtime - def _run_interface(self, runtime, *kwargs): - """ Core function that executes interface - """ + def _run_interface(self, runtime, dry_run=False, **kwargs): + """ Core function that executes interface""" raise NotImplementedError('BaseInterface running is disabled.') - + def pre_run(self, **inputs): """ Implementation of the pre-execution hook""" inputs.pop('dry_run', None) # Remove the dry_run key @@ -175,30 +199,45 @@ def post_run(self): """ Implementation of the post-execution hook""" pass - def _aggregate_outputs(self): - # ns_outputs = {} - # for ns_input, ns_spec in list(self.inputs.namesource_items()): - # ns_pointer = getattr(ns_spec, 'out_name', None) - # if ns_pointer is not None: - # ns_outputs[ns_pointer] = ns_input - - # # Search for inputs with the same name - # for out_name, spec in list(self.outputs.items()): - # if out_name in ns_outputs.keys(): - # value = getattr(self.inputs, ns_outputs[out_name], Undefined) - # else: - # value = getattr(self.inputs, out_name, Undefined) - - # if isdefined(value): - # setattr(self.outputs, out_name, op.abspath(value)) - - # # Search for outputs with name source - # for out_name, spec in self.outputs.namesource_items(): - # if isdefined(getattr(self.outputs, out_name)): - # continue - # value = self.outputs.format_ns(spec.name_source, out_name, self.inputs) - # setattr(self.outputs, out_name, value) - pass + def _genfile_dryrun(self, name, value, out_name=None): + if out_name is None: + out_name = name + + exists_list = self.outputs.trait_names(**dict(exists=lambda t: t is not None or t)) + print(exists_list) + + if isinstance(value, string_types): + files = [value] + else: + files = value + + if self.outputs.traits()[out_name].exists: + for fname in files: + _touch_file(fname) + + def _aggregate_outputs(self, dry_run=False): + """ + Anticipates the outputs. If, for some reason, the outputs cannot be + guessed from the inputs and the rules inside this method, + use :member:`nipype.interfaces.base.IBase.post_run()` to specify + these outputs + """ + outputs = [k[0] for k in list(self.outputs.items())] + for name, value, spec in self.inputs.get_defined(): + # Rule #1: outputs with a corresponding input (same name) are + # automatically copied. + if name in outputs: + if dry_run: + self._genfile_dryrun(name, value) + setattr(self.outputs, name, value) + + # Rule #2: boolean inputs that start with save_ automatically + # enable the corresponding out_ and vice-versa + if name.startswith('save_') and isinstance(value, bool): + out_name = 'out_' + name[5:] + if not value and out_name in outputs: + setattr(self.outputs, Undefined) + def run(self, dry_run=False, **inputs): """Basic implementation of the interface runner""" @@ -213,10 +252,7 @@ def run(self, dry_run=False, **inputs): self.status = 'running' exception = None try: - if not dry_run: - runtime = self._run_wrapper(runtime) - else: - runtime = self._dry_run(runtime) + runtime = self._run_wrapper(runtime, dry_run) except Exception as error: # pylint: disable=W0703 runtime, exception = self.handle_error(runtime, error) if not self.ignore_exception: @@ -231,6 +267,7 @@ def run(self, dry_run=False, **inputs): if exception is None: self.status = 'ending' + self._aggregate_outputs(dry_run=dry_run) self.post_run() results.outputs = self.outputs @@ -378,10 +415,6 @@ def cmdline(self): self.inputs.check_inputs() return ' '.join([self.command] + self.inputs.parse_args()) - def _run_wrapper(self, runtime): - runtime = self._run_interface(runtime) - return runtime - def _run_interface(self, runtime, **kwargs): """Execute command via subprocess @@ -496,6 +529,11 @@ def post_run(self): else: setattr(self.outputs, name, op.abspath(corresponding_input)) +def _touch_file(filename): + if not op.isfile(filename): + with open(filename, 'a'): + os.utime(filename, None) + def _unlock_display(ndisplay): lockf = op.join('/tmp', '.X%d-lock' % ndisplay) try: diff --git a/nipype/interfaces/base/specs.py b/nipype/interfaces/base/specs.py index 6e51a156b3..911438a5a6 100644 --- a/nipype/interfaces/base/specs.py +++ b/nipype/interfaces/base/specs.py @@ -52,6 +52,9 @@ def get(self, **kwargs): def get_traitsfree(self, **kwargs): """ Returns traited class as a dict without traits""" + def get_defined(self): + """ Returns the traits that have been set""" + @classmethod def help(cls): """Print help of these traits""" @@ -91,11 +94,17 @@ def __repr__(self): return '\n' + '\n'.join(outstr) + '\n' def items(self): - """ Name, trait generator for user modifiable traits - """ + """ Name, trait generator for user modifiable traits""" for name in sorted(self.copyable_trait_names()): yield name, self.traits()[name] + def get_defined(self): + """ Trait generator for modified traits by user""" + for name in sorted(self.copyable_trait_names()): + value = getattr(self, name) + if isdefined(value): + yield name, value, self.traits()[name] + @classmethod def help(cls): """Print help of these traits""" diff --git a/nipype/interfaces/base/traits_extension.py b/nipype/interfaces/base/traits_extension.py index 910f2843bc..2758151715 100644 --- a/nipype/interfaces/base/traits_extension.py +++ b/nipype/interfaces/base/traits_extension.py @@ -24,6 +24,7 @@ if traits.__version__ < '3.7.0': raise ImportError('Traits version 3.7.0 or higher must be installed') import traits.api as traits +from traits.trait_types import BaseFile, File, BaseStr, ListStr, Directory from traits.trait_handlers import TraitDictObject, TraitListObject from traits.trait_errors import TraitError from traits.trait_base import _Undefined @@ -34,7 +35,7 @@ IFLOGGER = logging.getLogger('interface') -class BaseFile (traits.BaseStr): +class BaseFile(traits.BaseStr): """ Defines a trait whose value must be the name of a file. """ @@ -42,7 +43,7 @@ class BaseFile (traits.BaseStr): info_text = 'a file name' def __init__(self, value='', filter=None, auto_set=False, - entries=0, exists=False, **metadata): + entries=0, **metadata): """ Creates a File trait. Parameters @@ -66,9 +67,12 @@ def __init__(self, value='', filter=None, auto_set=False, self.filter = filter self.auto_set = auto_set self.entries = entries - self.exists = exists - if exists: + # Fix: get exists through metadata. Otherwise it won't be + # available to be queried + self.exists = metadata.get('exists', False) + + if self.exists: self.info_text = 'an existing file name' super(BaseFile, self).__init__(value, **metadata) @@ -83,17 +87,16 @@ def validate(self, obj, name, value): return validated_value elif op.isfile(value): return validated_value - self.error(obj, name, value) -class File (BaseFile): +class File(BaseFile): """ Defines a trait whose value must be the name of a file using a C-level fast validator. """ def __init__(self, value='', filter=None, auto_set=False, - entries=0, exists=False, **metadata): + entries=0, **metadata): """ Creates a File trait. Parameters @@ -114,12 +117,12 @@ def __init__(self, value='', filter=None, auto_set=False, ------------- *value* or '' """ + exists = metadata.get('exists', False) if not exists: # Define the C-level fast validator to use: fast_validate = (11, str) - super(File, self).__init__(value, filter, auto_set, entries, exists, - **metadata) + super(File, self).__init__(value, filter, auto_set, entries, **metadata) class GenFile(File): @@ -159,8 +162,7 @@ class GenFile(File): """ - def __init__(self, template=None, keep_extension=False, value='', - filter=None, auto_set=False, entries=0, exists=False, **metadata): + def __init__(self, value='', template=None, **metadata): """ Creates a GenFile trait. """ if template is None or not isinstance(template, string_types): @@ -173,9 +175,9 @@ def __init__(self, template=None, keep_extension=False, value='', template = template.replace(itoken, '') self.template = template - self.keep_ext = keep_extension - super(GenFile, self).__init__(value, filter, auto_set, entries, exists, - **metadata) + self.keep_ext = metadata.get('keep_extension', False) + self.exists = metadata.get('exists', False) + super(GenFile, self).__init__(value, **metadata) def validate(self, obj, name, value): @@ -264,7 +266,7 @@ def set(self, obj, name, value): self.set_value(obj, name, value) -class MultiPath(traits.List): +class MultiPath(ListStr): """ Abstract class - shared functionality of input and output MultiPath """ @@ -277,7 +279,7 @@ def validate(self, obj, name, value): if not isinstance(value, list) \ or (self.inner_traits() and isinstance(self.inner_traits()[0].trait_type, - traits.List) and not + ListStr) and not isinstance(self.inner_traits()[0].trait_type, InputMultiPath) and isinstance(value, list) and @@ -292,7 +294,7 @@ def validate(self, obj, name, value): self.error(obj, name, value) -class GenMultiFile(traits.List): +class GenMultiFile(ListStr): """ Traits to generate lists of files. >>> # The traits start undefined @@ -392,7 +394,7 @@ def validate(self, obj, name, value): if not isinstance(value, list) \ or (self.inner_traits() and isinstance(self.inner_traits()[0].trait_type, - traits.List) and not + ListStr) and not isinstance(self.inner_traits()[0].trait_type, InputMultiPath) and isinstance(value, list) and @@ -580,89 +582,90 @@ class InputMultiPath(MultiPath): # ------------------------------------------------------------------------------- -class BaseDirectory (traits.BaseStr): - """ Defines a trait whose value must be the name of a directory. - """ - - # A description of the type of value this trait accepts: - info_text = 'a directory name' - - def __init__(self, value='', auto_set=False, entries=0, - exists=False, **metadata): - """ Creates a BaseDirectory trait. - - Parameters - ---------- - value : string - The default value for the trait - auto_set : boolean - Indicates whether the directory editor updates the trait value - after every key stroke. - exists : boolean - Indicates whether the trait value must be an existing directory or - not. - - Default Value - ------------- - *value* or '' - """ - self.entries = entries - self.auto_set = auto_set - self.exists = exists - - if exists: - self.info_text = 'an existing directory name' - - super(BaseDirectory, self).__init__(value, **metadata) - - def validate(self, obj, name, value): - """ Validates that a specified value is valid for this trait. - - Note: The 'fast validator' version performs this check in C. - """ - validated_value = super(BaseDirectory, self).validate(obj, name, value) - if not self.exists: - return validated_value - - if op.isdir(value): - return validated_value - - self.error(obj, name, value) - - -class Directory (BaseDirectory): - """ Defines a trait whose value must be the name of a directory using a - C-level fast validator. - """ - - def __init__(self, value='', auto_set=False, entries=0, - exists=False, **metadata): - """ Creates a Directory trait. - - Parameters - ---------- - value : string - The default value for the trait - auto_set : boolean - Indicates whether the directory editor updates the trait value - after every key stroke. - exists : boolean - Indicates whether the trait value must be an existing directory or - not. - - Default Value - ------------- - *value* or '' - """ - # Define the C-level fast validator to use if the directory existence - # test is not required: - if not exists: - self.fast_validate = (11, str) - - super(Directory, self).__init__(value, auto_set, entries, exists, - **metadata) - -class Command(traits.BaseStr): +# class BaseDirectory (traits.BaseStr): +# """ Defines a trait whose value must be the name of a directory. +# """ + +# # A description of the type of value this trait accepts: +# info_text = 'a directory name' + +# def __init__(self, value='', auto_set=False, entries=0, +# exists=False, **metadata): +# """ Creates a BaseDirectory trait. + +# Parameters +# ---------- +# value : string +# The default value for the trait +# auto_set : boolean +# Indicates whether the directory editor updates the trait value +# after every key stroke. +# exists : boolean +# Indicates whether the trait value must be an existing directory or +# not. + +# Default Value +# ------------- +# *value* or '' + +# """ +# self.entries = entries +# self.auto_set = auto_set +# self.exists = exists + +# if exists: +# self.info_text = 'an existing directory name' + +# super(BaseDirectory, self).__init__(value, **metadata) + +# def validate(self, obj, name, value): +# """ Validates that a specified value is valid for this trait. + +# Note: The 'fast validator' version performs this check in C. +# """ +# validated_value = super(BaseDirectory, self).validate(obj, name, value) +# if not self.exists: +# return validated_value + +# if op.isdir(value): +# return validated_value + +# self.error(obj, name, value) + + +# class Directory (BaseDirectory): +# """ Defines a trait whose value must be the name of a directory using a +# C-level fast validator. +# """ + +# def __init__(self, value='', auto_set=False, entries=0, +# exists=False, **metadata): +# """ Creates a Directory trait. + +# Parameters +# ---------- +# value : string +# The default value for the trait +# auto_set : boolean +# Indicates whether the directory editor updates the trait value +# after every key stroke. +# exists : boolean +# Indicates whether the trait value must be an existing directory or +# not. + +# Default Value +# ------------- +# *value* or '' +# """ +# # Define the C-level fast validator to use if the directory existence +# # test is not required: +# if not exists: +# self.fast_validate = (11, str) + +# super(Directory, self).__init__(value, auto_set, entries, exists, +# **metadata) + +class Command(BaseStr): """ Defines a trait whose value must be an executable command """ From d58c6a96ccbc6d72aba66ce8636b244afb13b9d5 Mon Sep 17 00:00:00 2001 From: oesteban Date: Mon, 22 Feb 2016 08:16:34 -0800 Subject: [PATCH 64/73] correctly write metadata path on Command traits --- nipype/interfaces/base/interfaces.py | 12 +- nipype/interfaces/base/traits_extension.py | 192 +++++++++++---------- 2 files changed, 104 insertions(+), 100 deletions(-) diff --git a/nipype/interfaces/base/interfaces.py b/nipype/interfaces/base/interfaces.py index 278b7f5e0d..a0529b45e5 100644 --- a/nipype/interfaces/base/interfaces.py +++ b/nipype/interfaces/base/interfaces.py @@ -115,15 +115,15 @@ class BaseInterface(HasTraits): ... foo = File(exists=True) ... bar = traits.Int(10, usedefault=True) ... out_foo = File('out_file.txt', usedefault=True) - + >>> class IfaceAOutputSpec(BaseOutputSpec): ... out_foo = File(exists=True) - + >>> class IfaceA(BaseInterface): ... _input_spec = IfaceAInputSpec ... _output_spec = IfaceAOutputSpec ... version = 1.0 - + >>> new_a = IfaceA() >>> new_a.inputs.foo = 'functional.nii' >>> new_a.inputs.get_traitsfree() @@ -131,7 +131,7 @@ class BaseInterface(HasTraits): >>> new_a.run(dry_run=True) # doctest: +SKIP - + """ _additional_metadata = [] _input_spec = BaseInputSpec @@ -187,7 +187,7 @@ def _run_wrapper(self, runtime, dry_run=False): def _run_interface(self, runtime, dry_run=False, **kwargs): """ Core function that executes interface""" raise NotImplementedError('BaseInterface running is disabled.') - + def pre_run(self, **inputs): """ Implementation of the pre-execution hook""" inputs.pop('dry_run', None) # Remove the dry_run key @@ -205,7 +205,7 @@ def _genfile_dryrun(self, name, value, out_name=None): exists_list = self.outputs.trait_names(**dict(exists=lambda t: t is not None or t)) print(exists_list) - + if isinstance(value, string_types): files = [value] else: diff --git a/nipype/interfaces/base/traits_extension.py b/nipype/interfaces/base/traits_extension.py index 2758151715..6e721577cc 100644 --- a/nipype/interfaces/base/traits_extension.py +++ b/nipype/interfaces/base/traits_extension.py @@ -24,7 +24,6 @@ if traits.__version__ < '3.7.0': raise ImportError('Traits version 3.7.0 or higher must be installed') import traits.api as traits -from traits.trait_types import BaseFile, File, BaseStr, ListStr, Directory from traits.trait_handlers import TraitDictObject, TraitListObject from traits.trait_errors import TraitError from traits.trait_base import _Undefined @@ -90,7 +89,7 @@ def validate(self, obj, name, value): self.error(obj, name, value) -class File(BaseFile): +class File(traits.BaseFile): """ Defines a trait whose value must be the name of a file using a C-level fast validator. """ @@ -227,8 +226,7 @@ def get(self, obj, name): outvals = [] - isfile = obj.trait(nsrc).is_trait_type(( - File, MultiPath, GenMultiFile)) + isfile = obj.trait(nsrc).is_trait_type((File, MultiPath, GenMultiFile)) for val in vallist: if isfile: _, val, ext = split_filename(val) @@ -266,7 +264,7 @@ def set(self, obj, name, value): self.set_value(obj, name, value) -class MultiPath(ListStr): +class MultiPath(traits.List): """ Abstract class - shared functionality of input and output MultiPath """ @@ -279,7 +277,7 @@ def validate(self, obj, name, value): if not isinstance(value, list) \ or (self.inner_traits() and isinstance(self.inner_traits()[0].trait_type, - ListStr) and not + traits.List) and not isinstance(self.inner_traits()[0].trait_type, InputMultiPath) and isinstance(value, list) and @@ -294,7 +292,7 @@ def validate(self, obj, name, value): self.error(obj, name, value) -class GenMultiFile(ListStr): +class GenMultiFile(traits.List): """ Traits to generate lists of files. >>> # The traits start undefined @@ -394,7 +392,7 @@ def validate(self, obj, name, value): if not isinstance(value, list) \ or (self.inner_traits() and isinstance(self.inner_traits()[0].trait_type, - ListStr) and not + traits.List) and not isinstance(self.inner_traits()[0].trait_type, InputMultiPath) and isinstance(value, list) and @@ -582,105 +580,111 @@ class InputMultiPath(MultiPath): # ------------------------------------------------------------------------------- -# class BaseDirectory (traits.BaseStr): -# """ Defines a trait whose value must be the name of a directory. -# """ - -# # A description of the type of value this trait accepts: -# info_text = 'a directory name' - -# def __init__(self, value='', auto_set=False, entries=0, -# exists=False, **metadata): -# """ Creates a BaseDirectory trait. - -# Parameters -# ---------- -# value : string -# The default value for the trait -# auto_set : boolean -# Indicates whether the directory editor updates the trait value -# after every key stroke. -# exists : boolean -# Indicates whether the trait value must be an existing directory or -# not. - -# Default Value -# ------------- -# *value* or '' - -# """ -# self.entries = entries -# self.auto_set = auto_set -# self.exists = exists - -# if exists: -# self.info_text = 'an existing directory name' - -# super(BaseDirectory, self).__init__(value, **metadata) - -# def validate(self, obj, name, value): -# """ Validates that a specified value is valid for this trait. - -# Note: The 'fast validator' version performs this check in C. -# """ -# validated_value = super(BaseDirectory, self).validate(obj, name, value) -# if not self.exists: -# return validated_value - -# if op.isdir(value): -# return validated_value - -# self.error(obj, name, value) - - -# class Directory (BaseDirectory): -# """ Defines a trait whose value must be the name of a directory using a -# C-level fast validator. -# """ - -# def __init__(self, value='', auto_set=False, entries=0, -# exists=False, **metadata): -# """ Creates a Directory trait. - -# Parameters -# ---------- -# value : string -# The default value for the trait -# auto_set : boolean -# Indicates whether the directory editor updates the trait value -# after every key stroke. -# exists : boolean -# Indicates whether the trait value must be an existing directory or -# not. - -# Default Value -# ------------- -# *value* or '' -# """ -# # Define the C-level fast validator to use if the directory existence -# # test is not required: -# if not exists: -# self.fast_validate = (11, str) - -# super(Directory, self).__init__(value, auto_set, entries, exists, -# **metadata) - -class Command(BaseStr): +class BaseDirectory (traits.BaseStr): + """ Defines a trait whose value must be the name of a directory. + """ + + # A description of the type of value this trait accepts: + info_text = 'a directory name' + + def __init__(self, value='', auto_set=False, entries=0, + exists=False, **metadata): + """ Creates a BaseDirectory trait. + + Parameters + ---------- + value : string + The default value for the trait + auto_set : boolean + Indicates whether the directory editor updates the trait value + after every key stroke. + exists : boolean + Indicates whether the trait value must be an existing directory or + not. + + Default Value + ------------- + *value* or '' + + """ + self.entries = entries + self.auto_set = auto_set + self.exists = exists + + if exists: + self.info_text = 'an existing directory name' + + super(BaseDirectory, self).__init__(value, **metadata) + + def validate(self, obj, name, value): + """ Validates that a specified value is valid for this trait. + + Note: The 'fast validator' version performs this check in C. + """ + validated_value = super(BaseDirectory, self).validate(obj, name, value) + if not self.exists: + return validated_value + + if op.isdir(value): + return validated_value + + self.error(obj, name, value) + + +class Directory (BaseDirectory): + """ Defines a trait whose value must be the name of a directory using a + C-level fast validator. + """ + + def __init__(self, value='', auto_set=False, entries=0, + exists=False, **metadata): + """ Creates a Directory trait. + + Parameters + ---------- + value : string + The default value for the trait + auto_set : boolean + Indicates whether the directory editor updates the trait value + after every key stroke. + exists : boolean + Indicates whether the trait value must be an existing directory or + not. + + Default Value + ------------- + *value* or '' + """ + # Define the C-level fast validator to use if the directory existence + # test is not required: + if not exists: + self.fast_validate = (11, str) + + super(Directory, self).__init__(value, auto_set, entries, exists, + **metadata) + +class Command(traits.BaseStr): """ Defines a trait whose value must be an executable command """ # A description of the type of value this trait accepts: info_text = 'an executable file' + def __init__(self, value='', path='', **metadata): + metadata['path'] = path + super(Command, self).__init__(value, **metadata) + + def validate(self, obj, name, value): """ Validates that a specified value is valid for this trait. Note: The 'fast validator' version performs this check in C. """ validated_value = super(Command, self).validate(obj, name, value) - env = obj.environ + env = getattr(obj, 'environ', None) # IFLOGGER.debug('Environ now: %s', env) - valid, _ = _exists_in_path(validated_value.split()[0], env) + valid, path = _exists_in_path(validated_value.split()[0], env) + obj.trait(name).path = path if valid: return validated_value From 7324d87b003f85c418a81bb3e79ee3ce2404fd96 Mon Sep 17 00:00:00 2001 From: oesteban Date: Mon, 22 Feb 2016 08:19:25 -0800 Subject: [PATCH 65/73] add rule 3 to outputs mapping --- nipype/interfaces/base/interfaces.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nipype/interfaces/base/interfaces.py b/nipype/interfaces/base/interfaces.py index a0529b45e5..addefc393d 100644 --- a/nipype/interfaces/base/interfaces.py +++ b/nipype/interfaces/base/interfaces.py @@ -238,6 +238,11 @@ def _aggregate_outputs(self, dry_run=False): if not value and out_name in outputs: setattr(self.outputs, Undefined) + # Rule #3: inputs specifying an output_name metadata will be + # mapped to the corresponding output + if spec.output_name and self.outputs.traits()[spec.output_name]: + setattr(self.outputs, spec.output_name, value) + def run(self, dry_run=False, **inputs): """Basic implementation of the interface runner""" From 1298d2cb070f36c831d6b1c2589defac4aaa559a Mon Sep 17 00:00:00 2001 From: oesteban Date: Mon, 22 Feb 2016 08:43:12 -0800 Subject: [PATCH 66/73] modify CommandLine help, when cmd not set --- nipype/interfaces/base/interfaces.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nipype/interfaces/base/interfaces.py b/nipype/interfaces/base/interfaces.py index addefc393d..02384ff5d1 100644 --- a/nipype/interfaces/base/interfaces.py +++ b/nipype/interfaces/base/interfaces.py @@ -241,6 +241,8 @@ def _aggregate_outputs(self, dry_run=False): # Rule #3: inputs specifying an output_name metadata will be # mapped to the corresponding output if spec.output_name and self.outputs.traits()[spec.output_name]: + if dry_run: + self._genfile_dryrun(name, value) setattr(self.outputs, spec.output_name, value) @@ -462,8 +464,12 @@ def version_from_command(self, flag='-v'): @classmethod def help(cls, returnhelp=False): - allhelp = super(CommandLine, cls).help(returnhelp=True) - allhelp = "Wraps command ``%s``\n\n" % cls._cmd + allhelp + if cls._cmd is not None: + allhelp = 'Wraps the ``%s`` command\n\n' % cls._cmd + else: + allhelp = 'Wraps a system command specified by the ``command`` attribute\n\n' + + allhelp += super(CommandLine, cls).help(returnhelp=True) if returnhelp: return allhelp From 079ed93fd6a55386a2d076e6dc24bbf8512bd521 Mon Sep 17 00:00:00 2001 From: oesteban Date: Mon, 22 Feb 2016 09:01:46 -0800 Subject: [PATCH 67/73] (in|out)put_spec are now private Used the following command line to fix all at once: ``` find . -name '*.py' | xargs perl -pi -e 's/(?>> wp.inputs.warp = 'warpfield.nii' >>> res = wp.run() # doctest: +SKIP """ - input_spec = WarpPointsInputSpec - output_spec = WarpPointsOutputSpec + _input_spec = WarpPointsInputSpec + _output_spec = WarpPointsOutputSpec def _run_interface(self, runtime): import nibabel as nb @@ -175,8 +175,8 @@ class ComputeMeshWarp(TVTKBaseInterface): """ - input_spec = ComputeMeshWarpInputSpec - output_spec = ComputeMeshWarpOutputSpec + _input_spec = ComputeMeshWarpInputSpec + _output_spec = ComputeMeshWarpOutputSpec def _triangle_area(self, A, B, C): A = np.array(A) @@ -307,8 +307,8 @@ class MeshWarpMaths(TVTKBaseInterface): """ - input_spec = MeshWarpMathsInputSpec - output_spec = MeshWarpMathsOutputSpec + _input_spec = MeshWarpMathsInputSpec + _output_spec = MeshWarpMathsOutputSpec def _run_interface(self, runtime): try: diff --git a/nipype/algorithms/metrics.py b/nipype/algorithms/metrics.py index 34aaca242f..95d2db82bf 100644 --- a/nipype/algorithms/metrics.py +++ b/nipype/algorithms/metrics.py @@ -67,8 +67,8 @@ class DistanceOutputSpec(TraitedSpec): class Distance(BaseInterface): """Calculates distance between two volumes. """ - input_spec = DistanceInputSpec - output_spec = DistanceOutputSpec + _input_spec = DistanceInputSpec + _output_spec = DistanceOutputSpec _hist_filename = "hist.pdf" @@ -264,8 +264,8 @@ class Overlap(BaseInterface): >>> res = overlap.run() # doctest: +SKIP """ - input_spec = OverlapInputSpec - output_spec = OverlapOutputSpec + _input_spec = OverlapInputSpec + _output_spec = OverlapOutputSpec def _bool_vec_dissimilarity(self, booldata1, booldata2, method): methods = {'dice': dice, 'jaccard': jaccard} @@ -390,8 +390,8 @@ class FuzzyOverlap(BaseInterface): >>> res = overlap.run() # doctest: +SKIP """ - input_spec = FuzzyOverlapInputSpec - output_spec = FuzzyOverlapOutputSpec + _input_spec = FuzzyOverlapInputSpec + _output_spec = FuzzyOverlapOutputSpec def _run_interface(self, runtime): ncomp = len(self.inputs.in_ref) @@ -483,8 +483,8 @@ class ErrorMap(BaseInterface): >>> errormap.inputs.in_tst = 'cont2.nii' >>> res = errormap.run() # doctest: +SKIP """ - input_spec = ErrorMapInputSpec - output_spec = ErrorMapOutputSpec + _input_spec = ErrorMapInputSpec + _output_spec = ErrorMapOutputSpec _out_file = '' def _run_interface(self, runtime): @@ -588,8 +588,8 @@ class Similarity(BaseInterface): >>> res = similarity.run() # doctest: +SKIP """ - input_spec = SimilarityInputSpec - output_spec = SimilarityOutputSpec + _input_spec = SimilarityInputSpec + _output_spec = SimilarityOutputSpec _have_nipy = True def __init__(self, **inputs): diff --git a/nipype/algorithms/misc.py b/nipype/algorithms/misc.py index 5cb108253b..cf94d5de4b 100644 --- a/nipype/algorithms/misc.py +++ b/nipype/algorithms/misc.py @@ -68,8 +68,8 @@ class PickAtlas(BaseInterface): and left right masking (assuming the atlas is properly aligned). """ - input_spec = PickAtlasInputSpec - output_spec = PickAtlasOutputSpec + _input_spec = PickAtlasInputSpec + _output_spec = PickAtlasOutputSpec def _run_interface(self, runtime): nim = self._get_brodmann_area() @@ -126,8 +126,8 @@ class SimpleThresholdOutputSpec(TraitedSpec): class SimpleThreshold(BaseInterface): """Applies a threshold to input volumes """ - input_spec = SimpleThresholdInputSpec - output_spec = SimpleThresholdOutputSpec + _input_spec = SimpleThresholdInputSpec + _output_spec = SimpleThresholdOutputSpec def _run_interface(self, runtime): for fname, out_name in zip(self.inputs.volumes, self.inputs.thresholded_volumes): @@ -164,8 +164,8 @@ class ModifyAffine(BaseInterface): """Left multiplies the affine matrix with a specified values. Saves the volume as a nifti file. """ - input_spec = ModifyAffineInputSpec - output_spec = ModifyAffineOutputSpec + _input_spec = ModifyAffineInputSpec + _output_spec = ModifyAffineOutputSpec def _run_interface(self, runtime): for fname, out_name in zip(self.inputs.volumes, self.inputs.transformed_volumes): @@ -192,8 +192,8 @@ class CreateNiftiOutputSpec(TraitedSpec): class CreateNifti(BaseInterface): """Creates a nifti volume """ - input_spec = CreateNiftiInputSpec - output_spec = CreateNiftiOutputSpec + _input_spec = CreateNiftiInputSpec + _output_spec = CreateNiftiOutputSpec def _run_interface(self, runtime): hdr = nb.AnalyzeHeader.from_fileobj( @@ -245,8 +245,8 @@ class TSNR(BaseInterface): >>> res = tsnr.run() # doctest: +SKIP """ - input_spec = TSNRInputSpec - output_spec = TSNROutputSpec + _input_spec = TSNRInputSpec + _output_spec = TSNROutputSpec def _run_interface(self, runtime): img = nb.load(self.inputs.in_file[0]) @@ -304,8 +304,8 @@ class GunzipOutputSpec(TraitedSpec): class Gunzip(BaseInterface): """Gunzip wrapper """ - input_spec = GunzipInputSpec - output_spec = GunzipOutputSpec + _input_spec = GunzipInputSpec + _output_spec = GunzipOutputSpec def _run_interface(self, runtime): import gzip @@ -346,8 +346,8 @@ class Matlab2CSV(BaseInterface): >>> mat2csv.inputs.in_file = 'cmatrix.mat' >>> mat2csv.run() # doctest: +SKIP """ - input_spec = Matlab2CSVInputSpec - output_spec = Matlab2CSVOutputSpec + _input_spec = Matlab2CSVInputSpec + _output_spec = Matlab2CSVOutputSpec def _run_interface(self, runtime): in_dict = sio.loadmat(op.abspath(self.inputs.in_file)) @@ -454,8 +454,8 @@ class MergeCSVFiles(BaseInterface): >>> mat2csv.inputs.column_headings = ['degree','clustering'] >>> mat2csv.run() # doctest: +SKIP """ - input_spec = MergeCSVFilesInputSpec - output_spec = MergeCSVFilesOutputSpec + _input_spec = MergeCSVFilesInputSpec + _output_spec = MergeCSVFilesOutputSpec def _run_interface(self, runtime): extraheadingBool = False @@ -575,8 +575,8 @@ class AddCSVColumn(BaseInterface): >>> addcol.inputs.extra_field = 'male' >>> addcol.run() # doctest: +SKIP """ - input_spec = AddCSVColumnInputSpec - output_spec = AddCSVColumnOutputSpec + _input_spec = AddCSVColumnInputSpec + _output_spec = AddCSVColumnOutputSpec def _run_interface(self, runtime): with open(self.inputs.in_file, 'r') as in_file: @@ -636,8 +636,8 @@ class AddCSVRow(BaseInterface): >>> addrow.inputs.list_of_values = [ 0.4, 0.7, 0.3 ] >>> addrow.run() # doctest: +SKIP """ - input_spec = AddCSVRowInputSpec - output_spec = AddCSVRowOutputSpec + _input_spec = AddCSVRowInputSpec + _output_spec = AddCSVRowOutputSpec def __init__(self, infields=None, force_run=True, **kwargs): super(AddCSVRow, self).__init__(**kwargs) @@ -741,8 +741,8 @@ class CalculateNormalizedMoments(BaseInterface): >>> skew.inputs.timeseries_file = 'timeseries.txt' >>> skew.run() # doctest: +SKIP """ - input_spec = CalculateNormalizedMomentsInputSpec - output_spec = CalculateNormalizedMomentsOutputSpec + _input_spec = CalculateNormalizedMomentsInputSpec + _output_spec = CalculateNormalizedMomentsOutputSpec def _run_interface(self, runtime): self.outputs.skewness = calc_moments( @@ -784,8 +784,8 @@ class AddNoise(BaseInterface): >>> noise.run() # doctest: +SKIP """ - input_spec = AddNoiseInputSpec - output_spec = AddNoiseOutputSpec + _input_spec = AddNoiseInputSpec + _output_spec = AddNoiseOutputSpec def _run_interface(self, runtime): in_image = nb.load(self.inputs.in_file) @@ -876,8 +876,8 @@ class NormalizeProbabilityMapSet(BaseInterface): >>> normalize.inputs.in_mask = 'tpms_msk.nii.gz' >>> normalize.run() # doctest: +SKIP """ - input_spec = NormalizeProbabilityMapSetInputSpec - output_spec = NormalizeProbabilityMapSetOutputSpec + _input_spec = NormalizeProbabilityMapSetInputSpec + _output_spec = NormalizeProbabilityMapSetOutputSpec def _run_interface(self, runtime): mask = None @@ -916,8 +916,8 @@ class SplitROIs(BaseInterface): >>> rois.run() # doctest: +SKIP """ - input_spec = SplitROIsInputSpec - output_spec = SplitROIsOutputSpec + _input_spec = SplitROIsInputSpec + _output_spec = SplitROIsOutputSpec def _run_interface(self, runtime): mask = None @@ -964,8 +964,8 @@ class MergeROIs(BaseInterface): >>> rois.run() # doctest: +SKIP """ - input_spec = MergeROIsInputSpec - output_spec = MergeROIsOutputSpec + _input_spec = MergeROIsInputSpec + _output_spec = MergeROIsOutputSpec def _run_interface(self, runtime): self.outputs.merged_file = merge_rois( diff --git a/nipype/algorithms/modelgen.py b/nipype/algorithms/modelgen.py index 03ce6b54ce..96101df591 100644 --- a/nipype/algorithms/modelgen.py +++ b/nipype/algorithms/modelgen.py @@ -281,8 +281,8 @@ class SpecifyModel(BaseInterface): >>> s.inputs.subject_info = info """ - input_spec = SpecifyModelInputSpec - output_spec = SpecifyModelOutputSpec + _input_spec = SpecifyModelInputSpec + _output_spec = SpecifyModelOutputSpec def _generate_standard_design(self, infolist, functional_runs=None, @@ -446,7 +446,7 @@ class SpecifySPMModel(SpecifyModel): """ - input_spec = SpecifySPMModelInputSpec + _input_spec = SpecifySPMModelInputSpec def _concatenate_info(self, infolist): nscans = [] @@ -608,8 +608,8 @@ class SpecifySparseModel(SpecifyModel): >>> s.inputs.subject_info = info """ - input_spec = SpecifySparseModelInputSpec - output_spec = SpecifySparseModelOutputSpec + _input_spec = SpecifySparseModelInputSpec + _output_spec = SpecifySparseModelOutputSpec def _gen_regress(self, i_onsets, i_durations, i_amplitudes, nscans): """Generates a regressor for a sparse/clustered-sparse acquisition diff --git a/nipype/algorithms/rapidart.py b/nipype/algorithms/rapidart.py index e3cb4768d5..3a08f61c50 100644 --- a/nipype/algorithms/rapidart.py +++ b/nipype/algorithms/rapidart.py @@ -151,8 +151,8 @@ class ArtifactDetect(BaseInterface): >>> ad.run() # doctest: +SKIP """ - input_spec = ArtifactDetectInputSpec - output_spec = ArtifactDetectOutputSpec + _input_spec = ArtifactDetectInputSpec + _output_spec = ArtifactDetectOutputSpec def __init__(self, **inputs): super(ArtifactDetect, self).__init__(**inputs) @@ -466,8 +466,8 @@ class StimulusCorrelation(BaseInterface): """ - input_spec = StimCorrInputSpec - output_spec = StimCorrOutputSpec + _input_spec = StimCorrInputSpec + _output_spec = StimCorrOutputSpec def _stimcorr_core(self, motionfile, intensityfile, corrfile, designmatrix): """ diff --git a/nipype/algorithms/tests/test_auto_AddCSVColumn.py b/nipype/algorithms/tests/test_auto_AddCSVColumn.py index 1cf26d7c2b..0a00920bb5 100644 --- a/nipype/algorithms/tests/test_auto_AddCSVColumn.py +++ b/nipype/algorithms/tests/test_auto_AddCSVColumn.py @@ -12,7 +12,7 @@ def test_AddCSVColumn_inputs(): output_name='csv_file', ), ) - inputs = AddCSVColumn.input_spec() + inputs = AddCSVColumn._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -22,7 +22,7 @@ def test_AddCSVColumn_inputs(): def test_AddCSVColumn_outputs(): output_map = dict(csv_file=dict(), ) - outputs = AddCSVColumn.output_spec() + outputs = AddCSVColumn._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/algorithms/tests/test_auto_AddCSVRow.py b/nipype/algorithms/tests/test_auto_AddCSVRow.py index eaac3370c9..e4e161a844 100644 --- a/nipype/algorithms/tests/test_auto_AddCSVRow.py +++ b/nipype/algorithms/tests/test_auto_AddCSVRow.py @@ -12,7 +12,7 @@ def test_AddCSVRow_inputs(): in_file=dict(mandatory=True, ), ) - inputs = AddCSVRow.input_spec() + inputs = AddCSVRow._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -22,7 +22,7 @@ def test_AddCSVRow_inputs(): def test_AddCSVRow_outputs(): output_map = dict(csv_file=dict(), ) - outputs = AddCSVRow.output_spec() + outputs = AddCSVRow._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/algorithms/tests/test_auto_AddNoise.py b/nipype/algorithms/tests/test_auto_AddNoise.py index 0dc3fcabcc..60138c1b15 100644 --- a/nipype/algorithms/tests/test_auto_AddNoise.py +++ b/nipype/algorithms/tests/test_auto_AddNoise.py @@ -18,7 +18,7 @@ def test_AddNoise_inputs(): snr=dict(usedefault=True, ), ) - inputs = AddNoise.input_spec() + inputs = AddNoise._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -28,7 +28,7 @@ def test_AddNoise_inputs(): def test_AddNoise_outputs(): output_map = dict(out_file=dict(), ) - outputs = AddNoise.output_spec() + outputs = AddNoise._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/algorithms/tests/test_auto_ArtifactDetect.py b/nipype/algorithms/tests/test_auto_ArtifactDetect.py index 961b7dd2d0..7ddd3f089d 100644 --- a/nipype/algorithms/tests/test_auto_ArtifactDetect.py +++ b/nipype/algorithms/tests/test_auto_ArtifactDetect.py @@ -45,7 +45,7 @@ def test_ArtifactDetect_inputs(): zintensity_threshold=dict(mandatory=True, ), ) - inputs = ArtifactDetect.input_spec() + inputs = ArtifactDetect._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -61,7 +61,7 @@ def test_ArtifactDetect_outputs(): plot_files=dict(), statistic_files=dict(), ) - outputs = ArtifactDetect.output_spec() + outputs = ArtifactDetect._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/algorithms/tests/test_auto_CalculateNormalizedMoments.py b/nipype/algorithms/tests/test_auto_CalculateNormalizedMoments.py index 62a7b67b0c..e7cc5d3a58 100644 --- a/nipype/algorithms/tests/test_auto_CalculateNormalizedMoments.py +++ b/nipype/algorithms/tests/test_auto_CalculateNormalizedMoments.py @@ -9,7 +9,7 @@ def test_CalculateNormalizedMoments_inputs(): timeseries_file=dict(mandatory=True, ), ) - inputs = CalculateNormalizedMoments.input_spec() + inputs = CalculateNormalizedMoments._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -19,7 +19,7 @@ def test_CalculateNormalizedMoments_inputs(): def test_CalculateNormalizedMoments_outputs(): output_map = dict(moments=dict(), ) - outputs = CalculateNormalizedMoments.output_spec() + outputs = CalculateNormalizedMoments._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/algorithms/tests/test_auto_ComputeMeshWarp.py b/nipype/algorithms/tests/test_auto_ComputeMeshWarp.py index 8039868765..1a6503c24a 100644 --- a/nipype/algorithms/tests/test_auto_ComputeMeshWarp.py +++ b/nipype/algorithms/tests/test_auto_ComputeMeshWarp.py @@ -17,7 +17,7 @@ def test_ComputeMeshWarp_inputs(): weighting=dict(usedefault=True, ), ) - inputs = ComputeMeshWarp.input_spec() + inputs = ComputeMeshWarp._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -29,7 +29,7 @@ def test_ComputeMeshWarp_outputs(): out_file=dict(), out_warp=dict(), ) - outputs = ComputeMeshWarp.output_spec() + outputs = ComputeMeshWarp._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/algorithms/tests/test_auto_CreateNifti.py b/nipype/algorithms/tests/test_auto_CreateNifti.py index ce76d6e26d..a478c56048 100644 --- a/nipype/algorithms/tests/test_auto_CreateNifti.py +++ b/nipype/algorithms/tests/test_auto_CreateNifti.py @@ -15,7 +15,7 @@ def test_CreateNifti_inputs(): nifti_file=dict(ns='data_file', ), ) - inputs = CreateNifti.input_spec() + inputs = CreateNifti._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -25,7 +25,7 @@ def test_CreateNifti_inputs(): def test_CreateNifti_outputs(): output_map = dict(nifti_file=dict(), ) - outputs = CreateNifti.output_spec() + outputs = CreateNifti._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/algorithms/tests/test_auto_Distance.py b/nipype/algorithms/tests/test_auto_Distance.py index 4e5da64ba9..61c9a74a58 100644 --- a/nipype/algorithms/tests/test_auto_Distance.py +++ b/nipype/algorithms/tests/test_auto_Distance.py @@ -15,7 +15,7 @@ def test_Distance_inputs(): volume2=dict(mandatory=True, ), ) - inputs = Distance.input_spec() + inputs = Distance._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -28,7 +28,7 @@ def test_Distance_outputs(): point1=dict(), point2=dict(), ) - outputs = Distance.output_spec() + outputs = Distance._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/algorithms/tests/test_auto_FuzzyOverlap.py b/nipype/algorithms/tests/test_auto_FuzzyOverlap.py index dbc0c02474..f4bac5fdb3 100644 --- a/nipype/algorithms/tests/test_auto_FuzzyOverlap.py +++ b/nipype/algorithms/tests/test_auto_FuzzyOverlap.py @@ -16,7 +16,7 @@ def test_FuzzyOverlap_inputs(): weighting=dict(usedefault=True, ), ) - inputs = FuzzyOverlap.input_spec() + inputs = FuzzyOverlap._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -30,7 +30,7 @@ def test_FuzzyOverlap_outputs(): diff_file=dict(), jaccard=dict(), ) - outputs = FuzzyOverlap.output_spec() + outputs = FuzzyOverlap._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/algorithms/tests/test_auto_Gunzip.py b/nipype/algorithms/tests/test_auto_Gunzip.py index 35e4572913..03e3ca1a00 100644 --- a/nipype/algorithms/tests/test_auto_Gunzip.py +++ b/nipype/algorithms/tests/test_auto_Gunzip.py @@ -13,7 +13,7 @@ def test_Gunzip_inputs(): ns='in_file', ), ) - inputs = Gunzip.input_spec() + inputs = Gunzip._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -23,7 +23,7 @@ def test_Gunzip_inputs(): def test_Gunzip_outputs(): output_map = dict(out_file=dict(), ) - outputs = Gunzip.output_spec() + outputs = Gunzip._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/algorithms/tests/test_auto_ICC.py b/nipype/algorithms/tests/test_auto_ICC.py index 6cbd23b27e..7671b85d96 100644 --- a/nipype/algorithms/tests/test_auto_ICC.py +++ b/nipype/algorithms/tests/test_auto_ICC.py @@ -13,7 +13,7 @@ def test_ICC_inputs(): subjects_sessions=dict(mandatory=True, ), ) - inputs = ICC.input_spec() + inputs = ICC._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -26,7 +26,7 @@ def test_ICC_outputs(): session_var_map=dict(), subject_var_map=dict(), ) - outputs = ICC.output_spec() + outputs = ICC._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/algorithms/tests/test_auto_Matlab2CSV.py b/nipype/algorithms/tests/test_auto_Matlab2CSV.py index 1382385dc3..79664ea725 100644 --- a/nipype/algorithms/tests/test_auto_Matlab2CSV.py +++ b/nipype/algorithms/tests/test_auto_Matlab2CSV.py @@ -9,7 +9,7 @@ def test_Matlab2CSV_inputs(): reshape_matrix=dict(usedefault=True, ), ) - inputs = Matlab2CSV.input_spec() + inputs = Matlab2CSV._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -19,7 +19,7 @@ def test_Matlab2CSV_inputs(): def test_Matlab2CSV_outputs(): output_map = dict(csv_files=dict(), ) - outputs = Matlab2CSV.output_spec() + outputs = Matlab2CSV._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/algorithms/tests/test_auto_MergeCSVFiles.py b/nipype/algorithms/tests/test_auto_MergeCSVFiles.py index 4d2d896db3..5b8530f627 100644 --- a/nipype/algorithms/tests/test_auto_MergeCSVFiles.py +++ b/nipype/algorithms/tests/test_auto_MergeCSVFiles.py @@ -15,7 +15,7 @@ def test_MergeCSVFiles_inputs(): ), row_headings=dict(), ) - inputs = MergeCSVFiles.input_spec() + inputs = MergeCSVFiles._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -25,7 +25,7 @@ def test_MergeCSVFiles_inputs(): def test_MergeCSVFiles_outputs(): output_map = dict(csv_file=dict(), ) - outputs = MergeCSVFiles.output_spec() + outputs = MergeCSVFiles._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/algorithms/tests/test_auto_MergeROIs.py b/nipype/algorithms/tests/test_auto_MergeROIs.py index 83eed3a4d4..46564d63d5 100644 --- a/nipype/algorithms/tests/test_auto_MergeROIs.py +++ b/nipype/algorithms/tests/test_auto_MergeROIs.py @@ -8,7 +8,7 @@ def test_MergeROIs_inputs(): in_index=dict(), in_reference=dict(), ) - inputs = MergeROIs.input_spec() + inputs = MergeROIs._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -18,7 +18,7 @@ def test_MergeROIs_inputs(): def test_MergeROIs_outputs(): output_map = dict(merged_file=dict(), ) - outputs = MergeROIs.output_spec() + outputs = MergeROIs._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/algorithms/tests/test_auto_MeshWarpMaths.py b/nipype/algorithms/tests/test_auto_MeshWarpMaths.py index 4e56879147..dd366adc24 100644 --- a/nipype/algorithms/tests/test_auto_MeshWarpMaths.py +++ b/nipype/algorithms/tests/test_auto_MeshWarpMaths.py @@ -16,7 +16,7 @@ def test_MeshWarpMaths_inputs(): ), out_warp=dict(), ) - inputs = MeshWarpMaths.input_spec() + inputs = MeshWarpMaths._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -27,7 +27,7 @@ def test_MeshWarpMaths_outputs(): output_map = dict(out_file=dict(), out_warp=dict(), ) - outputs = MeshWarpMaths.output_spec() + outputs = MeshWarpMaths._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/algorithms/tests/test_auto_ModifyAffine.py b/nipype/algorithms/tests/test_auto_ModifyAffine.py index 1d16433b83..aa54fe09ab 100644 --- a/nipype/algorithms/tests/test_auto_ModifyAffine.py +++ b/nipype/algorithms/tests/test_auto_ModifyAffine.py @@ -13,7 +13,7 @@ def test_ModifyAffine_inputs(): volumes=dict(mandatory=True, ), ) - inputs = ModifyAffine.input_spec() + inputs = ModifyAffine._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -23,7 +23,7 @@ def test_ModifyAffine_inputs(): def test_ModifyAffine_outputs(): output_map = dict(transformed_volumes=dict(), ) - outputs = ModifyAffine.output_spec() + outputs = ModifyAffine._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/algorithms/tests/test_auto_NormalizeProbabilityMapSet.py b/nipype/algorithms/tests/test_auto_NormalizeProbabilityMapSet.py index 66382d723c..09812d3e44 100644 --- a/nipype/algorithms/tests/test_auto_NormalizeProbabilityMapSet.py +++ b/nipype/algorithms/tests/test_auto_NormalizeProbabilityMapSet.py @@ -8,7 +8,7 @@ def test_NormalizeProbabilityMapSet_inputs(): in_mask=dict(), out_files=dict(), ) - inputs = NormalizeProbabilityMapSet.input_spec() + inputs = NormalizeProbabilityMapSet._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -18,7 +18,7 @@ def test_NormalizeProbabilityMapSet_inputs(): def test_NormalizeProbabilityMapSet_outputs(): output_map = dict(out_files=dict(), ) - outputs = NormalizeProbabilityMapSet.output_spec() + outputs = NormalizeProbabilityMapSet._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/algorithms/tests/test_auto_P2PDistance.py b/nipype/algorithms/tests/test_auto_P2PDistance.py index 2cca025b72..59b8753ae2 100644 --- a/nipype/algorithms/tests/test_auto_P2PDistance.py +++ b/nipype/algorithms/tests/test_auto_P2PDistance.py @@ -17,7 +17,7 @@ def test_P2PDistance_inputs(): weighting=dict(usedefault=True, ), ) - inputs = P2PDistance.input_spec() + inputs = P2PDistance._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -29,7 +29,7 @@ def test_P2PDistance_outputs(): out_file=dict(), out_warp=dict(), ) - outputs = P2PDistance.output_spec() + outputs = P2PDistance._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/algorithms/tests/test_auto_PickAtlas.py b/nipype/algorithms/tests/test_auto_PickAtlas.py index c4db574d2a..cc8cfd30cc 100644 --- a/nipype/algorithms/tests/test_auto_PickAtlas.py +++ b/nipype/algorithms/tests/test_auto_PickAtlas.py @@ -21,7 +21,7 @@ def test_PickAtlas_inputs(): new_name='mask_file', ), ) - inputs = PickAtlas.input_spec() + inputs = PickAtlas._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -31,7 +31,7 @@ def test_PickAtlas_inputs(): def test_PickAtlas_outputs(): output_map = dict(mask_file=dict(), ) - outputs = PickAtlas.output_spec() + outputs = PickAtlas._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/algorithms/tests/test_auto_Similarity.py b/nipype/algorithms/tests/test_auto_Similarity.py index 109933677c..9f3c4742c9 100644 --- a/nipype/algorithms/tests/test_auto_Similarity.py +++ b/nipype/algorithms/tests/test_auto_Similarity.py @@ -16,7 +16,7 @@ def test_Similarity_inputs(): volume2=dict(mandatory=True, ), ) - inputs = Similarity.input_spec() + inputs = Similarity._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -26,7 +26,7 @@ def test_Similarity_inputs(): def test_Similarity_outputs(): output_map = dict(similarity=dict(), ) - outputs = Similarity.output_spec() + outputs = Similarity._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/algorithms/tests/test_auto_SimpleThreshold.py b/nipype/algorithms/tests/test_auto_SimpleThreshold.py index f2ab4fa0c6..b79c578195 100644 --- a/nipype/algorithms/tests/test_auto_SimpleThreshold.py +++ b/nipype/algorithms/tests/test_auto_SimpleThreshold.py @@ -13,7 +13,7 @@ def test_SimpleThreshold_inputs(): volumes=dict(mandatory=True, ), ) - inputs = SimpleThreshold.input_spec() + inputs = SimpleThreshold._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -23,7 +23,7 @@ def test_SimpleThreshold_inputs(): def test_SimpleThreshold_outputs(): output_map = dict(thresholded_volumes=dict(), ) - outputs = SimpleThreshold.output_spec() + outputs = SimpleThreshold._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/algorithms/tests/test_auto_SpecifyModel.py b/nipype/algorithms/tests/test_auto_SpecifyModel.py index 69a528c3c2..fe6687c1ab 100644 --- a/nipype/algorithms/tests/test_auto_SpecifyModel.py +++ b/nipype/algorithms/tests/test_auto_SpecifyModel.py @@ -27,7 +27,7 @@ def test_SpecifyModel_inputs(): time_repetition=dict(mandatory=True, ), ) - inputs = SpecifyModel.input_spec() + inputs = SpecifyModel._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -37,7 +37,7 @@ def test_SpecifyModel_inputs(): def test_SpecifyModel_outputs(): output_map = dict(session_info=dict(), ) - outputs = SpecifyModel.output_spec() + outputs = SpecifyModel._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/algorithms/tests/test_auto_SpecifySPMModel.py b/nipype/algorithms/tests/test_auto_SpecifySPMModel.py index 19ccaa9ba5..66d8b2619a 100644 --- a/nipype/algorithms/tests/test_auto_SpecifySPMModel.py +++ b/nipype/algorithms/tests/test_auto_SpecifySPMModel.py @@ -31,7 +31,7 @@ def test_SpecifySPMModel_inputs(): time_repetition=dict(mandatory=True, ), ) - inputs = SpecifySPMModel.input_spec() + inputs = SpecifySPMModel._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -41,7 +41,7 @@ def test_SpecifySPMModel_inputs(): def test_SpecifySPMModel_outputs(): output_map = dict(session_info=dict(), ) - outputs = SpecifySPMModel.output_spec() + outputs = SpecifySPMModel._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/algorithms/tests/test_auto_SpecifySparseModel.py b/nipype/algorithms/tests/test_auto_SpecifySparseModel.py index 873c2c5e41..878d17a475 100644 --- a/nipype/algorithms/tests/test_auto_SpecifySparseModel.py +++ b/nipype/algorithms/tests/test_auto_SpecifySparseModel.py @@ -44,7 +44,7 @@ def test_SpecifySparseModel_inputs(): volumes_in_cluster=dict(usedefault=True, ), ) - inputs = SpecifySparseModel.input_spec() + inputs = SpecifySparseModel._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -56,7 +56,7 @@ def test_SpecifySparseModel_outputs(): sparse_png_file=dict(), sparse_svg_file=dict(), ) - outputs = SpecifySparseModel.output_spec() + outputs = SpecifySparseModel._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/algorithms/tests/test_auto_SplitROIs.py b/nipype/algorithms/tests/test_auto_SplitROIs.py index cd23a51468..80e45a9e54 100644 --- a/nipype/algorithms/tests/test_auto_SplitROIs.py +++ b/nipype/algorithms/tests/test_auto_SplitROIs.py @@ -9,7 +9,7 @@ def test_SplitROIs_inputs(): in_mask=dict(), roi_size=dict(), ) - inputs = SplitROIs.input_spec() + inputs = SplitROIs._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -21,7 +21,7 @@ def test_SplitROIs_outputs(): out_index=dict(), out_masks=dict(), ) - outputs = SplitROIs.output_spec() + outputs = SplitROIs._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/algorithms/tests/test_auto_StimulusCorrelation.py b/nipype/algorithms/tests/test_auto_StimulusCorrelation.py index e806c3ee88..2a799ef61a 100644 --- a/nipype/algorithms/tests/test_auto_StimulusCorrelation.py +++ b/nipype/algorithms/tests/test_auto_StimulusCorrelation.py @@ -17,7 +17,7 @@ def test_StimulusCorrelation_inputs(): ), stimcorr_files=dict(), ) - inputs = StimulusCorrelation.input_spec() + inputs = StimulusCorrelation._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -27,7 +27,7 @@ def test_StimulusCorrelation_inputs(): def test_StimulusCorrelation_outputs(): output_map = dict(stimcorr_files=dict(), ) - outputs = StimulusCorrelation.output_spec() + outputs = StimulusCorrelation._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/algorithms/tests/test_auto_TSNR.py b/nipype/algorithms/tests/test_auto_TSNR.py index 9cec72a0ca..21880171ab 100644 --- a/nipype/algorithms/tests/test_auto_TSNR.py +++ b/nipype/algorithms/tests/test_auto_TSNR.py @@ -23,7 +23,7 @@ def test_TSNR_inputs(): ns='in_file', ), ) - inputs = TSNR.input_spec() + inputs = TSNR._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -36,7 +36,7 @@ def test_TSNR_outputs(): stddev_file=dict(), tsnr_file=dict(), ) - outputs = TSNR.output_spec() + outputs = TSNR._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/algorithms/tests/test_auto_WarpPoints.py b/nipype/algorithms/tests/test_auto_WarpPoints.py index 554bc8cdfb..d0316c1af8 100644 --- a/nipype/algorithms/tests/test_auto_WarpPoints.py +++ b/nipype/algorithms/tests/test_auto_WarpPoints.py @@ -16,7 +16,7 @@ def test_WarpPoints_inputs(): warp=dict(mandatory=True, ), ) - inputs = WarpPoints.input_spec() + inputs = WarpPoints._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -26,7 +26,7 @@ def test_WarpPoints_inputs(): def test_WarpPoints_outputs(): output_map = dict(out_points=dict(), ) - outputs = WarpPoints.output_spec() + outputs = WarpPoints._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/base.py b/nipype/interfaces/afni/base.py index 1f1fb48474..011a5d9095 100644 --- a/nipype/interfaces/afni/base.py +++ b/nipype/interfaces/afni/base.py @@ -93,7 +93,7 @@ class AFNICommandOutputSpec(TraitedSpec): class AFNICommand(AFNICommandBase): """Shared options for several AFNI commands """ - input_spec = AFNICommandInputSpec + _input_spec = AFNICommandInputSpec def no_afni(): """ Checks if AFNI is available """ diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index 051a38c150..04b14140eb 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -76,8 +76,8 @@ class To3D(AFNICommand): """ _cmd = 'to3d' - input_spec = To3DInputSpec - output_spec = AFNICommandOutputSpec + _input_spec = To3DInputSpec + _output_spec = AFNICommandOutputSpec class TShiftInputSpec(AFNICommandInputSpec): @@ -126,8 +126,8 @@ class TShift(AFNICommand): """ _cmd = '3dTshift' - input_spec = TShiftInputSpec - output_spec = AFNICommandOutputSpec + _input_spec = TShiftInputSpec + _output_spec = AFNICommandOutputSpec class RefitInputSpec(AFNICommandInputSpec): @@ -171,8 +171,8 @@ class Refit(AFNICommandBase): """ _cmd = '3drefit' - input_spec = RefitInputSpec - output_spec = RefitOutputSpec + _input_spec = RefitInputSpec + _output_spec = RefitOutputSpec class WarpInputSpec(AFNICommandInputSpec): @@ -223,8 +223,8 @@ class Warp(AFNICommand): """ _cmd = '3dWarp' - input_spec = WarpInputSpec - output_spec = AFNICommandOutputSpec + _input_spec = WarpInputSpec + _output_spec = AFNICommandOutputSpec class ResampleInputSpec(AFNICommandInputSpec): @@ -267,8 +267,8 @@ class Resample(AFNICommand): """ _cmd = '3dresample' - input_spec = ResampleInputSpec - output_spec = AFNICommandOutputSpec + _input_spec = ResampleInputSpec + _output_spec = AFNICommandOutputSpec class AutoTcorrelateInputSpec(AFNICommandInputSpec): @@ -307,8 +307,8 @@ class AutoTcorrelate(AFNICommand): '3dAutoTcorrelate -eta2 -mask mask.nii -mask_only_targets -prefix functional_similarity_matrix.1D -polort -1 functional.nii' >>> res = corr.run() # doctest: +SKIP """ - input_spec = AutoTcorrelateInputSpec - output_spec = AFNICommandOutputSpec + _input_spec = AutoTcorrelateInputSpec + _output_spec = AFNICommandOutputSpec _cmd = '3dAutoTcorrelate' @@ -345,8 +345,8 @@ class TStat(AFNICommand): """ _cmd = '3dTstat' - input_spec = TStatInputSpec - output_spec = AFNICommandOutputSpec + _input_spec = TStatInputSpec + _output_spec = AFNICommandOutputSpec class DetrendInputSpec(AFNICommandInputSpec): @@ -381,8 +381,8 @@ class Detrend(AFNICommand): """ _cmd = '3dDetrend' - input_spec = DetrendInputSpec - output_spec = AFNICommandOutputSpec + _input_spec = DetrendInputSpec + _output_spec = AFNICommandOutputSpec class DespikeInputSpec(AFNICommandInputSpec): @@ -414,8 +414,8 @@ class Despike(AFNICommand): """ _cmd = '3dDespike' - input_spec = DespikeInputSpec - output_spec = AFNICommandOutputSpec + _input_spec = DespikeInputSpec + _output_spec = AFNICommandOutputSpec class AutomaskInputSpec(AFNICommandInputSpec): @@ -459,8 +459,8 @@ class Automask(AFNICommand): """ _cmd = '3dAutomask' - input_spec = AutomaskInputSpec - output_spec = AutomaskOutputSpec + _input_spec = AutomaskInputSpec + _output_spec = AutomaskOutputSpec class VolregInputSpec(AFNICommandInputSpec): @@ -517,8 +517,8 @@ class Volreg(AFNICommand): """ _cmd = '3dvolreg' - input_spec = VolregInputSpec - output_spec = VolregOutputSpec + _input_spec = VolregInputSpec + _output_spec = VolregOutputSpec class MergeInputSpec(AFNICommandInputSpec): @@ -558,8 +558,8 @@ class Merge(AFNICommand): """ _cmd = '3dmerge' - input_spec = MergeInputSpec - output_spec = AFNICommandOutputSpec + _input_spec = MergeInputSpec + _output_spec = AFNICommandOutputSpec class CopyInputSpec(AFNICommandInputSpec): @@ -608,8 +608,8 @@ class Copy(AFNICommand): """ _cmd = '3dcopy' - input_spec = CopyInputSpec - output_spec = AFNICommandOutputSpec + _input_spec = CopyInputSpec + _output_spec = AFNICommandOutputSpec class FourierInputSpec(AFNICommandInputSpec): @@ -653,8 +653,8 @@ class Fourier(AFNICommand): """ _cmd = '3dFourier' - input_spec = FourierInputSpec - output_spec = AFNICommandOutputSpec + _input_spec = FourierInputSpec + _output_spec = AFNICommandOutputSpec class BandpassInputSpec(AFNICommandInputSpec): @@ -764,8 +764,8 @@ class Bandpass(AFNICommand): """ _cmd = '3dBandpass' - input_spec = BandpassInputSpec - output_spec = AFNICommandOutputSpec + _input_spec = BandpassInputSpec + _output_spec = AFNICommandOutputSpec class ZCutUpInputSpec(AFNICommandInputSpec): @@ -801,8 +801,8 @@ class ZCutUp(AFNICommand): """ _cmd = '3dZcutup' - input_spec = ZCutUpInputSpec - output_spec = AFNICommandOutputSpec + _input_spec = ZCutUpInputSpec + _output_spec = AFNICommandOutputSpec class AllineateInputSpec(AFNICommandInputSpec): @@ -1030,8 +1030,8 @@ class Allineate(AFNICommand): """ _cmd = '3dAllineate' - input_spec = AllineateInputSpec - output_spec = AllineateOutputSpec + _input_spec = AllineateInputSpec + _output_spec = AllineateOutputSpec class MaskaveInputSpec(AFNICommandInputSpec): @@ -1072,8 +1072,8 @@ class Maskave(AFNICommand): """ _cmd = '3dmaskave' - input_spec = MaskaveInputSpec - output_spec = AFNICommandOutputSpec + _input_spec = MaskaveInputSpec + _output_spec = AFNICommandOutputSpec class SkullStripInputSpec(AFNICommandInputSpec): @@ -1107,8 +1107,8 @@ class SkullStrip(AFNICommand): """ _cmd = '3dSkullStrip' _redirect_x = True - input_spec = SkullStripInputSpec - output_spec = AFNICommandOutputSpec + _input_spec = SkullStripInputSpec + _output_spec = AFNICommandOutputSpec def __init__(self, **inputs): super(SkullStrip, self).__init__(**inputs) @@ -1154,8 +1154,8 @@ class TCat(AFNICommand): """ _cmd = '3dTcat' - input_spec = TCatInputSpec - output_spec = AFNICommandOutputSpec + _input_spec = TCatInputSpec + _output_spec = AFNICommandOutputSpec class FimInputSpec(AFNICommandInputSpec): @@ -1202,8 +1202,8 @@ class Fim(AFNICommand): """ _cmd = '3dfim+' - input_spec = FimInputSpec - output_spec = AFNICommandOutputSpec + _input_spec = FimInputSpec + _output_spec = AFNICommandOutputSpec class TCorrelateInputSpec(AFNICommandInputSpec): @@ -1251,8 +1251,8 @@ class TCorrelate(AFNICommand): """ _cmd = '3dTcorrelate' - input_spec = TCorrelateInputSpec - output_spec = AFNICommandOutputSpec + _input_spec = TCorrelateInputSpec + _output_spec = AFNICommandOutputSpec class TCorr1DInputSpec(AFNICommandInputSpec): @@ -1308,8 +1308,8 @@ class TCorr1D(AFNICommand): """ _cmd = '3dTcorr1D' - input_spec = TCorr1DInputSpec - output_spec = TCorr1DOutputSpec + _input_spec = TCorr1DInputSpec + _output_spec = TCorr1DOutputSpec class BrickStatInputSpec(AFNICommandInputSpec): @@ -1344,8 +1344,8 @@ class BrickStat(AFNICommand): """ _cmd = '3dBrickStat' - input_spec = BrickStatInputSpec - output_spec = BrickStatOutputSpec + _input_spec = BrickStatInputSpec + _output_spec = BrickStatOutputSpec def aggregate_outputs(self, runtime=None, needed_outputs=None): @@ -1426,8 +1426,8 @@ class ROIStats(AFNICommandBase): """ _cmd = '3dROIstats' - input_spec = ROIStatsInputSpec - output_spec = ROIStatsOutputSpec + _input_spec = ROIStatsInputSpec + _output_spec = ROIStatsOutputSpec def aggregate_outputs(self, runtime=None, needed_outputs=None): outputs = self._outputs() @@ -1492,8 +1492,8 @@ class Calc(AFNICommand): """ _cmd = '3dcalc' - input_spec = CalcInputSpec - output_spec = AFNICommandOutputSpec + _input_spec = CalcInputSpec + _output_spec = AFNICommandOutputSpec class BlurInMaskInputSpec(AFNICommandInputSpec): @@ -1552,8 +1552,8 @@ class BlurInMask(AFNICommand): """ _cmd = '3dBlurInMask' - input_spec = BlurInMaskInputSpec - output_spec = AFNICommandOutputSpec + _input_spec = BlurInMaskInputSpec + _output_spec = AFNICommandOutputSpec class TCorrMapInputSpec(AFNICommandInputSpec): @@ -1659,8 +1659,8 @@ class TCorrMap(AFNICommand): """ _cmd = '3dTcorrMap' - input_spec = TCorrMapInputSpec - output_spec = TCorrMapOutputSpec + _input_spec = TCorrMapInputSpec + _output_spec = TCorrMapOutputSpec _additional_metadata = ['suffix'] @@ -1711,8 +1711,8 @@ class Autobox(AFNICommand): """ _cmd = '3dAutobox' - input_spec = AutoboxInputSpec - output_spec = AutoboxOuputSpec + _input_spec = AutoboxInputSpec + _output_spec = AutoboxOuputSpec def aggregate_outputs(self, runtime=None, needed_outputs=None): outputs = self._outputs() @@ -1799,8 +1799,8 @@ class Retroicor(AFNICommand): """ _cmd = '3dretroicor' - input_spec = RetroicorInputSpec - output_spec = AFNICommandOutputSpec + _input_spec = RetroicorInputSpec + _output_spec = AFNICommandOutputSpec class AFNItoNIFTIInputSpec(AFNICommandInputSpec): @@ -1835,8 +1835,8 @@ class AFNItoNIFTI(AFNICommand): """ _cmd = '3dAFNItoNIFTI' - input_spec = AFNItoNIFTIInputSpec - output_spec = AFNICommandOutputSpec + _input_spec = AFNItoNIFTIInputSpec + _output_spec = AFNICommandOutputSpec class EvalInputSpec(AFNICommandInputSpec): @@ -1899,8 +1899,8 @@ class Eval(AFNICommand): """ _cmd = '1deval' - input_spec = EvalInputSpec - output_spec = AFNICommandOutputSpec + _input_spec = EvalInputSpec + _output_spec = AFNICommandOutputSpec class MeansInputSpec(AFNICommandInputSpec): @@ -1947,8 +1947,8 @@ class Means(AFNICommand): """ _cmd = '3dMean' - input_spec = MeansInputSpec - output_spec = AFNICommandOutputSpec + _input_spec = MeansInputSpec + _output_spec = AFNICommandOutputSpec class HistInputSpec(CommandLineInputSpec): @@ -2004,8 +2004,8 @@ class Hist(AFNICommandBase): """ _cmd = '3dHist' - input_spec = HistInputSpec - output_spec = HistOutputSpec + _input_spec = HistInputSpec + _output_spec = HistOutputSpec _redirect_x = True def __init__(self, **inputs): @@ -2215,8 +2215,8 @@ class FWHMx(AFNICommandBase): """ _cmd = '3dFWHMx' - input_spec = FWHMxInputSpec - output_spec = FWHMxOutputSpec + _input_spec = FWHMxInputSpec + _output_spec = FWHMxOutputSpec def _post_run(self): super(FWHMx, self)._post_run() diff --git a/nipype/interfaces/afni/svm.py b/nipype/interfaces/afni/svm.py index a7ef1b5b44..6f9c69d4e3 100644 --- a/nipype/interfaces/afni/svm.py +++ b/nipype/interfaces/afni/svm.py @@ -93,8 +93,8 @@ class SVMTrain(AFNICommand): """ _cmd = '3dsvm' - input_spec = SVMTrainInputSpec - output_spec = SVMTrainOutputSpec + _input_spec = SVMTrainInputSpec + _output_spec = SVMTrainOutputSpec _additional_metadata = ['suffix'] def _format_arg(self, name, trait_spec, value): @@ -146,5 +146,5 @@ class SVMTest(AFNICommand): """ _cmd = '3dsvm' - input_spec = SVMTestInputSpec - output_spec = AFNICommandOutputSpec + _input_spec = SVMTestInputSpec + _output_spec = AFNICommandOutputSpec diff --git a/nipype/interfaces/afni/tests/test_auto_AFNICommand.py b/nipype/interfaces/afni/tests/test_auto_AFNICommand.py index cc1d14c481..99cdf36b0e 100644 --- a/nipype/interfaces/afni/tests/test_auto_AFNICommand.py +++ b/nipype/interfaces/afni/tests/test_auto_AFNICommand.py @@ -17,7 +17,7 @@ def test_AFNICommand_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = AFNICommand.input_spec() + inputs = AFNICommand._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -26,7 +26,7 @@ def test_AFNICommand_inputs(): def test_AFNICommand_outputs(): output_map = dict() - outputs = AFNICommand.output_spec() + outputs = AFNICommand._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_AFNICommandBase.py b/nipype/interfaces/afni/tests/test_auto_AFNICommandBase.py index c5d8841a19..50ada7dd71 100644 --- a/nipype/interfaces/afni/tests/test_auto_AFNICommandBase.py +++ b/nipype/interfaces/afni/tests/test_auto_AFNICommandBase.py @@ -15,7 +15,7 @@ def test_AFNICommandBase_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = AFNICommandBase.input_spec() + inputs = AFNICommandBase._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -24,7 +24,7 @@ def test_AFNICommandBase_inputs(): def test_AFNICommandBase_outputs(): output_map = dict() - outputs = AFNICommandBase.output_spec() + outputs = AFNICommandBase._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_AFNItoNIFTI.py b/nipype/interfaces/afni/tests/test_auto_AFNItoNIFTI.py index 945af37be8..36ee76fd75 100644 --- a/nipype/interfaces/afni/tests/test_auto_AFNItoNIFTI.py +++ b/nipype/interfaces/afni/tests/test_auto_AFNItoNIFTI.py @@ -27,7 +27,7 @@ def test_AFNItoNIFTI_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = AFNItoNIFTI.input_spec() + inputs = AFNItoNIFTI._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -37,7 +37,7 @@ def test_AFNItoNIFTI_inputs(): def test_AFNItoNIFTI_outputs(): output_map = dict(out_file=dict(), ) - outputs = AFNItoNIFTI.output_spec() + outputs = AFNItoNIFTI._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_Allineate.py b/nipype/interfaces/afni/tests/test_auto_Allineate.py index 66d44c24e7..fe2592f471 100644 --- a/nipype/interfaces/afni/tests/test_auto_Allineate.py +++ b/nipype/interfaces/afni/tests/test_auto_Allineate.py @@ -107,7 +107,7 @@ def test_Allineate_inputs(): zclip=dict(argstr='-zclip', ), ) - inputs = Allineate.input_spec() + inputs = Allineate._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -118,7 +118,7 @@ def test_Allineate_outputs(): output_map = dict(matrix=dict(), out_file=dict(), ) - outputs = Allineate.output_spec() + outputs = Allineate._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_AutoTcorrelate.py b/nipype/interfaces/afni/tests/test_auto_AutoTcorrelate.py index e1f50719dc..8922a184e0 100644 --- a/nipype/interfaces/afni/tests/test_auto_AutoTcorrelate.py +++ b/nipype/interfaces/afni/tests/test_auto_AutoTcorrelate.py @@ -37,7 +37,7 @@ def test_AutoTcorrelate_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = AutoTcorrelate.input_spec() + inputs = AutoTcorrelate._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -47,7 +47,7 @@ def test_AutoTcorrelate_inputs(): def test_AutoTcorrelate_outputs(): output_map = dict(out_file=dict(), ) - outputs = AutoTcorrelate.output_spec() + outputs = AutoTcorrelate._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_Autobox.py b/nipype/interfaces/afni/tests/test_auto_Autobox.py index 8bb5ccc343..ed72a05cd6 100644 --- a/nipype/interfaces/afni/tests/test_auto_Autobox.py +++ b/nipype/interfaces/afni/tests/test_auto_Autobox.py @@ -28,7 +28,7 @@ def test_Autobox_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Autobox.input_spec() + inputs = Autobox._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -44,7 +44,7 @@ def test_Autobox_outputs(): z_max=dict(), z_min=dict(), ) - outputs = Autobox.output_spec() + outputs = Autobox._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_Automask.py b/nipype/interfaces/afni/tests/test_auto_Automask.py index 06289c30f5..77d2ab1c1b 100644 --- a/nipype/interfaces/afni/tests/test_auto_Automask.py +++ b/nipype/interfaces/afni/tests/test_auto_Automask.py @@ -32,7 +32,7 @@ def test_Automask_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Automask.input_spec() + inputs = Automask._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -43,7 +43,7 @@ def test_Automask_outputs(): output_map = dict(brain_file=dict(), out_file=dict(), ) - outputs = Automask.output_spec() + outputs = Automask._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_Bandpass.py b/nipype/interfaces/afni/tests/test_auto_Bandpass.py index 670f03cfdf..82f51817a1 100644 --- a/nipype/interfaces/afni/tests/test_auto_Bandpass.py +++ b/nipype/interfaces/afni/tests/test_auto_Bandpass.py @@ -61,7 +61,7 @@ def test_Bandpass_inputs(): tr=dict(argstr='-dt %f', ), ) - inputs = Bandpass.input_spec() + inputs = Bandpass._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -71,7 +71,7 @@ def test_Bandpass_inputs(): def test_Bandpass_outputs(): output_map = dict(out_file=dict(), ) - outputs = Bandpass.output_spec() + outputs = Bandpass._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_BlurInMask.py b/nipype/interfaces/afni/tests/test_auto_BlurInMask.py index 45636f2ea2..b01bfce10d 100644 --- a/nipype/interfaces/afni/tests/test_auto_BlurInMask.py +++ b/nipype/interfaces/afni/tests/test_auto_BlurInMask.py @@ -41,7 +41,7 @@ def test_BlurInMask_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = BlurInMask.input_spec() + inputs = BlurInMask._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -51,7 +51,7 @@ def test_BlurInMask_inputs(): def test_BlurInMask_outputs(): output_map = dict(out_file=dict(), ) - outputs = BlurInMask.output_spec() + outputs = BlurInMask._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_BrickStat.py b/nipype/interfaces/afni/tests/test_auto_BrickStat.py index 9bc240fe6a..6fc1e0915f 100644 --- a/nipype/interfaces/afni/tests/test_auto_BrickStat.py +++ b/nipype/interfaces/afni/tests/test_auto_BrickStat.py @@ -27,7 +27,7 @@ def test_BrickStat_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = BrickStat.input_spec() + inputs = BrickStat._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -37,7 +37,7 @@ def test_BrickStat_inputs(): def test_BrickStat_outputs(): output_map = dict(min_val=dict(), ) - outputs = BrickStat.output_spec() + outputs = BrickStat._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_Calc.py b/nipype/interfaces/afni/tests/test_auto_Calc.py index b6d937b41a..847a9c4300 100644 --- a/nipype/interfaces/afni/tests/test_auto_Calc.py +++ b/nipype/interfaces/afni/tests/test_auto_Calc.py @@ -42,7 +42,7 @@ def test_Calc_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Calc.input_spec() + inputs = Calc._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -52,7 +52,7 @@ def test_Calc_inputs(): def test_Calc_outputs(): output_map = dict(out_file=dict(), ) - outputs = Calc.output_spec() + outputs = Calc._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_Copy.py b/nipype/interfaces/afni/tests/test_auto_Copy.py index 10fea3394b..824ac78312 100644 --- a/nipype/interfaces/afni/tests/test_auto_Copy.py +++ b/nipype/interfaces/afni/tests/test_auto_Copy.py @@ -25,7 +25,7 @@ def test_Copy_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Copy.input_spec() + inputs = Copy._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -35,7 +35,7 @@ def test_Copy_inputs(): def test_Copy_outputs(): output_map = dict(out_file=dict(), ) - outputs = Copy.output_spec() + outputs = Copy._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_Despike.py b/nipype/interfaces/afni/tests/test_auto_Despike.py index 52cb9de3ac..f309359f12 100644 --- a/nipype/interfaces/afni/tests/test_auto_Despike.py +++ b/nipype/interfaces/afni/tests/test_auto_Despike.py @@ -25,7 +25,7 @@ def test_Despike_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Despike.input_spec() + inputs = Despike._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -35,7 +35,7 @@ def test_Despike_inputs(): def test_Despike_outputs(): output_map = dict(out_file=dict(), ) - outputs = Despike.output_spec() + outputs = Despike._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_Detrend.py b/nipype/interfaces/afni/tests/test_auto_Detrend.py index 277392d541..eac34e5bfa 100644 --- a/nipype/interfaces/afni/tests/test_auto_Detrend.py +++ b/nipype/interfaces/afni/tests/test_auto_Detrend.py @@ -25,7 +25,7 @@ def test_Detrend_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Detrend.input_spec() + inputs = Detrend._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -35,7 +35,7 @@ def test_Detrend_inputs(): def test_Detrend_outputs(): output_map = dict(out_file=dict(), ) - outputs = Detrend.output_spec() + outputs = Detrend._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_Eval.py b/nipype/interfaces/afni/tests/test_auto_Eval.py index 50951737be..e3d2617f55 100644 --- a/nipype/interfaces/afni/tests/test_auto_Eval.py +++ b/nipype/interfaces/afni/tests/test_auto_Eval.py @@ -44,7 +44,7 @@ def test_Eval_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Eval.input_spec() + inputs = Eval._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -54,7 +54,7 @@ def test_Eval_inputs(): def test_Eval_outputs(): output_map = dict(out_file=dict(), ) - outputs = Eval.output_spec() + outputs = Eval._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_FWHMx.py b/nipype/interfaces/afni/tests/test_auto_FWHMx.py index dc2d67879f..29e25c877b 100644 --- a/nipype/interfaces/afni/tests/test_auto_FWHMx.py +++ b/nipype/interfaces/afni/tests/test_auto_FWHMx.py @@ -55,7 +55,7 @@ def test_FWHMx_inputs(): unif=dict(argstr='-unif', ), ) - inputs = FWHMx.input_spec() + inputs = FWHMx._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -70,7 +70,7 @@ def test_FWHMx_outputs(): out_file=dict(), out_subbricks=dict(), ) - outputs = FWHMx.output_spec() + outputs = FWHMx._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_Fim.py b/nipype/interfaces/afni/tests/test_auto_Fim.py index 9cf495629a..92ac1cb312 100644 --- a/nipype/interfaces/afni/tests/test_auto_Fim.py +++ b/nipype/interfaces/afni/tests/test_auto_Fim.py @@ -36,7 +36,7 @@ def test_Fim_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Fim.input_spec() + inputs = Fim._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -46,7 +46,7 @@ def test_Fim_inputs(): def test_Fim_outputs(): output_map = dict(out_file=dict(), ) - outputs = Fim.output_spec() + outputs = Fim._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_Fourier.py b/nipype/interfaces/afni/tests/test_auto_Fourier.py index 0013f320e4..2eb2eef493 100644 --- a/nipype/interfaces/afni/tests/test_auto_Fourier.py +++ b/nipype/interfaces/afni/tests/test_auto_Fourier.py @@ -34,7 +34,7 @@ def test_Fourier_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Fourier.input_spec() + inputs = Fourier._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -44,7 +44,7 @@ def test_Fourier_inputs(): def test_Fourier_outputs(): output_map = dict(out_file=dict(), ) - outputs = Fourier.output_spec() + outputs = Fourier._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_Hist.py b/nipype/interfaces/afni/tests/test_auto_Hist.py index 60b38fdcab..e77b701e89 100644 --- a/nipype/interfaces/afni/tests/test_auto_Hist.py +++ b/nipype/interfaces/afni/tests/test_auto_Hist.py @@ -42,7 +42,7 @@ def test_Hist_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Hist.input_spec() + inputs = Hist._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -53,7 +53,7 @@ def test_Hist_outputs(): output_map = dict(out_file=dict(), out_show=dict(), ) - outputs = Hist.output_spec() + outputs = Hist._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_Maskave.py b/nipype/interfaces/afni/tests/test_auto_Maskave.py index 6dec4e3d4e..5fef8cabf1 100644 --- a/nipype/interfaces/afni/tests/test_auto_Maskave.py +++ b/nipype/interfaces/afni/tests/test_auto_Maskave.py @@ -31,7 +31,7 @@ def test_Maskave_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Maskave.input_spec() + inputs = Maskave._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -41,7 +41,7 @@ def test_Maskave_inputs(): def test_Maskave_outputs(): output_map = dict(out_file=dict(), ) - outputs = Maskave.output_spec() + outputs = Maskave._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_Means.py b/nipype/interfaces/afni/tests/test_auto_Means.py index 1114573eb1..be3e3b9960 100644 --- a/nipype/interfaces/afni/tests/test_auto_Means.py +++ b/nipype/interfaces/afni/tests/test_auto_Means.py @@ -44,7 +44,7 @@ def test_Means_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Means.input_spec() + inputs = Means._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -54,7 +54,7 @@ def test_Means_inputs(): def test_Means_outputs(): output_map = dict(out_file=dict(), ) - outputs = Means.output_spec() + outputs = Means._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_Merge.py b/nipype/interfaces/afni/tests/test_auto_Merge.py index ec0eaa3b03..96a74dae92 100644 --- a/nipype/interfaces/afni/tests/test_auto_Merge.py +++ b/nipype/interfaces/afni/tests/test_auto_Merge.py @@ -29,7 +29,7 @@ def test_Merge_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Merge.input_spec() + inputs = Merge._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -39,7 +39,7 @@ def test_Merge_inputs(): def test_Merge_outputs(): output_map = dict(out_file=dict(), ) - outputs = Merge.output_spec() + outputs = Merge._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_ROIStats.py b/nipype/interfaces/afni/tests/test_auto_ROIStats.py index 447b5000f6..42652baf26 100644 --- a/nipype/interfaces/afni/tests/test_auto_ROIStats.py +++ b/nipype/interfaces/afni/tests/test_auto_ROIStats.py @@ -30,7 +30,7 @@ def test_ROIStats_inputs(): usedefault=True, ), ) - inputs = ROIStats.input_spec() + inputs = ROIStats._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -40,7 +40,7 @@ def test_ROIStats_inputs(): def test_ROIStats_outputs(): output_map = dict(stats=dict(), ) - outputs = ROIStats.output_spec() + outputs = ROIStats._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_Refit.py b/nipype/interfaces/afni/tests/test_auto_Refit.py index ec345d4b58..3cea31c4b4 100644 --- a/nipype/interfaces/afni/tests/test_auto_Refit.py +++ b/nipype/interfaces/afni/tests/test_auto_Refit.py @@ -40,7 +40,7 @@ def test_Refit_inputs(): zorigin=dict(argstr='-zorigin %s', ), ) - inputs = Refit.input_spec() + inputs = Refit._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -50,7 +50,7 @@ def test_Refit_inputs(): def test_Refit_outputs(): output_map = dict(out_file=dict(), ) - outputs = Refit.output_spec() + outputs = Refit._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_Resample.py b/nipype/interfaces/afni/tests/test_auto_Resample.py index d133cebc3c..ffeae483af 100644 --- a/nipype/interfaces/afni/tests/test_auto_Resample.py +++ b/nipype/interfaces/afni/tests/test_auto_Resample.py @@ -33,7 +33,7 @@ def test_Resample_inputs(): voxel_size=dict(argstr='-dxyz %f %f %f', ), ) - inputs = Resample.input_spec() + inputs = Resample._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -43,7 +43,7 @@ def test_Resample_inputs(): def test_Resample_outputs(): output_map = dict(out_file=dict(), ) - outputs = Resample.output_spec() + outputs = Resample._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_Retroicor.py b/nipype/interfaces/afni/tests/test_auto_Retroicor.py index 48c3b78ccb..92021b6ba1 100644 --- a/nipype/interfaces/afni/tests/test_auto_Retroicor.py +++ b/nipype/interfaces/afni/tests/test_auto_Retroicor.py @@ -46,7 +46,7 @@ def test_Retroicor_inputs(): position=-4, ), ) - inputs = Retroicor.input_spec() + inputs = Retroicor._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -56,7 +56,7 @@ def test_Retroicor_inputs(): def test_Retroicor_outputs(): output_map = dict(out_file=dict(), ) - outputs = Retroicor.output_spec() + outputs = Retroicor._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_SVMTest.py b/nipype/interfaces/afni/tests/test_auto_SVMTest.py index 8a1a071763..1187c289a0 100644 --- a/nipype/interfaces/afni/tests/test_auto_SVMTest.py +++ b/nipype/interfaces/afni/tests/test_auto_SVMTest.py @@ -38,7 +38,7 @@ def test_SVMTest_inputs(): testlabels=dict(argstr='-testlabels %s', ), ) - inputs = SVMTest.input_spec() + inputs = SVMTest._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -48,7 +48,7 @@ def test_SVMTest_inputs(): def test_SVMTest_outputs(): output_map = dict(out_file=dict(), ) - outputs = SVMTest.output_spec() + outputs = SVMTest._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_SVMTrain.py b/nipype/interfaces/afni/tests/test_auto_SVMTrain.py index 2604a841e0..57b20c3b8d 100644 --- a/nipype/interfaces/afni/tests/test_auto_SVMTrain.py +++ b/nipype/interfaces/afni/tests/test_auto_SVMTrain.py @@ -57,7 +57,7 @@ def test_SVMTrain_inputs(): w_out=dict(argstr='-wout', ), ) - inputs = SVMTrain.input_spec() + inputs = SVMTrain._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -69,7 +69,7 @@ def test_SVMTrain_outputs(): model=dict(), out_file=dict(), ) - outputs = SVMTrain.output_spec() + outputs = SVMTrain._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_SkullStrip.py b/nipype/interfaces/afni/tests/test_auto_SkullStrip.py index 5b2334fed0..203eab9985 100644 --- a/nipype/interfaces/afni/tests/test_auto_SkullStrip.py +++ b/nipype/interfaces/afni/tests/test_auto_SkullStrip.py @@ -26,7 +26,7 @@ def test_SkullStrip_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = SkullStrip.input_spec() + inputs = SkullStrip._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -36,7 +36,7 @@ def test_SkullStrip_inputs(): def test_SkullStrip_outputs(): output_map = dict(out_file=dict(), ) - outputs = SkullStrip.output_spec() + outputs = SkullStrip._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_TCat.py b/nipype/interfaces/afni/tests/test_auto_TCat.py index bd02538439..fe7b6c5703 100644 --- a/nipype/interfaces/afni/tests/test_auto_TCat.py +++ b/nipype/interfaces/afni/tests/test_auto_TCat.py @@ -29,7 +29,7 @@ def test_TCat_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = TCat.input_spec() + inputs = TCat._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -39,7 +39,7 @@ def test_TCat_inputs(): def test_TCat_outputs(): output_map = dict(out_file=dict(), ) - outputs = TCat.output_spec() + outputs = TCat._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_TCorr1D.py b/nipype/interfaces/afni/tests/test_auto_TCorr1D.py index a60372482e..269d67df40 100644 --- a/nipype/interfaces/afni/tests/test_auto_TCorr1D.py +++ b/nipype/interfaces/afni/tests/test_auto_TCorr1D.py @@ -47,7 +47,7 @@ def test_TCorr1D_inputs(): position=-1, ), ) - inputs = TCorr1D.input_spec() + inputs = TCorr1D._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -57,7 +57,7 @@ def test_TCorr1D_inputs(): def test_TCorr1D_outputs(): output_map = dict(out_file=dict(), ) - outputs = TCorr1D.output_spec() + outputs = TCorr1D._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_TCorrMap.py b/nipype/interfaces/afni/tests/test_auto_TCorrMap.py index 6a126d2daa..4e73509129 100644 --- a/nipype/interfaces/afni/tests/test_auto_TCorrMap.py +++ b/nipype/interfaces/afni/tests/test_auto_TCorrMap.py @@ -98,7 +98,7 @@ def test_TCorrMap_inputs(): suffix='_zmean', ), ) - inputs = TCorrMap.input_spec() + inputs = TCorrMap._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -120,7 +120,7 @@ def test_TCorrMap_outputs(): var_absolute_threshold_normalize=dict(), zmean=dict(), ) - outputs = TCorrMap.output_spec() + outputs = TCorrMap._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_TCorrelate.py b/nipype/interfaces/afni/tests/test_auto_TCorrelate.py index 3fbd091430..be5f63b47c 100644 --- a/nipype/interfaces/afni/tests/test_auto_TCorrelate.py +++ b/nipype/interfaces/afni/tests/test_auto_TCorrelate.py @@ -37,7 +37,7 @@ def test_TCorrelate_inputs(): position=-1, ), ) - inputs = TCorrelate.input_spec() + inputs = TCorrelate._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -47,7 +47,7 @@ def test_TCorrelate_inputs(): def test_TCorrelate_outputs(): output_map = dict(out_file=dict(), ) - outputs = TCorrelate.output_spec() + outputs = TCorrelate._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_TShift.py b/nipype/interfaces/afni/tests/test_auto_TShift.py index eefd89e4d7..65dd3f4930 100644 --- a/nipype/interfaces/afni/tests/test_auto_TShift.py +++ b/nipype/interfaces/afni/tests/test_auto_TShift.py @@ -43,7 +43,7 @@ def test_TShift_inputs(): xor=['tslice'], ), ) - inputs = TShift.input_spec() + inputs = TShift._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -53,7 +53,7 @@ def test_TShift_inputs(): def test_TShift_outputs(): output_map = dict(out_file=dict(), ) - outputs = TShift.output_spec() + outputs = TShift._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_TStat.py b/nipype/interfaces/afni/tests/test_auto_TStat.py index ce224b221c..b8fb40dc95 100644 --- a/nipype/interfaces/afni/tests/test_auto_TStat.py +++ b/nipype/interfaces/afni/tests/test_auto_TStat.py @@ -29,7 +29,7 @@ def test_TStat_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = TStat.input_spec() + inputs = TStat._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -39,7 +39,7 @@ def test_TStat_inputs(): def test_TStat_outputs(): output_map = dict(out_file=dict(), ) - outputs = TStat.output_spec() + outputs = TStat._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_To3D.py b/nipype/interfaces/afni/tests/test_auto_To3D.py index 565a235505..e53a913a97 100644 --- a/nipype/interfaces/afni/tests/test_auto_To3D.py +++ b/nipype/interfaces/afni/tests/test_auto_To3D.py @@ -35,7 +35,7 @@ def test_To3D_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = To3D.input_spec() + inputs = To3D._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -45,7 +45,7 @@ def test_To3D_inputs(): def test_To3D_outputs(): output_map = dict(out_file=dict(), ) - outputs = To3D.output_spec() + outputs = To3D._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_Volreg.py b/nipype/interfaces/afni/tests/test_auto_Volreg.py index c59b13efe3..ceca1b365d 100644 --- a/nipype/interfaces/afni/tests/test_auto_Volreg.py +++ b/nipype/interfaces/afni/tests/test_auto_Volreg.py @@ -43,7 +43,7 @@ def test_Volreg_inputs(): position=-5, ), ) - inputs = Volreg.input_spec() + inputs = Volreg._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -56,7 +56,7 @@ def test_Volreg_outputs(): oned_matrix_save=dict(), out_file=dict(), ) - outputs = Volreg.output_spec() + outputs = Volreg._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_Warp.py b/nipype/interfaces/afni/tests/test_auto_Warp.py index ab570f9287..90fd5ce2d2 100644 --- a/nipype/interfaces/afni/tests/test_auto_Warp.py +++ b/nipype/interfaces/afni/tests/test_auto_Warp.py @@ -41,7 +41,7 @@ def test_Warp_inputs(): zpad=dict(argstr='-zpad %d', ), ) - inputs = Warp.input_spec() + inputs = Warp._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -51,7 +51,7 @@ def test_Warp_inputs(): def test_Warp_outputs(): output_map = dict(out_file=dict(), ) - outputs = Warp.output_spec() + outputs = Warp._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/afni/tests/test_auto_ZCutUp.py b/nipype/interfaces/afni/tests/test_auto_ZCutUp.py index bd59594d21..e51f152e0c 100644 --- a/nipype/interfaces/afni/tests/test_auto_ZCutUp.py +++ b/nipype/interfaces/afni/tests/test_auto_ZCutUp.py @@ -28,7 +28,7 @@ def test_ZCutUp_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ZCutUp.input_spec() + inputs = ZCutUp._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -38,7 +38,7 @@ def test_ZCutUp_inputs(): def test_ZCutUp_outputs(): output_map = dict(out_file=dict(), ) - outputs = ZCutUp.output_spec() + outputs = ZCutUp._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/ants/base.py b/nipype/interfaces/ants/base.py index 70902faa1d..b0787a175b 100644 --- a/nipype/interfaces/ants/base.py +++ b/nipype/interfaces/ants/base.py @@ -43,7 +43,7 @@ class ANTSCommand(CommandLine): """Base class for ANTS interfaces """ - input_spec = ANTSCommandInputSpec + _input_spec = ANTSCommandInputSpec _num_threads = LOCAL_DEFAULT_NUMBER_OF_THREADS def __init__(self, **inputs): diff --git a/nipype/interfaces/ants/legacy.py b/nipype/interfaces/ants/legacy.py index 8e8e1f00b5..1a15bfc801 100644 --- a/nipype/interfaces/ants/legacy.py +++ b/nipype/interfaces/ants/legacy.py @@ -92,8 +92,8 @@ class antsIntroduction(ANTSCommand): """ _cmd = 'antsIntroduction.sh' - input_spec = antsIntroductionInputSpec - output_spec = antsIntroductionOutputSpec + _input_spec = antsIntroductionInputSpec + _output_spec = antsIntroductionOutputSpec def _post_run(self): transmodel = self.inputs.transformation_model @@ -208,8 +208,8 @@ class buildtemplateparallel(ANTSCommand): """ _cmd = 'buildtemplateparallel.sh' - input_spec = buildtemplateparallelInputSpec - output_spec = buildtemplateparallelOutputSpec + _input_spec = buildtemplateparallelInputSpec + _output_spec = buildtemplateparallelOutputSpec def _format_arg(self, opt, spec, val): if opt == 'num_cores': diff --git a/nipype/interfaces/ants/registration.py b/nipype/interfaces/ants/registration.py index ccb5b47efd..2095256e2b 100644 --- a/nipype/interfaces/ants/registration.py +++ b/nipype/interfaces/ants/registration.py @@ -205,8 +205,8 @@ class ANTS(ANTSCommand): --transformation-model SyN[0.25] --use-Histogram-Matching 1' """ _cmd = 'ANTS' - input_spec = ANTSInputSpec - output_spec = ANTSOutputSpec + _input_spec = ANTSInputSpec + _output_spec = ANTSOutputSpec class RegistrationInputSpec(ANTSCommandInputSpec): @@ -873,8 +873,8 @@ class Registration(ANTSCommand): """The default sampling strategy argument.""" _cmd = 'antsRegistration' - input_spec = RegistrationInputSpec - output_spec = RegistrationOutputSpec + _input_spec = RegistrationInputSpec + _output_spec = RegistrationOutputSpec _linear_transform_names = ['Rigid', 'Affine', 'Translation', 'CompositeAffine', 'Similarity'] def _post_run(self): diff --git a/nipype/interfaces/ants/resampling.py b/nipype/interfaces/ants/resampling.py index ece2a0803a..a67f034856 100644 --- a/nipype/interfaces/ants/resampling.py +++ b/nipype/interfaces/ants/resampling.py @@ -85,8 +85,8 @@ class WarpTimeSeriesImageMultiTransform(ANTSCommand): """ _cmd = 'WarpTimeSeriesImageMultiTransform' - input_spec = WarpTimeSeriesImageMultiTransformInputSpec - output_spec = WarpTimeSeriesImageMultiTransformOutputSpec + _input_spec = WarpTimeSeriesImageMultiTransformInputSpec + _output_spec = WarpTimeSeriesImageMultiTransformOutputSpec def _run_interface(self, runtime, correct_return_codes=[0]): runtime = super(WarpTimeSeriesImageMultiTransform, self)._run_interface(runtime, correct_return_codes=[0, 1]) @@ -179,8 +179,8 @@ class WarpImageMultiTransform(ANTSCommand): """ _cmd = 'WarpImageMultiTransform' - input_spec = WarpImageMultiTransformInputSpec - output_spec = WarpImageMultiTransformOutputSpec + _input_spec = WarpImageMultiTransformInputSpec + _output_spec = WarpImageMultiTransformOutputSpec class ApplyTransformsInputSpec(ANTSCommandInputSpec): @@ -309,8 +309,8 @@ class ApplyTransforms(ANTSCommand): """ _cmd = 'antsApplyTransforms' - input_spec = ApplyTransformsInputSpec - output_spec = ApplyTransformsOutputSpec + _input_spec = ApplyTransformsInputSpec + _output_spec = ApplyTransformsOutputSpec class ApplyTransformsToPointsInputSpec(ANTSCommandInputSpec): @@ -384,5 +384,5 @@ class ApplyTransformsToPoints(ANTSCommand): """ _cmd = 'antsApplyTransformsToPoints' - input_spec = ApplyTransformsToPointsInputSpec - output_spec = ApplyTransformsToPointsOutputSpec + _input_spec = ApplyTransformsToPointsInputSpec + _output_spec = ApplyTransformsToPointsOutputSpec diff --git a/nipype/interfaces/ants/segmentation.py b/nipype/interfaces/ants/segmentation.py index cd9bf36795..6d1ec5e600 100644 --- a/nipype/interfaces/ants/segmentation.py +++ b/nipype/interfaces/ants/segmentation.py @@ -141,8 +141,8 @@ class Atropos(ANTSCommand): --likelihood-model Gaussian --mask-image mask.nii --mrf [0.2,1x1x1] --convergence [5,1e-06] \ --output [structural_labeled.nii,POSTERIOR_%02d.nii.gz] --posterior-formulation Socrates[1] --use-random-seed 1' """ - input_spec = AtroposInputSpec - output_spec = AtroposOutputSpec + _input_spec = AtroposInputSpec + _output_spec = AtroposOutputSpec _cmd = 'Atropos' def _run_interface(self, runtime, correct_return_codes=[0]): @@ -200,8 +200,8 @@ class LaplacianThickness(ANTSCommand): """ _cmd = 'LaplacianThickness' - input_spec = LaplacianThicknessInputSpec - output_spec = LaplacianThicknessOutputSpec + _input_spec = LaplacianThicknessInputSpec + _output_spec = LaplacianThicknessOutputSpec def _gen_filename(self, name): if name == 'output_image': @@ -339,8 +339,8 @@ class N4BiasFieldCorrection(ANTSCommand): """ _cmd = 'N4BiasFieldCorrection' - input_spec = N4BiasFieldCorrectionInputSpec - output_spec = N4BiasFieldCorrectionOutputSpec + _input_spec = N4BiasFieldCorrectionInputSpec + _output_spec = N4BiasFieldCorrectionOutputSpec class CorticalThicknessInputSpec(ANTSCommandInputSpec): @@ -490,8 +490,8 @@ class CorticalThickness(ANTSCommand): -s nii.gz -o antsCT_ -p nipype_priors/BrainSegmentationPrior%02d.nii.gz -t brain_study_template.nii.gz' """ - input_spec = CorticalThicknessInputSpec - output_spec = CorticalThicknessOutputSpec + _input_spec = CorticalThicknessInputSpec + _output_spec = CorticalThicknessOutputSpec _cmd = 'antsCorticalThickness.sh' def _run_interface(self, runtime, correct_return_codes=[0]): @@ -627,8 +627,8 @@ class BrainExtraction(ANTSCommand): 'antsBrainExtraction.sh -a T1.nii.gz -m ProbabilityMaskOfStudyTemplate.nii.gz -e study_template.nii.gz -d 3 \ -s nii.gz -o highres001_' """ - input_spec = BrainExtractionInputSpec - output_spec = BrainExtractionOutputSpec + _input_spec = BrainExtractionInputSpec + _output_spec = BrainExtractionOutputSpec _cmd = 'antsBrainExtraction.sh' def _post_run(self): @@ -743,8 +743,8 @@ class JointFusion(ANTSCommand): 'jointfusion 3 1 -m Joint[0.5,1] -rp 3x2x1 -rs 1x2x3 -tg T1.nii -g im1.nii -g im2.nii -g im3.nii \ -l segmentation0.nii.gz -l segmentation1.nii.gz -l segmentation1.nii.gz fusion_labelimage_output.nii' """ - input_spec = JointFusionInputSpec - output_spec = JointFusionOutputSpec + _input_spec = JointFusionInputSpec + _output_spec = JointFusionOutputSpec _cmd = 'jointfusion' def _post_run(self): @@ -828,8 +828,8 @@ class DenoiseImage(ANTSCommand): >>> denoise_3.cmdline 'DenoiseImage -i im1.nii -n Gaussian -o [ im1_noise_corrected.nii, im1_noise.nii ] -s 1' """ - input_spec = DenoiseImageInputSpec - output_spec = DenoiseImageOutputSpec + _input_spec = DenoiseImageInputSpec + _output_spec = DenoiseImageOutputSpec _cmd = 'DenoiseImage' @@ -1008,8 +1008,8 @@ class AntsJointFusion(ANTSCommand): -p 3x2x1 -s mask.nii -t ['im1.nii', 'im2.nii'] -v" """ - input_spec = AntsJointFusionInputSpec - output_spec = AntsJointFusionOutputSpec + _input_spec = AntsJointFusionInputSpec + _output_spec = AntsJointFusionOutputSpec _cmd = 'antsJointFusion' diff --git a/nipype/interfaces/ants/tests/test_auto_ANTS.py b/nipype/interfaces/ants/tests/test_auto_ANTS.py index ca316c4589..ddb0dce2a9 100644 --- a/nipype/interfaces/ants/tests/test_auto_ANTS.py +++ b/nipype/interfaces/ants/tests/test_auto_ANTS.py @@ -74,7 +74,7 @@ def test_ANTS_inputs(): usedefault=True, ), ) - inputs = ANTS.input_spec() + inputs = ANTS._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -97,7 +97,7 @@ def test_ANTS_outputs(): name_template='%sWarp.nii.gz', ), ) - outputs = ANTS.output_spec() + outputs = ANTS._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/ants/tests/test_auto_ANTSCommand.py b/nipype/interfaces/ants/tests/test_auto_ANTSCommand.py index d930db7d72..26c30c9798 100644 --- a/nipype/interfaces/ants/tests/test_auto_ANTSCommand.py +++ b/nipype/interfaces/ants/tests/test_auto_ANTSCommand.py @@ -18,7 +18,7 @@ def test_ANTSCommand_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ANTSCommand.input_spec() + inputs = ANTSCommand._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -27,7 +27,7 @@ def test_ANTSCommand_inputs(): def test_ANTSCommand_outputs(): output_map = dict() - outputs = ANTSCommand.output_spec() + outputs = ANTSCommand._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/ants/tests/test_auto_AntsJointFusion.py b/nipype/interfaces/ants/tests/test_auto_AntsJointFusion.py index 478c0c1400..2e105e3354 100644 --- a/nipype/interfaces/ants/tests/test_auto_AntsJointFusion.py +++ b/nipype/interfaces/ants/tests/test_auto_AntsJointFusion.py @@ -73,7 +73,7 @@ def test_AntsJointFusion_inputs(): verbose=dict(argstr='-v', ), ) - inputs = AntsJointFusion.input_spec() + inputs = AntsJointFusion._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -86,7 +86,7 @@ def test_AntsJointFusion_outputs(): out_label_fusion=dict(), out_label_post_prob_name_format=dict(), ) - outputs = AntsJointFusion.output_spec() + outputs = AntsJointFusion._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/ants/tests/test_auto_ApplyTransforms.py b/nipype/interfaces/ants/tests/test_auto_ApplyTransforms.py index a483727bc5..ddf1a0becd 100644 --- a/nipype/interfaces/ants/tests/test_auto_ApplyTransforms.py +++ b/nipype/interfaces/ants/tests/test_auto_ApplyTransforms.py @@ -51,7 +51,7 @@ def test_ApplyTransforms_inputs(): mandatory=True, ), ) - inputs = ApplyTransforms.input_spec() + inputs = ApplyTransforms._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -61,7 +61,7 @@ def test_ApplyTransforms_inputs(): def test_ApplyTransforms_outputs(): output_map = dict(output_image=dict(), ) - outputs = ApplyTransforms.output_spec() + outputs = ApplyTransforms._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/ants/tests/test_auto_ApplyTransformsToPoints.py b/nipype/interfaces/ants/tests/test_auto_ApplyTransformsToPoints.py index 3c6be3669a..b65fd85131 100644 --- a/nipype/interfaces/ants/tests/test_auto_ApplyTransformsToPoints.py +++ b/nipype/interfaces/ants/tests/test_auto_ApplyTransformsToPoints.py @@ -32,7 +32,7 @@ def test_ApplyTransformsToPoints_inputs(): mandatory=True, ), ) - inputs = ApplyTransformsToPoints.input_spec() + inputs = ApplyTransformsToPoints._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -42,7 +42,7 @@ def test_ApplyTransformsToPoints_inputs(): def test_ApplyTransformsToPoints_outputs(): output_map = dict(output_file=dict(), ) - outputs = ApplyTransformsToPoints.output_spec() + outputs = ApplyTransformsToPoints._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/ants/tests/test_auto_Atropos.py b/nipype/interfaces/ants/tests/test_auto_Atropos.py index ccf48272be..d440883bbe 100644 --- a/nipype/interfaces/ants/tests/test_auto_Atropos.py +++ b/nipype/interfaces/ants/tests/test_auto_Atropos.py @@ -68,7 +68,7 @@ def test_Atropos_inputs(): usedefault=True, ), ) - inputs = Atropos.input_spec() + inputs = Atropos._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -79,7 +79,7 @@ def test_Atropos_outputs(): output_map = dict(classified_image=dict(), posteriors=dict(), ) - outputs = Atropos.output_spec() + outputs = Atropos._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/ants/tests/test_auto_AverageAffineTransform.py b/nipype/interfaces/ants/tests/test_auto_AverageAffineTransform.py index 347b07ef6e..c7c0c67760 100644 --- a/nipype/interfaces/ants/tests/test_auto_AverageAffineTransform.py +++ b/nipype/interfaces/ants/tests/test_auto_AverageAffineTransform.py @@ -31,7 +31,7 @@ def test_AverageAffineTransform_inputs(): position=3, ), ) - inputs = AverageAffineTransform.input_spec() + inputs = AverageAffineTransform._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -41,7 +41,7 @@ def test_AverageAffineTransform_inputs(): def test_AverageAffineTransform_outputs(): output_map = dict(affine_transform=dict(), ) - outputs = AverageAffineTransform.output_spec() + outputs = AverageAffineTransform._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/ants/tests/test_auto_AverageImages.py b/nipype/interfaces/ants/tests/test_auto_AverageImages.py index 2e25305f3a..a56e1b52d1 100644 --- a/nipype/interfaces/ants/tests/test_auto_AverageImages.py +++ b/nipype/interfaces/ants/tests/test_auto_AverageImages.py @@ -35,7 +35,7 @@ def test_AverageImages_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = AverageImages.input_spec() + inputs = AverageImages._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -45,7 +45,7 @@ def test_AverageImages_inputs(): def test_AverageImages_outputs(): output_map = dict(output_average_image=dict(), ) - outputs = AverageImages.output_spec() + outputs = AverageImages._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/ants/tests/test_auto_BrainExtraction.py b/nipype/interfaces/ants/tests/test_auto_BrainExtraction.py index b1448a641d..26eb9af5a6 100644 --- a/nipype/interfaces/ants/tests/test_auto_BrainExtraction.py +++ b/nipype/interfaces/ants/tests/test_auto_BrainExtraction.py @@ -47,7 +47,7 @@ def test_BrainExtraction_inputs(): use_random_seeding=dict(argstr='-u %d', ), ) - inputs = BrainExtraction.input_spec() + inputs = BrainExtraction._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -58,7 +58,7 @@ def test_BrainExtraction_outputs(): output_map = dict(BrainExtractionBrain=dict(), BrainExtractionMask=dict(), ) - outputs = BrainExtraction.output_spec() + outputs = BrainExtraction._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/ants/tests/test_auto_ConvertScalarImageToRGB.py b/nipype/interfaces/ants/tests/test_auto_ConvertScalarImageToRGB.py index cc2dfada40..0ed5d673ae 100644 --- a/nipype/interfaces/ants/tests/test_auto_ConvertScalarImageToRGB.py +++ b/nipype/interfaces/ants/tests/test_auto_ConvertScalarImageToRGB.py @@ -60,7 +60,7 @@ def test_ConvertScalarImageToRGB_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ConvertScalarImageToRGB.input_spec() + inputs = ConvertScalarImageToRGB._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -70,7 +70,7 @@ def test_ConvertScalarImageToRGB_inputs(): def test_ConvertScalarImageToRGB_outputs(): output_map = dict(output_image=dict(), ) - outputs = ConvertScalarImageToRGB.output_spec() + outputs = ConvertScalarImageToRGB._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/ants/tests/test_auto_CorticalThickness.py b/nipype/interfaces/ants/tests/test_auto_CorticalThickness.py index df40609826..e060cd7037 100644 --- a/nipype/interfaces/ants/tests/test_auto_CorticalThickness.py +++ b/nipype/interfaces/ants/tests/test_auto_CorticalThickness.py @@ -68,7 +68,7 @@ def test_CorticalThickness_inputs(): use_random_seeding=dict(argstr='-u %d', ), ) - inputs = CorticalThickness.input_spec() + inputs = CorticalThickness._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -89,7 +89,7 @@ def test_CorticalThickness_outputs(): TemplateToSubject0Warp=dict(), TemplateToSubject1GenericAffine=dict(), ) - outputs = CorticalThickness.output_spec() + outputs = CorticalThickness._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/ants/tests/test_auto_CreateTiledMosaic.py b/nipype/interfaces/ants/tests/test_auto_CreateTiledMosaic.py index a5222ef3de..eed798daeb 100644 --- a/nipype/interfaces/ants/tests/test_auto_CreateTiledMosaic.py +++ b/nipype/interfaces/ants/tests/test_auto_CreateTiledMosaic.py @@ -43,7 +43,7 @@ def test_CreateTiledMosaic_inputs(): tile_geometry=dict(argstr='-t %s', ), ) - inputs = CreateTiledMosaic.input_spec() + inputs = CreateTiledMosaic._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -53,7 +53,7 @@ def test_CreateTiledMosaic_inputs(): def test_CreateTiledMosaic_outputs(): output_map = dict(output_image=dict(), ) - outputs = CreateTiledMosaic.output_spec() + outputs = CreateTiledMosaic._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/ants/tests/test_auto_DenoiseImage.py b/nipype/interfaces/ants/tests/test_auto_DenoiseImage.py index ec4ea18dc4..2b14f7076c 100644 --- a/nipype/interfaces/ants/tests/test_auto_DenoiseImage.py +++ b/nipype/interfaces/ants/tests/test_auto_DenoiseImage.py @@ -48,7 +48,7 @@ def test_DenoiseImage_inputs(): verbose=dict(argstr='-v', ), ) - inputs = DenoiseImage.input_spec() + inputs = DenoiseImage._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -59,7 +59,7 @@ def test_DenoiseImage_outputs(): output_map = dict(noise_image=dict(), output_image=dict(), ) - outputs = DenoiseImage.output_spec() + outputs = DenoiseImage._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/ants/tests/test_auto_GenWarpFields.py b/nipype/interfaces/ants/tests/test_auto_GenWarpFields.py index a6a3e5c6a7..43a8844e35 100644 --- a/nipype/interfaces/ants/tests/test_auto_GenWarpFields.py +++ b/nipype/interfaces/ants/tests/test_auto_GenWarpFields.py @@ -49,7 +49,7 @@ def test_GenWarpFields_inputs(): usedefault=True, ), ) - inputs = GenWarpFields.input_spec() + inputs = GenWarpFields._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -63,7 +63,7 @@ def test_GenWarpFields_outputs(): output_file=dict(), warp_field=dict(), ) - outputs = GenWarpFields.output_spec() + outputs = GenWarpFields._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/ants/tests/test_auto_JacobianDeterminant.py b/nipype/interfaces/ants/tests/test_auto_JacobianDeterminant.py index c83a95a5f9..bb8d8e885e 100644 --- a/nipype/interfaces/ants/tests/test_auto_JacobianDeterminant.py +++ b/nipype/interfaces/ants/tests/test_auto_JacobianDeterminant.py @@ -45,7 +45,7 @@ def test_JacobianDeterminant_inputs(): position=1, ), ) - inputs = JacobianDeterminant.input_spec() + inputs = JacobianDeterminant._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -55,7 +55,7 @@ def test_JacobianDeterminant_inputs(): def test_JacobianDeterminant_outputs(): output_map = dict(jacobian_image=dict(), ) - outputs = JacobianDeterminant.output_spec() + outputs = JacobianDeterminant._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/ants/tests/test_auto_JointFusion.py b/nipype/interfaces/ants/tests/test_auto_JointFusion.py index 76d8d46969..7ef0077bcc 100644 --- a/nipype/interfaces/ants/tests/test_auto_JointFusion.py +++ b/nipype/interfaces/ants/tests/test_auto_JointFusion.py @@ -65,7 +65,7 @@ def test_JointFusion_inputs(): mandatory=True, ), ) - inputs = JointFusion.input_spec() + inputs = JointFusion._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -75,7 +75,7 @@ def test_JointFusion_inputs(): def test_JointFusion_outputs(): output_map = dict(output_label_image=dict(), ) - outputs = JointFusion.output_spec() + outputs = JointFusion._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/ants/tests/test_auto_LaplacianThickness.py b/nipype/interfaces/ants/tests/test_auto_LaplacianThickness.py index 60cfb494e3..8f7c3908a9 100644 --- a/nipype/interfaces/ants/tests/test_auto_LaplacianThickness.py +++ b/nipype/interfaces/ants/tests/test_auto_LaplacianThickness.py @@ -48,7 +48,7 @@ def test_LaplacianThickness_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = LaplacianThickness.input_spec() + inputs = LaplacianThickness._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -58,7 +58,7 @@ def test_LaplacianThickness_inputs(): def test_LaplacianThickness_outputs(): output_map = dict(output_image=dict(), ) - outputs = LaplacianThickness.output_spec() + outputs = LaplacianThickness._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/ants/tests/test_auto_MultiplyImages.py b/nipype/interfaces/ants/tests/test_auto_MultiplyImages.py index 5a3d682551..cb37d75788 100644 --- a/nipype/interfaces/ants/tests/test_auto_MultiplyImages.py +++ b/nipype/interfaces/ants/tests/test_auto_MultiplyImages.py @@ -35,7 +35,7 @@ def test_MultiplyImages_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = MultiplyImages.input_spec() + inputs = MultiplyImages._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -45,7 +45,7 @@ def test_MultiplyImages_inputs(): def test_MultiplyImages_outputs(): output_map = dict(output_product_image=dict(), ) - outputs = MultiplyImages.output_spec() + outputs = MultiplyImages._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/ants/tests/test_auto_N4BiasFieldCorrection.py b/nipype/interfaces/ants/tests/test_auto_N4BiasFieldCorrection.py index dc0e97f6b1..e5311c7f6e 100644 --- a/nipype/interfaces/ants/tests/test_auto_N4BiasFieldCorrection.py +++ b/nipype/interfaces/ants/tests/test_auto_N4BiasFieldCorrection.py @@ -54,7 +54,7 @@ def test_N4BiasFieldCorrection_inputs(): weight_image=dict(argstr='--weight-image %s', ), ) - inputs = N4BiasFieldCorrection.input_spec() + inputs = N4BiasFieldCorrection._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -65,7 +65,7 @@ def test_N4BiasFieldCorrection_outputs(): output_map = dict(bias_image=dict(), output_image=dict(), ) - outputs = N4BiasFieldCorrection.output_spec() + outputs = N4BiasFieldCorrection._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/ants/tests/test_auto_Registration.py b/nipype/interfaces/ants/tests/test_auto_Registration.py index 990f97eea5..bbc2bd692f 100644 --- a/nipype/interfaces/ants/tests/test_auto_Registration.py +++ b/nipype/interfaces/ants/tests/test_auto_Registration.py @@ -114,7 +114,7 @@ def test_Registration_inputs(): usedefault=True, ), ) - inputs = Registration.input_spec() + inputs = Registration._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -132,7 +132,7 @@ def test_Registration_outputs(): save_state=dict(), warped_image=dict(), ) - outputs = Registration.output_spec() + outputs = Registration._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/ants/tests/test_auto_WarpImageMultiTransform.py b/nipype/interfaces/ants/tests/test_auto_WarpImageMultiTransform.py index 96a8f71d8f..2cc8a87391 100644 --- a/nipype/interfaces/ants/tests/test_auto_WarpImageMultiTransform.py +++ b/nipype/interfaces/ants/tests/test_auto_WarpImageMultiTransform.py @@ -54,7 +54,7 @@ def test_WarpImageMultiTransform_inputs(): use_nearest=dict(argstr='--use-NN', ), ) - inputs = WarpImageMultiTransform.input_spec() + inputs = WarpImageMultiTransform._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -64,7 +64,7 @@ def test_WarpImageMultiTransform_inputs(): def test_WarpImageMultiTransform_outputs(): output_map = dict(output_image=dict(), ) - outputs = WarpImageMultiTransform.output_spec() + outputs = WarpImageMultiTransform._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/ants/tests/test_auto_WarpTimeSeriesImageMultiTransform.py b/nipype/interfaces/ants/tests/test_auto_WarpTimeSeriesImageMultiTransform.py index 364a9e7e9f..052b272fee 100644 --- a/nipype/interfaces/ants/tests/test_auto_WarpTimeSeriesImageMultiTransform.py +++ b/nipype/interfaces/ants/tests/test_auto_WarpTimeSeriesImageMultiTransform.py @@ -52,7 +52,7 @@ def test_WarpTimeSeriesImageMultiTransform_inputs(): use_nearest=dict(argstr='--use-NN', ), ) - inputs = WarpTimeSeriesImageMultiTransform.input_spec() + inputs = WarpTimeSeriesImageMultiTransform._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -62,7 +62,7 @@ def test_WarpTimeSeriesImageMultiTransform_inputs(): def test_WarpTimeSeriesImageMultiTransform_outputs(): output_map = dict(output_image=dict(), ) - outputs = WarpTimeSeriesImageMultiTransform.output_spec() + outputs = WarpTimeSeriesImageMultiTransform._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/ants/tests/test_auto_antsBrainExtraction.py b/nipype/interfaces/ants/tests/test_auto_antsBrainExtraction.py index 5661eddd02..13741bea34 100644 --- a/nipype/interfaces/ants/tests/test_auto_antsBrainExtraction.py +++ b/nipype/interfaces/ants/tests/test_auto_antsBrainExtraction.py @@ -47,7 +47,7 @@ def test_antsBrainExtraction_inputs(): use_random_seeding=dict(argstr='-u %d', ), ) - inputs = antsBrainExtraction.input_spec() + inputs = antsBrainExtraction._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -58,7 +58,7 @@ def test_antsBrainExtraction_outputs(): output_map = dict(BrainExtractionBrain=dict(), BrainExtractionMask=dict(), ) - outputs = antsBrainExtraction.output_spec() + outputs = antsBrainExtraction._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/ants/tests/test_auto_antsCorticalThickness.py b/nipype/interfaces/ants/tests/test_auto_antsCorticalThickness.py index 0944ebf1b7..8c97d68ab5 100644 --- a/nipype/interfaces/ants/tests/test_auto_antsCorticalThickness.py +++ b/nipype/interfaces/ants/tests/test_auto_antsCorticalThickness.py @@ -68,7 +68,7 @@ def test_antsCorticalThickness_inputs(): use_random_seeding=dict(argstr='-u %d', ), ) - inputs = antsCorticalThickness.input_spec() + inputs = antsCorticalThickness._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -89,7 +89,7 @@ def test_antsCorticalThickness_outputs(): TemplateToSubject0Warp=dict(), TemplateToSubject1GenericAffine=dict(), ) - outputs = antsCorticalThickness.output_spec() + outputs = antsCorticalThickness._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/ants/tests/test_auto_antsIntroduction.py b/nipype/interfaces/ants/tests/test_auto_antsIntroduction.py index be61025e30..776e974ad1 100644 --- a/nipype/interfaces/ants/tests/test_auto_antsIntroduction.py +++ b/nipype/interfaces/ants/tests/test_auto_antsIntroduction.py @@ -49,7 +49,7 @@ def test_antsIntroduction_inputs(): usedefault=True, ), ) - inputs = antsIntroduction.input_spec() + inputs = antsIntroduction._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -63,7 +63,7 @@ def test_antsIntroduction_outputs(): output_file=dict(), warp_field=dict(), ) - outputs = antsIntroduction.output_spec() + outputs = antsIntroduction._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/ants/tests/test_auto_buildtemplateparallel.py b/nipype/interfaces/ants/tests/test_auto_buildtemplateparallel.py index 6992ce5c11..7dcb11bca2 100644 --- a/nipype/interfaces/ants/tests/test_auto_buildtemplateparallel.py +++ b/nipype/interfaces/ants/tests/test_auto_buildtemplateparallel.py @@ -53,7 +53,7 @@ def test_buildtemplateparallel_inputs(): ), use_first_as_target=dict(), ) - inputs = buildtemplateparallel.input_spec() + inputs = buildtemplateparallel._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -65,7 +65,7 @@ def test_buildtemplateparallel_outputs(): subject_outfiles=dict(), template_files=dict(), ) - outputs = buildtemplateparallel.output_spec() + outputs = buildtemplateparallel._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/ants/utils.py b/nipype/interfaces/ants/utils.py index 8dd99f5b96..1290702c7e 100644 --- a/nipype/interfaces/ants/utils.py +++ b/nipype/interfaces/ants/utils.py @@ -39,8 +39,8 @@ class AverageAffineTransform(ANTSCommand): 'AverageAffineTransform 3 MYtemplatewarp.mat trans.mat func_to_struct.mat' """ _cmd = 'AverageAffineTransform' - input_spec = AverageAffineTransformInputSpec - output_spec = AverageAffineTransformOutputSpec + _input_spec = AverageAffineTransformInputSpec + _output_spec = AverageAffineTransformOutputSpec def _format_arg(self, opt, spec, val): return super(AverageAffineTransform, self)._format_arg(opt, spec, val) @@ -79,8 +79,8 @@ class AverageImages(ANTSCommand): 'AverageImages 3 average.nii.gz 1 rc1s1.nii rc1s1.nii' """ _cmd = 'AverageImages' - input_spec = AverageImagesInputSpec - output_spec = AverageImagesOutputSpec + _input_spec = AverageImagesInputSpec + _output_spec = AverageImagesOutputSpec def _format_arg(self, opt, spec, val): return super(AverageImages, self)._format_arg(opt, spec, val) @@ -118,8 +118,8 @@ class MultiplyImages(ANTSCommand): 'MultiplyImages 3 moving2.nii 0.25 out.nii' """ _cmd = 'MultiplyImages' - input_spec = MultiplyImagesInputSpec - output_spec = MultiplyImagesOutputSpec + _input_spec = MultiplyImagesInputSpec + _output_spec = MultiplyImagesOutputSpec def _format_arg(self, opt, spec, val): return super(MultiplyImages, self)._format_arg(opt, spec, val) @@ -169,8 +169,8 @@ class JacobianDeterminant(ANTSCommand): """ _cmd = 'ANTSJacobian' - input_spec = JacobianDeterminantInputSpec - output_spec = JacobianDeterminantOutputSpec + _input_spec = JacobianDeterminantInputSpec + _output_spec = JacobianDeterminantOutputSpec def _gen_filename(self, name): if name == 'output_prefix': diff --git a/nipype/interfaces/ants/visualization.py b/nipype/interfaces/ants/visualization.py index 98efd559e5..2412335e65 100644 --- a/nipype/interfaces/ants/visualization.py +++ b/nipype/interfaces/ants/visualization.py @@ -58,8 +58,8 @@ class ConvertScalarImageToRGB(ANTSCommand): 'ConvertScalarImageToRGB 3 T1.nii.gz rgb.nii.gz none jet none 0 6 0 255' """ _cmd = 'ConvertScalarImageToRGB' - input_spec = ConvertScalarImageToRGBInputSpec - output_spec = ConvertScalarImageToRGBOutputSpec + _input_spec = ConvertScalarImageToRGBInputSpec + _output_spec = ConvertScalarImageToRGBOutputSpec def _format_arg(self, opt, spec, val): return super(ConvertScalarImageToRGB, self)._format_arg(opt, spec, val) @@ -144,8 +144,8 @@ class CreateTiledMosaic(ANTSCommand): """ _cmd = 'CreateTiledMosaic' - input_spec = CreateTiledMosaicInputSpec - output_spec = CreateTiledMosaicOutputSpec + _input_spec = CreateTiledMosaicInputSpec + _output_spec = CreateTiledMosaicOutputSpec def _post_run(self): self.outputs.output_image = os.path.join(os.getcwd(), diff --git a/nipype/interfaces/c3.py b/nipype/interfaces/c3.py index 8246a68786..346119ce06 100644 --- a/nipype/interfaces/c3.py +++ b/nipype/interfaces/c3.py @@ -39,8 +39,8 @@ class C3dAffineTool(SEMLikeCommandLine): >>> c3.cmdline 'c3d_affine_tool -src cmatrix.mat -fsl2ras -oitk affine.txt' """ - input_spec = C3dAffineToolInputSpec - output_spec = C3dAffineToolOutputSpec + _input_spec = C3dAffineToolInputSpec + _output_spec = C3dAffineToolOutputSpec _cmd = 'c3d_affine_tool' _outputs_filenames = {'itk_transform': 'affine.txt'} diff --git a/nipype/interfaces/camino/calib.py b/nipype/interfaces/camino/calib.py index d74b103599..211c3d19e5 100644 --- a/nipype/interfaces/camino/calib.py +++ b/nipype/interfaces/camino/calib.py @@ -117,8 +117,8 @@ class SFPICOCalibData(StdOutCommandLine): data is generated for calculating the LUT. # doctest: +SKIP """ _cmd = 'sfpicocalibdata' - input_spec = SFPICOCalibDataInputSpec - output_spec = SFPICOCalibDataOutputSpec + _input_spec = SFPICOCalibDataInputSpec + _output_spec = SFPICOCalibDataOutputSpec def _post_run(self): @@ -223,8 +223,8 @@ class SFLUTGen(StdOutCommandLine): >>> lutgen.run() # doctest: +SKIP """ _cmd = 'sflutgen' - input_spec = SFLUTGenInputSpec - output_spec = SFLUTGenOutputSpec + _input_spec = SFLUTGenInputSpec + _output_spec = SFLUTGenOutputSpec def _post_run(self): diff --git a/nipype/interfaces/camino/connectivity.py b/nipype/interfaces/camino/connectivity.py index 099b2d92b4..58ab8feddd 100644 --- a/nipype/interfaces/camino/connectivity.py +++ b/nipype/interfaces/camino/connectivity.py @@ -129,8 +129,8 @@ class Conmat(CommandLine): >>> conmat.run() # doctest: +SKIP """ _cmd = 'conmat' - input_spec = ConmatInputSpec - output_spec = ConmatOutputSpec + _input_spec = ConmatInputSpec + _output_spec = ConmatOutputSpec def _post_run(self): diff --git a/nipype/interfaces/camino/convert.py b/nipype/interfaces/camino/convert.py index 2ea8a8446a..27f1e6a8d3 100644 --- a/nipype/interfaces/camino/convert.py +++ b/nipype/interfaces/camino/convert.py @@ -53,8 +53,8 @@ class Image2Voxel(StdOutCommandLine): >>> img2vox.run() # doctest: +SKIP """ _cmd = 'image2voxel' - input_spec = Image2VoxelInputSpec - output_spec = Image2VoxelOutputSpec + _input_spec = Image2VoxelInputSpec + _output_spec = Image2VoxelOutputSpec def _post_run(self): @@ -110,8 +110,8 @@ class FSL2Scheme(StdOutCommandLine): """ _cmd = 'fsl2scheme' - input_spec = FSL2SchemeInputSpec - output_spec = FSL2SchemeOutputSpec + _input_spec = FSL2SchemeInputSpec + _output_spec = FSL2SchemeOutputSpec def _post_run(self): @@ -165,8 +165,8 @@ class VtkStreamlines(StdOutCommandLine): >>> vtk.run() # doctest: +SKIP """ _cmd = 'vtkstreamlines' - input_spec = VtkStreamlinesInputSpec - output_spec = VtkStreamlinesOutputSpec + _input_spec = VtkStreamlinesInputSpec + _output_spec = VtkStreamlinesOutputSpec def _post_run(self): @@ -269,8 +269,8 @@ class ProcStreamlines(StdOutCommandLine): >>> proc.run() # doctest: +SKIP """ _cmd = 'procstreamlines' - input_spec = ProcStreamlinesInputSpec - output_spec = ProcStreamlinesOutputSpec + _input_spec = ProcStreamlinesInputSpec + _output_spec = ProcStreamlinesOutputSpec def _format_arg(self, name, spec, value): if name == 'outputroot': @@ -344,8 +344,8 @@ class TractShredder(StdOutCommandLine): >>> shred.run() # doctest: +SKIP """ _cmd = 'tractshredder' - input_spec = TractShredderInputSpec - output_spec = TractShredderOutputSpec + _input_spec = TractShredderInputSpec + _output_spec = TractShredderOutputSpec def _post_run(self): @@ -382,8 +382,8 @@ class DT2NIfTI(CommandLine): Reads Camino diffusion tensors, and converts them to NIFTI format as three .nii files. """ _cmd = 'dt2nii' - input_spec = DT2NIfTIInputSpec - output_spec = DT2NIfTIOutputSpec + _input_spec = DT2NIfTIInputSpec + _output_spec = DT2NIfTIOutputSpec def _post_run(self): @@ -464,8 +464,8 @@ class NIfTIDT2Camino(CommandLine): """ _cmd = 'niftidt2camino' - input_spec = NIfTIDT2CaminoInputSpec - output_spec = NIfTIDT2CaminoOutputSpec + _input_spec = NIfTIDT2CaminoInputSpec + _output_spec = NIfTIDT2CaminoOutputSpec def _post_run(self): @@ -617,8 +617,8 @@ class AnalyzeHeader(StdOutCommandLine): >>> hdr.run() # doctest: +SKIP """ _cmd = 'analyzeheader' - input_spec = AnalyzeHeaderInputSpec - output_spec = AnalyzeHeaderOutputSpec + _input_spec = AnalyzeHeaderInputSpec + _output_spec = AnalyzeHeaderOutputSpec def _post_run(self): @@ -670,8 +670,8 @@ class Shredder(StdOutCommandLine): >>> shred.run() # doctest: +SKIP """ _cmd = 'shredder' - input_spec = ShredderInputSpec - output_spec = ShredderOutputSpec + _input_spec = ShredderInputSpec + _output_spec = ShredderOutputSpec def _post_run(self): diff --git a/nipype/interfaces/camino/dti.py b/nipype/interfaces/camino/dti.py index 1702f31fdc..ab2d329765 100644 --- a/nipype/interfaces/camino/dti.py +++ b/nipype/interfaces/camino/dti.py @@ -58,8 +58,8 @@ class DTIFit(StdOutCommandLine): >>> fit.run() # doctest: +SKIP """ _cmd = 'dtfit' - input_spec = DTIFitInputSpec - output_spec = DTIFitOutputSpec + _input_spec = DTIFitInputSpec + _output_spec = DTIFitOutputSpec def _post_run(self): @@ -143,8 +143,8 @@ class DTMetric(CommandLine): >>> dtmetric.run() # doctest: +SKIP """ _cmd = 'dtshape' - input_spec = DTMetricInputSpec - output_spec = DTMetricOutputSpec + _input_spec = DTMetricInputSpec + _output_spec = DTMetricOutputSpec def _post_run(self): @@ -246,8 +246,8 @@ class ModelFit(StdOutCommandLine): >>> fit.run() # doctest: +SKIP """ _cmd = 'modelfit' - input_spec = ModelFitInputSpec - output_spec = ModelFitOutputSpec + _input_spec = ModelFitInputSpec + _output_spec = ModelFitOutputSpec def _post_run(self): @@ -327,8 +327,8 @@ class DTLUTGen(StdOutCommandLine): >>> dtl.run() # doctest: +SKIP """ _cmd = 'dtlutgen' - input_spec = DTLUTGenInputSpec - output_spec = DTLUTGenOutputSpec + _input_spec = DTLUTGenInputSpec + _output_spec = DTLUTGenOutputSpec def _post_run(self): @@ -390,8 +390,8 @@ class PicoPDFs(StdOutCommandLine): >>> pdf.run() # doctest: +SKIP """ _cmd = 'picopdfs' - input_spec = PicoPDFsInputSpec - output_spec = PicoPDFsOutputSpec + _input_spec = PicoPDFsInputSpec + _output_spec = PicoPDFsOutputSpec def _post_run(self): @@ -556,8 +556,8 @@ class Track(CommandLine): _cmd = 'track' - input_spec = TrackInputSpec - output_spec = TrackOutputSpec + _input_spec = TrackInputSpec + _output_spec = TrackOutputSpec def _post_run(self): @@ -621,7 +621,7 @@ class TrackPICo(Track): >>> track.run() # doctest: +SKIP """ - input_spec = TrackPICoInputSpec + _input_spec = TrackPICoInputSpec def __init__(self, command=None, **inputs): inputs["inputmodel"] = "pico" @@ -662,7 +662,7 @@ class TrackBedpostxDeter(Track): >>> track.run() # doctest: +SKIP """ - input_spec = TrackBedpostxDeterInputSpec + _input_spec = TrackBedpostxDeterInputSpec def __init__(self, command=None, **inputs): inputs["inputmodel"] = "bedpostx_dyad" @@ -712,7 +712,7 @@ class TrackBedpostxProba(Track): >>> track.run() # doctest: +SKIP """ - input_spec = TrackBedpostxProbaInputSpec + _input_spec = TrackBedpostxProbaInputSpec def __init__(self, command=None, **inputs): inputs["inputmodel"] = "bedpostx_dyad" @@ -758,7 +758,7 @@ class TrackBayesDirac(Track): >>> track.run() # doctest: +SKIP """ - input_spec = TrackBayesDiracInputSpec + _input_spec = TrackBayesDiracInputSpec def __init__(self, command=None, **inputs): inputs["inputmodel"] = "bayesdirac" @@ -812,7 +812,7 @@ class TrackBootstrap(Track): >>> track.run() # doctest: +SKIP """ - input_spec = TrackBootstrapInputSpec + _input_spec = TrackBootstrapInputSpec def __init__(self, command=None, **inputs): return super(TrackBootstrap, self).__init__(command, **inputs) @@ -863,8 +863,8 @@ class ComputeMeanDiffusivity(StdOutCommandLine): >>> md.run() # doctest: +SKIP """ _cmd = 'md' - input_spec = ComputeMeanDiffusivityInputSpec - output_spec = ComputeMeanDiffusivityOutputSpec + _input_spec = ComputeMeanDiffusivityInputSpec + _output_spec = ComputeMeanDiffusivityOutputSpec def _post_run(self): @@ -924,8 +924,8 @@ class ComputeFractionalAnisotropy(StdOutCommandLine): >>> fa.run() # doctest: +SKIP """ _cmd = 'fa' - input_spec = ComputeFractionalAnisotropyInputSpec - output_spec = ComputeFractionalAnisotropyOutputSpec + _input_spec = ComputeFractionalAnisotropyInputSpec + _output_spec = ComputeFractionalAnisotropyOutputSpec def _post_run(self): @@ -987,8 +987,8 @@ class ComputeTensorTrace(StdOutCommandLine): >>> trace.run() # doctest: +SKIP """ _cmd = 'trd' - input_spec = ComputeTensorTraceInputSpec - output_spec = ComputeTensorTraceOutputSpec + _input_spec = ComputeTensorTraceInputSpec + _output_spec = ComputeTensorTraceOutputSpec def _post_run(self): @@ -1046,8 +1046,8 @@ class ComputeEigensystem(StdOutCommandLine): >>> dteig.run() # doctest: +SKIP """ _cmd = 'dteig' - input_spec = ComputeEigensystemInputSpec - output_spec = ComputeEigensystemOutputSpec + _input_spec = ComputeEigensystemInputSpec + _output_spec = ComputeEigensystemOutputSpec def _post_run(self): diff --git a/nipype/interfaces/camino/odf.py b/nipype/interfaces/camino/odf.py index 2d8d6f1754..3a0dbaafb0 100644 --- a/nipype/interfaces/camino/odf.py +++ b/nipype/interfaces/camino/odf.py @@ -79,8 +79,8 @@ class QBallMX(StdOutCommandLine): >>> qballcoeffs.run() # doctest: +SKIP """ _cmd = 'qballmx' - input_spec = QBallMXInputSpec - output_spec = QBallMXOutputSpec + _input_spec = QBallMXInputSpec + _output_spec = QBallMXOutputSpec def _post_run(self): @@ -155,8 +155,8 @@ class LinRecon(StdOutCommandLine): >>> qballcoeffs.run() # doctest: +SKIP """ _cmd = 'linrecon' - input_spec = LinReconInputSpec - output_spec = LinReconOutputSpec + _input_spec = LinReconInputSpec + _output_spec = LinReconOutputSpec def _post_run(self): @@ -278,8 +278,8 @@ class MESD(StdOutCommandLine): >>> mesd.run() # doctest: +SKIP """ _cmd = 'mesd' - input_spec = MESDInputSpec - output_spec = MESDOutputSpec + _input_spec = MESDInputSpec + _output_spec = MESDOutputSpec def _post_run(self): @@ -424,8 +424,8 @@ class SFPeaks(StdOutCommandLine): >>> sf_peaks.run() # doctest: +SKIP """ _cmd = 'sfpeaks' - input_spec = SFPeaksInputSpec - output_spec = SFPeaksOutputSpec + _input_spec = SFPeaksInputSpec + _output_spec = SFPeaksOutputSpec def _post_run(self): diff --git a/nipype/interfaces/camino/tests/test_auto_AnalyzeHeader.py b/nipype/interfaces/camino/tests/test_auto_AnalyzeHeader.py index 2339ef9c65..daba8457c1 100644 --- a/nipype/interfaces/camino/tests/test_auto_AnalyzeHeader.py +++ b/nipype/interfaces/camino/tests/test_auto_AnalyzeHeader.py @@ -80,7 +80,7 @@ def test_AnalyzeHeader_inputs(): units='mm', ), ) - inputs = AnalyzeHeader.input_spec() + inputs = AnalyzeHeader._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -90,7 +90,7 @@ def test_AnalyzeHeader_inputs(): def test_AnalyzeHeader_outputs(): output_map = dict(header=dict(), ) - outputs = AnalyzeHeader.output_spec() + outputs = AnalyzeHeader._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_ComputeEigensystem.py b/nipype/interfaces/camino/tests/test_auto_ComputeEigensystem.py index 9dccbfc586..87dd0b7640 100644 --- a/nipype/interfaces/camino/tests/test_auto_ComputeEigensystem.py +++ b/nipype/interfaces/camino/tests/test_auto_ComputeEigensystem.py @@ -33,7 +33,7 @@ def test_ComputeEigensystem_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ComputeEigensystem.input_spec() + inputs = ComputeEigensystem._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -43,7 +43,7 @@ def test_ComputeEigensystem_inputs(): def test_ComputeEigensystem_outputs(): output_map = dict(eigen=dict(), ) - outputs = ComputeEigensystem.output_spec() + outputs = ComputeEigensystem._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_ComputeFractionalAnisotropy.py b/nipype/interfaces/camino/tests/test_auto_ComputeFractionalAnisotropy.py index 63b5199358..38aa904eb3 100644 --- a/nipype/interfaces/camino/tests/test_auto_ComputeFractionalAnisotropy.py +++ b/nipype/interfaces/camino/tests/test_auto_ComputeFractionalAnisotropy.py @@ -32,7 +32,7 @@ def test_ComputeFractionalAnisotropy_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ComputeFractionalAnisotropy.input_spec() + inputs = ComputeFractionalAnisotropy._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -42,7 +42,7 @@ def test_ComputeFractionalAnisotropy_inputs(): def test_ComputeFractionalAnisotropy_outputs(): output_map = dict(fa=dict(), ) - outputs = ComputeFractionalAnisotropy.output_spec() + outputs = ComputeFractionalAnisotropy._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_ComputeMeanDiffusivity.py b/nipype/interfaces/camino/tests/test_auto_ComputeMeanDiffusivity.py index 213ff038fc..4333758aaa 100644 --- a/nipype/interfaces/camino/tests/test_auto_ComputeMeanDiffusivity.py +++ b/nipype/interfaces/camino/tests/test_auto_ComputeMeanDiffusivity.py @@ -32,7 +32,7 @@ def test_ComputeMeanDiffusivity_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ComputeMeanDiffusivity.input_spec() + inputs = ComputeMeanDiffusivity._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -42,7 +42,7 @@ def test_ComputeMeanDiffusivity_inputs(): def test_ComputeMeanDiffusivity_outputs(): output_map = dict(md=dict(), ) - outputs = ComputeMeanDiffusivity.output_spec() + outputs = ComputeMeanDiffusivity._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_ComputeTensorTrace.py b/nipype/interfaces/camino/tests/test_auto_ComputeTensorTrace.py index e98e5e7b16..7523f25ed5 100644 --- a/nipype/interfaces/camino/tests/test_auto_ComputeTensorTrace.py +++ b/nipype/interfaces/camino/tests/test_auto_ComputeTensorTrace.py @@ -32,7 +32,7 @@ def test_ComputeTensorTrace_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ComputeTensorTrace.input_spec() + inputs = ComputeTensorTrace._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -42,7 +42,7 @@ def test_ComputeTensorTrace_inputs(): def test_ComputeTensorTrace_outputs(): output_map = dict(trace=dict(), ) - outputs = ComputeTensorTrace.output_spec() + outputs = ComputeTensorTrace._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_Conmat.py b/nipype/interfaces/camino/tests/test_auto_Conmat.py index c5aa705c6c..6cd26db9f3 100644 --- a/nipype/interfaces/camino/tests/test_auto_Conmat.py +++ b/nipype/interfaces/camino/tests/test_auto_Conmat.py @@ -38,7 +38,7 @@ def test_Conmat_inputs(): xor=['tract_prop'], ), ) - inputs = Conmat.input_spec() + inputs = Conmat._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -49,7 +49,7 @@ def test_Conmat_outputs(): output_map = dict(conmat_sc=dict(), conmat_ts=dict(), ) - outputs = Conmat.output_spec() + outputs = Conmat._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_DT2NIfTI.py b/nipype/interfaces/camino/tests/test_auto_DT2NIfTI.py index 9bc58fecdd..7bfba40fb2 100644 --- a/nipype/interfaces/camino/tests/test_auto_DT2NIfTI.py +++ b/nipype/interfaces/camino/tests/test_auto_DT2NIfTI.py @@ -27,7 +27,7 @@ def test_DT2NIfTI_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = DT2NIfTI.input_spec() + inputs = DT2NIfTI._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -39,7 +39,7 @@ def test_DT2NIfTI_outputs(): exitcode=dict(), lns0=dict(), ) - outputs = DT2NIfTI.output_spec() + outputs = DT2NIfTI._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_DTIFit.py b/nipype/interfaces/camino/tests/test_auto_DTIFit.py index 3720d95f58..663d38f8c5 100644 --- a/nipype/interfaces/camino/tests/test_auto_DTIFit.py +++ b/nipype/interfaces/camino/tests/test_auto_DTIFit.py @@ -32,7 +32,7 @@ def test_DTIFit_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = DTIFit.input_spec() + inputs = DTIFit._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -42,7 +42,7 @@ def test_DTIFit_inputs(): def test_DTIFit_outputs(): output_map = dict(tensor_fitted=dict(), ) - outputs = DTIFit.output_spec() + outputs = DTIFit._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_DTLUTGen.py b/nipype/interfaces/camino/tests/test_auto_DTLUTGen.py index 30e884b1c1..6d591f03f2 100644 --- a/nipype/interfaces/camino/tests/test_auto_DTLUTGen.py +++ b/nipype/interfaces/camino/tests/test_auto_DTLUTGen.py @@ -52,7 +52,7 @@ def test_DTLUTGen_inputs(): watson=dict(argstr='-watson', ), ) - inputs = DTLUTGen.input_spec() + inputs = DTLUTGen._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -62,7 +62,7 @@ def test_DTLUTGen_inputs(): def test_DTLUTGen_outputs(): output_map = dict(dtLUT=dict(), ) - outputs = DTLUTGen.output_spec() + outputs = DTLUTGen._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_DTMetric.py b/nipype/interfaces/camino/tests/test_auto_DTMetric.py index d4cec76afb..bb5e765d04 100644 --- a/nipype/interfaces/camino/tests/test_auto_DTMetric.py +++ b/nipype/interfaces/camino/tests/test_auto_DTMetric.py @@ -32,7 +32,7 @@ def test_DTMetric_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = DTMetric.input_spec() + inputs = DTMetric._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -42,7 +42,7 @@ def test_DTMetric_inputs(): def test_DTMetric_outputs(): output_map = dict(metric_stats=dict(), ) - outputs = DTMetric.output_spec() + outputs = DTMetric._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_FSL2Scheme.py b/nipype/interfaces/camino/tests/test_auto_FSL2Scheme.py index 70432d5936..6d706a73ec 100644 --- a/nipype/interfaces/camino/tests/test_auto_FSL2Scheme.py +++ b/nipype/interfaces/camino/tests/test_auto_FSL2Scheme.py @@ -46,7 +46,7 @@ def test_FSL2Scheme_inputs(): usegradmod=dict(argstr='-usegradmod', ), ) - inputs = FSL2Scheme.input_spec() + inputs = FSL2Scheme._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -56,7 +56,7 @@ def test_FSL2Scheme_inputs(): def test_FSL2Scheme_outputs(): output_map = dict(scheme=dict(), ) - outputs = FSL2Scheme.output_spec() + outputs = FSL2Scheme._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_Image2Voxel.py b/nipype/interfaces/camino/tests/test_auto_Image2Voxel.py index c55f9189de..da398d2d46 100644 --- a/nipype/interfaces/camino/tests/test_auto_Image2Voxel.py +++ b/nipype/interfaces/camino/tests/test_auto_Image2Voxel.py @@ -27,7 +27,7 @@ def test_Image2Voxel_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Image2Voxel.input_spec() + inputs = Image2Voxel._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -37,7 +37,7 @@ def test_Image2Voxel_inputs(): def test_Image2Voxel_outputs(): output_map = dict(voxel_order=dict(), ) - outputs = Image2Voxel.output_spec() + outputs = Image2Voxel._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_ImageStats.py b/nipype/interfaces/camino/tests/test_auto_ImageStats.py index 2fd6293a24..ca30280f81 100644 --- a/nipype/interfaces/camino/tests/test_auto_ImageStats.py +++ b/nipype/interfaces/camino/tests/test_auto_ImageStats.py @@ -29,7 +29,7 @@ def test_ImageStats_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ImageStats.input_spec() + inputs = ImageStats._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -39,7 +39,7 @@ def test_ImageStats_inputs(): def test_ImageStats_outputs(): output_map = dict(out_file=dict(), ) - outputs = ImageStats.output_spec() + outputs = ImageStats._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_LinRecon.py b/nipype/interfaces/camino/tests/test_auto_LinRecon.py index 3e3aa55fad..3612ab3c3c 100644 --- a/nipype/interfaces/camino/tests/test_auto_LinRecon.py +++ b/nipype/interfaces/camino/tests/test_auto_LinRecon.py @@ -37,7 +37,7 @@ def test_LinRecon_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = LinRecon.input_spec() + inputs = LinRecon._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -47,7 +47,7 @@ def test_LinRecon_inputs(): def test_LinRecon_outputs(): output_map = dict(recon_data=dict(), ) - outputs = LinRecon.output_spec() + outputs = LinRecon._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_MESD.py b/nipype/interfaces/camino/tests/test_auto_MESD.py index 3fd26c8ae5..8a1bc4a56b 100644 --- a/nipype/interfaces/camino/tests/test_auto_MESD.py +++ b/nipype/interfaces/camino/tests/test_auto_MESD.py @@ -45,7 +45,7 @@ def test_MESD_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = MESD.input_spec() + inputs = MESD._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -55,7 +55,7 @@ def test_MESD_inputs(): def test_MESD_outputs(): output_map = dict(mesd_data=dict(), ) - outputs = MESD.output_spec() + outputs = MESD._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_ModelFit.py b/nipype/interfaces/camino/tests/test_auto_ModelFit.py index 64f0d1cdfa..bc48d58c6d 100644 --- a/nipype/interfaces/camino/tests/test_auto_ModelFit.py +++ b/nipype/interfaces/camino/tests/test_auto_ModelFit.py @@ -52,7 +52,7 @@ def test_ModelFit_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ModelFit.input_spec() + inputs = ModelFit._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -62,7 +62,7 @@ def test_ModelFit_inputs(): def test_ModelFit_outputs(): output_map = dict(fitted_data=dict(), ) - outputs = ModelFit.output_spec() + outputs = ModelFit._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_NIfTIDT2Camino.py b/nipype/interfaces/camino/tests/test_auto_NIfTIDT2Camino.py index ca4c47a787..41eacea0d1 100644 --- a/nipype/interfaces/camino/tests/test_auto_NIfTIDT2Camino.py +++ b/nipype/interfaces/camino/tests/test_auto_NIfTIDT2Camino.py @@ -35,7 +35,7 @@ def test_NIfTIDT2Camino_inputs(): uppertriangular=dict(argstr='-uppertriangular %s', ), ) - inputs = NIfTIDT2Camino.input_spec() + inputs = NIfTIDT2Camino._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -45,7 +45,7 @@ def test_NIfTIDT2Camino_inputs(): def test_NIfTIDT2Camino_outputs(): output_map = dict(out_file=dict(), ) - outputs = NIfTIDT2Camino.output_spec() + outputs = NIfTIDT2Camino._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_PicoPDFs.py b/nipype/interfaces/camino/tests/test_auto_PicoPDFs.py index 3a855b7ccf..795f7c629d 100644 --- a/nipype/interfaces/camino/tests/test_auto_PicoPDFs.py +++ b/nipype/interfaces/camino/tests/test_auto_PicoPDFs.py @@ -42,7 +42,7 @@ def test_PicoPDFs_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = PicoPDFs.input_spec() + inputs = PicoPDFs._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -52,7 +52,7 @@ def test_PicoPDFs_inputs(): def test_PicoPDFs_outputs(): output_map = dict(pdfs=dict(), ) - outputs = PicoPDFs.output_spec() + outputs = PicoPDFs._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_ProcStreamlines.py b/nipype/interfaces/camino/tests/test_auto_ProcStreamlines.py index 560074ecb8..3e2fa71be1 100644 --- a/nipype/interfaces/camino/tests/test_auto_ProcStreamlines.py +++ b/nipype/interfaces/camino/tests/test_auto_ProcStreamlines.py @@ -100,7 +100,7 @@ def test_ProcStreamlines_inputs(): waypointfile=dict(argstr='-waypointfile %s', ), ) - inputs = ProcStreamlines.input_spec() + inputs = ProcStreamlines._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -111,7 +111,7 @@ def test_ProcStreamlines_outputs(): output_map = dict(outputroot_files=dict(), proc=dict(), ) - outputs = ProcStreamlines.output_spec() + outputs = ProcStreamlines._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_QBallMX.py b/nipype/interfaces/camino/tests/test_auto_QBallMX.py index c73e15921c..3e3f691458 100644 --- a/nipype/interfaces/camino/tests/test_auto_QBallMX.py +++ b/nipype/interfaces/camino/tests/test_auto_QBallMX.py @@ -37,7 +37,7 @@ def test_QBallMX_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = QBallMX.input_spec() + inputs = QBallMX._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -47,7 +47,7 @@ def test_QBallMX_inputs(): def test_QBallMX_outputs(): output_map = dict(qmat=dict(), ) - outputs = QBallMX.output_spec() + outputs = QBallMX._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_SFLUTGen.py b/nipype/interfaces/camino/tests/test_auto_SFLUTGen.py index 5b2811235d..f223276443 100644 --- a/nipype/interfaces/camino/tests/test_auto_SFLUTGen.py +++ b/nipype/interfaces/camino/tests/test_auto_SFLUTGen.py @@ -42,7 +42,7 @@ def test_SFLUTGen_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = SFLUTGen.input_spec() + inputs = SFLUTGen._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -53,7 +53,7 @@ def test_SFLUTGen_outputs(): output_map = dict(lut_one_fibre=dict(), lut_two_fibres=dict(), ) - outputs = SFLUTGen.output_spec() + outputs = SFLUTGen._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_SFPICOCalibData.py b/nipype/interfaces/camino/tests/test_auto_SFPICOCalibData.py index e187704b71..f61dde7d30 100644 --- a/nipype/interfaces/camino/tests/test_auto_SFPICOCalibData.py +++ b/nipype/interfaces/camino/tests/test_auto_SFPICOCalibData.py @@ -60,7 +60,7 @@ def test_SFPICOCalibData_inputs(): units='NA', ), ) - inputs = SFPICOCalibData.input_spec() + inputs = SFPICOCalibData._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -71,7 +71,7 @@ def test_SFPICOCalibData_outputs(): output_map = dict(PICOCalib=dict(), calib_info=dict(), ) - outputs = SFPICOCalibData.output_spec() + outputs = SFPICOCalibData._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_SFPeaks.py b/nipype/interfaces/camino/tests/test_auto_SFPeaks.py index 632547c793..9c2d99217e 100644 --- a/nipype/interfaces/camino/tests/test_auto_SFPeaks.py +++ b/nipype/interfaces/camino/tests/test_auto_SFPeaks.py @@ -56,7 +56,7 @@ def test_SFPeaks_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = SFPeaks.input_spec() + inputs = SFPeaks._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -66,7 +66,7 @@ def test_SFPeaks_inputs(): def test_SFPeaks_outputs(): output_map = dict(peaks=dict(), ) - outputs = SFPeaks.output_spec() + outputs = SFPeaks._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_Shredder.py b/nipype/interfaces/camino/tests/test_auto_Shredder.py index 347daf4e14..c553268422 100644 --- a/nipype/interfaces/camino/tests/test_auto_Shredder.py +++ b/nipype/interfaces/camino/tests/test_auto_Shredder.py @@ -35,7 +35,7 @@ def test_Shredder_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Shredder.input_spec() + inputs = Shredder._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -45,7 +45,7 @@ def test_Shredder_inputs(): def test_Shredder_outputs(): output_map = dict(shredded=dict(), ) - outputs = Shredder.output_spec() + outputs = Shredder._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_Track.py b/nipype/interfaces/camino/tests/test_auto_Track.py index a8fd980b79..028863271f 100644 --- a/nipype/interfaces/camino/tests/test_auto_Track.py +++ b/nipype/interfaces/camino/tests/test_auto_Track.py @@ -68,7 +68,7 @@ def test_Track_inputs(): units='mm', ), ) - inputs = Track.input_spec() + inputs = Track._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -78,7 +78,7 @@ def test_Track_inputs(): def test_Track_outputs(): output_map = dict(tracked=dict(), ) - outputs = Track.output_spec() + outputs = Track._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_TrackBallStick.py b/nipype/interfaces/camino/tests/test_auto_TrackBallStick.py index 1d563f873c..511ba68e1d 100644 --- a/nipype/interfaces/camino/tests/test_auto_TrackBallStick.py +++ b/nipype/interfaces/camino/tests/test_auto_TrackBallStick.py @@ -68,7 +68,7 @@ def test_TrackBallStick_inputs(): units='mm', ), ) - inputs = TrackBallStick.input_spec() + inputs = TrackBallStick._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -78,7 +78,7 @@ def test_TrackBallStick_inputs(): def test_TrackBallStick_outputs(): output_map = dict(tracked=dict(), ) - outputs = TrackBallStick.output_spec() + outputs = TrackBallStick._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_TrackBayesDirac.py b/nipype/interfaces/camino/tests/test_auto_TrackBayesDirac.py index f2c2aecede..586ef55726 100644 --- a/nipype/interfaces/camino/tests/test_auto_TrackBayesDirac.py +++ b/nipype/interfaces/camino/tests/test_auto_TrackBayesDirac.py @@ -88,7 +88,7 @@ def test_TrackBayesDirac_inputs(): units='mm', ), ) - inputs = TrackBayesDirac.input_spec() + inputs = TrackBayesDirac._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -98,7 +98,7 @@ def test_TrackBayesDirac_inputs(): def test_TrackBayesDirac_outputs(): output_map = dict(tracked=dict(), ) - outputs = TrackBayesDirac.output_spec() + outputs = TrackBayesDirac._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_TrackBedpostxDeter.py b/nipype/interfaces/camino/tests/test_auto_TrackBedpostxDeter.py index 9f9e40d284..4461aeb6f3 100644 --- a/nipype/interfaces/camino/tests/test_auto_TrackBedpostxDeter.py +++ b/nipype/interfaces/camino/tests/test_auto_TrackBedpostxDeter.py @@ -74,7 +74,7 @@ def test_TrackBedpostxDeter_inputs(): units='mm', ), ) - inputs = TrackBedpostxDeter.input_spec() + inputs = TrackBedpostxDeter._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -84,7 +84,7 @@ def test_TrackBedpostxDeter_inputs(): def test_TrackBedpostxDeter_outputs(): output_map = dict(tracked=dict(), ) - outputs = TrackBedpostxDeter.output_spec() + outputs = TrackBedpostxDeter._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_TrackBedpostxProba.py b/nipype/interfaces/camino/tests/test_auto_TrackBedpostxProba.py index 40f01d1b37..8bd425ce4f 100644 --- a/nipype/interfaces/camino/tests/test_auto_TrackBedpostxProba.py +++ b/nipype/interfaces/camino/tests/test_auto_TrackBedpostxProba.py @@ -77,7 +77,7 @@ def test_TrackBedpostxProba_inputs(): units='mm', ), ) - inputs = TrackBedpostxProba.input_spec() + inputs = TrackBedpostxProba._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -87,7 +87,7 @@ def test_TrackBedpostxProba_inputs(): def test_TrackBedpostxProba_outputs(): output_map = dict(tracked=dict(), ) - outputs = TrackBedpostxProba.output_spec() + outputs = TrackBedpostxProba._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_TrackBootstrap.py b/nipype/interfaces/camino/tests/test_auto_TrackBootstrap.py index 091fa6bd90..8a4d0bcec8 100644 --- a/nipype/interfaces/camino/tests/test_auto_TrackBootstrap.py +++ b/nipype/interfaces/camino/tests/test_auto_TrackBootstrap.py @@ -81,7 +81,7 @@ def test_TrackBootstrap_inputs(): units='mm', ), ) - inputs = TrackBootstrap.input_spec() + inputs = TrackBootstrap._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -91,7 +91,7 @@ def test_TrackBootstrap_inputs(): def test_TrackBootstrap_outputs(): output_map = dict(tracked=dict(), ) - outputs = TrackBootstrap.output_spec() + outputs = TrackBootstrap._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_TrackDT.py b/nipype/interfaces/camino/tests/test_auto_TrackDT.py index 0376ff7d55..495e8ae6fa 100644 --- a/nipype/interfaces/camino/tests/test_auto_TrackDT.py +++ b/nipype/interfaces/camino/tests/test_auto_TrackDT.py @@ -68,7 +68,7 @@ def test_TrackDT_inputs(): units='mm', ), ) - inputs = TrackDT.input_spec() + inputs = TrackDT._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -78,7 +78,7 @@ def test_TrackDT_inputs(): def test_TrackDT_outputs(): output_map = dict(tracked=dict(), ) - outputs = TrackDT.output_spec() + outputs = TrackDT._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_TrackPICo.py b/nipype/interfaces/camino/tests/test_auto_TrackPICo.py index c95a7e8812..a6ae5ef60d 100644 --- a/nipype/interfaces/camino/tests/test_auto_TrackPICo.py +++ b/nipype/interfaces/camino/tests/test_auto_TrackPICo.py @@ -73,7 +73,7 @@ def test_TrackPICo_inputs(): units='mm', ), ) - inputs = TrackPICo.input_spec() + inputs = TrackPICo._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -83,7 +83,7 @@ def test_TrackPICo_inputs(): def test_TrackPICo_outputs(): output_map = dict(tracked=dict(), ) - outputs = TrackPICo.output_spec() + outputs = TrackPICo._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_TractShredder.py b/nipype/interfaces/camino/tests/test_auto_TractShredder.py index 91286e9b64..f507f4829f 100644 --- a/nipype/interfaces/camino/tests/test_auto_TractShredder.py +++ b/nipype/interfaces/camino/tests/test_auto_TractShredder.py @@ -35,7 +35,7 @@ def test_TractShredder_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = TractShredder.input_spec() + inputs = TractShredder._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -45,7 +45,7 @@ def test_TractShredder_inputs(): def test_TractShredder_outputs(): output_map = dict(shredded=dict(), ) - outputs = TractShredder.output_spec() + outputs = TractShredder._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/tests/test_auto_VtkStreamlines.py b/nipype/interfaces/camino/tests/test_auto_VtkStreamlines.py index 68b16ea128..377733fd30 100644 --- a/nipype/interfaces/camino/tests/test_auto_VtkStreamlines.py +++ b/nipype/interfaces/camino/tests/test_auto_VtkStreamlines.py @@ -45,7 +45,7 @@ def test_VtkStreamlines_inputs(): units='mm', ), ) - inputs = VtkStreamlines.input_spec() + inputs = VtkStreamlines._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -55,7 +55,7 @@ def test_VtkStreamlines_inputs(): def test_VtkStreamlines_outputs(): output_map = dict(vtk=dict(), ) - outputs = VtkStreamlines.output_spec() + outputs = VtkStreamlines._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino/utils.py b/nipype/interfaces/camino/utils.py index da68872341..c69ec736d7 100644 --- a/nipype/interfaces/camino/utils.py +++ b/nipype/interfaces/camino/utils.py @@ -52,8 +52,8 @@ class ImageStats(CommandLine): >>> imstats.run() # doctest: +SKIP """ _cmd = 'imagestats' - input_spec = ImageStatsInputSpec - output_spec = ImageStatsOutputSpec + _input_spec = ImageStatsInputSpec + _output_spec = ImageStatsOutputSpec def _post_run(self): diff --git a/nipype/interfaces/camino2trackvis/convert.py b/nipype/interfaces/camino2trackvis/convert.py index 94291a55b2..b609916b4f 100644 --- a/nipype/interfaces/camino2trackvis/convert.py +++ b/nipype/interfaces/camino2trackvis/convert.py @@ -70,8 +70,8 @@ class Camino2Trackvis(CommandLine): """ _cmd = 'camino_to_trackvis' - input_spec = Camino2TrackvisInputSpec - output_spec = Camino2TrackvisOutputSpec + _input_spec = Camino2TrackvisInputSpec + _output_spec = Camino2TrackvisOutputSpec def _post_run(self): @@ -120,8 +120,8 @@ class Trackvis2CaminoOutputSpec(TraitedSpec): class Trackvis2Camino(CommandLine): _cmd = 'trackvis_to_camino' - input_spec = Trackvis2CaminoInputSpec - output_spec = Trackvis2CaminoOutputSpec + _input_spec = Trackvis2CaminoInputSpec + _output_spec = Trackvis2CaminoOutputSpec def _post_run(self): diff --git a/nipype/interfaces/camino2trackvis/tests/test_auto_Camino2Trackvis.py b/nipype/interfaces/camino2trackvis/tests/test_auto_Camino2Trackvis.py index 4feaae6bf3..3f6c26709e 100644 --- a/nipype/interfaces/camino2trackvis/tests/test_auto_Camino2Trackvis.py +++ b/nipype/interfaces/camino2trackvis/tests/test_auto_Camino2Trackvis.py @@ -44,7 +44,7 @@ def test_Camino2Trackvis_inputs(): position=6, ), ) - inputs = Camino2Trackvis.input_spec() + inputs = Camino2Trackvis._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -54,7 +54,7 @@ def test_Camino2Trackvis_inputs(): def test_Camino2Trackvis_outputs(): output_map = dict(trackvis=dict(), ) - outputs = Camino2Trackvis.output_spec() + outputs = Camino2Trackvis._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/camino2trackvis/tests/test_auto_Trackvis2Camino.py b/nipype/interfaces/camino2trackvis/tests/test_auto_Trackvis2Camino.py index fe24f0f99b..7b58417349 100644 --- a/nipype/interfaces/camino2trackvis/tests/test_auto_Trackvis2Camino.py +++ b/nipype/interfaces/camino2trackvis/tests/test_auto_Trackvis2Camino.py @@ -26,7 +26,7 @@ def test_Trackvis2Camino_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Trackvis2Camino.input_spec() + inputs = Trackvis2Camino._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -36,7 +36,7 @@ def test_Trackvis2Camino_inputs(): def test_Trackvis2Camino_outputs(): output_map = dict(camino=dict(), ) - outputs = Trackvis2Camino.output_spec() + outputs = Trackvis2Camino._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/cmtk/cmtk.py b/nipype/interfaces/cmtk/cmtk.py index 064e771dd4..7e56191a88 100644 --- a/nipype/interfaces/cmtk/cmtk.py +++ b/nipype/interfaces/cmtk/cmtk.py @@ -455,8 +455,8 @@ class CreateMatrix(BaseInterface): >>> conmap.run() # doctest: +SKIP """ - input_spec = CreateMatrixInputSpec - output_spec = CreateMatrixOutputSpec + _input_spec = CreateMatrixInputSpec + _output_spec = CreateMatrixOutputSpec def _run_interface(self, runtime): if isdefined(self.inputs.out_matrix_file): @@ -613,8 +613,8 @@ class ROIGen(BaseInterface): >>> labelDict # doctest: +SKIP """ - input_spec = ROIGenInputSpec - output_spec = ROIGenOutputSpec + _input_spec = ROIGenInputSpec + _output_spec = ROIGenOutputSpec def _run_interface(self, runtime): aparc_aseg_file = self.inputs.aparc_aseg_file @@ -777,8 +777,8 @@ class CreateNodes(BaseInterface): >>> mknode.run() # doctest: +SKIP """ - input_spec = CreateNodesInputSpec - output_spec = CreateNodesOutputSpec + _input_spec = CreateNodesInputSpec + _output_spec = CreateNodesOutputSpec def _run_interface(self, runtime): iflogger.info('Creating nodes...') diff --git a/nipype/interfaces/cmtk/convert.py b/nipype/interfaces/cmtk/convert.py index 548894b116..2bc051c8b3 100644 --- a/nipype/interfaces/cmtk/convert.py +++ b/nipype/interfaces/cmtk/convert.py @@ -75,8 +75,8 @@ class CFFConverter(BaseInterface): >>> cvt.run() # doctest: +SKIP """ - input_spec = CFFConverterInputSpec - output_spec = CFFConverterOutputSpec + _input_spec = CFFConverterInputSpec + _output_spec = CFFConverterOutputSpec def _run_interface(self, runtime): a = cf.connectome() @@ -225,8 +225,8 @@ class MergeCNetworks(BaseInterface): >>> mrg.run() # doctest: +SKIP """ - input_spec = MergeCNetworksInputSpec - output_spec = MergeCNetworksOutputSpec + _input_spec = MergeCNetworksInputSpec + _output_spec = MergeCNetworksOutputSpec def _run_interface(self, runtime): extracted_networks = [] diff --git a/nipype/interfaces/cmtk/nbs.py b/nipype/interfaces/cmtk/nbs.py index e7b0d27b63..5553bfd636 100644 --- a/nipype/interfaces/cmtk/nbs.py +++ b/nipype/interfaces/cmtk/nbs.py @@ -72,8 +72,8 @@ class NetworkBasedStatistic(BaseInterface): >>> nbs.inputs.in_group2 = ['pat1.pck', 'pat2.pck'] # doctest: +SKIP >>> nbs.run() # doctest: +SKIP """ - input_spec = NetworkBasedStatisticInputSpec - output_spec = NetworkBasedStatisticOutputSpec + _input_spec = NetworkBasedStatisticInputSpec + _output_spec = NetworkBasedStatisticOutputSpec def _run_interface(self, runtime): THRESH = self.inputs.threshold diff --git a/nipype/interfaces/cmtk/nx.py b/nipype/interfaces/cmtk/nx.py index ecea701cce..3a43c7da3b 100644 --- a/nipype/interfaces/cmtk/nx.py +++ b/nipype/interfaces/cmtk/nx.py @@ -384,8 +384,8 @@ class NetworkXMetrics(BaseInterface): >>> nxmetrics.inputs.in_file = 'subj1.pck' >>> nxmetrics.run() # doctest: +SKIP """ - input_spec = NetworkXMetricsInputSpec - output_spec = NetworkXMetricsOutputSpec + _input_spec = NetworkXMetricsInputSpec + _output_spec = NetworkXMetricsOutputSpec def _run_interface(self, runtime): global gpickled, nodentwks, edgentwks, kntwks, matlab @@ -533,8 +533,8 @@ class AverageNetworks(BaseInterface): >>> avg.run() # doctest: +SKIP """ - input_spec = AverageNetworksInputSpec - output_spec = AverageNetworksOutputSpec + _input_spec = AverageNetworksInputSpec + _output_spec = AverageNetworksOutputSpec def _run_interface(self, runtime): if isdefined(self.inputs.resolution_network_file): diff --git a/nipype/interfaces/cmtk/parcellation.py b/nipype/interfaces/cmtk/parcellation.py index a0ddde7866..02f9dd4cd6 100644 --- a/nipype/interfaces/cmtk/parcellation.py +++ b/nipype/interfaces/cmtk/parcellation.py @@ -564,8 +564,8 @@ class Parcellate(BaseInterface): >>> parcellate.run() # doctest: +SKIP """ - input_spec = ParcellateInputSpec - output_spec = ParcellateOutputSpec + _input_spec = ParcellateInputSpec + _output_spec = ParcellateOutputSpec def _run_interface(self, runtime): if self.inputs.subjects_dir: diff --git a/nipype/interfaces/cmtk/tests/test_auto_AverageNetworks.py b/nipype/interfaces/cmtk/tests/test_auto_AverageNetworks.py index e4d649585e..a47682c76f 100644 --- a/nipype/interfaces/cmtk/tests/test_auto_AverageNetworks.py +++ b/nipype/interfaces/cmtk/tests/test_auto_AverageNetworks.py @@ -15,7 +15,7 @@ def test_AverageNetworks_inputs(): out_gpickled_groupavg=dict(), resolution_network_file=dict(), ) - inputs = AverageNetworks.input_spec() + inputs = AverageNetworks._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -27,7 +27,7 @@ def test_AverageNetworks_outputs(): gpickled_groupavg=dict(), matlab_groupavgs=dict(), ) - outputs = AverageNetworks.output_spec() + outputs = AverageNetworks._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/cmtk/tests/test_auto_CFFConverter.py b/nipype/interfaces/cmtk/tests/test_auto_CFFConverter.py index 261a0babaa..c3103787fd 100644 --- a/nipype/interfaces/cmtk/tests/test_auto_CFFConverter.py +++ b/nipype/interfaces/cmtk/tests/test_auto_CFFConverter.py @@ -31,7 +31,7 @@ def test_CFFConverter_inputs(): title=dict(), tract_files=dict(), ) - inputs = CFFConverter.input_spec() + inputs = CFFConverter._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -41,7 +41,7 @@ def test_CFFConverter_inputs(): def test_CFFConverter_outputs(): output_map = dict(connectome_file=dict(), ) - outputs = CFFConverter.output_spec() + outputs = CFFConverter._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/cmtk/tests/test_auto_CreateMatrix.py b/nipype/interfaces/cmtk/tests/test_auto_CreateMatrix.py index c986c02c7b..63c1bd27f1 100644 --- a/nipype/interfaces/cmtk/tests/test_auto_CreateMatrix.py +++ b/nipype/interfaces/cmtk/tests/test_auto_CreateMatrix.py @@ -27,7 +27,7 @@ def test_CreateMatrix_inputs(): tract_file=dict(mandatory=True, ), ) - inputs = CreateMatrix.input_spec() + inputs = CreateMatrix._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -54,7 +54,7 @@ def test_CreateMatrix_outputs(): median_fiber_length_matrix_mat_file=dict(), stats_file=dict(), ) - outputs = CreateMatrix.output_spec() + outputs = CreateMatrix._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/cmtk/tests/test_auto_CreateNodes.py b/nipype/interfaces/cmtk/tests/test_auto_CreateNodes.py index c5d9fe4163..f427372099 100644 --- a/nipype/interfaces/cmtk/tests/test_auto_CreateNodes.py +++ b/nipype/interfaces/cmtk/tests/test_auto_CreateNodes.py @@ -14,7 +14,7 @@ def test_CreateNodes_inputs(): roi_file=dict(mandatory=True, ), ) - inputs = CreateNodes.input_spec() + inputs = CreateNodes._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -24,7 +24,7 @@ def test_CreateNodes_inputs(): def test_CreateNodes_outputs(): output_map = dict(node_network=dict(), ) - outputs = CreateNodes.output_spec() + outputs = CreateNodes._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/cmtk/tests/test_auto_MergeCNetworks.py b/nipype/interfaces/cmtk/tests/test_auto_MergeCNetworks.py index 73654ced71..2ee0172ab9 100644 --- a/nipype/interfaces/cmtk/tests/test_auto_MergeCNetworks.py +++ b/nipype/interfaces/cmtk/tests/test_auto_MergeCNetworks.py @@ -12,7 +12,7 @@ def test_MergeCNetworks_inputs(): out_file=dict(usedefault=True, ), ) - inputs = MergeCNetworks.input_spec() + inputs = MergeCNetworks._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -22,7 +22,7 @@ def test_MergeCNetworks_inputs(): def test_MergeCNetworks_outputs(): output_map = dict(connectome_file=dict(), ) - outputs = MergeCNetworks.output_spec() + outputs = MergeCNetworks._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/cmtk/tests/test_auto_NetworkBasedStatistic.py b/nipype/interfaces/cmtk/tests/test_auto_NetworkBasedStatistic.py index 70857e1b98..255cc29a55 100644 --- a/nipype/interfaces/cmtk/tests/test_auto_NetworkBasedStatistic.py +++ b/nipype/interfaces/cmtk/tests/test_auto_NetworkBasedStatistic.py @@ -23,7 +23,7 @@ def test_NetworkBasedStatistic_inputs(): threshold=dict(usedefault=True, ), ) - inputs = NetworkBasedStatistic.input_spec() + inputs = NetworkBasedStatistic._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -35,7 +35,7 @@ def test_NetworkBasedStatistic_outputs(): nbs_pval_network=dict(), network_files=dict(), ) - outputs = NetworkBasedStatistic.output_spec() + outputs = NetworkBasedStatistic._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/cmtk/tests/test_auto_NetworkXMetrics.py b/nipype/interfaces/cmtk/tests/test_auto_NetworkXMetrics.py index e26c389974..d084cbf613 100644 --- a/nipype/interfaces/cmtk/tests/test_auto_NetworkXMetrics.py +++ b/nipype/interfaces/cmtk/tests/test_auto_NetworkXMetrics.py @@ -28,7 +28,7 @@ def test_NetworkXMetrics_inputs(): treat_as_weighted_graph=dict(usedefault=True, ), ) - inputs = NetworkXMetrics.input_spec() + inputs = NetworkXMetrics._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -50,7 +50,7 @@ def test_NetworkXMetrics_outputs(): node_measures_matlab=dict(), pickled_extra_measures=dict(), ) - outputs = NetworkXMetrics.output_spec() + outputs = NetworkXMetrics._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/cmtk/tests/test_auto_Parcellate.py b/nipype/interfaces/cmtk/tests/test_auto_Parcellate.py index eff984ea54..470caa54f9 100644 --- a/nipype/interfaces/cmtk/tests/test_auto_Parcellate.py +++ b/nipype/interfaces/cmtk/tests/test_auto_Parcellate.py @@ -18,7 +18,7 @@ def test_Parcellate_inputs(): ), subjects_dir=dict(), ) - inputs = Parcellate.input_spec() + inputs = Parcellate._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -35,7 +35,7 @@ def test_Parcellate_outputs(): roiv_file=dict(), white_matter_mask_file=dict(), ) - outputs = Parcellate.output_spec() + outputs = Parcellate._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/cmtk/tests/test_auto_ROIGen.py b/nipype/interfaces/cmtk/tests/test_auto_ROIGen.py index 2869299324..182f1e82d1 100644 --- a/nipype/interfaces/cmtk/tests/test_auto_ROIGen.py +++ b/nipype/interfaces/cmtk/tests/test_auto_ROIGen.py @@ -20,7 +20,7 @@ def test_ROIGen_inputs(): use_freesurfer_LUT=dict(xor=['LUT_file'], ), ) - inputs = ROIGen.input_spec() + inputs = ROIGen._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -31,7 +31,7 @@ def test_ROIGen_outputs(): output_map = dict(dict_file=dict(), roi_file=dict(), ) - outputs = ROIGen.output_spec() + outputs = ROIGen._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/dcm2nii.py b/nipype/interfaces/dcm2nii.py index d5d91cd061..172790ce2b 100644 --- a/nipype/interfaces/dcm2nii.py +++ b/nipype/interfaces/dcm2nii.py @@ -63,8 +63,8 @@ class Dcm2nii(CommandLine): 'dcm2nii -a y -c y -b config.ini -v y -d y -e y -g y -i n -n y -o . -p y -x n -f n functional_1.dcm' """ - input_spec = Dcm2niiInputSpec - output_spec = Dcm2niiOutputSpec + _input_spec = Dcm2niiInputSpec + _output_spec = Dcm2niiOutputSpec _cmd = 'dcm2nii' def _format_arg(self, opt, spec, val): diff --git a/nipype/interfaces/dcmstack.py b/nipype/interfaces/dcmstack.py index 18dc39bed9..0112548584 100644 --- a/nipype/interfaces/dcmstack.py +++ b/nipype/interfaces/dcmstack.py @@ -125,8 +125,8 @@ class DcmStack(NiftiGeneratorBase): >>> result.outputs.out_file # doctest: +SKIP '/path/to/cwd/sequence.nii.gz' """ - input_spec = DcmStackInputSpec - output_spec = DcmStackOutputSpec + _input_spec = DcmStackInputSpec + _output_spec = DcmStackOutputSpec def _get_filelist(self, trait_input): if isinstance(trait_input, string_types): @@ -172,8 +172,8 @@ class GroupAndStackOutputSpec(TraitedSpec): class GroupAndStack(DcmStack): """Create (potentially) multiple Nifti files for a set of DICOM files. """ - input_spec = DcmStackInputSpec - output_spec = GroupAndStackOutputSpec + _input_spec = DcmStackInputSpec + _output_spec = GroupAndStackOutputSpec def _run_interface(self, runtime): src_paths = self._get_filelist(self.inputs.dicom_files) @@ -225,8 +225,8 @@ class LookupMeta(BaseInterface): >>> result.outputs.TE # doctest: +SKIP 95.0 """ - input_spec = LookupMetaInputSpec - output_spec = DynamicTraitedSpec + _input_spec = LookupMetaInputSpec + _output_spec = DynamicTraitedSpec def _make_name_map(self): if isinstance(self.inputs.meta_keys, list): @@ -279,8 +279,8 @@ class CopyMetaOutputSpec(TraitedSpec): class CopyMeta(BaseInterface): """Copy meta data from one Nifti file to another. Useful for preserving meta data after some processing steps.""" - input_spec = CopyMetaInputSpec - output_spec = CopyMetaOutputSpec + _input_spec = CopyMetaInputSpec + _output_spec = CopyMetaOutputSpec def _run_interface(self, runtime): src_nii = nb.load(self.inputs.src_file) @@ -344,8 +344,8 @@ def key_func(src_nii): class MergeNifti(NiftiGeneratorBase): """Merge multiple Nifti files into one. Merges together meta data extensions as well.""" - input_spec = MergeNiftiInputSpec - output_spec = MergeNiftiOutputSpec + _input_spec = MergeNiftiInputSpec + _output_spec = MergeNiftiOutputSpec def _run_interface(self, runtime): niis = [nb.load(fn) @@ -389,8 +389,8 @@ class SplitNifti(NiftiGeneratorBase): Split one Nifti file into many along the specified dimension. Each result has an updated meta data extension as well. """ - input_spec = SplitNiftiInputSpec - output_spec = SplitNiftiOutputSpec + _input_spec = SplitNiftiInputSpec + _output_spec = SplitNiftiOutputSpec def _run_interface(self, runtime): self.out_list = [] diff --git a/nipype/interfaces/diffusion_toolkit/dti.py b/nipype/interfaces/diffusion_toolkit/dti.py index 921c6a225a..25db245884 100644 --- a/nipype/interfaces/diffusion_toolkit/dti.py +++ b/nipype/interfaces/diffusion_toolkit/dti.py @@ -62,8 +62,8 @@ class DTIRecon(CommandLine): """Use dti_recon to generate tensors and other maps """ - input_spec = DTIReconInputSpec - output_spec = DTIReconOutputSpec + _input_spec = DTIReconInputSpec + _output_spec = DTIReconOutputSpec _cmd = 'dti_recon' @@ -151,8 +151,8 @@ class DTITrackerOutputSpec(TraitedSpec): class DTITracker(CommandLine): - input_spec = DTITrackerInputSpec - output_spec = DTITrackerOutputSpec + _input_spec = DTITrackerInputSpec + _output_spec = DTITrackerOutputSpec _cmd = 'dti_tracker' diff --git a/nipype/interfaces/diffusion_toolkit/odf.py b/nipype/interfaces/diffusion_toolkit/odf.py index 501b67d288..35cc9f38ca 100644 --- a/nipype/interfaces/diffusion_toolkit/odf.py +++ b/nipype/interfaces/diffusion_toolkit/odf.py @@ -58,8 +58,8 @@ class HARDIMatOutputSpec(TraitedSpec): class HARDIMat(CommandLine): """Use hardi_mat to calculate a reconstruction matrix from a gradient table """ - input_spec = HARDIMatInputSpec - output_spec = HARDIMatOutputSpec + _input_spec = HARDIMatInputSpec + _output_spec = HARDIMatOutputSpec _cmd = 'hardi_mat' @@ -132,8 +132,8 @@ class ODFRecon(CommandLine): """Use odf_recon to generate tensors and other maps """ - input_spec = ODFReconInputSpec - output_spec = ODFReconOutputSpec + _input_spec = ODFReconInputSpec + _output_spec = ODFReconOutputSpec _cmd = 'odf_recon' @@ -213,8 +213,8 @@ class ODFTracker(CommandLine): """Use odf_tracker to generate track file """ - input_spec = ODFTrackerInputSpec - output_spec = ODFTrackerOutputSpec + _input_spec = ODFTrackerInputSpec + _output_spec = ODFTrackerOutputSpec _cmd = 'odf_tracker' diff --git a/nipype/interfaces/diffusion_toolkit/postproc.py b/nipype/interfaces/diffusion_toolkit/postproc.py index 55af4a4bb4..ca6f478269 100644 --- a/nipype/interfaces/diffusion_toolkit/postproc.py +++ b/nipype/interfaces/diffusion_toolkit/postproc.py @@ -45,8 +45,8 @@ class SplineFilter(CommandLine): >>> filt.inputs.step_length = 0.5 >>> filt.run() # doctest: +SKIP """ - input_spec = SplineFilterInputSpec - output_spec = SplineFilterOutputSpec + _input_spec = SplineFilterInputSpec + _output_spec = SplineFilterOutputSpec _cmd = "spline_filter" @@ -84,8 +84,8 @@ class TrackMerge(CommandLine): >>> mrg.inputs.track_files = ['track1.trk','track2.trk'] >>> mrg.run() # doctest: +SKIP """ - input_spec = TrackMergeInputSpec - output_spec = TrackMergeOutputSpec + _input_spec = TrackMergeInputSpec + _output_spec = TrackMergeOutputSpec _cmd = "track_merge" diff --git a/nipype/interfaces/diffusion_toolkit/tests/test_auto_DTIRecon.py b/nipype/interfaces/diffusion_toolkit/tests/test_auto_DTIRecon.py index 907df7eb13..b459700a8b 100644 --- a/nipype/interfaces/diffusion_toolkit/tests/test_auto_DTIRecon.py +++ b/nipype/interfaces/diffusion_toolkit/tests/test_auto_DTIRecon.py @@ -39,7 +39,7 @@ def test_DTIRecon_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = DTIRecon.input_spec() + inputs = DTIRecon._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -60,7 +60,7 @@ def test_DTIRecon_outputs(): exp=dict(), tensor=dict(), ) - outputs = DTIRecon.output_spec() + outputs = DTIRecon._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/diffusion_toolkit/tests/test_auto_DTITracker.py b/nipype/interfaces/diffusion_toolkit/tests/test_auto_DTITracker.py index d21a6ecb34..df265bb39b 100644 --- a/nipype/interfaces/diffusion_toolkit/tests/test_auto_DTITracker.py +++ b/nipype/interfaces/diffusion_toolkit/tests/test_auto_DTITracker.py @@ -63,7 +63,7 @@ def test_DTITracker_inputs(): tracking_method=dict(argstr='-%s', ), ) - inputs = DTITracker.input_spec() + inputs = DTITracker._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -74,7 +74,7 @@ def test_DTITracker_outputs(): output_map = dict(mask_file=dict(), track_file=dict(), ) - outputs = DTITracker.output_spec() + outputs = DTITracker._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/diffusion_toolkit/tests/test_auto_HARDIMat.py b/nipype/interfaces/diffusion_toolkit/tests/test_auto_HARDIMat.py index 725bbef73a..218cae5a10 100644 --- a/nipype/interfaces/diffusion_toolkit/tests/test_auto_HARDIMat.py +++ b/nipype/interfaces/diffusion_toolkit/tests/test_auto_HARDIMat.py @@ -37,7 +37,7 @@ def test_HARDIMat_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = HARDIMat.input_spec() + inputs = HARDIMat._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -47,7 +47,7 @@ def test_HARDIMat_inputs(): def test_HARDIMat_outputs(): output_map = dict(out_file=dict(), ) - outputs = HARDIMat.output_spec() + outputs = HARDIMat._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/diffusion_toolkit/tests/test_auto_ODFRecon.py b/nipype/interfaces/diffusion_toolkit/tests/test_auto_ODFRecon.py index 641fb1ad93..321c637e8b 100644 --- a/nipype/interfaces/diffusion_toolkit/tests/test_auto_ODFRecon.py +++ b/nipype/interfaces/diffusion_toolkit/tests/test_auto_ODFRecon.py @@ -54,7 +54,7 @@ def test_ODFRecon_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ODFRecon.input_spec() + inputs = ODFRecon._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -68,7 +68,7 @@ def test_ODFRecon_outputs(): entropy=dict(), max=dict(), ) - outputs = ODFRecon.output_spec() + outputs = ODFRecon._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/diffusion_toolkit/tests/test_auto_ODFTracker.py b/nipype/interfaces/diffusion_toolkit/tests/test_auto_ODFTracker.py index ba57c26e02..6978fd51e4 100644 --- a/nipype/interfaces/diffusion_toolkit/tests/test_auto_ODFTracker.py +++ b/nipype/interfaces/diffusion_toolkit/tests/test_auto_ODFTracker.py @@ -73,7 +73,7 @@ def test_ODFTracker_inputs(): voxel_order=dict(argstr='-vorder %s', ), ) - inputs = ODFTracker.input_spec() + inputs = ODFTracker._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -83,7 +83,7 @@ def test_ODFTracker_inputs(): def test_ODFTracker_outputs(): output_map = dict(track_file=dict(), ) - outputs = ODFTracker.output_spec() + outputs = ODFTracker._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/diffusion_toolkit/tests/test_auto_SplineFilter.py b/nipype/interfaces/diffusion_toolkit/tests/test_auto_SplineFilter.py index 8079634c80..749e661923 100644 --- a/nipype/interfaces/diffusion_toolkit/tests/test_auto_SplineFilter.py +++ b/nipype/interfaces/diffusion_toolkit/tests/test_auto_SplineFilter.py @@ -27,7 +27,7 @@ def test_SplineFilter_inputs(): position=0, ), ) - inputs = SplineFilter.input_spec() + inputs = SplineFilter._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -37,7 +37,7 @@ def test_SplineFilter_inputs(): def test_SplineFilter_outputs(): output_map = dict(smoothed_track_file=dict(), ) - outputs = SplineFilter.output_spec() + outputs = SplineFilter._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/diffusion_toolkit/tests/test_auto_TrackMerge.py b/nipype/interfaces/diffusion_toolkit/tests/test_auto_TrackMerge.py index 5eaa8f1224..21d26cfb75 100644 --- a/nipype/interfaces/diffusion_toolkit/tests/test_auto_TrackMerge.py +++ b/nipype/interfaces/diffusion_toolkit/tests/test_auto_TrackMerge.py @@ -23,7 +23,7 @@ def test_TrackMerge_inputs(): position=0, ), ) - inputs = TrackMerge.input_spec() + inputs = TrackMerge._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -33,7 +33,7 @@ def test_TrackMerge_inputs(): def test_TrackMerge_outputs(): output_map = dict(track_file=dict(), ) - outputs = TrackMerge.output_spec() + outputs = TrackMerge._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/dipy/base.py b/nipype/interfaces/dipy/base.py index 4051b3cf7d..f5bdbd1f38 100644 --- a/nipype/interfaces/dipy/base.py +++ b/nipype/interfaces/dipy/base.py @@ -54,7 +54,7 @@ class DipyDiffusionInterface(DipyBaseInterface): """ A base interface for py:mod:`dipy` computations """ - input_spec = DipyBaseInputSpec + _input_spec = DipyBaseInputSpec def _get_gradient_table(self): bval = np.loadtxt(self.inputs.in_bval) diff --git a/nipype/interfaces/dipy/preprocess.py b/nipype/interfaces/dipy/preprocess.py index cb168458be..c344360c57 100644 --- a/nipype/interfaces/dipy/preprocess.py +++ b/nipype/interfaces/dipy/preprocess.py @@ -49,8 +49,8 @@ class Resample(DipyBaseInterface): >>> reslice.inputs.in_file = 'diffusion.nii' >>> reslice.run() # doctest: +SKIP """ - input_spec = ResampleInputSpec - output_spec = ResampleOutputSpec + _input_spec = ResampleInputSpec + _output_spec = ResampleOutputSpec def _run_interface(self, runtime): order = self.inputs.interp @@ -118,8 +118,8 @@ class Denoise(DipyBaseInterface): >>> denoise.inputs.in_file = 'diffusion.nii' >>> denoise.run() # doctest: +SKIP """ - input_spec = DenoiseInputSpec - output_spec = DenoiseOutputSpec + _input_spec = DenoiseInputSpec + _output_spec = DenoiseOutputSpec def _run_interface(self, runtime): out_file = op.abspath(self._gen_outfilename()) diff --git a/nipype/interfaces/dipy/reconstruction.py b/nipype/interfaces/dipy/reconstruction.py index 4525d3af24..6f6c939686 100644 --- a/nipype/interfaces/dipy/reconstruction.py +++ b/nipype/interfaces/dipy/reconstruction.py @@ -60,8 +60,8 @@ class RESTORE(DipyDiffusionInterface): """ - input_spec = RESTOREInputSpec - output_spec = RESTOREOutputSpec + _input_spec = RESTOREInputSpec + _output_spec = RESTOREOutputSpec def _run_interface(self, runtime): from scipy.special import gamma @@ -195,8 +195,8 @@ class EstimateResponseSH(DipyDiffusionInterface): """ - input_spec = EstimateResponseSHInputSpec - output_spec = EstimateResponseSHOutputSpec + _input_spec = EstimateResponseSHInputSpec + _output_spec = EstimateResponseSHOutputSpec def _run_interface(self, runtime): from dipy.core.gradients import GradientTable @@ -306,8 +306,8 @@ class CSD(DipyDiffusionInterface): >>> csd.inputs.in_bvec = 'bvecs' >>> res = csd.run() # doctest: +SKIP """ - input_spec = CSDInputSpec - output_spec = CSDOutputSpec + _input_spec = CSDInputSpec + _output_spec = CSDOutputSpec def _run_interface(self, runtime): from dipy.reconst.csdeconv import ConstrainedSphericalDeconvModel diff --git a/nipype/interfaces/dipy/simulate.py b/nipype/interfaces/dipy/simulate.py index 17f14b680b..b6399dbd0f 100644 --- a/nipype/interfaces/dipy/simulate.py +++ b/nipype/interfaces/dipy/simulate.py @@ -86,8 +86,8 @@ class SimulateMultiTensor(DipyBaseInterface): >>> sim.inputs.in_bval = 'bvals' >>> sim.run() # doctest: +SKIP """ - input_spec = SimulateMultiTensorInputSpec - output_spec = SimulateMultiTensorOutputSpec + _input_spec = SimulateMultiTensorInputSpec + _output_spec = SimulateMultiTensorOutputSpec def _run_interface(self, runtime): from dipy.core.gradients import gradient_table diff --git a/nipype/interfaces/dipy/tensors.py b/nipype/interfaces/dipy/tensors.py index 17ce947578..d5e48b40fd 100644 --- a/nipype/interfaces/dipy/tensors.py +++ b/nipype/interfaces/dipy/tensors.py @@ -37,8 +37,8 @@ class DTI(DipyDiffusionInterface): >>> dti.inputs.in_bval = 'bvals' >>> dti.run() # doctest: +SKIP """ - input_spec = DTIInputSpec - output_spec = DTIOutputSpec + _input_spec = DTIInputSpec + _output_spec = DTIOutputSpec def _run_interface(self, runtime): from dipy.reconst import dti @@ -98,8 +98,8 @@ class TensorMode(DipyDiffusionInterface): >>> mode.inputs.in_bval = 'bvals' >>> mode.run() # doctest: +SKIP """ - input_spec = TensorModeInputSpec - output_spec = TensorModeOutputSpec + _input_spec = TensorModeInputSpec + _output_spec = TensorModeOutputSpec def _run_interface(self, runtime): from dipy.reconst import dti diff --git a/nipype/interfaces/dipy/tests/test_auto_CSD.py b/nipype/interfaces/dipy/tests/test_auto_CSD.py index d99aac4527..ad74719962 100644 --- a/nipype/interfaces/dipy/tests/test_auto_CSD.py +++ b/nipype/interfaces/dipy/tests/test_auto_CSD.py @@ -26,7 +26,7 @@ def test_CSD_inputs(): usedefault=True, ), ) - inputs = CSD.input_spec() + inputs = CSD._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -37,7 +37,7 @@ def test_CSD_outputs(): output_map = dict(model=dict(), out_fods=dict(), ) - outputs = CSD.output_spec() + outputs = CSD._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/dipy/tests/test_auto_DTI.py b/nipype/interfaces/dipy/tests/test_auto_DTI.py index eb35d6a9e2..db9c40c929 100644 --- a/nipype/interfaces/dipy/tests/test_auto_DTI.py +++ b/nipype/interfaces/dipy/tests/test_auto_DTI.py @@ -18,7 +18,7 @@ def test_DTI_inputs(): mask_file=dict(), out_prefix=dict(), ) - inputs = DTI.input_spec() + inputs = DTI._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -28,7 +28,7 @@ def test_DTI_inputs(): def test_DTI_outputs(): output_map = dict(out_file=dict(), ) - outputs = DTI.output_spec() + outputs = DTI._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/dipy/tests/test_auto_Denoise.py b/nipype/interfaces/dipy/tests/test_auto_Denoise.py index 6a400231c4..c23451602b 100644 --- a/nipype/interfaces/dipy/tests/test_auto_Denoise.py +++ b/nipype/interfaces/dipy/tests/test_auto_Denoise.py @@ -16,7 +16,7 @@ def test_Denoise_inputs(): signal_mask=dict(), snr=dict(), ) - inputs = Denoise.input_spec() + inputs = Denoise._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -26,7 +26,7 @@ def test_Denoise_inputs(): def test_Denoise_outputs(): output_map = dict(out_file=dict(), ) - outputs = Denoise.output_spec() + outputs = Denoise._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/dipy/tests/test_auto_DipyBaseInterface.py b/nipype/interfaces/dipy/tests/test_auto_DipyBaseInterface.py index cf1a9f0169..8fab1caf82 100644 --- a/nipype/interfaces/dipy/tests/test_auto_DipyBaseInterface.py +++ b/nipype/interfaces/dipy/tests/test_auto_DipyBaseInterface.py @@ -8,7 +8,7 @@ def test_DipyBaseInterface_inputs(): usedefault=True, ), ) - inputs = DipyBaseInterface.input_spec() + inputs = DipyBaseInterface._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -17,7 +17,7 @@ def test_DipyBaseInterface_inputs(): def test_DipyBaseInterface_outputs(): output_map = dict() - outputs = DipyBaseInterface.output_spec() + outputs = DipyBaseInterface._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/dipy/tests/test_auto_DipyDiffusionInterface.py b/nipype/interfaces/dipy/tests/test_auto_DipyDiffusionInterface.py index 287b1720e6..04ff1092a9 100644 --- a/nipype/interfaces/dipy/tests/test_auto_DipyDiffusionInterface.py +++ b/nipype/interfaces/dipy/tests/test_auto_DipyDiffusionInterface.py @@ -17,7 +17,7 @@ def test_DipyDiffusionInterface_inputs(): ), out_prefix=dict(), ) - inputs = DipyDiffusionInterface.input_spec() + inputs = DipyDiffusionInterface._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -26,7 +26,7 @@ def test_DipyDiffusionInterface_inputs(): def test_DipyDiffusionInterface_outputs(): output_map = dict() - outputs = DipyDiffusionInterface.output_spec() + outputs = DipyDiffusionInterface._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/dipy/tests/test_auto_EstimateResponseSH.py b/nipype/interfaces/dipy/tests/test_auto_EstimateResponseSH.py index 95e702bd50..46d8962a32 100644 --- a/nipype/interfaces/dipy/tests/test_auto_EstimateResponseSH.py +++ b/nipype/interfaces/dipy/tests/test_auto_EstimateResponseSH.py @@ -34,7 +34,7 @@ def test_EstimateResponseSH_inputs(): roi_radius=dict(usedefault=True, ), ) - inputs = EstimateResponseSH.input_spec() + inputs = EstimateResponseSH._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -45,7 +45,7 @@ def test_EstimateResponseSH_outputs(): output_map = dict(out_mask=dict(), response=dict(), ) - outputs = EstimateResponseSH.output_spec() + outputs = EstimateResponseSH._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/dipy/tests/test_auto_RESTORE.py b/nipype/interfaces/dipy/tests/test_auto_RESTORE.py index c06bc74573..01c758854a 100644 --- a/nipype/interfaces/dipy/tests/test_auto_RESTORE.py +++ b/nipype/interfaces/dipy/tests/test_auto_RESTORE.py @@ -19,7 +19,7 @@ def test_RESTORE_inputs(): noise_mask=dict(), out_prefix=dict(), ) - inputs = RESTORE.input_spec() + inputs = RESTORE._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -35,7 +35,7 @@ def test_RESTORE_outputs(): rd=dict(), trace=dict(), ) - outputs = RESTORE.output_spec() + outputs = RESTORE._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/dipy/tests/test_auto_Resample.py b/nipype/interfaces/dipy/tests/test_auto_Resample.py index 06c462dd2d..09a68c17f2 100644 --- a/nipype/interfaces/dipy/tests/test_auto_Resample.py +++ b/nipype/interfaces/dipy/tests/test_auto_Resample.py @@ -11,7 +11,7 @@ def test_Resample_inputs(): ), vox_size=dict(), ) - inputs = Resample.input_spec() + inputs = Resample._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -21,7 +21,7 @@ def test_Resample_inputs(): def test_Resample_outputs(): output_map = dict(out_file=dict(), ) - outputs = Resample.output_spec() + outputs = Resample._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/dipy/tests/test_auto_SimulateMultiTensor.py b/nipype/interfaces/dipy/tests/test_auto_SimulateMultiTensor.py index 5bc7a2928f..c3c520574e 100644 --- a/nipype/interfaces/dipy/tests/test_auto_SimulateMultiTensor.py +++ b/nipype/interfaces/dipy/tests/test_auto_SimulateMultiTensor.py @@ -40,7 +40,7 @@ def test_SimulateMultiTensor_inputs(): snr=dict(usedefault=True, ), ) - inputs = SimulateMultiTensor.input_spec() + inputs = SimulateMultiTensor._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -53,7 +53,7 @@ def test_SimulateMultiTensor_outputs(): out_file=dict(), out_mask=dict(), ) - outputs = SimulateMultiTensor.output_spec() + outputs = SimulateMultiTensor._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/dipy/tests/test_auto_StreamlineTractography.py b/nipype/interfaces/dipy/tests/test_auto_StreamlineTractography.py index b4c4dae679..7b6ca95a3d 100644 --- a/nipype/interfaces/dipy/tests/test_auto_StreamlineTractography.py +++ b/nipype/interfaces/dipy/tests/test_auto_StreamlineTractography.py @@ -34,7 +34,7 @@ def test_StreamlineTractography_inputs(): seed_mask=dict(), tracking_mask=dict(), ) - inputs = StreamlineTractography.input_spec() + inputs = StreamlineTractography._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -47,7 +47,7 @@ def test_StreamlineTractography_outputs(): out_seeds=dict(), tracks=dict(), ) - outputs = StreamlineTractography.output_spec() + outputs = StreamlineTractography._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/dipy/tests/test_auto_TensorMode.py b/nipype/interfaces/dipy/tests/test_auto_TensorMode.py index 53f77d5d33..b88c350c79 100644 --- a/nipype/interfaces/dipy/tests/test_auto_TensorMode.py +++ b/nipype/interfaces/dipy/tests/test_auto_TensorMode.py @@ -18,7 +18,7 @@ def test_TensorMode_inputs(): mask_file=dict(), out_prefix=dict(), ) - inputs = TensorMode.input_spec() + inputs = TensorMode._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -28,7 +28,7 @@ def test_TensorMode_inputs(): def test_TensorMode_outputs(): output_map = dict(out_file=dict(), ) - outputs = TensorMode.output_spec() + outputs = TensorMode._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/dipy/tests/test_auto_TrackDensityMap.py b/nipype/interfaces/dipy/tests/test_auto_TrackDensityMap.py index 187c4c0d49..c86e067efa 100644 --- a/nipype/interfaces/dipy/tests/test_auto_TrackDensityMap.py +++ b/nipype/interfaces/dipy/tests/test_auto_TrackDensityMap.py @@ -17,7 +17,7 @@ def test_TrackDensityMap_inputs(): reference=dict(), voxel_dims=dict(), ) - inputs = TrackDensityMap.input_spec() + inputs = TrackDensityMap._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -27,7 +27,7 @@ def test_TrackDensityMap_inputs(): def test_TrackDensityMap_outputs(): output_map = dict(out_file=dict(), ) - outputs = TrackDensityMap.output_spec() + outputs = TrackDensityMap._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/dipy/tracks.py b/nipype/interfaces/dipy/tracks.py index 58f4cda1f5..623aab240c 100644 --- a/nipype/interfaces/dipy/tracks.py +++ b/nipype/interfaces/dipy/tracks.py @@ -53,8 +53,8 @@ class TrackDensityMap(DipyBaseInterface): >>> trk2tdi.run() # doctest: +SKIP """ - input_spec = TrackDensityMapInputSpec - output_spec = TrackDensityMapOutputSpec + _input_spec = TrackDensityMapInputSpec + _output_spec = TrackDensityMapOutputSpec def _run_interface(self, runtime): from numpy import min_scalar_type @@ -155,8 +155,8 @@ class StreamlineTractography(DipyBaseInterface): >>> track.inputs.tracking_mask = 'dilated_wm_mask.nii' >>> res = track.run() # doctest: +SKIP """ - input_spec = StreamlineTractographyInputSpec - output_spec = StreamlineTractographyOutputSpec + _input_spec = StreamlineTractographyInputSpec + _output_spec = StreamlineTractographyOutputSpec def _run_interface(self, runtime): from dipy.reconst.peaks import peaks_from_model diff --git a/nipype/interfaces/dynamic_slicer.py b/nipype/interfaces/dynamic_slicer.py index e5d9225d2f..a0ad9fe82e 100644 --- a/nipype/interfaces/dynamic_slicer.py +++ b/nipype/interfaces/dynamic_slicer.py @@ -28,8 +28,8 @@ class SlicerCommandLine(CommandLine): """ _cmd = "Slicer3" - input_spec = SlicerCommandLineInputSpec - output_spec = DynamicTraitedSpec + _input_spec = SlicerCommandLineInputSpec + _output_spec = DynamicTraitedSpec def _grab_xml(self, module): cmd = CommandLine(command="Slicer3", args="--launch %s --xml" % module) diff --git a/nipype/interfaces/elastix/registration.py b/nipype/interfaces/elastix/registration.py index 9aa38e4b66..0cc3ec5958 100644 --- a/nipype/interfaces/elastix/registration.py +++ b/nipype/interfaces/elastix/registration.py @@ -62,8 +62,8 @@ class Registration(CommandLine): """ _cmd = 'elastix' - input_spec = RegistrationInputSpec - output_spec = RegistrationOutputSpec + _input_spec = RegistrationInputSpec + _output_spec = RegistrationOutputSpec def _post_run(self): @@ -152,8 +152,8 @@ class ApplyWarp(CommandLine): """ _cmd = 'transformix' - input_spec = ApplyWarpInputSpec - output_spec = ApplyWarpOutputSpec + _input_spec = ApplyWarpInputSpec + _output_spec = ApplyWarpOutputSpec def _post_run(self): out_dir = op.abspath(self.inputs.output_path) @@ -190,8 +190,8 @@ class AnalyzeWarp(CommandLine): """ _cmd = 'transformix -def all -jac all -jacmat all' - input_spec = AnalyzeWarpInputSpec - output_spec = AnalyzeWarpOutputSpec + _input_spec = AnalyzeWarpInputSpec + _output_spec = AnalyzeWarpOutputSpec def _post_run(self): out_dir = op.abspath(self.inputs.output_path) @@ -229,8 +229,8 @@ class PointsWarp(CommandLine): """ _cmd = 'transformix' - input_spec = PointsWarpInputSpec - output_spec = PointsWarpOutputSpec + _input_spec = PointsWarpInputSpec + _output_spec = PointsWarpOutputSpec def _post_run(self): out_dir = op.abspath(self.inputs.output_path) diff --git a/nipype/interfaces/elastix/tests/test_auto_AnalyzeWarp.py b/nipype/interfaces/elastix/tests/test_auto_AnalyzeWarp.py index a298b4ade6..b78e0461e9 100644 --- a/nipype/interfaces/elastix/tests/test_auto_AnalyzeWarp.py +++ b/nipype/interfaces/elastix/tests/test_auto_AnalyzeWarp.py @@ -25,7 +25,7 @@ def test_AnalyzeWarp_inputs(): mandatory=True, ), ) - inputs = AnalyzeWarp.input_spec() + inputs = AnalyzeWarp._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -37,7 +37,7 @@ def test_AnalyzeWarp_outputs(): jacdet_map=dict(), jacmat_map=dict(), ) - outputs = AnalyzeWarp.output_spec() + outputs = AnalyzeWarp._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/elastix/tests/test_auto_ApplyWarp.py b/nipype/interfaces/elastix/tests/test_auto_ApplyWarp.py index 1d6addb92a..7fdd3b78b4 100644 --- a/nipype/interfaces/elastix/tests/test_auto_ApplyWarp.py +++ b/nipype/interfaces/elastix/tests/test_auto_ApplyWarp.py @@ -28,7 +28,7 @@ def test_ApplyWarp_inputs(): mandatory=True, ), ) - inputs = ApplyWarp.input_spec() + inputs = ApplyWarp._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -38,7 +38,7 @@ def test_ApplyWarp_inputs(): def test_ApplyWarp_outputs(): output_map = dict(warped_file=dict(), ) - outputs = ApplyWarp.output_spec() + outputs = ApplyWarp._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/elastix/tests/test_auto_EditTransform.py b/nipype/interfaces/elastix/tests/test_auto_EditTransform.py index 9b5c082299..65b4a1ed2f 100644 --- a/nipype/interfaces/elastix/tests/test_auto_EditTransform.py +++ b/nipype/interfaces/elastix/tests/test_auto_EditTransform.py @@ -19,7 +19,7 @@ def test_EditTransform_inputs(): transform_file=dict(mandatory=True, ), ) - inputs = EditTransform.input_spec() + inputs = EditTransform._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -29,7 +29,7 @@ def test_EditTransform_inputs(): def test_EditTransform_outputs(): output_map = dict(output_file=dict(), ) - outputs = EditTransform.output_spec() + outputs = EditTransform._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/elastix/tests/test_auto_PointsWarp.py b/nipype/interfaces/elastix/tests/test_auto_PointsWarp.py index de12ae5698..bf0440079c 100644 --- a/nipype/interfaces/elastix/tests/test_auto_PointsWarp.py +++ b/nipype/interfaces/elastix/tests/test_auto_PointsWarp.py @@ -28,7 +28,7 @@ def test_PointsWarp_inputs(): mandatory=True, ), ) - inputs = PointsWarp.input_spec() + inputs = PointsWarp._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -38,7 +38,7 @@ def test_PointsWarp_inputs(): def test_PointsWarp_outputs(): output_map = dict(warped_file=dict(), ) - outputs = PointsWarp.output_spec() + outputs = PointsWarp._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/elastix/tests/test_auto_Registration.py b/nipype/interfaces/elastix/tests/test_auto_Registration.py index 4bbe547488..474bc8d7ec 100644 --- a/nipype/interfaces/elastix/tests/test_auto_Registration.py +++ b/nipype/interfaces/elastix/tests/test_auto_Registration.py @@ -37,7 +37,7 @@ def test_Registration_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Registration.input_spec() + inputs = Registration._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -50,7 +50,7 @@ def test_Registration_outputs(): warped_files=dict(), warped_files_flags=dict(), ) - outputs = Registration.output_spec() + outputs = Registration._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/elastix/utils.py b/nipype/interfaces/elastix/utils.py index fb5fb28779..feaf7b5c12 100644 --- a/nipype/interfaces/elastix/utils.py +++ b/nipype/interfaces/elastix/utils.py @@ -56,8 +56,8 @@ class EditTransform(BaseInterface): """ - input_spec = EditTransformInputSpec - output_spec = EditTransformOutputSpec + _input_spec = EditTransformInputSpec + _output_spec = EditTransformOutputSpec _out_file = '' _pattern = '\((?P%s\s\"?)([-\.\s\w]+)(\"?\))' diff --git a/nipype/interfaces/freesurfer/base.py b/nipype/interfaces/freesurfer/base.py index 4498d88b84..48b0b7ad86 100644 --- a/nipype/interfaces/freesurfer/base.py +++ b/nipype/interfaces/freesurfer/base.py @@ -94,7 +94,7 @@ class FSCommand(CommandLine): Every FS command accepts 'subjects_dir' input. """ - input_spec = FSTraitedSpec + _input_spec = FSTraitedSpec _subjects_dir = None diff --git a/nipype/interfaces/freesurfer/model.py b/nipype/interfaces/freesurfer/model.py index deb156f96e..af692330d8 100644 --- a/nipype/interfaces/freesurfer/model.py +++ b/nipype/interfaces/freesurfer/model.py @@ -94,8 +94,8 @@ class MRISPreproc(FSCommand): """ _cmd = 'mris_preproc' - input_spec = MRISPreprocInputSpec - output_spec = MRISPreprocOutputSpec + _input_spec = MRISPreprocInputSpec + _output_spec = MRISPreprocOutputSpec def _post_run(self): @@ -267,8 +267,8 @@ class GLMFit(FSCommand): """ _cmd = 'mri_glmfit' - input_spec = GLMFitInputSpec - output_spec = GLMFitOutputSpec + _input_spec = GLMFitInputSpec + _output_spec = GLMFitOutputSpec def _format_arg(self, name, spec, value): if name == "surf": @@ -412,8 +412,8 @@ class Binarize(FSCommand): """ _cmd = 'mri_binarize' - input_spec = BinarizeInputSpec - output_spec = BinarizeOutputSpec + _input_spec = BinarizeInputSpec + _output_spec = BinarizeOutputSpec def _post_run(self): @@ -520,8 +520,8 @@ class Concatenate(FSCommand): """ _cmd = 'mri_concat' - input_spec = ConcatenateInputSpec - output_spec = ConcatenateOutputSpec + _input_spec = ConcatenateInputSpec + _output_spec = ConcatenateOutputSpec def _post_run(self): @@ -627,8 +627,8 @@ class SegStats(FSCommand): """ _cmd = 'mri_segstats' - input_spec = SegStatsInputSpec - output_spec = SegStatsOutputSpec + _input_spec = SegStatsInputSpec + _output_spec = SegStatsOutputSpec def _post_run(self): @@ -745,8 +745,8 @@ class Label2Vol(FSCommand): """ _cmd = 'mri_label2vol' - input_spec = Label2VolInputSpec - output_spec = Label2VolOutputSpec + _input_spec = Label2VolInputSpec + _output_spec = Label2VolOutputSpec def _post_run(self): @@ -822,8 +822,8 @@ class MS_LDA(FSCommand): """ _cmd = 'mri_ms_LDA' - input_spec = MS_LDAInputSpec - output_spec = MS_LDAOutputSpec + _input_spec = MS_LDAInputSpec + _output_spec = MS_LDAOutputSpec def _post_run(self): if isdefined(self.inputs.output_synth): diff --git a/nipype/interfaces/freesurfer/preprocess.py b/nipype/interfaces/freesurfer/preprocess.py index 60b9f167aa..b8c56267a9 100644 --- a/nipype/interfaces/freesurfer/preprocess.py +++ b/nipype/interfaces/freesurfer/preprocess.py @@ -63,8 +63,8 @@ class ParseDICOMDir(FSCommand): """ _cmd = 'mri_parse_sdcmdir' - input_spec = ParseDICOMDirInputSpec - output_spec = ParseDICOMDirOutputSpec + _input_spec = ParseDICOMDirInputSpec + _output_spec = ParseDICOMDirOutputSpec def _post_run(self): @@ -124,7 +124,7 @@ class UnpackSDICOMDir(FSCommand): 'unpacksdcmdir -generic -targ . -run 5 mprage nii struct -src .' """ _cmd = 'unpacksdcmdir' - input_spec = UnpackSDICOMDirInputSpec + _input_spec = UnpackSDICOMDirInputSpec class MRIConvertInputSpec(FSTraitedSpec): @@ -345,8 +345,8 @@ class MRIConvert(FSCommand): """ _cmd = 'mri_convert' - input_spec = MRIConvertInputSpec - output_spec = MRIConvertOutputSpec + _input_spec = MRIConvertInputSpec + _output_spec = MRIConvertOutputSpec filemap = dict(cor='cor', mgh='mgh', mgz='mgz', minc='mnc', afni='brik', brik='brik', bshort='bshort', @@ -453,7 +453,7 @@ class DICOMConvert(FSCommand): """ _cmd = 'mri_convert' - input_spec = DICOMConvertInputSpec + _input_spec = DICOMConvertInputSpec def _get_dicomfiles(self): """validate fsl bet options @@ -571,8 +571,8 @@ class Resample(FSCommand): """ _cmd = 'mri_convert' - input_spec = ResampleInputSpec - output_spec = ResampleOutputSpec + _input_spec = ResampleInputSpec + _output_spec = ResampleOutputSpec def _get_outfilename(self): if isdefined(self.inputs.resampled_file): @@ -616,7 +616,7 @@ class ReconAllInputSpec(CommandLineInputSpec): flags = traits.Str(argstr='%s', desc='additional parameters') -class ReconAllIOutputSpec(FreeSurferSource.output_spec): +class ReconAllIOutputSpec(FreeSurferSource._output_spec): subjects_dir = Directory(exists=True, desc='Freesurfer subjects directory.') subject_id = traits.Str(desc='Subject name for whom to retrieve data') @@ -641,8 +641,8 @@ class ReconAll(CommandLine): _cmd = 'recon-all' _additional_metadata = ['loc', 'altkey'] - input_spec = ReconAllInputSpec - output_spec = ReconAllIOutputSpec + _input_spec = ReconAllInputSpec + _output_spec = ReconAllIOutputSpec _can_resume = True _steps = [ @@ -860,8 +860,8 @@ class BBRegister(FSCommand): """ _cmd = 'bbregister' - input_spec = BBRegisterInputSpec - output_spec = BBRegisterOutputSpec + _input_spec = BBRegisterInputSpec + _output_spec = BBRegisterOutputSpec def _post_run(self): @@ -993,8 +993,8 @@ class ApplyVolTransform(FSCommand): """ _cmd = 'mri_vol2vol' - input_spec = ApplyVolTransformInputSpec - output_spec = ApplyVolTransformOutputSpec + _input_spec = ApplyVolTransformInputSpec + _output_spec = ApplyVolTransformOutputSpec def _get_outfile(self): outfile = self.inputs.transformed_file @@ -1072,8 +1072,8 @@ class Smooth(FSCommand): """ _cmd = 'mris_volsmooth' - input_spec = SmoothInputSpec - output_spec = SmoothOutputSpec + _input_spec = SmoothInputSpec + _output_spec = SmoothOutputSpec def _post_run(self): @@ -1181,8 +1181,8 @@ class RobustRegister(FSCommand): """ _cmd = 'mri_robust_register' - input_spec = RobustRegisterInputSpec - output_spec = RobustRegisterOutputSpec + _input_spec = RobustRegisterInputSpec + _output_spec = RobustRegisterOutputSpec def _format_arg(self, name, spec, value): for option in ["registered_file", "weights_file", "half_source", "half_targ", @@ -1260,8 +1260,8 @@ class FitMSParams(FSCommand): """ _cmd = "mri_ms_fitparms" - input_spec = FitMSParamsInputSpec - output_spec = FitMSParamsOutputSpec + _input_spec = FitMSParamsInputSpec + _output_spec = FitMSParamsOutputSpec def _format_arg(self, name, spec, value): if name == "in_files": @@ -1332,8 +1332,8 @@ class SynthesizeFLASH(FSCommand): """ _cmd = "mri_synthesize" - input_spec = SynthesizeFLASHInputSpec - output_spec = SynthesizeFLASHOutputSpec + _input_spec = SynthesizeFLASHInputSpec + _output_spec = SynthesizeFLASHOutputSpec def _post_run(self): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_ApplyMask.py b/nipype/interfaces/freesurfer/tests/test_auto_ApplyMask.py index 23bff662ce..a441212414 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_ApplyMask.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_ApplyMask.py @@ -40,7 +40,7 @@ def test_ApplyMask_inputs(): xfm_target=dict(argstr='-lta_dst %s', ), ) - inputs = ApplyMask.input_spec() + inputs = ApplyMask._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -50,7 +50,7 @@ def test_ApplyMask_inputs(): def test_ApplyMask_outputs(): output_map = dict(out_file=dict(), ) - outputs = ApplyMask.output_spec() + outputs = ApplyMask._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_ApplyVolTransform.py b/nipype/interfaces/freesurfer/tests/test_auto_ApplyVolTransform.py index 0912bc80dd..d81ab3929c 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_ApplyVolTransform.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_ApplyVolTransform.py @@ -72,7 +72,7 @@ def test_ApplyVolTransform_inputs(): xor=('reg_file', 'fsl_reg_file', 'xfm_reg_file', 'reg_header', 'subject'), ), ) - inputs = ApplyVolTransform.input_spec() + inputs = ApplyVolTransform._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -82,7 +82,7 @@ def test_ApplyVolTransform_inputs(): def test_ApplyVolTransform_outputs(): output_map = dict(transformed_file=dict(), ) - outputs = ApplyVolTransform.output_spec() + outputs = ApplyVolTransform._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_BBRegister.py b/nipype/interfaces/freesurfer/tests/test_auto_BBRegister.py index cb3444c2f0..9e49453277 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_BBRegister.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_BBRegister.py @@ -53,7 +53,7 @@ def test_BBRegister_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = BBRegister.input_spec() + inputs = BBRegister._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -66,7 +66,7 @@ def test_BBRegister_outputs(): out_reg_file=dict(), registered_file=dict(), ) - outputs = BBRegister.output_spec() + outputs = BBRegister._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_Binarize.py b/nipype/interfaces/freesurfer/tests/test_auto_Binarize.py index 6fd29cf435..46fb6cd4c8 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_Binarize.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_Binarize.py @@ -76,7 +76,7 @@ def test_Binarize_inputs(): zero_slice_edge=dict(argstr='--zero-slice-edges', ), ) - inputs = Binarize.input_spec() + inputs = Binarize._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -87,7 +87,7 @@ def test_Binarize_outputs(): output_map = dict(binary_file=dict(), count_file=dict(), ) - outputs = Binarize.output_spec() + outputs = Binarize._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_Concatenate.py b/nipype/interfaces/freesurfer/tests/test_auto_Concatenate.py index 1a5e51758e..717b2bd4bb 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_Concatenate.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_Concatenate.py @@ -52,7 +52,7 @@ def test_Concatenate_inputs(): vote=dict(argstr='--vote', ), ) - inputs = Concatenate.input_spec() + inputs = Concatenate._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -62,7 +62,7 @@ def test_Concatenate_inputs(): def test_Concatenate_outputs(): output_map = dict(concatenated_file=dict(), ) - outputs = Concatenate.output_spec() + outputs = Concatenate._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_DICOMConvert.py b/nipype/interfaces/freesurfer/tests/test_auto_DICOMConvert.py index 102c4e6dd9..89a1eb943e 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_DICOMConvert.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_DICOMConvert.py @@ -31,7 +31,7 @@ def test_DICOMConvert_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = DICOMConvert.input_spec() + inputs = DICOMConvert._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -40,7 +40,7 @@ def test_DICOMConvert_inputs(): def test_DICOMConvert_outputs(): output_map = dict() - outputs = DICOMConvert.output_spec() + outputs = DICOMConvert._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_ExtractMainComponent.py b/nipype/interfaces/freesurfer/tests/test_auto_ExtractMainComponent.py index 617a696a2b..e8fcdc56ad 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_ExtractMainComponent.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_ExtractMainComponent.py @@ -24,7 +24,7 @@ def test_ExtractMainComponent_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ExtractMainComponent.input_spec() + inputs = ExtractMainComponent._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -34,7 +34,7 @@ def test_ExtractMainComponent_inputs(): def test_ExtractMainComponent_outputs(): output_map = dict(out_file=dict(), ) - outputs = ExtractMainComponent.output_spec() + outputs = ExtractMainComponent._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_FSCommand.py b/nipype/interfaces/freesurfer/tests/test_auto_FSCommand.py index 77f1b3b5ad..6b76c3f794 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_FSCommand.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_FSCommand.py @@ -16,7 +16,7 @@ def test_FSCommand_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = FSCommand.input_spec() + inputs = FSCommand._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -25,7 +25,7 @@ def test_FSCommand_inputs(): def test_FSCommand_outputs(): output_map = dict() - outputs = FSCommand.output_spec() + outputs = FSCommand._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_FitMSParams.py b/nipype/interfaces/freesurfer/tests/test_auto_FitMSParams.py index e54c0ddcc7..b85fc7439f 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_FitMSParams.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_FitMSParams.py @@ -28,7 +28,7 @@ def test_FitMSParams_inputs(): tr_list=dict(), xfm_list=dict(), ) - inputs = FitMSParams.input_spec() + inputs = FitMSParams._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -40,7 +40,7 @@ def test_FitMSParams_outputs(): t1_image=dict(), t2star_image=dict(), ) - outputs = FitMSParams.output_spec() + outputs = FitMSParams._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_GLMFit.py b/nipype/interfaces/freesurfer/tests/test_auto_GLMFit.py index 41f09cb1a8..8097afd6da 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_GLMFit.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_GLMFit.py @@ -137,7 +137,7 @@ def test_GLMFit_inputs(): xor=('weight_file', 'weight_inv', 'weight_sqrt'), ), ) - inputs = GLMFit.input_spec() + inputs = GLMFit._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -163,7 +163,7 @@ def test_GLMFit_outputs(): spatial_eigenvectors=dict(), svd_stats_file=dict(), ) - outputs = GLMFit.output_spec() + outputs = GLMFit._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_ImageInfo.py b/nipype/interfaces/freesurfer/tests/test_auto_ImageInfo.py index 5d409f2966..a9d16fb12b 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_ImageInfo.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_ImageInfo.py @@ -19,7 +19,7 @@ def test_ImageInfo_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ImageInfo.input_spec() + inputs = ImageInfo._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -39,7 +39,7 @@ def test_ImageInfo_outputs(): ph_enc_dir=dict(), vox_sizes=dict(), ) - outputs = ImageInfo.output_spec() + outputs = ImageInfo._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_Label2Vol.py b/nipype/interfaces/freesurfer/tests/test_auto_Label2Vol.py index 4ed1bb441c..16cfdff712 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_Label2Vol.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_Label2Vol.py @@ -72,7 +72,7 @@ def test_Label2Vol_inputs(): genfile=True, ), ) - inputs = Label2Vol.input_spec() + inputs = Label2Vol._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -82,7 +82,7 @@ def test_Label2Vol_inputs(): def test_Label2Vol_outputs(): output_map = dict(vol_label_file=dict(), ) - outputs = Label2Vol.output_spec() + outputs = Label2Vol._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_MRIConvert.py b/nipype/interfaces/freesurfer/tests/test_auto_MRIConvert.py index ad6fd9e55c..e06f95e5ad 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_MRIConvert.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_MRIConvert.py @@ -183,7 +183,7 @@ def test_MRIConvert_inputs(): zero_outlines=dict(argstr='--zero_outlines', ), ) - inputs = MRIConvert.input_spec() + inputs = MRIConvert._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -193,7 +193,7 @@ def test_MRIConvert_inputs(): def test_MRIConvert_outputs(): output_map = dict(out_file=dict(), ) - outputs = MRIConvert.output_spec() + outputs = MRIConvert._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_MRIMarchingCubes.py b/nipype/interfaces/freesurfer/tests/test_auto_MRIMarchingCubes.py index 44c4725e8e..14a9213133 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_MRIMarchingCubes.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_MRIMarchingCubes.py @@ -32,7 +32,7 @@ def test_MRIMarchingCubes_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = MRIMarchingCubes.input_spec() + inputs = MRIMarchingCubes._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -42,7 +42,7 @@ def test_MRIMarchingCubes_inputs(): def test_MRIMarchingCubes_outputs(): output_map = dict(surface=dict(), ) - outputs = MRIMarchingCubes.output_spec() + outputs = MRIMarchingCubes._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_MRIPretess.py b/nipype/interfaces/freesurfer/tests/test_auto_MRIPretess.py index ce3e7a244b..ebc563005b 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_MRIPretess.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_MRIPretess.py @@ -39,7 +39,7 @@ def test_MRIPretess_inputs(): test=dict(argstr='-test', ), ) - inputs = MRIPretess.input_spec() + inputs = MRIPretess._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -49,7 +49,7 @@ def test_MRIPretess_inputs(): def test_MRIPretess_outputs(): output_map = dict(out_file=dict(), ) - outputs = MRIPretess.output_spec() + outputs = MRIPretess._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_MRISPreproc.py b/nipype/interfaces/freesurfer/tests/test_auto_MRISPreproc.py index 306ca4cd8e..73626fe780 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_MRISPreproc.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_MRISPreproc.py @@ -65,7 +65,7 @@ def test_MRISPreproc_inputs(): vol_measure_file=dict(argstr='--iv %s %s...', ), ) - inputs = MRISPreproc.input_spec() + inputs = MRISPreproc._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -75,7 +75,7 @@ def test_MRISPreproc_inputs(): def test_MRISPreproc_outputs(): output_map = dict(out_file=dict(), ) - outputs = MRISPreproc.output_spec() + outputs = MRISPreproc._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_MRITessellate.py b/nipype/interfaces/freesurfer/tests/test_auto_MRITessellate.py index 3aea6fb331..fb0b6cc9e6 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_MRITessellate.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_MRITessellate.py @@ -32,7 +32,7 @@ def test_MRITessellate_inputs(): use_real_RAS_coordinates=dict(argstr='-n', ), ) - inputs = MRITessellate.input_spec() + inputs = MRITessellate._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -42,7 +42,7 @@ def test_MRITessellate_inputs(): def test_MRITessellate_outputs(): output_map = dict(surface=dict(), ) - outputs = MRITessellate.output_spec() + outputs = MRITessellate._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_MRIsConvert.py b/nipype/interfaces/freesurfer/tests/test_auto_MRIsConvert.py index c7ac846849..91d3f503c2 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_MRIsConvert.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_MRIsConvert.py @@ -59,7 +59,7 @@ def test_MRIsConvert_inputs(): xyz_ascii=dict(argstr='-a', ), ) - inputs = MRIsConvert.input_spec() + inputs = MRIsConvert._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -69,7 +69,7 @@ def test_MRIsConvert_inputs(): def test_MRIsConvert_outputs(): output_map = dict(converted=dict(), ) - outputs = MRIsConvert.output_spec() + outputs = MRIsConvert._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_MS_LDA.py b/nipype/interfaces/freesurfer/tests/test_auto_MS_LDA.py index 30264881c8..3b6e23d1bd 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_MS_LDA.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_MS_LDA.py @@ -41,7 +41,7 @@ def test_MS_LDA_inputs(): mandatory=True, ), ) - inputs = MS_LDA.input_spec() + inputs = MS_LDA._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -52,7 +52,7 @@ def test_MS_LDA_outputs(): output_map = dict(vol_synth_file=dict(), weight_file=dict(), ) - outputs = MS_LDA.output_spec() + outputs = MS_LDA._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_MakeAverageSubject.py b/nipype/interfaces/freesurfer/tests/test_auto_MakeAverageSubject.py index 5dd694a707..ac679a3b0f 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_MakeAverageSubject.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_MakeAverageSubject.py @@ -23,7 +23,7 @@ def test_MakeAverageSubject_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = MakeAverageSubject.input_spec() + inputs = MakeAverageSubject._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -33,7 +33,7 @@ def test_MakeAverageSubject_inputs(): def test_MakeAverageSubject_outputs(): output_map = dict(average_subject_name=dict(), ) - outputs = MakeAverageSubject.output_spec() + outputs = MakeAverageSubject._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_OneSampleTTest.py b/nipype/interfaces/freesurfer/tests/test_auto_OneSampleTTest.py index b33ecf5856..73aef8e3a8 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_OneSampleTTest.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_OneSampleTTest.py @@ -137,7 +137,7 @@ def test_OneSampleTTest_inputs(): xor=('weight_file', 'weight_inv', 'weight_sqrt'), ), ) - inputs = OneSampleTTest.input_spec() + inputs = OneSampleTTest._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -163,7 +163,7 @@ def test_OneSampleTTest_outputs(): spatial_eigenvectors=dict(), svd_stats_file=dict(), ) - outputs = OneSampleTTest.output_spec() + outputs = OneSampleTTest._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_ParseDICOMDir.py b/nipype/interfaces/freesurfer/tests/test_auto_ParseDICOMDir.py index a2afa891d9..d3d6b4aae5 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_ParseDICOMDir.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_ParseDICOMDir.py @@ -26,7 +26,7 @@ def test_ParseDICOMDir_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ParseDICOMDir.input_spec() + inputs = ParseDICOMDir._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -36,7 +36,7 @@ def test_ParseDICOMDir_inputs(): def test_ParseDICOMDir_outputs(): output_map = dict(dicom_info_file=dict(), ) - outputs = ParseDICOMDir.output_spec() + outputs = ParseDICOMDir._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_ReconAll.py b/nipype/interfaces/freesurfer/tests/test_auto_ReconAll.py index 2ed5d7929f..54ad2a1615 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_ReconAll.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_ReconAll.py @@ -40,7 +40,7 @@ def test_ReconAll_inputs(): min_ver='5.3.0', ), ) - inputs = ReconAll.input_spec() + inputs = ReconAll._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -127,7 +127,7 @@ def test_ReconAll_outputs(): loc='stats', ), ) - outputs = ReconAll.output_spec() + outputs = ReconAll._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_Resample.py b/nipype/interfaces/freesurfer/tests/test_auto_Resample.py index befb0b9d01..4057f34ba2 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_Resample.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_Resample.py @@ -27,7 +27,7 @@ def test_Resample_inputs(): mandatory=True, ), ) - inputs = Resample.input_spec() + inputs = Resample._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -37,7 +37,7 @@ def test_Resample_inputs(): def test_Resample_outputs(): output_map = dict(resampled_file=dict(), ) - outputs = Resample.output_spec() + outputs = Resample._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_RobustRegister.py b/nipype/interfaces/freesurfer/tests/test_auto_RobustRegister.py index 9c52782acc..c0c3630648 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_RobustRegister.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_RobustRegister.py @@ -81,7 +81,7 @@ def test_RobustRegister_inputs(): write_vo2vox=dict(argstr='--vox2vox', ), ) - inputs = RobustRegister.input_spec() + inputs = RobustRegister._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -98,7 +98,7 @@ def test_RobustRegister_outputs(): registered_file=dict(), weights_file=dict(), ) - outputs = RobustRegister.output_spec() + outputs = RobustRegister._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_SampleToSurface.py b/nipype/interfaces/freesurfer/tests/test_auto_SampleToSurface.py index 8a08a621f8..bfb39c62f7 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_SampleToSurface.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_SampleToSurface.py @@ -104,7 +104,7 @@ def test_SampleToSurface_inputs(): vox_file=dict(argstr='--nvox %s', ), ) - inputs = SampleToSurface.input_spec() + inputs = SampleToSurface._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -116,7 +116,7 @@ def test_SampleToSurface_outputs(): out_file=dict(), vox_file=dict(), ) - outputs = SampleToSurface.output_spec() + outputs = SampleToSurface._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_SegStats.py b/nipype/interfaces/freesurfer/tests/test_auto_SegStats.py index 2a69e99de3..5ee5af3655 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_SegStats.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_SegStats.py @@ -87,7 +87,7 @@ def test_SegStats_inputs(): wm_vol_from_surf=dict(argstr='--surf-wm-vol', ), ) - inputs = SegStats.input_spec() + inputs = SegStats._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -100,7 +100,7 @@ def test_SegStats_outputs(): sf_avg_file=dict(), summary_file=dict(), ) - outputs = SegStats.output_spec() + outputs = SegStats._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_Smooth.py b/nipype/interfaces/freesurfer/tests/test_auto_Smooth.py index 16fefa2873..8a0dc968ca 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_Smooth.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_Smooth.py @@ -42,7 +42,7 @@ def test_Smooth_inputs(): vol_fwhm=dict(argstr='--vol-fwhm %f', ), ) - inputs = Smooth.input_spec() + inputs = Smooth._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -52,7 +52,7 @@ def test_Smooth_inputs(): def test_Smooth_outputs(): output_map = dict(smoothed_file=dict(), ) - outputs = Smooth.output_spec() + outputs = Smooth._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_SmoothTessellation.py b/nipype/interfaces/freesurfer/tests/test_auto_SmoothTessellation.py index 2ba9b80134..7d720e2cfc 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_SmoothTessellation.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_SmoothTessellation.py @@ -53,7 +53,7 @@ def test_SmoothTessellation_inputs(): use_momentum=dict(argstr='-m', ), ) - inputs = SmoothTessellation.input_spec() + inputs = SmoothTessellation._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -63,7 +63,7 @@ def test_SmoothTessellation_inputs(): def test_SmoothTessellation_outputs(): output_map = dict(surface=dict(), ) - outputs = SmoothTessellation.output_spec() + outputs = SmoothTessellation._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_Surface2VolTransform.py b/nipype/interfaces/freesurfer/tests/test_auto_Surface2VolTransform.py index 7da293e7bd..f92075b9bd 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_Surface2VolTransform.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_Surface2VolTransform.py @@ -51,7 +51,7 @@ def test_Surface2VolTransform_inputs(): name_template='%s_asVol_vertex.nii', ), ) - inputs = Surface2VolTransform.input_spec() + inputs = Surface2VolTransform._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -62,7 +62,7 @@ def test_Surface2VolTransform_outputs(): output_map = dict(transformed_file=dict(), vertexvol_file=dict(), ) - outputs = Surface2VolTransform.output_spec() + outputs = Surface2VolTransform._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_SurfaceSmooth.py b/nipype/interfaces/freesurfer/tests/test_auto_SurfaceSmooth.py index 92d145cfc9..79de738bba 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_SurfaceSmooth.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_SurfaceSmooth.py @@ -39,7 +39,7 @@ def test_SurfaceSmooth_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = SurfaceSmooth.input_spec() + inputs = SurfaceSmooth._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -49,7 +49,7 @@ def test_SurfaceSmooth_inputs(): def test_SurfaceSmooth_outputs(): output_map = dict(out_file=dict(), ) - outputs = SurfaceSmooth.output_spec() + outputs = SurfaceSmooth._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_SurfaceSnapshots.py b/nipype/interfaces/freesurfer/tests/test_auto_SurfaceSnapshots.py index 46411c9fca..cbcc47f29c 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_SurfaceSnapshots.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_SurfaceSnapshots.py @@ -93,7 +93,7 @@ def test_SurfaceSnapshots_inputs(): truncate_overlay=dict(argstr='-truncphaseflag 1', ), ) - inputs = SurfaceSnapshots.input_spec() + inputs = SurfaceSnapshots._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -103,7 +103,7 @@ def test_SurfaceSnapshots_inputs(): def test_SurfaceSnapshots_outputs(): output_map = dict(snapshots=dict(), ) - outputs = SurfaceSnapshots.output_spec() + outputs = SurfaceSnapshots._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_SurfaceTransform.py b/nipype/interfaces/freesurfer/tests/test_auto_SurfaceTransform.py index 250f697402..474cb6d358 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_SurfaceTransform.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_SurfaceTransform.py @@ -47,7 +47,7 @@ def test_SurfaceTransform_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = SurfaceTransform.input_spec() + inputs = SurfaceTransform._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -57,7 +57,7 @@ def test_SurfaceTransform_inputs(): def test_SurfaceTransform_outputs(): output_map = dict(out_file=dict(), ) - outputs = SurfaceTransform.output_spec() + outputs = SurfaceTransform._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_SynthesizeFLASH.py b/nipype/interfaces/freesurfer/tests/test_auto_SynthesizeFLASH.py index fc213c7411..0e5fa54685 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_SynthesizeFLASH.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_SynthesizeFLASH.py @@ -42,7 +42,7 @@ def test_SynthesizeFLASH_inputs(): position=2, ), ) - inputs = SynthesizeFLASH.input_spec() + inputs = SynthesizeFLASH._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -52,7 +52,7 @@ def test_SynthesizeFLASH_inputs(): def test_SynthesizeFLASH_outputs(): output_map = dict(out_file=dict(), ) - outputs = SynthesizeFLASH.output_spec() + outputs = SynthesizeFLASH._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_Tkregister2.py b/nipype/interfaces/freesurfer/tests/test_auto_Tkregister2.py index 150bfac675..5401d91db1 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_Tkregister2.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_Tkregister2.py @@ -47,7 +47,7 @@ def test_Tkregister2_inputs(): xfm=dict(argstr='--xfm %s', ), ) - inputs = Tkregister2.input_spec() + inputs = Tkregister2._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -58,7 +58,7 @@ def test_Tkregister2_outputs(): output_map = dict(fsl_file=dict(), reg_file=dict(), ) - outputs = Tkregister2.output_spec() + outputs = Tkregister2._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/tests/test_auto_UnpackSDICOMDir.py b/nipype/interfaces/freesurfer/tests/test_auto_UnpackSDICOMDir.py index 366af91387..3e42a95d21 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_UnpackSDICOMDir.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_UnpackSDICOMDir.py @@ -45,7 +45,7 @@ def test_UnpackSDICOMDir_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = UnpackSDICOMDir.input_spec() + inputs = UnpackSDICOMDir._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -54,7 +54,7 @@ def test_UnpackSDICOMDir_inputs(): def test_UnpackSDICOMDir_outputs(): output_map = dict() - outputs = UnpackSDICOMDir.output_spec() + outputs = UnpackSDICOMDir._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/freesurfer/utils.py b/nipype/interfaces/freesurfer/utils.py index 1d94211e0e..30e8e15cf3 100644 --- a/nipype/interfaces/freesurfer/utils.py +++ b/nipype/interfaces/freesurfer/utils.py @@ -149,8 +149,8 @@ class SampleToSurface(FSCommand): """ _cmd = "mri_vol2surf" - input_spec = SampleToSurfaceInputSpec - output_spec = SampleToSurfaceOutputSpec + _input_spec = SampleToSurfaceInputSpec + _output_spec = SampleToSurfaceOutputSpec filemap = dict(cor='cor', mgh='mgh', mgz='mgz', minc='mnc', afni='brik', brik='brik', bshort='bshort', @@ -268,8 +268,8 @@ class SurfaceSmooth(FSCommand): """ _cmd = "mri_surf2surf" - input_spec = SurfaceSmoothInputSpec - output_spec = SurfaceSmoothOutputSpec + _input_spec = SurfaceSmoothInputSpec + _output_spec = SurfaceSmoothOutputSpec def _post_run(self): self.outputs.out_file = self.inputs.out_file @@ -344,8 +344,8 @@ class SurfaceTransform(FSCommand): """ _cmd = "mri_surf2surf" - input_spec = SurfaceTransformInputSpec - output_spec = SurfaceTransformOutputSpec + _input_spec = SurfaceTransformInputSpec + _output_spec = SurfaceTransformOutputSpec def _post_run(self): self.outputs.out_file = self.inputs.out_file @@ -441,8 +441,8 @@ class Surface2VolTransform(FSCommand): """ _cmd = 'mri_surf2vol' - input_spec = Surface2VolTransformInputSpec - output_spec = Surface2VolTransformOutputSpec + _input_spec = Surface2VolTransformInputSpec + _output_spec = Surface2VolTransformOutputSpec class ApplyMaskInputSpec(FSTraitedSpec): @@ -476,8 +476,8 @@ class ApplyMask(FSCommand): """ _cmd = "mri_mask" - input_spec = ApplyMaskInputSpec - output_spec = ApplyMaskOutputSpec + _input_spec = ApplyMaskInputSpec + _output_spec = ApplyMaskOutputSpec def _post_run(self): self.outputs.out_file = self.inputs.out_file @@ -598,8 +598,8 @@ class SurfaceSnapshots(FSCommand): """ _cmd = "tksurfer" - input_spec = SurfaceSnapshotsInputSpec - output_spec = SurfaceSnapshotsOutputSpec + _input_spec = SurfaceSnapshotsInputSpec + _output_spec = SurfaceSnapshotsOutputSpec def _format_arg(self, name, spec, value): if name == "tcl_script": @@ -727,8 +727,8 @@ class ImageInfoOutputSpec(TraitedSpec): class ImageInfo(FSCommand): _cmd = "mri_info" - input_spec = ImageInfoInputSpec - output_spec = ImageInfoOutputSpec + _input_spec = ImageInfoInputSpec + _output_spec = ImageInfoOutputSpec def info_regexp(self, info, field, delim="\n"): m = re.search("%s\s*:\s+(.+?)%s" % (field, delim), info) @@ -833,8 +833,8 @@ class MRIsConvert(FSCommand): >>> mris.run() # doctest: +SKIP """ _cmd = 'mris_convert' - input_spec = MRIsConvertInputSpec - output_spec = MRIsConvertOutputSpec + _input_spec = MRIsConvertInputSpec + _output_spec = MRIsConvertOutputSpec def _format_arg(self, name, spec, value): if name == "out_file" and not os.path.isabs(value): @@ -905,8 +905,8 @@ class MRITessellate(FSCommand): >>> tess.run() # doctest: +SKIP """ _cmd = 'mri_tessellate' - input_spec = MRITessellateInputSpec - output_spec = MRITessellateOutputSpec + _input_spec = MRITessellateInputSpec + _output_spec = MRITessellateOutputSpec def _post_run(self): @@ -974,8 +974,8 @@ class MRIPretess(FSCommand): >>> pretess.run() # doctest: +SKIP """ _cmd = 'mri_pretess' - input_spec = MRIPretessInputSpec - output_spec = MRIPretessOutputSpec + _input_spec = MRIPretessInputSpec + _output_spec = MRIPretessOutputSpec def _post_run(self): @@ -1030,8 +1030,8 @@ class MRIMarchingCubes(FSCommand): >>> mc.run() # doctest: +SKIP """ _cmd = 'mri_mc' - input_spec = MRIMarchingCubesInputSpec - output_spec = MRIMarchingCubesOutputSpec + _input_spec = MRIMarchingCubesInputSpec + _output_spec = MRIMarchingCubesOutputSpec def _post_run(self): @@ -1100,8 +1100,8 @@ class SmoothTessellation(FSCommand): >>> smooth.run() # doctest: +SKIP """ _cmd = 'mris_smooth' - input_spec = SmoothTessellationInputSpec - output_spec = SmoothTessellationOutputSpec + _input_spec = SmoothTessellationInputSpec + _output_spec = SmoothTessellationOutputSpec def _post_run(self): @@ -1156,8 +1156,8 @@ class MakeAverageSubject(FSCommand): """ _cmd = 'make_average_subject' - input_spec = MakeAverageSubjectInputSpec - output_spec = MakeAverageSubjectOutputSpec + _input_spec = MakeAverageSubjectInputSpec + _output_spec = MakeAverageSubjectOutputSpec def _post_run(self): @@ -1190,8 +1190,8 @@ class ExtractMainComponent(CommandLine): """ _cmd = 'mris_extract_main_component' - input_spec = ExtractMainComponentInputSpec - output_spec = ExtractMainComponentOutputSpec + _input_spec = ExtractMainComponentInputSpec + _output_spec = ExtractMainComponentOutputSpec class Tkregister2InputSpec(FSTraitedSpec): @@ -1265,8 +1265,8 @@ class Tkregister2(FSCommand): >>> tk2.run() # doctest: +SKIP """ _cmd = "tkregister2" - input_spec = Tkregister2InputSpec - output_spec = Tkregister2OutputSpec + _input_spec = Tkregister2InputSpec + _output_spec = Tkregister2OutputSpec def _post_run(self): self.outputs.reg_file = os.path.abspath(self.inputs.reg_file) diff --git a/nipype/interfaces/fsl/base.py b/nipype/interfaces/fsl/base.py index f8b564b42d..f6a3335c8b 100644 --- a/nipype/interfaces/fsl/base.py +++ b/nipype/interfaces/fsl/base.py @@ -120,7 +120,7 @@ def _output_type_changed(self, new): class FSLCommand(CommandLine): # pylint: disable=W0223 """Base support for FSL commands.""" - input_spec = FSLCommandInputSpec + _input_spec = FSLCommandInputSpec def __init__(self, **inputs): super(FSLCommand, self).__init__(**inputs) diff --git a/nipype/interfaces/fsl/dti.py b/nipype/interfaces/fsl/dti.py index 733663edae..8522b90951 100644 --- a/nipype/interfaces/fsl/dti.py +++ b/nipype/interfaces/fsl/dti.py @@ -113,8 +113,8 @@ class DTIFit(FSLCommand): """ _cmd = 'dtifit' - input_spec = DTIFitInputSpec - output_spec = DTIFitOutputSpec + _input_spec = DTIFitInputSpec + _output_spec = DTIFitOutputSpec def _post_run(self): if not self.inputs.save_tensor: @@ -223,8 +223,8 @@ class FSLXCommand(FSLCommand): """ Base support for ``xfibres`` and ``bedpostx`` """ - input_spec = FSLXCommandInputSpec - output_spec = FSLXCommandOutputSpec + _input_spec = FSLXCommandInputSpec + _output_spec = FSLXCommandOutputSpec def _run_interface(self, runtime): runtime = super(FSLXCommand, self)._run_interface(runtime) @@ -302,8 +302,8 @@ class BEDPOSTX5(FSLXCommand): _cmd = 'bedpostx' _default_cmd = _cmd - input_spec = BEDPOSTX5InputSpec - output_spec = BEDPOSTX5OutputSpec + _input_spec = BEDPOSTX5InputSpec + _output_spec = BEDPOSTX5OutputSpec _can_resume = True def __init__(self, **inputs): @@ -350,8 +350,8 @@ class XFibres5(FSLXCommand): parameters """ _cmd = 'xfibres' - input_spec = XFibres5InputSpec - output_spec = FSLXCommandOutputSpec + _input_spec = XFibres5InputSpec + _output_spec = FSLXCommandOutputSpec class XFibres4InputSpec(FSLCommandInputSpec): @@ -414,8 +414,8 @@ class XFibres4(FSLCommand): """ _cmd = 'xfibres' - input_spec = XFibres4InputSpec - output_spec = XFibres4OutputSpec + _input_spec = XFibres4InputSpec + _output_spec = XFibres4OutputSpec def __init__(self, **inputs): IFLOGGER.warn('Deprecated: Please use XFIBERS5 instead. This ' @@ -515,8 +515,8 @@ class BEDPOSTX4(FSLCommand): """ _cmd = 'bedpostx' - input_spec = BEDPOSTX4InputSpec - output_spec = BEDPOSTX4OutputSpec + _input_spec = BEDPOSTX4InputSpec + _output_spec = BEDPOSTX4OutputSpec _can_resume = True def __init__(self, **inputs): @@ -727,8 +727,8 @@ class ProbTrackX(FSLCommand): """ _cmd = 'probtrackx' - input_spec = ProbTrackXInputSpec - output_spec = ProbTrackXOutputSpec + _input_spec = ProbTrackXInputSpec + _output_spec = ProbTrackXOutputSpec def __init__(self, **inputs): IFLOGGER.warn('Deprecated: Please use create_bedpostx_pipeline instead') @@ -878,8 +878,8 @@ class ProbTrackX2(ProbTrackX): 'probtrackx2 --forcedir -m nodif_brain_mask.nii.gz --nsamples=3 --nsteps=10 --opd --dir=. --samples=merged --seed=seed_source.nii.gz' """ _cmd = 'probtrackx2' - input_spec = ProbTrackX2InputSpec - output_spec = ProbTrackX2OutputSpec + _input_spec = ProbTrackX2InputSpec + _output_spec = ProbTrackX2OutputSpec def _post_run(self): outputs = super(ProbTrackX2, self)._post_run() @@ -951,8 +951,8 @@ class VecReg(FSLCommand): """ _cmd = 'vecreg' - input_spec = VecRegInputSpec - output_spec = VecRegOutputSpec + _input_spec = VecRegInputSpec + _output_spec = VecRegOutputSpec def _run_interface(self, runtime): if not isdefined(self.inputs.out_file): @@ -1006,8 +1006,8 @@ class ProjThresh(FSLCommand): """ _cmd = 'proj_thresh' - input_spec = ProjThreshInputSpec - output_spec = ProjThreshOuputSpec + _input_spec = ProjThreshInputSpec + _output_spec = ProjThreshOuputSpec def _post_run(self): self.outputs.out_files = [] @@ -1048,8 +1048,8 @@ class FindTheBiggest(FSLCommand): """ _cmd = 'find_the_biggest' - input_spec = FindTheBiggestInputSpec - output_spec = FindTheBiggestOutputSpec + _input_spec = FindTheBiggestInputSpec + _output_spec = FindTheBiggestOutputSpec def _run_interface(self, runtime): if not isdefined(self.inputs.out_file): @@ -1119,8 +1119,8 @@ class TractSkeleton(FSLCommand): """ _cmd = 'tbss_skeleton' - input_spec = TractSkeletonInputSpec - output_spec = TractSkeletonOutputSpec + _input_spec = TractSkeletonInputSpec + _output_spec = TractSkeletonOutputSpec def _format_arg(self, name, spec, value): if name == 'project_data': @@ -1203,8 +1203,8 @@ class DistanceMap(FSLCommand): """ _cmd = 'distancemap' - input_spec = DistanceMapInputSpec - output_spec = DistanceMapOutputSpec + _input_spec = DistanceMapInputSpec + _output_spec = DistanceMapOutputSpec def _post_run(self): _si = self.inputs @@ -1251,8 +1251,8 @@ class MakeDyadicVectors(FSLCommand): and its uncertainty (dispersion)""" _cmd = 'make_dyadic_vectors' - input_spec = MakeDyadicVectorsInputSpec - output_spec = MakeDyadicVectorsOutputSpec + _input_spec = MakeDyadicVectorsInputSpec + _output_spec = MakeDyadicVectorsOutputSpec def _post_run(self): self.outputs.dyads = self._gen_fname(self.inputs.output) diff --git a/nipype/interfaces/fsl/epi.py b/nipype/interfaces/fsl/epi.py index cadc2f48b8..25bca7fd31 100644 --- a/nipype/interfaces/fsl/epi.py +++ b/nipype/interfaces/fsl/epi.py @@ -76,8 +76,8 @@ class PrepareFieldmap(FSLCommand): """ _cmd = 'fsl_prepare_fieldmap' - input_spec = PrepareFieldmapInputSpec - output_spec = PrepareFieldmapOutputSpec + _input_spec = PrepareFieldmapInputSpec + _output_spec = PrepareFieldmapOutputSpec def _run_interface(self, runtime): runtime = super(PrepareFieldmap, self)._run_interface(runtime) @@ -227,8 +227,8 @@ class TOPUP(FSLCommand): """ _cmd = 'topup' - input_spec = TOPUPInputSpec - output_spec = TOPUPOutputSpec + _input_spec = TOPUPInputSpec + _output_spec = TOPUPOutputSpec def _run_interface(self, runtime): if not os.path.isfile(self.inputs.encoding_file): @@ -307,8 +307,8 @@ class ApplyTOPUP(FSLCommand): """ _cmd = 'applytopup' - input_spec = ApplyTOPUPInputSpec - output_spec = ApplyTOPUPOutputSpec + _input_spec = ApplyTOPUPInputSpec + _output_spec = ApplyTOPUPOutputSpec class EddyInputSpec(FSLCommandInputSpec): @@ -394,8 +394,8 @@ class Eddy(FSLCommand): """ _cmd = 'eddy' - input_spec = EddyInputSpec - output_spec = EddyOutputSpec + _input_spec = EddyInputSpec + _output_spec = EddyOutputSpec _num_threads = 1 @@ -471,8 +471,8 @@ class SigLoss(FSLCommand): """ - input_spec = SigLossInputSpec - output_spec = SigLossOuputSpec + _input_spec = SigLossInputSpec + _output_spec = SigLossOuputSpec _cmd = 'sigloss' def _post_run(self): @@ -613,8 +613,8 @@ class EpiReg(FSLCommand): """ _cmd = 'epi_reg' - input_spec = EpiRegInputSpec - output_spec = EpiRegOutputSpec + _input_spec = EpiRegInputSpec + _output_spec = EpiRegOutputSpec # Helper functions ------------------------ diff --git a/nipype/interfaces/fsl/maths.py b/nipype/interfaces/fsl/maths.py index a7cbfb2f6b..4c0f442ce2 100644 --- a/nipype/interfaces/fsl/maths.py +++ b/nipype/interfaces/fsl/maths.py @@ -40,8 +40,8 @@ class MathsOutput(TraitedSpec): class MathsCommand(FSLCommand): _cmd = "fslmaths" - input_spec = MathsInput - output_spec = MathsOutput + _input_spec = MathsInput + _output_spec = MathsOutput class ChangeDataTypeInput(MathsInput): @@ -57,7 +57,7 @@ class ChangeDataTypeInput(MathsInput): class ChangeDataType(MathsCommand): """Use fslmaths to change the datatype of an image.""" - input_spec = ChangeDataTypeInput + _input_spec = ChangeDataTypeInput class ThresholdInputSpec(MathsInput): @@ -89,7 +89,7 @@ def _format_arg(self, name, spec, value): class Threshold(MathsCommand): """Use fslmaths to apply a threshold to an image in a variety of ways.""" - input_spec = ThresholdInputSpec + _input_spec = ThresholdInputSpec class MeanImageInput(MathsInput): @@ -102,7 +102,7 @@ class MeanImageInput(MathsInput): class MeanImage(MathsCommand): """Use fslmaths to generate a mean image across a given dimension.""" - input_spec = MeanImageInput + _input_spec = MeanImageInput class MaxImageInput(MathsInput): @@ -127,7 +127,7 @@ class MaxImage(MathsCommand): 'fslmaths functional.nii -Tmax functional_max.nii' """ - input_spec = MaxImageInput + _input_spec = MaxImageInput class IsotropicSmoothInput(MathsInput): @@ -147,7 +147,7 @@ def _format_arg(self, name, spec, value): class IsotropicSmooth(MathsCommand): """Use fslmaths to spatially smooth an image with a gaussian kernel.""" - input_spec = IsotropicSmoothInput + _input_spec = IsotropicSmoothInput class ApplyMaskInput(MathsInput): @@ -160,7 +160,7 @@ class ApplyMaskInput(MathsInput): class ApplyMask(MathsCommand): """Use fslmaths to apply a binary mask to another image.""" - input_spec = ApplyMaskInput + _input_spec = ApplyMaskInput class KernelInput(MathsInput): @@ -187,7 +187,7 @@ def _format_arg(self, name, spec, value): class DilateImage(MathsCommand): """Use fslmaths to perform a spatial dilation of an image.""" - input_spec = DilateInput + _input_spec = DilateInput class ErodeInput(KernelInput): @@ -206,7 +206,7 @@ def _format_arg(self, name, spec, value): class ErodeImage(MathsCommand): """Use fslmaths to perform a spatial erosion of an image.""" - input_spec = ErodeInput + _input_spec = ErodeInput class SpatialFilterInput(KernelInput): @@ -219,7 +219,7 @@ class SpatialFilterInput(KernelInput): class SpatialFilter(MathsCommand): """Use fslmaths to spatially filter an image.""" - input_spec = SpatialFilterInput + _input_spec = SpatialFilterInput class UnaryMathsInput(MathsInput): @@ -235,7 +235,7 @@ class UnaryMathsInput(MathsInput): class UnaryMaths(MathsCommand): """Use fslmaths to perorm a variety of mathematical operations on an image.""" - input_spec = UnaryMathsInput + _input_spec = UnaryMathsInput class BinaryMathsInput(MathsInput): @@ -253,7 +253,7 @@ class BinaryMaths(MathsCommand): Use fslmaths to perform mathematical operations using a second image or a numeric value. """ - input_spec = BinaryMathsInput + _input_spec = BinaryMathsInput class MultiImageMathsInput(MathsInput): @@ -281,7 +281,7 @@ class MultiImageMaths(MathsCommand): 'fslmaths functional.nii -add functional2.nii -mul -1 -div functional3.nii functional_maths.nii.gz' """ - input_spec = MultiImageMathsInput + _input_spec = MultiImageMathsInput class TemporalFilterInput(MathsInput): @@ -296,4 +296,4 @@ class TemporalFilterInput(MathsInput): class TemporalFilter(MathsCommand): """Use fslmaths to apply a low, high, or bandpass temporal filter to a timeseries. """ - input_spec = TemporalFilterInput + _input_spec = TemporalFilterInput diff --git a/nipype/interfaces/fsl/model.py b/nipype/interfaces/fsl/model.py index 3ff17b9591..5336a7eda6 100644 --- a/nipype/interfaces/fsl/model.py +++ b/nipype/interfaces/fsl/model.py @@ -112,8 +112,8 @@ class Level1Design(BaseInterface): """ - input_spec = Level1DesignInputSpec - output_spec = Level1DesignOutputSpec + _input_spec = Level1DesignInputSpec + _output_spec = Level1DesignOutputSpec def _create_ev_file(self, evfname, evinfo): f = open(evfname, 'wt') @@ -384,8 +384,8 @@ class FEAT(FSLCommand): """Uses FSL feat to calculate first level stats """ _cmd = 'feat' - input_spec = FEATInputSpec - output_spec = FEATOutputSpec + _input_spec = FEATInputSpec + _output_spec = FEATOutputSpec def _post_run(self): is_ica = False @@ -446,8 +446,8 @@ class FEATModel(FSLCommand): """Uses FSL feat_model to generate design.mat files """ _cmd = 'feat_model' - input_spec = FEATModelInputSpec - output_spec = FEATModelOutputSpec + _input_spec = FEATModelInputSpec + _output_spec = FEATModelOutputSpec def _get_design_root(self, infile): _, fname = os.path.split(infile) @@ -646,15 +646,15 @@ class FILMGLS(FSLCommand): _cmd = 'film_gls' if Info.version() and LooseVersion(Info.version()) > LooseVersion('5.0.6'): - input_spec = FILMGLSInputSpec507 + _input_spec = FILMGLSInputSpec507 elif Info.version() and LooseVersion(Info.version()) > LooseVersion('5.0.4'): - input_spec = FILMGLSInputSpec505 + _input_spec = FILMGLSInputSpec505 else: - input_spec = FILMGLSInputSpec + _input_spec = FILMGLSInputSpec if Info.version() and LooseVersion(Info.version()) > LooseVersion('5.0.6'): - output_spec = FILMGLSOutputSpec507 + _output_spec = FILMGLSOutputSpec507 else: - output_spec = FILMGLSOutputSpec + _output_spec = FILMGLSOutputSpec def _get_pe_files(self, cwd): files = None @@ -766,8 +766,8 @@ class FEATRegisterOutputSpec(TraitedSpec): class FEATRegister(BaseInterface): """Register feat directories to a specific standard """ - input_spec = FEATRegisterInputSpec - output_spec = FEATRegisterOutputSpec + _input_spec = FEATRegisterInputSpec + _output_spec = FEATRegisterOutputSpec def _run_interface(self, runtime): fsf_header = load_template('featreg_header.tcl') @@ -887,8 +887,8 @@ class FLAMEO(FSLCommand): """ _cmd = 'flameo' - input_spec = FLAMEOInputSpec - output_spec = FLAMEOOutputSpec + _input_spec = FLAMEOInputSpec + _output_spec = FLAMEOOutputSpec # ohinds: 2010-04-06 def _run_interface(self, runtime): @@ -1010,8 +1010,8 @@ class ContrastMgr(FSLCommand): """ _cmd = 'contrast_mgr' - input_spec = ContrastMgrInputSpec - output_spec = ContrastMgrOutputSpec + _input_spec = ContrastMgrInputSpec + _output_spec = ContrastMgrOutputSpec def _run_interface(self, runtime): # The returncode is meaningless in ContrastMgr. So check the output @@ -1118,8 +1118,8 @@ class L2Model(BaseInterface): """ - input_spec = L2ModelInputSpec - output_spec = L2ModelOutputSpec + _input_spec = L2ModelInputSpec + _output_spec = L2ModelOutputSpec def _run_interface(self, runtime): cwd = os.getcwd() @@ -1223,8 +1223,8 @@ class MultipleRegressDesign(BaseInterface): """ - input_spec = MultipleRegressDesignInputSpec - output_spec = MultipleRegressDesignOutputSpec + _input_spec = MultipleRegressDesignInputSpec + _output_spec = MultipleRegressDesignOutputSpec def _run_interface(self, runtime): cwd = os.getcwd() @@ -1362,8 +1362,8 @@ class SMM(FSLCommand): Woolrich, M., Behrens, T., Beckmann, C., and Smith, S.; IEEE Trans. Medical Imaging, 24(1):1-11, 2005. """ _cmd = 'mm' - input_spec = SMMInputSpec - output_spec = SMMOutputSpec + _input_spec = SMMInputSpec + _output_spec = SMMOutputSpec class MELODICInputSpec(FSLCommandInputSpec): @@ -1479,8 +1479,8 @@ class MELODIC(FSLCommand): """ - input_spec = MELODICInputSpec - output_spec = MELODICOutputSpec + _input_spec = MELODICInputSpec + _output_spec = MELODICOutputSpec _cmd = 'melodic' def _post_run(self): @@ -1532,8 +1532,8 @@ class SmoothEstimate(FSLCommand): """ - input_spec = SmoothEstimateInputSpec - output_spec = SmoothEstimateOutputSpec + _input_spec = SmoothEstimateInputSpec + _output_spec = SmoothEstimateOutputSpec _cmd = 'smoothest' def aggregate_outputs(self, runtime=None, needed_outputs=None): @@ -1646,8 +1646,8 @@ class Cluster(FSLCommand): 'cluster --in=zstat1.nii.gz --olmax=stats.txt --thresh=2.3000000000' """ - input_spec = ClusterInputSpec - output_spec = ClusterOutputSpec + _input_spec = ClusterInputSpec + _output_spec = ClusterOutputSpec _cmd = 'cluster' @@ -1750,8 +1750,8 @@ class Randomise(FSLCommand): """ _cmd = 'randomise' - input_spec = RandomiseInputSpec - output_spec = RandomiseOutputSpec + _input_spec = RandomiseInputSpec + _output_spec = RandomiseOutputSpec def _post_run(self): @@ -1885,8 +1885,8 @@ class GLM(FSLCommand): """ _cmd = 'fsl_glm' - input_spec = GLMInputSpec - output_spec = GLMOutputSpec + _input_spec = GLMInputSpec + _output_spec = GLMOutputSpec def _post_run(self): outputs = super(GLM, self)._list_outputs() diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index 92b1b630e8..a4519af713 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -143,8 +143,8 @@ class BET(FSLCommand): """ _cmd = 'bet' - input_spec = BETInputSpec - output_spec = BETOutputSpec + _input_spec = BETInputSpec + _output_spec = BETOutputSpec def _run_interface(self, runtime): # The returncode is meaningless in BET. So check the output @@ -302,8 +302,8 @@ class FAST(FSLCommand): """ _cmd = 'fast' - input_spec = FASTInputSpec - output_spec = FASTOutputSpec + _input_spec = FASTInputSpec + _output_spec = FASTOutputSpec def _post_run(self): @@ -533,8 +533,8 @@ class FLIRT(FSLCommand): """ _cmd = 'flirt' - input_spec = FLIRTInputSpec - output_spec = FLIRTOutputSpec + _input_spec = FLIRTInputSpec + _output_spec = FLIRTOutputSpec def _run_interface(self, runtime, **kwargs): runtime = super(FLIRT, self)._run_interface(runtime, **kwargs) @@ -574,7 +574,7 @@ class ApplyXfm(FLIRT): >>> result = applyxfm.run() # doctest: +SKIP """ - input_spec = ApplyXfmInputSpec + _input_spec = ApplyXfmInputSpec class MCFLIRTInputSpec(FSLCommandInputSpec): @@ -652,8 +652,8 @@ class MCFLIRT(FSLCommand): """ _cmd = 'mcflirt' - input_spec = MCFLIRTInputSpec - output_spec = MCFLIRTOutputSpec + _input_spec = MCFLIRTInputSpec + _output_spec = MCFLIRTOutputSpec def _post_run(self): @@ -853,8 +853,8 @@ class FNIRT(FSLCommand): """ _cmd = 'fnirt' - input_spec = FNIRTInputSpec - output_spec = FNIRTOutputSpec + _input_spec = FNIRTInputSpec + _output_spec = FNIRTOutputSpec filemap = {'warped_file': 'warped', 'field_file': 'field', @@ -971,8 +971,8 @@ class ApplyWarp(FSLCommand): """ _cmd = 'applywarp' - input_spec = ApplyWarpInputSpec - output_spec = ApplyWarpOutputSpec + _input_spec = ApplyWarpInputSpec + _output_spec = ApplyWarpOutputSpec def _post_run(self): @@ -1030,8 +1030,8 @@ class SliceTimer(FSLCommand): """ _cmd = 'slicetimer' - input_spec = SliceTimerInputSpec - output_spec = SliceTimerOutputSpec + _input_spec = SliceTimerInputSpec + _output_spec = SliceTimerOutputSpec def _post_run(self): out_file = self.inputs.out_file @@ -1108,8 +1108,8 @@ class SUSAN(FSLCommand): """ _cmd = 'susan' - input_spec = SUSANInputSpec - output_spec = SUSANOutputSpec + _input_spec = SUSANInputSpec + _output_spec = SUSANOutputSpec def _post_run(self): @@ -1299,8 +1299,8 @@ class FUGUE(FSLCommand): """ _cmd = 'fugue' - input_spec = FUGUEInputSpec - output_spec = FUGUEOutputSpec + _input_spec = FUGUEInputSpec + _output_spec = FUGUEOutputSpec class PRELUDEInputSpec(FSLCommandInputSpec): @@ -1361,8 +1361,8 @@ class PRELUDE(FSLCommand): Please insert examples for use of this command """ - input_spec = PRELUDEInputSpec - output_spec = PRELUDEOutputSpec + _input_spec = PRELUDEInputSpec + _output_spec = PRELUDEOutputSpec _cmd = 'prelude' def __init__(self, **kwargs): @@ -1456,8 +1456,8 @@ class FIRST(FSLCommand): """ _cmd = 'run_first_all' - input_spec = FIRSTInputSpec - output_spec = FIRSTOutputSpec + _input_spec = FIRSTInputSpec + _output_spec = FIRSTOutputSpec def _post_run(self): diff --git a/nipype/interfaces/fsl/tests/test_auto_ApplyMask.py b/nipype/interfaces/fsl/tests/test_auto_ApplyMask.py index 3463489616..3148deb9a7 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ApplyMask.py +++ b/nipype/interfaces/fsl/tests/test_auto_ApplyMask.py @@ -39,7 +39,7 @@ def test_ApplyMask_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ApplyMask.input_spec() + inputs = ApplyMask._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -49,7 +49,7 @@ def test_ApplyMask_inputs(): def test_ApplyMask_outputs(): output_map = dict(out_file=dict(), ) - outputs = ApplyMask.output_spec() + outputs = ApplyMask._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_ApplyTOPUP.py b/nipype/interfaces/fsl/tests/test_auto_ApplyTOPUP.py index 6a9d904f8a..3d22b0e2c3 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ApplyTOPUP.py +++ b/nipype/interfaces/fsl/tests/test_auto_ApplyTOPUP.py @@ -43,7 +43,7 @@ def test_ApplyTOPUP_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ApplyTOPUP.input_spec() + inputs = ApplyTOPUP._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -53,7 +53,7 @@ def test_ApplyTOPUP_inputs(): def test_ApplyTOPUP_outputs(): output_map = dict(out_corrected=dict(), ) - outputs = ApplyTOPUP.output_spec() + outputs = ApplyTOPUP._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_ApplyWarp.py b/nipype/interfaces/fsl/tests/test_auto_ApplyWarp.py index 3a62d1c873..62278d202e 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ApplyWarp.py +++ b/nipype/interfaces/fsl/tests/test_auto_ApplyWarp.py @@ -54,7 +54,7 @@ def test_ApplyWarp_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ApplyWarp.input_spec() + inputs = ApplyWarp._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -64,7 +64,7 @@ def test_ApplyWarp_inputs(): def test_ApplyWarp_outputs(): output_map = dict(out_file=dict(), ) - outputs = ApplyWarp.output_spec() + outputs = ApplyWarp._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_ApplyXfm.py b/nipype/interfaces/fsl/tests/test_auto_ApplyXfm.py index b5ee6dcf7b..b86cd6e088 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ApplyXfm.py +++ b/nipype/interfaces/fsl/tests/test_auto_ApplyXfm.py @@ -146,7 +146,7 @@ def test_ApplyXfm_inputs(): min_ver='5.0.0', ), ) - inputs = ApplyXfm.input_spec() + inputs = ApplyXfm._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -158,7 +158,7 @@ def test_ApplyXfm_outputs(): out_log=dict(), out_matrix_file=dict(), ) - outputs = ApplyXfm.output_spec() + outputs = ApplyXfm._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_AvScale.py b/nipype/interfaces/fsl/tests/test_auto_AvScale.py index 1ff5de7fe3..630b258b49 100644 --- a/nipype/interfaces/fsl/tests/test_auto_AvScale.py +++ b/nipype/interfaces/fsl/tests/test_auto_AvScale.py @@ -20,7 +20,7 @@ def test_AvScale_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = AvScale.input_spec() + inputs = AvScale._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -37,7 +37,7 @@ def test_AvScale_outputs(): scales=dict(), skews=dict(), ) - outputs = AvScale.output_spec() + outputs = AvScale._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX4.py b/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX4.py index 83fe61490b..22a74bef2e 100644 --- a/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX4.py +++ b/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX4.py @@ -80,7 +80,7 @@ def test_BEDPOSTX4_inputs(): weight=dict(argstr='-w %.2f', ), ) - inputs = BEDPOSTX4.input_spec() + inputs = BEDPOSTX4._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -98,7 +98,7 @@ def test_BEDPOSTX4_outputs(): merged_thsamples=dict(), xfms_directory=dict(), ) - outputs = BEDPOSTX4.output_spec() + outputs = BEDPOSTX4._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX5.py b/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX5.py index ffc8e96abb..f8423d06e8 100644 --- a/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX5.py +++ b/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX5.py @@ -91,7 +91,7 @@ def test_BEDPOSTX5_inputs(): ), use_gpu=dict(), ) - inputs = BEDPOSTX5.input_spec() + inputs = BEDPOSTX5._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -109,7 +109,7 @@ def test_BEDPOSTX5_outputs(): phsamples=dict(), thsamples=dict(), ) - outputs = BEDPOSTX5.output_spec() + outputs = BEDPOSTX5._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_BET.py b/nipype/interfaces/fsl/tests/test_auto_BET.py index 04e4db99c5..da267e01cc 100644 --- a/nipype/interfaces/fsl/tests/test_auto_BET.py +++ b/nipype/interfaces/fsl/tests/test_auto_BET.py @@ -85,7 +85,7 @@ def test_BET_inputs(): vertical_gradient=dict(argstr='-g %.2f', ), ) - inputs = BET.input_spec() + inputs = BET._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -105,7 +105,7 @@ def test_BET_outputs(): outskull_mesh_file=dict(), skull_mask_file=dict(), ) - outputs = BET.output_spec() + outputs = BET._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_BinaryMaths.py b/nipype/interfaces/fsl/tests/test_auto_BinaryMaths.py index 86d19884cd..1dd66465d1 100644 --- a/nipype/interfaces/fsl/tests/test_auto_BinaryMaths.py +++ b/nipype/interfaces/fsl/tests/test_auto_BinaryMaths.py @@ -49,7 +49,7 @@ def test_BinaryMaths_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = BinaryMaths.input_spec() + inputs = BinaryMaths._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -59,7 +59,7 @@ def test_BinaryMaths_inputs(): def test_BinaryMaths_outputs(): output_map = dict(out_file=dict(), ) - outputs = BinaryMaths.output_spec() + outputs = BinaryMaths._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_ChangeDataType.py b/nipype/interfaces/fsl/tests/test_auto_ChangeDataType.py index cd647821d9..e6c47c57cc 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ChangeDataType.py +++ b/nipype/interfaces/fsl/tests/test_auto_ChangeDataType.py @@ -36,7 +36,7 @@ def test_ChangeDataType_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ChangeDataType.input_spec() + inputs = ChangeDataType._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -46,7 +46,7 @@ def test_ChangeDataType_inputs(): def test_ChangeDataType_outputs(): output_map = dict(out_file=dict(), ) - outputs = ChangeDataType.output_spec() + outputs = ChangeDataType._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_Cluster.py b/nipype/interfaces/fsl/tests/test_auto_Cluster.py index dc374701ef..75b73193fc 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Cluster.py +++ b/nipype/interfaces/fsl/tests/test_auto_Cluster.py @@ -91,7 +91,7 @@ def test_Cluster_inputs(): xfm_file=dict(argstr='--xfm=%s', ), ) - inputs = Cluster.input_spec() + inputs = Cluster._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -108,7 +108,7 @@ def test_Cluster_outputs(): out_size_file=dict(), out_threshold_file=dict(), ) - outputs = Cluster.output_spec() + outputs = Cluster._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_Complex.py b/nipype/interfaces/fsl/tests/test_auto_Complex.py index 955788fff3..85a47953f4 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Complex.py +++ b/nipype/interfaces/fsl/tests/test_auto_Complex.py @@ -80,7 +80,7 @@ def test_Complex_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Complex.input_spec() + inputs = Complex._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -94,7 +94,7 @@ def test_Complex_outputs(): phase_out_file=dict(), real_out_file=dict(), ) - outputs = Complex.output_spec() + outputs = Complex._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_ContrastMgr.py b/nipype/interfaces/fsl/tests/test_auto_ContrastMgr.py index add2dc41d9..a88e95bcd6 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ContrastMgr.py +++ b/nipype/interfaces/fsl/tests/test_auto_ContrastMgr.py @@ -43,7 +43,7 @@ def test_ContrastMgr_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ContrastMgr.input_spec() + inputs = ContrastMgr._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -59,7 +59,7 @@ def test_ContrastMgr_outputs(): zfstats=dict(), zstats=dict(), ) - outputs = ContrastMgr.output_spec() + outputs = ContrastMgr._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_ConvertWarp.py b/nipype/interfaces/fsl/tests/test_auto_ConvertWarp.py index 5103834ff6..6badee8ea8 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ConvertWarp.py +++ b/nipype/interfaces/fsl/tests/test_auto_ConvertWarp.py @@ -57,7 +57,7 @@ def test_ConvertWarp_inputs(): warp2=dict(argstr='--warp2=%s', ), ) - inputs = ConvertWarp.input_spec() + inputs = ConvertWarp._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -67,7 +67,7 @@ def test_ConvertWarp_inputs(): def test_ConvertWarp_outputs(): output_map = dict(out_file=dict(), ) - outputs = ConvertWarp.output_spec() + outputs = ConvertWarp._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_ConvertXFM.py b/nipype/interfaces/fsl/tests/test_auto_ConvertXFM.py index 65edd5c25c..3eef6a4d36 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ConvertXFM.py +++ b/nipype/interfaces/fsl/tests/test_auto_ConvertXFM.py @@ -47,7 +47,7 @@ def test_ConvertXFM_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ConvertXFM.input_spec() + inputs = ConvertXFM._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -57,7 +57,7 @@ def test_ConvertXFM_inputs(): def test_ConvertXFM_outputs(): output_map = dict(out_file=dict(), ) - outputs = ConvertXFM.output_spec() + outputs = ConvertXFM._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_CopyGeom.py b/nipype/interfaces/fsl/tests/test_auto_CopyGeom.py index 830af5cfa2..55f006d235 100644 --- a/nipype/interfaces/fsl/tests/test_auto_CopyGeom.py +++ b/nipype/interfaces/fsl/tests/test_auto_CopyGeom.py @@ -31,7 +31,7 @@ def test_CopyGeom_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = CopyGeom.input_spec() + inputs = CopyGeom._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -41,7 +41,7 @@ def test_CopyGeom_inputs(): def test_CopyGeom_outputs(): output_map = dict(out_file=dict(), ) - outputs = CopyGeom.output_spec() + outputs = CopyGeom._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_DTIFit.py b/nipype/interfaces/fsl/tests/test_auto_DTIFit.py index 83d48e1262..e59dd9f7d5 100644 --- a/nipype/interfaces/fsl/tests/test_auto_DTIFit.py +++ b/nipype/interfaces/fsl/tests/test_auto_DTIFit.py @@ -71,7 +71,7 @@ def test_DTIFit_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = DTIFit.input_spec() + inputs = DTIFit._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -91,7 +91,7 @@ def test_DTIFit_outputs(): out_v3=dict(), tensor=dict(), ) - outputs = DTIFit.output_spec() + outputs = DTIFit._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_DilateImage.py b/nipype/interfaces/fsl/tests/test_auto_DilateImage.py index 044ba1c605..ba9b3e07d4 100644 --- a/nipype/interfaces/fsl/tests/test_auto_DilateImage.py +++ b/nipype/interfaces/fsl/tests/test_auto_DilateImage.py @@ -50,7 +50,7 @@ def test_DilateImage_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = DilateImage.input_spec() + inputs = DilateImage._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -60,7 +60,7 @@ def test_DilateImage_inputs(): def test_DilateImage_outputs(): output_map = dict(out_file=dict(), ) - outputs = DilateImage.output_spec() + outputs = DilateImage._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_DistanceMap.py b/nipype/interfaces/fsl/tests/test_auto_DistanceMap.py index ee72ba05dc..a7ec33cdbd 100644 --- a/nipype/interfaces/fsl/tests/test_auto_DistanceMap.py +++ b/nipype/interfaces/fsl/tests/test_auto_DistanceMap.py @@ -31,7 +31,7 @@ def test_DistanceMap_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = DistanceMap.input_spec() + inputs = DistanceMap._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -42,7 +42,7 @@ def test_DistanceMap_outputs(): output_map = dict(distance_map=dict(), local_max_file=dict(), ) - outputs = DistanceMap.output_spec() + outputs = DistanceMap._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_EPIDeWarp.py b/nipype/interfaces/fsl/tests/test_auto_EPIDeWarp.py index 5f4f574f0f..b3313b2573 100644 --- a/nipype/interfaces/fsl/tests/test_auto_EPIDeWarp.py +++ b/nipype/interfaces/fsl/tests/test_auto_EPIDeWarp.py @@ -17,7 +17,7 @@ def test_EPIDeWarp_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = EPIDeWarp.input_spec() + inputs = EPIDeWarp._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -26,7 +26,7 @@ def test_EPIDeWarp_inputs(): def test_EPIDeWarp_outputs(): output_map = dict() - outputs = EPIDeWarp.output_spec() + outputs = EPIDeWarp._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_Eddy.py b/nipype/interfaces/fsl/tests/test_auto_Eddy.py index 727b6cb8ed..9f7aa7bd7b 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Eddy.py +++ b/nipype/interfaces/fsl/tests/test_auto_Eddy.py @@ -58,7 +58,7 @@ def test_Eddy_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Eddy.input_spec() + inputs = Eddy._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -69,7 +69,7 @@ def test_Eddy_outputs(): output_map = dict(out_corrected=dict(), out_parameter=dict(), ) - outputs = Eddy.output_spec() + outputs = Eddy._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_EddyCorrect.py b/nipype/interfaces/fsl/tests/test_auto_EddyCorrect.py index 1974200634..8ac4a24f4f 100644 --- a/nipype/interfaces/fsl/tests/test_auto_EddyCorrect.py +++ b/nipype/interfaces/fsl/tests/test_auto_EddyCorrect.py @@ -17,7 +17,7 @@ def test_EddyCorrect_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = EddyCorrect.input_spec() + inputs = EddyCorrect._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -26,7 +26,7 @@ def test_EddyCorrect_inputs(): def test_EddyCorrect_outputs(): output_map = dict() - outputs = EddyCorrect.output_spec() + outputs = EddyCorrect._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_EpiReg.py b/nipype/interfaces/fsl/tests/test_auto_EpiReg.py index 82440ecebb..b6a800dbce 100644 --- a/nipype/interfaces/fsl/tests/test_auto_EpiReg.py +++ b/nipype/interfaces/fsl/tests/test_auto_EpiReg.py @@ -63,7 +63,7 @@ def test_EpiReg_inputs(): wmedge=dict(), wmseg=dict(), ) - inputs = EpiReg.input_spec() + inputs = EpiReg._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -85,7 +85,7 @@ def test_EpiReg_outputs(): wmedge=dict(), wmseg=dict(), ) - outputs = EpiReg.output_spec() + outputs = EpiReg._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_ErodeImage.py b/nipype/interfaces/fsl/tests/test_auto_ErodeImage.py index 98fe5f4b0b..fbb477d9ad 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ErodeImage.py +++ b/nipype/interfaces/fsl/tests/test_auto_ErodeImage.py @@ -50,7 +50,7 @@ def test_ErodeImage_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ErodeImage.input_spec() + inputs = ErodeImage._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -60,7 +60,7 @@ def test_ErodeImage_inputs(): def test_ErodeImage_outputs(): output_map = dict(out_file=dict(), ) - outputs = ErodeImage.output_spec() + outputs = ErodeImage._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_ExtractROI.py b/nipype/interfaces/fsl/tests/test_auto_ExtractROI.py index 6a6f971128..3d71463a9e 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ExtractROI.py +++ b/nipype/interfaces/fsl/tests/test_auto_ExtractROI.py @@ -53,7 +53,7 @@ def test_ExtractROI_inputs(): position=7, ), ) - inputs = ExtractROI.input_spec() + inputs = ExtractROI._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -63,7 +63,7 @@ def test_ExtractROI_inputs(): def test_ExtractROI_outputs(): output_map = dict(roi_file=dict(), ) - outputs = ExtractROI.output_spec() + outputs = ExtractROI._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_FAST.py b/nipype/interfaces/fsl/tests/test_auto_FAST.py index 0249ee415c..a15cedcc71 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FAST.py +++ b/nipype/interfaces/fsl/tests/test_auto_FAST.py @@ -75,7 +75,7 @@ def test_FAST_inputs(): verbose=dict(argstr='-v', ), ) - inputs = FAST.input_spec() + inputs = FAST._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -92,7 +92,7 @@ def test_FAST_outputs(): tissue_class_files=dict(), tissue_class_map=dict(), ) - outputs = FAST.output_spec() + outputs = FAST._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_FEAT.py b/nipype/interfaces/fsl/tests/test_auto_FEAT.py index a6ebeb9d08..216c683b86 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FEAT.py +++ b/nipype/interfaces/fsl/tests/test_auto_FEAT.py @@ -21,7 +21,7 @@ def test_FEAT_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = FEAT.input_spec() + inputs = FEAT._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -31,7 +31,7 @@ def test_FEAT_inputs(): def test_FEAT_outputs(): output_map = dict(feat_dir=dict(), ) - outputs = FEAT.output_spec() + outputs = FEAT._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_FEATModel.py b/nipype/interfaces/fsl/tests/test_auto_FEATModel.py index ca076465d6..c838c02ced 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FEATModel.py +++ b/nipype/interfaces/fsl/tests/test_auto_FEATModel.py @@ -27,7 +27,7 @@ def test_FEATModel_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = FEATModel.input_spec() + inputs = FEATModel._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -41,7 +41,7 @@ def test_FEATModel_outputs(): design_image=dict(), fcon_file=dict(), ) - outputs = FEATModel.output_spec() + outputs = FEATModel._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_FEATRegister.py b/nipype/interfaces/fsl/tests/test_auto_FEATRegister.py index 3af3b4695d..0fe3ed04bd 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FEATRegister.py +++ b/nipype/interfaces/fsl/tests/test_auto_FEATRegister.py @@ -14,7 +14,7 @@ def test_FEATRegister_inputs(): reg_image=dict(mandatory=True, ), ) - inputs = FEATRegister.input_spec() + inputs = FEATRegister._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -24,7 +24,7 @@ def test_FEATRegister_inputs(): def test_FEATRegister_outputs(): output_map = dict(fsf_file=dict(), ) - outputs = FEATRegister.output_spec() + outputs = FEATRegister._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_FIRST.py b/nipype/interfaces/fsl/tests/test_auto_FIRST.py index 6ad2da8452..eb673151f5 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FIRST.py +++ b/nipype/interfaces/fsl/tests/test_auto_FIRST.py @@ -52,7 +52,7 @@ def test_FIRST_inputs(): position=1, ), ) - inputs = FIRST.input_spec() + inputs = FIRST._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -65,7 +65,7 @@ def test_FIRST_outputs(): segmentation_file=dict(), vtk_surfaces=dict(), ) - outputs = FIRST.output_spec() + outputs = FIRST._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_FLAMEO.py b/nipype/interfaces/fsl/tests/test_auto_FLAMEO.py index e93e1d08f0..341148d1f7 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FLAMEO.py +++ b/nipype/interfaces/fsl/tests/test_auto_FLAMEO.py @@ -60,7 +60,7 @@ def test_FLAMEO_inputs(): var_cope_file=dict(argstr='--varcopefile=%s', ), ) - inputs = FLAMEO.input_spec() + inputs = FLAMEO._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -81,7 +81,7 @@ def test_FLAMEO_outputs(): zfstats=dict(), zstats=dict(), ) - outputs = FLAMEO.output_spec() + outputs = FLAMEO._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_FLIRT.py b/nipype/interfaces/fsl/tests/test_auto_FLIRT.py index e5d56fda1d..e727e2885b 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FLIRT.py +++ b/nipype/interfaces/fsl/tests/test_auto_FLIRT.py @@ -145,7 +145,7 @@ def test_FLIRT_inputs(): min_ver='5.0.0', ), ) - inputs = FLIRT.input_spec() + inputs = FLIRT._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -157,7 +157,7 @@ def test_FLIRT_outputs(): out_log=dict(), out_matrix_file=dict(), ) - outputs = FLIRT.output_spec() + outputs = FLIRT._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_FNIRT.py b/nipype/interfaces/fsl/tests/test_auto_FNIRT.py index 83bd3b300b..c769ee67af 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FNIRT.py +++ b/nipype/interfaces/fsl/tests/test_auto_FNIRT.py @@ -123,7 +123,7 @@ def test_FNIRT_inputs(): hash_files=False, ), ) - inputs = FNIRT.input_spec() + inputs = FNIRT._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -139,7 +139,7 @@ def test_FNIRT_outputs(): out_intensitymap_file=dict(), warped_file=dict(), ) - outputs = FNIRT.output_spec() + outputs = FNIRT._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_FSLCommand.py b/nipype/interfaces/fsl/tests/test_auto_FSLCommand.py index df99aef52d..560b081bf9 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FSLCommand.py +++ b/nipype/interfaces/fsl/tests/test_auto_FSLCommand.py @@ -17,7 +17,7 @@ def test_FSLCommand_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = FSLCommand.input_spec() + inputs = FSLCommand._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -26,7 +26,7 @@ def test_FSLCommand_inputs(): def test_FSLCommand_outputs(): output_map = dict() - outputs = FSLCommand.output_spec() + outputs = FSLCommand._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_FSLXCommand.py b/nipype/interfaces/fsl/tests/test_auto_FSLXCommand.py index 929e4109a3..d4e3e18955 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FSLXCommand.py +++ b/nipype/interfaces/fsl/tests/test_auto_FSLXCommand.py @@ -87,7 +87,7 @@ def test_FSLXCommand_inputs(): update_proposal_every=dict(argstr='--updateproposalevery=%d', ), ) - inputs = FSLXCommand.input_spec() + inputs = FSLXCommand._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -104,7 +104,7 @@ def test_FSLXCommand_outputs(): phsamples=dict(), thsamples=dict(), ) - outputs = FSLXCommand.output_spec() + outputs = FSLXCommand._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_FUGUE.py b/nipype/interfaces/fsl/tests/test_auto_FUGUE.py index 3719e1e285..1172e7e1c3 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FUGUE.py +++ b/nipype/interfaces/fsl/tests/test_auto_FUGUE.py @@ -91,7 +91,7 @@ def test_FUGUE_inputs(): xor=['unwarped_file'], ), ) - inputs = FUGUE.input_spec() + inputs = FUGUE._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -104,7 +104,7 @@ def test_FUGUE_outputs(): unwarped_file=dict(), warped_file=dict(), ) - outputs = FUGUE.output_spec() + outputs = FUGUE._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_FilterRegressor.py b/nipype/interfaces/fsl/tests/test_auto_FilterRegressor.py index 546ff54ff4..a19687291e 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FilterRegressor.py +++ b/nipype/interfaces/fsl/tests/test_auto_FilterRegressor.py @@ -46,7 +46,7 @@ def test_FilterRegressor_inputs(): var_norm=dict(argstr='--vn', ), ) - inputs = FilterRegressor.input_spec() + inputs = FilterRegressor._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -56,7 +56,7 @@ def test_FilterRegressor_inputs(): def test_FilterRegressor_outputs(): output_map = dict(out_file=dict(), ) - outputs = FilterRegressor.output_spec() + outputs = FilterRegressor._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_FindTheBiggest.py b/nipype/interfaces/fsl/tests/test_auto_FindTheBiggest.py index 46d13ddf9e..458a53295a 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FindTheBiggest.py +++ b/nipype/interfaces/fsl/tests/test_auto_FindTheBiggest.py @@ -26,7 +26,7 @@ def test_FindTheBiggest_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = FindTheBiggest.input_spec() + inputs = FindTheBiggest._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -37,7 +37,7 @@ def test_FindTheBiggest_outputs(): output_map = dict(out_file=dict(argstr='%s', ), ) - outputs = FindTheBiggest.output_spec() + outputs = FindTheBiggest._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_GLM.py b/nipype/interfaces/fsl/tests/test_auto_GLM.py index fc14205028..6f75ba78aa 100644 --- a/nipype/interfaces/fsl/tests/test_auto_GLM.py +++ b/nipype/interfaces/fsl/tests/test_auto_GLM.py @@ -67,7 +67,7 @@ def test_GLM_inputs(): var_norm=dict(argstr='--vn', ), ) - inputs = GLM.input_spec() + inputs = GLM._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -88,7 +88,7 @@ def test_GLM_outputs(): out_vnscales=dict(), out_z=dict(), ) - outputs = GLM.output_spec() + outputs = GLM._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_ImageMaths.py b/nipype/interfaces/fsl/tests/test_auto_ImageMaths.py index ae1c0f83cc..c86a8620d5 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ImageMaths.py +++ b/nipype/interfaces/fsl/tests/test_auto_ImageMaths.py @@ -36,7 +36,7 @@ def test_ImageMaths_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ImageMaths.input_spec() + inputs = ImageMaths._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -46,7 +46,7 @@ def test_ImageMaths_inputs(): def test_ImageMaths_outputs(): output_map = dict(out_file=dict(), ) - outputs = ImageMaths.output_spec() + outputs = ImageMaths._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_ImageMeants.py b/nipype/interfaces/fsl/tests/test_auto_ImageMeants.py index 1441f68c05..a067e45911 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ImageMeants.py +++ b/nipype/interfaces/fsl/tests/test_auto_ImageMeants.py @@ -41,7 +41,7 @@ def test_ImageMeants_inputs(): use_mm=dict(argstr='--usemm', ), ) - inputs = ImageMeants.input_spec() + inputs = ImageMeants._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -51,7 +51,7 @@ def test_ImageMeants_inputs(): def test_ImageMeants_outputs(): output_map = dict(out_file=dict(), ) - outputs = ImageMeants.output_spec() + outputs = ImageMeants._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_ImageStats.py b/nipype/interfaces/fsl/tests/test_auto_ImageStats.py index 6f393c07d9..0d32e8cc21 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ImageStats.py +++ b/nipype/interfaces/fsl/tests/test_auto_ImageStats.py @@ -30,7 +30,7 @@ def test_ImageStats_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ImageStats.input_spec() + inputs = ImageStats._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -40,7 +40,7 @@ def test_ImageStats_inputs(): def test_ImageStats_outputs(): output_map = dict(out_stat=dict(), ) - outputs = ImageStats.output_spec() + outputs = ImageStats._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_InvWarp.py b/nipype/interfaces/fsl/tests/test_auto_InvWarp.py index 6d6fd72689..4fc04f1bd6 100644 --- a/nipype/interfaces/fsl/tests/test_auto_InvWarp.py +++ b/nipype/interfaces/fsl/tests/test_auto_InvWarp.py @@ -42,7 +42,7 @@ def test_InvWarp_inputs(): mandatory=True, ), ) - inputs = InvWarp.input_spec() + inputs = InvWarp._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -52,7 +52,7 @@ def test_InvWarp_inputs(): def test_InvWarp_outputs(): output_map = dict(inverse_warp=dict(), ) - outputs = InvWarp.output_spec() + outputs = InvWarp._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_IsotropicSmooth.py b/nipype/interfaces/fsl/tests/test_auto_IsotropicSmooth.py index 8c05b34ed4..6dc55569fe 100644 --- a/nipype/interfaces/fsl/tests/test_auto_IsotropicSmooth.py +++ b/nipype/interfaces/fsl/tests/test_auto_IsotropicSmooth.py @@ -45,7 +45,7 @@ def test_IsotropicSmooth_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = IsotropicSmooth.input_spec() + inputs = IsotropicSmooth._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -55,7 +55,7 @@ def test_IsotropicSmooth_inputs(): def test_IsotropicSmooth_outputs(): output_map = dict(out_file=dict(), ) - outputs = IsotropicSmooth.output_spec() + outputs = IsotropicSmooth._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_L2Model.py b/nipype/interfaces/fsl/tests/test_auto_L2Model.py index bcf3737fdd..4a869803fd 100644 --- a/nipype/interfaces/fsl/tests/test_auto_L2Model.py +++ b/nipype/interfaces/fsl/tests/test_auto_L2Model.py @@ -10,7 +10,7 @@ def test_L2Model_inputs(): num_copes=dict(mandatory=True, ), ) - inputs = L2Model.input_spec() + inputs = L2Model._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -22,7 +22,7 @@ def test_L2Model_outputs(): design_grp=dict(), design_mat=dict(), ) - outputs = L2Model.output_spec() + outputs = L2Model._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_Level1Design.py b/nipype/interfaces/fsl/tests/test_auto_Level1Design.py index f1500d42be..88b819e990 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Level1Design.py +++ b/nipype/interfaces/fsl/tests/test_auto_Level1Design.py @@ -17,7 +17,7 @@ def test_Level1Design_inputs(): session_info=dict(mandatory=True, ), ) - inputs = Level1Design.input_spec() + inputs = Level1Design._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -28,7 +28,7 @@ def test_Level1Design_outputs(): output_map = dict(ev_files=dict(), fsf_files=dict(), ) - outputs = Level1Design.output_spec() + outputs = Level1Design._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_MCFLIRT.py b/nipype/interfaces/fsl/tests/test_auto_MCFLIRT.py index 88c7a5e079..71d1532541 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MCFLIRT.py +++ b/nipype/interfaces/fsl/tests/test_auto_MCFLIRT.py @@ -61,7 +61,7 @@ def test_MCFLIRT_inputs(): use_gradient=dict(argstr='-gdt', ), ) - inputs = MCFLIRT.input_spec() + inputs = MCFLIRT._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -77,7 +77,7 @@ def test_MCFLIRT_outputs(): std_img=dict(), variance_img=dict(), ) - outputs = MCFLIRT.output_spec() + outputs = MCFLIRT._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_MELODIC.py b/nipype/interfaces/fsl/tests/test_auto_MELODIC.py index dbfb447911..3b5943124d 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MELODIC.py +++ b/nipype/interfaces/fsl/tests/test_auto_MELODIC.py @@ -109,7 +109,7 @@ def test_MELODIC_inputs(): var_norm=dict(argstr='--vn', ), ) - inputs = MELODIC.input_spec() + inputs = MELODIC._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -120,7 +120,7 @@ def test_MELODIC_outputs(): output_map = dict(out_dir=dict(), report_dir=dict(), ) - outputs = MELODIC.output_spec() + outputs = MELODIC._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_MakeDyadicVectors.py b/nipype/interfaces/fsl/tests/test_auto_MakeDyadicVectors.py index 3d42ba2ec2..fa5d90626a 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MakeDyadicVectors.py +++ b/nipype/interfaces/fsl/tests/test_auto_MakeDyadicVectors.py @@ -36,7 +36,7 @@ def test_MakeDyadicVectors_inputs(): position=0, ), ) - inputs = MakeDyadicVectors.input_spec() + inputs = MakeDyadicVectors._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -47,7 +47,7 @@ def test_MakeDyadicVectors_outputs(): output_map = dict(dispersion=dict(), dyads=dict(), ) - outputs = MakeDyadicVectors.output_spec() + outputs = MakeDyadicVectors._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_MathsCommand.py b/nipype/interfaces/fsl/tests/test_auto_MathsCommand.py index 740604db08..ab7e6487dd 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MathsCommand.py +++ b/nipype/interfaces/fsl/tests/test_auto_MathsCommand.py @@ -35,7 +35,7 @@ def test_MathsCommand_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = MathsCommand.input_spec() + inputs = MathsCommand._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -45,7 +45,7 @@ def test_MathsCommand_inputs(): def test_MathsCommand_outputs(): output_map = dict(out_file=dict(), ) - outputs = MathsCommand.output_spec() + outputs = MathsCommand._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_MaxImage.py b/nipype/interfaces/fsl/tests/test_auto_MaxImage.py index e71e5018bb..ddbba7276e 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MaxImage.py +++ b/nipype/interfaces/fsl/tests/test_auto_MaxImage.py @@ -39,7 +39,7 @@ def test_MaxImage_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = MaxImage.input_spec() + inputs = MaxImage._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -49,7 +49,7 @@ def test_MaxImage_inputs(): def test_MaxImage_outputs(): output_map = dict(out_file=dict(), ) - outputs = MaxImage.output_spec() + outputs = MaxImage._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_MeanImage.py b/nipype/interfaces/fsl/tests/test_auto_MeanImage.py index dfc34fc27c..e5c2e6f790 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MeanImage.py +++ b/nipype/interfaces/fsl/tests/test_auto_MeanImage.py @@ -39,7 +39,7 @@ def test_MeanImage_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = MeanImage.input_spec() + inputs = MeanImage._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -49,7 +49,7 @@ def test_MeanImage_inputs(): def test_MeanImage_outputs(): output_map = dict(out_file=dict(), ) - outputs = MeanImage.output_spec() + outputs = MeanImage._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_Merge.py b/nipype/interfaces/fsl/tests/test_auto_Merge.py index c08bc799c6..3e149f4242 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Merge.py +++ b/nipype/interfaces/fsl/tests/test_auto_Merge.py @@ -32,7 +32,7 @@ def test_Merge_inputs(): position=-1, ), ) - inputs = Merge.input_spec() + inputs = Merge._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -42,7 +42,7 @@ def test_Merge_inputs(): def test_Merge_outputs(): output_map = dict(merged_file=dict(), ) - outputs = Merge.output_spec() + outputs = Merge._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_MotionOutliers.py b/nipype/interfaces/fsl/tests/test_auto_MotionOutliers.py index 7c6565c4ef..14f97ca45d 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MotionOutliers.py +++ b/nipype/interfaces/fsl/tests/test_auto_MotionOutliers.py @@ -39,7 +39,7 @@ def test_MotionOutliers_inputs(): threshold=dict(argstr='--thresh=%g', ), ) - inputs = MotionOutliers.input_spec() + inputs = MotionOutliers._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -51,7 +51,7 @@ def test_MotionOutliers_outputs(): out_metric_plot=dict(), out_metric_values=dict(), ) - outputs = MotionOutliers.output_spec() + outputs = MotionOutliers._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_MultiImageMaths.py b/nipype/interfaces/fsl/tests/test_auto_MultiImageMaths.py index bb4247c08d..48ab1b1c14 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MultiImageMaths.py +++ b/nipype/interfaces/fsl/tests/test_auto_MultiImageMaths.py @@ -41,7 +41,7 @@ def test_MultiImageMaths_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = MultiImageMaths.input_spec() + inputs = MultiImageMaths._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -51,7 +51,7 @@ def test_MultiImageMaths_inputs(): def test_MultiImageMaths_outputs(): output_map = dict(out_file=dict(), ) - outputs = MultiImageMaths.output_spec() + outputs = MultiImageMaths._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_MultipleRegressDesign.py b/nipype/interfaces/fsl/tests/test_auto_MultipleRegressDesign.py index 5e4a88cf79..4ba9c447d1 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MultipleRegressDesign.py +++ b/nipype/interfaces/fsl/tests/test_auto_MultipleRegressDesign.py @@ -13,7 +13,7 @@ def test_MultipleRegressDesign_inputs(): regressors=dict(mandatory=True, ), ) - inputs = MultipleRegressDesign.input_spec() + inputs = MultipleRegressDesign._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -26,7 +26,7 @@ def test_MultipleRegressDesign_outputs(): design_grp=dict(), design_mat=dict(), ) - outputs = MultipleRegressDesign.output_spec() + outputs = MultipleRegressDesign._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_Overlay.py b/nipype/interfaces/fsl/tests/test_auto_Overlay.py index 9452550394..a12bdb2e34 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Overlay.py +++ b/nipype/interfaces/fsl/tests/test_auto_Overlay.py @@ -70,7 +70,7 @@ def test_Overlay_inputs(): position=3, ), ) - inputs = Overlay.input_spec() + inputs = Overlay._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -80,7 +80,7 @@ def test_Overlay_inputs(): def test_Overlay_outputs(): output_map = dict(out_file=dict(), ) - outputs = Overlay.output_spec() + outputs = Overlay._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_PRELUDE.py b/nipype/interfaces/fsl/tests/test_auto_PRELUDE.py index 4e60b70dc8..b8fe631a55 100644 --- a/nipype/interfaces/fsl/tests/test_auto_PRELUDE.py +++ b/nipype/interfaces/fsl/tests/test_auto_PRELUDE.py @@ -62,7 +62,7 @@ def test_PRELUDE_inputs(): hash_files=False, ), ) - inputs = PRELUDE.input_spec() + inputs = PRELUDE._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -72,7 +72,7 @@ def test_PRELUDE_inputs(): def test_PRELUDE_outputs(): output_map = dict(unwrapped_phase_file=dict(), ) - outputs = PRELUDE.output_spec() + outputs = PRELUDE._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_PlotMotionParams.py b/nipype/interfaces/fsl/tests/test_auto_PlotMotionParams.py index 6e29b0d067..269241af43 100644 --- a/nipype/interfaces/fsl/tests/test_auto_PlotMotionParams.py +++ b/nipype/interfaces/fsl/tests/test_auto_PlotMotionParams.py @@ -33,7 +33,7 @@ def test_PlotMotionParams_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = PlotMotionParams.input_spec() + inputs = PlotMotionParams._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -43,7 +43,7 @@ def test_PlotMotionParams_inputs(): def test_PlotMotionParams_outputs(): output_map = dict(out_file=dict(), ) - outputs = PlotMotionParams.output_spec() + outputs = PlotMotionParams._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_PlotTimeSeries.py b/nipype/interfaces/fsl/tests/test_auto_PlotTimeSeries.py index 680f90c272..4835b5bfb2 100644 --- a/nipype/interfaces/fsl/tests/test_auto_PlotTimeSeries.py +++ b/nipype/interfaces/fsl/tests/test_auto_PlotTimeSeries.py @@ -60,7 +60,7 @@ def test_PlotTimeSeries_inputs(): xor=['y_min', 'y_max'], ), ) - inputs = PlotTimeSeries.input_spec() + inputs = PlotTimeSeries._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -70,7 +70,7 @@ def test_PlotTimeSeries_inputs(): def test_PlotTimeSeries_outputs(): output_map = dict(out_file=dict(), ) - outputs = PlotTimeSeries.output_spec() + outputs = PlotTimeSeries._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_PowerSpectrum.py b/nipype/interfaces/fsl/tests/test_auto_PowerSpectrum.py index 9cb97a67f0..e32b3b820e 100644 --- a/nipype/interfaces/fsl/tests/test_auto_PowerSpectrum.py +++ b/nipype/interfaces/fsl/tests/test_auto_PowerSpectrum.py @@ -25,7 +25,7 @@ def test_PowerSpectrum_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = PowerSpectrum.input_spec() + inputs = PowerSpectrum._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -35,7 +35,7 @@ def test_PowerSpectrum_inputs(): def test_PowerSpectrum_outputs(): output_map = dict(out_file=dict(), ) - outputs = PowerSpectrum.output_spec() + outputs = PowerSpectrum._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_PrepareFieldmap.py b/nipype/interfaces/fsl/tests/test_auto_PrepareFieldmap.py index 42d1c20388..01cf0ad9dd 100644 --- a/nipype/interfaces/fsl/tests/test_auto_PrepareFieldmap.py +++ b/nipype/interfaces/fsl/tests/test_auto_PrepareFieldmap.py @@ -41,7 +41,7 @@ def test_PrepareFieldmap_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = PrepareFieldmap.input_spec() + inputs = PrepareFieldmap._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -51,7 +51,7 @@ def test_PrepareFieldmap_inputs(): def test_PrepareFieldmap_outputs(): output_map = dict(out_fieldmap=dict(), ) - outputs = PrepareFieldmap.output_spec() + outputs = PrepareFieldmap._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_ProbTrackX.py b/nipype/interfaces/fsl/tests/test_auto_ProbTrackX.py index b890fc5294..08c3d4d14c 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ProbTrackX.py +++ b/nipype/interfaces/fsl/tests/test_auto_ProbTrackX.py @@ -97,7 +97,7 @@ def test_ProbTrackX_inputs(): xfm=dict(argstr='--xfm=%s', ), ) - inputs = ProbTrackX.input_spec() + inputs = ProbTrackX._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -111,7 +111,7 @@ def test_ProbTrackX_outputs(): targets=dict(), way_total=dict(), ) - outputs = ProbTrackX.output_spec() + outputs = ProbTrackX._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_ProbTrackX2.py b/nipype/interfaces/fsl/tests/test_auto_ProbTrackX2.py index 967c90788d..91ba1743cd 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ProbTrackX2.py +++ b/nipype/interfaces/fsl/tests/test_auto_ProbTrackX2.py @@ -127,7 +127,7 @@ def test_ProbTrackX2_inputs(): xfm=dict(argstr='--xfm=%s', ), ) - inputs = ProbTrackX2.input_spec() + inputs = ProbTrackX2._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -146,7 +146,7 @@ def test_ProbTrackX2_outputs(): targets=dict(), way_total=dict(), ) - outputs = ProbTrackX2.output_spec() + outputs = ProbTrackX2._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_ProjThresh.py b/nipype/interfaces/fsl/tests/test_auto_ProjThresh.py index 44fda21420..e4fab4e176 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ProjThresh.py +++ b/nipype/interfaces/fsl/tests/test_auto_ProjThresh.py @@ -25,7 +25,7 @@ def test_ProjThresh_inputs(): position=1, ), ) - inputs = ProjThresh.input_spec() + inputs = ProjThresh._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -35,7 +35,7 @@ def test_ProjThresh_inputs(): def test_ProjThresh_outputs(): output_map = dict(out_files=dict(), ) - outputs = ProjThresh.output_spec() + outputs = ProjThresh._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_Randomise.py b/nipype/interfaces/fsl/tests/test_auto_Randomise.py index 46dbce71ff..3994465807 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Randomise.py +++ b/nipype/interfaces/fsl/tests/test_auto_Randomise.py @@ -77,7 +77,7 @@ def test_Randomise_inputs(): x_block_labels=dict(argstr='-e %s', ), ) - inputs = Randomise.input_spec() + inputs = Randomise._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -92,7 +92,7 @@ def test_Randomise_outputs(): t_p_files=dict(), tstat_files=dict(), ) - outputs = Randomise.output_spec() + outputs = Randomise._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_Reorient2Std.py b/nipype/interfaces/fsl/tests/test_auto_Reorient2Std.py index 2e4cb224e1..53232381b9 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Reorient2Std.py +++ b/nipype/interfaces/fsl/tests/test_auto_Reorient2Std.py @@ -23,7 +23,7 @@ def test_Reorient2Std_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Reorient2Std.input_spec() + inputs = Reorient2Std._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -33,7 +33,7 @@ def test_Reorient2Std_inputs(): def test_Reorient2Std_outputs(): output_map = dict(out_file=dict(), ) - outputs = Reorient2Std.output_spec() + outputs = Reorient2Std._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_RobustFOV.py b/nipype/interfaces/fsl/tests/test_auto_RobustFOV.py index 6ed9cecdd7..c384cddb81 100644 --- a/nipype/interfaces/fsl/tests/test_auto_RobustFOV.py +++ b/nipype/interfaces/fsl/tests/test_auto_RobustFOV.py @@ -24,7 +24,7 @@ def test_RobustFOV_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = RobustFOV.input_spec() + inputs = RobustFOV._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -34,7 +34,7 @@ def test_RobustFOV_inputs(): def test_RobustFOV_outputs(): output_map = dict(out_roi=dict(), ) - outputs = RobustFOV.output_spec() + outputs = RobustFOV._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_SMM.py b/nipype/interfaces/fsl/tests/test_auto_SMM.py index 4cef44c665..910cc0bb49 100644 --- a/nipype/interfaces/fsl/tests/test_auto_SMM.py +++ b/nipype/interfaces/fsl/tests/test_auto_SMM.py @@ -30,7 +30,7 @@ def test_SMM_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = SMM.input_spec() + inputs = SMM._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -42,7 +42,7 @@ def test_SMM_outputs(): deactivation_p_map=dict(), null_p_map=dict(), ) - outputs = SMM.output_spec() + outputs = SMM._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_SUSAN.py b/nipype/interfaces/fsl/tests/test_auto_SUSAN.py index 247a062106..5c7510a4f6 100644 --- a/nipype/interfaces/fsl/tests/test_auto_SUSAN.py +++ b/nipype/interfaces/fsl/tests/test_auto_SUSAN.py @@ -46,7 +46,7 @@ def test_SUSAN_inputs(): usedefault=True, ), ) - inputs = SUSAN.input_spec() + inputs = SUSAN._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -56,7 +56,7 @@ def test_SUSAN_inputs(): def test_SUSAN_outputs(): output_map = dict(smoothed_file=dict(), ) - outputs = SUSAN.output_spec() + outputs = SUSAN._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_SigLoss.py b/nipype/interfaces/fsl/tests/test_auto_SigLoss.py index 49e1928af2..5cbfc53b17 100644 --- a/nipype/interfaces/fsl/tests/test_auto_SigLoss.py +++ b/nipype/interfaces/fsl/tests/test_auto_SigLoss.py @@ -29,7 +29,7 @@ def test_SigLoss_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = SigLoss.input_spec() + inputs = SigLoss._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -39,7 +39,7 @@ def test_SigLoss_inputs(): def test_SigLoss_outputs(): output_map = dict(out_file=dict(), ) - outputs = SigLoss.output_spec() + outputs = SigLoss._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_SliceTimer.py b/nipype/interfaces/fsl/tests/test_auto_SliceTimer.py index b4c91745ba..9d9c0ed60c 100644 --- a/nipype/interfaces/fsl/tests/test_auto_SliceTimer.py +++ b/nipype/interfaces/fsl/tests/test_auto_SliceTimer.py @@ -39,7 +39,7 @@ def test_SliceTimer_inputs(): time_repetition=dict(argstr='--repeat=%f', ), ) - inputs = SliceTimer.input_spec() + inputs = SliceTimer._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -49,7 +49,7 @@ def test_SliceTimer_inputs(): def test_SliceTimer_outputs(): output_map = dict(slice_time_corrected_file=dict(), ) - outputs = SliceTimer.output_spec() + outputs = SliceTimer._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_Slicer.py b/nipype/interfaces/fsl/tests/test_auto_Slicer.py index 230ef4a45f..ce598bdff2 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Slicer.py +++ b/nipype/interfaces/fsl/tests/test_auto_Slicer.py @@ -84,7 +84,7 @@ def test_Slicer_inputs(): position=6, ), ) - inputs = Slicer.input_spec() + inputs = Slicer._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -94,7 +94,7 @@ def test_Slicer_inputs(): def test_Slicer_outputs(): output_map = dict(out_file=dict(), ) - outputs = Slicer.output_spec() + outputs = Slicer._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_Smooth.py b/nipype/interfaces/fsl/tests/test_auto_Smooth.py index 247008db52..941a3debf9 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Smooth.py +++ b/nipype/interfaces/fsl/tests/test_auto_Smooth.py @@ -35,7 +35,7 @@ def test_Smooth_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Smooth.input_spec() + inputs = Smooth._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -45,7 +45,7 @@ def test_Smooth_inputs(): def test_Smooth_outputs(): output_map = dict(smoothed_file=dict(), ) - outputs = Smooth.output_spec() + outputs = Smooth._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_SmoothEstimate.py b/nipype/interfaces/fsl/tests/test_auto_SmoothEstimate.py index d703e308ed..e7e82c0e74 100644 --- a/nipype/interfaces/fsl/tests/test_auto_SmoothEstimate.py +++ b/nipype/interfaces/fsl/tests/test_auto_SmoothEstimate.py @@ -30,7 +30,7 @@ def test_SmoothEstimate_inputs(): xor=['dof'], ), ) - inputs = SmoothEstimate.input_spec() + inputs = SmoothEstimate._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -42,7 +42,7 @@ def test_SmoothEstimate_outputs(): resels=dict(), volume=dict(), ) - outputs = SmoothEstimate.output_spec() + outputs = SmoothEstimate._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_SpatialFilter.py b/nipype/interfaces/fsl/tests/test_auto_SpatialFilter.py index 3c02cef908..8db807e579 100644 --- a/nipype/interfaces/fsl/tests/test_auto_SpatialFilter.py +++ b/nipype/interfaces/fsl/tests/test_auto_SpatialFilter.py @@ -50,7 +50,7 @@ def test_SpatialFilter_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = SpatialFilter.input_spec() + inputs = SpatialFilter._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -60,7 +60,7 @@ def test_SpatialFilter_inputs(): def test_SpatialFilter_outputs(): output_map = dict(out_file=dict(), ) - outputs = SpatialFilter.output_spec() + outputs = SpatialFilter._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_Split.py b/nipype/interfaces/fsl/tests/test_auto_Split.py index d889d8678f..7c7854e21e 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Split.py +++ b/nipype/interfaces/fsl/tests/test_auto_Split.py @@ -28,7 +28,7 @@ def test_Split_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Split.input_spec() + inputs = Split._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -38,7 +38,7 @@ def test_Split_inputs(): def test_Split_outputs(): output_map = dict(out_files=dict(), ) - outputs = Split.output_spec() + outputs = Split._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_SwapDimensions.py b/nipype/interfaces/fsl/tests/test_auto_SwapDimensions.py index 12370a1fdc..6c6d05abd2 100644 --- a/nipype/interfaces/fsl/tests/test_auto_SwapDimensions.py +++ b/nipype/interfaces/fsl/tests/test_auto_SwapDimensions.py @@ -27,7 +27,7 @@ def test_SwapDimensions_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = SwapDimensions.input_spec() + inputs = SwapDimensions._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -37,7 +37,7 @@ def test_SwapDimensions_inputs(): def test_SwapDimensions_outputs(): output_map = dict(out_file=dict(), ) - outputs = SwapDimensions.output_spec() + outputs = SwapDimensions._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_TOPUP.py b/nipype/interfaces/fsl/tests/test_auto_TOPUP.py index 80520511fe..df8a39bc77 100644 --- a/nipype/interfaces/fsl/tests/test_auto_TOPUP.py +++ b/nipype/interfaces/fsl/tests/test_auto_TOPUP.py @@ -82,7 +82,7 @@ def test_TOPUP_inputs(): warp_res=dict(argstr='--warpres=%f', ), ) - inputs = TOPUP.input_spec() + inputs = TOPUP._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -97,7 +97,7 @@ def test_TOPUP_outputs(): out_logfile=dict(), out_movpar=dict(), ) - outputs = TOPUP.output_spec() + outputs = TOPUP._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_TemporalFilter.py b/nipype/interfaces/fsl/tests/test_auto_TemporalFilter.py index b53f74ed23..1e88242107 100644 --- a/nipype/interfaces/fsl/tests/test_auto_TemporalFilter.py +++ b/nipype/interfaces/fsl/tests/test_auto_TemporalFilter.py @@ -43,7 +43,7 @@ def test_TemporalFilter_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = TemporalFilter.input_spec() + inputs = TemporalFilter._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -53,7 +53,7 @@ def test_TemporalFilter_inputs(): def test_TemporalFilter_outputs(): output_map = dict(out_file=dict(), ) - outputs = TemporalFilter.output_spec() + outputs = TemporalFilter._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_Threshold.py b/nipype/interfaces/fsl/tests/test_auto_Threshold.py index 866f5a93a7..afcddce8d3 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Threshold.py +++ b/nipype/interfaces/fsl/tests/test_auto_Threshold.py @@ -44,7 +44,7 @@ def test_Threshold_inputs(): ), use_robust_range=dict(), ) - inputs = Threshold.input_spec() + inputs = Threshold._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -54,7 +54,7 @@ def test_Threshold_inputs(): def test_Threshold_outputs(): output_map = dict(out_file=dict(), ) - outputs = Threshold.output_spec() + outputs = Threshold._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_TractSkeleton.py b/nipype/interfaces/fsl/tests/test_auto_TractSkeleton.py index 9fcad4e22c..dfb83b4862 100644 --- a/nipype/interfaces/fsl/tests/test_auto_TractSkeleton.py +++ b/nipype/interfaces/fsl/tests/test_auto_TractSkeleton.py @@ -38,7 +38,7 @@ def test_TractSkeleton_inputs(): xor=['search_mask_file'], ), ) - inputs = TractSkeleton.input_spec() + inputs = TractSkeleton._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -49,7 +49,7 @@ def test_TractSkeleton_outputs(): output_map = dict(projected_data=dict(), skeleton_file=dict(), ) - outputs = TractSkeleton.output_spec() + outputs = TractSkeleton._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_UnaryMaths.py b/nipype/interfaces/fsl/tests/test_auto_UnaryMaths.py index 7836d0ca3a..0899b8b0ae 100644 --- a/nipype/interfaces/fsl/tests/test_auto_UnaryMaths.py +++ b/nipype/interfaces/fsl/tests/test_auto_UnaryMaths.py @@ -39,7 +39,7 @@ def test_UnaryMaths_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = UnaryMaths.input_spec() + inputs = UnaryMaths._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -49,7 +49,7 @@ def test_UnaryMaths_inputs(): def test_UnaryMaths_outputs(): output_map = dict(out_file=dict(), ) - outputs = UnaryMaths.output_spec() + outputs = UnaryMaths._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_VecReg.py b/nipype/interfaces/fsl/tests/test_auto_VecReg.py index 503d6c5ea5..273d0c2db5 100644 --- a/nipype/interfaces/fsl/tests/test_auto_VecReg.py +++ b/nipype/interfaces/fsl/tests/test_auto_VecReg.py @@ -41,7 +41,7 @@ def test_VecReg_inputs(): warp_field=dict(argstr='-w %s', ), ) - inputs = VecReg.input_spec() + inputs = VecReg._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -51,7 +51,7 @@ def test_VecReg_inputs(): def test_VecReg_outputs(): output_map = dict(out_file=dict(), ) - outputs = VecReg.output_spec() + outputs = VecReg._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_WarpPoints.py b/nipype/interfaces/fsl/tests/test_auto_WarpPoints.py index 984b3f77a1..e206542478 100644 --- a/nipype/interfaces/fsl/tests/test_auto_WarpPoints.py +++ b/nipype/interfaces/fsl/tests/test_auto_WarpPoints.py @@ -41,7 +41,7 @@ def test_WarpPoints_inputs(): xor=['warp_file'], ), ) - inputs = WarpPoints.input_spec() + inputs = WarpPoints._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -51,7 +51,7 @@ def test_WarpPoints_inputs(): def test_WarpPoints_outputs(): output_map = dict(out_file=dict(), ) - outputs = WarpPoints.output_spec() + outputs = WarpPoints._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_WarpPointsToStd.py b/nipype/interfaces/fsl/tests/test_auto_WarpPointsToStd.py index f6ecd09f2e..a3018f0994 100644 --- a/nipype/interfaces/fsl/tests/test_auto_WarpPointsToStd.py +++ b/nipype/interfaces/fsl/tests/test_auto_WarpPointsToStd.py @@ -43,7 +43,7 @@ def test_WarpPointsToStd_inputs(): xor=['warp_file'], ), ) - inputs = WarpPointsToStd.input_spec() + inputs = WarpPointsToStd._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -53,7 +53,7 @@ def test_WarpPointsToStd_inputs(): def test_WarpPointsToStd_outputs(): output_map = dict(out_file=dict(), ) - outputs = WarpPointsToStd.output_spec() + outputs = WarpPointsToStd._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_WarpUtils.py b/nipype/interfaces/fsl/tests/test_auto_WarpUtils.py index 06b90eddfe..69a617ea47 100644 --- a/nipype/interfaces/fsl/tests/test_auto_WarpUtils.py +++ b/nipype/interfaces/fsl/tests/test_auto_WarpUtils.py @@ -39,7 +39,7 @@ def test_WarpUtils_inputs(): usedefault=True, ), ) - inputs = WarpUtils.input_spec() + inputs = WarpUtils._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -50,7 +50,7 @@ def test_WarpUtils_outputs(): output_map = dict(out_file=dict(), out_jacobian=dict(), ) - outputs = WarpUtils.output_spec() + outputs = WarpUtils._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_XFibres4.py b/nipype/interfaces/fsl/tests/test_auto_XFibres4.py index 448b30884b..575feb41d3 100644 --- a/nipype/interfaces/fsl/tests/test_auto_XFibres4.py +++ b/nipype/interfaces/fsl/tests/test_auto_XFibres4.py @@ -67,7 +67,7 @@ def test_XFibres4_inputs(): update_proposal_every=dict(argstr='--updateproposalevery=%d', ), ) - inputs = XFibres4.input_spec() + inputs = XFibres4._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -83,7 +83,7 @@ def test_XFibres4_outputs(): phsamples=dict(), thsamples=dict(), ) - outputs = XFibres4.output_spec() + outputs = XFibres4._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_auto_XFibres5.py b/nipype/interfaces/fsl/tests/test_auto_XFibres5.py index 29361e2571..32613a5154 100644 --- a/nipype/interfaces/fsl/tests/test_auto_XFibres5.py +++ b/nipype/interfaces/fsl/tests/test_auto_XFibres5.py @@ -89,7 +89,7 @@ def test_XFibres5_inputs(): update_proposal_every=dict(argstr='--updateproposalevery=%d', ), ) - inputs = XFibres5.input_spec() + inputs = XFibres5._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -106,7 +106,7 @@ def test_XFibres5_outputs(): phsamples=dict(), thsamples=dict(), ) - outputs = XFibres5.output_spec() + outputs = XFibres5._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/fsl/tests/test_preprocess.py b/nipype/interfaces/fsl/tests/test_preprocess.py index 1065fad6a5..90e3d33bb0 100644 --- a/nipype/interfaces/fsl/tests/test_preprocess.py +++ b/nipype/interfaces/fsl/tests/test_preprocess.py @@ -224,7 +224,7 @@ def test_flirt(): _, tmpfile = tempfile.mkstemp(suffix='.nii', dir=tmpdir) # Loop over all inputs, set a reasonable value and make sure the # cmdline is updated correctly. - for key, trait_spec in sorted(fsl.FLIRT.input_spec().traits().items()): + for key, trait_spec in sorted(fsl.FLIRT._input_spec().traits().items()): # Skip mandatory inputs and the trait methods if key in ('trait_added', 'trait_modified', 'in_file', 'reference', 'environ', 'output_type', 'out_file', 'out_matrix_file', diff --git a/nipype/interfaces/fsl/utils.py b/nipype/interfaces/fsl/utils.py index b05d6ce46f..7d44fc601a 100644 --- a/nipype/interfaces/fsl/utils.py +++ b/nipype/interfaces/fsl/utils.py @@ -59,8 +59,8 @@ class CopyGeom(FSLCommand): in loss of information or potentially incorrect settings. """ _cmd = 'fslcpgeom' - input_spec = CopyGeomInputSpec - output_spec = CopyGeomOutputSpec + _input_spec = CopyGeomInputSpec + _output_spec = CopyGeomOutputSpec class RobustFOVInputSpec(FSLCommandInputSpec): @@ -76,8 +76,8 @@ class RobustFOVOutputSpec(TraitedSpec): class RobustFOV(FSLCommand): _cmd = 'robustfov' - input_spec = RobustFOVInputSpec - output_spec = RobustFOVOutputSpec + _input_spec = RobustFOVInputSpec + _output_spec = RobustFOVOutputSpec class ImageMeantsInputSpec(FSLCommandInputSpec): @@ -115,8 +115,8 @@ class ImageMeants(FSLCommand): """ _cmd = 'fslmeants' - input_spec = ImageMeantsInputSpec - output_spec = ImageMeantsOutputSpec + _input_spec = ImageMeantsInputSpec + _output_spec = ImageMeantsOutputSpec class SmoothInputSpec(FSLCommandInputSpec): @@ -174,8 +174,8 @@ class Smooth(FSLCommand): """ - input_spec = SmoothInputSpec - output_spec = SmoothOutputSpec + _input_spec = SmoothInputSpec + _output_spec = SmoothOutputSpec _cmd = 'fslmaths' @@ -236,8 +236,8 @@ class Merge(FSLCommand): """ _cmd = 'fslmerge' - input_spec = MergeInputSpec - output_spec = MergeOutputSpec + _input_spec = MergeInputSpec + _output_spec = MergeOutputSpec class ExtractROIInputSpec(FSLCommandInputSpec): @@ -296,8 +296,8 @@ class ExtractROI(FSLCommand): """ _cmd = 'fslroi' - input_spec = ExtractROIInputSpec - output_spec = ExtractROIOutputSpec + _input_spec = ExtractROIInputSpec + _output_spec = ExtractROIOutputSpec class SplitInputSpec(FSLCommandInputSpec): @@ -318,8 +318,8 @@ class Split(FSLCommand): time, x, y or z dimension. """ _cmd = 'fslsplit' - input_spec = SplitInputSpec - output_spec = SplitOutputSpec + _input_spec = SplitInputSpec + _output_spec = SplitOutputSpec def _post_run(self): ext = self.inputs.output_type_ @@ -367,8 +367,8 @@ class ImageMaths(FSLCommand): """ - input_spec = ImageMathsInputSpec - output_spec = ImageMathsOutputSpec + _input_spec = ImageMathsInputSpec + _output_spec = ImageMathsOutputSpec _cmd = 'fslmaths' @@ -420,8 +420,8 @@ class FilterRegressor(FSLCommand): Uses simple OLS regression on 4D images """ - input_spec = FilterRegressorInputSpec - output_spec = FilterRegressorOutputSpec + _input_spec = FilterRegressorInputSpec + _output_spec = FilterRegressorOutputSpec _cmd = 'fsl_regfilt' @@ -473,8 +473,8 @@ class ImageStats(FSLCommand): """ - input_spec = ImageStatsInputSpec - output_spec = ImageStatsOutputSpec + _input_spec = ImageStatsInputSpec + _output_spec = ImageStatsOutputSpec _cmd = 'fslstats' @@ -534,8 +534,8 @@ class AvScale(FSLCommand): """ - input_spec = AvScaleInputSpec - output_spec = AvScaleOutputSpec + _input_spec = AvScaleInputSpec + _output_spec = AvScaleOutputSpec _cmd = 'avscale' @@ -655,8 +655,8 @@ class Overlay(FSLCommand): """ _cmd = 'overlay' - input_spec = OverlayInputSpec - output_spec = OverlayOutputSpec + _input_spec = OverlayInputSpec + _output_spec = OverlayOutputSpec class SlicerInputSpec(FSLCommandInputSpec): @@ -741,8 +741,8 @@ class Slicer(FSLCommand): """ _cmd = 'slicer' - input_spec = SlicerInputSpec - output_spec = SlicerOutputSpec + _input_spec = SlicerInputSpec + _output_spec = SlicerOutputSpec class PlotTimeSeriesInputSpec(FSLCommandInputSpec): @@ -805,8 +805,8 @@ class PlotTimeSeries(FSLCommand): """ _cmd = 'fsl_tsplot' - input_spec = PlotTimeSeriesInputSpec - output_spec = PlotTimeSeriesOutputSpec + _input_spec = PlotTimeSeriesInputSpec + _output_spec = PlotTimeSeriesOutputSpec class PlotMotionParamsInputSpec(FSLCommandInputSpec): @@ -888,8 +888,8 @@ class PlotMotionParams(FSLCommand): """ _cmd = 'fsl_tsplot' - input_spec = PlotMotionParamsInputSpec - output_spec = PlotMotionParamsOutputSpec + _input_spec = PlotMotionParamsInputSpec + _output_spec = PlotMotionParamsOutputSpec class ConvertXFMInputSpec(FSLCommandInputSpec): @@ -961,8 +961,8 @@ class ConvertXFM(FSLCommand): """ _cmd = 'convert_xfm' - input_spec = ConvertXFMInputSpec - output_spec = ConvertXFMOutputSpec + _input_spec = ConvertXFMInputSpec + _output_spec = ConvertXFMOutputSpec class SwapDimensionsInputSpec(FSLCommandInputSpec): @@ -993,8 +993,8 @@ class SwapDimensions(FSLCommand): """ _cmd = 'fslswapdim' - input_spec = SwapDimensionsInputSpec - output_spec = SwapDimensionsOutputSpec + _input_spec = SwapDimensionsInputSpec + _output_spec = SwapDimensionsOutputSpec class PowerSpectrumInputSpec(FSLCommandInputSpec): @@ -1028,8 +1028,8 @@ class PowerSpectrum(FSLCommand): """ _cmd = 'fslpspec' - input_spec = PowerSpectrumInputSpec - output_spec = PowerSpectrumOutputSpec + _input_spec = PowerSpectrumInputSpec + _output_spec = PowerSpectrumOutputSpec class SigLossInputSpec(FSLCommandInputSpec): @@ -1069,8 +1069,8 @@ class SigLoss(FSLCommand): """ - input_spec = SigLossInputSpec - output_spec = SigLossOuputSpec + _input_spec = SigLossInputSpec + _output_spec = SigLossOuputSpec _cmd = 'sigloss' @@ -1099,8 +1099,8 @@ class Reorient2Std(FSLCommand): """ _cmd = 'fslreorient2std' - input_spec = Reorient2StdInputSpec - output_spec = Reorient2StdOutputSpec + _input_spec = Reorient2StdInputSpec + _output_spec = Reorient2StdOutputSpec class InvWarpInputSpec(FSLCommandInputSpec): @@ -1175,8 +1175,8 @@ class InvWarp(FSLCommand): """ - input_spec = InvWarpInputSpec - output_spec = InvWarpOutputSpec + _input_spec = InvWarpInputSpec + _output_spec = InvWarpOutputSpec _cmd = 'invwarp' @@ -1268,8 +1268,8 @@ class Complex(FSLCommand): """ _cmd = 'fslcomplex' - input_spec = ComplexInputSpec - output_spec = ComplexOuputSpec + _input_spec = ComplexInputSpec + _output_spec = ComplexOuputSpec class WarpUtilsInputSpec(FSLCommandInputSpec): @@ -1368,8 +1368,8 @@ class WarpUtils(FSLCommand): """ - input_spec = WarpUtilsInputSpec - output_spec = WarpUtilsOutputSpec + _input_spec = WarpUtilsInputSpec + _output_spec = WarpUtilsOutputSpec _cmd = 'fnirtfileutils' @@ -1476,8 +1476,8 @@ class ConvertWarp(FSLCommand): """ - input_spec = ConvertWarpInputSpec - output_spec = ConvertWarpOutputSpec + _input_spec = ConvertWarpInputSpec + _output_spec = ConvertWarpOutputSpec _cmd = 'convertwarp' @@ -1534,8 +1534,8 @@ class WarpPoints(CommandLine): """ - input_spec = WarpPointsInputSpec - output_spec = WarpPointsOutputSpec + _input_spec = WarpPointsInputSpec + _output_spec = WarpPointsOutputSpec _cmd = 'img2imgcoord' _terminal_output = 'stream' @@ -1715,8 +1715,8 @@ class WarpPointsToStd(WarpPoints): """ - input_spec = WarpPointsToStdInputSpec - output_spec = WarpPointsOutputSpec + _input_spec = WarpPointsToStdInputSpec + _output_spec = WarpPointsOutputSpec _cmd = 'img2stdcoord' @@ -1759,6 +1759,6 @@ class MotionOutliers(FSLCommand): >>> res = mo.run() # doctest: +SKIP """ - input_spec = MotionOutliersInputSpec - output_spec = MotionOutliersOutputSpec + _input_spec = MotionOutliersInputSpec + _output_spec = MotionOutliersOutputSpec _cmd = 'fsl_motion_outliers' diff --git a/nipype/interfaces/io.py b/nipype/interfaces/io.py index 64da8c9ffc..551c483f9d 100644 --- a/nipype/interfaces/io.py +++ b/nipype/interfaces/io.py @@ -298,8 +298,8 @@ class DataSink(IOBase): """ # Give obj .inputs and .outputs - input_spec = DataSinkInputSpec - output_spec = DataSinkOutputSpec + _input_spec = DataSinkInputSpec + _output_spec = DataSinkOutputSpec # Initialization method to set up datasink def __init__(self, infields=None, force_run=True, **kwargs): @@ -804,8 +804,8 @@ class S3DataGrabber(IOBase): glob-style found in the original DataGrabber. """ - input_spec = S3DataGrabberInputSpec - output_spec = DynamicTraitedSpec + _input_spec = S3DataGrabberInputSpec + _output_spec = DynamicTraitedSpec _always_run = True def __init__(self, infields=None, outfields=None, **kwargs): @@ -1052,8 +1052,8 @@ class DataGrabber(IOBase): >>> dg.inputs.template_args['struct'] = [['sid']] """ - input_spec = DataGrabberInputSpec - output_spec = DynamicTraitedSpec + _input_spec = DataGrabberInputSpec + _output_spec = DynamicTraitedSpec _always_run = True def __init__(self, infields=None, outfields=None, **kwargs): @@ -1234,8 +1234,8 @@ class SelectFiles(IOBase): >>> dg.inputs.run = [2, 4] """ - input_spec = SelectFilesInputSpec - output_spec = DynamicTraitedSpec + _input_spec = SelectFilesInputSpec + _output_spec = DynamicTraitedSpec _always_run = True def __init__(self, templates, **kwargs): @@ -1385,8 +1385,8 @@ class DataFinder(IOBase): """ - input_spec = DataFinderInputSpec - output_spec = DynamicTraitedSpec + _input_spec = DataFinderInputSpec + _output_spec = DynamicTraitedSpec _always_run = True def _match_path(self, target_path): @@ -1576,8 +1576,8 @@ class FreeSurferSource(IOBase): >>> res = fs.run() # doctest: +SKIP """ - input_spec = FSSourceInputSpec - output_spec = FSSourceOutputSpec + _input_spec = FSSourceInputSpec + _output_spec = FSSourceOutputSpec _always_run = True _additional_metadata = ['loc', 'altkey'] @@ -1676,8 +1676,8 @@ class XNATSource(IOBase): """ - input_spec = XNATSourceInputSpec - output_spec = DynamicTraitedSpec + _input_spec = XNATSourceInputSpec + _output_spec = DynamicTraitedSpec def __init__(self, infields=None, outfields=None, **kwargs): """ @@ -1882,7 +1882,7 @@ class XNATSink(IOBase): list of nifti files and provides a set of structured output fields. """ - input_spec = XNATSinkInputSpec + _input_spec = XNATSinkInputSpec def _post_run(self): """Execute this module. @@ -2079,7 +2079,7 @@ class SQLiteSink(IOBase): >>> sql.run() # doctest: +SKIP """ - input_spec = SQLiteSinkInputSpec + _input_spec = SQLiteSinkInputSpec def __init__(self, input_names, **inputs): @@ -2132,7 +2132,7 @@ class MySQLSink(IOBase): >>> sql.run() # doctest: +SKIP """ - input_spec = MySQLSinkInputSpec + _input_spec = MySQLSinkInputSpec def __init__(self, input_names, **inputs): @@ -2238,8 +2238,8 @@ class SSHDataGrabber(DataGrabber): >>> dg.inputs.template_args['struct'] = [['sid']] """ - input_spec = SSHDataGrabberInputSpec - output_spec = DynamicTraitedSpec + _input_spec = SSHDataGrabberInputSpec + _output_spec = DynamicTraitedSpec _always_run = False def __init__(self, infields=None, outfields=None, **kwargs): @@ -2451,8 +2451,8 @@ class JSONFileGrabber(IOBase): """ - input_spec = JSONFileGrabberInputSpec - output_spec = DynamicTraitedSpec + _input_spec = JSONFileGrabberInputSpec + _output_spec = DynamicTraitedSpec _always_run = True def _post_run(self): @@ -2526,8 +2526,8 @@ class JSONFileSink(IOBase): >>> dictsink.run() # doctest: +SKIP """ - input_spec = JSONFileSinkInputSpec - output_spec = JSONFileSinkOutputSpec + _input_spec = JSONFileSinkInputSpec + _output_spec = JSONFileSinkOutputSpec def __init__(self, infields=[], force_run=True, **inputs): super(JSONFileSink, self).__init__(**inputs) diff --git a/nipype/interfaces/matlab.py b/nipype/interfaces/matlab.py index a81076b31f..da7b91424c 100644 --- a/nipype/interfaces/matlab.py +++ b/nipype/interfaces/matlab.py @@ -77,7 +77,7 @@ class MatlabCommand(CommandLine): _default_matlab_cmd = None _default_mfile = None _default_paths = None - input_spec = MatlabInputSpec + _input_spec = MatlabInputSpec def __init__(self, matlab_cmd=None, **inputs): """initializes interface to matlab diff --git a/nipype/interfaces/meshfix.py b/nipype/interfaces/meshfix.py index 21f85aaab3..dcbd521234 100644 --- a/nipype/interfaces/meshfix.py +++ b/nipype/interfaces/meshfix.py @@ -108,8 +108,8 @@ class MeshFix(CommandLine): 'meshfix lh-pial.stl rh-pial.stl -o lh-pial_fixed.off' """ _cmd = 'meshfix' - input_spec = MeshFixInputSpec - output_spec = MeshFixOutputSpec + _input_spec = MeshFixInputSpec + _output_spec = MeshFixOutputSpec def _post_run(self): diff --git a/nipype/interfaces/minc/minc.py b/nipype/interfaces/minc/minc.py index 4490ef52f3..e9ac90d6c6 100644 --- a/nipype/interfaces/minc/minc.py +++ b/nipype/interfaces/minc/minc.py @@ -239,8 +239,8 @@ class Extract(StdOutCommandLine): >>> extract.run() # doctest: +SKIP """ - input_spec = ExtractInputSpec - output_spec = ExtractOutputSpec + _input_spec = ExtractInputSpec + _output_spec = ExtractOutputSpec _cmd = 'mincextract' @@ -344,8 +344,8 @@ class ToRaw(StdOutCommandLine): >>> toraw.run() # doctest: +SKIP """ - input_spec = ToRawInputSpec - output_spec = ToRawOutputSpec + _input_spec = ToRawInputSpec + _output_spec = ToRawOutputSpec _cmd = 'minctoraw' @@ -419,8 +419,8 @@ class Convert(CommandLine): >>> c.run() # doctest: +SKIP """ - input_spec = ConvertInputSpec - output_spec = ConvertOutputSpec + _input_spec = ConvertInputSpec + _output_spec = ConvertOutputSpec _cmd = 'mincconvert' @@ -470,8 +470,8 @@ class Copy(CommandLine): with caution. """ - input_spec = CopyInputSpec - output_spec = CopyOutputSpec + _input_spec = CopyInputSpec + _output_spec = CopyOutputSpec _cmd = 'minccopy' @@ -550,8 +550,8 @@ class ToEcat(CommandLine): """ - input_spec = ToEcatInputSpec - output_spec = ToEcatOutputSpec + _input_spec = ToEcatInputSpec + _output_spec = ToEcatOutputSpec _cmd = 'minctoecat' @@ -644,8 +644,8 @@ class Dump(StdOutCommandLine): """ - input_spec = DumpInputSpec - output_spec = DumpOutputSpec + _input_spec = DumpInputSpec + _output_spec = DumpOutputSpec _cmd = 'mincdump' def _format_arg(self, name, spec, value): @@ -855,8 +855,8 @@ class Average(CommandLine): """ - input_spec = AverageInputSpec - output_spec = AverageOutputSpec + _input_spec = AverageInputSpec + _output_spec = AverageOutputSpec _cmd = 'mincaverage' @@ -908,8 +908,8 @@ class Blob(CommandLine): >>> blob.run() # doctest: +SKIP """ - input_spec = BlobInputSpec - output_spec = BlobOutputSpec + _input_spec = BlobInputSpec + _output_spec = BlobOutputSpec _cmd = 'mincblob' @@ -1123,8 +1123,8 @@ class Calc(CommandLine): >>> calc.run() # doctest: +SKIP """ - input_spec = CalcInputSpec - output_spec = CalcOutputSpec + _input_spec = CalcInputSpec + _output_spec = CalcOutputSpec _cmd = 'minccalc' @@ -1206,8 +1206,8 @@ class BBox(StdOutCommandLine): >>> bbox.run() # doctest: +SKIP """ - input_spec = BBoxInputSpec - output_spec = BBoxOutputSpec + _input_spec = BBoxInputSpec + _output_spec = BBoxOutputSpec _cmd = 'mincbbox' @@ -1369,8 +1369,8 @@ class Beast(CommandLine): >>> beast .run() # doctest: +SKIP """ - input_spec = BeastInputSpec - output_spec = BeastOutputSpec + _input_spec = BeastInputSpec + _output_spec = BeastOutputSpec _cmd = 'mincbeast' @@ -1536,8 +1536,8 @@ class Pik(CommandLine): """ - input_spec = PikInputSpec - output_spec = PikOutputSpec + _input_spec = PikInputSpec + _output_spec = PikOutputSpec _cmd = 'mincpik' def _format_arg(self, name, spec, value): @@ -1675,8 +1675,8 @@ class Blur(StdOutCommandLine): /tmp/out_6_dy.mnc, /tmp/out_6_dz.mnc and /tmp/out_6_dxyz.mnc. """ - input_spec = BlurInputSpec - output_spec = BlurOutputSpec + _input_spec = BlurInputSpec + _output_spec = BlurOutputSpec _cmd = 'mincblur' def _gen_output_base(self): @@ -2069,14 +2069,14 @@ class Math(StdOutCommandLine): >>> gt.run() # doctest: +SKIP """ - input_spec = MathInputSpec - output_spec = MathOutputSpec + _input_spec = MathInputSpec + _output_spec = MathOutputSpec _cmd = 'mincmath' def _format_arg(self, name, spec, value): assert value is not None - if name in self.input_spec.bool_or_const_traits: + if name in self._input_spec.bool_or_const_traits: # t is unused, what was I trying to do with it? # t = self.inputs.__getattribute__(name) @@ -2099,7 +2099,7 @@ def parse_args(self): nr_input_files = len(self.inputs.input_files) - for n in self.input_spec.bool_or_const_traits: + for n in self._input_spec.bool_or_const_traits: t = self.inputs.__getattribute__(n) if isdefined(t): @@ -2118,7 +2118,7 @@ def parse_args(self): 'Argument should be a bool or const, but got: %s' % t) - for n in self.input_spec.single_volume_traits: + for n in self._input_spec.single_volume_traits: t = self.inputs.__getattribute__(n) if isdefined(t): @@ -2127,7 +2127,7 @@ def parse_args(self): 'Due to the %s option we expected 1 file but input_files is of length %d' % (n, nr_input_files,)) - for n in self.input_spec.two_volume_traits: + for n in self._input_spec.two_volume_traits: t = self.inputs.__getattribute__(n) if isdefined(t): @@ -2136,7 +2136,7 @@ def parse_args(self): 'Due to the %s option we expected 2 files but input_files is of length %d' % (n, nr_input_files,)) - for n in self.input_spec.n_volume_traits: + for n in self._input_spec.n_volume_traits: t = self.inputs.__getattribute__(n) if isdefined(t): @@ -2544,8 +2544,8 @@ class Resample(StdOutCommandLine): """ - input_spec = ResampleInputSpec - output_spec = ResampleOutputSpec + _input_spec = ResampleInputSpec + _output_spec = ResampleOutputSpec _cmd = 'mincresample' @@ -2658,8 +2658,8 @@ class Norm(CommandLine): >>> n.run() # doctest: +SKIP """ - input_spec = NormInputSpec - output_spec = NormOutputSpec + _input_spec = NormInputSpec + _output_spec = NormOutputSpec _cmd = 'mincnorm' @@ -2755,8 +2755,8 @@ class Volcentre(CommandLine): >>> vc.run() # doctest: +SKIP """ - input_spec = VolcentreInputSpec - output_spec = VolcentreOutputSpec + _input_spec = VolcentreInputSpec + _output_spec = VolcentreOutputSpec _cmd = 'volcentre' @@ -2846,8 +2846,8 @@ class Volpad(CommandLine): >>> vp.run() # doctest: +SKIP """ - input_spec = VolpadInputSpec - output_spec = VolpadOutputSpec + _input_spec = VolpadInputSpec + _output_spec = VolpadOutputSpec _cmd = 'volpad' @@ -2908,8 +2908,8 @@ class Voliso(CommandLine): >>> viso.run() # doctest: +SKIP """ - input_spec = VolisoInputSpec - output_spec = VolisoOutputSpec + _input_spec = VolisoInputSpec + _output_spec = VolisoOutputSpec _cmd = 'voliso' @@ -2967,8 +2967,8 @@ class Gennlxfm(CommandLine): """ - input_spec = GennlxfmInputSpec - output_spec = GennlxfmOutputSpec + _input_spec = GennlxfmInputSpec + _output_spec = GennlxfmOutputSpec _cmd = 'gennlxfm' def _post_run(self): @@ -3030,8 +3030,8 @@ class XfmConcat(CommandLine): >>> conc.run() # doctest: +SKIP """ - input_spec = XfmConcatInputSpec - output_spec = XfmConcatOutputSpec + _input_spec = XfmConcatInputSpec + _output_spec = XfmConcatOutputSpec _cmd = 'xfmconcat' def _post_run(self): @@ -3126,8 +3126,8 @@ class BestLinReg(CommandLine): >>> linreg.run() # doctest: +SKIP """ - input_spec = BestLinRegInputSpec - output_spec = BestLinRegOutputSpec + _input_spec = BestLinRegInputSpec + _output_spec = BestLinRegOutputSpec _cmd = 'bestlinreg' @@ -3213,8 +3213,8 @@ class NlpFit(CommandLine): >>> nlpfit.run() # doctest: +SKIP """ - input_spec = NlpFitInputSpec - output_spec = NlpFitOutputSpec + _input_spec = NlpFitInputSpec + _output_spec = NlpFitOutputSpec _cmd = 'nlpfit' def _gen_filename(self, name): @@ -3314,8 +3314,8 @@ class XfmAvg(CommandLine): >>> xfmavg.run() # doctest: +SKIP """ - input_spec = XfmAvgInputSpec - output_spec = XfmAvgOutputSpec + _input_spec = XfmAvgInputSpec + _output_spec = XfmAvgOutputSpec _cmd = 'xfmavg' def _gen_filename(self, name): @@ -3387,8 +3387,8 @@ class XfmInvert(CommandLine): >>> invert.run() # doctest: +SKIP """ - input_spec = XfmInvertInputSpec - output_spec = XfmInvertOutputSpec + _input_spec = XfmInvertInputSpec + _output_spec = XfmInvertOutputSpec _cmd = 'xfminvert' def _gen_filename(self, name): @@ -3506,8 +3506,8 @@ class BigAverage(CommandLine): >>> average.run() # doctest: +SKIP """ - input_spec = BigAverageInputSpec - output_spec = BigAverageOutputSpec + _input_spec = BigAverageInputSpec + _output_spec = BigAverageOutputSpec _cmd = 'mincbigaverage' @@ -3566,8 +3566,8 @@ class Reshape(CommandLine): """ - input_spec = ReshapeInputSpec - output_spec = ReshapeOutputSpec + _input_spec = ReshapeInputSpec + _output_spec = ReshapeOutputSpec _cmd = 'mincreshape' @@ -3663,8 +3663,8 @@ class VolSymm(CommandLine): """ - input_spec = VolSymmInputSpec - output_spec = VolSymmOutputSpec + _input_spec = VolSymmInputSpec + _output_spec = VolSymmOutputSpec _cmd = 'volsymm' def _post_run(self): diff --git a/nipype/interfaces/minc/tests/test_auto_Average.py b/nipype/interfaces/minc/tests/test_auto_Average.py index 7eb22fb4b9..80f627a34b 100644 --- a/nipype/interfaces/minc/tests/test_auto_Average.py +++ b/nipype/interfaces/minc/tests/test_auto_Average.py @@ -111,7 +111,7 @@ def test_Average_inputs(): requires=('avgdim',), ), ) - inputs = Average.input_spec() + inputs = Average._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -121,7 +121,7 @@ def test_Average_inputs(): def test_Average_outputs(): output_map = dict(output_file=dict(), ) - outputs = Average.output_spec() + outputs = Average._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/minc/tests/test_auto_BBox.py b/nipype/interfaces/minc/tests/test_auto_BBox.py index d2a05db604..1848fae1b4 100644 --- a/nipype/interfaces/minc/tests/test_auto_BBox.py +++ b/nipype/interfaces/minc/tests/test_auto_BBox.py @@ -43,7 +43,7 @@ def test_BBox_inputs(): xor=('one_line', 'two_lines'), ), ) - inputs = BBox.input_spec() + inputs = BBox._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -53,7 +53,7 @@ def test_BBox_inputs(): def test_BBox_outputs(): output_map = dict(output_file=dict(), ) - outputs = BBox.output_spec() + outputs = BBox._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/minc/tests/test_auto_Beast.py b/nipype/interfaces/minc/tests/test_auto_Beast.py index 563fa1eb79..b9d90b8eb1 100644 --- a/nipype/interfaces/minc/tests/test_auto_Beast.py +++ b/nipype/interfaces/minc/tests/test_auto_Beast.py @@ -65,7 +65,7 @@ def test_Beast_inputs(): voxel_size=dict(argstr='-voxel_size %s', ), ) - inputs = Beast.input_spec() + inputs = Beast._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -75,7 +75,7 @@ def test_Beast_inputs(): def test_Beast_outputs(): output_map = dict(output_file=dict(), ) - outputs = Beast.output_spec() + outputs = Beast._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/minc/tests/test_auto_BestLinReg.py b/nipype/interfaces/minc/tests/test_auto_BestLinReg.py index 394a7d753a..419fdd48cc 100644 --- a/nipype/interfaces/minc/tests/test_auto_BestLinReg.py +++ b/nipype/interfaces/minc/tests/test_auto_BestLinReg.py @@ -44,7 +44,7 @@ def test_BestLinReg_inputs(): verbose=dict(argstr='-verbose', ), ) - inputs = BestLinReg.input_spec() + inputs = BestLinReg._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -55,7 +55,7 @@ def test_BestLinReg_outputs(): output_map = dict(output_mnc=dict(), output_xfm=dict(), ) - outputs = BestLinReg.output_spec() + outputs = BestLinReg._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/minc/tests/test_auto_BigAverage.py b/nipype/interfaces/minc/tests/test_auto_BigAverage.py index fb71302049..b5f990eec0 100644 --- a/nipype/interfaces/minc/tests/test_auto_BigAverage.py +++ b/nipype/interfaces/minc/tests/test_auto_BigAverage.py @@ -44,7 +44,7 @@ def test_BigAverage_inputs(): verbose=dict(argstr='--verbose', ), ) - inputs = BigAverage.input_spec() + inputs = BigAverage._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -55,7 +55,7 @@ def test_BigAverage_outputs(): output_map = dict(output_file=dict(), sd_file=dict(), ) - outputs = BigAverage.output_spec() + outputs = BigAverage._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/minc/tests/test_auto_Blob.py b/nipype/interfaces/minc/tests/test_auto_Blob.py index 96050e4746..ac5d656bff 100644 --- a/nipype/interfaces/minc/tests/test_auto_Blob.py +++ b/nipype/interfaces/minc/tests/test_auto_Blob.py @@ -34,7 +34,7 @@ def test_Blob_inputs(): translation=dict(argstr='-translation', ), ) - inputs = Blob.input_spec() + inputs = Blob._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -44,7 +44,7 @@ def test_Blob_inputs(): def test_Blob_outputs(): output_map = dict(output_file=dict(), ) - outputs = Blob.output_spec() + outputs = Blob._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/minc/tests/test_auto_Blur.py b/nipype/interfaces/minc/tests/test_auto_Blur.py index 340523b0f4..e0e4914371 100644 --- a/nipype/interfaces/minc/tests/test_auto_Blur.py +++ b/nipype/interfaces/minc/tests/test_auto_Blur.py @@ -51,7 +51,7 @@ def test_Blur_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Blur.input_spec() + inputs = Blur._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -66,7 +66,7 @@ def test_Blur_outputs(): partial_dy=dict(), partial_dz=dict(), ) - outputs = Blur.output_spec() + outputs = Blur._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/minc/tests/test_auto_Calc.py b/nipype/interfaces/minc/tests/test_auto_Calc.py index c5d39cdb38..0c40edd5c7 100644 --- a/nipype/interfaces/minc/tests/test_auto_Calc.py +++ b/nipype/interfaces/minc/tests/test_auto_Calc.py @@ -114,7 +114,7 @@ def test_Calc_inputs(): voxel_range=dict(argstr='-range %d %d', ), ) - inputs = Calc.input_spec() + inputs = Calc._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -124,7 +124,7 @@ def test_Calc_inputs(): def test_Calc_outputs(): output_map = dict(output_file=dict(), ) - outputs = Calc.output_spec() + outputs = Calc._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/minc/tests/test_auto_Convert.py b/nipype/interfaces/minc/tests/test_auto_Convert.py index 74928bc100..5d57f6cea2 100644 --- a/nipype/interfaces/minc/tests/test_auto_Convert.py +++ b/nipype/interfaces/minc/tests/test_auto_Convert.py @@ -38,7 +38,7 @@ def test_Convert_inputs(): two=dict(argstr='-2', ), ) - inputs = Convert.input_spec() + inputs = Convert._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -48,7 +48,7 @@ def test_Convert_inputs(): def test_Convert_outputs(): output_map = dict(output_file=dict(), ) - outputs = Convert.output_spec() + outputs = Convert._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/minc/tests/test_auto_Copy.py b/nipype/interfaces/minc/tests/test_auto_Copy.py index a3f2edff48..211aa707d4 100644 --- a/nipype/interfaces/minc/tests/test_auto_Copy.py +++ b/nipype/interfaces/minc/tests/test_auto_Copy.py @@ -32,7 +32,7 @@ def test_Copy_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Copy.input_spec() + inputs = Copy._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -42,7 +42,7 @@ def test_Copy_inputs(): def test_Copy_outputs(): output_map = dict(output_file=dict(), ) - outputs = Copy.output_spec() + outputs = Copy._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/minc/tests/test_auto_Dump.py b/nipype/interfaces/minc/tests/test_auto_Dump.py index 9eda182ce9..f4727956e2 100644 --- a/nipype/interfaces/minc/tests/test_auto_Dump.py +++ b/nipype/interfaces/minc/tests/test_auto_Dump.py @@ -51,7 +51,7 @@ def test_Dump_inputs(): sep=',', ), ) - inputs = Dump.input_spec() + inputs = Dump._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -61,7 +61,7 @@ def test_Dump_inputs(): def test_Dump_outputs(): output_map = dict(output_file=dict(), ) - outputs = Dump.output_spec() + outputs = Dump._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/minc/tests/test_auto_Extract.py b/nipype/interfaces/minc/tests/test_auto_Extract.py index a87c127a2e..fc93d8e1ea 100644 --- a/nipype/interfaces/minc/tests/test_auto_Extract.py +++ b/nipype/interfaces/minc/tests/test_auto_Extract.py @@ -112,7 +112,7 @@ def test_Extract_inputs(): xor=('write_signed', 'write_unsigned'), ), ) - inputs = Extract.input_spec() + inputs = Extract._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -122,7 +122,7 @@ def test_Extract_inputs(): def test_Extract_outputs(): output_map = dict(output_file=dict(), ) - outputs = Extract.output_spec() + outputs = Extract._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/minc/tests/test_auto_Gennlxfm.py b/nipype/interfaces/minc/tests/test_auto_Gennlxfm.py index 97d67c454a..6f681a5bb4 100644 --- a/nipype/interfaces/minc/tests/test_auto_Gennlxfm.py +++ b/nipype/interfaces/minc/tests/test_auto_Gennlxfm.py @@ -33,7 +33,7 @@ def test_Gennlxfm_inputs(): verbose=dict(argstr='-verbose', ), ) - inputs = Gennlxfm.input_spec() + inputs = Gennlxfm._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -44,7 +44,7 @@ def test_Gennlxfm_outputs(): output_map = dict(output_file=dict(), output_grid=dict(), ) - outputs = Gennlxfm.output_spec() + outputs = Gennlxfm._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/minc/tests/test_auto_Math.py b/nipype/interfaces/minc/tests/test_auto_Math.py index 95e8ac30c4..acd9b5d890 100644 --- a/nipype/interfaces/minc/tests/test_auto_Math.py +++ b/nipype/interfaces/minc/tests/test_auto_Math.py @@ -154,7 +154,7 @@ def test_Math_inputs(): voxel_range=dict(argstr='-range %d %d', ), ) - inputs = Math.input_spec() + inputs = Math._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -164,7 +164,7 @@ def test_Math_inputs(): def test_Math_outputs(): output_map = dict(output_file=dict(), ) - outputs = Math.output_spec() + outputs = Math._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/minc/tests/test_auto_NlpFit.py b/nipype/interfaces/minc/tests/test_auto_NlpFit.py index 5423d564a0..4a981b1431 100644 --- a/nipype/interfaces/minc/tests/test_auto_NlpFit.py +++ b/nipype/interfaces/minc/tests/test_auto_NlpFit.py @@ -42,7 +42,7 @@ def test_NlpFit_inputs(): verbose=dict(argstr='-verbose', ), ) - inputs = NlpFit.input_spec() + inputs = NlpFit._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -53,7 +53,7 @@ def test_NlpFit_outputs(): output_map = dict(output_grid=dict(), output_xfm=dict(), ) - outputs = NlpFit.output_spec() + outputs = NlpFit._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/minc/tests/test_auto_Norm.py b/nipype/interfaces/minc/tests/test_auto_Norm.py index a7deaca0ea..23359205d0 100644 --- a/nipype/interfaces/minc/tests/test_auto_Norm.py +++ b/nipype/interfaces/minc/tests/test_auto_Norm.py @@ -61,7 +61,7 @@ def test_Norm_inputs(): upper=dict(argstr='-upper %s', ), ) - inputs = Norm.input_spec() + inputs = Norm._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -72,7 +72,7 @@ def test_Norm_outputs(): output_map = dict(output_file=dict(), output_threshold_mask=dict(), ) - outputs = Norm.output_spec() + outputs = Norm._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/minc/tests/test_auto_Pik.py b/nipype/interfaces/minc/tests/test_auto_Pik.py index 89242d649b..87b6a1d69b 100644 --- a/nipype/interfaces/minc/tests/test_auto_Pik.py +++ b/nipype/interfaces/minc/tests/test_auto_Pik.py @@ -82,7 +82,7 @@ def test_Pik_inputs(): width=dict(argstr='--width %s', ), ) - inputs = Pik.input_spec() + inputs = Pik._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -92,7 +92,7 @@ def test_Pik_inputs(): def test_Pik_outputs(): output_map = dict(output_file=dict(), ) - outputs = Pik.output_spec() + outputs = Pik._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/minc/tests/test_auto_Resample.py b/nipype/interfaces/minc/tests/test_auto_Resample.py index 38c3ac1e8f..3c18eee18b 100644 --- a/nipype/interfaces/minc/tests/test_auto_Resample.py +++ b/nipype/interfaces/minc/tests/test_auto_Resample.py @@ -187,7 +187,7 @@ def test_Resample_inputs(): xor=('step', 'step_x_y_or_z'), ), ) - inputs = Resample.input_spec() + inputs = Resample._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -197,7 +197,7 @@ def test_Resample_inputs(): def test_Resample_outputs(): output_map = dict(output_file=dict(), ) - outputs = Resample.output_spec() + outputs = Resample._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/minc/tests/test_auto_Reshape.py b/nipype/interfaces/minc/tests/test_auto_Reshape.py index 89fe7b10d8..2df3c86484 100644 --- a/nipype/interfaces/minc/tests/test_auto_Reshape.py +++ b/nipype/interfaces/minc/tests/test_auto_Reshape.py @@ -33,7 +33,7 @@ def test_Reshape_inputs(): write_short=dict(argstr='-short', ), ) - inputs = Reshape.input_spec() + inputs = Reshape._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -43,7 +43,7 @@ def test_Reshape_inputs(): def test_Reshape_outputs(): output_map = dict(output_file=dict(), ) - outputs = Reshape.output_spec() + outputs = Reshape._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/minc/tests/test_auto_ToEcat.py b/nipype/interfaces/minc/tests/test_auto_ToEcat.py index 27349fc805..5528fd0b8d 100644 --- a/nipype/interfaces/minc/tests/test_auto_ToEcat.py +++ b/nipype/interfaces/minc/tests/test_auto_ToEcat.py @@ -44,7 +44,7 @@ def test_ToEcat_inputs(): voxels_as_integers=dict(argstr='-label', ), ) - inputs = ToEcat.input_spec() + inputs = ToEcat._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -54,7 +54,7 @@ def test_ToEcat_inputs(): def test_ToEcat_outputs(): output_map = dict(output_file=dict(), ) - outputs = ToEcat.output_spec() + outputs = ToEcat._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/minc/tests/test_auto_ToRaw.py b/nipype/interfaces/minc/tests/test_auto_ToRaw.py index 059962d84a..4c160cfc22 100644 --- a/nipype/interfaces/minc/tests/test_auto_ToRaw.py +++ b/nipype/interfaces/minc/tests/test_auto_ToRaw.py @@ -61,7 +61,7 @@ def test_ToRaw_inputs(): xor=('write_signed', 'write_unsigned'), ), ) - inputs = ToRaw.input_spec() + inputs = ToRaw._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -71,7 +71,7 @@ def test_ToRaw_inputs(): def test_ToRaw_outputs(): output_map = dict(output_file=dict(), ) - outputs = ToRaw.output_spec() + outputs = ToRaw._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/minc/tests/test_auto_VolSymm.py b/nipype/interfaces/minc/tests/test_auto_VolSymm.py index 6200880c93..01a3e3ecbc 100644 --- a/nipype/interfaces/minc/tests/test_auto_VolSymm.py +++ b/nipype/interfaces/minc/tests/test_auto_VolSymm.py @@ -54,7 +54,7 @@ def test_VolSymm_inputs(): z=dict(argstr='-z', ), ) - inputs = VolSymm.input_spec() + inputs = VolSymm._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -66,7 +66,7 @@ def test_VolSymm_outputs(): output_grid=dict(), trans_file=dict(), ) - outputs = VolSymm.output_spec() + outputs = VolSymm._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/minc/tests/test_auto_Volcentre.py b/nipype/interfaces/minc/tests/test_auto_Volcentre.py index 02afcf871e..85ebb43492 100644 --- a/nipype/interfaces/minc/tests/test_auto_Volcentre.py +++ b/nipype/interfaces/minc/tests/test_auto_Volcentre.py @@ -37,7 +37,7 @@ def test_Volcentre_inputs(): zero_dircos=dict(argstr='-zero_dircos', ), ) - inputs = Volcentre.input_spec() + inputs = Volcentre._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -47,7 +47,7 @@ def test_Volcentre_inputs(): def test_Volcentre_outputs(): output_map = dict(output_file=dict(), ) - outputs = Volcentre.output_spec() + outputs = Volcentre._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/minc/tests/test_auto_Voliso.py b/nipype/interfaces/minc/tests/test_auto_Voliso.py index e64d8f8dc1..2db4ec7177 100644 --- a/nipype/interfaces/minc/tests/test_auto_Voliso.py +++ b/nipype/interfaces/minc/tests/test_auto_Voliso.py @@ -37,7 +37,7 @@ def test_Voliso_inputs(): verbose=dict(argstr='--verbose', ), ) - inputs = Voliso.input_spec() + inputs = Voliso._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -47,7 +47,7 @@ def test_Voliso_inputs(): def test_Voliso_outputs(): output_map = dict(output_file=dict(), ) - outputs = Voliso.output_spec() + outputs = Voliso._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/minc/tests/test_auto_Volpad.py b/nipype/interfaces/minc/tests/test_auto_Volpad.py index d7adf256f0..639aa3a2ef 100644 --- a/nipype/interfaces/minc/tests/test_auto_Volpad.py +++ b/nipype/interfaces/minc/tests/test_auto_Volpad.py @@ -41,7 +41,7 @@ def test_Volpad_inputs(): verbose=dict(argstr='-verbose', ), ) - inputs = Volpad.input_spec() + inputs = Volpad._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -51,7 +51,7 @@ def test_Volpad_inputs(): def test_Volpad_outputs(): output_map = dict(output_file=dict(), ) - outputs = Volpad.output_spec() + outputs = Volpad._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/minc/tests/test_auto_XfmAvg.py b/nipype/interfaces/minc/tests/test_auto_XfmAvg.py index 1721e861fc..801c360056 100644 --- a/nipype/interfaces/minc/tests/test_auto_XfmAvg.py +++ b/nipype/interfaces/minc/tests/test_auto_XfmAvg.py @@ -39,7 +39,7 @@ def test_XfmAvg_inputs(): verbose=dict(argstr='-verbose', ), ) - inputs = XfmAvg.input_spec() + inputs = XfmAvg._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -50,7 +50,7 @@ def test_XfmAvg_outputs(): output_map = dict(output_file=dict(), output_grid=dict(), ) - outputs = XfmAvg.output_spec() + outputs = XfmAvg._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/minc/tests/test_auto_XfmConcat.py b/nipype/interfaces/minc/tests/test_auto_XfmConcat.py index 5ae6b6bef1..e6f8d0601d 100644 --- a/nipype/interfaces/minc/tests/test_auto_XfmConcat.py +++ b/nipype/interfaces/minc/tests/test_auto_XfmConcat.py @@ -34,7 +34,7 @@ def test_XfmConcat_inputs(): verbose=dict(argstr='-verbose', ), ) - inputs = XfmConcat.input_spec() + inputs = XfmConcat._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -46,7 +46,7 @@ def test_XfmConcat_outputs(): output_grids=dict(exists=True, ), ) - outputs = XfmConcat.output_spec() + outputs = XfmConcat._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/minc/tests/test_auto_XfmInvert.py b/nipype/interfaces/minc/tests/test_auto_XfmInvert.py index 873850c6b0..916ab53624 100644 --- a/nipype/interfaces/minc/tests/test_auto_XfmInvert.py +++ b/nipype/interfaces/minc/tests/test_auto_XfmInvert.py @@ -28,7 +28,7 @@ def test_XfmInvert_inputs(): verbose=dict(argstr='-verbose', ), ) - inputs = XfmInvert.input_spec() + inputs = XfmInvert._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -39,7 +39,7 @@ def test_XfmInvert_outputs(): output_map = dict(output_file=dict(), output_grid=dict(), ) - outputs = XfmInvert.output_spec() + outputs = XfmInvert._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mipav/developer.py b/nipype/interfaces/mipav/developer.py index c0762332cb..39b238ae4d 100644 --- a/nipype/interfaces/mipav/developer.py +++ b/nipype/interfaces/mipav/developer.py @@ -50,8 +50,8 @@ class JistLaminarVolumetricLayering(SEMLikeCommandLine): """ - input_spec = JistLaminarVolumetricLayeringInputSpec - output_spec = JistLaminarVolumetricLayeringOutputSpec + _input_spec = JistLaminarVolumetricLayeringInputSpec + _output_spec = JistLaminarVolumetricLayeringOutputSpec _cmd = "java edu.jhu.ece.iacl.jist.cli.run de.mpg.cbs.jist.laminar.JistLaminarVolumetricLayering " _outputs_filenames = {'outContinuous': 'outContinuous.nii', 'outLayer': 'outLayer.nii', 'outDiscrete': 'outDiscrete.nii'} _redirect_x = True @@ -102,8 +102,8 @@ class JistBrainMgdmSegmentation(SEMLikeCommandLine): """ - input_spec = JistBrainMgdmSegmentationInputSpec - output_spec = JistBrainMgdmSegmentationOutputSpec + _input_spec = JistBrainMgdmSegmentationInputSpec + _output_spec = JistBrainMgdmSegmentationOutputSpec _cmd = "java edu.jhu.ece.iacl.jist.cli.run de.mpg.cbs.jist.brain.JistBrainMgdmSegmentation " _outputs_filenames = {'outSegmented': 'outSegmented.nii', 'outPosterior2': 'outPosterior2.nii', 'outPosterior3': 'outPosterior3.nii', 'outLevelset': 'outLevelset.nii'} _redirect_x = True @@ -137,8 +137,8 @@ class JistLaminarProfileGeometry(SEMLikeCommandLine): """ - input_spec = JistLaminarProfileGeometryInputSpec - output_spec = JistLaminarProfileGeometryOutputSpec + _input_spec = JistLaminarProfileGeometryInputSpec + _output_spec = JistLaminarProfileGeometryOutputSpec _cmd = "java edu.jhu.ece.iacl.jist.cli.run de.mpg.cbs.jist.laminar.JistLaminarProfileGeometry " _outputs_filenames = {'outResult': 'outResult.nii'} _redirect_x = True @@ -170,8 +170,8 @@ class JistLaminarProfileCalculator(SEMLikeCommandLine): """ - input_spec = JistLaminarProfileCalculatorInputSpec - output_spec = JistLaminarProfileCalculatorOutputSpec + _input_spec = JistLaminarProfileCalculatorInputSpec + _output_spec = JistLaminarProfileCalculatorOutputSpec _cmd = "java edu.jhu.ece.iacl.jist.cli.run de.mpg.cbs.jist.laminar.JistLaminarProfileCalculator " _outputs_filenames = {'outResult': 'outResult.nii'} _redirect_x = True @@ -211,8 +211,8 @@ class MedicAlgorithmN3(SEMLikeCommandLine): """ - input_spec = MedicAlgorithmN3InputSpec - output_spec = MedicAlgorithmN3OutputSpec + _input_spec = MedicAlgorithmN3InputSpec + _output_spec = MedicAlgorithmN3OutputSpec _cmd = "java edu.jhu.ece.iacl.jist.cli.run edu.jhu.ece.iacl.plugins.classification.MedicAlgorithmN3 " _outputs_filenames = {'outInhomogeneity2': 'outInhomogeneity2.nii', 'outInhomogeneity': 'outInhomogeneity.nii'} _redirect_x = True @@ -245,8 +245,8 @@ class JistLaminarROIAveraging(SEMLikeCommandLine): """ - input_spec = JistLaminarROIAveragingInputSpec - output_spec = JistLaminarROIAveragingOutputSpec + _input_spec = JistLaminarROIAveragingInputSpec + _output_spec = JistLaminarROIAveragingOutputSpec _cmd = "java edu.jhu.ece.iacl.jist.cli.run de.mpg.cbs.jist.laminar.JistLaminarROIAveraging " _outputs_filenames = {'outROI3': 'outROI3'} _redirect_x = True @@ -315,8 +315,8 @@ class MedicAlgorithmLesionToads(SEMLikeCommandLine): """ - input_spec = MedicAlgorithmLesionToadsInputSpec - output_spec = MedicAlgorithmLesionToadsOutputSpec + _input_spec = MedicAlgorithmLesionToadsInputSpec + _output_spec = MedicAlgorithmLesionToadsOutputSpec _cmd = "java edu.jhu.ece.iacl.jist.cli.run edu.jhu.ece.iacl.plugins.classification.MedicAlgorithmLesionToads " _outputs_filenames = {'outWM': 'outWM.nii', 'outHard': 'outHard.nii', 'outFilled': 'outFilled.nii', 'outMembership': 'outMembership.nii', 'outInhomogeneity': 'outInhomogeneity.nii', 'outCortical': 'outCortical.nii', 'outHard2': 'outHard2.nii', 'outLesion': 'outLesion.nii', 'outSulcal': 'outSulcal.nii'} _redirect_x = True @@ -356,8 +356,8 @@ class JistBrainMp2rageSkullStripping(SEMLikeCommandLine): """ - input_spec = JistBrainMp2rageSkullStrippingInputSpec - output_spec = JistBrainMp2rageSkullStrippingOutputSpec + _input_spec = JistBrainMp2rageSkullStrippingInputSpec + _output_spec = JistBrainMp2rageSkullStrippingOutputSpec _cmd = "java edu.jhu.ece.iacl.jist.cli.run de.mpg.cbs.jist.brain.JistBrainMp2rageSkullStripping " _outputs_filenames = {'outBrain': 'outBrain.nii', 'outMasked3': 'outMasked3.nii', 'outMasked2': 'outMasked2.nii', 'outMasked': 'outMasked.nii'} _redirect_x = True @@ -398,8 +398,8 @@ class JistCortexSurfaceMeshInflation(SEMLikeCommandLine): """ - input_spec = JistCortexSurfaceMeshInflationInputSpec - output_spec = JistCortexSurfaceMeshInflationOutputSpec + _input_spec = JistCortexSurfaceMeshInflationInputSpec + _output_spec = JistCortexSurfaceMeshInflationOutputSpec _cmd = "java edu.jhu.ece.iacl.jist.cli.run de.mpg.cbs.jist.cortex.JistCortexSurfaceMeshInflation " _outputs_filenames = {'outOriginal': 'outOriginal', 'outInflated': 'outInflated'} _redirect_x = True @@ -439,8 +439,8 @@ class RandomVol(SEMLikeCommandLine): """ - input_spec = RandomVolInputSpec - output_spec = RandomVolOutputSpec + _input_spec = RandomVolInputSpec + _output_spec = RandomVolOutputSpec _cmd = "java edu.jhu.ece.iacl.jist.cli.run edu.jhu.bme.smile.demo.RandomVol " _outputs_filenames = {'outRand1': 'outRand1.nii'} _redirect_x = True @@ -474,8 +474,8 @@ class MedicAlgorithmImageCalculator(SEMLikeCommandLine): """ - input_spec = MedicAlgorithmImageCalculatorInputSpec - output_spec = MedicAlgorithmImageCalculatorOutputSpec + _input_spec = MedicAlgorithmImageCalculatorInputSpec + _output_spec = MedicAlgorithmImageCalculatorOutputSpec _cmd = "java edu.jhu.ece.iacl.jist.cli.run edu.jhu.ece.iacl.plugins.utilities.math.MedicAlgorithmImageCalculator " _outputs_filenames = {'outResult': 'outResult.nii'} _redirect_x = True @@ -508,8 +508,8 @@ class JistBrainMp2rageDuraEstimation(SEMLikeCommandLine): """ - input_spec = JistBrainMp2rageDuraEstimationInputSpec - output_spec = JistBrainMp2rageDuraEstimationOutputSpec + _input_spec = JistBrainMp2rageDuraEstimationInputSpec + _output_spec = JistBrainMp2rageDuraEstimationOutputSpec _cmd = "java edu.jhu.ece.iacl.jist.cli.run de.mpg.cbs.jist.brain.JistBrainMp2rageDuraEstimation " _outputs_filenames = {'outDura': 'outDura.nii'} _redirect_x = True @@ -543,8 +543,8 @@ class JistLaminarProfileSampling(SEMLikeCommandLine): """ - input_spec = JistLaminarProfileSamplingInputSpec - output_spec = JistLaminarProfileSamplingOutputSpec + _input_spec = JistLaminarProfileSamplingInputSpec + _output_spec = JistLaminarProfileSamplingOutputSpec _cmd = "java edu.jhu.ece.iacl.jist.cli.run de.mpg.cbs.jist.laminar.JistLaminarProfileSampling " _outputs_filenames = {'outProfile2': 'outProfile2.nii', 'outProfilemapped': 'outProfilemapped.nii'} _redirect_x = True @@ -582,8 +582,8 @@ class MedicAlgorithmMipavReorient(SEMLikeCommandLine): """ - input_spec = MedicAlgorithmMipavReorientInputSpec - output_spec = MedicAlgorithmMipavReorientOutputSpec + _input_spec = MedicAlgorithmMipavReorientInputSpec + _output_spec = MedicAlgorithmMipavReorientOutputSpec _cmd = "java edu.jhu.ece.iacl.jist.cli.run edu.jhu.ece.iacl.plugins.utilities.volume.MedicAlgorithmMipavReorient " _outputs_filenames = {} _redirect_x = True @@ -673,8 +673,8 @@ class MedicAlgorithmSPECTRE2010(SEMLikeCommandLine): """ - input_spec = MedicAlgorithmSPECTRE2010InputSpec - output_spec = MedicAlgorithmSPECTRE2010OutputSpec + _input_spec = MedicAlgorithmSPECTRE2010InputSpec + _output_spec = MedicAlgorithmSPECTRE2010OutputSpec _cmd = "java edu.jhu.ece.iacl.jist.cli.run edu.jhu.ece.iacl.plugins.segmentation.skull_strip.MedicAlgorithmSPECTRE2010 " _outputs_filenames = {'outd0': 'outd0.nii', 'outOriginal': 'outOriginal.nii', 'outMask': 'outMask.nii', 'outSplitHalves': 'outSplitHalves.nii', 'outMidsagittal': 'outMidsagittal.nii', 'outPrior': 'outPrior.nii', 'outFANTASM': 'outFANTASM.nii', 'outSegmentation': 'outSegmentation.nii', 'outStripped': 'outStripped.nii'} _redirect_x = True @@ -706,8 +706,8 @@ class JistBrainPartialVolumeFilter(SEMLikeCommandLine): """ - input_spec = JistBrainPartialVolumeFilterInputSpec - output_spec = JistBrainPartialVolumeFilterOutputSpec + _input_spec = JistBrainPartialVolumeFilterInputSpec + _output_spec = JistBrainPartialVolumeFilterOutputSpec _cmd = "java edu.jhu.ece.iacl.jist.cli.run de.mpg.cbs.jist.brain.JistBrainPartialVolumeFilter " _outputs_filenames = {'outPartial': 'outPartial.nii'} _redirect_x = True @@ -748,8 +748,8 @@ class JistIntensityMp2rageMasking(SEMLikeCommandLine): """ - input_spec = JistIntensityMp2rageMaskingInputSpec - output_spec = JistIntensityMp2rageMaskingOutputSpec + _input_spec = JistIntensityMp2rageMaskingInputSpec + _output_spec = JistIntensityMp2rageMaskingOutputSpec _cmd = "java edu.jhu.ece.iacl.jist.cli.run de.mpg.cbs.jist.intensity.JistIntensityMp2rageMasking " _outputs_filenames = {'outSignal2': 'outSignal2.nii', 'outSignal': 'outSignal.nii', 'outMasked2': 'outMasked2.nii', 'outMasked': 'outMasked.nii'} _redirect_x = True @@ -784,8 +784,8 @@ class MedicAlgorithmThresholdToBinaryMask(SEMLikeCommandLine): """ - input_spec = MedicAlgorithmThresholdToBinaryMaskInputSpec - output_spec = MedicAlgorithmThresholdToBinaryMaskOutputSpec + _input_spec = MedicAlgorithmThresholdToBinaryMaskInputSpec + _output_spec = MedicAlgorithmThresholdToBinaryMaskOutputSpec _cmd = "java edu.jhu.ece.iacl.jist.cli.run edu.jhu.ece.iacl.plugins.utilities.volume.MedicAlgorithmThresholdToBinaryMask " _outputs_filenames = {} _redirect_x = True diff --git a/nipype/interfaces/mipav/tests/test_auto_JistBrainMgdmSegmentation.py b/nipype/interfaces/mipav/tests/test_auto_JistBrainMgdmSegmentation.py index e326a579a2..15d7e8d27e 100644 --- a/nipype/interfaces/mipav/tests/test_auto_JistBrainMgdmSegmentation.py +++ b/nipype/interfaces/mipav/tests/test_auto_JistBrainMgdmSegmentation.py @@ -68,7 +68,7 @@ def test_JistBrainMgdmSegmentation_inputs(): xPrefExt=dict(argstr='--xPrefExt %s', ), ) - inputs = JistBrainMgdmSegmentation.input_spec() + inputs = JistBrainMgdmSegmentation._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -81,7 +81,7 @@ def test_JistBrainMgdmSegmentation_outputs(): outPosterior3=dict(), outSegmented=dict(), ) - outputs = JistBrainMgdmSegmentation.output_spec() + outputs = JistBrainMgdmSegmentation._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mipav/tests/test_auto_JistBrainMp2rageDuraEstimation.py b/nipype/interfaces/mipav/tests/test_auto_JistBrainMp2rageDuraEstimation.py index d8fab93f50..5aa73ab8eb 100644 --- a/nipype/interfaces/mipav/tests/test_auto_JistBrainMp2rageDuraEstimation.py +++ b/nipype/interfaces/mipav/tests/test_auto_JistBrainMp2rageDuraEstimation.py @@ -35,7 +35,7 @@ def test_JistBrainMp2rageDuraEstimation_inputs(): xPrefExt=dict(argstr='--xPrefExt %s', ), ) - inputs = JistBrainMp2rageDuraEstimation.input_spec() + inputs = JistBrainMp2rageDuraEstimation._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -45,7 +45,7 @@ def test_JistBrainMp2rageDuraEstimation_inputs(): def test_JistBrainMp2rageDuraEstimation_outputs(): output_map = dict(outDura=dict(), ) - outputs = JistBrainMp2rageDuraEstimation.output_spec() + outputs = JistBrainMp2rageDuraEstimation._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mipav/tests/test_auto_JistBrainMp2rageSkullStripping.py b/nipype/interfaces/mipav/tests/test_auto_JistBrainMp2rageSkullStripping.py index 12b3232fa7..c4890181e3 100644 --- a/nipype/interfaces/mipav/tests/test_auto_JistBrainMp2rageSkullStripping.py +++ b/nipype/interfaces/mipav/tests/test_auto_JistBrainMp2rageSkullStripping.py @@ -46,7 +46,7 @@ def test_JistBrainMp2rageSkullStripping_inputs(): xPrefExt=dict(argstr='--xPrefExt %s', ), ) - inputs = JistBrainMp2rageSkullStripping.input_spec() + inputs = JistBrainMp2rageSkullStripping._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -59,7 +59,7 @@ def test_JistBrainMp2rageSkullStripping_outputs(): outMasked2=dict(), outMasked3=dict(), ) - outputs = JistBrainMp2rageSkullStripping.output_spec() + outputs = JistBrainMp2rageSkullStripping._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mipav/tests/test_auto_JistBrainPartialVolumeFilter.py b/nipype/interfaces/mipav/tests/test_auto_JistBrainPartialVolumeFilter.py index 659b4672b0..1cbc5802fc 100644 --- a/nipype/interfaces/mipav/tests/test_auto_JistBrainPartialVolumeFilter.py +++ b/nipype/interfaces/mipav/tests/test_auto_JistBrainPartialVolumeFilter.py @@ -33,7 +33,7 @@ def test_JistBrainPartialVolumeFilter_inputs(): xPrefExt=dict(argstr='--xPrefExt %s', ), ) - inputs = JistBrainPartialVolumeFilter.input_spec() + inputs = JistBrainPartialVolumeFilter._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -43,7 +43,7 @@ def test_JistBrainPartialVolumeFilter_inputs(): def test_JistBrainPartialVolumeFilter_outputs(): output_map = dict(outPartial=dict(), ) - outputs = JistBrainPartialVolumeFilter.output_spec() + outputs = JistBrainPartialVolumeFilter._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mipav/tests/test_auto_JistCortexSurfaceMeshInflation.py b/nipype/interfaces/mipav/tests/test_auto_JistCortexSurfaceMeshInflation.py index c4bf2b4c64..d2f6c5e699 100644 --- a/nipype/interfaces/mipav/tests/test_auto_JistCortexSurfaceMeshInflation.py +++ b/nipype/interfaces/mipav/tests/test_auto_JistCortexSurfaceMeshInflation.py @@ -44,7 +44,7 @@ def test_JistCortexSurfaceMeshInflation_inputs(): xPrefExt=dict(argstr='--xPrefExt %s', ), ) - inputs = JistCortexSurfaceMeshInflation.input_spec() + inputs = JistCortexSurfaceMeshInflation._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -55,7 +55,7 @@ def test_JistCortexSurfaceMeshInflation_outputs(): output_map = dict(outInflated=dict(), outOriginal=dict(), ) - outputs = JistCortexSurfaceMeshInflation.output_spec() + outputs = JistCortexSurfaceMeshInflation._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mipav/tests/test_auto_JistIntensityMp2rageMasking.py b/nipype/interfaces/mipav/tests/test_auto_JistIntensityMp2rageMasking.py index e5eb472c0f..c96faa15d9 100644 --- a/nipype/interfaces/mipav/tests/test_auto_JistIntensityMp2rageMasking.py +++ b/nipype/interfaces/mipav/tests/test_auto_JistIntensityMp2rageMasking.py @@ -48,7 +48,7 @@ def test_JistIntensityMp2rageMasking_inputs(): xPrefExt=dict(argstr='--xPrefExt %s', ), ) - inputs = JistIntensityMp2rageMasking.input_spec() + inputs = JistIntensityMp2rageMasking._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -61,7 +61,7 @@ def test_JistIntensityMp2rageMasking_outputs(): outSignal=dict(), outSignal2=dict(), ) - outputs = JistIntensityMp2rageMasking.output_spec() + outputs = JistIntensityMp2rageMasking._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mipav/tests/test_auto_JistLaminarProfileCalculator.py b/nipype/interfaces/mipav/tests/test_auto_JistLaminarProfileCalculator.py index c00adac81c..2c38f444de 100644 --- a/nipype/interfaces/mipav/tests/test_auto_JistLaminarProfileCalculator.py +++ b/nipype/interfaces/mipav/tests/test_auto_JistLaminarProfileCalculator.py @@ -33,7 +33,7 @@ def test_JistLaminarProfileCalculator_inputs(): xPrefExt=dict(argstr='--xPrefExt %s', ), ) - inputs = JistLaminarProfileCalculator.input_spec() + inputs = JistLaminarProfileCalculator._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -43,7 +43,7 @@ def test_JistLaminarProfileCalculator_inputs(): def test_JistLaminarProfileCalculator_outputs(): output_map = dict(outResult=dict(), ) - outputs = JistLaminarProfileCalculator.output_spec() + outputs = JistLaminarProfileCalculator._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mipav/tests/test_auto_JistLaminarProfileGeometry.py b/nipype/interfaces/mipav/tests/test_auto_JistLaminarProfileGeometry.py index b251f594db..745f6c393d 100644 --- a/nipype/interfaces/mipav/tests/test_auto_JistLaminarProfileGeometry.py +++ b/nipype/interfaces/mipav/tests/test_auto_JistLaminarProfileGeometry.py @@ -37,7 +37,7 @@ def test_JistLaminarProfileGeometry_inputs(): xPrefExt=dict(argstr='--xPrefExt %s', ), ) - inputs = JistLaminarProfileGeometry.input_spec() + inputs = JistLaminarProfileGeometry._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -47,7 +47,7 @@ def test_JistLaminarProfileGeometry_inputs(): def test_JistLaminarProfileGeometry_outputs(): output_map = dict(outResult=dict(), ) - outputs = JistLaminarProfileGeometry.output_spec() + outputs = JistLaminarProfileGeometry._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mipav/tests/test_auto_JistLaminarProfileSampling.py b/nipype/interfaces/mipav/tests/test_auto_JistLaminarProfileSampling.py index b9d5a067ec..5468645673 100644 --- a/nipype/interfaces/mipav/tests/test_auto_JistLaminarProfileSampling.py +++ b/nipype/interfaces/mipav/tests/test_auto_JistLaminarProfileSampling.py @@ -36,7 +36,7 @@ def test_JistLaminarProfileSampling_inputs(): xPrefExt=dict(argstr='--xPrefExt %s', ), ) - inputs = JistLaminarProfileSampling.input_spec() + inputs = JistLaminarProfileSampling._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -47,7 +47,7 @@ def test_JistLaminarProfileSampling_outputs(): output_map = dict(outProfile2=dict(), outProfilemapped=dict(), ) - outputs = JistLaminarProfileSampling.output_spec() + outputs = JistLaminarProfileSampling._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mipav/tests/test_auto_JistLaminarROIAveraging.py b/nipype/interfaces/mipav/tests/test_auto_JistLaminarROIAveraging.py index 2c22ad0e70..f0c3c4b7c0 100644 --- a/nipype/interfaces/mipav/tests/test_auto_JistLaminarROIAveraging.py +++ b/nipype/interfaces/mipav/tests/test_auto_JistLaminarROIAveraging.py @@ -35,7 +35,7 @@ def test_JistLaminarROIAveraging_inputs(): xPrefExt=dict(argstr='--xPrefExt %s', ), ) - inputs = JistLaminarROIAveraging.input_spec() + inputs = JistLaminarROIAveraging._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -45,7 +45,7 @@ def test_JistLaminarROIAveraging_inputs(): def test_JistLaminarROIAveraging_outputs(): output_map = dict(outROI3=dict(), ) - outputs = JistLaminarROIAveraging.output_spec() + outputs = JistLaminarROIAveraging._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mipav/tests/test_auto_JistLaminarVolumetricLayering.py b/nipype/interfaces/mipav/tests/test_auto_JistLaminarVolumetricLayering.py index 40ff811855..6d681a96d9 100644 --- a/nipype/interfaces/mipav/tests/test_auto_JistLaminarVolumetricLayering.py +++ b/nipype/interfaces/mipav/tests/test_auto_JistLaminarVolumetricLayering.py @@ -55,7 +55,7 @@ def test_JistLaminarVolumetricLayering_inputs(): xPrefExt=dict(argstr='--xPrefExt %s', ), ) - inputs = JistLaminarVolumetricLayering.input_spec() + inputs = JistLaminarVolumetricLayering._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -67,7 +67,7 @@ def test_JistLaminarVolumetricLayering_outputs(): outDiscrete=dict(), outLayer=dict(), ) - outputs = JistLaminarVolumetricLayering.output_spec() + outputs = JistLaminarVolumetricLayering._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmImageCalculator.py b/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmImageCalculator.py index 802669247f..fc1388536e 100644 --- a/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmImageCalculator.py +++ b/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmImageCalculator.py @@ -33,7 +33,7 @@ def test_MedicAlgorithmImageCalculator_inputs(): xPrefExt=dict(argstr='--xPrefExt %s', ), ) - inputs = MedicAlgorithmImageCalculator.input_spec() + inputs = MedicAlgorithmImageCalculator._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -43,7 +43,7 @@ def test_MedicAlgorithmImageCalculator_inputs(): def test_MedicAlgorithmImageCalculator_outputs(): output_map = dict(outResult=dict(), ) - outputs = MedicAlgorithmImageCalculator.output_spec() + outputs = MedicAlgorithmImageCalculator._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmLesionToads.py b/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmLesionToads.py index 232d6a1362..e38af9af0c 100644 --- a/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmLesionToads.py +++ b/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmLesionToads.py @@ -93,7 +93,7 @@ def test_MedicAlgorithmLesionToads_inputs(): xPrefExt=dict(argstr='--xPrefExt %s', ), ) - inputs = MedicAlgorithmLesionToads.input_spec() + inputs = MedicAlgorithmLesionToads._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -111,7 +111,7 @@ def test_MedicAlgorithmLesionToads_outputs(): outSulcal=dict(), outWM=dict(), ) - outputs = MedicAlgorithmLesionToads.output_spec() + outputs = MedicAlgorithmLesionToads._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmMipavReorient.py b/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmMipavReorient.py index a9e43b3b04..5670f3a8a7 100644 --- a/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmMipavReorient.py +++ b/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmMipavReorient.py @@ -46,7 +46,7 @@ def test_MedicAlgorithmMipavReorient_inputs(): xPrefExt=dict(argstr='--xPrefExt %s', ), ) - inputs = MedicAlgorithmMipavReorient.input_spec() + inputs = MedicAlgorithmMipavReorient._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -55,7 +55,7 @@ def test_MedicAlgorithmMipavReorient_inputs(): def test_MedicAlgorithmMipavReorient_outputs(): output_map = dict() - outputs = MedicAlgorithmMipavReorient.output_spec() + outputs = MedicAlgorithmMipavReorient._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmN3.py b/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmN3.py index 58b3daa96f..261e64dcf8 100644 --- a/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmN3.py +++ b/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmN3.py @@ -48,7 +48,7 @@ def test_MedicAlgorithmN3_inputs(): xPrefExt=dict(argstr='--xPrefExt %s', ), ) - inputs = MedicAlgorithmN3.input_spec() + inputs = MedicAlgorithmN3._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -59,7 +59,7 @@ def test_MedicAlgorithmN3_outputs(): output_map = dict(outInhomogeneity=dict(), outInhomogeneity2=dict(), ) - outputs = MedicAlgorithmN3.output_spec() + outputs = MedicAlgorithmN3._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmSPECTRE2010.py b/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmSPECTRE2010.py index c8e005123b..ea90b9278a 100644 --- a/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmSPECTRE2010.py +++ b/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmSPECTRE2010.py @@ -119,7 +119,7 @@ def test_MedicAlgorithmSPECTRE2010_inputs(): xPrefExt=dict(argstr='--xPrefExt %s', ), ) - inputs = MedicAlgorithmSPECTRE2010.input_spec() + inputs = MedicAlgorithmSPECTRE2010._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -137,7 +137,7 @@ def test_MedicAlgorithmSPECTRE2010_outputs(): outStripped=dict(), outd0=dict(), ) - outputs = MedicAlgorithmSPECTRE2010.output_spec() + outputs = MedicAlgorithmSPECTRE2010._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmThresholdToBinaryMask.py b/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmThresholdToBinaryMask.py index f472c7043f..b2d4334063 100644 --- a/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmThresholdToBinaryMask.py +++ b/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmThresholdToBinaryMask.py @@ -36,7 +36,7 @@ def test_MedicAlgorithmThresholdToBinaryMask_inputs(): xPrefExt=dict(argstr='--xPrefExt %s', ), ) - inputs = MedicAlgorithmThresholdToBinaryMask.input_spec() + inputs = MedicAlgorithmThresholdToBinaryMask._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -45,7 +45,7 @@ def test_MedicAlgorithmThresholdToBinaryMask_inputs(): def test_MedicAlgorithmThresholdToBinaryMask_outputs(): output_map = dict() - outputs = MedicAlgorithmThresholdToBinaryMask.output_spec() + outputs = MedicAlgorithmThresholdToBinaryMask._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mipav/tests/test_auto_RandomVol.py b/nipype/interfaces/mipav/tests/test_auto_RandomVol.py index be6839e209..adb9389a4a 100644 --- a/nipype/interfaces/mipav/tests/test_auto_RandomVol.py +++ b/nipype/interfaces/mipav/tests/test_auto_RandomVol.py @@ -45,7 +45,7 @@ def test_RandomVol_inputs(): xPrefExt=dict(argstr='--xPrefExt %s', ), ) - inputs = RandomVol.input_spec() + inputs = RandomVol._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -55,7 +55,7 @@ def test_RandomVol_inputs(): def test_RandomVol_outputs(): output_map = dict(outRand1=dict(), ) - outputs = RandomVol.output_spec() + outputs = RandomVol._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mne/base.py b/nipype/interfaces/mne/base.py index 40d0ea50ec..4855b04956 100644 --- a/nipype/interfaces/mne/base.py +++ b/nipype/interfaces/mne/base.py @@ -60,8 +60,8 @@ class WatershedBEM(FSCommand): """ _cmd = 'mne_watershed_bem' - input_spec = WatershedBEMInputSpec - output_spec = WatershedBEMOutputSpec + _input_spec = WatershedBEMInputSpec + _output_spec = WatershedBEMOutputSpec _additional_metadata = ['loc', 'altkey'] def _get_files(self, path, key, dirval, altkey=None): diff --git a/nipype/interfaces/mne/tests/test_auto_WatershedBEM.py b/nipype/interfaces/mne/tests/test_auto_WatershedBEM.py index 28c42e1c6d..58012fd268 100644 --- a/nipype/interfaces/mne/tests/test_auto_WatershedBEM.py +++ b/nipype/interfaces/mne/tests/test_auto_WatershedBEM.py @@ -29,7 +29,7 @@ def test_WatershedBEM_inputs(): usedefault=True, ), ) - inputs = WatershedBEM.input_spec() + inputs = WatershedBEM._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -53,7 +53,7 @@ def test_WatershedBEM_outputs(): outer_skull_surface=dict(loc='bem/watershed', ), ) - outputs = WatershedBEM.output_spec() + outputs = WatershedBEM._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix/convert.py b/nipype/interfaces/mrtrix/convert.py index 0963b206a3..f33f4154c6 100644 --- a/nipype/interfaces/mrtrix/convert.py +++ b/nipype/interfaces/mrtrix/convert.py @@ -177,8 +177,8 @@ class MRTrix2TrackVis(BaseInterface): >>> tck2trk.inputs.image_file = 'diffusion.nii' >>> tck2trk.run() # doctest: +SKIP """ - input_spec = MRTrix2TrackVisInputSpec - output_spec = MRTrix2TrackVisOutputSpec + _input_spec = MRTrix2TrackVisInputSpec + _output_spec = MRTrix2TrackVisOutputSpec def _run_interface(self, runtime): dx, dy, dz = get_data_dims(self.inputs.image_file) diff --git a/nipype/interfaces/mrtrix/preprocess.py b/nipype/interfaces/mrtrix/preprocess.py index a12632bd9d..7b894ec353 100644 --- a/nipype/interfaces/mrtrix/preprocess.py +++ b/nipype/interfaces/mrtrix/preprocess.py @@ -64,8 +64,8 @@ class MRConvert(CommandLine): """ _cmd = 'mrconvert' - input_spec = MRConvertInputSpec - output_spec = MRConvertOutputSpec + _input_spec = MRConvertInputSpec + _output_spec = MRConvertOutputSpec def _post_run(self): @@ -146,8 +146,8 @@ class DWI2Tensor(CommandLine): """ _cmd = 'dwi2tensor' - input_spec = DWI2TensorInputSpec - output_spec = DWI2TensorOutputSpec + _input_spec = DWI2TensorInputSpec + _output_spec = DWI2TensorOutputSpec class Tensor2VectorInputSpec(CommandLineInputSpec): @@ -176,8 +176,8 @@ class Tensor2Vector(CommandLine): """ _cmd = 'tensor2vector' - input_spec = Tensor2VectorInputSpec - output_spec = Tensor2VectorOutputSpec + _input_spec = Tensor2VectorInputSpec + _output_spec = Tensor2VectorOutputSpec def _post_run(self): @@ -224,8 +224,8 @@ class Tensor2FractionalAnisotropy(CommandLine): """ _cmd = 'tensor2FA' - input_spec = Tensor2FractionalAnisotropyInputSpec - output_spec = Tensor2FractionalAnisotropyOutputSpec + _input_spec = Tensor2FractionalAnisotropyInputSpec + _output_spec = Tensor2FractionalAnisotropyOutputSpec def _post_run(self): @@ -272,8 +272,8 @@ class Tensor2ApparentDiffusion(CommandLine): """ _cmd = 'tensor2ADC' - input_spec = Tensor2ApparentDiffusionInputSpec - output_spec = Tensor2ApparentDiffusionOutputSpec + _input_spec = Tensor2ApparentDiffusionInputSpec + _output_spec = Tensor2ApparentDiffusionOutputSpec def _post_run(self): @@ -321,8 +321,8 @@ class MRMultiply(CommandLine): """ _cmd = 'mrmult' - input_spec = MRMultiplyInputSpec - output_spec = MRMultiplyOutputSpec + _input_spec = MRMultiplyInputSpec + _output_spec = MRMultiplyOutputSpec def _post_run(self): @@ -369,8 +369,8 @@ class MRTrixViewer(CommandLine): """ _cmd = 'mrview' - input_spec = MRTrixViewerInputSpec - output_spec = MRTrixViewerOutputSpec + _input_spec = MRTrixViewerInputSpec + _output_spec = MRTrixViewerOutputSpec def _post_run(self): return @@ -399,8 +399,8 @@ class MRTrixInfo(CommandLine): """ _cmd = 'mrinfo' - input_spec = MRTrixInfoInputSpec - output_spec = MRTrixInfoOutputSpec + _input_spec = MRTrixInfoInputSpec + _output_spec = MRTrixInfoOutputSpec def _post_run(self): return @@ -434,8 +434,8 @@ class GenerateWhiteMatterMask(CommandLine): """ _cmd = 'gen_WM_mask' - input_spec = GenerateWhiteMatterMaskInputSpec - output_spec = GenerateWhiteMatterMaskOutputSpec + _input_spec = GenerateWhiteMatterMaskInputSpec + _output_spec = GenerateWhiteMatterMaskOutputSpec def _post_run(self): @@ -479,8 +479,8 @@ class Erode(CommandLine): >>> erode.run() # doctest: +SKIP """ _cmd = 'erode' - input_spec = ErodeInputSpec - output_spec = ErodeOutputSpec + _input_spec = ErodeInputSpec + _output_spec = ErodeOutputSpec def _post_run(self): @@ -536,8 +536,8 @@ class Threshold(CommandLine): """ _cmd = 'threshold' - input_spec = ThresholdInputSpec - output_spec = ThresholdOutputSpec + _input_spec = ThresholdInputSpec + _output_spec = ThresholdOutputSpec def _post_run(self): @@ -584,8 +584,8 @@ class MedianFilter3D(CommandLine): """ _cmd = 'median3D' - input_spec = MedianFilter3DInputSpec - output_spec = MedianFilter3DOutputSpec + _input_spec = MedianFilter3DInputSpec + _output_spec = MedianFilter3DOutputSpec def _post_run(self): @@ -641,8 +641,8 @@ class MRTransform(CommandLine): """ _cmd = 'mrtransform' - input_spec = MRTransformInputSpec - output_spec = MRTransformOutputSpec + _input_spec = MRTransformInputSpec + _output_spec = MRTransformOutputSpec def _post_run(self): diff --git a/nipype/interfaces/mrtrix/tensors.py b/nipype/interfaces/mrtrix/tensors.py index 7b262cf1be..d70a863acd 100644 --- a/nipype/interfaces/mrtrix/tensors.py +++ b/nipype/interfaces/mrtrix/tensors.py @@ -72,8 +72,8 @@ class DWI2SphericalHarmonicsImage(CommandLine): >>> dwi2SH.run() # doctest: +SKIP """ _cmd = 'dwi2SH' - input_spec = DWI2SphericalHarmonicsImageInputSpec - output_spec = DWI2SphericalHarmonicsImageOutputSpec + _input_spec = DWI2SphericalHarmonicsImageInputSpec + _output_spec = DWI2SphericalHarmonicsImageOutputSpec def _post_run(self): @@ -154,8 +154,8 @@ class ConstrainedSphericalDeconvolution(CommandLine): """ _cmd = 'csdeconv' - input_spec = ConstrainedSphericalDeconvolutionInputSpec - output_spec = ConstrainedSphericalDeconvolutionOutputSpec + _input_spec = ConstrainedSphericalDeconvolutionInputSpec + _output_spec = ConstrainedSphericalDeconvolutionOutputSpec def _post_run(self): @@ -207,8 +207,8 @@ class EstimateResponseForSH(CommandLine): >>> estresp.run() # doctest: +SKIP """ _cmd = 'estimate_response' - input_spec = EstimateResponseForSHInputSpec - output_spec = EstimateResponseForSHOutputSpec + _input_spec = EstimateResponseForSHInputSpec + _output_spec = EstimateResponseForSHOutputSpec def _post_run(self): @@ -286,8 +286,8 @@ class FSL2MRTrix(BaseInterface): >>> fsl2mrtrix.inputs.invert_y = True >>> fsl2mrtrix.run() # doctest: +SKIP """ - input_spec = FSL2MRTrixInputSpec - output_spec = FSL2MRTrixOutputSpec + _input_spec = FSL2MRTrixInputSpec + _output_spec = FSL2MRTrixOutputSpec def _run_interface(self, runtime): encoding = concat_files(self.inputs.bvec_file, self.inputs.bval_file, self.inputs.invert_x, self.inputs.invert_y, self.inputs.invert_z) @@ -339,8 +339,8 @@ class GenerateDirections(CommandLine): """ _cmd = 'gendir' - input_spec = GenerateDirectionsInputSpec - output_spec = GenerateDirectionsOutputSpec + _input_spec = GenerateDirectionsInputSpec + _output_spec = GenerateDirectionsOutputSpec class FindShPeaksInputSpec(CommandLineInputSpec): @@ -379,8 +379,8 @@ class FindShPeaks(CommandLine): """ _cmd = 'find_SH_peaks' - input_spec = FindShPeaksInputSpec - output_spec = FindShPeaksOutputSpec + _input_spec = FindShPeaksInputSpec + _output_spec = FindShPeaksOutputSpec class Directions2AmplitudeInputSpec(CommandLineInputSpec): @@ -415,5 +415,5 @@ class Directions2Amplitude(CommandLine): """ _cmd = 'dir2amp' - input_spec = Directions2AmplitudeInputSpec - output_spec = Directions2AmplitudeOutputSpec + _input_spec = Directions2AmplitudeInputSpec + _output_spec = Directions2AmplitudeOutputSpec diff --git a/nipype/interfaces/mrtrix/tests/test_auto_ConstrainedSphericalDeconvolution.py b/nipype/interfaces/mrtrix/tests/test_auto_ConstrainedSphericalDeconvolution.py index 4bf97e42f7..26eec439ec 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_ConstrainedSphericalDeconvolution.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_ConstrainedSphericalDeconvolution.py @@ -52,7 +52,7 @@ def test_ConstrainedSphericalDeconvolution_inputs(): threshold_value=dict(argstr='-threshold %s', ), ) - inputs = ConstrainedSphericalDeconvolution.input_spec() + inputs = ConstrainedSphericalDeconvolution._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -62,7 +62,7 @@ def test_ConstrainedSphericalDeconvolution_inputs(): def test_ConstrainedSphericalDeconvolution_outputs(): output_map = dict(spherical_harmonics_image=dict(), ) - outputs = ConstrainedSphericalDeconvolution.output_spec() + outputs = ConstrainedSphericalDeconvolution._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix/tests/test_auto_DWI2SphericalHarmonicsImage.py b/nipype/interfaces/mrtrix/tests/test_auto_DWI2SphericalHarmonicsImage.py index 28d3c97831..29ccc7385f 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_DWI2SphericalHarmonicsImage.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_DWI2SphericalHarmonicsImage.py @@ -32,7 +32,7 @@ def test_DWI2SphericalHarmonicsImage_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = DWI2SphericalHarmonicsImage.input_spec() + inputs = DWI2SphericalHarmonicsImage._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -42,7 +42,7 @@ def test_DWI2SphericalHarmonicsImage_inputs(): def test_DWI2SphericalHarmonicsImage_outputs(): output_map = dict(spherical_harmonics_image=dict(), ) - outputs = DWI2SphericalHarmonicsImage.output_spec() + outputs = DWI2SphericalHarmonicsImage._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix/tests/test_auto_DWI2Tensor.py b/nipype/interfaces/mrtrix/tests/test_auto_DWI2Tensor.py index 1062277c13..891d33f9b8 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_DWI2Tensor.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_DWI2Tensor.py @@ -42,7 +42,7 @@ def test_DWI2Tensor_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = DWI2Tensor.input_spec() + inputs = DWI2Tensor._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -52,7 +52,7 @@ def test_DWI2Tensor_inputs(): def test_DWI2Tensor_outputs(): output_map = dict(tensor=dict(), ) - outputs = DWI2Tensor.output_spec() + outputs = DWI2Tensor._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix/tests/test_auto_DiffusionTensorStreamlineTrack.py b/nipype/interfaces/mrtrix/tests/test_auto_DiffusionTensorStreamlineTrack.py index 42cb14de9f..306cb3545f 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_DiffusionTensorStreamlineTrack.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_DiffusionTensorStreamlineTrack.py @@ -102,7 +102,7 @@ def test_DiffusionTensorStreamlineTrack_inputs(): unidirectional=dict(argstr='-unidirectional', ), ) - inputs = DiffusionTensorStreamlineTrack.input_spec() + inputs = DiffusionTensorStreamlineTrack._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -112,7 +112,7 @@ def test_DiffusionTensorStreamlineTrack_inputs(): def test_DiffusionTensorStreamlineTrack_outputs(): output_map = dict(tracked=dict(), ) - outputs = DiffusionTensorStreamlineTrack.output_spec() + outputs = DiffusionTensorStreamlineTrack._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix/tests/test_auto_Directions2Amplitude.py b/nipype/interfaces/mrtrix/tests/test_auto_Directions2Amplitude.py index 1fb1d8d764..3a2fdca603 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_Directions2Amplitude.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_Directions2Amplitude.py @@ -39,7 +39,7 @@ def test_Directions2Amplitude_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Directions2Amplitude.input_spec() + inputs = Directions2Amplitude._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -49,7 +49,7 @@ def test_Directions2Amplitude_inputs(): def test_Directions2Amplitude_outputs(): output_map = dict(out_file=dict(), ) - outputs = Directions2Amplitude.output_spec() + outputs = Directions2Amplitude._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix/tests/test_auto_Erode.py b/nipype/interfaces/mrtrix/tests/test_auto_Erode.py index 3161e6e0fd..f0d53bdac1 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_Erode.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_Erode.py @@ -34,7 +34,7 @@ def test_Erode_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Erode.input_spec() + inputs = Erode._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -44,7 +44,7 @@ def test_Erode_inputs(): def test_Erode_outputs(): output_map = dict(out_file=dict(), ) - outputs = Erode.output_spec() + outputs = Erode._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix/tests/test_auto_EstimateResponseForSH.py b/nipype/interfaces/mrtrix/tests/test_auto_EstimateResponseForSH.py index ff6a638f14..601822afdd 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_EstimateResponseForSH.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_EstimateResponseForSH.py @@ -39,7 +39,7 @@ def test_EstimateResponseForSH_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = EstimateResponseForSH.input_spec() + inputs = EstimateResponseForSH._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -49,7 +49,7 @@ def test_EstimateResponseForSH_inputs(): def test_EstimateResponseForSH_outputs(): output_map = dict(response=dict(), ) - outputs = EstimateResponseForSH.output_spec() + outputs = EstimateResponseForSH._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix/tests/test_auto_FSL2MRTrix.py b/nipype/interfaces/mrtrix/tests/test_auto_FSL2MRTrix.py index 03cc06b2ed..980dfeaee0 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_FSL2MRTrix.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_FSL2MRTrix.py @@ -17,7 +17,7 @@ def test_FSL2MRTrix_inputs(): out_encoding_file=dict(genfile=True, ), ) - inputs = FSL2MRTrix.input_spec() + inputs = FSL2MRTrix._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -27,7 +27,7 @@ def test_FSL2MRTrix_inputs(): def test_FSL2MRTrix_outputs(): output_map = dict(encoding_file=dict(), ) - outputs = FSL2MRTrix.output_spec() + outputs = FSL2MRTrix._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix/tests/test_auto_FilterTracks.py b/nipype/interfaces/mrtrix/tests/test_auto_FilterTracks.py index 099d08c2de..14cf64350d 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_FilterTracks.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_FilterTracks.py @@ -56,7 +56,7 @@ def test_FilterTracks_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = FilterTracks.input_spec() + inputs = FilterTracks._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -66,7 +66,7 @@ def test_FilterTracks_inputs(): def test_FilterTracks_outputs(): output_map = dict(out_file=dict(), ) - outputs = FilterTracks.output_spec() + outputs = FilterTracks._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix/tests/test_auto_FindShPeaks.py b/nipype/interfaces/mrtrix/tests/test_auto_FindShPeaks.py index d4776cb4b3..613f9d7da3 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_FindShPeaks.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_FindShPeaks.py @@ -45,7 +45,7 @@ def test_FindShPeaks_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = FindShPeaks.input_spec() + inputs = FindShPeaks._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -55,7 +55,7 @@ def test_FindShPeaks_inputs(): def test_FindShPeaks_outputs(): output_map = dict(out_file=dict(), ) - outputs = FindShPeaks.output_spec() + outputs = FindShPeaks._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix/tests/test_auto_GenerateDirections.py b/nipype/interfaces/mrtrix/tests/test_auto_GenerateDirections.py index bd54f78fb3..d4fb2c77ee 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_GenerateDirections.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_GenerateDirections.py @@ -35,7 +35,7 @@ def test_GenerateDirections_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = GenerateDirections.input_spec() + inputs = GenerateDirections._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -45,7 +45,7 @@ def test_GenerateDirections_inputs(): def test_GenerateDirections_outputs(): output_map = dict(out_file=dict(), ) - outputs = GenerateDirections.output_spec() + outputs = GenerateDirections._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix/tests/test_auto_GenerateWhiteMatterMask.py b/nipype/interfaces/mrtrix/tests/test_auto_GenerateWhiteMatterMask.py index 909015a608..012db8b7f8 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_GenerateWhiteMatterMask.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_GenerateWhiteMatterMask.py @@ -33,7 +33,7 @@ def test_GenerateWhiteMatterMask_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = GenerateWhiteMatterMask.input_spec() + inputs = GenerateWhiteMatterMask._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -43,7 +43,7 @@ def test_GenerateWhiteMatterMask_inputs(): def test_GenerateWhiteMatterMask_outputs(): output_map = dict(WMprobabilitymap=dict(), ) - outputs = GenerateWhiteMatterMask.output_spec() + outputs = GenerateWhiteMatterMask._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix/tests/test_auto_MRConvert.py b/nipype/interfaces/mrtrix/tests/test_auto_MRConvert.py index 75cb4ff985..c069107a5f 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_MRConvert.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_MRConvert.py @@ -57,7 +57,7 @@ def test_MRConvert_inputs(): sep=',', ), ) - inputs = MRConvert.input_spec() + inputs = MRConvert._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -67,7 +67,7 @@ def test_MRConvert_inputs(): def test_MRConvert_outputs(): output_map = dict(converted=dict(), ) - outputs = MRConvert.output_spec() + outputs = MRConvert._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix/tests/test_auto_MRMultiply.py b/nipype/interfaces/mrtrix/tests/test_auto_MRMultiply.py index 4c76a6f96c..22ca4cf25d 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_MRMultiply.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_MRMultiply.py @@ -29,7 +29,7 @@ def test_MRMultiply_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = MRMultiply.input_spec() + inputs = MRMultiply._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -39,7 +39,7 @@ def test_MRMultiply_inputs(): def test_MRMultiply_outputs(): output_map = dict(out_file=dict(), ) - outputs = MRMultiply.output_spec() + outputs = MRMultiply._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix/tests/test_auto_MRTransform.py b/nipype/interfaces/mrtrix/tests/test_auto_MRTransform.py index 0376e9b4e1..9bbc7d22dc 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_MRTransform.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_MRTransform.py @@ -47,7 +47,7 @@ def test_MRTransform_inputs(): position=1, ), ) - inputs = MRTransform.input_spec() + inputs = MRTransform._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -57,7 +57,7 @@ def test_MRTransform_inputs(): def test_MRTransform_outputs(): output_map = dict(out_file=dict(), ) - outputs = MRTransform.output_spec() + outputs = MRTransform._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix/tests/test_auto_MRTrix2TrackVis.py b/nipype/interfaces/mrtrix/tests/test_auto_MRTrix2TrackVis.py index d7da413c92..69ab46acea 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_MRTrix2TrackVis.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_MRTrix2TrackVis.py @@ -13,7 +13,7 @@ def test_MRTrix2TrackVis_inputs(): ), registration_image_file=dict(), ) - inputs = MRTrix2TrackVis.input_spec() + inputs = MRTrix2TrackVis._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -23,7 +23,7 @@ def test_MRTrix2TrackVis_inputs(): def test_MRTrix2TrackVis_outputs(): output_map = dict(out_file=dict(), ) - outputs = MRTrix2TrackVis.output_spec() + outputs = MRTrix2TrackVis._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix/tests/test_auto_MRTrixInfo.py b/nipype/interfaces/mrtrix/tests/test_auto_MRTrixInfo.py index 73671df40c..85a2bda311 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_MRTrixInfo.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_MRTrixInfo.py @@ -19,7 +19,7 @@ def test_MRTrixInfo_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = MRTrixInfo.input_spec() + inputs = MRTrixInfo._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -28,7 +28,7 @@ def test_MRTrixInfo_inputs(): def test_MRTrixInfo_outputs(): output_map = dict() - outputs = MRTrixInfo.output_spec() + outputs = MRTrixInfo._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix/tests/test_auto_MRTrixViewer.py b/nipype/interfaces/mrtrix/tests/test_auto_MRTrixViewer.py index d0e99f2348..cf3deeb7e4 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_MRTrixViewer.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_MRTrixViewer.py @@ -25,7 +25,7 @@ def test_MRTrixViewer_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = MRTrixViewer.input_spec() + inputs = MRTrixViewer._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -34,7 +34,7 @@ def test_MRTrixViewer_inputs(): def test_MRTrixViewer_outputs(): output_map = dict() - outputs = MRTrixViewer.output_spec() + outputs = MRTrixViewer._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix/tests/test_auto_MedianFilter3D.py b/nipype/interfaces/mrtrix/tests/test_auto_MedianFilter3D.py index 7010acfda5..d4fd2ec99b 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_MedianFilter3D.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_MedianFilter3D.py @@ -29,7 +29,7 @@ def test_MedianFilter3D_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = MedianFilter3D.input_spec() + inputs = MedianFilter3D._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -39,7 +39,7 @@ def test_MedianFilter3D_inputs(): def test_MedianFilter3D_outputs(): output_map = dict(out_file=dict(), ) - outputs = MedianFilter3D.output_spec() + outputs = MedianFilter3D._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix/tests/test_auto_ProbabilisticSphericallyDeconvolutedStreamlineTrack.py b/nipype/interfaces/mrtrix/tests/test_auto_ProbabilisticSphericallyDeconvolutedStreamlineTrack.py index dfb1b57ddc..7d5402ad2d 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_ProbabilisticSphericallyDeconvolutedStreamlineTrack.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_ProbabilisticSphericallyDeconvolutedStreamlineTrack.py @@ -100,7 +100,7 @@ def test_ProbabilisticSphericallyDeconvolutedStreamlineTrack_inputs(): unidirectional=dict(argstr='-unidirectional', ), ) - inputs = ProbabilisticSphericallyDeconvolutedStreamlineTrack.input_spec() + inputs = ProbabilisticSphericallyDeconvolutedStreamlineTrack._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -110,7 +110,7 @@ def test_ProbabilisticSphericallyDeconvolutedStreamlineTrack_inputs(): def test_ProbabilisticSphericallyDeconvolutedStreamlineTrack_outputs(): output_map = dict(tracked=dict(), ) - outputs = ProbabilisticSphericallyDeconvolutedStreamlineTrack.output_spec() + outputs = ProbabilisticSphericallyDeconvolutedStreamlineTrack._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix/tests/test_auto_SphericallyDeconvolutedStreamlineTrack.py b/nipype/interfaces/mrtrix/tests/test_auto_SphericallyDeconvolutedStreamlineTrack.py index 2180af33eb..4ee50a1aa6 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_SphericallyDeconvolutedStreamlineTrack.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_SphericallyDeconvolutedStreamlineTrack.py @@ -98,7 +98,7 @@ def test_SphericallyDeconvolutedStreamlineTrack_inputs(): unidirectional=dict(argstr='-unidirectional', ), ) - inputs = SphericallyDeconvolutedStreamlineTrack.input_spec() + inputs = SphericallyDeconvolutedStreamlineTrack._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -108,7 +108,7 @@ def test_SphericallyDeconvolutedStreamlineTrack_inputs(): def test_SphericallyDeconvolutedStreamlineTrack_outputs(): output_map = dict(tracked=dict(), ) - outputs = SphericallyDeconvolutedStreamlineTrack.output_spec() + outputs = SphericallyDeconvolutedStreamlineTrack._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix/tests/test_auto_StreamlineTrack.py b/nipype/interfaces/mrtrix/tests/test_auto_StreamlineTrack.py index 86f3607f34..051bb70c0c 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_StreamlineTrack.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_StreamlineTrack.py @@ -98,7 +98,7 @@ def test_StreamlineTrack_inputs(): unidirectional=dict(argstr='-unidirectional', ), ) - inputs = StreamlineTrack.input_spec() + inputs = StreamlineTrack._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -108,7 +108,7 @@ def test_StreamlineTrack_inputs(): def test_StreamlineTrack_outputs(): output_map = dict(tracked=dict(), ) - outputs = StreamlineTrack.output_spec() + outputs = StreamlineTrack._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix/tests/test_auto_Tensor2ApparentDiffusion.py b/nipype/interfaces/mrtrix/tests/test_auto_Tensor2ApparentDiffusion.py index c7bd91a610..e0d0b8931b 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_Tensor2ApparentDiffusion.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_Tensor2ApparentDiffusion.py @@ -29,7 +29,7 @@ def test_Tensor2ApparentDiffusion_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Tensor2ApparentDiffusion.input_spec() + inputs = Tensor2ApparentDiffusion._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -39,7 +39,7 @@ def test_Tensor2ApparentDiffusion_inputs(): def test_Tensor2ApparentDiffusion_outputs(): output_map = dict(ADC=dict(), ) - outputs = Tensor2ApparentDiffusion.output_spec() + outputs = Tensor2ApparentDiffusion._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix/tests/test_auto_Tensor2FractionalAnisotropy.py b/nipype/interfaces/mrtrix/tests/test_auto_Tensor2FractionalAnisotropy.py index 07a9fadc2f..5256d5027d 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_Tensor2FractionalAnisotropy.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_Tensor2FractionalAnisotropy.py @@ -29,7 +29,7 @@ def test_Tensor2FractionalAnisotropy_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Tensor2FractionalAnisotropy.input_spec() + inputs = Tensor2FractionalAnisotropy._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -39,7 +39,7 @@ def test_Tensor2FractionalAnisotropy_inputs(): def test_Tensor2FractionalAnisotropy_outputs(): output_map = dict(FA=dict(), ) - outputs = Tensor2FractionalAnisotropy.output_spec() + outputs = Tensor2FractionalAnisotropy._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix/tests/test_auto_Tensor2Vector.py b/nipype/interfaces/mrtrix/tests/test_auto_Tensor2Vector.py index cc84f35f3a..c9f63b7a3a 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_Tensor2Vector.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_Tensor2Vector.py @@ -29,7 +29,7 @@ def test_Tensor2Vector_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Tensor2Vector.input_spec() + inputs = Tensor2Vector._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -39,7 +39,7 @@ def test_Tensor2Vector_inputs(): def test_Tensor2Vector_outputs(): output_map = dict(vector=dict(), ) - outputs = Tensor2Vector.output_spec() + outputs = Tensor2Vector._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix/tests/test_auto_Threshold.py b/nipype/interfaces/mrtrix/tests/test_auto_Threshold.py index c45e38f714..9c0cb97eaa 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_Threshold.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_Threshold.py @@ -39,7 +39,7 @@ def test_Threshold_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Threshold.input_spec() + inputs = Threshold._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -49,7 +49,7 @@ def test_Threshold_inputs(): def test_Threshold_outputs(): output_map = dict(out_file=dict(), ) - outputs = Threshold.output_spec() + outputs = Threshold._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix/tests/test_auto_Tracks2Prob.py b/nipype/interfaces/mrtrix/tests/test_auto_Tracks2Prob.py index 5460b7b18e..3b09add534 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_Tracks2Prob.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_Tracks2Prob.py @@ -43,7 +43,7 @@ def test_Tracks2Prob_inputs(): sep=',', ), ) - inputs = Tracks2Prob.input_spec() + inputs = Tracks2Prob._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -53,7 +53,7 @@ def test_Tracks2Prob_inputs(): def test_Tracks2Prob_outputs(): output_map = dict(tract_image=dict(), ) - outputs = Tracks2Prob.output_spec() + outputs = Tracks2Prob._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix/tracking.py b/nipype/interfaces/mrtrix/tracking.py index db3141320e..79b8efbec0 100644 --- a/nipype/interfaces/mrtrix/tracking.py +++ b/nipype/interfaces/mrtrix/tracking.py @@ -62,8 +62,8 @@ class FilterTracks(CommandLine): """ _cmd = 'filter_tracks' - input_spec = FilterTracksInputSpec - output_spec = FilterTracksOutputSpec + _input_spec = FilterTracksInputSpec + _output_spec = FilterTracksOutputSpec class Tracks2ProbInputSpec(CommandLineInputSpec): @@ -104,8 +104,8 @@ class Tracks2Prob(CommandLine): """ _cmd = 'tracks2prob' - input_spec = Tracks2ProbInputSpec - output_spec = Tracks2ProbOutputSpec + _input_spec = Tracks2ProbInputSpec + _output_spec = Tracks2ProbOutputSpec def _post_run(self): @@ -211,8 +211,8 @@ class StreamlineTrack(CommandLine): >>> strack.run() # doctest: +SKIP """ _cmd = 'streamtrack' - input_spec = StreamlineTrackInputSpec - output_spec = StreamlineTrackOutputSpec + _input_spec = StreamlineTrackInputSpec + _output_spec = StreamlineTrackOutputSpec class DiffusionTensorStreamlineTrackInputSpec(StreamlineTrackInputSpec): @@ -236,7 +236,7 @@ class DiffusionTensorStreamlineTrack(StreamlineTrack): >>> dtstrack.run() # doctest: +SKIP """ - input_spec = DiffusionTensorStreamlineTrackInputSpec + _input_spec = DiffusionTensorStreamlineTrackInputSpec def __init__(self, command=None, **inputs): inputs["inputmodel"] = "DT_STREAM" @@ -265,7 +265,7 @@ class ProbabilisticSphericallyDeconvolutedStreamlineTrack(StreamlineTrack): >>> sdprobtrack.inputs.seed_file = 'seed_mask.nii' >>> sdprobtrack.run() # doctest: +SKIP """ - input_spec = ProbabilisticSphericallyDeconvolutedStreamlineTrackInputSpec + _input_spec = ProbabilisticSphericallyDeconvolutedStreamlineTrackInputSpec def __init__(self, command=None, **inputs): inputs["inputmodel"] = "SD_PROB" @@ -289,7 +289,7 @@ class SphericallyDeconvolutedStreamlineTrack(StreamlineTrack): >>> sdtrack.inputs.seed_file = 'seed_mask.nii' >>> sdtrack.run() # doctest: +SKIP """ - input_spec = StreamlineTrackInputSpec + _input_spec = StreamlineTrackInputSpec def __init__(self, command=None, **inputs): inputs["inputmodel"] = "SD_STREAM" diff --git a/nipype/interfaces/mrtrix3/connectivity.py b/nipype/interfaces/mrtrix3/connectivity.py index 3b0142a0fb..dc9dad2365 100644 --- a/nipype/interfaces/mrtrix3/connectivity.py +++ b/nipype/interfaces/mrtrix3/connectivity.py @@ -101,8 +101,8 @@ class BuildConnectome(MRTrix3Base): """ _cmd = 'tck2connectome' - input_spec = BuildConnectomeInputSpec - output_spec = BuildConnectomeOutputSpec + _input_spec = BuildConnectomeInputSpec + _output_spec = BuildConnectomeOutputSpec def _post_run(self): @@ -159,8 +159,8 @@ class LabelConfig(MRTrix3Base): """ _cmd = 'labelconfig' - input_spec = LabelConfigInputSpec - output_spec = LabelConfigOutputSpec + _input_spec = LabelConfigInputSpec + _output_spec = LabelConfigOutputSpec def parse_args(self, skip=None): if skip is None: diff --git a/nipype/interfaces/mrtrix3/preprocess.py b/nipype/interfaces/mrtrix3/preprocess.py index 252efecc98..5a3e43ee1e 100644 --- a/nipype/interfaces/mrtrix3/preprocess.py +++ b/nipype/interfaces/mrtrix3/preprocess.py @@ -102,8 +102,8 @@ class ResponseSD(MRTrix3Base): """ _cmd = 'dwi2response' - input_spec = ResponseSDInputSpec - output_spec = ResponseSDOutputSpec + _input_spec = ResponseSDInputSpec + _output_spec = ResponseSDOutputSpec def _post_run(self): @@ -144,8 +144,8 @@ class ACTPrepareFSL(CommandLine): """ _cmd = 'act_anat_prepare_fsl' - input_spec = ACTPrepareFSLInputSpec - output_spec = ACTPrepareFSLOutputSpec + _input_spec = ACTPrepareFSLInputSpec + _output_spec = ACTPrepareFSLOutputSpec def _post_run(self): @@ -190,8 +190,8 @@ class ReplaceFSwithFIRST(CommandLine): """ _cmd = 'fs_parc_replace_sgm_first' - input_spec = ReplaceFSwithFIRSTInputSpec - output_spec = ReplaceFSwithFIRSTOutputSpec + _input_spec = ReplaceFSwithFIRSTInputSpec + _output_spec = ReplaceFSwithFIRSTOutputSpec def _post_run(self): diff --git a/nipype/interfaces/mrtrix3/reconst.py b/nipype/interfaces/mrtrix3/reconst.py index ba83ee8b55..7afe946933 100644 --- a/nipype/interfaces/mrtrix3/reconst.py +++ b/nipype/interfaces/mrtrix3/reconst.py @@ -68,8 +68,8 @@ class FitTensor(MRTrix3Base): """ _cmd = 'dwi2tensor' - input_spec = FitTensorInputSpec - output_spec = FitTensorOutputSpec + _input_spec = FitTensorInputSpec + _output_spec = FitTensorOutputSpec def _post_run(self): @@ -183,8 +183,8 @@ class EstimateFOD(MRTrix3Base): """ _cmd = 'dwi2fod' - input_spec = EstimateFODInputSpec - output_spec = EstimateFODOutputSpec + _input_spec = EstimateFODInputSpec + _output_spec = EstimateFODOutputSpec def _post_run(self): diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_ACTPrepareFSL.py b/nipype/interfaces/mrtrix3/tests/test_auto_ACTPrepareFSL.py index 45a1a9fef0..7e290fce82 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_ACTPrepareFSL.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_ACTPrepareFSL.py @@ -24,7 +24,7 @@ def test_ACTPrepareFSL_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ACTPrepareFSL.input_spec() + inputs = ACTPrepareFSL._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -34,7 +34,7 @@ def test_ACTPrepareFSL_inputs(): def test_ACTPrepareFSL_outputs(): output_map = dict(out_file=dict(), ) - outputs = ACTPrepareFSL.output_spec() + outputs = ACTPrepareFSL._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_BrainMask.py b/nipype/interfaces/mrtrix3/tests/test_auto_BrainMask.py index 7581fe6059..3560529e37 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_BrainMask.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_BrainMask.py @@ -36,7 +36,7 @@ def test_BrainMask_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = BrainMask.input_spec() + inputs = BrainMask._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -46,7 +46,7 @@ def test_BrainMask_inputs(): def test_BrainMask_outputs(): output_map = dict(out_file=dict(), ) - outputs = BrainMask.output_spec() + outputs = BrainMask._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_BuildConnectome.py b/nipype/interfaces/mrtrix3/tests/test_auto_BuildConnectome.py index e4b97f4381..4943ddfe26 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_BuildConnectome.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_BuildConnectome.py @@ -48,7 +48,7 @@ def test_BuildConnectome_inputs(): zero_diagonal=dict(argstr='-zero_diagonal', ), ) - inputs = BuildConnectome.input_spec() + inputs = BuildConnectome._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -58,7 +58,7 @@ def test_BuildConnectome_inputs(): def test_BuildConnectome_outputs(): output_map = dict(out_file=dict(), ) - outputs = BuildConnectome.output_spec() + outputs = BuildConnectome._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_ComputeTDI.py b/nipype/interfaces/mrtrix3/tests/test_auto_ComputeTDI.py index ef2fec18a5..c266def027 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_ComputeTDI.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_ComputeTDI.py @@ -59,7 +59,7 @@ def test_ComputeTDI_inputs(): sep=',', ), ) - inputs = ComputeTDI.input_spec() + inputs = ComputeTDI._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -69,7 +69,7 @@ def test_ComputeTDI_inputs(): def test_ComputeTDI_outputs(): output_map = dict(out_file=dict(), ) - outputs = ComputeTDI.output_spec() + outputs = ComputeTDI._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_EstimateFOD.py b/nipype/interfaces/mrtrix3/tests/test_auto_EstimateFOD.py index 1f8b434843..03e6621541 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_EstimateFOD.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_EstimateFOD.py @@ -57,7 +57,7 @@ def test_EstimateFOD_inputs(): thres=dict(argstr='-threshold %f', ), ) - inputs = EstimateFOD.input_spec() + inputs = EstimateFOD._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -67,7 +67,7 @@ def test_EstimateFOD_inputs(): def test_EstimateFOD_outputs(): output_map = dict(out_file=dict(), ) - outputs = EstimateFOD.output_spec() + outputs = EstimateFOD._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_FitTensor.py b/nipype/interfaces/mrtrix3/tests/test_auto_FitTensor.py index 3d926e3bd3..395e5add01 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_FitTensor.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_FitTensor.py @@ -42,7 +42,7 @@ def test_FitTensor_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = FitTensor.input_spec() + inputs = FitTensor._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -52,7 +52,7 @@ def test_FitTensor_inputs(): def test_FitTensor_outputs(): output_map = dict(out_file=dict(), ) - outputs = FitTensor.output_spec() + outputs = FitTensor._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_Generate5tt.py b/nipype/interfaces/mrtrix3/tests/test_auto_Generate5tt.py index b06b6362ab..b27fa87490 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_Generate5tt.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_Generate5tt.py @@ -27,7 +27,7 @@ def test_Generate5tt_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Generate5tt.input_spec() + inputs = Generate5tt._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -37,7 +37,7 @@ def test_Generate5tt_inputs(): def test_Generate5tt_outputs(): output_map = dict(out_file=dict(), ) - outputs = Generate5tt.output_spec() + outputs = Generate5tt._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_LabelConfig.py b/nipype/interfaces/mrtrix3/tests/test_auto_LabelConfig.py index 4f57c6246d..add9afb8cb 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_LabelConfig.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_LabelConfig.py @@ -40,7 +40,7 @@ def test_LabelConfig_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = LabelConfig.input_spec() + inputs = LabelConfig._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -50,7 +50,7 @@ def test_LabelConfig_inputs(): def test_LabelConfig_outputs(): output_map = dict(out_file=dict(), ) - outputs = LabelConfig.output_spec() + outputs = LabelConfig._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_MRTrix3Base.py b/nipype/interfaces/mrtrix3/tests/test_auto_MRTrix3Base.py index 8349b13b9d..afe3f8fd40 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_MRTrix3Base.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_MRTrix3Base.py @@ -15,7 +15,7 @@ def test_MRTrix3Base_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = MRTrix3Base.input_spec() + inputs = MRTrix3Base._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -24,7 +24,7 @@ def test_MRTrix3Base_inputs(): def test_MRTrix3Base_outputs(): output_map = dict() - outputs = MRTrix3Base.output_spec() + outputs = MRTrix3Base._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_Mesh2PVE.py b/nipype/interfaces/mrtrix3/tests/test_auto_Mesh2PVE.py index 781d8b2e98..15f94a0a22 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_Mesh2PVE.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_Mesh2PVE.py @@ -30,7 +30,7 @@ def test_Mesh2PVE_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Mesh2PVE.input_spec() + inputs = Mesh2PVE._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -40,7 +40,7 @@ def test_Mesh2PVE_inputs(): def test_Mesh2PVE_outputs(): output_map = dict(out_file=dict(), ) - outputs = Mesh2PVE.output_spec() + outputs = Mesh2PVE._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_ReplaceFSwithFIRST.py b/nipype/interfaces/mrtrix3/tests/test_auto_ReplaceFSwithFIRST.py index cb33fda95b..148b60d589 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_ReplaceFSwithFIRST.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_ReplaceFSwithFIRST.py @@ -31,7 +31,7 @@ def test_ReplaceFSwithFIRST_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ReplaceFSwithFIRST.input_spec() + inputs = ReplaceFSwithFIRST._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -41,7 +41,7 @@ def test_ReplaceFSwithFIRST_inputs(): def test_ReplaceFSwithFIRST_outputs(): output_map = dict(out_file=dict(), ) - outputs = ReplaceFSwithFIRST.output_spec() + outputs = ReplaceFSwithFIRST._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_ResponseSD.py b/nipype/interfaces/mrtrix3/tests/test_auto_ResponseSD.py index cb78159156..75247ac875 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_ResponseSD.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_ResponseSD.py @@ -57,7 +57,7 @@ def test_ResponseSD_inputs(): vol_ratio=dict(argstr='-volume_ratio %f', ), ) - inputs = ResponseSD.input_spec() + inputs = ResponseSD._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -68,7 +68,7 @@ def test_ResponseSD_outputs(): output_map = dict(out_file=dict(), out_sf=dict(), ) - outputs = ResponseSD.output_spec() + outputs = ResponseSD._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_TCK2VTK.py b/nipype/interfaces/mrtrix3/tests/test_auto_TCK2VTK.py index d80b749fee..cbd6ccbbc9 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_TCK2VTK.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_TCK2VTK.py @@ -30,7 +30,7 @@ def test_TCK2VTK_inputs(): voxel=dict(argstr='-image %s', ), ) - inputs = TCK2VTK.input_spec() + inputs = TCK2VTK._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -40,7 +40,7 @@ def test_TCK2VTK_inputs(): def test_TCK2VTK_outputs(): output_map = dict(out_file=dict(), ) - outputs = TCK2VTK.output_spec() + outputs = TCK2VTK._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_TensorMetrics.py b/nipype/interfaces/mrtrix3/tests/test_auto_TensorMetrics.py index 6be2bccab0..822ad63710 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_TensorMetrics.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_TensorMetrics.py @@ -34,7 +34,7 @@ def test_TensorMetrics_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = TensorMetrics.input_spec() + inputs = TensorMetrics._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -47,7 +47,7 @@ def test_TensorMetrics_outputs(): out_evec=dict(), out_fa=dict(), ) - outputs = TensorMetrics.output_spec() + outputs = TensorMetrics._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_Tractography.py b/nipype/interfaces/mrtrix3/tests/test_auto_Tractography.py index aeaff9b599..c028a31e69 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_Tractography.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_Tractography.py @@ -108,7 +108,7 @@ def test_Tractography_inputs(): use_rk4=dict(argstr='-rk4', ), ) - inputs = Tractography.input_spec() + inputs = Tractography._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -119,7 +119,7 @@ def test_Tractography_outputs(): output_map = dict(out_file=dict(), out_seeds=dict(), ) - outputs = Tractography.output_spec() + outputs = Tractography._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/mrtrix3/tracking.py b/nipype/interfaces/mrtrix3/tracking.py index b92ed88a09..34e747e3dd 100644 --- a/nipype/interfaces/mrtrix3/tracking.py +++ b/nipype/interfaces/mrtrix3/tracking.py @@ -238,8 +238,8 @@ class Tractography(MRTrix3Base): """ _cmd = 'tckgen' - input_spec = TractographyInputSpec - output_spec = TractographyOutputSpec + _input_spec = TractographyInputSpec + _output_spec = TractographyOutputSpec def _format_arg(self, name, trait_spec, value): if 'roi_' in name and isinstance(value, tuple): diff --git a/nipype/interfaces/mrtrix3/utils.py b/nipype/interfaces/mrtrix3/utils.py index 1b10842651..589010f2c8 100644 --- a/nipype/interfaces/mrtrix3/utils.py +++ b/nipype/interfaces/mrtrix3/utils.py @@ -53,8 +53,8 @@ class BrainMask(CommandLine): """ _cmd = 'dwi2mask' - input_spec = BrainMaskInputSpec - output_spec = BrainMaskOutputSpec + _input_spec = BrainMaskInputSpec + _output_spec = BrainMaskOutputSpec def _post_run(self): @@ -99,8 +99,8 @@ class Mesh2PVE(CommandLine): """ _cmd = 'mesh2pve' - input_spec = Mesh2PVEInputSpec - output_spec = Mesh2PVEOutputSpec + _input_spec = Mesh2PVEInputSpec + _output_spec = Mesh2PVEOutputSpec def _post_run(self): @@ -145,8 +145,8 @@ class Generate5tt(CommandLine): """ _cmd = '5ttgen' - input_spec = Generate5ttInputSpec - output_spec = Generate5ttOutputSpec + _input_spec = Generate5ttInputSpec + _output_spec = Generate5ttOutputSpec def _post_run(self): @@ -201,8 +201,8 @@ class TensorMetrics(CommandLine): """ _cmd = 'tensor2metric' - input_spec = TensorMetricsInputSpec - output_spec = TensorMetricsOutputSpec + _input_spec = TensorMetricsInputSpec + _output_spec = TensorMetricsOutputSpec def _post_run(self): for k in list(outputs.keys()): @@ -338,8 +338,8 @@ class ComputeTDI(MRTrix3Base): """ _cmd = 'tckmap' - input_spec = ComputeTDIInputSpec - output_spec = ComputeTDIOutputSpec + _input_spec = ComputeTDIInputSpec + _output_spec = ComputeTDIOutputSpec def _post_run(self): @@ -388,8 +388,8 @@ class TCK2VTK(MRTrix3Base): """ _cmd = 'tck2vtk' - input_spec = TCK2VTKInputSpec - output_spec = TCK2VTKOutputSpec + _input_spec = TCK2VTKInputSpec + _output_spec = TCK2VTKOutputSpec def _post_run(self): diff --git a/nipype/interfaces/nipy/model.py b/nipype/interfaces/nipy/model.py index dd6c7a8f7c..c7a240daf5 100644 --- a/nipype/interfaces/nipy/model.py +++ b/nipype/interfaces/nipy/model.py @@ -76,8 +76,8 @@ class FitGLM(BaseInterface): """ Fit GLM model based on the specified design. Supports only single or concatenated runs. """ - input_spec = FitGLMInputSpec - output_spec = FitGLMOutputSpec + _input_spec = FitGLMInputSpec + _output_spec = FitGLMOutputSpec def _run_interface(self, runtime): @@ -253,8 +253,8 @@ class EstimateContrast(BaseInterface): """ Estimate contrast of a fitted model. """ - input_spec = EstimateContrastInputSpec - output_spec = EstimateContrastOutputSpec + _input_spec = EstimateContrastInputSpec + _output_spec = EstimateContrastOutputSpec def _run_interface(self, runtime): diff --git a/nipype/interfaces/nipy/preprocess.py b/nipype/interfaces/nipy/preprocess.py index 1cf0f676d9..43ce3128f7 100644 --- a/nipype/interfaces/nipy/preprocess.py +++ b/nipype/interfaces/nipy/preprocess.py @@ -47,8 +47,8 @@ class ComputeMaskOutputSpec(TraitedSpec): class ComputeMask(BaseInterface): - input_spec = ComputeMaskInputSpec - output_spec = ComputeMaskOutputSpec + _input_spec = ComputeMaskInputSpec + _output_spec = ComputeMaskOutputSpec def _run_interface(self, runtime): from nipy.labs.mask import compute_mask @@ -140,8 +140,8 @@ class FmriRealign4d(BaseInterface): """ - input_spec = FmriRealign4dInputSpec - output_spec = FmriRealign4dOutputSpec + _input_spec = FmriRealign4dInputSpec + _output_spec = FmriRealign4dOutputSpec keywords = ['slice timing', 'motion correction'] def _run_interface(self, runtime): @@ -267,8 +267,8 @@ class SpaceTimeRealigner(BaseInterface): """ - input_spec = SpaceTimeRealignerInputSpec - output_spec = SpaceTimeRealignerOutputSpec + _input_spec = SpaceTimeRealignerInputSpec + _output_spec = SpaceTimeRealignerOutputSpec keywords = ['slice timing', 'motion correction'] @property @@ -355,8 +355,8 @@ class Trim(BaseInterface): """ - input_spec = TrimInputSpec - output_spec = TrimOutputSpec + _input_spec = TrimInputSpec + _output_spec = TrimOutputSpec def _run_interface(self, runtime): out_file = self.outputs.out_file diff --git a/nipype/interfaces/nipy/tests/test_auto_ComputeMask.py b/nipype/interfaces/nipy/tests/test_auto_ComputeMask.py index 607c2b1f9d..aea0133c88 100644 --- a/nipype/interfaces/nipy/tests/test_auto_ComputeMask.py +++ b/nipype/interfaces/nipy/tests/test_auto_ComputeMask.py @@ -14,7 +14,7 @@ def test_ComputeMask_inputs(): ), reference_volume=dict(), ) - inputs = ComputeMask.input_spec() + inputs = ComputeMask._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -24,7 +24,7 @@ def test_ComputeMask_inputs(): def test_ComputeMask_outputs(): output_map = dict(brain_mask=dict(), ) - outputs = ComputeMask.output_spec() + outputs = ComputeMask._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/nipy/tests/test_auto_EstimateContrast.py b/nipype/interfaces/nipy/tests/test_auto_EstimateContrast.py index 61e6d42146..73245ddd34 100644 --- a/nipype/interfaces/nipy/tests/test_auto_EstimateContrast.py +++ b/nipype/interfaces/nipy/tests/test_auto_EstimateContrast.py @@ -25,7 +25,7 @@ def test_EstimateContrast_inputs(): s2=dict(mandatory=True, ), ) - inputs = EstimateContrast.input_spec() + inputs = EstimateContrast._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -37,7 +37,7 @@ def test_EstimateContrast_outputs(): stat_maps=dict(), z_maps=dict(), ) - outputs = EstimateContrast.output_spec() + outputs = EstimateContrast._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/nipy/tests/test_auto_FitGLM.py b/nipype/interfaces/nipy/tests/test_auto_FitGLM.py index 0f15facdb1..2f3d4acb78 100644 --- a/nipype/interfaces/nipy/tests/test_auto_FitGLM.py +++ b/nipype/interfaces/nipy/tests/test_auto_FitGLM.py @@ -27,7 +27,7 @@ def test_FitGLM_inputs(): session_info=dict(mandatory=True, ), ) - inputs = FitGLM.input_spec() + inputs = FitGLM._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -45,7 +45,7 @@ def test_FitGLM_outputs(): residuals=dict(), s2=dict(), ) - outputs = FitGLM.output_spec() + outputs = FitGLM._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/nipy/tests/test_auto_FmriRealign4d.py b/nipype/interfaces/nipy/tests/test_auto_FmriRealign4d.py index 917c1bbe9c..08ba592e44 100644 --- a/nipype/interfaces/nipy/tests/test_auto_FmriRealign4d.py +++ b/nipype/interfaces/nipy/tests/test_auto_FmriRealign4d.py @@ -26,7 +26,7 @@ def test_FmriRealign4d_inputs(): tr_slices=dict(requires=['time_interp'], ), ) - inputs = FmriRealign4d.input_spec() + inputs = FmriRealign4d._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -37,7 +37,7 @@ def test_FmriRealign4d_outputs(): output_map = dict(out_file=dict(), par_file=dict(), ) - outputs = FmriRealign4d.output_spec() + outputs = FmriRealign4d._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/nipy/tests/test_auto_Similarity.py b/nipype/interfaces/nipy/tests/test_auto_Similarity.py index ef370639ce..0b386baba5 100644 --- a/nipype/interfaces/nipy/tests/test_auto_Similarity.py +++ b/nipype/interfaces/nipy/tests/test_auto_Similarity.py @@ -16,7 +16,7 @@ def test_Similarity_inputs(): volume2=dict(mandatory=True, ), ) - inputs = Similarity.input_spec() + inputs = Similarity._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -26,7 +26,7 @@ def test_Similarity_inputs(): def test_Similarity_outputs(): output_map = dict(similarity=dict(), ) - outputs = Similarity.output_spec() + outputs = Similarity._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/nipy/tests/test_auto_SpaceTimeRealigner.py b/nipype/interfaces/nipy/tests/test_auto_SpaceTimeRealigner.py index 1dc0a5e6df..59c568e87b 100644 --- a/nipype/interfaces/nipy/tests/test_auto_SpaceTimeRealigner.py +++ b/nipype/interfaces/nipy/tests/test_auto_SpaceTimeRealigner.py @@ -16,7 +16,7 @@ def test_SpaceTimeRealigner_inputs(): tr=dict(requires=['slice_times'], ), ) - inputs = SpaceTimeRealigner.input_spec() + inputs = SpaceTimeRealigner._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -27,7 +27,7 @@ def test_SpaceTimeRealigner_outputs(): output_map = dict(out_file=dict(), par_file=dict(), ) - outputs = SpaceTimeRealigner.output_spec() + outputs = SpaceTimeRealigner._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/nipy/tests/test_auto_Trim.py b/nipype/interfaces/nipy/tests/test_auto_Trim.py index 98c8d0dea1..71e7e729f7 100644 --- a/nipype/interfaces/nipy/tests/test_auto_Trim.py +++ b/nipype/interfaces/nipy/tests/test_auto_Trim.py @@ -17,7 +17,7 @@ def test_Trim_inputs(): suffix=dict(usedefault=True, ), ) - inputs = Trim.input_spec() + inputs = Trim._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -27,7 +27,7 @@ def test_Trim_inputs(): def test_Trim_outputs(): output_map = dict(out_file=dict(), ) - outputs = Trim.output_spec() + outputs = Trim._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/nipy/utils.py b/nipype/interfaces/nipy/utils.py index 1b9cec9123..8a4f2ad39e 100644 --- a/nipype/interfaces/nipy/utils.py +++ b/nipype/interfaces/nipy/utils.py @@ -66,8 +66,8 @@ class Similarity(BaseInterface): >>> res = similarity.run() # doctest: +SKIP """ - input_spec = SimilarityInputSpec - output_spec = SimilarityOutputSpec + _input_spec = SimilarityInputSpec + _output_spec = SimilarityOutputSpec def __init__(self, **inputs): warnings.warn(("This interface is deprecated since 0.10.0." diff --git a/nipype/interfaces/nitime/analysis.py b/nipype/interfaces/nitime/analysis.py index 5308008e25..8b1987bed0 100644 --- a/nipype/interfaces/nitime/analysis.py +++ b/nipype/interfaces/nitime/analysis.py @@ -96,8 +96,8 @@ class CoherenceAnalyzerOutputSpec(TraitedSpec): class CoherenceAnalyzer(BaseInterface): - input_spec = CoherenceAnalyzerInputSpec - output_spec = CoherenceAnalyzerOutputSpec + _input_spec = CoherenceAnalyzerInputSpec + _output_spec = CoherenceAnalyzerOutputSpec def _read_csv(self): """ diff --git a/nipype/interfaces/nitime/tests/test_auto_CoherenceAnalyzer.py b/nipype/interfaces/nitime/tests/test_auto_CoherenceAnalyzer.py index 2303b647c0..08fa8c92ae 100644 --- a/nipype/interfaces/nitime/tests/test_auto_CoherenceAnalyzer.py +++ b/nipype/interfaces/nitime/tests/test_auto_CoherenceAnalyzer.py @@ -22,7 +22,7 @@ def test_CoherenceAnalyzer_inputs(): output_csv_file=dict(), output_figure_file=dict(), ) - inputs = CoherenceAnalyzer.input_spec() + inputs = CoherenceAnalyzer._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -37,7 +37,7 @@ def test_CoherenceAnalyzer_outputs(): timedelay_csv=dict(), timedelay_fig=dict(), ) - outputs = CoherenceAnalyzer.output_spec() + outputs = CoherenceAnalyzer._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/petpvc.py b/nipype/interfaces/petpvc.py index c21edfc638..5592770e7c 100644 --- a/nipype/interfaces/petpvc.py +++ b/nipype/interfaces/petpvc.py @@ -158,8 +158,8 @@ class PETPVC(CommandLine): >>> pvc.inputs.fwhm_z = 2.0 >>> outs = pvc.run() #doctest: +SKIP """ - input_spec = PETPVCInputSpec - output_spec = PETPVCOutputSpec + _input_spec = PETPVCInputSpec + _output_spec = PETPVCOutputSpec _cmd = 'petpvc' def _post_run(self): diff --git a/nipype/interfaces/semtools/brains/classify.py b/nipype/interfaces/semtools/brains/classify.py index 191284b104..e6bc7211fe 100644 --- a/nipype/interfaces/semtools/brains/classify.py +++ b/nipype/interfaces/semtools/brains/classify.py @@ -44,8 +44,8 @@ class BRAINSPosteriorToContinuousClass(SEMLikeCommandLine): """ - input_spec = BRAINSPosteriorToContinuousClassInputSpec - output_spec = BRAINSPosteriorToContinuousClassOutputSpec + _input_spec = BRAINSPosteriorToContinuousClassInputSpec + _output_spec = BRAINSPosteriorToContinuousClassOutputSpec _cmd = " BRAINSPosteriorToContinuousClass " _outputs_filenames = {'outputVolume': 'outputVolume'} _redirect_x = False diff --git a/nipype/interfaces/semtools/brains/segmentation.py b/nipype/interfaces/semtools/brains/segmentation.py index a5f5c0031c..103dda499c 100644 --- a/nipype/interfaces/semtools/brains/segmentation.py +++ b/nipype/interfaces/semtools/brains/segmentation.py @@ -36,8 +36,8 @@ class SimilarityIndex(SEMLikeCommandLine): """ - input_spec = SimilarityIndexInputSpec - output_spec = SimilarityIndexOutputSpec + _input_spec = SimilarityIndexInputSpec + _output_spec = SimilarityIndexOutputSpec _cmd = " SimilarityIndex " _outputs_filenames = {} _redirect_x = False @@ -82,8 +82,8 @@ class BRAINSTalairach(SEMLikeCommandLine): """ - input_spec = BRAINSTalairachInputSpec - output_spec = BRAINSTalairachOutputSpec + _input_spec = BRAINSTalairachInputSpec + _output_spec = BRAINSTalairachOutputSpec _cmd = " BRAINSTalairach " _outputs_filenames = {'outputGrid': 'outputGrid', 'outputBox': 'outputBox'} _redirect_x = False @@ -122,8 +122,8 @@ class BRAINSTalairachMask(SEMLikeCommandLine): """ - input_spec = BRAINSTalairachMaskInputSpec - output_spec = BRAINSTalairachMaskOutputSpec + _input_spec = BRAINSTalairachMaskInputSpec + _output_spec = BRAINSTalairachMaskOutputSpec _cmd = " BRAINSTalairachMask " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} _redirect_x = False diff --git a/nipype/interfaces/semtools/brains/tests/test_auto_BRAINSPosteriorToContinuousClass.py b/nipype/interfaces/semtools/brains/tests/test_auto_BRAINSPosteriorToContinuousClass.py index 7fa7c6db0b..4eeb5855d4 100644 --- a/nipype/interfaces/semtools/brains/tests/test_auto_BRAINSPosteriorToContinuousClass.py +++ b/nipype/interfaces/semtools/brains/tests/test_auto_BRAINSPosteriorToContinuousClass.py @@ -32,7 +32,7 @@ def test_BRAINSPosteriorToContinuousClass_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = BRAINSPosteriorToContinuousClass.input_spec() + inputs = BRAINSPosteriorToContinuousClass._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -42,7 +42,7 @@ def test_BRAINSPosteriorToContinuousClass_inputs(): def test_BRAINSPosteriorToContinuousClass_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = BRAINSPosteriorToContinuousClass.output_spec() + outputs = BRAINSPosteriorToContinuousClass._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/brains/tests/test_auto_BRAINSTalairach.py b/nipype/interfaces/semtools/brains/tests/test_auto_BRAINSTalairach.py index 51a08d06e2..564af8d1c6 100644 --- a/nipype/interfaces/semtools/brains/tests/test_auto_BRAINSTalairach.py +++ b/nipype/interfaces/semtools/brains/tests/test_auto_BRAINSTalairach.py @@ -43,7 +43,7 @@ def test_BRAINSTalairach_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = BRAINSTalairach.input_spec() + inputs = BRAINSTalairach._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -54,7 +54,7 @@ def test_BRAINSTalairach_outputs(): output_map = dict(outputBox=dict(), outputGrid=dict(), ) - outputs = BRAINSTalairach.output_spec() + outputs = BRAINSTalairach._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/brains/tests/test_auto_BRAINSTalairachMask.py b/nipype/interfaces/semtools/brains/tests/test_auto_BRAINSTalairachMask.py index e4eaa93073..c38aea861d 100644 --- a/nipype/interfaces/semtools/brains/tests/test_auto_BRAINSTalairachMask.py +++ b/nipype/interfaces/semtools/brains/tests/test_auto_BRAINSTalairachMask.py @@ -28,7 +28,7 @@ def test_BRAINSTalairachMask_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = BRAINSTalairachMask.input_spec() + inputs = BRAINSTalairachMask._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -38,7 +38,7 @@ def test_BRAINSTalairachMask_inputs(): def test_BRAINSTalairachMask_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = BRAINSTalairachMask.output_spec() + outputs = BRAINSTalairachMask._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/brains/tests/test_auto_HistogramMatchingFilter.py b/nipype/interfaces/semtools/brains/tests/test_auto_HistogramMatchingFilter.py index 41c4fb832f..beb5b800ca 100644 --- a/nipype/interfaces/semtools/brains/tests/test_auto_HistogramMatchingFilter.py +++ b/nipype/interfaces/semtools/brains/tests/test_auto_HistogramMatchingFilter.py @@ -36,7 +36,7 @@ def test_HistogramMatchingFilter_inputs(): writeHistogram=dict(argstr='--writeHistogram %s', ), ) - inputs = HistogramMatchingFilter.input_spec() + inputs = HistogramMatchingFilter._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -46,7 +46,7 @@ def test_HistogramMatchingFilter_inputs(): def test_HistogramMatchingFilter_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = HistogramMatchingFilter.output_spec() + outputs = HistogramMatchingFilter._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/brains/tests/test_auto_SimilarityIndex.py b/nipype/interfaces/semtools/brains/tests/test_auto_SimilarityIndex.py index 3fbbbace73..2c9b35f032 100644 --- a/nipype/interfaces/semtools/brains/tests/test_auto_SimilarityIndex.py +++ b/nipype/interfaces/semtools/brains/tests/test_auto_SimilarityIndex.py @@ -23,7 +23,7 @@ def test_SimilarityIndex_inputs(): thresholdInterval=dict(argstr='--thresholdInterval %f', ), ) - inputs = SimilarityIndex.input_spec() + inputs = SimilarityIndex._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -32,7 +32,7 @@ def test_SimilarityIndex_inputs(): def test_SimilarityIndex_outputs(): output_map = dict() - outputs = SimilarityIndex.output_spec() + outputs = SimilarityIndex._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/brains/utilities.py b/nipype/interfaces/semtools/brains/utilities.py index a296be671c..5ddf4ca071 100644 --- a/nipype/interfaces/semtools/brains/utilities.py +++ b/nipype/interfaces/semtools/brains/utilities.py @@ -40,8 +40,8 @@ class HistogramMatchingFilter(SEMLikeCommandLine): """ - input_spec = HistogramMatchingFilterInputSpec - output_spec = HistogramMatchingFilterOutputSpec + _input_spec = HistogramMatchingFilterInputSpec + _output_spec = HistogramMatchingFilterOutputSpec _cmd = " HistogramMatchingFilter " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} _redirect_x = False diff --git a/nipype/interfaces/semtools/converters.py b/nipype/interfaces/semtools/converters.py index 01ef06967b..4d3dad9340 100644 --- a/nipype/interfaces/semtools/converters.py +++ b/nipype/interfaces/semtools/converters.py @@ -39,8 +39,8 @@ class DWISimpleCompare(SEMLikeCommandLine): """ - input_spec = DWISimpleCompareInputSpec - output_spec = DWISimpleCompareOutputSpec + _input_spec = DWISimpleCompareInputSpec + _output_spec = DWISimpleCompareOutputSpec _cmd = " DWISimpleCompare " _outputs_filenames = {} _redirect_x = False @@ -75,8 +75,8 @@ class DWICompare(SEMLikeCommandLine): """ - input_spec = DWICompareInputSpec - output_spec = DWICompareOutputSpec + _input_spec = DWICompareInputSpec + _output_spec = DWICompareOutputSpec _cmd = " DWICompare " _outputs_filenames = {} _redirect_x = False diff --git a/nipype/interfaces/semtools/diffusion/diffusion.py b/nipype/interfaces/semtools/diffusion/diffusion.py index 6d30e1fc44..f8ce16d2c6 100644 --- a/nipype/interfaces/semtools/diffusion/diffusion.py +++ b/nipype/interfaces/semtools/diffusion/diffusion.py @@ -43,8 +43,8 @@ class dtiaverage(SEMLikeCommandLine): """ - input_spec = dtiaverageInputSpec - output_spec = dtiaverageOutputSpec + _input_spec = dtiaverageInputSpec + _output_spec = dtiaverageOutputSpec _cmd = " dtiaverage " _outputs_filenames = {'tensor_output': 'tensor_output.nii'} _redirect_x = False @@ -125,8 +125,8 @@ class dtiestim(SEMLikeCommandLine): """ - input_spec = dtiestimInputSpec - output_spec = dtiestimOutputSpec + _input_spec = dtiestimInputSpec + _output_spec = dtiestimOutputSpec _cmd = " dtiestim " _outputs_filenames = {'B0': 'B0.nii', 'idwi': 'idwi.nii', 'tensor_output': 'tensor_output.nii', 'B0_mask_output': 'B0_mask_output.nii'} _redirect_x = False @@ -216,8 +216,8 @@ class dtiprocess(SEMLikeCommandLine): """ - input_spec = dtiprocessInputSpec - output_spec = dtiprocessOutputSpec + _input_spec = dtiprocessInputSpec + _output_spec = dtiprocessOutputSpec _cmd = " dtiprocess " _outputs_filenames = {'fa_gradmag_output': 'fa_gradmag_output.nii', 'fa_gradient_output': 'fa_gradient_output.nii', 'lambda1_output': 'lambda1_output.nii', 'lambda2_output': 'lambda2_output.nii', 'color_fa_output': 'color_fa_output.nii', 'fa_output': 'fa_output.nii', 'frobenius_norm_output': 'frobenius_norm_output.nii', 'principal_eigenvector_output': 'principal_eigenvector_output.nii', 'outmask': 'outmask.nii', 'lambda3_output': 'lambda3_output.nii', 'negative_eigenvector_output': 'negative_eigenvector_output.nii', 'md_output': 'md_output.nii', 'RD_output': 'RD_output.nii', 'deformation_output': 'deformation_output.nii', 'rot_output': 'rot_output.nii'} @@ -274,8 +274,8 @@ class DWIConvert(SEMLikeCommandLine): """ - input_spec = DWIConvertInputSpec - output_spec = DWIConvertOutputSpec + _input_spec = DWIConvertInputSpec + _output_spec = DWIConvertOutputSpec _cmd = " DWIConvert " _outputs_filenames = {'outputVolume': 'outputVolume.nii', 'outputDirectory': 'outputDirectory', 'outputBValues': 'outputBValues.bval', 'gradientVectorFile': 'gradientVectorFile', 'outputBVectors': 'outputBVectors.bvec'} _redirect_x = False diff --git a/nipype/interfaces/semtools/diffusion/gtract.py b/nipype/interfaces/semtools/diffusion/gtract.py index c7f2db432c..93724faf8c 100644 --- a/nipype/interfaces/semtools/diffusion/gtract.py +++ b/nipype/interfaces/semtools/diffusion/gtract.py @@ -40,8 +40,8 @@ class gtractTransformToDisplacementField(SEMLikeCommandLine): """ - input_spec = gtractTransformToDisplacementFieldInputSpec - output_spec = gtractTransformToDisplacementFieldOutputSpec + _input_spec = gtractTransformToDisplacementFieldInputSpec + _output_spec = gtractTransformToDisplacementFieldOutputSpec _cmd = " gtractTransformToDisplacementField " _outputs_filenames = {'outputDeformationFieldVolume': 'outputDeformationFieldVolume.nii'} _redirect_x = False @@ -79,8 +79,8 @@ class gtractInvertBSplineTransform(SEMLikeCommandLine): """ - input_spec = gtractInvertBSplineTransformInputSpec - output_spec = gtractInvertBSplineTransformOutputSpec + _input_spec = gtractInvertBSplineTransformInputSpec + _output_spec = gtractInvertBSplineTransformOutputSpec _cmd = " gtractInvertBSplineTransform " _outputs_filenames = {'outputTransform': 'outputTransform.h5'} _redirect_x = False @@ -117,8 +117,8 @@ class gtractConcatDwi(SEMLikeCommandLine): """ - input_spec = gtractConcatDwiInputSpec - output_spec = gtractConcatDwiOutputSpec + _input_spec = gtractConcatDwiInputSpec + _output_spec = gtractConcatDwiOutputSpec _cmd = " gtractConcatDwi " _outputs_filenames = {'outputVolume': 'outputVolume.nrrd'} _redirect_x = False @@ -156,8 +156,8 @@ class gtractAverageBvalues(SEMLikeCommandLine): """ - input_spec = gtractAverageBvaluesInputSpec - output_spec = gtractAverageBvaluesOutputSpec + _input_spec = gtractAverageBvaluesInputSpec + _output_spec = gtractAverageBvaluesOutputSpec _cmd = " gtractAverageBvalues " _outputs_filenames = {'outputVolume': 'outputVolume.nrrd'} _redirect_x = False @@ -209,8 +209,8 @@ class gtractCoregBvalues(SEMLikeCommandLine): """ - input_spec = gtractCoregBvaluesInputSpec - output_spec = gtractCoregBvaluesOutputSpec + _input_spec = gtractCoregBvaluesInputSpec + _output_spec = gtractCoregBvaluesOutputSpec _cmd = " gtractCoregBvalues " _outputs_filenames = {'outputVolume': 'outputVolume.nrrd', 'outputTransform': 'outputTransform.h5'} _redirect_x = False @@ -249,8 +249,8 @@ class gtractResampleAnisotropy(SEMLikeCommandLine): """ - input_spec = gtractResampleAnisotropyInputSpec - output_spec = gtractResampleAnisotropyOutputSpec + _input_spec = gtractResampleAnisotropyInputSpec + _output_spec = gtractResampleAnisotropyOutputSpec _cmd = " gtractResampleAnisotropy " _outputs_filenames = {'outputVolume': 'outputVolume.nrrd'} _redirect_x = False @@ -289,8 +289,8 @@ class gtractResampleCodeImage(SEMLikeCommandLine): """ - input_spec = gtractResampleCodeImageInputSpec - output_spec = gtractResampleCodeImageOutputSpec + _input_spec = gtractResampleCodeImageInputSpec + _output_spec = gtractResampleCodeImageOutputSpec _cmd = " gtractResampleCodeImage " _outputs_filenames = {'outputVolume': 'outputVolume.nrrd'} _redirect_x = False @@ -327,8 +327,8 @@ class gtractCopyImageOrientation(SEMLikeCommandLine): """ - input_spec = gtractCopyImageOrientationInputSpec - output_spec = gtractCopyImageOrientationOutputSpec + _input_spec = gtractCopyImageOrientationInputSpec + _output_spec = gtractCopyImageOrientationOutputSpec _cmd = " gtractCopyImageOrientation " _outputs_filenames = {'outputVolume': 'outputVolume.nrrd'} _redirect_x = False @@ -366,8 +366,8 @@ class gtractCreateGuideFiber(SEMLikeCommandLine): """ - input_spec = gtractCreateGuideFiberInputSpec - output_spec = gtractCreateGuideFiberOutputSpec + _input_spec = gtractCreateGuideFiberInputSpec + _output_spec = gtractCreateGuideFiberOutputSpec _cmd = " gtractCreateGuideFiber " _outputs_filenames = {'outputFiber': 'outputFiber.vtk'} _redirect_x = False @@ -404,8 +404,8 @@ class gtractAnisotropyMap(SEMLikeCommandLine): """ - input_spec = gtractAnisotropyMapInputSpec - output_spec = gtractAnisotropyMapOutputSpec + _input_spec = gtractAnisotropyMapInputSpec + _output_spec = gtractAnisotropyMapOutputSpec _cmd = " gtractAnisotropyMap " _outputs_filenames = {'outputVolume': 'outputVolume.nrrd'} _redirect_x = False @@ -443,8 +443,8 @@ class gtractClipAnisotropy(SEMLikeCommandLine): """ - input_spec = gtractClipAnisotropyInputSpec - output_spec = gtractClipAnisotropyOutputSpec + _input_spec = gtractClipAnisotropyInputSpec + _output_spec = gtractClipAnisotropyOutputSpec _cmd = " gtractClipAnisotropy " _outputs_filenames = {'outputVolume': 'outputVolume.nrrd'} _redirect_x = False @@ -484,8 +484,8 @@ class gtractResampleB0(SEMLikeCommandLine): """ - input_spec = gtractResampleB0InputSpec - output_spec = gtractResampleB0OutputSpec + _input_spec = gtractResampleB0InputSpec + _output_spec = gtractResampleB0OutputSpec _cmd = " gtractResampleB0 " _outputs_filenames = {'outputVolume': 'outputVolume.nrrd'} _redirect_x = False @@ -521,8 +521,8 @@ class gtractInvertRigidTransform(SEMLikeCommandLine): """ - input_spec = gtractInvertRigidTransformInputSpec - output_spec = gtractInvertRigidTransformOutputSpec + _input_spec = gtractInvertRigidTransformInputSpec + _output_spec = gtractInvertRigidTransformOutputSpec _cmd = " gtractInvertRigidTransform " _outputs_filenames = {'outputTransform': 'outputTransform.h5'} _redirect_x = False @@ -559,8 +559,8 @@ class gtractImageConformity(SEMLikeCommandLine): """ - input_spec = gtractImageConformityInputSpec - output_spec = gtractImageConformityOutputSpec + _input_spec = gtractImageConformityInputSpec + _output_spec = gtractImageConformityOutputSpec _cmd = " gtractImageConformity " _outputs_filenames = {'outputVolume': 'outputVolume.nrrd'} _redirect_x = False @@ -601,8 +601,8 @@ class compareTractInclusion(SEMLikeCommandLine): """ - input_spec = compareTractInclusionInputSpec - output_spec = compareTractInclusionOutputSpec + _input_spec = compareTractInclusionInputSpec + _output_spec = compareTractInclusionOutputSpec _cmd = " compareTractInclusion " _outputs_filenames = {} _redirect_x = False @@ -649,8 +649,8 @@ class gtractFastMarchingTracking(SEMLikeCommandLine): """ - input_spec = gtractFastMarchingTrackingInputSpec - output_spec = gtractFastMarchingTrackingOutputSpec + _input_spec = gtractFastMarchingTrackingInputSpec + _output_spec = gtractFastMarchingTrackingOutputSpec _cmd = " gtractFastMarchingTracking " _outputs_filenames = {'outputTract': 'outputTract.vtk'} _redirect_x = False @@ -688,8 +688,8 @@ class gtractInvertDisplacementField(SEMLikeCommandLine): """ - input_spec = gtractInvertDisplacementFieldInputSpec - output_spec = gtractInvertDisplacementFieldOutputSpec + _input_spec = gtractInvertDisplacementFieldInputSpec + _output_spec = gtractInvertDisplacementFieldOutputSpec _cmd = " gtractInvertDisplacementField " _outputs_filenames = {'outputVolume': 'outputVolume.nrrd'} _redirect_x = False @@ -752,8 +752,8 @@ class gtractCoRegAnatomy(SEMLikeCommandLine): """ - input_spec = gtractCoRegAnatomyInputSpec - output_spec = gtractCoRegAnatomyOutputSpec + _input_spec = gtractCoRegAnatomyInputSpec + _output_spec = gtractCoRegAnatomyOutputSpec _cmd = " gtractCoRegAnatomy " _outputs_filenames = {'outputTransformName': 'outputTransformName.h5'} _redirect_x = False @@ -796,8 +796,8 @@ class gtractResampleDWIInPlace(SEMLikeCommandLine): """ - input_spec = gtractResampleDWIInPlaceInputSpec - output_spec = gtractResampleDWIInPlaceOutputSpec + _input_spec = gtractResampleDWIInPlaceInputSpec + _output_spec = gtractResampleDWIInPlaceOutputSpec _cmd = " gtractResampleDWIInPlace " _outputs_filenames = {'outputResampledB0': 'outputResampledB0.nii', 'outputVolume': 'outputVolume.nii'} _redirect_x = False @@ -841,8 +841,8 @@ class gtractCostFastMarching(SEMLikeCommandLine): """ - input_spec = gtractCostFastMarchingInputSpec - output_spec = gtractCostFastMarchingOutputSpec + _input_spec = gtractCostFastMarchingInputSpec + _output_spec = gtractCostFastMarchingOutputSpec _cmd = " gtractCostFastMarching " _outputs_filenames = {'outputCostVolume': 'outputCostVolume.nrrd', 'outputSpeedVolume': 'outputSpeedVolume.nrrd'} _redirect_x = False @@ -903,8 +903,8 @@ class gtractFiberTracking(SEMLikeCommandLine): """ - input_spec = gtractFiberTrackingInputSpec - output_spec = gtractFiberTrackingOutputSpec + _input_spec = gtractFiberTrackingInputSpec + _output_spec = gtractFiberTrackingOutputSpec _cmd = " gtractFiberTracking " _outputs_filenames = {'outputTract': 'outputTract.vtk'} _redirect_x = False @@ -942,8 +942,8 @@ class extractNrrdVectorIndex(SEMLikeCommandLine): """ - input_spec = extractNrrdVectorIndexInputSpec - output_spec = extractNrrdVectorIndexOutputSpec + _input_spec = extractNrrdVectorIndexInputSpec + _output_spec = extractNrrdVectorIndexOutputSpec _cmd = " extractNrrdVectorIndex " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} _redirect_x = False @@ -982,8 +982,8 @@ class gtractResampleFibers(SEMLikeCommandLine): """ - input_spec = gtractResampleFibersInputSpec - output_spec = gtractResampleFibersOutputSpec + _input_spec = gtractResampleFibersInputSpec + _output_spec = gtractResampleFibersOutputSpec _cmd = " gtractResampleFibers " _outputs_filenames = {'outputTract': 'outputTract.vtk'} _redirect_x = False @@ -1031,8 +1031,8 @@ class gtractTensor(SEMLikeCommandLine): """ - input_spec = gtractTensorInputSpec - output_spec = gtractTensorOutputSpec + _input_spec = gtractTensorInputSpec + _output_spec = gtractTensorOutputSpec _cmd = " gtractTensor " _outputs_filenames = {'outputVolume': 'outputVolume.nrrd'} _redirect_x = False diff --git a/nipype/interfaces/semtools/diffusion/maxcurvature.py b/nipype/interfaces/semtools/diffusion/maxcurvature.py index 4206844ea2..21b382ac7d 100644 --- a/nipype/interfaces/semtools/diffusion/maxcurvature.py +++ b/nipype/interfaces/semtools/diffusion/maxcurvature.py @@ -44,8 +44,8 @@ class maxcurvature(SEMLikeCommandLine): """ - input_spec = maxcurvatureInputSpec - output_spec = maxcurvatureOutputSpec + _input_spec = maxcurvatureInputSpec + _output_spec = maxcurvatureOutputSpec _cmd = " maxcurvature " _outputs_filenames = {'output': 'output.nii'} _redirect_x = False diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_DWIConvert.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_DWIConvert.py index 15e293f3aa..cf69f6dc4d 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_DWIConvert.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_DWIConvert.py @@ -52,7 +52,7 @@ def test_DWIConvert_inputs(): writeProtocolGradientsFile=dict(argstr='--writeProtocolGradientsFile ', ), ) - inputs = DWIConvert.input_spec() + inputs = DWIConvert._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -66,7 +66,7 @@ def test_DWIConvert_outputs(): outputDirectory=dict(), outputVolume=dict(), ) - outputs = DWIConvert.output_spec() + outputs = DWIConvert._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_compareTractInclusion.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_compareTractInclusion.py index 1a46be411a..394412a291 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_compareTractInclusion.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_compareTractInclusion.py @@ -31,7 +31,7 @@ def test_compareTractInclusion_inputs(): writeXMLPolyDataFile=dict(argstr='--writeXMLPolyDataFile ', ), ) - inputs = compareTractInclusion.input_spec() + inputs = compareTractInclusion._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -40,7 +40,7 @@ def test_compareTractInclusion_inputs(): def test_compareTractInclusion_outputs(): output_map = dict() - outputs = compareTractInclusion.output_spec() + outputs = compareTractInclusion._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_dtiaverage.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_dtiaverage.py index 7988994224..63d92d0c78 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_dtiaverage.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_dtiaverage.py @@ -24,7 +24,7 @@ def test_dtiaverage_inputs(): verbose=dict(argstr='--verbose ', ), ) - inputs = dtiaverage.input_spec() + inputs = dtiaverage._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -34,7 +34,7 @@ def test_dtiaverage_inputs(): def test_dtiaverage_outputs(): output_map = dict(tensor_output=dict(), ) - outputs = dtiaverage.output_spec() + outputs = dtiaverage._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_dtiestim.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_dtiestim.py index 1b488807b9..cc2cf41a7c 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_dtiestim.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_dtiestim.py @@ -56,7 +56,7 @@ def test_dtiestim_inputs(): weight_iterations=dict(argstr='--weight_iterations %d', ), ) - inputs = dtiestim.input_spec() + inputs = dtiestim._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -69,7 +69,7 @@ def test_dtiestim_outputs(): idwi=dict(), tensor_output=dict(), ) - outputs = dtiestim.output_spec() + outputs = dtiestim._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_dtiprocess.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_dtiprocess.py index 94bd061f75..b9625179d3 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_dtiprocess.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_dtiprocess.py @@ -88,7 +88,7 @@ def test_dtiprocess_inputs(): verbose=dict(argstr='--verbose ', ), ) - inputs = dtiprocess.input_spec() + inputs = dtiprocess._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -112,7 +112,7 @@ def test_dtiprocess_outputs(): principal_eigenvector_output=dict(), rot_output=dict(), ) - outputs = dtiprocess.output_spec() + outputs = dtiprocess._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_extractNrrdVectorIndex.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_extractNrrdVectorIndex.py index 79400fea82..04c78827c9 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_extractNrrdVectorIndex.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_extractNrrdVectorIndex.py @@ -26,7 +26,7 @@ def test_extractNrrdVectorIndex_inputs(): vectorIndex=dict(argstr='--vectorIndex %d', ), ) - inputs = extractNrrdVectorIndex.input_spec() + inputs = extractNrrdVectorIndex._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -36,7 +36,7 @@ def test_extractNrrdVectorIndex_inputs(): def test_extractNrrdVectorIndex_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = extractNrrdVectorIndex.output_spec() + outputs = extractNrrdVectorIndex._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractAnisotropyMap.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractAnisotropyMap.py index eccf216089..a01f44e7a6 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractAnisotropyMap.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractAnisotropyMap.py @@ -24,7 +24,7 @@ def test_gtractAnisotropyMap_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = gtractAnisotropyMap.input_spec() + inputs = gtractAnisotropyMap._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -34,7 +34,7 @@ def test_gtractAnisotropyMap_inputs(): def test_gtractAnisotropyMap_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = gtractAnisotropyMap.output_spec() + outputs = gtractAnisotropyMap._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractAverageBvalues.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractAverageBvalues.py index 3c00c388cf..8eae1d8f64 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractAverageBvalues.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractAverageBvalues.py @@ -26,7 +26,7 @@ def test_gtractAverageBvalues_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = gtractAverageBvalues.input_spec() + inputs = gtractAverageBvalues._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -36,7 +36,7 @@ def test_gtractAverageBvalues_inputs(): def test_gtractAverageBvalues_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = gtractAverageBvalues.output_spec() + outputs = gtractAverageBvalues._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractClipAnisotropy.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractClipAnisotropy.py index 95970529ef..81455dfaba 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractClipAnisotropy.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractClipAnisotropy.py @@ -26,7 +26,7 @@ def test_gtractClipAnisotropy_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = gtractClipAnisotropy.input_spec() + inputs = gtractClipAnisotropy._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -36,7 +36,7 @@ def test_gtractClipAnisotropy_inputs(): def test_gtractClipAnisotropy_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = gtractClipAnisotropy.output_spec() + outputs = gtractClipAnisotropy._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCoRegAnatomy.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCoRegAnatomy.py index 60ce5e72a4..2629defa52 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCoRegAnatomy.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCoRegAnatomy.py @@ -65,7 +65,7 @@ def test_gtractCoRegAnatomy_inputs(): vectorIndex=dict(argstr='--vectorIndex %d', ), ) - inputs = gtractCoRegAnatomy.input_spec() + inputs = gtractCoRegAnatomy._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -75,7 +75,7 @@ def test_gtractCoRegAnatomy_inputs(): def test_gtractCoRegAnatomy_outputs(): output_map = dict(outputTransformName=dict(), ) - outputs = gtractCoRegAnatomy.output_spec() + outputs = gtractCoRegAnatomy._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractConcatDwi.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractConcatDwi.py index 0cfe65e61d..b023a0b717 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractConcatDwi.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractConcatDwi.py @@ -24,7 +24,7 @@ def test_gtractConcatDwi_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = gtractConcatDwi.input_spec() + inputs = gtractConcatDwi._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -34,7 +34,7 @@ def test_gtractConcatDwi_inputs(): def test_gtractConcatDwi_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = gtractConcatDwi.output_spec() + outputs = gtractConcatDwi._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCopyImageOrientation.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCopyImageOrientation.py index e16d80814d..9cc32581ee 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCopyImageOrientation.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCopyImageOrientation.py @@ -24,7 +24,7 @@ def test_gtractCopyImageOrientation_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = gtractCopyImageOrientation.input_spec() + inputs = gtractCopyImageOrientation._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -34,7 +34,7 @@ def test_gtractCopyImageOrientation_inputs(): def test_gtractCopyImageOrientation_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = gtractCopyImageOrientation.output_spec() + outputs = gtractCopyImageOrientation._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCoregBvalues.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCoregBvalues.py index c6b69bc116..4df2f5d09a 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCoregBvalues.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCoregBvalues.py @@ -49,7 +49,7 @@ def test_gtractCoregBvalues_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = gtractCoregBvalues.input_spec() + inputs = gtractCoregBvalues._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -60,7 +60,7 @@ def test_gtractCoregBvalues_outputs(): output_map = dict(outputTransform=dict(), outputVolume=dict(), ) - outputs = gtractCoregBvalues.output_spec() + outputs = gtractCoregBvalues._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCostFastMarching.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCostFastMarching.py index 84b91e79dc..2192b198d7 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCostFastMarching.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCostFastMarching.py @@ -37,7 +37,7 @@ def test_gtractCostFastMarching_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = gtractCostFastMarching.input_spec() + inputs = gtractCostFastMarching._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -48,7 +48,7 @@ def test_gtractCostFastMarching_outputs(): output_map = dict(outputCostVolume=dict(), outputSpeedVolume=dict(), ) - outputs = gtractCostFastMarching.output_spec() + outputs = gtractCostFastMarching._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCreateGuideFiber.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCreateGuideFiber.py index ed4c3a7891..192d8050fb 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCreateGuideFiber.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCreateGuideFiber.py @@ -26,7 +26,7 @@ def test_gtractCreateGuideFiber_inputs(): writeXMLPolyDataFile=dict(argstr='--writeXMLPolyDataFile ', ), ) - inputs = gtractCreateGuideFiber.input_spec() + inputs = gtractCreateGuideFiber._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -36,7 +36,7 @@ def test_gtractCreateGuideFiber_inputs(): def test_gtractCreateGuideFiber_outputs(): output_map = dict(outputFiber=dict(), ) - outputs = gtractCreateGuideFiber.output_spec() + outputs = gtractCreateGuideFiber._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractFastMarchingTracking.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractFastMarchingTracking.py index 80b431b91d..d84fce6850 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractFastMarchingTracking.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractFastMarchingTracking.py @@ -44,7 +44,7 @@ def test_gtractFastMarchingTracking_inputs(): writeXMLPolyDataFile=dict(argstr='--writeXMLPolyDataFile ', ), ) - inputs = gtractFastMarchingTracking.input_spec() + inputs = gtractFastMarchingTracking._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -54,7 +54,7 @@ def test_gtractFastMarchingTracking_inputs(): def test_gtractFastMarchingTracking_outputs(): output_map = dict(outputTract=dict(), ) - outputs = gtractFastMarchingTracking.output_spec() + outputs = gtractFastMarchingTracking._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractFiberTracking.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractFiberTracking.py index e9aa021e41..8bad5343d1 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractFiberTracking.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractFiberTracking.py @@ -72,7 +72,7 @@ def test_gtractFiberTracking_inputs(): writeXMLPolyDataFile=dict(argstr='--writeXMLPolyDataFile ', ), ) - inputs = gtractFiberTracking.input_spec() + inputs = gtractFiberTracking._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -82,7 +82,7 @@ def test_gtractFiberTracking_inputs(): def test_gtractFiberTracking_outputs(): output_map = dict(outputTract=dict(), ) - outputs = gtractFiberTracking.output_spec() + outputs = gtractFiberTracking._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractImageConformity.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractImageConformity.py index f14f17359a..2a3bd068be 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractImageConformity.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractImageConformity.py @@ -24,7 +24,7 @@ def test_gtractImageConformity_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = gtractImageConformity.input_spec() + inputs = gtractImageConformity._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -34,7 +34,7 @@ def test_gtractImageConformity_inputs(): def test_gtractImageConformity_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = gtractImageConformity.output_spec() + outputs = gtractImageConformity._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractInvertBSplineTransform.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractInvertBSplineTransform.py index 476a05e6ec..42efde82e9 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractInvertBSplineTransform.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractInvertBSplineTransform.py @@ -27,7 +27,7 @@ def test_gtractInvertBSplineTransform_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = gtractInvertBSplineTransform.input_spec() + inputs = gtractInvertBSplineTransform._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -37,7 +37,7 @@ def test_gtractInvertBSplineTransform_inputs(): def test_gtractInvertBSplineTransform_outputs(): output_map = dict(outputTransform=dict(), ) - outputs = gtractInvertBSplineTransform.output_spec() + outputs = gtractInvertBSplineTransform._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractInvertDisplacementField.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractInvertDisplacementField.py index db5b1e8b7a..74e49060a8 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractInvertDisplacementField.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractInvertDisplacementField.py @@ -26,7 +26,7 @@ def test_gtractInvertDisplacementField_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = gtractInvertDisplacementField.input_spec() + inputs = gtractInvertDisplacementField._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -36,7 +36,7 @@ def test_gtractInvertDisplacementField_inputs(): def test_gtractInvertDisplacementField_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = gtractInvertDisplacementField.output_spec() + outputs = gtractInvertDisplacementField._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractInvertRigidTransform.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractInvertRigidTransform.py index 4286c0769e..17f1e4ccb4 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractInvertRigidTransform.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractInvertRigidTransform.py @@ -22,7 +22,7 @@ def test_gtractInvertRigidTransform_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = gtractInvertRigidTransform.input_spec() + inputs = gtractInvertRigidTransform._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -32,7 +32,7 @@ def test_gtractInvertRigidTransform_inputs(): def test_gtractInvertRigidTransform_outputs(): output_map = dict(outputTransform=dict(), ) - outputs = gtractInvertRigidTransform.output_spec() + outputs = gtractInvertRigidTransform._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleAnisotropy.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleAnisotropy.py index 1887a216b9..fd76230f0f 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleAnisotropy.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleAnisotropy.py @@ -28,7 +28,7 @@ def test_gtractResampleAnisotropy_inputs(): transformType=dict(argstr='--transformType %s', ), ) - inputs = gtractResampleAnisotropy.input_spec() + inputs = gtractResampleAnisotropy._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -38,7 +38,7 @@ def test_gtractResampleAnisotropy_inputs(): def test_gtractResampleAnisotropy_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = gtractResampleAnisotropy.output_spec() + outputs = gtractResampleAnisotropy._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleB0.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleB0.py index 1623574a96..39b9551817 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleB0.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleB0.py @@ -30,7 +30,7 @@ def test_gtractResampleB0_inputs(): vectorIndex=dict(argstr='--vectorIndex %d', ), ) - inputs = gtractResampleB0.input_spec() + inputs = gtractResampleB0._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -40,7 +40,7 @@ def test_gtractResampleB0_inputs(): def test_gtractResampleB0_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = gtractResampleB0.output_spec() + outputs = gtractResampleB0._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleCodeImage.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleCodeImage.py index 78fc493bb0..ece2ed5fb1 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleCodeImage.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleCodeImage.py @@ -28,7 +28,7 @@ def test_gtractResampleCodeImage_inputs(): transformType=dict(argstr='--transformType %s', ), ) - inputs = gtractResampleCodeImage.input_spec() + inputs = gtractResampleCodeImage._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -38,7 +38,7 @@ def test_gtractResampleCodeImage_inputs(): def test_gtractResampleCodeImage_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = gtractResampleCodeImage.output_spec() + outputs = gtractResampleCodeImage._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleDWIInPlace.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleDWIInPlace.py index da647cf1f0..5b353fcbf7 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleDWIInPlace.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleDWIInPlace.py @@ -36,7 +36,7 @@ def test_gtractResampleDWIInPlace_inputs(): warpDWITransform=dict(argstr='--warpDWITransform %s', ), ) - inputs = gtractResampleDWIInPlace.input_spec() + inputs = gtractResampleDWIInPlace._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -47,7 +47,7 @@ def test_gtractResampleDWIInPlace_outputs(): output_map = dict(outputResampledB0=dict(), outputVolume=dict(), ) - outputs = gtractResampleDWIInPlace.output_spec() + outputs = gtractResampleDWIInPlace._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleFibers.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleFibers.py index f8954b20fb..6a9fe674df 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleFibers.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleFibers.py @@ -28,7 +28,7 @@ def test_gtractResampleFibers_inputs(): writeXMLPolyDataFile=dict(argstr='--writeXMLPolyDataFile ', ), ) - inputs = gtractResampleFibers.input_spec() + inputs = gtractResampleFibers._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -38,7 +38,7 @@ def test_gtractResampleFibers_inputs(): def test_gtractResampleFibers_outputs(): output_map = dict(outputTract=dict(), ) - outputs = gtractResampleFibers.output_spec() + outputs = gtractResampleFibers._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractTensor.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractTensor.py index 9b35d8ffd5..4515588dd1 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractTensor.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractTensor.py @@ -42,7 +42,7 @@ def test_gtractTensor_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = gtractTensor.input_spec() + inputs = gtractTensor._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -52,7 +52,7 @@ def test_gtractTensor_inputs(): def test_gtractTensor_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = gtractTensor.output_spec() + outputs = gtractTensor._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractTransformToDisplacementField.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractTransformToDisplacementField.py index 1e74ff01ee..9a8d775d25 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractTransformToDisplacementField.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractTransformToDisplacementField.py @@ -24,7 +24,7 @@ def test_gtractTransformToDisplacementField_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = gtractTransformToDisplacementField.input_spec() + inputs = gtractTransformToDisplacementField._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -34,7 +34,7 @@ def test_gtractTransformToDisplacementField_inputs(): def test_gtractTransformToDisplacementField_outputs(): output_map = dict(outputDeformationFieldVolume=dict(), ) - outputs = gtractTransformToDisplacementField.output_spec() + outputs = gtractTransformToDisplacementField._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_maxcurvature.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_maxcurvature.py index 12958f9a32..8f867fab44 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_maxcurvature.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_maxcurvature.py @@ -24,7 +24,7 @@ def test_maxcurvature_inputs(): verbose=dict(argstr='--verbose ', ), ) - inputs = maxcurvature.input_spec() + inputs = maxcurvature._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -34,7 +34,7 @@ def test_maxcurvature_inputs(): def test_maxcurvature_outputs(): output_map = dict(output=dict(), ) - outputs = maxcurvature.output_spec() + outputs = maxcurvature._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tractography/commandlineonly.py b/nipype/interfaces/semtools/diffusion/tractography/commandlineonly.py index edf2f089a9..07ebe57c42 100644 --- a/nipype/interfaces/semtools/diffusion/tractography/commandlineonly.py +++ b/nipype/interfaces/semtools/diffusion/tractography/commandlineonly.py @@ -42,8 +42,8 @@ class fiberstats(SEMLikeCommandLine): """ - input_spec = fiberstatsInputSpec - output_spec = fiberstatsOutputSpec + _input_spec = fiberstatsInputSpec + _output_spec = fiberstatsOutputSpec _cmd = " fiberstats " _outputs_filenames = {} _redirect_x = False diff --git a/nipype/interfaces/semtools/diffusion/tractography/fiberprocess.py b/nipype/interfaces/semtools/diffusion/tractography/fiberprocess.py index 28fbac5b24..1ce24766ac 100644 --- a/nipype/interfaces/semtools/diffusion/tractography/fiberprocess.py +++ b/nipype/interfaces/semtools/diffusion/tractography/fiberprocess.py @@ -56,8 +56,8 @@ class fiberprocess(SEMLikeCommandLine): """ - input_spec = fiberprocessInputSpec - output_spec = fiberprocessOutputSpec + _input_spec = fiberprocessInputSpec + _output_spec = fiberprocessOutputSpec _cmd = " fiberprocess " _outputs_filenames = {'fiber_output': 'fiber_output.vtk', 'voxelize': 'voxelize.nii'} _redirect_x = False diff --git a/nipype/interfaces/semtools/diffusion/tractography/fibertrack.py b/nipype/interfaces/semtools/diffusion/tractography/fibertrack.py index 893f3a9b7b..bf6d60e00d 100644 --- a/nipype/interfaces/semtools/diffusion/tractography/fibertrack.py +++ b/nipype/interfaces/semtools/diffusion/tractography/fibertrack.py @@ -56,8 +56,8 @@ class fibertrack(SEMLikeCommandLine): """ - input_spec = fibertrackInputSpec - output_spec = fibertrackOutputSpec + _input_spec = fibertrackInputSpec + _output_spec = fibertrackOutputSpec _cmd = " fibertrack " _outputs_filenames = {'output_fiber_file': 'output_fiber_file.vtk'} _redirect_x = False diff --git a/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_UKFTractography.py b/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_UKFTractography.py index 5550a1e903..8d455078c9 100644 --- a/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_UKFTractography.py +++ b/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_UKFTractography.py @@ -84,7 +84,7 @@ def test_UKFTractography_inputs(): writeUncompressedTracts=dict(argstr='--writeUncompressedTracts ', ), ) - inputs = UKFTractography.input_spec() + inputs = UKFTractography._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -95,7 +95,7 @@ def test_UKFTractography_outputs(): output_map = dict(tracts=dict(), tractsWithSecondTensor=dict(), ) - outputs = UKFTractography.output_spec() + outputs = UKFTractography._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_fiberprocess.py b/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_fiberprocess.py index b607a189d7..594e7ab18d 100644 --- a/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_fiberprocess.py +++ b/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_fiberprocess.py @@ -45,7 +45,7 @@ def test_fiberprocess_inputs(): voxelize_count_fibers=dict(argstr='--voxelize_count_fibers ', ), ) - inputs = fiberprocess.input_spec() + inputs = fiberprocess._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -56,7 +56,7 @@ def test_fiberprocess_outputs(): output_map = dict(fiber_output=dict(), voxelize=dict(), ) - outputs = fiberprocess.output_spec() + outputs = fiberprocess._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_fiberstats.py b/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_fiberstats.py index 8521e59239..9a3f555ad4 100644 --- a/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_fiberstats.py +++ b/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_fiberstats.py @@ -19,7 +19,7 @@ def test_fiberstats_inputs(): verbose=dict(argstr='--verbose ', ), ) - inputs = fiberstats.input_spec() + inputs = fiberstats._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -28,7 +28,7 @@ def test_fiberstats_inputs(): def test_fiberstats_outputs(): output_map = dict() - outputs = fiberstats.output_spec() + outputs = fiberstats._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_fibertrack.py b/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_fibertrack.py index d12c437f1c..1f74b03424 100644 --- a/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_fibertrack.py +++ b/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_fibertrack.py @@ -42,7 +42,7 @@ def test_fibertrack_inputs(): whole_brain=dict(argstr='--whole_brain ', ), ) - inputs = fibertrack.input_spec() + inputs = fibertrack._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -52,7 +52,7 @@ def test_fibertrack_inputs(): def test_fibertrack_outputs(): output_map = dict(output_fiber_file=dict(), ) - outputs = fibertrack.output_spec() + outputs = fibertrack._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/diffusion/tractography/ukftractography.py b/nipype/interfaces/semtools/diffusion/tractography/ukftractography.py index 63b1ecb33c..bfec9f0c7f 100644 --- a/nipype/interfaces/semtools/diffusion/tractography/ukftractography.py +++ b/nipype/interfaces/semtools/diffusion/tractography/ukftractography.py @@ -69,8 +69,8 @@ class UKFTractography(SEMLikeCommandLine): """ - input_spec = UKFTractographyInputSpec - output_spec = UKFTractographyOutputSpec + _input_spec = UKFTractographyInputSpec + _output_spec = UKFTractographyOutputSpec _cmd = " UKFTractography " _outputs_filenames = {'tracts': 'tracts.vtp', 'tractsWithSecondTensor': 'tractsWithSecondTensor.vtp'} _redirect_x = False diff --git a/nipype/interfaces/semtools/featurecreator.py b/nipype/interfaces/semtools/featurecreator.py index 4147832b77..29cb6fc725 100644 --- a/nipype/interfaces/semtools/featurecreator.py +++ b/nipype/interfaces/semtools/featurecreator.py @@ -36,8 +36,8 @@ class GenerateCsfClippedFromClassifiedImage(SEMLikeCommandLine): """ - input_spec = GenerateCsfClippedFromClassifiedImageInputSpec - output_spec = GenerateCsfClippedFromClassifiedImageOutputSpec + _input_spec = GenerateCsfClippedFromClassifiedImageInputSpec + _output_spec = GenerateCsfClippedFromClassifiedImageOutputSpec _cmd = " GenerateCsfClippedFromClassifiedImage " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} _redirect_x = False diff --git a/nipype/interfaces/semtools/filtering/denoising.py b/nipype/interfaces/semtools/filtering/denoising.py index 03536fd643..16430b45f7 100644 --- a/nipype/interfaces/semtools/filtering/denoising.py +++ b/nipype/interfaces/semtools/filtering/denoising.py @@ -49,8 +49,8 @@ class UnbiasedNonLocalMeans(SEMLikeCommandLine): """ - input_spec = UnbiasedNonLocalMeansInputSpec - output_spec = UnbiasedNonLocalMeansOutputSpec + _input_spec = UnbiasedNonLocalMeansInputSpec + _output_spec = UnbiasedNonLocalMeansOutputSpec _cmd = " UnbiasedNonLocalMeans " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} _redirect_x = False diff --git a/nipype/interfaces/semtools/filtering/featuredetection.py b/nipype/interfaces/semtools/filtering/featuredetection.py index 6f66a39ae4..23e75245bd 100644 --- a/nipype/interfaces/semtools/filtering/featuredetection.py +++ b/nipype/interfaces/semtools/filtering/featuredetection.py @@ -37,8 +37,8 @@ class GenerateSummedGradientImage(SEMLikeCommandLine): """ - input_spec = GenerateSummedGradientImageInputSpec - output_spec = GenerateSummedGradientImageOutputSpec + _input_spec = GenerateSummedGradientImageInputSpec + _output_spec = GenerateSummedGradientImageOutputSpec _cmd = " GenerateSummedGradientImage " _outputs_filenames = {'outputFileName': 'outputFileName'} _redirect_x = False @@ -79,8 +79,8 @@ class CannySegmentationLevelSetImageFilter(SEMLikeCommandLine): """ - input_spec = CannySegmentationLevelSetImageFilterInputSpec - output_spec = CannySegmentationLevelSetImageFilterOutputSpec + _input_spec = CannySegmentationLevelSetImageFilterInputSpec + _output_spec = CannySegmentationLevelSetImageFilterOutputSpec _cmd = " CannySegmentationLevelSetImageFilter " _outputs_filenames = {'outputVolume': 'outputVolume.nii', 'outputSpeedVolume': 'outputSpeedVolume.nii'} _redirect_x = False @@ -115,8 +115,8 @@ class DilateImage(SEMLikeCommandLine): """ - input_spec = DilateImageInputSpec - output_spec = DilateImageOutputSpec + _input_spec = DilateImageInputSpec + _output_spec = DilateImageOutputSpec _cmd = " DilateImage " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} _redirect_x = False @@ -150,8 +150,8 @@ class TextureFromNoiseImageFilter(SEMLikeCommandLine): """ - input_spec = TextureFromNoiseImageFilterInputSpec - output_spec = TextureFromNoiseImageFilterOutputSpec + _input_spec = TextureFromNoiseImageFilterInputSpec + _output_spec = TextureFromNoiseImageFilterOutputSpec _cmd = " TextureFromNoiseImageFilter " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} _redirect_x = False @@ -185,8 +185,8 @@ class FlippedDifference(SEMLikeCommandLine): """ - input_spec = FlippedDifferenceInputSpec - output_spec = FlippedDifferenceOutputSpec + _input_spec = FlippedDifferenceInputSpec + _output_spec = FlippedDifferenceOutputSpec _cmd = " FlippedDifference " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} _redirect_x = False @@ -221,8 +221,8 @@ class ErodeImage(SEMLikeCommandLine): """ - input_spec = ErodeImageInputSpec - output_spec = ErodeImageOutputSpec + _input_spec = ErodeImageInputSpec + _output_spec = ErodeImageOutputSpec _cmd = " ErodeImage " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} _redirect_x = False @@ -255,8 +255,8 @@ class GenerateBrainClippedImage(SEMLikeCommandLine): """ - input_spec = GenerateBrainClippedImageInputSpec - output_spec = GenerateBrainClippedImageOutputSpec + _input_spec = GenerateBrainClippedImageInputSpec + _output_spec = GenerateBrainClippedImageOutputSpec _cmd = " GenerateBrainClippedImage " _outputs_filenames = {'outputFileName': 'outputFileName'} _redirect_x = False @@ -291,8 +291,8 @@ class NeighborhoodMedian(SEMLikeCommandLine): """ - input_spec = NeighborhoodMedianInputSpec - output_spec = NeighborhoodMedianOutputSpec + _input_spec = NeighborhoodMedianInputSpec + _output_spec = NeighborhoodMedianOutputSpec _cmd = " NeighborhoodMedian " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} _redirect_x = False @@ -326,8 +326,8 @@ class GenerateTestImage(SEMLikeCommandLine): """ - input_spec = GenerateTestImageInputSpec - output_spec = GenerateTestImageOutputSpec + _input_spec = GenerateTestImageInputSpec + _output_spec = GenerateTestImageOutputSpec _cmd = " GenerateTestImage " _outputs_filenames = {'outputVolume': 'outputVolume'} _redirect_x = False @@ -362,8 +362,8 @@ class NeighborhoodMean(SEMLikeCommandLine): """ - input_spec = NeighborhoodMeanInputSpec - output_spec = NeighborhoodMeanOutputSpec + _input_spec = NeighborhoodMeanInputSpec + _output_spec = NeighborhoodMeanOutputSpec _cmd = " NeighborhoodMean " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} _redirect_x = False @@ -400,8 +400,8 @@ class HammerAttributeCreator(SEMLikeCommandLine): """ - input_spec = HammerAttributeCreatorInputSpec - output_spec = HammerAttributeCreatorOutputSpec + _input_spec = HammerAttributeCreatorInputSpec + _output_spec = HammerAttributeCreatorOutputSpec _cmd = " HammerAttributeCreator " _outputs_filenames = {} _redirect_x = False @@ -437,8 +437,8 @@ class TextureMeasureFilter(SEMLikeCommandLine): """ - input_spec = TextureMeasureFilterInputSpec - output_spec = TextureMeasureFilterOutputSpec + _input_spec = TextureMeasureFilterInputSpec + _output_spec = TextureMeasureFilterOutputSpec _cmd = " TextureMeasureFilter " _outputs_filenames = {'outputFilename': 'outputFilename'} _redirect_x = False @@ -474,8 +474,8 @@ class DilateMask(SEMLikeCommandLine): """ - input_spec = DilateMaskInputSpec - output_spec = DilateMaskOutputSpec + _input_spec = DilateMaskInputSpec + _output_spec = DilateMaskOutputSpec _cmd = " DilateMask " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} _redirect_x = False @@ -508,8 +508,8 @@ class DumpBinaryTrainingVectors(SEMLikeCommandLine): """ - input_spec = DumpBinaryTrainingVectorsInputSpec - output_spec = DumpBinaryTrainingVectorsOutputSpec + _input_spec = DumpBinaryTrainingVectorsInputSpec + _output_spec = DumpBinaryTrainingVectorsOutputSpec _cmd = " DumpBinaryTrainingVectors " _outputs_filenames = {} _redirect_x = False @@ -544,8 +544,8 @@ class DistanceMaps(SEMLikeCommandLine): """ - input_spec = DistanceMapsInputSpec - output_spec = DistanceMapsOutputSpec + _input_spec = DistanceMapsInputSpec + _output_spec = DistanceMapsOutputSpec _cmd = " DistanceMaps " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} _redirect_x = False @@ -579,8 +579,8 @@ class STAPLEAnalysis(SEMLikeCommandLine): """ - input_spec = STAPLEAnalysisInputSpec - output_spec = STAPLEAnalysisOutputSpec + _input_spec = STAPLEAnalysisInputSpec + _output_spec = STAPLEAnalysisOutputSpec _cmd = " STAPLEAnalysis " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} _redirect_x = False @@ -610,8 +610,8 @@ class GradientAnisotropicDiffusionImageFilter(SEMLikeCommandLine): """ - input_spec = GradientAnisotropicDiffusionImageFilterInputSpec - output_spec = GradientAnisotropicDiffusionImageFilterOutputSpec + _input_spec = GradientAnisotropicDiffusionImageFilterInputSpec + _output_spec = GradientAnisotropicDiffusionImageFilterOutputSpec _cmd = " GradientAnisotropicDiffusionImageFilter " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} _redirect_x = False @@ -649,8 +649,8 @@ class CannyEdge(SEMLikeCommandLine): """ - input_spec = CannyEdgeInputSpec - output_spec = CannyEdgeOutputSpec + _input_spec = CannyEdgeInputSpec + _output_spec = CannyEdgeOutputSpec _cmd = " CannyEdge " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} _redirect_x = False diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_CannyEdge.py b/nipype/interfaces/semtools/filtering/tests/test_auto_CannyEdge.py index f09e7e139a..ed0d8b0aa1 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_CannyEdge.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_CannyEdge.py @@ -26,7 +26,7 @@ def test_CannyEdge_inputs(): variance=dict(argstr='--variance %f', ), ) - inputs = CannyEdge.input_spec() + inputs = CannyEdge._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -36,7 +36,7 @@ def test_CannyEdge_inputs(): def test_CannyEdge_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = CannyEdge.output_spec() + outputs = CannyEdge._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_CannySegmentationLevelSetImageFilter.py b/nipype/interfaces/semtools/filtering/tests/test_auto_CannySegmentationLevelSetImageFilter.py index 5dd69484aa..23e0b2f1a0 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_CannySegmentationLevelSetImageFilter.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_CannySegmentationLevelSetImageFilter.py @@ -35,7 +35,7 @@ def test_CannySegmentationLevelSetImageFilter_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = CannySegmentationLevelSetImageFilter.input_spec() + inputs = CannySegmentationLevelSetImageFilter._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -46,7 +46,7 @@ def test_CannySegmentationLevelSetImageFilter_outputs(): output_map = dict(outputSpeedVolume=dict(), outputVolume=dict(), ) - outputs = CannySegmentationLevelSetImageFilter.output_spec() + outputs = CannySegmentationLevelSetImageFilter._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_DilateImage.py b/nipype/interfaces/semtools/filtering/tests/test_auto_DilateImage.py index 353924d80f..4d1a8c4a34 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_DilateImage.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_DilateImage.py @@ -24,7 +24,7 @@ def test_DilateImage_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = DilateImage.input_spec() + inputs = DilateImage._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -34,7 +34,7 @@ def test_DilateImage_inputs(): def test_DilateImage_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = DilateImage.output_spec() + outputs = DilateImage._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_DilateMask.py b/nipype/interfaces/semtools/filtering/tests/test_auto_DilateMask.py index 91fb032420..ea96c32680 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_DilateMask.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_DilateMask.py @@ -26,7 +26,7 @@ def test_DilateMask_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = DilateMask.input_spec() + inputs = DilateMask._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -36,7 +36,7 @@ def test_DilateMask_inputs(): def test_DilateMask_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = DilateMask.output_spec() + outputs = DilateMask._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_DistanceMaps.py b/nipype/interfaces/semtools/filtering/tests/test_auto_DistanceMaps.py index 6e43ad16ee..4d05aba965 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_DistanceMaps.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_DistanceMaps.py @@ -24,7 +24,7 @@ def test_DistanceMaps_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = DistanceMaps.input_spec() + inputs = DistanceMaps._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -34,7 +34,7 @@ def test_DistanceMaps_inputs(): def test_DistanceMaps_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = DistanceMaps.output_spec() + outputs = DistanceMaps._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_DumpBinaryTrainingVectors.py b/nipype/interfaces/semtools/filtering/tests/test_auto_DumpBinaryTrainingVectors.py index b588e4bcf6..c822e7f014 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_DumpBinaryTrainingVectors.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_DumpBinaryTrainingVectors.py @@ -19,7 +19,7 @@ def test_DumpBinaryTrainingVectors_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = DumpBinaryTrainingVectors.input_spec() + inputs = DumpBinaryTrainingVectors._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -28,7 +28,7 @@ def test_DumpBinaryTrainingVectors_inputs(): def test_DumpBinaryTrainingVectors_outputs(): output_map = dict() - outputs = DumpBinaryTrainingVectors.output_spec() + outputs = DumpBinaryTrainingVectors._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_ErodeImage.py b/nipype/interfaces/semtools/filtering/tests/test_auto_ErodeImage.py index 81c8429e13..eed7411979 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_ErodeImage.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_ErodeImage.py @@ -24,7 +24,7 @@ def test_ErodeImage_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ErodeImage.input_spec() + inputs = ErodeImage._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -34,7 +34,7 @@ def test_ErodeImage_inputs(): def test_ErodeImage_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = ErodeImage.output_spec() + outputs = ErodeImage._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_FlippedDifference.py b/nipype/interfaces/semtools/filtering/tests/test_auto_FlippedDifference.py index 3c86f288fa..97f9be5262 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_FlippedDifference.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_FlippedDifference.py @@ -22,7 +22,7 @@ def test_FlippedDifference_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = FlippedDifference.input_spec() + inputs = FlippedDifference._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -32,7 +32,7 @@ def test_FlippedDifference_inputs(): def test_FlippedDifference_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = FlippedDifference.output_spec() + outputs = FlippedDifference._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_GenerateBrainClippedImage.py b/nipype/interfaces/semtools/filtering/tests/test_auto_GenerateBrainClippedImage.py index c605f8deea..135f74d2ef 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_GenerateBrainClippedImage.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_GenerateBrainClippedImage.py @@ -24,7 +24,7 @@ def test_GenerateBrainClippedImage_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = GenerateBrainClippedImage.input_spec() + inputs = GenerateBrainClippedImage._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -34,7 +34,7 @@ def test_GenerateBrainClippedImage_inputs(): def test_GenerateBrainClippedImage_outputs(): output_map = dict(outputFileName=dict(), ) - outputs = GenerateBrainClippedImage.output_spec() + outputs = GenerateBrainClippedImage._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_GenerateSummedGradientImage.py b/nipype/interfaces/semtools/filtering/tests/test_auto_GenerateSummedGradientImage.py index fe720a4850..e38f35d84b 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_GenerateSummedGradientImage.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_GenerateSummedGradientImage.py @@ -26,7 +26,7 @@ def test_GenerateSummedGradientImage_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = GenerateSummedGradientImage.input_spec() + inputs = GenerateSummedGradientImage._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -36,7 +36,7 @@ def test_GenerateSummedGradientImage_inputs(): def test_GenerateSummedGradientImage_outputs(): output_map = dict(outputFileName=dict(), ) - outputs = GenerateSummedGradientImage.output_spec() + outputs = GenerateSummedGradientImage._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_GenerateTestImage.py b/nipype/interfaces/semtools/filtering/tests/test_auto_GenerateTestImage.py index 869788f527..f79c3ab9f5 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_GenerateTestImage.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_GenerateTestImage.py @@ -26,7 +26,7 @@ def test_GenerateTestImage_inputs(): upperBoundOfOutputVolume=dict(argstr='--upperBoundOfOutputVolume %f', ), ) - inputs = GenerateTestImage.input_spec() + inputs = GenerateTestImage._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -36,7 +36,7 @@ def test_GenerateTestImage_inputs(): def test_GenerateTestImage_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = GenerateTestImage.output_spec() + outputs = GenerateTestImage._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_GradientAnisotropicDiffusionImageFilter.py b/nipype/interfaces/semtools/filtering/tests/test_auto_GradientAnisotropicDiffusionImageFilter.py index d31e178ccb..192ee1fe65 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_GradientAnisotropicDiffusionImageFilter.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_GradientAnisotropicDiffusionImageFilter.py @@ -26,7 +26,7 @@ def test_GradientAnisotropicDiffusionImageFilter_inputs(): timeStep=dict(argstr='--timeStep %f', ), ) - inputs = GradientAnisotropicDiffusionImageFilter.input_spec() + inputs = GradientAnisotropicDiffusionImageFilter._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -36,7 +36,7 @@ def test_GradientAnisotropicDiffusionImageFilter_inputs(): def test_GradientAnisotropicDiffusionImageFilter_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = GradientAnisotropicDiffusionImageFilter.output_spec() + outputs = GradientAnisotropicDiffusionImageFilter._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_HammerAttributeCreator.py b/nipype/interfaces/semtools/filtering/tests/test_auto_HammerAttributeCreator.py index 2d7cfa38a8..0aa709d07e 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_HammerAttributeCreator.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_HammerAttributeCreator.py @@ -27,7 +27,7 @@ def test_HammerAttributeCreator_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = HammerAttributeCreator.input_spec() + inputs = HammerAttributeCreator._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -36,7 +36,7 @@ def test_HammerAttributeCreator_inputs(): def test_HammerAttributeCreator_outputs(): output_map = dict() - outputs = HammerAttributeCreator.output_spec() + outputs = HammerAttributeCreator._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_NeighborhoodMean.py b/nipype/interfaces/semtools/filtering/tests/test_auto_NeighborhoodMean.py index 82b34513f5..f988d119f5 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_NeighborhoodMean.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_NeighborhoodMean.py @@ -24,7 +24,7 @@ def test_NeighborhoodMean_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = NeighborhoodMean.input_spec() + inputs = NeighborhoodMean._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -34,7 +34,7 @@ def test_NeighborhoodMean_inputs(): def test_NeighborhoodMean_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = NeighborhoodMean.output_spec() + outputs = NeighborhoodMean._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_NeighborhoodMedian.py b/nipype/interfaces/semtools/filtering/tests/test_auto_NeighborhoodMedian.py index 3c22450067..b708fcbec0 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_NeighborhoodMedian.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_NeighborhoodMedian.py @@ -24,7 +24,7 @@ def test_NeighborhoodMedian_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = NeighborhoodMedian.input_spec() + inputs = NeighborhoodMedian._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -34,7 +34,7 @@ def test_NeighborhoodMedian_inputs(): def test_NeighborhoodMedian_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = NeighborhoodMedian.output_spec() + outputs = NeighborhoodMedian._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_STAPLEAnalysis.py b/nipype/interfaces/semtools/filtering/tests/test_auto_STAPLEAnalysis.py index 410cfc40b7..567e1da3af 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_STAPLEAnalysis.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_STAPLEAnalysis.py @@ -22,7 +22,7 @@ def test_STAPLEAnalysis_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = STAPLEAnalysis.input_spec() + inputs = STAPLEAnalysis._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -32,7 +32,7 @@ def test_STAPLEAnalysis_inputs(): def test_STAPLEAnalysis_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = STAPLEAnalysis.output_spec() + outputs = STAPLEAnalysis._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_TextureFromNoiseImageFilter.py b/nipype/interfaces/semtools/filtering/tests/test_auto_TextureFromNoiseImageFilter.py index 2b20435355..006823ff29 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_TextureFromNoiseImageFilter.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_TextureFromNoiseImageFilter.py @@ -22,7 +22,7 @@ def test_TextureFromNoiseImageFilter_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = TextureFromNoiseImageFilter.input_spec() + inputs = TextureFromNoiseImageFilter._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -32,7 +32,7 @@ def test_TextureFromNoiseImageFilter_inputs(): def test_TextureFromNoiseImageFilter_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = TextureFromNoiseImageFilter.output_spec() + outputs = TextureFromNoiseImageFilter._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_TextureMeasureFilter.py b/nipype/interfaces/semtools/filtering/tests/test_auto_TextureMeasureFilter.py index 77c1f8220d..ef611d1702 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_TextureMeasureFilter.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_TextureMeasureFilter.py @@ -26,7 +26,7 @@ def test_TextureMeasureFilter_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = TextureMeasureFilter.input_spec() + inputs = TextureMeasureFilter._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -36,7 +36,7 @@ def test_TextureMeasureFilter_inputs(): def test_TextureMeasureFilter_outputs(): output_map = dict(outputFilename=dict(), ) - outputs = TextureMeasureFilter.output_spec() + outputs = TextureMeasureFilter._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_UnbiasedNonLocalMeans.py b/nipype/interfaces/semtools/filtering/tests/test_auto_UnbiasedNonLocalMeans.py index 9d4de6b37b..acfeece325 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_UnbiasedNonLocalMeans.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_UnbiasedNonLocalMeans.py @@ -34,7 +34,7 @@ def test_UnbiasedNonLocalMeans_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = UnbiasedNonLocalMeans.input_spec() + inputs = UnbiasedNonLocalMeans._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -45,7 +45,7 @@ def test_UnbiasedNonLocalMeans_outputs(): output_map = dict(outputVolume=dict(position=-1, ), ) - outputs = UnbiasedNonLocalMeans.output_spec() + outputs = UnbiasedNonLocalMeans._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/legacy/registration.py b/nipype/interfaces/semtools/legacy/registration.py index 8af1e20bfd..a75bfb63a0 100644 --- a/nipype/interfaces/semtools/legacy/registration.py +++ b/nipype/interfaces/semtools/legacy/registration.py @@ -44,8 +44,8 @@ class scalartransform(SEMLikeCommandLine): """ - input_spec = scalartransformInputSpec - output_spec = scalartransformOutputSpec + _input_spec = scalartransformInputSpec + _output_spec = scalartransformOutputSpec _cmd = " scalartransform " _outputs_filenames = {'output_image': 'output_image.nii', 'transformation': 'transformation'} _redirect_x = False diff --git a/nipype/interfaces/semtools/legacy/tests/test_auto_scalartransform.py b/nipype/interfaces/semtools/legacy/tests/test_auto_scalartransform.py index 5885b351e0..c478cdf14c 100644 --- a/nipype/interfaces/semtools/legacy/tests/test_auto_scalartransform.py +++ b/nipype/interfaces/semtools/legacy/tests/test_auto_scalartransform.py @@ -31,7 +31,7 @@ def test_scalartransform_inputs(): hash_files=False, ), ) - inputs = scalartransform.input_spec() + inputs = scalartransform._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -42,7 +42,7 @@ def test_scalartransform_outputs(): output_map = dict(output_image=dict(), transformation=dict(), ) - outputs = scalartransform.output_spec() + outputs = scalartransform._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/registration/brainsfit.py b/nipype/interfaces/semtools/registration/brainsfit.py index f80750d09a..10751db96e 100644 --- a/nipype/interfaces/semtools/registration/brainsfit.py +++ b/nipype/interfaces/semtools/registration/brainsfit.py @@ -129,8 +129,8 @@ class BRAINSFit(SEMLikeCommandLine): """ - input_spec = BRAINSFitInputSpec - output_spec = BRAINSFitOutputSpec + _input_spec = BRAINSFitInputSpec + _output_spec = BRAINSFitOutputSpec _cmd = " BRAINSFit " _outputs_filenames = {'outputVolume': 'outputVolume.nii', 'bsplineTransform': 'bsplineTransform.h5', 'outputTransform': 'outputTransform.h5', 'outputFixedVolumeROI': 'outputFixedVolumeROI.nii', 'strippedOutputTransform': 'strippedOutputTransform.h5', 'outputMovingVolumeROI': 'outputMovingVolumeROI.nii', 'linearTransform': 'linearTransform.h5', 'logFileReport': 'logFileReport'} diff --git a/nipype/interfaces/semtools/registration/brainsresample.py b/nipype/interfaces/semtools/registration/brainsresample.py index 9a14b48589..5bf0f7c42d 100644 --- a/nipype/interfaces/semtools/registration/brainsresample.py +++ b/nipype/interfaces/semtools/registration/brainsresample.py @@ -50,8 +50,8 @@ class BRAINSResample(SEMLikeCommandLine): """ - input_spec = BRAINSResampleInputSpec - output_spec = BRAINSResampleOutputSpec + _input_spec = BRAINSResampleInputSpec + _output_spec = BRAINSResampleOutputSpec _cmd = " BRAINSResample " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} _redirect_x = False diff --git a/nipype/interfaces/semtools/registration/brainsresize.py b/nipype/interfaces/semtools/registration/brainsresize.py index dac094b6e4..ff46b643cc 100644 --- a/nipype/interfaces/semtools/registration/brainsresize.py +++ b/nipype/interfaces/semtools/registration/brainsresize.py @@ -39,8 +39,8 @@ class BRAINSResize(SEMLikeCommandLine): """ - input_spec = BRAINSResizeInputSpec - output_spec = BRAINSResizeOutputSpec + _input_spec = BRAINSResizeInputSpec + _output_spec = BRAINSResizeOutputSpec _cmd = " BRAINSResize " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} _redirect_x = False diff --git a/nipype/interfaces/semtools/registration/specialized.py b/nipype/interfaces/semtools/registration/specialized.py index ed6e6c76d7..2dbe3c9e9a 100644 --- a/nipype/interfaces/semtools/registration/specialized.py +++ b/nipype/interfaces/semtools/registration/specialized.py @@ -80,8 +80,8 @@ class VBRAINSDemonWarp(SEMLikeCommandLine): """ - input_spec = VBRAINSDemonWarpInputSpec - output_spec = VBRAINSDemonWarpOutputSpec + _input_spec = VBRAINSDemonWarpInputSpec + _output_spec = VBRAINSDemonWarpOutputSpec _cmd = " VBRAINSDemonWarp " _outputs_filenames = {'outputVolume': 'outputVolume.nii', 'outputCheckerboardVolume': 'outputCheckerboardVolume.nii', 'outputDisplacementFieldVolume': 'outputDisplacementFieldVolume.nrrd'} _redirect_x = False @@ -158,8 +158,8 @@ class BRAINSDemonWarp(SEMLikeCommandLine): """ - input_spec = BRAINSDemonWarpInputSpec - output_spec = BRAINSDemonWarpOutputSpec + _input_spec = BRAINSDemonWarpInputSpec + _output_spec = BRAINSDemonWarpOutputSpec _cmd = " BRAINSDemonWarp " _outputs_filenames = {'outputVolume': 'outputVolume.nii', 'outputCheckerboardVolume': 'outputCheckerboardVolume.nii', 'outputDisplacementFieldVolume': 'outputDisplacementFieldVolume.nrrd'} _redirect_x = False @@ -197,8 +197,8 @@ class BRAINSTransformFromFiducials(SEMLikeCommandLine): """ - input_spec = BRAINSTransformFromFiducialsInputSpec - output_spec = BRAINSTransformFromFiducialsOutputSpec + _input_spec = BRAINSTransformFromFiducialsInputSpec + _output_spec = BRAINSTransformFromFiducialsOutputSpec _cmd = " BRAINSTransformFromFiducials " _outputs_filenames = {'saveTransform': 'saveTransform.h5'} _redirect_x = False diff --git a/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSDemonWarp.py b/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSDemonWarp.py index fa3caa8d79..ef16a5cb57 100644 --- a/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSDemonWarp.py +++ b/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSDemonWarp.py @@ -105,7 +105,7 @@ def test_BRAINSDemonWarp_inputs(): use_vanilla_dem=dict(argstr='--use_vanilla_dem ', ), ) - inputs = BRAINSDemonWarp.input_spec() + inputs = BRAINSDemonWarp._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -117,7 +117,7 @@ def test_BRAINSDemonWarp_outputs(): outputDisplacementFieldVolume=dict(), outputVolume=dict(), ) - outputs = BRAINSDemonWarp.output_spec() + outputs = BRAINSDemonWarp._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSFit.py b/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSFit.py index feb165f1e2..56fa676186 100644 --- a/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSFit.py +++ b/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSFit.py @@ -158,7 +158,7 @@ def test_BRAINSFit_inputs(): writeTransformOnFailure=dict(argstr='--writeTransformOnFailure ', ), ) - inputs = BRAINSFit.input_spec() + inputs = BRAINSFit._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -175,7 +175,7 @@ def test_BRAINSFit_outputs(): outputVolume=dict(), strippedOutputTransform=dict(), ) - outputs = BRAINSFit.output_spec() + outputs = BRAINSFit._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSResample.py b/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSResample.py index e6d8c39ae8..abc2cb27e1 100644 --- a/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSResample.py +++ b/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSResample.py @@ -39,7 +39,7 @@ def test_BRAINSResample_inputs(): warpTransform=dict(argstr='--warpTransform %s', ), ) - inputs = BRAINSResample.input_spec() + inputs = BRAINSResample._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -49,7 +49,7 @@ def test_BRAINSResample_inputs(): def test_BRAINSResample_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = BRAINSResample.output_spec() + outputs = BRAINSResample._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSResize.py b/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSResize.py index 8ea205c2c6..e56977fcbb 100644 --- a/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSResize.py +++ b/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSResize.py @@ -24,7 +24,7 @@ def test_BRAINSResize_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = BRAINSResize.input_spec() + inputs = BRAINSResize._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -34,7 +34,7 @@ def test_BRAINSResize_inputs(): def test_BRAINSResize_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = BRAINSResize.output_spec() + outputs = BRAINSResize._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSTransformFromFiducials.py b/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSTransformFromFiducials.py index f7e228e28d..f5b41fa53a 100644 --- a/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSTransformFromFiducials.py +++ b/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSTransformFromFiducials.py @@ -30,7 +30,7 @@ def test_BRAINSTransformFromFiducials_inputs(): transformType=dict(argstr='--transformType %s', ), ) - inputs = BRAINSTransformFromFiducials.input_spec() + inputs = BRAINSTransformFromFiducials._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -40,7 +40,7 @@ def test_BRAINSTransformFromFiducials_inputs(): def test_BRAINSTransformFromFiducials_outputs(): output_map = dict(saveTransform=dict(), ) - outputs = BRAINSTransformFromFiducials.output_spec() + outputs = BRAINSTransformFromFiducials._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/registration/tests/test_auto_VBRAINSDemonWarp.py b/nipype/interfaces/semtools/registration/tests/test_auto_VBRAINSDemonWarp.py index 50df05872a..af920f8f80 100644 --- a/nipype/interfaces/semtools/registration/tests/test_auto_VBRAINSDemonWarp.py +++ b/nipype/interfaces/semtools/registration/tests/test_auto_VBRAINSDemonWarp.py @@ -108,7 +108,7 @@ def test_VBRAINSDemonWarp_inputs(): sep=',', ), ) - inputs = VBRAINSDemonWarp.input_spec() + inputs = VBRAINSDemonWarp._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -120,7 +120,7 @@ def test_VBRAINSDemonWarp_outputs(): outputDisplacementFieldVolume=dict(), outputVolume=dict(), ) - outputs = VBRAINSDemonWarp.output_spec() + outputs = VBRAINSDemonWarp._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/segmentation/specialized.py b/nipype/interfaces/semtools/segmentation/specialized.py index ec2395a200..087077416b 100644 --- a/nipype/interfaces/semtools/segmentation/specialized.py +++ b/nipype/interfaces/semtools/segmentation/specialized.py @@ -49,8 +49,8 @@ class BRAINSCut(SEMLikeCommandLine): """ - input_spec = BRAINSCutInputSpec - output_spec = BRAINSCutOutputSpec + _input_spec = BRAINSCutInputSpec + _output_spec = BRAINSCutOutputSpec _cmd = " BRAINSCut " _outputs_filenames = {} _redirect_x = False @@ -94,8 +94,8 @@ class BRAINSROIAuto(SEMLikeCommandLine): """ - input_spec = BRAINSROIAutoInputSpec - output_spec = BRAINSROIAutoOutputSpec + _input_spec = BRAINSROIAutoInputSpec + _output_spec = BRAINSROIAutoOutputSpec _cmd = " BRAINSROIAuto " _outputs_filenames = {'outputVolume': 'outputVolume.nii', 'outputROIMaskVolume': 'outputROIMaskVolume.nii'} _redirect_x = False @@ -185,8 +185,8 @@ class BRAINSConstellationDetector(SEMLikeCommandLine): """ - input_spec = BRAINSConstellationDetectorInputSpec - output_spec = BRAINSConstellationDetectorOutputSpec + _input_spec = BRAINSConstellationDetectorInputSpec + _output_spec = BRAINSConstellationDetectorOutputSpec _cmd = " BRAINSConstellationDetector " _outputs_filenames = {'outputVolume': 'outputVolume.nii.gz', 'outputMRML': 'outputMRML.mrml', 'resultsDir': 'resultsDir', 'outputResampledVolume': 'outputResampledVolume.nii.gz', 'outputTransform': 'outputTransform.h5', 'writeBranded2DImage': 'writeBranded2DImage.png', 'outputLandmarksInACPCAlignedSpace': 'outputLandmarksInACPCAlignedSpace.fcsv', 'outputLandmarksInInputSpace': 'outputLandmarksInInputSpace.fcsv', 'outputUntransformedClippedVolume': 'outputUntransformedClippedVolume.nii.gz', 'outputVerificationScript': 'outputVerificationScript.sh'} @@ -218,8 +218,8 @@ class BRAINSCreateLabelMapFromProbabilityMaps(SEMLikeCommandLine): """ - input_spec = BRAINSCreateLabelMapFromProbabilityMapsInputSpec - output_spec = BRAINSCreateLabelMapFromProbabilityMapsOutputSpec + _input_spec = BRAINSCreateLabelMapFromProbabilityMapsInputSpec + _output_spec = BRAINSCreateLabelMapFromProbabilityMapsOutputSpec _cmd = " BRAINSCreateLabelMapFromProbabilityMaps " _outputs_filenames = {'dirtyLabelVolume': 'dirtyLabelVolume.nii', 'cleanLabelVolume': 'cleanLabelVolume.nii'} _redirect_x = False @@ -253,8 +253,8 @@ class BinaryMaskEditorBasedOnLandmarks(SEMLikeCommandLine): """ - input_spec = BinaryMaskEditorBasedOnLandmarksInputSpec - output_spec = BinaryMaskEditorBasedOnLandmarksOutputSpec + _input_spec = BinaryMaskEditorBasedOnLandmarksInputSpec + _output_spec = BinaryMaskEditorBasedOnLandmarksOutputSpec _cmd = " BinaryMaskEditorBasedOnLandmarks " _outputs_filenames = {'outputBinaryVolume': 'outputBinaryVolume.nii'} _redirect_x = False @@ -286,8 +286,8 @@ class BRAINSMultiSTAPLE(SEMLikeCommandLine): """ - input_spec = BRAINSMultiSTAPLEInputSpec - output_spec = BRAINSMultiSTAPLEOutputSpec + _input_spec = BRAINSMultiSTAPLEInputSpec + _output_spec = BRAINSMultiSTAPLEOutputSpec _cmd = " BRAINSMultiSTAPLE " _outputs_filenames = {'outputMultiSTAPLE': 'outputMultiSTAPLE.nii', 'outputConfusionMatrix': 'outputConfusionMatrixh5|mat|txt'} _redirect_x = False @@ -352,8 +352,8 @@ class BRAINSABC(SEMLikeCommandLine): """ - input_spec = BRAINSABCInputSpec - output_spec = BRAINSABCOutputSpec + _input_spec = BRAINSABCInputSpec + _output_spec = BRAINSABCOutputSpec _cmd = " BRAINSABC " _outputs_filenames = {'saveState': 'saveState.h5', 'outputLabels': 'outputLabels.nii.gz', 'atlasToSubjectTransform': 'atlasToSubjectTransform.h5', 'atlasToSubjectInitialTransform': 'atlasToSubjectInitialTransform.h5', 'outputDirtyLabels': 'outputDirtyLabels.nii.gz', 'outputVolumes': 'outputVolumes.nii.gz', 'outputDir': 'outputDir', 'implicitOutputs': 'implicitOutputs.nii.gz'} @@ -386,8 +386,8 @@ class ESLR(SEMLikeCommandLine): """ - input_spec = ESLRInputSpec - output_spec = ESLROutputSpec + _input_spec = ESLRInputSpec + _output_spec = ESLROutputSpec _cmd = " ESLR " _outputs_filenames = {'outputVolume': 'outputVolume.nii.gz'} _redirect_x = False diff --git a/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSABC.py b/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSABC.py index 871e5df311..eb3ad90f1e 100644 --- a/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSABC.py +++ b/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSABC.py @@ -91,7 +91,7 @@ def test_BRAINSABC_inputs(): writeLess=dict(argstr='--writeLess ', ), ) - inputs = BRAINSABC.input_spec() + inputs = BRAINSABC._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -108,7 +108,7 @@ def test_BRAINSABC_outputs(): outputVolumes=dict(), saveState=dict(), ) - outputs = BRAINSABC.output_spec() + outputs = BRAINSABC._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSConstellationDetector.py b/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSConstellationDetector.py index 39556f42d0..d9f0a521b0 100644 --- a/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSConstellationDetector.py +++ b/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSConstellationDetector.py @@ -110,7 +110,7 @@ def test_BRAINSConstellationDetector_inputs(): writedebuggingImagesLevel=dict(argstr='--writedebuggingImagesLevel %d', ), ) - inputs = BRAINSConstellationDetector.input_spec() + inputs = BRAINSConstellationDetector._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -129,7 +129,7 @@ def test_BRAINSConstellationDetector_outputs(): resultsDir=dict(), writeBranded2DImage=dict(), ) - outputs = BRAINSConstellationDetector.output_spec() + outputs = BRAINSConstellationDetector._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSCreateLabelMapFromProbabilityMaps.py b/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSCreateLabelMapFromProbabilityMaps.py index 88ce476209..593edb3eb1 100644 --- a/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSCreateLabelMapFromProbabilityMaps.py +++ b/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSCreateLabelMapFromProbabilityMaps.py @@ -33,7 +33,7 @@ def test_BRAINSCreateLabelMapFromProbabilityMaps_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = BRAINSCreateLabelMapFromProbabilityMaps.input_spec() + inputs = BRAINSCreateLabelMapFromProbabilityMaps._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -44,7 +44,7 @@ def test_BRAINSCreateLabelMapFromProbabilityMaps_outputs(): output_map = dict(cleanLabelVolume=dict(), dirtyLabelVolume=dict(), ) - outputs = BRAINSCreateLabelMapFromProbabilityMaps.output_spec() + outputs = BRAINSCreateLabelMapFromProbabilityMaps._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSCut.py b/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSCut.py index 7efdf9a1cc..958d396917 100644 --- a/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSCut.py +++ b/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSCut.py @@ -49,7 +49,7 @@ def test_BRAINSCut_inputs(): verbose=dict(argstr='--verbose %d', ), ) - inputs = BRAINSCut.input_spec() + inputs = BRAINSCut._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -58,7 +58,7 @@ def test_BRAINSCut_inputs(): def test_BRAINSCut_outputs(): output_map = dict() - outputs = BRAINSCut.output_spec() + outputs = BRAINSCut._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSMultiSTAPLE.py b/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSMultiSTAPLE.py index 86daa0bb17..ca8ca5b9c5 100644 --- a/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSMultiSTAPLE.py +++ b/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSMultiSTAPLE.py @@ -33,7 +33,7 @@ def test_BRAINSMultiSTAPLE_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = BRAINSMultiSTAPLE.input_spec() + inputs = BRAINSMultiSTAPLE._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -44,7 +44,7 @@ def test_BRAINSMultiSTAPLE_outputs(): output_map = dict(outputConfusionMatrix=dict(), outputMultiSTAPLE=dict(), ) - outputs = BRAINSMultiSTAPLE.output_spec() + outputs = BRAINSMultiSTAPLE._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSROIAuto.py b/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSROIAuto.py index eaffbf7909..1861e70413 100644 --- a/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSROIAuto.py +++ b/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSROIAuto.py @@ -39,7 +39,7 @@ def test_BRAINSROIAuto_inputs(): thresholdCorrectionFactor=dict(argstr='--thresholdCorrectionFactor %f', ), ) - inputs = BRAINSROIAuto.input_spec() + inputs = BRAINSROIAuto._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -50,7 +50,7 @@ def test_BRAINSROIAuto_outputs(): output_map = dict(outputROIMaskVolume=dict(), outputVolume=dict(), ) - outputs = BRAINSROIAuto.output_spec() + outputs = BRAINSROIAuto._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/segmentation/tests/test_auto_BinaryMaskEditorBasedOnLandmarks.py b/nipype/interfaces/semtools/segmentation/tests/test_auto_BinaryMaskEditorBasedOnLandmarks.py index 85ae45ffa7..2ed343a974 100644 --- a/nipype/interfaces/semtools/segmentation/tests/test_auto_BinaryMaskEditorBasedOnLandmarks.py +++ b/nipype/interfaces/semtools/segmentation/tests/test_auto_BinaryMaskEditorBasedOnLandmarks.py @@ -34,7 +34,7 @@ def test_BinaryMaskEditorBasedOnLandmarks_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = BinaryMaskEditorBasedOnLandmarks.input_spec() + inputs = BinaryMaskEditorBasedOnLandmarks._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -44,7 +44,7 @@ def test_BinaryMaskEditorBasedOnLandmarks_inputs(): def test_BinaryMaskEditorBasedOnLandmarks_outputs(): output_map = dict(outputBinaryVolume=dict(), ) - outputs = BinaryMaskEditorBasedOnLandmarks.output_spec() + outputs = BinaryMaskEditorBasedOnLandmarks._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/segmentation/tests/test_auto_ESLR.py b/nipype/interfaces/semtools/segmentation/tests/test_auto_ESLR.py index 943e609b99..8ce86e4fac 100644 --- a/nipype/interfaces/semtools/segmentation/tests/test_auto_ESLR.py +++ b/nipype/interfaces/semtools/segmentation/tests/test_auto_ESLR.py @@ -34,7 +34,7 @@ def test_ESLR_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ESLR.input_spec() + inputs = ESLR._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -44,7 +44,7 @@ def test_ESLR_inputs(): def test_ESLR_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = ESLR.output_spec() + outputs = ESLR._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/testing/featuredetection.py b/nipype/interfaces/semtools/testing/featuredetection.py index 2985e5bf1b..5922163e28 100644 --- a/nipype/interfaces/semtools/testing/featuredetection.py +++ b/nipype/interfaces/semtools/testing/featuredetection.py @@ -29,8 +29,8 @@ class SphericalCoordinateGeneration(SEMLikeCommandLine): """ - input_spec = SphericalCoordinateGenerationInputSpec - output_spec = SphericalCoordinateGenerationOutputSpec + _input_spec = SphericalCoordinateGenerationInputSpec + _output_spec = SphericalCoordinateGenerationOutputSpec _cmd = " SphericalCoordinateGeneration " _outputs_filenames = {} _redirect_x = False diff --git a/nipype/interfaces/semtools/testing/generateaveragelmkfile.py b/nipype/interfaces/semtools/testing/generateaveragelmkfile.py index 0bd8188269..4276ef6907 100644 --- a/nipype/interfaces/semtools/testing/generateaveragelmkfile.py +++ b/nipype/interfaces/semtools/testing/generateaveragelmkfile.py @@ -27,8 +27,8 @@ class GenerateAverageLmkFile(SEMLikeCommandLine): """ - input_spec = GenerateAverageLmkFileInputSpec - output_spec = GenerateAverageLmkFileOutputSpec + _input_spec = GenerateAverageLmkFileInputSpec + _output_spec = GenerateAverageLmkFileOutputSpec _cmd = " GenerateAverageLmkFile " _outputs_filenames = {'outputLandmarkFile': 'outputLandmarkFile'} _redirect_x = False diff --git a/nipype/interfaces/semtools/testing/landmarkscompare.py b/nipype/interfaces/semtools/testing/landmarkscompare.py index 1370bcb419..103d61f3a2 100644 --- a/nipype/interfaces/semtools/testing/landmarkscompare.py +++ b/nipype/interfaces/semtools/testing/landmarkscompare.py @@ -28,8 +28,8 @@ class LandmarksCompare(SEMLikeCommandLine): """ - input_spec = LandmarksCompareInputSpec - output_spec = LandmarksCompareOutputSpec + _input_spec = LandmarksCompareInputSpec + _output_spec = LandmarksCompareOutputSpec _cmd = " LandmarksCompare " _outputs_filenames = {} _redirect_x = False diff --git a/nipype/interfaces/semtools/tests/test_auto_DWICompare.py b/nipype/interfaces/semtools/tests/test_auto_DWICompare.py index 264ebfbd86..35081ccead 100644 --- a/nipype/interfaces/semtools/tests/test_auto_DWICompare.py +++ b/nipype/interfaces/semtools/tests/test_auto_DWICompare.py @@ -19,7 +19,7 @@ def test_DWICompare_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = DWICompare.input_spec() + inputs = DWICompare._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -28,7 +28,7 @@ def test_DWICompare_inputs(): def test_DWICompare_outputs(): output_map = dict() - outputs = DWICompare.output_spec() + outputs = DWICompare._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/tests/test_auto_DWISimpleCompare.py b/nipype/interfaces/semtools/tests/test_auto_DWISimpleCompare.py index 017abf83af..73dc15c797 100644 --- a/nipype/interfaces/semtools/tests/test_auto_DWISimpleCompare.py +++ b/nipype/interfaces/semtools/tests/test_auto_DWISimpleCompare.py @@ -21,7 +21,7 @@ def test_DWISimpleCompare_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = DWISimpleCompare.input_spec() + inputs = DWISimpleCompare._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -30,7 +30,7 @@ def test_DWISimpleCompare_inputs(): def test_DWISimpleCompare_outputs(): output_map = dict() - outputs = DWISimpleCompare.output_spec() + outputs = DWISimpleCompare._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/tests/test_auto_GenerateCsfClippedFromClassifiedImage.py b/nipype/interfaces/semtools/tests/test_auto_GenerateCsfClippedFromClassifiedImage.py index ccb2e8abd6..310b5039dd 100644 --- a/nipype/interfaces/semtools/tests/test_auto_GenerateCsfClippedFromClassifiedImage.py +++ b/nipype/interfaces/semtools/tests/test_auto_GenerateCsfClippedFromClassifiedImage.py @@ -20,7 +20,7 @@ def test_GenerateCsfClippedFromClassifiedImage_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = GenerateCsfClippedFromClassifiedImage.input_spec() + inputs = GenerateCsfClippedFromClassifiedImage._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -30,7 +30,7 @@ def test_GenerateCsfClippedFromClassifiedImage_inputs(): def test_GenerateCsfClippedFromClassifiedImage_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = GenerateCsfClippedFromClassifiedImage.output_spec() + outputs = GenerateCsfClippedFromClassifiedImage._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/utilities/brains.py b/nipype/interfaces/semtools/utilities/brains.py index e7402da5a4..7cc1305765 100644 --- a/nipype/interfaces/semtools/utilities/brains.py +++ b/nipype/interfaces/semtools/utilities/brains.py @@ -44,8 +44,8 @@ class BRAINSConstellationModeler(SEMLikeCommandLine): """ - input_spec = BRAINSConstellationModelerInputSpec - output_spec = BRAINSConstellationModelerOutputSpec + _input_spec = BRAINSConstellationModelerInputSpec + _output_spec = BRAINSConstellationModelerOutputSpec _cmd = " BRAINSConstellationModeler " _outputs_filenames = {'outputModel': 'outputModel.mdl', 'resultsDir': 'resultsDir'} _redirect_x = False @@ -72,8 +72,8 @@ class landmarksConstellationWeights(SEMLikeCommandLine): """ - input_spec = landmarksConstellationWeightsInputSpec - output_spec = landmarksConstellationWeightsOutputSpec + _input_spec = landmarksConstellationWeightsInputSpec + _output_spec = landmarksConstellationWeightsOutputSpec _cmd = " landmarksConstellationWeights " _outputs_filenames = {'outputWeightsList': 'outputWeightsList.wts'} _redirect_x = False @@ -108,8 +108,8 @@ class BRAINSTrimForegroundInDirection(SEMLikeCommandLine): """ - input_spec = BRAINSTrimForegroundInDirectionInputSpec - output_spec = BRAINSTrimForegroundInDirectionOutputSpec + _input_spec = BRAINSTrimForegroundInDirectionInputSpec + _output_spec = BRAINSTrimForegroundInDirectionOutputSpec _cmd = " BRAINSTrimForegroundInDirection " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} _redirect_x = False @@ -144,8 +144,8 @@ class BRAINSLmkTransform(SEMLikeCommandLine): """ - input_spec = BRAINSLmkTransformInputSpec - output_spec = BRAINSLmkTransformOutputSpec + _input_spec = BRAINSLmkTransformInputSpec + _output_spec = BRAINSLmkTransformOutputSpec _cmd = " BRAINSLmkTransform " _outputs_filenames = {'outputResampledVolume': 'outputResampledVolume.nii', 'outputAffineTransform': 'outputAffineTransform.h5'} _redirect_x = False @@ -196,8 +196,8 @@ class BRAINSMush(SEMLikeCommandLine): """ - input_spec = BRAINSMushInputSpec - output_spec = BRAINSMushOutputSpec + _input_spec = BRAINSMushInputSpec + _output_spec = BRAINSMushOutputSpec _cmd = " BRAINSMush " _outputs_filenames = {'outputMask': 'outputMask.nii.gz', 'outputWeightsFile': 'outputWeightsFile.txt', 'outputVolume': 'outputVolume.nii.gz'} _redirect_x = False @@ -235,8 +235,8 @@ class BRAINSTransformConvert(SEMLikeCommandLine): """ - input_spec = BRAINSTransformConvertInputSpec - output_spec = BRAINSTransformConvertOutputSpec + _input_spec = BRAINSTransformConvertInputSpec + _output_spec = BRAINSTransformConvertOutputSpec _cmd = " BRAINSTransformConvert " _outputs_filenames = {'displacementVolume': 'displacementVolume.nii', 'outputTransform': 'outputTransform.mat'} _redirect_x = False @@ -263,8 +263,8 @@ class landmarksConstellationAligner(SEMLikeCommandLine): """ - input_spec = landmarksConstellationAlignerInputSpec - output_spec = landmarksConstellationAlignerOutputSpec + _input_spec = landmarksConstellationAlignerInputSpec + _output_spec = landmarksConstellationAlignerOutputSpec _cmd = " landmarksConstellationAligner " _outputs_filenames = {'outputLandmarksPaired': 'outputLandmarksPaired'} _redirect_x = False @@ -293,8 +293,8 @@ class BRAINSEyeDetector(SEMLikeCommandLine): """ - input_spec = BRAINSEyeDetectorInputSpec - output_spec = BRAINSEyeDetectorOutputSpec + _input_spec = BRAINSEyeDetectorInputSpec + _output_spec = BRAINSEyeDetectorOutputSpec _cmd = " BRAINSEyeDetector " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} _redirect_x = False @@ -323,8 +323,8 @@ class BRAINSLinearModelerEPCA(SEMLikeCommandLine): """ - input_spec = BRAINSLinearModelerEPCAInputSpec - output_spec = BRAINSLinearModelerEPCAOutputSpec + _input_spec = BRAINSLinearModelerEPCAInputSpec + _output_spec = BRAINSLinearModelerEPCAOutputSpec _cmd = " BRAINSLinearModelerEPCA " _outputs_filenames = {} _redirect_x = False @@ -361,8 +361,8 @@ class BRAINSInitializedControlPoints(SEMLikeCommandLine): """ - input_spec = BRAINSInitializedControlPointsInputSpec - output_spec = BRAINSInitializedControlPointsOutputSpec + _input_spec = BRAINSInitializedControlPointsInputSpec + _output_spec = BRAINSInitializedControlPointsOutputSpec _cmd = " BRAINSInitializedControlPoints " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} _redirect_x = False @@ -391,8 +391,8 @@ class CleanUpOverlapLabels(SEMLikeCommandLine): """ - input_spec = CleanUpOverlapLabelsInputSpec - output_spec = CleanUpOverlapLabelsOutputSpec + _input_spec = CleanUpOverlapLabelsInputSpec + _output_spec = CleanUpOverlapLabelsOutputSpec _cmd = " CleanUpOverlapLabels " _outputs_filenames = {'outputBinaryVolumes': 'outputBinaryVolumes.nii'} _redirect_x = False @@ -423,8 +423,8 @@ class BRAINSClipInferior(SEMLikeCommandLine): """ - input_spec = BRAINSClipInferiorInputSpec - output_spec = BRAINSClipInferiorOutputSpec + _input_spec = BRAINSClipInferiorInputSpec + _output_spec = BRAINSClipInferiorOutputSpec _cmd = " BRAINSClipInferior " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} _redirect_x = False @@ -454,8 +454,8 @@ class GenerateLabelMapFromProbabilityMap(SEMLikeCommandLine): """ - input_spec = GenerateLabelMapFromProbabilityMapInputSpec - output_spec = GenerateLabelMapFromProbabilityMapOutputSpec + _input_spec = GenerateLabelMapFromProbabilityMapInputSpec + _output_spec = GenerateLabelMapFromProbabilityMapOutputSpec _cmd = " GenerateLabelMapFromProbabilityMap " _outputs_filenames = {'outputLabelVolume': 'outputLabelVolume.nii.gz'} _redirect_x = False @@ -493,8 +493,8 @@ class BRAINSAlignMSP(SEMLikeCommandLine): """ - input_spec = BRAINSAlignMSPInputSpec - output_spec = BRAINSAlignMSPOutputSpec + _input_spec = BRAINSAlignMSPInputSpec + _output_spec = BRAINSAlignMSPOutputSpec _cmd = " BRAINSAlignMSP " _outputs_filenames = {'OutputresampleMSP': 'OutputresampleMSP.nii', 'resultsDir': 'resultsDir'} _redirect_x = False @@ -527,8 +527,8 @@ class BRAINSLandmarkInitializer(SEMLikeCommandLine): """ - input_spec = BRAINSLandmarkInitializerInputSpec - output_spec = BRAINSLandmarkInitializerOutputSpec + _input_spec = BRAINSLandmarkInitializerInputSpec + _output_spec = BRAINSLandmarkInitializerOutputSpec _cmd = " BRAINSLandmarkInitializer " _outputs_filenames = {'outputTransformFilename': 'outputTransformFilename'} _redirect_x = False @@ -555,8 +555,8 @@ class insertMidACPCpoint(SEMLikeCommandLine): """ - input_spec = insertMidACPCpointInputSpec - output_spec = insertMidACPCpointOutputSpec + _input_spec = insertMidACPCpointInputSpec + _output_spec = insertMidACPCpointOutputSpec _cmd = " insertMidACPCpoint " _outputs_filenames = {'outputLandmarkFile': 'outputLandmarkFile'} _redirect_x = False @@ -592,8 +592,8 @@ class BRAINSSnapShotWriter(SEMLikeCommandLine): """ - input_spec = BRAINSSnapShotWriterInputSpec - output_spec = BRAINSSnapShotWriterOutputSpec + _input_spec = BRAINSSnapShotWriterInputSpec + _output_spec = BRAINSSnapShotWriterOutputSpec _cmd = " BRAINSSnapShotWriter " _outputs_filenames = {'outputFilename': 'outputFilename'} _redirect_x = False @@ -626,8 +626,8 @@ class JointHistogram(SEMLikeCommandLine): """ - input_spec = JointHistogramInputSpec - output_spec = JointHistogramOutputSpec + _input_spec = JointHistogramInputSpec + _output_spec = JointHistogramOutputSpec _cmd = " JointHistogram " _outputs_filenames = {} _redirect_x = False @@ -659,8 +659,8 @@ class ShuffleVectorsModule(SEMLikeCommandLine): """ - input_spec = ShuffleVectorsModuleInputSpec - output_spec = ShuffleVectorsModuleOutputSpec + _input_spec = ShuffleVectorsModuleInputSpec + _output_spec = ShuffleVectorsModuleOutputSpec _cmd = " ShuffleVectorsModule " _outputs_filenames = {'outputVectorFileBaseName': 'outputVectorFileBaseName'} _redirect_x = False @@ -696,8 +696,8 @@ class ImageRegionPlotter(SEMLikeCommandLine): """ - input_spec = ImageRegionPlotterInputSpec - output_spec = ImageRegionPlotterOutputSpec + _input_spec = ImageRegionPlotterInputSpec + _output_spec = ImageRegionPlotterOutputSpec _cmd = " ImageRegionPlotter " _outputs_filenames = {} _redirect_x = False @@ -727,8 +727,8 @@ class fcsv_to_hdf5(SEMLikeCommandLine): """ - input_spec = fcsv_to_hdf5InputSpec - output_spec = fcsv_to_hdf5OutputSpec + _input_spec = fcsv_to_hdf5InputSpec + _output_spec = fcsv_to_hdf5OutputSpec _cmd = " fcsv_to_hdf5 " _outputs_filenames = {'modelFile': 'modelFile', 'landmarksInformationFile': 'landmarksInformationFile.h5'} _redirect_x = False @@ -780,8 +780,8 @@ class FindCenterOfBrain(SEMLikeCommandLine): """ - input_spec = FindCenterOfBrainInputSpec - output_spec = FindCenterOfBrainOutputSpec + _input_spec = FindCenterOfBrainInputSpec + _output_spec = FindCenterOfBrainOutputSpec _cmd = " FindCenterOfBrain " _outputs_filenames = {'debugClippedImageMask': 'debugClippedImageMask.nii', 'debugTrimmedImage': 'debugTrimmedImage.nii', 'debugDistanceImage': 'debugDistanceImage.nii', 'debugGridImage': 'debugGridImage.nii', 'clippedImageMask': 'clippedImageMask.nii', 'debugAfterGridComputationsForegroundImage': 'debugAfterGridComputationsForegroundImage.nii'} diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSAlignMSP.py b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSAlignMSP.py index 98837c75a7..67b52d62f6 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSAlignMSP.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSAlignMSP.py @@ -42,7 +42,7 @@ def test_BRAINSAlignMSP_inputs(): writedebuggingImagesLevel=dict(argstr='--writedebuggingImagesLevel %d', ), ) - inputs = BRAINSAlignMSP.input_spec() + inputs = BRAINSAlignMSP._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -53,7 +53,7 @@ def test_BRAINSAlignMSP_outputs(): output_map = dict(OutputresampleMSP=dict(), resultsDir=dict(), ) - outputs = BRAINSAlignMSP.output_spec() + outputs = BRAINSAlignMSP._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSClipInferior.py b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSClipInferior.py index f7636c95d1..4ab9f70875 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSClipInferior.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSClipInferior.py @@ -26,7 +26,7 @@ def test_BRAINSClipInferior_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = BRAINSClipInferior.input_spec() + inputs = BRAINSClipInferior._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -36,7 +36,7 @@ def test_BRAINSClipInferior_inputs(): def test_BRAINSClipInferior_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = BRAINSClipInferior.output_spec() + outputs = BRAINSClipInferior._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSConstellationModeler.py b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSConstellationModeler.py index ee8b7bb018..cd431e3d34 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSConstellationModeler.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSConstellationModeler.py @@ -44,7 +44,7 @@ def test_BRAINSConstellationModeler_inputs(): writedebuggingImagesLevel=dict(argstr='--writedebuggingImagesLevel %d', ), ) - inputs = BRAINSConstellationModeler.input_spec() + inputs = BRAINSConstellationModeler._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -55,7 +55,7 @@ def test_BRAINSConstellationModeler_outputs(): output_map = dict(outputModel=dict(), resultsDir=dict(), ) - outputs = BRAINSConstellationModeler.output_spec() + outputs = BRAINSConstellationModeler._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSEyeDetector.py b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSEyeDetector.py index 20072ed902..694ad845de 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSEyeDetector.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSEyeDetector.py @@ -24,7 +24,7 @@ def test_BRAINSEyeDetector_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = BRAINSEyeDetector.input_spec() + inputs = BRAINSEyeDetector._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -34,7 +34,7 @@ def test_BRAINSEyeDetector_inputs(): def test_BRAINSEyeDetector_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = BRAINSEyeDetector.output_spec() + outputs = BRAINSEyeDetector._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSInitializedControlPoints.py b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSInitializedControlPoints.py index fb5d164f9b..8c797c777a 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSInitializedControlPoints.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSInitializedControlPoints.py @@ -30,7 +30,7 @@ def test_BRAINSInitializedControlPoints_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = BRAINSInitializedControlPoints.input_spec() + inputs = BRAINSInitializedControlPoints._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -40,7 +40,7 @@ def test_BRAINSInitializedControlPoints_inputs(): def test_BRAINSInitializedControlPoints_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = BRAINSInitializedControlPoints.output_spec() + outputs = BRAINSInitializedControlPoints._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSLandmarkInitializer.py b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSLandmarkInitializer.py index def6a40242..9f358ca6c6 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSLandmarkInitializer.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSLandmarkInitializer.py @@ -24,7 +24,7 @@ def test_BRAINSLandmarkInitializer_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = BRAINSLandmarkInitializer.input_spec() + inputs = BRAINSLandmarkInitializer._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -34,7 +34,7 @@ def test_BRAINSLandmarkInitializer_inputs(): def test_BRAINSLandmarkInitializer_outputs(): output_map = dict(outputTransformFilename=dict(), ) - outputs = BRAINSLandmarkInitializer.output_spec() + outputs = BRAINSLandmarkInitializer._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSLinearModelerEPCA.py b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSLinearModelerEPCA.py index f15061c8b4..972d2a3de3 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSLinearModelerEPCA.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSLinearModelerEPCA.py @@ -19,7 +19,7 @@ def test_BRAINSLinearModelerEPCA_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = BRAINSLinearModelerEPCA.input_spec() + inputs = BRAINSLinearModelerEPCA._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -28,7 +28,7 @@ def test_BRAINSLinearModelerEPCA_inputs(): def test_BRAINSLinearModelerEPCA_outputs(): output_map = dict() - outputs = BRAINSLinearModelerEPCA.output_spec() + outputs = BRAINSLinearModelerEPCA._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSLmkTransform.py b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSLmkTransform.py index 7bda89c361..47472bc9f7 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSLmkTransform.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSLmkTransform.py @@ -31,7 +31,7 @@ def test_BRAINSLmkTransform_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = BRAINSLmkTransform.input_spec() + inputs = BRAINSLmkTransform._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -42,7 +42,7 @@ def test_BRAINSLmkTransform_outputs(): output_map = dict(outputAffineTransform=dict(), outputResampledVolume=dict(), ) - outputs = BRAINSLmkTransform.output_spec() + outputs = BRAINSLmkTransform._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSMush.py b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSMush.py index 4a351563d1..03146d5488 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSMush.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSMush.py @@ -53,7 +53,7 @@ def test_BRAINSMush_inputs(): upperThresholdFactorPre=dict(argstr='--upperThresholdFactorPre %f', ), ) - inputs = BRAINSMush.input_spec() + inputs = BRAINSMush._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -65,7 +65,7 @@ def test_BRAINSMush_outputs(): outputVolume=dict(), outputWeightsFile=dict(), ) - outputs = BRAINSMush.output_spec() + outputs = BRAINSMush._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSSnapShotWriter.py b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSSnapShotWriter.py index 5ebceb6933..5df1db87c8 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSSnapShotWriter.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSSnapShotWriter.py @@ -34,7 +34,7 @@ def test_BRAINSSnapShotWriter_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = BRAINSSnapShotWriter.input_spec() + inputs = BRAINSSnapShotWriter._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -44,7 +44,7 @@ def test_BRAINSSnapShotWriter_inputs(): def test_BRAINSSnapShotWriter_outputs(): output_map = dict(outputFilename=dict(), ) - outputs = BRAINSSnapShotWriter.output_spec() + outputs = BRAINSSnapShotWriter._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSTransformConvert.py b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSTransformConvert.py index dd909677cc..ded6481139 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSTransformConvert.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSTransformConvert.py @@ -29,7 +29,7 @@ def test_BRAINSTransformConvert_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = BRAINSTransformConvert.input_spec() + inputs = BRAINSTransformConvert._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -40,7 +40,7 @@ def test_BRAINSTransformConvert_outputs(): output_map = dict(displacementVolume=dict(), outputTransform=dict(), ) - outputs = BRAINSTransformConvert.output_spec() + outputs = BRAINSTransformConvert._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSTrimForegroundInDirection.py b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSTrimForegroundInDirection.py index a63835efc8..1cfd68bc42 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSTrimForegroundInDirection.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSTrimForegroundInDirection.py @@ -32,7 +32,7 @@ def test_BRAINSTrimForegroundInDirection_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = BRAINSTrimForegroundInDirection.input_spec() + inputs = BRAINSTrimForegroundInDirection._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -42,7 +42,7 @@ def test_BRAINSTrimForegroundInDirection_inputs(): def test_BRAINSTrimForegroundInDirection_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = BRAINSTrimForegroundInDirection.output_spec() + outputs = BRAINSTrimForegroundInDirection._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_CleanUpOverlapLabels.py b/nipype/interfaces/semtools/utilities/tests/test_auto_CleanUpOverlapLabels.py index 16e64f7910..34fdd2c29a 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_CleanUpOverlapLabels.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_CleanUpOverlapLabels.py @@ -20,7 +20,7 @@ def test_CleanUpOverlapLabels_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = CleanUpOverlapLabels.input_spec() + inputs = CleanUpOverlapLabels._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -30,7 +30,7 @@ def test_CleanUpOverlapLabels_inputs(): def test_CleanUpOverlapLabels_outputs(): output_map = dict(outputBinaryVolumes=dict(), ) - outputs = CleanUpOverlapLabels.output_spec() + outputs = CleanUpOverlapLabels._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_FindCenterOfBrain.py b/nipype/interfaces/semtools/utilities/tests/test_auto_FindCenterOfBrain.py index 51cd6c5b70..a67175ee16 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_FindCenterOfBrain.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_FindCenterOfBrain.py @@ -53,7 +53,7 @@ def test_FindCenterOfBrain_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = FindCenterOfBrain.input_spec() + inputs = FindCenterOfBrain._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -68,7 +68,7 @@ def test_FindCenterOfBrain_outputs(): debugGridImage=dict(), debugTrimmedImage=dict(), ) - outputs = FindCenterOfBrain.output_spec() + outputs = FindCenterOfBrain._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_GenerateLabelMapFromProbabilityMap.py b/nipype/interfaces/semtools/utilities/tests/test_auto_GenerateLabelMapFromProbabilityMap.py index 28d2675275..cbd58a1fc1 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_GenerateLabelMapFromProbabilityMap.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_GenerateLabelMapFromProbabilityMap.py @@ -22,7 +22,7 @@ def test_GenerateLabelMapFromProbabilityMap_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = GenerateLabelMapFromProbabilityMap.input_spec() + inputs = GenerateLabelMapFromProbabilityMap._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -32,7 +32,7 @@ def test_GenerateLabelMapFromProbabilityMap_inputs(): def test_GenerateLabelMapFromProbabilityMap_outputs(): output_map = dict(outputLabelVolume=dict(), ) - outputs = GenerateLabelMapFromProbabilityMap.output_spec() + outputs = GenerateLabelMapFromProbabilityMap._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_ImageRegionPlotter.py b/nipype/interfaces/semtools/utilities/tests/test_auto_ImageRegionPlotter.py index 6c7f5215f8..f34a5639eb 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_ImageRegionPlotter.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_ImageRegionPlotter.py @@ -33,7 +33,7 @@ def test_ImageRegionPlotter_inputs(): verbose=dict(argstr='--verbose ', ), ) - inputs = ImageRegionPlotter.input_spec() + inputs = ImageRegionPlotter._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -42,7 +42,7 @@ def test_ImageRegionPlotter_inputs(): def test_ImageRegionPlotter_outputs(): output_map = dict() - outputs = ImageRegionPlotter.output_spec() + outputs = ImageRegionPlotter._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_JointHistogram.py b/nipype/interfaces/semtools/utilities/tests/test_auto_JointHistogram.py index 5f1ddedcb8..8f70ff0d00 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_JointHistogram.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_JointHistogram.py @@ -27,7 +27,7 @@ def test_JointHistogram_inputs(): verbose=dict(argstr='--verbose ', ), ) - inputs = JointHistogram.input_spec() + inputs = JointHistogram._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -36,7 +36,7 @@ def test_JointHistogram_inputs(): def test_JointHistogram_outputs(): output_map = dict() - outputs = JointHistogram.output_spec() + outputs = JointHistogram._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_ShuffleVectorsModule.py b/nipype/interfaces/semtools/utilities/tests/test_auto_ShuffleVectorsModule.py index 8d84a541b8..4cf785e3c1 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_ShuffleVectorsModule.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_ShuffleVectorsModule.py @@ -22,7 +22,7 @@ def test_ShuffleVectorsModule_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ShuffleVectorsModule.input_spec() + inputs = ShuffleVectorsModule._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -32,7 +32,7 @@ def test_ShuffleVectorsModule_inputs(): def test_ShuffleVectorsModule_outputs(): output_map = dict(outputVectorFileBaseName=dict(), ) - outputs = ShuffleVectorsModule.output_spec() + outputs = ShuffleVectorsModule._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_fcsv_to_hdf5.py b/nipype/interfaces/semtools/utilities/tests/test_auto_fcsv_to_hdf5.py index 9bee62f991..ec0ddbd9fb 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_fcsv_to_hdf5.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_fcsv_to_hdf5.py @@ -29,7 +29,7 @@ def test_fcsv_to_hdf5_inputs(): versionID=dict(argstr='--versionID %s', ), ) - inputs = fcsv_to_hdf5.input_spec() + inputs = fcsv_to_hdf5._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -40,7 +40,7 @@ def test_fcsv_to_hdf5_outputs(): output_map = dict(landmarksInformationFile=dict(), modelFile=dict(), ) - outputs = fcsv_to_hdf5.output_spec() + outputs = fcsv_to_hdf5._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_insertMidACPCpoint.py b/nipype/interfaces/semtools/utilities/tests/test_auto_insertMidACPCpoint.py index 8803f8263b..9a6f4b12a9 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_insertMidACPCpoint.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_insertMidACPCpoint.py @@ -20,7 +20,7 @@ def test_insertMidACPCpoint_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = insertMidACPCpoint.input_spec() + inputs = insertMidACPCpoint._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -30,7 +30,7 @@ def test_insertMidACPCpoint_inputs(): def test_insertMidACPCpoint_outputs(): output_map = dict(outputLandmarkFile=dict(), ) - outputs = insertMidACPCpoint.output_spec() + outputs = insertMidACPCpoint._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_landmarksConstellationAligner.py b/nipype/interfaces/semtools/utilities/tests/test_auto_landmarksConstellationAligner.py index d5b97d17b2..82451f5cf2 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_landmarksConstellationAligner.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_landmarksConstellationAligner.py @@ -20,7 +20,7 @@ def test_landmarksConstellationAligner_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = landmarksConstellationAligner.input_spec() + inputs = landmarksConstellationAligner._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -30,7 +30,7 @@ def test_landmarksConstellationAligner_inputs(): def test_landmarksConstellationAligner_outputs(): output_map = dict(outputLandmarksPaired=dict(), ) - outputs = landmarksConstellationAligner.output_spec() + outputs = landmarksConstellationAligner._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_landmarksConstellationWeights.py b/nipype/interfaces/semtools/utilities/tests/test_auto_landmarksConstellationWeights.py index 154d17665d..16d216509c 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_landmarksConstellationWeights.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_landmarksConstellationWeights.py @@ -24,7 +24,7 @@ def test_landmarksConstellationWeights_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = landmarksConstellationWeights.input_spec() + inputs = landmarksConstellationWeights._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -34,7 +34,7 @@ def test_landmarksConstellationWeights_inputs(): def test_landmarksConstellationWeights_outputs(): output_map = dict(outputWeightsList=dict(), ) - outputs = landmarksConstellationWeights.output_spec() + outputs = landmarksConstellationWeights._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/converters.py b/nipype/interfaces/slicer/converters.py index c55656fd4b..c89d90b8ef 100644 --- a/nipype/interfaces/slicer/converters.py +++ b/nipype/interfaces/slicer/converters.py @@ -39,8 +39,8 @@ class DicomToNrrdConverter(SEMLikeCommandLine): """ - input_spec = DicomToNrrdConverterInputSpec - output_spec = DicomToNrrdConverterOutputSpec + _input_spec = DicomToNrrdConverterInputSpec + _output_spec = DicomToNrrdConverterOutputSpec _cmd = "DicomToNrrdConverter " _outputs_filenames = {'outputDirectory': 'outputDirectory'} @@ -72,7 +72,7 @@ class OrientScalarVolume(SEMLikeCommandLine): """ - input_spec = OrientScalarVolumeInputSpec - output_spec = OrientScalarVolumeOutputSpec + _input_spec = OrientScalarVolumeInputSpec + _output_spec = OrientScalarVolumeOutputSpec _cmd = "OrientScalarVolume " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} diff --git a/nipype/interfaces/slicer/diffusion/diffusion.py b/nipype/interfaces/slicer/diffusion/diffusion.py index cb87deb4f5..794fcc0734 100644 --- a/nipype/interfaces/slicer/diffusion/diffusion.py +++ b/nipype/interfaces/slicer/diffusion/diffusion.py @@ -56,8 +56,8 @@ class ResampleDTIVolume(SEMLikeCommandLine): """ - input_spec = ResampleDTIVolumeInputSpec - output_spec = ResampleDTIVolumeOutputSpec + _input_spec = ResampleDTIVolumeInputSpec + _output_spec = ResampleDTIVolumeOutputSpec _cmd = "ResampleDTIVolume " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} @@ -101,8 +101,8 @@ class DWIRicianLMMSEFilter(SEMLikeCommandLine): """ - input_spec = DWIRicianLMMSEFilterInputSpec - output_spec = DWIRicianLMMSEFilterOutputSpec + _input_spec = DWIRicianLMMSEFilterInputSpec + _output_spec = DWIRicianLMMSEFilterOutputSpec _cmd = "DWIRicianLMMSEFilter " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} @@ -151,8 +151,8 @@ class TractographyLabelMapSeeding(SEMLikeCommandLine): """ - input_spec = TractographyLabelMapSeedingInputSpec - output_spec = TractographyLabelMapSeedingOutputSpec + _input_spec = TractographyLabelMapSeedingInputSpec + _output_spec = TractographyLabelMapSeedingOutputSpec _cmd = "TractographyLabelMapSeeding " _outputs_filenames = {'OutputFibers': 'OutputFibers.vtk', 'outputdirectory': 'outputdirectory'} @@ -190,8 +190,8 @@ class DWIJointRicianLMMSEFilter(SEMLikeCommandLine): """ - input_spec = DWIJointRicianLMMSEFilterInputSpec - output_spec = DWIJointRicianLMMSEFilterOutputSpec + _input_spec = DWIJointRicianLMMSEFilterInputSpec + _output_spec = DWIJointRicianLMMSEFilterOutputSpec _cmd = "DWIJointRicianLMMSEFilter " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} @@ -226,8 +226,8 @@ class DiffusionWeightedVolumeMasking(SEMLikeCommandLine): """ - input_spec = DiffusionWeightedVolumeMaskingInputSpec - output_spec = DiffusionWeightedVolumeMaskingOutputSpec + _input_spec = DiffusionWeightedVolumeMaskingInputSpec + _output_spec = DiffusionWeightedVolumeMaskingOutputSpec _cmd = "DiffusionWeightedVolumeMasking " _outputs_filenames = {'outputBaseline': 'outputBaseline.nii', 'thresholdMask': 'thresholdMask.nii'} @@ -259,8 +259,8 @@ class DTIimport(SEMLikeCommandLine): """ - input_spec = DTIimportInputSpec - output_spec = DTIimportOutputSpec + _input_spec = DTIimportInputSpec + _output_spec = DTIimportOutputSpec _cmd = "DTIimport " _outputs_filenames = {'outputTensor': 'outputTensor.nii'} @@ -300,8 +300,8 @@ class DWIToDTIEstimation(SEMLikeCommandLine): """ - input_spec = DWIToDTIEstimationInputSpec - output_spec = DWIToDTIEstimationOutputSpec + _input_spec = DWIToDTIEstimationInputSpec + _output_spec = DWIToDTIEstimationOutputSpec _cmd = "DWIToDTIEstimation " _outputs_filenames = {'outputTensor': 'outputTensor.nii', 'outputBaseline': 'outputBaseline.nii'} @@ -333,8 +333,8 @@ class DiffusionTensorScalarMeasurements(SEMLikeCommandLine): """ - input_spec = DiffusionTensorScalarMeasurementsInputSpec - output_spec = DiffusionTensorScalarMeasurementsOutputSpec + _input_spec = DiffusionTensorScalarMeasurementsInputSpec + _output_spec = DiffusionTensorScalarMeasurementsOutputSpec _cmd = "DiffusionTensorScalarMeasurements " _outputs_filenames = {'outputScalar': 'outputScalar.nii'} @@ -365,7 +365,7 @@ class DTIexport(SEMLikeCommandLine): """ - input_spec = DTIexportInputSpec - output_spec = DTIexportOutputSpec + _input_spec = DTIexportInputSpec + _output_spec = DTIexportOutputSpec _cmd = "DTIexport " _outputs_filenames = {'outputFile': 'outputFile'} diff --git a/nipype/interfaces/slicer/diffusion/tests/test_auto_DTIexport.py b/nipype/interfaces/slicer/diffusion/tests/test_auto_DTIexport.py index 1704c064f6..fcd5ad2682 100644 --- a/nipype/interfaces/slicer/diffusion/tests/test_auto_DTIexport.py +++ b/nipype/interfaces/slicer/diffusion/tests/test_auto_DTIexport.py @@ -22,7 +22,7 @@ def test_DTIexport_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = DTIexport.input_spec() + inputs = DTIexport._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -33,7 +33,7 @@ def test_DTIexport_outputs(): output_map = dict(outputFile=dict(position=-1, ), ) - outputs = DTIexport.output_spec() + outputs = DTIexport._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/diffusion/tests/test_auto_DTIimport.py b/nipype/interfaces/slicer/diffusion/tests/test_auto_DTIimport.py index dab8788688..3f84b0a28d 100644 --- a/nipype/interfaces/slicer/diffusion/tests/test_auto_DTIimport.py +++ b/nipype/interfaces/slicer/diffusion/tests/test_auto_DTIimport.py @@ -24,7 +24,7 @@ def test_DTIimport_inputs(): testingmode=dict(argstr='--testingmode ', ), ) - inputs = DTIimport.input_spec() + inputs = DTIimport._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -35,7 +35,7 @@ def test_DTIimport_outputs(): output_map = dict(outputTensor=dict(position=-1, ), ) - outputs = DTIimport.output_spec() + outputs = DTIimport._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/diffusion/tests/test_auto_DWIJointRicianLMMSEFilter.py b/nipype/interfaces/slicer/diffusion/tests/test_auto_DWIJointRicianLMMSEFilter.py index a5215c65b5..206bf37f6d 100644 --- a/nipype/interfaces/slicer/diffusion/tests/test_auto_DWIJointRicianLMMSEFilter.py +++ b/nipype/interfaces/slicer/diffusion/tests/test_auto_DWIJointRicianLMMSEFilter.py @@ -32,7 +32,7 @@ def test_DWIJointRicianLMMSEFilter_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = DWIJointRicianLMMSEFilter.input_spec() + inputs = DWIJointRicianLMMSEFilter._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -43,7 +43,7 @@ def test_DWIJointRicianLMMSEFilter_outputs(): output_map = dict(outputVolume=dict(position=-1, ), ) - outputs = DWIJointRicianLMMSEFilter.output_spec() + outputs = DWIJointRicianLMMSEFilter._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/diffusion/tests/test_auto_DWIRicianLMMSEFilter.py b/nipype/interfaces/slicer/diffusion/tests/test_auto_DWIRicianLMMSEFilter.py index da2e1d4d07..4d5227048a 100644 --- a/nipype/interfaces/slicer/diffusion/tests/test_auto_DWIRicianLMMSEFilter.py +++ b/nipype/interfaces/slicer/diffusion/tests/test_auto_DWIRicianLMMSEFilter.py @@ -44,7 +44,7 @@ def test_DWIRicianLMMSEFilter_inputs(): uav=dict(argstr='--uav ', ), ) - inputs = DWIRicianLMMSEFilter.input_spec() + inputs = DWIRicianLMMSEFilter._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -55,7 +55,7 @@ def test_DWIRicianLMMSEFilter_outputs(): output_map = dict(outputVolume=dict(position=-1, ), ) - outputs = DWIRicianLMMSEFilter.output_spec() + outputs = DWIRicianLMMSEFilter._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/diffusion/tests/test_auto_DWIToDTIEstimation.py b/nipype/interfaces/slicer/diffusion/tests/test_auto_DWIToDTIEstimation.py index be0f92c092..af075d08c0 100644 --- a/nipype/interfaces/slicer/diffusion/tests/test_auto_DWIToDTIEstimation.py +++ b/nipype/interfaces/slicer/diffusion/tests/test_auto_DWIToDTIEstimation.py @@ -32,7 +32,7 @@ def test_DWIToDTIEstimation_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = DWIToDTIEstimation.input_spec() + inputs = DWIToDTIEstimation._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -45,7 +45,7 @@ def test_DWIToDTIEstimation_outputs(): outputTensor=dict(position=-2, ), ) - outputs = DWIToDTIEstimation.output_spec() + outputs = DWIToDTIEstimation._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/diffusion/tests/test_auto_DiffusionTensorScalarMeasurements.py b/nipype/interfaces/slicer/diffusion/tests/test_auto_DiffusionTensorScalarMeasurements.py index 425800bd41..111c81978d 100644 --- a/nipype/interfaces/slicer/diffusion/tests/test_auto_DiffusionTensorScalarMeasurements.py +++ b/nipype/interfaces/slicer/diffusion/tests/test_auto_DiffusionTensorScalarMeasurements.py @@ -24,7 +24,7 @@ def test_DiffusionTensorScalarMeasurements_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = DiffusionTensorScalarMeasurements.input_spec() + inputs = DiffusionTensorScalarMeasurements._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -35,7 +35,7 @@ def test_DiffusionTensorScalarMeasurements_outputs(): output_map = dict(outputScalar=dict(position=-1, ), ) - outputs = DiffusionTensorScalarMeasurements.output_spec() + outputs = DiffusionTensorScalarMeasurements._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/diffusion/tests/test_auto_DiffusionWeightedVolumeMasking.py b/nipype/interfaces/slicer/diffusion/tests/test_auto_DiffusionWeightedVolumeMasking.py index d325afaf71..b63c1759b4 100644 --- a/nipype/interfaces/slicer/diffusion/tests/test_auto_DiffusionWeightedVolumeMasking.py +++ b/nipype/interfaces/slicer/diffusion/tests/test_auto_DiffusionWeightedVolumeMasking.py @@ -30,7 +30,7 @@ def test_DiffusionWeightedVolumeMasking_inputs(): position=-1, ), ) - inputs = DiffusionWeightedVolumeMasking.input_spec() + inputs = DiffusionWeightedVolumeMasking._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -43,7 +43,7 @@ def test_DiffusionWeightedVolumeMasking_outputs(): thresholdMask=dict(position=-1, ), ) - outputs = DiffusionWeightedVolumeMasking.output_spec() + outputs = DiffusionWeightedVolumeMasking._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/diffusion/tests/test_auto_ResampleDTIVolume.py b/nipype/interfaces/slicer/diffusion/tests/test_auto_ResampleDTIVolume.py index 9f7ded5f1c..fb712a6a82 100644 --- a/nipype/interfaces/slicer/diffusion/tests/test_auto_ResampleDTIVolume.py +++ b/nipype/interfaces/slicer/diffusion/tests/test_auto_ResampleDTIVolume.py @@ -74,7 +74,7 @@ def test_ResampleDTIVolume_inputs(): window_function=dict(argstr='--window_function %s', ), ) - inputs = ResampleDTIVolume.input_spec() + inputs = ResampleDTIVolume._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -85,7 +85,7 @@ def test_ResampleDTIVolume_outputs(): output_map = dict(outputVolume=dict(position=-1, ), ) - outputs = ResampleDTIVolume.output_spec() + outputs = ResampleDTIVolume._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/diffusion/tests/test_auto_TractographyLabelMapSeeding.py b/nipype/interfaces/slicer/diffusion/tests/test_auto_TractographyLabelMapSeeding.py index f368cc2275..c5a6f39bd5 100644 --- a/nipype/interfaces/slicer/diffusion/tests/test_auto_TractographyLabelMapSeeding.py +++ b/nipype/interfaces/slicer/diffusion/tests/test_auto_TractographyLabelMapSeeding.py @@ -53,7 +53,7 @@ def test_TractographyLabelMapSeeding_inputs(): writetofile=dict(argstr='--writetofile ', ), ) - inputs = TractographyLabelMapSeeding.input_spec() + inputs = TractographyLabelMapSeeding._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -65,7 +65,7 @@ def test_TractographyLabelMapSeeding_outputs(): ), outputdirectory=dict(), ) - outputs = TractographyLabelMapSeeding.output_spec() + outputs = TractographyLabelMapSeeding._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/filtering/arithmetic.py b/nipype/interfaces/slicer/filtering/arithmetic.py index cfde7f5d02..9ab44642ab 100644 --- a/nipype/interfaces/slicer/filtering/arithmetic.py +++ b/nipype/interfaces/slicer/filtering/arithmetic.py @@ -34,8 +34,8 @@ class MultiplyScalarVolumes(SEMLikeCommandLine): """ - input_spec = MultiplyScalarVolumesInputSpec - output_spec = MultiplyScalarVolumesOutputSpec + _input_spec = MultiplyScalarVolumesInputSpec + _output_spec = MultiplyScalarVolumesOutputSpec _cmd = "MultiplyScalarVolumes " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} @@ -69,8 +69,8 @@ class MaskScalarVolume(SEMLikeCommandLine): """ - input_spec = MaskScalarVolumeInputSpec - output_spec = MaskScalarVolumeOutputSpec + _input_spec = MaskScalarVolumeInputSpec + _output_spec = MaskScalarVolumeOutputSpec _cmd = "MaskScalarVolume " _outputs_filenames = {'OutputVolume': 'OutputVolume.nii'} @@ -103,8 +103,8 @@ class SubtractScalarVolumes(SEMLikeCommandLine): """ - input_spec = SubtractScalarVolumesInputSpec - output_spec = SubtractScalarVolumesOutputSpec + _input_spec = SubtractScalarVolumesInputSpec + _output_spec = SubtractScalarVolumesOutputSpec _cmd = "SubtractScalarVolumes " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} @@ -137,8 +137,8 @@ class AddScalarVolumes(SEMLikeCommandLine): """ - input_spec = AddScalarVolumesInputSpec - output_spec = AddScalarVolumesOutputSpec + _input_spec = AddScalarVolumesInputSpec + _output_spec = AddScalarVolumesOutputSpec _cmd = "AddScalarVolumes " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} @@ -172,7 +172,7 @@ class CastScalarVolume(SEMLikeCommandLine): """ - input_spec = CastScalarVolumeInputSpec - output_spec = CastScalarVolumeOutputSpec + _input_spec = CastScalarVolumeInputSpec + _output_spec = CastScalarVolumeOutputSpec _cmd = "CastScalarVolume " _outputs_filenames = {'OutputVolume': 'OutputVolume.nii'} diff --git a/nipype/interfaces/slicer/filtering/checkerboardfilter.py b/nipype/interfaces/slicer/filtering/checkerboardfilter.py index 894777bbdf..856cdf9136 100644 --- a/nipype/interfaces/slicer/filtering/checkerboardfilter.py +++ b/nipype/interfaces/slicer/filtering/checkerboardfilter.py @@ -34,7 +34,7 @@ class CheckerBoardFilter(SEMLikeCommandLine): """ - input_spec = CheckerBoardFilterInputSpec - output_spec = CheckerBoardFilterOutputSpec + _input_spec = CheckerBoardFilterInputSpec + _output_spec = CheckerBoardFilterOutputSpec _cmd = "CheckerBoardFilter " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} diff --git a/nipype/interfaces/slicer/filtering/denoising.py b/nipype/interfaces/slicer/filtering/denoising.py index 7c506d4839..769cdade8a 100644 --- a/nipype/interfaces/slicer/filtering/denoising.py +++ b/nipype/interfaces/slicer/filtering/denoising.py @@ -37,8 +37,8 @@ class GradientAnisotropicDiffusion(SEMLikeCommandLine): """ - input_spec = GradientAnisotropicDiffusionInputSpec - output_spec = GradientAnisotropicDiffusionOutputSpec + _input_spec = GradientAnisotropicDiffusionInputSpec + _output_spec = GradientAnisotropicDiffusionOutputSpec _cmd = "GradientAnisotropicDiffusion " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} @@ -76,8 +76,8 @@ class CurvatureAnisotropicDiffusion(SEMLikeCommandLine): """ - input_spec = CurvatureAnisotropicDiffusionInputSpec - output_spec = CurvatureAnisotropicDiffusionOutputSpec + _input_spec = CurvatureAnisotropicDiffusionInputSpec + _output_spec = CurvatureAnisotropicDiffusionOutputSpec _cmd = "CurvatureAnisotropicDiffusion " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} @@ -109,8 +109,8 @@ class GaussianBlurImageFilter(SEMLikeCommandLine): """ - input_spec = GaussianBlurImageFilterInputSpec - output_spec = GaussianBlurImageFilterOutputSpec + _input_spec = GaussianBlurImageFilterInputSpec + _output_spec = GaussianBlurImageFilterOutputSpec _cmd = "GaussianBlurImageFilter " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} @@ -142,7 +142,7 @@ class MedianImageFilter(SEMLikeCommandLine): """ - input_spec = MedianImageFilterInputSpec - output_spec = MedianImageFilterOutputSpec + _input_spec = MedianImageFilterInputSpec + _output_spec = MedianImageFilterOutputSpec _cmd = "MedianImageFilter " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} diff --git a/nipype/interfaces/slicer/filtering/extractskeleton.py b/nipype/interfaces/slicer/filtering/extractskeleton.py index 0c516850db..bc7e9bdaf2 100644 --- a/nipype/interfaces/slicer/filtering/extractskeleton.py +++ b/nipype/interfaces/slicer/filtering/extractskeleton.py @@ -36,7 +36,7 @@ class ExtractSkeleton(SEMLikeCommandLine): """ - input_spec = ExtractSkeletonInputSpec - output_spec = ExtractSkeletonOutputSpec + _input_spec = ExtractSkeletonInputSpec + _output_spec = ExtractSkeletonOutputSpec _cmd = "ExtractSkeleton " _outputs_filenames = {'OutputImageFileName': 'OutputImageFileName.nii'} diff --git a/nipype/interfaces/slicer/filtering/histogrammatching.py b/nipype/interfaces/slicer/filtering/histogrammatching.py index beaeb044bc..8c5e513109 100644 --- a/nipype/interfaces/slicer/filtering/histogrammatching.py +++ b/nipype/interfaces/slicer/filtering/histogrammatching.py @@ -42,7 +42,7 @@ class HistogramMatching(SEMLikeCommandLine): """ - input_spec = HistogramMatchingInputSpec - output_spec = HistogramMatchingOutputSpec + _input_spec = HistogramMatchingInputSpec + _output_spec = HistogramMatchingOutputSpec _cmd = "HistogramMatching " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} diff --git a/nipype/interfaces/slicer/filtering/imagelabelcombine.py b/nipype/interfaces/slicer/filtering/imagelabelcombine.py index 36611de864..d3bc919baa 100644 --- a/nipype/interfaces/slicer/filtering/imagelabelcombine.py +++ b/nipype/interfaces/slicer/filtering/imagelabelcombine.py @@ -32,7 +32,7 @@ class ImageLabelCombine(SEMLikeCommandLine): """ - input_spec = ImageLabelCombineInputSpec - output_spec = ImageLabelCombineOutputSpec + _input_spec = ImageLabelCombineInputSpec + _output_spec = ImageLabelCombineOutputSpec _cmd = "ImageLabelCombine " _outputs_filenames = {'OutputLabelMap': 'OutputLabelMap.nii'} diff --git a/nipype/interfaces/slicer/filtering/morphology.py b/nipype/interfaces/slicer/filtering/morphology.py index 7214828d95..93451b8be0 100644 --- a/nipype/interfaces/slicer/filtering/morphology.py +++ b/nipype/interfaces/slicer/filtering/morphology.py @@ -42,8 +42,8 @@ class GrayscaleGrindPeakImageFilter(SEMLikeCommandLine): """ - input_spec = GrayscaleGrindPeakImageFilterInputSpec - output_spec = GrayscaleGrindPeakImageFilterOutputSpec + _input_spec = GrayscaleGrindPeakImageFilterInputSpec + _output_spec = GrayscaleGrindPeakImageFilterOutputSpec _cmd = "GrayscaleGrindPeakImageFilter " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} @@ -82,7 +82,7 @@ class GrayscaleFillHoleImageFilter(SEMLikeCommandLine): """ - input_spec = GrayscaleFillHoleImageFilterInputSpec - output_spec = GrayscaleFillHoleImageFilterOutputSpec + _input_spec = GrayscaleFillHoleImageFilterInputSpec + _output_spec = GrayscaleFillHoleImageFilterOutputSpec _cmd = "GrayscaleFillHoleImageFilter " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} diff --git a/nipype/interfaces/slicer/filtering/n4itkbiasfieldcorrection.py b/nipype/interfaces/slicer/filtering/n4itkbiasfieldcorrection.py index b56d4d3af2..4d88ea9232 100644 --- a/nipype/interfaces/slicer/filtering/n4itkbiasfieldcorrection.py +++ b/nipype/interfaces/slicer/filtering/n4itkbiasfieldcorrection.py @@ -43,7 +43,7 @@ class N4ITKBiasFieldCorrection(SEMLikeCommandLine): """ - input_spec = N4ITKBiasFieldCorrectionInputSpec - output_spec = N4ITKBiasFieldCorrectionOutputSpec + _input_spec = N4ITKBiasFieldCorrectionInputSpec + _output_spec = N4ITKBiasFieldCorrectionOutputSpec _cmd = "N4ITKBiasFieldCorrection " _outputs_filenames = {'outputimage': 'outputimage.nii', 'outputbiasfield': 'outputbiasfield.nii'} diff --git a/nipype/interfaces/slicer/filtering/resamplescalarvectordwivolume.py b/nipype/interfaces/slicer/filtering/resamplescalarvectordwivolume.py index b90694118f..1bb4ab7aff 100644 --- a/nipype/interfaces/slicer/filtering/resamplescalarvectordwivolume.py +++ b/nipype/interfaces/slicer/filtering/resamplescalarvectordwivolume.py @@ -58,7 +58,7 @@ class ResampleScalarVectorDWIVolume(SEMLikeCommandLine): """ - input_spec = ResampleScalarVectorDWIVolumeInputSpec - output_spec = ResampleScalarVectorDWIVolumeOutputSpec + _input_spec = ResampleScalarVectorDWIVolumeInputSpec + _output_spec = ResampleScalarVectorDWIVolumeOutputSpec _cmd = "ResampleScalarVectorDWIVolume " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_AddScalarVolumes.py b/nipype/interfaces/slicer/filtering/tests/test_auto_AddScalarVolumes.py index 1b196c557a..70970d6c79 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_AddScalarVolumes.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_AddScalarVolumes.py @@ -27,7 +27,7 @@ def test_AddScalarVolumes_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = AddScalarVolumes.input_spec() + inputs = AddScalarVolumes._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -38,7 +38,7 @@ def test_AddScalarVolumes_outputs(): output_map = dict(outputVolume=dict(position=-1, ), ) - outputs = AddScalarVolumes.output_spec() + outputs = AddScalarVolumes._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_CastScalarVolume.py b/nipype/interfaces/slicer/filtering/tests/test_auto_CastScalarVolume.py index b24be436f8..6011d09351 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_CastScalarVolume.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_CastScalarVolume.py @@ -24,7 +24,7 @@ def test_CastScalarVolume_inputs(): type=dict(argstr='--type %s', ), ) - inputs = CastScalarVolume.input_spec() + inputs = CastScalarVolume._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -35,7 +35,7 @@ def test_CastScalarVolume_outputs(): output_map = dict(OutputVolume=dict(position=-1, ), ) - outputs = CastScalarVolume.output_spec() + outputs = CastScalarVolume._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_CheckerBoardFilter.py b/nipype/interfaces/slicer/filtering/tests/test_auto_CheckerBoardFilter.py index 2ddf46c861..bb42406c75 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_CheckerBoardFilter.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_CheckerBoardFilter.py @@ -28,7 +28,7 @@ def test_CheckerBoardFilter_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = CheckerBoardFilter.input_spec() + inputs = CheckerBoardFilter._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -39,7 +39,7 @@ def test_CheckerBoardFilter_outputs(): output_map = dict(outputVolume=dict(position=-1, ), ) - outputs = CheckerBoardFilter.output_spec() + outputs = CheckerBoardFilter._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_CurvatureAnisotropicDiffusion.py b/nipype/interfaces/slicer/filtering/tests/test_auto_CurvatureAnisotropicDiffusion.py index c31af700d5..46367ab986 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_CurvatureAnisotropicDiffusion.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_CurvatureAnisotropicDiffusion.py @@ -28,7 +28,7 @@ def test_CurvatureAnisotropicDiffusion_inputs(): timeStep=dict(argstr='--timeStep %f', ), ) - inputs = CurvatureAnisotropicDiffusion.input_spec() + inputs = CurvatureAnisotropicDiffusion._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -39,7 +39,7 @@ def test_CurvatureAnisotropicDiffusion_outputs(): output_map = dict(outputVolume=dict(position=-1, ), ) - outputs = CurvatureAnisotropicDiffusion.output_spec() + outputs = CurvatureAnisotropicDiffusion._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_ExtractSkeleton.py b/nipype/interfaces/slicer/filtering/tests/test_auto_ExtractSkeleton.py index 05b71f76ec..de7eb87a1b 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_ExtractSkeleton.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_ExtractSkeleton.py @@ -30,7 +30,7 @@ def test_ExtractSkeleton_inputs(): type=dict(argstr='--type %s', ), ) - inputs = ExtractSkeleton.input_spec() + inputs = ExtractSkeleton._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -41,7 +41,7 @@ def test_ExtractSkeleton_outputs(): output_map = dict(OutputImageFileName=dict(position=-1, ), ) - outputs = ExtractSkeleton.output_spec() + outputs = ExtractSkeleton._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_GaussianBlurImageFilter.py b/nipype/interfaces/slicer/filtering/tests/test_auto_GaussianBlurImageFilter.py index d5b2d21589..2c32d58f72 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_GaussianBlurImageFilter.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_GaussianBlurImageFilter.py @@ -24,7 +24,7 @@ def test_GaussianBlurImageFilter_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = GaussianBlurImageFilter.input_spec() + inputs = GaussianBlurImageFilter._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -35,7 +35,7 @@ def test_GaussianBlurImageFilter_outputs(): output_map = dict(outputVolume=dict(position=-1, ), ) - outputs = GaussianBlurImageFilter.output_spec() + outputs = GaussianBlurImageFilter._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_GradientAnisotropicDiffusion.py b/nipype/interfaces/slicer/filtering/tests/test_auto_GradientAnisotropicDiffusion.py index c5874901c8..9416e18b94 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_GradientAnisotropicDiffusion.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_GradientAnisotropicDiffusion.py @@ -28,7 +28,7 @@ def test_GradientAnisotropicDiffusion_inputs(): timeStep=dict(argstr='--timeStep %f', ), ) - inputs = GradientAnisotropicDiffusion.input_spec() + inputs = GradientAnisotropicDiffusion._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -39,7 +39,7 @@ def test_GradientAnisotropicDiffusion_outputs(): output_map = dict(outputVolume=dict(position=-1, ), ) - outputs = GradientAnisotropicDiffusion.output_spec() + outputs = GradientAnisotropicDiffusion._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_GrayscaleFillHoleImageFilter.py b/nipype/interfaces/slicer/filtering/tests/test_auto_GrayscaleFillHoleImageFilter.py index 794f2833ee..c1e0247e3a 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_GrayscaleFillHoleImageFilter.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_GrayscaleFillHoleImageFilter.py @@ -22,7 +22,7 @@ def test_GrayscaleFillHoleImageFilter_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = GrayscaleFillHoleImageFilter.input_spec() + inputs = GrayscaleFillHoleImageFilter._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -33,7 +33,7 @@ def test_GrayscaleFillHoleImageFilter_outputs(): output_map = dict(outputVolume=dict(position=-1, ), ) - outputs = GrayscaleFillHoleImageFilter.output_spec() + outputs = GrayscaleFillHoleImageFilter._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_GrayscaleGrindPeakImageFilter.py b/nipype/interfaces/slicer/filtering/tests/test_auto_GrayscaleGrindPeakImageFilter.py index 3bcfd4145c..11751b5c83 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_GrayscaleGrindPeakImageFilter.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_GrayscaleGrindPeakImageFilter.py @@ -22,7 +22,7 @@ def test_GrayscaleGrindPeakImageFilter_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = GrayscaleGrindPeakImageFilter.input_spec() + inputs = GrayscaleGrindPeakImageFilter._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -33,7 +33,7 @@ def test_GrayscaleGrindPeakImageFilter_outputs(): output_map = dict(outputVolume=dict(position=-1, ), ) - outputs = GrayscaleGrindPeakImageFilter.output_spec() + outputs = GrayscaleGrindPeakImageFilter._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_HistogramMatching.py b/nipype/interfaces/slicer/filtering/tests/test_auto_HistogramMatching.py index 2d4e23c33e..f08e2400c0 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_HistogramMatching.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_HistogramMatching.py @@ -31,7 +31,7 @@ def test_HistogramMatching_inputs(): threshold=dict(argstr='--threshold ', ), ) - inputs = HistogramMatching.input_spec() + inputs = HistogramMatching._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -42,7 +42,7 @@ def test_HistogramMatching_outputs(): output_map = dict(outputVolume=dict(position=-1, ), ) - outputs = HistogramMatching.output_spec() + outputs = HistogramMatching._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_ImageLabelCombine.py b/nipype/interfaces/slicer/filtering/tests/test_auto_ImageLabelCombine.py index a02b922e86..7bab8726c5 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_ImageLabelCombine.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_ImageLabelCombine.py @@ -27,7 +27,7 @@ def test_ImageLabelCombine_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ImageLabelCombine.input_spec() + inputs = ImageLabelCombine._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -38,7 +38,7 @@ def test_ImageLabelCombine_outputs(): output_map = dict(OutputLabelMap=dict(position=-1, ), ) - outputs = ImageLabelCombine.output_spec() + outputs = ImageLabelCombine._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_MaskScalarVolume.py b/nipype/interfaces/slicer/filtering/tests/test_auto_MaskScalarVolume.py index a627bae20e..04fc4e0823 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_MaskScalarVolume.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_MaskScalarVolume.py @@ -29,7 +29,7 @@ def test_MaskScalarVolume_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = MaskScalarVolume.input_spec() + inputs = MaskScalarVolume._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -40,7 +40,7 @@ def test_MaskScalarVolume_outputs(): output_map = dict(OutputVolume=dict(position=-1, ), ) - outputs = MaskScalarVolume.output_spec() + outputs = MaskScalarVolume._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_MedianImageFilter.py b/nipype/interfaces/slicer/filtering/tests/test_auto_MedianImageFilter.py index d8f3489fcd..6f43ff183f 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_MedianImageFilter.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_MedianImageFilter.py @@ -25,7 +25,7 @@ def test_MedianImageFilter_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = MedianImageFilter.input_spec() + inputs = MedianImageFilter._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -36,7 +36,7 @@ def test_MedianImageFilter_outputs(): output_map = dict(outputVolume=dict(position=-1, ), ) - outputs = MedianImageFilter.output_spec() + outputs = MedianImageFilter._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_MultiplyScalarVolumes.py b/nipype/interfaces/slicer/filtering/tests/test_auto_MultiplyScalarVolumes.py index d1038d8001..2342105bc8 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_MultiplyScalarVolumes.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_MultiplyScalarVolumes.py @@ -27,7 +27,7 @@ def test_MultiplyScalarVolumes_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = MultiplyScalarVolumes.input_spec() + inputs = MultiplyScalarVolumes._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -38,7 +38,7 @@ def test_MultiplyScalarVolumes_outputs(): output_map = dict(outputVolume=dict(position=-1, ), ) - outputs = MultiplyScalarVolumes.output_spec() + outputs = MultiplyScalarVolumes._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_N4ITKBiasFieldCorrection.py b/nipype/interfaces/slicer/filtering/tests/test_auto_N4ITKBiasFieldCorrection.py index 9e1b7df801..299a42f058 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_N4ITKBiasFieldCorrection.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_N4ITKBiasFieldCorrection.py @@ -44,7 +44,7 @@ def test_N4ITKBiasFieldCorrection_inputs(): weightimage=dict(argstr='--weightimage %s', ), ) - inputs = N4ITKBiasFieldCorrection.input_spec() + inputs = N4ITKBiasFieldCorrection._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -55,7 +55,7 @@ def test_N4ITKBiasFieldCorrection_outputs(): output_map = dict(outputbiasfield=dict(), outputimage=dict(), ) - outputs = N4ITKBiasFieldCorrection.output_spec() + outputs = N4ITKBiasFieldCorrection._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_ResampleScalarVectorDWIVolume.py b/nipype/interfaces/slicer/filtering/tests/test_auto_ResampleScalarVectorDWIVolume.py index 363dfe4747..4edbf65353 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_ResampleScalarVectorDWIVolume.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_ResampleScalarVectorDWIVolume.py @@ -70,7 +70,7 @@ def test_ResampleScalarVectorDWIVolume_inputs(): window_function=dict(argstr='--window_function %s', ), ) - inputs = ResampleScalarVectorDWIVolume.input_spec() + inputs = ResampleScalarVectorDWIVolume._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -81,7 +81,7 @@ def test_ResampleScalarVectorDWIVolume_outputs(): output_map = dict(outputVolume=dict(position=-1, ), ) - outputs = ResampleScalarVectorDWIVolume.output_spec() + outputs = ResampleScalarVectorDWIVolume._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_SubtractScalarVolumes.py b/nipype/interfaces/slicer/filtering/tests/test_auto_SubtractScalarVolumes.py index c95b4de042..7085c0aef0 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_SubtractScalarVolumes.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_SubtractScalarVolumes.py @@ -27,7 +27,7 @@ def test_SubtractScalarVolumes_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = SubtractScalarVolumes.input_spec() + inputs = SubtractScalarVolumes._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -38,7 +38,7 @@ def test_SubtractScalarVolumes_outputs(): output_map = dict(outputVolume=dict(position=-1, ), ) - outputs = SubtractScalarVolumes.output_spec() + outputs = SubtractScalarVolumes._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_ThresholdScalarVolume.py b/nipype/interfaces/slicer/filtering/tests/test_auto_ThresholdScalarVolume.py index a4f6d0f64a..481856a1bd 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_ThresholdScalarVolume.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_ThresholdScalarVolume.py @@ -32,7 +32,7 @@ def test_ThresholdScalarVolume_inputs(): upper=dict(argstr='--upper %d', ), ) - inputs = ThresholdScalarVolume.input_spec() + inputs = ThresholdScalarVolume._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -43,7 +43,7 @@ def test_ThresholdScalarVolume_outputs(): output_map = dict(OutputVolume=dict(position=-1, ), ) - outputs = ThresholdScalarVolume.output_spec() + outputs = ThresholdScalarVolume._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_VotingBinaryHoleFillingImageFilter.py b/nipype/interfaces/slicer/filtering/tests/test_auto_VotingBinaryHoleFillingImageFilter.py index 5c213925e0..07a9b65939 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_VotingBinaryHoleFillingImageFilter.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_VotingBinaryHoleFillingImageFilter.py @@ -31,7 +31,7 @@ def test_VotingBinaryHoleFillingImageFilter_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = VotingBinaryHoleFillingImageFilter.input_spec() + inputs = VotingBinaryHoleFillingImageFilter._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -42,7 +42,7 @@ def test_VotingBinaryHoleFillingImageFilter_outputs(): output_map = dict(outputVolume=dict(position=-1, ), ) - outputs = VotingBinaryHoleFillingImageFilter.output_spec() + outputs = VotingBinaryHoleFillingImageFilter._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/filtering/thresholdscalarvolume.py b/nipype/interfaces/slicer/filtering/thresholdscalarvolume.py index 63e7e5a7b7..0c045b56f7 100644 --- a/nipype/interfaces/slicer/filtering/thresholdscalarvolume.py +++ b/nipype/interfaces/slicer/filtering/thresholdscalarvolume.py @@ -37,7 +37,7 @@ class ThresholdScalarVolume(SEMLikeCommandLine): """ - input_spec = ThresholdScalarVolumeInputSpec - output_spec = ThresholdScalarVolumeOutputSpec + _input_spec = ThresholdScalarVolumeInputSpec + _output_spec = ThresholdScalarVolumeOutputSpec _cmd = "ThresholdScalarVolume " _outputs_filenames = {'OutputVolume': 'OutputVolume.nii'} diff --git a/nipype/interfaces/slicer/filtering/votingbinaryholefillingimagefilter.py b/nipype/interfaces/slicer/filtering/votingbinaryholefillingimagefilter.py index 5dd42d9437..829956e8f1 100644 --- a/nipype/interfaces/slicer/filtering/votingbinaryholefillingimagefilter.py +++ b/nipype/interfaces/slicer/filtering/votingbinaryholefillingimagefilter.py @@ -36,7 +36,7 @@ class VotingBinaryHoleFillingImageFilter(SEMLikeCommandLine): """ - input_spec = VotingBinaryHoleFillingImageFilterInputSpec - output_spec = VotingBinaryHoleFillingImageFilterOutputSpec + _input_spec = VotingBinaryHoleFillingImageFilterInputSpec + _output_spec = VotingBinaryHoleFillingImageFilterOutputSpec _cmd = "VotingBinaryHoleFillingImageFilter " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} diff --git a/nipype/interfaces/slicer/generate_classes.py b/nipype/interfaces/slicer/generate_classes.py index 46b85af86a..7843a21f07 100644 --- a/nipype/interfaces/slicer/generate_classes.py +++ b/nipype/interfaces/slicer/generate_classes.py @@ -281,37 +281,37 @@ def generate_class(module, launcher, strip_module_name_prefix=True, redirect_x=F 'xMaxProcess = traits.Int(1, desc="Set default maximum number of processes.", argstr="-xMaxProcess %d", usedefault=True)'] inputTraits += compulsory_inputs - input_spec_code = "class " + module_name + "InputSpec(CommandLineInputSpec):\n" + _input_spec_code = "class " + module_name + "InputSpec(CommandLineInputSpec):\n" for trait in inputTraits: - input_spec_code += " " + trait + "\n" + _input_spec_code += " " + trait + "\n" - output_spec_code = "class " + module_name + "OutputSpec(TraitedSpec):\n" + _output_spec_code = "class " + module_name + "OutputSpec(TraitedSpec):\n" if not outputTraits: - output_spec_code += " pass\n" + _output_spec_code += " pass\n" else: for trait in outputTraits: - output_spec_code += " " + trait + "\n" + _output_spec_code += " " + trait + "\n" output_filenames_code = "_outputs_filenames = {" output_filenames_code += ",".join(["'%s':'%s'" % ( key, value) for key, value in outputs_filenames.items()]) output_filenames_code += "}" - input_spec_code += "\n\n" - output_spec_code += "\n\n" + _input_spec_code += "\n\n" + _output_spec_code += "\n\n" template = """class %module_name%(SEMLikeCommandLine): %class_str% - input_spec = %module_name%InputSpec - output_spec = %module_name%OutputSpec + _input_spec = %module_name%InputSpec + _output_spec = %module_name%OutputSpec _cmd = "%launcher% %name% " %output_filenames_code%\n""" template += " _redirect_x = {0}\n".format(str(redirect_x)) main_class = template.replace('%class_str%', class_string).replace("%module_name%", module_name).replace("%name%", module).replace("%output_filenames_code%", output_filenames_code).replace("%launcher%", " ".join(launcher)) - return category, input_spec_code + output_spec_code + main_class, module_name + return category, _input_spec_code + _output_spec_code + main_class, module_name def grab_xml(module, launcher, mipav_hacks=False): diff --git a/nipype/interfaces/slicer/legacy/converters.py b/nipype/interfaces/slicer/legacy/converters.py index fd1817c06f..84b70cbd65 100644 --- a/nipype/interfaces/slicer/legacy/converters.py +++ b/nipype/interfaces/slicer/legacy/converters.py @@ -33,7 +33,7 @@ class BSplineToDeformationField(SEMLikeCommandLine): """ - input_spec = BSplineToDeformationFieldInputSpec - output_spec = BSplineToDeformationFieldOutputSpec + _input_spec = BSplineToDeformationFieldInputSpec + _output_spec = BSplineToDeformationFieldOutputSpec _cmd = "BSplineToDeformationField " _outputs_filenames = {'defImage': 'defImage.nii'} diff --git a/nipype/interfaces/slicer/legacy/diffusion/denoising.py b/nipype/interfaces/slicer/legacy/diffusion/denoising.py index bbec5f7d9b..4c2da7d88a 100644 --- a/nipype/interfaces/slicer/legacy/diffusion/denoising.py +++ b/nipype/interfaces/slicer/legacy/diffusion/denoising.py @@ -41,7 +41,7 @@ class DWIUnbiasedNonLocalMeansFilter(SEMLikeCommandLine): """ - input_spec = DWIUnbiasedNonLocalMeansFilterInputSpec - output_spec = DWIUnbiasedNonLocalMeansFilterOutputSpec + _input_spec = DWIUnbiasedNonLocalMeansFilterInputSpec + _output_spec = DWIUnbiasedNonLocalMeansFilterOutputSpec _cmd = "DWIUnbiasedNonLocalMeansFilter " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} diff --git a/nipype/interfaces/slicer/legacy/diffusion/tests/test_auto_DWIUnbiasedNonLocalMeansFilter.py b/nipype/interfaces/slicer/legacy/diffusion/tests/test_auto_DWIUnbiasedNonLocalMeansFilter.py index 3f9c41c416..6ac11f68f2 100644 --- a/nipype/interfaces/slicer/legacy/diffusion/tests/test_auto_DWIUnbiasedNonLocalMeansFilter.py +++ b/nipype/interfaces/slicer/legacy/diffusion/tests/test_auto_DWIUnbiasedNonLocalMeansFilter.py @@ -35,7 +35,7 @@ def test_DWIUnbiasedNonLocalMeansFilter_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = DWIUnbiasedNonLocalMeansFilter.input_spec() + inputs = DWIUnbiasedNonLocalMeansFilter._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -46,7 +46,7 @@ def test_DWIUnbiasedNonLocalMeansFilter_outputs(): output_map = dict(outputVolume=dict(position=-1, ), ) - outputs = DWIUnbiasedNonLocalMeansFilter.output_spec() + outputs = DWIUnbiasedNonLocalMeansFilter._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/legacy/filtering.py b/nipype/interfaces/slicer/legacy/filtering.py index b6684d2d64..930f655d0f 100644 --- a/nipype/interfaces/slicer/legacy/filtering.py +++ b/nipype/interfaces/slicer/legacy/filtering.py @@ -39,8 +39,8 @@ class OtsuThresholdImageFilter(SEMLikeCommandLine): """ - input_spec = OtsuThresholdImageFilterInputSpec - output_spec = OtsuThresholdImageFilterOutputSpec + _input_spec = OtsuThresholdImageFilterInputSpec + _output_spec = OtsuThresholdImageFilterOutputSpec _cmd = "OtsuThresholdImageFilter " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} @@ -73,7 +73,7 @@ class ResampleScalarVolume(SEMLikeCommandLine): """ - input_spec = ResampleScalarVolumeInputSpec - output_spec = ResampleScalarVolumeOutputSpec + _input_spec = ResampleScalarVolumeInputSpec + _output_spec = ResampleScalarVolumeOutputSpec _cmd = "ResampleScalarVolume " _outputs_filenames = {'OutputVolume': 'OutputVolume.nii'} diff --git a/nipype/interfaces/slicer/legacy/registration.py b/nipype/interfaces/slicer/legacy/registration.py index 5ba5baf3f5..41005f2c2f 100644 --- a/nipype/interfaces/slicer/legacy/registration.py +++ b/nipype/interfaces/slicer/legacy/registration.py @@ -45,8 +45,8 @@ class BSplineDeformableRegistration(SEMLikeCommandLine): """ - input_spec = BSplineDeformableRegistrationInputSpec - output_spec = BSplineDeformableRegistrationOutputSpec + _input_spec = BSplineDeformableRegistrationInputSpec + _output_spec = BSplineDeformableRegistrationOutputSpec _cmd = "BSplineDeformableRegistration " _outputs_filenames = {'resampledmovingfilename': 'resampledmovingfilename.nii', 'outputtransform': 'outputtransform.txt', 'outputwarp': 'outputwarp.nrrd'} @@ -93,8 +93,8 @@ class AffineRegistration(SEMLikeCommandLine): """ - input_spec = AffineRegistrationInputSpec - output_spec = AffineRegistrationOutputSpec + _input_spec = AffineRegistrationInputSpec + _output_spec = AffineRegistrationOutputSpec _cmd = "AffineRegistration " _outputs_filenames = {'resampledmovingfilename': 'resampledmovingfilename.nii', 'outputtransform': 'outputtransform.txt'} @@ -135,8 +135,8 @@ class MultiResolutionAffineRegistration(SEMLikeCommandLine): """ - input_spec = MultiResolutionAffineRegistrationInputSpec - output_spec = MultiResolutionAffineRegistrationOutputSpec + _input_spec = MultiResolutionAffineRegistrationInputSpec + _output_spec = MultiResolutionAffineRegistrationOutputSpec _cmd = "MultiResolutionAffineRegistration " _outputs_filenames = {'resampledImage': 'resampledImage.nii', 'saveTransform': 'saveTransform.txt'} @@ -189,8 +189,8 @@ class RigidRegistration(SEMLikeCommandLine): """ - input_spec = RigidRegistrationInputSpec - output_spec = RigidRegistrationOutputSpec + _input_spec = RigidRegistrationInputSpec + _output_spec = RigidRegistrationOutputSpec _cmd = "RigidRegistration " _outputs_filenames = {'resampledmovingfilename': 'resampledmovingfilename.nii', 'outputtransform': 'outputtransform.txt'} @@ -232,8 +232,8 @@ class LinearRegistration(SEMLikeCommandLine): """ - input_spec = LinearRegistrationInputSpec - output_spec = LinearRegistrationOutputSpec + _input_spec = LinearRegistrationInputSpec + _output_spec = LinearRegistrationOutputSpec _cmd = "LinearRegistration " _outputs_filenames = {'resampledmovingfilename': 'resampledmovingfilename.nii', 'outputtransform': 'outputtransform.txt'} @@ -291,7 +291,7 @@ class ExpertAutomatedRegistration(SEMLikeCommandLine): """ - input_spec = ExpertAutomatedRegistrationInputSpec - output_spec = ExpertAutomatedRegistrationOutputSpec + _input_spec = ExpertAutomatedRegistrationInputSpec + _output_spec = ExpertAutomatedRegistrationOutputSpec _cmd = "ExpertAutomatedRegistration " _outputs_filenames = {'resampledImage': 'resampledImage.nii', 'saveTransform': 'saveTransform.txt'} diff --git a/nipype/interfaces/slicer/legacy/segmentation.py b/nipype/interfaces/slicer/legacy/segmentation.py index af724c9f96..dc85fcaaac 100644 --- a/nipype/interfaces/slicer/legacy/segmentation.py +++ b/nipype/interfaces/slicer/legacy/segmentation.py @@ -36,7 +36,7 @@ class OtsuThresholdSegmentation(SEMLikeCommandLine): """ - input_spec = OtsuThresholdSegmentationInputSpec - output_spec = OtsuThresholdSegmentationOutputSpec + _input_spec = OtsuThresholdSegmentationInputSpec + _output_spec = OtsuThresholdSegmentationOutputSpec _cmd = "OtsuThresholdSegmentation " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} diff --git a/nipype/interfaces/slicer/legacy/tests/test_auto_AffineRegistration.py b/nipype/interfaces/slicer/legacy/tests/test_auto_AffineRegistration.py index bb46ea5f58..f745a3d3ce 100644 --- a/nipype/interfaces/slicer/legacy/tests/test_auto_AffineRegistration.py +++ b/nipype/interfaces/slicer/legacy/tests/test_auto_AffineRegistration.py @@ -41,7 +41,7 @@ def test_AffineRegistration_inputs(): translationscale=dict(argstr='--translationscale %f', ), ) - inputs = AffineRegistration.input_spec() + inputs = AffineRegistration._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -52,7 +52,7 @@ def test_AffineRegistration_outputs(): output_map = dict(outputtransform=dict(), resampledmovingfilename=dict(), ) - outputs = AffineRegistration.output_spec() + outputs = AffineRegistration._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/legacy/tests/test_auto_BSplineDeformableRegistration.py b/nipype/interfaces/slicer/legacy/tests/test_auto_BSplineDeformableRegistration.py index 761a605c75..3e1ac64655 100644 --- a/nipype/interfaces/slicer/legacy/tests/test_auto_BSplineDeformableRegistration.py +++ b/nipype/interfaces/slicer/legacy/tests/test_auto_BSplineDeformableRegistration.py @@ -46,7 +46,7 @@ def test_BSplineDeformableRegistration_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = BSplineDeformableRegistration.input_spec() + inputs = BSplineDeformableRegistration._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -58,7 +58,7 @@ def test_BSplineDeformableRegistration_outputs(): outputwarp=dict(), resampledmovingfilename=dict(), ) - outputs = BSplineDeformableRegistration.output_spec() + outputs = BSplineDeformableRegistration._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/legacy/tests/test_auto_BSplineToDeformationField.py b/nipype/interfaces/slicer/legacy/tests/test_auto_BSplineToDeformationField.py index 84173d2341..a8f1508c66 100644 --- a/nipype/interfaces/slicer/legacy/tests/test_auto_BSplineToDeformationField.py +++ b/nipype/interfaces/slicer/legacy/tests/test_auto_BSplineToDeformationField.py @@ -22,7 +22,7 @@ def test_BSplineToDeformationField_inputs(): tfm=dict(argstr='--tfm %s', ), ) - inputs = BSplineToDeformationField.input_spec() + inputs = BSplineToDeformationField._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -32,7 +32,7 @@ def test_BSplineToDeformationField_inputs(): def test_BSplineToDeformationField_outputs(): output_map = dict(defImage=dict(), ) - outputs = BSplineToDeformationField.output_spec() + outputs = BSplineToDeformationField._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/legacy/tests/test_auto_ExpertAutomatedRegistration.py b/nipype/interfaces/slicer/legacy/tests/test_auto_ExpertAutomatedRegistration.py index e0e4c5d7eb..a9004ecdd7 100644 --- a/nipype/interfaces/slicer/legacy/tests/test_auto_ExpertAutomatedRegistration.py +++ b/nipype/interfaces/slicer/legacy/tests/test_auto_ExpertAutomatedRegistration.py @@ -75,7 +75,7 @@ def test_ExpertAutomatedRegistration_inputs(): verbosityLevel=dict(argstr='--verbosityLevel %s', ), ) - inputs = ExpertAutomatedRegistration.input_spec() + inputs = ExpertAutomatedRegistration._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -86,7 +86,7 @@ def test_ExpertAutomatedRegistration_outputs(): output_map = dict(resampledImage=dict(), saveTransform=dict(), ) - outputs = ExpertAutomatedRegistration.output_spec() + outputs = ExpertAutomatedRegistration._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/legacy/tests/test_auto_LinearRegistration.py b/nipype/interfaces/slicer/legacy/tests/test_auto_LinearRegistration.py index 2945019abe..5fbb385b92 100644 --- a/nipype/interfaces/slicer/legacy/tests/test_auto_LinearRegistration.py +++ b/nipype/interfaces/slicer/legacy/tests/test_auto_LinearRegistration.py @@ -45,7 +45,7 @@ def test_LinearRegistration_inputs(): translationscale=dict(argstr='--translationscale %f', ), ) - inputs = LinearRegistration.input_spec() + inputs = LinearRegistration._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -56,7 +56,7 @@ def test_LinearRegistration_outputs(): output_map = dict(outputtransform=dict(), resampledmovingfilename=dict(), ) - outputs = LinearRegistration.output_spec() + outputs = LinearRegistration._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/legacy/tests/test_auto_MultiResolutionAffineRegistration.py b/nipype/interfaces/slicer/legacy/tests/test_auto_MultiResolutionAffineRegistration.py index b8ea765938..87d08c4375 100644 --- a/nipype/interfaces/slicer/legacy/tests/test_auto_MultiResolutionAffineRegistration.py +++ b/nipype/interfaces/slicer/legacy/tests/test_auto_MultiResolutionAffineRegistration.py @@ -41,7 +41,7 @@ def test_MultiResolutionAffineRegistration_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = MultiResolutionAffineRegistration.input_spec() + inputs = MultiResolutionAffineRegistration._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -52,7 +52,7 @@ def test_MultiResolutionAffineRegistration_outputs(): output_map = dict(resampledImage=dict(), saveTransform=dict(), ) - outputs = MultiResolutionAffineRegistration.output_spec() + outputs = MultiResolutionAffineRegistration._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/legacy/tests/test_auto_OtsuThresholdImageFilter.py b/nipype/interfaces/slicer/legacy/tests/test_auto_OtsuThresholdImageFilter.py index 0f4c9e3050..5053c3933b 100644 --- a/nipype/interfaces/slicer/legacy/tests/test_auto_OtsuThresholdImageFilter.py +++ b/nipype/interfaces/slicer/legacy/tests/test_auto_OtsuThresholdImageFilter.py @@ -28,7 +28,7 @@ def test_OtsuThresholdImageFilter_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = OtsuThresholdImageFilter.input_spec() + inputs = OtsuThresholdImageFilter._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -39,7 +39,7 @@ def test_OtsuThresholdImageFilter_outputs(): output_map = dict(outputVolume=dict(position=-1, ), ) - outputs = OtsuThresholdImageFilter.output_spec() + outputs = OtsuThresholdImageFilter._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/legacy/tests/test_auto_OtsuThresholdSegmentation.py b/nipype/interfaces/slicer/legacy/tests/test_auto_OtsuThresholdSegmentation.py index 29f00b8e5f..2ef8ed4b04 100644 --- a/nipype/interfaces/slicer/legacy/tests/test_auto_OtsuThresholdSegmentation.py +++ b/nipype/interfaces/slicer/legacy/tests/test_auto_OtsuThresholdSegmentation.py @@ -30,7 +30,7 @@ def test_OtsuThresholdSegmentation_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = OtsuThresholdSegmentation.input_spec() + inputs = OtsuThresholdSegmentation._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -41,7 +41,7 @@ def test_OtsuThresholdSegmentation_outputs(): output_map = dict(outputVolume=dict(position=-1, ), ) - outputs = OtsuThresholdSegmentation.output_spec() + outputs = OtsuThresholdSegmentation._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/legacy/tests/test_auto_ResampleScalarVolume.py b/nipype/interfaces/slicer/legacy/tests/test_auto_ResampleScalarVolume.py index 617ea6a3df..0a42210902 100644 --- a/nipype/interfaces/slicer/legacy/tests/test_auto_ResampleScalarVolume.py +++ b/nipype/interfaces/slicer/legacy/tests/test_auto_ResampleScalarVolume.py @@ -27,7 +27,7 @@ def test_ResampleScalarVolume_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ResampleScalarVolume.input_spec() + inputs = ResampleScalarVolume._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -38,7 +38,7 @@ def test_ResampleScalarVolume_outputs(): output_map = dict(OutputVolume=dict(position=-1, ), ) - outputs = ResampleScalarVolume.output_spec() + outputs = ResampleScalarVolume._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/legacy/tests/test_auto_RigidRegistration.py b/nipype/interfaces/slicer/legacy/tests/test_auto_RigidRegistration.py index a721fd9401..4922dc8253 100644 --- a/nipype/interfaces/slicer/legacy/tests/test_auto_RigidRegistration.py +++ b/nipype/interfaces/slicer/legacy/tests/test_auto_RigidRegistration.py @@ -47,7 +47,7 @@ def test_RigidRegistration_inputs(): translationscale=dict(argstr='--translationscale %f', ), ) - inputs = RigidRegistration.input_spec() + inputs = RigidRegistration._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -58,7 +58,7 @@ def test_RigidRegistration_outputs(): output_map = dict(outputtransform=dict(), resampledmovingfilename=dict(), ) - outputs = RigidRegistration.output_spec() + outputs = RigidRegistration._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/quantification/changequantification.py b/nipype/interfaces/slicer/quantification/changequantification.py index f5225065e2..3d174bf618 100644 --- a/nipype/interfaces/slicer/quantification/changequantification.py +++ b/nipype/interfaces/slicer/quantification/changequantification.py @@ -43,7 +43,7 @@ class IntensityDifferenceMetric(SEMLikeCommandLine): """ - input_spec = IntensityDifferenceMetricInputSpec - output_spec = IntensityDifferenceMetricOutputSpec + _input_spec = IntensityDifferenceMetricInputSpec + _output_spec = IntensityDifferenceMetricOutputSpec _cmd = "IntensityDifferenceMetric " _outputs_filenames = {'outputVolume': 'outputVolume.nii', 'reportFileName': 'reportFileName'} diff --git a/nipype/interfaces/slicer/quantification/petstandarduptakevaluecomputation.py b/nipype/interfaces/slicer/quantification/petstandarduptakevaluecomputation.py index 8dfe67b546..c83ae2724e 100644 --- a/nipype/interfaces/slicer/quantification/petstandarduptakevaluecomputation.py +++ b/nipype/interfaces/slicer/quantification/petstandarduptakevaluecomputation.py @@ -40,7 +40,7 @@ class PETStandardUptakeValueComputation(SEMLikeCommandLine): """ - input_spec = PETStandardUptakeValueComputationInputSpec - output_spec = PETStandardUptakeValueComputationOutputSpec + _input_spec = PETStandardUptakeValueComputationInputSpec + _output_spec = PETStandardUptakeValueComputationOutputSpec _cmd = "PETStandardUptakeValueComputation " _outputs_filenames = {'csvFile': 'csvFile.csv'} diff --git a/nipype/interfaces/slicer/quantification/tests/test_auto_IntensityDifferenceMetric.py b/nipype/interfaces/slicer/quantification/tests/test_auto_IntensityDifferenceMetric.py index bcc651a10c..9c77d1e64a 100644 --- a/nipype/interfaces/slicer/quantification/tests/test_auto_IntensityDifferenceMetric.py +++ b/nipype/interfaces/slicer/quantification/tests/test_auto_IntensityDifferenceMetric.py @@ -35,7 +35,7 @@ def test_IntensityDifferenceMetric_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = IntensityDifferenceMetric.input_spec() + inputs = IntensityDifferenceMetric._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -47,7 +47,7 @@ def test_IntensityDifferenceMetric_outputs(): ), reportFileName=dict(), ) - outputs = IntensityDifferenceMetric.output_spec() + outputs = IntensityDifferenceMetric._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/quantification/tests/test_auto_PETStandardUptakeValueComputation.py b/nipype/interfaces/slicer/quantification/tests/test_auto_PETStandardUptakeValueComputation.py index 9794302982..d04775207e 100644 --- a/nipype/interfaces/slicer/quantification/tests/test_auto_PETStandardUptakeValueComputation.py +++ b/nipype/interfaces/slicer/quantification/tests/test_auto_PETStandardUptakeValueComputation.py @@ -36,7 +36,7 @@ def test_PETStandardUptakeValueComputation_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = PETStandardUptakeValueComputation.input_spec() + inputs = PETStandardUptakeValueComputation._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -46,7 +46,7 @@ def test_PETStandardUptakeValueComputation_inputs(): def test_PETStandardUptakeValueComputation_outputs(): output_map = dict(csvFile=dict(), ) - outputs = PETStandardUptakeValueComputation.output_spec() + outputs = PETStandardUptakeValueComputation._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/registration/brainsfit.py b/nipype/interfaces/slicer/registration/brainsfit.py index b093235b84..58f4e47411 100644 --- a/nipype/interfaces/slicer/registration/brainsfit.py +++ b/nipype/interfaces/slicer/registration/brainsfit.py @@ -99,7 +99,7 @@ class BRAINSFit(SEMLikeCommandLine): """ - input_spec = BRAINSFitInputSpec - output_spec = BRAINSFitOutputSpec + _input_spec = BRAINSFitInputSpec + _output_spec = BRAINSFitOutputSpec _cmd = "BRAINSFit " _outputs_filenames = {'outputVolume': 'outputVolume.nii', 'bsplineTransform': 'bsplineTransform.mat', 'outputTransform': 'outputTransform.mat', 'outputFixedVolumeROI': 'outputFixedVolumeROI.nii', 'strippedOutputTransform': 'strippedOutputTransform.mat', 'outputMovingVolumeROI': 'outputMovingVolumeROI.nii', 'linearTransform': 'linearTransform.mat'} diff --git a/nipype/interfaces/slicer/registration/brainsresample.py b/nipype/interfaces/slicer/registration/brainsresample.py index c7f2ba63a2..6901f37f44 100644 --- a/nipype/interfaces/slicer/registration/brainsresample.py +++ b/nipype/interfaces/slicer/registration/brainsresample.py @@ -45,7 +45,7 @@ class BRAINSResample(SEMLikeCommandLine): """ - input_spec = BRAINSResampleInputSpec - output_spec = BRAINSResampleOutputSpec + _input_spec = BRAINSResampleInputSpec + _output_spec = BRAINSResampleOutputSpec _cmd = "BRAINSResample " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} diff --git a/nipype/interfaces/slicer/registration/specialized.py b/nipype/interfaces/slicer/registration/specialized.py index 3123cd2e63..97a873e4b1 100644 --- a/nipype/interfaces/slicer/registration/specialized.py +++ b/nipype/interfaces/slicer/registration/specialized.py @@ -36,8 +36,8 @@ class ACPCTransform(SEMLikeCommandLine): """ - input_spec = ACPCTransformInputSpec - output_spec = ACPCTransformOutputSpec + _input_spec = ACPCTransformInputSpec + _output_spec = ACPCTransformOutputSpec _cmd = "ACPCTransform " _outputs_filenames = {'outputTransform': 'outputTransform.mat'} @@ -72,8 +72,8 @@ class FiducialRegistration(SEMLikeCommandLine): """ - input_spec = FiducialRegistrationInputSpec - output_spec = FiducialRegistrationOutputSpec + _input_spec = FiducialRegistrationInputSpec + _output_spec = FiducialRegistrationOutputSpec _cmd = "FiducialRegistration " _outputs_filenames = {'saveTransform': 'saveTransform.txt'} @@ -150,8 +150,8 @@ class VBRAINSDemonWarp(SEMLikeCommandLine): """ - input_spec = VBRAINSDemonWarpInputSpec - output_spec = VBRAINSDemonWarpOutputSpec + _input_spec = VBRAINSDemonWarpInputSpec + _output_spec = VBRAINSDemonWarpOutputSpec _cmd = "VBRAINSDemonWarp " _outputs_filenames = {'outputVolume': 'outputVolume.nii', 'outputCheckerboardVolume': 'outputCheckerboardVolume.nii', 'outputDisplacementFieldVolume': 'outputDisplacementFieldVolume.nrrd'} @@ -227,7 +227,7 @@ class BRAINSDemonWarp(SEMLikeCommandLine): """ - input_spec = BRAINSDemonWarpInputSpec - output_spec = BRAINSDemonWarpOutputSpec + _input_spec = BRAINSDemonWarpInputSpec + _output_spec = BRAINSDemonWarpOutputSpec _cmd = "BRAINSDemonWarp " _outputs_filenames = {'outputVolume': 'outputVolume.nii', 'outputCheckerboardVolume': 'outputCheckerboardVolume.nii', 'outputDisplacementFieldVolume': 'outputDisplacementFieldVolume.nrrd'} diff --git a/nipype/interfaces/slicer/registration/tests/test_auto_ACPCTransform.py b/nipype/interfaces/slicer/registration/tests/test_auto_ACPCTransform.py index a118de15c1..780ada5993 100644 --- a/nipype/interfaces/slicer/registration/tests/test_auto_ACPCTransform.py +++ b/nipype/interfaces/slicer/registration/tests/test_auto_ACPCTransform.py @@ -24,7 +24,7 @@ def test_ACPCTransform_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ACPCTransform.input_spec() + inputs = ACPCTransform._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -34,7 +34,7 @@ def test_ACPCTransform_inputs(): def test_ACPCTransform_outputs(): output_map = dict(outputTransform=dict(), ) - outputs = ACPCTransform.output_spec() + outputs = ACPCTransform._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/registration/tests/test_auto_BRAINSDemonWarp.py b/nipype/interfaces/slicer/registration/tests/test_auto_BRAINSDemonWarp.py index fa3caa8d79..ef16a5cb57 100644 --- a/nipype/interfaces/slicer/registration/tests/test_auto_BRAINSDemonWarp.py +++ b/nipype/interfaces/slicer/registration/tests/test_auto_BRAINSDemonWarp.py @@ -105,7 +105,7 @@ def test_BRAINSDemonWarp_inputs(): use_vanilla_dem=dict(argstr='--use_vanilla_dem ', ), ) - inputs = BRAINSDemonWarp.input_spec() + inputs = BRAINSDemonWarp._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -117,7 +117,7 @@ def test_BRAINSDemonWarp_outputs(): outputDisplacementFieldVolume=dict(), outputVolume=dict(), ) - outputs = BRAINSDemonWarp.output_spec() + outputs = BRAINSDemonWarp._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/registration/tests/test_auto_BRAINSFit.py b/nipype/interfaces/slicer/registration/tests/test_auto_BRAINSFit.py index b28da552ed..9c75a29c27 100644 --- a/nipype/interfaces/slicer/registration/tests/test_auto_BRAINSFit.py +++ b/nipype/interfaces/slicer/registration/tests/test_auto_BRAINSFit.py @@ -150,7 +150,7 @@ def test_BRAINSFit_inputs(): writeTransformOnFailure=dict(argstr='--writeTransformOnFailure ', ), ) - inputs = BRAINSFit.input_spec() + inputs = BRAINSFit._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -166,7 +166,7 @@ def test_BRAINSFit_outputs(): outputVolume=dict(), strippedOutputTransform=dict(), ) - outputs = BRAINSFit.output_spec() + outputs = BRAINSFit._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/registration/tests/test_auto_BRAINSResample.py b/nipype/interfaces/slicer/registration/tests/test_auto_BRAINSResample.py index e6d8c39ae8..abc2cb27e1 100644 --- a/nipype/interfaces/slicer/registration/tests/test_auto_BRAINSResample.py +++ b/nipype/interfaces/slicer/registration/tests/test_auto_BRAINSResample.py @@ -39,7 +39,7 @@ def test_BRAINSResample_inputs(): warpTransform=dict(argstr='--warpTransform %s', ), ) - inputs = BRAINSResample.input_spec() + inputs = BRAINSResample._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -49,7 +49,7 @@ def test_BRAINSResample_inputs(): def test_BRAINSResample_outputs(): output_map = dict(outputVolume=dict(), ) - outputs = BRAINSResample.output_spec() + outputs = BRAINSResample._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/registration/tests/test_auto_FiducialRegistration.py b/nipype/interfaces/slicer/registration/tests/test_auto_FiducialRegistration.py index de4cdaae40..caf6ac37c8 100644 --- a/nipype/interfaces/slicer/registration/tests/test_auto_FiducialRegistration.py +++ b/nipype/interfaces/slicer/registration/tests/test_auto_FiducialRegistration.py @@ -28,7 +28,7 @@ def test_FiducialRegistration_inputs(): transformType=dict(argstr='--transformType %s', ), ) - inputs = FiducialRegistration.input_spec() + inputs = FiducialRegistration._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -38,7 +38,7 @@ def test_FiducialRegistration_inputs(): def test_FiducialRegistration_outputs(): output_map = dict(saveTransform=dict(), ) - outputs = FiducialRegistration.output_spec() + outputs = FiducialRegistration._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/registration/tests/test_auto_VBRAINSDemonWarp.py b/nipype/interfaces/slicer/registration/tests/test_auto_VBRAINSDemonWarp.py index 50df05872a..af920f8f80 100644 --- a/nipype/interfaces/slicer/registration/tests/test_auto_VBRAINSDemonWarp.py +++ b/nipype/interfaces/slicer/registration/tests/test_auto_VBRAINSDemonWarp.py @@ -108,7 +108,7 @@ def test_VBRAINSDemonWarp_inputs(): sep=',', ), ) - inputs = VBRAINSDemonWarp.input_spec() + inputs = VBRAINSDemonWarp._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -120,7 +120,7 @@ def test_VBRAINSDemonWarp_outputs(): outputDisplacementFieldVolume=dict(), outputVolume=dict(), ) - outputs = VBRAINSDemonWarp.output_spec() + outputs = VBRAINSDemonWarp._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/segmentation/simpleregiongrowingsegmentation.py b/nipype/interfaces/slicer/segmentation/simpleregiongrowingsegmentation.py index ee2c9e11ea..718503ad1c 100644 --- a/nipype/interfaces/slicer/segmentation/simpleregiongrowingsegmentation.py +++ b/nipype/interfaces/slicer/segmentation/simpleregiongrowingsegmentation.py @@ -39,7 +39,7 @@ class SimpleRegionGrowingSegmentation(SEMLikeCommandLine): """ - input_spec = SimpleRegionGrowingSegmentationInputSpec - output_spec = SimpleRegionGrowingSegmentationOutputSpec + _input_spec = SimpleRegionGrowingSegmentationInputSpec + _output_spec = SimpleRegionGrowingSegmentationOutputSpec _cmd = "SimpleRegionGrowingSegmentation " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} diff --git a/nipype/interfaces/slicer/segmentation/specialized.py b/nipype/interfaces/slicer/segmentation/specialized.py index fef3cb7df3..cfcaea40b9 100644 --- a/nipype/interfaces/slicer/segmentation/specialized.py +++ b/nipype/interfaces/slicer/segmentation/specialized.py @@ -38,8 +38,8 @@ class RobustStatisticsSegmenter(SEMLikeCommandLine): """ - input_spec = RobustStatisticsSegmenterInputSpec - output_spec = RobustStatisticsSegmenterOutputSpec + _input_spec = RobustStatisticsSegmenterInputSpec + _output_spec = RobustStatisticsSegmenterOutputSpec _cmd = "RobustStatisticsSegmenter " _outputs_filenames = {'segmentedImageFileName': 'segmentedImageFileName.nii'} @@ -96,8 +96,8 @@ class EMSegmentCommandLine(SEMLikeCommandLine): """ - input_spec = EMSegmentCommandLineInputSpec - output_spec = EMSegmentCommandLineOutputSpec + _input_spec = EMSegmentCommandLineInputSpec + _output_spec = EMSegmentCommandLineOutputSpec _cmd = "EMSegmentCommandLine " _outputs_filenames = {'generateEmptyMRMLSceneAndQuit': 'generateEmptyMRMLSceneAndQuit', 'resultMRMLSceneFileName': 'resultMRMLSceneFileName', 'resultVolumeFileName': 'resultVolumeFileName.mhd'} @@ -137,7 +137,7 @@ class BRAINSROIAuto(SEMLikeCommandLine): """ - input_spec = BRAINSROIAutoInputSpec - output_spec = BRAINSROIAutoOutputSpec + _input_spec = BRAINSROIAutoInputSpec + _output_spec = BRAINSROIAutoOutputSpec _cmd = "BRAINSROIAuto " _outputs_filenames = {'outputROIMaskVolume': 'outputROIMaskVolume.nii', 'outputClippedVolumeROI': 'outputClippedVolumeROI.nii'} diff --git a/nipype/interfaces/slicer/segmentation/tests/test_auto_BRAINSROIAuto.py b/nipype/interfaces/slicer/segmentation/tests/test_auto_BRAINSROIAuto.py index 17d9993671..9efdaeb554 100644 --- a/nipype/interfaces/slicer/segmentation/tests/test_auto_BRAINSROIAuto.py +++ b/nipype/interfaces/slicer/segmentation/tests/test_auto_BRAINSROIAuto.py @@ -35,7 +35,7 @@ def test_BRAINSROIAuto_inputs(): thresholdCorrectionFactor=dict(argstr='--thresholdCorrectionFactor %f', ), ) - inputs = BRAINSROIAuto.input_spec() + inputs = BRAINSROIAuto._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -46,7 +46,7 @@ def test_BRAINSROIAuto_outputs(): output_map = dict(outputClippedVolumeROI=dict(), outputROIMaskVolume=dict(), ) - outputs = BRAINSROIAuto.output_spec() + outputs = BRAINSROIAuto._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/segmentation/tests/test_auto_EMSegmentCommandLine.py b/nipype/interfaces/slicer/segmentation/tests/test_auto_EMSegmentCommandLine.py index 3a98a84d41..b49794b479 100644 --- a/nipype/interfaces/slicer/segmentation/tests/test_auto_EMSegmentCommandLine.py +++ b/nipype/interfaces/slicer/segmentation/tests/test_auto_EMSegmentCommandLine.py @@ -60,7 +60,7 @@ def test_EMSegmentCommandLine_inputs(): verbose=dict(argstr='--verbose ', ), ) - inputs = EMSegmentCommandLine.input_spec() + inputs = EMSegmentCommandLine._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -72,7 +72,7 @@ def test_EMSegmentCommandLine_outputs(): resultMRMLSceneFileName=dict(), resultVolumeFileName=dict(), ) - outputs = EMSegmentCommandLine.output_spec() + outputs = EMSegmentCommandLine._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/segmentation/tests/test_auto_RobustStatisticsSegmenter.py b/nipype/interfaces/slicer/segmentation/tests/test_auto_RobustStatisticsSegmenter.py index 8c8c954c68..65cd4d86f4 100644 --- a/nipype/interfaces/slicer/segmentation/tests/test_auto_RobustStatisticsSegmenter.py +++ b/nipype/interfaces/slicer/segmentation/tests/test_auto_RobustStatisticsSegmenter.py @@ -35,7 +35,7 @@ def test_RobustStatisticsSegmenter_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = RobustStatisticsSegmenter.input_spec() + inputs = RobustStatisticsSegmenter._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -46,7 +46,7 @@ def test_RobustStatisticsSegmenter_outputs(): output_map = dict(segmentedImageFileName=dict(position=-1, ), ) - outputs = RobustStatisticsSegmenter.output_spec() + outputs = RobustStatisticsSegmenter._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/segmentation/tests/test_auto_SimpleRegionGrowingSegmentation.py b/nipype/interfaces/slicer/segmentation/tests/test_auto_SimpleRegionGrowingSegmentation.py index a06926156e..a9dd045f47 100644 --- a/nipype/interfaces/slicer/segmentation/tests/test_auto_SimpleRegionGrowingSegmentation.py +++ b/nipype/interfaces/slicer/segmentation/tests/test_auto_SimpleRegionGrowingSegmentation.py @@ -36,7 +36,7 @@ def test_SimpleRegionGrowingSegmentation_inputs(): timestep=dict(argstr='--timestep %f', ), ) - inputs = SimpleRegionGrowingSegmentation.input_spec() + inputs = SimpleRegionGrowingSegmentation._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -47,7 +47,7 @@ def test_SimpleRegionGrowingSegmentation_outputs(): output_map = dict(outputVolume=dict(position=-1, ), ) - outputs = SimpleRegionGrowingSegmentation.output_spec() + outputs = SimpleRegionGrowingSegmentation._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/surface.py b/nipype/interfaces/slicer/surface.py index cd8edcf2cf..aa1773463e 100644 --- a/nipype/interfaces/slicer/surface.py +++ b/nipype/interfaces/slicer/surface.py @@ -33,8 +33,8 @@ class MergeModels(SEMLikeCommandLine): """ - input_spec = MergeModelsInputSpec - output_spec = MergeModelsOutputSpec + _input_spec = MergeModelsInputSpec + _output_spec = MergeModelsOutputSpec _cmd = "MergeModels " _outputs_filenames = {'ModelOutput': 'ModelOutput.vtk'} @@ -67,8 +67,8 @@ class ModelToLabelMap(SEMLikeCommandLine): """ - input_spec = ModelToLabelMapInputSpec - output_spec = ModelToLabelMapOutputSpec + _input_spec = ModelToLabelMapInputSpec + _output_spec = ModelToLabelMapOutputSpec _cmd = "ModelToLabelMap " _outputs_filenames = {'OutputVolume': 'OutputVolume.nii'} @@ -107,8 +107,8 @@ class GrayscaleModelMaker(SEMLikeCommandLine): """ - input_spec = GrayscaleModelMakerInputSpec - output_spec = GrayscaleModelMakerOutputSpec + _input_spec = GrayscaleModelMakerInputSpec + _output_spec = GrayscaleModelMakerOutputSpec _cmd = "GrayscaleModelMaker " _outputs_filenames = {'OutputGeometry': 'OutputGeometry.vtk'} @@ -140,8 +140,8 @@ class ProbeVolumeWithModel(SEMLikeCommandLine): """ - input_spec = ProbeVolumeWithModelInputSpec - output_spec = ProbeVolumeWithModelOutputSpec + _input_spec = ProbeVolumeWithModelInputSpec + _output_spec = ProbeVolumeWithModelOutputSpec _cmd = "ProbeVolumeWithModel " _outputs_filenames = {'OutputModel': 'OutputModel.vtk'} @@ -176,8 +176,8 @@ class LabelMapSmoothing(SEMLikeCommandLine): """ - input_spec = LabelMapSmoothingInputSpec - output_spec = LabelMapSmoothingOutputSpec + _input_spec = LabelMapSmoothingInputSpec + _output_spec = LabelMapSmoothingOutputSpec _cmd = "LabelMapSmoothing " _outputs_filenames = {'outputVolume': 'outputVolume.nii'} @@ -226,7 +226,7 @@ class ModelMaker(SEMLikeCommandLine): """ - input_spec = ModelMakerInputSpec - output_spec = ModelMakerOutputSpec + _input_spec = ModelMakerInputSpec + _output_spec = ModelMakerOutputSpec _cmd = "ModelMaker " _outputs_filenames = {'modelSceneFile': 'modelSceneFile.mrml'} diff --git a/nipype/interfaces/slicer/tests/test_auto_DicomToNrrdConverter.py b/nipype/interfaces/slicer/tests/test_auto_DicomToNrrdConverter.py index e758a394f2..1b5382f34e 100644 --- a/nipype/interfaces/slicer/tests/test_auto_DicomToNrrdConverter.py +++ b/nipype/interfaces/slicer/tests/test_auto_DicomToNrrdConverter.py @@ -30,7 +30,7 @@ def test_DicomToNrrdConverter_inputs(): writeProtocolGradientsFile=dict(argstr='--writeProtocolGradientsFile ', ), ) - inputs = DicomToNrrdConverter.input_spec() + inputs = DicomToNrrdConverter._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -40,7 +40,7 @@ def test_DicomToNrrdConverter_inputs(): def test_DicomToNrrdConverter_outputs(): output_map = dict(outputDirectory=dict(), ) - outputs = DicomToNrrdConverter.output_spec() + outputs = DicomToNrrdConverter._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/tests/test_auto_EMSegmentTransformToNewFormat.py b/nipype/interfaces/slicer/tests/test_auto_EMSegmentTransformToNewFormat.py index 3ef48595c8..b65a696bc9 100644 --- a/nipype/interfaces/slicer/tests/test_auto_EMSegmentTransformToNewFormat.py +++ b/nipype/interfaces/slicer/tests/test_auto_EMSegmentTransformToNewFormat.py @@ -22,7 +22,7 @@ def test_EMSegmentTransformToNewFormat_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = EMSegmentTransformToNewFormat.input_spec() + inputs = EMSegmentTransformToNewFormat._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -32,7 +32,7 @@ def test_EMSegmentTransformToNewFormat_inputs(): def test_EMSegmentTransformToNewFormat_outputs(): output_map = dict(outputMRMLFileName=dict(), ) - outputs = EMSegmentTransformToNewFormat.output_spec() + outputs = EMSegmentTransformToNewFormat._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/tests/test_auto_GrayscaleModelMaker.py b/nipype/interfaces/slicer/tests/test_auto_GrayscaleModelMaker.py index 5d871640f5..7a7d4a6870 100644 --- a/nipype/interfaces/slicer/tests/test_auto_GrayscaleModelMaker.py +++ b/nipype/interfaces/slicer/tests/test_auto_GrayscaleModelMaker.py @@ -34,7 +34,7 @@ def test_GrayscaleModelMaker_inputs(): threshold=dict(argstr='--threshold %f', ), ) - inputs = GrayscaleModelMaker.input_spec() + inputs = GrayscaleModelMaker._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -45,7 +45,7 @@ def test_GrayscaleModelMaker_outputs(): output_map = dict(OutputGeometry=dict(position=-1, ), ) - outputs = GrayscaleModelMaker.output_spec() + outputs = GrayscaleModelMaker._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/tests/test_auto_LabelMapSmoothing.py b/nipype/interfaces/slicer/tests/test_auto_LabelMapSmoothing.py index 44bbf0179a..1987b4964f 100644 --- a/nipype/interfaces/slicer/tests/test_auto_LabelMapSmoothing.py +++ b/nipype/interfaces/slicer/tests/test_auto_LabelMapSmoothing.py @@ -30,7 +30,7 @@ def test_LabelMapSmoothing_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = LabelMapSmoothing.input_spec() + inputs = LabelMapSmoothing._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -41,7 +41,7 @@ def test_LabelMapSmoothing_outputs(): output_map = dict(outputVolume=dict(position=-1, ), ) - outputs = LabelMapSmoothing.output_spec() + outputs = LabelMapSmoothing._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/tests/test_auto_MergeModels.py b/nipype/interfaces/slicer/tests/test_auto_MergeModels.py index 7dfcefb5be..8857926a1f 100644 --- a/nipype/interfaces/slicer/tests/test_auto_MergeModels.py +++ b/nipype/interfaces/slicer/tests/test_auto_MergeModels.py @@ -25,7 +25,7 @@ def test_MergeModels_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = MergeModels.input_spec() + inputs = MergeModels._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -36,7 +36,7 @@ def test_MergeModels_outputs(): output_map = dict(ModelOutput=dict(position=-1, ), ) - outputs = MergeModels.output_spec() + outputs = MergeModels._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/tests/test_auto_ModelMaker.py b/nipype/interfaces/slicer/tests/test_auto_ModelMaker.py index 1137fe4898..1046a1716a 100644 --- a/nipype/interfaces/slicer/tests/test_auto_ModelMaker.py +++ b/nipype/interfaces/slicer/tests/test_auto_ModelMaker.py @@ -54,7 +54,7 @@ def test_ModelMaker_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ModelMaker.input_spec() + inputs = ModelMaker._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -64,7 +64,7 @@ def test_ModelMaker_inputs(): def test_ModelMaker_outputs(): output_map = dict(modelSceneFile=dict(), ) - outputs = ModelMaker.output_spec() + outputs = ModelMaker._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/tests/test_auto_ModelToLabelMap.py b/nipype/interfaces/slicer/tests/test_auto_ModelToLabelMap.py index 2756e03782..209cf8e42e 100644 --- a/nipype/interfaces/slicer/tests/test_auto_ModelToLabelMap.py +++ b/nipype/interfaces/slicer/tests/test_auto_ModelToLabelMap.py @@ -27,7 +27,7 @@ def test_ModelToLabelMap_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ModelToLabelMap.input_spec() + inputs = ModelToLabelMap._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -38,7 +38,7 @@ def test_ModelToLabelMap_outputs(): output_map = dict(OutputVolume=dict(position=-1, ), ) - outputs = ModelToLabelMap.output_spec() + outputs = ModelToLabelMap._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/tests/test_auto_OrientScalarVolume.py b/nipype/interfaces/slicer/tests/test_auto_OrientScalarVolume.py index 4477681f60..1647809ba7 100644 --- a/nipype/interfaces/slicer/tests/test_auto_OrientScalarVolume.py +++ b/nipype/interfaces/slicer/tests/test_auto_OrientScalarVolume.py @@ -24,7 +24,7 @@ def test_OrientScalarVolume_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = OrientScalarVolume.input_spec() + inputs = OrientScalarVolume._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -35,7 +35,7 @@ def test_OrientScalarVolume_outputs(): output_map = dict(outputVolume=dict(position=-1, ), ) - outputs = OrientScalarVolume.output_spec() + outputs = OrientScalarVolume._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/tests/test_auto_ProbeVolumeWithModel.py b/nipype/interfaces/slicer/tests/test_auto_ProbeVolumeWithModel.py index 842768fd27..35bf6d3041 100644 --- a/nipype/interfaces/slicer/tests/test_auto_ProbeVolumeWithModel.py +++ b/nipype/interfaces/slicer/tests/test_auto_ProbeVolumeWithModel.py @@ -25,7 +25,7 @@ def test_ProbeVolumeWithModel_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = ProbeVolumeWithModel.input_spec() + inputs = ProbeVolumeWithModel._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -36,7 +36,7 @@ def test_ProbeVolumeWithModel_outputs(): output_map = dict(OutputModel=dict(position=-1, ), ) - outputs = ProbeVolumeWithModel.output_spec() + outputs = ProbeVolumeWithModel._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/tests/test_auto_SlicerCommandLine.py b/nipype/interfaces/slicer/tests/test_auto_SlicerCommandLine.py index 003a27e3e3..f251892fa8 100644 --- a/nipype/interfaces/slicer/tests/test_auto_SlicerCommandLine.py +++ b/nipype/interfaces/slicer/tests/test_auto_SlicerCommandLine.py @@ -15,7 +15,7 @@ def test_SlicerCommandLine_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = SlicerCommandLine.input_spec() + inputs = SlicerCommandLine._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -24,7 +24,7 @@ def test_SlicerCommandLine_inputs(): def test_SlicerCommandLine_outputs(): output_map = dict() - outputs = SlicerCommandLine.output_spec() + outputs = SlicerCommandLine._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/slicer/utilities.py b/nipype/interfaces/slicer/utilities.py index bdc675e55a..62629a689d 100644 --- a/nipype/interfaces/slicer/utilities.py +++ b/nipype/interfaces/slicer/utilities.py @@ -31,7 +31,7 @@ class EMSegmentTransformToNewFormat(SEMLikeCommandLine): """ - input_spec = EMSegmentTransformToNewFormatInputSpec - output_spec = EMSegmentTransformToNewFormatOutputSpec + _input_spec = EMSegmentTransformToNewFormatInputSpec + _output_spec = EMSegmentTransformToNewFormatOutputSpec _cmd = "EMSegmentTransformToNewFormat " _outputs_filenames = {'outputMRMLFileName': 'outputMRMLFileName.mrml'} diff --git a/nipype/interfaces/spm/base.py b/nipype/interfaces/spm/base.py index 8d776da9ac..19a87371ea 100644 --- a/nipype/interfaces/spm/base.py +++ b/nipype/interfaces/spm/base.py @@ -225,7 +225,7 @@ class SPMCommand(BaseInterface): WARNING: Pseudo prototype class, meant to be subclassed """ - input_spec = SPMCommandInputSpec + _input_spec = SPMCommandInputSpec _additional_metadata = ['field'] _jobtype = 'basetype' diff --git a/nipype/interfaces/spm/model.py b/nipype/interfaces/spm/model.py index 1ff3175a8f..ac40227b3d 100644 --- a/nipype/interfaces/spm/model.py +++ b/nipype/interfaces/spm/model.py @@ -105,8 +105,8 @@ class Level1Design(SPMCommand): """ - input_spec = Level1DesignInputSpec - output_spec = Level1DesignOutputSpec + _input_spec = Level1DesignInputSpec + _output_spec = Level1DesignOutputSpec _jobtype = 'stats' _jobname = 'fmri_spec' @@ -187,8 +187,8 @@ class EstimateModel(SPMCommand): >>> est.inputs.spm_mat_file = 'SPM.mat' >>> est.run() # doctest: +SKIP """ - input_spec = EstimateModelInputSpec - output_spec = EstimateModelOutputSpec + _input_spec = EstimateModelInputSpec + _output_spec = EstimateModelOutputSpec _jobtype = 'stats' _jobname = 'fmri_est' @@ -309,8 +309,8 @@ class EstimateContrast(SPMCommand): """ - input_spec = EstimateContrastInputSpec - output_spec = EstimateContrastOutputSpec + _input_spec = EstimateContrastInputSpec + _output_spec = EstimateContrastOutputSpec _jobtype = 'stats' _jobname = 'con' @@ -444,8 +444,8 @@ class Threshold(SPMCommand): >>> thresh.inputs.extent_fdr_p_threshold = 0.05 >>> thresh.run() # doctest: +SKIP """ - input_spec = ThresholdInputSpec - output_spec = ThresholdOutputSpec + _input_spec = ThresholdInputSpec + _output_spec = ThresholdOutputSpec def _gen_thresholded_map_filename(self): _, fname, ext = split_filename(self.inputs.stat_image) @@ -619,8 +619,8 @@ class ThresholdStatistics(SPMCommand): >>> thresh.inputs.height_threshold = 4.56 >>> thresh.run() # doctest: +SKIP """ - input_spec = ThresholdStatisticsInputSpec - output_spec = ThresholdStatisticsOutputSpec + _input_spec = ThresholdStatisticsInputSpec + _output_spec = ThresholdStatisticsOutputSpec def _make_matlab_command(self, _): script = "con_index = %d;\n" % self.inputs.contrast_index @@ -737,8 +737,8 @@ class FactorialDesign(SPMCommand): """ - input_spec = FactorialDesignInputSpec - output_spec = FactorialDesignOutputSpec + _input_spec = FactorialDesignInputSpec + _output_spec = FactorialDesignOutputSpec _jobtype = 'stats' _jobname = 'factorial_design' @@ -790,7 +790,7 @@ class OneSampleTTestDesign(FactorialDesign): >>> ttest.run() # doctest: +SKIP """ - input_spec = OneSampleTTestDesignInputSpec + _input_spec = OneSampleTTestDesignInputSpec def _format_arg(self, opt, spec, val): """Convert input to appropriate format for spm @@ -827,7 +827,7 @@ class TwoSampleTTestDesign(FactorialDesign): >>> ttest.run() # doctest: +SKIP """ - input_spec = TwoSampleTTestDesignInputSpec + _input_spec = TwoSampleTTestDesignInputSpec def _format_arg(self, opt, spec, val): """Convert input to appropriate format for spm @@ -859,7 +859,7 @@ class PairedTTestDesign(FactorialDesign): >>> pttest.run() # doctest: +SKIP """ - input_spec = PairedTTestDesignInputSpec + _input_spec = PairedTTestDesignInputSpec def _format_arg(self, opt, spec, val): """Convert input to appropriate format for spm @@ -895,7 +895,7 @@ class MultipleRegressionDesign(FactorialDesign): >>> mreg.run() # doctest: +SKIP """ - input_spec = MultipleRegressionDesignInputSpec + _input_spec = MultipleRegressionDesignInputSpec def _format_arg(self, opt, spec, val): """Convert input to appropriate format for spm diff --git a/nipype/interfaces/spm/preprocess.py b/nipype/interfaces/spm/preprocess.py index 5f56621c4a..7781c6e48f 100644 --- a/nipype/interfaces/spm/preprocess.py +++ b/nipype/interfaces/spm/preprocess.py @@ -82,8 +82,8 @@ class SliceTiming(SPMCommand): """ - input_spec = SliceTimingInputSpec - output_spec = SliceTimingOutputSpec + _input_spec = SliceTimingInputSpec + _output_spec = SliceTimingOutputSpec _jobtype = 'temporal' _jobname = 'st' @@ -180,8 +180,8 @@ class Realign(SPMCommand): """ - input_spec = RealignInputSpec - output_spec = RealignOutputSpec + _input_spec = RealignInputSpec + _output_spec = RealignOutputSpec _jobtype = 'spatial' _jobname = 'realign' @@ -310,8 +310,8 @@ class Coregister(SPMCommand): """ - input_spec = CoregisterInputSpec - output_spec = CoregisterOutputSpec + _input_spec = CoregisterInputSpec + _output_spec = CoregisterOutputSpec _jobtype = 'spatial' _jobname = 'coreg' @@ -435,8 +435,8 @@ class Normalize(SPMCommand): """ - input_spec = NormalizeInputSpec - output_spec = NormalizeOutputSpec + _input_spec = NormalizeInputSpec + _output_spec = NormalizeOutputSpec _jobtype = 'spatial' _jobname = 'normalise' @@ -595,8 +595,8 @@ class Normalize12(SPMCommand): """ - input_spec = Normalize12InputSpec - output_spec = Normalize12OutputSpec + _input_spec = Normalize12InputSpec + _output_spec = Normalize12OutputSpec _jobtype = 'spatial' _jobname = 'normalise' @@ -755,8 +755,8 @@ class Segment(SPMCommand): """ - input_spec = SegmentInputSpec - output_spec = SegmentOutputSpec + _input_spec = SegmentInputSpec + _output_spec = SegmentOutputSpec def __init__(self, **inputs): _local_version = SPMCommand().version @@ -882,8 +882,8 @@ class NewSegment(SPMCommand): """ - input_spec = NewSegmentInputSpec - output_spec = NewSegmentOutputSpec + _input_spec = NewSegmentInputSpec + _output_spec = NewSegmentOutputSpec def __init__(self, **inputs): _local_version = SPMCommand().version @@ -1009,8 +1009,8 @@ class Smooth(SPMCommand): >>> smooth.run() # doctest: +SKIP """ - input_spec = SmoothInputSpec - output_spec = SmoothOutputSpec + _input_spec = SmoothInputSpec + _output_spec = SmoothOutputSpec _jobtype = 'spatial' _jobname = 'smooth' @@ -1093,8 +1093,8 @@ class DARTEL(SPMCommand): """ - input_spec = DARTELInputSpec - output_spec = DARTELOutputSpec + _input_spec = DARTELInputSpec + _output_spec = DARTELOutputSpec _jobtype = 'tools' _jobname = 'dartel' @@ -1187,8 +1187,8 @@ class DARTELNorm2MNI(SPMCommand): """ - input_spec = DARTELNorm2MNIInputSpec - output_spec = DARTELNorm2MNIOutputSpec + _input_spec = DARTELNorm2MNIInputSpec + _output_spec = DARTELNorm2MNIOutputSpec _jobtype = 'tools' _jobname = 'dartel' @@ -1269,8 +1269,8 @@ class CreateWarped(SPMCommand): """ - input_spec = CreateWarpedInputSpec - output_spec = CreateWarpedOutputSpec + _input_spec = CreateWarpedInputSpec + _output_spec = CreateWarpedOutputSpec _jobtype = 'tools' _jobname = 'dartel' @@ -1312,8 +1312,8 @@ class ApplyDeformationFieldOutputSpec(TraitedSpec): class ApplyDeformations(SPMCommand): - input_spec = ApplyDeformationFieldInputSpec - output_spec = ApplyDeformationFieldOutputSpec + _input_spec = ApplyDeformationFieldInputSpec + _output_spec = ApplyDeformationFieldOutputSpec _jobtype = 'util' _jobname = 'defs' @@ -1495,8 +1495,8 @@ class VBMSegment(SPMCommand): >>> seg.run() # doctest: +SKIP """ - input_spec = VBMSegmentInputSpec - output_spec = VBMSegmentOuputSpec + _input_spec = VBMSegmentInputSpec + _output_spec = VBMSegmentOuputSpec _jobtype = 'tools' _jobname = 'vbm8' diff --git a/nipype/interfaces/spm/tests/test_auto_Analyze2nii.py b/nipype/interfaces/spm/tests/test_auto_Analyze2nii.py index 2f175f80f6..2661910fe5 100644 --- a/nipype/interfaces/spm/tests/test_auto_Analyze2nii.py +++ b/nipype/interfaces/spm/tests/test_auto_Analyze2nii.py @@ -18,7 +18,7 @@ def test_Analyze2nii_inputs(): usedefault=True, ), ) - inputs = Analyze2nii.input_spec() + inputs = Analyze2nii._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -39,7 +39,7 @@ def test_Analyze2nii_outputs(): usedefault=True, ), ) - outputs = Analyze2nii.output_spec() + outputs = Analyze2nii._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_ApplyDeformations.py b/nipype/interfaces/spm/tests/test_auto_ApplyDeformations.py index a84d6e8246..0ca5fdaa38 100644 --- a/nipype/interfaces/spm/tests/test_auto_ApplyDeformations.py +++ b/nipype/interfaces/spm/tests/test_auto_ApplyDeformations.py @@ -27,7 +27,7 @@ def test_ApplyDeformations_inputs(): usedefault=True, ), ) - inputs = ApplyDeformations.input_spec() + inputs = ApplyDeformations._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -37,7 +37,7 @@ def test_ApplyDeformations_inputs(): def test_ApplyDeformations_outputs(): output_map = dict(out_files=dict(), ) - outputs = ApplyDeformations.output_spec() + outputs = ApplyDeformations._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_ApplyInverseDeformation.py b/nipype/interfaces/spm/tests/test_auto_ApplyInverseDeformation.py index 8eca900dd9..4a30b9092b 100644 --- a/nipype/interfaces/spm/tests/test_auto_ApplyInverseDeformation.py +++ b/nipype/interfaces/spm/tests/test_auto_ApplyInverseDeformation.py @@ -33,7 +33,7 @@ def test_ApplyInverseDeformation_inputs(): voxel_sizes=dict(field='comp{1}.inv.comp{1}.sn2def.vox', ), ) - inputs = ApplyInverseDeformation.input_spec() + inputs = ApplyInverseDeformation._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -43,7 +43,7 @@ def test_ApplyInverseDeformation_inputs(): def test_ApplyInverseDeformation_outputs(): output_map = dict(out_files=dict(), ) - outputs = ApplyInverseDeformation.output_spec() + outputs = ApplyInverseDeformation._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_ApplyTransform.py b/nipype/interfaces/spm/tests/test_auto_ApplyTransform.py index 090ae3e200..28259118f3 100644 --- a/nipype/interfaces/spm/tests/test_auto_ApplyTransform.py +++ b/nipype/interfaces/spm/tests/test_auto_ApplyTransform.py @@ -23,7 +23,7 @@ def test_ApplyTransform_inputs(): usedefault=True, ), ) - inputs = ApplyTransform.input_spec() + inputs = ApplyTransform._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -33,7 +33,7 @@ def test_ApplyTransform_inputs(): def test_ApplyTransform_outputs(): output_map = dict(out_file=dict(), ) - outputs = ApplyTransform.output_spec() + outputs = ApplyTransform._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_CalcCoregAffine.py b/nipype/interfaces/spm/tests/test_auto_CalcCoregAffine.py index a058f57767..0bbf6465ff 100644 --- a/nipype/interfaces/spm/tests/test_auto_CalcCoregAffine.py +++ b/nipype/interfaces/spm/tests/test_auto_CalcCoregAffine.py @@ -23,7 +23,7 @@ def test_CalcCoregAffine_inputs(): usedefault=True, ), ) - inputs = CalcCoregAffine.input_spec() + inputs = CalcCoregAffine._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -34,7 +34,7 @@ def test_CalcCoregAffine_outputs(): output_map = dict(invmat=dict(), mat=dict(), ) - outputs = CalcCoregAffine.output_spec() + outputs = CalcCoregAffine._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_Coregister.py b/nipype/interfaces/spm/tests/test_auto_Coregister.py index 5b8eb8f51f..45e8160174 100644 --- a/nipype/interfaces/spm/tests/test_auto_Coregister.py +++ b/nipype/interfaces/spm/tests/test_auto_Coregister.py @@ -46,7 +46,7 @@ def test_Coregister_inputs(): write_wrap=dict(field='roptions.wrap', ), ) - inputs = Coregister.input_spec() + inputs = Coregister._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -57,7 +57,7 @@ def test_Coregister_outputs(): output_map = dict(coregistered_files=dict(), coregistered_source=dict(), ) - outputs = Coregister.output_spec() + outputs = Coregister._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_CreateWarped.py b/nipype/interfaces/spm/tests/test_auto_CreateWarped.py index 043847d15e..8c0912c0a6 100644 --- a/nipype/interfaces/spm/tests/test_auto_CreateWarped.py +++ b/nipype/interfaces/spm/tests/test_auto_CreateWarped.py @@ -30,7 +30,7 @@ def test_CreateWarped_inputs(): usedefault=True, ), ) - inputs = CreateWarped.input_spec() + inputs = CreateWarped._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -40,7 +40,7 @@ def test_CreateWarped_inputs(): def test_CreateWarped_outputs(): output_map = dict(warped_files=dict(), ) - outputs = CreateWarped.output_spec() + outputs = CreateWarped._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_DARTEL.py b/nipype/interfaces/spm/tests/test_auto_DARTEL.py index 0e3bb00668..cfd5808dd8 100644 --- a/nipype/interfaces/spm/tests/test_auto_DARTEL.py +++ b/nipype/interfaces/spm/tests/test_auto_DARTEL.py @@ -29,7 +29,7 @@ def test_DARTEL_inputs(): usedefault=True, ), ) - inputs = DARTEL.input_spec() + inputs = DARTEL._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -41,7 +41,7 @@ def test_DARTEL_outputs(): final_template_file=dict(), template_files=dict(), ) - outputs = DARTEL.output_spec() + outputs = DARTEL._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_DARTELNorm2MNI.py b/nipype/interfaces/spm/tests/test_auto_DARTELNorm2MNI.py index 8af7fc0285..3e8a773af3 100644 --- a/nipype/interfaces/spm/tests/test_auto_DARTELNorm2MNI.py +++ b/nipype/interfaces/spm/tests/test_auto_DARTELNorm2MNI.py @@ -35,7 +35,7 @@ def test_DARTELNorm2MNI_inputs(): voxel_size=dict(field='mni_norm.vox', ), ) - inputs = DARTELNorm2MNI.input_spec() + inputs = DARTELNorm2MNI._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -46,7 +46,7 @@ def test_DARTELNorm2MNI_outputs(): output_map = dict(normalization_parameter_file=dict(), normalized_files=dict(), ) - outputs = DARTELNorm2MNI.output_spec() + outputs = DARTELNorm2MNI._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_DicomImport.py b/nipype/interfaces/spm/tests/test_auto_DicomImport.py index 9bc1c2762e..da3881d6f6 100644 --- a/nipype/interfaces/spm/tests/test_auto_DicomImport.py +++ b/nipype/interfaces/spm/tests/test_auto_DicomImport.py @@ -31,7 +31,7 @@ def test_DicomImport_inputs(): usedefault=True, ), ) - inputs = DicomImport.input_spec() + inputs = DicomImport._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -41,7 +41,7 @@ def test_DicomImport_inputs(): def test_DicomImport_outputs(): output_map = dict(out_files=dict(), ) - outputs = DicomImport.output_spec() + outputs = DicomImport._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_EstimateContrast.py b/nipype/interfaces/spm/tests/test_auto_EstimateContrast.py index 558790c20e..12170b54da 100644 --- a/nipype/interfaces/spm/tests/test_auto_EstimateContrast.py +++ b/nipype/interfaces/spm/tests/test_auto_EstimateContrast.py @@ -32,7 +32,7 @@ def test_EstimateContrast_inputs(): usedefault=True, ), ) - inputs = EstimateContrast.input_spec() + inputs = EstimateContrast._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -46,7 +46,7 @@ def test_EstimateContrast_outputs(): spmT_images=dict(), spm_mat_file=dict(), ) - outputs = EstimateContrast.output_spec() + outputs = EstimateContrast._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_EstimateModel.py b/nipype/interfaces/spm/tests/test_auto_EstimateModel.py index 44d269e89c..89c274621a 100644 --- a/nipype/interfaces/spm/tests/test_auto_EstimateModel.py +++ b/nipype/interfaces/spm/tests/test_auto_EstimateModel.py @@ -24,7 +24,7 @@ def test_EstimateModel_inputs(): usedefault=True, ), ) - inputs = EstimateModel.input_spec() + inputs = EstimateModel._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -38,7 +38,7 @@ def test_EstimateModel_outputs(): residual_image=dict(), spm_mat_file=dict(), ) - outputs = EstimateModel.output_spec() + outputs = EstimateModel._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_FactorialDesign.py b/nipype/interfaces/spm/tests/test_auto_FactorialDesign.py index c382ed3c8d..e985bffed7 100644 --- a/nipype/interfaces/spm/tests/test_auto_FactorialDesign.py +++ b/nipype/interfaces/spm/tests/test_auto_FactorialDesign.py @@ -46,7 +46,7 @@ def test_FactorialDesign_inputs(): usedefault=True, ), ) - inputs = FactorialDesign.input_spec() + inputs = FactorialDesign._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -56,7 +56,7 @@ def test_FactorialDesign_inputs(): def test_FactorialDesign_outputs(): output_map = dict(spm_mat_file=dict(), ) - outputs = FactorialDesign.output_spec() + outputs = FactorialDesign._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_Level1Design.py b/nipype/interfaces/spm/tests/test_auto_Level1Design.py index de50c577c0..803bdfabf3 100644 --- a/nipype/interfaces/spm/tests/test_auto_Level1Design.py +++ b/nipype/interfaces/spm/tests/test_auto_Level1Design.py @@ -46,7 +46,7 @@ def test_Level1Design_inputs(): volterra_expansion_order=dict(field='volt', ), ) - inputs = Level1Design.input_spec() + inputs = Level1Design._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -56,7 +56,7 @@ def test_Level1Design_inputs(): def test_Level1Design_outputs(): output_map = dict(spm_mat_file=dict(), ) - outputs = Level1Design.output_spec() + outputs = Level1Design._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_MultipleRegressionDesign.py b/nipype/interfaces/spm/tests/test_auto_MultipleRegressionDesign.py index 5fa47fadf2..8be452f5fb 100644 --- a/nipype/interfaces/spm/tests/test_auto_MultipleRegressionDesign.py +++ b/nipype/interfaces/spm/tests/test_auto_MultipleRegressionDesign.py @@ -54,7 +54,7 @@ def test_MultipleRegressionDesign_inputs(): user_covariates=dict(field='des.mreg.mcov', ), ) - inputs = MultipleRegressionDesign.input_spec() + inputs = MultipleRegressionDesign._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -64,7 +64,7 @@ def test_MultipleRegressionDesign_inputs(): def test_MultipleRegressionDesign_outputs(): output_map = dict(spm_mat_file=dict(), ) - outputs = MultipleRegressionDesign.output_spec() + outputs = MultipleRegressionDesign._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_NewSegment.py b/nipype/interfaces/spm/tests/test_auto_NewSegment.py index 89f6a5c18c..50504699a9 100644 --- a/nipype/interfaces/spm/tests/test_auto_NewSegment.py +++ b/nipype/interfaces/spm/tests/test_auto_NewSegment.py @@ -32,7 +32,7 @@ def test_NewSegment_inputs(): write_deformation_fields=dict(field='warp.write', ), ) - inputs = NewSegment.input_spec() + inputs = NewSegment._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -50,7 +50,7 @@ def test_NewSegment_outputs(): normalized_class_images=dict(), transformation_mat=dict(), ) - outputs = NewSegment.output_spec() + outputs = NewSegment._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_Normalize.py b/nipype/interfaces/spm/tests/test_auto_Normalize.py index 96ce55975e..0bcaef5159 100644 --- a/nipype/interfaces/spm/tests/test_auto_Normalize.py +++ b/nipype/interfaces/spm/tests/test_auto_Normalize.py @@ -67,7 +67,7 @@ def test_Normalize_inputs(): write_wrap=dict(field='roptions.wrap', ), ) - inputs = Normalize.input_spec() + inputs = Normalize._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -79,7 +79,7 @@ def test_Normalize_outputs(): normalized_files=dict(), normalized_source=dict(), ) - outputs = Normalize.output_spec() + outputs = Normalize._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_Normalize12.py b/nipype/interfaces/spm/tests/test_auto_Normalize12.py index 7fedba9d86..0498965050 100644 --- a/nipype/interfaces/spm/tests/test_auto_Normalize12.py +++ b/nipype/interfaces/spm/tests/test_auto_Normalize12.py @@ -53,7 +53,7 @@ def test_Normalize12_inputs(): write_voxel_sizes=dict(field='woptions.vox', ), ) - inputs = Normalize12.input_spec() + inputs = Normalize12._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -65,7 +65,7 @@ def test_Normalize12_outputs(): normalized_files=dict(), normalized_image=dict(), ) - outputs = Normalize12.output_spec() + outputs = Normalize12._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_OneSampleTTestDesign.py b/nipype/interfaces/spm/tests/test_auto_OneSampleTTestDesign.py index 51f4e9d4e2..3e05239f8a 100644 --- a/nipype/interfaces/spm/tests/test_auto_OneSampleTTestDesign.py +++ b/nipype/interfaces/spm/tests/test_auto_OneSampleTTestDesign.py @@ -49,7 +49,7 @@ def test_OneSampleTTestDesign_inputs(): usedefault=True, ), ) - inputs = OneSampleTTestDesign.input_spec() + inputs = OneSampleTTestDesign._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -59,7 +59,7 @@ def test_OneSampleTTestDesign_inputs(): def test_OneSampleTTestDesign_outputs(): output_map = dict(spm_mat_file=dict(), ) - outputs = OneSampleTTestDesign.output_spec() + outputs = OneSampleTTestDesign._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_PairedTTestDesign.py b/nipype/interfaces/spm/tests/test_auto_PairedTTestDesign.py index b053cb58d1..767371f2e8 100644 --- a/nipype/interfaces/spm/tests/test_auto_PairedTTestDesign.py +++ b/nipype/interfaces/spm/tests/test_auto_PairedTTestDesign.py @@ -53,7 +53,7 @@ def test_PairedTTestDesign_inputs(): usedefault=True, ), ) - inputs = PairedTTestDesign.input_spec() + inputs = PairedTTestDesign._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -63,7 +63,7 @@ def test_PairedTTestDesign_inputs(): def test_PairedTTestDesign_outputs(): output_map = dict(spm_mat_file=dict(), ) - outputs = PairedTTestDesign.output_spec() + outputs = PairedTTestDesign._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_Realign.py b/nipype/interfaces/spm/tests/test_auto_Realign.py index 6ee1c7a110..d279dda596 100644 --- a/nipype/interfaces/spm/tests/test_auto_Realign.py +++ b/nipype/interfaces/spm/tests/test_auto_Realign.py @@ -50,7 +50,7 @@ def test_Realign_inputs(): write_wrap=dict(field='roptions.wrap', ), ) - inputs = Realign.input_spec() + inputs = Realign._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -63,7 +63,7 @@ def test_Realign_outputs(): realigned_files=dict(), realignment_parameters=dict(), ) - outputs = Realign.output_spec() + outputs = Realign._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_Reslice.py b/nipype/interfaces/spm/tests/test_auto_Reslice.py index 1687309bd7..eb83dca084 100644 --- a/nipype/interfaces/spm/tests/test_auto_Reslice.py +++ b/nipype/interfaces/spm/tests/test_auto_Reslice.py @@ -23,7 +23,7 @@ def test_Reslice_inputs(): usedefault=True, ), ) - inputs = Reslice.input_spec() + inputs = Reslice._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -33,7 +33,7 @@ def test_Reslice_inputs(): def test_Reslice_outputs(): output_map = dict(out_file=dict(), ) - outputs = Reslice.output_spec() + outputs = Reslice._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_ResliceToReference.py b/nipype/interfaces/spm/tests/test_auto_ResliceToReference.py index d791b5965a..3dd7d4cb4a 100644 --- a/nipype/interfaces/spm/tests/test_auto_ResliceToReference.py +++ b/nipype/interfaces/spm/tests/test_auto_ResliceToReference.py @@ -27,7 +27,7 @@ def test_ResliceToReference_inputs(): voxel_sizes=dict(field='comp{2}.idbbvox.vox', ), ) - inputs = ResliceToReference.input_spec() + inputs = ResliceToReference._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -37,7 +37,7 @@ def test_ResliceToReference_inputs(): def test_ResliceToReference_outputs(): output_map = dict(out_files=dict(), ) - outputs = ResliceToReference.output_spec() + outputs = ResliceToReference._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_SPMCommand.py b/nipype/interfaces/spm/tests/test_auto_SPMCommand.py index b0df440742..0b3d469e7e 100644 --- a/nipype/interfaces/spm/tests/test_auto_SPMCommand.py +++ b/nipype/interfaces/spm/tests/test_auto_SPMCommand.py @@ -16,7 +16,7 @@ def test_SPMCommand_inputs(): usedefault=True, ), ) - inputs = SPMCommand.input_spec() + inputs = SPMCommand._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -25,7 +25,7 @@ def test_SPMCommand_inputs(): def test_SPMCommand_outputs(): output_map = dict() - outputs = SPMCommand.output_spec() + outputs = SPMCommand._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_Segment.py b/nipype/interfaces/spm/tests/test_auto_Segment.py index c32284105c..45ac41d3ce 100644 --- a/nipype/interfaces/spm/tests/test_auto_Segment.py +++ b/nipype/interfaces/spm/tests/test_auto_Segment.py @@ -48,7 +48,7 @@ def test_Segment_inputs(): wm_output_type=dict(field='output.WM', ), ) - inputs = Segment.input_spec() + inputs = Segment._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -72,7 +72,7 @@ def test_Segment_outputs(): normalized_wm_image=dict(), transformation_mat=dict(), ) - outputs = Segment.output_spec() + outputs = Segment._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_SliceTiming.py b/nipype/interfaces/spm/tests/test_auto_SliceTiming.py index c230c2909c..1982843846 100644 --- a/nipype/interfaces/spm/tests/test_auto_SliceTiming.py +++ b/nipype/interfaces/spm/tests/test_auto_SliceTiming.py @@ -38,7 +38,7 @@ def test_SliceTiming_inputs(): usedefault=True, ), ) - inputs = SliceTiming.input_spec() + inputs = SliceTiming._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -48,7 +48,7 @@ def test_SliceTiming_inputs(): def test_SliceTiming_outputs(): output_map = dict(timecorrected_files=dict(), ) - outputs = SliceTiming.output_spec() + outputs = SliceTiming._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_Smooth.py b/nipype/interfaces/spm/tests/test_auto_Smooth.py index aa5708ba5f..3c74327548 100644 --- a/nipype/interfaces/spm/tests/test_auto_Smooth.py +++ b/nipype/interfaces/spm/tests/test_auto_Smooth.py @@ -29,7 +29,7 @@ def test_Smooth_inputs(): usedefault=True, ), ) - inputs = Smooth.input_spec() + inputs = Smooth._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -39,7 +39,7 @@ def test_Smooth_inputs(): def test_Smooth_outputs(): output_map = dict(smoothed_files=dict(), ) - outputs = Smooth.output_spec() + outputs = Smooth._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_Threshold.py b/nipype/interfaces/spm/tests/test_auto_Threshold.py index e79460f980..7b6caf8c5e 100644 --- a/nipype/interfaces/spm/tests/test_auto_Threshold.py +++ b/nipype/interfaces/spm/tests/test_auto_Threshold.py @@ -38,7 +38,7 @@ def test_Threshold_inputs(): usedefault=True, ), ) - inputs = Threshold.input_spec() + inputs = Threshold._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -53,7 +53,7 @@ def test_Threshold_outputs(): pre_topo_n_clusters=dict(), thresholded_map=dict(), ) - outputs = Threshold.output_spec() + outputs = Threshold._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_ThresholdStatistics.py b/nipype/interfaces/spm/tests/test_auto_ThresholdStatistics.py index a5363ebccd..a7ae3e48b5 100644 --- a/nipype/interfaces/spm/tests/test_auto_ThresholdStatistics.py +++ b/nipype/interfaces/spm/tests/test_auto_ThresholdStatistics.py @@ -28,7 +28,7 @@ def test_ThresholdStatistics_inputs(): usedefault=True, ), ) - inputs = ThresholdStatistics.input_spec() + inputs = ThresholdStatistics._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -43,7 +43,7 @@ def test_ThresholdStatistics_outputs(): voxelwise_P_RF=dict(), voxelwise_P_uncor=dict(), ) - outputs = ThresholdStatistics.output_spec() + outputs = ThresholdStatistics._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_TwoSampleTTestDesign.py b/nipype/interfaces/spm/tests/test_auto_TwoSampleTTestDesign.py index c27ae684dc..f8cc2c0654 100644 --- a/nipype/interfaces/spm/tests/test_auto_TwoSampleTTestDesign.py +++ b/nipype/interfaces/spm/tests/test_auto_TwoSampleTTestDesign.py @@ -56,7 +56,7 @@ def test_TwoSampleTTestDesign_inputs(): usedefault=True, ), ) - inputs = TwoSampleTTestDesign.input_spec() + inputs = TwoSampleTTestDesign._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -66,7 +66,7 @@ def test_TwoSampleTTestDesign_inputs(): def test_TwoSampleTTestDesign_outputs(): output_map = dict(spm_mat_file=dict(), ) - outputs = TwoSampleTTestDesign.output_spec() + outputs = TwoSampleTTestDesign._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_auto_VBMSegment.py b/nipype/interfaces/spm/tests/test_auto_VBMSegment.py index 1b330af007..fac56484a5 100644 --- a/nipype/interfaces/spm/tests/test_auto_VBMSegment.py +++ b/nipype/interfaces/spm/tests/test_auto_VBMSegment.py @@ -112,7 +112,7 @@ def test_VBMSegment_inputs(): usedefault=True, ), ) - inputs = VBMSegment.input_spec() + inputs = VBMSegment._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -134,7 +134,7 @@ def test_VBMSegment_outputs(): pve_label_registered_images=dict(), transformation_mat=dict(), ) - outputs = VBMSegment.output_spec() + outputs = VBMSegment._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/spm/tests/test_base.py b/nipype/interfaces/spm/tests/test_base.py index ec376113a6..0d22befe32 100644 --- a/nipype/interfaces/spm/tests/test_base.py +++ b/nipype/interfaces/spm/tests/test_base.py @@ -63,7 +63,7 @@ def test_spm_path(): def test_use_mfile(): class TestClass(spm.SPMCommand): - input_spec = spm.SPMCommandInputSpec + _input_spec = spm.SPMCommandInputSpec dc = TestClass() # dc = derived_class yield assert_true, dc.inputs.mfile @@ -100,7 +100,7 @@ class TestClass(spm.SPMCommand): @skipif(no_spm, "SPM not found") def test_cmd_update(): class TestClass(spm.SPMCommand): - input_spec = spm.SPMCommandInputSpec + _input_spec = spm.SPMCommandInputSpec dc = TestClass() # dc = derived_class dc.inputs.matlab_cmd = 'foo' yield assert_equal, dc.mlab._cmd, 'foo' @@ -110,7 +110,7 @@ def test_cmd_update2(): class TestClass(spm.SPMCommand): _jobtype = 'jobtype' _jobname = 'jobname' - input_spec = spm.SPMCommandInputSpec + _input_spec = spm.SPMCommandInputSpec dc = TestClass() # dc = derived_class yield assert_equal, dc.jobtype, 'jobtype' yield assert_equal, dc.jobname, 'jobname' @@ -118,7 +118,7 @@ class TestClass(spm.SPMCommand): def test_reformat_dict_for_savemat(): class TestClass(spm.SPMCommand): - input_spec = spm.SPMCommandInputSpec + _input_spec = spm.SPMCommandInputSpec dc = TestClass() # dc = derived_class out = dc._reformat_dict_for_savemat({'a': {'b': {'c': []}}}) yield assert_equal, out, [{'a': [{'b': [{'c': []}]}]}] @@ -126,7 +126,7 @@ class TestClass(spm.SPMCommand): def test_generate_job(): class TestClass(spm.SPMCommand): - input_spec = spm.SPMCommandInputSpec + _input_spec = spm.SPMCommandInputSpec dc = TestClass() # dc = derived_class out = dc._generate_job() yield assert_equal, out, '' @@ -158,7 +158,7 @@ class TestClassInputSpec(SPMCommandInputSpec): test_in = include_intercept = traits.Bool(field='testfield') class TestClass(spm.SPMCommand): - input_spec = TestClassInputSpec + _input_spec = TestClassInputSpec _jobtype = 'jobtype' _jobname = 'jobname' dc = TestClass() # dc = derived_class @@ -174,7 +174,7 @@ def test_make_matlab_command(): class TestClass(spm.SPMCommand): _jobtype = 'jobtype' _jobname = 'jobname' - input_spec = spm.SPMCommandInputSpec + _input_spec = spm.SPMCommandInputSpec dc = TestClass() # dc = derived_class filelist, outdir, cwd = create_files_in_directory() contents = {'contents': [1, 2, 3, 4]} diff --git a/nipype/interfaces/spm/utils.py b/nipype/interfaces/spm/utils.py index dcf6dce7b2..86d2d2bb01 100644 --- a/nipype/interfaces/spm/utils.py +++ b/nipype/interfaces/spm/utils.py @@ -22,8 +22,8 @@ class Analyze2niiOutputSpec(SPMCommandInputSpec): class Analyze2nii(SPMCommand): - input_spec = Analyze2niiInputSpec - output_spec = Analyze2niiOutputSpec + _input_spec = Analyze2niiInputSpec + _output_spec = Analyze2niiOutputSpec def _make_matlab_command(self, _): script = "V = spm_vol('%s');\n" % self.inputs.analyze_file @@ -76,8 +76,8 @@ class CalcCoregAffine(SPMCommand): that can be used to move it """ - input_spec = CalcCoregAffineInputSpec - output_spec = CalcCoregAffineOutputSpec + _input_spec = CalcCoregAffineInputSpec + _output_spec = CalcCoregAffineOutputSpec def _make_inv_file(self): """ makes filename to hold inverse transform if not specified""" @@ -144,8 +144,8 @@ class ApplyTransform(SPMCommand): >>> applymat.run() # doctest: +SKIP """ - input_spec = ApplyTransformInputSpec - output_spec = ApplyTransformOutputSpec + _input_spec = ApplyTransformInputSpec + _output_spec = ApplyTransformOutputSpec def _make_matlab_command(self, _): """checks for SPM, generates script""" @@ -202,8 +202,8 @@ class ResliceOutputSpec(TraitedSpec): class Reslice(SPMCommand): """ uses spm_reslice to resample in_file into space of space_defining""" - input_spec = ResliceInputSpec - output_spec = ResliceOutputSpec + _input_spec = ResliceInputSpec + _output_spec = ResliceOutputSpec def _make_matlab_command(self, _): """ generates script""" @@ -294,8 +294,8 @@ class ApplyInverseDeformation(SPMCommand): >>> inv.run() # doctest: +SKIP """ - input_spec = ApplyInverseDeformationInput - output_spec = ApplyInverseDeformationOutput + _input_spec = ApplyInverseDeformationInput + _output_spec = ApplyInverseDeformationOutput _jobtype = 'util' _jobname = 'defs' @@ -349,8 +349,8 @@ class ResliceToReference(SPMCommand): >>> r2ref.run() # doctest: +SKIP """ - input_spec = ResliceToReferenceInput - output_spec = ResliceToReferenceOutput + _input_spec = ResliceToReferenceInput + _output_spec = ResliceToReferenceOutput _jobtype = 'util' _jobname = 'defs' @@ -436,8 +436,8 @@ class DicomImport(SPMCommand): >>> di.run() # doctest: +SKIP """ - input_spec = DicomImportInputSpec - output_spec = DicomImportOutputSpec + _input_spec = DicomImportInputSpec + _output_spec = DicomImportOutputSpec _jobtype = 'util' _jobname = 'dicom' diff --git a/nipype/interfaces/tests/test_auto_AssertEqual.py b/nipype/interfaces/tests/test_auto_AssertEqual.py index ffc246f825..9278f7a6b2 100644 --- a/nipype/interfaces/tests/test_auto_AssertEqual.py +++ b/nipype/interfaces/tests/test_auto_AssertEqual.py @@ -12,7 +12,7 @@ def test_AssertEqual_inputs(): volume2=dict(mandatory=True, ), ) - inputs = AssertEqual.input_spec() + inputs = AssertEqual._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -21,7 +21,7 @@ def test_AssertEqual_inputs(): def test_AssertEqual_outputs(): output_map = dict() - outputs = AssertEqual.output_spec() + outputs = AssertEqual._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_BaseInterface.py b/nipype/interfaces/tests/test_auto_BaseInterface.py index 2b5c863729..dd13b1c7d1 100644 --- a/nipype/interfaces/tests/test_auto_BaseInterface.py +++ b/nipype/interfaces/tests/test_auto_BaseInterface.py @@ -8,7 +8,7 @@ def test_BaseInterface_inputs(): usedefault=True, ), ) - inputs = BaseInterface.input_spec() + inputs = BaseInterface._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -17,7 +17,7 @@ def test_BaseInterface_inputs(): def test_BaseInterface_outputs(): output_map = dict() - outputs = BaseInterface.output_spec() + outputs = BaseInterface._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_C3dAffineTool.py b/nipype/interfaces/tests/test_auto_C3dAffineTool.py index dc8cc37b8c..38f59b690d 100644 --- a/nipype/interfaces/tests/test_auto_C3dAffineTool.py +++ b/nipype/interfaces/tests/test_auto_C3dAffineTool.py @@ -31,7 +31,7 @@ def test_C3dAffineTool_inputs(): position=3, ), ) - inputs = C3dAffineTool.input_spec() + inputs = C3dAffineTool._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -41,7 +41,7 @@ def test_C3dAffineTool_inputs(): def test_C3dAffineTool_outputs(): output_map = dict(itk_transform=dict(), ) - outputs = C3dAffineTool.output_spec() + outputs = C3dAffineTool._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_CSVReader.py b/nipype/interfaces/tests/test_auto_CSVReader.py index a6f42de676..e822b91a9a 100644 --- a/nipype/interfaces/tests/test_auto_CSVReader.py +++ b/nipype/interfaces/tests/test_auto_CSVReader.py @@ -9,7 +9,7 @@ def test_CSVReader_inputs(): in_file=dict(mandatory=True, ), ) - inputs = CSVReader.input_spec() + inputs = CSVReader._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -18,7 +18,7 @@ def test_CSVReader_inputs(): def test_CSVReader_outputs(): output_map = dict() - outputs = CSVReader.output_spec() + outputs = CSVReader._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_CommandLine.py b/nipype/interfaces/tests/test_auto_CommandLine.py index 1ebbd2c135..f567263fac 100644 --- a/nipype/interfaces/tests/test_auto_CommandLine.py +++ b/nipype/interfaces/tests/test_auto_CommandLine.py @@ -15,7 +15,7 @@ def test_CommandLine_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = CommandLine.input_spec() + inputs = CommandLine._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -24,7 +24,7 @@ def test_CommandLine_inputs(): def test_CommandLine_outputs(): output_map = dict() - outputs = CommandLine.output_spec() + outputs = CommandLine._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_CopyMeta.py b/nipype/interfaces/tests/test_auto_CopyMeta.py index 8b456d4e09..fc9698dcef 100644 --- a/nipype/interfaces/tests/test_auto_CopyMeta.py +++ b/nipype/interfaces/tests/test_auto_CopyMeta.py @@ -11,7 +11,7 @@ def test_CopyMeta_inputs(): src_file=dict(mandatory=True, ), ) - inputs = CopyMeta.input_spec() + inputs = CopyMeta._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -21,7 +21,7 @@ def test_CopyMeta_inputs(): def test_CopyMeta_outputs(): output_map = dict(dest_file=dict(), ) - outputs = CopyMeta.output_spec() + outputs = CopyMeta._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_DataFinder.py b/nipype/interfaces/tests/test_auto_DataFinder.py index 8eb5faa9ea..df1bc26155 100644 --- a/nipype/interfaces/tests/test_auto_DataFinder.py +++ b/nipype/interfaces/tests/test_auto_DataFinder.py @@ -17,7 +17,7 @@ def test_DataFinder_inputs(): unpack_single=dict(usedefault=True, ), ) - inputs = DataFinder.input_spec() + inputs = DataFinder._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -26,7 +26,7 @@ def test_DataFinder_inputs(): def test_DataFinder_outputs(): output_map = dict() - outputs = DataFinder.output_spec() + outputs = DataFinder._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_DataGrabber.py b/nipype/interfaces/tests/test_auto_DataGrabber.py index f72eb2bdfe..f06edb19b9 100644 --- a/nipype/interfaces/tests/test_auto_DataGrabber.py +++ b/nipype/interfaces/tests/test_auto_DataGrabber.py @@ -16,7 +16,7 @@ def test_DataGrabber_inputs(): ), template_args=dict(), ) - inputs = DataGrabber.input_spec() + inputs = DataGrabber._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -25,7 +25,7 @@ def test_DataGrabber_inputs(): def test_DataGrabber_outputs(): output_map = dict() - outputs = DataGrabber.output_spec() + outputs = DataGrabber._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_DataSink.py b/nipype/interfaces/tests/test_auto_DataSink.py index 38cb7c1915..e762f2ca8b 100644 --- a/nipype/interfaces/tests/test_auto_DataSink.py +++ b/nipype/interfaces/tests/test_auto_DataSink.py @@ -25,7 +25,7 @@ def test_DataSink_inputs(): strip_dir=dict(), substitutions=dict(), ) - inputs = DataSink.input_spec() + inputs = DataSink._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -35,7 +35,7 @@ def test_DataSink_inputs(): def test_DataSink_outputs(): output_map = dict(out_file=dict(), ) - outputs = DataSink.output_spec() + outputs = DataSink._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_Dcm2nii.py b/nipype/interfaces/tests/test_auto_Dcm2nii.py index 5ff104d5c3..0b71a406b1 100644 --- a/nipype/interfaces/tests/test_auto_Dcm2nii.py +++ b/nipype/interfaces/tests/test_auto_Dcm2nii.py @@ -70,7 +70,7 @@ def test_Dcm2nii_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Dcm2nii.input_spec() + inputs = Dcm2nii._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -84,7 +84,7 @@ def test_Dcm2nii_outputs(): reoriented_and_cropped_files=dict(), reoriented_files=dict(), ) - outputs = Dcm2nii.output_spec() + outputs = Dcm2nii._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_DcmStack.py b/nipype/interfaces/tests/test_auto_DcmStack.py index c91379caa6..02ee1860fe 100644 --- a/nipype/interfaces/tests/test_auto_DcmStack.py +++ b/nipype/interfaces/tests/test_auto_DcmStack.py @@ -16,7 +16,7 @@ def test_DcmStack_inputs(): out_format=dict(), out_path=dict(), ) - inputs = DcmStack.input_spec() + inputs = DcmStack._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -26,7 +26,7 @@ def test_DcmStack_inputs(): def test_DcmStack_outputs(): output_map = dict(out_file=dict(), ) - outputs = DcmStack.output_spec() + outputs = DcmStack._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_FreeSurferSource.py b/nipype/interfaces/tests/test_auto_FreeSurferSource.py index 8b393bf0c4..7f06d05078 100644 --- a/nipype/interfaces/tests/test_auto_FreeSurferSource.py +++ b/nipype/interfaces/tests/test_auto_FreeSurferSource.py @@ -14,7 +14,7 @@ def test_FreeSurferSource_inputs(): subjects_dir=dict(mandatory=True, ), ) - inputs = FreeSurferSource.input_spec() + inputs = FreeSurferSource._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -99,7 +99,7 @@ def test_FreeSurferSource_outputs(): loc='stats', ), ) - outputs = FreeSurferSource.output_spec() + outputs = FreeSurferSource._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_Function.py b/nipype/interfaces/tests/test_auto_Function.py index 65afafbe47..b3e6ef7230 100644 --- a/nipype/interfaces/tests/test_auto_Function.py +++ b/nipype/interfaces/tests/test_auto_Function.py @@ -10,7 +10,7 @@ def test_Function_inputs(): usedefault=True, ), ) - inputs = Function.input_spec() + inputs = Function._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -19,7 +19,7 @@ def test_Function_inputs(): def test_Function_outputs(): output_map = dict() - outputs = Function.output_spec() + outputs = Function._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_GroupAndStack.py b/nipype/interfaces/tests/test_auto_GroupAndStack.py index 8523f76c32..ec9c33c7b4 100644 --- a/nipype/interfaces/tests/test_auto_GroupAndStack.py +++ b/nipype/interfaces/tests/test_auto_GroupAndStack.py @@ -16,7 +16,7 @@ def test_GroupAndStack_inputs(): out_format=dict(), out_path=dict(), ) - inputs = GroupAndStack.input_spec() + inputs = GroupAndStack._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -26,7 +26,7 @@ def test_GroupAndStack_inputs(): def test_GroupAndStack_outputs(): output_map = dict(out_list=dict(), ) - outputs = GroupAndStack.output_spec() + outputs = GroupAndStack._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_IOBase.py b/nipype/interfaces/tests/test_auto_IOBase.py index bbdff9f5f5..9f9808f94d 100644 --- a/nipype/interfaces/tests/test_auto_IOBase.py +++ b/nipype/interfaces/tests/test_auto_IOBase.py @@ -8,7 +8,7 @@ def test_IOBase_inputs(): usedefault=True, ), ) - inputs = IOBase.input_spec() + inputs = IOBase._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -17,7 +17,7 @@ def test_IOBase_inputs(): def test_IOBase_outputs(): output_map = dict() - outputs = IOBase.output_spec() + outputs = IOBase._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_IdentityInterface.py b/nipype/interfaces/tests/test_auto_IdentityInterface.py index f5787df81c..3bb049933a 100644 --- a/nipype/interfaces/tests/test_auto_IdentityInterface.py +++ b/nipype/interfaces/tests/test_auto_IdentityInterface.py @@ -5,7 +5,7 @@ def test_IdentityInterface_inputs(): input_map = dict() - inputs = IdentityInterface.input_spec() + inputs = IdentityInterface._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -14,7 +14,7 @@ def test_IdentityInterface_inputs(): def test_IdentityInterface_outputs(): output_map = dict() - outputs = IdentityInterface.output_spec() + outputs = IdentityInterface._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_JSONFileGrabber.py b/nipype/interfaces/tests/test_auto_JSONFileGrabber.py index a99c4c6ba2..0ec537287d 100644 --- a/nipype/interfaces/tests/test_auto_JSONFileGrabber.py +++ b/nipype/interfaces/tests/test_auto_JSONFileGrabber.py @@ -10,7 +10,7 @@ def test_JSONFileGrabber_inputs(): ), in_file=dict(), ) - inputs = JSONFileGrabber.input_spec() + inputs = JSONFileGrabber._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -19,7 +19,7 @@ def test_JSONFileGrabber_inputs(): def test_JSONFileGrabber_outputs(): output_map = dict() - outputs = JSONFileGrabber.output_spec() + outputs = JSONFileGrabber._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_JSONFileSink.py b/nipype/interfaces/tests/test_auto_JSONFileSink.py index 738166527f..ec18a850e4 100644 --- a/nipype/interfaces/tests/test_auto_JSONFileSink.py +++ b/nipype/interfaces/tests/test_auto_JSONFileSink.py @@ -13,7 +13,7 @@ def test_JSONFileSink_inputs(): ), out_file=dict(), ) - inputs = JSONFileSink.input_spec() + inputs = JSONFileSink._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -23,7 +23,7 @@ def test_JSONFileSink_inputs(): def test_JSONFileSink_outputs(): output_map = dict(out_file=dict(), ) - outputs = JSONFileSink.output_spec() + outputs = JSONFileSink._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_LookupMeta.py b/nipype/interfaces/tests/test_auto_LookupMeta.py index 7e89973931..603e00f266 100644 --- a/nipype/interfaces/tests/test_auto_LookupMeta.py +++ b/nipype/interfaces/tests/test_auto_LookupMeta.py @@ -9,7 +9,7 @@ def test_LookupMeta_inputs(): meta_keys=dict(mandatory=True, ), ) - inputs = LookupMeta.input_spec() + inputs = LookupMeta._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -18,7 +18,7 @@ def test_LookupMeta_inputs(): def test_LookupMeta_outputs(): output_map = dict() - outputs = LookupMeta.output_spec() + outputs = LookupMeta._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_MatlabCommand.py b/nipype/interfaces/tests/test_auto_MatlabCommand.py index 66b9d5335f..ae7727a8a3 100644 --- a/nipype/interfaces/tests/test_auto_MatlabCommand.py +++ b/nipype/interfaces/tests/test_auto_MatlabCommand.py @@ -44,7 +44,7 @@ def test_MatlabCommand_inputs(): xor=['nodesktop', 'nosplash', 'single_comp_thread'], ), ) - inputs = MatlabCommand.input_spec() + inputs = MatlabCommand._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -53,7 +53,7 @@ def test_MatlabCommand_inputs(): def test_MatlabCommand_outputs(): output_map = dict() - outputs = MatlabCommand.output_spec() + outputs = MatlabCommand._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_Merge.py b/nipype/interfaces/tests/test_auto_Merge.py index adddcdebd2..cfe4a03833 100644 --- a/nipype/interfaces/tests/test_auto_Merge.py +++ b/nipype/interfaces/tests/test_auto_Merge.py @@ -12,7 +12,7 @@ def test_Merge_inputs(): no_flatten=dict(usedefault=True, ), ) - inputs = Merge.input_spec() + inputs = Merge._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -22,7 +22,7 @@ def test_Merge_inputs(): def test_Merge_outputs(): output_map = dict(out=dict(), ) - outputs = Merge.output_spec() + outputs = Merge._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_MergeNifti.py b/nipype/interfaces/tests/test_auto_MergeNifti.py index 3a6e0fc5a1..b3d49ce3d0 100644 --- a/nipype/interfaces/tests/test_auto_MergeNifti.py +++ b/nipype/interfaces/tests/test_auto_MergeNifti.py @@ -13,7 +13,7 @@ def test_MergeNifti_inputs(): out_path=dict(), sort_order=dict(), ) - inputs = MergeNifti.input_spec() + inputs = MergeNifti._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -23,7 +23,7 @@ def test_MergeNifti_inputs(): def test_MergeNifti_outputs(): output_map = dict(out_file=dict(), ) - outputs = MergeNifti.output_spec() + outputs = MergeNifti._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_MeshFix.py b/nipype/interfaces/tests/test_auto_MeshFix.py index 4c0fd67596..a1438acccf 100644 --- a/nipype/interfaces/tests/test_auto_MeshFix.py +++ b/nipype/interfaces/tests/test_auto_MeshFix.py @@ -89,7 +89,7 @@ def test_MeshFix_inputs(): x_shift=dict(argstr='--smooth %d', ), ) - inputs = MeshFix.input_spec() + inputs = MeshFix._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -99,7 +99,7 @@ def test_MeshFix_inputs(): def test_MeshFix_outputs(): output_map = dict(mesh_file=dict(), ) - outputs = MeshFix.output_spec() + outputs = MeshFix._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_MpiCommandLine.py b/nipype/interfaces/tests/test_auto_MpiCommandLine.py index 0137c6ccf5..7fa5abe0a6 100644 --- a/nipype/interfaces/tests/test_auto_MpiCommandLine.py +++ b/nipype/interfaces/tests/test_auto_MpiCommandLine.py @@ -18,7 +18,7 @@ def test_MpiCommandLine_inputs(): use_mpi=dict(usedefault=True, ), ) - inputs = MpiCommandLine.input_spec() + inputs = MpiCommandLine._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -27,7 +27,7 @@ def test_MpiCommandLine_inputs(): def test_MpiCommandLine_outputs(): output_map = dict() - outputs = MpiCommandLine.output_spec() + outputs = MpiCommandLine._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_MySQLSink.py b/nipype/interfaces/tests/test_auto_MySQLSink.py index 15193ac116..1b283ac4a6 100644 --- a/nipype/interfaces/tests/test_auto_MySQLSink.py +++ b/nipype/interfaces/tests/test_auto_MySQLSink.py @@ -22,7 +22,7 @@ def test_MySQLSink_inputs(): ), username=dict(), ) - inputs = MySQLSink.input_spec() + inputs = MySQLSink._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -31,7 +31,7 @@ def test_MySQLSink_inputs(): def test_MySQLSink_outputs(): output_map = dict() - outputs = MySQLSink.output_spec() + outputs = MySQLSink._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_NiftiGeneratorBase.py b/nipype/interfaces/tests/test_auto_NiftiGeneratorBase.py index 86476c3d30..6a1e35757f 100644 --- a/nipype/interfaces/tests/test_auto_NiftiGeneratorBase.py +++ b/nipype/interfaces/tests/test_auto_NiftiGeneratorBase.py @@ -8,7 +8,7 @@ def test_NiftiGeneratorBase_inputs(): usedefault=True, ), ) - inputs = NiftiGeneratorBase.input_spec() + inputs = NiftiGeneratorBase._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -17,7 +17,7 @@ def test_NiftiGeneratorBase_inputs(): def test_NiftiGeneratorBase_outputs(): output_map = dict() - outputs = NiftiGeneratorBase.output_spec() + outputs = NiftiGeneratorBase._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_PETPVC.py b/nipype/interfaces/tests/test_auto_PETPVC.py index 67c02c72b0..d2ed3d0063 100644 --- a/nipype/interfaces/tests/test_auto_PETPVC.py +++ b/nipype/interfaces/tests/test_auto_PETPVC.py @@ -48,7 +48,7 @@ def test_PETPVC_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = PETPVC.input_spec() + inputs = PETPVC._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -58,7 +58,7 @@ def test_PETPVC_inputs(): def test_PETPVC_outputs(): output_map = dict(out_file=dict(), ) - outputs = PETPVC.output_spec() + outputs = PETPVC._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_Rename.py b/nipype/interfaces/tests/test_auto_Rename.py index 1cace232fe..39ee679b43 100644 --- a/nipype/interfaces/tests/test_auto_Rename.py +++ b/nipype/interfaces/tests/test_auto_Rename.py @@ -13,7 +13,7 @@ def test_Rename_inputs(): use_fullpath=dict(usedefault=True, ), ) - inputs = Rename.input_spec() + inputs = Rename._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -23,7 +23,7 @@ def test_Rename_inputs(): def test_Rename_outputs(): output_map = dict(out_file=dict(), ) - outputs = Rename.output_spec() + outputs = Rename._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_S3DataGrabber.py b/nipype/interfaces/tests/test_auto_S3DataGrabber.py index 584134ca8f..ef61babd98 100644 --- a/nipype/interfaces/tests/test_auto_S3DataGrabber.py +++ b/nipype/interfaces/tests/test_auto_S3DataGrabber.py @@ -24,7 +24,7 @@ def test_S3DataGrabber_inputs(): ), template_args=dict(), ) - inputs = S3DataGrabber.input_spec() + inputs = S3DataGrabber._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -33,7 +33,7 @@ def test_S3DataGrabber_inputs(): def test_S3DataGrabber_outputs(): output_map = dict() - outputs = S3DataGrabber.output_spec() + outputs = S3DataGrabber._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_SEMLikeCommandLine.py b/nipype/interfaces/tests/test_auto_SEMLikeCommandLine.py index da5784fce6..13850aeb9c 100644 --- a/nipype/interfaces/tests/test_auto_SEMLikeCommandLine.py +++ b/nipype/interfaces/tests/test_auto_SEMLikeCommandLine.py @@ -15,7 +15,7 @@ def test_SEMLikeCommandLine_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = SEMLikeCommandLine.input_spec() + inputs = SEMLikeCommandLine._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -24,7 +24,7 @@ def test_SEMLikeCommandLine_inputs(): def test_SEMLikeCommandLine_outputs(): output_map = dict() - outputs = SEMLikeCommandLine.output_spec() + outputs = SEMLikeCommandLine._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_SQLiteSink.py b/nipype/interfaces/tests/test_auto_SQLiteSink.py index c92ac25985..ecdfd5cfdc 100644 --- a/nipype/interfaces/tests/test_auto_SQLiteSink.py +++ b/nipype/interfaces/tests/test_auto_SQLiteSink.py @@ -12,7 +12,7 @@ def test_SQLiteSink_inputs(): table_name=dict(mandatory=True, ), ) - inputs = SQLiteSink.input_spec() + inputs = SQLiteSink._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -21,7 +21,7 @@ def test_SQLiteSink_inputs(): def test_SQLiteSink_outputs(): output_map = dict() - outputs = SQLiteSink.output_spec() + outputs = SQLiteSink._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_SSHDataGrabber.py b/nipype/interfaces/tests/test_auto_SSHDataGrabber.py index cbec846af1..f38eea0aeb 100644 --- a/nipype/interfaces/tests/test_auto_SSHDataGrabber.py +++ b/nipype/interfaces/tests/test_auto_SSHDataGrabber.py @@ -27,7 +27,7 @@ def test_SSHDataGrabber_inputs(): ), username=dict(), ) - inputs = SSHDataGrabber.input_spec() + inputs = SSHDataGrabber._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -36,7 +36,7 @@ def test_SSHDataGrabber_inputs(): def test_SSHDataGrabber_outputs(): output_map = dict() - outputs = SSHDataGrabber.output_spec() + outputs = SSHDataGrabber._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_Select.py b/nipype/interfaces/tests/test_auto_Select.py index 26d629da4c..e598db177a 100644 --- a/nipype/interfaces/tests/test_auto_Select.py +++ b/nipype/interfaces/tests/test_auto_Select.py @@ -12,7 +12,7 @@ def test_Select_inputs(): inlist=dict(mandatory=True, ), ) - inputs = Select.input_spec() + inputs = Select._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -22,7 +22,7 @@ def test_Select_inputs(): def test_Select_outputs(): output_map = dict(out=dict(), ) - outputs = Select.output_spec() + outputs = Select._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_SelectFiles.py b/nipype/interfaces/tests/test_auto_SelectFiles.py index 49cb40dcf6..17fae734e5 100644 --- a/nipype/interfaces/tests/test_auto_SelectFiles.py +++ b/nipype/interfaces/tests/test_auto_SelectFiles.py @@ -15,7 +15,7 @@ def test_SelectFiles_inputs(): sort_filelist=dict(usedefault=True, ), ) - inputs = SelectFiles.input_spec() + inputs = SelectFiles._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -24,7 +24,7 @@ def test_SelectFiles_inputs(): def test_SelectFiles_outputs(): output_map = dict() - outputs = SelectFiles.output_spec() + outputs = SelectFiles._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_SlicerCommandLine.py b/nipype/interfaces/tests/test_auto_SlicerCommandLine.py index 131c8f851c..c018a3b794 100644 --- a/nipype/interfaces/tests/test_auto_SlicerCommandLine.py +++ b/nipype/interfaces/tests/test_auto_SlicerCommandLine.py @@ -16,7 +16,7 @@ def test_SlicerCommandLine_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = SlicerCommandLine.input_spec() + inputs = SlicerCommandLine._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -25,7 +25,7 @@ def test_SlicerCommandLine_inputs(): def test_SlicerCommandLine_outputs(): output_map = dict() - outputs = SlicerCommandLine.output_spec() + outputs = SlicerCommandLine._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_Split.py b/nipype/interfaces/tests/test_auto_Split.py index 03da66dec6..b7d9174ff7 100644 --- a/nipype/interfaces/tests/test_auto_Split.py +++ b/nipype/interfaces/tests/test_auto_Split.py @@ -14,7 +14,7 @@ def test_Split_inputs(): squeeze=dict(usedefault=True, ), ) - inputs = Split.input_spec() + inputs = Split._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -23,7 +23,7 @@ def test_Split_inputs(): def test_Split_outputs(): output_map = dict() - outputs = Split.output_spec() + outputs = Split._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_SplitNifti.py b/nipype/interfaces/tests/test_auto_SplitNifti.py index 1a0ad4aa15..009a97fadd 100644 --- a/nipype/interfaces/tests/test_auto_SplitNifti.py +++ b/nipype/interfaces/tests/test_auto_SplitNifti.py @@ -12,7 +12,7 @@ def test_SplitNifti_inputs(): out_path=dict(), split_dim=dict(), ) - inputs = SplitNifti.input_spec() + inputs = SplitNifti._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -22,7 +22,7 @@ def test_SplitNifti_inputs(): def test_SplitNifti_outputs(): output_map = dict(out_list=dict(), ) - outputs = SplitNifti.output_spec() + outputs = SplitNifti._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_StdOutCommandLine.py b/nipype/interfaces/tests/test_auto_StdOutCommandLine.py index da5bbd3cc9..ac1daf7239 100644 --- a/nipype/interfaces/tests/test_auto_StdOutCommandLine.py +++ b/nipype/interfaces/tests/test_auto_StdOutCommandLine.py @@ -19,7 +19,7 @@ def test_StdOutCommandLine_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = StdOutCommandLine.input_spec() + inputs = StdOutCommandLine._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -29,7 +29,7 @@ def test_StdOutCommandLine_inputs(): def test_StdOutCommandLine_outputs(): output_map = dict(out_file=dict(), ) - outputs = StdOutCommandLine.output_spec() + outputs = StdOutCommandLine._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_XNATSink.py b/nipype/interfaces/tests/test_auto_XNATSink.py index a774d1e13d..c23bf11cb8 100644 --- a/nipype/interfaces/tests/test_auto_XNATSink.py +++ b/nipype/interfaces/tests/test_auto_XNATSink.py @@ -32,7 +32,7 @@ def test_XNATSink_inputs(): ), user=dict(), ) - inputs = XNATSink.input_spec() + inputs = XNATSink._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -41,7 +41,7 @@ def test_XNATSink_inputs(): def test_XNATSink_outputs(): output_map = dict() - outputs = XNATSink.output_spec() + outputs = XNATSink._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_auto_XNATSource.py b/nipype/interfaces/tests/test_auto_XNATSource.py index 297c050a22..e850aa95cb 100644 --- a/nipype/interfaces/tests/test_auto_XNATSource.py +++ b/nipype/interfaces/tests/test_auto_XNATSource.py @@ -22,7 +22,7 @@ def test_XNATSource_inputs(): ), user=dict(), ) - inputs = XNATSource.input_spec() + inputs = XNATSource._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -31,7 +31,7 @@ def test_XNATSource_inputs(): def test_XNATSource_outputs(): output_map = dict() - outputs = XNATSource.output_spec() + outputs = XNATSource._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/tests/test_matlab.py b/nipype/interfaces/tests/test_matlab.py index 874e0bddd8..05fa159629 100644 --- a/nipype/interfaces/tests/test_matlab.py +++ b/nipype/interfaces/tests/test_matlab.py @@ -62,7 +62,7 @@ def test_mlab_init(): default_script_file = clean_workspace_and_get_default_script_file() yield assert_equal, mlab.MatlabCommand._cmd, 'matlab' - yield assert_equal, mlab.MatlabCommand.input_spec, mlab.MatlabInputSpec + yield assert_equal, mlab.MatlabCommand._input_spec, mlab.MatlabInputSpec yield assert_equal, mlab.MatlabCommand().cmd, matlab_cmd mc = mlab.MatlabCommand(matlab_cmd='foo_m') diff --git a/nipype/interfaces/utility.py b/nipype/interfaces/utility.py index ef0d0eac95..a8ec4997ca 100644 --- a/nipype/interfaces/utility.py +++ b/nipype/interfaces/utility.py @@ -56,8 +56,8 @@ class IdentityInterface(IOBase): >>> out = ii2.run() # doctest: +SKIP ValueError: IdentityInterface requires a value for input 'b' because it was listed in 'fields' Interface IdentityInterface failed to run. """ - input_spec = DynamicTraitedSpec - output_spec = DynamicTraitedSpec + _input_spec = DynamicTraitedSpec + _output_spec = DynamicTraitedSpec def __init__(self, fields=None, mandatory_inputs=True, **inputs): super(IdentityInterface, self).__init__(**inputs) @@ -126,8 +126,8 @@ class Merge(IOBase): [1, 2, 5, 3] """ - input_spec = MergeInputSpec - output_spec = MergeOutputSpec + _input_spec = MergeInputSpec + _output_spec = MergeOutputSpec def __init__(self, numinputs=0, **inputs): super(Merge, self).__init__(**inputs) @@ -213,8 +213,8 @@ class Rename(IOBase): 'subj_201_epi_run02.nii' # doctest: +SKIP """ - input_spec = RenameInputSpec - output_spec = RenameOutputSpec + _input_spec = RenameInputSpec + _output_spec = RenameOutputSpec def __init__(self, format_string=None, **inputs): super(Rename, self).__init__(**inputs) @@ -281,8 +281,8 @@ class Split(IOBase): """ - input_spec = SplitInputSpec - output_spec = DynamicTraitedSpec + _input_spec = SplitInputSpec + _output_spec = DynamicTraitedSpec def _add_output_traits(self, base): undefined_traits = {} @@ -338,8 +338,8 @@ class Select(IOBase): """ - input_spec = SelectInputSpec - output_spec = SelectOutputSpec + _input_spec = SelectInputSpec + _output_spec = SelectOutputSpec def _post_run(self): self.outputs.out = np.array(self.inputs.inlist)[np.array(self.inputs.index)].tolist() @@ -363,8 +363,8 @@ class Function(IOBase): """ - input_spec = FunctionInputSpec - output_spec = DynamicTraitedSpec + _input_spec = FunctionInputSpec + _output_spec = DynamicTraitedSpec def __init__(self, input_names, output_names, function=None, imports=None, **inputs): @@ -462,7 +462,7 @@ class AssertEqualInputSpec(BaseInputSpec): class AssertEqual(BaseInterface): - input_spec = AssertEqualInputSpec + _input_spec = AssertEqualInputSpec def _run_interface(self, runtime): @@ -506,8 +506,8 @@ class CSVReader(BaseInterface): True """ - input_spec = CSVReaderInputSpec - output_spec = DynamicTraitedSpec + _input_spec = CSVReaderInputSpec + _output_spec = DynamicTraitedSpec _always_run = True def _append_entry(self, outputs, entry): diff --git a/nipype/interfaces/vista/tests/test_auto_Vnifti2Image.py b/nipype/interfaces/vista/tests/test_auto_Vnifti2Image.py index 16abe83a0e..50f87debec 100644 --- a/nipype/interfaces/vista/tests/test_auto_Vnifti2Image.py +++ b/nipype/interfaces/vista/tests/test_auto_Vnifti2Image.py @@ -29,7 +29,7 @@ def test_Vnifti2Image_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = Vnifti2Image.input_spec() + inputs = Vnifti2Image._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -39,7 +39,7 @@ def test_Vnifti2Image_inputs(): def test_Vnifti2Image_outputs(): output_map = dict(out_file=dict(), ) - outputs = Vnifti2Image.output_spec() + outputs = Vnifti2Image._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/vista/tests/test_auto_VtoMat.py b/nipype/interfaces/vista/tests/test_auto_VtoMat.py index 77c814dab5..1eb6211600 100644 --- a/nipype/interfaces/vista/tests/test_auto_VtoMat.py +++ b/nipype/interfaces/vista/tests/test_auto_VtoMat.py @@ -26,7 +26,7 @@ def test_VtoMat_inputs(): terminal_output=dict(nohash=True, ), ) - inputs = VtoMat.input_spec() + inputs = VtoMat._input_spec() for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -36,7 +36,7 @@ def test_VtoMat_inputs(): def test_VtoMat_outputs(): output_map = dict(out_file=dict(), ) - outputs = VtoMat.output_spec() + outputs = VtoMat._output_spec() for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): diff --git a/nipype/interfaces/vista/vista.py b/nipype/interfaces/vista/vista.py index fdb054a5ad..9fd7e9a91f 100644 --- a/nipype/interfaces/vista/vista.py +++ b/nipype/interfaces/vista/vista.py @@ -42,8 +42,8 @@ class Vnifti2Image(CommandLine): """ _cmd = 'vnifti2image' - input_spec = Vnifti2ImageInputSpec - output_spec = Vnifti2ImageOutputSpec + _input_spec = Vnifti2ImageInputSpec + _output_spec = Vnifti2ImageOutputSpec class VtoMatInputSpec(CommandLineInputSpec): @@ -71,5 +71,5 @@ class VtoMat(CommandLine): """ _cmd = 'vtomat' - input_spec = VtoMatInputSpec - output_spec = VtoMatOutputSpec + _input_spec = VtoMatInputSpec + _output_spec = VtoMatOutputSpec diff --git a/nipype/pipeline/engine/tests/test_engine.py b/nipype/pipeline/engine/tests/test_engine.py index 846ab23112..55a4b75a3f 100644 --- a/nipype/pipeline/engine/tests/test_engine.py +++ b/nipype/pipeline/engine/tests/test_engine.py @@ -26,8 +26,8 @@ class OutputSpec(nib.TraitedSpec): class TestInterface(nib.BaseInterface): - input_spec = InputSpec - output_spec = OutputSpec + _input_spec = InputSpec + _output_spec = OutputSpec def _run_interface(self, runtime): runtime.returncode = 0 diff --git a/nipype/pipeline/engine/tests/test_join.py b/nipype/pipeline/engine/tests/test_join.py index 2933406144..6f75d5894f 100644 --- a/nipype/pipeline/engine/tests/test_join.py +++ b/nipype/pipeline/engine/tests/test_join.py @@ -24,8 +24,8 @@ class PickFirstOutSpec(nib.TraitedSpec): class PickFirst(nib.BaseInterface): - input_spec = PickFirstSpec - output_spec = PickFirstOutSpec + _input_spec = PickFirstSpec + _output_spec = PickFirstOutSpec def _run_interface(self, runtime): runtime.returncode = 0 @@ -45,8 +45,8 @@ class IncrementOutputSpec(nib.TraitedSpec): class IncrementInterface(nib.BaseInterface): - input_spec = IncrementInputSpec - output_spec = IncrementOutputSpec + _input_spec = IncrementInputSpec + _output_spec = IncrementOutputSpec def _run_interface(self, runtime): runtime.returncode = 0 @@ -70,8 +70,8 @@ class SumOutputSpec(nib.TraitedSpec): class SumInterface(nib.BaseInterface): - input_spec = SumInputSpec - output_spec = SumOutputSpec + _input_spec = SumInputSpec + _output_spec = SumOutputSpec def _run_interface(self, runtime): runtime.returncode = 0 @@ -99,8 +99,8 @@ class SetOutputSpec(nib.TraitedSpec): class SetInterface(nib.BaseInterface): - input_spec = SetInputSpec - output_spec = SetOutputSpec + _input_spec = SetInputSpec + _output_spec = SetOutputSpec def _run_interface(self, runtime): runtime.returncode = 0 @@ -125,8 +125,8 @@ class ProductOutputSpec(nib.TraitedSpec): class ProductInterface(nib.BaseInterface): - input_spec = ProductInputSpec - output_spec = ProductOutputSpec + _input_spec = ProductInputSpec + _output_spec = ProductOutputSpec def _run_interface(self, runtime): runtime.returncode = 0 diff --git a/nipype/pipeline/engine/tests/test_utils.py b/nipype/pipeline/engine/tests/test_utils.py index 8865249b39..74b7719e68 100644 --- a/nipype/pipeline/engine/tests/test_utils.py +++ b/nipype/pipeline/engine/tests/test_utils.py @@ -141,8 +141,8 @@ class OutputSpec(nib.TraitedSpec): class TestInterface(nib.BaseInterface): - input_spec = InputSpec - output_spec = OutputSpec + _input_spec = InputSpec + _output_spec = OutputSpec def _run_interface(self, runtime): runtime.returncode = 0 diff --git a/nipype/pipeline/plugins/tests/test_debug.py b/nipype/pipeline/plugins/tests/test_debug.py index 4a8484cbd1..5299b04b62 100644 --- a/nipype/pipeline/plugins/tests/test_debug.py +++ b/nipype/pipeline/plugins/tests/test_debug.py @@ -17,8 +17,8 @@ class OutputSpec(nib.TraitedSpec): class TestInterface(nib.BaseInterface): - input_spec = InputSpec - output_spec = OutputSpec + _input_spec = InputSpec + _output_spec = OutputSpec def _run_interface(self, runtime): runtime.returncode = 0 diff --git a/nipype/pipeline/plugins/tests/test_linear.py b/nipype/pipeline/plugins/tests/test_linear.py index 1b049771e3..3cff6bb894 100644 --- a/nipype/pipeline/plugins/tests/test_linear.py +++ b/nipype/pipeline/plugins/tests/test_linear.py @@ -17,8 +17,8 @@ class OutputSpec(nib.TraitedSpec): class TestInterface(nib.BaseInterface): - input_spec = InputSpec - output_spec = OutputSpec + _input_spec = InputSpec + _output_spec = OutputSpec def _run_interface(self, runtime): runtime.returncode = 0 diff --git a/nipype/pipeline/plugins/tests/test_multiproc.py b/nipype/pipeline/plugins/tests/test_multiproc.py index 9cba7d1efe..fb8c34fdb8 100644 --- a/nipype/pipeline/plugins/tests/test_multiproc.py +++ b/nipype/pipeline/plugins/tests/test_multiproc.py @@ -17,8 +17,8 @@ class OutputSpec(nib.TraitedSpec): class TestInterface(nib.BaseInterface): - input_spec = InputSpec - output_spec = OutputSpec + _input_spec = InputSpec + _output_spec = OutputSpec def _run_interface(self, runtime): runtime.returncode = 0 diff --git a/nipype/pipeline/plugins/tests/test_oar.py b/nipype/pipeline/plugins/tests/test_oar.py index 59d6e45452..9488370ccf 100644 --- a/nipype/pipeline/plugins/tests/test_oar.py +++ b/nipype/pipeline/plugins/tests/test_oar.py @@ -17,8 +17,8 @@ class OutputSpec(nib.TraitedSpec): class TestInterface(nib.BaseInterface): - input_spec = InputSpec - output_spec = OutputSpec + _input_spec = InputSpec + _output_spec = OutputSpec def _run_interface(self, runtime): runtime.returncode = 0 diff --git a/nipype/pipeline/plugins/tests/test_pbs.py b/nipype/pipeline/plugins/tests/test_pbs.py index 5fbaa1b7e8..55d7efc20b 100644 --- a/nipype/pipeline/plugins/tests/test_pbs.py +++ b/nipype/pipeline/plugins/tests/test_pbs.py @@ -18,8 +18,8 @@ class OutputSpec(nib.TraitedSpec): class TestInterface(nib.BaseInterface): - input_spec = InputSpec - output_spec = OutputSpec + _input_spec = InputSpec + _output_spec = OutputSpec def _run_interface(self, runtime): runtime.returncode = 0 diff --git a/nipype/pipeline/plugins/tests/test_somaflow.py b/nipype/pipeline/plugins/tests/test_somaflow.py index 0025d214c3..1cdc31d14d 100644 --- a/nipype/pipeline/plugins/tests/test_somaflow.py +++ b/nipype/pipeline/plugins/tests/test_somaflow.py @@ -20,8 +20,8 @@ class OutputSpec(nib.TraitedSpec): class TestInterface(nib.BaseInterface): - input_spec = InputSpec - output_spec = OutputSpec + _input_spec = InputSpec + _output_spec = OutputSpec def _run_interface(self, runtime): runtime.returncode = 0 diff --git a/nipype/utils/nipype2boutiques.py b/nipype/utils/nipype2boutiques.py index 60a17b48ba..728f10876f 100644 --- a/nipype/utils/nipype2boutiques.py +++ b/nipype/utils/nipype2boutiques.py @@ -66,8 +66,8 @@ def generate_boutiques_descriptor(module, interface_name, ignored_template_input # Retrieves Nipype interface __import__(module) interface = getattr(sys.modules[module], interface_name)() - inputs = interface.input_spec() - outputs = interface.output_spec() + inputs = interface._input_spec() + outputs = interface._output_spec() # Tool description tool_desc = {} diff --git a/nipype/utils/nipype_cmd.py b/nipype/utils/nipype_cmd.py index 9bdfd7df91..c196d9cd47 100644 --- a/nipype/utils/nipype_cmd.py +++ b/nipype/utils/nipype_cmd.py @@ -23,7 +23,7 @@ def add_options(parser=None, module=None, function=None): __import__(module) interface = getattr(sys.modules[module], function)() - inputs = interface.input_spec() + inputs = interface._input_spec() for name, spec in sorted(interface.inputs.traits(transient=None).items()): desc = "\n".join(interface._get_trait_desc(inputs, name, spec))[len(name) + 2:] args = {} diff --git a/tools/checkspecs.py b/tools/checkspecs.py index 24ae1f9e1c..6feca1bf90 100644 --- a/tools/checkspecs.py +++ b/tools/checkspecs.py @@ -214,7 +214,7 @@ def test_specs(self, uri): ''] cmd.append('\ndef test_%s_inputs():' % c) input_fields = '' - for traitname, trait in sorted(classinst.input_spec().traits(transient=None).items()): + for traitname, trait in sorted(classinst._input_spec().traits(transient=None).items()): input_fields += '%s=dict(' % traitname for key, value in sorted(trait.__dict__.items()): if key in in_built or key == 'desc': @@ -229,7 +229,7 @@ def test_specs(self, uri): input_fields += "%s=%s,\n " % (key, value) input_fields += '),\n ' cmd += [' input_map = dict(%s)' % input_fields] - cmd += [' inputs = %s.input_spec()' % c] + cmd += [' inputs = %s._input_spec()' % c] cmd += [""" for key, metadata in list(input_map.items()): for metakey, value in list(metadata.items()): @@ -238,7 +238,7 @@ def test_specs(self, uri): else: print('%s has nonautotest' % c) - for traitname, trait in sorted(classinst.input_spec().traits(transient=None).items()): + for traitname, trait in sorted(classinst._input_spec().traits(transient=None).items()): for key in sorted(trait.__dict__): if key in in_built: continue @@ -251,14 +251,14 @@ def test_specs(self, uri): if key == 'mandatory' and trait.mandatory is not None and not trait.mandatory: bad_specs.append([uri, c, 'Inputs', traitname, 'mandatory=False']) - if not classinst.output_spec: + if not classinst._output_spec: continue if not os.path.exists(nonautotest): with open(testfile, 'at') as fp: cmd = ['\ndef test_%s_outputs():' % c] input_fields = '' - for traitname, trait in sorted(classinst.output_spec().traits(transient=None).items()): + for traitname, trait in sorted(classinst._output_spec().traits(transient=None).items()): input_fields += '%s=dict(' % traitname for key, value in sorted(trait.__dict__.items()): if key in in_built or key == 'desc': @@ -273,14 +273,14 @@ def test_specs(self, uri): input_fields += "%s=%s,\n " % (key, value) input_fields += '),\n ' cmd += [' output_map = dict(%s)' % input_fields] - cmd += [' outputs = %s.output_spec()' % c] + cmd += [' outputs = %s._output_spec()' % c] cmd += [""" for key, metadata in list(output_map.items()): for metakey, value in list(metadata.items()): yield assert_equal, getattr(outputs.traits()[key], metakey), value"""] fp.writelines('\n'.join(cmd) + '\n') - for traitname, trait in sorted(classinst.output_spec().traits(transient=None).items()): + for traitname, trait in sorted(classinst._output_spec().traits(transient=None).items()): for key in sorted(trait.__dict__): if key in in_built: continue From 4638149817292649614b13821d07d8f8ee08b581 Mon Sep 17 00:00:00 2001 From: oesteban Date: Mon, 22 Feb 2016 09:03:27 -0800 Subject: [PATCH 68/73] make specs --- .../algorithms/tests/test_auto_AddCSVRow.py | 3 -- nipype/algorithms/tests/test_auto_AddNoise.py | 3 +- .../tests/test_auto_ArtifactDetect.py | 3 -- .../algorithms/tests/test_auto_CreateNifti.py | 6 +-- nipype/algorithms/tests/test_auto_Distance.py | 5 +-- nipype/algorithms/tests/test_auto_ErrorMap.py | 33 ++++++++++++++ .../tests/test_auto_FuzzyOverlap.py | 5 +-- nipype/algorithms/tests/test_auto_Gunzip.py | 8 ++-- .../tests/test_auto_MeshWarpMaths.py | 3 +- .../tests/test_auto_ModifyAffine.py | 5 +-- nipype/algorithms/tests/test_auto_Overlap.py | 44 +++++++++++++++++++ .../algorithms/tests/test_auto_PickAtlas.py | 3 -- .../algorithms/tests/test_auto_Similarity.py | 5 +-- .../tests/test_auto_SimpleThreshold.py | 5 +-- .../tests/test_auto_SpecifyModel.py | 3 -- .../tests/test_auto_SpecifySPMModel.py | 3 -- .../tests/test_auto_SpecifySparseModel.py | 3 -- .../tests/test_auto_StimulusCorrelation.py | 3 -- nipype/algorithms/tests/test_auto_TSNR.py | 3 -- .../tests/test_auto_TVTKBaseInterface.py | 21 +++++++++ .../algorithms/tests/test_auto_WarpPoints.py | 6 +-- .../afni/tests/test_auto_AFNICommand.py | 8 ---- .../afni/tests/test_auto_AFNICommandBase.py | 8 ---- .../afni/tests/test_auto_AFNItoNIFTI.py | 8 ---- .../afni/tests/test_auto_Allineate.py | 8 ---- .../afni/tests/test_auto_AutoTcorrelate.py | 9 +--- .../afni/tests/test_auto_Autobox.py | 8 ---- .../afni/tests/test_auto_Automask.py | 8 ---- .../afni/tests/test_auto_Bandpass.py | 8 ---- .../afni/tests/test_auto_BlurInMask.py | 12 ++--- .../afni/tests/test_auto_BrickStat.py | 8 ---- .../interfaces/afni/tests/test_auto_Calc.py | 8 ---- .../interfaces/afni/tests/test_auto_Copy.py | 8 ---- .../afni/tests/test_auto_Despike.py | 12 ++--- .../afni/tests/test_auto_Detrend.py | 12 ++--- .../interfaces/afni/tests/test_auto_Eval.py | 8 ---- .../interfaces/afni/tests/test_auto_FWHMx.py | 10 +---- nipype/interfaces/afni/tests/test_auto_Fim.py | 8 ---- .../afni/tests/test_auto_Fourier.py | 8 ---- .../interfaces/afni/tests/test_auto_Hist.py | 12 ++--- .../afni/tests/test_auto_Maskave.py | 9 +--- .../interfaces/afni/tests/test_auto_Means.py | 8 ---- .../interfaces/afni/tests/test_auto_Merge.py | 8 ---- .../afni/tests/test_auto_ROIStats.py | 6 --- .../interfaces/afni/tests/test_auto_Refit.py | 8 ---- .../afni/tests/test_auto_Resample.py | 12 ++--- .../afni/tests/test_auto_Retroicor.py | 8 ---- .../afni/tests/test_auto_SVMTest.py | 8 ---- .../afni/tests/test_auto_SVMTrain.py | 8 ---- .../afni/tests/test_auto_SkullStrip.py | 8 ---- .../interfaces/afni/tests/test_auto_TCat.py | 8 ---- .../afni/tests/test_auto_TCorr1D.py | 9 +--- .../afni/tests/test_auto_TCorrMap.py | 8 ---- .../afni/tests/test_auto_TCorrelate.py | 8 ---- .../interfaces/afni/tests/test_auto_TShift.py | 9 +--- .../interfaces/afni/tests/test_auto_TStat.py | 12 ++--- .../interfaces/afni/tests/test_auto_To3D.py | 11 +---- .../interfaces/afni/tests/test_auto_Volreg.py | 11 ++--- .../interfaces/afni/tests/test_auto_Warp.py | 9 +--- .../interfaces/afni/tests/test_auto_ZCutUp.py | 8 ---- .../interfaces/ants/tests/test_auto_ANTS.py | 8 ---- .../ants/tests/test_auto_ANTSCommand.py | 8 ---- .../ants/tests/test_auto_AntsJointFusion.py | 8 ---- .../ants/tests/test_auto_ApplyTransforms.py | 8 ---- .../test_auto_ApplyTransformsToPoints.py | 8 ---- .../ants/tests/test_auto_Atropos.py | 8 ---- .../tests/test_auto_AverageAffineTransform.py | 8 ---- .../ants/tests/test_auto_AverageImages.py | 8 ---- .../ants/tests/test_auto_BrainExtraction.py | 8 ---- .../test_auto_ConvertScalarImageToRGB.py | 8 ---- .../ants/tests/test_auto_CorticalThickness.py | 8 ---- .../ants/tests/test_auto_CreateTiledMosaic.py | 8 ---- .../ants/tests/test_auto_DenoiseImage.py | 8 ---- .../ants/tests/test_auto_GenWarpFields.py | 8 ---- .../tests/test_auto_JacobianDeterminant.py | 8 ---- .../ants/tests/test_auto_JointFusion.py | 8 ---- .../tests/test_auto_LaplacianThickness.py | 8 ---- .../ants/tests/test_auto_MultiplyImages.py | 8 ---- .../tests/test_auto_N4BiasFieldCorrection.py | 8 ---- .../ants/tests/test_auto_Registration.py | 8 ---- .../test_auto_WarpImageMultiTransform.py | 8 ---- ..._auto_WarpTimeSeriesImageMultiTransform.py | 8 ---- .../tests/test_auto_antsBrainExtraction.py | 8 ---- .../tests/test_auto_antsCorticalThickness.py | 8 ---- .../ants/tests/test_auto_antsIntroduction.py | 8 ---- .../tests/test_auto_buildtemplateparallel.py | 8 ---- .../base/tests/test_auto_BaseInterface.py | 21 +++++++++ .../base/tests/test_auto_CommandLine.py | 23 ++++++++++ .../base/tests/test_auto_MpiCommandLine.py | 26 +++++++++++ .../tests/test_auto_SEMLikeCommandLine.py | 23 ++++++++++ .../base/tests/test_auto_StdOutCommandLine.py | 28 ++++++++++++ .../camino/tests/test_auto_AnalyzeHeader.py | 8 ---- .../tests/test_auto_ComputeEigensystem.py | 8 ---- .../test_auto_ComputeFractionalAnisotropy.py | 8 ---- .../tests/test_auto_ComputeMeanDiffusivity.py | 8 ---- .../tests/test_auto_ComputeTensorTrace.py | 8 ---- .../camino/tests/test_auto_Conmat.py | 8 ---- .../camino/tests/test_auto_DT2NIfTI.py | 8 ---- .../camino/tests/test_auto_DTIFit.py | 8 ---- .../camino/tests/test_auto_DTLUTGen.py | 8 ---- .../camino/tests/test_auto_DTMetric.py | 8 ---- .../camino/tests/test_auto_FSL2Scheme.py | 8 ---- .../camino/tests/test_auto_Image2Voxel.py | 8 ---- .../camino/tests/test_auto_ImageStats.py | 8 ---- .../camino/tests/test_auto_LinRecon.py | 8 ---- .../interfaces/camino/tests/test_auto_MESD.py | 8 ---- .../camino/tests/test_auto_ModelFit.py | 8 ---- .../camino/tests/test_auto_NIfTIDT2Camino.py | 8 ---- .../camino/tests/test_auto_PicoPDFs.py | 8 ---- .../camino/tests/test_auto_ProcStreamlines.py | 8 ---- .../camino/tests/test_auto_QBallMX.py | 8 ---- .../camino/tests/test_auto_SFLUTGen.py | 8 ---- .../camino/tests/test_auto_SFPICOCalibData.py | 8 ---- .../camino/tests/test_auto_SFPeaks.py | 8 ---- .../camino/tests/test_auto_Shredder.py | 8 ---- .../camino/tests/test_auto_Track.py | 8 ---- .../camino/tests/test_auto_TrackBallStick.py | 8 ---- .../camino/tests/test_auto_TrackBayesDirac.py | 8 ---- .../tests/test_auto_TrackBedpostxDeter.py | 8 ---- .../tests/test_auto_TrackBedpostxProba.py | 8 ---- .../camino/tests/test_auto_TrackBootstrap.py | 8 ---- .../camino/tests/test_auto_TrackDT.py | 8 ---- .../camino/tests/test_auto_TrackPICo.py | 8 ---- .../camino/tests/test_auto_TractShredder.py | 8 ---- .../camino/tests/test_auto_VtkStreamlines.py | 8 ---- .../tests/test_auto_Camino2Trackvis.py | 8 ---- .../tests/test_auto_Trackvis2Camino.py | 8 ---- .../cmtk/tests/test_auto_AverageNetworks.py | 3 -- .../cmtk/tests/test_auto_CFFConverter.py | 3 -- .../cmtk/tests/test_auto_CreateNodes.py | 5 +-- .../cmtk/tests/test_auto_MergeCNetworks.py | 5 +-- .../tests/test_auto_NetworkBasedStatistic.py | 3 -- .../cmtk/tests/test_auto_NetworkXMetrics.py | 3 -- .../cmtk/tests/test_auto_Parcellate.py | 3 -- .../interfaces/cmtk/tests/test_auto_ROIGen.py | 3 -- .../tests/test_auto_DTIRecon.py | 8 ---- .../tests/test_auto_DTITracker.py | 8 ---- .../tests/test_auto_HARDIMat.py | 8 ---- .../tests/test_auto_ODFRecon.py | 8 ---- .../tests/test_auto_ODFTracker.py | 8 ---- .../tests/test_auto_SplineFilter.py | 8 ---- .../tests/test_auto_TrackMerge.py | 8 ---- nipype/interfaces/dipy/tests/test_auto_CSD.py | 3 -- nipype/interfaces/dipy/tests/test_auto_DTI.py | 3 -- .../dipy/tests/test_auto_DipyBaseInterface.py | 5 +-- .../tests/test_auto_DipyDiffusionInterface.py | 3 -- .../tests/test_auto_EstimateResponseSH.py | 3 -- .../dipy/tests/test_auto_RESTORE.py | 3 -- .../tests/test_auto_SimulateMultiTensor.py | 3 -- .../tests/test_auto_StreamlineTractography.py | 3 -- .../dipy/tests/test_auto_TensorMode.py | 3 -- .../dipy/tests/test_auto_TrackDensityMap.py | 3 -- .../elastix/tests/test_auto_AnalyzeWarp.py | 8 ---- .../elastix/tests/test_auto_ApplyWarp.py | 8 ---- .../elastix/tests/test_auto_EditTransform.py | 5 +-- .../elastix/tests/test_auto_PointsWarp.py | 8 ---- .../elastix/tests/test_auto_Registration.py | 8 ---- .../freesurfer/tests/test_auto_ApplyMask.py | 8 ---- .../tests/test_auto_ApplyVolTransform.py | 8 ---- .../freesurfer/tests/test_auto_BBRegister.py | 8 ---- .../freesurfer/tests/test_auto_Binarize.py | 8 ---- .../freesurfer/tests/test_auto_Concatenate.py | 8 ---- .../tests/test_auto_DICOMConvert.py | 8 ---- .../tests/test_auto_ExtractMainComponent.py | 8 ---- .../freesurfer/tests/test_auto_FSCommand.py | 8 ---- .../freesurfer/tests/test_auto_FitMSParams.py | 8 ---- .../freesurfer/tests/test_auto_GLMFit.py | 8 ---- .../freesurfer/tests/test_auto_ImageInfo.py | 8 ---- .../freesurfer/tests/test_auto_Label2Vol.py | 8 ---- .../freesurfer/tests/test_auto_MRIConvert.py | 8 ---- .../tests/test_auto_MRIMarchingCubes.py | 8 ---- .../freesurfer/tests/test_auto_MRIPretess.py | 8 ---- .../freesurfer/tests/test_auto_MRISPreproc.py | 8 ---- .../tests/test_auto_MRITessellate.py | 8 ---- .../freesurfer/tests/test_auto_MRIsConvert.py | 8 ---- .../freesurfer/tests/test_auto_MS_LDA.py | 8 ---- .../tests/test_auto_MakeAverageSubject.py | 8 ---- .../tests/test_auto_OneSampleTTest.py | 8 ---- .../tests/test_auto_ParseDICOMDir.py | 8 ---- .../freesurfer/tests/test_auto_ReconAll.py | 8 ---- .../freesurfer/tests/test_auto_Resample.py | 8 ---- .../tests/test_auto_RobustRegister.py | 8 ---- .../tests/test_auto_SampleToSurface.py | 8 ---- .../freesurfer/tests/test_auto_SegStats.py | 8 ---- .../freesurfer/tests/test_auto_Smooth.py | 8 ---- .../tests/test_auto_SmoothTessellation.py | 8 ---- .../tests/test_auto_Surface2VolTransform.py | 8 ---- .../tests/test_auto_SurfaceSmooth.py | 8 ---- .../tests/test_auto_SurfaceSnapshots.py | 8 ---- .../tests/test_auto_SurfaceTransform.py | 8 ---- .../tests/test_auto_SynthesizeFLASH.py | 8 ---- .../freesurfer/tests/test_auto_Tkregister2.py | 8 ---- .../tests/test_auto_UnpackSDICOMDir.py | 8 ---- .../fsl/tests/test_auto_ApplyMask.py | 8 ---- .../fsl/tests/test_auto_ApplyTOPUP.py | 8 ---- .../fsl/tests/test_auto_ApplyWarp.py | 8 ---- .../fsl/tests/test_auto_ApplyXfm.py | 8 ---- .../interfaces/fsl/tests/test_auto_AvScale.py | 8 ---- .../fsl/tests/test_auto_BEDPOSTX4.py | 8 ---- .../fsl/tests/test_auto_BEDPOSTX5.py | 17 +++---- nipype/interfaces/fsl/tests/test_auto_BET.py | 20 ++++----- .../fsl/tests/test_auto_BinaryMaths.py | 8 ---- .../fsl/tests/test_auto_ChangeDataType.py | 8 ---- .../interfaces/fsl/tests/test_auto_Cluster.py | 8 ---- .../interfaces/fsl/tests/test_auto_Complex.py | 8 ---- .../fsl/tests/test_auto_ContrastMgr.py | 8 ---- .../fsl/tests/test_auto_ConvertWarp.py | 8 ---- .../fsl/tests/test_auto_ConvertXFM.py | 8 ---- .../fsl/tests/test_auto_CopyGeom.py | 8 ---- .../interfaces/fsl/tests/test_auto_DTIFit.py | 39 ++++++++-------- .../fsl/tests/test_auto_DilateImage.py | 8 ---- .../fsl/tests/test_auto_DistanceMap.py | 9 ---- .../fsl/tests/test_auto_EPIDeWarp.py | 8 ---- nipype/interfaces/fsl/tests/test_auto_Eddy.py | 8 ---- .../fsl/tests/test_auto_EddyCorrect.py | 8 ---- .../interfaces/fsl/tests/test_auto_EpiReg.py | 42 ++++++++++-------- .../fsl/tests/test_auto_ErodeImage.py | 8 ---- .../fsl/tests/test_auto_ExtractROI.py | 8 ---- nipype/interfaces/fsl/tests/test_auto_FAST.py | 9 +--- nipype/interfaces/fsl/tests/test_auto_FEAT.py | 8 ---- .../fsl/tests/test_auto_FEATModel.py | 8 ---- .../fsl/tests/test_auto_FEATRegister.py | 3 -- .../interfaces/fsl/tests/test_auto_FIRST.py | 8 ---- .../interfaces/fsl/tests/test_auto_FLAMEO.py | 8 ---- .../interfaces/fsl/tests/test_auto_FLIRT.py | 8 ---- .../interfaces/fsl/tests/test_auto_FNIRT.py | 8 ---- .../fsl/tests/test_auto_FSLCommand.py | 8 ---- .../fsl/tests/test_auto_FSLXCommand.py | 17 +++---- .../interfaces/fsl/tests/test_auto_FUGUE.py | 8 ---- .../fsl/tests/test_auto_FilterRegressor.py | 8 ---- .../fsl/tests/test_auto_FindTheBiggest.py | 8 ---- nipype/interfaces/fsl/tests/test_auto_GLM.py | 8 ---- .../fsl/tests/test_auto_ImageMaths.py | 8 ---- .../fsl/tests/test_auto_ImageMeants.py | 8 ---- .../fsl/tests/test_auto_ImageStats.py | 8 ---- .../interfaces/fsl/tests/test_auto_InvWarp.py | 8 ---- .../fsl/tests/test_auto_IsotropicSmooth.py | 8 ---- .../interfaces/fsl/tests/test_auto_L2Model.py | 5 +-- .../fsl/tests/test_auto_Level1Design.py | 3 -- .../interfaces/fsl/tests/test_auto_MCFLIRT.py | 9 ---- .../interfaces/fsl/tests/test_auto_MELODIC.py | 8 ---- .../fsl/tests/test_auto_MakeDyadicVectors.py | 8 ---- .../fsl/tests/test_auto_MathsCommand.py | 8 ---- .../fsl/tests/test_auto_MaxImage.py | 8 ---- .../fsl/tests/test_auto_MeanImage.py | 8 ---- .../interfaces/fsl/tests/test_auto_Merge.py | 8 ---- .../fsl/tests/test_auto_MotionOutliers.py | 8 ---- .../fsl/tests/test_auto_MultiImageMaths.py | 8 ---- .../tests/test_auto_MultipleRegressDesign.py | 3 -- .../interfaces/fsl/tests/test_auto_Overlay.py | 8 ---- .../interfaces/fsl/tests/test_auto_PRELUDE.py | 8 ---- .../fsl/tests/test_auto_PlotMotionParams.py | 8 ---- .../fsl/tests/test_auto_PlotTimeSeries.py | 8 ---- .../fsl/tests/test_auto_PowerSpectrum.py | 8 ---- .../fsl/tests/test_auto_PrepareFieldmap.py | 8 ---- .../fsl/tests/test_auto_ProbTrackX.py | 8 ---- .../fsl/tests/test_auto_ProbTrackX2.py | 8 ---- .../fsl/tests/test_auto_ProjThresh.py | 8 ---- .../fsl/tests/test_auto_Randomise.py | 8 ---- .../fsl/tests/test_auto_Reorient2Std.py | 8 ---- .../fsl/tests/test_auto_RobustFOV.py | 8 ---- nipype/interfaces/fsl/tests/test_auto_SMM.py | 19 ++++---- .../interfaces/fsl/tests/test_auto_SUSAN.py | 8 ---- .../interfaces/fsl/tests/test_auto_SigLoss.py | 8 ---- .../fsl/tests/test_auto_SliceTimer.py | 8 ---- .../interfaces/fsl/tests/test_auto_Slicer.py | 8 ---- .../interfaces/fsl/tests/test_auto_Smooth.py | 8 ---- .../fsl/tests/test_auto_SmoothEstimate.py | 8 ---- .../fsl/tests/test_auto_SpatialFilter.py | 8 ---- .../interfaces/fsl/tests/test_auto_Split.py | 8 ---- .../fsl/tests/test_auto_SwapDimensions.py | 8 ---- .../interfaces/fsl/tests/test_auto_TOPUP.py | 8 ---- .../fsl/tests/test_auto_TemporalFilter.py | 8 ---- .../fsl/tests/test_auto_Threshold.py | 8 ---- .../fsl/tests/test_auto_TractSkeleton.py | 8 ---- .../fsl/tests/test_auto_UnaryMaths.py | 8 ---- .../interfaces/fsl/tests/test_auto_VecReg.py | 8 ---- .../fsl/tests/test_auto_WarpPoints.py | 8 ---- .../fsl/tests/test_auto_WarpPointsToStd.py | 8 ---- .../fsl/tests/test_auto_WarpUtils.py | 8 ---- .../fsl/tests/test_auto_XFibres4.py | 8 ---- .../fsl/tests/test_auto_XFibres5.py | 17 +++---- .../minc/tests/test_auto_Average.py | 8 ---- .../interfaces/minc/tests/test_auto_BBox.py | 8 ---- .../interfaces/minc/tests/test_auto_Beast.py | 8 ---- .../minc/tests/test_auto_BestLinReg.py | 8 ---- .../minc/tests/test_auto_BigAverage.py | 8 ---- .../interfaces/minc/tests/test_auto_Blob.py | 8 ---- .../interfaces/minc/tests/test_auto_Blur.py | 8 ---- .../interfaces/minc/tests/test_auto_Calc.py | 8 ---- .../minc/tests/test_auto_Convert.py | 8 ---- .../interfaces/minc/tests/test_auto_Copy.py | 8 ---- .../interfaces/minc/tests/test_auto_Dump.py | 8 ---- .../minc/tests/test_auto_Extract.py | 8 ---- .../minc/tests/test_auto_Gennlxfm.py | 8 ---- .../interfaces/minc/tests/test_auto_Math.py | 8 ---- .../interfaces/minc/tests/test_auto_NlpFit.py | 8 ---- .../interfaces/minc/tests/test_auto_Norm.py | 8 ---- nipype/interfaces/minc/tests/test_auto_Pik.py | 8 ---- .../minc/tests/test_auto_Resample.py | 8 ---- .../minc/tests/test_auto_Reshape.py | 8 ---- .../interfaces/minc/tests/test_auto_ToEcat.py | 8 ---- .../interfaces/minc/tests/test_auto_ToRaw.py | 8 ---- .../minc/tests/test_auto_VolSymm.py | 8 ---- .../minc/tests/test_auto_Volcentre.py | 8 ---- .../interfaces/minc/tests/test_auto_Voliso.py | 8 ---- .../interfaces/minc/tests/test_auto_Volpad.py | 8 ---- .../interfaces/minc/tests/test_auto_XfmAvg.py | 8 ---- .../minc/tests/test_auto_XfmConcat.py | 8 ---- .../minc/tests/test_auto_XfmInvert.py | 8 ---- .../test_auto_JistBrainMgdmSegmentation.py | 8 ---- ...est_auto_JistBrainMp2rageDuraEstimation.py | 8 ---- ...est_auto_JistBrainMp2rageSkullStripping.py | 8 ---- .../test_auto_JistBrainPartialVolumeFilter.py | 8 ---- ...est_auto_JistCortexSurfaceMeshInflation.py | 8 ---- .../test_auto_JistIntensityMp2rageMasking.py | 8 ---- .../test_auto_JistLaminarProfileCalculator.py | 8 ---- .../test_auto_JistLaminarProfileGeometry.py | 8 ---- .../test_auto_JistLaminarProfileSampling.py | 8 ---- .../test_auto_JistLaminarROIAveraging.py | 8 ---- ...test_auto_JistLaminarVolumetricLayering.py | 8 ---- ...test_auto_MedicAlgorithmImageCalculator.py | 8 ---- .../test_auto_MedicAlgorithmLesionToads.py | 8 ---- .../test_auto_MedicAlgorithmMipavReorient.py | 8 ---- .../mipav/tests/test_auto_MedicAlgorithmN3.py | 8 ---- .../test_auto_MedicAlgorithmSPECTRE2010.py | 8 ---- ...uto_MedicAlgorithmThresholdToBinaryMask.py | 8 ---- .../mipav/tests/test_auto_RandomVol.py | 8 ---- .../mne/tests/test_auto_WatershedBEM.py | 8 ---- ..._auto_ConstrainedSphericalDeconvolution.py | 8 ---- .../test_auto_DWI2SphericalHarmonicsImage.py | 8 ---- .../mrtrix/tests/test_auto_DWI2Tensor.py | 8 ---- ...est_auto_DiffusionTensorStreamlineTrack.py | 8 ---- .../tests/test_auto_Directions2Amplitude.py | 8 ---- .../mrtrix/tests/test_auto_Erode.py | 8 ---- .../tests/test_auto_EstimateResponseForSH.py | 8 ---- .../mrtrix/tests/test_auto_FilterTracks.py | 8 ---- .../mrtrix/tests/test_auto_FindShPeaks.py | 8 ---- .../tests/test_auto_GenerateDirections.py | 8 ---- .../test_auto_GenerateWhiteMatterMask.py | 8 ---- .../mrtrix/tests/test_auto_MRConvert.py | 8 ---- .../mrtrix/tests/test_auto_MRMultiply.py | 8 ---- .../mrtrix/tests/test_auto_MRTransform.py | 8 ---- .../mrtrix/tests/test_auto_MRTrixInfo.py | 8 ---- .../mrtrix/tests/test_auto_MRTrixViewer.py | 8 ---- .../mrtrix/tests/test_auto_MedianFilter3D.py | 8 ---- ...cSphericallyDeconvolutedStreamlineTrack.py | 8 ---- ..._SphericallyDeconvolutedStreamlineTrack.py | 8 ---- .../mrtrix/tests/test_auto_StreamlineTrack.py | 8 ---- .../test_auto_Tensor2ApparentDiffusion.py | 8 ---- .../test_auto_Tensor2FractionalAnisotropy.py | 8 ---- .../mrtrix/tests/test_auto_Tensor2Vector.py | 8 ---- .../mrtrix/tests/test_auto_Threshold.py | 8 ---- .../mrtrix/tests/test_auto_Tracks2Prob.py | 8 ---- .../mrtrix3/tests/test_auto_ACTPrepareFSL.py | 8 ---- .../mrtrix3/tests/test_auto_BrainMask.py | 8 ---- .../tests/test_auto_BuildConnectome.py | 8 ---- .../mrtrix3/tests/test_auto_ComputeTDI.py | 8 ---- .../mrtrix3/tests/test_auto_EstimateFOD.py | 8 ---- .../mrtrix3/tests/test_auto_FitTensor.py | 8 ---- .../mrtrix3/tests/test_auto_Generate5tt.py | 8 ---- .../mrtrix3/tests/test_auto_LabelConfig.py | 8 ---- .../mrtrix3/tests/test_auto_MRTrix3Base.py | 8 ---- .../mrtrix3/tests/test_auto_Mesh2PVE.py | 8 ---- .../tests/test_auto_ReplaceFSwithFIRST.py | 8 ---- .../mrtrix3/tests/test_auto_ResponseSD.py | 8 ---- .../mrtrix3/tests/test_auto_TCK2VTK.py | 8 ---- .../mrtrix3/tests/test_auto_TensorMetrics.py | 8 ---- .../mrtrix3/tests/test_auto_Tractography.py | 8 ---- .../nipy/tests/test_auto_ComputeMask.py | 3 -- .../nipy/tests/test_auto_EstimateContrast.py | 3 -- .../interfaces/nipy/tests/test_auto_FitGLM.py | 3 -- .../nipy/tests/test_auto_FmriRealign4d.py | 3 -- .../nipy/tests/test_auto_Similarity.py | 5 +-- .../tests/test_auto_SpaceTimeRealigner.py | 5 +-- .../interfaces/nipy/tests/test_auto_Trim.py | 3 -- .../tests/test_auto_CoherenceAnalyzer.py | 3 -- ...t_auto_BRAINSPosteriorToContinuousClass.py | 8 ---- .../brains/tests/test_auto_BRAINSTalairach.py | 8 ---- .../tests/test_auto_BRAINSTalairachMask.py | 8 ---- .../test_auto_HistogramMatchingFilter.py | 8 ---- .../brains/tests/test_auto_SimilarityIndex.py | 8 ---- .../diffusion/tests/test_auto_DWIConvert.py | 8 ---- .../tests/test_auto_compareTractInclusion.py | 8 ---- .../diffusion/tests/test_auto_dtiaverage.py | 8 ---- .../diffusion/tests/test_auto_dtiestim.py | 8 ---- .../diffusion/tests/test_auto_dtiprocess.py | 8 ---- .../tests/test_auto_extractNrrdVectorIndex.py | 8 ---- .../tests/test_auto_gtractAnisotropyMap.py | 8 ---- .../tests/test_auto_gtractAverageBvalues.py | 8 ---- .../tests/test_auto_gtractClipAnisotropy.py | 8 ---- .../tests/test_auto_gtractCoRegAnatomy.py | 8 ---- .../tests/test_auto_gtractConcatDwi.py | 8 ---- .../test_auto_gtractCopyImageOrientation.py | 8 ---- .../tests/test_auto_gtractCoregBvalues.py | 8 ---- .../tests/test_auto_gtractCostFastMarching.py | 8 ---- .../tests/test_auto_gtractCreateGuideFiber.py | 8 ---- .../test_auto_gtractFastMarchingTracking.py | 8 ---- .../tests/test_auto_gtractFiberTracking.py | 8 ---- .../tests/test_auto_gtractImageConformity.py | 8 ---- .../test_auto_gtractInvertBSplineTransform.py | 8 ---- ...test_auto_gtractInvertDisplacementField.py | 8 ---- .../test_auto_gtractInvertRigidTransform.py | 8 ---- .../test_auto_gtractResampleAnisotropy.py | 8 ---- .../tests/test_auto_gtractResampleB0.py | 8 ---- .../test_auto_gtractResampleCodeImage.py | 8 ---- .../test_auto_gtractResampleDWIInPlace.py | 8 ---- .../tests/test_auto_gtractResampleFibers.py | 8 ---- .../diffusion/tests/test_auto_gtractTensor.py | 8 ---- ...auto_gtractTransformToDisplacementField.py | 8 ---- .../diffusion/tests/test_auto_maxcurvature.py | 8 ---- .../tests/test_auto_UKFTractography.py | 8 ---- .../tests/test_auto_fiberprocess.py | 8 ---- .../tests/test_auto_fiberstats.py | 8 ---- .../tests/test_auto_fibertrack.py | 8 ---- .../filtering/tests/test_auto_CannyEdge.py | 8 ---- ...to_CannySegmentationLevelSetImageFilter.py | 8 ---- .../filtering/tests/test_auto_DilateImage.py | 8 ---- .../filtering/tests/test_auto_DilateMask.py | 8 ---- .../filtering/tests/test_auto_DistanceMaps.py | 8 ---- .../test_auto_DumpBinaryTrainingVectors.py | 8 ---- .../filtering/tests/test_auto_ErodeImage.py | 8 ---- .../tests/test_auto_FlippedDifference.py | 8 ---- .../test_auto_GenerateBrainClippedImage.py | 8 ---- .../test_auto_GenerateSummedGradientImage.py | 8 ---- .../tests/test_auto_GenerateTestImage.py | 8 ---- ...GradientAnisotropicDiffusionImageFilter.py | 8 ---- .../tests/test_auto_HammerAttributeCreator.py | 8 ---- .../tests/test_auto_NeighborhoodMean.py | 8 ---- .../tests/test_auto_NeighborhoodMedian.py | 8 ---- .../tests/test_auto_STAPLEAnalysis.py | 8 ---- .../test_auto_TextureFromNoiseImageFilter.py | 8 ---- .../tests/test_auto_TextureMeasureFilter.py | 8 ---- .../tests/test_auto_UnbiasedNonLocalMeans.py | 8 ---- .../legacy/tests/test_auto_scalartransform.py | 8 ---- .../tests/test_auto_BRAINSDemonWarp.py | 8 ---- .../registration/tests/test_auto_BRAINSFit.py | 8 ---- .../tests/test_auto_BRAINSResample.py | 8 ---- .../tests/test_auto_BRAINSResize.py | 8 ---- .../test_auto_BRAINSTransformFromFiducials.py | 8 ---- .../tests/test_auto_VBRAINSDemonWarp.py | 8 ---- .../segmentation/tests/test_auto_BRAINSABC.py | 8 ---- .../test_auto_BRAINSConstellationDetector.py | 8 ---- ...BRAINSCreateLabelMapFromProbabilityMaps.py | 8 ---- .../segmentation/tests/test_auto_BRAINSCut.py | 8 ---- .../tests/test_auto_BRAINSMultiSTAPLE.py | 8 ---- .../tests/test_auto_BRAINSROIAuto.py | 8 ---- ...t_auto_BinaryMaskEditorBasedOnLandmarks.py | 8 ---- .../segmentation/tests/test_auto_ESLR.py | 8 ---- .../semtools/tests/test_auto_DWICompare.py | 8 ---- .../tests/test_auto_DWISimpleCompare.py | 8 ---- ...o_GenerateCsfClippedFromClassifiedImage.py | 8 ---- .../tests/test_auto_BRAINSAlignMSP.py | 8 ---- .../tests/test_auto_BRAINSClipInferior.py | 8 ---- .../test_auto_BRAINSConstellationModeler.py | 8 ---- .../tests/test_auto_BRAINSEyeDetector.py | 8 ---- ...est_auto_BRAINSInitializedControlPoints.py | 8 ---- .../test_auto_BRAINSLandmarkInitializer.py | 8 ---- .../test_auto_BRAINSLinearModelerEPCA.py | 8 ---- .../tests/test_auto_BRAINSLmkTransform.py | 8 ---- .../utilities/tests/test_auto_BRAINSMush.py | 8 ---- .../tests/test_auto_BRAINSSnapShotWriter.py | 8 ---- .../tests/test_auto_BRAINSTransformConvert.py | 8 ---- ...st_auto_BRAINSTrimForegroundInDirection.py | 8 ---- .../tests/test_auto_CleanUpOverlapLabels.py | 8 ---- .../tests/test_auto_FindCenterOfBrain.py | 8 ---- ...auto_GenerateLabelMapFromProbabilityMap.py | 8 ---- .../tests/test_auto_ImageRegionPlotter.py | 8 ---- .../tests/test_auto_JointHistogram.py | 8 ---- .../tests/test_auto_ShuffleVectorsModule.py | 8 ---- .../utilities/tests/test_auto_fcsv_to_hdf5.py | 8 ---- .../tests/test_auto_insertMidACPCpoint.py | 8 ---- ...test_auto_landmarksConstellationAligner.py | 8 ---- ...test_auto_landmarksConstellationWeights.py | 8 ---- .../diffusion/tests/test_auto_DTIexport.py | 8 ---- .../diffusion/tests/test_auto_DTIimport.py | 8 ---- .../test_auto_DWIJointRicianLMMSEFilter.py | 8 ---- .../tests/test_auto_DWIRicianLMMSEFilter.py | 8 ---- .../tests/test_auto_DWIToDTIEstimation.py | 8 ---- ..._auto_DiffusionTensorScalarMeasurements.py | 8 ---- ...est_auto_DiffusionWeightedVolumeMasking.py | 8 ---- .../tests/test_auto_ResampleDTIVolume.py | 8 ---- .../test_auto_TractographyLabelMapSeeding.py | 8 ---- .../tests/test_auto_AddScalarVolumes.py | 8 ---- .../tests/test_auto_CastScalarVolume.py | 8 ---- .../tests/test_auto_CheckerBoardFilter.py | 8 ---- ...test_auto_CurvatureAnisotropicDiffusion.py | 8 ---- .../tests/test_auto_ExtractSkeleton.py | 8 ---- .../test_auto_GaussianBlurImageFilter.py | 8 ---- .../test_auto_GradientAnisotropicDiffusion.py | 8 ---- .../test_auto_GrayscaleFillHoleImageFilter.py | 8 ---- ...test_auto_GrayscaleGrindPeakImageFilter.py | 8 ---- .../tests/test_auto_HistogramMatching.py | 8 ---- .../tests/test_auto_ImageLabelCombine.py | 8 ---- .../tests/test_auto_MaskScalarVolume.py | 8 ---- .../tests/test_auto_MedianImageFilter.py | 8 ---- .../tests/test_auto_MultiplyScalarVolumes.py | 8 ---- .../test_auto_N4ITKBiasFieldCorrection.py | 8 ---- ...test_auto_ResampleScalarVectorDWIVolume.py | 8 ---- .../tests/test_auto_SubtractScalarVolumes.py | 8 ---- .../tests/test_auto_ThresholdScalarVolume.py | 8 ---- ...auto_VotingBinaryHoleFillingImageFilter.py | 8 ---- ...est_auto_DWIUnbiasedNonLocalMeansFilter.py | 8 ---- .../tests/test_auto_AffineRegistration.py | 8 ---- ...test_auto_BSplineDeformableRegistration.py | 8 ---- .../test_auto_BSplineToDeformationField.py | 8 ---- .../test_auto_ExpertAutomatedRegistration.py | 8 ---- .../tests/test_auto_LinearRegistration.py | 8 ---- ..._auto_MultiResolutionAffineRegistration.py | 8 ---- .../test_auto_OtsuThresholdImageFilter.py | 8 ---- .../test_auto_OtsuThresholdSegmentation.py | 8 ---- .../tests/test_auto_ResampleScalarVolume.py | 8 ---- .../tests/test_auto_RigidRegistration.py | 8 ---- .../test_auto_IntensityDifferenceMetric.py | 8 ---- ..._auto_PETStandardUptakeValueComputation.py | 8 ---- .../tests/test_auto_ACPCTransform.py | 8 ---- .../tests/test_auto_BRAINSDemonWarp.py | 8 ---- .../registration/tests/test_auto_BRAINSFit.py | 8 ---- .../tests/test_auto_BRAINSResample.py | 8 ---- .../tests/test_auto_FiducialRegistration.py | 8 ---- .../tests/test_auto_VBRAINSDemonWarp.py | 8 ---- .../tests/test_auto_BRAINSROIAuto.py | 8 ---- .../tests/test_auto_EMSegmentCommandLine.py | 8 ---- .../test_auto_RobustStatisticsSegmenter.py | 8 ---- ...st_auto_SimpleRegionGrowingSegmentation.py | 8 ---- .../tests/test_auto_DicomToNrrdConverter.py | 8 ---- ...test_auto_EMSegmentTransformToNewFormat.py | 8 ---- .../tests/test_auto_GrayscaleModelMaker.py | 8 ---- .../tests/test_auto_LabelMapSmoothing.py | 8 ---- .../slicer/tests/test_auto_MergeModels.py | 8 ---- .../slicer/tests/test_auto_ModelMaker.py | 8 ---- .../slicer/tests/test_auto_ModelToLabelMap.py | 8 ---- .../tests/test_auto_OrientScalarVolume.py | 8 ---- .../tests/test_auto_ProbeVolumeWithModel.py | 8 ---- .../tests/test_auto_SlicerCommandLine.py | 8 ---- .../spm/tests/test_auto_Analyze2nii.py | 8 +--- .../spm/tests/test_auto_ApplyDeformations.py | 3 -- .../test_auto_ApplyInverseDeformation.py | 3 -- .../spm/tests/test_auto_ApplyTransform.py | 5 +-- .../spm/tests/test_auto_CalcCoregAffine.py | 5 +-- .../spm/tests/test_auto_Coregister.py | 3 -- .../spm/tests/test_auto_CreateWarped.py | 3 -- .../interfaces/spm/tests/test_auto_DARTEL.py | 5 +-- .../spm/tests/test_auto_DARTELNorm2MNI.py | 3 -- .../spm/tests/test_auto_DicomImport.py | 3 -- .../spm/tests/test_auto_EstimateContrast.py | 3 -- .../spm/tests/test_auto_EstimateModel.py | 3 -- .../spm/tests/test_auto_FactorialDesign.py | 3 -- .../spm/tests/test_auto_Level1Design.py | 3 -- .../test_auto_MultipleRegressionDesign.py | 3 -- .../spm/tests/test_auto_NewSegment.py | 3 -- .../spm/tests/test_auto_Normalize.py | 3 -- .../spm/tests/test_auto_Normalize12.py | 3 -- .../tests/test_auto_OneSampleTTestDesign.py | 3 -- .../spm/tests/test_auto_PairedTTestDesign.py | 3 -- .../interfaces/spm/tests/test_auto_Realign.py | 3 -- .../interfaces/spm/tests/test_auto_Reslice.py | 5 +-- .../spm/tests/test_auto_ResliceToReference.py | 3 -- .../spm/tests/test_auto_SPMCommand.py | 5 +-- .../interfaces/spm/tests/test_auto_Segment.py | 3 -- .../spm/tests/test_auto_SliceTiming.py | 5 +-- .../interfaces/spm/tests/test_auto_Smooth.py | 3 -- .../spm/tests/test_auto_Threshold.py | 3 -- .../tests/test_auto_ThresholdStatistics.py | 3 -- .../tests/test_auto_TwoSampleTTestDesign.py | 3 -- .../spm/tests/test_auto_VBMSegment.py | 3 -- .../interfaces/tests/test_auto_AssertEqual.py | 5 +-- .../tests/test_auto_C3dAffineTool.py | 8 ---- .../interfaces/tests/test_auto_DataFinder.py | 5 +-- .../interfaces/tests/test_auto_DataGrabber.py | 3 -- nipype/interfaces/tests/test_auto_DataSink.py | 3 -- nipype/interfaces/tests/test_auto_Dcm2nii.py | 8 ---- .../tests/test_auto_FreeSurferSource.py | 3 -- nipype/interfaces/tests/test_auto_Function.py | 3 -- nipype/interfaces/tests/test_auto_IOBase.py | 5 +-- .../tests/test_auto_JSONFileGrabber.py | 3 -- .../tests/test_auto_JSONFileSink.py | 3 -- .../tests/test_auto_MatlabCommand.py | 8 ---- nipype/interfaces/tests/test_auto_Merge.py | 3 -- nipype/interfaces/tests/test_auto_MeshFix.py | 8 ---- .../interfaces/tests/test_auto_MySQLSink.py | 3 -- .../tests/test_auto_NiftiGeneratorBase.py | 5 +-- nipype/interfaces/tests/test_auto_PETPVC.py | 8 ---- .../tests/test_auto_S3DataGrabber.py | 3 -- .../interfaces/tests/test_auto_SQLiteSink.py | 3 -- .../tests/test_auto_SSHDataGrabber.py | 3 -- nipype/interfaces/tests/test_auto_Select.py | 5 +-- .../interfaces/tests/test_auto_SelectFiles.py | 3 -- .../tests/test_auto_SlicerCommandLine.py | 8 ---- nipype/interfaces/tests/test_auto_Split.py | 5 +-- nipype/interfaces/tests/test_auto_XNATSink.py | 3 -- .../interfaces/tests/test_auto_XNATSource.py | 3 -- .../vista/tests/test_auto_Vnifti2Image.py | 8 ---- .../vista/tests/test_auto_VtoMat.py | 8 ---- 594 files changed, 367 insertions(+), 4257 deletions(-) create mode 100644 nipype/algorithms/tests/test_auto_ErrorMap.py create mode 100644 nipype/algorithms/tests/test_auto_Overlap.py create mode 100644 nipype/interfaces/base/tests/test_auto_BaseInterface.py create mode 100644 nipype/interfaces/base/tests/test_auto_CommandLine.py create mode 100644 nipype/interfaces/base/tests/test_auto_MpiCommandLine.py create mode 100644 nipype/interfaces/base/tests/test_auto_SEMLikeCommandLine.py create mode 100644 nipype/interfaces/base/tests/test_auto_StdOutCommandLine.py diff --git a/nipype/algorithms/tests/test_auto_AddCSVRow.py b/nipype/algorithms/tests/test_auto_AddCSVRow.py index e4e161a844..22bc79a238 100644 --- a/nipype/algorithms/tests/test_auto_AddCSVRow.py +++ b/nipype/algorithms/tests/test_auto_AddCSVRow.py @@ -6,9 +6,6 @@ def test_AddCSVRow_inputs(): input_map = dict(_outputs=dict(usedefault=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(mandatory=True, ), ) diff --git a/nipype/algorithms/tests/test_auto_AddNoise.py b/nipype/algorithms/tests/test_auto_AddNoise.py index 60138c1b15..7b50767d6f 100644 --- a/nipype/algorithms/tests/test_auto_AddNoise.py +++ b/nipype/algorithms/tests/test_auto_AddNoise.py @@ -13,7 +13,8 @@ def test_AddNoise_inputs(): in_file=dict(mandatory=True, ), in_mask=dict(), - out_file=dict(ns=['in_file', 'snr'], + out_file=dict(keep_extension=True, + ns=['in_file', 'snr'], ), snr=dict(usedefault=True, ), diff --git a/nipype/algorithms/tests/test_auto_ArtifactDetect.py b/nipype/algorithms/tests/test_auto_ArtifactDetect.py index 7ddd3f089d..59b369ce82 100644 --- a/nipype/algorithms/tests/test_auto_ArtifactDetect.py +++ b/nipype/algorithms/tests/test_auto_ArtifactDetect.py @@ -8,9 +8,6 @@ def test_ArtifactDetect_inputs(): ), global_threshold=dict(usedefault=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), intersect_mask=dict(), mask_file=dict(), mask_threshold=dict(), diff --git a/nipype/algorithms/tests/test_auto_CreateNifti.py b/nipype/algorithms/tests/test_auto_CreateNifti.py index a478c56048..aa5a78206b 100644 --- a/nipype/algorithms/tests/test_auto_CreateNifti.py +++ b/nipype/algorithms/tests/test_auto_CreateNifti.py @@ -9,10 +9,8 @@ def test_CreateNifti_inputs(): ), header_file=dict(mandatory=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), - nifti_file=dict(ns='data_file', + nifti_file=dict(keep_extension=False, + ns='data_file', ), ) inputs = CreateNifti._input_spec() diff --git a/nipype/algorithms/tests/test_auto_Distance.py b/nipype/algorithms/tests/test_auto_Distance.py index 61c9a74a58..98e224ca8a 100644 --- a/nipype/algorithms/tests/test_auto_Distance.py +++ b/nipype/algorithms/tests/test_auto_Distance.py @@ -4,10 +4,7 @@ def test_Distance_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - mask_volume=dict(), + input_map = dict(mask_volume=dict(), method=dict(usedefault=True, ), volume1=dict(mandatory=True, diff --git a/nipype/algorithms/tests/test_auto_ErrorMap.py b/nipype/algorithms/tests/test_auto_ErrorMap.py new file mode 100644 index 0000000000..6d2fcb98dd --- /dev/null +++ b/nipype/algorithms/tests/test_auto_ErrorMap.py @@ -0,0 +1,33 @@ +# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT +from ...testing import assert_equal +from ..metrics import ErrorMap + + +def test_ErrorMap_inputs(): + input_map = dict(in_ref=dict(mandatory=True, + ), + in_tst=dict(mandatory=True, + ), + mask=dict(), + metric=dict(mandatory=True, + usedefault=True, + ), + out_map=dict(keep_extension=True, + ), + ) + inputs = ErrorMap._input_spec() + + for key, metadata in list(input_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(inputs.traits()[key], metakey), value + + +def test_ErrorMap_outputs(): + output_map = dict(distance=dict(), + out_map=dict(), + ) + outputs = ErrorMap._output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/algorithms/tests/test_auto_FuzzyOverlap.py b/nipype/algorithms/tests/test_auto_FuzzyOverlap.py index f4bac5fdb3..9356670157 100644 --- a/nipype/algorithms/tests/test_auto_FuzzyOverlap.py +++ b/nipype/algorithms/tests/test_auto_FuzzyOverlap.py @@ -4,10 +4,7 @@ def test_FuzzyOverlap_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - in_ref=dict(mandatory=True, + input_map = dict(in_ref=dict(mandatory=True, ), in_tst=dict(mandatory=True, ), diff --git a/nipype/algorithms/tests/test_auto_Gunzip.py b/nipype/algorithms/tests/test_auto_Gunzip.py index 03e3ca1a00..663f3906d0 100644 --- a/nipype/algorithms/tests/test_auto_Gunzip.py +++ b/nipype/algorithms/tests/test_auto_Gunzip.py @@ -4,12 +4,10 @@ def test_Gunzip_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, + input_map = dict(in_file=dict(mandatory=True, ), - in_file=dict(mandatory=True, - ), - out_file=dict(name_remove='.gz', + out_file=dict(keep_extension=False, + name_remove='.gz', ns='in_file', ), ) diff --git a/nipype/algorithms/tests/test_auto_MeshWarpMaths.py b/nipype/algorithms/tests/test_auto_MeshWarpMaths.py index dd366adc24..77b25ae6b2 100644 --- a/nipype/algorithms/tests/test_auto_MeshWarpMaths.py +++ b/nipype/algorithms/tests/test_auto_MeshWarpMaths.py @@ -14,7 +14,8 @@ def test_MeshWarpMaths_inputs(): out_file=dict(keep_extension=True, template='{in_surf}_warped', ), - out_warp=dict(), + out_warp=dict(keep_extension=True, + ), ) inputs = MeshWarpMaths._input_spec() diff --git a/nipype/algorithms/tests/test_auto_ModifyAffine.py b/nipype/algorithms/tests/test_auto_ModifyAffine.py index aa54fe09ab..584dffdfca 100644 --- a/nipype/algorithms/tests/test_auto_ModifyAffine.py +++ b/nipype/algorithms/tests/test_auto_ModifyAffine.py @@ -4,10 +4,7 @@ def test_ModifyAffine_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - transformation_matrix=dict(usedefault=True, + input_map = dict(transformation_matrix=dict(usedefault=True, ), transformed_volumes=dict(), volumes=dict(mandatory=True, diff --git a/nipype/algorithms/tests/test_auto_Overlap.py b/nipype/algorithms/tests/test_auto_Overlap.py new file mode 100644 index 0000000000..d313cd9698 --- /dev/null +++ b/nipype/algorithms/tests/test_auto_Overlap.py @@ -0,0 +1,44 @@ +# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT +from ...testing import assert_equal +from ..misc import Overlap + + +def test_Overlap_inputs(): + input_map = dict(bg_overlap=dict(mandatory=True, + usedefault=True, + ), + mask_volume=dict(), + out_file=dict(usedefault=True, + ), + vol_units=dict(mandatory=True, + usedefault=True, + ), + volume1=dict(mandatory=True, + ), + volume2=dict(mandatory=True, + ), + weighting=dict(usedefault=True, + ), + ) + inputs = Overlap._input_spec() + + for key, metadata in list(input_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(inputs.traits()[key], metakey), value + + +def test_Overlap_outputs(): + output_map = dict(dice=dict(), + diff_file=dict(), + jaccard=dict(), + labels=dict(), + roi_di=dict(), + roi_ji=dict(), + roi_voldiff=dict(), + volume_difference=dict(), + ) + outputs = Overlap._output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/algorithms/tests/test_auto_PickAtlas.py b/nipype/algorithms/tests/test_auto_PickAtlas.py index cc8cfd30cc..2a3f7d3453 100644 --- a/nipype/algorithms/tests/test_auto_PickAtlas.py +++ b/nipype/algorithms/tests/test_auto_PickAtlas.py @@ -10,9 +10,6 @@ def test_PickAtlas_inputs(): ), hemi=dict(usedefault=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), labels=dict(mandatory=True, ), mask_file=dict(ns='atlas', diff --git a/nipype/algorithms/tests/test_auto_Similarity.py b/nipype/algorithms/tests/test_auto_Similarity.py index 9f3c4742c9..2e79106ee5 100644 --- a/nipype/algorithms/tests/test_auto_Similarity.py +++ b/nipype/algorithms/tests/test_auto_Similarity.py @@ -4,10 +4,7 @@ def test_Similarity_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - mask1=dict(), + input_map = dict(mask1=dict(), mask2=dict(), metric=dict(usedefault=True, ), diff --git a/nipype/algorithms/tests/test_auto_SimpleThreshold.py b/nipype/algorithms/tests/test_auto_SimpleThreshold.py index b79c578195..2b3f99aea2 100644 --- a/nipype/algorithms/tests/test_auto_SimpleThreshold.py +++ b/nipype/algorithms/tests/test_auto_SimpleThreshold.py @@ -4,10 +4,7 @@ def test_SimpleThreshold_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - threshold=dict(mandatory=True, + input_map = dict(threshold=dict(mandatory=True, ), thresholded_volumes=dict(), volumes=dict(mandatory=True, diff --git a/nipype/algorithms/tests/test_auto_SpecifyModel.py b/nipype/algorithms/tests/test_auto_SpecifyModel.py index fe6687c1ab..b35a8c2de7 100644 --- a/nipype/algorithms/tests/test_auto_SpecifyModel.py +++ b/nipype/algorithms/tests/test_auto_SpecifyModel.py @@ -12,9 +12,6 @@ def test_SpecifyModel_inputs(): ), high_pass_filter_cutoff=dict(mandatory=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_units=dict(mandatory=True, ), outlier_files=dict(copyfile=False, diff --git a/nipype/algorithms/tests/test_auto_SpecifySPMModel.py b/nipype/algorithms/tests/test_auto_SpecifySPMModel.py index 66d8b2619a..5aca7f6798 100644 --- a/nipype/algorithms/tests/test_auto_SpecifySPMModel.py +++ b/nipype/algorithms/tests/test_auto_SpecifySPMModel.py @@ -14,9 +14,6 @@ def test_SpecifySPMModel_inputs(): ), high_pass_filter_cutoff=dict(mandatory=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_units=dict(mandatory=True, ), outlier_files=dict(copyfile=False, diff --git a/nipype/algorithms/tests/test_auto_SpecifySparseModel.py b/nipype/algorithms/tests/test_auto_SpecifySparseModel.py index 878d17a475..010392edd8 100644 --- a/nipype/algorithms/tests/test_auto_SpecifySparseModel.py +++ b/nipype/algorithms/tests/test_auto_SpecifySparseModel.py @@ -12,9 +12,6 @@ def test_SpecifySparseModel_inputs(): ), high_pass_filter_cutoff=dict(mandatory=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_units=dict(mandatory=True, ), model_hrf=dict(), diff --git a/nipype/algorithms/tests/test_auto_StimulusCorrelation.py b/nipype/algorithms/tests/test_auto_StimulusCorrelation.py index 2a799ef61a..bf1937103c 100644 --- a/nipype/algorithms/tests/test_auto_StimulusCorrelation.py +++ b/nipype/algorithms/tests/test_auto_StimulusCorrelation.py @@ -6,9 +6,6 @@ def test_StimulusCorrelation_inputs(): input_map = dict(concatenated_design=dict(mandatory=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), intensity_values=dict(mandatory=True, ), realignment_parameters=dict(mandatory=True, diff --git a/nipype/algorithms/tests/test_auto_TSNR.py b/nipype/algorithms/tests/test_auto_TSNR.py index 21880171ab..42f3e19722 100644 --- a/nipype/algorithms/tests/test_auto_TSNR.py +++ b/nipype/algorithms/tests/test_auto_TSNR.py @@ -7,9 +7,6 @@ def test_TSNR_inputs(): input_map = dict(detrended_file=dict(hash_files=False, ns='in_file', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(mandatory=True, ), mean_file=dict(hash_files=False, diff --git a/nipype/algorithms/tests/test_auto_TVTKBaseInterface.py b/nipype/algorithms/tests/test_auto_TVTKBaseInterface.py index e69de29bb2..d246493911 100644 --- a/nipype/algorithms/tests/test_auto_TVTKBaseInterface.py +++ b/nipype/algorithms/tests/test_auto_TVTKBaseInterface.py @@ -0,0 +1,21 @@ +# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT +from ...testing import assert_equal +from ..mesh import TVTKBaseInterface + + +def test_TVTKBaseInterface_inputs(): + input_map = dict() + inputs = TVTKBaseInterface._input_spec() + + for key, metadata in list(input_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(inputs.traits()[key], metakey), value + + +def test_TVTKBaseInterface_outputs(): + output_map = dict() + outputs = TVTKBaseInterface._output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/algorithms/tests/test_auto_WarpPoints.py b/nipype/algorithms/tests/test_auto_WarpPoints.py index d0316c1af8..5b985f0509 100644 --- a/nipype/algorithms/tests/test_auto_WarpPoints.py +++ b/nipype/algorithms/tests/test_auto_WarpPoints.py @@ -4,13 +4,11 @@ def test_WarpPoints_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, + input_map = dict(interp=dict(mandatory=True, usedefault=True, ), - interp=dict(mandatory=True, - usedefault=True, + out_points=dict(keep_extension=True, ), - out_points=dict(), points=dict(mandatory=True, ), warp=dict(mandatory=True, diff --git a/nipype/interfaces/afni/tests/test_auto_AFNICommand.py b/nipype/interfaces/afni/tests/test_auto_AFNICommand.py index 99cdf36b0e..e029603110 100644 --- a/nipype/interfaces/afni/tests/test_auto_AFNICommand.py +++ b/nipype/interfaces/afni/tests/test_auto_AFNICommand.py @@ -6,16 +6,8 @@ def test_AFNICommand_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), outputtype=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = AFNICommand._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_AFNICommandBase.py b/nipype/interfaces/afni/tests/test_auto_AFNICommandBase.py index 50ada7dd71..3ea9bac7cc 100644 --- a/nipype/interfaces/afni/tests/test_auto_AFNICommandBase.py +++ b/nipype/interfaces/afni/tests/test_auto_AFNICommandBase.py @@ -6,14 +6,6 @@ def test_AFNICommandBase_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), - terminal_output=dict(nohash=True, - ), ) inputs = AFNICommandBase._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_AFNItoNIFTI.py b/nipype/interfaces/afni/tests/test_auto_AFNItoNIFTI.py index 36ee76fd75..e37978a073 100644 --- a/nipype/interfaces/afni/tests/test_auto_AFNItoNIFTI.py +++ b/nipype/interfaces/afni/tests/test_auto_AFNItoNIFTI.py @@ -6,12 +6,6 @@ def test_AFNItoNIFTI_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', copyfile=False, mandatory=True, @@ -24,8 +18,6 @@ def test_AFNItoNIFTI_inputs(): ), outputtype=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = AFNItoNIFTI._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_Allineate.py b/nipype/interfaces/afni/tests/test_auto_Allineate.py index fe2592f471..b8339b2aaf 100644 --- a/nipype/interfaces/afni/tests/test_auto_Allineate.py +++ b/nipype/interfaces/afni/tests/test_auto_Allineate.py @@ -20,18 +20,12 @@ def test_Allineate_inputs(): ), cost=dict(argstr='-cost %s', ), - environ=dict(nohash=True, - usedefault=True, - ), epi=dict(argstr='-EPI', ), final_interpolation=dict(argstr='-final %s', ), fine_blur=dict(argstr='-fineblur %f', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-source %s', copyfile=False, mandatory=True, @@ -86,8 +80,6 @@ def test_Allineate_inputs(): ), source_mask=dict(argstr='-source_mask %s', ), - terminal_output=dict(nohash=True, - ), two_best=dict(argstr='-twobest %d', ), two_blur=dict(argstr='-twoblur', diff --git a/nipype/interfaces/afni/tests/test_auto_AutoTcorrelate.py b/nipype/interfaces/afni/tests/test_auto_AutoTcorrelate.py index 8922a184e0..138317c3b2 100644 --- a/nipype/interfaces/afni/tests/test_auto_AutoTcorrelate.py +++ b/nipype/interfaces/afni/tests/test_auto_AutoTcorrelate.py @@ -6,14 +6,8 @@ def test_AutoTcorrelate_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), eta2=dict(argstr='-eta2', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', copyfile=False, mandatory=True, @@ -29,13 +23,12 @@ def test_AutoTcorrelate_inputs(): xor=['mask_only_targets'], ), out_file=dict(argstr='-prefix %s', + keep_extension=False, ), outputtype=dict(usedefault=True, ), polort=dict(argstr='-polort %d', ), - terminal_output=dict(nohash=True, - ), ) inputs = AutoTcorrelate._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_Autobox.py b/nipype/interfaces/afni/tests/test_auto_Autobox.py index ed72a05cd6..0005b05656 100644 --- a/nipype/interfaces/afni/tests/test_auto_Autobox.py +++ b/nipype/interfaces/afni/tests/test_auto_Autobox.py @@ -6,12 +6,6 @@ def test_Autobox_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-input %s', copyfile=False, mandatory=True, @@ -25,8 +19,6 @@ def test_Autobox_inputs(): ), padding=dict(argstr='-npad %d', ), - terminal_output=dict(nohash=True, - ), ) inputs = Autobox._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_Automask.py b/nipype/interfaces/afni/tests/test_auto_Automask.py index 77d2ab1c1b..c828cc3f7a 100644 --- a/nipype/interfaces/afni/tests/test_auto_Automask.py +++ b/nipype/interfaces/afni/tests/test_auto_Automask.py @@ -12,14 +12,8 @@ def test_Automask_inputs(): ), dilate=dict(argstr='-dilate %s', ), - environ=dict(nohash=True, - usedefault=True, - ), erode=dict(argstr='-erode %s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', copyfile=False, mandatory=True, @@ -29,8 +23,6 @@ def test_Automask_inputs(): ), outputtype=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = Automask._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_Bandpass.py b/nipype/interfaces/afni/tests/test_auto_Bandpass.py index 82f51817a1..404b3c2324 100644 --- a/nipype/interfaces/afni/tests/test_auto_Bandpass.py +++ b/nipype/interfaces/afni/tests/test_auto_Bandpass.py @@ -12,16 +12,10 @@ def test_Bandpass_inputs(): ), despike=dict(argstr='-despike', ), - environ=dict(nohash=True, - usedefault=True, - ), highpass=dict(argstr='%f', mandatory=True, position=-3, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', copyfile=False, mandatory=True, @@ -56,8 +50,6 @@ def test_Bandpass_inputs(): ), outputtype=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), tr=dict(argstr='-dt %f', ), ) diff --git a/nipype/interfaces/afni/tests/test_auto_BlurInMask.py b/nipype/interfaces/afni/tests/test_auto_BlurInMask.py index b01bfce10d..01dbe23a2a 100644 --- a/nipype/interfaces/afni/tests/test_auto_BlurInMask.py +++ b/nipype/interfaces/afni/tests/test_auto_BlurInMask.py @@ -8,17 +8,11 @@ def test_BlurInMask_inputs(): ), automask=dict(argstr='-automask', ), - environ=dict(nohash=True, - usedefault=True, - ), float_out=dict(argstr='-float', ), fwhm=dict(argstr='-FWHM %f', mandatory=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-input %s', copyfile=False, mandatory=True, @@ -31,15 +25,15 @@ def test_BlurInMask_inputs(): options=dict(argstr='%s', position=2, ), - out_file=dict(), + out_file=dict(keep_extension=False, + ), outputtype=dict(usedefault=True, ), prefix=dict(argstr='-prefix %s', + keep_extension=False, ), preserve=dict(argstr='-preserve', ), - terminal_output=dict(nohash=True, - ), ) inputs = BlurInMask._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_BrickStat.py b/nipype/interfaces/afni/tests/test_auto_BrickStat.py index 6fc1e0915f..2246fe966d 100644 --- a/nipype/interfaces/afni/tests/test_auto_BrickStat.py +++ b/nipype/interfaces/afni/tests/test_auto_BrickStat.py @@ -6,12 +6,6 @@ def test_BrickStat_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-1, @@ -24,8 +18,6 @@ def test_BrickStat_inputs(): ), outputtype=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = BrickStat._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_Calc.py b/nipype/interfaces/afni/tests/test_auto_Calc.py index 847a9c4300..c2692f536c 100644 --- a/nipype/interfaces/afni/tests/test_auto_Calc.py +++ b/nipype/interfaces/afni/tests/test_auto_Calc.py @@ -6,16 +6,10 @@ def test_Calc_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), expr=dict(argstr='-expr "%s"', mandatory=True, position=3, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file_a=dict(argstr='-a %s', mandatory=True, position=0, @@ -39,8 +33,6 @@ def test_Calc_inputs(): ), stop_idx=dict(requires=['start_idx'], ), - terminal_output=dict(nohash=True, - ), ) inputs = Calc._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_Copy.py b/nipype/interfaces/afni/tests/test_auto_Copy.py index 824ac78312..803b3cce03 100644 --- a/nipype/interfaces/afni/tests/test_auto_Copy.py +++ b/nipype/interfaces/afni/tests/test_auto_Copy.py @@ -6,12 +6,6 @@ def test_Copy_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', copyfile=False, mandatory=True, @@ -22,8 +16,6 @@ def test_Copy_inputs(): ), outputtype=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = Copy._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_Despike.py b/nipype/interfaces/afni/tests/test_auto_Despike.py index f309359f12..36918ecdb1 100644 --- a/nipype/interfaces/afni/tests/test_auto_Despike.py +++ b/nipype/interfaces/afni/tests/test_auto_Despike.py @@ -6,23 +6,17 @@ def test_Despike_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', copyfile=False, mandatory=True, position=-1, ), - out_file=dict(), + out_file=dict(keep_extension=False, + ), outputtype=dict(usedefault=True, ), prefix=dict(argstr='-prefix %s', - ), - terminal_output=dict(nohash=True, + keep_extension=False, ), ) inputs = Despike._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_Detrend.py b/nipype/interfaces/afni/tests/test_auto_Detrend.py index eac34e5bfa..f973948b14 100644 --- a/nipype/interfaces/afni/tests/test_auto_Detrend.py +++ b/nipype/interfaces/afni/tests/test_auto_Detrend.py @@ -6,23 +6,17 @@ def test_Detrend_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', copyfile=False, mandatory=True, position=-1, ), - out_file=dict(), + out_file=dict(keep_extension=False, + ), outputtype=dict(usedefault=True, ), prefix=dict(argstr='-prefix %s', - ), - terminal_output=dict(nohash=True, + keep_extension=False, ), ) inputs = Detrend._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_Eval.py b/nipype/interfaces/afni/tests/test_auto_Eval.py index e3d2617f55..c46cfc5c10 100644 --- a/nipype/interfaces/afni/tests/test_auto_Eval.py +++ b/nipype/interfaces/afni/tests/test_auto_Eval.py @@ -6,16 +6,10 @@ def test_Eval_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), expr=dict(argstr='-expr "%s"', mandatory=True, position=3, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file_a=dict(argstr='-a %s', mandatory=True, position=0, @@ -41,8 +35,6 @@ def test_Eval_inputs(): ), stop_idx=dict(requires=['start_idx'], ), - terminal_output=dict(nohash=True, - ), ) inputs = Eval._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_FWHMx.py b/nipype/interfaces/afni/tests/test_auto_FWHMx.py index 29e25c877b..c55296d87e 100644 --- a/nipype/interfaces/afni/tests/test_auto_FWHMx.py +++ b/nipype/interfaces/afni/tests/test_auto_FWHMx.py @@ -26,15 +26,9 @@ def test_FWHMx_inputs(): usedefault=True, xor=['demed'], ), - environ=dict(nohash=True, - usedefault=True, - ), geom=dict(argstr='-geom', xor=['arith'], ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-input %s', mandatory=True, ), @@ -46,11 +40,11 @@ def test_FWHMx_inputs(): name_template='%s_detrend', ), out_file=dict(argstr='> %s', + keep_extension=False, position=-1, ), out_subbricks=dict(argstr='-out %s', - ), - terminal_output=dict(nohash=True, + keep_extension=False, ), unif=dict(argstr='-unif', ), diff --git a/nipype/interfaces/afni/tests/test_auto_Fim.py b/nipype/interfaces/afni/tests/test_auto_Fim.py index 92ac1cb312..0a914a9031 100644 --- a/nipype/interfaces/afni/tests/test_auto_Fim.py +++ b/nipype/interfaces/afni/tests/test_auto_Fim.py @@ -6,9 +6,6 @@ def test_Fim_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), fim_thr=dict(argstr='-fim_thr %f', position=3, ), @@ -16,9 +13,6 @@ def test_Fim_inputs(): mandatory=True, position=2, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr=' -input %s', copyfile=False, mandatory=True, @@ -33,8 +27,6 @@ def test_Fim_inputs(): ), outputtype=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = Fim._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_Fourier.py b/nipype/interfaces/afni/tests/test_auto_Fourier.py index 2eb2eef493..4c5498bad8 100644 --- a/nipype/interfaces/afni/tests/test_auto_Fourier.py +++ b/nipype/interfaces/afni/tests/test_auto_Fourier.py @@ -6,16 +6,10 @@ def test_Fourier_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), highpass=dict(argstr='-highpass %f', mandatory=True, position=1, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', copyfile=False, mandatory=True, @@ -31,8 +25,6 @@ def test_Fourier_inputs(): ), outputtype=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = Fourier._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_Hist.py b/nipype/interfaces/afni/tests/test_auto_Hist.py index e77b701e89..e65f7f0416 100644 --- a/nipype/interfaces/afni/tests/test_auto_Hist.py +++ b/nipype/interfaces/afni/tests/test_auto_Hist.py @@ -8,12 +8,6 @@ def test_Hist_inputs(): ), bin_width=dict(argstr='-binwidth %f', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-input %s', copyfile=False, mandatory=True, @@ -27,7 +21,8 @@ def test_Hist_inputs(): ), nbin=dict(argstr='-nbin %d', ), - out_file=dict(), + out_file=dict(keep_extension=False, + ), out_show=dict(argstr='> %s', keep_extension=False, name_source='in_file', @@ -35,12 +30,11 @@ def test_Hist_inputs(): position=-1, ), prefix=dict(argstr='-prefix %s', + keep_extension=False, ), showhist=dict(argstr='-showhist', usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = Hist._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_Maskave.py b/nipype/interfaces/afni/tests/test_auto_Maskave.py index 5fef8cabf1..a6a3bdc08d 100644 --- a/nipype/interfaces/afni/tests/test_auto_Maskave.py +++ b/nipype/interfaces/afni/tests/test_auto_Maskave.py @@ -6,12 +6,6 @@ def test_Maskave_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', copyfile=False, mandatory=True, @@ -21,6 +15,7 @@ def test_Maskave_inputs(): position=1, ), out_file=dict(argstr='> %s', + keep_extension=False, position=-1, ), outputtype=dict(usedefault=True, @@ -28,8 +23,6 @@ def test_Maskave_inputs(): quiet=dict(argstr='-quiet', position=2, ), - terminal_output=dict(nohash=True, - ), ) inputs = Maskave._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_Means.py b/nipype/interfaces/afni/tests/test_auto_Means.py index be3e3b9960..ddefbeaf7c 100644 --- a/nipype/interfaces/afni/tests/test_auto_Means.py +++ b/nipype/interfaces/afni/tests/test_auto_Means.py @@ -8,12 +8,6 @@ def test_Means_inputs(): ), count=dict(argstr='-count', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file_a=dict(argstr='%s', mandatory=True, position=0, @@ -41,8 +35,6 @@ def test_Means_inputs(): ), summ=dict(argstr='-sum', ), - terminal_output=dict(nohash=True, - ), ) inputs = Means._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_Merge.py b/nipype/interfaces/afni/tests/test_auto_Merge.py index 96a74dae92..53e9b1ae63 100644 --- a/nipype/interfaces/afni/tests/test_auto_Merge.py +++ b/nipype/interfaces/afni/tests/test_auto_Merge.py @@ -11,12 +11,6 @@ def test_Merge_inputs(): ), doall=dict(argstr='-doall', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_files=dict(argstr='%s', copyfile=False, mandatory=True, @@ -26,8 +20,6 @@ def test_Merge_inputs(): ), outputtype=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = Merge._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_ROIStats.py b/nipype/interfaces/afni/tests/test_auto_ROIStats.py index 42652baf26..fa1df6d87f 100644 --- a/nipype/interfaces/afni/tests/test_auto_ROIStats.py +++ b/nipype/interfaces/afni/tests/test_auto_ROIStats.py @@ -6,12 +6,6 @@ def test_ROIStats_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-1, diff --git a/nipype/interfaces/afni/tests/test_auto_Refit.py b/nipype/interfaces/afni/tests/test_auto_Refit.py index 3cea31c4b4..c396920538 100644 --- a/nipype/interfaces/afni/tests/test_auto_Refit.py +++ b/nipype/interfaces/afni/tests/test_auto_Refit.py @@ -9,12 +9,6 @@ def test_Refit_inputs(): deoblique=dict(argstr='-deoblique', usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', copyfile=True, mandatory=True, @@ -25,8 +19,6 @@ def test_Refit_inputs(): ), space=dict(argstr='-space %s', ), - terminal_output=dict(nohash=True, - ), xdel=dict(argstr='-xdel %f', ), xorigin=dict(argstr='-xorigin %s', diff --git a/nipype/interfaces/afni/tests/test_auto_Resample.py b/nipype/interfaces/afni/tests/test_auto_Resample.py index ffeae483af..a98b6848d0 100644 --- a/nipype/interfaces/afni/tests/test_auto_Resample.py +++ b/nipype/interfaces/afni/tests/test_auto_Resample.py @@ -6,12 +6,6 @@ def test_Resample_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-inset %s', copyfile=False, mandatory=True, @@ -21,15 +15,15 @@ def test_Resample_inputs(): ), orientation=dict(argstr='-orient %s', ), - out_file=dict(), + out_file=dict(keep_extension=False, + ), outputtype=dict(usedefault=True, ), prefix=dict(argstr='-prefix %s', + keep_extension=False, ), resample_mode=dict(argstr='-rmode %s', ), - terminal_output=dict(nohash=True, - ), voxel_size=dict(argstr='-dxyz %f %f %f', ), ) diff --git a/nipype/interfaces/afni/tests/test_auto_Retroicor.py b/nipype/interfaces/afni/tests/test_auto_Retroicor.py index 92021b6ba1..debd16ad22 100644 --- a/nipype/interfaces/afni/tests/test_auto_Retroicor.py +++ b/nipype/interfaces/afni/tests/test_auto_Retroicor.py @@ -13,12 +13,6 @@ def test_Retroicor_inputs(): hash_files=False, position=-6, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', copyfile=False, mandatory=True, @@ -40,8 +34,6 @@ def test_Retroicor_inputs(): hash_files=False, position=-7, ), - terminal_output=dict(nohash=True, - ), threshold=dict(argstr='-threshold %d', position=-4, ), diff --git a/nipype/interfaces/afni/tests/test_auto_SVMTest.py b/nipype/interfaces/afni/tests/test_auto_SVMTest.py index 1187c289a0..9c9376e4c0 100644 --- a/nipype/interfaces/afni/tests/test_auto_SVMTest.py +++ b/nipype/interfaces/afni/tests/test_auto_SVMTest.py @@ -8,12 +8,6 @@ def test_SVMTest_inputs(): ), classout=dict(argstr='-classout', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-testvol %s', mandatory=True, ), @@ -33,8 +27,6 @@ def test_SVMTest_inputs(): ), outputtype=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), testlabels=dict(argstr='-testlabels %s', ), ) diff --git a/nipype/interfaces/afni/tests/test_auto_SVMTrain.py b/nipype/interfaces/afni/tests/test_auto_SVMTrain.py index 57b20c3b8d..ed6dbf5b40 100644 --- a/nipype/interfaces/afni/tests/test_auto_SVMTrain.py +++ b/nipype/interfaces/afni/tests/test_auto_SVMTrain.py @@ -13,12 +13,6 @@ def test_SVMTrain_inputs(): ), censor=dict(argstr='-censor %s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-trainvol %s', copyfile=False, mandatory=True, @@ -47,8 +41,6 @@ def test_SVMTrain_inputs(): ), outputtype=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), trainlabels=dict(argstr='-trainlabels %s', ), ttype=dict(argstr='-type %s', diff --git a/nipype/interfaces/afni/tests/test_auto_SkullStrip.py b/nipype/interfaces/afni/tests/test_auto_SkullStrip.py index 203eab9985..aad31022d0 100644 --- a/nipype/interfaces/afni/tests/test_auto_SkullStrip.py +++ b/nipype/interfaces/afni/tests/test_auto_SkullStrip.py @@ -6,12 +6,6 @@ def test_SkullStrip_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-input %s', copyfile=False, mandatory=True, @@ -23,8 +17,6 @@ def test_SkullStrip_inputs(): ), outputtype=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = SkullStrip._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_TCat.py b/nipype/interfaces/afni/tests/test_auto_TCat.py index fe7b6c5703..488c6333e4 100644 --- a/nipype/interfaces/afni/tests/test_auto_TCat.py +++ b/nipype/interfaces/afni/tests/test_auto_TCat.py @@ -6,12 +6,6 @@ def test_TCat_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_files=dict(argstr=' %s', copyfile=False, mandatory=True, @@ -26,8 +20,6 @@ def test_TCat_inputs(): rlt=dict(argstr='-rlt%s', position=1, ), - terminal_output=dict(nohash=True, - ), ) inputs = TCat._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_TCorr1D.py b/nipype/interfaces/afni/tests/test_auto_TCorr1D.py index 269d67df40..025ac8c421 100644 --- a/nipype/interfaces/afni/tests/test_auto_TCorr1D.py +++ b/nipype/interfaces/afni/tests/test_auto_TCorr1D.py @@ -6,12 +6,6 @@ def test_TCorr1D_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), ktaub=dict(argstr=' -ktaub', position=1, xor=['pearson', 'spearman', 'quadrant'], @@ -26,6 +20,7 @@ def test_TCorr1D_inputs(): xor=['spearman', 'quadrant', 'ktaub'], ), prefix=dict(argstr='-prefix %s', + keep_extension=False, ), quadrant=dict(argstr=' -quadrant', position=1, @@ -35,8 +30,6 @@ def test_TCorr1D_inputs(): position=1, xor=['pearson', 'quadrant', 'ktaub'], ), - terminal_output=dict(nohash=True, - ), xset=dict(argstr='%s', copyfile=False, mandatory=True, diff --git a/nipype/interfaces/afni/tests/test_auto_TCorrMap.py b/nipype/interfaces/afni/tests/test_auto_TCorrMap.py index 4e73509129..15fa6a5481 100644 --- a/nipype/interfaces/afni/tests/test_auto_TCorrMap.py +++ b/nipype/interfaces/afni/tests/test_auto_TCorrMap.py @@ -33,18 +33,12 @@ def test_TCorrMap_inputs(): correlation_maps_masked=dict(argstr='-CorrMask %s', name_source='in_file', ), - environ=dict(nohash=True, - usedefault=True, - ), expr=dict(), histogram=dict(argstr='-Hist %d %s', name_source='in_file', suffix='_hist', ), histogram_bin_numbers=dict(), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-input %s', copyfile=False, mandatory=True, @@ -80,8 +74,6 @@ def test_TCorrMap_inputs(): suffix='_sexpr', xor=('average_expr', 'average_expr_nonzero', 'sum_expr'), ), - terminal_output=dict(nohash=True, - ), thresholds=dict(), var_absolute_threshold=dict(argstr='-VarThresh %f %f %f %s', name_source='in_file', diff --git a/nipype/interfaces/afni/tests/test_auto_TCorrelate.py b/nipype/interfaces/afni/tests/test_auto_TCorrelate.py index be5f63b47c..9a88216559 100644 --- a/nipype/interfaces/afni/tests/test_auto_TCorrelate.py +++ b/nipype/interfaces/afni/tests/test_auto_TCorrelate.py @@ -6,12 +6,6 @@ def test_TCorrelate_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), out_file=dict(argstr='-prefix %s', name_source='xset', name_template='%s_tcorr', @@ -24,8 +18,6 @@ def test_TCorrelate_inputs(): polort=dict(argstr='-polort %d', position=2, ), - terminal_output=dict(nohash=True, - ), xset=dict(argstr=' %s', copyfile=False, mandatory=True, diff --git a/nipype/interfaces/afni/tests/test_auto_TShift.py b/nipype/interfaces/afni/tests/test_auto_TShift.py index 65dd3f4930..01d6ef6de4 100644 --- a/nipype/interfaces/afni/tests/test_auto_TShift.py +++ b/nipype/interfaces/afni/tests/test_auto_TShift.py @@ -6,14 +6,8 @@ def test_TShift_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), ignore=dict(argstr='-ignore %s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', copyfile=False, mandatory=True, @@ -25,13 +19,12 @@ def test_TShift_inputs(): outputtype=dict(usedefault=True, ), prefix=dict(argstr='-prefix %s', + keep_extension=False, ), rlt=dict(argstr='-rlt', ), rltplus=dict(argstr='-rlt+', ), - terminal_output=dict(nohash=True, - ), tpattern=dict(argstr='-tpattern %s', ), tr=dict(argstr='-TR %s', diff --git a/nipype/interfaces/afni/tests/test_auto_TStat.py b/nipype/interfaces/afni/tests/test_auto_TStat.py index b8fb40dc95..146fc5d8c1 100644 --- a/nipype/interfaces/afni/tests/test_auto_TStat.py +++ b/nipype/interfaces/afni/tests/test_auto_TStat.py @@ -6,12 +6,6 @@ def test_TStat_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', copyfile=False, mandatory=True, @@ -21,12 +15,12 @@ def test_TStat_inputs(): ), options=dict(argstr='%s', ), - out_file=dict(), + out_file=dict(keep_extension=False, + ), outputtype=dict(usedefault=True, ), prefix=dict(argstr='-prefix %s', - ), - terminal_output=dict(nohash=True, + keep_extension=False, ), ) inputs = TStat._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_To3D.py b/nipype/interfaces/afni/tests/test_auto_To3D.py index e53a913a97..2330682ad4 100644 --- a/nipype/interfaces/afni/tests/test_auto_To3D.py +++ b/nipype/interfaces/afni/tests/test_auto_To3D.py @@ -10,21 +10,16 @@ def test_To3D_inputs(): ), datatype=dict(argstr='-datum %s', ), - environ=dict(nohash=True, - usedefault=True, - ), filetype=dict(argstr='-%s', ), funcparams=dict(argstr='-time:zt %s alt+z2', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_folder=dict(argstr='%s/*.dcm', mandatory=True, position=-1, ), - out_file=dict(), + out_file=dict(keep_extension=False, + ), outputtype=dict(usedefault=True, ), prefix=dict(argstr='-prefix %s', @@ -32,8 +27,6 @@ def test_To3D_inputs(): ), skipoutliers=dict(argstr='-skip_outliers', ), - terminal_output=dict(nohash=True, - ), ) inputs = To3D._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_Volreg.py b/nipype/interfaces/afni/tests/test_auto_Volreg.py index ceca1b365d..2c1a513929 100644 --- a/nipype/interfaces/afni/tests/test_auto_Volreg.py +++ b/nipype/interfaces/afni/tests/test_auto_Volreg.py @@ -11,30 +11,25 @@ def test_Volreg_inputs(): ), copyorigin=dict(argstr='-twodup', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', copyfile=False, mandatory=True, position=-1, ), md1d_file=dict(argstr='-maxdisp1D %s', + keep_extension=False, position=-4, ), oned_file=dict(argstr='-1Dfile %s', + keep_extension=False, ), oned_matrix_save=dict(argstr='-1Dmatrix_save %s', + keep_extension=False, ), out_file=dict(argstr='-prefix %s', ), outputtype=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), timeshift=dict(argstr='-tshift 0', ), verbose=dict(argstr='-verbose', diff --git a/nipype/interfaces/afni/tests/test_auto_Warp.py b/nipype/interfaces/afni/tests/test_auto_Warp.py index 90fd5ce2d2..4c9a9895cb 100644 --- a/nipype/interfaces/afni/tests/test_auto_Warp.py +++ b/nipype/interfaces/afni/tests/test_auto_Warp.py @@ -8,14 +8,8 @@ def test_Warp_inputs(): ), deoblique=dict(argstr='-deoblique', ), - environ=dict(nohash=True, - usedefault=True, - ), gridset=dict(argstr='-gridset %s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', copyfile=False, mandatory=True, @@ -33,8 +27,7 @@ def test_Warp_inputs(): outputtype=dict(usedefault=True, ), prefix=dict(argstr='-prefix %s', - ), - terminal_output=dict(nohash=True, + keep_extension=False, ), tta2mni=dict(argstr='-tta2mni', ), diff --git a/nipype/interfaces/afni/tests/test_auto_ZCutUp.py b/nipype/interfaces/afni/tests/test_auto_ZCutUp.py index e51f152e0c..6c11d59af6 100644 --- a/nipype/interfaces/afni/tests/test_auto_ZCutUp.py +++ b/nipype/interfaces/afni/tests/test_auto_ZCutUp.py @@ -6,12 +6,6 @@ def test_ZCutUp_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', copyfile=False, mandatory=True, @@ -25,8 +19,6 @@ def test_ZCutUp_inputs(): ), outputtype=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = ZCutUp._input_spec() diff --git a/nipype/interfaces/ants/tests/test_auto_ANTS.py b/nipype/interfaces/ants/tests/test_auto_ANTS.py index ddb0dce2a9..0ca055f8c5 100644 --- a/nipype/interfaces/ants/tests/test_auto_ANTS.py +++ b/nipype/interfaces/ants/tests/test_auto_ANTS.py @@ -14,16 +14,10 @@ def test_ANTS_inputs(): position=1, usedefault=False, ), - environ=dict(nohash=True, - usedefault=True, - ), fixed_image=dict(mandatory=True, ), gradient_step_length=dict(requires=['transformation_model'], ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), metric=dict(mandatory=True, ), metric_weight=dict(requires=['metric'], @@ -65,8 +59,6 @@ def test_ANTS_inputs(): ), symmetry_type=dict(requires=['delta_time'], ), - terminal_output=dict(nohash=True, - ), transformation_model=dict(argstr='%s', mandatory=True, ), diff --git a/nipype/interfaces/ants/tests/test_auto_ANTSCommand.py b/nipype/interfaces/ants/tests/test_auto_ANTSCommand.py index 26c30c9798..e1899648f4 100644 --- a/nipype/interfaces/ants/tests/test_auto_ANTSCommand.py +++ b/nipype/interfaces/ants/tests/test_auto_ANTSCommand.py @@ -6,17 +6,9 @@ def test_ANTSCommand_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), num_threads=dict(nohash=True, usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = ANTSCommand._input_spec() diff --git a/nipype/interfaces/ants/tests/test_auto_AntsJointFusion.py b/nipype/interfaces/ants/tests/test_auto_AntsJointFusion.py index 2e105e3354..aa513253a5 100644 --- a/nipype/interfaces/ants/tests/test_auto_AntsJointFusion.py +++ b/nipype/interfaces/ants/tests/test_auto_AntsJointFusion.py @@ -24,16 +24,10 @@ def test_AntsJointFusion_inputs(): dimension=dict(argstr='-d %d', usedefault=False, ), - environ=dict(nohash=True, - usedefault=True, - ), exclusion_image=dict(), exclusion_image_label=dict(argstr='-e %s', requires=['exclusion_image'], ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), mask_image=dict(argstr='-x %s', ), num_threads=dict(nohash=True, @@ -68,8 +62,6 @@ def test_AntsJointFusion_inputs(): target_image=dict(argstr='-t %s', mandatory=True, ), - terminal_output=dict(nohash=True, - ), verbose=dict(argstr='-v', ), ) diff --git a/nipype/interfaces/ants/tests/test_auto_ApplyTransforms.py b/nipype/interfaces/ants/tests/test_auto_ApplyTransforms.py index ddf1a0becd..d90ef0c189 100644 --- a/nipype/interfaces/ants/tests/test_auto_ApplyTransforms.py +++ b/nipype/interfaces/ants/tests/test_auto_ApplyTransforms.py @@ -11,14 +11,8 @@ def test_ApplyTransforms_inputs(): ), dimension=dict(argstr='--dimensionality %d', ), - environ=dict(nohash=True, - usedefault=True, - ), float=dict(argstr='--float %d', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_image=dict(argstr='--input %s', mandatory=True, ), @@ -45,8 +39,6 @@ def test_ApplyTransforms_inputs(): reference_image=dict(argstr='--reference-image %s', mandatory=True, ), - terminal_output=dict(nohash=True, - ), transforms=dict(argstr='%s', mandatory=True, ), diff --git a/nipype/interfaces/ants/tests/test_auto_ApplyTransformsToPoints.py b/nipype/interfaces/ants/tests/test_auto_ApplyTransformsToPoints.py index b65fd85131..5924f5d341 100644 --- a/nipype/interfaces/ants/tests/test_auto_ApplyTransformsToPoints.py +++ b/nipype/interfaces/ants/tests/test_auto_ApplyTransformsToPoints.py @@ -8,12 +8,6 @@ def test_ApplyTransformsToPoints_inputs(): ), dimension=dict(argstr='--dimensionality %d', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_file=dict(argstr='--input %s', mandatory=True, ), @@ -26,8 +20,6 @@ def test_ApplyTransformsToPoints_inputs(): name_source=['input_file'], name_template='%s_transformed.csv', ), - terminal_output=dict(nohash=True, - ), transforms=dict(argstr='%s', mandatory=True, ), diff --git a/nipype/interfaces/ants/tests/test_auto_Atropos.py b/nipype/interfaces/ants/tests/test_auto_Atropos.py index d440883bbe..ed8549f966 100644 --- a/nipype/interfaces/ants/tests/test_auto_Atropos.py +++ b/nipype/interfaces/ants/tests/test_auto_Atropos.py @@ -11,14 +11,8 @@ def test_Atropos_inputs(): dimension=dict(argstr='--image-dimensionality %d', usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), icm_use_synchronous_update=dict(argstr='%s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), initialization=dict(argstr='%s', mandatory=True, requires=['number_of_tissue_classes'], @@ -60,8 +54,6 @@ def test_Atropos_inputs(): prior_weighting=dict(), save_posteriors=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), use_mixture_model_proportions=dict(requires=['posterior_formulation'], ), use_random_seed=dict(argstr='--use-random-seed %d', diff --git a/nipype/interfaces/ants/tests/test_auto_AverageAffineTransform.py b/nipype/interfaces/ants/tests/test_auto_AverageAffineTransform.py index c7c0c67760..ddcfb4b707 100644 --- a/nipype/interfaces/ants/tests/test_auto_AverageAffineTransform.py +++ b/nipype/interfaces/ants/tests/test_auto_AverageAffineTransform.py @@ -11,12 +11,6 @@ def test_AverageAffineTransform_inputs(): position=0, usedefault=False, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), num_threads=dict(nohash=True, usedefault=True, ), @@ -24,8 +18,6 @@ def test_AverageAffineTransform_inputs(): mandatory=True, position=1, ), - terminal_output=dict(nohash=True, - ), transforms=dict(argstr='%s', mandatory=True, position=3, diff --git a/nipype/interfaces/ants/tests/test_auto_AverageImages.py b/nipype/interfaces/ants/tests/test_auto_AverageImages.py index a56e1b52d1..d1c15280fa 100644 --- a/nipype/interfaces/ants/tests/test_auto_AverageImages.py +++ b/nipype/interfaces/ants/tests/test_auto_AverageImages.py @@ -10,12 +10,6 @@ def test_AverageImages_inputs(): mandatory=True, position=0, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), images=dict(argstr='%s', mandatory=True, position=3, @@ -32,8 +26,6 @@ def test_AverageImages_inputs(): position=1, usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = AverageImages._input_spec() diff --git a/nipype/interfaces/ants/tests/test_auto_BrainExtraction.py b/nipype/interfaces/ants/tests/test_auto_BrainExtraction.py index 26eb9af5a6..24c640eea1 100644 --- a/nipype/interfaces/ants/tests/test_auto_BrainExtraction.py +++ b/nipype/interfaces/ants/tests/test_auto_BrainExtraction.py @@ -21,14 +21,8 @@ def test_BrainExtraction_inputs(): dimension=dict(argstr='-d %d', usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), extraction_registration_mask=dict(argstr='-f %s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), image_suffix=dict(argstr='-s %s', usedefault=True, ), @@ -40,8 +34,6 @@ def test_BrainExtraction_inputs(): out_prefix=dict(argstr='-o %s', usedefault=True, ), - terminal_output=dict(nohash=True, - ), use_floatingpoint_precision=dict(argstr='-q %d', ), use_random_seeding=dict(argstr='-u %d', diff --git a/nipype/interfaces/ants/tests/test_auto_ConvertScalarImageToRGB.py b/nipype/interfaces/ants/tests/test_auto_ConvertScalarImageToRGB.py index 0ed5d673ae..b47517fa5d 100644 --- a/nipype/interfaces/ants/tests/test_auto_ConvertScalarImageToRGB.py +++ b/nipype/interfaces/ants/tests/test_auto_ConvertScalarImageToRGB.py @@ -20,12 +20,6 @@ def test_ConvertScalarImageToRGB_inputs(): position=0, usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_image=dict(argstr='%s', mandatory=True, position=1, @@ -57,8 +51,6 @@ def test_ConvertScalarImageToRGB_inputs(): position=2, usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = ConvertScalarImageToRGB._input_spec() diff --git a/nipype/interfaces/ants/tests/test_auto_CorticalThickness.py b/nipype/interfaces/ants/tests/test_auto_CorticalThickness.py index e060cd7037..d518ffbbb8 100644 --- a/nipype/interfaces/ants/tests/test_auto_CorticalThickness.py +++ b/nipype/interfaces/ants/tests/test_auto_CorticalThickness.py @@ -24,14 +24,8 @@ def test_CorticalThickness_inputs(): dimension=dict(argstr='-d %d', usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), extraction_registration_mask=dict(argstr='-f %s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), image_suffix=dict(argstr='-s %s', usedefault=True, ), @@ -61,8 +55,6 @@ def test_CorticalThickness_inputs(): t1_registration_template=dict(argstr='-t %s', mandatory=True, ), - terminal_output=dict(nohash=True, - ), use_floatingpoint_precision=dict(argstr='-j %d', ), use_random_seeding=dict(argstr='-u %d', diff --git a/nipype/interfaces/ants/tests/test_auto_CreateTiledMosaic.py b/nipype/interfaces/ants/tests/test_auto_CreateTiledMosaic.py index eed798daeb..da43fb52d5 100644 --- a/nipype/interfaces/ants/tests/test_auto_CreateTiledMosaic.py +++ b/nipype/interfaces/ants/tests/test_auto_CreateTiledMosaic.py @@ -10,14 +10,8 @@ def test_CreateTiledMosaic_inputs(): ), direction=dict(argstr='-d %d', ), - environ=dict(nohash=True, - usedefault=True, - ), flip_slice=dict(argstr='-f %s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_image=dict(argstr='-i %s', mandatory=True, ), @@ -38,8 +32,6 @@ def test_CreateTiledMosaic_inputs(): ), slices=dict(argstr='-s %s', ), - terminal_output=dict(nohash=True, - ), tile_geometry=dict(argstr='-t %s', ), ) diff --git a/nipype/interfaces/ants/tests/test_auto_DenoiseImage.py b/nipype/interfaces/ants/tests/test_auto_DenoiseImage.py index 2b14f7076c..0f100a7744 100644 --- a/nipype/interfaces/ants/tests/test_auto_DenoiseImage.py +++ b/nipype/interfaces/ants/tests/test_auto_DenoiseImage.py @@ -9,12 +9,6 @@ def test_DenoiseImage_inputs(): dimension=dict(argstr='-d %d', usedefault=False, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_image=dict(argstr='-i %s', mandatory=True, ), @@ -43,8 +37,6 @@ def test_DenoiseImage_inputs(): shrink_factor=dict(argstr='-s %s', usedefault=True, ), - terminal_output=dict(nohash=True, - ), verbose=dict(argstr='-v', ), ) diff --git a/nipype/interfaces/ants/tests/test_auto_GenWarpFields.py b/nipype/interfaces/ants/tests/test_auto_GenWarpFields.py index 43a8844e35..a9fc62745d 100644 --- a/nipype/interfaces/ants/tests/test_auto_GenWarpFields.py +++ b/nipype/interfaces/ants/tests/test_auto_GenWarpFields.py @@ -12,14 +12,8 @@ def test_GenWarpFields_inputs(): position=1, usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), force_proceed=dict(argstr='-f 1', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_image=dict(argstr='-i %s', copyfile=False, mandatory=True, @@ -43,8 +37,6 @@ def test_GenWarpFields_inputs(): ), similarity_metric=dict(argstr='-s %s', ), - terminal_output=dict(nohash=True, - ), transformation_model=dict(argstr='-t %s', usedefault=True, ), diff --git a/nipype/interfaces/ants/tests/test_auto_JacobianDeterminant.py b/nipype/interfaces/ants/tests/test_auto_JacobianDeterminant.py index bb8d8e885e..13ae2a9928 100644 --- a/nipype/interfaces/ants/tests/test_auto_JacobianDeterminant.py +++ b/nipype/interfaces/ants/tests/test_auto_JacobianDeterminant.py @@ -11,12 +11,6 @@ def test_JacobianDeterminant_inputs(): position=0, usedefault=False, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), norm_by_total=dict(argstr='%d', position=5, ), @@ -35,8 +29,6 @@ def test_JacobianDeterminant_inputs(): template_mask=dict(argstr='%s', position=4, ), - terminal_output=dict(nohash=True, - ), use_log=dict(argstr='%d', position=3, ), diff --git a/nipype/interfaces/ants/tests/test_auto_JointFusion.py b/nipype/interfaces/ants/tests/test_auto_JointFusion.py index 7ef0077bcc..b9bef8aa36 100644 --- a/nipype/interfaces/ants/tests/test_auto_JointFusion.py +++ b/nipype/interfaces/ants/tests/test_auto_JointFusion.py @@ -21,14 +21,8 @@ def test_JointFusion_inputs(): position=0, usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), exclusion_region=dict(argstr='-x %s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), method=dict(argstr='-m %s', usedefault=True, ), @@ -56,8 +50,6 @@ def test_JointFusion_inputs(): target_image=dict(argstr='-tg %s...', mandatory=True, ), - terminal_output=dict(nohash=True, - ), warped_intensity_images=dict(argstr='-g %s...', mandatory=True, ), diff --git a/nipype/interfaces/ants/tests/test_auto_LaplacianThickness.py b/nipype/interfaces/ants/tests/test_auto_LaplacianThickness.py index 8f7c3908a9..9c4d958e7c 100644 --- a/nipype/interfaces/ants/tests/test_auto_LaplacianThickness.py +++ b/nipype/interfaces/ants/tests/test_auto_LaplacianThickness.py @@ -9,12 +9,6 @@ def test_LaplacianThickness_inputs(): dT=dict(argstr='dT=%d', position=6, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_gm=dict(argstr='%s', copyfile=True, mandatory=True, @@ -45,8 +39,6 @@ def test_LaplacianThickness_inputs(): sulcus_prior=dict(argstr='use-sulcus-prior', position=7, ), - terminal_output=dict(nohash=True, - ), ) inputs = LaplacianThickness._input_spec() diff --git a/nipype/interfaces/ants/tests/test_auto_MultiplyImages.py b/nipype/interfaces/ants/tests/test_auto_MultiplyImages.py index cb37d75788..0ba5e39c6a 100644 --- a/nipype/interfaces/ants/tests/test_auto_MultiplyImages.py +++ b/nipype/interfaces/ants/tests/test_auto_MultiplyImages.py @@ -11,16 +11,10 @@ def test_MultiplyImages_inputs(): position=0, usedefault=False, ), - environ=dict(nohash=True, - usedefault=True, - ), first_input=dict(argstr='%s', mandatory=True, position=1, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), num_threads=dict(nohash=True, usedefault=True, ), @@ -32,8 +26,6 @@ def test_MultiplyImages_inputs(): mandatory=True, position=2, ), - terminal_output=dict(nohash=True, - ), ) inputs = MultiplyImages._input_spec() diff --git a/nipype/interfaces/ants/tests/test_auto_N4BiasFieldCorrection.py b/nipype/interfaces/ants/tests/test_auto_N4BiasFieldCorrection.py index e5311c7f6e..b2b4e910bc 100644 --- a/nipype/interfaces/ants/tests/test_auto_N4BiasFieldCorrection.py +++ b/nipype/interfaces/ants/tests/test_auto_N4BiasFieldCorrection.py @@ -21,12 +21,6 @@ def test_N4BiasFieldCorrection_inputs(): dimension=dict(argstr='-d %d', usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_image=dict(argstr='--input-image %s', mandatory=True, ), @@ -49,8 +43,6 @@ def test_N4BiasFieldCorrection_inputs(): ), shrink_factor=dict(argstr='--shrink-factor %d', ), - terminal_output=dict(nohash=True, - ), weight_image=dict(argstr='--weight-image %s', ), ) diff --git a/nipype/interfaces/ants/tests/test_auto_Registration.py b/nipype/interfaces/ants/tests/test_auto_Registration.py index bbc2bd692f..c5c1afdd46 100644 --- a/nipype/interfaces/ants/tests/test_auto_Registration.py +++ b/nipype/interfaces/ants/tests/test_auto_Registration.py @@ -18,18 +18,12 @@ def test_Registration_inputs(): dimension=dict(argstr='--dimensionality %d', usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), fixed_image=dict(mandatory=True, ), fixed_image_mask=dict(argstr='%s', ), float=dict(argstr='--float %d', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), initial_moving_transform=dict(argstr='%s', xor=['initial_moving_transform_com'], ), @@ -95,8 +89,6 @@ def test_Registration_inputs(): ), smoothing_sigmas=dict(mandatory=True, ), - terminal_output=dict(nohash=True, - ), transform_parameters=dict(), transforms=dict(argstr='%s', mandatory=True, diff --git a/nipype/interfaces/ants/tests/test_auto_WarpImageMultiTransform.py b/nipype/interfaces/ants/tests/test_auto_WarpImageMultiTransform.py index 2cc8a87391..962df40b51 100644 --- a/nipype/interfaces/ants/tests/test_auto_WarpImageMultiTransform.py +++ b/nipype/interfaces/ants/tests/test_auto_WarpImageMultiTransform.py @@ -10,12 +10,6 @@ def test_WarpImageMultiTransform_inputs(): position=1, usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_image=dict(argstr='%s', mandatory=True, position=2, @@ -40,8 +34,6 @@ def test_WarpImageMultiTransform_inputs(): ), reslice_by_header=dict(argstr='--reslice-by-header', ), - terminal_output=dict(nohash=True, - ), tightest_box=dict(argstr='--tightest-bounding-box', xor=['reference_image'], ), diff --git a/nipype/interfaces/ants/tests/test_auto_WarpTimeSeriesImageMultiTransform.py b/nipype/interfaces/ants/tests/test_auto_WarpTimeSeriesImageMultiTransform.py index 052b272fee..0a3212577b 100644 --- a/nipype/interfaces/ants/tests/test_auto_WarpTimeSeriesImageMultiTransform.py +++ b/nipype/interfaces/ants/tests/test_auto_WarpTimeSeriesImageMultiTransform.py @@ -10,12 +10,6 @@ def test_WarpTimeSeriesImageMultiTransform_inputs(): position=1, usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_image=dict(argstr='%s', copyfile=True, mandatory=True, @@ -38,8 +32,6 @@ def test_WarpTimeSeriesImageMultiTransform_inputs(): ), reslice_by_header=dict(argstr='--reslice-by-header', ), - terminal_output=dict(nohash=True, - ), tightest_box=dict(argstr='--tightest-bounding-box', xor=['reference_image'], ), diff --git a/nipype/interfaces/ants/tests/test_auto_antsBrainExtraction.py b/nipype/interfaces/ants/tests/test_auto_antsBrainExtraction.py index 13741bea34..2a95d05cc0 100644 --- a/nipype/interfaces/ants/tests/test_auto_antsBrainExtraction.py +++ b/nipype/interfaces/ants/tests/test_auto_antsBrainExtraction.py @@ -21,14 +21,8 @@ def test_antsBrainExtraction_inputs(): dimension=dict(argstr='-d %d', usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), extraction_registration_mask=dict(argstr='-f %s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), image_suffix=dict(argstr='-s %s', usedefault=True, ), @@ -40,8 +34,6 @@ def test_antsBrainExtraction_inputs(): out_prefix=dict(argstr='-o %s', usedefault=True, ), - terminal_output=dict(nohash=True, - ), use_floatingpoint_precision=dict(argstr='-q %d', ), use_random_seeding=dict(argstr='-u %d', diff --git a/nipype/interfaces/ants/tests/test_auto_antsCorticalThickness.py b/nipype/interfaces/ants/tests/test_auto_antsCorticalThickness.py index 8c97d68ab5..38e0df0393 100644 --- a/nipype/interfaces/ants/tests/test_auto_antsCorticalThickness.py +++ b/nipype/interfaces/ants/tests/test_auto_antsCorticalThickness.py @@ -24,14 +24,8 @@ def test_antsCorticalThickness_inputs(): dimension=dict(argstr='-d %d', usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), extraction_registration_mask=dict(argstr='-f %s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), image_suffix=dict(argstr='-s %s', usedefault=True, ), @@ -61,8 +55,6 @@ def test_antsCorticalThickness_inputs(): t1_registration_template=dict(argstr='-t %s', mandatory=True, ), - terminal_output=dict(nohash=True, - ), use_floatingpoint_precision=dict(argstr='-j %d', ), use_random_seeding=dict(argstr='-u %d', diff --git a/nipype/interfaces/ants/tests/test_auto_antsIntroduction.py b/nipype/interfaces/ants/tests/test_auto_antsIntroduction.py index 776e974ad1..741b10dde4 100644 --- a/nipype/interfaces/ants/tests/test_auto_antsIntroduction.py +++ b/nipype/interfaces/ants/tests/test_auto_antsIntroduction.py @@ -12,14 +12,8 @@ def test_antsIntroduction_inputs(): position=1, usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), force_proceed=dict(argstr='-f 1', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_image=dict(argstr='-i %s', copyfile=False, mandatory=True, @@ -43,8 +37,6 @@ def test_antsIntroduction_inputs(): ), similarity_metric=dict(argstr='-s %s', ), - terminal_output=dict(nohash=True, - ), transformation_model=dict(argstr='-t %s', usedefault=True, ), diff --git a/nipype/interfaces/ants/tests/test_auto_buildtemplateparallel.py b/nipype/interfaces/ants/tests/test_auto_buildtemplateparallel.py index 7dcb11bca2..021948bb19 100644 --- a/nipype/interfaces/ants/tests/test_auto_buildtemplateparallel.py +++ b/nipype/interfaces/ants/tests/test_auto_buildtemplateparallel.py @@ -12,14 +12,8 @@ def test_buildtemplateparallel_inputs(): position=1, usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), gradient_step_size=dict(argstr='-g %f', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_files=dict(argstr='%s', mandatory=True, position=-1, @@ -46,8 +40,6 @@ def test_buildtemplateparallel_inputs(): ), similarity_metric=dict(argstr='-s %s', ), - terminal_output=dict(nohash=True, - ), transformation_model=dict(argstr='-t %s', usedefault=True, ), diff --git a/nipype/interfaces/base/tests/test_auto_BaseInterface.py b/nipype/interfaces/base/tests/test_auto_BaseInterface.py new file mode 100644 index 0000000000..9f3e417907 --- /dev/null +++ b/nipype/interfaces/base/tests/test_auto_BaseInterface.py @@ -0,0 +1,21 @@ +# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT +from ....testing import assert_equal +from ..interfaces import BaseInterface + + +def test_BaseInterface_inputs(): + input_map = dict() + inputs = BaseInterface._input_spec() + + for key, metadata in list(input_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(inputs.traits()[key], metakey), value + + +def test_BaseInterface_outputs(): + output_map = dict() + outputs = BaseInterface._output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/base/tests/test_auto_CommandLine.py b/nipype/interfaces/base/tests/test_auto_CommandLine.py new file mode 100644 index 0000000000..6c85e891c7 --- /dev/null +++ b/nipype/interfaces/base/tests/test_auto_CommandLine.py @@ -0,0 +1,23 @@ +# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT +from ....testing import assert_equal +from ..interfaces import CommandLine + + +def test_CommandLine_inputs(): + input_map = dict(args=dict(argstr='%s', + ), + ) + inputs = CommandLine._input_spec() + + for key, metadata in list(input_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(inputs.traits()[key], metakey), value + + +def test_CommandLine_outputs(): + output_map = dict() + outputs = CommandLine._output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/base/tests/test_auto_MpiCommandLine.py b/nipype/interfaces/base/tests/test_auto_MpiCommandLine.py new file mode 100644 index 0000000000..8223ac7e41 --- /dev/null +++ b/nipype/interfaces/base/tests/test_auto_MpiCommandLine.py @@ -0,0 +1,26 @@ +# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT +from ....testing import assert_equal +from ..interfaces import MpiCommandLine + + +def test_MpiCommandLine_inputs(): + input_map = dict(args=dict(argstr='%s', + ), + n_procs=dict(), + use_mpi=dict(usedefault=True, + ), + ) + inputs = MpiCommandLine._input_spec() + + for key, metadata in list(input_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(inputs.traits()[key], metakey), value + + +def test_MpiCommandLine_outputs(): + output_map = dict() + outputs = MpiCommandLine._output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/base/tests/test_auto_SEMLikeCommandLine.py b/nipype/interfaces/base/tests/test_auto_SEMLikeCommandLine.py new file mode 100644 index 0000000000..29e1f61ae5 --- /dev/null +++ b/nipype/interfaces/base/tests/test_auto_SEMLikeCommandLine.py @@ -0,0 +1,23 @@ +# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT +from ....testing import assert_equal +from ..interfaces import SEMLikeCommandLine + + +def test_SEMLikeCommandLine_inputs(): + input_map = dict(args=dict(argstr='%s', + ), + ) + inputs = SEMLikeCommandLine._input_spec() + + for key, metadata in list(input_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(inputs.traits()[key], metakey), value + + +def test_SEMLikeCommandLine_outputs(): + output_map = dict() + outputs = SEMLikeCommandLine._output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/base/tests/test_auto_StdOutCommandLine.py b/nipype/interfaces/base/tests/test_auto_StdOutCommandLine.py new file mode 100644 index 0000000000..2a27e5d256 --- /dev/null +++ b/nipype/interfaces/base/tests/test_auto_StdOutCommandLine.py @@ -0,0 +1,28 @@ +# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT +from ....testing import assert_equal +from ..interfaces import StdOutCommandLine + + +def test_StdOutCommandLine_inputs(): + input_map = dict(args=dict(argstr='%s', + ), + out_file=dict(argstr='> %s', + position=-1, + usedefault=True, + ), + ) + inputs = StdOutCommandLine._input_spec() + + for key, metadata in list(input_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(inputs.traits()[key], metakey), value + + +def test_StdOutCommandLine_outputs(): + output_map = dict(out_file=dict(), + ) + outputs = StdOutCommandLine._output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/camino/tests/test_auto_AnalyzeHeader.py b/nipype/interfaces/camino/tests/test_auto_AnalyzeHeader.py index daba8457c1..74046fe720 100644 --- a/nipype/interfaces/camino/tests/test_auto_AnalyzeHeader.py +++ b/nipype/interfaces/camino/tests/test_auto_AnalyzeHeader.py @@ -17,15 +17,9 @@ def test_AnalyzeHeader_inputs(): ), description=dict(argstr='-description %s', ), - environ=dict(nohash=True, - usedefault=True, - ), greylevels=dict(argstr='-gl %s', units='NA', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='< %s', mandatory=True, position=1, @@ -74,8 +68,6 @@ def test_AnalyzeHeader_inputs(): scheme_file=dict(argstr='%s', position=2, ), - terminal_output=dict(nohash=True, - ), voxel_dims=dict(argstr='-voxeldims %s', units='mm', ), diff --git a/nipype/interfaces/camino/tests/test_auto_ComputeEigensystem.py b/nipype/interfaces/camino/tests/test_auto_ComputeEigensystem.py index 87dd0b7640..9447698f04 100644 --- a/nipype/interfaces/camino/tests/test_auto_ComputeEigensystem.py +++ b/nipype/interfaces/camino/tests/test_auto_ComputeEigensystem.py @@ -6,12 +6,6 @@ def test_ComputeEigensystem_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='< %s', mandatory=True, position=1, @@ -30,8 +24,6 @@ def test_ComputeEigensystem_inputs(): outputdatatype=dict(argstr='-outputdatatype %s', usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = ComputeEigensystem._input_spec() diff --git a/nipype/interfaces/camino/tests/test_auto_ComputeFractionalAnisotropy.py b/nipype/interfaces/camino/tests/test_auto_ComputeFractionalAnisotropy.py index 38aa904eb3..419537a2c8 100644 --- a/nipype/interfaces/camino/tests/test_auto_ComputeFractionalAnisotropy.py +++ b/nipype/interfaces/camino/tests/test_auto_ComputeFractionalAnisotropy.py @@ -6,12 +6,6 @@ def test_ComputeFractionalAnisotropy_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='< %s', mandatory=True, position=1, @@ -29,8 +23,6 @@ def test_ComputeFractionalAnisotropy_inputs(): scheme_file=dict(argstr='%s', position=2, ), - terminal_output=dict(nohash=True, - ), ) inputs = ComputeFractionalAnisotropy._input_spec() diff --git a/nipype/interfaces/camino/tests/test_auto_ComputeMeanDiffusivity.py b/nipype/interfaces/camino/tests/test_auto_ComputeMeanDiffusivity.py index 4333758aaa..c0b293d61d 100644 --- a/nipype/interfaces/camino/tests/test_auto_ComputeMeanDiffusivity.py +++ b/nipype/interfaces/camino/tests/test_auto_ComputeMeanDiffusivity.py @@ -6,12 +6,6 @@ def test_ComputeMeanDiffusivity_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='< %s', mandatory=True, position=1, @@ -29,8 +23,6 @@ def test_ComputeMeanDiffusivity_inputs(): scheme_file=dict(argstr='%s', position=2, ), - terminal_output=dict(nohash=True, - ), ) inputs = ComputeMeanDiffusivity._input_spec() diff --git a/nipype/interfaces/camino/tests/test_auto_ComputeTensorTrace.py b/nipype/interfaces/camino/tests/test_auto_ComputeTensorTrace.py index 7523f25ed5..277f33dba1 100644 --- a/nipype/interfaces/camino/tests/test_auto_ComputeTensorTrace.py +++ b/nipype/interfaces/camino/tests/test_auto_ComputeTensorTrace.py @@ -6,12 +6,6 @@ def test_ComputeTensorTrace_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='< %s', mandatory=True, position=1, @@ -29,8 +23,6 @@ def test_ComputeTensorTrace_inputs(): scheme_file=dict(argstr='%s', position=2, ), - terminal_output=dict(nohash=True, - ), ) inputs = ComputeTensorTrace._input_spec() diff --git a/nipype/interfaces/camino/tests/test_auto_Conmat.py b/nipype/interfaces/camino/tests/test_auto_Conmat.py index 6cd26db9f3..0b4c9d18ea 100644 --- a/nipype/interfaces/camino/tests/test_auto_Conmat.py +++ b/nipype/interfaces/camino/tests/test_auto_Conmat.py @@ -6,12 +6,6 @@ def test_Conmat_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-inputfile %s', mandatory=True, ), @@ -26,8 +20,6 @@ def test_Conmat_inputs(): ), targetname_file=dict(argstr='-targetnamefile %s', ), - terminal_output=dict(nohash=True, - ), tract_prop=dict(argstr='-tractstat %s', units='NA', xor=['tract_stat'], diff --git a/nipype/interfaces/camino/tests/test_auto_DT2NIfTI.py b/nipype/interfaces/camino/tests/test_auto_DT2NIfTI.py index 7bfba40fb2..0fab23a4a1 100644 --- a/nipype/interfaces/camino/tests/test_auto_DT2NIfTI.py +++ b/nipype/interfaces/camino/tests/test_auto_DT2NIfTI.py @@ -6,16 +6,10 @@ def test_DT2NIfTI_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), header_file=dict(argstr='-header %s', mandatory=True, position=3, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-inputfile %s', mandatory=True, position=1, @@ -24,8 +18,6 @@ def test_DT2NIfTI_inputs(): genfile=True, position=2, ), - terminal_output=dict(nohash=True, - ), ) inputs = DT2NIfTI._input_spec() diff --git a/nipype/interfaces/camino/tests/test_auto_DTIFit.py b/nipype/interfaces/camino/tests/test_auto_DTIFit.py index 663d38f8c5..9387b1be7a 100644 --- a/nipype/interfaces/camino/tests/test_auto_DTIFit.py +++ b/nipype/interfaces/camino/tests/test_auto_DTIFit.py @@ -8,12 +8,6 @@ def test_DTIFit_inputs(): ), bgmask=dict(argstr='-bgmask %s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=1, @@ -29,8 +23,6 @@ def test_DTIFit_inputs(): mandatory=True, position=2, ), - terminal_output=dict(nohash=True, - ), ) inputs = DTIFit._input_spec() diff --git a/nipype/interfaces/camino/tests/test_auto_DTLUTGen.py b/nipype/interfaces/camino/tests/test_auto_DTLUTGen.py index 6d591f03f2..df41d710dc 100644 --- a/nipype/interfaces/camino/tests/test_auto_DTLUTGen.py +++ b/nipype/interfaces/camino/tests/test_auto_DTLUTGen.py @@ -10,16 +10,10 @@ def test_DTLUTGen_inputs(): ), bingham=dict(argstr='-bingham', ), - environ=dict(nohash=True, - usedefault=True, - ), frange=dict(argstr='-frange %s', position=1, units='NA', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inversion=dict(argstr='-inversion %d', units='NA', ), @@ -44,8 +38,6 @@ def test_DTLUTGen_inputs(): step=dict(argstr='-step %f', units='NA', ), - terminal_output=dict(nohash=True, - ), trace=dict(argstr='-trace %G', units='NA', ), diff --git a/nipype/interfaces/camino/tests/test_auto_DTMetric.py b/nipype/interfaces/camino/tests/test_auto_DTMetric.py index bb5e765d04..6f02b97f5e 100644 --- a/nipype/interfaces/camino/tests/test_auto_DTMetric.py +++ b/nipype/interfaces/camino/tests/test_auto_DTMetric.py @@ -11,12 +11,6 @@ def test_DTMetric_inputs(): eigen_data=dict(argstr='-inputfile %s', mandatory=True, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputdatatype=dict(argstr='-inputdatatype %s', usedefault=True, ), @@ -29,8 +23,6 @@ def test_DTMetric_inputs(): outputfile=dict(argstr='-outputfile %s', genfile=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = DTMetric._input_spec() diff --git a/nipype/interfaces/camino/tests/test_auto_FSL2Scheme.py b/nipype/interfaces/camino/tests/test_auto_FSL2Scheme.py index 6d706a73ec..4f8cddfe5c 100644 --- a/nipype/interfaces/camino/tests/test_auto_FSL2Scheme.py +++ b/nipype/interfaces/camino/tests/test_auto_FSL2Scheme.py @@ -20,18 +20,12 @@ def test_FSL2Scheme_inputs(): diffusiontime=dict(argstr='-diffusiontime %f', units='NA', ), - environ=dict(nohash=True, - usedefault=True, - ), flipx=dict(argstr='-flipx', ), flipy=dict(argstr='-flipy', ), flipz=dict(argstr='-flipz', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), interleave=dict(argstr='-interleave', ), numscans=dict(argstr='-numscans %d', @@ -41,8 +35,6 @@ def test_FSL2Scheme_inputs(): position=-1, usedefault=True, ), - terminal_output=dict(nohash=True, - ), usegradmod=dict(argstr='-usegradmod', ), ) diff --git a/nipype/interfaces/camino/tests/test_auto_Image2Voxel.py b/nipype/interfaces/camino/tests/test_auto_Image2Voxel.py index da398d2d46..2c4fe9ef30 100644 --- a/nipype/interfaces/camino/tests/test_auto_Image2Voxel.py +++ b/nipype/interfaces/camino/tests/test_auto_Image2Voxel.py @@ -6,12 +6,6 @@ def test_Image2Voxel_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-4dimage %s', mandatory=True, position=1, @@ -24,8 +18,6 @@ def test_Image2Voxel_inputs(): position=2, usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = Image2Voxel._input_spec() diff --git a/nipype/interfaces/camino/tests/test_auto_ImageStats.py b/nipype/interfaces/camino/tests/test_auto_ImageStats.py index ca30280f81..ab21504950 100644 --- a/nipype/interfaces/camino/tests/test_auto_ImageStats.py +++ b/nipype/interfaces/camino/tests/test_auto_ImageStats.py @@ -6,12 +6,6 @@ def test_ImageStats_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_files=dict(argstr='-images %s', mandatory=True, position=-1, @@ -26,8 +20,6 @@ def test_ImageStats_inputs(): mandatory=True, units='NA', ), - terminal_output=dict(nohash=True, - ), ) inputs = ImageStats._input_spec() diff --git a/nipype/interfaces/camino/tests/test_auto_LinRecon.py b/nipype/interfaces/camino/tests/test_auto_LinRecon.py index 3612ab3c3c..1dd6cb2f28 100644 --- a/nipype/interfaces/camino/tests/test_auto_LinRecon.py +++ b/nipype/interfaces/camino/tests/test_auto_LinRecon.py @@ -8,12 +8,6 @@ def test_LinRecon_inputs(): ), bgmask=dict(argstr='-bgmask %s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=1, @@ -34,8 +28,6 @@ def test_LinRecon_inputs(): mandatory=True, position=2, ), - terminal_output=dict(nohash=True, - ), ) inputs = LinRecon._input_spec() diff --git a/nipype/interfaces/camino/tests/test_auto_MESD.py b/nipype/interfaces/camino/tests/test_auto_MESD.py index 8a1bc4a56b..125b81c391 100644 --- a/nipype/interfaces/camino/tests/test_auto_MESD.py +++ b/nipype/interfaces/camino/tests/test_auto_MESD.py @@ -8,15 +8,9 @@ def test_MESD_inputs(): ), bgmask=dict(argstr='-bgmask %s', ), - environ=dict(nohash=True, - usedefault=True, - ), fastmesd=dict(argstr='-fastmesd', requires=['mepointset'], ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-inputfile %s', mandatory=True, position=1, @@ -42,8 +36,6 @@ def test_MESD_inputs(): scheme_file=dict(argstr='-schemefile %s', mandatory=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = MESD._input_spec() diff --git a/nipype/interfaces/camino/tests/test_auto_ModelFit.py b/nipype/interfaces/camino/tests/test_auto_ModelFit.py index bc48d58c6d..27c1c5db50 100644 --- a/nipype/interfaces/camino/tests/test_auto_ModelFit.py +++ b/nipype/interfaces/camino/tests/test_auto_ModelFit.py @@ -12,16 +12,10 @@ def test_ModelFit_inputs(): ), cfthresh=dict(argstr='-csfthresh %G', ), - environ=dict(nohash=True, - usedefault=True, - ), fixedbvalue=dict(argstr='-fixedbvalue %s', ), fixedmodq=dict(argstr='-fixedmod %s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-inputfile %s', mandatory=True, ), @@ -49,8 +43,6 @@ def test_ModelFit_inputs(): ), tau=dict(argstr='-tau %G', ), - terminal_output=dict(nohash=True, - ), ) inputs = ModelFit._input_spec() diff --git a/nipype/interfaces/camino/tests/test_auto_NIfTIDT2Camino.py b/nipype/interfaces/camino/tests/test_auto_NIfTIDT2Camino.py index 41eacea0d1..3cbd6834f8 100644 --- a/nipype/interfaces/camino/tests/test_auto_NIfTIDT2Camino.py +++ b/nipype/interfaces/camino/tests/test_auto_NIfTIDT2Camino.py @@ -8,12 +8,6 @@ def test_NIfTIDT2Camino_inputs(): ), bgmask=dict(argstr='-bgmask %s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-inputfile %s', mandatory=True, position=1, @@ -30,8 +24,6 @@ def test_NIfTIDT2Camino_inputs(): ), scaleslope=dict(argstr='-scaleslope %s', ), - terminal_output=dict(nohash=True, - ), uppertriangular=dict(argstr='-uppertriangular %s', ), ) diff --git a/nipype/interfaces/camino/tests/test_auto_PicoPDFs.py b/nipype/interfaces/camino/tests/test_auto_PicoPDFs.py index 795f7c629d..4081f2beab 100644 --- a/nipype/interfaces/camino/tests/test_auto_PicoPDFs.py +++ b/nipype/interfaces/camino/tests/test_auto_PicoPDFs.py @@ -8,12 +8,6 @@ def test_PicoPDFs_inputs(): ), directmap=dict(argstr='-directmap', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='< %s', mandatory=True, position=1, @@ -39,8 +33,6 @@ def test_PicoPDFs_inputs(): position=4, usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = PicoPDFs._input_spec() diff --git a/nipype/interfaces/camino/tests/test_auto_ProcStreamlines.py b/nipype/interfaces/camino/tests/test_auto_ProcStreamlines.py index 3e2fa71be1..284f23fdc4 100644 --- a/nipype/interfaces/camino/tests/test_auto_ProcStreamlines.py +++ b/nipype/interfaces/camino/tests/test_auto_ProcStreamlines.py @@ -18,16 +18,10 @@ def test_ProcStreamlines_inputs(): ), endpointfile=dict(argstr='-endpointfile %s', ), - environ=dict(nohash=True, - usedefault=True, - ), exclusionfile=dict(argstr='-exclusionfile %s', ), gzip=dict(argstr='-gzip', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-inputfile %s', mandatory=True, position=1, @@ -88,8 +82,6 @@ def test_ProcStreamlines_inputs(): ), targetfile=dict(argstr='-targetfile %s', ), - terminal_output=dict(nohash=True, - ), truncateinexclusion=dict(argstr='-truncateinexclusion', ), truncateloops=dict(argstr='-truncateloops', diff --git a/nipype/interfaces/camino/tests/test_auto_QBallMX.py b/nipype/interfaces/camino/tests/test_auto_QBallMX.py index 3e3f691458..1b4716b7a7 100644 --- a/nipype/interfaces/camino/tests/test_auto_QBallMX.py +++ b/nipype/interfaces/camino/tests/test_auto_QBallMX.py @@ -9,12 +9,6 @@ def test_QBallMX_inputs(): basistype=dict(argstr='-basistype %s', usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), order=dict(argstr='-order %d', units='NA', ), @@ -34,8 +28,6 @@ def test_QBallMX_inputs(): smoothingsigma=dict(argstr='-smoothingsigma %f', units='NA', ), - terminal_output=dict(nohash=True, - ), ) inputs = QBallMX._input_spec() diff --git a/nipype/interfaces/camino/tests/test_auto_SFLUTGen.py b/nipype/interfaces/camino/tests/test_auto_SFLUTGen.py index f223276443..ca2aa907c9 100644 --- a/nipype/interfaces/camino/tests/test_auto_SFLUTGen.py +++ b/nipype/interfaces/camino/tests/test_auto_SFLUTGen.py @@ -11,12 +11,6 @@ def test_SFLUTGen_inputs(): ), directmap=dict(argstr='-directmap', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-inputfile %s', mandatory=True, ), @@ -39,8 +33,6 @@ def test_SFLUTGen_inputs(): pdf=dict(argstr='-pdf %s', usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = SFLUTGen._input_spec() diff --git a/nipype/interfaces/camino/tests/test_auto_SFPICOCalibData.py b/nipype/interfaces/camino/tests/test_auto_SFPICOCalibData.py index f61dde7d30..2e99baa730 100644 --- a/nipype/interfaces/camino/tests/test_auto_SFPICOCalibData.py +++ b/nipype/interfaces/camino/tests/test_auto_SFPICOCalibData.py @@ -6,12 +6,6 @@ def test_SFPICOCalibData_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), info_file=dict(argstr='-infooutputfile %s', genfile=True, hash_files=False, @@ -36,8 +30,6 @@ def test_SFPICOCalibData_inputs(): snr=dict(argstr='-snr %f', units='NA', ), - terminal_output=dict(nohash=True, - ), trace=dict(argstr='-trace %f', units='NA', ), diff --git a/nipype/interfaces/camino/tests/test_auto_SFPeaks.py b/nipype/interfaces/camino/tests/test_auto_SFPeaks.py index 9c2d99217e..49067b8027 100644 --- a/nipype/interfaces/camino/tests/test_auto_SFPeaks.py +++ b/nipype/interfaces/camino/tests/test_auto_SFPeaks.py @@ -9,12 +9,6 @@ def test_SFPeaks_inputs(): density=dict(argstr='-density %d', units='NA', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-inputfile %s', mandatory=True, ), @@ -53,8 +47,6 @@ def test_SFPeaks_inputs(): stdsfrommean=dict(argstr='-stdsfrommean %f', units='NA', ), - terminal_output=dict(nohash=True, - ), ) inputs = SFPeaks._input_spec() diff --git a/nipype/interfaces/camino/tests/test_auto_Shredder.py b/nipype/interfaces/camino/tests/test_auto_Shredder.py index c553268422..b97f46acbf 100644 --- a/nipype/interfaces/camino/tests/test_auto_Shredder.py +++ b/nipype/interfaces/camino/tests/test_auto_Shredder.py @@ -10,12 +10,6 @@ def test_Shredder_inputs(): position=2, units='NA', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='< %s', mandatory=True, position=-2, @@ -32,8 +26,6 @@ def test_Shredder_inputs(): position=3, units='NA', ), - terminal_output=dict(nohash=True, - ), ) inputs = Shredder._input_spec() diff --git a/nipype/interfaces/camino/tests/test_auto_Track.py b/nipype/interfaces/camino/tests/test_auto_Track.py index 028863271f..7aabc48119 100644 --- a/nipype/interfaces/camino/tests/test_auto_Track.py +++ b/nipype/interfaces/camino/tests/test_auto_Track.py @@ -18,14 +18,8 @@ def test_Track_inputs(): data_dims=dict(argstr='-datadims %s', units='voxels', ), - environ=dict(nohash=True, - usedefault=True, - ), gzip=dict(argstr='-gzip', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-inputfile %s', position=1, ), @@ -59,8 +53,6 @@ def test_Track_inputs(): stepsize=dict(argstr='-stepsize %f', requires=['tracker'], ), - terminal_output=dict(nohash=True, - ), tracker=dict(argstr='-tracker %s', usedefault=True, ), diff --git a/nipype/interfaces/camino/tests/test_auto_TrackBallStick.py b/nipype/interfaces/camino/tests/test_auto_TrackBallStick.py index 511ba68e1d..4472984b04 100644 --- a/nipype/interfaces/camino/tests/test_auto_TrackBallStick.py +++ b/nipype/interfaces/camino/tests/test_auto_TrackBallStick.py @@ -18,14 +18,8 @@ def test_TrackBallStick_inputs(): data_dims=dict(argstr='-datadims %s', units='voxels', ), - environ=dict(nohash=True, - usedefault=True, - ), gzip=dict(argstr='-gzip', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-inputfile %s', position=1, ), @@ -59,8 +53,6 @@ def test_TrackBallStick_inputs(): stepsize=dict(argstr='-stepsize %f', requires=['tracker'], ), - terminal_output=dict(nohash=True, - ), tracker=dict(argstr='-tracker %s', usedefault=True, ), diff --git a/nipype/interfaces/camino/tests/test_auto_TrackBayesDirac.py b/nipype/interfaces/camino/tests/test_auto_TrackBayesDirac.py index 586ef55726..ab0497466e 100644 --- a/nipype/interfaces/camino/tests/test_auto_TrackBayesDirac.py +++ b/nipype/interfaces/camino/tests/test_auto_TrackBayesDirac.py @@ -24,18 +24,12 @@ def test_TrackBayesDirac_inputs(): ), datamodel=dict(argstr='-datamodel %s', ), - environ=dict(nohash=True, - usedefault=True, - ), extpriordatatype=dict(argstr='-extpriordatatype %s', ), extpriorfile=dict(argstr='-extpriorfile %s', ), gzip=dict(argstr='-gzip', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-inputfile %s', position=1, ), @@ -79,8 +73,6 @@ def test_TrackBayesDirac_inputs(): stepsize=dict(argstr='-stepsize %f', requires=['tracker'], ), - terminal_output=dict(nohash=True, - ), tracker=dict(argstr='-tracker %s', usedefault=True, ), diff --git a/nipype/interfaces/camino/tests/test_auto_TrackBedpostxDeter.py b/nipype/interfaces/camino/tests/test_auto_TrackBedpostxDeter.py index 4461aeb6f3..7f7c8a8c3f 100644 --- a/nipype/interfaces/camino/tests/test_auto_TrackBedpostxDeter.py +++ b/nipype/interfaces/camino/tests/test_auto_TrackBedpostxDeter.py @@ -21,14 +21,8 @@ def test_TrackBedpostxDeter_inputs(): data_dims=dict(argstr='-datadims %s', units='voxels', ), - environ=dict(nohash=True, - usedefault=True, - ), gzip=dict(argstr='-gzip', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-inputfile %s', position=1, ), @@ -65,8 +59,6 @@ def test_TrackBedpostxDeter_inputs(): stepsize=dict(argstr='-stepsize %f', requires=['tracker'], ), - terminal_output=dict(nohash=True, - ), tracker=dict(argstr='-tracker %s', usedefault=True, ), diff --git a/nipype/interfaces/camino/tests/test_auto_TrackBedpostxProba.py b/nipype/interfaces/camino/tests/test_auto_TrackBedpostxProba.py index 8bd425ce4f..8ac2bb0331 100644 --- a/nipype/interfaces/camino/tests/test_auto_TrackBedpostxProba.py +++ b/nipype/interfaces/camino/tests/test_auto_TrackBedpostxProba.py @@ -21,14 +21,8 @@ def test_TrackBedpostxProba_inputs(): data_dims=dict(argstr='-datadims %s', units='voxels', ), - environ=dict(nohash=True, - usedefault=True, - ), gzip=dict(argstr='-gzip', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-inputfile %s', position=1, ), @@ -68,8 +62,6 @@ def test_TrackBedpostxProba_inputs(): stepsize=dict(argstr='-stepsize %f', requires=['tracker'], ), - terminal_output=dict(nohash=True, - ), tracker=dict(argstr='-tracker %s', usedefault=True, ), diff --git a/nipype/interfaces/camino/tests/test_auto_TrackBootstrap.py b/nipype/interfaces/camino/tests/test_auto_TrackBootstrap.py index 8a4d0bcec8..19ce772af9 100644 --- a/nipype/interfaces/camino/tests/test_auto_TrackBootstrap.py +++ b/nipype/interfaces/camino/tests/test_auto_TrackBootstrap.py @@ -23,14 +23,8 @@ def test_TrackBootstrap_inputs(): data_dims=dict(argstr='-datadims %s', units='voxels', ), - environ=dict(nohash=True, - usedefault=True, - ), gzip=dict(argstr='-gzip', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-inputfile %s', position=1, ), @@ -72,8 +66,6 @@ def test_TrackBootstrap_inputs(): stepsize=dict(argstr='-stepsize %f', requires=['tracker'], ), - terminal_output=dict(nohash=True, - ), tracker=dict(argstr='-tracker %s', usedefault=True, ), diff --git a/nipype/interfaces/camino/tests/test_auto_TrackDT.py b/nipype/interfaces/camino/tests/test_auto_TrackDT.py index 495e8ae6fa..e4de064dce 100644 --- a/nipype/interfaces/camino/tests/test_auto_TrackDT.py +++ b/nipype/interfaces/camino/tests/test_auto_TrackDT.py @@ -18,14 +18,8 @@ def test_TrackDT_inputs(): data_dims=dict(argstr='-datadims %s', units='voxels', ), - environ=dict(nohash=True, - usedefault=True, - ), gzip=dict(argstr='-gzip', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-inputfile %s', position=1, ), @@ -59,8 +53,6 @@ def test_TrackDT_inputs(): stepsize=dict(argstr='-stepsize %f', requires=['tracker'], ), - terminal_output=dict(nohash=True, - ), tracker=dict(argstr='-tracker %s', usedefault=True, ), diff --git a/nipype/interfaces/camino/tests/test_auto_TrackPICo.py b/nipype/interfaces/camino/tests/test_auto_TrackPICo.py index a6ae5ef60d..edb1b005e8 100644 --- a/nipype/interfaces/camino/tests/test_auto_TrackPICo.py +++ b/nipype/interfaces/camino/tests/test_auto_TrackPICo.py @@ -18,14 +18,8 @@ def test_TrackPICo_inputs(): data_dims=dict(argstr='-datadims %s', units='voxels', ), - environ=dict(nohash=True, - usedefault=True, - ), gzip=dict(argstr='-gzip', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-inputfile %s', position=1, ), @@ -64,8 +58,6 @@ def test_TrackPICo_inputs(): stepsize=dict(argstr='-stepsize %f', requires=['tracker'], ), - terminal_output=dict(nohash=True, - ), tracker=dict(argstr='-tracker %s', usedefault=True, ), diff --git a/nipype/interfaces/camino/tests/test_auto_TractShredder.py b/nipype/interfaces/camino/tests/test_auto_TractShredder.py index f507f4829f..eef2907b71 100644 --- a/nipype/interfaces/camino/tests/test_auto_TractShredder.py +++ b/nipype/interfaces/camino/tests/test_auto_TractShredder.py @@ -10,12 +10,6 @@ def test_TractShredder_inputs(): position=2, units='NA', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='< %s', mandatory=True, position=-2, @@ -32,8 +26,6 @@ def test_TractShredder_inputs(): position=3, units='NA', ), - terminal_output=dict(nohash=True, - ), ) inputs = TractShredder._input_spec() diff --git a/nipype/interfaces/camino/tests/test_auto_VtkStreamlines.py b/nipype/interfaces/camino/tests/test_auto_VtkStreamlines.py index 377733fd30..9aa6f894cf 100644 --- a/nipype/interfaces/camino/tests/test_auto_VtkStreamlines.py +++ b/nipype/interfaces/camino/tests/test_auto_VtkStreamlines.py @@ -8,12 +8,6 @@ def test_VtkStreamlines_inputs(): ), colourorient=dict(argstr='-colourorient', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr=' < %s', mandatory=True, position=-2, @@ -38,8 +32,6 @@ def test_VtkStreamlines_inputs(): target_file=dict(argstr='-targetfile %s', position=2, ), - terminal_output=dict(nohash=True, - ), voxeldims=dict(argstr='-voxeldims %s', position=4, units='mm', diff --git a/nipype/interfaces/camino2trackvis/tests/test_auto_Camino2Trackvis.py b/nipype/interfaces/camino2trackvis/tests/test_auto_Camino2Trackvis.py index 3f6c26709e..c7f044866f 100644 --- a/nipype/interfaces/camino2trackvis/tests/test_auto_Camino2Trackvis.py +++ b/nipype/interfaces/camino2trackvis/tests/test_auto_Camino2Trackvis.py @@ -11,12 +11,6 @@ def test_Camino2Trackvis_inputs(): position=4, sep=',', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-i %s', mandatory=True, position=1, @@ -32,8 +26,6 @@ def test_Camino2Trackvis_inputs(): genfile=True, position=2, ), - terminal_output=dict(nohash=True, - ), voxel_dims=dict(argstr='-x %s', mandatory=True, position=5, diff --git a/nipype/interfaces/camino2trackvis/tests/test_auto_Trackvis2Camino.py b/nipype/interfaces/camino2trackvis/tests/test_auto_Trackvis2Camino.py index 7b58417349..821ab67960 100644 --- a/nipype/interfaces/camino2trackvis/tests/test_auto_Trackvis2Camino.py +++ b/nipype/interfaces/camino2trackvis/tests/test_auto_Trackvis2Camino.py @@ -9,12 +9,6 @@ def test_Trackvis2Camino_inputs(): ), args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-i %s', mandatory=True, position=1, @@ -23,8 +17,6 @@ def test_Trackvis2Camino_inputs(): genfile=True, position=2, ), - terminal_output=dict(nohash=True, - ), ) inputs = Trackvis2Camino._input_spec() diff --git a/nipype/interfaces/cmtk/tests/test_auto_AverageNetworks.py b/nipype/interfaces/cmtk/tests/test_auto_AverageNetworks.py index a47682c76f..b9f8a9a29a 100644 --- a/nipype/interfaces/cmtk/tests/test_auto_AverageNetworks.py +++ b/nipype/interfaces/cmtk/tests/test_auto_AverageNetworks.py @@ -6,9 +6,6 @@ def test_AverageNetworks_inputs(): input_map = dict(group_id=dict(usedefault=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_files=dict(mandatory=True, ), out_gexf_groupavg=dict(), diff --git a/nipype/interfaces/cmtk/tests/test_auto_CFFConverter.py b/nipype/interfaces/cmtk/tests/test_auto_CFFConverter.py index c3103787fd..ab5ae3a683 100644 --- a/nipype/interfaces/cmtk/tests/test_auto_CFFConverter.py +++ b/nipype/interfaces/cmtk/tests/test_auto_CFFConverter.py @@ -13,9 +13,6 @@ def test_CFFConverter_inputs(): gifti_surfaces=dict(), gpickled_networks=dict(), graphml_networks=dict(), - ignore_exception=dict(nohash=True, - usedefault=True, - ), license=dict(), nifti_volumes=dict(), out_file=dict(usedefault=True, diff --git a/nipype/interfaces/cmtk/tests/test_auto_CreateNodes.py b/nipype/interfaces/cmtk/tests/test_auto_CreateNodes.py index f427372099..11aca21a80 100644 --- a/nipype/interfaces/cmtk/tests/test_auto_CreateNodes.py +++ b/nipype/interfaces/cmtk/tests/test_auto_CreateNodes.py @@ -4,10 +4,7 @@ def test_CreateNodes_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - out_filename=dict(usedefault=True, + input_map = dict(out_filename=dict(usedefault=True, ), resolution_network_file=dict(mandatory=True, ), diff --git a/nipype/interfaces/cmtk/tests/test_auto_MergeCNetworks.py b/nipype/interfaces/cmtk/tests/test_auto_MergeCNetworks.py index 2ee0172ab9..10881720e0 100644 --- a/nipype/interfaces/cmtk/tests/test_auto_MergeCNetworks.py +++ b/nipype/interfaces/cmtk/tests/test_auto_MergeCNetworks.py @@ -4,10 +4,7 @@ def test_MergeCNetworks_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - in_files=dict(mandatory=True, + input_map = dict(in_files=dict(mandatory=True, ), out_file=dict(usedefault=True, ), diff --git a/nipype/interfaces/cmtk/tests/test_auto_NetworkBasedStatistic.py b/nipype/interfaces/cmtk/tests/test_auto_NetworkBasedStatistic.py index 255cc29a55..e92478fad5 100644 --- a/nipype/interfaces/cmtk/tests/test_auto_NetworkBasedStatistic.py +++ b/nipype/interfaces/cmtk/tests/test_auto_NetworkBasedStatistic.py @@ -6,9 +6,6 @@ def test_NetworkBasedStatistic_inputs(): input_map = dict(edge_key=dict(usedefault=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_group1=dict(mandatory=True, ), in_group2=dict(mandatory=True, diff --git a/nipype/interfaces/cmtk/tests/test_auto_NetworkXMetrics.py b/nipype/interfaces/cmtk/tests/test_auto_NetworkXMetrics.py index d084cbf613..50400c9a2c 100644 --- a/nipype/interfaces/cmtk/tests/test_auto_NetworkXMetrics.py +++ b/nipype/interfaces/cmtk/tests/test_auto_NetworkXMetrics.py @@ -6,9 +6,6 @@ def test_NetworkXMetrics_inputs(): input_map = dict(compute_clique_related_measures=dict(usedefault=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(mandatory=True, ), out_edge_metrics_matlab=dict(genfile=True, diff --git a/nipype/interfaces/cmtk/tests/test_auto_Parcellate.py b/nipype/interfaces/cmtk/tests/test_auto_Parcellate.py index 470caa54f9..7fe54a5f6f 100644 --- a/nipype/interfaces/cmtk/tests/test_auto_Parcellate.py +++ b/nipype/interfaces/cmtk/tests/test_auto_Parcellate.py @@ -7,9 +7,6 @@ def test_Parcellate_inputs(): input_map = dict(dilation=dict(usedefault=True, ), freesurfer_dir=dict(), - ignore_exception=dict(nohash=True, - usedefault=True, - ), out_roi_file=dict(genfile=True, ), parcellation_name=dict(usedefault=True, diff --git a/nipype/interfaces/cmtk/tests/test_auto_ROIGen.py b/nipype/interfaces/cmtk/tests/test_auto_ROIGen.py index 182f1e82d1..eeca82d68f 100644 --- a/nipype/interfaces/cmtk/tests/test_auto_ROIGen.py +++ b/nipype/interfaces/cmtk/tests/test_auto_ROIGen.py @@ -10,9 +10,6 @@ def test_ROIGen_inputs(): ), freesurfer_dir=dict(requires=['use_freesurfer_LUT'], ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), out_dict_file=dict(genfile=True, ), out_roi_file=dict(genfile=True, diff --git a/nipype/interfaces/diffusion_toolkit/tests/test_auto_DTIRecon.py b/nipype/interfaces/diffusion_toolkit/tests/test_auto_DTIRecon.py index b459700a8b..9fe1eaf350 100644 --- a/nipype/interfaces/diffusion_toolkit/tests/test_auto_DTIRecon.py +++ b/nipype/interfaces/diffusion_toolkit/tests/test_auto_DTIRecon.py @@ -17,12 +17,6 @@ def test_DTIRecon_inputs(): bvecs=dict(argstr='-gm %s', mandatory=True, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), image_orientation_vectors=dict(argstr='-iop %f', ), n_averages=dict(argstr='-nex %s', @@ -36,8 +30,6 @@ def test_DTIRecon_inputs(): output_type=dict(argstr='-ot %s', usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = DTIRecon._input_spec() diff --git a/nipype/interfaces/diffusion_toolkit/tests/test_auto_DTITracker.py b/nipype/interfaces/diffusion_toolkit/tests/test_auto_DTITracker.py index df265bb39b..113162b033 100644 --- a/nipype/interfaces/diffusion_toolkit/tests/test_auto_DTITracker.py +++ b/nipype/interfaces/diffusion_toolkit/tests/test_auto_DTITracker.py @@ -10,12 +10,6 @@ def test_DTITracker_inputs(): ), args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_data_prefix=dict(argstr='%s', position=0, usedefault=True, @@ -58,8 +52,6 @@ def test_DTITracker_inputs(): swap_zx=dict(argstr='-szx', ), tensor_file=dict(), - terminal_output=dict(nohash=True, - ), tracking_method=dict(argstr='-%s', ), ) diff --git a/nipype/interfaces/diffusion_toolkit/tests/test_auto_HARDIMat.py b/nipype/interfaces/diffusion_toolkit/tests/test_auto_HARDIMat.py index 218cae5a10..ba105216c1 100644 --- a/nipype/interfaces/diffusion_toolkit/tests/test_auto_HARDIMat.py +++ b/nipype/interfaces/diffusion_toolkit/tests/test_auto_HARDIMat.py @@ -12,12 +12,6 @@ def test_HARDIMat_inputs(): mandatory=True, position=1, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), image_info=dict(argstr='-info %s', ), image_orientation_vectors=dict(argstr='-iop %f', @@ -34,8 +28,6 @@ def test_HARDIMat_inputs(): ), reference_file=dict(argstr='-ref %s', ), - terminal_output=dict(nohash=True, - ), ) inputs = HARDIMat._input_spec() diff --git a/nipype/interfaces/diffusion_toolkit/tests/test_auto_ODFRecon.py b/nipype/interfaces/diffusion_toolkit/tests/test_auto_ODFRecon.py index 321c637e8b..5142b06be0 100644 --- a/nipype/interfaces/diffusion_toolkit/tests/test_auto_ODFRecon.py +++ b/nipype/interfaces/diffusion_toolkit/tests/test_auto_ODFRecon.py @@ -12,14 +12,8 @@ def test_ODFRecon_inputs(): ), dsi=dict(argstr='-dsi', ), - environ=dict(nohash=True, - usedefault=True, - ), filter=dict(argstr='-f', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), image_orientation_vectors=dict(argstr='-iop %f', ), matrix=dict(argstr='-mat %s', @@ -51,8 +45,6 @@ def test_ODFRecon_inputs(): ), subtract_background=dict(argstr='-bg', ), - terminal_output=dict(nohash=True, - ), ) inputs = ODFRecon._input_spec() diff --git a/nipype/interfaces/diffusion_toolkit/tests/test_auto_ODFTracker.py b/nipype/interfaces/diffusion_toolkit/tests/test_auto_ODFTracker.py index 6978fd51e4..998428f830 100644 --- a/nipype/interfaces/diffusion_toolkit/tests/test_auto_ODFTracker.py +++ b/nipype/interfaces/diffusion_toolkit/tests/test_auto_ODFTracker.py @@ -14,12 +14,6 @@ def test_ODFTracker_inputs(): ), dsi=dict(argstr='-dsi', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), image_orientation_vectors=dict(argstr='-iop %f', ), input_data_prefix=dict(argstr='%s', @@ -68,8 +62,6 @@ def test_ODFTracker_inputs(): ), swap_zx=dict(argstr='-szx', ), - terminal_output=dict(nohash=True, - ), voxel_order=dict(argstr='-vorder %s', ), ) diff --git a/nipype/interfaces/diffusion_toolkit/tests/test_auto_SplineFilter.py b/nipype/interfaces/diffusion_toolkit/tests/test_auto_SplineFilter.py index 749e661923..82f35cd635 100644 --- a/nipype/interfaces/diffusion_toolkit/tests/test_auto_SplineFilter.py +++ b/nipype/interfaces/diffusion_toolkit/tests/test_auto_SplineFilter.py @@ -6,12 +6,6 @@ def test_SplineFilter_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), output_file=dict(argstr='%s', position=2, usedefault=True, @@ -20,8 +14,6 @@ def test_SplineFilter_inputs(): mandatory=True, position=1, ), - terminal_output=dict(nohash=True, - ), track_file=dict(argstr='%s', mandatory=True, position=0, diff --git a/nipype/interfaces/diffusion_toolkit/tests/test_auto_TrackMerge.py b/nipype/interfaces/diffusion_toolkit/tests/test_auto_TrackMerge.py index 21d26cfb75..35f7636242 100644 --- a/nipype/interfaces/diffusion_toolkit/tests/test_auto_TrackMerge.py +++ b/nipype/interfaces/diffusion_toolkit/tests/test_auto_TrackMerge.py @@ -6,18 +6,10 @@ def test_TrackMerge_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), output_file=dict(argstr='%s', position=-1, usedefault=True, ), - terminal_output=dict(nohash=True, - ), track_files=dict(argstr='%s...', mandatory=True, position=0, diff --git a/nipype/interfaces/dipy/tests/test_auto_CSD.py b/nipype/interfaces/dipy/tests/test_auto_CSD.py index ad74719962..59ec23a790 100644 --- a/nipype/interfaces/dipy/tests/test_auto_CSD.py +++ b/nipype/interfaces/dipy/tests/test_auto_CSD.py @@ -6,9 +6,6 @@ def test_CSD_inputs(): input_map = dict(b0_thres=dict(usedefault=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_bval=dict(mandatory=True, ), in_bvec=dict(mandatory=True, diff --git a/nipype/interfaces/dipy/tests/test_auto_DTI.py b/nipype/interfaces/dipy/tests/test_auto_DTI.py index db9c40c929..015337b899 100644 --- a/nipype/interfaces/dipy/tests/test_auto_DTI.py +++ b/nipype/interfaces/dipy/tests/test_auto_DTI.py @@ -6,9 +6,6 @@ def test_DTI_inputs(): input_map = dict(b0_thres=dict(usedefault=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_bval=dict(mandatory=True, ), in_bvec=dict(mandatory=True, diff --git a/nipype/interfaces/dipy/tests/test_auto_DipyBaseInterface.py b/nipype/interfaces/dipy/tests/test_auto_DipyBaseInterface.py index 8fab1caf82..13a81681aa 100644 --- a/nipype/interfaces/dipy/tests/test_auto_DipyBaseInterface.py +++ b/nipype/interfaces/dipy/tests/test_auto_DipyBaseInterface.py @@ -4,10 +4,7 @@ def test_DipyBaseInterface_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - ) + input_map = dict() inputs = DipyBaseInterface._input_spec() for key, metadata in list(input_map.items()): diff --git a/nipype/interfaces/dipy/tests/test_auto_DipyDiffusionInterface.py b/nipype/interfaces/dipy/tests/test_auto_DipyDiffusionInterface.py index 04ff1092a9..6987b2d1f1 100644 --- a/nipype/interfaces/dipy/tests/test_auto_DipyDiffusionInterface.py +++ b/nipype/interfaces/dipy/tests/test_auto_DipyDiffusionInterface.py @@ -6,9 +6,6 @@ def test_DipyDiffusionInterface_inputs(): input_map = dict(b0_thres=dict(usedefault=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_bval=dict(mandatory=True, ), in_bvec=dict(mandatory=True, diff --git a/nipype/interfaces/dipy/tests/test_auto_EstimateResponseSH.py b/nipype/interfaces/dipy/tests/test_auto_EstimateResponseSH.py index 46d8962a32..7778c21c12 100644 --- a/nipype/interfaces/dipy/tests/test_auto_EstimateResponseSH.py +++ b/nipype/interfaces/dipy/tests/test_auto_EstimateResponseSH.py @@ -11,9 +11,6 @@ def test_EstimateResponseSH_inputs(): ), fa_thresh=dict(usedefault=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_bval=dict(mandatory=True, ), in_bvec=dict(mandatory=True, diff --git a/nipype/interfaces/dipy/tests/test_auto_RESTORE.py b/nipype/interfaces/dipy/tests/test_auto_RESTORE.py index 01c758854a..018eee72ba 100644 --- a/nipype/interfaces/dipy/tests/test_auto_RESTORE.py +++ b/nipype/interfaces/dipy/tests/test_auto_RESTORE.py @@ -6,9 +6,6 @@ def test_RESTORE_inputs(): input_map = dict(b0_thres=dict(usedefault=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_bval=dict(mandatory=True, ), in_bvec=dict(mandatory=True, diff --git a/nipype/interfaces/dipy/tests/test_auto_SimulateMultiTensor.py b/nipype/interfaces/dipy/tests/test_auto_SimulateMultiTensor.py index c3c520574e..49a18bf7c2 100644 --- a/nipype/interfaces/dipy/tests/test_auto_SimulateMultiTensor.py +++ b/nipype/interfaces/dipy/tests/test_auto_SimulateMultiTensor.py @@ -13,9 +13,6 @@ def test_SimulateMultiTensor_inputs(): diff_sf=dict(usedefault=True, ), gradients=dict(), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_bval=dict(), in_bvec=dict(), in_dirs=dict(mandatory=True, diff --git a/nipype/interfaces/dipy/tests/test_auto_StreamlineTractography.py b/nipype/interfaces/dipy/tests/test_auto_StreamlineTractography.py index 7b6ca95a3d..a6f8ced948 100644 --- a/nipype/interfaces/dipy/tests/test_auto_StreamlineTractography.py +++ b/nipype/interfaces/dipy/tests/test_auto_StreamlineTractography.py @@ -7,9 +7,6 @@ def test_StreamlineTractography_inputs(): input_map = dict(gfa_thresh=dict(mandatory=True, usedefault=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(mandatory=True, ), in_model=dict(), diff --git a/nipype/interfaces/dipy/tests/test_auto_TensorMode.py b/nipype/interfaces/dipy/tests/test_auto_TensorMode.py index b88c350c79..8b74e504e3 100644 --- a/nipype/interfaces/dipy/tests/test_auto_TensorMode.py +++ b/nipype/interfaces/dipy/tests/test_auto_TensorMode.py @@ -6,9 +6,6 @@ def test_TensorMode_inputs(): input_map = dict(b0_thres=dict(usedefault=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_bval=dict(mandatory=True, ), in_bvec=dict(mandatory=True, diff --git a/nipype/interfaces/dipy/tests/test_auto_TrackDensityMap.py b/nipype/interfaces/dipy/tests/test_auto_TrackDensityMap.py index c86e067efa..da7b455710 100644 --- a/nipype/interfaces/dipy/tests/test_auto_TrackDensityMap.py +++ b/nipype/interfaces/dipy/tests/test_auto_TrackDensityMap.py @@ -5,9 +5,6 @@ def test_TrackDensityMap_inputs(): input_map = dict(data_dims=dict(), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(mandatory=True, ), out_filename=dict(usedefault=True, diff --git a/nipype/interfaces/elastix/tests/test_auto_AnalyzeWarp.py b/nipype/interfaces/elastix/tests/test_auto_AnalyzeWarp.py index b78e0461e9..0d9772818f 100644 --- a/nipype/interfaces/elastix/tests/test_auto_AnalyzeWarp.py +++ b/nipype/interfaces/elastix/tests/test_auto_AnalyzeWarp.py @@ -6,12 +6,6 @@ def test_AnalyzeWarp_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), num_threads=dict(argstr='-threads %01d', nohash=True, ), @@ -19,8 +13,6 @@ def test_AnalyzeWarp_inputs(): mandatory=True, usedefault=True, ), - terminal_output=dict(nohash=True, - ), transform_file=dict(argstr='-tp %s', mandatory=True, ), diff --git a/nipype/interfaces/elastix/tests/test_auto_ApplyWarp.py b/nipype/interfaces/elastix/tests/test_auto_ApplyWarp.py index 7fdd3b78b4..873d36a20b 100644 --- a/nipype/interfaces/elastix/tests/test_auto_ApplyWarp.py +++ b/nipype/interfaces/elastix/tests/test_auto_ApplyWarp.py @@ -6,12 +6,6 @@ def test_ApplyWarp_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), moving_image=dict(argstr='-in %s', mandatory=True, ), @@ -22,8 +16,6 @@ def test_ApplyWarp_inputs(): mandatory=True, usedefault=True, ), - terminal_output=dict(nohash=True, - ), transform_file=dict(argstr='-tp %s', mandatory=True, ), diff --git a/nipype/interfaces/elastix/tests/test_auto_EditTransform.py b/nipype/interfaces/elastix/tests/test_auto_EditTransform.py index 65b4a1ed2f..3e0a4c7481 100644 --- a/nipype/interfaces/elastix/tests/test_auto_EditTransform.py +++ b/nipype/interfaces/elastix/tests/test_auto_EditTransform.py @@ -4,10 +4,7 @@ def test_EditTransform_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - interpolation=dict(argstr='FinalBSplineInterpolationOrder', + input_map = dict(interpolation=dict(argstr='FinalBSplineInterpolationOrder', usedefault=True, ), output_file=dict(), diff --git a/nipype/interfaces/elastix/tests/test_auto_PointsWarp.py b/nipype/interfaces/elastix/tests/test_auto_PointsWarp.py index bf0440079c..d35a439586 100644 --- a/nipype/interfaces/elastix/tests/test_auto_PointsWarp.py +++ b/nipype/interfaces/elastix/tests/test_auto_PointsWarp.py @@ -6,12 +6,6 @@ def test_PointsWarp_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), num_threads=dict(argstr='-threads %01d', nohash=True, ), @@ -22,8 +16,6 @@ def test_PointsWarp_inputs(): points_file=dict(argstr='-def %s', mandatory=True, ), - terminal_output=dict(nohash=True, - ), transform_file=dict(argstr='-tp %s', mandatory=True, ), diff --git a/nipype/interfaces/elastix/tests/test_auto_Registration.py b/nipype/interfaces/elastix/tests/test_auto_Registration.py index 474bc8d7ec..b779a8abd2 100644 --- a/nipype/interfaces/elastix/tests/test_auto_Registration.py +++ b/nipype/interfaces/elastix/tests/test_auto_Registration.py @@ -6,17 +6,11 @@ def test_Registration_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), fixed_image=dict(argstr='-f %s', mandatory=True, ), fixed_mask=dict(argstr='-fMask %s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), initial_transform=dict(argstr='-t0 %s', ), moving_image=dict(argstr='-m %s', @@ -34,8 +28,6 @@ def test_Registration_inputs(): parameters=dict(argstr='-p %s...', mandatory=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = Registration._input_spec() diff --git a/nipype/interfaces/freesurfer/tests/test_auto_ApplyMask.py b/nipype/interfaces/freesurfer/tests/test_auto_ApplyMask.py index a441212414..e654198d67 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_ApplyMask.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_ApplyMask.py @@ -6,12 +6,6 @@ def test_ApplyMask_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-3, @@ -29,8 +23,6 @@ def test_ApplyMask_inputs(): position=-1, ), subjects_dir=dict(), - terminal_output=dict(nohash=True, - ), use_abs=dict(argstr='-abs', ), xfm_file=dict(argstr='-xform %s', diff --git a/nipype/interfaces/freesurfer/tests/test_auto_ApplyVolTransform.py b/nipype/interfaces/freesurfer/tests/test_auto_ApplyVolTransform.py index d81ab3929c..6bf0628812 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_ApplyVolTransform.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_ApplyVolTransform.py @@ -6,9 +6,6 @@ def test_ApplyVolTransform_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), fs_target=dict(argstr='--fstarg', mandatory=True, requires=['reg_file'], @@ -18,9 +15,6 @@ def test_ApplyVolTransform_inputs(): mandatory=True, xor=('reg_file', 'fsl_reg_file', 'xfm_reg_file', 'reg_header', 'subject'), ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), interp=dict(argstr='--interp %s', ), inverse=dict(argstr='--inv', @@ -62,8 +56,6 @@ def test_ApplyVolTransform_inputs(): mandatory=True, xor=('target_file', 'tal', 'fs_target'), ), - terminal_output=dict(nohash=True, - ), transformed_file=dict(argstr='--o %s', genfile=True, ), diff --git a/nipype/interfaces/freesurfer/tests/test_auto_BBRegister.py b/nipype/interfaces/freesurfer/tests/test_auto_BBRegister.py index 9e49453277..528fe7afc2 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_BBRegister.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_BBRegister.py @@ -9,14 +9,8 @@ def test_BBRegister_inputs(): contrast_type=dict(argstr='--%s', mandatory=True, ), - environ=dict(nohash=True, - usedefault=True, - ), epi_mask=dict(argstr='--epi-mask', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), init=dict(argstr='--init-%s', mandatory=True, xor=['init_reg_file'], @@ -50,8 +44,6 @@ def test_BBRegister_inputs(): mandatory=True, ), subjects_dir=dict(), - terminal_output=dict(nohash=True, - ), ) inputs = BBRegister._input_spec() diff --git a/nipype/interfaces/freesurfer/tests/test_auto_Binarize.py b/nipype/interfaces/freesurfer/tests/test_auto_Binarize.py index 46fb6cd4c8..d148f06285 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_Binarize.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_Binarize.py @@ -23,18 +23,12 @@ def test_Binarize_inputs(): ), dilate=dict(argstr='--dilate %d', ), - environ=dict(nohash=True, - usedefault=True, - ), erode=dict(argstr='--erode %d', ), erode2d=dict(argstr='--erode2d %d', ), frame_no=dict(argstr='--frame %s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='--i %s', copyfile=False, mandatory=True, @@ -62,8 +56,6 @@ def test_Binarize_inputs(): rmin=dict(argstr='--rmin %f', ), subjects_dir=dict(), - terminal_output=dict(nohash=True, - ), ventricles=dict(argstr='--ventricles', ), wm=dict(argstr='--wm', diff --git a/nipype/interfaces/freesurfer/tests/test_auto_Concatenate.py b/nipype/interfaces/freesurfer/tests/test_auto_Concatenate.py index 717b2bd4bb..21f86b2b73 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_Concatenate.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_Concatenate.py @@ -13,14 +13,8 @@ def test_Concatenate_inputs(): concatenated_file=dict(argstr='--o %s', genfile=True, ), - environ=dict(nohash=True, - usedefault=True, - ), gmean=dict(argstr='--gmean %d', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_files=dict(argstr='--i %s...', mandatory=True, ), @@ -47,8 +41,6 @@ def test_Concatenate_inputs(): stats=dict(argstr='--%s', ), subjects_dir=dict(), - terminal_output=dict(nohash=True, - ), vote=dict(argstr='--vote', ), ) diff --git a/nipype/interfaces/freesurfer/tests/test_auto_DICOMConvert.py b/nipype/interfaces/freesurfer/tests/test_auto_DICOMConvert.py index 89a1eb943e..6111b46459 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_DICOMConvert.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_DICOMConvert.py @@ -11,13 +11,7 @@ def test_DICOMConvert_inputs(): dicom_dir=dict(mandatory=True, ), dicom_info=dict(), - environ=dict(nohash=True, - usedefault=True, - ), file_mapping=dict(), - ignore_exception=dict(nohash=True, - usedefault=True, - ), ignore_single_slice=dict(requires=['dicom_info'], ), out_type=dict(usedefault=True, @@ -28,8 +22,6 @@ def test_DICOMConvert_inputs(): ), subject_id=dict(), subjects_dir=dict(), - terminal_output=dict(nohash=True, - ), ) inputs = DICOMConvert._input_spec() diff --git a/nipype/interfaces/freesurfer/tests/test_auto_ExtractMainComponent.py b/nipype/interfaces/freesurfer/tests/test_auto_ExtractMainComponent.py index e8fcdc56ad..3c5edd9436 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_ExtractMainComponent.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_ExtractMainComponent.py @@ -6,12 +6,6 @@ def test_ExtractMainComponent_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=1, @@ -21,8 +15,6 @@ def test_ExtractMainComponent_inputs(): name_template='%s.maincmp', position=2, ), - terminal_output=dict(nohash=True, - ), ) inputs = ExtractMainComponent._input_spec() diff --git a/nipype/interfaces/freesurfer/tests/test_auto_FSCommand.py b/nipype/interfaces/freesurfer/tests/test_auto_FSCommand.py index 6b76c3f794..be9b409a13 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_FSCommand.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_FSCommand.py @@ -6,15 +6,7 @@ def test_FSCommand_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), subjects_dir=dict(), - terminal_output=dict(nohash=True, - ), ) inputs = FSCommand._input_spec() diff --git a/nipype/interfaces/freesurfer/tests/test_auto_FitMSParams.py b/nipype/interfaces/freesurfer/tests/test_auto_FitMSParams.py index b85fc7439f..2fa15ddf04 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_FitMSParams.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_FitMSParams.py @@ -6,13 +6,7 @@ def test_FitMSParams_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), flip_list=dict(), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_files=dict(argstr='%s', mandatory=True, position=-2, @@ -23,8 +17,6 @@ def test_FitMSParams_inputs(): ), subjects_dir=dict(), te_list=dict(), - terminal_output=dict(nohash=True, - ), tr_list=dict(), xfm_list=dict(), ) diff --git a/nipype/interfaces/freesurfer/tests/test_auto_GLMFit.py b/nipype/interfaces/freesurfer/tests/test_auto_GLMFit.py index 8097afd6da..4d51982f29 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_GLMFit.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_GLMFit.py @@ -29,9 +29,6 @@ def test_GLMFit_inputs(): diag=dict(), diag_cluster=dict(argstr='--diag-cluster', ), - environ=dict(nohash=True, - usedefault=True, - ), fixed_fx_dof=dict(argstr='--ffxdof %d', xor=['fixed_fx_dof_file'], ), @@ -51,9 +48,6 @@ def test_GLMFit_inputs(): genfile=True, ), hemi=dict(), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='--y %s', copyfile=False, mandatory=True, @@ -117,8 +111,6 @@ def test_GLMFit_inputs(): ), synth=dict(argstr='--synth', ), - terminal_output=dict(nohash=True, - ), uniform=dict(argstr='--uniform %f %f', ), var_fwhm=dict(argstr='--var-fwhm %f', diff --git a/nipype/interfaces/freesurfer/tests/test_auto_ImageInfo.py b/nipype/interfaces/freesurfer/tests/test_auto_ImageInfo.py index a9d16fb12b..dab102c1d8 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_ImageInfo.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_ImageInfo.py @@ -6,18 +6,10 @@ def test_ImageInfo_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', position=1, ), subjects_dir=dict(), - terminal_output=dict(nohash=True, - ), ) inputs = ImageInfo._input_spec() diff --git a/nipype/interfaces/freesurfer/tests/test_auto_Label2Vol.py b/nipype/interfaces/freesurfer/tests/test_auto_Label2Vol.py index 16cfdff712..59a9b74b68 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_Label2Vol.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_Label2Vol.py @@ -16,9 +16,6 @@ def test_Label2Vol_inputs(): ), args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), fill_thresh=dict(argstr='--fillthresh %.f', ), hemi=dict(argstr='--hemi %s', @@ -26,9 +23,6 @@ def test_Label2Vol_inputs(): identity=dict(argstr='--identity', xor=('reg_file', 'reg_header', 'identity'), ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), invert_mtx=dict(argstr='--invertmtx', ), label_file=dict(argstr='--label %s...', @@ -66,8 +60,6 @@ def test_Label2Vol_inputs(): template_file=dict(argstr='--temp %s', mandatory=True, ), - terminal_output=dict(nohash=True, - ), vol_label_file=dict(argstr='--o %s', genfile=True, ), diff --git a/nipype/interfaces/freesurfer/tests/test_auto_MRIConvert.py b/nipype/interfaces/freesurfer/tests/test_auto_MRIConvert.py index e06f95e5ad..2207dca6b2 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_MRIConvert.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_MRIConvert.py @@ -34,9 +34,6 @@ def test_MRIConvert_inputs(): ), drop_n=dict(argstr='--ndrop %d', ), - environ=dict(nohash=True, - usedefault=True, - ), fill_parcellation=dict(argstr='--fill_parcellation', ), force_ras=dict(argstr='--force_ras_good', @@ -47,9 +44,6 @@ def test_MRIConvert_inputs(): ), fwhm=dict(argstr='--fwhm %f', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_center=dict(argstr='--in_center %s', ), in_file=dict(argstr='--input_volume %s', @@ -168,8 +162,6 @@ def test_MRIConvert_inputs(): template_info=dict(), template_type=dict(argstr='--template_type %s', ), - terminal_output=dict(nohash=True, - ), ti=dict(argstr='-ti %d', ), tr=dict(argstr='-tr %d', diff --git a/nipype/interfaces/freesurfer/tests/test_auto_MRIMarchingCubes.py b/nipype/interfaces/freesurfer/tests/test_auto_MRIMarchingCubes.py index 14a9213133..6521f49d23 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_MRIMarchingCubes.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_MRIMarchingCubes.py @@ -10,12 +10,6 @@ def test_MRIMarchingCubes_inputs(): position=-1, usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=1, @@ -29,8 +23,6 @@ def test_MRIMarchingCubes_inputs(): position=-2, ), subjects_dir=dict(), - terminal_output=dict(nohash=True, - ), ) inputs = MRIMarchingCubes._input_spec() diff --git a/nipype/interfaces/freesurfer/tests/test_auto_MRIPretess.py b/nipype/interfaces/freesurfer/tests/test_auto_MRIPretess.py index ebc563005b..4b1fb1b93b 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_MRIPretess.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_MRIPretess.py @@ -6,12 +6,6 @@ def test_MRIPretess_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_filled=dict(argstr='%s', mandatory=True, position=-4, @@ -34,8 +28,6 @@ def test_MRIPretess_inputs(): position=-1, ), subjects_dir=dict(), - terminal_output=dict(nohash=True, - ), test=dict(argstr='-test', ), ) diff --git a/nipype/interfaces/freesurfer/tests/test_auto_MRISPreproc.py b/nipype/interfaces/freesurfer/tests/test_auto_MRISPreproc.py index 73626fe780..5fa79164bf 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_MRISPreproc.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_MRISPreproc.py @@ -6,9 +6,6 @@ def test_MRISPreproc_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), fsgd_file=dict(argstr='--fsgd %s', xor=('subjects', 'fsgd_file', 'subject_file'), ), @@ -21,9 +18,6 @@ def test_MRISPreproc_inputs(): hemi=dict(argstr='--hemi %s', mandatory=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), num_iters=dict(argstr='--niters %d', xor=['fwhm'], ), @@ -60,8 +54,6 @@ def test_MRISPreproc_inputs(): target=dict(argstr='--target %s', mandatory=True, ), - terminal_output=dict(nohash=True, - ), vol_measure_file=dict(argstr='--iv %s %s...', ), ) diff --git a/nipype/interfaces/freesurfer/tests/test_auto_MRITessellate.py b/nipype/interfaces/freesurfer/tests/test_auto_MRITessellate.py index fb0b6cc9e6..7005f18928 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_MRITessellate.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_MRITessellate.py @@ -6,12 +6,6 @@ def test_MRITessellate_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-3, @@ -25,8 +19,6 @@ def test_MRITessellate_inputs(): position=-1, ), subjects_dir=dict(), - terminal_output=dict(nohash=True, - ), tesselate_all_voxels=dict(argstr='-a', ), use_real_RAS_coordinates=dict(argstr='-n', diff --git a/nipype/interfaces/freesurfer/tests/test_auto_MRIsConvert.py b/nipype/interfaces/freesurfer/tests/test_auto_MRIsConvert.py index 91d3f503c2..d621e9c46f 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_MRIsConvert.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_MRIsConvert.py @@ -10,14 +10,8 @@ def test_MRIsConvert_inputs(): ), dataarray_num=dict(argstr='--da_num %d', ), - environ=dict(nohash=True, - usedefault=True, - ), functional_file=dict(argstr='-f %s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-2, @@ -52,8 +46,6 @@ def test_MRIsConvert_inputs(): subjects_dir=dict(), talairachxfm_subjid=dict(argstr='-t %s', ), - terminal_output=dict(nohash=True, - ), vertex=dict(argstr='-v', ), xyz_ascii=dict(argstr='-a', diff --git a/nipype/interfaces/freesurfer/tests/test_auto_MS_LDA.py b/nipype/interfaces/freesurfer/tests/test_auto_MS_LDA.py index 3b6e23d1bd..f28c15db71 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_MS_LDA.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_MS_LDA.py @@ -8,12 +8,6 @@ def test_MS_LDA_inputs(): ), conform=dict(argstr='-conform', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), images=dict(argstr='%s', copyfile=False, mandatory=True, @@ -30,8 +24,6 @@ def test_MS_LDA_inputs(): shift=dict(argstr='-shift %d', ), subjects_dir=dict(), - terminal_output=dict(nohash=True, - ), use_weights=dict(argstr='-W', ), vol_synth_file=dict(argstr='-synth %s', diff --git a/nipype/interfaces/freesurfer/tests/test_auto_MakeAverageSubject.py b/nipype/interfaces/freesurfer/tests/test_auto_MakeAverageSubject.py index ac679a3b0f..cce1ceb323 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_MakeAverageSubject.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_MakeAverageSubject.py @@ -6,12 +6,6 @@ def test_MakeAverageSubject_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), out_name=dict(argstr='--out %s', usedefault=True, ), @@ -20,8 +14,6 @@ def test_MakeAverageSubject_inputs(): mandatory=True, sep=' ', ), - terminal_output=dict(nohash=True, - ), ) inputs = MakeAverageSubject._input_spec() diff --git a/nipype/interfaces/freesurfer/tests/test_auto_OneSampleTTest.py b/nipype/interfaces/freesurfer/tests/test_auto_OneSampleTTest.py index 73aef8e3a8..7bb8273d26 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_OneSampleTTest.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_OneSampleTTest.py @@ -29,9 +29,6 @@ def test_OneSampleTTest_inputs(): diag=dict(), diag_cluster=dict(argstr='--diag-cluster', ), - environ=dict(nohash=True, - usedefault=True, - ), fixed_fx_dof=dict(argstr='--ffxdof %d', xor=['fixed_fx_dof_file'], ), @@ -51,9 +48,6 @@ def test_OneSampleTTest_inputs(): genfile=True, ), hemi=dict(), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='--y %s', copyfile=False, mandatory=True, @@ -117,8 +111,6 @@ def test_OneSampleTTest_inputs(): ), synth=dict(argstr='--synth', ), - terminal_output=dict(nohash=True, - ), uniform=dict(argstr='--uniform %f %f', ), var_fwhm=dict(argstr='--var-fwhm %f', diff --git a/nipype/interfaces/freesurfer/tests/test_auto_ParseDICOMDir.py b/nipype/interfaces/freesurfer/tests/test_auto_ParseDICOMDir.py index d3d6b4aae5..050f618f28 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_ParseDICOMDir.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_ParseDICOMDir.py @@ -12,19 +12,11 @@ def test_ParseDICOMDir_inputs(): dicom_info_file=dict(argstr='--o %s', usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), sortbyrun=dict(argstr='--sortbyrun', ), subjects_dir=dict(), summarize=dict(argstr='--summarize', ), - terminal_output=dict(nohash=True, - ), ) inputs = ParseDICOMDir._input_spec() diff --git a/nipype/interfaces/freesurfer/tests/test_auto_ReconAll.py b/nipype/interfaces/freesurfer/tests/test_auto_ReconAll.py index 54ad2a1615..ce63fc324f 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_ReconAll.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_ReconAll.py @@ -15,16 +15,10 @@ def test_ReconAll_inputs(): position=0, usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), flags=dict(argstr='%s', ), hemi=dict(argstr='-hemi %s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), openmp=dict(argstr='-openmp %d', ), subject_id=dict(argstr='-subjid %s', @@ -34,8 +28,6 @@ def test_ReconAll_inputs(): genfile=True, hash_files=False, ), - terminal_output=dict(nohash=True, - ), use_T2=dict(argstr='-T2pial', min_ver='5.3.0', ), diff --git a/nipype/interfaces/freesurfer/tests/test_auto_Resample.py b/nipype/interfaces/freesurfer/tests/test_auto_Resample.py index 4057f34ba2..61ccaaab7c 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_Resample.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_Resample.py @@ -6,12 +6,6 @@ def test_Resample_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-i %s', mandatory=True, position=-2, @@ -21,8 +15,6 @@ def test_Resample_inputs(): position=-1, ), subjects_dir=dict(), - terminal_output=dict(nohash=True, - ), voxel_size=dict(argstr='-vs %.2f %.2f %.2f', mandatory=True, ), diff --git a/nipype/interfaces/freesurfer/tests/test_auto_RobustRegister.py b/nipype/interfaces/freesurfer/tests/test_auto_RobustRegister.py index c0c3630648..524b65b823 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_RobustRegister.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_RobustRegister.py @@ -10,9 +10,6 @@ def test_RobustRegister_inputs(): mandatory=True, xor=['outlier_sens'], ), - environ=dict(nohash=True, - usedefault=True, - ), est_int_scale=dict(argstr='--iscale', ), force_double=dict(argstr='--doubleprec', @@ -31,9 +28,6 @@ def test_RobustRegister_inputs(): ), high_iterations=dict(argstr='--highit %d', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_xfm_file=dict(argstr='--transform', ), init_orient=dict(argstr='--initorient', @@ -72,8 +66,6 @@ def test_RobustRegister_inputs(): target_file=dict(argstr='--dst %s', mandatory=True, ), - terminal_output=dict(nohash=True, - ), trans_only=dict(argstr='--transonly', ), weights_file=dict(argstr='--weights %s', diff --git a/nipype/interfaces/freesurfer/tests/test_auto_SampleToSurface.py b/nipype/interfaces/freesurfer/tests/test_auto_SampleToSurface.py index bfb39c62f7..23c9f063b6 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_SampleToSurface.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_SampleToSurface.py @@ -13,9 +13,6 @@ def test_SampleToSurface_inputs(): cortex_mask=dict(argstr='--cortex', xor=['mask_label'], ), - environ=dict(nohash=True, - usedefault=True, - ), fix_tk_reg=dict(argstr='--fixtkreg', ), float2int_method=dict(argstr='--float2int %s', @@ -32,9 +29,6 @@ def test_SampleToSurface_inputs(): ico_order=dict(argstr='--icoorder %d', requires=['target_subject'], ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), interp_method=dict(argstr='--interp %s', ), mask_label=dict(argstr='--mask %s', @@ -99,8 +93,6 @@ def test_SampleToSurface_inputs(): ), target_subject=dict(argstr='--trgsubject %s', ), - terminal_output=dict(nohash=True, - ), vox_file=dict(argstr='--nvox %s', ), ) diff --git a/nipype/interfaces/freesurfer/tests/test_auto_SegStats.py b/nipype/interfaces/freesurfer/tests/test_auto_SegStats.py index 5ee5af3655..6d7191fa8d 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_SegStats.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_SegStats.py @@ -27,9 +27,6 @@ def test_SegStats_inputs(): default_color_table=dict(argstr='--ctab-default', xor=('color_table_file', 'default_color_table', 'gca_color_table'), ), - environ=dict(nohash=True, - usedefault=True, - ), etiv=dict(argstr='--etiv', ), etiv_only=dict(), @@ -42,9 +39,6 @@ def test_SegStats_inputs(): gca_color_table=dict(argstr='--ctab-gca %s', xor=('color_table_file', 'default_color_table', 'gca_color_table'), ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='--i %s', ), mask_erode=dict(argstr='--maskerode %d', @@ -80,8 +74,6 @@ def test_SegStats_inputs(): mandatory=True, xor=('segmentation_file', 'annot', 'surf_label'), ), - terminal_output=dict(nohash=True, - ), vox=dict(argstr='--vox %s', ), wm_vol_from_surf=dict(argstr='--surf-wm-vol', diff --git a/nipype/interfaces/freesurfer/tests/test_auto_Smooth.py b/nipype/interfaces/freesurfer/tests/test_auto_Smooth.py index 8a0dc968ca..1091f09806 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_Smooth.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_Smooth.py @@ -6,12 +6,6 @@ def test_Smooth_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='--i %s', mandatory=True, ), @@ -37,8 +31,6 @@ def test_Smooth_inputs(): requires=['reg_file'], xor=['num_iters'], ), - terminal_output=dict(nohash=True, - ), vol_fwhm=dict(argstr='--vol-fwhm %f', ), ) diff --git a/nipype/interfaces/freesurfer/tests/test_auto_SmoothTessellation.py b/nipype/interfaces/freesurfer/tests/test_auto_SmoothTessellation.py index 7d720e2cfc..53afb2375a 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_SmoothTessellation.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_SmoothTessellation.py @@ -12,18 +12,12 @@ def test_SmoothTessellation_inputs(): ), disable_estimates=dict(argstr='-nw', ), - environ=dict(nohash=True, - usedefault=True, - ), gaussian_curvature_norm_steps=dict(argstr='%d ', position=4, ), gaussian_curvature_smoothing_steps=dict(argstr='%d', position=5, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=1, @@ -45,8 +39,6 @@ def test_SmoothTessellation_inputs(): snapshot_writing_iterations=dict(argstr='-w %d', ), subjects_dir=dict(), - terminal_output=dict(nohash=True, - ), use_gaussian_curvature_smoothing=dict(argstr='-g', position=3, ), diff --git a/nipype/interfaces/freesurfer/tests/test_auto_Surface2VolTransform.py b/nipype/interfaces/freesurfer/tests/test_auto_Surface2VolTransform.py index f92075b9bd..878453c109 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_Surface2VolTransform.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_Surface2VolTransform.py @@ -6,15 +6,9 @@ def test_Surface2VolTransform_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), hemi=dict(argstr='--hemi %s', mandatory=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), mkmask=dict(argstr='--mkmask', xor=['source_file'], ), @@ -38,8 +32,6 @@ def test_Surface2VolTransform_inputs(): ), template_file=dict(argstr='--template %s', ), - terminal_output=dict(nohash=True, - ), transformed_file=dict(argstr='--outvol %s', hash_files=False, name_source=['source_file'], diff --git a/nipype/interfaces/freesurfer/tests/test_auto_SurfaceSmooth.py b/nipype/interfaces/freesurfer/tests/test_auto_SurfaceSmooth.py index 79de738bba..8de3a83ce2 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_SurfaceSmooth.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_SurfaceSmooth.py @@ -9,18 +9,12 @@ def test_SurfaceSmooth_inputs(): cortex=dict(argstr='--cortex', usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), fwhm=dict(argstr='--fwhm %.4f', xor=['smooth_iters'], ), hemi=dict(argstr='--hemi %s', mandatory=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='--sval %s', mandatory=True, ), @@ -36,8 +30,6 @@ def test_SurfaceSmooth_inputs(): mandatory=True, ), subjects_dir=dict(), - terminal_output=dict(nohash=True, - ), ) inputs = SurfaceSmooth._input_spec() diff --git a/nipype/interfaces/freesurfer/tests/test_auto_SurfaceSnapshots.py b/nipype/interfaces/freesurfer/tests/test_auto_SurfaceSnapshots.py index cbcc47f29c..d2e4fb27a0 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_SurfaceSnapshots.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_SurfaceSnapshots.py @@ -16,9 +16,6 @@ def test_SurfaceSnapshots_inputs(): ), demean_overlay=dict(argstr='-zm', ), - environ=dict(nohash=True, - usedefault=True, - ), hemi=dict(argstr='%s', mandatory=True, position=2, @@ -26,9 +23,6 @@ def test_SurfaceSnapshots_inputs(): identity_reg=dict(argstr='-overlay-reg-identity', xor=['overlay_reg', 'identity_reg', 'mni152_reg'], ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), invert_overlay=dict(argstr='-invphaseflag 1', ), label_file=dict(argstr='-label %s', @@ -88,8 +82,6 @@ def test_SurfaceSnapshots_inputs(): tcl_script=dict(argstr='%s', genfile=True, ), - terminal_output=dict(nohash=True, - ), truncate_overlay=dict(argstr='-truncphaseflag 1', ), ) diff --git a/nipype/interfaces/freesurfer/tests/test_auto_SurfaceTransform.py b/nipype/interfaces/freesurfer/tests/test_auto_SurfaceTransform.py index 474cb6d358..421467edbd 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_SurfaceTransform.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_SurfaceTransform.py @@ -6,15 +6,9 @@ def test_SurfaceTransform_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), hemi=dict(argstr='--hemi %s', mandatory=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), out_file=dict(argstr='--tval %s', genfile=True, ), @@ -44,8 +38,6 @@ def test_SurfaceTransform_inputs(): ), target_type=dict(argstr='--tfmt %s', ), - terminal_output=dict(nohash=True, - ), ) inputs = SurfaceTransform._input_spec() diff --git a/nipype/interfaces/freesurfer/tests/test_auto_SynthesizeFLASH.py b/nipype/interfaces/freesurfer/tests/test_auto_SynthesizeFLASH.py index 0e5fa54685..5b3ab0a4ae 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_SynthesizeFLASH.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_SynthesizeFLASH.py @@ -6,9 +6,6 @@ def test_SynthesizeFLASH_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), fixed_weighting=dict(argstr='-w', position=1, ), @@ -16,9 +13,6 @@ def test_SynthesizeFLASH_inputs(): mandatory=True, position=3, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), out_file=dict(argstr='%s', genfile=True, ), @@ -35,8 +29,6 @@ def test_SynthesizeFLASH_inputs(): mandatory=True, position=4, ), - terminal_output=dict(nohash=True, - ), tr=dict(argstr='%.2f', mandatory=True, position=2, diff --git a/nipype/interfaces/freesurfer/tests/test_auto_Tkregister2.py b/nipype/interfaces/freesurfer/tests/test_auto_Tkregister2.py index 5401d91db1..ac5498dbd9 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_Tkregister2.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_Tkregister2.py @@ -6,9 +6,6 @@ def test_Tkregister2_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), fsl_in_matrix=dict(argstr='--fsl %s', ), fsl_out=dict(argstr='--fslregout %s', @@ -19,9 +16,6 @@ def test_Tkregister2_inputs(): fstarg=dict(argstr='--fstarg', xor=['target_image'], ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), moving_image=dict(argstr='--mov %s', mandatory=True, ), @@ -42,8 +36,6 @@ def test_Tkregister2_inputs(): target_image=dict(argstr='--targ %s', xor=['fstarg'], ), - terminal_output=dict(nohash=True, - ), xfm=dict(argstr='--xfm %s', ), ) diff --git a/nipype/interfaces/freesurfer/tests/test_auto_UnpackSDICOMDir.py b/nipype/interfaces/freesurfer/tests/test_auto_UnpackSDICOMDir.py index 3e42a95d21..8e494f6249 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_UnpackSDICOMDir.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_UnpackSDICOMDir.py @@ -12,12 +12,6 @@ def test_UnpackSDICOMDir_inputs(): ), dir_structure=dict(argstr='-%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), log_file=dict(argstr='-log %s', ), no_info_dump=dict(argstr='-noinfodump', @@ -42,8 +36,6 @@ def test_UnpackSDICOMDir_inputs(): spm_zeropad=dict(argstr='-nspmzeropad %d', ), subjects_dir=dict(), - terminal_output=dict(nohash=True, - ), ) inputs = UnpackSDICOMDir._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_ApplyMask.py b/nipype/interfaces/fsl/tests/test_auto_ApplyMask.py index 3148deb9a7..098ca5b12b 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ApplyMask.py +++ b/nipype/interfaces/fsl/tests/test_auto_ApplyMask.py @@ -6,12 +6,6 @@ def test_ApplyMask_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=2, @@ -36,8 +30,6 @@ def test_ApplyMask_inputs(): ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = ApplyMask._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_ApplyTOPUP.py b/nipype/interfaces/fsl/tests/test_auto_ApplyTOPUP.py index 3d22b0e2c3..d95f50dcf6 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ApplyTOPUP.py +++ b/nipype/interfaces/fsl/tests/test_auto_ApplyTOPUP.py @@ -11,12 +11,6 @@ def test_ApplyTOPUP_inputs(): encoding_file=dict(argstr='--datain=%s', mandatory=True, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_files=dict(argstr='--imain=%s', mandatory=True, sep=',', @@ -40,8 +34,6 @@ def test_ApplyTOPUP_inputs(): ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = ApplyTOPUP._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_ApplyWarp.py b/nipype/interfaces/fsl/tests/test_auto_ApplyWarp.py index 62278d202e..61d933bb66 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ApplyWarp.py +++ b/nipype/interfaces/fsl/tests/test_auto_ApplyWarp.py @@ -11,14 +11,8 @@ def test_ApplyWarp_inputs(): ), datatype=dict(argstr='--datatype=%s', ), - environ=dict(nohash=True, - usedefault=True, - ), field_file=dict(argstr='--warp=%s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='--in=%s', mandatory=True, position=0, @@ -51,8 +45,6 @@ def test_ApplyWarp_inputs(): ), supersample=dict(argstr='--super', ), - terminal_output=dict(nohash=True, - ), ) inputs = ApplyWarp._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_ApplyXfm.py b/nipype/interfaces/fsl/tests/test_auto_ApplyXfm.py index b86cd6e088..a464f0d194 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ApplyXfm.py +++ b/nipype/interfaces/fsl/tests/test_auto_ApplyXfm.py @@ -41,9 +41,6 @@ def test_ApplyXfm_inputs(): echospacing=dict(argstr='-echospacing %f', min_ver='5.0.0', ), - environ=dict(nohash=True, - usedefault=True, - ), fieldmap=dict(argstr='-fieldmap %s', min_ver='5.0.0', ), @@ -55,9 +52,6 @@ def test_ApplyXfm_inputs(): ), force_scaling=dict(argstr='-forcescaling', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-in %s', mandatory=True, position=0, @@ -130,8 +124,6 @@ def test_ApplyXfm_inputs(): ), sinc_window=dict(argstr='-sincwindow %s', ), - terminal_output=dict(nohash=True, - ), uses_qform=dict(argstr='-usesqform', ), verbose=dict(argstr='-verbose %d', diff --git a/nipype/interfaces/fsl/tests/test_auto_AvScale.py b/nipype/interfaces/fsl/tests/test_auto_AvScale.py index 630b258b49..96ba24c1fc 100644 --- a/nipype/interfaces/fsl/tests/test_auto_AvScale.py +++ b/nipype/interfaces/fsl/tests/test_auto_AvScale.py @@ -6,19 +6,11 @@ def test_AvScale_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), mat_file=dict(argstr='%s', position=0, ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = AvScale._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX4.py b/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX4.py index 22a74bef2e..0dc8e15583 100644 --- a/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX4.py +++ b/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX4.py @@ -24,9 +24,6 @@ def test_BEDPOSTX4_inputs(): ), dwi=dict(mandatory=True, ), - environ=dict(nohash=True, - usedefault=True, - ), fibres=dict(argstr='-n %d', ), force_dir=dict(argstr='--forcedir', @@ -36,9 +33,6 @@ def test_BEDPOSTX4_inputs(): ), gradnonlin=dict(argstr='--gradnonlin=%s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), jumps=dict(argstr='-j %d', ), logdir=dict(argstr='--logdir=%s', @@ -73,8 +67,6 @@ def test_BEDPOSTX4_inputs(): ), seed=dict(argstr='--seed=%d', ), - terminal_output=dict(nohash=True, - ), update_proposal_every=dict(argstr='--updateproposalevery=%d', ), weight=dict(argstr='-w %.2f', diff --git a/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX5.py b/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX5.py index f8423d06e8..ffaeba4426 100644 --- a/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX5.py +++ b/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX5.py @@ -24,9 +24,6 @@ def test_BEDPOSTX5_inputs(): ), dyads=dict(), dyads_dispersion=dict(), - environ=dict(nohash=True, - usedefault=True, - ), f0_ard=dict(argstr='--f0 --ardf0', xor=['f0_noard', 'f0_ard', 'all_ard'], ), @@ -41,17 +38,17 @@ def test_BEDPOSTX5_inputs(): ), gradnonlin=dict(argstr='-g', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), logdir=dict(argstr='--logdir=%s', ), mask=dict(mandatory=True, ), - mean_S0samples=dict(), - mean_dsamples=dict(), + mean_S0samples=dict(keep_extension=False, + ), + mean_dsamples=dict(keep_extension=False, + ), mean_fsamples=dict(), - mean_tausamples=dict(), + mean_tausamples=dict(keep_extension=False, + ), model=dict(argstr='-model %d', ), n_fibres=dict(argstr='-n %d', @@ -84,8 +81,6 @@ def test_BEDPOSTX5_inputs(): ), seed=dict(argstr='--seed=%d', ), - terminal_output=dict(nohash=True, - ), thsamples=dict(), update_proposal_every=dict(argstr='--updateproposalevery=%d', ), diff --git a/nipype/interfaces/fsl/tests/test_auto_BET.py b/nipype/interfaces/fsl/tests/test_auto_BET.py index da267e01cc..31d60f6a7f 100644 --- a/nipype/interfaces/fsl/tests/test_auto_BET.py +++ b/nipype/interfaces/fsl/tests/test_auto_BET.py @@ -9,23 +9,18 @@ def test_BET_inputs(): center=dict(argstr='-c %s', units='voxels', ), - environ=dict(nohash=True, - usedefault=True, - ), frac=dict(argstr='-f %.2f', ), functional=dict(argstr='-F', xor=('functional', 'reduce_bias', 'robust', 'padding', 'remove_eyes', 'surfaces', 't2_guided'), ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=0, ), inskull_mask_file=dict(), - inskull_mesh_file=dict(), + inskull_mesh_file=dict(keep_extension=False, + ), mask=dict(argstr='-m', usedefault=True, ), @@ -33,7 +28,8 @@ def test_BET_inputs(): mesh=dict(argstr='-e', usedefault=True, ), - meshfile=dict(), + meshfile=dict(keep_extension=False, + ), no_output=dict(argstr='-n', usedefault=True, ), @@ -48,9 +44,11 @@ def test_BET_inputs(): output_type=dict(usedefault=True, ), outskin_mask_file=dict(), - outskin_mesh_file=dict(), + outskin_mesh_file=dict(keep_extension=False, + ), outskull_mask_file=dict(), - outskull_mesh_file=dict(), + outskull_mesh_file=dict(keep_extension=False, + ), padding=dict(argstr='-Z', xor=('functional', 'reduce_bias', 'robust', 'padding', 'remove_eyes', 'surfaces', 't2_guided'), ), @@ -77,8 +75,6 @@ def test_BET_inputs(): t2_guided=dict(argstr='-A2 %s', xor=('functional', 'reduce_bias', 'robust', 'padding', 'remove_eyes', 'surfaces', 't2_guided'), ), - terminal_output=dict(nohash=True, - ), threshold=dict(argstr='-t', usedefault=True, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_BinaryMaths.py b/nipype/interfaces/fsl/tests/test_auto_BinaryMaths.py index 1dd66465d1..a6d5916e32 100644 --- a/nipype/interfaces/fsl/tests/test_auto_BinaryMaths.py +++ b/nipype/interfaces/fsl/tests/test_auto_BinaryMaths.py @@ -6,12 +6,6 @@ def test_BinaryMaths_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=2, @@ -46,8 +40,6 @@ def test_BinaryMaths_inputs(): ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = BinaryMaths._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_ChangeDataType.py b/nipype/interfaces/fsl/tests/test_auto_ChangeDataType.py index e6c47c57cc..f6bddc3a8d 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ChangeDataType.py +++ b/nipype/interfaces/fsl/tests/test_auto_ChangeDataType.py @@ -6,12 +6,6 @@ def test_ChangeDataType_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=2, @@ -33,8 +27,6 @@ def test_ChangeDataType_inputs(): ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = ChangeDataType._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_Cluster.py b/nipype/interfaces/fsl/tests/test_auto_Cluster.py index 75b73193fc..92b4a02bde 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Cluster.py +++ b/nipype/interfaces/fsl/tests/test_auto_Cluster.py @@ -12,14 +12,8 @@ def test_Cluster_inputs(): ), dlh=dict(argstr='--dlh=%.10f', ), - environ=dict(nohash=True, - usedefault=True, - ), find_min=dict(), fractional=dict(), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='--in=%s', mandatory=True, ), @@ -78,8 +72,6 @@ def test_Cluster_inputs(): ), std_space_file=dict(argstr='--stdvol=%s', ), - terminal_output=dict(nohash=True, - ), threshold=dict(argstr='--thresh=%.10f', mandatory=True, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_Complex.py b/nipype/interfaces/fsl/tests/test_auto_Complex.py index 85a47953f4..4e82423f23 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Complex.py +++ b/nipype/interfaces/fsl/tests/test_auto_Complex.py @@ -34,12 +34,6 @@ def test_Complex_inputs(): end_vol=dict(argstr='%d', position=-1, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), imaginary_in_file=dict(argstr='%s', position=3, ), @@ -77,8 +71,6 @@ def test_Complex_inputs(): start_vol=dict(argstr='%d', position=-2, ), - terminal_output=dict(nohash=True, - ), ) inputs = Complex._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_ContrastMgr.py b/nipype/interfaces/fsl/tests/test_auto_ContrastMgr.py index a88e95bcd6..3a65975e6e 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ContrastMgr.py +++ b/nipype/interfaces/fsl/tests/test_auto_ContrastMgr.py @@ -15,14 +15,8 @@ def test_ContrastMgr_inputs(): copyfile=False, mandatory=True, ), - environ=dict(nohash=True, - usedefault=True, - ), fcon_file=dict(argstr='-f %s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), output_type=dict(usedefault=True, ), param_estimates=dict(argstr='', @@ -40,8 +34,6 @@ def test_ContrastMgr_inputs(): mandatory=True, position=-1, ), - terminal_output=dict(nohash=True, - ), ) inputs = ContrastMgr._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_ConvertWarp.py b/nipype/interfaces/fsl/tests/test_auto_ConvertWarp.py index 6badee8ea8..dfe4246853 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ConvertWarp.py +++ b/nipype/interfaces/fsl/tests/test_auto_ConvertWarp.py @@ -11,12 +11,6 @@ def test_ConvertWarp_inputs(): ), cons_jacobian=dict(argstr='--constrainj', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), jacobian_max=dict(argstr='--jmax=%f', ), jacobian_min=dict(argstr='--jmin=%f', @@ -50,8 +44,6 @@ def test_ConvertWarp_inputs(): ), shift_in_file=dict(argstr='--shiftmap=%s', ), - terminal_output=dict(nohash=True, - ), warp1=dict(argstr='--warp1=%s', ), warp2=dict(argstr='--warp2=%s', diff --git a/nipype/interfaces/fsl/tests/test_auto_ConvertXFM.py b/nipype/interfaces/fsl/tests/test_auto_ConvertXFM.py index 3eef6a4d36..e904325b9a 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ConvertXFM.py +++ b/nipype/interfaces/fsl/tests/test_auto_ConvertXFM.py @@ -11,17 +11,11 @@ def test_ConvertXFM_inputs(): requires=['in_file2'], xor=['invert_xfm', 'concat_xfm', 'fix_scale_skew'], ), - environ=dict(nohash=True, - usedefault=True, - ), fix_scale_skew=dict(argstr='-fixscaleskew', position=-3, requires=['in_file2'], xor=['invert_xfm', 'concat_xfm', 'fix_scale_skew'], ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-1, @@ -44,8 +38,6 @@ def test_ConvertXFM_inputs(): ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = ConvertXFM._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_CopyGeom.py b/nipype/interfaces/fsl/tests/test_auto_CopyGeom.py index 55f006d235..54303cdc20 100644 --- a/nipype/interfaces/fsl/tests/test_auto_CopyGeom.py +++ b/nipype/interfaces/fsl/tests/test_auto_CopyGeom.py @@ -12,24 +12,16 @@ def test_CopyGeom_inputs(): output_name='out_file', position=1, ), - environ=dict(nohash=True, - usedefault=True, - ), ignore_dims=dict(argstr='-d', position=-1, usedefault=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=0, ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = CopyGeom._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_DTIFit.py b/nipype/interfaces/fsl/tests/test_auto_DTIFit.py index e59dd9f7d5..6978ddbf26 100644 --- a/nipype/interfaces/fsl/tests/test_auto_DTIFit.py +++ b/nipype/interfaces/fsl/tests/test_auto_DTIFit.py @@ -24,14 +24,8 @@ def test_DTIFit_inputs(): mandatory=True, position=0, ), - environ=dict(nohash=True, - usedefault=True, - ), gradnonlin=dict(argstr='--gradnonlin=%s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), little_bit=dict(argstr='--littlebit', ), mask=dict(argstr='-m %s', @@ -50,16 +44,26 @@ def test_DTIFit_inputs(): ), min_z=dict(argstr='-z %d', ), - out_fa=dict(), - out_l1=dict(), - out_l2=dict(), - out_l3=dict(), - out_md=dict(), - out_mo=dict(), - out_s0=dict(), - out_v1=dict(), - out_v2=dict(), - out_v3=dict(), + out_fa=dict(keep_extension=False, + ), + out_l1=dict(keep_extension=False, + ), + out_l2=dict(keep_extension=False, + ), + out_l3=dict(keep_extension=False, + ), + out_md=dict(keep_extension=False, + ), + out_mo=dict(keep_extension=False, + ), + out_s0=dict(keep_extension=False, + ), + out_v1=dict(keep_extension=False, + ), + out_v2=dict(keep_extension=False, + ), + out_v3=dict(keep_extension=False, + ), output_type=dict(usedefault=True, ), save_tensor=dict(argstr='--save_tensor', @@ -67,8 +71,7 @@ def test_DTIFit_inputs(): ), sse=dict(argstr='--sse', ), - tensor=dict(), - terminal_output=dict(nohash=True, + tensor=dict(keep_extension=False, ), ) inputs = DTIFit._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_DilateImage.py b/nipype/interfaces/fsl/tests/test_auto_DilateImage.py index ba9b3e07d4..26c2a5f3d3 100644 --- a/nipype/interfaces/fsl/tests/test_auto_DilateImage.py +++ b/nipype/interfaces/fsl/tests/test_auto_DilateImage.py @@ -6,12 +6,6 @@ def test_DilateImage_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=2, @@ -47,8 +41,6 @@ def test_DilateImage_inputs(): ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = DilateImage._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_DistanceMap.py b/nipype/interfaces/fsl/tests/test_auto_DistanceMap.py index a7ec33cdbd..07e0fc83ee 100644 --- a/nipype/interfaces/fsl/tests/test_auto_DistanceMap.py +++ b/nipype/interfaces/fsl/tests/test_auto_DistanceMap.py @@ -7,15 +7,8 @@ def test_DistanceMap_inputs(): input_map = dict(args=dict(argstr='%s', ), distance_map=dict(argstr='--out=%s', - genfile=True, hash_files=False, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='--in=%s', mandatory=True, ), @@ -28,8 +21,6 @@ def test_DistanceMap_inputs(): ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = DistanceMap._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_EPIDeWarp.py b/nipype/interfaces/fsl/tests/test_auto_EPIDeWarp.py index b3313b2573..c523272816 100644 --- a/nipype/interfaces/fsl/tests/test_auto_EPIDeWarp.py +++ b/nipype/interfaces/fsl/tests/test_auto_EPIDeWarp.py @@ -6,16 +6,8 @@ def test_EPIDeWarp_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = EPIDeWarp._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_Eddy.py b/nipype/interfaces/fsl/tests/test_auto_Eddy.py index 9f7aa7bd7b..2268c751c2 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Eddy.py +++ b/nipype/interfaces/fsl/tests/test_auto_Eddy.py @@ -6,16 +6,10 @@ def test_Eddy_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), flm=dict(argstr='--flm=%s', ), fwhm=dict(argstr='--fwhm=%s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_acqp=dict(argstr='--acqp=%s', mandatory=True, ), @@ -55,8 +49,6 @@ def test_Eddy_inputs(): ), session=dict(argstr='--session=%s', ), - terminal_output=dict(nohash=True, - ), ) inputs = Eddy._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_EddyCorrect.py b/nipype/interfaces/fsl/tests/test_auto_EddyCorrect.py index 8ac4a24f4f..c4f9763257 100644 --- a/nipype/interfaces/fsl/tests/test_auto_EddyCorrect.py +++ b/nipype/interfaces/fsl/tests/test_auto_EddyCorrect.py @@ -6,16 +6,8 @@ def test_EddyCorrect_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = EddyCorrect._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_EpiReg.py b/nipype/interfaces/fsl/tests/test_auto_EpiReg.py index b6a800dbce..4135b6354d 100644 --- a/nipype/interfaces/fsl/tests/test_auto_EpiReg.py +++ b/nipype/interfaces/fsl/tests/test_auto_EpiReg.py @@ -8,28 +8,29 @@ def test_EpiReg_inputs(): ), echospacing=dict(argstr='--echospacing=%f', ), - environ=dict(nohash=True, - usedefault=True, - ), epi=dict(argstr='--epi=%s', mandatory=True, position=-4, ), - epi2str_inv=dict(), - epi2str_mat=dict(), + epi2str_inv=dict(keep_extension=False, + ), + epi2str_mat=dict(keep_extension=False, + ), fmap=dict(argstr='--fmap=%s', ), - fmap2epi_mat=dict(), - fmap2str_mat=dict(), - fmap_epi=dict(), - fmap_str=dict(), + fmap2epi_mat=dict(keep_extension=False, + ), + fmap2str_mat=dict(keep_extension=False, + ), + fmap_epi=dict(keep_extension=False, + ), + fmap_str=dict(keep_extension=False, + ), fmapmag=dict(argstr='--fmapmag=%s', ), fmapmagbrain=dict(argstr='--fmapmagbrain=%s', ), - fullwarp=dict(), - ignore_exception=dict(nohash=True, - usedefault=True, + fullwarp=dict(keep_extension=False, ), no_clean=dict(argstr='--noclean', usedefault=True, @@ -37,17 +38,20 @@ def test_EpiReg_inputs(): no_fmapreg=dict(argstr='--nofmapreg', usedefault=True, ), - out_1vol=dict(), + out_1vol=dict(keep_extension=False, + ), out_base=dict(argstr='--out=%s', position=-1, usedefault=True, ), - out_file=dict(), + out_file=dict(keep_extension=False, + ), output_type=dict(usedefault=True, ), pedir=dict(argstr='--pedir=%s', ), - shiftmap=dict(), + shiftmap=dict(keep_extension=False, + ), t1_brain=dict(argstr='--t1brain=%s', mandatory=True, position=-2, @@ -56,12 +60,12 @@ def test_EpiReg_inputs(): mandatory=True, position=-3, ), - terminal_output=dict(nohash=True, - ), weight_image=dict(argstr='--weight=%s', ), - wmedge=dict(), - wmseg=dict(), + wmedge=dict(keep_extension=False, + ), + wmseg=dict(keep_extension=False, + ), ) inputs = EpiReg._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_ErodeImage.py b/nipype/interfaces/fsl/tests/test_auto_ErodeImage.py index fbb477d9ad..9aae2d081d 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ErodeImage.py +++ b/nipype/interfaces/fsl/tests/test_auto_ErodeImage.py @@ -6,12 +6,6 @@ def test_ErodeImage_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=2, @@ -47,8 +41,6 @@ def test_ErodeImage_inputs(): ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = ErodeImage._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_ExtractROI.py b/nipype/interfaces/fsl/tests/test_auto_ExtractROI.py index 3d71463a9e..5c1e20f345 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ExtractROI.py +++ b/nipype/interfaces/fsl/tests/test_auto_ExtractROI.py @@ -10,12 +10,6 @@ def test_ExtractROI_inputs(): position=2, xor=['x_min', 'x_size', 'y_min', 'y_size', 'z_min', 'z_size', 't_min', 't_size'], ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=0, @@ -32,8 +26,6 @@ def test_ExtractROI_inputs(): t_size=dict(argstr='%d', position=9, ), - terminal_output=dict(nohash=True, - ), x_min=dict(argstr='%d', position=2, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_FAST.py b/nipype/interfaces/fsl/tests/test_auto_FAST.py index a15cedcc71..4f58452280 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FAST.py +++ b/nipype/interfaces/fsl/tests/test_auto_FAST.py @@ -12,14 +12,8 @@ def test_FAST_inputs(): bias_lowpass=dict(argstr='-l %d', units='mm', ), - environ=dict(nohash=True, - usedefault=True, - ), hyper=dict(argstr='-H %.2f', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), img_type=dict(argstr='-t %d', ), in_files=dict(argstr='%s', @@ -48,6 +42,7 @@ def test_FAST_inputs(): other_priors=dict(argstr='-A %s', ), out_basename=dict(argstr='-o %s', + keep_extension=False, ), output_biascorrected=dict(argstr='-B', ), @@ -66,8 +61,6 @@ def test_FAST_inputs(): ), segments=dict(argstr='-g', ), - terminal_output=dict(nohash=True, - ), tissue_class_files=dict(), tissue_class_map=dict(), use_priors=dict(argstr='-P', diff --git a/nipype/interfaces/fsl/tests/test_auto_FEAT.py b/nipype/interfaces/fsl/tests/test_auto_FEAT.py index 216c683b86..3f3068f6cb 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FEAT.py +++ b/nipype/interfaces/fsl/tests/test_auto_FEAT.py @@ -6,20 +6,12 @@ def test_FEAT_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), fsf_file=dict(argstr='%s', mandatory=True, position=0, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = FEAT._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_FEATModel.py b/nipype/interfaces/fsl/tests/test_auto_FEATModel.py index c838c02ced..e34ce1d73c 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FEATModel.py +++ b/nipype/interfaces/fsl/tests/test_auto_FEATModel.py @@ -6,9 +6,6 @@ def test_FEATModel_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), ev_files=dict(argstr='%s', copyfile=False, mandatory=True, @@ -19,13 +16,8 @@ def test_FEATModel_inputs(): mandatory=True, position=0, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = FEATModel._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_FEATRegister.py b/nipype/interfaces/fsl/tests/test_auto_FEATRegister.py index 0fe3ed04bd..a13ad971cc 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FEATRegister.py +++ b/nipype/interfaces/fsl/tests/test_auto_FEATRegister.py @@ -6,9 +6,6 @@ def test_FEATRegister_inputs(): input_map = dict(feat_dirs=dict(mandatory=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), reg_dof=dict(usedefault=True, ), reg_image=dict(mandatory=True, diff --git a/nipype/interfaces/fsl/tests/test_auto_FIRST.py b/nipype/interfaces/fsl/tests/test_auto_FIRST.py index eb673151f5..8fee38f29f 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FIRST.py +++ b/nipype/interfaces/fsl/tests/test_auto_FIRST.py @@ -12,12 +12,6 @@ def test_FIRST_inputs(): brain_extracted=dict(argstr='-b', position=2, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-i %s', copyfile=False, mandatory=True, @@ -46,8 +40,6 @@ def test_FIRST_inputs(): ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), verbose=dict(argstr='-v', position=1, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_FLAMEO.py b/nipype/interfaces/fsl/tests/test_auto_FLAMEO.py index 341148d1f7..bfae762622 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FLAMEO.py +++ b/nipype/interfaces/fsl/tests/test_auto_FLAMEO.py @@ -19,16 +19,10 @@ def test_FLAMEO_inputs(): ), dof_var_cope_file=dict(argstr='--dofvarcopefile=%s', ), - environ=dict(nohash=True, - usedefault=True, - ), f_con_file=dict(argstr='--fcontrastsfile=%s', ), fix_mean=dict(argstr='--fixmean', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), infer_outliers=dict(argstr='--inferoutliers', ), log_dir=dict(argstr='--ld=%s', @@ -55,8 +49,6 @@ def test_FLAMEO_inputs(): t_con_file=dict(argstr='--tcontrastsfile=%s', mandatory=True, ), - terminal_output=dict(nohash=True, - ), var_cope_file=dict(argstr='--varcopefile=%s', ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_FLIRT.py b/nipype/interfaces/fsl/tests/test_auto_FLIRT.py index e727e2885b..9324c15c88 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FLIRT.py +++ b/nipype/interfaces/fsl/tests/test_auto_FLIRT.py @@ -40,9 +40,6 @@ def test_FLIRT_inputs(): echospacing=dict(argstr='-echospacing %f', min_ver='5.0.0', ), - environ=dict(nohash=True, - usedefault=True, - ), fieldmap=dict(argstr='-fieldmap %s', min_ver='5.0.0', ), @@ -54,9 +51,6 @@ def test_FLIRT_inputs(): ), force_scaling=dict(argstr='-forcescaling', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-in %s', mandatory=True, position=0, @@ -129,8 +123,6 @@ def test_FLIRT_inputs(): ), sinc_window=dict(argstr='-sincwindow %s', ), - terminal_output=dict(nohash=True, - ), uses_qform=dict(argstr='-usesqform', ), verbose=dict(argstr='-verbose %d', diff --git a/nipype/interfaces/fsl/tests/test_auto_FNIRT.py b/nipype/interfaces/fsl/tests/test_auto_FNIRT.py index c769ee67af..cb0901b185 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FNIRT.py +++ b/nipype/interfaces/fsl/tests/test_auto_FNIRT.py @@ -28,9 +28,6 @@ def test_FNIRT_inputs(): ), derive_from_ref=dict(argstr='--refderiv', ), - environ=dict(nohash=True, - usedefault=True, - ), field_file=dict(argstr='--fout=%s', hash_files=False, ), @@ -38,9 +35,6 @@ def test_FNIRT_inputs(): ), hessian_precision=dict(argstr='--numprec=%s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='--in=%s', mandatory=True, ), @@ -114,8 +108,6 @@ def test_FNIRT_inputs(): subsampling_scheme=dict(argstr='--subsamp=%s', sep=',', ), - terminal_output=dict(nohash=True, - ), warp_resolution=dict(argstr='--warpres=%d,%d,%d', ), warped_file=dict(argstr='--iout=%s', diff --git a/nipype/interfaces/fsl/tests/test_auto_FSLCommand.py b/nipype/interfaces/fsl/tests/test_auto_FSLCommand.py index 560b081bf9..f3105a49e4 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FSLCommand.py +++ b/nipype/interfaces/fsl/tests/test_auto_FSLCommand.py @@ -6,16 +6,8 @@ def test_FSLCommand_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = FSLCommand._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_FSLXCommand.py b/nipype/interfaces/fsl/tests/test_auto_FSLXCommand.py index d4e3e18955..45a2fac163 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FSLXCommand.py +++ b/nipype/interfaces/fsl/tests/test_auto_FSLXCommand.py @@ -26,9 +26,6 @@ def test_FSLXCommand_inputs(): mandatory=True, ), dyads=dict(), - environ=dict(nohash=True, - usedefault=True, - ), f0_ard=dict(argstr='--f0 --ardf0', xor=['f0_noard', 'f0_ard', 'all_ard'], ), @@ -41,19 +38,19 @@ def test_FSLXCommand_inputs(): fsamples=dict(), fudge=dict(argstr='--fudge=%d', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), logdir=dict(argstr='--logdir=%s', usedefault=True, ), mask=dict(argstr='--mask=%s', mandatory=True, ), - mean_S0samples=dict(), - mean_dsamples=dict(), + mean_S0samples=dict(keep_extension=False, + ), + mean_dsamples=dict(keep_extension=False, + ), mean_fsamples=dict(), - mean_tausamples=dict(), + mean_tausamples=dict(keep_extension=False, + ), model=dict(argstr='--model=%d', ), n_fibres=dict(argstr='--nfibres=%d', @@ -81,8 +78,6 @@ def test_FSLXCommand_inputs(): ), seed=dict(argstr='--seed=%d', ), - terminal_output=dict(nohash=True, - ), thsamples=dict(), update_proposal_every=dict(argstr='--updateproposalevery=%d', ), diff --git a/nipype/interfaces/fsl/tests/test_auto_FUGUE.py b/nipype/interfaces/fsl/tests/test_auto_FUGUE.py index 1172e7e1c3..651fedf580 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FUGUE.py +++ b/nipype/interfaces/fsl/tests/test_auto_FUGUE.py @@ -16,9 +16,6 @@ def test_FUGUE_inputs(): ), dwell_to_asym_ratio=dict(argstr='--dwelltoasym=%.10f', ), - environ=dict(nohash=True, - usedefault=True, - ), fmap_in_file=dict(argstr='--loadfmap=%s', ), fmap_out_file=dict(argstr='--savefmap=%s', @@ -33,9 +30,6 @@ def test_FUGUE_inputs(): icorr_only=dict(argstr='--icorronly', requires=['unwarped_file'], ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='--in=%s', ), mask_file=dict(argstr='--mask=%s', @@ -78,8 +72,6 @@ def test_FUGUE_inputs(): ), smooth3d=dict(argstr='--smooth3=%.2f', ), - terminal_output=dict(nohash=True, - ), unwarp_direction=dict(argstr='--unwarpdir=%s', ), unwarped_file=dict(argstr='--unwarp=%s', diff --git a/nipype/interfaces/fsl/tests/test_auto_FilterRegressor.py b/nipype/interfaces/fsl/tests/test_auto_FilterRegressor.py index a19687291e..5970c5c347 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FilterRegressor.py +++ b/nipype/interfaces/fsl/tests/test_auto_FilterRegressor.py @@ -10,9 +10,6 @@ def test_FilterRegressor_inputs(): mandatory=True, position=3, ), - environ=dict(nohash=True, - usedefault=True, - ), filter_all=dict(argstr="-f '%s'", mandatory=True, position=4, @@ -23,9 +20,6 @@ def test_FilterRegressor_inputs(): position=4, xor=['filter_all'], ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-i %s', mandatory=True, position=1, @@ -41,8 +35,6 @@ def test_FilterRegressor_inputs(): ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), var_norm=dict(argstr='--vn', ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_FindTheBiggest.py b/nipype/interfaces/fsl/tests/test_auto_FindTheBiggest.py index 458a53295a..8f7da940b5 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FindTheBiggest.py +++ b/nipype/interfaces/fsl/tests/test_auto_FindTheBiggest.py @@ -6,12 +6,6 @@ def test_FindTheBiggest_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_files=dict(argstr='%s', mandatory=True, position=0, @@ -23,8 +17,6 @@ def test_FindTheBiggest_inputs(): ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = FindTheBiggest._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_GLM.py b/nipype/interfaces/fsl/tests/test_auto_GLM.py index 6f75ba78aa..9ae8cda12e 100644 --- a/nipype/interfaces/fsl/tests/test_auto_GLM.py +++ b/nipype/interfaces/fsl/tests/test_auto_GLM.py @@ -20,12 +20,6 @@ def test_GLM_inputs(): ), dof=dict(argstr='--dof=%d', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-i %s', mandatory=True, position=1, @@ -62,8 +56,6 @@ def test_GLM_inputs(): ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), var_norm=dict(argstr='--vn', ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_ImageMaths.py b/nipype/interfaces/fsl/tests/test_auto_ImageMaths.py index c86a8620d5..5f95a5ae0d 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ImageMaths.py +++ b/nipype/interfaces/fsl/tests/test_auto_ImageMaths.py @@ -6,12 +6,6 @@ def test_ImageMaths_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=1, @@ -33,8 +27,6 @@ def test_ImageMaths_inputs(): ), suffix=dict(deprecated=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = ImageMaths._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_ImageMeants.py b/nipype/interfaces/fsl/tests/test_auto_ImageMeants.py index a067e45911..7b7b620cde 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ImageMeants.py +++ b/nipype/interfaces/fsl/tests/test_auto_ImageMeants.py @@ -8,12 +8,6 @@ def test_ImageMeants_inputs(): ), eig=dict(argstr='--eig', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-i %s', mandatory=True, position=0, @@ -34,8 +28,6 @@ def test_ImageMeants_inputs(): ), spatial_coord=dict(argstr='-c %s', ), - terminal_output=dict(nohash=True, - ), transpose=dict(argstr='--transpose', ), use_mm=dict(argstr='--usemm', diff --git a/nipype/interfaces/fsl/tests/test_auto_ImageStats.py b/nipype/interfaces/fsl/tests/test_auto_ImageStats.py index 0d32e8cc21..9a0cfb4df3 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ImageStats.py +++ b/nipype/interfaces/fsl/tests/test_auto_ImageStats.py @@ -6,12 +6,6 @@ def test_ImageStats_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=2, @@ -27,8 +21,6 @@ def test_ImageStats_inputs(): split_4d=dict(argstr='-t', position=1, ), - terminal_output=dict(nohash=True, - ), ) inputs = ImageStats._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_InvWarp.py b/nipype/interfaces/fsl/tests/test_auto_InvWarp.py index 4fc04f1bd6..a9bda879a4 100644 --- a/nipype/interfaces/fsl/tests/test_auto_InvWarp.py +++ b/nipype/interfaces/fsl/tests/test_auto_InvWarp.py @@ -9,12 +9,6 @@ def test_InvWarp_inputs(): ), args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inverse_warp=dict(argstr='--out=%s', hash_files=False, ), @@ -36,8 +30,6 @@ def test_InvWarp_inputs(): relative=dict(argstr='--rel', xor=['absolute'], ), - terminal_output=dict(nohash=True, - ), warp=dict(argstr='--warp=%s', mandatory=True, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_IsotropicSmooth.py b/nipype/interfaces/fsl/tests/test_auto_IsotropicSmooth.py index 6dc55569fe..0cb3758a0a 100644 --- a/nipype/interfaces/fsl/tests/test_auto_IsotropicSmooth.py +++ b/nipype/interfaces/fsl/tests/test_auto_IsotropicSmooth.py @@ -6,17 +6,11 @@ def test_IsotropicSmooth_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), fwhm=dict(argstr='-s %.5f', mandatory=True, position=4, xor=['sigma'], ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=2, @@ -42,8 +36,6 @@ def test_IsotropicSmooth_inputs(): position=4, xor=['fwhm'], ), - terminal_output=dict(nohash=True, - ), ) inputs = IsotropicSmooth._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_L2Model.py b/nipype/interfaces/fsl/tests/test_auto_L2Model.py index 4a869803fd..1c9573e588 100644 --- a/nipype/interfaces/fsl/tests/test_auto_L2Model.py +++ b/nipype/interfaces/fsl/tests/test_auto_L2Model.py @@ -4,10 +4,7 @@ def test_L2Model_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - num_copes=dict(mandatory=True, + input_map = dict(num_copes=dict(mandatory=True, ), ) inputs = L2Model._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_Level1Design.py b/nipype/interfaces/fsl/tests/test_auto_Level1Design.py index 88b819e990..c1a2702ffb 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Level1Design.py +++ b/nipype/interfaces/fsl/tests/test_auto_Level1Design.py @@ -7,9 +7,6 @@ def test_Level1Design_inputs(): input_map = dict(bases=dict(mandatory=True, ), contrasts=dict(), - ignore_exception=dict(nohash=True, - usedefault=True, - ), interscan_interval=dict(mandatory=True, ), model_serial_correlations=dict(mandatory=True, diff --git a/nipype/interfaces/fsl/tests/test_auto_MCFLIRT.py b/nipype/interfaces/fsl/tests/test_auto_MCFLIRT.py index 71d1532541..bd312fafef 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MCFLIRT.py +++ b/nipype/interfaces/fsl/tests/test_auto_MCFLIRT.py @@ -12,12 +12,6 @@ def test_MCFLIRT_inputs(): ), dof=dict(argstr='-dof %d', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-in %s', mandatory=True, position=0, @@ -29,7 +23,6 @@ def test_MCFLIRT_inputs(): mean_vol=dict(argstr='-meanvol', ), out_file=dict(argstr='-out %s', - genfile=True, hash_files=False, ), output_type=dict(usedefault=True, @@ -54,8 +47,6 @@ def test_MCFLIRT_inputs(): ), stats_imgs=dict(argstr='-stats', ), - terminal_output=dict(nohash=True, - ), use_contour=dict(argstr='-edge', ), use_gradient=dict(argstr='-gdt', diff --git a/nipype/interfaces/fsl/tests/test_auto_MELODIC.py b/nipype/interfaces/fsl/tests/test_auto_MELODIC.py index 3b5943124d..5c63c94bac 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MELODIC.py +++ b/nipype/interfaces/fsl/tests/test_auto_MELODIC.py @@ -20,16 +20,10 @@ def test_MELODIC_inputs(): ), dim_est=dict(argstr='--dimest=%s', ), - environ=dict(nohash=True, - usedefault=True, - ), epsilon=dict(argstr='--eps=%f', ), epsilonS=dict(argstr='--epsS=%f', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_files=dict(argstr='-i %s', mandatory=True, position=0, @@ -100,8 +94,6 @@ def test_MELODIC_inputs(): ), t_des=dict(argstr='--Tdes=%s', ), - terminal_output=dict(nohash=True, - ), tr_sec=dict(argstr='--tr=%f', ), update_mask=dict(argstr='--update_mask', diff --git a/nipype/interfaces/fsl/tests/test_auto_MakeDyadicVectors.py b/nipype/interfaces/fsl/tests/test_auto_MakeDyadicVectors.py index fa5d90626a..4f2576e0e5 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MakeDyadicVectors.py +++ b/nipype/interfaces/fsl/tests/test_auto_MakeDyadicVectors.py @@ -6,12 +6,6 @@ def test_MakeDyadicVectors_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), mask=dict(argstr='%s', position=2, ), @@ -29,8 +23,6 @@ def test_MakeDyadicVectors_inputs(): mandatory=True, position=1, ), - terminal_output=dict(nohash=True, - ), theta_vol=dict(argstr='%s', mandatory=True, position=0, diff --git a/nipype/interfaces/fsl/tests/test_auto_MathsCommand.py b/nipype/interfaces/fsl/tests/test_auto_MathsCommand.py index ab7e6487dd..c5d4ab27b9 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MathsCommand.py +++ b/nipype/interfaces/fsl/tests/test_auto_MathsCommand.py @@ -6,12 +6,6 @@ def test_MathsCommand_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=2, @@ -32,8 +26,6 @@ def test_MathsCommand_inputs(): ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = MathsCommand._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_MaxImage.py b/nipype/interfaces/fsl/tests/test_auto_MaxImage.py index ddbba7276e..b9a5b968f2 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MaxImage.py +++ b/nipype/interfaces/fsl/tests/test_auto_MaxImage.py @@ -10,12 +10,6 @@ def test_MaxImage_inputs(): position=4, usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=2, @@ -36,8 +30,6 @@ def test_MaxImage_inputs(): ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = MaxImage._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_MeanImage.py b/nipype/interfaces/fsl/tests/test_auto_MeanImage.py index e5c2e6f790..112fa13819 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MeanImage.py +++ b/nipype/interfaces/fsl/tests/test_auto_MeanImage.py @@ -10,12 +10,6 @@ def test_MeanImage_inputs(): position=4, usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=2, @@ -36,8 +30,6 @@ def test_MeanImage_inputs(): ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = MeanImage._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_Merge.py b/nipype/interfaces/fsl/tests/test_auto_Merge.py index 3e149f4242..62420a593e 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Merge.py +++ b/nipype/interfaces/fsl/tests/test_auto_Merge.py @@ -10,12 +10,6 @@ def test_Merge_inputs(): mandatory=True, position=0, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_files=dict(argstr='%s', mandatory=True, position=2, @@ -26,8 +20,6 @@ def test_Merge_inputs(): ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), tr=dict(argstr='%.2f', position=-1, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_MotionOutliers.py b/nipype/interfaces/fsl/tests/test_auto_MotionOutliers.py index 14f97ca45d..f579333cc7 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MotionOutliers.py +++ b/nipype/interfaces/fsl/tests/test_auto_MotionOutliers.py @@ -8,12 +8,6 @@ def test_MotionOutliers_inputs(): ), dummy=dict(argstr='--dummy=%d', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-i %s', mandatory=True, ), @@ -34,8 +28,6 @@ def test_MotionOutliers_inputs(): ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), threshold=dict(argstr='--thresh=%g', ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_MultiImageMaths.py b/nipype/interfaces/fsl/tests/test_auto_MultiImageMaths.py index 48ab1b1c14..08dc8ed355 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MultiImageMaths.py +++ b/nipype/interfaces/fsl/tests/test_auto_MultiImageMaths.py @@ -6,12 +6,6 @@ def test_MultiImageMaths_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=2, @@ -38,8 +32,6 @@ def test_MultiImageMaths_inputs(): ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = MultiImageMaths._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_MultipleRegressDesign.py b/nipype/interfaces/fsl/tests/test_auto_MultipleRegressDesign.py index 4ba9c447d1..030f9ce78c 100644 --- a/nipype/interfaces/fsl/tests/test_auto_MultipleRegressDesign.py +++ b/nipype/interfaces/fsl/tests/test_auto_MultipleRegressDesign.py @@ -7,9 +7,6 @@ def test_MultipleRegressDesign_inputs(): input_map = dict(contrasts=dict(mandatory=True, ), groups=dict(), - ignore_exception=dict(nohash=True, - usedefault=True, - ), regressors=dict(mandatory=True, ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_Overlay.py b/nipype/interfaces/fsl/tests/test_auto_Overlay.py index a12bdb2e34..f4a0a85d82 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Overlay.py +++ b/nipype/interfaces/fsl/tests/test_auto_Overlay.py @@ -20,17 +20,11 @@ def test_Overlay_inputs(): position=5, xor=('auto_thresh_bg', 'full_bg_range', 'bg_thresh'), ), - environ=dict(nohash=True, - usedefault=True, - ), full_bg_range=dict(argstr='-A', mandatory=True, position=5, xor=('auto_thresh_bg', 'full_bg_range', 'bg_thresh'), ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), out_file=dict(argstr='%s', hash_files=False, position=-1, @@ -60,8 +54,6 @@ def test_Overlay_inputs(): stat_thresh2=dict(argstr='%.2f %.2f', position=10, ), - terminal_output=dict(nohash=True, - ), transparency=dict(argstr='%s', position=1, usedefault=True, diff --git a/nipype/interfaces/fsl/tests/test_auto_PRELUDE.py b/nipype/interfaces/fsl/tests/test_auto_PRELUDE.py index b8fe631a55..947ca52fbd 100644 --- a/nipype/interfaces/fsl/tests/test_auto_PRELUDE.py +++ b/nipype/interfaces/fsl/tests/test_auto_PRELUDE.py @@ -12,12 +12,6 @@ def test_PRELUDE_inputs(): ), end=dict(argstr='--end=%d', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), label_file=dict(argstr='--labels=%s', hash_files=False, ), @@ -53,8 +47,6 @@ def test_PRELUDE_inputs(): ), start=dict(argstr='--start=%d', ), - terminal_output=dict(nohash=True, - ), threshold=dict(argstr='--thresh=%.10f', ), unwrapped_phase_file=dict(argstr='--unwrap=%s', diff --git a/nipype/interfaces/fsl/tests/test_auto_PlotMotionParams.py b/nipype/interfaces/fsl/tests/test_auto_PlotMotionParams.py index 269241af43..25acaab775 100644 --- a/nipype/interfaces/fsl/tests/test_auto_PlotMotionParams.py +++ b/nipype/interfaces/fsl/tests/test_auto_PlotMotionParams.py @@ -6,12 +6,6 @@ def test_PlotMotionParams_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-i %s', mandatory=True, position=1, @@ -30,8 +24,6 @@ def test_PlotMotionParams_inputs(): plot_type=dict(argstr='%s', mandatory=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = PlotMotionParams._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_PlotTimeSeries.py b/nipype/interfaces/fsl/tests/test_auto_PlotTimeSeries.py index 4835b5bfb2..cc3b7193a8 100644 --- a/nipype/interfaces/fsl/tests/test_auto_PlotTimeSeries.py +++ b/nipype/interfaces/fsl/tests/test_auto_PlotTimeSeries.py @@ -6,12 +6,6 @@ def test_PlotTimeSeries_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=1, @@ -41,8 +35,6 @@ def test_PlotTimeSeries_inputs(): ), sci_notation=dict(argstr='--sci', ), - terminal_output=dict(nohash=True, - ), title=dict(argstr="-t '%s'", ), x_precision=dict(argstr='--precision=%d', diff --git a/nipype/interfaces/fsl/tests/test_auto_PowerSpectrum.py b/nipype/interfaces/fsl/tests/test_auto_PowerSpectrum.py index e32b3b820e..f57c42bedf 100644 --- a/nipype/interfaces/fsl/tests/test_auto_PowerSpectrum.py +++ b/nipype/interfaces/fsl/tests/test_auto_PowerSpectrum.py @@ -6,12 +6,6 @@ def test_PowerSpectrum_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=0, @@ -22,8 +16,6 @@ def test_PowerSpectrum_inputs(): ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = PowerSpectrum._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_PrepareFieldmap.py b/nipype/interfaces/fsl/tests/test_auto_PrepareFieldmap.py index 01cf0ad9dd..040fe4fdff 100644 --- a/nipype/interfaces/fsl/tests/test_auto_PrepareFieldmap.py +++ b/nipype/interfaces/fsl/tests/test_auto_PrepareFieldmap.py @@ -11,12 +11,6 @@ def test_PrepareFieldmap_inputs(): position=-2, usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_magnitude=dict(argstr='%s', mandatory=True, position=3, @@ -38,8 +32,6 @@ def test_PrepareFieldmap_inputs(): position=1, usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = PrepareFieldmap._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_ProbTrackX.py b/nipype/interfaces/fsl/tests/test_auto_ProbTrackX.py index 08c3d4d14c..5fde7eddc4 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ProbTrackX.py +++ b/nipype/interfaces/fsl/tests/test_auto_ProbTrackX.py @@ -14,9 +14,6 @@ def test_ProbTrackX_inputs(): ), dist_thresh=dict(argstr='--distthresh=%.3f', ), - environ=dict(nohash=True, - usedefault=True, - ), fibst=dict(argstr='--fibst=%d', ), force_dir=dict(argstr='--forcedir', @@ -24,9 +21,6 @@ def test_ProbTrackX_inputs(): ), fsamples=dict(mandatory=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inv_xfm=dict(argstr='--invxfm=%s', ), loop_check=dict(argstr='--loopcheck', @@ -84,8 +78,6 @@ def test_ProbTrackX_inputs(): ), target_masks=dict(argstr='--targetmasks=%s', ), - terminal_output=dict(nohash=True, - ), thsamples=dict(mandatory=True, ), use_anisotropy=dict(argstr='--usef', diff --git a/nipype/interfaces/fsl/tests/test_auto_ProbTrackX2.py b/nipype/interfaces/fsl/tests/test_auto_ProbTrackX2.py index 91ba1743cd..e34d3070bb 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ProbTrackX2.py +++ b/nipype/interfaces/fsl/tests/test_auto_ProbTrackX2.py @@ -20,9 +20,6 @@ def test_ProbTrackX2_inputs(): ), distthresh3=dict(argstr='--distthresh3=%.3f', ), - environ=dict(nohash=True, - usedefault=True, - ), fibst=dict(argstr='--fibst=%d', ), fopd=dict(argstr='--fopd=%s', @@ -32,9 +29,6 @@ def test_ProbTrackX2_inputs(): ), fsamples=dict(mandatory=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inv_xfm=dict(argstr='--invxfm=%s', ), loop_check=dict(argstr='--loopcheck', @@ -110,8 +104,6 @@ def test_ProbTrackX2_inputs(): ), target_masks=dict(argstr='--targetmasks=%s', ), - terminal_output=dict(nohash=True, - ), thsamples=dict(mandatory=True, ), use_anisotropy=dict(argstr='--usef', diff --git a/nipype/interfaces/fsl/tests/test_auto_ProjThresh.py b/nipype/interfaces/fsl/tests/test_auto_ProjThresh.py index e4fab4e176..8641dcc76c 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ProjThresh.py +++ b/nipype/interfaces/fsl/tests/test_auto_ProjThresh.py @@ -6,20 +6,12 @@ def test_ProjThresh_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_files=dict(argstr='%s', mandatory=True, position=0, ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), threshold=dict(argstr='%d', mandatory=True, position=1, diff --git a/nipype/interfaces/fsl/tests/test_auto_Randomise.py b/nipype/interfaces/fsl/tests/test_auto_Randomise.py index 3994465807..54df4630d2 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Randomise.py +++ b/nipype/interfaces/fsl/tests/test_auto_Randomise.py @@ -19,9 +19,6 @@ def test_Randomise_inputs(): design_mat=dict(argstr='-d %s', position=2, ), - environ=dict(nohash=True, - usedefault=True, - ), f_c_thresh=dict(argstr='-F %.2f', ), f_cm_thresh=dict(argstr='-S %.2f', @@ -30,9 +27,6 @@ def test_Randomise_inputs(): ), fcon=dict(argstr='-f %s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-i %s', mandatory=True, position=0, @@ -58,8 +52,6 @@ def test_Randomise_inputs(): tcon=dict(argstr='-t %s', position=3, ), - terminal_output=dict(nohash=True, - ), tfce=dict(argstr='-T', ), tfce2D=dict(argstr='--T2', diff --git a/nipype/interfaces/fsl/tests/test_auto_Reorient2Std.py b/nipype/interfaces/fsl/tests/test_auto_Reorient2Std.py index 53232381b9..21b374c4dd 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Reorient2Std.py +++ b/nipype/interfaces/fsl/tests/test_auto_Reorient2Std.py @@ -6,12 +6,6 @@ def test_Reorient2Std_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, ), @@ -20,8 +14,6 @@ def test_Reorient2Std_inputs(): ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = Reorient2Std._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_RobustFOV.py b/nipype/interfaces/fsl/tests/test_auto_RobustFOV.py index c384cddb81..53365b47e4 100644 --- a/nipype/interfaces/fsl/tests/test_auto_RobustFOV.py +++ b/nipype/interfaces/fsl/tests/test_auto_RobustFOV.py @@ -6,12 +6,6 @@ def test_RobustFOV_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-i %s', mandatory=True, position=0, @@ -21,8 +15,6 @@ def test_RobustFOV_inputs(): ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = RobustFOV._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_SMM.py b/nipype/interfaces/fsl/tests/test_auto_SMM.py index 910cc0bb49..bc117b0ccb 100644 --- a/nipype/interfaces/fsl/tests/test_auto_SMM.py +++ b/nipype/interfaces/fsl/tests/test_auto_SMM.py @@ -4,30 +4,33 @@ def test_SMM_inputs(): - input_map = dict(args=dict(argstr='%s', + input_map = dict(activation_p_map=dict(hash_files=False, ), - environ=dict(nohash=True, - usedefault=True, + args=dict(argstr='%s', + ), + deactivation_p_map=dict(hash_files=False, ), - ignore_exception=dict(nohash=True, + logdir=dict(argstr='--ld=%s', + mandatory=True, + position=0, usedefault=True, ), mask=dict(argstr='--mask="%s"', copyfile=False, mandatory=True, - position=1, + position=2, ), no_deactivation_class=dict(argstr='--zfstatmode', position=2, ), + null_p_map=dict(hash_files=False, + ), output_type=dict(usedefault=True, ), spatial_data_file=dict(argstr='--sdf="%s"', copyfile=False, mandatory=True, - position=0, - ), - terminal_output=dict(nohash=True, + position=1, ), ) inputs = SMM._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_SUSAN.py b/nipype/interfaces/fsl/tests/test_auto_SUSAN.py index 5c7510a4f6..33599c7e64 100644 --- a/nipype/interfaces/fsl/tests/test_auto_SUSAN.py +++ b/nipype/interfaces/fsl/tests/test_auto_SUSAN.py @@ -14,16 +14,10 @@ def test_SUSAN_inputs(): position=4, usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), fwhm=dict(argstr='%.10f', mandatory=True, position=3, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=1, @@ -35,8 +29,6 @@ def test_SUSAN_inputs(): ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), usans=dict(argstr='', position=6, usedefault=True, diff --git a/nipype/interfaces/fsl/tests/test_auto_SigLoss.py b/nipype/interfaces/fsl/tests/test_auto_SigLoss.py index 5cbfc53b17..f0ba131de2 100644 --- a/nipype/interfaces/fsl/tests/test_auto_SigLoss.py +++ b/nipype/interfaces/fsl/tests/test_auto_SigLoss.py @@ -8,12 +8,6 @@ def test_SigLoss_inputs(): ), echo_time=dict(argstr='--te=%f', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-i %s', mandatory=True, ), @@ -26,8 +20,6 @@ def test_SigLoss_inputs(): ), slice_direction=dict(argstr='-d %s', ), - terminal_output=dict(nohash=True, - ), ) inputs = SigLoss._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_SliceTimer.py b/nipype/interfaces/fsl/tests/test_auto_SliceTimer.py index 9d9c0ed60c..80af4a62d6 100644 --- a/nipype/interfaces/fsl/tests/test_auto_SliceTimer.py +++ b/nipype/interfaces/fsl/tests/test_auto_SliceTimer.py @@ -10,14 +10,8 @@ def test_SliceTimer_inputs(): ), custom_timings=dict(argstr='--tcustom=%s', ), - environ=dict(nohash=True, - usedefault=True, - ), global_shift=dict(argstr='--tglobal', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='--in=%s', mandatory=True, position=0, @@ -34,8 +28,6 @@ def test_SliceTimer_inputs(): ), slice_direction=dict(argstr='--direction=%d', ), - terminal_output=dict(nohash=True, - ), time_repetition=dict(argstr='--repeat=%f', ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_Slicer.py b/nipype/interfaces/fsl/tests/test_auto_Slicer.py index ce598bdff2..ee9067f54d 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Slicer.py +++ b/nipype/interfaces/fsl/tests/test_auto_Slicer.py @@ -17,16 +17,10 @@ def test_Slicer_inputs(): dither_edges=dict(argstr='-t', position=7, ), - environ=dict(nohash=True, - usedefault=True, - ), hide_orientation=dict(argstr='-u', position=9, usedefault=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), image_edges=dict(argstr='%s', position=2, ), @@ -78,8 +72,6 @@ def test_Slicer_inputs(): slice_number=dict(argstr='-%d', position=11, ), - terminal_output=dict(nohash=True, - ), threshold_edges=dict(argstr='-e %.3f', position=6, ), diff --git a/nipype/interfaces/fsl/tests/test_auto_Smooth.py b/nipype/interfaces/fsl/tests/test_auto_Smooth.py index 941a3debf9..45361f392b 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Smooth.py +++ b/nipype/interfaces/fsl/tests/test_auto_Smooth.py @@ -6,17 +6,11 @@ def test_Smooth_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), fwhm=dict(argstr='-kernel gauss %.03f -fmean', mandatory=True, position=1, xor=['sigma'], ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=0, @@ -32,8 +26,6 @@ def test_Smooth_inputs(): hash_files=False, position=2, ), - terminal_output=dict(nohash=True, - ), ) inputs = Smooth._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_SmoothEstimate.py b/nipype/interfaces/fsl/tests/test_auto_SmoothEstimate.py index e7e82c0e74..15c142e58d 100644 --- a/nipype/interfaces/fsl/tests/test_auto_SmoothEstimate.py +++ b/nipype/interfaces/fsl/tests/test_auto_SmoothEstimate.py @@ -10,12 +10,6 @@ def test_SmoothEstimate_inputs(): mandatory=True, xor=['zstat_file'], ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), mask_file=dict(argstr='--mask=%s', mandatory=True, ), @@ -24,8 +18,6 @@ def test_SmoothEstimate_inputs(): residual_fit_file=dict(argstr='--res=%s', requires=['dof'], ), - terminal_output=dict(nohash=True, - ), zstat_file=dict(argstr='--zstat=%s', xor=['dof'], ), diff --git a/nipype/interfaces/fsl/tests/test_auto_SpatialFilter.py b/nipype/interfaces/fsl/tests/test_auto_SpatialFilter.py index 8db807e579..bd8dddb3b5 100644 --- a/nipype/interfaces/fsl/tests/test_auto_SpatialFilter.py +++ b/nipype/interfaces/fsl/tests/test_auto_SpatialFilter.py @@ -6,12 +6,6 @@ def test_SpatialFilter_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=2, @@ -47,8 +41,6 @@ def test_SpatialFilter_inputs(): ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = SpatialFilter._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_Split.py b/nipype/interfaces/fsl/tests/test_auto_Split.py index 7c7854e21e..e227147319 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Split.py +++ b/nipype/interfaces/fsl/tests/test_auto_Split.py @@ -10,12 +10,6 @@ def test_Split_inputs(): mandatory=True, position=2, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=0, @@ -25,8 +19,6 @@ def test_Split_inputs(): ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = Split._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_SwapDimensions.py b/nipype/interfaces/fsl/tests/test_auto_SwapDimensions.py index 6c6d05abd2..6849741f16 100644 --- a/nipype/interfaces/fsl/tests/test_auto_SwapDimensions.py +++ b/nipype/interfaces/fsl/tests/test_auto_SwapDimensions.py @@ -6,12 +6,6 @@ def test_SwapDimensions_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=1, @@ -24,8 +18,6 @@ def test_SwapDimensions_inputs(): ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = SwapDimensions._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_TOPUP.py b/nipype/interfaces/fsl/tests/test_auto_TOPUP.py index df8a39bc77..08ebe51c3a 100644 --- a/nipype/interfaces/fsl/tests/test_auto_TOPUP.py +++ b/nipype/interfaces/fsl/tests/test_auto_TOPUP.py @@ -20,16 +20,10 @@ def test_TOPUP_inputs(): template='{in_file}_encfile.txt', xor=['encoding_direction'], ), - environ=dict(nohash=True, - usedefault=True, - ), estmov=dict(argstr='--estmov=%d', ), fwhm=dict(argstr='--fwhm=%f', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='--imain=%s', mandatory=True, ), @@ -77,8 +71,6 @@ def test_TOPUP_inputs(): ), subsamp=dict(argstr='--subsamp=%d', ), - terminal_output=dict(nohash=True, - ), warp_res=dict(argstr='--warpres=%f', ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_TemporalFilter.py b/nipype/interfaces/fsl/tests/test_auto_TemporalFilter.py index 1e88242107..7e8ef612fb 100644 --- a/nipype/interfaces/fsl/tests/test_auto_TemporalFilter.py +++ b/nipype/interfaces/fsl/tests/test_auto_TemporalFilter.py @@ -6,16 +6,10 @@ def test_TemporalFilter_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), highpass_sigma=dict(argstr='-bptf %.6f', position=4, usedefault=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=2, @@ -40,8 +34,6 @@ def test_TemporalFilter_inputs(): ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = TemporalFilter._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_Threshold.py b/nipype/interfaces/fsl/tests/test_auto_Threshold.py index afcddce8d3..79c340aaa4 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Threshold.py +++ b/nipype/interfaces/fsl/tests/test_auto_Threshold.py @@ -8,12 +8,6 @@ def test_Threshold_inputs(): ), direction=dict(usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=2, @@ -34,8 +28,6 @@ def test_Threshold_inputs(): ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), thresh=dict(argstr='%s', mandatory=True, position=4, diff --git a/nipype/interfaces/fsl/tests/test_auto_TractSkeleton.py b/nipype/interfaces/fsl/tests/test_auto_TractSkeleton.py index dfb83b4862..1619e77951 100644 --- a/nipype/interfaces/fsl/tests/test_auto_TractSkeleton.py +++ b/nipype/interfaces/fsl/tests/test_auto_TractSkeleton.py @@ -12,12 +12,6 @@ def test_TractSkeleton_inputs(): ), data_file=dict(), distance_map=dict(), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-i %s', mandatory=True, ), @@ -31,8 +25,6 @@ def test_TractSkeleton_inputs(): ), skeleton_file=dict(argstr='-o %s', ), - terminal_output=dict(nohash=True, - ), threshold=dict(), use_cingulum_mask=dict(usedefault=True, xor=['search_mask_file'], diff --git a/nipype/interfaces/fsl/tests/test_auto_UnaryMaths.py b/nipype/interfaces/fsl/tests/test_auto_UnaryMaths.py index 0899b8b0ae..64725d5b86 100644 --- a/nipype/interfaces/fsl/tests/test_auto_UnaryMaths.py +++ b/nipype/interfaces/fsl/tests/test_auto_UnaryMaths.py @@ -6,12 +6,6 @@ def test_UnaryMaths_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=2, @@ -36,8 +30,6 @@ def test_UnaryMaths_inputs(): ), output_type=dict(usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = UnaryMaths._input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_VecReg.py b/nipype/interfaces/fsl/tests/test_auto_VecReg.py index 273d0c2db5..04c313e829 100644 --- a/nipype/interfaces/fsl/tests/test_auto_VecReg.py +++ b/nipype/interfaces/fsl/tests/test_auto_VecReg.py @@ -8,12 +8,6 @@ def test_VecReg_inputs(): ), args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-i %s', mandatory=True, ), @@ -36,8 +30,6 @@ def test_VecReg_inputs(): ), rotation_warp=dict(argstr='--rotwarp=%s', ), - terminal_output=dict(nohash=True, - ), warp_field=dict(argstr='-w %s', ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_WarpPoints.py b/nipype/interfaces/fsl/tests/test_auto_WarpPoints.py index e206542478..eecae5c374 100644 --- a/nipype/interfaces/fsl/tests/test_auto_WarpPoints.py +++ b/nipype/interfaces/fsl/tests/test_auto_WarpPoints.py @@ -15,12 +15,6 @@ def test_WarpPoints_inputs(): dest_file=dict(argstr='-dest %s', mandatory=True, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_coords=dict(argstr='%s', mandatory=True, position=-1, @@ -32,8 +26,6 @@ def test_WarpPoints_inputs(): src_file=dict(argstr='-src %s', mandatory=True, ), - terminal_output=dict(nohash=True, - ), warp_file=dict(argstr='-warp %s', xor=['xfm_file'], ), diff --git a/nipype/interfaces/fsl/tests/test_auto_WarpPointsToStd.py b/nipype/interfaces/fsl/tests/test_auto_WarpPointsToStd.py index a3018f0994..7434772911 100644 --- a/nipype/interfaces/fsl/tests/test_auto_WarpPointsToStd.py +++ b/nipype/interfaces/fsl/tests/test_auto_WarpPointsToStd.py @@ -12,12 +12,6 @@ def test_WarpPointsToStd_inputs(): coord_vox=dict(argstr='-vox', xor=['coord_mm'], ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), img_file=dict(argstr='-img %s', mandatory=True, ), @@ -34,8 +28,6 @@ def test_WarpPointsToStd_inputs(): std_file=dict(argstr='-std %s', mandatory=True, ), - terminal_output=dict(nohash=True, - ), warp_file=dict(argstr='-warp %s', xor=['xfm_file'], ), diff --git a/nipype/interfaces/fsl/tests/test_auto_WarpUtils.py b/nipype/interfaces/fsl/tests/test_auto_WarpUtils.py index 69a617ea47..147d3f17b7 100644 --- a/nipype/interfaces/fsl/tests/test_auto_WarpUtils.py +++ b/nipype/interfaces/fsl/tests/test_auto_WarpUtils.py @@ -6,12 +6,6 @@ def test_WarpUtils_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='--in=%s', mandatory=True, ), @@ -29,8 +23,6 @@ def test_WarpUtils_inputs(): reference=dict(argstr='--ref=%s', mandatory=True, ), - terminal_output=dict(nohash=True, - ), warp_resolution=dict(argstr='--warpres=%0.4f,%0.4f,%0.4f', ), with_affine=dict(argstr='--withaff', diff --git a/nipype/interfaces/fsl/tests/test_auto_XFibres4.py b/nipype/interfaces/fsl/tests/test_auto_XFibres4.py index 575feb41d3..cf67e5300a 100644 --- a/nipype/interfaces/fsl/tests/test_auto_XFibres4.py +++ b/nipype/interfaces/fsl/tests/test_auto_XFibres4.py @@ -22,9 +22,6 @@ def test_XFibres4_inputs(): dwi=dict(argstr='--data=%s', mandatory=True, ), - environ=dict(nohash=True, - usedefault=True, - ), force_dir=dict(argstr='--forcedir', usedefault=True, ), @@ -32,9 +29,6 @@ def test_XFibres4_inputs(): ), gradnonlin=dict(argstr='--gradnonlin=%s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), logdir=dict(argstr='--logdir=%s', usedefault=True, ), @@ -62,8 +56,6 @@ def test_XFibres4_inputs(): ), seed=dict(argstr='--seed=%d', ), - terminal_output=dict(nohash=True, - ), update_proposal_every=dict(argstr='--updateproposalevery=%d', ), ) diff --git a/nipype/interfaces/fsl/tests/test_auto_XFibres5.py b/nipype/interfaces/fsl/tests/test_auto_XFibres5.py index 32613a5154..3b4a55285b 100644 --- a/nipype/interfaces/fsl/tests/test_auto_XFibres5.py +++ b/nipype/interfaces/fsl/tests/test_auto_XFibres5.py @@ -26,9 +26,6 @@ def test_XFibres5_inputs(): mandatory=True, ), dyads=dict(), - environ=dict(nohash=True, - usedefault=True, - ), f0_ard=dict(argstr='--f0 --ardf0', xor=['f0_noard', 'f0_ard', 'all_ard'], ), @@ -43,19 +40,19 @@ def test_XFibres5_inputs(): ), gradnonlin=dict(argstr='--gradnonlin=%s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), logdir=dict(argstr='--logdir=%s', usedefault=True, ), mask=dict(argstr='--mask=%s', mandatory=True, ), - mean_S0samples=dict(), - mean_dsamples=dict(), + mean_S0samples=dict(keep_extension=False, + ), + mean_dsamples=dict(keep_extension=False, + ), mean_fsamples=dict(), - mean_tausamples=dict(), + mean_tausamples=dict(keep_extension=False, + ), model=dict(argstr='--model=%d', ), n_fibres=dict(argstr='--nfibres=%d', @@ -83,8 +80,6 @@ def test_XFibres5_inputs(): ), seed=dict(argstr='--seed=%d', ), - terminal_output=dict(nohash=True, - ), thsamples=dict(), update_proposal_every=dict(argstr='--updateproposalevery=%d', ), diff --git a/nipype/interfaces/minc/tests/test_auto_Average.py b/nipype/interfaces/minc/tests/test_auto_Average.py index 80f627a34b..c8fb1aaa63 100644 --- a/nipype/interfaces/minc/tests/test_auto_Average.py +++ b/nipype/interfaces/minc/tests/test_auto_Average.py @@ -25,9 +25,6 @@ def test_Average_inputs(): ), debug=dict(argstr='-debug', ), - environ=dict(nohash=True, - usedefault=True, - ), filelist=dict(argstr='-filelist %s', mandatory=True, xor=('input_files', 'filelist'), @@ -59,9 +56,6 @@ def test_Average_inputs(): format_unsigned=dict(argstr='-unsigned', xor=('format_filetype', 'format_byte', 'format_short', 'format_int', 'format_long', 'format_float', 'format_double', 'format_signed', 'format_unsigned'), ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_files=dict(argstr='%s', exists=True, mandatory=True, @@ -95,8 +89,6 @@ def test_Average_inputs(): ), sdfile=dict(argstr='-sdfile %s', ), - terminal_output=dict(nohash=True, - ), two=dict(argstr='-2', ), verbose=dict(argstr='-verbose', diff --git a/nipype/interfaces/minc/tests/test_auto_BBox.py b/nipype/interfaces/minc/tests/test_auto_BBox.py index 1848fae1b4..2d3b776a68 100644 --- a/nipype/interfaces/minc/tests/test_auto_BBox.py +++ b/nipype/interfaces/minc/tests/test_auto_BBox.py @@ -6,18 +6,12 @@ def test_BBox_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), format_minccrop=dict(argstr='-minccrop', ), format_mincresample=dict(argstr='-mincresample', ), format_mincreshape=dict(argstr='-mincreshape', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_file=dict(argstr='%s', mandatory=True, position=-2, @@ -35,8 +29,6 @@ def test_BBox_inputs(): name_template='%s_bbox.txt', position=-1, ), - terminal_output=dict(nohash=True, - ), threshold=dict(argstr='-threshold', ), two_lines=dict(argstr='-two_lines', diff --git a/nipype/interfaces/minc/tests/test_auto_Beast.py b/nipype/interfaces/minc/tests/test_auto_Beast.py index b9d90b8eb1..7e30806e79 100644 --- a/nipype/interfaces/minc/tests/test_auto_Beast.py +++ b/nipype/interfaces/minc/tests/test_auto_Beast.py @@ -16,16 +16,10 @@ def test_Beast_inputs(): ), configuration_file=dict(argstr='-configuration %s', ), - environ=dict(nohash=True, - usedefault=True, - ), fill_holes=dict(argstr='-fill', ), flip_images=dict(argstr='-flip', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_file=dict(argstr='%s', mandatory=True, position=-2, @@ -58,8 +52,6 @@ def test_Beast_inputs(): ), smoothness_factor_beta=dict(argstr='-beta %s', ), - terminal_output=dict(nohash=True, - ), threshold_patch_selection=dict(argstr='-threshold %s', ), voxel_size=dict(argstr='-voxel_size %s', diff --git a/nipype/interfaces/minc/tests/test_auto_BestLinReg.py b/nipype/interfaces/minc/tests/test_auto_BestLinReg.py index 419fdd48cc..9aa16f4971 100644 --- a/nipype/interfaces/minc/tests/test_auto_BestLinReg.py +++ b/nipype/interfaces/minc/tests/test_auto_BestLinReg.py @@ -9,12 +9,6 @@ def test_BestLinReg_inputs(): clobber=dict(argstr='-clobber', usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), output_mnc=dict(argstr='%s', genfile=True, hash_files=False, @@ -39,8 +33,6 @@ def test_BestLinReg_inputs(): mandatory=True, position=-3, ), - terminal_output=dict(nohash=True, - ), verbose=dict(argstr='-verbose', ), ) diff --git a/nipype/interfaces/minc/tests/test_auto_BigAverage.py b/nipype/interfaces/minc/tests/test_auto_BigAverage.py index b5f990eec0..0f56592c72 100644 --- a/nipype/interfaces/minc/tests/test_auto_BigAverage.py +++ b/nipype/interfaces/minc/tests/test_auto_BigAverage.py @@ -9,12 +9,6 @@ def test_BigAverage_inputs(): clobber=dict(argstr='--clobber', usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_files=dict(argstr='%s', exists=True, mandatory=True, @@ -37,8 +31,6 @@ def test_BigAverage_inputs(): name_source=['input_files'], name_template='%s_bigaverage_stdev.mnc', ), - terminal_output=dict(nohash=True, - ), tmpdir=dict(argstr='-tmpdir %s', ), verbose=dict(argstr='--verbose', diff --git a/nipype/interfaces/minc/tests/test_auto_Blob.py b/nipype/interfaces/minc/tests/test_auto_Blob.py index ac5d656bff..e416836ee6 100644 --- a/nipype/interfaces/minc/tests/test_auto_Blob.py +++ b/nipype/interfaces/minc/tests/test_auto_Blob.py @@ -8,12 +8,6 @@ def test_Blob_inputs(): ), determinant=dict(argstr='-determinant', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_file=dict(argstr='%s', mandatory=True, position=-2, @@ -27,8 +21,6 @@ def test_Blob_inputs(): name_template='%s_blob.mnc', position=-1, ), - terminal_output=dict(nohash=True, - ), trace=dict(argstr='-trace', ), translation=dict(argstr='-translation', diff --git a/nipype/interfaces/minc/tests/test_auto_Blur.py b/nipype/interfaces/minc/tests/test_auto_Blur.py index e0e4914371..07f188d1b6 100644 --- a/nipype/interfaces/minc/tests/test_auto_Blur.py +++ b/nipype/interfaces/minc/tests/test_auto_Blur.py @@ -11,9 +11,6 @@ def test_Blur_inputs(): ), dimensions=dict(argstr='-dimensions %s', ), - environ=dict(nohash=True, - usedefault=True, - ), fwhm=dict(argstr='-fwhm %s', mandatory=True, xor=('fwhm', 'fwhm3d', 'standard_dev'), @@ -27,9 +24,6 @@ def test_Blur_inputs(): ), gradient=dict(argstr='-gradient', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_file=dict(argstr='%s', mandatory=True, position=-2, @@ -48,8 +42,6 @@ def test_Blur_inputs(): mandatory=True, xor=('fwhm', 'fwhm3d', 'standard_dev'), ), - terminal_output=dict(nohash=True, - ), ) inputs = Blur._input_spec() diff --git a/nipype/interfaces/minc/tests/test_auto_Calc.py b/nipype/interfaces/minc/tests/test_auto_Calc.py index 0c40edd5c7..10b2230cda 100644 --- a/nipype/interfaces/minc/tests/test_auto_Calc.py +++ b/nipype/interfaces/minc/tests/test_auto_Calc.py @@ -17,9 +17,6 @@ def test_Calc_inputs(): ), debug=dict(argstr='-debug', ), - environ=dict(nohash=True, - usedefault=True, - ), eval_width=dict(argstr='-eval_width %s', usedefault=False, ), @@ -62,9 +59,6 @@ def test_Calc_inputs(): format_unsigned=dict(argstr='-unsigned', xor=('format_filetype', 'format_byte', 'format_short', 'format_int', 'format_long', 'format_float', 'format_double', 'format_signed', 'format_unsigned'), ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), ignore_nan=dict(argstr='-ignore_nan', ), input_files=dict(argstr='%s', @@ -104,8 +98,6 @@ def test_Calc_inputs(): quiet=dict(argstr='-quiet', xor=('verbose', 'quiet'), ), - terminal_output=dict(nohash=True, - ), two=dict(argstr='-2', ), verbose=dict(argstr='-verbose', diff --git a/nipype/interfaces/minc/tests/test_auto_Convert.py b/nipype/interfaces/minc/tests/test_auto_Convert.py index 5d57f6cea2..f99c1231f4 100644 --- a/nipype/interfaces/minc/tests/test_auto_Convert.py +++ b/nipype/interfaces/minc/tests/test_auto_Convert.py @@ -14,12 +14,6 @@ def test_Convert_inputs(): ), compression=dict(argstr='-compress %s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_file=dict(argstr='%s', mandatory=True, position=-2, @@ -33,8 +27,6 @@ def test_Convert_inputs(): ), template=dict(argstr='-template', ), - terminal_output=dict(nohash=True, - ), two=dict(argstr='-2', ), ) diff --git a/nipype/interfaces/minc/tests/test_auto_Copy.py b/nipype/interfaces/minc/tests/test_auto_Copy.py index 211aa707d4..b439c06f9b 100644 --- a/nipype/interfaces/minc/tests/test_auto_Copy.py +++ b/nipype/interfaces/minc/tests/test_auto_Copy.py @@ -6,12 +6,6 @@ def test_Copy_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_file=dict(argstr='%s', mandatory=True, position=-2, @@ -29,8 +23,6 @@ def test_Copy_inputs(): real_values=dict(argstr='-real_values', xor=('pixel_values', 'real_values'), ), - terminal_output=dict(nohash=True, - ), ) inputs = Copy._input_spec() diff --git a/nipype/interfaces/minc/tests/test_auto_Dump.py b/nipype/interfaces/minc/tests/test_auto_Dump.py index f4727956e2..98f4112ffb 100644 --- a/nipype/interfaces/minc/tests/test_auto_Dump.py +++ b/nipype/interfaces/minc/tests/test_auto_Dump.py @@ -15,15 +15,9 @@ def test_Dump_inputs(): coordinate_data=dict(argstr='-c', xor=('coordinate_data', 'header_data'), ), - environ=dict(nohash=True, - usedefault=True, - ), header_data=dict(argstr='-h', xor=('coordinate_data', 'header_data'), ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_file=dict(argstr='%s', mandatory=True, position=-2, @@ -45,8 +39,6 @@ def test_Dump_inputs(): ), precision=dict(argstr='%s', ), - terminal_output=dict(nohash=True, - ), variables=dict(argstr='-v %s', sep=',', ), diff --git a/nipype/interfaces/minc/tests/test_auto_Extract.py b/nipype/interfaces/minc/tests/test_auto_Extract.py index fc93d8e1ea..24a4878e06 100644 --- a/nipype/interfaces/minc/tests/test_auto_Extract.py +++ b/nipype/interfaces/minc/tests/test_auto_Extract.py @@ -9,9 +9,6 @@ def test_Extract_inputs(): count=dict(argstr='-count %s', sep=',', ), - environ=dict(nohash=True, - usedefault=True, - ), flip_any_direction=dict(argstr='-any_direction', xor=('flip_positive_direction', 'flip_negative_direction', 'flip_any_direction'), ), @@ -48,9 +45,6 @@ def test_Extract_inputs(): flip_z_positive=dict(argstr='+zdirection', xor=('flip_z_positive', 'flip_z_negative', 'flip_z_any'), ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), image_maximum=dict(argstr='-image_maximum %s', ), image_minimum=dict(argstr='-image_minimum %s', @@ -80,8 +74,6 @@ def test_Extract_inputs(): start=dict(argstr='-start %s', sep=',', ), - terminal_output=dict(nohash=True, - ), write_ascii=dict(argstr='-ascii', xor=('write_ascii', 'write_ascii', 'write_byte', 'write_short', 'write_int', 'write_long', 'write_float', 'write_double', 'write_signed', 'write_unsigned'), ), diff --git a/nipype/interfaces/minc/tests/test_auto_Gennlxfm.py b/nipype/interfaces/minc/tests/test_auto_Gennlxfm.py index 6f681a5bb4..44f5797cd4 100644 --- a/nipype/interfaces/minc/tests/test_auto_Gennlxfm.py +++ b/nipype/interfaces/minc/tests/test_auto_Gennlxfm.py @@ -9,14 +9,8 @@ def test_Gennlxfm_inputs(): clobber=dict(argstr='-clobber', usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), ident=dict(argstr='-ident', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), like=dict(argstr='-like %s', ), output_file=dict(argstr='%s', @@ -28,8 +22,6 @@ def test_Gennlxfm_inputs(): ), step=dict(argstr='-step %s', ), - terminal_output=dict(nohash=True, - ), verbose=dict(argstr='-verbose', ), ) diff --git a/nipype/interfaces/minc/tests/test_auto_Math.py b/nipype/interfaces/minc/tests/test_auto_Math.py index acd9b5d890..209b9b8183 100644 --- a/nipype/interfaces/minc/tests/test_auto_Math.py +++ b/nipype/interfaces/minc/tests/test_auto_Math.py @@ -37,9 +37,6 @@ def test_Math_inputs(): ), dimension=dict(argstr='-dimension %s', ), - environ=dict(nohash=True, - usedefault=True, - ), exp=dict(argstr='-exp -const2 %s %s', ), filelist=dict(argstr='-filelist %s', @@ -73,9 +70,6 @@ def test_Math_inputs(): format_unsigned=dict(argstr='-unsigned', xor=('format_filetype', 'format_byte', 'format_short', 'format_int', 'format_long', 'format_float', 'format_double', 'format_signed', 'format_unsigned'), ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), ignore_nan=dict(argstr='-ignore_nan', ), input_files=dict(argstr='%s', @@ -135,8 +129,6 @@ def test_Math_inputs(): ), square=dict(argstr='-square', ), - terminal_output=dict(nohash=True, - ), test_eq=dict(argstr='-eq', ), test_ge=dict(argstr='-ge', diff --git a/nipype/interfaces/minc/tests/test_auto_NlpFit.py b/nipype/interfaces/minc/tests/test_auto_NlpFit.py index 4a981b1431..d5c467559b 100644 --- a/nipype/interfaces/minc/tests/test_auto_NlpFit.py +++ b/nipype/interfaces/minc/tests/test_auto_NlpFit.py @@ -12,12 +12,6 @@ def test_NlpFit_inputs(): config_file=dict(argstr='-config_file %s', mandatory=True, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), init_xfm=dict(argstr='-init_xfm %s', mandatory=True, ), @@ -37,8 +31,6 @@ def test_NlpFit_inputs(): mandatory=True, position=-2, ), - terminal_output=dict(nohash=True, - ), verbose=dict(argstr='-verbose', ), ) diff --git a/nipype/interfaces/minc/tests/test_auto_Norm.py b/nipype/interfaces/minc/tests/test_auto_Norm.py index 23359205d0..70f7207d9c 100644 --- a/nipype/interfaces/minc/tests/test_auto_Norm.py +++ b/nipype/interfaces/minc/tests/test_auto_Norm.py @@ -16,12 +16,6 @@ def test_Norm_inputs(): max=100, min=0, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_file=dict(argstr='%s', mandatory=True, position=-2, @@ -46,8 +40,6 @@ def test_Norm_inputs(): name_source=['input_file'], name_template='%s_norm_threshold_mask.mnc', ), - terminal_output=dict(nohash=True, - ), threshold=dict(argstr='-threshold', ), threshold_blur=dict(argstr='-threshold_blur %s', diff --git a/nipype/interfaces/minc/tests/test_auto_Pik.py b/nipype/interfaces/minc/tests/test_auto_Pik.py index 87b6a1d69b..2d3883ed82 100644 --- a/nipype/interfaces/minc/tests/test_auto_Pik.py +++ b/nipype/interfaces/minc/tests/test_auto_Pik.py @@ -16,15 +16,9 @@ def test_Pik_inputs(): ), depth=dict(argstr='--depth %s', ), - environ=dict(nohash=True, - usedefault=True, - ), horizontal_triplanar_view=dict(argstr='--horizontal', xor=('vertical_triplanar_view', 'horizontal_triplanar_view'), ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), image_range=dict(argstr='--image_range %s %s', xor=('image_range', 'auto_range'), ), @@ -65,8 +59,6 @@ def test_Pik_inputs(): ), start=dict(argstr='--slice %s', ), - terminal_output=dict(nohash=True, - ), tile_size=dict(argstr='--tilesize %s', ), title=dict(argstr='%s', diff --git a/nipype/interfaces/minc/tests/test_auto_Resample.py b/nipype/interfaces/minc/tests/test_auto_Resample.py index 3c18eee18b..d4f38ab981 100644 --- a/nipype/interfaces/minc/tests/test_auto_Resample.py +++ b/nipype/interfaces/minc/tests/test_auto_Resample.py @@ -15,9 +15,6 @@ def test_Resample_inputs(): dircos=dict(argstr='-dircos %s %s %s', xor=('nelements', 'nelements_x_y_or_z'), ), - environ=dict(nohash=True, - usedefault=True, - ), fill=dict(argstr='-fill', xor=('nofill', 'fill'), ), @@ -51,9 +48,6 @@ def test_Resample_inputs(): half_width_sinc_window=dict(argstr='-width %s', requires=['sinc_interpolation'], ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_file=dict(argstr='%s', mandatory=True, position=-2, @@ -118,8 +112,6 @@ def test_Resample_inputs(): ), talairach=dict(argstr='-talairach', ), - terminal_output=dict(nohash=True, - ), transformation=dict(argstr='-transformation %s', ), transverse_slices=dict(argstr='-transverse', diff --git a/nipype/interfaces/minc/tests/test_auto_Reshape.py b/nipype/interfaces/minc/tests/test_auto_Reshape.py index 2df3c86484..d2e628279d 100644 --- a/nipype/interfaces/minc/tests/test_auto_Reshape.py +++ b/nipype/interfaces/minc/tests/test_auto_Reshape.py @@ -9,12 +9,6 @@ def test_Reshape_inputs(): clobber=dict(argstr='-clobber', usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_file=dict(argstr='%s', mandatory=True, position=-2, @@ -26,8 +20,6 @@ def test_Reshape_inputs(): name_template='%s_reshape.mnc', position=-1, ), - terminal_output=dict(nohash=True, - ), verbose=dict(argstr='-verbose', ), write_short=dict(argstr='-short', diff --git a/nipype/interfaces/minc/tests/test_auto_ToEcat.py b/nipype/interfaces/minc/tests/test_auto_ToEcat.py index 5528fd0b8d..f820b59f5b 100644 --- a/nipype/interfaces/minc/tests/test_auto_ToEcat.py +++ b/nipype/interfaces/minc/tests/test_auto_ToEcat.py @@ -6,9 +6,6 @@ def test_ToEcat_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), ignore_acquisition_variable=dict(argstr='-ignore_acquisition_variable', ), ignore_ecat_acquisition_variable=dict(argstr='-ignore_ecat_acquisition_variable', @@ -17,9 +14,6 @@ def test_ToEcat_inputs(): ), ignore_ecat_subheader_variable=dict(argstr='-ignore_ecat_subheader_variable', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), ignore_patient_variable=dict(argstr='-ignore_patient_variable', ), ignore_study_variable=dict(argstr='-ignore_study_variable', @@ -39,8 +33,6 @@ def test_ToEcat_inputs(): name_template='%s_to_ecat.v', position=-1, ), - terminal_output=dict(nohash=True, - ), voxels_as_integers=dict(argstr='-label', ), ) diff --git a/nipype/interfaces/minc/tests/test_auto_ToRaw.py b/nipype/interfaces/minc/tests/test_auto_ToRaw.py index 4c160cfc22..c8539dfa87 100644 --- a/nipype/interfaces/minc/tests/test_auto_ToRaw.py +++ b/nipype/interfaces/minc/tests/test_auto_ToRaw.py @@ -6,12 +6,6 @@ def test_ToRaw_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_file=dict(argstr='%s', mandatory=True, position=-2, @@ -32,8 +26,6 @@ def test_ToRaw_inputs(): name_template='%s.raw', position=-1, ), - terminal_output=dict(nohash=True, - ), write_byte=dict(argstr='-byte', xor=('write_byte', 'write_short', 'write_int', 'write_long', 'write_float', 'write_double'), ), diff --git a/nipype/interfaces/minc/tests/test_auto_VolSymm.py b/nipype/interfaces/minc/tests/test_auto_VolSymm.py index 01a3e3ecbc..5b6464b2f2 100644 --- a/nipype/interfaces/minc/tests/test_auto_VolSymm.py +++ b/nipype/interfaces/minc/tests/test_auto_VolSymm.py @@ -11,16 +11,10 @@ def test_VolSymm_inputs(): ), config_file=dict(argstr='-config_file %s', ), - environ=dict(nohash=True, - usedefault=True, - ), fit_linear=dict(argstr='-linear', ), fit_nonlinear=dict(argstr='-nonlinear', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_file=dict(argstr='%s', mandatory=True, position=-3, @@ -35,8 +29,6 @@ def test_VolSymm_inputs(): name_template='%s_vol_symm.mnc', position=-1, ), - terminal_output=dict(nohash=True, - ), trans_file=dict(argstr='%s', genfile=True, hash_files=False, diff --git a/nipype/interfaces/minc/tests/test_auto_Volcentre.py b/nipype/interfaces/minc/tests/test_auto_Volcentre.py index 85ebb43492..94ce61ff07 100644 --- a/nipype/interfaces/minc/tests/test_auto_Volcentre.py +++ b/nipype/interfaces/minc/tests/test_auto_Volcentre.py @@ -13,12 +13,6 @@ def test_Volcentre_inputs(): ), com=dict(argstr='-com', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_file=dict(argstr='%s', mandatory=True, position=-2, @@ -30,8 +24,6 @@ def test_Volcentre_inputs(): name_template='%s_volcentre.mnc', position=-1, ), - terminal_output=dict(nohash=True, - ), verbose=dict(argstr='-verbose', ), zero_dircos=dict(argstr='-zero_dircos', diff --git a/nipype/interfaces/minc/tests/test_auto_Voliso.py b/nipype/interfaces/minc/tests/test_auto_Voliso.py index 2db4ec7177..efbfec3016 100644 --- a/nipype/interfaces/minc/tests/test_auto_Voliso.py +++ b/nipype/interfaces/minc/tests/test_auto_Voliso.py @@ -11,12 +11,6 @@ def test_Voliso_inputs(): clobber=dict(argstr='--clobber', usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_file=dict(argstr='%s', mandatory=True, position=-2, @@ -32,8 +26,6 @@ def test_Voliso_inputs(): name_template='%s_voliso.mnc', position=-1, ), - terminal_output=dict(nohash=True, - ), verbose=dict(argstr='--verbose', ), ) diff --git a/nipype/interfaces/minc/tests/test_auto_Volpad.py b/nipype/interfaces/minc/tests/test_auto_Volpad.py index 639aa3a2ef..0c37e5ee3b 100644 --- a/nipype/interfaces/minc/tests/test_auto_Volpad.py +++ b/nipype/interfaces/minc/tests/test_auto_Volpad.py @@ -15,12 +15,6 @@ def test_Volpad_inputs(): ), distance=dict(argstr='-distance %s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_file=dict(argstr='%s', mandatory=True, position=-2, @@ -36,8 +30,6 @@ def test_Volpad_inputs(): ), smooth_distance=dict(argstr='-smooth_distance %s', ), - terminal_output=dict(nohash=True, - ), verbose=dict(argstr='-verbose', ), ) diff --git a/nipype/interfaces/minc/tests/test_auto_XfmAvg.py b/nipype/interfaces/minc/tests/test_auto_XfmAvg.py index 801c360056..dcdc5d5479 100644 --- a/nipype/interfaces/minc/tests/test_auto_XfmAvg.py +++ b/nipype/interfaces/minc/tests/test_auto_XfmAvg.py @@ -13,12 +13,6 @@ def test_XfmAvg_inputs(): clobber=dict(argstr='-clobber', usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), ignore_linear=dict(argstr='-ignore_linear', ), ignore_nonlinear=dict(argstr='-ignore_nonline', @@ -34,8 +28,6 @@ def test_XfmAvg_inputs(): genfile=True, position=-1, ), - terminal_output=dict(nohash=True, - ), verbose=dict(argstr='-verbose', ), ) diff --git a/nipype/interfaces/minc/tests/test_auto_XfmConcat.py b/nipype/interfaces/minc/tests/test_auto_XfmConcat.py index e6f8d0601d..01d11cdcbf 100644 --- a/nipype/interfaces/minc/tests/test_auto_XfmConcat.py +++ b/nipype/interfaces/minc/tests/test_auto_XfmConcat.py @@ -9,12 +9,6 @@ def test_XfmConcat_inputs(): clobber=dict(argstr='-clobber', usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_files=dict(argstr='%s', exists=True, mandatory=True, @@ -29,8 +23,6 @@ def test_XfmConcat_inputs(): name_template='%s_xfmconcat.xfm', position=-1, ), - terminal_output=dict(nohash=True, - ), verbose=dict(argstr='-verbose', ), ) diff --git a/nipype/interfaces/minc/tests/test_auto_XfmInvert.py b/nipype/interfaces/minc/tests/test_auto_XfmInvert.py index 916ab53624..4e42261fd6 100644 --- a/nipype/interfaces/minc/tests/test_auto_XfmInvert.py +++ b/nipype/interfaces/minc/tests/test_auto_XfmInvert.py @@ -9,12 +9,6 @@ def test_XfmInvert_inputs(): clobber=dict(argstr='-clobber', usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_file=dict(argstr='%s', mandatory=True, position=-2, @@ -23,8 +17,6 @@ def test_XfmInvert_inputs(): genfile=True, position=-1, ), - terminal_output=dict(nohash=True, - ), verbose=dict(argstr='-verbose', ), ) diff --git a/nipype/interfaces/mipav/tests/test_auto_JistBrainMgdmSegmentation.py b/nipype/interfaces/mipav/tests/test_auto_JistBrainMgdmSegmentation.py index 15d7e8d27e..b5c97f1f85 100644 --- a/nipype/interfaces/mipav/tests/test_auto_JistBrainMgdmSegmentation.py +++ b/nipype/interfaces/mipav/tests/test_auto_JistBrainMgdmSegmentation.py @@ -6,12 +6,6 @@ def test_JistBrainMgdmSegmentation_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inAdjust=dict(argstr='--inAdjust %s', ), inAtlas=dict(argstr='--inAtlas %s', @@ -58,8 +52,6 @@ def test_JistBrainMgdmSegmentation_inputs(): outSegmented=dict(argstr='--outSegmented %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), xDefaultMem=dict(argstr='-xDefaultMem %d', ), xMaxProcess=dict(argstr='-xMaxProcess %d', diff --git a/nipype/interfaces/mipav/tests/test_auto_JistBrainMp2rageDuraEstimation.py b/nipype/interfaces/mipav/tests/test_auto_JistBrainMp2rageDuraEstimation.py index 5aa73ab8eb..7fd9a2fc81 100644 --- a/nipype/interfaces/mipav/tests/test_auto_JistBrainMp2rageDuraEstimation.py +++ b/nipype/interfaces/mipav/tests/test_auto_JistBrainMp2rageDuraEstimation.py @@ -6,12 +6,6 @@ def test_JistBrainMp2rageDuraEstimation_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inDistance=dict(argstr='--inDistance %f', ), inSecond=dict(argstr='--inSecond %s', @@ -25,8 +19,6 @@ def test_JistBrainMp2rageDuraEstimation_inputs(): outDura=dict(argstr='--outDura %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), xDefaultMem=dict(argstr='-xDefaultMem %d', ), xMaxProcess=dict(argstr='-xMaxProcess %d', diff --git a/nipype/interfaces/mipav/tests/test_auto_JistBrainMp2rageSkullStripping.py b/nipype/interfaces/mipav/tests/test_auto_JistBrainMp2rageSkullStripping.py index c4890181e3..febf1c3149 100644 --- a/nipype/interfaces/mipav/tests/test_auto_JistBrainMp2rageSkullStripping.py +++ b/nipype/interfaces/mipav/tests/test_auto_JistBrainMp2rageSkullStripping.py @@ -6,12 +6,6 @@ def test_JistBrainMp2rageSkullStripping_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inFilter=dict(argstr='--inFilter %s', ), inSecond=dict(argstr='--inSecond %s', @@ -36,8 +30,6 @@ def test_JistBrainMp2rageSkullStripping_inputs(): outMasked3=dict(argstr='--outMasked3 %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), xDefaultMem=dict(argstr='-xDefaultMem %d', ), xMaxProcess=dict(argstr='-xMaxProcess %d', diff --git a/nipype/interfaces/mipav/tests/test_auto_JistBrainPartialVolumeFilter.py b/nipype/interfaces/mipav/tests/test_auto_JistBrainPartialVolumeFilter.py index 1cbc5802fc..7d14f83e2a 100644 --- a/nipype/interfaces/mipav/tests/test_auto_JistBrainPartialVolumeFilter.py +++ b/nipype/interfaces/mipav/tests/test_auto_JistBrainPartialVolumeFilter.py @@ -6,12 +6,6 @@ def test_JistBrainPartialVolumeFilter_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inInput=dict(argstr='--inInput %s', ), inPV=dict(argstr='--inPV %s', @@ -23,8 +17,6 @@ def test_JistBrainPartialVolumeFilter_inputs(): outPartial=dict(argstr='--outPartial %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), xDefaultMem=dict(argstr='-xDefaultMem %d', ), xMaxProcess=dict(argstr='-xMaxProcess %d', diff --git a/nipype/interfaces/mipav/tests/test_auto_JistCortexSurfaceMeshInflation.py b/nipype/interfaces/mipav/tests/test_auto_JistCortexSurfaceMeshInflation.py index d2f6c5e699..35b3714a14 100644 --- a/nipype/interfaces/mipav/tests/test_auto_JistCortexSurfaceMeshInflation.py +++ b/nipype/interfaces/mipav/tests/test_auto_JistCortexSurfaceMeshInflation.py @@ -6,12 +6,6 @@ def test_JistCortexSurfaceMeshInflation_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inLevelset=dict(argstr='--inLevelset %s', ), inLorentzian=dict(argstr='--inLorentzian %s', @@ -34,8 +28,6 @@ def test_JistCortexSurfaceMeshInflation_inputs(): outOriginal=dict(argstr='--outOriginal %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), xDefaultMem=dict(argstr='-xDefaultMem %d', ), xMaxProcess=dict(argstr='-xMaxProcess %d', diff --git a/nipype/interfaces/mipav/tests/test_auto_JistIntensityMp2rageMasking.py b/nipype/interfaces/mipav/tests/test_auto_JistIntensityMp2rageMasking.py index c96faa15d9..bf19468cd5 100644 --- a/nipype/interfaces/mipav/tests/test_auto_JistIntensityMp2rageMasking.py +++ b/nipype/interfaces/mipav/tests/test_auto_JistIntensityMp2rageMasking.py @@ -6,12 +6,6 @@ def test_JistIntensityMp2rageMasking_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inBackground=dict(argstr='--inBackground %s', ), inMasking=dict(argstr='--inMasking %s', @@ -38,8 +32,6 @@ def test_JistIntensityMp2rageMasking_inputs(): outSignal2=dict(argstr='--outSignal2 %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), xDefaultMem=dict(argstr='-xDefaultMem %d', ), xMaxProcess=dict(argstr='-xMaxProcess %d', diff --git a/nipype/interfaces/mipav/tests/test_auto_JistLaminarProfileCalculator.py b/nipype/interfaces/mipav/tests/test_auto_JistLaminarProfileCalculator.py index 2c38f444de..e9efab1eae 100644 --- a/nipype/interfaces/mipav/tests/test_auto_JistLaminarProfileCalculator.py +++ b/nipype/interfaces/mipav/tests/test_auto_JistLaminarProfileCalculator.py @@ -6,12 +6,6 @@ def test_JistLaminarProfileCalculator_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inIntensity=dict(argstr='--inIntensity %s', ), inMask=dict(argstr='--inMask %s', @@ -23,8 +17,6 @@ def test_JistLaminarProfileCalculator_inputs(): outResult=dict(argstr='--outResult %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), xDefaultMem=dict(argstr='-xDefaultMem %d', ), xMaxProcess=dict(argstr='-xMaxProcess %d', diff --git a/nipype/interfaces/mipav/tests/test_auto_JistLaminarProfileGeometry.py b/nipype/interfaces/mipav/tests/test_auto_JistLaminarProfileGeometry.py index 745f6c393d..1eccbf1a04 100644 --- a/nipype/interfaces/mipav/tests/test_auto_JistLaminarProfileGeometry.py +++ b/nipype/interfaces/mipav/tests/test_auto_JistLaminarProfileGeometry.py @@ -6,12 +6,6 @@ def test_JistLaminarProfileGeometry_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inProfile=dict(argstr='--inProfile %s', ), incomputed=dict(argstr='--incomputed %s', @@ -27,8 +21,6 @@ def test_JistLaminarProfileGeometry_inputs(): outResult=dict(argstr='--outResult %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), xDefaultMem=dict(argstr='-xDefaultMem %d', ), xMaxProcess=dict(argstr='-xMaxProcess %d', diff --git a/nipype/interfaces/mipav/tests/test_auto_JistLaminarProfileSampling.py b/nipype/interfaces/mipav/tests/test_auto_JistLaminarProfileSampling.py index 5468645673..8c82f168ca 100644 --- a/nipype/interfaces/mipav/tests/test_auto_JistLaminarProfileSampling.py +++ b/nipype/interfaces/mipav/tests/test_auto_JistLaminarProfileSampling.py @@ -6,12 +6,6 @@ def test_JistLaminarProfileSampling_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inCortex=dict(argstr='--inCortex %s', ), inIntensity=dict(argstr='--inIntensity %s', @@ -26,8 +20,6 @@ def test_JistLaminarProfileSampling_inputs(): outProfilemapped=dict(argstr='--outProfilemapped %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), xDefaultMem=dict(argstr='-xDefaultMem %d', ), xMaxProcess=dict(argstr='-xMaxProcess %d', diff --git a/nipype/interfaces/mipav/tests/test_auto_JistLaminarROIAveraging.py b/nipype/interfaces/mipav/tests/test_auto_JistLaminarROIAveraging.py index f0c3c4b7c0..8f43b4dec9 100644 --- a/nipype/interfaces/mipav/tests/test_auto_JistLaminarROIAveraging.py +++ b/nipype/interfaces/mipav/tests/test_auto_JistLaminarROIAveraging.py @@ -6,12 +6,6 @@ def test_JistLaminarROIAveraging_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inIntensity=dict(argstr='--inIntensity %s', ), inMask=dict(argstr='--inMask %s', @@ -25,8 +19,6 @@ def test_JistLaminarROIAveraging_inputs(): outROI3=dict(argstr='--outROI3 %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), xDefaultMem=dict(argstr='-xDefaultMem %d', ), xMaxProcess=dict(argstr='-xMaxProcess %d', diff --git a/nipype/interfaces/mipav/tests/test_auto_JistLaminarVolumetricLayering.py b/nipype/interfaces/mipav/tests/test_auto_JistLaminarVolumetricLayering.py index 6d681a96d9..95203ed9e7 100644 --- a/nipype/interfaces/mipav/tests/test_auto_JistLaminarVolumetricLayering.py +++ b/nipype/interfaces/mipav/tests/test_auto_JistLaminarVolumetricLayering.py @@ -6,12 +6,6 @@ def test_JistLaminarVolumetricLayering_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inInner=dict(argstr='--inInner %s', ), inLayering=dict(argstr='--inLayering %s', @@ -45,8 +39,6 @@ def test_JistLaminarVolumetricLayering_inputs(): outLayer=dict(argstr='--outLayer %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), xDefaultMem=dict(argstr='-xDefaultMem %d', ), xMaxProcess=dict(argstr='-xMaxProcess %d', diff --git a/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmImageCalculator.py b/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmImageCalculator.py index fc1388536e..771296e8be 100644 --- a/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmImageCalculator.py +++ b/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmImageCalculator.py @@ -6,12 +6,6 @@ def test_MedicAlgorithmImageCalculator_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inOperation=dict(argstr='--inOperation %s', ), inVolume=dict(argstr='--inVolume %s', @@ -23,8 +17,6 @@ def test_MedicAlgorithmImageCalculator_inputs(): outResult=dict(argstr='--outResult %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), xDefaultMem=dict(argstr='-xDefaultMem %d', ), xMaxProcess=dict(argstr='-xMaxProcess %d', diff --git a/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmLesionToads.py b/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmLesionToads.py index e38af9af0c..1977d04dd5 100644 --- a/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmLesionToads.py +++ b/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmLesionToads.py @@ -6,12 +6,6 @@ def test_MedicAlgorithmLesionToads_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inAtlas=dict(argstr='--inAtlas %s', ), inAtlas2=dict(argstr='--inAtlas2 %s', @@ -83,8 +77,6 @@ def test_MedicAlgorithmLesionToads_inputs(): outWM=dict(argstr='--outWM %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), xDefaultMem=dict(argstr='-xDefaultMem %d', ), xMaxProcess=dict(argstr='-xMaxProcess %d', diff --git a/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmMipavReorient.py b/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmMipavReorient.py index 5670f3a8a7..a0dd338048 100644 --- a/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmMipavReorient.py +++ b/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmMipavReorient.py @@ -6,12 +6,6 @@ def test_MedicAlgorithmMipavReorient_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inInterpolation=dict(argstr='--inInterpolation %s', ), inNew=dict(argstr='--inNew %s', @@ -36,8 +30,6 @@ def test_MedicAlgorithmMipavReorient_inputs(): outReoriented=dict(argstr='--outReoriented %s', sep=';', ), - terminal_output=dict(nohash=True, - ), xDefaultMem=dict(argstr='-xDefaultMem %d', ), xMaxProcess=dict(argstr='-xMaxProcess %d', diff --git a/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmN3.py b/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmN3.py index 261e64dcf8..b23191aead 100644 --- a/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmN3.py +++ b/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmN3.py @@ -6,12 +6,6 @@ def test_MedicAlgorithmN3_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inAutomatic=dict(argstr='--inAutomatic %s', ), inEnd=dict(argstr='--inEnd %f', @@ -38,8 +32,6 @@ def test_MedicAlgorithmN3_inputs(): outInhomogeneity2=dict(argstr='--outInhomogeneity2 %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), xDefaultMem=dict(argstr='-xDefaultMem %d', ), xMaxProcess=dict(argstr='-xMaxProcess %d', diff --git a/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmSPECTRE2010.py b/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmSPECTRE2010.py index ea90b9278a..d564684428 100644 --- a/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmSPECTRE2010.py +++ b/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmSPECTRE2010.py @@ -6,12 +6,6 @@ def test_MedicAlgorithmSPECTRE2010_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inApply=dict(argstr='--inApply %s', ), inAtlas=dict(argstr='--inAtlas %s', @@ -109,8 +103,6 @@ def test_MedicAlgorithmSPECTRE2010_inputs(): outd0=dict(argstr='--outd0 %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), xDefaultMem=dict(argstr='-xDefaultMem %d', ), xMaxProcess=dict(argstr='-xMaxProcess %d', diff --git a/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmThresholdToBinaryMask.py b/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmThresholdToBinaryMask.py index b2d4334063..ff2115de58 100644 --- a/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmThresholdToBinaryMask.py +++ b/nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmThresholdToBinaryMask.py @@ -6,12 +6,6 @@ def test_MedicAlgorithmThresholdToBinaryMask_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inLabel=dict(argstr='--inLabel %s', sep=';', ), @@ -26,8 +20,6 @@ def test_MedicAlgorithmThresholdToBinaryMask_inputs(): outBinary=dict(argstr='--outBinary %s', sep=';', ), - terminal_output=dict(nohash=True, - ), xDefaultMem=dict(argstr='-xDefaultMem %d', ), xMaxProcess=dict(argstr='-xMaxProcess %d', diff --git a/nipype/interfaces/mipav/tests/test_auto_RandomVol.py b/nipype/interfaces/mipav/tests/test_auto_RandomVol.py index adb9389a4a..c618d9bd8f 100644 --- a/nipype/interfaces/mipav/tests/test_auto_RandomVol.py +++ b/nipype/interfaces/mipav/tests/test_auto_RandomVol.py @@ -6,12 +6,6 @@ def test_RandomVol_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inField=dict(argstr='--inField %s', ), inLambda=dict(argstr='--inLambda %f', @@ -35,8 +29,6 @@ def test_RandomVol_inputs(): outRand1=dict(argstr='--outRand1 %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), xDefaultMem=dict(argstr='-xDefaultMem %d', ), xMaxProcess=dict(argstr='-xMaxProcess %d', diff --git a/nipype/interfaces/mne/tests/test_auto_WatershedBEM.py b/nipype/interfaces/mne/tests/test_auto_WatershedBEM.py index 58012fd268..81f3ef4f36 100644 --- a/nipype/interfaces/mne/tests/test_auto_WatershedBEM.py +++ b/nipype/interfaces/mne/tests/test_auto_WatershedBEM.py @@ -8,12 +8,6 @@ def test_WatershedBEM_inputs(): ), atlas_mode=dict(argstr='--atlas', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), overwrite=dict(argstr='--overwrite', usedefault=True, ), @@ -23,8 +17,6 @@ def test_WatershedBEM_inputs(): subjects_dir=dict(mandatory=True, usedefault=True, ), - terminal_output=dict(nohash=True, - ), volume=dict(argstr='--volume %s', usedefault=True, ), diff --git a/nipype/interfaces/mrtrix/tests/test_auto_ConstrainedSphericalDeconvolution.py b/nipype/interfaces/mrtrix/tests/test_auto_ConstrainedSphericalDeconvolution.py index 26eec439ec..2104a09415 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_ConstrainedSphericalDeconvolution.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_ConstrainedSphericalDeconvolution.py @@ -14,15 +14,9 @@ def test_ConstrainedSphericalDeconvolution_inputs(): encoding_file=dict(argstr='-grad %s', position=1, ), - environ=dict(nohash=True, - usedefault=True, - ), filter_file=dict(argstr='-filter %s', position=-2, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-3, @@ -47,8 +41,6 @@ def test_ConstrainedSphericalDeconvolution_inputs(): mandatory=True, position=-2, ), - terminal_output=dict(nohash=True, - ), threshold_value=dict(argstr='-threshold %s', ), ) diff --git a/nipype/interfaces/mrtrix/tests/test_auto_DWI2SphericalHarmonicsImage.py b/nipype/interfaces/mrtrix/tests/test_auto_DWI2SphericalHarmonicsImage.py index 29ccc7385f..1124a1cba7 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_DWI2SphericalHarmonicsImage.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_DWI2SphericalHarmonicsImage.py @@ -10,12 +10,6 @@ def test_DWI2SphericalHarmonicsImage_inputs(): mandatory=True, position=1, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-2, @@ -29,8 +23,6 @@ def test_DWI2SphericalHarmonicsImage_inputs(): genfile=True, position=-1, ), - terminal_output=dict(nohash=True, - ), ) inputs = DWI2SphericalHarmonicsImage._input_spec() diff --git a/nipype/interfaces/mrtrix/tests/test_auto_DWI2Tensor.py b/nipype/interfaces/mrtrix/tests/test_auto_DWI2Tensor.py index 891d33f9b8..63b3fffacb 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_DWI2Tensor.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_DWI2Tensor.py @@ -12,12 +12,6 @@ def test_DWI2Tensor_inputs(): encoding_file=dict(argstr='-grad %s', position=2, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), ignore_slice_by_volume=dict(argstr='-ignoreslices %s', position=2, sep=' ', @@ -39,8 +33,6 @@ def test_DWI2Tensor_inputs(): quiet=dict(argstr='-quiet', position=1, ), - terminal_output=dict(nohash=True, - ), ) inputs = DWI2Tensor._input_spec() diff --git a/nipype/interfaces/mrtrix/tests/test_auto_DiffusionTensorStreamlineTrack.py b/nipype/interfaces/mrtrix/tests/test_auto_DiffusionTensorStreamlineTrack.py index 306cb3545f..1b34fa1d2d 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_DiffusionTensorStreamlineTrack.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_DiffusionTensorStreamlineTrack.py @@ -13,9 +13,6 @@ def test_DiffusionTensorStreamlineTrack_inputs(): ), do_not_precompute=dict(argstr='-noprecomputed', ), - environ=dict(nohash=True, - usedefault=True, - ), exclude_file=dict(argstr='-exclude %s', xor=['exclude_file', 'exclude_spec'], ), @@ -29,9 +26,6 @@ def test_DiffusionTensorStreamlineTrack_inputs(): mandatory=True, position=-2, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-2, @@ -97,8 +91,6 @@ def test_DiffusionTensorStreamlineTrack_inputs(): ), stop=dict(argstr='-stop', ), - terminal_output=dict(nohash=True, - ), unidirectional=dict(argstr='-unidirectional', ), ) diff --git a/nipype/interfaces/mrtrix/tests/test_auto_Directions2Amplitude.py b/nipype/interfaces/mrtrix/tests/test_auto_Directions2Amplitude.py index 3a2fdca603..c6044d9b3f 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_Directions2Amplitude.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_Directions2Amplitude.py @@ -10,12 +10,6 @@ def test_Directions2Amplitude_inputs(): ), display_info=dict(argstr='-info', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-2, @@ -36,8 +30,6 @@ def test_Directions2Amplitude_inputs(): ), quiet_display=dict(argstr='-quiet', ), - terminal_output=dict(nohash=True, - ), ) inputs = Directions2Amplitude._input_spec() diff --git a/nipype/interfaces/mrtrix/tests/test_auto_Erode.py b/nipype/interfaces/mrtrix/tests/test_auto_Erode.py index f0d53bdac1..6bb4dc9749 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_Erode.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_Erode.py @@ -12,12 +12,6 @@ def test_Erode_inputs(): dilate=dict(argstr='-dilate', position=1, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-2, @@ -31,8 +25,6 @@ def test_Erode_inputs(): quiet=dict(argstr='-quiet', position=1, ), - terminal_output=dict(nohash=True, - ), ) inputs = Erode._input_spec() diff --git a/nipype/interfaces/mrtrix/tests/test_auto_EstimateResponseForSH.py b/nipype/interfaces/mrtrix/tests/test_auto_EstimateResponseForSH.py index 601822afdd..56c72ab0b4 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_EstimateResponseForSH.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_EstimateResponseForSH.py @@ -12,12 +12,6 @@ def test_EstimateResponseForSH_inputs(): mandatory=True, position=1, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-3, @@ -36,8 +30,6 @@ def test_EstimateResponseForSH_inputs(): ), quiet=dict(argstr='-quiet', ), - terminal_output=dict(nohash=True, - ), ) inputs = EstimateResponseForSH._input_spec() diff --git a/nipype/interfaces/mrtrix/tests/test_auto_FilterTracks.py b/nipype/interfaces/mrtrix/tests/test_auto_FilterTracks.py index 14cf64350d..261daf6be2 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_FilterTracks.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_FilterTracks.py @@ -9,9 +9,6 @@ def test_FilterTracks_inputs(): debug=dict(argstr='-debug', position=1, ), - environ=dict(nohash=True, - usedefault=True, - ), exclude_file=dict(argstr='-exclude %s', xor=['exclude_file', 'exclude_spec'], ), @@ -21,9 +18,6 @@ def test_FilterTracks_inputs(): units='mm', xor=['exclude_file', 'exclude_spec'], ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-2, @@ -53,8 +47,6 @@ def test_FilterTracks_inputs(): quiet=dict(argstr='-quiet', position=1, ), - terminal_output=dict(nohash=True, - ), ) inputs = FilterTracks._input_spec() diff --git a/nipype/interfaces/mrtrix/tests/test_auto_FindShPeaks.py b/nipype/interfaces/mrtrix/tests/test_auto_FindShPeaks.py index 613f9d7da3..43cc5d4627 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_FindShPeaks.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_FindShPeaks.py @@ -14,12 +14,6 @@ def test_FindShPeaks_inputs(): ), display_info=dict(argstr='-info', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-3, @@ -42,8 +36,6 @@ def test_FindShPeaks_inputs(): ), quiet_display=dict(argstr='-quiet', ), - terminal_output=dict(nohash=True, - ), ) inputs = FindShPeaks._input_spec() diff --git a/nipype/interfaces/mrtrix/tests/test_auto_GenerateDirections.py b/nipype/interfaces/mrtrix/tests/test_auto_GenerateDirections.py index d4fb2c77ee..9c32884b97 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_GenerateDirections.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_GenerateDirections.py @@ -10,12 +10,6 @@ def test_GenerateDirections_inputs(): ), display_info=dict(argstr='-info', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), niter=dict(argstr='-niter %s', ), num_dirs=dict(argstr='%s', @@ -32,8 +26,6 @@ def test_GenerateDirections_inputs(): ), quiet_display=dict(argstr='-quiet', ), - terminal_output=dict(nohash=True, - ), ) inputs = GenerateDirections._input_spec() diff --git a/nipype/interfaces/mrtrix/tests/test_auto_GenerateWhiteMatterMask.py b/nipype/interfaces/mrtrix/tests/test_auto_GenerateWhiteMatterMask.py index 012db8b7f8..6e57789400 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_GenerateWhiteMatterMask.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_GenerateWhiteMatterMask.py @@ -14,12 +14,6 @@ def test_GenerateWhiteMatterMask_inputs(): mandatory=True, position=1, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-3, @@ -30,8 +24,6 @@ def test_GenerateWhiteMatterMask_inputs(): genfile=True, position=-1, ), - terminal_output=dict(nohash=True, - ), ) inputs = GenerateWhiteMatterMask._input_spec() diff --git a/nipype/interfaces/mrtrix/tests/test_auto_MRConvert.py b/nipype/interfaces/mrtrix/tests/test_auto_MRConvert.py index c069107a5f..cf75765206 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_MRConvert.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_MRConvert.py @@ -6,9 +6,6 @@ def test_MRConvert_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), extension=dict(position=2, usedefault=True, ), @@ -19,9 +16,6 @@ def test_MRConvert_inputs(): position=2, sep=',', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-2, @@ -50,8 +44,6 @@ def test_MRConvert_inputs(): position=3, units='mm', ), - terminal_output=dict(nohash=True, - ), voxel_dims=dict(argstr='-vox %s', position=3, sep=',', diff --git a/nipype/interfaces/mrtrix/tests/test_auto_MRMultiply.py b/nipype/interfaces/mrtrix/tests/test_auto_MRMultiply.py index 22ca4cf25d..59a788867f 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_MRMultiply.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_MRMultiply.py @@ -9,12 +9,6 @@ def test_MRMultiply_inputs(): debug=dict(argstr='-debug', position=1, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_files=dict(argstr='%s', mandatory=True, position=-2, @@ -26,8 +20,6 @@ def test_MRMultiply_inputs(): quiet=dict(argstr='-quiet', position=1, ), - terminal_output=dict(nohash=True, - ), ) inputs = MRMultiply._input_spec() diff --git a/nipype/interfaces/mrtrix/tests/test_auto_MRTransform.py b/nipype/interfaces/mrtrix/tests/test_auto_MRTransform.py index 9bbc7d22dc..1d0751fcf1 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_MRTransform.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_MRTransform.py @@ -9,15 +9,9 @@ def test_MRTransform_inputs(): debug=dict(argstr='-debug', position=1, ), - environ=dict(nohash=True, - usedefault=True, - ), flip_x=dict(argstr='-flipx', position=1, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_files=dict(argstr='%s', mandatory=True, position=-2, @@ -41,8 +35,6 @@ def test_MRTransform_inputs(): template_image=dict(argstr='-template %s', position=1, ), - terminal_output=dict(nohash=True, - ), transformation_file=dict(argstr='-transform %s', position=1, ), diff --git a/nipype/interfaces/mrtrix/tests/test_auto_MRTrixInfo.py b/nipype/interfaces/mrtrix/tests/test_auto_MRTrixInfo.py index 85a2bda311..a245b5caf6 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_MRTrixInfo.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_MRTrixInfo.py @@ -6,18 +6,10 @@ def test_MRTrixInfo_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-2, ), - terminal_output=dict(nohash=True, - ), ) inputs = MRTrixInfo._input_spec() diff --git a/nipype/interfaces/mrtrix/tests/test_auto_MRTrixViewer.py b/nipype/interfaces/mrtrix/tests/test_auto_MRTrixViewer.py index cf3deeb7e4..e935043c6f 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_MRTrixViewer.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_MRTrixViewer.py @@ -9,12 +9,6 @@ def test_MRTrixViewer_inputs(): debug=dict(argstr='-debug', position=1, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_files=dict(argstr='%s', mandatory=True, position=-2, @@ -22,8 +16,6 @@ def test_MRTrixViewer_inputs(): quiet=dict(argstr='-quiet', position=1, ), - terminal_output=dict(nohash=True, - ), ) inputs = MRTrixViewer._input_spec() diff --git a/nipype/interfaces/mrtrix/tests/test_auto_MedianFilter3D.py b/nipype/interfaces/mrtrix/tests/test_auto_MedianFilter3D.py index d4fd2ec99b..6505623455 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_MedianFilter3D.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_MedianFilter3D.py @@ -9,12 +9,6 @@ def test_MedianFilter3D_inputs(): debug=dict(argstr='-debug', position=1, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-2, @@ -26,8 +20,6 @@ def test_MedianFilter3D_inputs(): quiet=dict(argstr='-quiet', position=1, ), - terminal_output=dict(nohash=True, - ), ) inputs = MedianFilter3D._input_spec() diff --git a/nipype/interfaces/mrtrix/tests/test_auto_ProbabilisticSphericallyDeconvolutedStreamlineTrack.py b/nipype/interfaces/mrtrix/tests/test_auto_ProbabilisticSphericallyDeconvolutedStreamlineTrack.py index 7d5402ad2d..2914e02590 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_ProbabilisticSphericallyDeconvolutedStreamlineTrack.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_ProbabilisticSphericallyDeconvolutedStreamlineTrack.py @@ -13,9 +13,6 @@ def test_ProbabilisticSphericallyDeconvolutedStreamlineTrack_inputs(): ), do_not_precompute=dict(argstr='-noprecomputed', ), - environ=dict(nohash=True, - usedefault=True, - ), exclude_file=dict(argstr='-exclude %s', xor=['exclude_file', 'exclude_spec'], ), @@ -25,9 +22,6 @@ def test_ProbabilisticSphericallyDeconvolutedStreamlineTrack_inputs(): units='mm', xor=['exclude_file', 'exclude_spec'], ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-2, @@ -95,8 +89,6 @@ def test_ProbabilisticSphericallyDeconvolutedStreamlineTrack_inputs(): ), stop=dict(argstr='-stop', ), - terminal_output=dict(nohash=True, - ), unidirectional=dict(argstr='-unidirectional', ), ) diff --git a/nipype/interfaces/mrtrix/tests/test_auto_SphericallyDeconvolutedStreamlineTrack.py b/nipype/interfaces/mrtrix/tests/test_auto_SphericallyDeconvolutedStreamlineTrack.py index 4ee50a1aa6..f20d05a870 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_SphericallyDeconvolutedStreamlineTrack.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_SphericallyDeconvolutedStreamlineTrack.py @@ -13,9 +13,6 @@ def test_SphericallyDeconvolutedStreamlineTrack_inputs(): ), do_not_precompute=dict(argstr='-noprecomputed', ), - environ=dict(nohash=True, - usedefault=True, - ), exclude_file=dict(argstr='-exclude %s', xor=['exclude_file', 'exclude_spec'], ), @@ -25,9 +22,6 @@ def test_SphericallyDeconvolutedStreamlineTrack_inputs(): units='mm', xor=['exclude_file', 'exclude_spec'], ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-2, @@ -93,8 +87,6 @@ def test_SphericallyDeconvolutedStreamlineTrack_inputs(): ), stop=dict(argstr='-stop', ), - terminal_output=dict(nohash=True, - ), unidirectional=dict(argstr='-unidirectional', ), ) diff --git a/nipype/interfaces/mrtrix/tests/test_auto_StreamlineTrack.py b/nipype/interfaces/mrtrix/tests/test_auto_StreamlineTrack.py index 051bb70c0c..1e3ae0252a 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_StreamlineTrack.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_StreamlineTrack.py @@ -13,9 +13,6 @@ def test_StreamlineTrack_inputs(): ), do_not_precompute=dict(argstr='-noprecomputed', ), - environ=dict(nohash=True, - usedefault=True, - ), exclude_file=dict(argstr='-exclude %s', xor=['exclude_file', 'exclude_spec'], ), @@ -25,9 +22,6 @@ def test_StreamlineTrack_inputs(): units='mm', xor=['exclude_file', 'exclude_spec'], ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-2, @@ -93,8 +87,6 @@ def test_StreamlineTrack_inputs(): ), stop=dict(argstr='-stop', ), - terminal_output=dict(nohash=True, - ), unidirectional=dict(argstr='-unidirectional', ), ) diff --git a/nipype/interfaces/mrtrix/tests/test_auto_Tensor2ApparentDiffusion.py b/nipype/interfaces/mrtrix/tests/test_auto_Tensor2ApparentDiffusion.py index e0d0b8931b..5963d50531 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_Tensor2ApparentDiffusion.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_Tensor2ApparentDiffusion.py @@ -9,12 +9,6 @@ def test_Tensor2ApparentDiffusion_inputs(): debug=dict(argstr='-debug', position=1, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-2, @@ -26,8 +20,6 @@ def test_Tensor2ApparentDiffusion_inputs(): quiet=dict(argstr='-quiet', position=1, ), - terminal_output=dict(nohash=True, - ), ) inputs = Tensor2ApparentDiffusion._input_spec() diff --git a/nipype/interfaces/mrtrix/tests/test_auto_Tensor2FractionalAnisotropy.py b/nipype/interfaces/mrtrix/tests/test_auto_Tensor2FractionalAnisotropy.py index 5256d5027d..e1710f54ee 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_Tensor2FractionalAnisotropy.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_Tensor2FractionalAnisotropy.py @@ -9,12 +9,6 @@ def test_Tensor2FractionalAnisotropy_inputs(): debug=dict(argstr='-debug', position=1, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-2, @@ -26,8 +20,6 @@ def test_Tensor2FractionalAnisotropy_inputs(): quiet=dict(argstr='-quiet', position=1, ), - terminal_output=dict(nohash=True, - ), ) inputs = Tensor2FractionalAnisotropy._input_spec() diff --git a/nipype/interfaces/mrtrix/tests/test_auto_Tensor2Vector.py b/nipype/interfaces/mrtrix/tests/test_auto_Tensor2Vector.py index c9f63b7a3a..3c532ee53f 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_Tensor2Vector.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_Tensor2Vector.py @@ -9,12 +9,6 @@ def test_Tensor2Vector_inputs(): debug=dict(argstr='-debug', position=1, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-2, @@ -26,8 +20,6 @@ def test_Tensor2Vector_inputs(): quiet=dict(argstr='-quiet', position=1, ), - terminal_output=dict(nohash=True, - ), ) inputs = Tensor2Vector._input_spec() diff --git a/nipype/interfaces/mrtrix/tests/test_auto_Threshold.py b/nipype/interfaces/mrtrix/tests/test_auto_Threshold.py index 9c0cb97eaa..af1aface53 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_Threshold.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_Threshold.py @@ -11,12 +11,6 @@ def test_Threshold_inputs(): debug=dict(argstr='-debug', position=1, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-2, @@ -36,8 +30,6 @@ def test_Threshold_inputs(): replace_zeros_with_NaN=dict(argstr='-nan', position=1, ), - terminal_output=dict(nohash=True, - ), ) inputs = Threshold._input_spec() diff --git a/nipype/interfaces/mrtrix/tests/test_auto_Tracks2Prob.py b/nipype/interfaces/mrtrix/tests/test_auto_Tracks2Prob.py index 3b09add534..0657c9c721 100644 --- a/nipype/interfaces/mrtrix/tests/test_auto_Tracks2Prob.py +++ b/nipype/interfaces/mrtrix/tests/test_auto_Tracks2Prob.py @@ -9,15 +9,9 @@ def test_Tracks2Prob_inputs(): colour=dict(argstr='-colour', position=3, ), - environ=dict(nohash=True, - usedefault=True, - ), fraction=dict(argstr='-fraction', position=3, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-2, @@ -36,8 +30,6 @@ def test_Tracks2Prob_inputs(): template_file=dict(argstr='-template %s', position=1, ), - terminal_output=dict(nohash=True, - ), voxel_dims=dict(argstr='-vox %s', position=2, sep=',', diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_ACTPrepareFSL.py b/nipype/interfaces/mrtrix3/tests/test_auto_ACTPrepareFSL.py index 7e290fce82..685f72d50b 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_ACTPrepareFSL.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_ACTPrepareFSL.py @@ -6,12 +6,6 @@ def test_ACTPrepareFSL_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-2, @@ -21,8 +15,6 @@ def test_ACTPrepareFSL_inputs(): position=-1, usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = ACTPrepareFSL._input_spec() diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_BrainMask.py b/nipype/interfaces/mrtrix3/tests/test_auto_BrainMask.py index 3560529e37..28b48c1fd9 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_BrainMask.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_BrainMask.py @@ -8,16 +8,10 @@ def test_BrainMask_inputs(): ), bval_scale=dict(argstr='-bvalue_scaling %s', ), - environ=dict(nohash=True, - usedefault=True, - ), grad_file=dict(argstr='-grad %s', ), grad_fsl=dict(argstr='-fslgrad %s %s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_bval=dict(), in_bvec=dict(argstr='-fslgrad %s %s', ), @@ -33,8 +27,6 @@ def test_BrainMask_inputs(): position=-1, usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = BrainMask._input_spec() diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_BuildConnectome.py b/nipype/interfaces/mrtrix3/tests/test_auto_BuildConnectome.py index 4943ddfe26..7b8b2deb43 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_BuildConnectome.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_BuildConnectome.py @@ -6,12 +6,6 @@ def test_BuildConnectome_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-3, @@ -41,8 +35,6 @@ def test_BuildConnectome_inputs(): ), search_reverse=dict(argstr='-assignment_reverse_search %f', ), - terminal_output=dict(nohash=True, - ), vox_lookup=dict(argstr='-assignment_voxel_lookup', ), zero_diagonal=dict(argstr='-zero_diagonal', diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_ComputeTDI.py b/nipype/interfaces/mrtrix3/tests/test_auto_ComputeTDI.py index c266def027..cf9bf001cc 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_ComputeTDI.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_ComputeTDI.py @@ -14,14 +14,8 @@ def test_ComputeTDI_inputs(): ), ends_only=dict(argstr='-ends_only', ), - environ=dict(nohash=True, - usedefault=True, - ), fwhm_tck=dict(argstr='-fwhm_tck %f', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-2, @@ -49,8 +43,6 @@ def test_ComputeTDI_inputs(): ), tck_weights=dict(argstr='-tck_weights_in %s', ), - terminal_output=dict(nohash=True, - ), upsample=dict(argstr='-upsample %d', ), use_dec=dict(argstr='-dec', diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_EstimateFOD.py b/nipype/interfaces/mrtrix3/tests/test_auto_EstimateFOD.py index 03e6621541..caa84b328d 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_EstimateFOD.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_EstimateFOD.py @@ -8,16 +8,10 @@ def test_EstimateFOD_inputs(): ), bval_scale=dict(argstr='-bvalue_scaling %s', ), - environ=dict(nohash=True, - usedefault=True, - ), grad_file=dict(argstr='-grad %s', ), grad_fsl=dict(argstr='-fslgrad %s %s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_bval=dict(), in_bvec=dict(argstr='-fslgrad %s %s', ), @@ -52,8 +46,6 @@ def test_EstimateFOD_inputs(): shell=dict(argstr='-shell %s', sep=',', ), - terminal_output=dict(nohash=True, - ), thres=dict(argstr='-threshold %f', ), ) diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_FitTensor.py b/nipype/interfaces/mrtrix3/tests/test_auto_FitTensor.py index 395e5add01..2d9a9f758c 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_FitTensor.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_FitTensor.py @@ -8,16 +8,10 @@ def test_FitTensor_inputs(): ), bval_scale=dict(argstr='-bvalue_scaling %s', ), - environ=dict(nohash=True, - usedefault=True, - ), grad_file=dict(argstr='-grad %s', ), grad_fsl=dict(argstr='-fslgrad %s %s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_bval=dict(), in_bvec=dict(argstr='-fslgrad %s %s', ), @@ -39,8 +33,6 @@ def test_FitTensor_inputs(): ), reg_term=dict(argstr='-regularisation %f', ), - terminal_output=dict(nohash=True, - ), ) inputs = FitTensor._input_spec() diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_Generate5tt.py b/nipype/interfaces/mrtrix3/tests/test_auto_Generate5tt.py index b27fa87490..6f5a76e9f1 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_Generate5tt.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_Generate5tt.py @@ -6,12 +6,6 @@ def test_Generate5tt_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_fast=dict(argstr='%s', mandatory=True, position=-3, @@ -24,8 +18,6 @@ def test_Generate5tt_inputs(): position=-1, usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = Generate5tt._input_spec() diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_LabelConfig.py b/nipype/interfaces/mrtrix3/tests/test_auto_LabelConfig.py index add9afb8cb..d2ad2c7a89 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_LabelConfig.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_LabelConfig.py @@ -6,12 +6,6 @@ def test_LabelConfig_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_config=dict(argstr='%s', position=-2, ), @@ -37,8 +31,6 @@ def test_LabelConfig_inputs(): ), spine=dict(argstr='-spine %s', ), - terminal_output=dict(nohash=True, - ), ) inputs = LabelConfig._input_spec() diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_MRTrix3Base.py b/nipype/interfaces/mrtrix3/tests/test_auto_MRTrix3Base.py index afe3f8fd40..abe18f0000 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_MRTrix3Base.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_MRTrix3Base.py @@ -6,14 +6,6 @@ def test_MRTrix3Base_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), - terminal_output=dict(nohash=True, - ), ) inputs = MRTrix3Base._input_spec() diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_Mesh2PVE.py b/nipype/interfaces/mrtrix3/tests/test_auto_Mesh2PVE.py index 15f94a0a22..61b7ebb65b 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_Mesh2PVE.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_Mesh2PVE.py @@ -6,12 +6,6 @@ def test_Mesh2PVE_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-3, @@ -27,8 +21,6 @@ def test_Mesh2PVE_inputs(): mandatory=True, position=-2, ), - terminal_output=dict(nohash=True, - ), ) inputs = Mesh2PVE._input_spec() diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_ReplaceFSwithFIRST.py b/nipype/interfaces/mrtrix3/tests/test_auto_ReplaceFSwithFIRST.py index 148b60d589..541296651c 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_ReplaceFSwithFIRST.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_ReplaceFSwithFIRST.py @@ -6,12 +6,6 @@ def test_ReplaceFSwithFIRST_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_config=dict(argstr='%s', position=-2, ), @@ -28,8 +22,6 @@ def test_ReplaceFSwithFIRST_inputs(): position=-1, usedefault=True, ), - terminal_output=dict(nohash=True, - ), ) inputs = ReplaceFSwithFIRST._input_spec() diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_ResponseSD.py b/nipype/interfaces/mrtrix3/tests/test_auto_ResponseSD.py index 75247ac875..f8489b0249 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_ResponseSD.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_ResponseSD.py @@ -10,16 +10,10 @@ def test_ResponseSD_inputs(): ), disp_mult=dict(argstr='-dispersion_multiplier %f', ), - environ=dict(nohash=True, - usedefault=True, - ), grad_file=dict(argstr='-grad %s', ), grad_fsl=dict(argstr='-fslgrad %s %s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_bval=dict(), in_bvec=dict(argstr='-fslgrad %s %s', ), @@ -50,8 +44,6 @@ def test_ResponseSD_inputs(): shell=dict(argstr='-shell %s', sep=',', ), - terminal_output=dict(nohash=True, - ), test_all=dict(argstr='-test_all', ), vol_ratio=dict(argstr='-volume_ratio %f', diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_TCK2VTK.py b/nipype/interfaces/mrtrix3/tests/test_auto_TCK2VTK.py index cbd6ccbbc9..d7d7f2f4e4 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_TCK2VTK.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_TCK2VTK.py @@ -6,12 +6,6 @@ def test_TCK2VTK_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-2, @@ -25,8 +19,6 @@ def test_TCK2VTK_inputs(): ), reference=dict(argstr='-image %s', ), - terminal_output=dict(nohash=True, - ), voxel=dict(argstr='-image %s', ), ) diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_TensorMetrics.py b/nipype/interfaces/mrtrix3/tests/test_auto_TensorMetrics.py index 822ad63710..bce0e23a4c 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_TensorMetrics.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_TensorMetrics.py @@ -9,12 +9,6 @@ def test_TensorMetrics_inputs(): component=dict(argstr='-num %s', sep=',', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='%s', mandatory=True, position=-1, @@ -31,8 +25,6 @@ def test_TensorMetrics_inputs(): ), out_fa=dict(argstr='-fa %s', ), - terminal_output=dict(nohash=True, - ), ) inputs = TensorMetrics._input_spec() diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_Tractography.py b/nipype/interfaces/mrtrix3/tests/test_auto_Tractography.py index c028a31e69..dfbea9dc6d 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_Tractography.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_Tractography.py @@ -25,16 +25,10 @@ def test_Tractography_inputs(): ), downsample=dict(argstr='-downsample %f', ), - environ=dict(nohash=True, - usedefault=True, - ), grad_file=dict(argstr='-grad %s', ), grad_fsl=dict(argstr='-fslgrad %s %s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_bval=dict(), in_bvec=dict(argstr='-fslgrad %s %s', ), @@ -101,8 +95,6 @@ def test_Tractography_inputs(): ), stop=dict(argstr='-stop', ), - terminal_output=dict(nohash=True, - ), unidirectional=dict(argstr='-unidirectional', ), use_rk4=dict(argstr='-rk4', diff --git a/nipype/interfaces/nipy/tests/test_auto_ComputeMask.py b/nipype/interfaces/nipy/tests/test_auto_ComputeMask.py index aea0133c88..0e5b9eb1b8 100644 --- a/nipype/interfaces/nipy/tests/test_auto_ComputeMask.py +++ b/nipype/interfaces/nipy/tests/test_auto_ComputeMask.py @@ -6,9 +6,6 @@ def test_ComputeMask_inputs(): input_map = dict(M=dict(), cc=dict(), - ignore_exception=dict(nohash=True, - usedefault=True, - ), m=dict(), mean_volume=dict(mandatory=True, ), diff --git a/nipype/interfaces/nipy/tests/test_auto_EstimateContrast.py b/nipype/interfaces/nipy/tests/test_auto_EstimateContrast.py index 73245ddd34..b57af2c429 100644 --- a/nipype/interfaces/nipy/tests/test_auto_EstimateContrast.py +++ b/nipype/interfaces/nipy/tests/test_auto_EstimateContrast.py @@ -14,9 +14,6 @@ def test_EstimateContrast_inputs(): ), dof=dict(mandatory=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), mask=dict(), nvbeta=dict(mandatory=True, ), diff --git a/nipype/interfaces/nipy/tests/test_auto_FitGLM.py b/nipype/interfaces/nipy/tests/test_auto_FitGLM.py index 2f3d4acb78..ad20a6b23d 100644 --- a/nipype/interfaces/nipy/tests/test_auto_FitGLM.py +++ b/nipype/interfaces/nipy/tests/test_auto_FitGLM.py @@ -10,9 +10,6 @@ def test_FitGLM_inputs(): ), hrf_model=dict(usedefault=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), mask=dict(), method=dict(usedefault=True, ), diff --git a/nipype/interfaces/nipy/tests/test_auto_FmriRealign4d.py b/nipype/interfaces/nipy/tests/test_auto_FmriRealign4d.py index 08ba592e44..1daf519313 100644 --- a/nipype/interfaces/nipy/tests/test_auto_FmriRealign4d.py +++ b/nipype/interfaces/nipy/tests/test_auto_FmriRealign4d.py @@ -6,9 +6,6 @@ def test_FmriRealign4d_inputs(): input_map = dict(between_loops=dict(usedefault=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(mandatory=True, ), loops=dict(usedefault=True, diff --git a/nipype/interfaces/nipy/tests/test_auto_Similarity.py b/nipype/interfaces/nipy/tests/test_auto_Similarity.py index 0b386baba5..e597414b3a 100644 --- a/nipype/interfaces/nipy/tests/test_auto_Similarity.py +++ b/nipype/interfaces/nipy/tests/test_auto_Similarity.py @@ -4,10 +4,7 @@ def test_Similarity_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - mask1=dict(), + input_map = dict(mask1=dict(), mask2=dict(), metric=dict(usedefault=True, ), diff --git a/nipype/interfaces/nipy/tests/test_auto_SpaceTimeRealigner.py b/nipype/interfaces/nipy/tests/test_auto_SpaceTimeRealigner.py index 59c568e87b..5a33910a5c 100644 --- a/nipype/interfaces/nipy/tests/test_auto_SpaceTimeRealigner.py +++ b/nipype/interfaces/nipy/tests/test_auto_SpaceTimeRealigner.py @@ -4,10 +4,7 @@ def test_SpaceTimeRealigner_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - in_file=dict(mandatory=True, + input_map = dict(in_file=dict(mandatory=True, min_ver='0.4.0.dev', ), slice_info=dict(requires=['slice_times'], diff --git a/nipype/interfaces/nipy/tests/test_auto_Trim.py b/nipype/interfaces/nipy/tests/test_auto_Trim.py index 71e7e729f7..d43ee09c56 100644 --- a/nipype/interfaces/nipy/tests/test_auto_Trim.py +++ b/nipype/interfaces/nipy/tests/test_auto_Trim.py @@ -8,9 +8,6 @@ def test_Trim_inputs(): ), end_index=dict(usedefault=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(mandatory=True, ), out_file=dict(), diff --git a/nipype/interfaces/nitime/tests/test_auto_CoherenceAnalyzer.py b/nipype/interfaces/nitime/tests/test_auto_CoherenceAnalyzer.py index 08fa8c92ae..200d3d8f95 100644 --- a/nipype/interfaces/nitime/tests/test_auto_CoherenceAnalyzer.py +++ b/nipype/interfaces/nitime/tests/test_auto_CoherenceAnalyzer.py @@ -11,9 +11,6 @@ def test_CoherenceAnalyzer_inputs(): ), frequency_range=dict(usedefault=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_TS=dict(), in_file=dict(requires=('TR',), ), diff --git a/nipype/interfaces/semtools/brains/tests/test_auto_BRAINSPosteriorToContinuousClass.py b/nipype/interfaces/semtools/brains/tests/test_auto_BRAINSPosteriorToContinuousClass.py index 4eeb5855d4..a6fadf11ab 100644 --- a/nipype/interfaces/semtools/brains/tests/test_auto_BRAINSPosteriorToContinuousClass.py +++ b/nipype/interfaces/semtools/brains/tests/test_auto_BRAINSPosteriorToContinuousClass.py @@ -6,12 +6,6 @@ def test_BRAINSPosteriorToContinuousClass_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputBasalGmVolume=dict(argstr='--inputBasalGmVolume %s', ), inputCrblGmVolume=dict(argstr='--inputCrblGmVolume %s', @@ -29,8 +23,6 @@ def test_BRAINSPosteriorToContinuousClass_inputs(): outputVolume=dict(argstr='--outputVolume %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = BRAINSPosteriorToContinuousClass._input_spec() diff --git a/nipype/interfaces/semtools/brains/tests/test_auto_BRAINSTalairach.py b/nipype/interfaces/semtools/brains/tests/test_auto_BRAINSTalairach.py index 564af8d1c6..4227e82583 100644 --- a/nipype/interfaces/semtools/brains/tests/test_auto_BRAINSTalairach.py +++ b/nipype/interfaces/semtools/brains/tests/test_auto_BRAINSTalairach.py @@ -26,12 +26,6 @@ def test_BRAINSTalairach_inputs(): ), args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='--inputVolume %s', ), outputBox=dict(argstr='--outputBox %s', @@ -40,8 +34,6 @@ def test_BRAINSTalairach_inputs(): outputGrid=dict(argstr='--outputGrid %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = BRAINSTalairach._input_spec() diff --git a/nipype/interfaces/semtools/brains/tests/test_auto_BRAINSTalairachMask.py b/nipype/interfaces/semtools/brains/tests/test_auto_BRAINSTalairachMask.py index c38aea861d..b6da22b951 100644 --- a/nipype/interfaces/semtools/brains/tests/test_auto_BRAINSTalairachMask.py +++ b/nipype/interfaces/semtools/brains/tests/test_auto_BRAINSTalairachMask.py @@ -6,16 +6,10 @@ def test_BRAINSTalairachMask_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), expand=dict(argstr='--expand ', ), hemisphereMode=dict(argstr='--hemisphereMode %s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='--inputVolume %s', ), outputVolume=dict(argstr='--outputVolume %s', @@ -25,8 +19,6 @@ def test_BRAINSTalairachMask_inputs(): ), talairachParameters=dict(argstr='--talairachParameters %s', ), - terminal_output=dict(nohash=True, - ), ) inputs = BRAINSTalairachMask._input_spec() diff --git a/nipype/interfaces/semtools/brains/tests/test_auto_HistogramMatchingFilter.py b/nipype/interfaces/semtools/brains/tests/test_auto_HistogramMatchingFilter.py index beb5b800ca..1b9bf81d43 100644 --- a/nipype/interfaces/semtools/brains/tests/test_auto_HistogramMatchingFilter.py +++ b/nipype/interfaces/semtools/brains/tests/test_auto_HistogramMatchingFilter.py @@ -6,14 +6,8 @@ def test_HistogramMatchingFilter_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), histogramAlgorithm=dict(argstr='--histogramAlgorithm %s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputBinaryVolume=dict(argstr='--inputBinaryVolume %s', ), inputVolume=dict(argstr='--inputVolume %s', @@ -29,8 +23,6 @@ def test_HistogramMatchingFilter_inputs(): ), referenceVolume=dict(argstr='--referenceVolume %s', ), - terminal_output=dict(nohash=True, - ), verbose=dict(argstr='--verbose ', ), writeHistogram=dict(argstr='--writeHistogram %s', diff --git a/nipype/interfaces/semtools/brains/tests/test_auto_SimilarityIndex.py b/nipype/interfaces/semtools/brains/tests/test_auto_SimilarityIndex.py index 2c9b35f032..463d92eaa0 100644 --- a/nipype/interfaces/semtools/brains/tests/test_auto_SimilarityIndex.py +++ b/nipype/interfaces/semtools/brains/tests/test_auto_SimilarityIndex.py @@ -8,18 +8,10 @@ def test_SimilarityIndex_inputs(): ), args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputManualVolume=dict(argstr='--inputManualVolume %s', ), outputCSVFilename=dict(argstr='--outputCSVFilename %s', ), - terminal_output=dict(nohash=True, - ), thresholdInterval=dict(argstr='--thresholdInterval %f', ), ) diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_DWIConvert.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_DWIConvert.py index cf69f6dc4d..a8facba396 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_DWIConvert.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_DWIConvert.py @@ -8,9 +8,6 @@ def test_DWIConvert_inputs(): ), conversionMode=dict(argstr='--conversionMode %s', ), - environ=dict(nohash=True, - usedefault=True, - ), fMRI=dict(argstr='--fMRI ', ), fslNIFTIFile=dict(argstr='--fslNIFTIFile %s', @@ -18,9 +15,6 @@ def test_DWIConvert_inputs(): gradientVectorFile=dict(argstr='--gradientVectorFile %s', hash_files=False, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputBValues=dict(argstr='--inputBValues %s', ), inputBVectors=dict(argstr='--inputBVectors %s', @@ -43,8 +37,6 @@ def test_DWIConvert_inputs(): ), smallGradientThreshold=dict(argstr='--smallGradientThreshold %f', ), - terminal_output=dict(nohash=True, - ), useBMatrixGradientDirections=dict(argstr='--useBMatrixGradientDirections ', ), useIdentityMeaseurementFrame=dict(argstr='--useIdentityMeaseurementFrame ', diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_compareTractInclusion.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_compareTractInclusion.py index 394412a291..8c9b0ea737 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_compareTractInclusion.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_compareTractInclusion.py @@ -8,20 +8,12 @@ def test_compareTractInclusion_inputs(): ), closeness=dict(argstr='--closeness %f', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), numberOfPoints=dict(argstr='--numberOfPoints %d', ), numberOfThreads=dict(argstr='--numberOfThreads %d', ), standardFiber=dict(argstr='--standardFiber %s', ), - terminal_output=dict(nohash=True, - ), testFiber=dict(argstr='--testFiber %s', ), testForBijection=dict(argstr='--testForBijection ', diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_dtiaverage.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_dtiaverage.py index 63d92d0c78..6b9dd9303e 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_dtiaverage.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_dtiaverage.py @@ -8,19 +8,11 @@ def test_dtiaverage_inputs(): ), args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputs=dict(argstr='--inputs %s...', ), tensor_output=dict(argstr='--tensor_output %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), verbose=dict(argstr='--verbose ', ), ) diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_dtiestim.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_dtiestim.py index cc2cf41a7c..3ed8c89ece 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_dtiestim.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_dtiestim.py @@ -25,15 +25,9 @@ def test_dtiestim_inputs(): ), dwi_image=dict(argstr='--dwi_image %s', ), - environ=dict(nohash=True, - usedefault=True, - ), idwi=dict(argstr='--idwi %s', hash_files=False, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), method=dict(argstr='--method %s', ), shiftNeg=dict(argstr='--shiftNeg ', @@ -47,8 +41,6 @@ def test_dtiestim_inputs(): tensor_output=dict(argstr='--tensor_output %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), threshold=dict(argstr='--threshold %d', ), verbose=dict(argstr='--verbose ', diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_dtiprocess.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_dtiprocess.py index b9625179d3..df0ff674c2 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_dtiprocess.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_dtiprocess.py @@ -25,9 +25,6 @@ def test_dtiprocess_inputs(): ), dti_image=dict(argstr='--dti_image %s', ), - environ=dict(nohash=True, - usedefault=True, - ), fa_gradient_output=dict(argstr='--fa_gradient_output %s', hash_files=False, ), @@ -44,9 +41,6 @@ def test_dtiprocess_inputs(): ), hField=dict(argstr='--hField ', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), interpolation=dict(argstr='--interpolation %s', ), lambda1_output=dict(argstr='--lambda1_output %s', @@ -83,8 +77,6 @@ def test_dtiprocess_inputs(): ), sigma=dict(argstr='--sigma %f', ), - terminal_output=dict(nohash=True, - ), verbose=dict(argstr='--verbose ', ), ) diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_extractNrrdVectorIndex.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_extractNrrdVectorIndex.py index 04c78827c9..c780c815b2 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_extractNrrdVectorIndex.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_extractNrrdVectorIndex.py @@ -6,12 +6,6 @@ def test_extractNrrdVectorIndex_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='--inputVolume %s', ), numberOfThreads=dict(argstr='--numberOfThreads %d', @@ -21,8 +15,6 @@ def test_extractNrrdVectorIndex_inputs(): ), setImageOrientation=dict(argstr='--setImageOrientation %s', ), - terminal_output=dict(nohash=True, - ), vectorIndex=dict(argstr='--vectorIndex %d', ), ) diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractAnisotropyMap.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractAnisotropyMap.py index a01f44e7a6..cc4bec623d 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractAnisotropyMap.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractAnisotropyMap.py @@ -8,12 +8,6 @@ def test_gtractAnisotropyMap_inputs(): ), args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputTensorVolume=dict(argstr='--inputTensorVolume %s', ), numberOfThreads=dict(argstr='--numberOfThreads %d', @@ -21,8 +15,6 @@ def test_gtractAnisotropyMap_inputs(): outputVolume=dict(argstr='--outputVolume %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = gtractAnisotropyMap._input_spec() diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractAverageBvalues.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractAverageBvalues.py index 8eae1d8f64..bd231b4514 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractAverageBvalues.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractAverageBvalues.py @@ -10,12 +10,6 @@ def test_gtractAverageBvalues_inputs(): ), directionsTolerance=dict(argstr='--directionsTolerance %f', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='--inputVolume %s', ), numberOfThreads=dict(argstr='--numberOfThreads %d', @@ -23,8 +17,6 @@ def test_gtractAverageBvalues_inputs(): outputVolume=dict(argstr='--outputVolume %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = gtractAverageBvalues._input_spec() diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractClipAnisotropy.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractClipAnisotropy.py index 81455dfaba..a5e53ce28e 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractClipAnisotropy.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractClipAnisotropy.py @@ -10,12 +10,6 @@ def test_gtractClipAnisotropy_inputs(): ), clipLastSlice=dict(argstr='--clipLastSlice ', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='--inputVolume %s', ), numberOfThreads=dict(argstr='--numberOfThreads %d', @@ -23,8 +17,6 @@ def test_gtractClipAnisotropy_inputs(): outputVolume=dict(argstr='--outputVolume %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = gtractClipAnisotropy._input_spec() diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCoRegAnatomy.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCoRegAnatomy.py index 2629defa52..a143be3de3 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCoRegAnatomy.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCoRegAnatomy.py @@ -10,17 +10,11 @@ def test_gtractCoRegAnatomy_inputs(): ), convergence=dict(argstr='--convergence %f', ), - environ=dict(nohash=True, - usedefault=True, - ), gradientTolerance=dict(argstr='--gradientTolerance %f', ), gridSize=dict(argstr='--gridSize %s', sep=',', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputAnatomicalVolume=dict(argstr='--inputAnatomicalVolume %s', ), inputRigidTransform=dict(argstr='--inputRigidTransform %s', @@ -50,8 +44,6 @@ def test_gtractCoRegAnatomy_inputs(): ), spatialScale=dict(argstr='--spatialScale %d', ), - terminal_output=dict(nohash=True, - ), transformType=dict(argstr='--transformType %s', ), translationScale=dict(argstr='--translationScale %f', diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractConcatDwi.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractConcatDwi.py index b023a0b717..1039a8492d 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractConcatDwi.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractConcatDwi.py @@ -6,14 +6,8 @@ def test_gtractConcatDwi_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), ignoreOrigins=dict(argstr='--ignoreOrigins ', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='--inputVolume %s...', ), numberOfThreads=dict(argstr='--numberOfThreads %d', @@ -21,8 +15,6 @@ def test_gtractConcatDwi_inputs(): outputVolume=dict(argstr='--outputVolume %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = gtractConcatDwi._input_spec() diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCopyImageOrientation.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCopyImageOrientation.py index 9cc32581ee..7ad4c2468c 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCopyImageOrientation.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCopyImageOrientation.py @@ -6,12 +6,6 @@ def test_gtractCopyImageOrientation_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputReferenceVolume=dict(argstr='--inputReferenceVolume %s', ), inputVolume=dict(argstr='--inputVolume %s', @@ -21,8 +15,6 @@ def test_gtractCopyImageOrientation_inputs(): outputVolume=dict(argstr='--outputVolume %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = gtractCopyImageOrientation._input_spec() diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCoregBvalues.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCoregBvalues.py index 4df2f5d09a..9665f59a15 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCoregBvalues.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCoregBvalues.py @@ -10,16 +10,10 @@ def test_gtractCoregBvalues_inputs(): ), eddyCurrentCorrection=dict(argstr='--eddyCurrentCorrection ', ), - environ=dict(nohash=True, - usedefault=True, - ), fixedVolume=dict(argstr='--fixedVolume %s', ), fixedVolumeIndex=dict(argstr='--fixedVolumeIndex %d', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), maximumStepSize=dict(argstr='--maximumStepSize %f', ), minimumStepSize=dict(argstr='--minimumStepSize %f', @@ -46,8 +40,6 @@ def test_gtractCoregBvalues_inputs(): ), spatialScale=dict(argstr='--spatialScale %f', ), - terminal_output=dict(nohash=True, - ), ) inputs = gtractCoregBvalues._input_spec() diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCostFastMarching.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCostFastMarching.py index 2192b198d7..77e89b251d 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCostFastMarching.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCostFastMarching.py @@ -8,12 +8,6 @@ def test_gtractCostFastMarching_inputs(): ), args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputAnisotropyVolume=dict(argstr='--inputAnisotropyVolume %s', ), inputStartingSeedsLabelMapVolume=dict(argstr='--inputStartingSeedsLabelMapVolume %s', @@ -34,8 +28,6 @@ def test_gtractCostFastMarching_inputs(): ), stoppingValue=dict(argstr='--stoppingValue %f', ), - terminal_output=dict(nohash=True, - ), ) inputs = gtractCostFastMarching._input_spec() diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCreateGuideFiber.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCreateGuideFiber.py index 192d8050fb..be1afa86f3 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCreateGuideFiber.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractCreateGuideFiber.py @@ -6,12 +6,6 @@ def test_gtractCreateGuideFiber_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputFiber=dict(argstr='--inputFiber %s', ), numberOfPoints=dict(argstr='--numberOfPoints %d', @@ -21,8 +15,6 @@ def test_gtractCreateGuideFiber_inputs(): outputFiber=dict(argstr='--outputFiber %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), writeXMLPolyDataFile=dict(argstr='--writeXMLPolyDataFile ', ), ) diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractFastMarchingTracking.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractFastMarchingTracking.py index d84fce6850..52b23fa2c5 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractFastMarchingTracking.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractFastMarchingTracking.py @@ -8,12 +8,6 @@ def test_gtractFastMarchingTracking_inputs(): ), costStepSize=dict(argstr='--costStepSize %f', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputAnisotropyVolume=dict(argstr='--inputAnisotropyVolume %s', ), inputCostVolume=dict(argstr='--inputCostVolume %s', @@ -37,8 +31,6 @@ def test_gtractFastMarchingTracking_inputs(): ), startingSeedsLabel=dict(argstr='--startingSeedsLabel %d', ), - terminal_output=dict(nohash=True, - ), trackingThreshold=dict(argstr='--trackingThreshold %f', ), writeXMLPolyDataFile=dict(argstr='--writeXMLPolyDataFile ', diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractFiberTracking.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractFiberTracking.py index 8bad5343d1..bbc122d710 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractFiberTracking.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractFiberTracking.py @@ -14,14 +14,8 @@ def test_gtractFiberTracking_inputs(): ), endingSeedsLabel=dict(argstr='--endingSeedsLabel %d', ), - environ=dict(nohash=True, - usedefault=True, - ), guidedCurvatureThreshold=dict(argstr='--guidedCurvatureThreshold %f', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputAnisotropyVolume=dict(argstr='--inputAnisotropyVolume %s', ), inputEndingSeedsLabelMapVolume=dict(argstr='--inputEndingSeedsLabelMapVolume %s', @@ -57,8 +51,6 @@ def test_gtractFiberTracking_inputs(): ), tendG=dict(argstr='--tendG %f', ), - terminal_output=dict(nohash=True, - ), trackingMethod=dict(argstr='--trackingMethod %s', ), trackingThreshold=dict(argstr='--trackingThreshold %f', diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractImageConformity.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractImageConformity.py index 2a3bd068be..895243866a 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractImageConformity.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractImageConformity.py @@ -6,12 +6,6 @@ def test_gtractImageConformity_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputReferenceVolume=dict(argstr='--inputReferenceVolume %s', ), inputVolume=dict(argstr='--inputVolume %s', @@ -21,8 +15,6 @@ def test_gtractImageConformity_inputs(): outputVolume=dict(argstr='--outputVolume %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = gtractImageConformity._input_spec() diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractInvertBSplineTransform.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractInvertBSplineTransform.py index 42efde82e9..43e855a557 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractInvertBSplineTransform.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractInvertBSplineTransform.py @@ -6,12 +6,6 @@ def test_gtractInvertBSplineTransform_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputReferenceVolume=dict(argstr='--inputReferenceVolume %s', ), inputTransform=dict(argstr='--inputTransform %s', @@ -24,8 +18,6 @@ def test_gtractInvertBSplineTransform_inputs(): outputTransform=dict(argstr='--outputTransform %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = gtractInvertBSplineTransform._input_spec() diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractInvertDisplacementField.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractInvertDisplacementField.py index 74e49060a8..e2c4692b53 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractInvertDisplacementField.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractInvertDisplacementField.py @@ -10,12 +10,6 @@ def test_gtractInvertDisplacementField_inputs(): ), deformationImage=dict(argstr='--deformationImage %s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), numberOfThreads=dict(argstr='--numberOfThreads %d', ), outputVolume=dict(argstr='--outputVolume %s', @@ -23,8 +17,6 @@ def test_gtractInvertDisplacementField_inputs(): ), subsamplingFactor=dict(argstr='--subsamplingFactor %d', ), - terminal_output=dict(nohash=True, - ), ) inputs = gtractInvertDisplacementField._input_spec() diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractInvertRigidTransform.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractInvertRigidTransform.py index 17f1e4ccb4..4766bc8cca 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractInvertRigidTransform.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractInvertRigidTransform.py @@ -6,12 +6,6 @@ def test_gtractInvertRigidTransform_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputTransform=dict(argstr='--inputTransform %s', ), numberOfThreads=dict(argstr='--numberOfThreads %d', @@ -19,8 +13,6 @@ def test_gtractInvertRigidTransform_inputs(): outputTransform=dict(argstr='--outputTransform %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = gtractInvertRigidTransform._input_spec() diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleAnisotropy.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleAnisotropy.py index fd76230f0f..8ae3e110ba 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleAnisotropy.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleAnisotropy.py @@ -6,12 +6,6 @@ def test_gtractResampleAnisotropy_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputAnatomicalVolume=dict(argstr='--inputAnatomicalVolume %s', ), inputAnisotropyVolume=dict(argstr='--inputAnisotropyVolume %s', @@ -23,8 +17,6 @@ def test_gtractResampleAnisotropy_inputs(): outputVolume=dict(argstr='--outputVolume %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), transformType=dict(argstr='--transformType %s', ), ) diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleB0.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleB0.py index 39b9551817..afbd61786a 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleB0.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleB0.py @@ -6,12 +6,6 @@ def test_gtractResampleB0_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputAnatomicalVolume=dict(argstr='--inputAnatomicalVolume %s', ), inputTransform=dict(argstr='--inputTransform %s', @@ -23,8 +17,6 @@ def test_gtractResampleB0_inputs(): outputVolume=dict(argstr='--outputVolume %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), transformType=dict(argstr='--transformType %s', ), vectorIndex=dict(argstr='--vectorIndex %d', diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleCodeImage.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleCodeImage.py index ece2ed5fb1..283b803720 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleCodeImage.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleCodeImage.py @@ -6,12 +6,6 @@ def test_gtractResampleCodeImage_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputCodeVolume=dict(argstr='--inputCodeVolume %s', ), inputReferenceVolume=dict(argstr='--inputReferenceVolume %s', @@ -23,8 +17,6 @@ def test_gtractResampleCodeImage_inputs(): outputVolume=dict(argstr='--outputVolume %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), transformType=dict(argstr='--transformType %s', ), ) diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleDWIInPlace.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleDWIInPlace.py index 5b353fcbf7..1455ba872a 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleDWIInPlace.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleDWIInPlace.py @@ -8,12 +8,6 @@ def test_gtractResampleDWIInPlace_inputs(): ), debugLevel=dict(argstr='--debugLevel %d', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), imageOutputSize=dict(argstr='--imageOutputSize %s', sep=',', ), @@ -31,8 +25,6 @@ def test_gtractResampleDWIInPlace_inputs(): ), referenceVolume=dict(argstr='--referenceVolume %s', ), - terminal_output=dict(nohash=True, - ), warpDWITransform=dict(argstr='--warpDWITransform %s', ), ) diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleFibers.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleFibers.py index 6a9fe674df..c70b3f022b 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleFibers.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleFibers.py @@ -6,12 +6,6 @@ def test_gtractResampleFibers_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputForwardDeformationFieldVolume=dict(argstr='--inputForwardDeformationFieldVolume %s', ), inputReverseDeformationFieldVolume=dict(argstr='--inputReverseDeformationFieldVolume %s', @@ -23,8 +17,6 @@ def test_gtractResampleFibers_inputs(): outputTract=dict(argstr='--outputTract %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), writeXMLPolyDataFile=dict(argstr='--writeXMLPolyDataFile ', ), ) diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractTensor.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractTensor.py index 4515588dd1..c5e9405b45 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractTensor.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractTensor.py @@ -12,15 +12,9 @@ def test_gtractTensor_inputs(): ), backgroundSuppressingThreshold=dict(argstr='--backgroundSuppressingThreshold %d', ), - environ=dict(nohash=True, - usedefault=True, - ), ignoreIndex=dict(argstr='--ignoreIndex %s', sep=',', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='--inputVolume %s', ), maskProcessingMode=dict(argstr='--maskProcessingMode %s', @@ -39,8 +33,6 @@ def test_gtractTensor_inputs(): ), size=dict(argstr='--size %f', ), - terminal_output=dict(nohash=True, - ), ) inputs = gtractTensor._input_spec() diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractTransformToDisplacementField.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractTransformToDisplacementField.py index 9a8d775d25..187f90a046 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractTransformToDisplacementField.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_gtractTransformToDisplacementField.py @@ -6,12 +6,6 @@ def test_gtractTransformToDisplacementField_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputReferenceVolume=dict(argstr='--inputReferenceVolume %s', ), inputTransform=dict(argstr='--inputTransform %s', @@ -21,8 +15,6 @@ def test_gtractTransformToDisplacementField_inputs(): outputDeformationFieldVolume=dict(argstr='--outputDeformationFieldVolume %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = gtractTransformToDisplacementField._input_spec() diff --git a/nipype/interfaces/semtools/diffusion/tests/test_auto_maxcurvature.py b/nipype/interfaces/semtools/diffusion/tests/test_auto_maxcurvature.py index 8f867fab44..5d6605be36 100644 --- a/nipype/interfaces/semtools/diffusion/tests/test_auto_maxcurvature.py +++ b/nipype/interfaces/semtools/diffusion/tests/test_auto_maxcurvature.py @@ -6,12 +6,6 @@ def test_maxcurvature_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), image=dict(argstr='--image %s', ), output=dict(argstr='--output %s', @@ -19,8 +13,6 @@ def test_maxcurvature_inputs(): ), sigma=dict(argstr='--sigma %f', ), - terminal_output=dict(nohash=True, - ), verbose=dict(argstr='--verbose ', ), ) diff --git a/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_UKFTractography.py b/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_UKFTractography.py index 8d455078c9..c3e0fb5098 100644 --- a/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_UKFTractography.py +++ b/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_UKFTractography.py @@ -16,16 +16,10 @@ def test_UKFTractography_inputs(): ), dwiFile=dict(argstr='--dwiFile %s', ), - environ=dict(nohash=True, - usedefault=True, - ), freeWater=dict(argstr='--freeWater ', ), fullTensorModel=dict(argstr='--fullTensorModel ', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), labels=dict(argstr='--labels %s', sep=',', ), @@ -71,8 +65,6 @@ def test_UKFTractography_inputs(): ), storeGlyphs=dict(argstr='--storeGlyphs ', ), - terminal_output=dict(nohash=True, - ), tracts=dict(argstr='--tracts %s', hash_files=False, ), diff --git a/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_fiberprocess.py b/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_fiberprocess.py index 594e7ab18d..cf6a9bca14 100644 --- a/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_fiberprocess.py +++ b/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_fiberprocess.py @@ -8,9 +8,6 @@ def test_fiberprocess_inputs(): ), displacement_field=dict(argstr='--displacement_field %s', ), - environ=dict(nohash=True, - usedefault=True, - ), fiber_file=dict(argstr='--fiber_file %s', ), fiber_output=dict(argstr='--fiber_output %s', @@ -20,9 +17,6 @@ def test_fiberprocess_inputs(): ), h_field=dict(argstr='--h_field %s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), index_space=dict(argstr='--index_space ', ), noDataChange=dict(argstr='--noDataChange ', @@ -33,8 +27,6 @@ def test_fiberprocess_inputs(): ), tensor_volume=dict(argstr='--tensor_volume %s', ), - terminal_output=dict(nohash=True, - ), verbose=dict(argstr='--verbose ', ), voxel_label=dict(argstr='--voxel_label %d', diff --git a/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_fiberstats.py b/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_fiberstats.py index 9a3f555ad4..0ebc9de81a 100644 --- a/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_fiberstats.py +++ b/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_fiberstats.py @@ -6,16 +6,8 @@ def test_fiberstats_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), fiber_file=dict(argstr='--fiber_file %s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), - terminal_output=dict(nohash=True, - ), verbose=dict(argstr='--verbose ', ), ) diff --git a/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_fibertrack.py b/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_fibertrack.py index 1f74b03424..688b3cd3e1 100644 --- a/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_fibertrack.py +++ b/nipype/interfaces/semtools/diffusion/tractography/tests/test_auto_fibertrack.py @@ -6,16 +6,10 @@ def test_fibertrack_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), forbidden_label=dict(argstr='--forbidden_label %d', ), force=dict(argstr='--force ', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_roi_file=dict(argstr='--input_roi_file %s', ), input_tensor_file=dict(argstr='--input_tensor_file %s', @@ -35,8 +29,6 @@ def test_fibertrack_inputs(): ), target_label=dict(argstr='--target_label %d', ), - terminal_output=dict(nohash=True, - ), verbose=dict(argstr='--verbose ', ), whole_brain=dict(argstr='--whole_brain ', diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_CannyEdge.py b/nipype/interfaces/semtools/filtering/tests/test_auto_CannyEdge.py index ed0d8b0aa1..cb1cd2fa7f 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_CannyEdge.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_CannyEdge.py @@ -6,12 +6,6 @@ def test_CannyEdge_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='--inputVolume %s', ), lowerThreshold=dict(argstr='--lowerThreshold %f', @@ -19,8 +13,6 @@ def test_CannyEdge_inputs(): outputVolume=dict(argstr='--outputVolume %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), upperThreshold=dict(argstr='--upperThreshold %f', ), variance=dict(argstr='--variance %f', diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_CannySegmentationLevelSetImageFilter.py b/nipype/interfaces/semtools/filtering/tests/test_auto_CannySegmentationLevelSetImageFilter.py index 23e0b2f1a0..c7829d29c4 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_CannySegmentationLevelSetImageFilter.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_CannySegmentationLevelSetImageFilter.py @@ -12,12 +12,6 @@ def test_CannySegmentationLevelSetImageFilter_inputs(): ), cannyVariance=dict(argstr='--cannyVariance %f', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), initialModel=dict(argstr='--initialModel %s', ), initialModelIsovalue=dict(argstr='--initialModelIsovalue %f', @@ -32,8 +26,6 @@ def test_CannySegmentationLevelSetImageFilter_inputs(): outputVolume=dict(argstr='--outputVolume %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = CannySegmentationLevelSetImageFilter._input_spec() diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_DilateImage.py b/nipype/interfaces/semtools/filtering/tests/test_auto_DilateImage.py index 4d1a8c4a34..87536804f8 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_DilateImage.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_DilateImage.py @@ -6,12 +6,6 @@ def test_DilateImage_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputMaskVolume=dict(argstr='--inputMaskVolume %s', ), inputRadius=dict(argstr='--inputRadius %d', @@ -21,8 +15,6 @@ def test_DilateImage_inputs(): outputVolume=dict(argstr='--outputVolume %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = DilateImage._input_spec() diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_DilateMask.py b/nipype/interfaces/semtools/filtering/tests/test_auto_DilateMask.py index ea96c32680..18feff3a8b 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_DilateMask.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_DilateMask.py @@ -6,12 +6,6 @@ def test_DilateMask_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputBinaryVolume=dict(argstr='--inputBinaryVolume %s', ), inputVolume=dict(argstr='--inputVolume %s', @@ -23,8 +17,6 @@ def test_DilateMask_inputs(): ), sizeStructuralElement=dict(argstr='--sizeStructuralElement %d', ), - terminal_output=dict(nohash=True, - ), ) inputs = DilateMask._input_spec() diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_DistanceMaps.py b/nipype/interfaces/semtools/filtering/tests/test_auto_DistanceMaps.py index 4d05aba965..f21f208e90 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_DistanceMaps.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_DistanceMaps.py @@ -6,12 +6,6 @@ def test_DistanceMaps_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputLabelVolume=dict(argstr='--inputLabelVolume %s', ), inputMaskVolume=dict(argstr='--inputMaskVolume %s', @@ -21,8 +15,6 @@ def test_DistanceMaps_inputs(): outputVolume=dict(argstr='--outputVolume %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = DistanceMaps._input_spec() diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_DumpBinaryTrainingVectors.py b/nipype/interfaces/semtools/filtering/tests/test_auto_DumpBinaryTrainingVectors.py index c822e7f014..bef26f53e8 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_DumpBinaryTrainingVectors.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_DumpBinaryTrainingVectors.py @@ -6,18 +6,10 @@ def test_DumpBinaryTrainingVectors_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputHeaderFilename=dict(argstr='--inputHeaderFilename %s', ), inputVectorFilename=dict(argstr='--inputVectorFilename %s', ), - terminal_output=dict(nohash=True, - ), ) inputs = DumpBinaryTrainingVectors._input_spec() diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_ErodeImage.py b/nipype/interfaces/semtools/filtering/tests/test_auto_ErodeImage.py index eed7411979..f0f57ed286 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_ErodeImage.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_ErodeImage.py @@ -6,12 +6,6 @@ def test_ErodeImage_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputMaskVolume=dict(argstr='--inputMaskVolume %s', ), inputRadius=dict(argstr='--inputRadius %d', @@ -21,8 +15,6 @@ def test_ErodeImage_inputs(): outputVolume=dict(argstr='--outputVolume %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = ErodeImage._input_spec() diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_FlippedDifference.py b/nipype/interfaces/semtools/filtering/tests/test_auto_FlippedDifference.py index 97f9be5262..46b4ed8781 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_FlippedDifference.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_FlippedDifference.py @@ -6,12 +6,6 @@ def test_FlippedDifference_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputMaskVolume=dict(argstr='--inputMaskVolume %s', ), inputVolume=dict(argstr='--inputVolume %s', @@ -19,8 +13,6 @@ def test_FlippedDifference_inputs(): outputVolume=dict(argstr='--outputVolume %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = FlippedDifference._input_spec() diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_GenerateBrainClippedImage.py b/nipype/interfaces/semtools/filtering/tests/test_auto_GenerateBrainClippedImage.py index 135f74d2ef..c84b0bc1bb 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_GenerateBrainClippedImage.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_GenerateBrainClippedImage.py @@ -6,12 +6,6 @@ def test_GenerateBrainClippedImage_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputImg=dict(argstr='--inputImg %s', ), inputMsk=dict(argstr='--inputMsk %s', @@ -21,8 +15,6 @@ def test_GenerateBrainClippedImage_inputs(): outputFileName=dict(argstr='--outputFileName %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = GenerateBrainClippedImage._input_spec() diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_GenerateSummedGradientImage.py b/nipype/interfaces/semtools/filtering/tests/test_auto_GenerateSummedGradientImage.py index e38f35d84b..ce76a48e05 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_GenerateSummedGradientImage.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_GenerateSummedGradientImage.py @@ -8,12 +8,6 @@ def test_GenerateSummedGradientImage_inputs(): ), args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume1=dict(argstr='--inputVolume1 %s', ), inputVolume2=dict(argstr='--inputVolume2 %s', @@ -23,8 +17,6 @@ def test_GenerateSummedGradientImage_inputs(): outputFileName=dict(argstr='--outputFileName %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = GenerateSummedGradientImage._input_spec() diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_GenerateTestImage.py b/nipype/interfaces/semtools/filtering/tests/test_auto_GenerateTestImage.py index f79c3ab9f5..de818fcc49 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_GenerateTestImage.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_GenerateTestImage.py @@ -6,12 +6,6 @@ def test_GenerateTestImage_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='--inputVolume %s', ), lowerBoundOfOutputVolume=dict(argstr='--lowerBoundOfOutputVolume %f', @@ -21,8 +15,6 @@ def test_GenerateTestImage_inputs(): ), outputVolumeSize=dict(argstr='--outputVolumeSize %f', ), - terminal_output=dict(nohash=True, - ), upperBoundOfOutputVolume=dict(argstr='--upperBoundOfOutputVolume %f', ), ) diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_GradientAnisotropicDiffusionImageFilter.py b/nipype/interfaces/semtools/filtering/tests/test_auto_GradientAnisotropicDiffusionImageFilter.py index 192ee1fe65..20fd6cebf7 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_GradientAnisotropicDiffusionImageFilter.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_GradientAnisotropicDiffusionImageFilter.py @@ -8,12 +8,6 @@ def test_GradientAnisotropicDiffusionImageFilter_inputs(): ), conductance=dict(argstr='--conductance %f', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='--inputVolume %s', ), numberOfIterations=dict(argstr='--numberOfIterations %d', @@ -21,8 +15,6 @@ def test_GradientAnisotropicDiffusionImageFilter_inputs(): outputVolume=dict(argstr='--outputVolume %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), timeStep=dict(argstr='--timeStep %f', ), ) diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_HammerAttributeCreator.py b/nipype/interfaces/semtools/filtering/tests/test_auto_HammerAttributeCreator.py index 0aa709d07e..1f8ea07a9b 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_HammerAttributeCreator.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_HammerAttributeCreator.py @@ -10,12 +10,6 @@ def test_HammerAttributeCreator_inputs(): ), args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputCSFVolume=dict(argstr='--inputCSFVolume %s', ), inputGMVolume=dict(argstr='--inputGMVolume %s', @@ -24,8 +18,6 @@ def test_HammerAttributeCreator_inputs(): ), outputVolumeBase=dict(argstr='--outputVolumeBase %s', ), - terminal_output=dict(nohash=True, - ), ) inputs = HammerAttributeCreator._input_spec() diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_NeighborhoodMean.py b/nipype/interfaces/semtools/filtering/tests/test_auto_NeighborhoodMean.py index f988d119f5..714a2acbeb 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_NeighborhoodMean.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_NeighborhoodMean.py @@ -6,12 +6,6 @@ def test_NeighborhoodMean_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputMaskVolume=dict(argstr='--inputMaskVolume %s', ), inputRadius=dict(argstr='--inputRadius %d', @@ -21,8 +15,6 @@ def test_NeighborhoodMean_inputs(): outputVolume=dict(argstr='--outputVolume %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = NeighborhoodMean._input_spec() diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_NeighborhoodMedian.py b/nipype/interfaces/semtools/filtering/tests/test_auto_NeighborhoodMedian.py index b708fcbec0..a68aabcd8f 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_NeighborhoodMedian.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_NeighborhoodMedian.py @@ -6,12 +6,6 @@ def test_NeighborhoodMedian_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputMaskVolume=dict(argstr='--inputMaskVolume %s', ), inputRadius=dict(argstr='--inputRadius %d', @@ -21,8 +15,6 @@ def test_NeighborhoodMedian_inputs(): outputVolume=dict(argstr='--outputVolume %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = NeighborhoodMedian._input_spec() diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_STAPLEAnalysis.py b/nipype/interfaces/semtools/filtering/tests/test_auto_STAPLEAnalysis.py index 567e1da3af..157b78ca0d 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_STAPLEAnalysis.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_STAPLEAnalysis.py @@ -6,12 +6,6 @@ def test_STAPLEAnalysis_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputDimension=dict(argstr='--inputDimension %d', ), inputLabelVolume=dict(argstr='--inputLabelVolume %s...', @@ -19,8 +13,6 @@ def test_STAPLEAnalysis_inputs(): outputVolume=dict(argstr='--outputVolume %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = STAPLEAnalysis._input_spec() diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_TextureFromNoiseImageFilter.py b/nipype/interfaces/semtools/filtering/tests/test_auto_TextureFromNoiseImageFilter.py index 006823ff29..28c38daf2f 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_TextureFromNoiseImageFilter.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_TextureFromNoiseImageFilter.py @@ -6,12 +6,6 @@ def test_TextureFromNoiseImageFilter_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputRadius=dict(argstr='--inputRadius %d', ), inputVolume=dict(argstr='--inputVolume %s', @@ -19,8 +13,6 @@ def test_TextureFromNoiseImageFilter_inputs(): outputVolume=dict(argstr='--outputVolume %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = TextureFromNoiseImageFilter._input_spec() diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_TextureMeasureFilter.py b/nipype/interfaces/semtools/filtering/tests/test_auto_TextureMeasureFilter.py index ef611d1702..d2d5a871ef 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_TextureMeasureFilter.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_TextureMeasureFilter.py @@ -8,12 +8,6 @@ def test_TextureMeasureFilter_inputs(): ), distance=dict(argstr='--distance %d', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputMaskVolume=dict(argstr='--inputMaskVolume %s', ), inputVolume=dict(argstr='--inputVolume %s', @@ -23,8 +17,6 @@ def test_TextureMeasureFilter_inputs(): outputFilename=dict(argstr='--outputFilename %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = TextureMeasureFilter._input_spec() diff --git a/nipype/interfaces/semtools/filtering/tests/test_auto_UnbiasedNonLocalMeans.py b/nipype/interfaces/semtools/filtering/tests/test_auto_UnbiasedNonLocalMeans.py index acfeece325..e0179ce311 100644 --- a/nipype/interfaces/semtools/filtering/tests/test_auto_UnbiasedNonLocalMeans.py +++ b/nipype/interfaces/semtools/filtering/tests/test_auto_UnbiasedNonLocalMeans.py @@ -6,14 +6,8 @@ def test_UnbiasedNonLocalMeans_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), hp=dict(argstr='--hp %f', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='%s', position=-2, ), @@ -31,8 +25,6 @@ def test_UnbiasedNonLocalMeans_inputs(): ), sigma=dict(argstr='--sigma %f', ), - terminal_output=dict(nohash=True, - ), ) inputs = UnbiasedNonLocalMeans._input_spec() diff --git a/nipype/interfaces/semtools/legacy/tests/test_auto_scalartransform.py b/nipype/interfaces/semtools/legacy/tests/test_auto_scalartransform.py index c478cdf14c..de2b88de44 100644 --- a/nipype/interfaces/semtools/legacy/tests/test_auto_scalartransform.py +++ b/nipype/interfaces/semtools/legacy/tests/test_auto_scalartransform.py @@ -8,14 +8,8 @@ def test_scalartransform_inputs(): ), deformation=dict(argstr='--deformation %s', ), - environ=dict(nohash=True, - usedefault=True, - ), h_field=dict(argstr='--h_field ', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), input_image=dict(argstr='--input_image %s', ), interpolation=dict(argstr='--interpolation %s', @@ -25,8 +19,6 @@ def test_scalartransform_inputs(): output_image=dict(argstr='--output_image %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), transformation=dict(argstr='--transformation %s', hash_files=False, ), diff --git a/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSDemonWarp.py b/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSDemonWarp.py index ef16a5cb57..4c61038378 100644 --- a/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSDemonWarp.py +++ b/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSDemonWarp.py @@ -14,9 +14,6 @@ def test_BRAINSDemonWarp_inputs(): checkerboardPatternSubdivisions=dict(argstr='--checkerboardPatternSubdivisions %s', sep=',', ), - environ=dict(nohash=True, - usedefault=True, - ), fixedBinaryVolume=dict(argstr='--fixedBinaryVolume %s', ), fixedVolume=dict(argstr='--fixedVolume %s', @@ -27,9 +24,6 @@ def test_BRAINSDemonWarp_inputs(): ), histogramMatch=dict(argstr='--histogramMatch ', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), initializeWithDisplacementField=dict(argstr='--initializeWithDisplacementField %s', ), initializeWithTransform=dict(argstr='--initializeWithTransform %s', @@ -96,8 +90,6 @@ def test_BRAINSDemonWarp_inputs(): ), smoothDisplacementFieldSigma=dict(argstr='--smoothDisplacementFieldSigma %f', ), - terminal_output=dict(nohash=True, - ), upFieldSmoothing=dict(argstr='--upFieldSmoothing %f', ), upperThresholdForBOBF=dict(argstr='--upperThresholdForBOBF %d', diff --git a/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSFit.py b/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSFit.py index 56fa676186..86f84a062d 100644 --- a/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSFit.py +++ b/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSFit.py @@ -21,9 +21,6 @@ def test_BRAINSFit_inputs(): ), debugLevel=dict(argstr='--debugLevel %d', ), - environ=dict(nohash=True, - usedefault=True, - ), failureExitCode=dict(argstr='--failureExitCode %d', ), fixedBinaryVolume=dict(argstr='--fixedBinaryVolume %s', @@ -38,9 +35,6 @@ def test_BRAINSFit_inputs(): ), histogramMatch=dict(argstr='--histogramMatch ', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), initialTransform=dict(argstr='--initialTransform %s', ), initializeRegistrationByCurrentGenericTransform=dict(argstr='--initializeRegistrationByCurrentGenericTransform ', @@ -130,8 +124,6 @@ def test_BRAINSFit_inputs(): strippedOutputTransform=dict(argstr='--strippedOutputTransform %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), transformType=dict(argstr='--transformType %s', sep=',', ), diff --git a/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSResample.py b/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSResample.py index abc2cb27e1..470e7d3cee 100644 --- a/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSResample.py +++ b/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSResample.py @@ -10,15 +10,9 @@ def test_BRAINSResample_inputs(): ), deformationVolume=dict(argstr='--deformationVolume %s', ), - environ=dict(nohash=True, - usedefault=True, - ), gridSpacing=dict(argstr='--gridSpacing %s', sep=',', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='--inputVolume %s', ), interpolationMode=dict(argstr='--interpolationMode %s', @@ -34,8 +28,6 @@ def test_BRAINSResample_inputs(): ), referenceVolume=dict(argstr='--referenceVolume %s', ), - terminal_output=dict(nohash=True, - ), warpTransform=dict(argstr='--warpTransform %s', ), ) diff --git a/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSResize.py b/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSResize.py index e56977fcbb..d1fc5c116e 100644 --- a/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSResize.py +++ b/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSResize.py @@ -6,12 +6,6 @@ def test_BRAINSResize_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='--inputVolume %s', ), outputVolume=dict(argstr='--outputVolume %s', @@ -21,8 +15,6 @@ def test_BRAINSResize_inputs(): ), scaleFactor=dict(argstr='--scaleFactor %f', ), - terminal_output=dict(nohash=True, - ), ) inputs = BRAINSResize._input_spec() diff --git a/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSTransformFromFiducials.py b/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSTransformFromFiducials.py index f5b41fa53a..07f887b96e 100644 --- a/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSTransformFromFiducials.py +++ b/nipype/interfaces/semtools/registration/tests/test_auto_BRAINSTransformFromFiducials.py @@ -6,16 +6,10 @@ def test_BRAINSTransformFromFiducials_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), fixedLandmarks=dict(argstr='--fixedLandmarks %s...', ), fixedLandmarksFile=dict(argstr='--fixedLandmarksFile %s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), movingLandmarks=dict(argstr='--movingLandmarks %s...', ), movingLandmarksFile=dict(argstr='--movingLandmarksFile %s', @@ -25,8 +19,6 @@ def test_BRAINSTransformFromFiducials_inputs(): saveTransform=dict(argstr='--saveTransform %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), transformType=dict(argstr='--transformType %s', ), ) diff --git a/nipype/interfaces/semtools/registration/tests/test_auto_VBRAINSDemonWarp.py b/nipype/interfaces/semtools/registration/tests/test_auto_VBRAINSDemonWarp.py index af920f8f80..a29428faaf 100644 --- a/nipype/interfaces/semtools/registration/tests/test_auto_VBRAINSDemonWarp.py +++ b/nipype/interfaces/semtools/registration/tests/test_auto_VBRAINSDemonWarp.py @@ -14,9 +14,6 @@ def test_VBRAINSDemonWarp_inputs(): checkerboardPatternSubdivisions=dict(argstr='--checkerboardPatternSubdivisions %s', sep=',', ), - environ=dict(nohash=True, - usedefault=True, - ), fixedBinaryVolume=dict(argstr='--fixedBinaryVolume %s', ), fixedVolume=dict(argstr='--fixedVolume %s...', @@ -27,9 +24,6 @@ def test_VBRAINSDemonWarp_inputs(): ), histogramMatch=dict(argstr='--histogramMatch ', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), initializeWithDisplacementField=dict(argstr='--initializeWithDisplacementField %s', ), initializeWithTransform=dict(argstr='--initializeWithTransform %s', @@ -96,8 +90,6 @@ def test_VBRAINSDemonWarp_inputs(): ), smoothDisplacementFieldSigma=dict(argstr='--smoothDisplacementFieldSigma %f', ), - terminal_output=dict(nohash=True, - ), upFieldSmoothing=dict(argstr='--upFieldSmoothing %f', ), upperThresholdForBOBF=dict(argstr='--upperThresholdForBOBF %d', diff --git a/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSABC.py b/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSABC.py index eb3ad90f1e..ae37dbbc42 100644 --- a/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSABC.py +++ b/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSABC.py @@ -22,9 +22,6 @@ def test_BRAINSABC_inputs(): ), defaultSuffix=dict(argstr='--defaultSuffix %s', ), - environ=dict(nohash=True, - usedefault=True, - ), filterIteration=dict(argstr='--filterIteration %d', ), filterMethod=dict(argstr='--filterMethod %s', @@ -34,9 +31,6 @@ def test_BRAINSABC_inputs(): gridSize=dict(argstr='--gridSize %s', sep=',', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), implicitOutputs=dict(argstr='--implicitOutputs %s...', hash_files=False, ), @@ -84,8 +78,6 @@ def test_BRAINSABC_inputs(): ), subjectIntermodeTransformType=dict(argstr='--subjectIntermodeTransformType %s', ), - terminal_output=dict(nohash=True, - ), useKNN=dict(argstr='--useKNN ', ), writeLess=dict(argstr='--writeLess ', diff --git a/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSConstellationDetector.py b/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSConstellationDetector.py index d9f0a521b0..9b86feccf9 100644 --- a/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSConstellationDetector.py +++ b/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSConstellationDetector.py @@ -22,9 +22,6 @@ def test_BRAINSConstellationDetector_inputs(): ), debug=dict(argstr='--debug ', ), - environ=dict(nohash=True, - usedefault=True, - ), forceACPoint=dict(argstr='--forceACPoint %s', sep=',', ), @@ -41,9 +38,6 @@ def test_BRAINSConstellationDetector_inputs(): ), houghEyeDetectorMode=dict(argstr='--houghEyeDetectorMode %d', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputLandmarksEMSP=dict(argstr='--inputLandmarksEMSP %s', ), inputTemplateModel=dict(argstr='--inputTemplateModel %s', @@ -98,8 +92,6 @@ def test_BRAINSConstellationDetector_inputs(): ), rpc=dict(argstr='--rpc %f', ), - terminal_output=dict(nohash=True, - ), trimRescaledIntensities=dict(argstr='--trimRescaledIntensities %f', ), verbose=dict(argstr='--verbose ', diff --git a/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSCreateLabelMapFromProbabilityMaps.py b/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSCreateLabelMapFromProbabilityMaps.py index 593edb3eb1..82c5f1fc13 100644 --- a/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSCreateLabelMapFromProbabilityMaps.py +++ b/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSCreateLabelMapFromProbabilityMaps.py @@ -12,15 +12,9 @@ def test_BRAINSCreateLabelMapFromProbabilityMaps_inputs(): dirtyLabelVolume=dict(argstr='--dirtyLabelVolume %s', hash_files=False, ), - environ=dict(nohash=True, - usedefault=True, - ), foregroundPriors=dict(argstr='--foregroundPriors %s', sep=',', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inclusionThreshold=dict(argstr='--inclusionThreshold %f', ), inputProbabilityVolume=dict(argstr='--inputProbabilityVolume %s...', @@ -30,8 +24,6 @@ def test_BRAINSCreateLabelMapFromProbabilityMaps_inputs(): priorLabelCodes=dict(argstr='--priorLabelCodes %s', sep=',', ), - terminal_output=dict(nohash=True, - ), ) inputs = BRAINSCreateLabelMapFromProbabilityMaps._input_spec() diff --git a/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSCut.py b/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSCut.py index 958d396917..0d891fd837 100644 --- a/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSCut.py +++ b/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSCut.py @@ -14,16 +14,10 @@ def test_BRAINSCut_inputs(): ), createVectors=dict(argstr='--createVectors ', ), - environ=dict(nohash=True, - usedefault=True, - ), generateProbability=dict(argstr='--generateProbability ', ), histogramEqualization=dict(argstr='--histogramEqualization ', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), method=dict(argstr='--method %s', ), modelConfigurationFilename=dict(argstr='--modelConfigurationFilename %s', @@ -38,8 +32,6 @@ def test_BRAINSCut_inputs(): ), randomTreeDepth=dict(argstr='--randomTreeDepth %d', ), - terminal_output=dict(nohash=True, - ), trainModel=dict(argstr='--trainModel ', ), trainModelStartIndex=dict(argstr='--trainModelStartIndex %d', diff --git a/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSMultiSTAPLE.py b/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSMultiSTAPLE.py index ca8ca5b9c5..6fee3b5bbe 100644 --- a/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSMultiSTAPLE.py +++ b/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSMultiSTAPLE.py @@ -6,12 +6,6 @@ def test_BRAINSMultiSTAPLE_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputCompositeT1Volume=dict(argstr='--inputCompositeT1Volume %s', ), inputLabelVolume=dict(argstr='--inputLabelVolume %s...', @@ -30,8 +24,6 @@ def test_BRAINSMultiSTAPLE_inputs(): ), skipResampling=dict(argstr='--skipResampling ', ), - terminal_output=dict(nohash=True, - ), ) inputs = BRAINSMultiSTAPLE._input_spec() diff --git a/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSROIAuto.py b/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSROIAuto.py index 1861e70413..e6daaaf6ed 100644 --- a/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSROIAuto.py +++ b/nipype/interfaces/semtools/segmentation/tests/test_auto_BRAINSROIAuto.py @@ -12,12 +12,6 @@ def test_BRAINSROIAuto_inputs(): ), cropOutput=dict(argstr='--cropOutput ', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='--inputVolume %s', ), maskOutput=dict(argstr='--maskOutput ', @@ -34,8 +28,6 @@ def test_BRAINSROIAuto_inputs(): ), outputVolumePixelType=dict(argstr='--outputVolumePixelType %s', ), - terminal_output=dict(nohash=True, - ), thresholdCorrectionFactor=dict(argstr='--thresholdCorrectionFactor %f', ), ) diff --git a/nipype/interfaces/semtools/segmentation/tests/test_auto_BinaryMaskEditorBasedOnLandmarks.py b/nipype/interfaces/semtools/segmentation/tests/test_auto_BinaryMaskEditorBasedOnLandmarks.py index 2ed343a974..0715400a5a 100644 --- a/nipype/interfaces/semtools/segmentation/tests/test_auto_BinaryMaskEditorBasedOnLandmarks.py +++ b/nipype/interfaces/semtools/segmentation/tests/test_auto_BinaryMaskEditorBasedOnLandmarks.py @@ -6,12 +6,6 @@ def test_BinaryMaskEditorBasedOnLandmarks_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputBinaryVolume=dict(argstr='--inputBinaryVolume %s', ), inputLandmarkNames=dict(argstr='--inputLandmarkNames %s', @@ -31,8 +25,6 @@ def test_BinaryMaskEditorBasedOnLandmarks_inputs(): setCutDirectionForObliquePlane=dict(argstr='--setCutDirectionForObliquePlane %s', sep=',', ), - terminal_output=dict(nohash=True, - ), ) inputs = BinaryMaskEditorBasedOnLandmarks._input_spec() diff --git a/nipype/interfaces/semtools/segmentation/tests/test_auto_ESLR.py b/nipype/interfaces/semtools/segmentation/tests/test_auto_ESLR.py index 8ce86e4fac..3ad669591b 100644 --- a/nipype/interfaces/semtools/segmentation/tests/test_auto_ESLR.py +++ b/nipype/interfaces/semtools/segmentation/tests/test_auto_ESLR.py @@ -8,14 +8,8 @@ def test_ESLR_inputs(): ), closingSize=dict(argstr='--closingSize %d', ), - environ=dict(nohash=True, - usedefault=True, - ), high=dict(argstr='--high %d', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='--inputVolume %s', ), low=dict(argstr='--low %d', @@ -31,8 +25,6 @@ def test_ESLR_inputs(): ), safetySize=dict(argstr='--safetySize %d', ), - terminal_output=dict(nohash=True, - ), ) inputs = ESLR._input_spec() diff --git a/nipype/interfaces/semtools/tests/test_auto_DWICompare.py b/nipype/interfaces/semtools/tests/test_auto_DWICompare.py index 35081ccead..f1b21dea21 100644 --- a/nipype/interfaces/semtools/tests/test_auto_DWICompare.py +++ b/nipype/interfaces/semtools/tests/test_auto_DWICompare.py @@ -6,18 +6,10 @@ def test_DWICompare_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume1=dict(argstr='--inputVolume1 %s', ), inputVolume2=dict(argstr='--inputVolume2 %s', ), - terminal_output=dict(nohash=True, - ), ) inputs = DWICompare._input_spec() diff --git a/nipype/interfaces/semtools/tests/test_auto_DWISimpleCompare.py b/nipype/interfaces/semtools/tests/test_auto_DWISimpleCompare.py index 73dc15c797..9e3980dc55 100644 --- a/nipype/interfaces/semtools/tests/test_auto_DWISimpleCompare.py +++ b/nipype/interfaces/semtools/tests/test_auto_DWISimpleCompare.py @@ -8,18 +8,10 @@ def test_DWISimpleCompare_inputs(): ), checkDWIData=dict(argstr='--checkDWIData ', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume1=dict(argstr='--inputVolume1 %s', ), inputVolume2=dict(argstr='--inputVolume2 %s', ), - terminal_output=dict(nohash=True, - ), ) inputs = DWISimpleCompare._input_spec() diff --git a/nipype/interfaces/semtools/tests/test_auto_GenerateCsfClippedFromClassifiedImage.py b/nipype/interfaces/semtools/tests/test_auto_GenerateCsfClippedFromClassifiedImage.py index 310b5039dd..d48adb3213 100644 --- a/nipype/interfaces/semtools/tests/test_auto_GenerateCsfClippedFromClassifiedImage.py +++ b/nipype/interfaces/semtools/tests/test_auto_GenerateCsfClippedFromClassifiedImage.py @@ -6,19 +6,11 @@ def test_GenerateCsfClippedFromClassifiedImage_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputCassifiedVolume=dict(argstr='--inputCassifiedVolume %s', ), outputVolume=dict(argstr='--outputVolume %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = GenerateCsfClippedFromClassifiedImage._input_spec() diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSAlignMSP.py b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSAlignMSP.py index 67b52d62f6..4dfc5709fb 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSAlignMSP.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSAlignMSP.py @@ -11,12 +11,6 @@ def test_BRAINSAlignMSP_inputs(): ), args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='--inputVolume %s', ), interpolationMode=dict(argstr='--interpolationMode %s', @@ -33,8 +27,6 @@ def test_BRAINSAlignMSP_inputs(): resultsDir=dict(argstr='--resultsDir %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), trimRescaledIntensities=dict(argstr='--trimRescaledIntensities %f', ), verbose=dict(argstr='--verbose ', diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSClipInferior.py b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSClipInferior.py index 4ab9f70875..d1b1fd28a8 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSClipInferior.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSClipInferior.py @@ -10,12 +10,6 @@ def test_BRAINSClipInferior_inputs(): ), args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='--inputVolume %s', ), numberOfThreads=dict(argstr='--numberOfThreads %d', @@ -23,8 +17,6 @@ def test_BRAINSClipInferior_inputs(): outputVolume=dict(argstr='--outputVolume %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = BRAINSClipInferior._input_spec() diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSConstellationModeler.py b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSConstellationModeler.py index cd431e3d34..eaeffcf274 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSConstellationModeler.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSConstellationModeler.py @@ -8,12 +8,6 @@ def test_BRAINSConstellationModeler_inputs(): ), args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputTrainingList=dict(argstr='--inputTrainingList %s', ), mspQualityLevel=dict(argstr='--mspQualityLevel %d', @@ -35,8 +29,6 @@ def test_BRAINSConstellationModeler_inputs(): ), saveOptimizedLandmarks=dict(argstr='--saveOptimizedLandmarks ', ), - terminal_output=dict(nohash=True, - ), trimRescaledIntensities=dict(argstr='--trimRescaledIntensities %f', ), verbose=dict(argstr='--verbose ', diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSEyeDetector.py b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSEyeDetector.py index 694ad845de..488fa45340 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSEyeDetector.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSEyeDetector.py @@ -8,12 +8,6 @@ def test_BRAINSEyeDetector_inputs(): ), debugDir=dict(argstr='--debugDir %s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='--inputVolume %s', ), numberOfThreads=dict(argstr='--numberOfThreads %d', @@ -21,8 +15,6 @@ def test_BRAINSEyeDetector_inputs(): outputVolume=dict(argstr='--outputVolume %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = BRAINSEyeDetector._input_spec() diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSInitializedControlPoints.py b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSInitializedControlPoints.py index 8c797c777a..c977bc9f63 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSInitializedControlPoints.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSInitializedControlPoints.py @@ -6,12 +6,6 @@ def test_BRAINSInitializedControlPoints_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='--inputVolume %s', ), numberOfThreads=dict(argstr='--numberOfThreads %d', @@ -27,8 +21,6 @@ def test_BRAINSInitializedControlPoints_inputs(): splineGridSize=dict(argstr='--splineGridSize %s', sep=',', ), - terminal_output=dict(nohash=True, - ), ) inputs = BRAINSInitializedControlPoints._input_spec() diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSLandmarkInitializer.py b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSLandmarkInitializer.py index 9f358ca6c6..d91013daac 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSLandmarkInitializer.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSLandmarkInitializer.py @@ -6,12 +6,6 @@ def test_BRAINSLandmarkInitializer_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputFixedLandmarkFilename=dict(argstr='--inputFixedLandmarkFilename %s', ), inputMovingLandmarkFilename=dict(argstr='--inputMovingLandmarkFilename %s', @@ -21,8 +15,6 @@ def test_BRAINSLandmarkInitializer_inputs(): outputTransformFilename=dict(argstr='--outputTransformFilename %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = BRAINSLandmarkInitializer._input_spec() diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSLinearModelerEPCA.py b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSLinearModelerEPCA.py index 972d2a3de3..4dcdfe2c95 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSLinearModelerEPCA.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSLinearModelerEPCA.py @@ -6,18 +6,10 @@ def test_BRAINSLinearModelerEPCA_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputTrainingList=dict(argstr='--inputTrainingList %s', ), numberOfThreads=dict(argstr='--numberOfThreads %d', ), - terminal_output=dict(nohash=True, - ), ) inputs = BRAINSLinearModelerEPCA._input_spec() diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSLmkTransform.py b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSLmkTransform.py index 47472bc9f7..e2d8e69e0d 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSLmkTransform.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSLmkTransform.py @@ -6,12 +6,6 @@ def test_BRAINSLmkTransform_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputFixedLandmarks=dict(argstr='--inputFixedLandmarks %s', ), inputMovingLandmarks=dict(argstr='--inputMovingLandmarks %s', @@ -28,8 +22,6 @@ def test_BRAINSLmkTransform_inputs(): outputResampledVolume=dict(argstr='--outputResampledVolume %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = BRAINSLmkTransform._input_spec() diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSMush.py b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSMush.py index 03146d5488..89a632bca4 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSMush.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSMush.py @@ -16,12 +16,6 @@ def test_BRAINSMush_inputs(): ), desiredVariance=dict(argstr='--desiredVariance %f', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputFirstVolume=dict(argstr='--inputFirstVolume %s', ), inputMaskVolume=dict(argstr='--inputMaskVolume %s', @@ -46,8 +40,6 @@ def test_BRAINSMush_inputs(): seed=dict(argstr='--seed %s', sep=',', ), - terminal_output=dict(nohash=True, - ), upperThresholdFactor=dict(argstr='--upperThresholdFactor %f', ), upperThresholdFactorPre=dict(argstr='--upperThresholdFactorPre %f', diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSSnapShotWriter.py b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSSnapShotWriter.py index 5df1db87c8..f2f246bc24 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSSnapShotWriter.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSSnapShotWriter.py @@ -6,12 +6,6 @@ def test_BRAINSSnapShotWriter_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputBinaryVolumes=dict(argstr='--inputBinaryVolumes %s...', ), inputPlaneDirection=dict(argstr='--inputPlaneDirection %s', @@ -31,8 +25,6 @@ def test_BRAINSSnapShotWriter_inputs(): outputFilename=dict(argstr='--outputFilename %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = BRAINSSnapShotWriter._input_spec() diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSTransformConvert.py b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSTransformConvert.py index ded6481139..e8e0636e1d 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSTransformConvert.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSTransformConvert.py @@ -9,12 +9,6 @@ def test_BRAINSTransformConvert_inputs(): displacementVolume=dict(argstr='--displacementVolume %s', hash_files=False, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputTransform=dict(argstr='--inputTransform %s', ), outputPrecisionType=dict(argstr='--outputPrecisionType %s', @@ -26,8 +20,6 @@ def test_BRAINSTransformConvert_inputs(): ), referenceVolume=dict(argstr='--referenceVolume %s', ), - terminal_output=dict(nohash=True, - ), ) inputs = BRAINSTransformConvert._input_spec() diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSTrimForegroundInDirection.py b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSTrimForegroundInDirection.py index 1cfd68bc42..8e224bd3ef 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSTrimForegroundInDirection.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSTrimForegroundInDirection.py @@ -12,14 +12,8 @@ def test_BRAINSTrimForegroundInDirection_inputs(): ), directionCode=dict(argstr='--directionCode %d', ), - environ=dict(nohash=True, - usedefault=True, - ), headSizeLimit=dict(argstr='--headSizeLimit %f', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='--inputVolume %s', ), numberOfThreads=dict(argstr='--numberOfThreads %d', @@ -29,8 +23,6 @@ def test_BRAINSTrimForegroundInDirection_inputs(): outputVolume=dict(argstr='--outputVolume %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = BRAINSTrimForegroundInDirection._input_spec() diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_CleanUpOverlapLabels.py b/nipype/interfaces/semtools/utilities/tests/test_auto_CleanUpOverlapLabels.py index 34fdd2c29a..15c4236a00 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_CleanUpOverlapLabels.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_CleanUpOverlapLabels.py @@ -6,19 +6,11 @@ def test_CleanUpOverlapLabels_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputBinaryVolumes=dict(argstr='--inputBinaryVolumes %s...', ), outputBinaryVolumes=dict(argstr='--outputBinaryVolumes %s...', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = CleanUpOverlapLabels._input_spec() diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_FindCenterOfBrain.py b/nipype/interfaces/semtools/utilities/tests/test_auto_FindCenterOfBrain.py index a67175ee16..fec6cdb9f7 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_FindCenterOfBrain.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_FindCenterOfBrain.py @@ -30,18 +30,12 @@ def test_FindCenterOfBrain_inputs(): debugTrimmedImage=dict(argstr='--debugTrimmedImage %s', hash_files=False, ), - environ=dict(nohash=True, - usedefault=True, - ), generateDebugImages=dict(argstr='--generateDebugImages ', ), headSizeEstimate=dict(argstr='--headSizeEstimate %f', ), headSizeLimit=dict(argstr='--headSizeLimit %f', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), imageMask=dict(argstr='--imageMask %s', ), inputVolume=dict(argstr='--inputVolume %s', @@ -50,8 +44,6 @@ def test_FindCenterOfBrain_inputs(): ), otsuPercentileThreshold=dict(argstr='--otsuPercentileThreshold %f', ), - terminal_output=dict(nohash=True, - ), ) inputs = FindCenterOfBrain._input_spec() diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_GenerateLabelMapFromProbabilityMap.py b/nipype/interfaces/semtools/utilities/tests/test_auto_GenerateLabelMapFromProbabilityMap.py index cbd58a1fc1..e4f344fff1 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_GenerateLabelMapFromProbabilityMap.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_GenerateLabelMapFromProbabilityMap.py @@ -6,12 +6,6 @@ def test_GenerateLabelMapFromProbabilityMap_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolumes=dict(argstr='--inputVolumes %s...', ), numberOfThreads=dict(argstr='--numberOfThreads %d', @@ -19,8 +13,6 @@ def test_GenerateLabelMapFromProbabilityMap_inputs(): outputLabelVolume=dict(argstr='--outputLabelVolume %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = GenerateLabelMapFromProbabilityMap._input_spec() diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_ImageRegionPlotter.py b/nipype/interfaces/semtools/utilities/tests/test_auto_ImageRegionPlotter.py index f34a5639eb..13cefa7c00 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_ImageRegionPlotter.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_ImageRegionPlotter.py @@ -6,12 +6,6 @@ def test_ImageRegionPlotter_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputBinaryROIVolume=dict(argstr='--inputBinaryROIVolume %s', ), inputLabelVolume=dict(argstr='--inputLabelVolume %s', @@ -24,8 +18,6 @@ def test_ImageRegionPlotter_inputs(): ), outputJointHistogramData=dict(argstr='--outputJointHistogramData %s', ), - terminal_output=dict(nohash=True, - ), useIntensityForHistogram=dict(argstr='--useIntensityForHistogram ', ), useROIAUTO=dict(argstr='--useROIAUTO ', diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_JointHistogram.py b/nipype/interfaces/semtools/utilities/tests/test_auto_JointHistogram.py index 8f70ff0d00..18057644fe 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_JointHistogram.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_JointHistogram.py @@ -6,12 +6,6 @@ def test_JointHistogram_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputMaskVolumeInXAxis=dict(argstr='--inputMaskVolumeInXAxis %s', ), inputMaskVolumeInYAxis=dict(argstr='--inputMaskVolumeInYAxis %s', @@ -22,8 +16,6 @@ def test_JointHistogram_inputs(): ), outputJointHistogramImage=dict(argstr='--outputJointHistogramImage %s', ), - terminal_output=dict(nohash=True, - ), verbose=dict(argstr='--verbose ', ), ) diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_ShuffleVectorsModule.py b/nipype/interfaces/semtools/utilities/tests/test_auto_ShuffleVectorsModule.py index 4cf785e3c1..a9879e815b 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_ShuffleVectorsModule.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_ShuffleVectorsModule.py @@ -6,12 +6,6 @@ def test_ShuffleVectorsModule_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVectorFileBaseName=dict(argstr='--inputVectorFileBaseName %s', ), outputVectorFileBaseName=dict(argstr='--outputVectorFileBaseName %s', @@ -19,8 +13,6 @@ def test_ShuffleVectorsModule_inputs(): ), resampleProportion=dict(argstr='--resampleProportion %f', ), - terminal_output=dict(nohash=True, - ), ) inputs = ShuffleVectorsModule._input_spec() diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_fcsv_to_hdf5.py b/nipype/interfaces/semtools/utilities/tests/test_auto_fcsv_to_hdf5.py index ec0ddbd9fb..5bed14284f 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_fcsv_to_hdf5.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_fcsv_to_hdf5.py @@ -6,12 +6,6 @@ def test_fcsv_to_hdf5_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), landmarkGlobPattern=dict(argstr='--landmarkGlobPattern %s', ), landmarkTypesList=dict(argstr='--landmarkTypesList %s', @@ -24,8 +18,6 @@ def test_fcsv_to_hdf5_inputs(): ), numberOfThreads=dict(argstr='--numberOfThreads %d', ), - terminal_output=dict(nohash=True, - ), versionID=dict(argstr='--versionID %s', ), ) diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_insertMidACPCpoint.py b/nipype/interfaces/semtools/utilities/tests/test_auto_insertMidACPCpoint.py index 9a6f4b12a9..680f8ccd4a 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_insertMidACPCpoint.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_insertMidACPCpoint.py @@ -6,19 +6,11 @@ def test_insertMidACPCpoint_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputLandmarkFile=dict(argstr='--inputLandmarkFile %s', ), outputLandmarkFile=dict(argstr='--outputLandmarkFile %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = insertMidACPCpoint._input_spec() diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_landmarksConstellationAligner.py b/nipype/interfaces/semtools/utilities/tests/test_auto_landmarksConstellationAligner.py index 82451f5cf2..6b54c8fd79 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_landmarksConstellationAligner.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_landmarksConstellationAligner.py @@ -6,19 +6,11 @@ def test_landmarksConstellationAligner_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputLandmarksPaired=dict(argstr='--inputLandmarksPaired %s', ), outputLandmarksPaired=dict(argstr='--outputLandmarksPaired %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = landmarksConstellationAligner._input_spec() diff --git a/nipype/interfaces/semtools/utilities/tests/test_auto_landmarksConstellationWeights.py b/nipype/interfaces/semtools/utilities/tests/test_auto_landmarksConstellationWeights.py index 16d216509c..6bf9e95aeb 100644 --- a/nipype/interfaces/semtools/utilities/tests/test_auto_landmarksConstellationWeights.py +++ b/nipype/interfaces/semtools/utilities/tests/test_auto_landmarksConstellationWeights.py @@ -8,12 +8,6 @@ def test_landmarksConstellationWeights_inputs(): ), args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputTemplateModel=dict(argstr='--inputTemplateModel %s', ), inputTrainingList=dict(argstr='--inputTrainingList %s', @@ -21,8 +15,6 @@ def test_landmarksConstellationWeights_inputs(): outputWeightsList=dict(argstr='--outputWeightsList %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = landmarksConstellationWeights._input_spec() diff --git a/nipype/interfaces/slicer/diffusion/tests/test_auto_DTIexport.py b/nipype/interfaces/slicer/diffusion/tests/test_auto_DTIexport.py index fcd5ad2682..00a6edddec 100644 --- a/nipype/interfaces/slicer/diffusion/tests/test_auto_DTIexport.py +++ b/nipype/interfaces/slicer/diffusion/tests/test_auto_DTIexport.py @@ -6,12 +6,6 @@ def test_DTIexport_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputTensor=dict(argstr='%s', position=-2, ), @@ -19,8 +13,6 @@ def test_DTIexport_inputs(): hash_files=False, position=-1, ), - terminal_output=dict(nohash=True, - ), ) inputs = DTIexport._input_spec() diff --git a/nipype/interfaces/slicer/diffusion/tests/test_auto_DTIimport.py b/nipype/interfaces/slicer/diffusion/tests/test_auto_DTIimport.py index 3f84b0a28d..8c7c940d5c 100644 --- a/nipype/interfaces/slicer/diffusion/tests/test_auto_DTIimport.py +++ b/nipype/interfaces/slicer/diffusion/tests/test_auto_DTIimport.py @@ -6,12 +6,6 @@ def test_DTIimport_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputFile=dict(argstr='%s', position=-2, ), @@ -19,8 +13,6 @@ def test_DTIimport_inputs(): hash_files=False, position=-1, ), - terminal_output=dict(nohash=True, - ), testingmode=dict(argstr='--testingmode ', ), ) diff --git a/nipype/interfaces/slicer/diffusion/tests/test_auto_DWIJointRicianLMMSEFilter.py b/nipype/interfaces/slicer/diffusion/tests/test_auto_DWIJointRicianLMMSEFilter.py index 206bf37f6d..b9f9a7fcf6 100644 --- a/nipype/interfaces/slicer/diffusion/tests/test_auto_DWIJointRicianLMMSEFilter.py +++ b/nipype/interfaces/slicer/diffusion/tests/test_auto_DWIJointRicianLMMSEFilter.py @@ -8,12 +8,6 @@ def test_DWIJointRicianLMMSEFilter_inputs(): ), compressOutput=dict(argstr='--compressOutput ', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='%s', position=-2, ), @@ -29,8 +23,6 @@ def test_DWIJointRicianLMMSEFilter_inputs(): rf=dict(argstr='--rf %s', sep=',', ), - terminal_output=dict(nohash=True, - ), ) inputs = DWIJointRicianLMMSEFilter._input_spec() diff --git a/nipype/interfaces/slicer/diffusion/tests/test_auto_DWIRicianLMMSEFilter.py b/nipype/interfaces/slicer/diffusion/tests/test_auto_DWIRicianLMMSEFilter.py index 4d5227048a..23c5471c76 100644 --- a/nipype/interfaces/slicer/diffusion/tests/test_auto_DWIRicianLMMSEFilter.py +++ b/nipype/interfaces/slicer/diffusion/tests/test_auto_DWIRicianLMMSEFilter.py @@ -8,14 +8,8 @@ def test_DWIRicianLMMSEFilter_inputs(): ), compressOutput=dict(argstr='--compressOutput ', ), - environ=dict(nohash=True, - usedefault=True, - ), hrf=dict(argstr='--hrf %f', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='%s', position=-2, ), @@ -39,8 +33,6 @@ def test_DWIRicianLMMSEFilter_inputs(): rf=dict(argstr='--rf %s', sep=',', ), - terminal_output=dict(nohash=True, - ), uav=dict(argstr='--uav ', ), ) diff --git a/nipype/interfaces/slicer/diffusion/tests/test_auto_DWIToDTIEstimation.py b/nipype/interfaces/slicer/diffusion/tests/test_auto_DWIToDTIEstimation.py index af075d08c0..35a54caf79 100644 --- a/nipype/interfaces/slicer/diffusion/tests/test_auto_DWIToDTIEstimation.py +++ b/nipype/interfaces/slicer/diffusion/tests/test_auto_DWIToDTIEstimation.py @@ -8,12 +8,6 @@ def test_DWIToDTIEstimation_inputs(): ), enumeration=dict(argstr='--enumeration %s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='%s', position=-3, ), @@ -29,8 +23,6 @@ def test_DWIToDTIEstimation_inputs(): ), shiftNeg=dict(argstr='--shiftNeg ', ), - terminal_output=dict(nohash=True, - ), ) inputs = DWIToDTIEstimation._input_spec() diff --git a/nipype/interfaces/slicer/diffusion/tests/test_auto_DiffusionTensorScalarMeasurements.py b/nipype/interfaces/slicer/diffusion/tests/test_auto_DiffusionTensorScalarMeasurements.py index 111c81978d..6796dc46de 100644 --- a/nipype/interfaces/slicer/diffusion/tests/test_auto_DiffusionTensorScalarMeasurements.py +++ b/nipype/interfaces/slicer/diffusion/tests/test_auto_DiffusionTensorScalarMeasurements.py @@ -8,12 +8,6 @@ def test_DiffusionTensorScalarMeasurements_inputs(): ), enumeration=dict(argstr='--enumeration %s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='%s', position=-3, ), @@ -21,8 +15,6 @@ def test_DiffusionTensorScalarMeasurements_inputs(): hash_files=False, position=-1, ), - terminal_output=dict(nohash=True, - ), ) inputs = DiffusionTensorScalarMeasurements._input_spec() diff --git a/nipype/interfaces/slicer/diffusion/tests/test_auto_DiffusionWeightedVolumeMasking.py b/nipype/interfaces/slicer/diffusion/tests/test_auto_DiffusionWeightedVolumeMasking.py index b63c1759b4..3224d2a4e7 100644 --- a/nipype/interfaces/slicer/diffusion/tests/test_auto_DiffusionWeightedVolumeMasking.py +++ b/nipype/interfaces/slicer/diffusion/tests/test_auto_DiffusionWeightedVolumeMasking.py @@ -6,12 +6,6 @@ def test_DiffusionWeightedVolumeMasking_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='%s', position=-4, ), @@ -23,8 +17,6 @@ def test_DiffusionWeightedVolumeMasking_inputs(): ), removeislands=dict(argstr='--removeislands ', ), - terminal_output=dict(nohash=True, - ), thresholdMask=dict(argstr='%s', hash_files=False, position=-1, diff --git a/nipype/interfaces/slicer/diffusion/tests/test_auto_ResampleDTIVolume.py b/nipype/interfaces/slicer/diffusion/tests/test_auto_ResampleDTIVolume.py index fb712a6a82..9f3b17caf6 100644 --- a/nipype/interfaces/slicer/diffusion/tests/test_auto_ResampleDTIVolume.py +++ b/nipype/interfaces/slicer/diffusion/tests/test_auto_ResampleDTIVolume.py @@ -21,14 +21,8 @@ def test_ResampleDTIVolume_inputs(): direction_matrix=dict(argstr='--direction_matrix %s', sep=',', ), - environ=dict(nohash=True, - usedefault=True, - ), hfieldtype=dict(argstr='--hfieldtype %s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), image_center=dict(argstr='--image_center %s', ), inputVolume=dict(argstr='%s', @@ -58,8 +52,6 @@ def test_ResampleDTIVolume_inputs(): ), spline_order=dict(argstr='--spline_order %d', ), - terminal_output=dict(nohash=True, - ), transform=dict(argstr='--transform %s', ), transform_matrix=dict(argstr='--transform_matrix %s', diff --git a/nipype/interfaces/slicer/diffusion/tests/test_auto_TractographyLabelMapSeeding.py b/nipype/interfaces/slicer/diffusion/tests/test_auto_TractographyLabelMapSeeding.py index c5a6f39bd5..0738ea703a 100644 --- a/nipype/interfaces/slicer/diffusion/tests/test_auto_TractographyLabelMapSeeding.py +++ b/nipype/interfaces/slicer/diffusion/tests/test_auto_TractographyLabelMapSeeding.py @@ -15,12 +15,6 @@ def test_TractographyLabelMapSeeding_inputs(): ), clthreshold=dict(argstr='--clthreshold %f', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputroi=dict(argstr='--inputroi %s', ), integrationsteplength=dict(argstr='--integrationsteplength %f', @@ -46,8 +40,6 @@ def test_TractographyLabelMapSeeding_inputs(): ), stoppingvalue=dict(argstr='--stoppingvalue %f', ), - terminal_output=dict(nohash=True, - ), useindexspace=dict(argstr='--useindexspace ', ), writetofile=dict(argstr='--writetofile ', diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_AddScalarVolumes.py b/nipype/interfaces/slicer/filtering/tests/test_auto_AddScalarVolumes.py index 70970d6c79..1b9c2e3333 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_AddScalarVolumes.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_AddScalarVolumes.py @@ -6,12 +6,6 @@ def test_AddScalarVolumes_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume1=dict(argstr='%s', position=-3, ), @@ -24,8 +18,6 @@ def test_AddScalarVolumes_inputs(): hash_files=False, position=-1, ), - terminal_output=dict(nohash=True, - ), ) inputs = AddScalarVolumes._input_spec() diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_CastScalarVolume.py b/nipype/interfaces/slicer/filtering/tests/test_auto_CastScalarVolume.py index 6011d09351..d50c7d353c 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_CastScalarVolume.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_CastScalarVolume.py @@ -13,14 +13,6 @@ def test_CastScalarVolume_inputs(): ), args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), - terminal_output=dict(nohash=True, - ), type=dict(argstr='--type %s', ), ) diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_CheckerBoardFilter.py b/nipype/interfaces/slicer/filtering/tests/test_auto_CheckerBoardFilter.py index bb42406c75..3a021dd639 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_CheckerBoardFilter.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_CheckerBoardFilter.py @@ -9,12 +9,6 @@ def test_CheckerBoardFilter_inputs(): checkerPattern=dict(argstr='--checkerPattern %s', sep=',', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume1=dict(argstr='%s', position=-3, ), @@ -25,8 +19,6 @@ def test_CheckerBoardFilter_inputs(): hash_files=False, position=-1, ), - terminal_output=dict(nohash=True, - ), ) inputs = CheckerBoardFilter._input_spec() diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_CurvatureAnisotropicDiffusion.py b/nipype/interfaces/slicer/filtering/tests/test_auto_CurvatureAnisotropicDiffusion.py index 46367ab986..1672914d3a 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_CurvatureAnisotropicDiffusion.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_CurvatureAnisotropicDiffusion.py @@ -8,12 +8,6 @@ def test_CurvatureAnisotropicDiffusion_inputs(): ), conductance=dict(argstr='--conductance %f', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='%s', position=-2, ), @@ -23,8 +17,6 @@ def test_CurvatureAnisotropicDiffusion_inputs(): hash_files=False, position=-1, ), - terminal_output=dict(nohash=True, - ), timeStep=dict(argstr='--timeStep %f', ), ) diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_ExtractSkeleton.py b/nipype/interfaces/slicer/filtering/tests/test_auto_ExtractSkeleton.py index de7eb87a1b..4600971852 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_ExtractSkeleton.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_ExtractSkeleton.py @@ -15,18 +15,10 @@ def test_ExtractSkeleton_inputs(): ), dontPrune=dict(argstr='--dontPrune ', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), numPoints=dict(argstr='--numPoints %d', ), pointsFile=dict(argstr='--pointsFile %s', ), - terminal_output=dict(nohash=True, - ), type=dict(argstr='--type %s', ), ) diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_GaussianBlurImageFilter.py b/nipype/interfaces/slicer/filtering/tests/test_auto_GaussianBlurImageFilter.py index 2c32d58f72..3da58c4528 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_GaussianBlurImageFilter.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_GaussianBlurImageFilter.py @@ -6,12 +6,6 @@ def test_GaussianBlurImageFilter_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='%s', position=-2, ), @@ -21,8 +15,6 @@ def test_GaussianBlurImageFilter_inputs(): ), sigma=dict(argstr='--sigma %f', ), - terminal_output=dict(nohash=True, - ), ) inputs = GaussianBlurImageFilter._input_spec() diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_GradientAnisotropicDiffusion.py b/nipype/interfaces/slicer/filtering/tests/test_auto_GradientAnisotropicDiffusion.py index 9416e18b94..d35c59b987 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_GradientAnisotropicDiffusion.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_GradientAnisotropicDiffusion.py @@ -8,12 +8,6 @@ def test_GradientAnisotropicDiffusion_inputs(): ), conductance=dict(argstr='--conductance %f', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='%s', position=-2, ), @@ -23,8 +17,6 @@ def test_GradientAnisotropicDiffusion_inputs(): hash_files=False, position=-1, ), - terminal_output=dict(nohash=True, - ), timeStep=dict(argstr='--timeStep %f', ), ) diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_GrayscaleFillHoleImageFilter.py b/nipype/interfaces/slicer/filtering/tests/test_auto_GrayscaleFillHoleImageFilter.py index c1e0247e3a..ef630583d7 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_GrayscaleFillHoleImageFilter.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_GrayscaleFillHoleImageFilter.py @@ -6,12 +6,6 @@ def test_GrayscaleFillHoleImageFilter_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='%s', position=-2, ), @@ -19,8 +13,6 @@ def test_GrayscaleFillHoleImageFilter_inputs(): hash_files=False, position=-1, ), - terminal_output=dict(nohash=True, - ), ) inputs = GrayscaleFillHoleImageFilter._input_spec() diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_GrayscaleGrindPeakImageFilter.py b/nipype/interfaces/slicer/filtering/tests/test_auto_GrayscaleGrindPeakImageFilter.py index 11751b5c83..2656bbd242 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_GrayscaleGrindPeakImageFilter.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_GrayscaleGrindPeakImageFilter.py @@ -6,12 +6,6 @@ def test_GrayscaleGrindPeakImageFilter_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='%s', position=-2, ), @@ -19,8 +13,6 @@ def test_GrayscaleGrindPeakImageFilter_inputs(): hash_files=False, position=-1, ), - terminal_output=dict(nohash=True, - ), ) inputs = GrayscaleGrindPeakImageFilter._input_spec() diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_HistogramMatching.py b/nipype/interfaces/slicer/filtering/tests/test_auto_HistogramMatching.py index f08e2400c0..59fb5cb682 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_HistogramMatching.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_HistogramMatching.py @@ -6,12 +6,6 @@ def test_HistogramMatching_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='%s', position=-3, ), @@ -26,8 +20,6 @@ def test_HistogramMatching_inputs(): referenceVolume=dict(argstr='%s', position=-2, ), - terminal_output=dict(nohash=True, - ), threshold=dict(argstr='--threshold ', ), ) diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_ImageLabelCombine.py b/nipype/interfaces/slicer/filtering/tests/test_auto_ImageLabelCombine.py index 7bab8726c5..e5796c6a90 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_ImageLabelCombine.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_ImageLabelCombine.py @@ -16,16 +16,8 @@ def test_ImageLabelCombine_inputs(): ), args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), first_overwrites=dict(argstr='--first_overwrites ', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), - terminal_output=dict(nohash=True, - ), ) inputs = ImageLabelCombine._input_spec() diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_MaskScalarVolume.py b/nipype/interfaces/slicer/filtering/tests/test_auto_MaskScalarVolume.py index 04fc4e0823..c3e95526b2 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_MaskScalarVolume.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_MaskScalarVolume.py @@ -16,18 +16,10 @@ def test_MaskScalarVolume_inputs(): ), args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), label=dict(argstr='--label %d', ), replace=dict(argstr='--replace %d', ), - terminal_output=dict(nohash=True, - ), ) inputs = MaskScalarVolume._input_spec() diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_MedianImageFilter.py b/nipype/interfaces/slicer/filtering/tests/test_auto_MedianImageFilter.py index 6f43ff183f..a807b91c2d 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_MedianImageFilter.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_MedianImageFilter.py @@ -6,12 +6,6 @@ def test_MedianImageFilter_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='%s', position=-2, ), @@ -22,8 +16,6 @@ def test_MedianImageFilter_inputs(): hash_files=False, position=-1, ), - terminal_output=dict(nohash=True, - ), ) inputs = MedianImageFilter._input_spec() diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_MultiplyScalarVolumes.py b/nipype/interfaces/slicer/filtering/tests/test_auto_MultiplyScalarVolumes.py index 2342105bc8..1e9c7dd114 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_MultiplyScalarVolumes.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_MultiplyScalarVolumes.py @@ -6,12 +6,6 @@ def test_MultiplyScalarVolumes_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume1=dict(argstr='%s', position=-3, ), @@ -24,8 +18,6 @@ def test_MultiplyScalarVolumes_inputs(): hash_files=False, position=-1, ), - terminal_output=dict(nohash=True, - ), ) inputs = MultiplyScalarVolumes._input_spec() diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_N4ITKBiasFieldCorrection.py b/nipype/interfaces/slicer/filtering/tests/test_auto_N4ITKBiasFieldCorrection.py index 299a42f058..fbbce40ad5 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_N4ITKBiasFieldCorrection.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_N4ITKBiasFieldCorrection.py @@ -10,15 +10,9 @@ def test_N4ITKBiasFieldCorrection_inputs(): ), convergencethreshold=dict(argstr='--convergencethreshold %f', ), - environ=dict(nohash=True, - usedefault=True, - ), histogramsharpening=dict(argstr='--histogramsharpening %s', sep=',', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputimage=dict(argstr='--inputimage %s', ), iterations=dict(argstr='--iterations %s', @@ -39,8 +33,6 @@ def test_N4ITKBiasFieldCorrection_inputs(): ), splinedistance=dict(argstr='--splinedistance %f', ), - terminal_output=dict(nohash=True, - ), weightimage=dict(argstr='--weightimage %s', ), ) diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_ResampleScalarVectorDWIVolume.py b/nipype/interfaces/slicer/filtering/tests/test_auto_ResampleScalarVectorDWIVolume.py index 4edbf65353..68eee6f8f3 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_ResampleScalarVectorDWIVolume.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_ResampleScalarVectorDWIVolume.py @@ -19,14 +19,8 @@ def test_ResampleScalarVectorDWIVolume_inputs(): direction_matrix=dict(argstr='--direction_matrix %s', sep=',', ), - environ=dict(nohash=True, - usedefault=True, - ), hfieldtype=dict(argstr='--hfieldtype %s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), image_center=dict(argstr='--image_center %s', ), inputVolume=dict(argstr='%s', @@ -56,8 +50,6 @@ def test_ResampleScalarVectorDWIVolume_inputs(): ), spline_order=dict(argstr='--spline_order %d', ), - terminal_output=dict(nohash=True, - ), transform=dict(argstr='--transform %s', ), transform_matrix=dict(argstr='--transform_matrix %s', diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_SubtractScalarVolumes.py b/nipype/interfaces/slicer/filtering/tests/test_auto_SubtractScalarVolumes.py index 7085c0aef0..9141acff1c 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_SubtractScalarVolumes.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_SubtractScalarVolumes.py @@ -6,12 +6,6 @@ def test_SubtractScalarVolumes_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume1=dict(argstr='%s', position=-3, ), @@ -24,8 +18,6 @@ def test_SubtractScalarVolumes_inputs(): hash_files=False, position=-1, ), - terminal_output=dict(nohash=True, - ), ) inputs = SubtractScalarVolumes._input_spec() diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_ThresholdScalarVolume.py b/nipype/interfaces/slicer/filtering/tests/test_auto_ThresholdScalarVolume.py index 481856a1bd..e9e4bc7c9b 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_ThresholdScalarVolume.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_ThresholdScalarVolume.py @@ -13,18 +13,10 @@ def test_ThresholdScalarVolume_inputs(): ), args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), lower=dict(argstr='--lower %d', ), outsidevalue=dict(argstr='--outsidevalue %d', ), - terminal_output=dict(nohash=True, - ), threshold=dict(argstr='--threshold %d', ), thresholdtype=dict(argstr='--thresholdtype %s', diff --git a/nipype/interfaces/slicer/filtering/tests/test_auto_VotingBinaryHoleFillingImageFilter.py b/nipype/interfaces/slicer/filtering/tests/test_auto_VotingBinaryHoleFillingImageFilter.py index 07a9b65939..61fd1ee5b6 100644 --- a/nipype/interfaces/slicer/filtering/tests/test_auto_VotingBinaryHoleFillingImageFilter.py +++ b/nipype/interfaces/slicer/filtering/tests/test_auto_VotingBinaryHoleFillingImageFilter.py @@ -8,14 +8,8 @@ def test_VotingBinaryHoleFillingImageFilter_inputs(): ), background=dict(argstr='--background %d', ), - environ=dict(nohash=True, - usedefault=True, - ), foreground=dict(argstr='--foreground %d', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='%s', position=-2, ), @@ -28,8 +22,6 @@ def test_VotingBinaryHoleFillingImageFilter_inputs(): radius=dict(argstr='--radius %s', sep=',', ), - terminal_output=dict(nohash=True, - ), ) inputs = VotingBinaryHoleFillingImageFilter._input_spec() diff --git a/nipype/interfaces/slicer/legacy/diffusion/tests/test_auto_DWIUnbiasedNonLocalMeansFilter.py b/nipype/interfaces/slicer/legacy/diffusion/tests/test_auto_DWIUnbiasedNonLocalMeansFilter.py index 6ac11f68f2..a767389d39 100644 --- a/nipype/interfaces/slicer/legacy/diffusion/tests/test_auto_DWIUnbiasedNonLocalMeansFilter.py +++ b/nipype/interfaces/slicer/legacy/diffusion/tests/test_auto_DWIUnbiasedNonLocalMeansFilter.py @@ -6,14 +6,8 @@ def test_DWIUnbiasedNonLocalMeansFilter_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), hp=dict(argstr='--hp %f', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='%s', position=-2, ), @@ -32,8 +26,6 @@ def test_DWIUnbiasedNonLocalMeansFilter_inputs(): rs=dict(argstr='--rs %s', sep=',', ), - terminal_output=dict(nohash=True, - ), ) inputs = DWIUnbiasedNonLocalMeansFilter._input_spec() diff --git a/nipype/interfaces/slicer/legacy/tests/test_auto_AffineRegistration.py b/nipype/interfaces/slicer/legacy/tests/test_auto_AffineRegistration.py index f745a3d3ce..8eb0a55d05 100644 --- a/nipype/interfaces/slicer/legacy/tests/test_auto_AffineRegistration.py +++ b/nipype/interfaces/slicer/legacy/tests/test_auto_AffineRegistration.py @@ -12,16 +12,10 @@ def test_AffineRegistration_inputs(): ), args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), fixedsmoothingfactor=dict(argstr='--fixedsmoothingfactor %d', ), histogrambins=dict(argstr='--histogrambins %d', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), initialtransform=dict(argstr='--initialtransform %s', ), iterations=dict(argstr='--iterations %d', @@ -36,8 +30,6 @@ def test_AffineRegistration_inputs(): ), spatialsamples=dict(argstr='--spatialsamples %d', ), - terminal_output=dict(nohash=True, - ), translationscale=dict(argstr='--translationscale %f', ), ) diff --git a/nipype/interfaces/slicer/legacy/tests/test_auto_BSplineDeformableRegistration.py b/nipype/interfaces/slicer/legacy/tests/test_auto_BSplineDeformableRegistration.py index 3e1ac64655..27a7804951 100644 --- a/nipype/interfaces/slicer/legacy/tests/test_auto_BSplineDeformableRegistration.py +++ b/nipype/interfaces/slicer/legacy/tests/test_auto_BSplineDeformableRegistration.py @@ -16,16 +16,10 @@ def test_BSplineDeformableRegistration_inputs(): ), default=dict(argstr='--default %d', ), - environ=dict(nohash=True, - usedefault=True, - ), gridSize=dict(argstr='--gridSize %d', ), histogrambins=dict(argstr='--histogrambins %d', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), initialtransform=dict(argstr='--initialtransform %s', ), iterations=dict(argstr='--iterations %d', @@ -43,8 +37,6 @@ def test_BSplineDeformableRegistration_inputs(): ), spatialsamples=dict(argstr='--spatialsamples %d', ), - terminal_output=dict(nohash=True, - ), ) inputs = BSplineDeformableRegistration._input_spec() diff --git a/nipype/interfaces/slicer/legacy/tests/test_auto_BSplineToDeformationField.py b/nipype/interfaces/slicer/legacy/tests/test_auto_BSplineToDeformationField.py index a8f1508c66..550567ed02 100644 --- a/nipype/interfaces/slicer/legacy/tests/test_auto_BSplineToDeformationField.py +++ b/nipype/interfaces/slicer/legacy/tests/test_auto_BSplineToDeformationField.py @@ -9,16 +9,8 @@ def test_BSplineToDeformationField_inputs(): defImage=dict(argstr='--defImage %s', hash_files=False, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), refImage=dict(argstr='--refImage %s', ), - terminal_output=dict(nohash=True, - ), tfm=dict(argstr='--tfm %s', ), ) diff --git a/nipype/interfaces/slicer/legacy/tests/test_auto_ExpertAutomatedRegistration.py b/nipype/interfaces/slicer/legacy/tests/test_auto_ExpertAutomatedRegistration.py index a9004ecdd7..81b2af4c43 100644 --- a/nipype/interfaces/slicer/legacy/tests/test_auto_ExpertAutomatedRegistration.py +++ b/nipype/interfaces/slicer/legacy/tests/test_auto_ExpertAutomatedRegistration.py @@ -16,9 +16,6 @@ def test_ExpertAutomatedRegistration_inputs(): ), controlPointSpacing=dict(argstr='--controlPointSpacing %d', ), - environ=dict(nohash=True, - usedefault=True, - ), expectedOffset=dict(argstr='--expectedOffset %f', ), expectedRotation=dict(argstr='--expectedRotation %f', @@ -34,9 +31,6 @@ def test_ExpertAutomatedRegistration_inputs(): ), fixedLandmarks=dict(argstr='--fixedLandmarks %s...', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), initialization=dict(argstr='--initialization %s', ), interpolation=dict(argstr='--interpolation %s', @@ -70,8 +64,6 @@ def test_ExpertAutomatedRegistration_inputs(): saveTransform=dict(argstr='--saveTransform %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), verbosityLevel=dict(argstr='--verbosityLevel %s', ), ) diff --git a/nipype/interfaces/slicer/legacy/tests/test_auto_LinearRegistration.py b/nipype/interfaces/slicer/legacy/tests/test_auto_LinearRegistration.py index 5fbb385b92..f0d0b13eb1 100644 --- a/nipype/interfaces/slicer/legacy/tests/test_auto_LinearRegistration.py +++ b/nipype/interfaces/slicer/legacy/tests/test_auto_LinearRegistration.py @@ -12,16 +12,10 @@ def test_LinearRegistration_inputs(): ), args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), fixedsmoothingfactor=dict(argstr='--fixedsmoothingfactor %d', ), histogrambins=dict(argstr='--histogrambins %d', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), initialtransform=dict(argstr='--initialtransform %s', ), iterations=dict(argstr='--iterations %s', @@ -40,8 +34,6 @@ def test_LinearRegistration_inputs(): ), spatialsamples=dict(argstr='--spatialsamples %d', ), - terminal_output=dict(nohash=True, - ), translationscale=dict(argstr='--translationscale %f', ), ) diff --git a/nipype/interfaces/slicer/legacy/tests/test_auto_MultiResolutionAffineRegistration.py b/nipype/interfaces/slicer/legacy/tests/test_auto_MultiResolutionAffineRegistration.py index 87d08c4375..b73c01fda7 100644 --- a/nipype/interfaces/slicer/legacy/tests/test_auto_MultiResolutionAffineRegistration.py +++ b/nipype/interfaces/slicer/legacy/tests/test_auto_MultiResolutionAffineRegistration.py @@ -6,9 +6,6 @@ def test_MultiResolutionAffineRegistration_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), fixedImage=dict(argstr='%s', position=-2, ), @@ -16,9 +13,6 @@ def test_MultiResolutionAffineRegistration_inputs(): ), fixedImageROI=dict(argstr='--fixedImageROI %s', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), metricTolerance=dict(argstr='--metricTolerance %f', ), movingImage=dict(argstr='%s', @@ -38,8 +32,6 @@ def test_MultiResolutionAffineRegistration_inputs(): ), stepTolerance=dict(argstr='--stepTolerance %f', ), - terminal_output=dict(nohash=True, - ), ) inputs = MultiResolutionAffineRegistration._input_spec() diff --git a/nipype/interfaces/slicer/legacy/tests/test_auto_OtsuThresholdImageFilter.py b/nipype/interfaces/slicer/legacy/tests/test_auto_OtsuThresholdImageFilter.py index 5053c3933b..92a35d995e 100644 --- a/nipype/interfaces/slicer/legacy/tests/test_auto_OtsuThresholdImageFilter.py +++ b/nipype/interfaces/slicer/legacy/tests/test_auto_OtsuThresholdImageFilter.py @@ -6,12 +6,6 @@ def test_OtsuThresholdImageFilter_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='%s', position=-2, ), @@ -25,8 +19,6 @@ def test_OtsuThresholdImageFilter_inputs(): ), outsideValue=dict(argstr='--outsideValue %d', ), - terminal_output=dict(nohash=True, - ), ) inputs = OtsuThresholdImageFilter._input_spec() diff --git a/nipype/interfaces/slicer/legacy/tests/test_auto_OtsuThresholdSegmentation.py b/nipype/interfaces/slicer/legacy/tests/test_auto_OtsuThresholdSegmentation.py index 2ef8ed4b04..a8c9abfecd 100644 --- a/nipype/interfaces/slicer/legacy/tests/test_auto_OtsuThresholdSegmentation.py +++ b/nipype/interfaces/slicer/legacy/tests/test_auto_OtsuThresholdSegmentation.py @@ -8,14 +8,8 @@ def test_OtsuThresholdSegmentation_inputs(): ), brightObjects=dict(argstr='--brightObjects ', ), - environ=dict(nohash=True, - usedefault=True, - ), faceConnected=dict(argstr='--faceConnected ', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='%s', position=-2, ), @@ -27,8 +21,6 @@ def test_OtsuThresholdSegmentation_inputs(): hash_files=False, position=-1, ), - terminal_output=dict(nohash=True, - ), ) inputs = OtsuThresholdSegmentation._input_spec() diff --git a/nipype/interfaces/slicer/legacy/tests/test_auto_ResampleScalarVolume.py b/nipype/interfaces/slicer/legacy/tests/test_auto_ResampleScalarVolume.py index 0a42210902..56f321520e 100644 --- a/nipype/interfaces/slicer/legacy/tests/test_auto_ResampleScalarVolume.py +++ b/nipype/interfaces/slicer/legacy/tests/test_auto_ResampleScalarVolume.py @@ -13,19 +13,11 @@ def test_ResampleScalarVolume_inputs(): ), args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), interpolation=dict(argstr='--interpolation %s', ), spacing=dict(argstr='--spacing %s', sep=',', ), - terminal_output=dict(nohash=True, - ), ) inputs = ResampleScalarVolume._input_spec() diff --git a/nipype/interfaces/slicer/legacy/tests/test_auto_RigidRegistration.py b/nipype/interfaces/slicer/legacy/tests/test_auto_RigidRegistration.py index 4922dc8253..ffd784ae05 100644 --- a/nipype/interfaces/slicer/legacy/tests/test_auto_RigidRegistration.py +++ b/nipype/interfaces/slicer/legacy/tests/test_auto_RigidRegistration.py @@ -12,16 +12,10 @@ def test_RigidRegistration_inputs(): ), args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), fixedsmoothingfactor=dict(argstr='--fixedsmoothingfactor %d', ), histogrambins=dict(argstr='--histogrambins %d', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), initialtransform=dict(argstr='--initialtransform %s', ), iterations=dict(argstr='--iterations %s', @@ -40,8 +34,6 @@ def test_RigidRegistration_inputs(): ), spatialsamples=dict(argstr='--spatialsamples %d', ), - terminal_output=dict(nohash=True, - ), testingmode=dict(argstr='--testingmode ', ), translationscale=dict(argstr='--translationscale %f', diff --git a/nipype/interfaces/slicer/quantification/tests/test_auto_IntensityDifferenceMetric.py b/nipype/interfaces/slicer/quantification/tests/test_auto_IntensityDifferenceMetric.py index 9c77d1e64a..cd1a3f217c 100644 --- a/nipype/interfaces/slicer/quantification/tests/test_auto_IntensityDifferenceMetric.py +++ b/nipype/interfaces/slicer/quantification/tests/test_auto_IntensityDifferenceMetric.py @@ -14,15 +14,9 @@ def test_IntensityDifferenceMetric_inputs(): ), changingBandSize=dict(argstr='--changingBandSize %d', ), - environ=dict(nohash=True, - usedefault=True, - ), followupVolume=dict(argstr='%s', position=-2, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), outputVolume=dict(argstr='%s', hash_files=False, position=-1, @@ -32,8 +26,6 @@ def test_IntensityDifferenceMetric_inputs(): ), sensitivityThreshold=dict(argstr='--sensitivityThreshold %f', ), - terminal_output=dict(nohash=True, - ), ) inputs = IntensityDifferenceMetric._input_spec() diff --git a/nipype/interfaces/slicer/quantification/tests/test_auto_PETStandardUptakeValueComputation.py b/nipype/interfaces/slicer/quantification/tests/test_auto_PETStandardUptakeValueComputation.py index d04775207e..bea58bbb79 100644 --- a/nipype/interfaces/slicer/quantification/tests/test_auto_PETStandardUptakeValueComputation.py +++ b/nipype/interfaces/slicer/quantification/tests/test_auto_PETStandardUptakeValueComputation.py @@ -21,20 +21,12 @@ def test_PETStandardUptakeValueComputation_inputs(): csvFile=dict(argstr='--csvFile %s', hash_files=False, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), labelMap=dict(argstr='--labelMap %s', ), petDICOMPath=dict(argstr='--petDICOMPath %s', ), petVolume=dict(argstr='--petVolume %s', ), - terminal_output=dict(nohash=True, - ), ) inputs = PETStandardUptakeValueComputation._input_spec() diff --git a/nipype/interfaces/slicer/registration/tests/test_auto_ACPCTransform.py b/nipype/interfaces/slicer/registration/tests/test_auto_ACPCTransform.py index 780ada5993..44e462bd6d 100644 --- a/nipype/interfaces/slicer/registration/tests/test_auto_ACPCTransform.py +++ b/nipype/interfaces/slicer/registration/tests/test_auto_ACPCTransform.py @@ -10,19 +10,11 @@ def test_ACPCTransform_inputs(): ), debugSwitch=dict(argstr='--debugSwitch ', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), midline=dict(argstr='--midline %s...', ), outputTransform=dict(argstr='--outputTransform %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), ) inputs = ACPCTransform._input_spec() diff --git a/nipype/interfaces/slicer/registration/tests/test_auto_BRAINSDemonWarp.py b/nipype/interfaces/slicer/registration/tests/test_auto_BRAINSDemonWarp.py index ef16a5cb57..4c61038378 100644 --- a/nipype/interfaces/slicer/registration/tests/test_auto_BRAINSDemonWarp.py +++ b/nipype/interfaces/slicer/registration/tests/test_auto_BRAINSDemonWarp.py @@ -14,9 +14,6 @@ def test_BRAINSDemonWarp_inputs(): checkerboardPatternSubdivisions=dict(argstr='--checkerboardPatternSubdivisions %s', sep=',', ), - environ=dict(nohash=True, - usedefault=True, - ), fixedBinaryVolume=dict(argstr='--fixedBinaryVolume %s', ), fixedVolume=dict(argstr='--fixedVolume %s', @@ -27,9 +24,6 @@ def test_BRAINSDemonWarp_inputs(): ), histogramMatch=dict(argstr='--histogramMatch ', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), initializeWithDisplacementField=dict(argstr='--initializeWithDisplacementField %s', ), initializeWithTransform=dict(argstr='--initializeWithTransform %s', @@ -96,8 +90,6 @@ def test_BRAINSDemonWarp_inputs(): ), smoothDisplacementFieldSigma=dict(argstr='--smoothDisplacementFieldSigma %f', ), - terminal_output=dict(nohash=True, - ), upFieldSmoothing=dict(argstr='--upFieldSmoothing %f', ), upperThresholdForBOBF=dict(argstr='--upperThresholdForBOBF %d', diff --git a/nipype/interfaces/slicer/registration/tests/test_auto_BRAINSFit.py b/nipype/interfaces/slicer/registration/tests/test_auto_BRAINSFit.py index 9c75a29c27..870c04caae 100644 --- a/nipype/interfaces/slicer/registration/tests/test_auto_BRAINSFit.py +++ b/nipype/interfaces/slicer/registration/tests/test_auto_BRAINSFit.py @@ -27,9 +27,6 @@ def test_BRAINSFit_inputs(): ), debugLevel=dict(argstr='--debugLevel %d', ), - environ=dict(nohash=True, - usedefault=True, - ), failureExitCode=dict(argstr='--failureExitCode %d', ), fixedBinaryVolume=dict(argstr='--fixedBinaryVolume %s', @@ -44,9 +41,6 @@ def test_BRAINSFit_inputs(): ), histogramMatch=dict(argstr='--histogramMatch ', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), initialTransform=dict(argstr='--initialTransform %s', ), initializeTransformMode=dict(argstr='--initializeTransformMode %s', @@ -124,8 +118,6 @@ def test_BRAINSFit_inputs(): strippedOutputTransform=dict(argstr='--strippedOutputTransform %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), transformType=dict(argstr='--transformType %s', sep=',', ), diff --git a/nipype/interfaces/slicer/registration/tests/test_auto_BRAINSResample.py b/nipype/interfaces/slicer/registration/tests/test_auto_BRAINSResample.py index abc2cb27e1..470e7d3cee 100644 --- a/nipype/interfaces/slicer/registration/tests/test_auto_BRAINSResample.py +++ b/nipype/interfaces/slicer/registration/tests/test_auto_BRAINSResample.py @@ -10,15 +10,9 @@ def test_BRAINSResample_inputs(): ), deformationVolume=dict(argstr='--deformationVolume %s', ), - environ=dict(nohash=True, - usedefault=True, - ), gridSpacing=dict(argstr='--gridSpacing %s', sep=',', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='--inputVolume %s', ), interpolationMode=dict(argstr='--interpolationMode %s', @@ -34,8 +28,6 @@ def test_BRAINSResample_inputs(): ), referenceVolume=dict(argstr='--referenceVolume %s', ), - terminal_output=dict(nohash=True, - ), warpTransform=dict(argstr='--warpTransform %s', ), ) diff --git a/nipype/interfaces/slicer/registration/tests/test_auto_FiducialRegistration.py b/nipype/interfaces/slicer/registration/tests/test_auto_FiducialRegistration.py index caf6ac37c8..511882a418 100644 --- a/nipype/interfaces/slicer/registration/tests/test_auto_FiducialRegistration.py +++ b/nipype/interfaces/slicer/registration/tests/test_auto_FiducialRegistration.py @@ -6,14 +6,8 @@ def test_FiducialRegistration_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), fixedLandmarks=dict(argstr='--fixedLandmarks %s...', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), movingLandmarks=dict(argstr='--movingLandmarks %s...', ), outputMessage=dict(argstr='--outputMessage %s', @@ -23,8 +17,6 @@ def test_FiducialRegistration_inputs(): saveTransform=dict(argstr='--saveTransform %s', hash_files=False, ), - terminal_output=dict(nohash=True, - ), transformType=dict(argstr='--transformType %s', ), ) diff --git a/nipype/interfaces/slicer/registration/tests/test_auto_VBRAINSDemonWarp.py b/nipype/interfaces/slicer/registration/tests/test_auto_VBRAINSDemonWarp.py index af920f8f80..a29428faaf 100644 --- a/nipype/interfaces/slicer/registration/tests/test_auto_VBRAINSDemonWarp.py +++ b/nipype/interfaces/slicer/registration/tests/test_auto_VBRAINSDemonWarp.py @@ -14,9 +14,6 @@ def test_VBRAINSDemonWarp_inputs(): checkerboardPatternSubdivisions=dict(argstr='--checkerboardPatternSubdivisions %s', sep=',', ), - environ=dict(nohash=True, - usedefault=True, - ), fixedBinaryVolume=dict(argstr='--fixedBinaryVolume %s', ), fixedVolume=dict(argstr='--fixedVolume %s...', @@ -27,9 +24,6 @@ def test_VBRAINSDemonWarp_inputs(): ), histogramMatch=dict(argstr='--histogramMatch ', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), initializeWithDisplacementField=dict(argstr='--initializeWithDisplacementField %s', ), initializeWithTransform=dict(argstr='--initializeWithTransform %s', @@ -96,8 +90,6 @@ def test_VBRAINSDemonWarp_inputs(): ), smoothDisplacementFieldSigma=dict(argstr='--smoothDisplacementFieldSigma %f', ), - terminal_output=dict(nohash=True, - ), upFieldSmoothing=dict(argstr='--upFieldSmoothing %f', ), upperThresholdForBOBF=dict(argstr='--upperThresholdForBOBF %d', diff --git a/nipype/interfaces/slicer/segmentation/tests/test_auto_BRAINSROIAuto.py b/nipype/interfaces/slicer/segmentation/tests/test_auto_BRAINSROIAuto.py index 9efdaeb554..6918b1cee3 100644 --- a/nipype/interfaces/slicer/segmentation/tests/test_auto_BRAINSROIAuto.py +++ b/nipype/interfaces/slicer/segmentation/tests/test_auto_BRAINSROIAuto.py @@ -10,12 +10,6 @@ def test_BRAINSROIAuto_inputs(): ), closingSize=dict(argstr='--closingSize %f', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='--inputVolume %s', ), numberOfThreads=dict(argstr='--numberOfThreads %d', @@ -30,8 +24,6 @@ def test_BRAINSROIAuto_inputs(): ), outputVolumePixelType=dict(argstr='--outputVolumePixelType %s', ), - terminal_output=dict(nohash=True, - ), thresholdCorrectionFactor=dict(argstr='--thresholdCorrectionFactor %f', ), ) diff --git a/nipype/interfaces/slicer/segmentation/tests/test_auto_EMSegmentCommandLine.py b/nipype/interfaces/slicer/segmentation/tests/test_auto_EMSegmentCommandLine.py index b49794b479..a99479ce2b 100644 --- a/nipype/interfaces/slicer/segmentation/tests/test_auto_EMSegmentCommandLine.py +++ b/nipype/interfaces/slicer/segmentation/tests/test_auto_EMSegmentCommandLine.py @@ -16,15 +16,9 @@ def test_EMSegmentCommandLine_inputs(): ), dontWriteResults=dict(argstr='--dontWriteResults ', ), - environ=dict(nohash=True, - usedefault=True, - ), generateEmptyMRMLSceneAndQuit=dict(argstr='--generateEmptyMRMLSceneAndQuit %s', hash_files=False, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), intermediateResultsDirectory=dict(argstr='--intermediateResultsDirectory %s', ), keepTempFiles=dict(argstr='--keepTempFiles ', @@ -55,8 +49,6 @@ def test_EMSegmentCommandLine_inputs(): ), taskPreProcessingSetting=dict(argstr='--taskPreProcessingSetting %s', ), - terminal_output=dict(nohash=True, - ), verbose=dict(argstr='--verbose ', ), ) diff --git a/nipype/interfaces/slicer/segmentation/tests/test_auto_RobustStatisticsSegmenter.py b/nipype/interfaces/slicer/segmentation/tests/test_auto_RobustStatisticsSegmenter.py index 65cd4d86f4..d7abd25dbd 100644 --- a/nipype/interfaces/slicer/segmentation/tests/test_auto_RobustStatisticsSegmenter.py +++ b/nipype/interfaces/slicer/segmentation/tests/test_auto_RobustStatisticsSegmenter.py @@ -8,14 +8,8 @@ def test_RobustStatisticsSegmenter_inputs(): ), curvatureWeight=dict(argstr='--curvatureWeight %f', ), - environ=dict(nohash=True, - usedefault=True, - ), expectedVolume=dict(argstr='--expectedVolume %f', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), intensityHomogeneity=dict(argstr='--intensityHomogeneity %f', ), labelImageFileName=dict(argstr='%s', @@ -32,8 +26,6 @@ def test_RobustStatisticsSegmenter_inputs(): hash_files=False, position=-1, ), - terminal_output=dict(nohash=True, - ), ) inputs = RobustStatisticsSegmenter._input_spec() diff --git a/nipype/interfaces/slicer/segmentation/tests/test_auto_SimpleRegionGrowingSegmentation.py b/nipype/interfaces/slicer/segmentation/tests/test_auto_SimpleRegionGrowingSegmentation.py index a9dd045f47..cbc6dbf4b1 100644 --- a/nipype/interfaces/slicer/segmentation/tests/test_auto_SimpleRegionGrowingSegmentation.py +++ b/nipype/interfaces/slicer/segmentation/tests/test_auto_SimpleRegionGrowingSegmentation.py @@ -6,12 +6,6 @@ def test_SimpleRegionGrowingSegmentation_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='%s', position=-2, ), @@ -31,8 +25,6 @@ def test_SimpleRegionGrowingSegmentation_inputs(): ), smoothingIterations=dict(argstr='--smoothingIterations %d', ), - terminal_output=dict(nohash=True, - ), timestep=dict(argstr='--timestep %f', ), ) diff --git a/nipype/interfaces/slicer/tests/test_auto_DicomToNrrdConverter.py b/nipype/interfaces/slicer/tests/test_auto_DicomToNrrdConverter.py index 1b5382f34e..422e95756f 100644 --- a/nipype/interfaces/slicer/tests/test_auto_DicomToNrrdConverter.py +++ b/nipype/interfaces/slicer/tests/test_auto_DicomToNrrdConverter.py @@ -6,12 +6,6 @@ def test_DicomToNrrdConverter_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputDicomDirectory=dict(argstr='--inputDicomDirectory %s', ), outputDirectory=dict(argstr='--outputDirectory %s', @@ -21,8 +15,6 @@ def test_DicomToNrrdConverter_inputs(): ), smallGradientThreshold=dict(argstr='--smallGradientThreshold %f', ), - terminal_output=dict(nohash=True, - ), useBMatrixGradientDirections=dict(argstr='--useBMatrixGradientDirections ', ), useIdentityMeaseurementFrame=dict(argstr='--useIdentityMeaseurementFrame ', diff --git a/nipype/interfaces/slicer/tests/test_auto_EMSegmentTransformToNewFormat.py b/nipype/interfaces/slicer/tests/test_auto_EMSegmentTransformToNewFormat.py index b65a696bc9..9a23ccca60 100644 --- a/nipype/interfaces/slicer/tests/test_auto_EMSegmentTransformToNewFormat.py +++ b/nipype/interfaces/slicer/tests/test_auto_EMSegmentTransformToNewFormat.py @@ -6,12 +6,6 @@ def test_EMSegmentTransformToNewFormat_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputMRMLFileName=dict(argstr='--inputMRMLFileName %s', ), outputMRMLFileName=dict(argstr='--outputMRMLFileName %s', @@ -19,8 +13,6 @@ def test_EMSegmentTransformToNewFormat_inputs(): ), templateFlag=dict(argstr='--templateFlag ', ), - terminal_output=dict(nohash=True, - ), ) inputs = EMSegmentTransformToNewFormat._input_spec() diff --git a/nipype/interfaces/slicer/tests/test_auto_GrayscaleModelMaker.py b/nipype/interfaces/slicer/tests/test_auto_GrayscaleModelMaker.py index 7a7d4a6870..b2ec4344cf 100644 --- a/nipype/interfaces/slicer/tests/test_auto_GrayscaleModelMaker.py +++ b/nipype/interfaces/slicer/tests/test_auto_GrayscaleModelMaker.py @@ -15,12 +15,6 @@ def test_GrayscaleModelMaker_inputs(): ), decimate=dict(argstr='--decimate %f', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), name=dict(argstr='--name %s', ), pointnormals=dict(argstr='--pointnormals ', @@ -29,8 +23,6 @@ def test_GrayscaleModelMaker_inputs(): ), splitnormals=dict(argstr='--splitnormals ', ), - terminal_output=dict(nohash=True, - ), threshold=dict(argstr='--threshold %f', ), ) diff --git a/nipype/interfaces/slicer/tests/test_auto_LabelMapSmoothing.py b/nipype/interfaces/slicer/tests/test_auto_LabelMapSmoothing.py index 1987b4964f..db1bbbe305 100644 --- a/nipype/interfaces/slicer/tests/test_auto_LabelMapSmoothing.py +++ b/nipype/interfaces/slicer/tests/test_auto_LabelMapSmoothing.py @@ -6,14 +6,8 @@ def test_LabelMapSmoothing_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), gaussianSigma=dict(argstr='--gaussianSigma %f', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume=dict(argstr='%s', position=-2, ), @@ -27,8 +21,6 @@ def test_LabelMapSmoothing_inputs(): hash_files=False, position=-1, ), - terminal_output=dict(nohash=True, - ), ) inputs = LabelMapSmoothing._input_spec() diff --git a/nipype/interfaces/slicer/tests/test_auto_MergeModels.py b/nipype/interfaces/slicer/tests/test_auto_MergeModels.py index 8857926a1f..60bbd31137 100644 --- a/nipype/interfaces/slicer/tests/test_auto_MergeModels.py +++ b/nipype/interfaces/slicer/tests/test_auto_MergeModels.py @@ -16,14 +16,6 @@ def test_MergeModels_inputs(): ), args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), - terminal_output=dict(nohash=True, - ), ) inputs = MergeModels._input_spec() diff --git a/nipype/interfaces/slicer/tests/test_auto_ModelMaker.py b/nipype/interfaces/slicer/tests/test_auto_ModelMaker.py index 1046a1716a..0d4eb77c72 100644 --- a/nipype/interfaces/slicer/tests/test_auto_ModelMaker.py +++ b/nipype/interfaces/slicer/tests/test_auto_ModelMaker.py @@ -17,16 +17,10 @@ def test_ModelMaker_inputs(): ), end=dict(argstr='--end %d', ), - environ=dict(nohash=True, - usedefault=True, - ), filtertype=dict(argstr='--filtertype %s', ), generateAll=dict(argstr='--generateAll ', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), jointsmooth=dict(argstr='--jointsmooth ', ), labels=dict(argstr='--labels %s', @@ -51,8 +45,6 @@ def test_ModelMaker_inputs(): ), start=dict(argstr='--start %d', ), - terminal_output=dict(nohash=True, - ), ) inputs = ModelMaker._input_spec() diff --git a/nipype/interfaces/slicer/tests/test_auto_ModelToLabelMap.py b/nipype/interfaces/slicer/tests/test_auto_ModelToLabelMap.py index 209cf8e42e..2ee8418b97 100644 --- a/nipype/interfaces/slicer/tests/test_auto_ModelToLabelMap.py +++ b/nipype/interfaces/slicer/tests/test_auto_ModelToLabelMap.py @@ -15,17 +15,9 @@ def test_ModelToLabelMap_inputs(): ), distance=dict(argstr='--distance %f', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), surface=dict(argstr='%s', position=-2, ), - terminal_output=dict(nohash=True, - ), ) inputs = ModelToLabelMap._input_spec() diff --git a/nipype/interfaces/slicer/tests/test_auto_OrientScalarVolume.py b/nipype/interfaces/slicer/tests/test_auto_OrientScalarVolume.py index 1647809ba7..8ed9ae29ce 100644 --- a/nipype/interfaces/slicer/tests/test_auto_OrientScalarVolume.py +++ b/nipype/interfaces/slicer/tests/test_auto_OrientScalarVolume.py @@ -6,12 +6,6 @@ def test_OrientScalarVolume_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), inputVolume1=dict(argstr='%s', position=-2, ), @@ -21,8 +15,6 @@ def test_OrientScalarVolume_inputs(): hash_files=False, position=-1, ), - terminal_output=dict(nohash=True, - ), ) inputs = OrientScalarVolume._input_spec() diff --git a/nipype/interfaces/slicer/tests/test_auto_ProbeVolumeWithModel.py b/nipype/interfaces/slicer/tests/test_auto_ProbeVolumeWithModel.py index 35bf6d3041..a9dee777a5 100644 --- a/nipype/interfaces/slicer/tests/test_auto_ProbeVolumeWithModel.py +++ b/nipype/interfaces/slicer/tests/test_auto_ProbeVolumeWithModel.py @@ -16,14 +16,6 @@ def test_ProbeVolumeWithModel_inputs(): ), args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), - terminal_output=dict(nohash=True, - ), ) inputs = ProbeVolumeWithModel._input_spec() diff --git a/nipype/interfaces/slicer/tests/test_auto_SlicerCommandLine.py b/nipype/interfaces/slicer/tests/test_auto_SlicerCommandLine.py index f251892fa8..082970372b 100644 --- a/nipype/interfaces/slicer/tests/test_auto_SlicerCommandLine.py +++ b/nipype/interfaces/slicer/tests/test_auto_SlicerCommandLine.py @@ -6,14 +6,6 @@ def test_SlicerCommandLine_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), - terminal_output=dict(nohash=True, - ), ) inputs = SlicerCommandLine._input_spec() diff --git a/nipype/interfaces/spm/tests/test_auto_Analyze2nii.py b/nipype/interfaces/spm/tests/test_auto_Analyze2nii.py index 2661910fe5..b319cbf62e 100644 --- a/nipype/interfaces/spm/tests/test_auto_Analyze2nii.py +++ b/nipype/interfaces/spm/tests/test_auto_Analyze2nii.py @@ -6,9 +6,6 @@ def test_Analyze2nii_inputs(): input_map = dict(analyze_file=dict(mandatory=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), matlab_cmd=dict(), mfile=dict(usedefault=True, ), @@ -26,10 +23,7 @@ def test_Analyze2nii_inputs(): def test_Analyze2nii_outputs(): - output_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - matlab_cmd=dict(), + output_map = dict(matlab_cmd=dict(), mfile=dict(usedefault=True, ), nifti_file=dict(), diff --git a/nipype/interfaces/spm/tests/test_auto_ApplyDeformations.py b/nipype/interfaces/spm/tests/test_auto_ApplyDeformations.py index 0ca5fdaa38..11d0273df2 100644 --- a/nipype/interfaces/spm/tests/test_auto_ApplyDeformations.py +++ b/nipype/interfaces/spm/tests/test_auto_ApplyDeformations.py @@ -7,9 +7,6 @@ def test_ApplyDeformations_inputs(): input_map = dict(deformation_field=dict(field='comp{1}.def', mandatory=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_files=dict(field='fnames', mandatory=True, ), diff --git a/nipype/interfaces/spm/tests/test_auto_ApplyInverseDeformation.py b/nipype/interfaces/spm/tests/test_auto_ApplyInverseDeformation.py index 4a30b9092b..9901677221 100644 --- a/nipype/interfaces/spm/tests/test_auto_ApplyInverseDeformation.py +++ b/nipype/interfaces/spm/tests/test_auto_ApplyInverseDeformation.py @@ -12,9 +12,6 @@ def test_ApplyInverseDeformation_inputs(): deformation_field=dict(field='comp{1}.inv.comp{1}.def', xor=['deformation'], ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_files=dict(field='fnames', mandatory=True, ), diff --git a/nipype/interfaces/spm/tests/test_auto_ApplyTransform.py b/nipype/interfaces/spm/tests/test_auto_ApplyTransform.py index 28259118f3..75a5c0406b 100644 --- a/nipype/interfaces/spm/tests/test_auto_ApplyTransform.py +++ b/nipype/interfaces/spm/tests/test_auto_ApplyTransform.py @@ -4,10 +4,7 @@ def test_ApplyTransform_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - in_file=dict(copyfile=True, + input_map = dict(in_file=dict(copyfile=True, mandatory=True, ), mat=dict(mandatory=True, diff --git a/nipype/interfaces/spm/tests/test_auto_CalcCoregAffine.py b/nipype/interfaces/spm/tests/test_auto_CalcCoregAffine.py index 0bbf6465ff..883234a93d 100644 --- a/nipype/interfaces/spm/tests/test_auto_CalcCoregAffine.py +++ b/nipype/interfaces/spm/tests/test_auto_CalcCoregAffine.py @@ -4,10 +4,7 @@ def test_CalcCoregAffine_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - invmat=dict(), + input_map = dict(invmat=dict(), mat=dict(), matlab_cmd=dict(), mfile=dict(usedefault=True, diff --git a/nipype/interfaces/spm/tests/test_auto_Coregister.py b/nipype/interfaces/spm/tests/test_auto_Coregister.py index 45e8160174..0b33156bef 100644 --- a/nipype/interfaces/spm/tests/test_auto_Coregister.py +++ b/nipype/interfaces/spm/tests/test_auto_Coregister.py @@ -11,9 +11,6 @@ def test_Coregister_inputs(): ), fwhm=dict(field='eoptions.fwhm', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), jobtype=dict(usedefault=True, ), matlab_cmd=dict(), diff --git a/nipype/interfaces/spm/tests/test_auto_CreateWarped.py b/nipype/interfaces/spm/tests/test_auto_CreateWarped.py index 8c0912c0a6..f77fb87903 100644 --- a/nipype/interfaces/spm/tests/test_auto_CreateWarped.py +++ b/nipype/interfaces/spm/tests/test_auto_CreateWarped.py @@ -8,9 +8,6 @@ def test_CreateWarped_inputs(): field='crt_warped.flowfields', mandatory=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), image_files=dict(copyfile=False, field='crt_warped.images', mandatory=True, diff --git a/nipype/interfaces/spm/tests/test_auto_DARTEL.py b/nipype/interfaces/spm/tests/test_auto_DARTEL.py index cfd5808dd8..388288b3bf 100644 --- a/nipype/interfaces/spm/tests/test_auto_DARTEL.py +++ b/nipype/interfaces/spm/tests/test_auto_DARTEL.py @@ -4,10 +4,7 @@ def test_DARTEL_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - image_files=dict(copyfile=False, + input_map = dict(image_files=dict(copyfile=False, field='warp.images', mandatory=True, ), diff --git a/nipype/interfaces/spm/tests/test_auto_DARTELNorm2MNI.py b/nipype/interfaces/spm/tests/test_auto_DARTELNorm2MNI.py index 3e8a773af3..2569076ef4 100644 --- a/nipype/interfaces/spm/tests/test_auto_DARTELNorm2MNI.py +++ b/nipype/interfaces/spm/tests/test_auto_DARTELNorm2MNI.py @@ -15,9 +15,6 @@ def test_DARTELNorm2MNI_inputs(): ), fwhm=dict(field='mni_norm.fwhm', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), matlab_cmd=dict(), mfile=dict(usedefault=True, ), diff --git a/nipype/interfaces/spm/tests/test_auto_DicomImport.py b/nipype/interfaces/spm/tests/test_auto_DicomImport.py index da3881d6f6..11b8e299a0 100644 --- a/nipype/interfaces/spm/tests/test_auto_DicomImport.py +++ b/nipype/interfaces/spm/tests/test_auto_DicomImport.py @@ -10,9 +10,6 @@ def test_DicomImport_inputs(): icedims=dict(field='convopts.icedims', usedefault=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_files=dict(field='data', mandatory=True, ), diff --git a/nipype/interfaces/spm/tests/test_auto_EstimateContrast.py b/nipype/interfaces/spm/tests/test_auto_EstimateContrast.py index 12170b54da..85c11a1123 100644 --- a/nipype/interfaces/spm/tests/test_auto_EstimateContrast.py +++ b/nipype/interfaces/spm/tests/test_auto_EstimateContrast.py @@ -11,9 +11,6 @@ def test_EstimateContrast_inputs(): ), group_contrast=dict(xor=['use_derivs'], ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), matlab_cmd=dict(), mfile=dict(usedefault=True, ), diff --git a/nipype/interfaces/spm/tests/test_auto_EstimateModel.py b/nipype/interfaces/spm/tests/test_auto_EstimateModel.py index 89c274621a..fe5ee1f894 100644 --- a/nipype/interfaces/spm/tests/test_auto_EstimateModel.py +++ b/nipype/interfaces/spm/tests/test_auto_EstimateModel.py @@ -8,9 +8,6 @@ def test_EstimateModel_inputs(): mandatory=True, ), flags=dict(), - ignore_exception=dict(nohash=True, - usedefault=True, - ), matlab_cmd=dict(), mfile=dict(usedefault=True, ), diff --git a/nipype/interfaces/spm/tests/test_auto_FactorialDesign.py b/nipype/interfaces/spm/tests/test_auto_FactorialDesign.py index e985bffed7..7fb31898b5 100644 --- a/nipype/interfaces/spm/tests/test_auto_FactorialDesign.py +++ b/nipype/interfaces/spm/tests/test_auto_FactorialDesign.py @@ -19,9 +19,6 @@ def test_FactorialDesign_inputs(): ), global_normalization=dict(field='globalm.glonorm', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), matlab_cmd=dict(), mfile=dict(usedefault=True, ), diff --git a/nipype/interfaces/spm/tests/test_auto_Level1Design.py b/nipype/interfaces/spm/tests/test_auto_Level1Design.py index 803bdfabf3..9369d00bb9 100644 --- a/nipype/interfaces/spm/tests/test_auto_Level1Design.py +++ b/nipype/interfaces/spm/tests/test_auto_Level1Design.py @@ -11,9 +11,6 @@ def test_Level1Design_inputs(): ), global_intensity_normalization=dict(field='global', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), interscan_interval=dict(field='timing.RT', mandatory=True, ), diff --git a/nipype/interfaces/spm/tests/test_auto_MultipleRegressionDesign.py b/nipype/interfaces/spm/tests/test_auto_MultipleRegressionDesign.py index 8be452f5fb..1c166741a7 100644 --- a/nipype/interfaces/spm/tests/test_auto_MultipleRegressionDesign.py +++ b/nipype/interfaces/spm/tests/test_auto_MultipleRegressionDesign.py @@ -19,9 +19,6 @@ def test_MultipleRegressionDesign_inputs(): ), global_normalization=dict(field='globalm.glonorm', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_files=dict(field='des.mreg.scans', mandatory=True, ), diff --git a/nipype/interfaces/spm/tests/test_auto_NewSegment.py b/nipype/interfaces/spm/tests/test_auto_NewSegment.py index 50504699a9..4c648b97d2 100644 --- a/nipype/interfaces/spm/tests/test_auto_NewSegment.py +++ b/nipype/interfaces/spm/tests/test_auto_NewSegment.py @@ -12,9 +12,6 @@ def test_NewSegment_inputs(): ), channel_info=dict(field='channel', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), matlab_cmd=dict(), mfile=dict(usedefault=True, ), diff --git a/nipype/interfaces/spm/tests/test_auto_Normalize.py b/nipype/interfaces/spm/tests/test_auto_Normalize.py index 0bcaef5159..4d0cd8a0c1 100644 --- a/nipype/interfaces/spm/tests/test_auto_Normalize.py +++ b/nipype/interfaces/spm/tests/test_auto_Normalize.py @@ -11,9 +11,6 @@ def test_Normalize_inputs(): apply_to_files=dict(copyfile=True, field='subj.resample', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), jobtype=dict(usedefault=True, ), matlab_cmd=dict(), diff --git a/nipype/interfaces/spm/tests/test_auto_Normalize12.py b/nipype/interfaces/spm/tests/test_auto_Normalize12.py index 0498965050..0baa8c8e9d 100644 --- a/nipype/interfaces/spm/tests/test_auto_Normalize12.py +++ b/nipype/interfaces/spm/tests/test_auto_Normalize12.py @@ -18,9 +18,6 @@ def test_Normalize12_inputs(): mandatory=True, xor=['image_to_align', 'tpm'], ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), image_to_align=dict(copyfile=True, field='subj.vol', mandatory=True, diff --git a/nipype/interfaces/spm/tests/test_auto_OneSampleTTestDesign.py b/nipype/interfaces/spm/tests/test_auto_OneSampleTTestDesign.py index 3e05239f8a..486cc029cd 100644 --- a/nipype/interfaces/spm/tests/test_auto_OneSampleTTestDesign.py +++ b/nipype/interfaces/spm/tests/test_auto_OneSampleTTestDesign.py @@ -19,9 +19,6 @@ def test_OneSampleTTestDesign_inputs(): ), global_normalization=dict(field='globalm.glonorm', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_files=dict(field='des.t1.scans', mandatory=True, ), diff --git a/nipype/interfaces/spm/tests/test_auto_PairedTTestDesign.py b/nipype/interfaces/spm/tests/test_auto_PairedTTestDesign.py index 767371f2e8..ca35c6e0a8 100644 --- a/nipype/interfaces/spm/tests/test_auto_PairedTTestDesign.py +++ b/nipype/interfaces/spm/tests/test_auto_PairedTTestDesign.py @@ -23,9 +23,6 @@ def test_PairedTTestDesign_inputs(): ), grand_mean_scaling=dict(field='des.pt.gmsca', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), matlab_cmd=dict(), mfile=dict(usedefault=True, ), diff --git a/nipype/interfaces/spm/tests/test_auto_Realign.py b/nipype/interfaces/spm/tests/test_auto_Realign.py index d279dda596..39082b5936 100644 --- a/nipype/interfaces/spm/tests/test_auto_Realign.py +++ b/nipype/interfaces/spm/tests/test_auto_Realign.py @@ -6,9 +6,6 @@ def test_Realign_inputs(): input_map = dict(fwhm=dict(field='eoptions.fwhm', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_files=dict(copyfile=True, field='data', mandatory=True, diff --git a/nipype/interfaces/spm/tests/test_auto_Reslice.py b/nipype/interfaces/spm/tests/test_auto_Reslice.py index eb83dca084..814e5c15af 100644 --- a/nipype/interfaces/spm/tests/test_auto_Reslice.py +++ b/nipype/interfaces/spm/tests/test_auto_Reslice.py @@ -4,10 +4,7 @@ def test_Reslice_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - in_file=dict(mandatory=True, + input_map = dict(in_file=dict(mandatory=True, ), interp=dict(usedefault=True, ), diff --git a/nipype/interfaces/spm/tests/test_auto_ResliceToReference.py b/nipype/interfaces/spm/tests/test_auto_ResliceToReference.py index 3dd7d4cb4a..8012e6d425 100644 --- a/nipype/interfaces/spm/tests/test_auto_ResliceToReference.py +++ b/nipype/interfaces/spm/tests/test_auto_ResliceToReference.py @@ -6,9 +6,6 @@ def test_ResliceToReference_inputs(): input_map = dict(bounding_box=dict(field='comp{2}.idbbvox.bb', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_files=dict(field='fnames', mandatory=True, ), diff --git a/nipype/interfaces/spm/tests/test_auto_SPMCommand.py b/nipype/interfaces/spm/tests/test_auto_SPMCommand.py index 0b3d469e7e..6f0fe180a1 100644 --- a/nipype/interfaces/spm/tests/test_auto_SPMCommand.py +++ b/nipype/interfaces/spm/tests/test_auto_SPMCommand.py @@ -4,10 +4,7 @@ def test_SPMCommand_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - matlab_cmd=dict(), + input_map = dict(matlab_cmd=dict(), mfile=dict(usedefault=True, ), paths=dict(), diff --git a/nipype/interfaces/spm/tests/test_auto_Segment.py b/nipype/interfaces/spm/tests/test_auto_Segment.py index 45ac41d3ce..b2257c2eaa 100644 --- a/nipype/interfaces/spm/tests/test_auto_Segment.py +++ b/nipype/interfaces/spm/tests/test_auto_Segment.py @@ -22,9 +22,6 @@ def test_Segment_inputs(): ), gm_output_type=dict(field='output.GM', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), mask_image=dict(field='opts.msk', ), matlab_cmd=dict(), diff --git a/nipype/interfaces/spm/tests/test_auto_SliceTiming.py b/nipype/interfaces/spm/tests/test_auto_SliceTiming.py index 1982843846..a9ffcaef6d 100644 --- a/nipype/interfaces/spm/tests/test_auto_SliceTiming.py +++ b/nipype/interfaces/spm/tests/test_auto_SliceTiming.py @@ -4,10 +4,7 @@ def test_SliceTiming_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - in_files=dict(copyfile=False, + input_map = dict(in_files=dict(copyfile=False, field='scans', mandatory=True, ), diff --git a/nipype/interfaces/spm/tests/test_auto_Smooth.py b/nipype/interfaces/spm/tests/test_auto_Smooth.py index 3c74327548..e7c69bbdba 100644 --- a/nipype/interfaces/spm/tests/test_auto_Smooth.py +++ b/nipype/interfaces/spm/tests/test_auto_Smooth.py @@ -8,9 +8,6 @@ def test_Smooth_inputs(): ), fwhm=dict(field='fwhm', ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), implicit_masking=dict(field='im', ), in_files=dict(copyfile=False, diff --git a/nipype/interfaces/spm/tests/test_auto_Threshold.py b/nipype/interfaces/spm/tests/test_auto_Threshold.py index 7b6caf8c5e..6e865006e9 100644 --- a/nipype/interfaces/spm/tests/test_auto_Threshold.py +++ b/nipype/interfaces/spm/tests/test_auto_Threshold.py @@ -16,9 +16,6 @@ def test_Threshold_inputs(): ), height_threshold_type=dict(usedefault=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), matlab_cmd=dict(), mfile=dict(usedefault=True, ), diff --git a/nipype/interfaces/spm/tests/test_auto_ThresholdStatistics.py b/nipype/interfaces/spm/tests/test_auto_ThresholdStatistics.py index a7ae3e48b5..a19f3fbf95 100644 --- a/nipype/interfaces/spm/tests/test_auto_ThresholdStatistics.py +++ b/nipype/interfaces/spm/tests/test_auto_ThresholdStatistics.py @@ -10,9 +10,6 @@ def test_ThresholdStatistics_inputs(): ), height_threshold=dict(mandatory=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), matlab_cmd=dict(), mfile=dict(usedefault=True, ), diff --git a/nipype/interfaces/spm/tests/test_auto_TwoSampleTTestDesign.py b/nipype/interfaces/spm/tests/test_auto_TwoSampleTTestDesign.py index f8cc2c0654..28d5f2513b 100644 --- a/nipype/interfaces/spm/tests/test_auto_TwoSampleTTestDesign.py +++ b/nipype/interfaces/spm/tests/test_auto_TwoSampleTTestDesign.py @@ -27,9 +27,6 @@ def test_TwoSampleTTestDesign_inputs(): group2_files=dict(field='des.t2.scans2', mandatory=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), matlab_cmd=dict(), mfile=dict(usedefault=True, ), diff --git a/nipype/interfaces/spm/tests/test_auto_VBMSegment.py b/nipype/interfaces/spm/tests/test_auto_VBMSegment.py index fac56484a5..9695fa7d20 100644 --- a/nipype/interfaces/spm/tests/test_auto_VBMSegment.py +++ b/nipype/interfaces/spm/tests/test_auto_VBMSegment.py @@ -56,9 +56,6 @@ def test_VBMSegment_inputs(): gm_normalized=dict(field='estwrite.output.GM.warped', usedefault=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_files=dict(copyfile=False, field='estwrite.data', mandatory=True, diff --git a/nipype/interfaces/tests/test_auto_AssertEqual.py b/nipype/interfaces/tests/test_auto_AssertEqual.py index 9278f7a6b2..54f02f6e02 100644 --- a/nipype/interfaces/tests/test_auto_AssertEqual.py +++ b/nipype/interfaces/tests/test_auto_AssertEqual.py @@ -4,10 +4,7 @@ def test_AssertEqual_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - volume1=dict(mandatory=True, + input_map = dict(volume1=dict(mandatory=True, ), volume2=dict(mandatory=True, ), diff --git a/nipype/interfaces/tests/test_auto_C3dAffineTool.py b/nipype/interfaces/tests/test_auto_C3dAffineTool.py index 38f59b690d..df37aa4472 100644 --- a/nipype/interfaces/tests/test_auto_C3dAffineTool.py +++ b/nipype/interfaces/tests/test_auto_C3dAffineTool.py @@ -6,15 +6,9 @@ def test_C3dAffineTool_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), fsl2ras=dict(argstr='-fsl2ras', position=4, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), itk_transform=dict(argstr='-oitk %s', hash_files=False, position=5, @@ -25,8 +19,6 @@ def test_C3dAffineTool_inputs(): source_file=dict(argstr='-src %s', position=2, ), - terminal_output=dict(nohash=True, - ), transform_file=dict(argstr='%s', position=3, ), diff --git a/nipype/interfaces/tests/test_auto_DataFinder.py b/nipype/interfaces/tests/test_auto_DataFinder.py index df1bc26155..d126018481 100644 --- a/nipype/interfaces/tests/test_auto_DataFinder.py +++ b/nipype/interfaces/tests/test_auto_DataFinder.py @@ -4,10 +4,7 @@ def test_DataFinder_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - ignore_regexes=dict(), + input_map = dict(ignore_regexes=dict(), match_regex=dict(usedefault=True, ), max_depth=dict(), diff --git a/nipype/interfaces/tests/test_auto_DataGrabber.py b/nipype/interfaces/tests/test_auto_DataGrabber.py index f06edb19b9..b123f9991b 100644 --- a/nipype/interfaces/tests/test_auto_DataGrabber.py +++ b/nipype/interfaces/tests/test_auto_DataGrabber.py @@ -5,9 +5,6 @@ def test_DataGrabber_inputs(): input_map = dict(base_directory=dict(), - ignore_exception=dict(nohash=True, - usedefault=True, - ), raise_on_empty=dict(usedefault=True, ), sort_filelist=dict(mandatory=True, diff --git a/nipype/interfaces/tests/test_auto_DataSink.py b/nipype/interfaces/tests/test_auto_DataSink.py index e762f2ca8b..f3a1d4d578 100644 --- a/nipype/interfaces/tests/test_auto_DataSink.py +++ b/nipype/interfaces/tests/test_auto_DataSink.py @@ -13,9 +13,6 @@ def test_DataSink_inputs(): container=dict(), creds_path=dict(), encrypt_bucket_keys=dict(), - ignore_exception=dict(nohash=True, - usedefault=True, - ), local_copy=dict(), parameterization=dict(usedefault=True, ), diff --git a/nipype/interfaces/tests/test_auto_Dcm2nii.py b/nipype/interfaces/tests/test_auto_Dcm2nii.py index 0b71a406b1..b11f38d7bf 100644 --- a/nipype/interfaces/tests/test_auto_Dcm2nii.py +++ b/nipype/interfaces/tests/test_auto_Dcm2nii.py @@ -21,9 +21,6 @@ def test_Dcm2nii_inputs(): date_in_filename=dict(argstr='-d', usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), events_in_filename=dict(argstr='-e', usedefault=True, ), @@ -33,9 +30,6 @@ def test_Dcm2nii_inputs(): id_in_filename=dict(argstr='-i', usedefault=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), nii_output=dict(argstr='-n', usedefault=True, ), @@ -67,8 +61,6 @@ def test_Dcm2nii_inputs(): spm_analyze=dict(argstr='-s', xor=['nii_output'], ), - terminal_output=dict(nohash=True, - ), ) inputs = Dcm2nii._input_spec() diff --git a/nipype/interfaces/tests/test_auto_FreeSurferSource.py b/nipype/interfaces/tests/test_auto_FreeSurferSource.py index 7f06d05078..384af5217d 100644 --- a/nipype/interfaces/tests/test_auto_FreeSurferSource.py +++ b/nipype/interfaces/tests/test_auto_FreeSurferSource.py @@ -6,9 +6,6 @@ def test_FreeSurferSource_inputs(): input_map = dict(hemi=dict(usedefault=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), subject_id=dict(mandatory=True, ), subjects_dir=dict(mandatory=True, diff --git a/nipype/interfaces/tests/test_auto_Function.py b/nipype/interfaces/tests/test_auto_Function.py index b3e6ef7230..744668f79b 100644 --- a/nipype/interfaces/tests/test_auto_Function.py +++ b/nipype/interfaces/tests/test_auto_Function.py @@ -6,9 +6,6 @@ def test_Function_inputs(): input_map = dict(function_str=dict(mandatory=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), ) inputs = Function._input_spec() diff --git a/nipype/interfaces/tests/test_auto_IOBase.py b/nipype/interfaces/tests/test_auto_IOBase.py index 9f9808f94d..19af3112c6 100644 --- a/nipype/interfaces/tests/test_auto_IOBase.py +++ b/nipype/interfaces/tests/test_auto_IOBase.py @@ -4,10 +4,7 @@ def test_IOBase_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - ) + input_map = dict() inputs = IOBase._input_spec() for key, metadata in list(input_map.items()): diff --git a/nipype/interfaces/tests/test_auto_JSONFileGrabber.py b/nipype/interfaces/tests/test_auto_JSONFileGrabber.py index 0ec537287d..785479caf3 100644 --- a/nipype/interfaces/tests/test_auto_JSONFileGrabber.py +++ b/nipype/interfaces/tests/test_auto_JSONFileGrabber.py @@ -5,9 +5,6 @@ def test_JSONFileGrabber_inputs(): input_map = dict(defaults=dict(), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(), ) inputs = JSONFileGrabber._input_spec() diff --git a/nipype/interfaces/tests/test_auto_JSONFileSink.py b/nipype/interfaces/tests/test_auto_JSONFileSink.py index ec18a850e4..18378ddf29 100644 --- a/nipype/interfaces/tests/test_auto_JSONFileSink.py +++ b/nipype/interfaces/tests/test_auto_JSONFileSink.py @@ -6,9 +6,6 @@ def test_JSONFileSink_inputs(): input_map = dict(_outputs=dict(usedefault=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_dict=dict(usedefault=True, ), out_file=dict(), diff --git a/nipype/interfaces/tests/test_auto_MatlabCommand.py b/nipype/interfaces/tests/test_auto_MatlabCommand.py index ae7727a8a3..5d8abc2c23 100644 --- a/nipype/interfaces/tests/test_auto_MatlabCommand.py +++ b/nipype/interfaces/tests/test_auto_MatlabCommand.py @@ -6,12 +6,6 @@ def test_MatlabCommand_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), logfile=dict(argstr='-logfile %s', ), mfile=dict(usedefault=True, @@ -38,8 +32,6 @@ def test_MatlabCommand_inputs(): single_comp_thread=dict(argstr='-singleCompThread', nohash=True, ), - terminal_output=dict(nohash=True, - ), uses_mcr=dict(nohash=True, xor=['nodesktop', 'nosplash', 'single_comp_thread'], ), diff --git a/nipype/interfaces/tests/test_auto_Merge.py b/nipype/interfaces/tests/test_auto_Merge.py index cfe4a03833..1d71ca7cc6 100644 --- a/nipype/interfaces/tests/test_auto_Merge.py +++ b/nipype/interfaces/tests/test_auto_Merge.py @@ -6,9 +6,6 @@ def test_Merge_inputs(): input_map = dict(axis=dict(usedefault=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), no_flatten=dict(usedefault=True, ), ) diff --git a/nipype/interfaces/tests/test_auto_MeshFix.py b/nipype/interfaces/tests/test_auto_MeshFix.py index a1438acccf..1e07299994 100644 --- a/nipype/interfaces/tests/test_auto_MeshFix.py +++ b/nipype/interfaces/tests/test_auto_MeshFix.py @@ -20,9 +20,6 @@ def test_MeshFix_inputs(): ), dont_clean=dict(argstr='--no-clean', ), - environ=dict(nohash=True, - usedefault=True, - ), epsilon_angle=dict(argstr='-a %f', ), finetuning_distance=dict(argstr='%f', @@ -38,9 +35,6 @@ def test_MeshFix_inputs(): finetuning_substeps=dict(argstr='%d', requires=['finetuning_distance'], ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file1=dict(argstr='%s', mandatory=True, position=1, @@ -78,8 +72,6 @@ def test_MeshFix_inputs(): ), set_intersections_to_one=dict(argstr='--intersect', ), - terminal_output=dict(nohash=True, - ), uniform_remeshing_steps=dict(argstr='-u %d', requires=['uniform_remeshing_vertices'], ), diff --git a/nipype/interfaces/tests/test_auto_MySQLSink.py b/nipype/interfaces/tests/test_auto_MySQLSink.py index 1b283ac4a6..402fddab73 100644 --- a/nipype/interfaces/tests/test_auto_MySQLSink.py +++ b/nipype/interfaces/tests/test_auto_MySQLSink.py @@ -14,9 +14,6 @@ def test_MySQLSink_inputs(): usedefault=True, xor=['config'], ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), password=dict(), table_name=dict(mandatory=True, ), diff --git a/nipype/interfaces/tests/test_auto_NiftiGeneratorBase.py b/nipype/interfaces/tests/test_auto_NiftiGeneratorBase.py index 6a1e35757f..8ada1a3950 100644 --- a/nipype/interfaces/tests/test_auto_NiftiGeneratorBase.py +++ b/nipype/interfaces/tests/test_auto_NiftiGeneratorBase.py @@ -4,10 +4,7 @@ def test_NiftiGeneratorBase_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - ) + input_map = dict() inputs = NiftiGeneratorBase._input_spec() for key, metadata in list(input_map.items()): diff --git a/nipype/interfaces/tests/test_auto_PETPVC.py b/nipype/interfaces/tests/test_auto_PETPVC.py index d2ed3d0063..b711069647 100644 --- a/nipype/interfaces/tests/test_auto_PETPVC.py +++ b/nipype/interfaces/tests/test_auto_PETPVC.py @@ -11,9 +11,6 @@ def test_PETPVC_inputs(): debug=dict(argstr='-d', usedefault=True, ), - environ=dict(nohash=True, - usedefault=True, - ), fwhm_x=dict(argstr='-x %.4f', mandatory=True, ), @@ -23,9 +20,6 @@ def test_PETPVC_inputs(): fwhm_z=dict(argstr='-z %.4f', mandatory=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-i %s', mandatory=True, ), @@ -45,8 +39,6 @@ def test_PETPVC_inputs(): ), stop_crit=dict(argstr='-a %.4f', ), - terminal_output=dict(nohash=True, - ), ) inputs = PETPVC._input_spec() diff --git a/nipype/interfaces/tests/test_auto_S3DataGrabber.py b/nipype/interfaces/tests/test_auto_S3DataGrabber.py index ef61babd98..ff819e78e9 100644 --- a/nipype/interfaces/tests/test_auto_S3DataGrabber.py +++ b/nipype/interfaces/tests/test_auto_S3DataGrabber.py @@ -10,9 +10,6 @@ def test_S3DataGrabber_inputs(): ), bucket_path=dict(usedefault=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), local_directory=dict(), raise_on_empty=dict(usedefault=True, ), diff --git a/nipype/interfaces/tests/test_auto_SQLiteSink.py b/nipype/interfaces/tests/test_auto_SQLiteSink.py index ecdfd5cfdc..db35d63123 100644 --- a/nipype/interfaces/tests/test_auto_SQLiteSink.py +++ b/nipype/interfaces/tests/test_auto_SQLiteSink.py @@ -6,9 +6,6 @@ def test_SQLiteSink_inputs(): input_map = dict(database_file=dict(mandatory=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), table_name=dict(mandatory=True, ), ) diff --git a/nipype/interfaces/tests/test_auto_SSHDataGrabber.py b/nipype/interfaces/tests/test_auto_SSHDataGrabber.py index f38eea0aeb..4c2e7dccc8 100644 --- a/nipype/interfaces/tests/test_auto_SSHDataGrabber.py +++ b/nipype/interfaces/tests/test_auto_SSHDataGrabber.py @@ -10,9 +10,6 @@ def test_SSHDataGrabber_inputs(): ), hostname=dict(mandatory=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), password=dict(), raise_on_empty=dict(usedefault=True, ), diff --git a/nipype/interfaces/tests/test_auto_Select.py b/nipype/interfaces/tests/test_auto_Select.py index e598db177a..bda409ddfa 100644 --- a/nipype/interfaces/tests/test_auto_Select.py +++ b/nipype/interfaces/tests/test_auto_Select.py @@ -4,10 +4,7 @@ def test_Select_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - index=dict(mandatory=True, + input_map = dict(index=dict(mandatory=True, ), inlist=dict(mandatory=True, ), diff --git a/nipype/interfaces/tests/test_auto_SelectFiles.py b/nipype/interfaces/tests/test_auto_SelectFiles.py index 17fae734e5..89b3cdc468 100644 --- a/nipype/interfaces/tests/test_auto_SelectFiles.py +++ b/nipype/interfaces/tests/test_auto_SelectFiles.py @@ -7,9 +7,6 @@ def test_SelectFiles_inputs(): input_map = dict(base_directory=dict(), force_lists=dict(usedefault=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), raise_on_empty=dict(usedefault=True, ), sort_filelist=dict(usedefault=True, diff --git a/nipype/interfaces/tests/test_auto_SlicerCommandLine.py b/nipype/interfaces/tests/test_auto_SlicerCommandLine.py index c018a3b794..d6c8a0a9cc 100644 --- a/nipype/interfaces/tests/test_auto_SlicerCommandLine.py +++ b/nipype/interfaces/tests/test_auto_SlicerCommandLine.py @@ -6,15 +6,7 @@ def test_SlicerCommandLine_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), module=dict(), - terminal_output=dict(nohash=True, - ), ) inputs = SlicerCommandLine._input_spec() diff --git a/nipype/interfaces/tests/test_auto_Split.py b/nipype/interfaces/tests/test_auto_Split.py index b7d9174ff7..38338fbf1e 100644 --- a/nipype/interfaces/tests/test_auto_Split.py +++ b/nipype/interfaces/tests/test_auto_Split.py @@ -4,10 +4,7 @@ def test_Split_inputs(): - input_map = dict(ignore_exception=dict(nohash=True, - usedefault=True, - ), - inlist=dict(mandatory=True, + input_map = dict(inlist=dict(mandatory=True, ), splits=dict(mandatory=True, ), diff --git a/nipype/interfaces/tests/test_auto_XNATSink.py b/nipype/interfaces/tests/test_auto_XNATSink.py index c23bf11cb8..1bb2dd9f72 100644 --- a/nipype/interfaces/tests/test_auto_XNATSink.py +++ b/nipype/interfaces/tests/test_auto_XNATSink.py @@ -14,9 +14,6 @@ def test_XNATSink_inputs(): ), experiment_id=dict(mandatory=True, ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), project_id=dict(mandatory=True, ), pwd=dict(), diff --git a/nipype/interfaces/tests/test_auto_XNATSource.py b/nipype/interfaces/tests/test_auto_XNATSource.py index e850aa95cb..5330aaa132 100644 --- a/nipype/interfaces/tests/test_auto_XNATSource.py +++ b/nipype/interfaces/tests/test_auto_XNATSource.py @@ -8,9 +8,6 @@ def test_XNATSource_inputs(): config=dict(mandatory=True, xor=['server'], ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), pwd=dict(), query_template=dict(mandatory=True, ), diff --git a/nipype/interfaces/vista/tests/test_auto_Vnifti2Image.py b/nipype/interfaces/vista/tests/test_auto_Vnifti2Image.py index 50f87debec..6ecafbf5af 100644 --- a/nipype/interfaces/vista/tests/test_auto_Vnifti2Image.py +++ b/nipype/interfaces/vista/tests/test_auto_Vnifti2Image.py @@ -9,12 +9,6 @@ def test_Vnifti2Image_inputs(): attributes=dict(argstr='-attr %s', position=2, ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-in %s', mandatory=True, position=1, @@ -26,8 +20,6 @@ def test_Vnifti2Image_inputs(): name_template='%s.v', position=-1, ), - terminal_output=dict(nohash=True, - ), ) inputs = Vnifti2Image._input_spec() diff --git a/nipype/interfaces/vista/tests/test_auto_VtoMat.py b/nipype/interfaces/vista/tests/test_auto_VtoMat.py index 1eb6211600..6d354e348b 100644 --- a/nipype/interfaces/vista/tests/test_auto_VtoMat.py +++ b/nipype/interfaces/vista/tests/test_auto_VtoMat.py @@ -6,12 +6,6 @@ def test_VtoMat_inputs(): input_map = dict(args=dict(argstr='%s', ), - environ=dict(nohash=True, - usedefault=True, - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), in_file=dict(argstr='-in %s', mandatory=True, position=1, @@ -23,8 +17,6 @@ def test_VtoMat_inputs(): name_template='%s.mat', position=-1, ), - terminal_output=dict(nohash=True, - ), ) inputs = VtoMat._input_spec() From dce88a4c5393e423bd535daa19bfb93caedc38e3 Mon Sep 17 00:00:00 2001 From: oesteban Date: Mon, 22 Feb 2016 10:09:35 -0800 Subject: [PATCH 69/73] afni tests passing --- nipype/interfaces/afni/base.py | 19 +++ nipype/interfaces/afni/preprocess.py | 116 +++++++++--------- .../afni/tests/test_auto_Automask.py | 10 +- .../interfaces/afni/tests/test_auto_Volreg.py | 5 +- nipype/interfaces/base/interfaces.py | 54 ++++---- 5 files changed, 117 insertions(+), 87 deletions(-) diff --git a/nipype/interfaces/afni/base.py b/nipype/interfaces/afni/base.py index 011a5d9095..5536e61d48 100644 --- a/nipype/interfaces/afni/base.py +++ b/nipype/interfaces/afni/base.py @@ -6,6 +6,7 @@ from builtins import object from ... import logging +from ...external.six import string_types from ..base import traits, File, CommandLine, CommandLineInputSpec, TraitedSpec # Use nipype's logging system @@ -77,6 +78,24 @@ class AFNICommandBase(CommandLine): A base class to fix a linking problem in OSX and afni. See http://afni.nimh.nih.gov/afni/community/board/read.php?1,145346,145347#msg-145347 """ + version_major = traits.Int(0, desc='AFNI version major') + + def _default_version(self): + version = '' + if not no_afni(): + version += Info.version() + + if isinstance(version, string_types): + return '.'.join(version) + return version + + def _default_version_major(self): + try: + return int(self.version.split('.')[0]) + except ValueError: + return 0 + + def _run_interface(self, runtime): if runtime.platform == 'darwin': runtime.environ['DYLD_FALLBACK_LIBRARY_PATH'] = '/usr/local/afni/' diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index 04b14140eb..bfa269f6f7 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -14,8 +14,10 @@ import re import numpy as np -from ..base import (Directory, traits, isdefined, File, GenFile, Undefined, - CommandLineInputSpec, TraitedSpec, InputMultiPath) +from ..base import (traits, isdefined, Undefined, + CommandLineInputSpec, TraitedSpec) +from ..base.traits_extension import Directory, File, GenFile, InputMultiPath + from .base import (AFNICommandBase, AFNICommand, AFNICommandInputSpec, AFNICommandOutputSpec, Info, no_afni) from ...external.six import string_types @@ -166,7 +168,7 @@ class Refit(AFNICommandBase): >>> refit.inputs.deoblique = True >>> refit.cmdline '3drefit -deoblique structural.nii' - >>> res = refit.run() # doctest: +SKIP + >>> res = refit.run(dry_run=True) """ @@ -262,7 +264,7 @@ class Resample(AFNICommand): >>> resample.inputs.outputtype = "NIFTI" >>> resample.cmdline '3dresample -orient RPI -prefix functional_resample -inset functional.nii' - >>> res = resample.run() # doctest: +SKIP + >>> res = resample.run(dry_run=True) """ @@ -305,7 +307,7 @@ class AutoTcorrelate(AFNICommand): >>> corr.inputs.mask_only_targets = True >>> corr.cmdline # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE '3dAutoTcorrelate -eta2 -mask mask.nii -mask_only_targets -prefix functional_similarity_matrix.1D -polort -1 functional.nii' - >>> res = corr.run() # doctest: +SKIP + >>> res = corr.run(dry_run=True) """ _input_spec = AutoTcorrelateInputSpec _output_spec = AFNICommandOutputSpec @@ -340,7 +342,7 @@ class TStat(AFNICommand): >>> tstat.inputs.out_file = "stats" >>> tstat.cmdline '3dTstat -mean -prefix functional_tstat functional.nii' - >>> res = tstat.run() # doctest: +SKIP + >>> res = tstat.run(dry_run=True) """ @@ -376,7 +378,7 @@ class Detrend(AFNICommand): >>> detrend.inputs.outputtype = "AFNI" >>> detrend.cmdline '3dDetrend -polort 2 -prefix functional_detrend functional.nii' - >>> res = detrend.run() # doctest: +SKIP + >>> res = detrend.run(dry_run=True) """ @@ -409,7 +411,7 @@ class Despike(AFNICommand): >>> despike.inputs.in_file = 'functional.nii' >>> despike.cmdline '3dDespike -prefix functional_despike functional.nii' - >>> res = despike.run() # doctest: +SKIP + >>> res = despike.run(dry_run=True) """ @@ -421,20 +423,24 @@ class Despike(AFNICommand): class AutomaskInputSpec(AFNICommandInputSpec): in_file = File(argstr='%s', position=-1, mandatory=True, exists=True, copyfile=False, desc='input file to 3dAutomask',) - out_file = GenFile(template="{in_file}_mask", argstr='-prefix %s', - desc='output image file name') - brain_file = GenFile(template="{in_file}_masked", argstr='-apply_prefix %s', - desc="output file from 3dAutomask") - clfrac = traits.Range(low=0.1, high=0.9, argstr='-clfrac %.2f', + prefix = GenFile(template="{in_file}_mask", argstr='-prefix %s', + desc='prefix for output images') + apply_prefix = GenFile(template="{in_file}_masked", argstr='-apply_prefix %s', + desc="output file from 3dAutomask") + clfrac = traits.Range(low=0.1, high=0.9, argstr='-clfrac %.2f', desc='sets the clip level fraction. A small value will tend ' 'to make the mask larger [default = 0.5].') dilate = traits.Int(argstr="-dilate %s", desc='dilate the mask outwards') erode = traits.Int(argstr="-erode %s", desc='erode the mask inwards') + # Automatically generated output names + out_file = GenFile(template="{prefix}{outputtype_}", desc='output image file name') + brain_file = GenFile(template="{apply_prefix}{outputtype_}", + desc="output file from 3dAutomask") class AutomaskOutputSpec(TraitedSpec): out_file = File(exists=True, desc='mask file') - brain_file = File(desc='brain file (skull stripped)', exists=True) + brain_file = File(exists=True, desc='brain file (skull stripped)') class Automask(AFNICommand): @@ -453,8 +459,10 @@ class Automask(AFNICommand): >>> automask.inputs.dilate = 1 >>> automask.inputs.outputtype = "NIFTI" >>> automask.cmdline #doctest: +ELLIPSIS - '3dAutomask -apply_prefix functional_masked.nii -dilate 1 -prefix functional_mask.nii functional.nii' - >>> res = automask.run() # doctest: +SKIP + '3dAutomask -apply_prefix functional_masked -dilate 1 -prefix functional_mask functional.nii' + >>> res = automask.run(dry_run=True) + >>> res.outputs.get_traitsfree() + {'out_file': 'functional_mask.nii', 'brain_file': 'functional_masked.nii'} """ @@ -466,30 +474,34 @@ class Automask(AFNICommand): class VolregInputSpec(AFNICommandInputSpec): in_file = File(argstr='%s', position=-1, mandatory=True, exists=True, copyfile=False, desc='input file to 3dvolreg') - out_file = GenFile(template="{in_file}_volreg", argstr='-prefix %s', + prefix = GenFile(template="{in_file}_volreg", argstr='-prefix %s', desc='output image file name') basefile = File(argstr='-base %s', position=-6, exists=True, desc='base file for registration') zpad = traits.Int(argstr='-zpad %d', position=-5, desc='Zeropad around the edges by \'n\' voxels during rotations') - md1d_file = GenFile(template='{in_file}_md.1D', argstr='-maxdisp1D %s', keep_extension=False, - position=-4, desc='max displacement output file') - oned_file = GenFile(template='{in_file}.1D', argstr='-1Dfile %s', keep_extension=False, - desc='1D movement parameters output file') verbose = traits.Bool(desc='more detailed description of the process', argstr='-verbose') timeshift = traits.Bool(desc='time shift to mean slice time offset', argstr='-tshift 0') copyorigin = traits.Bool(desc='copy base file origin coords to output', argstr='-twodup') + + # Outputs + out_file = GenFile(template="{in_file}_volreg{outputtype_}", + desc='output image file name') + md1d_file = GenFile(template='{in_file}_md.1D', argstr='-maxdisp1D %s', keep_extension=False, + position=-4, desc='max displacement output file') + oned_file = GenFile(template='{in_file}.1D', argstr='-1Dfile %s', keep_extension=False, + desc='1D movement parameters output file') oned_matrix_save = GenFile(template='{in_file}.aff12.1D', argstr='-1Dmatrix_save %s', keep_extension=False, desc='Save the matrix transformation') class VolregOutputSpec(TraitedSpec): - out_file = File(desc='registered file', exists=True) - md1d_file = File(desc='max displacement info file', exists=True) - oned_file = File(desc='movement parameters info file', exists=True) + out_file = File(exists=True, desc='registered file') + md1d_file = File(exists=True, desc='max displacement info file') + oned_file = File(exists=True, desc='movement parameters info file') oned_matrix_save = File( desc='matrix transformation from base to input', exists=True) @@ -511,8 +523,8 @@ class Volreg(AFNICommand): >>> volreg.inputs.zpad = 4 >>> volreg.inputs.outputtype = "NIFTI" >>> volreg.cmdline #doctest: +ELLIPSIS - '3dvolreg -Fourier -twopass -1Dfile functional.1D -1Dmatrix_save functional.aff12.1D -prefix functional_volreg.nii -zpad 4 -maxdisp1D functional_md.1D functional.nii' - >>> res = volreg.run() # doctest: +SKIP + '3dvolreg -Fourier -twopass -1Dfile functional.1D -1Dmatrix_save functional.aff12.1D -prefix functional_volreg -zpad 4 -maxdisp1D functional_md.1D functional.nii' + >>> res = volreg.run(dry_run=True) """ @@ -553,7 +565,7 @@ class Merge(AFNICommand): >>> merge.inputs.blurfwhm = 4 >>> merge.inputs.doall = True >>> merge.inputs.out_file = 'e7.nii' - >>> res = merge.run() # doctest: +SKIP + >>> res = merge.run(dry_run=True) """ @@ -648,7 +660,7 @@ class Fourier(AFNICommand): >>> fourier.inputs.args = '-retrend' >>> fourier.inputs.highpass = 0.005 >>> fourier.inputs.lowpass = 0.1 - >>> res = fourier.run() # doctest: +SKIP + >>> res = fourier.run(dry_run=True) """ @@ -759,7 +771,7 @@ class Bandpass(AFNICommand): >>> bandpass.inputs.in_file = example_data('functional.nii') >>> bandpass.inputs.highpass = 0.005 >>> bandpass.inputs.lowpass = 0.1 - >>> res = bandpass.run() # doctest: +SKIP + >>> res = bandpass.run(dry_run=True) """ @@ -796,7 +808,7 @@ class ZCutUp(AFNICommand): >>> zcutup.inputs.in_file = 'functional.nii' >>> zcutup.inputs.out_file = 'functional_zcutup.nii' >>> zcutup.inputs.keep= '0 10' - >>> res = zcutup.run() # doctest: +SKIP + >>> res = zcutup.run(dry_run=True) """ @@ -1025,7 +1037,7 @@ class Allineate(AFNICommand): >>> allineate.inputs.in_file = 'functional.nii' >>> allineate.inputs.out_file= 'functional_allineate.nii' >>> allineate.inputs.in_matrix= 'cmatrix.mat' - >>> res = allineate.run() # doctest: +SKIP + >>> res = allineate.run(dry_run=True) """ @@ -1067,7 +1079,7 @@ class Maskave(AFNICommand): >>> maskave.inputs.quiet= True >>> maskave.cmdline #doctest: +ELLIPSIS '3dmaskave -mask seed_mask.nii -quiet functional.nii > functional_maskave.1D' - >>> res = maskave.run() # doctest: +SKIP + >>> res = maskave.run(dry_run=True) """ @@ -1102,22 +1114,19 @@ class SkullStrip(AFNICommand): >>> skullstrip = afni.SkullStrip() >>> skullstrip.inputs.in_file = 'functional.nii' >>> skullstrip.inputs.args = '-o_ply' - >>> res = skullstrip.run() # doctest: +SKIP + >>> res = skullstrip.run(dry_run=True) """ _cmd = '3dSkullStrip' - _redirect_x = True _input_spec = SkullStripInputSpec _output_spec = AFNICommandOutputSpec + redirect_x = True def __init__(self, **inputs): super(SkullStrip, self).__init__(**inputs) - if not no_afni(): - v = Info.version() - - # As of AFNI 16.0.00, redirect_x is not needed - if isinstance(v[0], int) and v[0] > 15: - self._redirect_x = False + # As of AFNI 16.0.00, redirect_x is not needed + if self.version_major > 15: + self.redirect_x = False class TCatInputSpec(AFNICommandInputSpec): @@ -1149,7 +1158,7 @@ class TCat(AFNICommand): >>> tcat.inputs.in_files = ['functional.nii', 'functional2.nii'] >>> tcat.inputs.out_file= 'functional_tcat.nii' >>> tcat.inputs.rlt = '+' - >>> res = tcat.run() # doctest: +SKIP + >>> res = tcat.run(dry_run=True) """ @@ -1197,7 +1206,7 @@ class Fim(AFNICommand): >>> fim.inputs.out_file = 'functional_corr.nii' >>> fim.inputs.out = 'Correlation' >>> fim.inputs.fim_thr = 0.0009 - >>> res = fim.run() # doctest: +SKIP + >>> res = fim.run(dry_run=True) """ @@ -1246,7 +1255,7 @@ class TCorrelate(AFNICommand): >>> tcorrelate.inputs.yset = 'u_rc1s2_Template.nii' >>> tcorrelate.inputs.polort = -1 >>> tcorrelate.inputs.pearson = True - >>> res = tcarrelate.run() # doctest: +SKIP + >>> res = tcorrelate.run(dry_run=True) """ @@ -1304,7 +1313,7 @@ class TCorr1D(AFNICommand): >>> tcorr1D.inputs.y_1d = 'seed.1D' >>> tcorr1D.cmdline '3dTcorr1D -prefix u_rc1s1_Template_correlation u_rc1s1_Template.nii seed.1D' - >>> res = tcorr1D.run() # doctest: +SKIP + >>> res = tcorr1D.run(dry_run=True) """ _cmd = '3dTcorr1D' @@ -1340,7 +1349,7 @@ class BrickStat(AFNICommand): >>> brickstat.inputs.in_file = 'functional.nii' >>> brickstat.inputs.mask = 'skeleton_mask.nii.gz' >>> brickstat.inputs.min = True - >>> res = brickstat.run() # doctest: +SKIP + >>> res = brickstat.run(dry_run=True) """ _cmd = '3dBrickStat' @@ -1422,7 +1431,7 @@ class ROIStats(AFNICommandBase): >>> roistats.inputs.in_file = 'functional.nii' >>> roistats.inputs.mask = 'skeleton_mask.nii.gz' >>> roistats.inputs.quiet=True - >>> res = roistats.run() # doctest: +SKIP + >>> res = roistats.run(dry_run=True) """ _cmd = '3dROIstats' @@ -1956,7 +1965,7 @@ class HistInputSpec(CommandLineInputSpec): desc='input file to 3dHist', argstr='-input %s', position=1, mandatory=True, exists=True, copyfile=False) prefix = GenFile( - template='{in_file}_hist', keep_extension=False, argstr='-prefix %s', + template='{in_file}_hist', keep_extension=False, argstr='-prefix %s', desc='Write histogram to niml file with this prefix') out_file = GenFile( template='{prefix}.niml.hist', keep_extension=False, @@ -1999,23 +2008,20 @@ class Hist(AFNICommandBase): >>> hist.inputs.in_file = 'functional.nii' >>> hist.cmdline '3dHist -input functional.nii -prefix functional_hist' - >>> res = hist.run() # doctest: +SKIP + >>> res = hist.run(dry_run=True) """ _cmd = '3dHist' _input_spec = HistInputSpec _output_spec = HistOutputSpec - _redirect_x = True + redirect_x = True def __init__(self, **inputs): super(Hist, self).__init__(**inputs) - if not no_afni(): - version = Info.version() - - # As of AFNI 16.0.00, redirect_x is not needed - if isinstance(version[0], int) and version[0] > 15: - self._redirect_x = False + # As of AFNI 16.0.00, redirect_x is not needed + if self.version_major > 15: + self.redirect_x = False def _post_run(self): diff --git a/nipype/interfaces/afni/tests/test_auto_Automask.py b/nipype/interfaces/afni/tests/test_auto_Automask.py index c828cc3f7a..42d24b5b58 100644 --- a/nipype/interfaces/afni/tests/test_auto_Automask.py +++ b/nipype/interfaces/afni/tests/test_auto_Automask.py @@ -4,10 +4,11 @@ def test_Automask_inputs(): - input_map = dict(args=dict(argstr='%s', + input_map = dict(apply_prefix=dict(argstr='-apply_prefix %s', ), - brain_file=dict(argstr='-apply_prefix %s', + args=dict(argstr='%s', ), + brain_file=dict(), clfrac=dict(argstr='-clfrac %.2f', ), dilate=dict(argstr='-dilate %s', @@ -19,10 +20,11 @@ def test_Automask_inputs(): mandatory=True, position=-1, ), - out_file=dict(argstr='-prefix %s', - ), + out_file=dict(), outputtype=dict(usedefault=True, ), + prefix=dict(argstr='-prefix %s', + ), ) inputs = Automask._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_Volreg.py b/nipype/interfaces/afni/tests/test_auto_Volreg.py index 2c1a513929..c001c00885 100644 --- a/nipype/interfaces/afni/tests/test_auto_Volreg.py +++ b/nipype/interfaces/afni/tests/test_auto_Volreg.py @@ -26,10 +26,11 @@ def test_Volreg_inputs(): oned_matrix_save=dict(argstr='-1Dmatrix_save %s', keep_extension=False, ), - out_file=dict(argstr='-prefix %s', - ), + out_file=dict(), outputtype=dict(usedefault=True, ), + prefix=dict(argstr='-prefix %s', + ), timeshift=dict(argstr='-tshift 0', ), verbose=dict(argstr='-verbose', diff --git a/nipype/interfaces/base/interfaces.py b/nipype/interfaces/base/interfaces.py index 02384ff5d1..5a813b6452 100644 --- a/nipype/interfaces/base/interfaces.py +++ b/nipype/interfaces/base/interfaces.py @@ -199,22 +199,6 @@ def post_run(self): """ Implementation of the post-execution hook""" pass - def _genfile_dryrun(self, name, value, out_name=None): - if out_name is None: - out_name = name - - exists_list = self.outputs.trait_names(**dict(exists=lambda t: t is not None or t)) - print(exists_list) - - if isinstance(value, string_types): - files = [value] - else: - files = value - - if self.outputs.traits()[out_name].exists: - for fname in files: - _touch_file(fname) - def _aggregate_outputs(self, dry_run=False): """ Anticipates the outputs. If, for some reason, the outputs cannot be @@ -227,9 +211,11 @@ def _aggregate_outputs(self, dry_run=False): # Rule #1: outputs with a corresponding input (same name) are # automatically copied. if name in outputs: - if dry_run: - self._genfile_dryrun(name, value) - setattr(self.outputs, name, value) + try: + setattr(self.outputs, name, value) + except traits.TraitError: # file does not exist + _genfile_dryrun(name, value) + setattr(self.outputs, name, value) # Rule #2: boolean inputs that start with save_ automatically # enable the corresponding out_ and vice-versa @@ -241,9 +227,12 @@ def _aggregate_outputs(self, dry_run=False): # Rule #3: inputs specifying an output_name metadata will be # mapped to the corresponding output if spec.output_name and self.outputs.traits()[spec.output_name]: - if dry_run: - self._genfile_dryrun(name, value) - setattr(self.outputs, spec.output_name, value) + try: + setattr(self.outputs, spec.output_name, value) + except traits.TraitError: # file does not exist + _genfile_dryrun(name, value) + setattr(self.outputs, spec.output_name, value) + def run(self, dry_run=False, **inputs): @@ -540,10 +529,23 @@ def post_run(self): else: setattr(self.outputs, name, op.abspath(corresponding_input)) -def _touch_file(filename): - if not op.isfile(filename): - with open(filename, 'a'): - os.utime(filename, None) + +def _genfile_dryrun(name, value, out_name=None): + if out_name is None: + out_name = name + + if isinstance(value, string_types): + files = [value] + else: + files = value + + for fname in files: + if not op.isfile(op.abspath(fname)): + with open(fname, 'a'): + os.utime(fname, None) + IFLOGGER.debug('Successfully created dry-run output: %s', fname) + else: + IFLOGGER.debug('File exists, skipping touch %s', fname) def _unlock_display(ndisplay): lockf = op.join('/tmp', '.X%d-lock' % ndisplay) From 290974491398da893b25fadff4bf9d785e3f900e Mon Sep 17 00:00:00 2001 From: oesteban Date: Mon, 22 Feb 2016 10:32:15 -0800 Subject: [PATCH 70/73] use output_type in afni for consistency with fsl --- nipype/interfaces/afni/base.py | 2 +- nipype/interfaces/afni/preprocess.py | 42 +++++++++---------- .../afni/tests/test_auto_AFNICommand.py | 2 +- .../afni/tests/test_auto_AFNItoNIFTI.py | 2 +- .../afni/tests/test_auto_Allineate.py | 2 +- .../afni/tests/test_auto_AutoTcorrelate.py | 2 +- .../afni/tests/test_auto_Autobox.py | 2 +- .../afni/tests/test_auto_Automask.py | 2 +- .../afni/tests/test_auto_Bandpass.py | 2 +- .../afni/tests/test_auto_BlurInMask.py | 2 +- .../afni/tests/test_auto_BrickStat.py | 2 +- .../interfaces/afni/tests/test_auto_Calc.py | 2 +- .../interfaces/afni/tests/test_auto_Copy.py | 2 +- .../afni/tests/test_auto_Despike.py | 2 +- .../afni/tests/test_auto_Detrend.py | 2 +- .../interfaces/afni/tests/test_auto_Eval.py | 2 +- nipype/interfaces/afni/tests/test_auto_Fim.py | 2 +- .../afni/tests/test_auto_Fourier.py | 2 +- .../afni/tests/test_auto_Maskave.py | 2 +- .../interfaces/afni/tests/test_auto_Means.py | 2 +- .../interfaces/afni/tests/test_auto_Merge.py | 2 +- .../interfaces/afni/tests/test_auto_Refit.py | 2 +- .../afni/tests/test_auto_Resample.py | 2 +- .../afni/tests/test_auto_Retroicor.py | 2 +- .../afni/tests/test_auto_SVMTest.py | 2 +- .../afni/tests/test_auto_SVMTrain.py | 2 +- .../afni/tests/test_auto_SkullStrip.py | 2 +- .../interfaces/afni/tests/test_auto_TCat.py | 2 +- .../afni/tests/test_auto_TCorr1D.py | 4 +- .../afni/tests/test_auto_TCorrMap.py | 2 +- .../afni/tests/test_auto_TCorrelate.py | 2 +- .../interfaces/afni/tests/test_auto_TShift.py | 2 +- .../interfaces/afni/tests/test_auto_TStat.py | 2 +- .../interfaces/afni/tests/test_auto_To3D.py | 2 +- .../interfaces/afni/tests/test_auto_Volreg.py | 2 +- .../interfaces/afni/tests/test_auto_Warp.py | 2 +- .../interfaces/afni/tests/test_auto_ZCutUp.py | 2 +- 37 files changed, 58 insertions(+), 58 deletions(-) diff --git a/nipype/interfaces/afni/base.py b/nipype/interfaces/afni/base.py index 5536e61d48..f470fdce12 100644 --- a/nipype/interfaces/afni/base.py +++ b/nipype/interfaces/afni/base.py @@ -103,7 +103,7 @@ def _run_interface(self, runtime): class AFNICommandInputSpec(CommandLineInputSpec): - outputtype = traits.Trait('AFNI', AFNI_FTYPES, usedefault=True, + output_type = traits.Trait('AFNI', AFNI_FTYPES, usedefault=True, desc='AFNI output filetype') class AFNICommandOutputSpec(TraitedSpec): diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index bfa269f6f7..dec3b595af 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -27,7 +27,7 @@ class To3DInputSpec(AFNICommandInputSpec): prefix = traits.Str('afni_to3d', usedefault='true', argstr='-prefix %s', desc='output files prefix') - out_file = GenFile(template='{prefix}{outputtype_}', keep_extension=False, + out_file = GenFile(template='{prefix}{output_type_}', keep_extension=False, desc='output image file name') in_folder = Directory(desc='folder with DICOM images to convert', argstr='%s/*.dcm', @@ -87,7 +87,7 @@ class TShiftInputSpec(AFNICommandInputSpec): exists=True, copyfile=False) prefix = GenFile(template='{in_file}_tshift', keep_extension=False, argstr='-prefix %s', desc='output files prefix') - out_file = GenFile(template='{prefix}{outputtype_}', desc='output image file name') + out_file = GenFile(template='{prefix}{output_type_}', desc='output image file name') tr = traits.Str(argstr='-TR %s', desc='manually set the TR You can attach suffix "s" for ' 'seconds or "ms" for milliseconds.') tzero = traits.Float(argstr='-tzero %s', xor=['tslice'], @@ -135,7 +135,7 @@ class TShift(AFNICommand): class RefitInputSpec(AFNICommandInputSpec): in_file = File(argstr='%s', position=-1, mandatory=True, exists=True, copyfile=True, desc='input file to 3drefit') - out_file = GenFile(template='{in_file}{outputtype_}', desc='output file') + out_file = GenFile(template='{in_file}{output_type_}', desc='output file') deoblique = traits.Bool( False, usedefault=True, argstr='-deoblique', desc='replace current transformation matrix with cardinal matrix') @@ -182,7 +182,7 @@ class WarpInputSpec(AFNICommandInputSpec): desc='input file to 3dWarp') prefix = GenFile(template='{in_file}_warp', keep_extension=False, argstr='-prefix %s', desc='output files prefix') - out_file = GenFile(template="{prefix}{outputtype_}", desc='output image file name') + out_file = GenFile(template="{prefix}{output_type_}", desc='output image file name') tta2mni = traits.Bool(desc='transform dataset from Talairach to MNI152', argstr='-tta2mni') mni2tta = traits.Bool(desc='transform dataset from MNI152 to Talaraich', @@ -234,7 +234,7 @@ class ResampleInputSpec(AFNICommandInputSpec): desc='input file to 3dresample') prefix = GenFile(template='{in_file}_resample', keep_extension=False, argstr='-prefix %s', desc='output files prefix') - out_file = GenFile(template="{prefix}{outputtype_}", keep_extension=False, + out_file = GenFile(template="{prefix}{output_type_}", keep_extension=False, desc='output image file name') orientation = traits.Str(desc='new orientation code', argstr='-orient %s') resample_mode = traits.Enum( @@ -261,7 +261,7 @@ class Resample(AFNICommand): >>> resample = afni.Resample() >>> resample.inputs.in_file = 'functional.nii' >>> resample.inputs.orientation= 'RPI' - >>> resample.inputs.outputtype = "NIFTI" + >>> resample.inputs.output_type = "NIFTI" >>> resample.cmdline '3dresample -orient RPI -prefix functional_resample -inset functional.nii' >>> res = resample.run(dry_run=True) @@ -319,7 +319,7 @@ class TStatInputSpec(AFNICommandInputSpec): desc='input file to 3dTstat') prefix = GenFile(template='{in_file}_tstat', keep_extension=False, argstr='-prefix %s', desc='output files prefix') - out_file = GenFile(template="{in_file}{outputtype_}", keep_extension=False, + out_file = GenFile(template="{in_file}{output_type_}", keep_extension=False, desc='output image file name') mask = File(desc='mask file', argstr='-mask %s', exists=True) options = traits.Str(desc='selected statistical output', argstr='%s') @@ -356,7 +356,7 @@ class DetrendInputSpec(AFNICommandInputSpec): desc='input file to 3dDetrend') prefix = GenFile(template='{in_file}_detrend', keep_extension=False, argstr='-prefix %s', desc='output files prefix') - out_file = GenFile(template="{prefix}{outputtype_}", keep_extension=False, + out_file = GenFile(template="{prefix}{output_type_}", keep_extension=False, desc='output image file name') @@ -375,7 +375,7 @@ class Detrend(AFNICommand): >>> detrend = afni.Detrend() >>> detrend.inputs.in_file = 'functional.nii' >>> detrend.inputs.args = '-polort 2' - >>> detrend.inputs.outputtype = "AFNI" + >>> detrend.inputs.output_type = "AFNI" >>> detrend.cmdline '3dDetrend -polort 2 -prefix functional_detrend functional.nii' >>> res = detrend.run(dry_run=True) @@ -392,7 +392,7 @@ class DespikeInputSpec(AFNICommandInputSpec): desc='input file to 3dDespike') prefix = GenFile(template='{in_file}_despike', keep_extension=False, argstr='-prefix %s', desc='output files prefix') - out_file = GenFile(template="{prefix}{outputtype_}", keep_extension=False, + out_file = GenFile(template="{prefix}{output_type_}", keep_extension=False, desc='output image file name') @@ -434,8 +434,8 @@ class AutomaskInputSpec(AFNICommandInputSpec): erode = traits.Int(argstr="-erode %s", desc='erode the mask inwards') # Automatically generated output names - out_file = GenFile(template="{prefix}{outputtype_}", desc='output image file name') - brain_file = GenFile(template="{apply_prefix}{outputtype_}", + out_file = GenFile(template="{prefix}{output_type_}", desc='output image file name') + brain_file = GenFile(template="{apply_prefix}{output_type_}", desc="output file from 3dAutomask") class AutomaskOutputSpec(TraitedSpec): @@ -457,7 +457,7 @@ class Automask(AFNICommand): >>> automask = afni.Automask() >>> automask.inputs.in_file = 'functional.nii' >>> automask.inputs.dilate = 1 - >>> automask.inputs.outputtype = "NIFTI" + >>> automask.inputs.output_type = "NIFTI" >>> automask.cmdline #doctest: +ELLIPSIS '3dAutomask -apply_prefix functional_masked -dilate 1 -prefix functional_mask functional.nii' >>> res = automask.run(dry_run=True) @@ -488,7 +488,7 @@ class VolregInputSpec(AFNICommandInputSpec): argstr='-twodup') # Outputs - out_file = GenFile(template="{in_file}_volreg{outputtype_}", + out_file = GenFile(template="{in_file}_volreg{output_type_}", desc='output image file name') md1d_file = GenFile(template='{in_file}_md.1D', argstr='-maxdisp1D %s', keep_extension=False, position=-4, desc='max displacement output file') @@ -521,7 +521,7 @@ class Volreg(AFNICommand): >>> volreg.inputs.in_file = 'functional.nii' >>> volreg.inputs.args = '-Fourier -twopass' >>> volreg.inputs.zpad = 4 - >>> volreg.inputs.outputtype = "NIFTI" + >>> volreg.inputs.output_type = "NIFTI" >>> volreg.cmdline #doctest: +ELLIPSIS '3dvolreg -Fourier -twopass -1Dfile functional.1D -1Dmatrix_save functional.aff12.1D -prefix functional_volreg -zpad 4 -maxdisp1D functional_md.1D functional.nii' >>> res = volreg.run(dry_run=True) @@ -578,7 +578,7 @@ class CopyInputSpec(AFNICommandInputSpec): in_file = File(desc='input file to 3dcopy', argstr='%s', position=-2, mandatory=True, exists=True, copyfile=False) out_file = GenFile( - template='{in_file}_copy{outputtype_}', position=-1, + template='{in_file}_copy{output_type_}', position=-1, argstr='%s', desc='output image file name') @@ -602,13 +602,13 @@ class Copy(AFNICommand): >>> from copy import deepcopy >>> copy3d_2 = afni.Copy() >>> copy3d_2.inputs.in_file = 'functional.nii' - >>> copy3d_2.inputs.outputtype = 'NIFTI' + >>> copy3d_2.inputs.output_type = 'NIFTI' >>> copy3d_2.cmdline '3dcopy functional.nii functional_copy.nii' >>> copy3d_3 = afni.Copy() >>> copy3d_3.inputs.in_file = 'functional.nii' - >>> copy3d_3.inputs.outputtype = 'NIFTI_GZ' + >>> copy3d_3.inputs.output_type = 'NIFTI_GZ' >>> copy3d_3.cmdline '3dcopy functional.nii functional_copy.nii.gz' @@ -1271,7 +1271,7 @@ class TCorr1DInputSpec(AFNICommandInputSpec): argstr='-prefix %s', desc='output files prefix') y_1d = File(argstr='%s', position=-1, mandatory=True, exists=True, desc='1D time series file input') - out_file = File(name_template='{prefix}{outputtype_}', keep_extension=False, + out_file = File(name_template='{prefix}{output_type_}', keep_extension=False, desc='output filename prefix') pearson = traits.Bool(desc='Correlation is the normal' + ' Pearson correlation coefficient', @@ -1494,7 +1494,7 @@ class Calc(AFNICommand): >>> calc.inputs.in_file_b = 'functional2.nii' >>> calc.inputs.expr='a*b' >>> calc.inputs.out_file = 'functional_calc.nii.gz' - >>> calc.inputs.outputtype = "NIFTI" + >>> calc.inputs.output_type = "NIFTI" >>> calc.cmdline #doctest: +ELLIPSIS '3dcalc -a functional.nii -b functional2.nii -expr "a*b" -prefix functional_calc.nii.gz' @@ -1515,7 +1515,7 @@ class BlurInMaskInputSpec(AFNICommandInputSpec): copyfile=False) prefix = GenFile(template='{in_file}_blur', keep_extension=False, argstr='-prefix %s', desc='output files prefix') - out_file = GenFile(template='{prefix}{outputtype_}', keep_extension=False, + out_file = GenFile(template='{prefix}{output_type_}', keep_extension=False, desc='output to the file') mask = File( desc='Mask dataset, if desired. Blurring will occur only within the mask. Voxels NOT in the mask will be set to zero in the output.', diff --git a/nipype/interfaces/afni/tests/test_auto_AFNICommand.py b/nipype/interfaces/afni/tests/test_auto_AFNICommand.py index e029603110..a00c44d21e 100644 --- a/nipype/interfaces/afni/tests/test_auto_AFNICommand.py +++ b/nipype/interfaces/afni/tests/test_auto_AFNICommand.py @@ -6,7 +6,7 @@ def test_AFNICommand_inputs(): input_map = dict(args=dict(argstr='%s', ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), ) inputs = AFNICommand._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_AFNItoNIFTI.py b/nipype/interfaces/afni/tests/test_auto_AFNItoNIFTI.py index e37978a073..25d85c0ff0 100644 --- a/nipype/interfaces/afni/tests/test_auto_AFNItoNIFTI.py +++ b/nipype/interfaces/afni/tests/test_auto_AFNItoNIFTI.py @@ -16,7 +16,7 @@ def test_AFNItoNIFTI_inputs(): name_source='in_file', name_template='%s.nii', ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), ) inputs = AFNItoNIFTI._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_Allineate.py b/nipype/interfaces/afni/tests/test_auto_Allineate.py index b8339b2aaf..63c3b02ddf 100644 --- a/nipype/interfaces/afni/tests/test_auto_Allineate.py +++ b/nipype/interfaces/afni/tests/test_auto_Allineate.py @@ -68,7 +68,7 @@ def test_Allineate_inputs(): ), out_weight_file=dict(argstr='-wtprefix %s', ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), reference=dict(argstr='-base %s', ), diff --git a/nipype/interfaces/afni/tests/test_auto_AutoTcorrelate.py b/nipype/interfaces/afni/tests/test_auto_AutoTcorrelate.py index 138317c3b2..679a195115 100644 --- a/nipype/interfaces/afni/tests/test_auto_AutoTcorrelate.py +++ b/nipype/interfaces/afni/tests/test_auto_AutoTcorrelate.py @@ -25,7 +25,7 @@ def test_AutoTcorrelate_inputs(): out_file=dict(argstr='-prefix %s', keep_extension=False, ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), polort=dict(argstr='-polort %d', ), diff --git a/nipype/interfaces/afni/tests/test_auto_Autobox.py b/nipype/interfaces/afni/tests/test_auto_Autobox.py index 0005b05656..c3c37c8519 100644 --- a/nipype/interfaces/afni/tests/test_auto_Autobox.py +++ b/nipype/interfaces/afni/tests/test_auto_Autobox.py @@ -15,7 +15,7 @@ def test_Autobox_inputs(): out_file=dict(argstr='-prefix %s', name_source='in_file', ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), padding=dict(argstr='-npad %d', ), diff --git a/nipype/interfaces/afni/tests/test_auto_Automask.py b/nipype/interfaces/afni/tests/test_auto_Automask.py index 42d24b5b58..1fb32bd509 100644 --- a/nipype/interfaces/afni/tests/test_auto_Automask.py +++ b/nipype/interfaces/afni/tests/test_auto_Automask.py @@ -21,7 +21,7 @@ def test_Automask_inputs(): position=-1, ), out_file=dict(), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), prefix=dict(argstr='-prefix %s', ), diff --git a/nipype/interfaces/afni/tests/test_auto_Bandpass.py b/nipype/interfaces/afni/tests/test_auto_Bandpass.py index 404b3c2324..a56d3e8e04 100644 --- a/nipype/interfaces/afni/tests/test_auto_Bandpass.py +++ b/nipype/interfaces/afni/tests/test_auto_Bandpass.py @@ -48,7 +48,7 @@ def test_Bandpass_inputs(): name_template='%s_bp', position=1, ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), tr=dict(argstr='-dt %f', ), diff --git a/nipype/interfaces/afni/tests/test_auto_BlurInMask.py b/nipype/interfaces/afni/tests/test_auto_BlurInMask.py index 01dbe23a2a..cef0743f2e 100644 --- a/nipype/interfaces/afni/tests/test_auto_BlurInMask.py +++ b/nipype/interfaces/afni/tests/test_auto_BlurInMask.py @@ -27,7 +27,7 @@ def test_BlurInMask_inputs(): ), out_file=dict(keep_extension=False, ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), prefix=dict(argstr='-prefix %s', keep_extension=False, diff --git a/nipype/interfaces/afni/tests/test_auto_BrickStat.py b/nipype/interfaces/afni/tests/test_auto_BrickStat.py index 2246fe966d..25a35d64b2 100644 --- a/nipype/interfaces/afni/tests/test_auto_BrickStat.py +++ b/nipype/interfaces/afni/tests/test_auto_BrickStat.py @@ -16,7 +16,7 @@ def test_BrickStat_inputs(): min=dict(argstr='-min', position=1, ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), ) inputs = BrickStat._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_Calc.py b/nipype/interfaces/afni/tests/test_auto_Calc.py index c2692f536c..da849bc858 100644 --- a/nipype/interfaces/afni/tests/test_auto_Calc.py +++ b/nipype/interfaces/afni/tests/test_auto_Calc.py @@ -26,7 +26,7 @@ def test_Calc_inputs(): name_source='in_file_a', name_template='%s_calc', ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), single_idx=dict(), start_idx=dict(requires=['stop_idx'], diff --git a/nipype/interfaces/afni/tests/test_auto_Copy.py b/nipype/interfaces/afni/tests/test_auto_Copy.py index 803b3cce03..5ab15a44c5 100644 --- a/nipype/interfaces/afni/tests/test_auto_Copy.py +++ b/nipype/interfaces/afni/tests/test_auto_Copy.py @@ -14,7 +14,7 @@ def test_Copy_inputs(): out_file=dict(argstr='%s', position=-1, ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), ) inputs = Copy._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_Despike.py b/nipype/interfaces/afni/tests/test_auto_Despike.py index 36918ecdb1..c2782e4dc1 100644 --- a/nipype/interfaces/afni/tests/test_auto_Despike.py +++ b/nipype/interfaces/afni/tests/test_auto_Despike.py @@ -13,7 +13,7 @@ def test_Despike_inputs(): ), out_file=dict(keep_extension=False, ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), prefix=dict(argstr='-prefix %s', keep_extension=False, diff --git a/nipype/interfaces/afni/tests/test_auto_Detrend.py b/nipype/interfaces/afni/tests/test_auto_Detrend.py index f973948b14..9646a319bf 100644 --- a/nipype/interfaces/afni/tests/test_auto_Detrend.py +++ b/nipype/interfaces/afni/tests/test_auto_Detrend.py @@ -13,7 +13,7 @@ def test_Detrend_inputs(): ), out_file=dict(keep_extension=False, ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), prefix=dict(argstr='-prefix %s', keep_extension=False, diff --git a/nipype/interfaces/afni/tests/test_auto_Eval.py b/nipype/interfaces/afni/tests/test_auto_Eval.py index c46cfc5c10..942d52fcc6 100644 --- a/nipype/interfaces/afni/tests/test_auto_Eval.py +++ b/nipype/interfaces/afni/tests/test_auto_Eval.py @@ -28,7 +28,7 @@ def test_Eval_inputs(): name_source='in_file_a', name_template='%s_calc', ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), single_idx=dict(), start_idx=dict(requires=['stop_idx'], diff --git a/nipype/interfaces/afni/tests/test_auto_Fim.py b/nipype/interfaces/afni/tests/test_auto_Fim.py index 0a914a9031..c385b9a928 100644 --- a/nipype/interfaces/afni/tests/test_auto_Fim.py +++ b/nipype/interfaces/afni/tests/test_auto_Fim.py @@ -25,7 +25,7 @@ def test_Fim_inputs(): name_source='in_file', name_template='%s_fim', ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), ) inputs = Fim._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_Fourier.py b/nipype/interfaces/afni/tests/test_auto_Fourier.py index 4c5498bad8..8b7b86a033 100644 --- a/nipype/interfaces/afni/tests/test_auto_Fourier.py +++ b/nipype/interfaces/afni/tests/test_auto_Fourier.py @@ -23,7 +23,7 @@ def test_Fourier_inputs(): name_source='in_file', name_template='%s_fourier', ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), ) inputs = Fourier._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_Maskave.py b/nipype/interfaces/afni/tests/test_auto_Maskave.py index a6a3bdc08d..df21b9422e 100644 --- a/nipype/interfaces/afni/tests/test_auto_Maskave.py +++ b/nipype/interfaces/afni/tests/test_auto_Maskave.py @@ -18,7 +18,7 @@ def test_Maskave_inputs(): keep_extension=False, position=-1, ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), quiet=dict(argstr='-quiet', position=2, diff --git a/nipype/interfaces/afni/tests/test_auto_Means.py b/nipype/interfaces/afni/tests/test_auto_Means.py index ddefbeaf7c..f18d796c5f 100644 --- a/nipype/interfaces/afni/tests/test_auto_Means.py +++ b/nipype/interfaces/afni/tests/test_auto_Means.py @@ -25,7 +25,7 @@ def test_Means_inputs(): name_source='in_file_a', name_template='%s_mean', ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), scale=dict(argstr='-%sscale', ), diff --git a/nipype/interfaces/afni/tests/test_auto_Merge.py b/nipype/interfaces/afni/tests/test_auto_Merge.py index 53e9b1ae63..961e422f85 100644 --- a/nipype/interfaces/afni/tests/test_auto_Merge.py +++ b/nipype/interfaces/afni/tests/test_auto_Merge.py @@ -18,7 +18,7 @@ def test_Merge_inputs(): ), out_file=dict(argstr='-prefix %s', ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), ) inputs = Merge._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_Refit.py b/nipype/interfaces/afni/tests/test_auto_Refit.py index c396920538..b4447f0dd1 100644 --- a/nipype/interfaces/afni/tests/test_auto_Refit.py +++ b/nipype/interfaces/afni/tests/test_auto_Refit.py @@ -15,7 +15,7 @@ def test_Refit_inputs(): position=-1, ), out_file=dict(), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), space=dict(argstr='-space %s', ), diff --git a/nipype/interfaces/afni/tests/test_auto_Resample.py b/nipype/interfaces/afni/tests/test_auto_Resample.py index a98b6848d0..2b0bdfe3d7 100644 --- a/nipype/interfaces/afni/tests/test_auto_Resample.py +++ b/nipype/interfaces/afni/tests/test_auto_Resample.py @@ -17,7 +17,7 @@ def test_Resample_inputs(): ), out_file=dict(keep_extension=False, ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), prefix=dict(argstr='-prefix %s', keep_extension=False, diff --git a/nipype/interfaces/afni/tests/test_auto_Retroicor.py b/nipype/interfaces/afni/tests/test_auto_Retroicor.py index debd16ad22..3a304b243a 100644 --- a/nipype/interfaces/afni/tests/test_auto_Retroicor.py +++ b/nipype/interfaces/afni/tests/test_auto_Retroicor.py @@ -25,7 +25,7 @@ def test_Retroicor_inputs(): mandatory=True, position=1, ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), resp=dict(argstr='-resp %s', position=-3, diff --git a/nipype/interfaces/afni/tests/test_auto_SVMTest.py b/nipype/interfaces/afni/tests/test_auto_SVMTest.py index 9c9376e4c0..c5363f9b9c 100644 --- a/nipype/interfaces/afni/tests/test_auto_SVMTest.py +++ b/nipype/interfaces/afni/tests/test_auto_SVMTest.py @@ -25,7 +25,7 @@ def test_SVMTest_inputs(): out_file=dict(argstr='-predictions %s', name_template='%s_predictions', ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), testlabels=dict(argstr='-testlabels %s', ), diff --git a/nipype/interfaces/afni/tests/test_auto_SVMTrain.py b/nipype/interfaces/afni/tests/test_auto_SVMTrain.py index ed6dbf5b40..e858e24f94 100644 --- a/nipype/interfaces/afni/tests/test_auto_SVMTrain.py +++ b/nipype/interfaces/afni/tests/test_auto_SVMTrain.py @@ -39,7 +39,7 @@ def test_SVMTrain_inputs(): name_template='%s_vectors', suffix='_bucket', ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), trainlabels=dict(argstr='-trainlabels %s', ), diff --git a/nipype/interfaces/afni/tests/test_auto_SkullStrip.py b/nipype/interfaces/afni/tests/test_auto_SkullStrip.py index aad31022d0..f291120518 100644 --- a/nipype/interfaces/afni/tests/test_auto_SkullStrip.py +++ b/nipype/interfaces/afni/tests/test_auto_SkullStrip.py @@ -15,7 +15,7 @@ def test_SkullStrip_inputs(): name_source='in_file', name_template='%s_skullstrip', ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), ) inputs = SkullStrip._input_spec() diff --git a/nipype/interfaces/afni/tests/test_auto_TCat.py b/nipype/interfaces/afni/tests/test_auto_TCat.py index 488c6333e4..6b526a4134 100644 --- a/nipype/interfaces/afni/tests/test_auto_TCat.py +++ b/nipype/interfaces/afni/tests/test_auto_TCat.py @@ -15,7 +15,7 @@ def test_TCat_inputs(): name_source='in_files', name_template='%s_tcat', ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), rlt=dict(argstr='-rlt%s', position=1, diff --git a/nipype/interfaces/afni/tests/test_auto_TCorr1D.py b/nipype/interfaces/afni/tests/test_auto_TCorr1D.py index 025ac8c421..6479e5c684 100644 --- a/nipype/interfaces/afni/tests/test_auto_TCorr1D.py +++ b/nipype/interfaces/afni/tests/test_auto_TCorr1D.py @@ -11,9 +11,9 @@ def test_TCorr1D_inputs(): xor=['pearson', 'spearman', 'quadrant'], ), out_file=dict(keep_extension=False, - name_template='{prefix}{outputtype_}', + name_template='{prefix}{output_type_}', ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), pearson=dict(argstr=' -pearson', position=1, diff --git a/nipype/interfaces/afni/tests/test_auto_TCorrMap.py b/nipype/interfaces/afni/tests/test_auto_TCorrMap.py index 15fa6a5481..c9f0a1bfae 100644 --- a/nipype/interfaces/afni/tests/test_auto_TCorrMap.py +++ b/nipype/interfaces/afni/tests/test_auto_TCorrMap.py @@ -49,7 +49,7 @@ def test_TCorrMap_inputs(): name_source='in_file', suffix='_mean', ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), pmean=dict(argstr='-Pmean %s', name_source='in_file', diff --git a/nipype/interfaces/afni/tests/test_auto_TCorrelate.py b/nipype/interfaces/afni/tests/test_auto_TCorrelate.py index 9a88216559..bce8dfaa54 100644 --- a/nipype/interfaces/afni/tests/test_auto_TCorrelate.py +++ b/nipype/interfaces/afni/tests/test_auto_TCorrelate.py @@ -10,7 +10,7 @@ def test_TCorrelate_inputs(): name_source='xset', name_template='%s_tcorr', ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), pearson=dict(argstr='-pearson', position=1, diff --git a/nipype/interfaces/afni/tests/test_auto_TShift.py b/nipype/interfaces/afni/tests/test_auto_TShift.py index 01d6ef6de4..1e6f254d4c 100644 --- a/nipype/interfaces/afni/tests/test_auto_TShift.py +++ b/nipype/interfaces/afni/tests/test_auto_TShift.py @@ -16,7 +16,7 @@ def test_TShift_inputs(): interp=dict(argstr='-%s', ), out_file=dict(), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), prefix=dict(argstr='-prefix %s', keep_extension=False, diff --git a/nipype/interfaces/afni/tests/test_auto_TStat.py b/nipype/interfaces/afni/tests/test_auto_TStat.py index 146fc5d8c1..349628e661 100644 --- a/nipype/interfaces/afni/tests/test_auto_TStat.py +++ b/nipype/interfaces/afni/tests/test_auto_TStat.py @@ -17,7 +17,7 @@ def test_TStat_inputs(): ), out_file=dict(keep_extension=False, ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), prefix=dict(argstr='-prefix %s', keep_extension=False, diff --git a/nipype/interfaces/afni/tests/test_auto_To3D.py b/nipype/interfaces/afni/tests/test_auto_To3D.py index 2330682ad4..55f7f71acc 100644 --- a/nipype/interfaces/afni/tests/test_auto_To3D.py +++ b/nipype/interfaces/afni/tests/test_auto_To3D.py @@ -20,7 +20,7 @@ def test_To3D_inputs(): ), out_file=dict(keep_extension=False, ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), prefix=dict(argstr='-prefix %s', usedefault='true', diff --git a/nipype/interfaces/afni/tests/test_auto_Volreg.py b/nipype/interfaces/afni/tests/test_auto_Volreg.py index c001c00885..80cb42f1dd 100644 --- a/nipype/interfaces/afni/tests/test_auto_Volreg.py +++ b/nipype/interfaces/afni/tests/test_auto_Volreg.py @@ -27,7 +27,7 @@ def test_Volreg_inputs(): keep_extension=False, ), out_file=dict(), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), prefix=dict(argstr='-prefix %s', ), diff --git a/nipype/interfaces/afni/tests/test_auto_Warp.py b/nipype/interfaces/afni/tests/test_auto_Warp.py index 4c9a9895cb..bbf9d4a429 100644 --- a/nipype/interfaces/afni/tests/test_auto_Warp.py +++ b/nipype/interfaces/afni/tests/test_auto_Warp.py @@ -24,7 +24,7 @@ def test_Warp_inputs(): newgrid=dict(argstr='-newgrid %f', ), out_file=dict(), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), prefix=dict(argstr='-prefix %s', keep_extension=False, diff --git a/nipype/interfaces/afni/tests/test_auto_ZCutUp.py b/nipype/interfaces/afni/tests/test_auto_ZCutUp.py index 6c11d59af6..e913a5f234 100644 --- a/nipype/interfaces/afni/tests/test_auto_ZCutUp.py +++ b/nipype/interfaces/afni/tests/test_auto_ZCutUp.py @@ -17,7 +17,7 @@ def test_ZCutUp_inputs(): name_source='in_file', name_template='%s_zcupup', ), - outputtype=dict(usedefault=True, + output_type=dict(usedefault=True, ), ) inputs = ZCutUp._input_spec() From 3c0c4b24185d8c2568ee4c6cddd8452c543eaa41 Mon Sep 17 00:00:00 2001 From: oesteban Date: Mon, 22 Feb 2016 11:01:05 -0800 Subject: [PATCH 71/73] fix afni input --- nipype/interfaces/afni/preprocess.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index dec3b595af..49d8545abc 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -87,7 +87,6 @@ class TShiftInputSpec(AFNICommandInputSpec): exists=True, copyfile=False) prefix = GenFile(template='{in_file}_tshift', keep_extension=False, argstr='-prefix %s', desc='output files prefix') - out_file = GenFile(template='{prefix}{output_type_}', desc='output image file name') tr = traits.Str(argstr='-TR %s', desc='manually set the TR You can attach suffix "s" for ' 'seconds or "ms" for milliseconds.') tzero = traits.Float(argstr='-tzero %s', xor=['tslice'], @@ -103,6 +102,7 @@ class TShiftInputSpec(AFNICommandInputSpec): rlt = traits.Bool(argstr="-rlt", desc='Before shifting, remove the mean and linear trend') rltplus = traits.Bool(argstr="-rlt+", desc='Before shifting, remove the mean and linear trend' ' and later put back the mean') + out_file = GenFile(template='{prefix}{output_type_}', desc='output image file name') class TShift(AFNICommand): @@ -319,7 +319,7 @@ class TStatInputSpec(AFNICommandInputSpec): desc='input file to 3dTstat') prefix = GenFile(template='{in_file}_tstat', keep_extension=False, argstr='-prefix %s', desc='output files prefix') - out_file = GenFile(template="{in_file}{output_type_}", keep_extension=False, + out_file = GenFile(template="{prefix}{output_type_}", keep_extension=False, desc='output image file name') mask = File(desc='mask file', argstr='-mask %s', exists=True) options = traits.Str(desc='selected statistical output', argstr='%s') From a01cadd82b42e4186099a35dcec8c2f7fac8b23d Mon Sep 17 00:00:00 2001 From: oesteban Date: Mon, 22 Feb 2016 11:30:57 -0800 Subject: [PATCH 72/73] some fixes to let make test run --- nipype/interfaces/ants/base.py | 10 +++++----- nipype/interfaces/freesurfer/base.py | 2 +- nipype/interfaces/fsl/base.py | 2 +- nipype/interfaces/fsl/epi.py | 6 +++--- nipype/pipeline/engine/base.py | 2 +- nipype/pipeline/engine/utils.py | 5 ++--- nipype/pipeline/engine/workflows.py | 4 ++-- 7 files changed, 15 insertions(+), 16 deletions(-) diff --git a/nipype/interfaces/ants/base.py b/nipype/interfaces/ants/base.py index b0787a175b..87eeca6e72 100644 --- a/nipype/interfaces/ants/base.py +++ b/nipype/interfaces/ants/base.py @@ -67,12 +67,12 @@ def _num_threads_update(self): # (i.e. respect SGE $NSLOTS or environmental variables of threads, or # user environmental settings) if (self.inputs.num_threads == -1): - if (ALT_ITKv4_THREAD_LIMIT_VARIABLE in self.inputs.environ): - del self.inputs.environ[ALT_ITKv4_THREAD_LIMIT_VARIABLE] - if (PREFERED_ITKv4_THREAD_LIMIT_VARIABLE in self.inputs.environ): - del self.inputs.environ[PREFERED_ITKv4_THREAD_LIMIT_VARIABLE] + if (ALT_ITKv4_THREAD_LIMIT_VARIABLE in self.environ): + del self.environ[ALT_ITKv4_THREAD_LIMIT_VARIABLE] + if (PREFERED_ITKv4_THREAD_LIMIT_VARIABLE in self.environ): + del self.environ[PREFERED_ITKv4_THREAD_LIMIT_VARIABLE] else: - self.inputs.environ.update({PREFERED_ITKv4_THREAD_LIMIT_VARIABLE: + self.environ.update({PREFERED_ITKv4_THREAD_LIMIT_VARIABLE: '%s' % self.inputs.num_threads}) @classmethod diff --git a/nipype/interfaces/freesurfer/base.py b/nipype/interfaces/freesurfer/base.py index 48b0b7ad86..f1009359ba 100644 --- a/nipype/interfaces/freesurfer/base.py +++ b/nipype/interfaces/freesurfer/base.py @@ -109,7 +109,7 @@ def __init__(self, **inputs): def _subjects_dir_update(self): if self.inputs.subjects_dir: - self.inputs.environ.update({'SUBJECTS_DIR': + self.environ.update({'SUBJECTS_DIR': self.inputs.subjects_dir}) @classmethod diff --git a/nipype/interfaces/fsl/base.py b/nipype/interfaces/fsl/base.py index f6a3335c8b..3e7caa6235 100644 --- a/nipype/interfaces/fsl/base.py +++ b/nipype/interfaces/fsl/base.py @@ -125,7 +125,7 @@ class FSLCommand(CommandLine): # pylint: disable=W0223 def __init__(self, **inputs): super(FSLCommand, self).__init__(**inputs) self.inputs.output_type = FSLOUTPUTTYPE - self.inputs.environ.update({'FSLOUTPUTTYPE': FSLOUTPUTTYPE}) + self.environ.update({'FSLOUTPUTTYPE': FSLOUTPUTTYPE}) @property def version(self): diff --git a/nipype/interfaces/fsl/epi.py b/nipype/interfaces/fsl/epi.py index 25bca7fd31..96466967a9 100644 --- a/nipype/interfaces/fsl/epi.py +++ b/nipype/interfaces/fsl/epi.py @@ -411,10 +411,10 @@ def __init__(self, **inputs): def _num_threads_update(self): self._num_threads = self.inputs.num_threads if not isdefined(self.inputs.num_threads): - if 'OMP_NUM_THREADS' in self.inputs.environ: - del self.inputs.environ['OMP_NUM_THREADS'] + if 'OMP_NUM_THREADS' in self.environ: + del self.environ['OMP_NUM_THREADS'] else: - self.inputs.environ['OMP_NUM_THREADS'] = str(self.inputs.num_threads) + self.environ['OMP_NUM_THREADS'] = str(self.inputs.num_threads) def _format_arg(self, name, spec, value): if name == 'in_topup_fieldcoef': diff --git a/nipype/pipeline/engine/base.py b/nipype/pipeline/engine/base.py index 5491573399..e47bc360c5 100644 --- a/nipype/pipeline/engine/base.py +++ b/nipype/pipeline/engine/base.py @@ -27,7 +27,7 @@ from copy import deepcopy import re import numpy as np -from ...interfaces.specs import DynamicTraitedSpec +from ...interfaces.base import DynamicTraitedSpec from ...utils.filemanip import loadpkl, savepkl from ... import logging diff --git a/nipype/pipeline/engine/utils.py b/nipype/pipeline/engine/utils.py index b60e46db8a..8b862dc209 100644 --- a/nipype/pipeline/engine/utils.py +++ b/nipype/pipeline/engine/utils.py @@ -36,8 +36,7 @@ from ...utils.filemanip import (fname_presuffix, FileNotFoundError, filename_to_list, get_related_files) from ...utils.misc import create_function_from_source, str2bool -from ...interfaces.traits_extension import isdefined, Undefined -from ...interfaces.base import CommandLine, InterfaceResult +from ...interfaces.base import CommandLine, InterfaceResult, isdefined, Undefined from ...interfaces.utility import IdentityInterface from ...utils.provenance import ProvStore, pm, nipype_ns, get_id @@ -1159,7 +1158,7 @@ def clean_working_directory(outputs, cwd, inputs, needed_outputs, config, for key in outputs.copyable_trait_names(): if key not in outputs_to_keep: setattr(outputs, key, Undefined) - + def merge_dict(d1, d2, merge=lambda x, y: y): """ diff --git a/nipype/pipeline/engine/workflows.py b/nipype/pipeline/engine/workflows.py index 26fd3ae883..ef8ef8d858 100644 --- a/nipype/pipeline/engine/workflows.py +++ b/nipype/pipeline/engine/workflows.py @@ -50,8 +50,8 @@ from ...utils.misc import package_check, str2bool from ... import config, logging -from ...interfaces.specs import TraitedSpec -from ...interfaces.traits_extension import traits, TraitListObject, TraitDictObject +from ...interfaces.base.traits_extension import TraitListObject, TraitDictObject +from ...interfaces.base import traits, TraitedSpec from ...utils.misc import (getsource, create_function_from_source, flatten, unflatten) from ...utils.filemanip import save_json From fe4578b4461ee8aee63c86eaf47de5ac4985fae6 Mon Sep 17 00:00:00 2001 From: oesteban Date: Mon, 22 Feb 2016 11:44:46 -0800 Subject: [PATCH 73/73] fix Gunzip --- nipype/algorithms/misc.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/nipype/algorithms/misc.py b/nipype/algorithms/misc.py index cf94d5de4b..6154d6e859 100644 --- a/nipype/algorithms/misc.py +++ b/nipype/algorithms/misc.py @@ -293,8 +293,6 @@ def _run_interface(self, runtime): class GunzipInputSpec(BaseInputSpec): in_file = File(exists=True, mandatory=True) - out_file = GenFile(ns='in_file', template='%s', name_remove='.gz', - keep_extension=False, desc='output file') class GunzipOutputSpec(TraitedSpec): @@ -302,16 +300,24 @@ class GunzipOutputSpec(TraitedSpec): class Gunzip(BaseInterface): - """Gunzip wrapper - """ + """Gunzip wrapper""" _input_spec = GunzipInputSpec _output_spec = GunzipOutputSpec def _run_interface(self, runtime): import gzip + + _, fname, ext = split_filename(self.inputs.in_file) + out_file = fname + ext + if not ext.endswith('.gz'): + IFLOGGER.warn('File does not have .gz extension.') + else: + out_file = out_file[:-3] + with gzip.open(self.inputs.in_file, 'rb') as in_file: - with open(self.inputs.out_file, 'wb') as out_file: - out_file.write(in_file.read()) + with open(out_file, 'wb') as ofile: + ofile.write(in_file.read()) + self.outputs.out_file = out_file return runtime