From 6d65cbb9ca4beebf2669c68851f9c52ab5b24b98 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Sat, 20 Jan 2018 22:22:07 -0500 Subject: [PATCH 01/11] fixing test_input_version (showing that maximum version check doesnt work) --- nipype/interfaces/base/tests/test_core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nipype/interfaces/base/tests/test_core.py b/nipype/interfaces/base/tests/test_core.py index 05a9f02b47..f55d9db508 100644 --- a/nipype/interfaces/base/tests/test_core.py +++ b/nipype/interfaces/base/tests/test_core.py @@ -237,7 +237,7 @@ class DerivedInterface2(nib.BaseInterface): obj = DerivedInterface2() obj.inputs.foo = 1 with pytest.raises(Exception): - obj._check_version_requirements() + obj._check_version_requirements(obj.inputs) class InputSpec(nib.TraitedSpec): foo = nib.traits.Int(desc='a random int', max_ver='0.9') From 955b3ade1f7a8d533fdb2478834657b4061435c2 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Sat, 20 Jan 2018 22:43:21 -0500 Subject: [PATCH 02/11] fixing _check_version_requirements, so it also checks maximal version --- nipype/interfaces/base/core.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nipype/interfaces/base/core.py b/nipype/interfaces/base/core.py index 3aa84b9b3f..62063309e3 100644 --- a/nipype/interfaces/base/core.py +++ b/nipype/interfaces/base/core.py @@ -411,8 +411,12 @@ def _check_version_requirements(self, trait_object, raise_exception=True): raise Exception( 'Trait %s (%s) (version %s < required %s)' % (name, self.__class__.__name__, version, min_ver)) - check = dict(max_ver=lambda t: t is not None) - names = trait_object.trait_names(**check) + + # check maximum version + check = dict(max_ver=lambda t: t is not None) + names = trait_object.trait_names(**check) + if names and self.version: + version = LooseVersion(str(self.version)) for name in names: max_ver = LooseVersion( str(trait_object.traits()[name].max_ver)) From 40a0804f2f5c497097bd2a0bbfc38c73af8eef18 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Sat, 20 Jan 2018 23:05:14 -0500 Subject: [PATCH 03/11] fixing and splitting test_input_version --- nipype/interfaces/base/tests/test_core.py | 50 ++++++++++++----------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/nipype/interfaces/base/tests/test_core.py b/nipype/interfaces/base/tests/test_core.py index f55d9db508..12d5c78e58 100644 --- a/nipype/interfaces/base/tests/test_core.py +++ b/nipype/interfaces/base/tests/test_core.py @@ -177,74 +177,76 @@ def __init__(self, **inputs): assert 'ec5755e07287e04a4b409e03b77a517c' == hashvalue -def test_input_version(): - class InputSpec(nib.TraitedSpec): - foo = nib.traits.Int(desc='a random int', min_ver='0.9') +class MinVerInputSpec(nib.TraitedSpec): + foo = nib.traits.Int(desc='a random int', min_ver='0.9') + +class MaxVerInputSpec(nib.TraitedSpec): + foo = nib.traits.Int(desc='a random int', max_ver='0.7') + +def test_input_version_1(): class DerivedInterface1(nib.BaseInterface): - input_spec = InputSpec + input_spec = MinVerInputSpec obj = DerivedInterface1() obj._check_version_requirements(obj.inputs) config.set('execution', 'stop_on_unknown_version', True) - with pytest.raises(Exception): + with pytest.raises(ValueError) as excinfo: obj._check_version_requirements(obj.inputs) + assert "no version information" in str(excinfo.value) config.set_default_config() - class InputSpec(nib.TraitedSpec): - foo = nib.traits.Int(desc='a random int', min_ver='0.9') +def test_input_version_2(): class DerivedInterface1(nib.BaseInterface): - input_spec = InputSpec + input_spec = MinVerInputSpec _version = '0.8' obj = DerivedInterface1() obj.inputs.foo = 1 - with pytest.raises(Exception): - obj._check_version_requirements() + with pytest.raises(Exception) as excinfo: + obj._check_version_requirements(obj.inputs) + assert "version 0.8 < required 0.9" in str(excinfo.value) - class InputSpec(nib.TraitedSpec): - foo = nib.traits.Int(desc='a random int', min_ver='0.9') +def test_input_version_3(): class DerivedInterface1(nib.BaseInterface): - input_spec = InputSpec + input_spec = MinVerInputSpec _version = '0.10' obj = DerivedInterface1() obj._check_version_requirements(obj.inputs) - class InputSpec(nib.TraitedSpec): - foo = nib.traits.Int(desc='a random int', min_ver='0.9') +def test_input_version_4(): class DerivedInterface1(nib.BaseInterface): - input_spec = InputSpec + input_spec = MinVerInputSpec _version = '0.9' obj = DerivedInterface1() obj.inputs.foo = 1 obj._check_version_requirements(obj.inputs) - class InputSpec(nib.TraitedSpec): - foo = nib.traits.Int(desc='a random int', max_ver='0.7') +def test_input_version_5(): class DerivedInterface2(nib.BaseInterface): - input_spec = InputSpec + input_spec = MaxVerInputSpec _version = '0.8' obj = DerivedInterface2() obj.inputs.foo = 1 - with pytest.raises(Exception): + with pytest.raises(Exception) as excinfo: obj._check_version_requirements(obj.inputs) + assert "version 0.8 > required 0.7" in str(excinfo.value) - class InputSpec(nib.TraitedSpec): - foo = nib.traits.Int(desc='a random int', max_ver='0.9') +def test_input_version_6(): class DerivedInterface1(nib.BaseInterface): - input_spec = InputSpec - _version = '0.9' + input_spec = MaxVerInputSpec + _version = '0.7' obj = DerivedInterface1() obj.inputs.foo = 1 From 35495663d8f05a385535bc8591ca6ab5734279de Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Sat, 20 Jan 2018 23:09:13 -0500 Subject: [PATCH 04/11] removing _requires_warn (not used) --- nipype/interfaces/base/specs.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/nipype/interfaces/base/specs.py b/nipype/interfaces/base/specs.py index 0bc0544b9a..7f87cd626d 100644 --- a/nipype/interfaces/base/specs.py +++ b/nipype/interfaces/base/specs.py @@ -119,20 +119,6 @@ def _xor_warn(self, obj, name, old, new): '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 """ From 17940049170a5bd41c88820a67f8e7fdfc0e9f8a Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Sat, 20 Jan 2018 23:13:45 -0500 Subject: [PATCH 05/11] removing _hash_infile (not used) --- nipype/interfaces/base/specs.py | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/nipype/interfaces/base/specs.py b/nipype/interfaces/base/specs.py index 7f87cd626d..3f7676c191 100644 --- a/nipype/interfaces/base/specs.py +++ b/nipype/interfaces/base/specs.py @@ -151,29 +151,6 @@ def _deprecated_warn(self, obj, name, old, new): '%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 From cc4c4183cc4cffe861bf0ed1b2035c9dafc0591c Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Sat, 20 Jan 2018 23:30:46 -0500 Subject: [PATCH 06/11] changing __pretty__ to _repr_pretty_ --- nipype/interfaces/base/support.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/nipype/interfaces/base/support.py b/nipype/interfaces/base/support.py index 88fdf761a5..2aa1d7162a 100644 --- a/nipype/interfaces/base/support.py +++ b/nipype/interfaces/base/support.py @@ -168,10 +168,8 @@ def _get_bunch_hash(self): sorted_dict = to_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""" + def _repr_pretty_(self, p, cycle): + """Support for the pretty module from ipython.externals""" if cycle: p.text('Bunch(...)') else: From 36ffda1dbf93dec300f6c6a0def0bf2494c81da5 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Sun, 21 Jan 2018 23:04:49 -0500 Subject: [PATCH 07/11] changing name MultiPath to MultiObject --- nipype/algorithms/confounds.py | 8 +- nipype/algorithms/metrics.py | 6 +- nipype/algorithms/misc.py | 32 +++---- nipype/algorithms/modelgen.py | 12 +-- nipype/algorithms/rapidart.py | 28 +++--- nipype/interfaces/afni/model.py | 12 +-- nipype/interfaces/afni/preprocess.py | 4 +- nipype/interfaces/afni/utils.py | 10 +- nipype/interfaces/ants/legacy.py | 6 +- nipype/interfaces/ants/registration.py | 18 ++-- nipype/interfaces/ants/resampling.py | 10 +- nipype/interfaces/ants/segmentation.py | 24 ++--- .../ants/tests/test_spec_JointFusion.py | 4 +- nipype/interfaces/ants/utils.py | 8 +- nipype/interfaces/base/__init__.py | 4 +- nipype/interfaces/base/traits_extension.py | 20 ++-- nipype/interfaces/camino/convert.py | 4 +- nipype/interfaces/camino/dti.py | 4 +- nipype/interfaces/camino/utils.py | 4 +- nipype/interfaces/cmtk/cmtk.py | 8 +- nipype/interfaces/cmtk/convert.py | 22 ++--- nipype/interfaces/cmtk/nbs.py | 8 +- nipype/interfaces/cmtk/nx.py | 18 ++-- nipype/interfaces/dcm2nii.py | 26 ++--- nipype/interfaces/dcmstack.py | 4 +- .../interfaces/diffusion_toolkit/postproc.py | 4 +- nipype/interfaces/dipy/simulate.py | 8 +- nipype/interfaces/elastix/registration.py | 8 +- nipype/interfaces/freesurfer/longitudinal.py | 24 ++--- nipype/interfaces/freesurfer/model.py | 26 ++--- nipype/interfaces/freesurfer/preprocess.py | 12 +-- nipype/interfaces/freesurfer/utils.py | 4 +- nipype/interfaces/fsl/dti.py | 40 ++++---- nipype/interfaces/fsl/epi.py | 6 +- nipype/interfaces/fsl/fix.py | 10 +- nipype/interfaces/fsl/maths.py | 4 +- nipype/interfaces/fsl/model.py | 88 ++++++++--------- nipype/interfaces/fsl/preprocess.py | 24 ++--- nipype/interfaces/fsl/utils.py | 4 +- nipype/interfaces/io.py | 66 ++++++------- nipype/interfaces/matlab.py | 4 +- nipype/interfaces/minc/minc.py | 34 +++---- nipype/interfaces/mipav/developer.py | 10 +- nipype/interfaces/mne/base.py | 6 +- nipype/interfaces/mrtrix/preprocess.py | 10 +- nipype/interfaces/mrtrix3/utils.py | 2 +- nipype/interfaces/niftyseg/em.py | 4 +- nipype/interfaces/nilearn.py | 4 +- nipype/interfaces/nipy/model.py | 8 +- nipype/interfaces/nipy/preprocess.py | 20 ++-- nipype/interfaces/semtools/brains/classify.py | 2 +- .../semtools/brains/segmentation.py | 10 +- .../interfaces/semtools/brains/utilities.py | 8 +- nipype/interfaces/semtools/converters.py | 2 +- .../semtools/diffusion/diffusion.py | 6 +- .../interfaces/semtools/diffusion/gtract.py | 14 +-- .../semtools/diffusion/maxcurvature.py | 2 +- .../diffusion/tractography/commandlineonly.py | 2 +- .../diffusion/tractography/fiberprocess.py | 2 +- .../diffusion/tractography/fibertrack.py | 2 +- .../diffusion/tractography/ukftractography.py | 4 +- nipype/interfaces/semtools/featurecreator.py | 2 +- .../semtools/filtering/denoising.py | 6 +- .../semtools/filtering/featuredetection.py | 4 +- .../semtools/legacy/registration.py | 2 +- .../semtools/registration/brainsfit.py | 12 +-- .../semtools/registration/brainsresample.py | 4 +- .../semtools/registration/brainsresize.py | 2 +- .../semtools/registration/specialized.py | 40 ++++---- .../semtools/segmentation/specialized.py | 48 +++++----- .../semtools/testing/featuredetection.py | 2 +- .../testing/generateaveragelmkfile.py | 4 +- .../semtools/testing/landmarkscompare.py | 2 +- .../interfaces/semtools/utilities/brains.py | 36 +++---- nipype/interfaces/slicer/converters.py | 2 +- .../interfaces/slicer/diffusion/diffusion.py | 18 ++-- .../interfaces/slicer/filtering/arithmetic.py | 2 +- .../slicer/filtering/checkerboardfilter.py | 4 +- .../interfaces/slicer/filtering/denoising.py | 4 +- .../slicer/filtering/extractskeleton.py | 2 +- .../slicer/filtering/histogrammatching.py | 2 +- .../slicer/filtering/imagelabelcombine.py | 2 +- .../interfaces/slicer/filtering/morphology.py | 2 +- .../filtering/n4itkbiasfieldcorrection.py | 8 +- .../resamplescalarvectordwivolume.py | 10 +- .../slicer/filtering/thresholdscalarvolume.py | 2 +- .../votingbinaryholefillingimagefilter.py | 4 +- nipype/interfaces/slicer/generate_classes.py | 8 +- nipype/interfaces/slicer/legacy/converters.py | 2 +- .../slicer/legacy/diffusion/denoising.py | 8 +- nipype/interfaces/slicer/legacy/filtering.py | 4 +- .../interfaces/slicer/legacy/registration.py | 14 +-- .../interfaces/slicer/legacy/segmentation.py | 2 +- .../quantification/changequantification.py | 2 +- .../petstandarduptakevaluecomputation.py | 2 +- .../slicer/registration/brainsfit.py | 14 +-- .../slicer/registration/brainsresample.py | 4 +- .../slicer/registration/specialized.py | 44 ++++----- .../simpleregiongrowingsegmentation.py | 4 +- .../slicer/segmentation/specialized.py | 6 +- nipype/interfaces/slicer/surface.py | 8 +- nipype/interfaces/slicer/utilities.py | 2 +- nipype/interfaces/spm/base.py | 4 +- nipype/interfaces/spm/model.py | 30 +++--- nipype/interfaces/spm/preprocess.py | 94 +++++++++---------- nipype/interfaces/spm/utils.py | 16 ++-- nipype/interfaces/utility/base.py | 8 +- nipype/pipeline/engine/nodes.py | 8 +- nipype/scripts/utils.py | 6 +- nipype/utils/nipype_cmd.py | 6 +- 110 files changed, 655 insertions(+), 655 deletions(-) diff --git a/nipype/algorithms/confounds.py b/nipype/algorithms/confounds.py index 10985edc6f..1922690437 100644 --- a/nipype/algorithms/confounds.py +++ b/nipype/algorithms/confounds.py @@ -27,7 +27,7 @@ from ..external.due import BibTeX from ..interfaces.base import (traits, TraitedSpec, BaseInterface, BaseInterfaceInputSpec, File, isdefined, - InputMultiPath, OutputMultiPath) + InputMultiObject, OutputMultiObject) from ..utils import NUMPY_MMAP from ..utils.misc import normalize_mc_params @@ -360,7 +360,7 @@ def _list_outputs(self): class CompCorInputSpec(BaseInterfaceInputSpec): realigned_file = File( exists=True, mandatory=True, desc='already realigned brain image (4D)') - mask_files = InputMultiPath( + mask_files = InputMultiObject( File(exists=True), desc=('One or more mask files that determines ' 'ROI (3D). When more that one file is ' @@ -649,7 +649,7 @@ class TCompCorInputSpec(CompCorInputSpec): class TCompCorOutputSpec(CompCorOutputSpec): # and all the fields in CompCorOutputSpec - high_variance_masks = OutputMultiPath( + high_variance_masks = OutputMultiObject( File(exists=True), desc=(("voxels exceeding the variance" " threshold"))) @@ -714,7 +714,7 @@ def _list_outputs(self): class TSNRInputSpec(BaseInterfaceInputSpec): - in_file = InputMultiPath( + in_file = InputMultiObject( File(exists=True), mandatory=True, desc='realigned 4D file or a list of 3D files') diff --git a/nipype/algorithms/metrics.py b/nipype/algorithms/metrics.py index 002b2a8216..2b3a6929e2 100644 --- a/nipype/algorithms/metrics.py +++ b/nipype/algorithms/metrics.py @@ -29,7 +29,7 @@ from ..utils.misc import package_check from ..interfaces.base import (BaseInterface, traits, TraitedSpec, File, - InputMultiPath, BaseInterfaceInputSpec, + InputMultiObject, BaseInterfaceInputSpec, isdefined) from ..utils import NUMPY_MMAP @@ -382,11 +382,11 @@ def _list_outputs(self): class FuzzyOverlapInputSpec(BaseInterfaceInputSpec): - in_ref = InputMultiPath( + in_ref = InputMultiObject( File(exists=True), mandatory=True, desc='Reference image. Requires the same dimensions as in_tst.') - in_tst = InputMultiPath( + in_tst = InputMultiObject( File(exists=True), mandatory=True, desc='Test image. Requires the same dimensions as in_ref.') diff --git a/nipype/algorithms/misc.py b/nipype/algorithms/misc.py index 87b1fae400..44844e632d 100644 --- a/nipype/algorithms/misc.py +++ b/nipype/algorithms/misc.py @@ -31,7 +31,7 @@ from .. import logging from . import metrics as nam from ..interfaces.base import ( - BaseInterface, traits, TraitedSpec, File, InputMultiPath, OutputMultiPath, + BaseInterface, traits, TraitedSpec, File, InputMultiObject, OutputMultiObject, BaseInterfaceInputSpec, isdefined, DynamicTraitedSpec, Undefined) from ..utils.filemanip import fname_presuffix, split_filename, filename_to_list from ..utils import NUMPY_MMAP @@ -124,7 +124,7 @@ def _list_outputs(self): class SimpleThresholdInputSpec(BaseInterfaceInputSpec): - volumes = InputMultiPath( + volumes = InputMultiObject( File(exists=True), desc='volumes to be thresholded', mandatory=True) threshold = traits.Float( desc='volumes to be thresholdedeverything below this value will be set\ @@ -133,7 +133,7 @@ class SimpleThresholdInputSpec(BaseInterfaceInputSpec): class SimpleThresholdOutputSpec(TraitedSpec): - thresholded_volumes = OutputMultiPath( + thresholded_volumes = OutputMultiObject( File(exists=True), desc="thresholded volumes") @@ -170,7 +170,7 @@ def _list_outputs(self): class ModifyAffineInputSpec(BaseInterfaceInputSpec): - volumes = InputMultiPath( + volumes = InputMultiObject( File(exists=True), desc='volumes which affine matrices will be modified', mandatory=True) @@ -183,7 +183,7 @@ class ModifyAffineInputSpec(BaseInterfaceInputSpec): class ModifyAffineOutputSpec(TraitedSpec): - transformed_volumes = OutputMultiPath(File(exist=True)) + transformed_volumes = OutputMultiObject(File(exist=True)) class ModifyAffine(BaseInterface): @@ -328,7 +328,7 @@ class Matlab2CSVInputSpec(TraitedSpec): class Matlab2CSVOutputSpec(TraitedSpec): - csv_files = OutputMultiPath( + csv_files = OutputMultiObject( File(desc='Output CSV files for each variable saved in the input .mat\ file')) @@ -503,7 +503,7 @@ def makefmtlist(output_array, typelist, rowheadingsBool, shape, class MergeCSVFilesInputSpec(TraitedSpec): - in_files = InputMultiPath( + in_files = InputMultiObject( File(exists=True), mandatory=True, desc='Input comma-separated value (CSV) files') @@ -1046,14 +1046,14 @@ def gen_noise(self, class NormalizeProbabilityMapSetInputSpec(TraitedSpec): - in_files = InputMultiPath( + in_files = InputMultiObject( 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.') class NormalizeProbabilityMapSetOutputSpec(TraitedSpec): - out_files = OutputMultiPath(File(exists=True), desc="normalized maps") + out_files = OutputMultiObject(File(exists=True), desc="normalized maps") class NormalizeProbabilityMapSet(BaseInterface): @@ -1099,10 +1099,10 @@ class SplitROIsInputSpec(TraitedSpec): class SplitROIsOutputSpec(TraitedSpec): - out_files = OutputMultiPath(File(exists=True), desc='the resulting ROIs') - out_masks = OutputMultiPath( + out_files = OutputMultiObject(File(exists=True), desc='the resulting ROIs') + out_masks = OutputMultiObject( File(exists=True), desc='a mask indicating valid values') - out_index = OutputMultiPath( + out_index = OutputMultiObject( File(exists=True), desc='arrays keeping original locations') @@ -1148,9 +1148,9 @@ def _list_outputs(self): class MergeROIsInputSpec(TraitedSpec): - in_files = InputMultiPath( + in_files = InputMultiObject( File(exists=True, mandatory=True, desc='files to be re-merged')) - in_index = InputMultiPath( + in_index = InputMultiObject( File(exists=True, mandatory=True), desc='array keeping original locations') in_reference = File(exists=True, desc='reference file') @@ -1421,7 +1421,7 @@ def merge_rois(in_files, in_idxs, in_ref, dtype=None, out_file=None): class CalculateMedianInputSpec(BaseInterfaceInputSpec): - in_files = InputMultiPath( + in_files = InputMultiObject( File( exists=True, mandatory=True, @@ -1432,7 +1432,7 @@ class CalculateMedianInputSpec(BaseInterfaceInputSpec): class CalculateMedianOutputSpec(TraitedSpec): - median_files = OutputMultiPath( + median_files = OutputMultiObject( File(exists=True), desc="One or more median images") diff --git a/nipype/algorithms/modelgen.py b/nipype/algorithms/modelgen.py index 289ebc8388..743cca1b16 100644 --- a/nipype/algorithms/modelgen.py +++ b/nipype/algorithms/modelgen.py @@ -30,7 +30,7 @@ from scipy.special import gammaln from ..utils import NUMPY_MMAP -from ..interfaces.base import (BaseInterface, TraitedSpec, InputMultiPath, +from ..interfaces.base import (BaseInterface, TraitedSpec, InputMultiObject, traits, File, Bunch, BaseInterfaceInputSpec, isdefined) from ..utils.filemanip import filename_to_list @@ -182,7 +182,7 @@ def gen_info(run_event_files): class SpecifyModelInputSpec(BaseInterfaceInputSpec): - subject_info = InputMultiPath( + subject_info = InputMultiObject( Bunch, mandatory=True, xor=['subject_info', 'event_files'], @@ -190,14 +190,14 @@ class SpecifyModelInputSpec(BaseInterfaceInputSpec): 'condition information. see ' ':ref:`SpecifyModel` or ' 'SpecifyModel.__doc__ for details') - event_files = InputMultiPath( + event_files = InputMultiObject( traits.List(File(exists=True)), mandatory=True, xor=['subject_info', 'event_files'], desc='List of event description files 1, 2 or 3 ' 'column format corresponding to onsets, ' 'durations and amplitudes') - realignment_parameters = InputMultiPath( + realignment_parameters = InputMultiObject( File(exists=True), desc='Realignment parameters returned ' 'by motion correction algorithm', @@ -210,12 +210,12 @@ class SpecifyModelInputSpec(BaseInterfaceInputSpec): "NIPY", usedefault=True, desc="Source of motion parameters") - outlier_files = InputMultiPath( + outlier_files = InputMultiObject( File(exists=True), desc='Files containing scan outlier indices ' 'that should be tossed', copyfile=False) - functional_runs = InputMultiPath( + functional_runs = InputMultiObject( traits.Either(traits.List(File(exists=True)), File(exists=True)), mandatory=True, desc='Data files for model. List of 4D ' diff --git a/nipype/algorithms/rapidart.py b/nipype/algorithms/rapidart.py index ddf8de8992..48edc8804b 100644 --- a/nipype/algorithms/rapidart.py +++ b/nipype/algorithms/rapidart.py @@ -31,8 +31,8 @@ import scipy.io as sio from ..utils import NUMPY_MMAP -from ..interfaces.base import (BaseInterface, traits, InputMultiPath, - OutputMultiPath, TraitedSpec, File, +from ..interfaces.base import (BaseInterface, traits, InputMultiObject, + OutputMultiObject, TraitedSpec, File, BaseInterfaceInputSpec, isdefined) from ..utils.filemanip import filename_to_list, save_json, split_filename from ..utils.misc import find_indices, normalize_mc_params @@ -163,12 +163,12 @@ def _calc_norm_affine(affines, use_differences, brain_pts=None): class ArtifactDetectInputSpec(BaseInterfaceInputSpec): - realigned_files = InputMultiPath( + realigned_files = InputMultiObject( File(exists=True), desc=("Names of realigned functional data " "files"), mandatory=True) - realignment_parameters = InputMultiPath( + realignment_parameters = InputMultiObject( File(exists=True), mandatory=True, desc=("Names of realignment " @@ -267,22 +267,22 @@ class ArtifactDetectInputSpec(BaseInterfaceInputSpec): class ArtifactDetectOutputSpec(TraitedSpec): - outlier_files = OutputMultiPath( + outlier_files = OutputMultiObject( File(exists=True), desc=("One file for each functional run " "containing a list of 0-based indices" " corresponding to outlier volumes")) - intensity_files = OutputMultiPath( + intensity_files = OutputMultiObject( File(exists=True), desc=("One file for each functional run " "containing the global intensity " "values determined from the " "brainmask")) - norm_files = OutputMultiPath( + norm_files = OutputMultiObject( File, desc=("One file for each functional run " "containing the composite norm")) - statistic_files = OutputMultiPath( + statistic_files = OutputMultiObject( File(exists=True), desc=("One file for each functional run " "containing information about the " @@ -291,16 +291,16 @@ class ArtifactDetectOutputSpec(TraitedSpec): "details of stimulus correlated " "motion and a listing or artifacts " "by event type.")) - plot_files = OutputMultiPath( + plot_files = OutputMultiObject( File, desc=("One image file for each functional run " "containing the detected outliers")) - mask_files = OutputMultiPath( + mask_files = OutputMultiObject( File, desc=("One image file for each functional run " "containing the mask used for global " "signal calculation")) - displacement_files = OutputMultiPath( + displacement_files = OutputMultiObject( File, desc=("One image file for each " "functional run containing the " @@ -631,13 +631,13 @@ def _run_interface(self, runtime): class StimCorrInputSpec(BaseInterfaceInputSpec): - realignment_parameters = InputMultiPath( + realignment_parameters = InputMultiObject( File(exists=True), mandatory=True, desc=("Names of realignment " "parameters corresponding to " "the functional data files")) - intensity_values = InputMultiPath( + intensity_values = InputMultiObject( File(exists=True), mandatory=True, desc=("Name of file containing intensity " @@ -653,7 +653,7 @@ class StimCorrInputSpec(BaseInterfaceInputSpec): class StimCorrOutputSpec(TraitedSpec): - stimcorr_files = OutputMultiPath( + stimcorr_files = OutputMultiObject( File(exists=True), desc=("List of files containing " "correlation values")) diff --git a/nipype/interfaces/afni/model.py b/nipype/interfaces/afni/model.py index 0d56f2dbb5..520fbacb09 100644 --- a/nipype/interfaces/afni/model.py +++ b/nipype/interfaces/afni/model.py @@ -18,7 +18,7 @@ import os from ..base import (CommandLineInputSpec, CommandLine, Directory, TraitedSpec, - traits, isdefined, File, InputMultiPath, Undefined, Str) + traits, isdefined, File, InputMultiObject, Undefined, Str) from ...external.due import BibTeX from .base import (AFNICommandBase, AFNICommand, AFNICommandInputSpec, @@ -26,7 +26,7 @@ class DeconvolveInputSpec(AFNICommandInputSpec): - in_files = InputMultiPath( + in_files = InputMultiObject( File(exists=True), desc='filenames of 3D+time input datasets. More than one filename can ' 'be given and the datasets will be auto-catenated in time. ' @@ -306,7 +306,7 @@ def _list_outputs(self): class RemlfitInputSpec(AFNICommandInputSpec): # mandatory files - in_files = InputMultiPath( + in_files = InputMultiObject( File(exists=True), desc='Read time series dataset', argstr='-input "%s"', @@ -353,7 +353,7 @@ class RemlfitInputSpec(AFNICommandInputSpec): '(only with \'mask\' or \'automask\' options).', argstr='-STATmask %s', exists=True) - addbase = InputMultiPath( + addbase = InputMultiObject( File( exists=True, desc='file containing columns to add to regression matrix'), @@ -364,7 +364,7 @@ class RemlfitInputSpec(AFNICommandInputSpec): copyfile=False, sep=" ", argstr='-addbase %s') - slibase = InputMultiPath( + slibase = InputMultiObject( File( exists=True, desc='file containing columns to add to regression matrix'), @@ -381,7 +381,7 @@ class RemlfitInputSpec(AFNICommandInputSpec): 'will slow the program down, and make it use a lot more memory ' '(to hold all the matrix stuff).', argstr='-slibase %s') - slibase_sm = InputMultiPath( + slibase_sm = InputMultiObject( File( exists=True, desc='file containing columns to add to regression matrix'), diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index f8bb57e06d..6498f63acc 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -19,7 +19,7 @@ from ...utils.filemanip import (load_json, save_json, split_filename, fname_presuffix) from ..base import (CommandLineInputSpec, CommandLine, TraitedSpec, traits, - isdefined, File, InputMultiPath, Undefined, Str) + isdefined, File, InputMultiObject, Undefined, Str) from .base import (AFNICommandBase, AFNICommand, AFNICommandInputSpec, AFNICommandOutputSpec, AFNIPythonCommandInputSpec, @@ -775,7 +775,7 @@ class BandpassInputSpec(AFNICommandInputSpec): desc='Despike each time series before other processing. Hopefully, ' 'you don\'t actually need to do this, which is why it is ' 'optional.') - orthogonalize_file = InputMultiPath( + orthogonalize_file = InputMultiObject( File(exists=True), argstr='-ort %s', desc='Also orthogonalize input to columns in f.1D. Multiple \'-ort\' ' diff --git a/nipype/interfaces/afni/utils.py b/nipype/interfaces/afni/utils.py index 188ba158c0..36ab537d09 100644 --- a/nipype/interfaces/afni/utils.py +++ b/nipype/interfaces/afni/utils.py @@ -23,7 +23,7 @@ from ...utils.filemanip import (load_json, save_json, split_filename) from ..base import (CommandLineInputSpec, CommandLine, Directory, TraitedSpec, - traits, isdefined, File, InputMultiPath, Undefined, Str) + traits, isdefined, File, InputMultiObject, Undefined, Str) from ...external.due import BibTeX from .base import (AFNICommandBase, AFNICommand, AFNICommandInputSpec, AFNICommandOutputSpec, AFNIPythonCommandInputSpec, @@ -1424,7 +1424,7 @@ class MaskTool(AFNICommand): class MergeInputSpec(AFNICommandInputSpec): - in_files = InputMultiPath( + in_files = InputMultiObject( File(desc='input file to 3dmerge', exists=True), argstr='%s', position=-1, @@ -1990,7 +1990,7 @@ class Resample(AFNICommand): class TCatInputSpec(AFNICommandInputSpec): - in_files = InputMultiPath( + in_files = InputMultiObject( File(exists=True), desc='input file to 3dTcat', argstr=' %s', @@ -2020,7 +2020,7 @@ class TCatInputSpec(AFNICommandInputSpec): class TCat(AFNICommand): """Concatenate sub-bricks from input datasets into one big 3D+time dataset. - TODO Replace InputMultiPath in_files with Traits.List, if possible. Current + TODO Replace InputMultiObject in_files with Traits.List, if possible. Current version adds extra whitespace. For complete details, see the `3dTcat Documentation. @@ -2628,7 +2628,7 @@ class Axialize(AFNICommand): class ZcatInputSpec(AFNICommandInputSpec): - in_files = InputMultiPath( + in_files = InputMultiObject( File(desc='input files to 3dZcat', exists=True), argstr='%s', position=-1, diff --git a/nipype/interfaces/ants/legacy.py b/nipype/interfaces/ants/legacy.py index 9ca5844426..69352d117d 100644 --- a/nipype/interfaces/ants/legacy.py +++ b/nipype/interfaces/ants/legacy.py @@ -18,7 +18,7 @@ from glob import glob from .base import ANTSCommand, ANTSCommandInputSpec -from ..base import TraitedSpec, File, traits, isdefined, OutputMultiPath +from ..base import TraitedSpec, File, traits, isdefined, OutputMultiObject from ...utils.filemanip import split_filename @@ -255,9 +255,9 @@ class buildtemplateparallelInputSpec(ANTSCommandInputSpec): class buildtemplateparallelOutputSpec(TraitedSpec): final_template_file = File(exists=True, desc='final ANTS template') - template_files = OutputMultiPath( + template_files = OutputMultiObject( File(exists=True), desc='Templates from different stages of iteration') - subject_outfiles = OutputMultiPath( + subject_outfiles = OutputMultiObject( File(exists=True), desc=('Outputs for each input image. Includes warp ' 'field, inverse warp, Affine, original image ' diff --git a/nipype/interfaces/ants/registration.py b/nipype/interfaces/ants/registration.py index 843e9b3043..90411591f0 100644 --- a/nipype/interfaces/ants/registration.py +++ b/nipype/interfaces/ants/registration.py @@ -14,7 +14,7 @@ import os from ...utils.filemanip import filename_to_list -from ..base import TraitedSpec, File, Str, traits, InputMultiPath, isdefined +from ..base import TraitedSpec, File, Str, traits, InputMultiObject, isdefined from .base import ANTSCommand, ANTSCommandInputSpec @@ -26,12 +26,12 @@ class ANTSInputSpec(ANTSCommandInputSpec): usedefault=False, position=1, desc='image dimension (2 or 3)') - fixed_image = InputMultiPath( + fixed_image = InputMultiObject( File(exists=True), mandatory=True, desc=('image to which the moving image is ' 'warped')) - moving_image = InputMultiPath( + moving_image = InputMultiObject( File(exists=True), argstr='%s', mandatory=True, @@ -257,7 +257,7 @@ class RegistrationInputSpec(ANTSCommandInputSpec): argstr='--dimensionality %d', usedefault=True, desc='image dimension (2 or 3)') - fixed_image = InputMultiPath( + fixed_image = InputMultiObject( File(exists=True), mandatory=True, desc='Image to which the moving_image should be transformed' @@ -269,14 +269,14 @@ class RegistrationInputSpec(ANTSCommandInputSpec): xor=['fixed_image_masks'], desc='Mask used to limit metric sampling region of the fixed image' 'in all stages') - fixed_image_masks = InputMultiPath( + fixed_image_masks = InputMultiObject( traits.Either('NULL', File(exists=True)), min_ver='2.2.0', xor=['fixed_image_mask'], desc= 'Masks used to limit metric sampling region of the fixed image, defined per registration stage' '(Use "NULL" to omit a mask at a given stage)') - moving_image = InputMultiPath( + moving_image = InputMultiObject( File(exists=True), mandatory=True, desc= @@ -289,7 +289,7 @@ class RegistrationInputSpec(ANTSCommandInputSpec): xor=['moving_image_masks'], desc='mask used to limit metric sampling region of the moving image' 'in all stages') - moving_image_masks = InputMultiPath( + moving_image_masks = InputMultiObject( traits.Either('NULL', File(exists=True)), min_ver='2.2.0', xor=['moving_image_mask'], @@ -310,14 +310,14 @@ class RegistrationInputSpec(ANTSCommandInputSpec): 'Filename for restoring the internal restorable state of the registration' ) - initial_moving_transform = InputMultiPath( + initial_moving_transform = InputMultiObject( File(exists=True), argstr='%s', desc='A transform or a list of transforms that should be applied' 'before the registration begins. Note that, when a list is given,' 'the transformations are applied in reverse order.', xor=['initial_moving_transform_com']) - invert_initial_moving_transform = InputMultiPath( + invert_initial_moving_transform = InputMultiObject( traits.Bool(), requires=["initial_moving_transform"], desc='One boolean or a list of booleans that indicate' diff --git a/nipype/interfaces/ants/resampling.py b/nipype/interfaces/ants/resampling.py index a3f5723ba8..6d7b775e28 100644 --- a/nipype/interfaces/ants/resampling.py +++ b/nipype/interfaces/ants/resampling.py @@ -13,7 +13,7 @@ import os from .base import ANTSCommand, ANTSCommandInputSpec -from ..base import TraitedSpec, File, traits, isdefined, InputMultiPath +from ..base import TraitedSpec, File, traits, isdefined, InputMultiObject from ...utils.filemanip import split_filename @@ -55,7 +55,7 @@ class WarpTimeSeriesImageMultiTransformInputSpec(ANTSCommandInputSpec): argstr='--use-NN', desc='Use nearest neighbor interpolation') use_bspline = traits.Bool( argstr='--use-Bspline', desc='Use 3rd order B-Spline interpolation') - transformation_series = InputMultiPath( + transformation_series = InputMultiObject( File(exists=True), argstr='%s', desc='transformation file(s) to be applied', @@ -197,7 +197,7 @@ class WarpImageMultiTransformInputSpec(ANTSCommandInputSpec): argstr='--use-NN', desc='Use nearest neighbor interpolation') use_bspline = traits.Bool( argstr='--use-BSpline', desc='Use 3rd order B-Spline interpolation') - transformation_series = InputMultiPath( + transformation_series = InputMultiObject( File(exists=True), argstr='%s', desc='transformation file(s) to be applied', @@ -350,13 +350,13 @@ class ApplyTransformsInputSpec(ANTSCommandInputSpec): traits.Float(), # Gaussian/MultiLabel (sigma, alpha) traits.Float())) transforms = traits.Either( - InputMultiPath(File(exists=True)), + InputMultiObject(File(exists=True)), 'identity', 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()) + invert_transform_flags = InputMultiObject(traits.Bool()) default_value = traits.Float( 0.0, argstr='--default-value %g', usedefault=True) print_out_composite_warp_file = traits.Bool( diff --git a/nipype/interfaces/ants/segmentation.py b/nipype/interfaces/ants/segmentation.py index b82db2e401..d49e46f1a7 100644 --- a/nipype/interfaces/ants/segmentation.py +++ b/nipype/interfaces/ants/segmentation.py @@ -15,7 +15,7 @@ import os from ...external.due import BibTeX from ...utils.filemanip import split_filename, copyfile, which -from ..base import TraitedSpec, File, traits, InputMultiPath, OutputMultiPath, isdefined +from ..base import TraitedSpec, File, traits, InputMultiObject, OutputMultiObject, isdefined from .base import ANTSCommand, ANTSCommandInputSpec @@ -27,7 +27,7 @@ class AtroposInputSpec(ANTSCommandInputSpec): argstr='--image-dimensionality %d', usedefault=True, desc='image dimension (2, 3, or 4)') - intensity_images = InputMultiPath( + intensity_images = InputMultiObject( File(exists=True), argstr="--intensity-image %s...", mandatory=True) mask_image = File(exists=True, argstr='--mask-image %s', mandatory=True) initialization = traits.Enum( @@ -39,7 +39,7 @@ class AtroposInputSpec(ANTSCommandInputSpec): argstr="%s", requires=['number_of_tissue_classes'], mandatory=True) - prior_probability_images = InputMultiPath(File(exists=True)) + prior_probability_images = InputMultiObject(File(exists=True)) number_of_tissue_classes = traits.Int(mandatory=True) prior_weighting = traits.Float() prior_probability_threshold = traits.Float(requires=['prior_weighting']) @@ -68,7 +68,7 @@ class AtroposInputSpec(ANTSCommandInputSpec): class AtroposOutputSpec(TraitedSpec): classified_image = File(exists=True) - posteriors = OutputMultiPath(File(exist=True)) + posteriors = OutputMultiObject(File(exist=True)) class Atropos(ANTSCommand): @@ -478,7 +478,7 @@ class CorticalThicknessInputSpec(ANTSCommandInputSpec): desc='brain probability mask in template space', copyfile=False, mandatory=True) - segmentation_priors = InputMultiPath( + segmentation_priors = InputMultiObject( File(exists=True), argstr='-p %s', mandatory=True) out_prefix = traits.Str( 'antsCT_', @@ -578,7 +578,7 @@ class CorticalThicknessOutputSpec(TraitedSpec): BrainExtractionMask = File(exists=True, desc='brain extraction mask') BrainSegmentation = File(exists=True, desc='brain segmentaion image') BrainSegmentationN4 = File(exists=True, desc='N4 corrected image') - BrainSegmentationPosteriors = OutputMultiPath( + BrainSegmentationPosteriors = OutputMultiObject( File(exists=True), desc='Posterior probability images') CorticalThickness = File(exists=True, desc='cortical thickness file') TemplateToSubject1GenericAffine = File( @@ -945,17 +945,17 @@ class JointFusionInputSpec(ANTSCommandInputSpec): position=1, mandatory=True, desc='Number of modalities or features') - warped_intensity_images = InputMultiPath( + warped_intensity_images = InputMultiObject( File(exists=True), argstr="-g %s...", mandatory=True, desc='Warped atlas images') - target_image = InputMultiPath( + target_image = InputMultiObject( File(exists=True), argstr='-tg %s...', mandatory=True, desc='Target image(s)') - warped_label_images = InputMultiPath( + warped_label_images = InputMultiObject( File(exists=True), argstr="-l %s...", mandatory=True, @@ -1188,20 +1188,20 @@ class AntsJointFusionInputSpec(ANTSCommandInputSpec): 'specified, the program tries to infer the ' 'dimensionality from the input image.') target_image = traits.List( - InputMultiPath(File(exists=True)), + InputMultiObject(File(exists=True)), argstr='-t %s', mandatory=True, desc='The target image (or ' 'multimodal target images) assumed to be ' 'aligned to a common image domain.') atlas_image = traits.List( - InputMultiPath(File(exists=True)), + InputMultiObject(File(exists=True)), argstr="-g %s...", mandatory=True, desc='The atlas image (or ' 'multimodal atlas images) assumed to be ' 'aligned to a common image domain.') - atlas_segmentation_image = InputMultiPath( + atlas_segmentation_image = InputMultiObject( File(exists=True), argstr="-l %s...", mandatory=True, diff --git a/nipype/interfaces/ants/tests/test_spec_JointFusion.py b/nipype/interfaces/ants/tests/test_spec_JointFusion.py index b2ca69926a..79f505bbec 100644 --- a/nipype/interfaces/ants/tests/test_spec_JointFusion.py +++ b/nipype/interfaces/ants/tests/test_spec_JointFusion.py @@ -2,7 +2,7 @@ from __future__ import division from builtins import range from nipype.testing import example_data -from nipype.interfaces.base import InputMultiPath +from nipype.interfaces.base import InputMultiObject from traits.trait_errors import TraitError from nipype.interfaces.ants import JointFusion import pytest @@ -83,5 +83,5 @@ def test_JointFusion_cmd(): assert at.cmdline == expected_command # setting intensity or labels with unequal lengths raises error with pytest.raises(AssertionError): - at._format_arg('warped_intensity_images', InputMultiPath, + at._format_arg('warped_intensity_images', InputMultiObject, warped_intensity_images + [example_data('im3.nii')]) diff --git a/nipype/interfaces/ants/utils.py b/nipype/interfaces/ants/utils.py index 43a3b4b98c..3509b85dbc 100644 --- a/nipype/interfaces/ants/utils.py +++ b/nipype/interfaces/ants/utils.py @@ -12,7 +12,7 @@ import os -from ..base import TraitedSpec, File, traits, InputMultiPath +from ..base import TraitedSpec, File, traits, InputMultiObject from .base import ANTSCommand, ANTSCommandInputSpec @@ -30,7 +30,7 @@ class AverageAffineTransformInputSpec(ANTSCommandInputSpec): mandatory=True, position=1, desc='Outputfname.txt: the name of the resulting transform.') - transforms = InputMultiPath( + transforms = InputMultiObject( File(exists=True), argstr='%s', mandatory=True, @@ -89,7 +89,7 @@ class AverageImagesInputSpec(ANTSCommandInputSpec): position=2, desc='Normalize: if true, the 2nd image is divided by its mean. ' 'This will select the largest image to average into.') - images = InputMultiPath( + images = InputMultiObject( File(exists=True), argstr='%s', mandatory=True, @@ -337,7 +337,7 @@ class ComposeMultiTransformInputSpec(ANTSCommandInputSpec): argstr='%s', position=2, desc='Reference image (only necessary when output is warpfield)') - transforms = InputMultiPath( + transforms = InputMultiObject( File(exists=True), argstr='%s', mandatory=True, diff --git a/nipype/interfaces/base/__init__.py b/nipype/interfaces/base/__init__.py index cb24ea50a9..a570584ec2 100644 --- a/nipype/interfaces/base/__init__.py +++ b/nipype/interfaces/base/__init__.py @@ -18,8 +18,8 @@ from .traits_extension import ( traits, Undefined, TraitDictObject, TraitListObject, TraitError, isdefined, - File, Directory, Str, DictStrStr, has_metadata, ImageFile, MultiPath, - OutputMultiPath, InputMultiPath) + File, Directory, Str, DictStrStr, has_metadata, ImageFile, MultiObject, + OutputMultiObject, InputMultiObject) from .support import (Bunch, InterfaceResult, load_template, NipypeInterfaceError) diff --git a/nipype/interfaces/base/traits_extension.py b/nipype/interfaces/base/traits_extension.py index 78b68a5601..5a9b1ec71a 100644 --- a/nipype/interfaces/base/traits_extension.py +++ b/nipype/interfaces/base/traits_extension.py @@ -390,8 +390,8 @@ def has_metadata(trait, metadata, value=None, recursive=True): return count > 0 -class MultiPath(traits.List): - """ Abstract class - shared functionality of input and output MultiPath +class MultiObject(traits.List): + """ Abstract class - shared functionality of input and output MultiObject """ def validate(self, object, name, value): @@ -412,12 +412,12 @@ def validate(self, object, name, value): isinstance(self.inner_traits()[0].trait_type, traits.List) and not isinstance(self.inner_traits()[0].trait_type, - InputMultiPath) and + InputMultiObject) and isinstance(value, list) and value and not isinstance(value[0], list)): newvalue = [value] - value = super(MultiPath, self).validate(object, name, newvalue) + value = super(MultiObject, self).validate(object, name, newvalue) if value: return value @@ -425,7 +425,7 @@ def validate(self, object, name, value): self.error(object, name, value) -class OutputMultiPath(MultiPath): +class OutputMultiObject(MultiObject): """ 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 @@ -437,9 +437,9 @@ class OutputMultiPath(MultiPath): XXX This needs to be vetted by somebody who understands traits - >>> from nipype.interfaces.base import OutputMultiPath, TraitedSpec + >>> from nipype.interfaces.base import OutputMultiObject, TraitedSpec >>> class A(TraitedSpec): - ... foo = OutputMultiPath(File(exists=False)) + ... foo = OutputMultiObject(File(exists=False)) >>> a = A() >>> a.foo @@ -471,7 +471,7 @@ def set(self, object, name, value): self.set_value(object, name, value) -class InputMultiPath(MultiPath): +class InputMultiObject(MultiObject): """ 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 @@ -482,9 +482,9 @@ class InputMultiPath(MultiPath): XXX This needs to be vetted by somebody who understands traits - >>> from nipype.interfaces.base import InputMultiPath, TraitedSpec + >>> from nipype.interfaces.base import InputMultiObject, TraitedSpec >>> class A(TraitedSpec): - ... foo = InputMultiPath(File(exists=False)) + ... foo = InputMultiObject(File(exists=False)) >>> a = A() >>> a.foo diff --git a/nipype/interfaces/camino/convert.py b/nipype/interfaces/camino/convert.py index 3091efd348..37a0651c71 100644 --- a/nipype/interfaces/camino/convert.py +++ b/nipype/interfaces/camino/convert.py @@ -15,7 +15,7 @@ from ...utils.filemanip import split_filename from ..base import (CommandLineInputSpec, CommandLine, traits, TraitedSpec, - File, StdOutCommandLine, OutputMultiPath, + File, StdOutCommandLine, OutputMultiObject, StdOutCommandLineInputSpec, isdefined) @@ -422,7 +422,7 @@ class ProcStreamlinesInputSpec(StdOutCommandLineInputSpec): class ProcStreamlinesOutputSpec(TraitedSpec): proc = File(exists=True, desc='Processed Streamlines') - outputroot_files = OutputMultiPath(File(exists=True)) + outputroot_files = OutputMultiObject(File(exists=True)) class ProcStreamlines(StdOutCommandLine): diff --git a/nipype/interfaces/camino/dti.py b/nipype/interfaces/camino/dti.py index a3b0f74c48..925b972a67 100644 --- a/nipype/interfaces/camino/dti.py +++ b/nipype/interfaces/camino/dti.py @@ -15,7 +15,7 @@ from ...utils.filemanip import split_filename from ..base import (CommandLineInputSpec, CommandLine, traits, TraitedSpec, File, Directory, StdOutCommandLine, - StdOutCommandLineInputSpec, isdefined, InputMultiPath) + StdOutCommandLineInputSpec, isdefined, InputMultiObject) class DTIFitInputSpec(StdOutCommandLineInputSpec): @@ -533,7 +533,7 @@ class PicoPDFsInputSpec(StdOutCommandLineInputSpec): desc='input model type', usedefault=True) - luts = InputMultiPath( + luts = InputMultiObject( File(exists=True), argstr='-luts %s', mandatory=True, diff --git a/nipype/interfaces/camino/utils.py b/nipype/interfaces/camino/utils.py index 1146927dc5..5345b9e64f 100644 --- a/nipype/interfaces/camino/utils.py +++ b/nipype/interfaces/camino/utils.py @@ -12,12 +12,12 @@ import os from ..base import (traits, TraitedSpec, File, CommandLine, - CommandLineInputSpec, InputMultiPath) + CommandLineInputSpec, InputMultiObject) from ...utils.filemanip import split_filename class ImageStatsInputSpec(CommandLineInputSpec): - in_files = InputMultiPath( + in_files = InputMultiObject( File(exists=True), argstr='-images %s', mandatory=True, diff --git a/nipype/interfaces/cmtk/cmtk.py b/nipype/interfaces/cmtk/cmtk.py index c7ca43cd4e..f0a297112b 100644 --- a/nipype/interfaces/cmtk/cmtk.py +++ b/nipype/interfaces/cmtk/cmtk.py @@ -26,7 +26,7 @@ from ...utils import NUMPY_MMAP from ..base import (BaseInterface, BaseInterfaceInputSpec, traits, File, - TraitedSpec, Directory, OutputMultiPath, isdefined) + TraitedSpec, Directory, OutputMultiObject, isdefined) iflogger = logging.getLogger('interface') @@ -504,11 +504,11 @@ class CreateMatrixOutputSpec(TraitedSpec): desc='NetworkX graph describing the connectivity', exists=True) intersection_matrix_file = File( desc='NetworkX graph describing the connectivity', exists=True) - matrix_files = OutputMultiPath( + matrix_files = OutputMultiObject( File( desc='All of the gpickled network files output by this interface', exists=True)) - matlab_matrix_files = OutputMultiPath( + matlab_matrix_files = OutputMultiObject( File( desc='All of the MATLAB .mat files output by this interface', exists=True)) @@ -550,7 +550,7 @@ class CreateMatrixOutputSpec(TraitedSpec): filtered_tractography_by_intersections = File( desc='TrackVis file containing all fibers which connect two regions', exists=True) - filtered_tractographies = OutputMultiPath( + filtered_tractographies = OutputMultiObject( File( desc= 'TrackVis file containing only those fibers originate in one and terminate in another region', diff --git a/nipype/interfaces/cmtk/convert.py b/nipype/interfaces/cmtk/convert.py index fc2dd98f28..47ade596dd 100644 --- a/nipype/interfaces/cmtk/convert.py +++ b/nipype/interfaces/cmtk/convert.py @@ -19,7 +19,7 @@ from ...utils.misc import package_check from ...utils.filemanip import split_filename from ..base import (BaseInterface, BaseInterfaceInputSpec, traits, File, - TraitedSpec, InputMultiPath, isdefined) + TraitedSpec, InputMultiObject, isdefined) have_cfflib = True try: @@ -31,25 +31,25 @@ class CFFConverterInputSpec(BaseInterfaceInputSpec): - graphml_networks = InputMultiPath( + graphml_networks = InputMultiObject( File(exists=True), desc='list of graphML networks') - gpickled_networks = InputMultiPath( + gpickled_networks = InputMultiObject( File(exists=True), desc='list of gpickled Networkx graphs') - gifti_surfaces = InputMultiPath( + gifti_surfaces = InputMultiObject( File(exists=True), desc='list of GIFTI surfaces') - gifti_labels = InputMultiPath( + gifti_labels = InputMultiObject( File(exists=True), desc='list of GIFTI labels') - nifti_volumes = InputMultiPath( + nifti_volumes = InputMultiObject( File(exists=True), desc='list of NIFTI volumes') - tract_files = InputMultiPath( + tract_files = InputMultiObject( File(exists=True), desc='list of Trackvis fiber files') - timeseries_files = InputMultiPath( + timeseries_files = InputMultiObject( File(exists=True), desc='list of HDF5 timeseries files') - script_files = InputMultiPath( + script_files = InputMultiObject( File(exists=True), desc='list of script files to include') - data_files = InputMultiPath( + data_files = InputMultiObject( File(exists=True), desc='list of external data files (i.e. Numpy, HD5, XML) ') @@ -225,7 +225,7 @@ def _list_outputs(self): class MergeCNetworksInputSpec(BaseInterfaceInputSpec): - in_files = InputMultiPath( + in_files = InputMultiObject( File(exists=True), mandatory=True, desc='List of CFF files to extract networks from') diff --git a/nipype/interfaces/cmtk/nbs.py b/nipype/interfaces/cmtk/nbs.py index 954b4d53df..954b6d1b4e 100644 --- a/nipype/interfaces/cmtk/nbs.py +++ b/nipype/interfaces/cmtk/nbs.py @@ -12,7 +12,7 @@ from ... import logging from ...utils.misc import package_check from ..base import (BaseInterface, BaseInterfaceInputSpec, traits, File, - TraitedSpec, InputMultiPath, OutputMultiPath, isdefined) + TraitedSpec, InputMultiObject, OutputMultiObject, isdefined) iflogger = logging.getLogger('interface') have_cv = True @@ -44,11 +44,11 @@ def ntwks_to_matrices(in_files, edge_key): class NetworkBasedStatisticInputSpec(BaseInterfaceInputSpec): - in_group1 = InputMultiPath( + in_group1 = InputMultiObject( File(exists=True), mandatory=True, desc='Networks for the first group of subjects') - in_group2 = InputMultiPath( + in_group2 = InputMultiObject( File(exists=True), mandatory=True, desc='Networks for the second group of subjects') @@ -87,7 +87,7 @@ class NetworkBasedStatisticOutputSpec(TraitedSpec): desc= 'Output network with p-values to weight the edges identified by the NBS' ) - network_files = OutputMultiPath( + network_files = OutputMultiObject( File(exists=True), desc='Output network with edges identified by the NBS') diff --git a/nipype/interfaces/cmtk/nx.py b/nipype/interfaces/cmtk/nx.py index 1072188cbc..9a43ebce94 100644 --- a/nipype/interfaces/cmtk/nx.py +++ b/nipype/interfaces/cmtk/nx.py @@ -24,7 +24,7 @@ from ...utils.filemanip import split_filename from ...utils.misc import package_check from ..base import (BaseInterface, BaseInterfaceInputSpec, traits, File, - TraitedSpec, InputMultiPath, OutputMultiPath, isdefined) + TraitedSpec, InputMultiObject, OutputMultiObject, isdefined) iflogger = logging.getLogger('interface') @@ -407,9 +407,9 @@ class NetworkXMetricsInputSpec(BaseInterfaceInputSpec): class NetworkXMetricsOutputSpec(TraitedSpec): - gpickled_network_files = OutputMultiPath( + gpickled_network_files = OutputMultiObject( File(desc='Output gpickled network files')) - matlab_matrix_files = OutputMultiPath( + matlab_matrix_files = OutputMultiObject( File(desc='Output network metrics in MATLAB .mat format')) global_measures_matlab = File( desc='Output global metrics in MATLAB .mat format') @@ -417,11 +417,11 @@ class NetworkXMetricsOutputSpec(TraitedSpec): desc='Output node metrics in MATLAB .mat format') edge_measures_matlab = File( desc='Output edge metrics in MATLAB .mat format') - node_measure_networks = OutputMultiPath( + node_measure_networks = OutputMultiObject( File(desc='Output gpickled network files for all node-based measures')) - edge_measure_networks = OutputMultiPath( + edge_measure_networks = OutputMultiObject( File(desc='Output gpickled network files for all edge-based measures')) - k_networks = OutputMultiPath( + k_networks = OutputMultiObject( File( desc= 'Output gpickled network files for the k-core, k-shell, and k-crust networks' @@ -435,7 +435,7 @@ class NetworkXMetricsOutputSpec(TraitedSpec): desc= 'Network measures for the group that return dictionaries, stored as a Pickle.' ) - matlab_dict_measures = OutputMultiPath( + matlab_dict_measures = OutputMultiObject( File( desc= 'Network measures for the group that return dictionaries, stored as matlab matrices.' @@ -594,7 +594,7 @@ def _gen_outfilename(self, name, ext): class AverageNetworksInputSpec(BaseInterfaceInputSpec): - in_files = InputMultiPath( + in_files = InputMultiObject( File(exists=True), mandatory=True, desc='Networks for a group of subjects') @@ -613,7 +613,7 @@ class AverageNetworksInputSpec(BaseInterfaceInputSpec): class AverageNetworksOutputSpec(TraitedSpec): gpickled_groupavg = File(desc='Average network saved as a NetworkX .pck') gexf_groupavg = File(desc='Average network saved as a .gexf file') - matlab_groupavgs = OutputMultiPath( + matlab_groupavgs = OutputMultiObject( File(desc='Average network saved as a .gexf file')) diff --git a/nipype/interfaces/dcm2nii.py b/nipype/interfaces/dcm2nii.py index f4e8065b36..0fa4b3ec11 100644 --- a/nipype/interfaces/dcm2nii.py +++ b/nipype/interfaces/dcm2nii.py @@ -15,12 +15,12 @@ from copy import deepcopy from ..utils.filemanip import split_filename -from .base import (CommandLine, CommandLineInputSpec, InputMultiPath, traits, - TraitedSpec, OutputMultiPath, isdefined, File, Directory) +from .base import (CommandLine, CommandLineInputSpec, InputMultiObject, traits, + TraitedSpec, OutputMultiObject, isdefined, File, Directory) class Dcm2niiInputSpec(CommandLineInputSpec): - source_names = InputMultiPath( + source_names = InputMultiObject( File(exists=True), argstr="%s", position=-1, @@ -87,11 +87,11 @@ class Dcm2niiInputSpec(CommandLineInputSpec): class Dcm2niiOutputSpec(TraitedSpec): - converted_files = OutputMultiPath(File(exists=True)) - reoriented_files = OutputMultiPath(File(exists=True)) - reoriented_and_cropped_files = OutputMultiPath(File(exists=True)) - bvecs = OutputMultiPath(File(exists=True)) - bvals = OutputMultiPath(File(exists=True)) + converted_files = OutputMultiObject(File(exists=True)) + reoriented_files = OutputMultiObject(File(exists=True)) + reoriented_and_cropped_files = OutputMultiObject(File(exists=True)) + bvecs = OutputMultiObject(File(exists=True)) + bvals = OutputMultiObject(File(exists=True)) class Dcm2nii(CommandLine): @@ -252,7 +252,7 @@ def _gen_filename(self, name): class Dcm2niixInputSpec(CommandLineInputSpec): - source_names = InputMultiPath( + source_names = InputMultiObject( File(exists=True), argstr="%s", position=-1, @@ -298,10 +298,10 @@ class Dcm2niixInputSpec(CommandLineInputSpec): class Dcm2niixOutputSpec(TraitedSpec): - converted_files = OutputMultiPath(File(exists=True)) - bvecs = OutputMultiPath(File(exists=True)) - bvals = OutputMultiPath(File(exists=True)) - bids = OutputMultiPath(File(exists=True)) + converted_files = OutputMultiObject(File(exists=True)) + bvecs = OutputMultiObject(File(exists=True)) + bvals = OutputMultiObject(File(exists=True)) + bids = OutputMultiObject(File(exists=True)) class Dcm2niix(CommandLine): diff --git a/nipype/interfaces/dcmstack.py b/nipype/interfaces/dcmstack.py index 80a26365f1..a298157b49 100644 --- a/nipype/interfaces/dcmstack.py +++ b/nipype/interfaces/dcmstack.py @@ -20,7 +20,7 @@ import nibabel as nb import imghdr -from .base import (TraitedSpec, DynamicTraitedSpec, InputMultiPath, File, +from .base import (TraitedSpec, DynamicTraitedSpec, InputMultiObject, File, Directory, traits, BaseInterface, isdefined, Undefined) from ..utils import NUMPY_MMAP @@ -96,7 +96,7 @@ def _get_out_path(self, meta, idx=None): class DcmStackInputSpec(NiftiGeneratorBaseInputSpec): dicom_files = traits.Either( - InputMultiPath(File(exists=True)), + InputMultiObject(File(exists=True)), Directory(exists=True), traits.Str(), mandatory=True) diff --git a/nipype/interfaces/diffusion_toolkit/postproc.py b/nipype/interfaces/diffusion_toolkit/postproc.py index 3536cc2643..c5570108fe 100644 --- a/nipype/interfaces/diffusion_toolkit/postproc.py +++ b/nipype/interfaces/diffusion_toolkit/postproc.py @@ -14,7 +14,7 @@ absolute_import) import os -from ..base import (TraitedSpec, File, traits, CommandLine, InputMultiPath, +from ..base import (TraitedSpec, File, traits, CommandLine, InputMultiObject, CommandLineInputSpec) __docformat__ = 'restructuredtext' @@ -75,7 +75,7 @@ def _list_outputs(self): class TrackMergeInputSpec(CommandLineInputSpec): - track_files = InputMultiPath( + track_files = InputMultiObject( File(exists=True), desc="file containing tracks to be filtered", position=0, diff --git a/nipype/interfaces/dipy/simulate.py b/nipype/interfaces/dipy/simulate.py index 282f79519a..d1c7e8776f 100644 --- a/nipype/interfaces/dipy/simulate.py +++ b/nipype/interfaces/dipy/simulate.py @@ -17,21 +17,21 @@ from ... import logging from ...utils import NUMPY_MMAP from ..base import (traits, TraitedSpec, BaseInterfaceInputSpec, File, - InputMultiPath, isdefined) + InputMultiObject, isdefined) from .base import DipyBaseInterface IFLOGGER = logging.getLogger('interface') class SimulateMultiTensorInputSpec(BaseInterfaceInputSpec): - in_dirs = InputMultiPath( + in_dirs = InputMultiObject( File(exists=True), mandatory=True, desc='list of fibers (principal directions)') - in_frac = InputMultiPath( + in_frac = InputMultiObject( File(exists=True), mandatory=True, desc=('volume fraction of each fiber')) - in_vfms = InputMultiPath( + in_vfms = InputMultiObject( File(exists=True), mandatory=True, desc=('volume fractions of isotropic ' diff --git a/nipype/interfaces/elastix/registration.py b/nipype/interfaces/elastix/registration.py index a19e337eb4..127f4084d5 100644 --- a/nipype/interfaces/elastix/registration.py +++ b/nipype/interfaces/elastix/registration.py @@ -16,7 +16,7 @@ from ... import logging from .base import ElastixBaseInputSpec -from ..base import CommandLine, TraitedSpec, File, traits, InputMultiPath +from ..base import CommandLine, TraitedSpec, File, traits, InputMultiObject iflogger = logging.getLogger('interface') @@ -26,7 +26,7 @@ class RegistrationInputSpec(ElastixBaseInputSpec): exists=True, mandatory=True, argstr='-f %s', desc='fixed image') moving_image = File( exists=True, mandatory=True, argstr='-m %s', desc='moving image') - parameters = InputMultiPath( + parameters = InputMultiObject( File(exists=True), mandatory=True, argstr='-p %s...', @@ -42,9 +42,9 @@ class RegistrationInputSpec(ElastixBaseInputSpec): class RegistrationOutputSpec(TraitedSpec): - transform = InputMultiPath(File(exists=True), desc='output transform') + transform = InputMultiObject(File(exists=True), desc='output transform') warped_file = File(desc='input moving image warped to fixed image') - warped_files = InputMultiPath( + warped_files = InputMultiObject( File(exists=False), desc=('input moving image warped to fixed image at each level')) warped_files_flags = traits.List( diff --git a/nipype/interfaces/freesurfer/longitudinal.py b/nipype/interfaces/freesurfer/longitudinal.py index 72b71adfe1..a911f1c467 100644 --- a/nipype/interfaces/freesurfer/longitudinal.py +++ b/nipype/interfaces/freesurfer/longitudinal.py @@ -16,7 +16,7 @@ import os from ... import logging -from ..base import (TraitedSpec, File, traits, InputMultiPath, OutputMultiPath, +from ..base import (TraitedSpec, File, traits, InputMultiObject, OutputMultiObject, isdefined) from .base import (FSCommand, FSTraitedSpec, FSCommandOpenMP, FSTraitedSpecOpenMP) @@ -27,7 +27,7 @@ class RobustTemplateInputSpec(FSTraitedSpecOpenMP): # required - in_files = InputMultiPath( + in_files = InputMultiObject( File(exists=True), mandatory=True, argstr='--mov %s', @@ -53,7 +53,7 @@ class RobustTemplateInputSpec(FSTraitedSpecOpenMP): 'values mean less sensitivity.') # optional transform_outputs = traits.Either( - InputMultiPath(File(exists=False)), + InputMultiObject(File(exists=False)), traits.Bool, argstr='--lta %s', desc='output xforms to template (for each input)') @@ -62,7 +62,7 @@ class RobustTemplateInputSpec(FSTraitedSpecOpenMP): argstr='--iscale', desc='allow also intensity scaling (default off)') scaled_intensity_outputs = traits.Either( - InputMultiPath(File(exists=False)), + InputMultiObject(File(exists=False)), traits.Bool, argstr='--iscaleout %s', desc='final intensity scales (will activate --iscale)') @@ -85,11 +85,11 @@ class RobustTemplateInputSpec(FSTraitedSpecOpenMP): default_value=False, argstr='--noit', desc='do not iterate, just create first template') - initial_transforms = InputMultiPath( + initial_transforms = InputMultiObject( File(exists=True), argstr='--ixforms %s', desc='use initial transforms (lta) on source') - in_intensity_scales = InputMultiPath( + in_intensity_scales = InputMultiObject( File(exists=True), argstr='--iscalein %s', desc='use initial intensity scales') @@ -98,9 +98,9 @@ class RobustTemplateInputSpec(FSTraitedSpecOpenMP): class RobustTemplateOutputSpec(TraitedSpec): out_file = File( exists=True, desc='output template volume (final mean/median image)') - transform_outputs = OutputMultiPath( + transform_outputs = OutputMultiObject( File(exists=True), desc="output xform files from moving to template") - scaled_intensity_outputs = OutputMultiPath( + scaled_intensity_outputs = OutputMultiObject( File(exists=True), desc="output final intensity scales") @@ -184,7 +184,7 @@ class FuseSegmentationsInputSpec(FSTraitedSpec): # required subject_id = traits.String( argstr='%s', position=-3, desc="subject_id being processed") - timepoints = InputMultiPath( + timepoints = InputMultiObject( traits.String(), mandatory=True, argstr='%s', @@ -195,19 +195,19 @@ class FuseSegmentationsInputSpec(FSTraitedSpec): mandatory=True, position=-1, desc="output fused segmentation file") - in_segmentations = InputMultiPath( + in_segmentations = InputMultiObject( File(exists=True), argstr="-a %s", mandatory=True, desc="name of aseg file to use (default: aseg.mgz) \ must include the aseg files for all the given timepoints") - in_segmentations_noCC = InputMultiPath( + in_segmentations_noCC = InputMultiObject( File(exists=True), argstr="-c %s", mandatory=True, desc="name of aseg file w/o CC labels (default: aseg.auto_noCCseg.mgz) \ must include the corresponding file for all the given timepoints") - in_norms = InputMultiPath( + in_norms = InputMultiObject( File(exists=True), argstr="-n %s", mandatory=True, diff --git a/nipype/interfaces/freesurfer/model.py b/nipype/interfaces/freesurfer/model.py index 4e9a4d0352..217f717e54 100644 --- a/nipype/interfaces/freesurfer/model.py +++ b/nipype/interfaces/freesurfer/model.py @@ -17,7 +17,7 @@ import os from ...utils.filemanip import fname_presuffix, split_filename -from ..base import (TraitedSpec, File, traits, InputMultiPath, OutputMultiPath, +from ..base import (TraitedSpec, File, traits, InputMultiObject, OutputMultiObject, Directory, isdefined) from .base import FSCommand, FSTraitedSpec from .utils import copy2subjdir @@ -58,7 +58,7 @@ class MRISPreprocInputSpec(FSTraitedSpec): argstr='--f %s', xor=('subjects', 'fsgd_file', 'subject_file'), desc='file specifying subjects separated by white space') - surf_measure_file = InputMultiPath( + surf_measure_file = InputMultiObject( File(exists=True), argstr='--is %s...', xor=('surf_measure', 'surf_measure_file', 'surf_area'), @@ -66,7 +66,7 @@ class MRISPreprocInputSpec(FSTraitedSpec): source_format = traits.Str(argstr='--srcfmt %s', desc='source format') surf_dir = traits.Str( argstr='--surfdir %s', desc='alternative directory (instead of surf)') - vol_measure_file = InputMultiPath( + vol_measure_file = InputMultiObject( traits.Tuple(File(exists=True), File(exists=True)), argstr='--iv %s %s...', desc='list of volume measure and reg file tuples') @@ -141,7 +141,7 @@ class MRISPreprocReconAllInputSpec(MRISPreprocInputSpec): argstr='--meas %s', xor=('surf_measure', 'surf_measure_file', 'surf_area'), desc='file necessary for surfmeas') - surfreg_files = InputMultiPath( + surfreg_files = InputMultiObject( File(exists=True), argstr="--surfreg %s", requires=['lh_surfreg_target', 'rh_surfreg_target'], @@ -241,7 +241,7 @@ class GLMFitInputSpec(FSTraitedSpec): argstr='--X %s', xor=_design_xor, desc='design matrix file') - contrast = InputMultiPath( + contrast = InputMultiObject( File(exists=True), argstr='--C %s...', desc='contrast file') one_sample = traits.Bool( @@ -251,7 +251,7 @@ class GLMFitInputSpec(FSTraitedSpec): no_contrast_ok = traits.Bool( argstr='--no-contrasts-ok', desc='do not fail if no contrasts specified') - per_voxel_reg = InputMultiPath( + per_voxel_reg = InputMultiObject( File(exists=True), argstr='--pvr %s...', desc='per-voxel regressors') self_reg = traits.Tuple( traits.Int, @@ -396,12 +396,12 @@ class GLMFitOutputSpec(TraitedSpec): fwhm_file = File(desc="text file with estimated smoothness") dof_file = File( desc="text file with effective degrees-of-freedom for the analysis") - gamma_file = OutputMultiPath( + gamma_file = OutputMultiObject( desc="map of contrast of regression coefficients") - gamma_var_file = OutputMultiPath( + gamma_var_file = OutputMultiObject( desc="map of regression contrast variance") - sig_file = OutputMultiPath(desc="map of F-test significance (in -log10p)") - ftest_file = OutputMultiPath(desc="map of test statistic values") + sig_file = OutputMultiObject(desc="map of F-test significance (in -log10p)") + ftest_file = OutputMultiObject(desc="map of test statistic values") spatial_eigenvectors = File( desc="map of spatial eigenvectors from residual PCA") frame_eigenvectors = File( @@ -639,7 +639,7 @@ def _gen_filename(self, name): class ConcatenateInputSpec(FSTraitedSpec): - in_files = InputMultiPath( + in_files = InputMultiObject( File(exists=True), desc='Individual volumes to be concatenated', argstr='--i %s...', @@ -1095,7 +1095,7 @@ def run(self, **inputs): class Label2VolInputSpec(FSTraitedSpec): - label_file = InputMultiPath( + label_file = InputMultiObject( File(exists=True), argstr='--label %s...', xor=('label_file', 'annot_file', 'seg_file', 'aparc_aseg'), @@ -1250,7 +1250,7 @@ class MS_LDAInputSpec(FSTraitedSpec): argstr='-W', desc=('Use the weights from a previously ' 'generated weight file')) - images = InputMultiPath( + images = InputMultiObject( File(exists=True), argstr='%s', mandatory=True, diff --git a/nipype/interfaces/freesurfer/preprocess.py b/nipype/interfaces/freesurfer/preprocess.py index 3e70200ad3..d73e8c0b7f 100644 --- a/nipype/interfaces/freesurfer/preprocess.py +++ b/nipype/interfaces/freesurfer/preprocess.py @@ -25,8 +25,8 @@ from ... import logging, LooseVersion from ...utils.filemanip import fname_presuffix, check_depends from ..io import FreeSurferSource -from ..base import (TraitedSpec, File, traits, Directory, InputMultiPath, - OutputMultiPath, CommandLine, CommandLineInputSpec, +from ..base import (TraitedSpec, File, traits, Directory, InputMultiObject, + OutputMultiObject, CommandLine, CommandLineInputSpec, isdefined) from .base import (FSCommand, FSTraitedSpec, FSTraitedSpecOpenMP, FSCommandOpenMP, Info) @@ -422,7 +422,7 @@ class MRIConvertInputSpec(FSTraitedSpec): class MRIConvertOutputSpec(TraitedSpec): - out_file = OutputMultiPath(File(exists=True), desc='converted output file') + out_file = OutputMultiObject(File(exists=True), desc='converted output file') class MRIConvert(FSCommand): @@ -750,7 +750,7 @@ class ReconAllInputSpec(CommandLineInputSpec): position=0) hemi = traits.Enum( 'lh', 'rh', desc='hemisphere to process', argstr="-hemi %s") - T1_files = InputMultiPath( + T1_files = InputMultiObject( File(exists=True), argstr='-i %s...', desc='name of T1 file to process') @@ -819,7 +819,7 @@ class ReconAllInputSpec(CommandLineInputSpec): hash_files=False, desc='path to subjects directory', genfile=True) - flags = InputMultiPath( + flags = InputMultiObject( traits.Str, argstr='%s', desc='additional parameters') # Expert options @@ -2455,7 +2455,7 @@ class CARegisterInputSpec(FSTraitedSpecOpenMP): A = traits.Int( argstr='-A %d', desc='undocumented flag used in longitudinal processing') - l_files = InputMultiPath( + l_files = InputMultiObject( File(exists=False), argstr='-l %s', desc='undocumented flag used in longitudinal processing') diff --git a/nipype/interfaces/freesurfer/utils.py b/nipype/interfaces/freesurfer/utils.py index 0fdfd8bfdb..d46c347ce7 100644 --- a/nipype/interfaces/freesurfer/utils.py +++ b/nipype/interfaces/freesurfer/utils.py @@ -20,7 +20,7 @@ from ... import logging from ...utils.filemanip import fname_presuffix, split_filename -from ..base import (TraitedSpec, File, traits, OutputMultiPath, isdefined, +from ..base import (TraitedSpec, File, traits, OutputMultiObject, isdefined, CommandLine, CommandLineInputSpec) from .base import (FSCommand, FSTraitedSpec, FSSurfaceCommand, FSScriptCommand, FSScriptOutputSpec, FSTraitedSpecOpenMP, FSCommandOpenMP) @@ -865,7 +865,7 @@ class SurfaceSnapshotsInputSpec(FSTraitedSpec): class SurfaceSnapshotsOutputSpec(TraitedSpec): - snapshots = OutputMultiPath( + snapshots = OutputMultiObject( File(exists=True), desc="tiff images of the surface from different perspectives") diff --git a/nipype/interfaces/fsl/dti.py b/nipype/interfaces/fsl/dti.py index cf14d1072f..e18d9451a3 100644 --- a/nipype/interfaces/fsl/dti.py +++ b/nipype/interfaces/fsl/dti.py @@ -20,8 +20,8 @@ import warnings from ...utils.filemanip import fname_presuffix, split_filename, copyfile -from ..base import (TraitedSpec, isdefined, File, Directory, InputMultiPath, - OutputMultiPath, traits) +from ..base import (TraitedSpec, isdefined, File, Directory, InputMultiObject, + OutputMultiObject, traits) from .base import (FSLCommand, FSLCommandInputSpec, Info) @@ -235,18 +235,18 @@ class FSLXCommandInputSpec(FSLCommandInputSpec): class FSLXCommandOutputSpec(TraitedSpec): - dyads = OutputMultiPath( + dyads = OutputMultiObject( File(exists=True), desc=('Mean of PDD distribution' ' in vector form.')) - fsamples = OutputMultiPath( + fsamples = OutputMultiObject( 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( + mean_fsamples = OutputMultiObject( File(exists=True), desc=('Mean of distribution on f ' 'anisotropy')) mean_S0samples = File( @@ -258,9 +258,9 @@ class FSLXCommandOutputSpec(TraitedSpec): desc=('Mean of distribution on ' 'tau samples (only with rician ' 'noise)')) - phsamples = OutputMultiPath( + phsamples = OutputMultiObject( File(exists=True), desc=('phi samples, per fiber')) - thsamples = OutputMultiPath( + thsamples = OutputMultiObject( File(exists=True), desc=('theta samples, per fiber')) @@ -375,30 +375,30 @@ class BEDPOSTX5InputSpec(FSLXCommandInputSpec): class BEDPOSTX5OutputSpec(TraitedSpec): mean_dsamples = File( exists=True, desc='Mean of distribution on diffusivity d') - mean_fsamples = OutputMultiPath( + mean_fsamples = OutputMultiObject( 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( + mean_phsamples = OutputMultiObject( File(exists=True), desc='Mean of distribution on phi') - mean_thsamples = OutputMultiPath( + mean_thsamples = OutputMultiObject( File(exists=True), desc='Mean of distribution on theta') - merged_thsamples = OutputMultiPath( + merged_thsamples = OutputMultiObject( File(exists=True), desc=('Samples from the distribution ' 'on theta')) - merged_phsamples = OutputMultiPath( + merged_phsamples = OutputMultiObject( File(exists=True), desc=('Samples from the distribution ' 'on phi')) - merged_fsamples = OutputMultiPath( + merged_fsamples = OutputMultiObject( File(exists=True), desc=('Samples from the distribution on ' 'anisotropic volume fraction')) - dyads = OutputMultiPath( + dyads = OutputMultiObject( File(exists=True), desc='Mean of PDD distribution in vector form.') - dyads_dispersion = OutputMultiPath(File(exists=True), desc=('Dispersion')) + dyads_dispersion = OutputMultiObject(File(exists=True), desc=('Dispersion')) class BEDPOSTX5(FSLXCommand): @@ -525,9 +525,9 @@ class XFibres5(FSLXCommand): class ProbTrackXBaseInputSpec(FSLCommandInputSpec): - thsamples = InputMultiPath(File(exists=True), mandatory=True) - phsamples = InputMultiPath(File(exists=True), mandatory=True) - fsamples = InputMultiPath(File(exists=True), mandatory=True) + thsamples = InputMultiObject(File(exists=True), mandatory=True) + phsamples = InputMultiObject(File(exists=True), mandatory=True) + fsamples = InputMultiObject(File(exists=True), mandatory=True) samples_base_name = traits.Str( "merged", desc=('the rootname/base_name for samples ' @@ -547,7 +547,7 @@ class ProbTrackXBaseInputSpec(FSLCommandInputSpec): 'label file'), argstr='--seed=%s', mandatory=True) - target_masks = InputMultiPath( + target_masks = InputMultiObject( File(exits=True), desc=('list of target masks - required for ' 'seeds_to_targets classification'), @@ -694,7 +694,7 @@ class ProbTrackXOutputSpec(TraitedSpec): log = File( exists=True, desc='path/name of a text record of the command that was run') - fdt_paths = OutputMultiPath( + fdt_paths = OutputMultiObject( File(exists=True), desc=('path/name of a 3D image file ' 'containing the output connectivity ' diff --git a/nipype/interfaces/fsl/epi.py b/nipype/interfaces/fsl/epi.py index 7cfbbac79a..f3f444bc58 100644 --- a/nipype/interfaces/fsl/epi.py +++ b/nipype/interfaces/fsl/epi.py @@ -24,7 +24,7 @@ from ...utils.filemanip import split_filename from ...utils import NUMPY_MMAP -from ..base import (traits, TraitedSpec, InputMultiPath, File, isdefined) +from ..base import (traits, TraitedSpec, InputMultiObject, File, isdefined) from .base import FSLCommand, FSLCommandInputSpec, Info @@ -151,7 +151,7 @@ class TOPUPInputSpec(FSLCommandInputSpec): argstr='--datain=%s', desc=('encoding direction for automatic ' 'generation of encoding_file')) - readout_times = InputMultiPath( + readout_times = InputMultiObject( traits.Float, requires=['encoding_direction'], xor=['encoding_file'], @@ -417,7 +417,7 @@ def _overload_extension(self, value, name=None): class ApplyTOPUPInputSpec(FSLCommandInputSpec): - in_files = InputMultiPath( + in_files = InputMultiObject( File(exists=True), mandatory=True, desc='name of file with images', diff --git a/nipype/interfaces/fsl/fix.py b/nipype/interfaces/fsl/fix.py index ebe986eb79..03fcd7ac64 100644 --- a/nipype/interfaces/fsl/fix.py +++ b/nipype/interfaces/fsl/fix.py @@ -58,13 +58,13 @@ absolute_import) from ..base import (TraitedSpec, CommandLineInputSpec, CommandLine, - InputMultiPath, OutputMultiPath, BaseInterface, + InputMultiObject, OutputMultiObject, BaseInterface, BaseInterfaceInputSpec, traits, Directory, File, isdefined) import os class TrainingSetCreatorInputSpec(BaseInterfaceInputSpec): - mel_icas_in = InputMultiPath( + mel_icas_in = InputMultiObject( Directory(exists=True), copyfile=False, desc='Melodic output directories', @@ -73,7 +73,7 @@ class TrainingSetCreatorInputSpec(BaseInterfaceInputSpec): class TrainingSetCreatorOutputSpec(TraitedSpec): - mel_icas_out = OutputMultiPath( + mel_icas_out = OutputMultiObject( Directory(exists=True), copyfile=False, desc='Hand labels for noise vs signal', @@ -150,7 +150,7 @@ def _list_outputs(self): class TrainingInputSpec(CommandLineInputSpec): - mel_icas = InputMultiPath( + mel_icas = InputMultiObject( Directory(exists=True), copyfile=False, desc='Melodic output directories', @@ -193,7 +193,7 @@ def _list_outputs(self): class AccuracyTesterInputSpec(CommandLineInputSpec): - mel_icas = InputMultiPath( + mel_icas = InputMultiObject( Directory(exists=True), copyfile=False, desc='Melodic output directories', diff --git a/nipype/interfaces/fsl/maths.py b/nipype/interfaces/fsl/maths.py index ef54b81965..c69d2fde6f 100644 --- a/nipype/interfaces/fsl/maths.py +++ b/nipype/interfaces/fsl/maths.py @@ -16,7 +16,7 @@ import os import numpy as np -from ..base import (TraitedSpec, File, traits, InputMultiPath, isdefined) +from ..base import (TraitedSpec, File, traits, InputMultiObject, isdefined) from .base import FSLCommand, FSLCommandInputSpec @@ -573,7 +573,7 @@ class MultiImageMathsInput(MathsInput): mandatory=True, desc=("python formatted string of operations " "to perform")) - operand_files = InputMultiPath( + operand_files = InputMultiObject( File(exists=True), mandatory=True, desc=("list of file names to plug into op " diff --git a/nipype/interfaces/fsl/model.py b/nipype/interfaces/fsl/model.py index 6b2224adb4..a135ec8157 100644 --- a/nipype/interfaces/fsl/model.py +++ b/nipype/interfaces/fsl/model.py @@ -28,7 +28,7 @@ from ...utils.misc import human_order_sorted from ...external.due import BibTeX from ..base import (File, traits, isdefined, TraitedSpec, BaseInterface, - Directory, InputMultiPath, OutputMultiPath, + Directory, InputMultiObject, OutputMultiObject, BaseInterfaceInputSpec) from .base import FSLCommand, FSLCommandInputSpec, Info @@ -93,9 +93,9 @@ class Level1DesignInputSpec(BaseInterfaceInputSpec): class Level1DesignOutputSpec(TraitedSpec): - fsf_files = OutputMultiPath( + fsf_files = OutputMultiObject( File(exists=True), desc='FSL feat specification files') - ev_files = OutputMultiPath( + ev_files = OutputMultiObject( traits.List(File(exists=True)), desc='condition information files') @@ -674,7 +674,7 @@ class FILMGLSInputSpec507(FILMGLSInputSpec505): class FILMGLSOutputSpec(TraitedSpec): - param_estimates = OutputMultiPath( + param_estimates = OutputMultiObject( File(exists=True), desc=('Parameter estimates for each ' 'column of the design matrix')) @@ -696,7 +696,7 @@ class FILMGLSOutputSpec(TraitedSpec): class FILMGLSOutputSpec507(TraitedSpec): - param_estimates = OutputMultiPath( + param_estimates = OutputMultiObject( File(exists=True), desc=('Parameter estimates for each ' 'column of the design matrix')) @@ -711,17 +711,17 @@ class FILMGLSOutputSpec507(TraitedSpec): exists=True, desc='directory storing model estimation output') thresholdac = File(exists=True, desc='The FILM autocorrelation parameters') logfile = File(exists=True, desc='FILM run logfile') - copes = OutputMultiPath( + copes = OutputMultiObject( File(exists=True), desc='Contrast estimates for each contrast') - varcopes = OutputMultiPath( + varcopes = OutputMultiObject( File(exists=True), desc='Variance estimates for each contrast') - zstats = OutputMultiPath( + zstats = OutputMultiObject( File(exists=True), desc='z-stat file for each contrast') - tstats = OutputMultiPath( + tstats = OutputMultiObject( File(exists=True), desc='t-stat file for each contrast') - fstats = OutputMultiPath( + fstats = OutputMultiObject( File(exists=True), desc='f-stat file for each contrast') - zfstats = OutputMultiPath( + zfstats = OutputMultiObject( File(exists=True), desc='z-stat file for each F contrast') @@ -863,7 +863,7 @@ def _list_outputs(self): class FEATRegisterInputSpec(BaseInterfaceInputSpec): - feat_dirs = InputMultiPath( + feat_dirs = InputMultiObject( Directory(exists=True), desc="Lower level feat dirs", mandatory=True) reg_image = File( exists=True, @@ -980,33 +980,33 @@ class FLAMEOInputSpec(FSLCommandInputSpec): class FLAMEOOutputSpec(TraitedSpec): - pes = OutputMultiPath( + pes = OutputMultiObject( File(exists=True), desc=("Parameter estimates for each column of the " "design matrix for each voxel")) - res4d = OutputMultiPath( + res4d = OutputMultiObject( File(exists=True), desc=("Model fit residual mean-squared error for " "each time point")) - copes = OutputMultiPath( + copes = OutputMultiObject( File(exists=True), desc="Contrast estimates for each contrast") - var_copes = OutputMultiPath( + var_copes = OutputMultiObject( File(exists=True), desc="Variance estimates for each contrast") - zstats = OutputMultiPath( + zstats = OutputMultiObject( File(exists=True), desc="z-stat file for each contrast") - tstats = OutputMultiPath( + tstats = OutputMultiObject( File(exists=True), desc="t-stat file for each contrast") - zfstats = OutputMultiPath( + zfstats = OutputMultiObject( File(exists=True), desc="z stat file for each f contrast") - fstats = OutputMultiPath( + fstats = OutputMultiObject( File(exists=True), desc="f-stat file for each contrast") - mrefvars = OutputMultiPath( + mrefvars = OutputMultiObject( File(exists=True), desc=("mean random effect variances for each " "contrast")) - tdof = OutputMultiPath( + tdof = OutputMultiObject( File(exists=True), desc="temporal dof file for each contrast") - weights = OutputMultiPath( + weights = OutputMultiObject( File(exists=True), desc="weights file for each contrast") stats_dir = Directory( File(exists=True), desc="directory storing model estimation output") @@ -1150,7 +1150,7 @@ class ContrastMgrInputSpec(FSLCommandInputSpec): exists=True, argstr='-f %s', desc='contrast file containing F-contrasts') - param_estimates = InputMultiPath( + param_estimates = InputMultiObject( File(exists=True), argstr='', copyfile=False, @@ -1189,19 +1189,19 @@ class ContrastMgrInputSpec(FSLCommandInputSpec): class ContrastMgrOutputSpec(TraitedSpec): - copes = OutputMultiPath( + copes = OutputMultiObject( File(exists=True), desc='Contrast estimates for each contrast') - varcopes = OutputMultiPath( + varcopes = OutputMultiObject( File(exists=True), desc='Variance estimates for each contrast') - zstats = OutputMultiPath( + zstats = OutputMultiObject( File(exists=True), desc='z-stat file for each contrast') - tstats = OutputMultiPath( + tstats = OutputMultiObject( File(exists=True), desc='t-stat file for each contrast') - fstats = OutputMultiPath( + fstats = OutputMultiObject( File(exists=True), desc='f-stat file for each contrast') - zfstats = OutputMultiPath( + zfstats = OutputMultiObject( File(exists=True), desc='z-stat file for each F contrast') - neffs = OutputMultiPath( + neffs = OutputMultiObject( File(exists=True), desc='neff file ?? for each contrast') @@ -1599,7 +1599,7 @@ def _list_outputs(self): class MELODICInputSpec(FSLCommandInputSpec): - in_files = InputMultiPath( + in_files = InputMultiObject( File(exists=True), argstr="-i %s", mandatory=True, @@ -2010,7 +2010,7 @@ def _format_arg(self, name, spec, value): class DualRegressionInputSpec(FSLCommandInputSpec): - in_files = InputMultiPath( + in_files = InputMultiObject( File(exists=True), argstr="%s", mandatory=True, @@ -2322,35 +2322,35 @@ class GLMInputSpec(FSLCommandInputSpec): class GLMOutputSpec(TraitedSpec): out_file = File( exists=True, desc=('file name of GLM parameters (if generated)')) - out_cope = OutputMultiPath( + out_cope = OutputMultiObject( File(exists=True), desc=('output file name for COPEs (either as text file or image)')) - out_z = OutputMultiPath( + out_z = OutputMultiObject( File(exists=True), desc=('output file name for COPEs (either as text file or image)')) - out_t = OutputMultiPath( + out_t = OutputMultiObject( File(exists=True), desc=('output file name for t-stats (either as text file or image)')) - out_p = OutputMultiPath( + out_p = OutputMultiObject( File(exists=True), desc=('output file name for p-values of Z-stats (either as text file ' 'or image)')) - out_f = OutputMultiPath( + out_f = OutputMultiObject( File(exists=True), desc=('output file name for F-value of full model fit')) - out_pf = OutputMultiPath( + out_pf = OutputMultiObject( File(exists=True), desc=('output file name for p-value for full model fit')) - out_res = OutputMultiPath( + out_res = OutputMultiObject( File(exists=True), desc='output file name for residuals') - out_varcb = OutputMultiPath( + out_varcb = OutputMultiObject( File(exists=True), desc='output file name for variance of COPEs') - out_sigsq = OutputMultiPath( + out_sigsq = OutputMultiObject( File(exists=True), desc=('output file name for residual noise variance sigma-square')) - out_data = OutputMultiPath( + out_data = OutputMultiObject( File(exists=True), desc='output file for preprocessed data') - out_vnscales = OutputMultiPath( + out_vnscales = OutputMultiObject( File(exists=True), desc=('output file name for scaling factors for variance ' 'normalisation')) diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index 8e7b7be477..46c99ba349 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -23,7 +23,7 @@ from nibabel import load from ...utils.filemanip import split_filename -from ..base import (TraitedSpec, File, InputMultiPath, OutputMultiPath, +from ..base import (TraitedSpec, File, InputMultiObject, OutputMultiObject, Undefined, traits, isdefined) from .base import FSLCommand, FSLCommandInputSpec, Info @@ -198,7 +198,7 @@ def _gen_filename(self, name): class FASTInputSpec(FSLCommandInputSpec): """ Defines inputs (trait classes) for FAST """ - in_files = InputMultiPath( + in_files = InputMultiObject( File(exists=True), copyfile=False, desc='image, or multi-channel set of images, ' @@ -247,7 +247,7 @@ class FASTInputSpec(FSLCommandInputSpec): desc=' initialise' ' using priors', argstr='-a %s') - other_priors = InputMultiPath( + other_priors = InputMultiObject( File(exist=True), desc='alternative prior images', argstr='-A %s', @@ -293,12 +293,12 @@ class FASTOutputSpec(TraitedSpec): exists=True, desc='path/name of binary segmented volume file' ' one val for each class _seg') - tissue_class_files = OutputMultiPath( + tissue_class_files = OutputMultiObject( File( desc=( 'path/name of binary segmented volumes one file for each class ' '_seg_x'))) - restored_image = OutputMultiPath( + restored_image = OutputMultiObject( File( desc=( 'restored images (one for each input image) named according to ' @@ -307,13 +307,13 @@ class FASTOutputSpec(TraitedSpec): 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( + partial_volume_files = OutputMultiObject( 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( + bias_field = OutputMultiObject(File(desc='Estimated bias field _bias')) + probability_maps = OutputMultiObject( File(desc='filenames, one for each class, for each input, prob_x')) @@ -788,9 +788,9 @@ class MCFLIRTOutputSpec(TraitedSpec): mean_img = File( exists=True, desc="mean timeseries image (if mean_vol=True)") par_file = File(exists=True, desc="text-file with motion parameters") - mat_file = OutputMultiPath( + mat_file = OutputMultiObject( File(exists=True), desc="transformation matrices") - rms_files = OutputMultiPath( + rms_files = OutputMultiObject( File(exists=True), desc="absolute and relative displacement parameters") @@ -1970,10 +1970,10 @@ class FIRSTInputSpec(FSLCommandInputSpec): class FIRSTOutputSpec(TraitedSpec): - vtk_surfaces = OutputMultiPath( + vtk_surfaces = OutputMultiObject( File(exists=True), desc='VTK format meshes for each subcortical region') - bvars = OutputMultiPath( + bvars = OutputMultiObject( File(exists=True), desc='bvars for each subcortical region') original_segmentations = File( exists=True, diff --git a/nipype/interfaces/fsl/utils.py b/nipype/interfaces/fsl/utils.py index 159e884a7c..6ac7c6e3a0 100644 --- a/nipype/interfaces/fsl/utils.py +++ b/nipype/interfaces/fsl/utils.py @@ -30,7 +30,7 @@ from ...utils.filemanip import (load_json, save_json, split_filename, fname_presuffix) -from ..base import (traits, TraitedSpec, OutputMultiPath, File, CommandLine, +from ..base import (traits, TraitedSpec, OutputMultiObject, File, CommandLine, CommandLineInputSpec, isdefined) from .base import FSLCommand, FSLCommandInputSpec, Info @@ -467,7 +467,7 @@ class SplitInputSpec(FSLCommandInputSpec): class SplitOutputSpec(TraitedSpec): - out_files = OutputMultiPath(File(exists=True)) + out_files = OutputMultiObject(File(exists=True)) class Split(FSLCommand): diff --git a/nipype/interfaces/io.py b/nipype/interfaces/io.py index 5687b3f77e..e40612f2c8 100644 --- a/nipype/interfaces/io.py +++ b/nipype/interfaces/io.py @@ -41,8 +41,8 @@ from ..utils.filemanip import copyfile, list_to_filename, filename_to_list from ..utils.misc import human_order_sorted, str2bool from .base import ( - TraitedSpec, traits, Str, File, Directory, BaseInterface, InputMultiPath, - isdefined, OutputMultiPath, DynamicTraitedSpec, Undefined, BaseInterfaceInputSpec) + TraitedSpec, traits, Str, File, Directory, BaseInterface, InputMultiObject, + isdefined, OutputMultiObject, DynamicTraitedSpec, Undefined, BaseInterfaceInputSpec) have_pybids = True try: @@ -196,13 +196,13 @@ class DataSinkInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): parameterization = traits.Bool( True, usedefault=True, desc='store output in parametrized structure') strip_dir = Directory(desc='path to strip out of filename') - substitutions = InputMultiPath( + substitutions = InputMultiObject( traits.Tuple(Str, Str), desc=('List of 2-tuples reflecting string ' 'to substitute and string to replace ' 'it with')) regexp_substitutions = \ - InputMultiPath(traits.Tuple(Str, Str), + InputMultiObject(traits.Tuple(Str, Str), desc=('List of 2-tuples reflecting a pair of a ' 'Python regexp pattern and a replacement ' 'string. Invoked after string `substitutions`')) @@ -893,7 +893,7 @@ def _add_output_traits(self, base): """ S3 specific: Downloads relevant files to a local folder specified - Using traits.Any instead out OutputMultiPath till add_trait bug + Using traits.Any instead out OutputMultiObject till add_trait bug is fixed. """ return add_traits(base, list(self.inputs.template_args.keys())) @@ -1154,7 +1154,7 @@ def __init__(self, infields=None, outfields=None, **kwargs): def _add_output_traits(self, base): """ - Using traits.Any instead out OutputMultiPath till add_trait bug + Using traits.Any instead out OutputMultiObject till add_trait bug is fixed. """ return add_traits(base, list(self.inputs.template_args.keys())) @@ -1594,7 +1594,7 @@ class FSSourceOutputSpec(TraitedSpec): loc='mri') rawavg = File( exists=True, desc='Volume formed by averaging input images', loc='mri') - ribbon = OutputMultiPath( + ribbon = OutputMultiObject( File(exists=True), desc='Volumetric maps of cortical ribbons', loc='mri', @@ -1604,103 +1604,103 @@ class FSSourceOutputSpec(TraitedSpec): exists=True, loc='mri', desc='Aparc parcellation projected into subcortical white matter') - curv = OutputMultiPath( + curv = OutputMultiObject( File(exists=True), desc='Maps of surface curvature', loc='surf') - avg_curv = OutputMultiPath( + avg_curv = OutputMultiObject( File(exists=True), desc='Average atlas curvature, sampled to subject', loc='surf') - inflated = OutputMultiPath( + inflated = OutputMultiObject( File(exists=True), desc='Inflated surface meshes', loc='surf') - pial = OutputMultiPath( + pial = OutputMultiObject( File(exists=True), desc='Gray matter/pia mater surface meshes', loc='surf') - area_pial = OutputMultiPath( + area_pial = OutputMultiObject( File(exists=True), desc='Mean area of triangles each vertex on the pial surface is ' 'associated with', loc='surf', altkey='area.pial') - curv_pial = OutputMultiPath( + curv_pial = OutputMultiObject( File(exists=True), desc='Curvature of pial surface', loc='surf', altkey='curv.pial') - smoothwm = OutputMultiPath( + smoothwm = OutputMultiObject( File(exists=True), loc='surf', desc='Smoothed original surface meshes') - sphere = OutputMultiPath( + sphere = OutputMultiObject( File(exists=True), desc='Spherical surface meshes', loc='surf') - sulc = OutputMultiPath( + sulc = OutputMultiObject( File(exists=True), desc='Surface maps of sulcal depth', loc='surf') - thickness = OutputMultiPath( + thickness = OutputMultiObject( File(exists=True), loc='surf', desc='Surface maps of cortical thickness') - volume = OutputMultiPath( + volume = OutputMultiObject( File(exists=True), desc='Surface maps of cortical volume', loc='surf') - white = OutputMultiPath( + white = OutputMultiObject( File(exists=True), desc='White/gray matter surface meshes', loc='surf') - jacobian_white = OutputMultiPath( + jacobian_white = OutputMultiObject( File(exists=True), desc='Distortion required to register to spherical atlas', loc='surf') - graymid = OutputMultiPath( + graymid = OutputMultiObject( File(exists=True), desc='Graymid/midthickness surface meshes', loc='surf', altkey=['graymid', 'midthickness']) - label = OutputMultiPath( + label = OutputMultiObject( File(exists=True), desc='Volume and surface label files', loc='label', altkey='*label') - annot = OutputMultiPath( + annot = OutputMultiObject( File(exists=True), desc='Surface annotation files', loc='label', altkey='*annot') - aparc_aseg = OutputMultiPath( + aparc_aseg = OutputMultiObject( File(exists=True), loc='mri', altkey='aparc*aseg', desc='Aparc parcellation projected into aseg volume') - sphere_reg = OutputMultiPath( + sphere_reg = OutputMultiObject( File(exists=True), loc='surf', altkey='sphere.reg', desc='Spherical registration file') - aseg_stats = OutputMultiPath( + aseg_stats = OutputMultiObject( File(exists=True), loc='stats', altkey='aseg', desc='Automated segmentation statistics file') - wmparc_stats = OutputMultiPath( + wmparc_stats = OutputMultiObject( File(exists=True), loc='stats', altkey='wmparc', desc='White matter parcellation statistics file') - aparc_stats = OutputMultiPath( + aparc_stats = OutputMultiObject( File(exists=True), loc='stats', altkey='aparc', desc='Aparc parcellation statistics files') - BA_stats = OutputMultiPath( + BA_stats = OutputMultiObject( File(exists=True), loc='stats', altkey='BA', desc='Brodmann Area statistics files') - aparc_a2009s_stats = OutputMultiPath( + aparc_a2009s_stats = OutputMultiObject( File(exists=True), loc='stats', altkey='aparc.a2009s', desc='Aparc a2009s parcellation statistics files') - curv_stats = OutputMultiPath( + curv_stats = OutputMultiObject( File(exists=True), loc='stats', altkey='curv', desc='Curvature statistics files') - entorhinal_exvivo_stats = OutputMultiPath( + entorhinal_exvivo_stats = OutputMultiObject( File(exists=True), loc='stats', altkey='entorhinal_exvivo', @@ -1868,7 +1868,7 @@ def __init__(self, infields=None, outfields=None, **kwargs): def _add_output_traits(self, base): """ - Using traits.Any instead out OutputMultiPath till add_trait bug + Using traits.Any instead out OutputMultiObject till add_trait bug is fixed. """ return add_traits(base, list(self.inputs.query_template_args.keys())) diff --git a/nipype/interfaces/matlab.py b/nipype/interfaces/matlab.py index fed7bfeb57..138c2dc3ea 100644 --- a/nipype/interfaces/matlab.py +++ b/nipype/interfaces/matlab.py @@ -8,7 +8,7 @@ import os from .. import config -from .base import (CommandLineInputSpec, InputMultiPath, isdefined, +from .base import (CommandLineInputSpec, InputMultiObject, isdefined, CommandLine, traits, File, Directory) @@ -69,7 +69,7 @@ class MatlabInputSpec(CommandLineInputSpec): mfile = traits.Bool(True, desc='Run m-code using m-file', usedefault=True) script_file = File( 'pyscript.m', usedefault=True, desc='Name of file to write m-code to') - paths = InputMultiPath(Directory(), desc='Paths to add to matlabpath') + paths = InputMultiObject(Directory(), desc='Paths to add to matlabpath') prescript = traits.List( ["ver,", "try,"], usedefault=True, diff --git a/nipype/interfaces/minc/minc.py b/nipype/interfaces/minc/minc.py index a520768bde..42df742111 100644 --- a/nipype/interfaces/minc/minc.py +++ b/nipype/interfaces/minc/minc.py @@ -28,7 +28,7 @@ from ..base import (TraitedSpec, CommandLineInputSpec, CommandLine, StdOutCommandLineInputSpec, StdOutCommandLine, File, - Directory, InputMultiPath, OutputMultiPath, traits, + Directory, InputMultiObject, OutputMultiObject, traits, isdefined) from .base import aggregate_filename @@ -143,14 +143,14 @@ class ExtractInputSpec(StdOutCommandLineInputSpec): 'Default value: 1.79769e+308.'), argstr='-image_maximum %s') - start = InputMultiPath( + start = InputMultiObject( traits.Int, desc='Specifies corner of hyperslab (C conventions for indices).', sep=',', argstr='-start %s', ) - count = InputMultiPath( + count = InputMultiObject( traits.Int, desc='Specifies edge lengths of hyperslab to read.', sep=',', @@ -620,7 +620,7 @@ class DumpInputSpec(StdOutCommandLineInputSpec): desc='Full annotations for C or Fortran indices in data.', xor=_xor_annotations) - variables = InputMultiPath( + variables = InputMultiObject( traits.Str, desc='Output data for specified variables only.', sep=',', @@ -688,7 +688,7 @@ def _format_arg(self, name, spec, value): class AverageInputSpec(CommandLineInputSpec): _xor_input_files = ('input_files', 'filelist') - input_files = InputMultiPath( + input_files = InputMultiObject( traits.File(exists=True), desc='input file(s)', mandatory=True, @@ -854,7 +854,7 @@ class AverageInputSpec(CommandLineInputSpec): 'binarization. Default value: -1.79769e+308'), argstr='-binvalue %s') - weights = InputMultiPath( + weights = InputMultiObject( traits.Str, desc='Specify weights for averaging (",,...").', sep=',', @@ -948,7 +948,7 @@ class Blob(CommandLine): class CalcInputSpec(CommandLineInputSpec): _xor_input_files = ('input_files', 'filelist') - input_files = InputMultiPath( + input_files = InputMultiObject( traits.File(exists=True), desc='input file(s) for calculation', mandatory=True, @@ -1756,7 +1756,7 @@ def cmdline(self): class MathInputSpec(CommandLineInputSpec): _xor_input_files = ('input_files', 'filelist') - input_files = InputMultiPath( + input_files = InputMultiObject( traits.File(exists=True), desc='input file(s) for calculation', mandatory=True, @@ -2207,7 +2207,7 @@ class ResampleInputSpec(CommandLineInputSpec): name_template='%s_resample.mnc') # This is a dummy input. - input_grid_files = InputMultiPath( + input_grid_files = InputMultiObject( traits.File, desc='input grid file(s)', ) @@ -3002,7 +3002,7 @@ def _list_outputs(self): class XfmConcatInputSpec(CommandLineInputSpec): - input_files = InputMultiPath( + input_files = InputMultiObject( traits.File(exists=True), desc='input file(s)', mandatory=True, @@ -3011,7 +3011,7 @@ class XfmConcatInputSpec(CommandLineInputSpec): position=-2) # This is a dummy input. - input_grid_files = InputMultiPath( + input_grid_files = InputMultiObject( traits.File, desc='input grid file(s)', ) @@ -3036,7 +3036,7 @@ class XfmConcatInputSpec(CommandLineInputSpec): class XfmConcatOutputSpec(TraitedSpec): output_file = File(desc='output file', exists=True) - output_grids = OutputMultiPath(File(exists=True), desc='output grids') + output_grids = OutputMultiObject(File(exists=True), desc='output grids') class XfmConcat(CommandLine): @@ -3179,7 +3179,7 @@ class NlpFitInputSpec(CommandLineInputSpec): ) # This is a dummy input. - input_grid_files = InputMultiPath( + input_grid_files = InputMultiObject( traits.File, desc='input grid file(s)', ) @@ -3270,7 +3270,7 @@ def _list_outputs(self): class XfmAvgInputSpec(CommandLineInputSpec): - input_files = InputMultiPath( + input_files = InputMultiObject( traits.File(exists=True), desc='input file(s)', mandatory=True, @@ -3279,7 +3279,7 @@ class XfmAvgInputSpec(CommandLineInputSpec): position=-2) # This is a dummy input. - input_grid_files = InputMultiPath( + input_grid_files = InputMultiObject( traits.File, desc='input grid file(s)', ) @@ -3444,7 +3444,7 @@ def _list_outputs(self): class BigAverageInputSpec(CommandLineInputSpec): - input_files = InputMultiPath( + input_files = InputMultiObject( traits.File(exists=True), desc='input file(s)', mandatory=True, @@ -3620,7 +3620,7 @@ class VolSymmInputSpec(CommandLineInputSpec): name_template='%s_vol_symm.mnc') # This is a dummy input. - input_grid_files = InputMultiPath( + input_grid_files = InputMultiObject( traits.File, desc='input grid file(s)', ) diff --git a/nipype/interfaces/mipav/developer.py b/nipype/interfaces/mipav/developer.py index ffb9e10cc3..ef86cadf5f 100644 --- a/nipype/interfaces/mipav/developer.py +++ b/nipype/interfaces/mipav/developer.py @@ -7,7 +7,7 @@ from ..base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiPath, OutputMultiPath) + InputMultiObject, OutputMultiObject) class JistLaminarVolumetricLayeringInputSpec(CommandLineInputSpec): @@ -1047,7 +1047,7 @@ class JistLaminarProfileSampling(SEMLikeCommandLine): class MedicAlgorithmMipavReorientInputSpec(CommandLineInputSpec): - inSource = InputMultiPath( + inSource = InputMultiObject( File, desc="Source", sep=";", argstr="--inSource %s") inTemplate = File(desc="Template", exists=True, argstr="--inTemplate %s") inNew = traits.Enum( @@ -1114,7 +1114,7 @@ class MedicAlgorithmMipavReorientInputSpec(CommandLineInputSpec): argstr="--inResolution %s") xPrefExt = traits.Enum( "nrrd", desc="Output File Type", argstr="--xPrefExt %s") - outReoriented = InputMultiPath( + outReoriented = InputMultiObject( File, desc="Reoriented Volume", sep=";", argstr="--outReoriented %s") null = traits.Str(desc="Execution Time", argstr="--null %s") xDefaultMem = traits.Int( @@ -1567,7 +1567,7 @@ class JistIntensityMp2rageMasking(SEMLikeCommandLine): class MedicAlgorithmThresholdToBinaryMaskInputSpec(CommandLineInputSpec): - inLabel = InputMultiPath( + inLabel = InputMultiObject( File, desc="Input volumes", sep=";", argstr="--inLabel %s") inMinimum = traits.Float( desc="Minimum threshold value.", argstr="--inMinimum %f") @@ -1580,7 +1580,7 @@ class MedicAlgorithmThresholdToBinaryMaskInputSpec(CommandLineInputSpec): argstr="--inUse %s") xPrefExt = traits.Enum( "nrrd", desc="Output File Type", argstr="--xPrefExt %s") - outBinary = InputMultiPath( + outBinary = InputMultiObject( File, desc="Binary Mask", sep=";", argstr="--outBinary %s") null = traits.Str(desc="Execution Time", argstr="--null %s") xDefaultMem = traits.Int( diff --git a/nipype/interfaces/mne/base.py b/nipype/interfaces/mne/base.py index 14cfcd53e5..168a3f9d9a 100644 --- a/nipype/interfaces/mne/base.py +++ b/nipype/interfaces/mne/base.py @@ -8,7 +8,7 @@ from ... import logging from ...utils.filemanip import list_to_filename -from ..base import (traits, File, Directory, TraitedSpec, OutputMultiPath) +from ..base import (traits, File, Directory, TraitedSpec, OutputMultiObject) from ..freesurfer.base import FSCommand, FSTraitedSpec iflogger = logging.getLogger('interface') @@ -46,7 +46,7 @@ class WatershedBEMInputSpec(FSTraitedSpec): class WatershedBEMOutputSpec(TraitedSpec): - mesh_files = OutputMultiPath( + mesh_files = OutputMultiObject( File(exists=True), desc=('Paths to the output meshes (brain, inner ' 'skull, outer skull, outer skin)')) @@ -71,7 +71,7 @@ class WatershedBEMOutputSpec(TraitedSpec): loc='bem', altkey='fif', desc='"fif" format file for EEG processing in MNE') - cor_files = OutputMultiPath( + cor_files = OutputMultiObject( File(exists=True), loc='bem/watershed/ws', altkey='COR', diff --git a/nipype/interfaces/mrtrix/preprocess.py b/nipype/interfaces/mrtrix/preprocess.py index 4de430bb58..7c4281740f 100644 --- a/nipype/interfaces/mrtrix/preprocess.py +++ b/nipype/interfaces/mrtrix/preprocess.py @@ -16,7 +16,7 @@ from ...utils.filemanip import split_filename from ..base import (CommandLineInputSpec, CommandLine, traits, TraitedSpec, - File, InputMultiPath, isdefined) + File, InputMultiObject, isdefined) class MRConvertInputSpec(CommandLineInputSpec): @@ -167,7 +167,7 @@ def _gen_outfilename(self): class DWI2TensorInputSpec(CommandLineInputSpec): - in_file = InputMultiPath( + in_file = InputMultiObject( File(exists=True), argstr='%s', mandatory=True, @@ -439,7 +439,7 @@ def _gen_outfilename(self): class MRMultiplyInputSpec(CommandLineInputSpec): - in_files = InputMultiPath( + in_files = InputMultiObject( File(exists=True), argstr='%s', mandatory=True, @@ -497,7 +497,7 @@ def _gen_outfilename(self): class MRTrixViewerInputSpec(CommandLineInputSpec): - in_files = InputMultiPath( + in_files = InputMultiObject( File(exists=True), argstr='%s', mandatory=True, @@ -841,7 +841,7 @@ def _gen_outfilename(self): class MRTransformInputSpec(CommandLineInputSpec): - in_files = InputMultiPath( + in_files = InputMultiObject( File(exists=True), argstr='%s', mandatory=True, diff --git a/nipype/interfaces/mrtrix3/utils.py b/nipype/interfaces/mrtrix3/utils.py index 2c02de75e4..0ee51f13d6 100644 --- a/nipype/interfaces/mrtrix3/utils.py +++ b/nipype/interfaces/mrtrix3/utils.py @@ -16,7 +16,7 @@ import os.path as op from ..base import (CommandLineInputSpec, CommandLine, traits, TraitedSpec, - File, InputMultiPath, isdefined) + File, InputMultiObject, isdefined) from .base import MRTrix3BaseInputSpec, MRTrix3Base diff --git a/nipype/interfaces/niftyseg/em.py b/nipype/interfaces/niftyseg/em.py index 47c0659b30..4309c4ba46 100644 --- a/nipype/interfaces/niftyseg/em.py +++ b/nipype/interfaces/niftyseg/em.py @@ -19,7 +19,7 @@ """ from ..base import (TraitedSpec, File, traits, CommandLineInputSpec, - InputMultiPath) + InputMultiObject) from .base import NiftySegCommand from ..niftyreg.base import get_custom_path @@ -52,7 +52,7 @@ class EMInputSpec(CommandLineInputSpec): desc='4D file containing the priors', xor=['no_prior', 'priors']) - priors = InputMultiPath( + priors = InputMultiObject( argstr='%s', mandatory=True, desc='List of priors filepaths.', diff --git a/nipype/interfaces/nilearn.py b/nipype/interfaces/nilearn.py index 3492e2e233..d73d01073b 100644 --- a/nipype/interfaces/nilearn.py +++ b/nipype/interfaces/nilearn.py @@ -20,13 +20,13 @@ from .. import logging from ..interfaces.base import (traits, TraitedSpec, BaseInterface, - BaseInterfaceInputSpec, File, InputMultiPath) + BaseInterfaceInputSpec, File, InputMultiObject) IFLOGGER = logging.getLogger('interface') class SignalExtractionInputSpec(BaseInterfaceInputSpec): in_file = File(exists=True, mandatory=True, desc='4-D fMRI nii file') - label_files = InputMultiPath( + label_files = InputMultiObject( File(exists=True), mandatory=True, desc='a 3-D label image, with 0 denoting ' diff --git a/nipype/interfaces/nipy/model.py b/nipype/interfaces/nipy/model.py index 7df9cb609d..659b819d70 100644 --- a/nipype/interfaces/nipy/model.py +++ b/nipype/interfaces/nipy/model.py @@ -11,7 +11,7 @@ from ...utils.misc import package_check from ...utils import NUMPY_MMAP -from ..base import (BaseInterface, TraitedSpec, traits, File, OutputMultiPath, +from ..base import (BaseInterface, TraitedSpec, traits, File, OutputMultiObject, BaseInterfaceInputSpec, isdefined) have_nipy = True @@ -278,9 +278,9 @@ class EstimateContrastInputSpec(BaseInterfaceInputSpec): class EstimateContrastOutputSpec(TraitedSpec): - stat_maps = OutputMultiPath(File(exists=True)) - z_maps = OutputMultiPath(File(exists=True)) - p_maps = OutputMultiPath(File(exists=True)) + stat_maps = OutputMultiObject(File(exists=True)) + z_maps = OutputMultiObject(File(exists=True)) + p_maps = OutputMultiObject(File(exists=True)) class EstimateContrast(BaseInterface): diff --git a/nipype/interfaces/nipy/preprocess.py b/nipype/interfaces/nipy/preprocess.py index a3566e07a9..134f0e6bc6 100644 --- a/nipype/interfaces/nipy/preprocess.py +++ b/nipype/interfaces/nipy/preprocess.py @@ -21,7 +21,7 @@ from ...utils.filemanip import split_filename, fname_presuffix from ..base import (TraitedSpec, BaseInterface, traits, BaseInterfaceInputSpec, - isdefined, File, InputMultiPath, OutputMultiPath) + isdefined, File, InputMultiObject, OutputMultiObject) have_nipy = True try: @@ -87,7 +87,7 @@ def _list_outputs(self): class FmriRealign4dInputSpec(BaseInterfaceInputSpec): - in_file = InputMultiPath( + in_file = InputMultiObject( File(exists=True), mandatory=True, desc="File to realign") tr = traits.Float(desc="TR in seconds", mandatory=True) slice_order = traits.List( @@ -107,16 +107,16 @@ class FmriRealign4dInputSpec(BaseInterfaceInputSpec): desc="Assume smooth changes across time e.g.,\ fmri series. If you don't want slice timing \ correction set this to undefined") - loops = InputMultiPath( + loops = InputMultiObject( [5], traits.Int, usedefault=True, desc="loops within each run") - between_loops = InputMultiPath( + between_loops = InputMultiObject( [5], traits.Int, usedefault=True, desc="loops used to \ realign different \ runs") - speedup = InputMultiPath( + speedup = InputMultiObject( [5], traits.Int, usedefault=True, @@ -127,8 +127,8 @@ class FmriRealign4dInputSpec(BaseInterfaceInputSpec): class FmriRealign4dOutputSpec(TraitedSpec): - out_file = OutputMultiPath(File(exists=True), desc="Realigned files") - par_file = OutputMultiPath( + out_file = OutputMultiObject(File(exists=True), desc="Realigned files") + par_file = OutputMultiObject( File(exists=True), desc="Motion parameter files") @@ -225,7 +225,7 @@ def _list_outputs(self): class SpaceTimeRealignerInputSpec(BaseInterfaceInputSpec): - in_file = InputMultiPath( + in_file = InputMultiObject( File(exists=True), mandatory=True, min_ver='0.4.0.dev', @@ -258,8 +258,8 @@ class SpaceTimeRealignerInputSpec(BaseInterfaceInputSpec): class SpaceTimeRealignerOutputSpec(TraitedSpec): - out_file = OutputMultiPath(File(exists=True), desc="Realigned files") - par_file = OutputMultiPath( + out_file = OutputMultiObject(File(exists=True), desc="Realigned files") + par_file = OutputMultiObject( File(exists=True), desc=("Motion parameter files. Angles are not " "euler angles")) diff --git a/nipype/interfaces/semtools/brains/classify.py b/nipype/interfaces/semtools/brains/classify.py index 89bb74f039..914e869dda 100644 --- a/nipype/interfaces/semtools/brains/classify.py +++ b/nipype/interfaces/semtools/brains/classify.py @@ -7,7 +7,7 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiPath, OutputMultiPath) + InputMultiObject, OutputMultiObject) class BRAINSPosteriorToContinuousClassInputSpec(CommandLineInputSpec): diff --git a/nipype/interfaces/semtools/brains/segmentation.py b/nipype/interfaces/semtools/brains/segmentation.py index fae5e4f1a2..ad30a06519 100644 --- a/nipype/interfaces/semtools/brains/segmentation.py +++ b/nipype/interfaces/semtools/brains/segmentation.py @@ -7,7 +7,7 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiPath, OutputMultiPath) + InputMultiObject, OutputMultiObject) class SimilarityIndexInputSpec(CommandLineInputSpec): @@ -56,19 +56,19 @@ class SimilarityIndex(SEMLikeCommandLine): class BRAINSTalairachInputSpec(CommandLineInputSpec): - AC = InputMultiPath( + AC = InputMultiObject( traits.Float, desc="Location of AC Point ", sep=",", argstr="--AC %s") ACisIndex = traits.Bool(desc="AC Point is Index", argstr="--ACisIndex ") - PC = InputMultiPath( + PC = InputMultiObject( traits.Float, desc="Location of PC Point ", sep=",", argstr="--PC %s") PCisIndex = traits.Bool(desc="PC Point is Index", argstr="--PCisIndex ") - SLA = InputMultiPath( + SLA = InputMultiObject( traits.Float, desc="Location of SLA Point ", sep=",", argstr="--SLA %s") SLAisIndex = traits.Bool(desc="SLA Point is Index", argstr="--SLAisIndex ") - IRP = InputMultiPath( + IRP = InputMultiObject( traits.Float, desc="Location of IRP Point ", sep=",", diff --git a/nipype/interfaces/semtools/brains/utilities.py b/nipype/interfaces/semtools/brains/utilities.py index d794c9c587..ed77fcade4 100644 --- a/nipype/interfaces/semtools/brains/utilities.py +++ b/nipype/interfaces/semtools/brains/utilities.py @@ -7,7 +7,7 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiPath, OutputMultiPath) + InputMultiObject, OutputMultiObject) class HistogramMatchingFilterInputSpec(CommandLineInputSpec): @@ -73,7 +73,7 @@ class HistogramMatchingFilter(SEMLikeCommandLine): class GenerateEdgeMapImageInputSpec(CommandLineInputSpec): - inputMRVolumes = InputMultiPath( + inputMRVolumes = InputMultiObject( File(exists=True), desc= "List of input structural MR volumes to create the maximum edgemap", @@ -146,14 +146,14 @@ class GenerateEdgeMapImage(SEMLikeCommandLine): class GeneratePurePlugMaskInputSpec(CommandLineInputSpec): - inputImageModalities = InputMultiPath( + inputImageModalities = InputMultiObject( File(exists=True), desc="List of input image file names to create pure plugs mask", argstr="--inputImageModalities %s...") threshold = traits.Float( desc="threshold value to define class membership", argstr="--threshold %f") - numberOfSubSamples = InputMultiPath( + numberOfSubSamples = InputMultiObject( traits.Int, desc= "Number of continous index samples taken at each direction of lattice space for each plug volume", diff --git a/nipype/interfaces/semtools/converters.py b/nipype/interfaces/semtools/converters.py index de638935e5..11c61125be 100644 --- a/nipype/interfaces/semtools/converters.py +++ b/nipype/interfaces/semtools/converters.py @@ -7,7 +7,7 @@ from ..base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiPath, OutputMultiPath) + InputMultiObject, OutputMultiObject) class DWISimpleCompareInputSpec(CommandLineInputSpec): diff --git a/nipype/interfaces/semtools/diffusion/diffusion.py b/nipype/interfaces/semtools/diffusion/diffusion.py index af943a04fb..e2bfac1616 100644 --- a/nipype/interfaces/semtools/diffusion/diffusion.py +++ b/nipype/interfaces/semtools/diffusion/diffusion.py @@ -7,11 +7,11 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiPath, OutputMultiPath) + InputMultiObject, OutputMultiObject) class dtiaverageInputSpec(CommandLineInputSpec): - inputs = InputMultiPath( + inputs = InputMultiObject( File(exists=True), desc="List of all the tensor fields to be averaged", argstr="--inputs %s...") @@ -135,7 +135,7 @@ class dtiestimInputSpec(CommandLineInputSpec): "Tensor components are saved as doubles (cannot be visualized in Slicer)", argstr="--DTI_double ") verbose = traits.Bool(desc="produce verbose output", argstr="--verbose ") - defaultTensor = InputMultiPath( + defaultTensor = InputMultiObject( traits.Float, desc= "Default tensor used if estimated tensor is below a given threshold", diff --git a/nipype/interfaces/semtools/diffusion/gtract.py b/nipype/interfaces/semtools/diffusion/gtract.py index 999c898599..298043bb55 100644 --- a/nipype/interfaces/semtools/diffusion/gtract.py +++ b/nipype/interfaces/semtools/diffusion/gtract.py @@ -7,7 +7,7 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiPath, OutputMultiPath) + InputMultiObject, OutputMultiObject) class gtractTransformToDisplacementFieldInputSpec(CommandLineInputSpec): @@ -80,7 +80,7 @@ class gtractInvertBSplineTransformInputSpec(CommandLineInputSpec): hash_files=False, desc="Required: output transform file name", argstr="--outputTransform %s") - landmarkDensity = InputMultiPath( + landmarkDensity = InputMultiObject( traits.Int, desc="Number of landmark subdivisions in all 3 directions", sep=",", @@ -122,7 +122,7 @@ class gtractInvertBSplineTransform(SEMLikeCommandLine): class gtractConcatDwiInputSpec(CommandLineInputSpec): - inputVolume = InputMultiPath( + inputVolume = InputMultiObject( File(exists=True), desc= "Required: input file containing the first diffusion weighted image", @@ -1105,7 +1105,7 @@ class gtractCoRegAnatomyInputSpec(CommandLineInputSpec): numberOfIterations = traits.Int( desc="Number of iterations in the selected 3D fit", argstr="--numberOfIterations %d") - gridSize = InputMultiPath( + gridSize = InputMultiObject( traits.Int, desc="Number of grid subdivisions in all 3 directions", sep=",", @@ -1226,7 +1226,7 @@ class gtractResampleDWIInPlaceInputSpec(CommandLineInputSpec): desc= "Display debug messages, and produce debug intermediate results. 0=OFF, 1=Minimal, 10=Maximum debugging.", argstr="--debugLevel %d") - imageOutputSize = InputMultiPath( + imageOutputSize = InputMultiObject( traits.Int, desc= "The voxel lattice for the output image, padding is added if necessary. NOTE: if 0,0,0, then the inputVolume size is used.", @@ -1633,7 +1633,7 @@ class gtractTensorInputSpec(CommandLineInputSpec): desc= "Required: name of output NRRD file containing the Tensor vector image", argstr="--outputVolume %s") - medianFilterSize = InputMultiPath( + medianFilterSize = InputMultiObject( traits.Int, desc="Median filter radius in all 3 directions", sep=",", @@ -1664,7 +1664,7 @@ class gtractTensorInputSpec(CommandLineInputSpec): applyMeasurementFrame = traits.Bool( desc="Flag to apply the measurement frame to the gradient directions", argstr="--applyMeasurementFrame ") - ignoreIndex = InputMultiPath( + ignoreIndex = InputMultiObject( traits.Int, desc= "Ignore diffusion gradient index. Used to remove specific gradient directions with artifacts.", diff --git a/nipype/interfaces/semtools/diffusion/maxcurvature.py b/nipype/interfaces/semtools/diffusion/maxcurvature.py index 570109eb1b..96c758d202 100644 --- a/nipype/interfaces/semtools/diffusion/maxcurvature.py +++ b/nipype/interfaces/semtools/diffusion/maxcurvature.py @@ -7,7 +7,7 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiPath, OutputMultiPath) + InputMultiObject, OutputMultiObject) class maxcurvatureInputSpec(CommandLineInputSpec): diff --git a/nipype/interfaces/semtools/diffusion/tractography/commandlineonly.py b/nipype/interfaces/semtools/diffusion/tractography/commandlineonly.py index 19adc2a817..5be503eb98 100644 --- a/nipype/interfaces/semtools/diffusion/tractography/commandlineonly.py +++ b/nipype/interfaces/semtools/diffusion/tractography/commandlineonly.py @@ -7,7 +7,7 @@ from ....base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiPath, OutputMultiPath) + InputMultiObject, OutputMultiObject) class fiberstatsInputSpec(CommandLineInputSpec): diff --git a/nipype/interfaces/semtools/diffusion/tractography/fiberprocess.py b/nipype/interfaces/semtools/diffusion/tractography/fiberprocess.py index c0e9dcbbaf..9b859f70a3 100644 --- a/nipype/interfaces/semtools/diffusion/tractography/fiberprocess.py +++ b/nipype/interfaces/semtools/diffusion/tractography/fiberprocess.py @@ -7,7 +7,7 @@ from ....base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiPath, OutputMultiPath) + InputMultiObject, OutputMultiObject) class fiberprocessInputSpec(CommandLineInputSpec): diff --git a/nipype/interfaces/semtools/diffusion/tractography/fibertrack.py b/nipype/interfaces/semtools/diffusion/tractography/fibertrack.py index 498cb2579d..7e675c01b4 100644 --- a/nipype/interfaces/semtools/diffusion/tractography/fibertrack.py +++ b/nipype/interfaces/semtools/diffusion/tractography/fibertrack.py @@ -7,7 +7,7 @@ from ....base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiPath, OutputMultiPath) + InputMultiObject, OutputMultiObject) class fibertrackInputSpec(CommandLineInputSpec): diff --git a/nipype/interfaces/semtools/diffusion/tractography/ukftractography.py b/nipype/interfaces/semtools/diffusion/tractography/ukftractography.py index 11971dbb6d..c67964755c 100644 --- a/nipype/interfaces/semtools/diffusion/tractography/ukftractography.py +++ b/nipype/interfaces/semtools/diffusion/tractography/ukftractography.py @@ -7,7 +7,7 @@ from ....base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiPath, OutputMultiPath) + InputMultiObject, OutputMultiObject) class UKFTractographyInputSpec(CommandLineInputSpec): @@ -17,7 +17,7 @@ class UKFTractographyInputSpec(CommandLineInputSpec): "Seeds for diffusion. If not specified, full brain tractography will be performed, and the algorithm will start from every voxel in the brain mask where the Generalized Anisotropy is bigger than 0.18", exists=True, argstr="--seedsFile %s") - labels = InputMultiPath( + labels = InputMultiObject( traits.Int, desc="A vector of the ROI labels to be used", sep=",", diff --git a/nipype/interfaces/semtools/featurecreator.py b/nipype/interfaces/semtools/featurecreator.py index 69ff2d675c..ff119a27aa 100644 --- a/nipype/interfaces/semtools/featurecreator.py +++ b/nipype/interfaces/semtools/featurecreator.py @@ -7,7 +7,7 @@ from ..base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiPath, OutputMultiPath) + InputMultiObject, OutputMultiObject) class GenerateCsfClippedFromClassifiedImageInputSpec(CommandLineInputSpec): diff --git a/nipype/interfaces/semtools/filtering/denoising.py b/nipype/interfaces/semtools/filtering/denoising.py index 97d687c512..191ec55f2a 100644 --- a/nipype/interfaces/semtools/filtering/denoising.py +++ b/nipype/interfaces/semtools/filtering/denoising.py @@ -7,7 +7,7 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiPath, OutputMultiPath) + InputMultiObject, OutputMultiObject) class UnbiasedNonLocalMeansInputSpec(CommandLineInputSpec): @@ -15,13 +15,13 @@ class UnbiasedNonLocalMeansInputSpec(CommandLineInputSpec): desc= "The root power of noise (sigma) in the complex Gaussian process the Rician comes from. If it is underestimated, the algorithm fails to remove the noise. If it is overestimated, over-blurring is likely to occur.", argstr="--sigma %f") - rs = InputMultiPath( + rs = InputMultiObject( traits.Int, desc= "The algorithm search for similar voxels in a neighborhood of this radius (radii larger than 5,5,5 are very slow, and the results can be only marginally better. Small radii may fail to effectively remove the noise).", sep=",", argstr="--rs %s") - rc = InputMultiPath( + rc = InputMultiObject( traits.Int, desc= "Similarity between blocks is computed as the difference between mean values and gradients. These parameters are computed fitting a hyperplane with LS inside a neighborhood of this size", diff --git a/nipype/interfaces/semtools/filtering/featuredetection.py b/nipype/interfaces/semtools/filtering/featuredetection.py index ca4973ab43..17c98dfc80 100644 --- a/nipype/interfaces/semtools/filtering/featuredetection.py +++ b/nipype/interfaces/semtools/filtering/featuredetection.py @@ -7,7 +7,7 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiPath, OutputMultiPath) + InputMultiObject, OutputMultiObject) class GenerateSummedGradientImageInputSpec(CommandLineInputSpec): @@ -697,7 +697,7 @@ class STAPLEAnalysisInputSpec(CommandLineInputSpec): inputDimension = traits.Int( desc="Required: input image Dimension 2 or 3", argstr="--inputDimension %d") - inputLabelVolume = InputMultiPath( + inputLabelVolume = InputMultiObject( File(exists=True), desc="Required: input label volume", argstr="--inputLabelVolume %s...") diff --git a/nipype/interfaces/semtools/legacy/registration.py b/nipype/interfaces/semtools/legacy/registration.py index 04bb425e3d..a020624c15 100644 --- a/nipype/interfaces/semtools/legacy/registration.py +++ b/nipype/interfaces/semtools/legacy/registration.py @@ -7,7 +7,7 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiPath, OutputMultiPath) + InputMultiObject, OutputMultiObject) class scalartransformInputSpec(CommandLineInputSpec): diff --git a/nipype/interfaces/semtools/registration/brainsfit.py b/nipype/interfaces/semtools/registration/brainsfit.py index 6142aac418..af6dff3072 100644 --- a/nipype/interfaces/semtools/registration/brainsfit.py +++ b/nipype/interfaces/semtools/registration/brainsfit.py @@ -7,7 +7,7 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiPath, OutputMultiPath) + InputMultiObject, OutputMultiObject) class BRAINSFitInputSpec(CommandLineInputSpec): @@ -25,7 +25,7 @@ class BRAINSFitInputSpec(CommandLineInputSpec): desc= "Fraction of voxels of the fixed image that will be used for registration. The number has to be larger than zero and less or equal to one. Higher values increase the computation time but may give more accurate results. You can also limit the sampling focus with ROI masks and ROIAUTO mask generation. The default is 0.002 (use approximately 0.2% of voxels, resulting in 100000 samples in a 512x512x192 volume) to provide a very fast registration in most cases. Typical values range from 0.01 (1%) for low detail images to 0.2 (20%) for high detail images.", argstr="--samplingPercentage %f") - splineGridSize = InputMultiPath( + splineGridSize = InputMultiObject( traits.Int, desc= "Number of BSpline grid subdivisions along each axis of the fixed image, centered on the image space. Values must be 3 or higher for the BSpline to be correctly computed.", @@ -133,7 +133,7 @@ class BRAINSFitInputSpec(CommandLineInputSpec): desc= "Apply histogram matching operation for the input images to make them more similar. This is suitable for images of the same modality that may have different brightness or contrast, but the same overall intensity profile. Do NOT use if registering images from different modalities.", argstr="--histogramMatch ") - medianFilterSize = InputMultiPath( + medianFilterSize = InputMultiObject( traits.Int, desc= "Apply median filtering to reduce noise in the input volumes. The 3 values specify the radius for the optional MedianImageFilter preprocessing in all 3 directions (in voxels).", @@ -184,7 +184,7 @@ class BRAINSFitInputSpec(CommandLineInputSpec): desc= "Type of interpolation to be used when applying transform to moving volume. Options are Linear, NearestNeighbor, BSpline, WindowedSinc, Hamming, Cosine, Welch, Lanczos, or ResampleInPlace. The ResampleInPlace option will create an image with the same discrete voxel values and will adjust the origin and direction of the physical space interpretation.", argstr="--interpolationMode %s") - numberOfIterations = InputMultiPath( + numberOfIterations = InputMultiObject( traits.Int, desc= "The maximum number of iterations to try before stopping the optimization. When using a lower value (500-1000) then the registration is forced to terminate earlier but there is a higher risk of stopping before an optimal solution is reached.", @@ -194,7 +194,7 @@ class BRAINSFitInputSpec(CommandLineInputSpec): desc= "Starting step length of the optimizer. In general, higher values allow for recovering larger initial misalignments but there is an increased chance that the registration will not converge.", argstr="--maximumStepLength %f") - minimumStepLength = InputMultiPath( + minimumStepLength = InputMultiObject( traits.Float, desc= "Each step in the optimization takes steps at least this big. When none are possible, registration is complete. Smaller values allows the optimizer to make smaller adjustments, but the registration time may increase.", @@ -267,7 +267,7 @@ class BRAINSFitInputSpec(CommandLineInputSpec): desc= "Rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE: This value is overridden if either bsplineTransform or linearTransform is set.", argstr="--strippedOutputTransform %s") - transformType = InputMultiPath( + transformType = InputMultiObject( traits.Str, desc= "Specifies a list of registration types to be used. The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, BSpline and SyN. Specifying more than one in a comma separated list will initialize the next stage with the previous results. If registrationClass flag is used, it overrides this parameter setting.", diff --git a/nipype/interfaces/semtools/registration/brainsresample.py b/nipype/interfaces/semtools/registration/brainsresample.py index f9ea80acbd..53915cf275 100644 --- a/nipype/interfaces/semtools/registration/brainsresample.py +++ b/nipype/interfaces/semtools/registration/brainsresample.py @@ -7,7 +7,7 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiPath, OutputMultiPath) + InputMultiObject, OutputMultiObject) class BRAINSResampleInputSpec(CommandLineInputSpec): @@ -65,7 +65,7 @@ class BRAINSResampleInputSpec(CommandLineInputSpec): argstr="--inverseTransform ") defaultValue = traits.Float( desc="Default voxel value", argstr="--defaultValue %f") - gridSpacing = InputMultiPath( + gridSpacing = InputMultiObject( traits.Int, desc= "Add warped grid to output image to help show the deformation that occured with specified spacing. A spacing of 0 in a dimension indicates that grid lines should be rendered to fall exactly (i.e. do not allow displacements off that plane). This is useful for makeing a 2D image of grid lines from the 3D space", diff --git a/nipype/interfaces/semtools/registration/brainsresize.py b/nipype/interfaces/semtools/registration/brainsresize.py index 11238dd914..5ea19679da 100644 --- a/nipype/interfaces/semtools/registration/brainsresize.py +++ b/nipype/interfaces/semtools/registration/brainsresize.py @@ -7,7 +7,7 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiPath, OutputMultiPath) + InputMultiObject, OutputMultiObject) class BRAINSResizeInputSpec(CommandLineInputSpec): diff --git a/nipype/interfaces/semtools/registration/specialized.py b/nipype/interfaces/semtools/registration/specialized.py index 2cc08e3ec7..5ec3c65c09 100644 --- a/nipype/interfaces/semtools/registration/specialized.py +++ b/nipype/interfaces/semtools/registration/specialized.py @@ -7,15 +7,15 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiPath, OutputMultiPath) + InputMultiObject, OutputMultiObject) class VBRAINSDemonWarpInputSpec(CommandLineInputSpec): - movingVolume = InputMultiPath( + movingVolume = InputMultiObject( File(exists=True), desc="Required: input moving image", argstr="--movingVolume %s...") - fixedVolume = InputMultiPath( + fixedVolume = InputMultiObject( File(exists=True), desc="Required: input fixed (target) image", argstr="--fixedVolume %s...") @@ -82,19 +82,19 @@ class VBRAINSDemonWarpInputSpec(CommandLineInputSpec): desc= "Number of image pyramid levels to use in the multi-resolution registration.", argstr="--numberOfPyramidLevels %d") - minimumFixedPyramid = InputMultiPath( + minimumFixedPyramid = InputMultiObject( traits.Int, desc= "The shrink factor for the first level of the fixed image pyramid. (i.e. start at 1/16 scale, then 1/8, then 1/4, then 1/2, and finally full scale)", sep=",", argstr="--minimumFixedPyramid %s") - minimumMovingPyramid = InputMultiPath( + minimumMovingPyramid = InputMultiObject( traits.Int, desc= "The shrink factor for the first level of the moving image pyramid. (i.e. start at 1/16 scale, then 1/8, then 1/4, then 1/2, and finally full scale)", sep=",", argstr="--minimumMovingPyramid %s") - arrayOfPyramidLevelIterations = InputMultiPath( + arrayOfPyramidLevelIterations = InputMultiObject( traits.Int, desc="The number of iterations for each pyramid level", sep=",", @@ -109,7 +109,7 @@ class VBRAINSDemonWarpInputSpec(CommandLineInputSpec): numberOfMatchPoints = traits.Int( desc="The number of match points for histrogramMatch", argstr="--numberOfMatchPoints %d") - medianFilterSize = InputMultiPath( + medianFilterSize = InputMultiObject( traits.Int, desc= "Median filter radius in all 3 directions. When images have a lot of salt and pepper noise, this step can improve the registration.", @@ -145,12 +145,12 @@ class VBRAINSDemonWarpInputSpec(CommandLineInputSpec): backgroundFillValue = traits.Int( desc="Replacement value to overwrite background when performing BOBF", argstr="--backgroundFillValue %d") - seedForBOBF = InputMultiPath( + seedForBOBF = InputMultiObject( traits.Int, desc="coordinates in all 3 directions for Seed when performing BOBF", sep=",", argstr="--seedForBOBF %s") - neighborhoodForBOBF = InputMultiPath( + neighborhoodForBOBF = InputMultiObject( traits.Int, desc= "neighborhood in all 3 directions to be included when performing BOBF", @@ -167,7 +167,7 @@ class VBRAINSDemonWarpInputSpec(CommandLineInputSpec): desc= "Genete a checkerboard image volume between the fixedVolume and the deformed movingVolume.", argstr="--outputCheckerboardVolume %s") - checkerboardPatternSubdivisions = InputMultiPath( + checkerboardPatternSubdivisions = InputMultiObject( traits.Int, desc="Number of Checkerboard subdivisions in all 3 directions", sep=",", @@ -179,7 +179,7 @@ class VBRAINSDemonWarpInputSpec(CommandLineInputSpec): outputDebug = traits.Bool( desc="Flag to write debugging images after each step.", argstr="--outputDebug ") - weightFactors = InputMultiPath( + weightFactors = InputMultiObject( traits.Float, desc="Weight fatctors for each input images", sep=",", @@ -329,19 +329,19 @@ class BRAINSDemonWarpInputSpec(CommandLineInputSpec): desc= "Number of image pyramid levels to use in the multi-resolution registration.", argstr="--numberOfPyramidLevels %d") - minimumFixedPyramid = InputMultiPath( + minimumFixedPyramid = InputMultiObject( traits.Int, desc= "The shrink factor for the first level of the fixed image pyramid. (i.e. start at 1/16 scale, then 1/8, then 1/4, then 1/2, and finally full scale)", sep=",", argstr="--minimumFixedPyramid %s") - minimumMovingPyramid = InputMultiPath( + minimumMovingPyramid = InputMultiObject( traits.Int, desc= "The shrink factor for the first level of the moving image pyramid. (i.e. start at 1/16 scale, then 1/8, then 1/4, then 1/2, and finally full scale)", sep=",", argstr="--minimumMovingPyramid %s") - arrayOfPyramidLevelIterations = InputMultiPath( + arrayOfPyramidLevelIterations = InputMultiObject( traits.Int, desc="The number of iterations for each pyramid level", sep=",", @@ -356,7 +356,7 @@ class BRAINSDemonWarpInputSpec(CommandLineInputSpec): numberOfMatchPoints = traits.Int( desc="The number of match points for histrogramMatch", argstr="--numberOfMatchPoints %d") - medianFilterSize = InputMultiPath( + medianFilterSize = InputMultiObject( traits.Int, desc= "Median filter radius in all 3 directions. When images have a lot of salt and pepper noise, this step can improve the registration.", @@ -396,12 +396,12 @@ class BRAINSDemonWarpInputSpec(CommandLineInputSpec): backgroundFillValue = traits.Int( desc="Replacement value to overwrite background when performing BOBF", argstr="--backgroundFillValue %d") - seedForBOBF = InputMultiPath( + seedForBOBF = InputMultiObject( traits.Int, desc="coordinates in all 3 directions for Seed when performing BOBF", sep=",", argstr="--seedForBOBF %s") - neighborhoodForBOBF = InputMultiPath( + neighborhoodForBOBF = InputMultiObject( traits.Int, desc= "neighborhood in all 3 directions to be included when performing BOBF", @@ -418,7 +418,7 @@ class BRAINSDemonWarpInputSpec(CommandLineInputSpec): desc= "Genete a checkerboard image volume between the fixedVolume and the deformed movingVolume.", argstr="--outputCheckerboardVolume %s") - checkerboardPatternSubdivisions = InputMultiPath( + checkerboardPatternSubdivisions = InputMultiObject( traits.Int, desc="Number of Checkerboard subdivisions in all 3 directions", sep=",", @@ -506,11 +506,11 @@ class BRAINSDemonWarp(SEMLikeCommandLine): class BRAINSTransformFromFiducialsInputSpec(CommandLineInputSpec): - fixedLandmarks = InputMultiPath( + fixedLandmarks = InputMultiObject( traits.List(traits.Float(), minlen=3, maxlen=3), desc="Ordered list of landmarks in the fixed image", argstr="--fixedLandmarks %s...") - movingLandmarks = InputMultiPath( + movingLandmarks = InputMultiObject( traits.List(traits.Float(), minlen=3, maxlen=3), desc="Ordered list of landmarks in the moving image", argstr="--movingLandmarks %s...") diff --git a/nipype/interfaces/semtools/segmentation/specialized.py b/nipype/interfaces/semtools/segmentation/specialized.py index fa08b8e260..40b261482b 100644 --- a/nipype/interfaces/semtools/segmentation/specialized.py +++ b/nipype/interfaces/semtools/segmentation/specialized.py @@ -7,7 +7,7 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiPath, OutputMultiPath) + InputMultiObject, OutputMultiObject) class BRAINSCutInputSpec(CommandLineInputSpec): @@ -280,7 +280,7 @@ class BRAINSConstellationDetectorInputSpec(CommandLineInputSpec): desc= ", Turn on clipping the rescaled image one-tailed on input. Units of standard deviations above the mean. Very large values are very permissive. Non-positive value turns clipping off. Defaults to removing 0.00001 of a normal tail above the mean., ", argstr="--trimRescaledIntensities %f") - rescaleIntensitiesOutputRange = InputMultiPath( + rescaleIntensitiesOutputRange = InputMultiObject( traits.Int, desc= ", This pair of integers gives the lower and upper bounds on the signal portion of the output image. Out-of-field voxels are taken from BackgroundFillValue., ", @@ -304,25 +304,25 @@ class BRAINSConstellationDetectorInputSpec(CommandLineInputSpec): desc= "Type of interpolation to be used when applying transform to moving volume. Options are Linear, ResampleInPlace, NearestNeighbor, BSpline, or WindowedSinc", argstr="--interpolationMode %s") - forceACPoint = InputMultiPath( + forceACPoint = InputMultiObject( traits.Float, desc= ", Use this flag to manually specify the AC point from the original image on the command line., ", sep=",", argstr="--forceACPoint %s") - forcePCPoint = InputMultiPath( + forcePCPoint = InputMultiObject( traits.Float, desc= ", Use this flag to manually specify the PC point from the original image on the command line., ", sep=",", argstr="--forcePCPoint %s") - forceVN4Point = InputMultiPath( + forceVN4Point = InputMultiObject( traits.Float, desc= ", Use this flag to manually specify the VN4 point from the original image on the command line., ", sep=",", argstr="--forceVN4Point %s") - forceRPPoint = InputMultiPath( + forceRPPoint = InputMultiObject( traits.Float, desc= ", Use this flag to manually specify the RP point from the original image on the command line., ", @@ -480,17 +480,17 @@ class BRAINSConstellationDetector(SEMLikeCommandLine): class BRAINSCreateLabelMapFromProbabilityMapsInputSpec(CommandLineInputSpec): - inputProbabilityVolume = InputMultiPath( + inputProbabilityVolume = InputMultiObject( File(exists=True), desc="The list of proobabilityimages.", argstr="--inputProbabilityVolume %s...") - priorLabelCodes = InputMultiPath( + priorLabelCodes = InputMultiObject( traits.Int, desc= "A list of PriorLabelCode values used for coding the output label images", sep=",", argstr="--priorLabelCodes %s") - foregroundPriors = InputMultiPath( + foregroundPriors = InputMultiObject( traits.Int, desc="A list: For each Prior Label, 1 if foreground, 0 if background", sep=",", @@ -556,25 +556,25 @@ class BinaryMaskEditorBasedOnLandmarksInputSpec(CommandLineInputSpec): " The filename for the landmark definition file in the same format produced by Slicer3 (.fcsv). ", exists=True, argstr="--inputLandmarksFilename %s") - inputLandmarkNames = InputMultiPath( + inputLandmarkNames = InputMultiObject( traits.Str, desc= " A target input landmark name to be edited. This should be listed in the inputLandmakrFilename Given. ", sep=",", argstr="--inputLandmarkNames %s") - setCutDirectionForLandmark = InputMultiPath( + setCutDirectionForLandmark = InputMultiObject( traits.Str, desc= "Setting the cutting out direction of the input binary image to the one of anterior, posterior, left, right, superior or posterior. (ENUMERATION: ANTERIOR, POSTERIOR, LEFT, RIGHT, SUPERIOR, POSTERIOR) ", sep=",", argstr="--setCutDirectionForLandmark %s") - setCutDirectionForObliquePlane = InputMultiPath( + setCutDirectionForObliquePlane = InputMultiObject( traits.Str, desc= "If this is true, the mask will be thresholded out to the direction of inferior, posterior, and/or left. Default behavrior is that cutting out to the direction of superior, anterior and/or right. ", sep=",", argstr="--setCutDirectionForObliquePlane %s") - inputLandmarkNamesForObliquePlane = InputMultiPath( + inputLandmarkNamesForObliquePlane = InputMultiObject( traits.Str, desc= " Three subset landmark names of inputLandmarksFilename for a oblique plane computation. The plane computed for binary volume editing. ", @@ -611,11 +611,11 @@ class BRAINSMultiSTAPLEInputSpec(CommandLineInputSpec): "Composite T1, all label maps transofrmed into the space for this image.", exists=True, argstr="--inputCompositeT1Volume %s") - inputLabelVolume = InputMultiPath( + inputLabelVolume = InputMultiObject( File(exists=True), desc="The list of proobabilityimages.", argstr="--inputLabelVolume %s...") - inputTransform = InputMultiPath( + inputTransform = InputMultiObject( File(exists=True), desc="transforms to apply to label volumes", argstr="--inputTransform %s...") @@ -668,7 +668,7 @@ class BRAINSMultiSTAPLE(SEMLikeCommandLine): class BRAINSABCInputSpec(CommandLineInputSpec): - inputVolumes = InputMultiPath( + inputVolumes = InputMultiObject( File(exists=True), desc="The list of input image files to be segmented.", argstr="--inputVolumes %s...") @@ -687,7 +687,7 @@ class BRAINSABCInputSpec(CommandLineInputSpec): desc= "(optional) Filename to which save the final state of the registration", argstr="--saveState %s") - inputVolumeTypes = InputMultiPath( + inputVolumeTypes = InputMultiObject( traits.Str, desc="The list of input image types corresponding to the inputVolumes.", sep=",", @@ -729,7 +729,7 @@ class BRAINSABCInputSpec(CommandLineInputSpec): argstr="--subjectIntermodeTransformType %s") outputVolumes = traits.Either( traits.Bool, - InputMultiPath(File(), ), + InputMultiObject(File(), ), hash_files=False, desc= "Corrected Output Images: should specify the same number of images as inputVolume, if only one element is given, then it is used as a file pattern where %s is replaced by the imageVolumeType, and %d by the index list location.", @@ -771,7 +771,7 @@ class BRAINSABCInputSpec(CommandLineInputSpec): argstr="--interpolationMode %s") maxIterations = traits.Int( desc="Filter iterations", argstr="--maxIterations %d") - medianFilterSize = InputMultiPath( + medianFilterSize = InputMultiObject( traits.Int, desc= "The radius for the optional MedianImageFilter preprocessing in all 3 directions.", @@ -798,7 +798,7 @@ class BRAINSABCInputSpec(CommandLineInputSpec): desc= "If this threshold value is greater than zero, only pure samples are used to compute the distributions in EM classification, and only pure samples are used for KNN training. The default value is set to 0, that means not using pure plugs. However, a value of 0.2 is suggested if you want to activate using pure plugs option.", argstr="--purePlugsThreshold %f") - numberOfSubSamplesInEachPlugArea = InputMultiPath( + numberOfSubSamplesInEachPlugArea = InputMultiObject( traits.Int, desc= "Number of continous index samples taken at each direction of lattice space for each plug volume.", @@ -807,7 +807,7 @@ class BRAINSABCInputSpec(CommandLineInputSpec): atlasWarpingOff = traits.Bool( desc="Deformable registration of atlas to subject", argstr="--atlasWarpingOff ") - gridSize = InputMultiPath( + gridSize = InputMultiObject( traits.Int, desc="Grid size for atlas warping with BSplines", sep=",", @@ -815,7 +815,7 @@ class BRAINSABCInputSpec(CommandLineInputSpec): defaultSuffix = traits.Str(argstr="--defaultSuffix %s") implicitOutputs = traits.Either( traits.Bool, - InputMultiPath(File(), ), + InputMultiObject(File(), ), hash_files=False, desc= "Outputs to be made available to NiPype. Needed because not all BRAINSABC outputs have command line arguments.", @@ -842,14 +842,14 @@ class BRAINSABCOutputSpec(TraitedSpec): desc="The transform from atlas to the subject", exists=True) atlasToSubjectInitialTransform = File( desc="The initial transform from atlas to the subject", exists=True) - outputVolumes = OutputMultiPath( + outputVolumes = OutputMultiObject( File(exists=True), desc= "Corrected Output Images: should specify the same number of images as inputVolume, if only one element is given, then it is used as a file pattern where %s is replaced by the imageVolumeType, and %d by the index list location." ) outputLabels = File(desc="Output Label Image", exists=True) outputDirtyLabels = File(desc="Output Dirty Label Image", exists=True) - implicitOutputs = OutputMultiPath( + implicitOutputs = OutputMultiObject( File(exists=True), desc= "Outputs to be made available to NiPype. Needed because not all BRAINSABC outputs have command line arguments." diff --git a/nipype/interfaces/semtools/testing/featuredetection.py b/nipype/interfaces/semtools/testing/featuredetection.py index e8f332c0a6..afeb967de9 100644 --- a/nipype/interfaces/semtools/testing/featuredetection.py +++ b/nipype/interfaces/semtools/testing/featuredetection.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os diff --git a/nipype/interfaces/semtools/testing/generateaveragelmkfile.py b/nipype/interfaces/semtools/testing/generateaveragelmkfile.py index bbb414c366..a68ee5c571 100644 --- a/nipype/interfaces/semtools/testing/generateaveragelmkfile.py +++ b/nipype/interfaces/semtools/testing/generateaveragelmkfile.py @@ -3,12 +3,12 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os class GenerateAverageLmkFileInputSpec(CommandLineInputSpec): - inputLandmarkFiles = InputMultiPath( + inputLandmarkFiles = InputMultiObject( traits.Str, desc="Input landmark files names (.fcsv or .wts)", sep=",", diff --git a/nipype/interfaces/semtools/testing/landmarkscompare.py b/nipype/interfaces/semtools/testing/landmarkscompare.py index 872d6d0df0..54fdb9a568 100644 --- a/nipype/interfaces/semtools/testing/landmarkscompare.py +++ b/nipype/interfaces/semtools/testing/landmarkscompare.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os diff --git a/nipype/interfaces/semtools/utilities/brains.py b/nipype/interfaces/semtools/utilities/brains.py index abc696b5d9..231895df18 100644 --- a/nipype/interfaces/semtools/utilities/brains.py +++ b/nipype/interfaces/semtools/utilities/brains.py @@ -7,7 +7,7 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiPath, OutputMultiPath) + InputMultiObject, OutputMultiObject) class BRAINSConstellationModelerInputSpec(CommandLineInputSpec): @@ -53,7 +53,7 @@ class BRAINSConstellationModelerInputSpec(CommandLineInputSpec): desc= ", Turn on clipping the rescaled image one-tailed on input. Units of standard deviations above the mean. Very large values are very permissive. Non-positive value turns clipping off. Defaults to removing 0.00001 of a normal tail above the mean., ", argstr="--trimRescaledIntensities %f") - rescaleIntensitiesOutputRange = InputMultiPath( + rescaleIntensitiesOutputRange = InputMultiObject( traits.Int, desc= ", This pair of integers gives the lower and upper bounds on the signal portion of the output image. Out-of-field voxels are taken from BackgroundFillValue., ", @@ -308,7 +308,7 @@ class BRAINSMushInputSpec(CommandLineInputSpec): hash_files=False, desc="The brain volume mask generated from the MUSH image", argstr="--outputMask %s") - seed = InputMultiPath( + seed = InputMultiObject( traits.Int, desc="Seed Point for Brain Region Filling", sep=",", @@ -332,13 +332,13 @@ class BRAINSMushInputSpec(CommandLineInputSpec): upperThresholdFactor = traits.Float( desc="Upper threshold factor for defining the brain mask", argstr="--upperThresholdFactor %f") - boundingBoxSize = InputMultiPath( + boundingBoxSize = InputMultiObject( traits.Int, desc= "Size of the cubic bounding box mask used when no brain mask is present", sep=",", argstr="--boundingBoxSize %s") - boundingBoxStart = InputMultiPath( + boundingBoxStart = InputMultiObject( traits.Int, desc= "XYZ point-coordinate for the start of the cubic bounding box mask used when no brain mask is present", @@ -566,13 +566,13 @@ class BRAINSInitializedControlPointsInputSpec(CommandLineInputSpec): hash_files=False, desc="Output Volume", argstr="--outputVolume %s") - splineGridSize = InputMultiPath( + splineGridSize = InputMultiObject( traits.Int, desc= "The number of subdivisions of the BSpline Grid to be centered on the image space. Each dimension must have at least 3 subdivisions for the BSpline to be correctly computed. ", sep=",", argstr="--splineGridSize %s") - permuteOrder = InputMultiPath( + permuteOrder = InputMultiObject( traits.Int, desc= "The permutation order for the images. The default is 0,1,2 (i.e. no permutation)", @@ -614,14 +614,14 @@ class BRAINSInitializedControlPoints(SEMLikeCommandLine): class CleanUpOverlapLabelsInputSpec(CommandLineInputSpec): - inputBinaryVolumes = InputMultiPath( + inputBinaryVolumes = InputMultiObject( File(exists=True), desc= "The list of binary images to be checked and cleaned up. Order is important. Binary volume given first always wins out. ", argstr="--inputBinaryVolumes %s...") outputBinaryVolumes = traits.Either( traits.Bool, - InputMultiPath(File(), ), + InputMultiObject(File(), ), hash_files=False, desc= "The output label map images, with integer values in it. Each label value specified in the inputLabels is combined into this output label map volume", @@ -629,7 +629,7 @@ class CleanUpOverlapLabelsInputSpec(CommandLineInputSpec): class CleanUpOverlapLabelsOutputSpec(TraitedSpec): - outputBinaryVolumes = OutputMultiPath( + outputBinaryVolumes = OutputMultiObject( File(exists=True), desc= "The output label map images, with integer values in it. Each label value specified in the inputLabels is combined into this output label map volume" @@ -707,7 +707,7 @@ class BRAINSClipInferior(SEMLikeCommandLine): class GenerateLabelMapFromProbabilityMapInputSpec(CommandLineInputSpec): - inputVolumes = InputMultiPath( + inputVolumes = InputMultiObject( File(exists=True), desc="The Input probaiblity images to be computed for lable maps", argstr="--inputVolumes %s...") @@ -782,7 +782,7 @@ class BRAINSAlignMSPInputSpec(CommandLineInputSpec): desc= ", Turn on clipping the rescaled image one-tailed on input. Units of standard deviations above the mean. Very large values are very permissive. Non-positive value turns clipping off. Defaults to removing 0.00001 of a normal tail above the mean., ", argstr="--trimRescaledIntensities %f") - rescaleIntensitiesOutputRange = InputMultiPath( + rescaleIntensitiesOutputRange = InputMultiObject( traits.Int, desc= ", This pair of integers gives the lower and upper bounds on the signal portion of the output image. Out-of-field voxels are taken from BackgroundFillValue., ", @@ -924,35 +924,35 @@ class insertMidACPCpoint(SEMLikeCommandLine): class BRAINSSnapShotWriterInputSpec(CommandLineInputSpec): - inputVolumes = InputMultiPath( + inputVolumes = InputMultiObject( File(exists=True), desc= "Input image volume list to be extracted as 2D image. Multiple input is possible. At least one input is required.", argstr="--inputVolumes %s...") - inputBinaryVolumes = InputMultiPath( + inputBinaryVolumes = InputMultiObject( File(exists=True), desc= "Input mask (binary) volume list to be extracted as 2D image. Multiple input is possible.", argstr="--inputBinaryVolumes %s...") - inputSliceToExtractInPhysicalPoint = InputMultiPath( + inputSliceToExtractInPhysicalPoint = InputMultiObject( traits.Float, desc= "2D slice number of input images. For autoWorkUp output, which AC-PC aligned, 0,0,0 will be the center.", sep=",", argstr="--inputSliceToExtractInPhysicalPoint %s") - inputSliceToExtractInIndex = InputMultiPath( + inputSliceToExtractInIndex = InputMultiObject( traits.Int, desc= "2D slice number of input images. For size of 256*256*256 image, 128 is usually used.", sep=",", argstr="--inputSliceToExtractInIndex %s") - inputSliceToExtractInPercent = InputMultiPath( + inputSliceToExtractInPercent = InputMultiObject( traits.Int, desc= "2D slice number of input images. Percentage input from 0%-100%. (ex. --inputSliceToExtractInPercent 50,50,50", sep=",", argstr="--inputSliceToExtractInPercent %s") - inputPlaneDirection = InputMultiPath( + inputPlaneDirection = InputMultiObject( traits.Int, desc= "Plane to display. In general, 0=saggital, 1=coronal, and 2=axial plane.", diff --git a/nipype/interfaces/slicer/converters.py b/nipype/interfaces/slicer/converters.py index e93b994110..c779498ac9 100644 --- a/nipype/interfaces/slicer/converters.py +++ b/nipype/interfaces/slicer/converters.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os diff --git a/nipype/interfaces/slicer/diffusion/diffusion.py b/nipype/interfaces/slicer/diffusion/diffusion.py index a088d25f8a..ebabe6c802 100644 --- a/nipype/interfaces/slicer/diffusion/diffusion.py +++ b/nipype/interfaces/slicer/diffusion/diffusion.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os @@ -87,19 +87,19 @@ class ResampleDTIVolumeInputSpec(CommandLineInputSpec): desc= "Inverse the transformation before applying it from output image to input image (only for rigid and affine transforms)", argstr="--Inverse_ITK_Transformation ") - spacing = InputMultiPath( + spacing = InputMultiObject( traits.Float, desc="Spacing along each dimension (0 means use input spacing)", sep=",", argstr="--spacing %s") - size = InputMultiPath( + size = InputMultiObject( traits.Float, desc="Size along each dimension (0 means use input size)", sep=",", argstr="--size %s") origin = traits.List( desc="Origin of the output Image", argstr="--origin %s") - direction_matrix = InputMultiPath( + direction_matrix = InputMultiObject( traits.Float, desc= "9 parameters of the direction matrix by rows (ijk to LPS if LPS transform, ijk to RAS if RAS transform)", @@ -124,7 +124,7 @@ class ResampleDTIVolumeInputSpec(CommandLineInputSpec): spline_order = traits.Int( desc="Spline Order (Spline order may be from 0 to 5)", argstr="--spline_order %d") - transform_matrix = InputMultiPath( + transform_matrix = InputMultiObject( traits.Float, desc= "12 parameters of the transform matrix by rows ( --last 3 being translation-- )", @@ -168,9 +168,9 @@ class DWIRicianLMMSEFilterInputSpec(CommandLineInputSpec): iter = traits.Int( desc="Number of iterations for the noise removal filter.", argstr="--iter %d") - re = InputMultiPath( + re = InputMultiObject( traits.Int, desc="Estimation radius.", sep=",", argstr="--re %s") - rf = InputMultiPath( + rf = InputMultiObject( traits.Int, desc="Filtering radius.", sep=",", argstr="--rf %s") mnvf = traits.Int( desc="Minimum number of voxels in kernel used for filtering.", @@ -327,9 +327,9 @@ class TractographyLabelMapSeeding(SEMLikeCommandLine): class DWIJointRicianLMMSEFilterInputSpec(CommandLineInputSpec): - re = InputMultiPath( + re = InputMultiObject( traits.Int, desc="Estimation radius.", sep=",", argstr="--re %s") - rf = InputMultiPath( + rf = InputMultiObject( traits.Int, desc="Filtering radius.", sep=",", argstr="--rf %s") ng = traits.Int( desc= diff --git a/nipype/interfaces/slicer/filtering/arithmetic.py b/nipype/interfaces/slicer/filtering/arithmetic.py index 22785e32e1..9b79bd017c 100644 --- a/nipype/interfaces/slicer/filtering/arithmetic.py +++ b/nipype/interfaces/slicer/filtering/arithmetic.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os diff --git a/nipype/interfaces/slicer/filtering/checkerboardfilter.py b/nipype/interfaces/slicer/filtering/checkerboardfilter.py index e4ad85dc5e..3b3668639a 100644 --- a/nipype/interfaces/slicer/filtering/checkerboardfilter.py +++ b/nipype/interfaces/slicer/filtering/checkerboardfilter.py @@ -3,12 +3,12 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os class CheckerBoardFilterInputSpec(CommandLineInputSpec): - checkerPattern = InputMultiPath( + checkerPattern = InputMultiObject( traits.Int, desc= "The pattern of input 1 and input 2 in the output image. The user can specify the number of checkers in each dimension. A checkerPattern of 2,2,1 means that images will alternate in every other checker in the first two dimensions. The same pattern will be used in the 3rd dimension.", diff --git a/nipype/interfaces/slicer/filtering/denoising.py b/nipype/interfaces/slicer/filtering/denoising.py index 0dbaaebf74..125ffb38d1 100644 --- a/nipype/interfaces/slicer/filtering/denoising.py +++ b/nipype/interfaces/slicer/filtering/denoising.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os @@ -164,7 +164,7 @@ class GaussianBlurImageFilter(SEMLikeCommandLine): class MedianImageFilterInputSpec(CommandLineInputSpec): - neighborhood = InputMultiPath( + neighborhood = InputMultiObject( traits.Int, desc="The size of the neighborhood in each dimension", sep=",", diff --git a/nipype/interfaces/slicer/filtering/extractskeleton.py b/nipype/interfaces/slicer/filtering/extractskeleton.py index d7770c8f2e..8a1d92dd57 100644 --- a/nipype/interfaces/slicer/filtering/extractskeleton.py +++ b/nipype/interfaces/slicer/filtering/extractskeleton.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os diff --git a/nipype/interfaces/slicer/filtering/histogrammatching.py b/nipype/interfaces/slicer/filtering/histogrammatching.py index 1b3b26b061..f8c211d598 100644 --- a/nipype/interfaces/slicer/filtering/histogrammatching.py +++ b/nipype/interfaces/slicer/filtering/histogrammatching.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os diff --git a/nipype/interfaces/slicer/filtering/imagelabelcombine.py b/nipype/interfaces/slicer/filtering/imagelabelcombine.py index 067a575045..b0fd8d8e41 100644 --- a/nipype/interfaces/slicer/filtering/imagelabelcombine.py +++ b/nipype/interfaces/slicer/filtering/imagelabelcombine.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os diff --git a/nipype/interfaces/slicer/filtering/morphology.py b/nipype/interfaces/slicer/filtering/morphology.py index 913c63d5ab..d9c12708c8 100644 --- a/nipype/interfaces/slicer/filtering/morphology.py +++ b/nipype/interfaces/slicer/filtering/morphology.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os diff --git a/nipype/interfaces/slicer/filtering/n4itkbiasfieldcorrection.py b/nipype/interfaces/slicer/filtering/n4itkbiasfieldcorrection.py index 28f694f77e..b985545fe1 100644 --- a/nipype/interfaces/slicer/filtering/n4itkbiasfieldcorrection.py +++ b/nipype/interfaces/slicer/filtering/n4itkbiasfieldcorrection.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os @@ -29,7 +29,7 @@ class N4ITKBiasFieldCorrectionInputSpec(CommandLineInputSpec): hash_files=False, desc="Recovered bias field (OPTIONAL)", argstr="--outputbiasfield %s") - iterations = InputMultiPath( + iterations = InputMultiObject( traits.Int, desc= "Maximum number of iterations at each level of resolution. Larger values will increase execution time, but may lead to better results.", @@ -39,7 +39,7 @@ class N4ITKBiasFieldCorrectionInputSpec(CommandLineInputSpec): desc= "Stopping criterion for the iterative bias estimation. Larger values will lead to smaller execution time.", argstr="--convergencethreshold %f") - meshresolution = InputMultiPath( + meshresolution = InputMultiObject( traits.Float, desc= "Resolution of the initial bspline grid defined as a sequence of three numbers. The actual resolution will be defined by adding the bspline order (default is 3) to the resolution in each dimension specified here. For example, 1,1,1 will result in a 4x4x4 grid of control points. This parameter may need to be adjusted based on your input image. In the multi-resolution N4 framework, the resolution of the bspline grid at subsequent iterations will be doubled. The number of resolutions is implicitly defined by Number of iterations parameter (the size of this list is the number of resolutions)", @@ -59,7 +59,7 @@ class N4ITKBiasFieldCorrectionInputSpec(CommandLineInputSpec): argstr="--bsplineorder %d") weightimage = File( desc="Weight Image", exists=True, argstr="--weightimage %s") - histogramsharpening = InputMultiPath( + histogramsharpening = InputMultiObject( traits.Float, desc= "A vector of up to three values. Non-zero values correspond to Bias Field Full Width at Half Maximum, Wiener filter noise, and Number of histogram bins.", diff --git a/nipype/interfaces/slicer/filtering/resamplescalarvectordwivolume.py b/nipype/interfaces/slicer/filtering/resamplescalarvectordwivolume.py index 6205b76b54..618014dd47 100644 --- a/nipype/interfaces/slicer/filtering/resamplescalarvectordwivolume.py +++ b/nipype/interfaces/slicer/filtering/resamplescalarvectordwivolume.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os @@ -74,19 +74,19 @@ class ResampleScalarVectorDWIVolumeInputSpec(CommandLineInputSpec): desc= "Inverse the transformation before applying it from output image to input image", argstr="--Inverse_ITK_Transformation ") - spacing = InputMultiPath( + spacing = InputMultiObject( traits.Float, desc="Spacing along each dimension (0 means use input spacing)", sep=",", argstr="--spacing %s") - size = InputMultiPath( + size = InputMultiObject( traits.Float, desc="Size along each dimension (0 means use input size)", sep=",", argstr="--size %s") origin = traits.List( desc="Origin of the output Image", argstr="--origin %s") - direction_matrix = InputMultiPath( + direction_matrix = InputMultiObject( traits.Float, desc= "9 parameters of the direction matrix by rows (ijk to LPS if LPS transform, ijk to RAS if RAS transform)", @@ -109,7 +109,7 @@ class ResampleScalarVectorDWIVolumeInputSpec(CommandLineInputSpec): "Window Function , h = Hamming , c = Cosine , w = Welch , l = Lanczos , b = Blackman", argstr="--window_function %s") spline_order = traits.Int(desc="Spline Order", argstr="--spline_order %d") - transform_matrix = InputMultiPath( + transform_matrix = InputMultiObject( traits.Float, desc= "12 parameters of the transform matrix by rows ( --last 3 being translation-- )", diff --git a/nipype/interfaces/slicer/filtering/thresholdscalarvolume.py b/nipype/interfaces/slicer/filtering/thresholdscalarvolume.py index 041ce10990..f1ec4ba05f 100644 --- a/nipype/interfaces/slicer/filtering/thresholdscalarvolume.py +++ b/nipype/interfaces/slicer/filtering/thresholdscalarvolume.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os diff --git a/nipype/interfaces/slicer/filtering/votingbinaryholefillingimagefilter.py b/nipype/interfaces/slicer/filtering/votingbinaryholefillingimagefilter.py index 9c19799d04..48b56ebeaa 100644 --- a/nipype/interfaces/slicer/filtering/votingbinaryholefillingimagefilter.py +++ b/nipype/interfaces/slicer/filtering/votingbinaryholefillingimagefilter.py @@ -3,12 +3,12 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os class VotingBinaryHoleFillingImageFilterInputSpec(CommandLineInputSpec): - radius = InputMultiPath( + radius = InputMultiObject( traits.Int, desc="The radius of a hole to be filled", sep=",", diff --git a/nipype/interfaces/slicer/generate_classes.py b/nipype/interfaces/slicer/generate_classes.py index 6fe3ae927f..77b1781264 100644 --- a/nipype/interfaces/slicer/generate_classes.py +++ b/nipype/interfaces/slicer/generate_classes.py @@ -42,7 +42,7 @@ def add_class_to_package(class_codes, class_names, module_name, package_dir): imports = """from __future__ import (print_function, division, unicode_literals, absolute_import) from ..base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, - File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath) + File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject) import os\n\n\n""" f_m.write(imports) f_m.write("\n\n".join(class_codes)) @@ -266,7 +266,7 @@ def generate_class(module, for el in param.getElementsByTagName('element') ] elif param.nodeName.endswith('-vector'): - type = "InputMultiPath" + type = "InputMultiObject" if param.nodeName in [ 'file', 'directory', 'image', 'geometry', 'transform', 'table' @@ -282,7 +282,7 @@ def generate_class(module, else: traitsParams["sep"] = ',' elif param.getAttribute('multiple') == "true": - type = "InputMultiPath" + type = "InputMultiObject" if param.nodeName in [ 'file', 'directory', 'image', 'geometry', 'transform', 'table' @@ -331,7 +331,7 @@ def generate_class(module, if param.nodeName in [ 'file', 'directory', 'image', 'geometry', 'transform', 'table' - ] and type not in ["InputMultiPath", "traits.List"]: + ] and type not in ["InputMultiObject", "traits.List"]: traitsParams["exists"] = True inputTraits.append("%s = %s(%s%s)" % (name, type, parse_values(values), diff --git a/nipype/interfaces/slicer/legacy/converters.py b/nipype/interfaces/slicer/legacy/converters.py index f5af1ad29b..6d59b0c6e8 100644 --- a/nipype/interfaces/slicer/legacy/converters.py +++ b/nipype/interfaces/slicer/legacy/converters.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os diff --git a/nipype/interfaces/slicer/legacy/diffusion/denoising.py b/nipype/interfaces/slicer/legacy/diffusion/denoising.py index 0cc8cce0f6..81891b9470 100644 --- a/nipype/interfaces/slicer/legacy/diffusion/denoising.py +++ b/nipype/interfaces/slicer/legacy/diffusion/denoising.py @@ -3,18 +3,18 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os class DWIUnbiasedNonLocalMeansFilterInputSpec(CommandLineInputSpec): - rs = InputMultiPath( + rs = InputMultiObject( traits.Int, desc= "The algorithm search for similar voxels in a neighborhood of this size (larger sizes than the default one are extremely slow).", sep=",", argstr="--rs %s") - rc = InputMultiPath( + rc = InputMultiObject( traits.Int, desc= "Similarity between blocks is measured using windows of this size.", @@ -28,7 +28,7 @@ class DWIUnbiasedNonLocalMeansFilterInputSpec(CommandLineInputSpec): desc= "The number of the closest gradients that are used to jointly filter a given gradient direction (a maximum of 5 is allowed).", argstr="--ng %d") - re = InputMultiPath( + re = InputMultiObject( traits.Int, desc= "A neighborhood of this size is used to compute the statistics for noise estimation.", diff --git a/nipype/interfaces/slicer/legacy/filtering.py b/nipype/interfaces/slicer/legacy/filtering.py index aaed2350e0..6aee218776 100644 --- a/nipype/interfaces/slicer/legacy/filtering.py +++ b/nipype/interfaces/slicer/legacy/filtering.py @@ -2,7 +2,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os @@ -65,7 +65,7 @@ class OtsuThresholdImageFilter(SEMLikeCommandLine): class ResampleScalarVolumeInputSpec(CommandLineInputSpec): - spacing = InputMultiPath( + spacing = InputMultiObject( traits.Float, desc="Spacing along each dimension (0 means use input spacing)", sep=",", diff --git a/nipype/interfaces/slicer/legacy/registration.py b/nipype/interfaces/slicer/legacy/registration.py index 7f73d85d82..21210d5177 100644 --- a/nipype/interfaces/slicer/legacy/registration.py +++ b/nipype/interfaces/slicer/legacy/registration.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os @@ -305,13 +305,13 @@ class RigidRegistrationInputSpec(CommandLineInputSpec): desc= "Number of spatial samples to use in estimating Mattes Mutual Information. Larger values yield more accurate PDFs and improved registration quality.", argstr="--spatialsamples %d") - iterations = InputMultiPath( + iterations = InputMultiObject( traits.Int, desc= "Comma separated list of iterations. Must have the same number of elements as the learning rate.", sep=",", argstr="--iterations %s") - learningrate = InputMultiPath( + learningrate = InputMultiObject( traits.Float, desc= "Comma separated list of learning rates. Learning rate is a scale factor on the gradient of the registration objective function (gradient with respect to the parameters of the transformation) used to update the parameters of the transformation during optimization. Smaller values cause the optimizer to take smaller steps through the parameter space. Larger values are typically used early in the registration process to take large jumps in parameter space followed by smaller values to home in on the optimum value of the registration objective function. Default is: 0.01, 0.005, 0.0005, 0.0002. Must have the same number of elements as iterations.", @@ -413,13 +413,13 @@ class LinearRegistrationInputSpec(CommandLineInputSpec): desc= "Number of spatial samples to use in estimating Mattes Mutual Information. Larger values yield more accurate PDFs and improved registration quality.", argstr="--spatialsamples %d") - iterations = InputMultiPath( + iterations = InputMultiObject( traits.Int, desc= "Comma separated list of iterations. Must have the same number of elements as the learning rate.", sep=",", argstr="--iterations %s") - learningrate = InputMultiPath( + learningrate = InputMultiObject( traits.Float, desc= "Comma separated list of learning rates. Learning rate is a scale factor on the gradient of the registration objective function (gradient with respect to the parameters of the transformation) used to update the parameters of the transformation during optimization. Smaller values cause the optimizer to take smaller steps through the parameter space. Larger values are typically used early in the registration process to take large jumps in parameter space followed by smaller values to home in on the optimum value of the registration objective function. Default is: 0.01, 0.005, 0.0005, 0.0002. Must have the same number of elements as iterations.", @@ -589,11 +589,11 @@ class ExpertAutomatedRegistrationInputSpec(CommandLineInputSpec): "BSpline", desc="Method for interpolation within the optimization process", argstr="--interpolation %s") - fixedLandmarks = InputMultiPath( + fixedLandmarks = InputMultiObject( traits.List(traits.Float(), minlen=3, maxlen=3), desc="Ordered list of landmarks in the fixed image", argstr="--fixedLandmarks %s...") - movingLandmarks = InputMultiPath( + movingLandmarks = InputMultiObject( traits.List(traits.Float(), minlen=3, maxlen=3), desc="Ordered list of landmarks in the moving image", argstr="--movingLandmarks %s...") diff --git a/nipype/interfaces/slicer/legacy/segmentation.py b/nipype/interfaces/slicer/legacy/segmentation.py index 3500d50d50..00d2bffb42 100644 --- a/nipype/interfaces/slicer/legacy/segmentation.py +++ b/nipype/interfaces/slicer/legacy/segmentation.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os diff --git a/nipype/interfaces/slicer/quantification/changequantification.py b/nipype/interfaces/slicer/quantification/changequantification.py index 5abf1b1287..d1ab5e3e94 100644 --- a/nipype/interfaces/slicer/quantification/changequantification.py +++ b/nipype/interfaces/slicer/quantification/changequantification.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os diff --git a/nipype/interfaces/slicer/quantification/petstandarduptakevaluecomputation.py b/nipype/interfaces/slicer/quantification/petstandarduptakevaluecomputation.py index 0edfca3fbb..4dda7f24c6 100644 --- a/nipype/interfaces/slicer/quantification/petstandarduptakevaluecomputation.py +++ b/nipype/interfaces/slicer/quantification/petstandarduptakevaluecomputation.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os diff --git a/nipype/interfaces/slicer/registration/brainsfit.py b/nipype/interfaces/slicer/registration/brainsfit.py index adbd733976..739ee0f41b 100644 --- a/nipype/interfaces/slicer/registration/brainsfit.py +++ b/nipype/interfaces/slicer/registration/brainsfit.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os @@ -77,13 +77,13 @@ class BRAINSFitInputSpec(CommandLineInputSpec): desc= "The number of voxels sampled for mutual information computation. Increase this for a slower, more careful fit. You can also limit the sampling focus with ROI masks and ROIAUTO mask generation.", argstr="--numberOfSamples %d") - splineGridSize = InputMultiPath( + splineGridSize = InputMultiObject( traits.Int, desc= "The number of subdivisions of the BSpline Grid to be centered on the image space. Each dimension must have at least 3 subdivisions for the BSpline to be correctly computed. ", sep=",", argstr="--splineGridSize %s") - numberOfIterations = InputMultiPath( + numberOfIterations = InputMultiObject( traits.Int, desc= "The maximum number of iterations to try before failing to converge. Use an explicit limit like 500 or 1000 to manage risk of divergence", @@ -153,7 +153,7 @@ class BRAINSFitInputSpec(CommandLineInputSpec): desc= "Type of interpolation to be used when applying transform to moving volume. Options are Linear, NearestNeighbor, BSpline, WindowedSinc, or ResampleInPlace. The ResampleInPlace option will create an image with the same discrete voxel values and will adjust the origin and direction of the physical space interpretation.", argstr="--interpolationMode %s") - minimumStepLength = InputMultiPath( + minimumStepLength = InputMultiObject( traits.Float, desc= "Each step in the optimization takes steps at least this big. When none are possible, registration is complete.", @@ -191,7 +191,7 @@ class BRAINSFitInputSpec(CommandLineInputSpec): desc= "File name for the rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE: This value is overwritten if either bsplineTransform or linearTransform is set.", argstr="--strippedOutputTransform %s") - transformType = InputMultiPath( + transformType = InputMultiObject( traits.Str, desc= "Specifies a list of registration types to be used. The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, and BSpline. Specifiying more than one in a comma separated list will initialize the next stage with the previous results. If registrationClass flag is used, it overrides this parameter setting.", @@ -212,7 +212,7 @@ class BRAINSFitInputSpec(CommandLineInputSpec): desc= "The index in the time series for the 3D moving image to fit, if 4-dimensional.", argstr="--movingVolumeTimeIndex %d") - medianFilterSize = InputMultiPath( + medianFilterSize = InputMultiObject( traits.Int, desc= "The radius for the optional MedianImageFilter preprocessing in all 3 directions.", @@ -296,7 +296,7 @@ class BRAINSFitInputSpec(CommandLineInputSpec): NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_02 = traits.Bool( desc="DO NOT USE THIS FLAG", argstr="--NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_02 ") - permitParameterVariation = InputMultiPath( + permitParameterVariation = InputMultiObject( traits.Int, desc= "A bit vector to permit linear transform parameters to vary under optimization. The vector order corresponds with transform parameters, and beyond the end ones fill in as a default. For instance, you can choose to rotate only in x (pitch) with 1,0,0; this is mostly for expert use in turning on and off individual degrees of freedom in rotation, translation or scaling without multiplying the number of transform representations; this trick is probably meaningless when tried with the general affine transform.", diff --git a/nipype/interfaces/slicer/registration/brainsresample.py b/nipype/interfaces/slicer/registration/brainsresample.py index a3b79681fd..f1a8b559fc 100644 --- a/nipype/interfaces/slicer/registration/brainsresample.py +++ b/nipype/interfaces/slicer/registration/brainsresample.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os @@ -61,7 +61,7 @@ class BRAINSResampleInputSpec(CommandLineInputSpec): argstr="--inverseTransform ") defaultValue = traits.Float( desc="Default voxel value", argstr="--defaultValue %f") - gridSpacing = InputMultiPath( + gridSpacing = InputMultiObject( traits.Int, desc= "Add warped grid to output image to help show the deformation that occured with specified spacing. A spacing of 0 in a dimension indicates that grid lines should be rendered to fall exactly (i.e. do not allow displacements off that plane). This is useful for makeing a 2D image of grid lines from the 3D space ", diff --git a/nipype/interfaces/slicer/registration/specialized.py b/nipype/interfaces/slicer/registration/specialized.py index 9c6c3f5f20..be72a3a4f1 100644 --- a/nipype/interfaces/slicer/registration/specialized.py +++ b/nipype/interfaces/slicer/registration/specialized.py @@ -3,17 +3,17 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os class ACPCTransformInputSpec(CommandLineInputSpec): - acpc = InputMultiPath( + acpc = InputMultiObject( traits.List(traits.Float(), minlen=3, maxlen=3), desc= "ACPC line, two fiducial points, one at the anterior commissure and one at the posterior commissure.", argstr="--acpc %s...") - midline = InputMultiPath( + midline = InputMultiObject( traits.List(traits.Float(), minlen=3, maxlen=3), desc= "The midline is a series of points defining the division between the hemispheres of the brain (the mid sagittal plane).", @@ -62,11 +62,11 @@ class ACPCTransform(SEMLikeCommandLine): class FiducialRegistrationInputSpec(CommandLineInputSpec): - fixedLandmarks = InputMultiPath( + fixedLandmarks = InputMultiObject( traits.List(traits.Float(), minlen=3, maxlen=3), desc="Ordered list of landmarks in the fixed image", argstr="--fixedLandmarks %s...") - movingLandmarks = InputMultiPath( + movingLandmarks = InputMultiObject( traits.List(traits.Float(), minlen=3, maxlen=3), desc="Ordered list of landmarks in the moving image", argstr="--movingLandmarks %s...") @@ -117,11 +117,11 @@ class FiducialRegistration(SEMLikeCommandLine): class VBRAINSDemonWarpInputSpec(CommandLineInputSpec): - movingVolume = InputMultiPath( + movingVolume = InputMultiObject( File(exists=True), desc="Required: input moving image", argstr="--movingVolume %s...") - fixedVolume = InputMultiPath( + fixedVolume = InputMultiObject( File(exists=True), desc="Required: input fixed (target) image", argstr="--fixedVolume %s...") @@ -188,19 +188,19 @@ class VBRAINSDemonWarpInputSpec(CommandLineInputSpec): desc= "Number of image pyramid levels to use in the multi-resolution registration.", argstr="--numberOfPyramidLevels %d") - minimumFixedPyramid = InputMultiPath( + minimumFixedPyramid = InputMultiObject( traits.Int, desc= "The shrink factor for the first level of the fixed image pyramid. (i.e. start at 1/16 scale, then 1/8, then 1/4, then 1/2, and finally full scale)", sep=",", argstr="--minimumFixedPyramid %s") - minimumMovingPyramid = InputMultiPath( + minimumMovingPyramid = InputMultiObject( traits.Int, desc= "The shrink factor for the first level of the moving image pyramid. (i.e. start at 1/16 scale, then 1/8, then 1/4, then 1/2, and finally full scale)", sep=",", argstr="--minimumMovingPyramid %s") - arrayOfPyramidLevelIterations = InputMultiPath( + arrayOfPyramidLevelIterations = InputMultiObject( traits.Int, desc="The number of iterations for each pyramid level", sep=",", @@ -215,7 +215,7 @@ class VBRAINSDemonWarpInputSpec(CommandLineInputSpec): numberOfMatchPoints = traits.Int( desc="The number of match points for histrogramMatch", argstr="--numberOfMatchPoints %d") - medianFilterSize = InputMultiPath( + medianFilterSize = InputMultiObject( traits.Int, desc= "Median filter radius in all 3 directions. When images have a lot of salt and pepper noise, this step can improve the registration.", @@ -251,12 +251,12 @@ class VBRAINSDemonWarpInputSpec(CommandLineInputSpec): backgroundFillValue = traits.Int( desc="Replacement value to overwrite background when performing BOBF", argstr="--backgroundFillValue %d") - seedForBOBF = InputMultiPath( + seedForBOBF = InputMultiObject( traits.Int, desc="coordinates in all 3 directions for Seed when performing BOBF", sep=",", argstr="--seedForBOBF %s") - neighborhoodForBOBF = InputMultiPath( + neighborhoodForBOBF = InputMultiObject( traits.Int, desc= "neighborhood in all 3 directions to be included when performing BOBF", @@ -273,7 +273,7 @@ class VBRAINSDemonWarpInputSpec(CommandLineInputSpec): desc= "Genete a checkerboard image volume between the fixedVolume and the deformed movingVolume.", argstr="--outputCheckerboardVolume %s") - checkerboardPatternSubdivisions = InputMultiPath( + checkerboardPatternSubdivisions = InputMultiObject( traits.Int, desc="Number of Checkerboard subdivisions in all 3 directions", sep=",", @@ -285,7 +285,7 @@ class VBRAINSDemonWarpInputSpec(CommandLineInputSpec): outputDebug = traits.Bool( desc="Flag to write debugging images after each step.", argstr="--outputDebug ") - weightFactors = InputMultiPath( + weightFactors = InputMultiObject( traits.Float, desc="Weight fatctors for each input images", sep=",", @@ -437,19 +437,19 @@ class BRAINSDemonWarpInputSpec(CommandLineInputSpec): desc= "Number of image pyramid levels to use in the multi-resolution registration.", argstr="--numberOfPyramidLevels %d") - minimumFixedPyramid = InputMultiPath( + minimumFixedPyramid = InputMultiObject( traits.Int, desc= "The shrink factor for the first level of the fixed image pyramid. (i.e. start at 1/16 scale, then 1/8, then 1/4, then 1/2, and finally full scale)", sep=",", argstr="--minimumFixedPyramid %s") - minimumMovingPyramid = InputMultiPath( + minimumMovingPyramid = InputMultiObject( traits.Int, desc= "The shrink factor for the first level of the moving image pyramid. (i.e. start at 1/16 scale, then 1/8, then 1/4, then 1/2, and finally full scale)", sep=",", argstr="--minimumMovingPyramid %s") - arrayOfPyramidLevelIterations = InputMultiPath( + arrayOfPyramidLevelIterations = InputMultiObject( traits.Int, desc="The number of iterations for each pyramid level", sep=",", @@ -464,7 +464,7 @@ class BRAINSDemonWarpInputSpec(CommandLineInputSpec): numberOfMatchPoints = traits.Int( desc="The number of match points for histrogramMatch", argstr="--numberOfMatchPoints %d") - medianFilterSize = InputMultiPath( + medianFilterSize = InputMultiObject( traits.Int, desc= "Median filter radius in all 3 directions. When images have a lot of salt and pepper noise, this step can improve the registration.", @@ -504,12 +504,12 @@ class BRAINSDemonWarpInputSpec(CommandLineInputSpec): backgroundFillValue = traits.Int( desc="Replacement value to overwrite background when performing BOBF", argstr="--backgroundFillValue %d") - seedForBOBF = InputMultiPath( + seedForBOBF = InputMultiObject( traits.Int, desc="coordinates in all 3 directions for Seed when performing BOBF", sep=",", argstr="--seedForBOBF %s") - neighborhoodForBOBF = InputMultiPath( + neighborhoodForBOBF = InputMultiObject( traits.Int, desc= "neighborhood in all 3 directions to be included when performing BOBF", @@ -526,7 +526,7 @@ class BRAINSDemonWarpInputSpec(CommandLineInputSpec): desc= "Genete a checkerboard image volume between the fixedVolume and the deformed movingVolume.", argstr="--outputCheckerboardVolume %s") - checkerboardPatternSubdivisions = InputMultiPath( + checkerboardPatternSubdivisions = InputMultiObject( traits.Int, desc="Number of Checkerboard subdivisions in all 3 directions", sep=",", diff --git a/nipype/interfaces/slicer/segmentation/simpleregiongrowingsegmentation.py b/nipype/interfaces/slicer/segmentation/simpleregiongrowingsegmentation.py index d466ccc1ac..dba833edae 100644 --- a/nipype/interfaces/slicer/segmentation/simpleregiongrowingsegmentation.py +++ b/nipype/interfaces/slicer/segmentation/simpleregiongrowingsegmentation.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os @@ -27,7 +27,7 @@ class SimpleRegionGrowingSegmentationInputSpec(CommandLineInputSpec): desc= "The integer value (0-255) to use for the segmentation results. This will determine the color of the segmentation that will be generated by the Region growing algorithm", argstr="--labelvalue %d") - seed = InputMultiPath( + seed = InputMultiObject( traits.List(traits.Float(), minlen=3, maxlen=3), desc="Seed point(s) for region growing", argstr="--seed %s...") diff --git a/nipype/interfaces/slicer/segmentation/specialized.py b/nipype/interfaces/slicer/segmentation/specialized.py index fdfeb74e37..0f467b8976 100644 --- a/nipype/interfaces/slicer/segmentation/specialized.py +++ b/nipype/interfaces/slicer/segmentation/specialized.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os @@ -85,7 +85,7 @@ class EMSegmentCommandLineInputSpec(CommandLineInputSpec): desc= "The file name that the segmentation result volume will be written to.", argstr="--resultVolumeFileName %s") - targetVolumeFileNames = InputMultiPath( + targetVolumeFileNames = InputMultiObject( File(exists=True), desc= "File names of target volumes (to be segmented). The number of target images must be equal to the number of target images specified in the parameter set, and these images must be spatially aligned.", @@ -146,7 +146,7 @@ class EMSegmentCommandLineInputSpec(CommandLineInputSpec): disableCompression = traits.Bool( desc="Don't use compression when writing result image to disk.", argstr="--disableCompression ") - atlasVolumeFileNames = InputMultiPath( + atlasVolumeFileNames = InputMultiObject( File(exists=True), desc= "Use an alternative atlas to the one that is specified by the mrml file - note the order matters ! ", diff --git a/nipype/interfaces/slicer/surface.py b/nipype/interfaces/slicer/surface.py index 6a1dfe2cc0..d5b0713c14 100644 --- a/nipype/interfaces/slicer/surface.py +++ b/nipype/interfaces/slicer/surface.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os @@ -263,7 +263,7 @@ class ModelMakerInputSpec(CommandLineInputSpec): argstr="--color %s") modelSceneFile = traits.Either( traits.Bool, - InputMultiPath(File(), ), + InputMultiObject(File(), ), hash_files=False, desc= "Generated models, under a model hierarchy node. Models are imported into Slicer under a model hierarchy node, and their colors are set by the color table associated with the input label map volume. The model hierarchy node must be created before running the model maker, by selecting Create New ModelHierarchy from the Models drop down menu. If you're running from the command line, a model hierarchy node in a new mrml scene will be created for you.", @@ -276,7 +276,7 @@ class ModelMakerInputSpec(CommandLineInputSpec): desc= "Generate models for all labels in the input volume. select this option if you want to create all models that correspond to all values in a labelmap volume (using the Joint Smoothing option below is useful with this option). Ignores Labels, Start Label, End Label settings. Skips label 0.", argstr="--generateAll ") - labels = InputMultiPath( + labels = InputMultiObject( traits.Int, desc= "A comma separated list of label values from which to make models. f you specify a list of Labels, it will override any start/end label settings. If you click Generate All Models it will override the list of labels and any start/end label settings.", @@ -335,7 +335,7 @@ class ModelMakerInputSpec(CommandLineInputSpec): class ModelMakerOutputSpec(TraitedSpec): - modelSceneFile = OutputMultiPath( + modelSceneFile = OutputMultiObject( File(exists=True), desc= "Generated models, under a model hierarchy node. Models are imported into Slicer under a model hierarchy node, and their colors are set by the color table associated with the input label map volume. The model hierarchy node must be created before running the model maker, by selecting Create New ModelHierarchy from the Models drop down menu. If you're running from the command line, a model hierarchy node in a new mrml scene will be created for you." diff --git a/nipype/interfaces/slicer/utilities.py b/nipype/interfaces/slicer/utilities.py index 5faf640570..94125d6ec0 100644 --- a/nipype/interfaces/slicer/utilities.py +++ b/nipype/interfaces/slicer/utilities.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject import os diff --git a/nipype/interfaces/spm/base.py b/nipype/interfaces/spm/base.py index cb0416392a..4f4dd716f6 100644 --- a/nipype/interfaces/spm/base.py +++ b/nipype/interfaces/spm/base.py @@ -30,7 +30,7 @@ # Local imports from ... import logging from ...utils import spm_docs as sd, NUMPY_MMAP -from ..base import (BaseInterface, traits, isdefined, InputMultiPath, +from ..base import (BaseInterface, traits, isdefined, InputMultiObject, BaseInterfaceInputSpec, Directory, Undefined, ImageFile, PackageInfo) from ..matlab import MatlabCommand @@ -241,7 +241,7 @@ def no_spm(): class SPMCommandInputSpec(BaseInterfaceInputSpec): matlab_cmd = traits.Str(desc='matlab command to use') - paths = InputMultiPath(Directory(), desc='Paths to add to matlabpath') + paths = InputMultiObject(Directory(), desc='Paths to add to matlabpath') mfile = traits.Bool(True, desc='Run m-code using m-file', usedefault=True) use_mcr = traits.Bool(desc='Run m-code using SPM MCR') use_v8struct = traits.Bool( diff --git a/nipype/interfaces/spm/model.py b/nipype/interfaces/spm/model.py index f7df523587..a715cbce7c 100644 --- a/nipype/interfaces/spm/model.py +++ b/nipype/interfaces/spm/model.py @@ -28,7 +28,7 @@ from ...utils.filemanip import (filename_to_list, list_to_filename, split_filename) from ..base import (Bunch, traits, TraitedSpec, File, Directory, - OutputMultiPath, InputMultiPath, isdefined) + OutputMultiObject, InputMultiObject, isdefined) from .base import (SPMCommand, SPMCommandInputSpec, scans_for_fnames, ImageFileSPM) @@ -218,24 +218,24 @@ class EstimateModelInputSpec(SPMCommandInputSpec): class EstimateModelOutputSpec(TraitedSpec): mask_image = ImageFileSPM( exists=True, desc='binary mask to constrain estimation') - beta_images = OutputMultiPath( + beta_images = OutputMultiObject( ImageFileSPM(exists=True), desc='design parameter estimates') residual_image = ImageFileSPM( exists=True, desc='Mean-squared image of the residuals') - residual_images = OutputMultiPath( + residual_images = OutputMultiObject( ImageFileSPM(exists=True), desc="individual residual images (requires `write_residuals`") RPVimage = ImageFileSPM(exists=True, desc='Resels per voxel image') spm_mat_file = File(exists=True, desc='Updated SPM mat file') labels = ImageFileSPM(exists=True, desc="label file") - SDerror = OutputMultiPath( + SDerror = OutputMultiObject( ImageFileSPM(exists=True), desc="Images of the standard deviation of the error") - ARcoef = OutputMultiPath( + ARcoef = OutputMultiObject( ImageFileSPM(exists=True), desc="Images of the AR coefficient") - Cbetas = OutputMultiPath( + Cbetas = OutputMultiObject( ImageFileSPM(exists=True), desc="Images of the parameter posteriors") - SDbetas = OutputMultiPath( + SDbetas = OutputMultiObject( ImageFileSPM(exists=True), desc="Images of the standard deviation of parameter posteriors") @@ -344,7 +344,7 @@ class EstimateContrastInputSpec(SPMCommandInputSpec): F contrasts, the condition list should contain previously defined T-contrasts.""", mandatory=True) - beta_images = InputMultiPath( + beta_images = InputMultiObject( File(exists=True), desc=('Parameter estimates of the ' 'design matrix'), @@ -362,13 +362,13 @@ class EstimateContrastInputSpec(SPMCommandInputSpec): class EstimateContrastOutputSpec(TraitedSpec): - con_images = OutputMultiPath( + con_images = OutputMultiObject( File(exists=True), desc='contrast images from a t-contrast') - spmT_images = OutputMultiPath( + spmT_images = OutputMultiObject( File(exists=True), desc='stat images from a t-contrast') - ess_images = OutputMultiPath( + ess_images = OutputMultiObject( File(exists=True), desc='contrast images from an F-contrast') - spmF_images = OutputMultiPath( + spmF_images = OutputMultiObject( File(exists=True), desc='stat images from an F-contrast') spm_mat_file = File(exists=True, desc='Updated SPM mat file') @@ -862,8 +862,8 @@ def aggregate_outputs(self, runtime=None, needed_outputs=None): class FactorialDesignInputSpec(SPMCommandInputSpec): spm_mat_dir = Directory( exists=True, field='dir', desc='directory to store SPM.mat file (opt)') - # Need to make an alias of InputMultiPath; the inputs below are not Path - covariates = InputMultiPath( + # Need to make an alias of InputMultiObject; the inputs below are not Path + covariates = InputMultiObject( traits.Dict( key_trait=traits.Enum('vector', 'name', 'interaction', 'centering')), @@ -1092,7 +1092,7 @@ class MultipleRegressionDesignInputSpec(FactorialDesignInputSpec): field='des.mreg.incint', usedefault=True, desc='Include intercept in design') - user_covariates = InputMultiPath( + user_covariates = InputMultiObject( traits.Dict(key_trait=traits.Enum('vector', 'name', 'centering')), field='des.mreg.mcov', desc=('covariate dictionary {vector, ' diff --git a/nipype/interfaces/spm/preprocess.py b/nipype/interfaces/spm/preprocess.py index 47c9fd77a4..8e3f6c7ac0 100644 --- a/nipype/interfaces/spm/preprocess.py +++ b/nipype/interfaces/spm/preprocess.py @@ -22,8 +22,8 @@ # Local imports from ...utils.filemanip import (fname_presuffix, filename_to_list, list_to_filename, split_filename) -from ..base import (OutputMultiPath, TraitedSpec, isdefined, traits, - InputMultiPath, File) +from ..base import (OutputMultiObject, TraitedSpec, isdefined, traits, + InputMultiObject, File) from .base import (SPMCommand, scans_for_fname, func_is_3d, scans_for_fnames, SPMCommandInputSpec, ImageFileSPM) @@ -31,7 +31,7 @@ class SliceTimingInputSpec(SPMCommandInputSpec): - in_files = InputMultiPath( + in_files = InputMultiObject( traits.Either( traits.List(ImageFileSPM(exists=True)), ImageFileSPM(exists=True)), field='scans', @@ -67,7 +67,7 @@ class SliceTimingInputSpec(SPMCommandInputSpec): class SliceTimingOutputSpec(TraitedSpec): - timecorrected_files = OutputMultiPath( + timecorrected_files = OutputMultiObject( traits.Either(traits.List(File(exists=True)), File(exists=True)), desc='slice time corrected files') @@ -124,7 +124,7 @@ def _list_outputs(self): class RealignInputSpec(SPMCommandInputSpec): - in_files = InputMultiPath( + in_files = InputMultiObject( ImageFileSPM(exists=True), field='data', mandatory=True, @@ -195,7 +195,7 @@ class RealignInputSpec(SPMCommandInputSpec): class RealignOutputSpec(TraitedSpec): mean_image = File(exists=True, desc='Mean image file from the realignment') - modified_in_files = OutputMultiPath( + modified_in_files = OutputMultiObject( traits.Either(traits.List(File(exists=True)), File(exists=True)), desc=('Copies of all files passed to ' 'in_files. Headers will have ' @@ -204,14 +204,14 @@ class RealignOutputSpec(TraitedSpec): 'optionally to first do that, ' 'extract a mean image, and ' 're-align to that mean image.')) - realigned_files = OutputMultiPath( + realigned_files = OutputMultiObject( traits.Either(traits.List(File(exists=True)), File(exists=True)), desc=('If jobtype is write or estwrite, ' 'these will be the resliced files.' ' Otherwise, they will be copies ' 'of in_files that have had their ' 'headers rewritten.')) - realignment_parameters = OutputMultiPath( + realignment_parameters = OutputMultiObject( File(exists=True), desc=('Estimated translation and ' 'rotation parameters')) @@ -314,7 +314,7 @@ class CoregisterInputSpec(SPMCommandInputSpec): field='ref', desc='reference file to register to', copyfile=False) - source = InputMultiPath( + source = InputMultiObject( ImageFileSPM(exists=True), field='source', desc='file to register to target', @@ -326,7 +326,7 @@ class CoregisterInputSpec(SPMCommandInputSpec): 'write', desc='one of: estimate, write, estwrite', usedefault=True) - apply_to_files = InputMultiPath( + apply_to_files = InputMultiObject( File(exists=True), field='other', desc='files to apply transformation to', @@ -377,9 +377,9 @@ class CoregisterInputSpec(SPMCommandInputSpec): class CoregisterOutputSpec(TraitedSpec): - coregistered_source = OutputMultiPath( + coregistered_source = OutputMultiObject( File(exists=True), desc='Coregistered source files') - coregistered_files = OutputMultiPath( + coregistered_files = OutputMultiObject( File(exists=True), desc='Coregistered other files') @@ -461,7 +461,7 @@ class NormalizeInputSpec(SPMCommandInputSpec): mandatory=True, xor=['parameter_file'], copyfile=False) - source = InputMultiPath( + source = InputMultiObject( ImageFileSPM(exists=True), field='subj.source', xor=['parameter_file'], @@ -474,7 +474,7 @@ class NormalizeInputSpec(SPMCommandInputSpec): 'write', usedefault=True, desc='Estimate, Write or do both') - apply_to_files = InputMultiPath( + apply_to_files = InputMultiObject( traits.Either(File(exists=True), traits.List(File(exists=True))), field='subj.resample', desc='files to apply transformation to', @@ -549,14 +549,14 @@ class NormalizeInputSpec(SPMCommandInputSpec): class NormalizeOutputSpec(TraitedSpec): - normalization_parameters = OutputMultiPath( + normalization_parameters = OutputMultiObject( File(exists=True), desc=('MAT files containing ' 'the normalization ' 'parameters')) - normalized_source = OutputMultiPath( + normalized_source = OutputMultiObject( File(exists=True), desc='Normalized source files') - normalized_files = OutputMultiPath( + normalized_files = OutputMultiObject( File(exists=True), desc='Normalized other files') @@ -665,7 +665,7 @@ class Normalize12InputSpec(SPMCommandInputSpec): xor=['deformation_file'], mandatory=True, copyfile=True) - apply_to_files = InputMultiPath( + apply_to_files = InputMultiObject( traits.Either( ImageFileSPM(exists=True), traits.List(ImageFileSPM(exists=True))), field='subj.resample', @@ -767,17 +767,17 @@ class Normalize12InputSpec(SPMCommandInputSpec): class Normalize12OutputSpec(TraitedSpec): - deformation_field = OutputMultiPath( + deformation_field = OutputMultiObject( File(exists=True), desc=('NIfTI file containing 3 ' 'deformation fields for the ' 'deformation in x, y and z ' 'dimension')) - normalized_image = OutputMultiPath( + normalized_image = OutputMultiObject( File(exists=True), desc=('Normalized file that needed to ' 'be aligned')) - normalized_files = OutputMultiPath( + normalized_files = OutputMultiObject( File(exists=True), desc='Normalized other files') @@ -875,7 +875,7 @@ def _list_outputs(self): class SegmentInputSpec(SPMCommandInputSpec): - data = InputMultiPath( + data = InputMultiObject( ImageFileSPM(exists=True), field='data', desc='one scan per subject', @@ -1098,7 +1098,7 @@ def _list_outputs(self): class NewSegmentInputSpec(SPMCommandInputSpec): - channel_files = InputMultiPath( + channel_files = InputMultiObject( ImageFileSPM(exists=True), mandatory=True, desc="A list of files to be segmented", @@ -1164,14 +1164,14 @@ class NewSegmentOutputSpec(TraitedSpec): traits.List(File(exists=True)), desc=('modulated+normalized class ' 'images')) - transformation_mat = OutputMultiPath( + transformation_mat = OutputMultiObject( File(exists=True), desc='Normalization transformation') - bias_corrected_images = OutputMultiPath( + bias_corrected_images = OutputMultiObject( File(exists=True), desc='bias corrected images') - bias_field_images = OutputMultiPath( + bias_field_images = OutputMultiObject( File(exists=True), desc='bias field images') - forward_deformation_field = OutputMultiPath(File(exists=True)) - inverse_deformation_field = OutputMultiPath(File(exists=True)) + forward_deformation_field = OutputMultiObject(File(exists=True)) + inverse_deformation_field = OutputMultiObject(File(exists=True)) class NewSegment(SPMCommand): @@ -1314,7 +1314,7 @@ def _list_outputs(self): class SmoothInputSpec(SPMCommandInputSpec): - in_files = InputMultiPath( + in_files = InputMultiObject( ImageFileSPM(exists=True), field='data', desc='list of files to smooth', @@ -1335,7 +1335,7 @@ class SmoothInputSpec(SPMCommandInputSpec): class SmoothOutputSpec(TraitedSpec): - smoothed_files = OutputMultiPath(File(exists=True), desc='smoothed files') + smoothed_files = OutputMultiObject(File(exists=True), desc='smoothed files') class Smooth(SPMCommand): @@ -1510,12 +1510,12 @@ class DARTELNorm2MNIInputSpec(SPMCommandInputSpec): mandatory=True, desc="DARTEL template", field='mni_norm.template') - flowfield_files = InputMultiPath( + flowfield_files = InputMultiObject( ImageFileSPM(exists=True), mandatory=True, desc="DARTEL flow fields u_rc1*", field='mni_norm.data.subjs.flowfields') - apply_to_files = InputMultiPath( + apply_to_files = InputMultiObject( ImageFileSPM(exists=True), desc="Files to apply the transform to", field='mni_norm.data.subjs.images', @@ -1548,7 +1548,7 @@ class DARTELNorm2MNIInputSpec(SPMCommandInputSpec): class DARTELNorm2MNIOutputSpec(TraitedSpec): - normalized_files = OutputMultiPath( + normalized_files = OutputMultiObject( File(exists=True), desc='Normalized files in MNI space') normalization_parameter_file = File( exists=True, desc=('Transform parameters to MNI ' @@ -1618,13 +1618,13 @@ def _list_outputs(self): class CreateWarpedInputSpec(SPMCommandInputSpec): - image_files = InputMultiPath( + image_files = InputMultiObject( ImageFileSPM(exists=True), mandatory=True, desc="A list of files to be warped", field='crt_warped.images', copyfile=False) - flowfield_files = InputMultiPath( + flowfield_files = InputMultiObject( ImageFileSPM(exists=True), copyfile=False, desc="DARTEL flow fields u_rc1*", @@ -1695,7 +1695,7 @@ def _list_outputs(self): class ApplyDeformationFieldInputSpec(SPMCommandInputSpec): - in_files = InputMultiPath( + in_files = InputMultiObject( ImageFileSPM(exists=True), mandatory=True, field='fnames') deformation_field = File(exists=True, mandatory=True, field='comp{1}.def') reference_volume = ImageFileSPM( @@ -1708,7 +1708,7 @@ class ApplyDeformationFieldInputSpec(SPMCommandInputSpec): class ApplyDeformationFieldOutputSpec(TraitedSpec): - out_files = OutputMultiPath(File(exists=True)) + out_files = OutputMultiObject(File(exists=True)) class ApplyDeformations(SPMCommand): @@ -1743,7 +1743,7 @@ def _list_outputs(self): class VBMSegmentInputSpec(SPMCommandInputSpec): - in_files = InputMultiPath( + in_files = InputMultiObject( ImageFileSPM(exists=True), desc="A list of files to be segmented", field='estwrite.data', @@ -1930,22 +1930,22 @@ class VBMSegmentOuputSpec(TraitedSpec): traits.List(File(exists=True)), desc=('modulated+normalized class ' 'images')) - transformation_mat = OutputMultiPath( + transformation_mat = OutputMultiObject( File(exists=True), desc='Normalization transformation') - bias_corrected_images = OutputMultiPath( + bias_corrected_images = OutputMultiObject( File(exists=True), desc='bias corrected images') - normalized_bias_corrected_images = OutputMultiPath( + normalized_bias_corrected_images = OutputMultiObject( File(exists=True), desc='bias corrected images') - pve_label_native_images = OutputMultiPath(File(exists=True)) - pve_label_normalized_images = OutputMultiPath(File(exists=True)) - pve_label_registered_images = OutputMultiPath(File(exists=True)) + pve_label_native_images = OutputMultiObject(File(exists=True)) + pve_label_normalized_images = OutputMultiObject(File(exists=True)) + pve_label_registered_images = OutputMultiObject(File(exists=True)) - forward_deformation_field = OutputMultiPath(File(exists=True)) - inverse_deformation_field = OutputMultiPath(File(exists=True)) + forward_deformation_field = OutputMultiObject(File(exists=True)) + inverse_deformation_field = OutputMultiObject(File(exists=True)) - jacobian_determinant_images = OutputMultiPath(File(exists=True)) + jacobian_determinant_images = OutputMultiObject(File(exists=True)) class VBMSegment(SPMCommand): diff --git a/nipype/interfaces/spm/utils.py b/nipype/interfaces/spm/utils.py index 5dd6c05e4d..1186e85193 100644 --- a/nipype/interfaces/spm/utils.py +++ b/nipype/interfaces/spm/utils.py @@ -9,8 +9,8 @@ from ...utils.filemanip import (split_filename, fname_presuffix, filename_to_list, list_to_filename) -from ..base import (TraitedSpec, isdefined, File, traits, OutputMultiPath, - InputMultiPath) +from ..base import (TraitedSpec, isdefined, File, traits, OutputMultiObject, + InputMultiObject) from .base import (SPMCommandInputSpec, SPMCommand, scans_for_fnames, scans_for_fname) @@ -248,7 +248,7 @@ def _list_outputs(self): class ApplyInverseDeformationInput(SPMCommandInputSpec): - in_files = InputMultiPath( + in_files = InputMultiObject( File(exists=True), mandatory=True, field='fnames', @@ -288,7 +288,7 @@ class ApplyInverseDeformationInput(SPMCommandInputSpec): class ApplyInverseDeformationOutput(TraitedSpec): - out_files = OutputMultiPath(File(exists=True), desc='Transformed files') + out_files = OutputMultiObject(File(exists=True), desc='Transformed files') class ApplyInverseDeformation(SPMCommand): @@ -335,7 +335,7 @@ def _list_outputs(self): class ResliceToReferenceInput(SPMCommandInputSpec): - in_files = InputMultiPath( + in_files = InputMultiObject( File(exists=True), mandatory=True, field='fnames', @@ -365,7 +365,7 @@ class ResliceToReferenceInput(SPMCommandInputSpec): class ResliceToReferenceOutput(TraitedSpec): - out_files = OutputMultiPath(File(exists=True), desc='Transformed files') + out_files = OutputMultiObject(File(exists=True), desc='Transformed files') class ResliceToReference(SPMCommand): @@ -411,7 +411,7 @@ def _list_outputs(self): class DicomImportInputSpec(SPMCommandInputSpec): - in_files = InputMultiPath( + in_files = InputMultiObject( File(exists=True), mandatory=True, field='data', @@ -449,7 +449,7 @@ class DicomImportInputSpec(SPMCommandInputSpec): class DicomImportOutputSpec(TraitedSpec): - out_files = OutputMultiPath(File(exists=True), desc='converted files') + out_files = OutputMultiObject(File(exists=True), desc='converted files') class DicomImport(SPMCommand): diff --git a/nipype/interfaces/utility/base.py b/nipype/interfaces/utility/base.py index 87eb51e61b..8f716f49be 100644 --- a/nipype/interfaces/utility/base.py +++ b/nipype/interfaces/utility/base.py @@ -19,7 +19,7 @@ import nibabel as nb from ..base import (traits, TraitedSpec, DynamicTraitedSpec, File, Undefined, - isdefined, OutputMultiPath, InputMultiPath, BaseInterface, + isdefined, OutputMultiObject, InputMultiObject, BaseInterface, BaseInterfaceInputSpec, Str) from ..io import IOBase, add_traits from ...utils.filemanip import filename_to_list, copyfile, split_filename @@ -372,14 +372,14 @@ def _list_outputs(self): class SelectInputSpec(BaseInterfaceInputSpec): - inlist = InputMultiPath( + inlist = InputMultiObject( traits.Any, mandatory=True, desc='list of values to choose from') - index = InputMultiPath( + index = InputMultiObject( traits.Int, mandatory=True, desc='0-based indices of values to choose') class SelectOutputSpec(TraitedSpec): - out = OutputMultiPath(traits.Any, desc='list of selected values') + out = OutputMultiObject(traits.Any, desc='list of selected values') class Select(IOBase): diff --git a/nipype/pipeline/engine/nodes.py b/nipype/pipeline/engine/nodes.py index 054f9a622c..677b410997 100644 --- a/nipype/pipeline/engine/nodes.py +++ b/nipype/pipeline/engine/nodes.py @@ -36,7 +36,7 @@ loadpkl, split_filename, load_json, makedirs, emptydirs, savepkl, to_str) -from ...interfaces.base import (traits, InputMultiPath, CommandLine, Undefined, +from ...interfaces.base import (traits, InputMultiObject, CommandLine, Undefined, DynamicTraitedSpec, Bunch, InterfaceResult, Interface, isdefined) from .utils import ( @@ -980,9 +980,9 @@ def _create_dynamic_traits(self, basetraits, fields=None, nitems=None): if name in fields and ((nitems is None) or (nitems > 1)): logger.debug('adding multipath trait: %s', name) if self.nested: - output.add_trait(name, InputMultiPath(traits.Any())) + output.add_trait(name, InputMultiObject(traits.Any())) else: - output.add_trait(name, InputMultiPath(spec.trait_type)) + output.add_trait(name, InputMultiObject(spec.trait_type)) else: output.add_trait(name, traits.Trait(spec)) setattr(output, name, Undefined) @@ -1018,7 +1018,7 @@ def _get_hashval(self): hashinputs.remove_trait(name) hashinputs.add_trait( name, - InputMultiPath( + InputMultiObject( self._interface.inputs.traits()[name].trait_type)) logger.debug('setting hashinput %s-> %s', name, getattr(self._inputs, name)) diff --git a/nipype/scripts/utils.py b/nipype/scripts/utils.py index f4b8a86fb1..08f2c077a0 100644 --- a/nipype/scripts/utils.py +++ b/nipype/scripts/utils.py @@ -12,7 +12,7 @@ import json from .instance import import_module -from ..interfaces.base import InputMultiPath, traits +from ..interfaces.base import InputMultiObject, traits # different context options CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help']) @@ -92,7 +92,7 @@ def add_args_options(arg_parser, interface): has_multiple_inner_traits = True if getattr(spec, "mandatory", False): - if spec.is_trait_type(InputMultiPath): + if spec.is_trait_type(InputMultiObject): args["nargs"] = "+" elif spec.is_trait_type(traits.List): if (spec.trait_type.minlen == spec.trait_type.maxlen) and \ @@ -111,7 +111,7 @@ def add_args_options(arg_parser, interface): ' argument: {}.'.format(name))) arg_parser.add_argument(name, help=desc, **args) else: - if spec.is_trait_type(InputMultiPath): + if spec.is_trait_type(InputMultiObject): args["nargs"] = "*" elif spec.is_trait_type(traits.List): if (spec.trait_type.minlen == spec.trait_type.maxlen) and \ diff --git a/nipype/utils/nipype_cmd.py b/nipype/utils/nipype_cmd.py index b31795aa92..c8669a5b5f 100644 --- a/nipype/utils/nipype_cmd.py +++ b/nipype/utils/nipype_cmd.py @@ -7,7 +7,7 @@ import inspect import sys -from ..interfaces.base import Interface, InputMultiPath, traits +from ..interfaces.base import Interface, InputMultiObject, traits from .misc import str2bool @@ -38,11 +38,11 @@ def add_options(parser=None, module=None, function=None): args["action"] = 'store_true' if hasattr(spec, "mandatory") and spec.mandatory: - if spec.is_trait_type(InputMultiPath): + if spec.is_trait_type(InputMultiObject): args["nargs"] = "+" parser.add_argument(name, help=desc, **args) else: - if spec.is_trait_type(InputMultiPath): + if spec.is_trait_type(InputMultiObject): args["nargs"] = "*" parser.add_argument( "--%s" % name, dest=name, help=desc, **args) From ab8ae1a5413c731506df61e6fa2fd30070dd3d7b Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Sun, 21 Jan 2018 23:26:28 -0500 Subject: [PATCH 08/11] File(Directory) class didnt dffer from BaseFile(Directory), i.e. didnt use a afast validator, so i renamed BaseFile(Directory) to File(Directory) and removed extra classes --- nipype/interfaces/base/traits_extension.py | 103 ++------------------- 1 file changed, 9 insertions(+), 94 deletions(-) diff --git a/nipype/interfaces/base/traits_extension.py b/nipype/interfaces/base/traits_extension.py index 5a9b1ec71a..f8618f0198 100644 --- a/nipype/interfaces/base/traits_extension.py +++ b/nipype/interfaces/base/traits_extension.py @@ -54,7 +54,7 @@ class Str(Unicode): traits.DictStrStr = DictStrStr -class BaseFile(BaseUnicode): +class File(BaseUnicode): """ Defines a trait whose value must be the name of a file. """ @@ -96,14 +96,11 @@ def __init__(self, if exists: self.info_text = 'an existing file name' - super(BaseFile, self).__init__(value, **metadata) + super(File, self).__init__(value, **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. - """ - validated_value = super(BaseFile, self).validate(object, name, value) + """ Validates that a specified value is valid for this trait.""" + validated_value = super(File, self).validate(object, name, value) if not self.exists: return validated_value elif os.path.isfile(value): @@ -117,53 +114,12 @@ def validate(self, object, name, value): self.error(object, name, value) -class File(BaseFile): - """ - Defines a trait whose value must be the name of a file. - Disables the default C-level fast validator. - """ - - def __init__(self, - 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 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) - - # ------------------------------------------------------------------------------- -# 'BaseDirectory' and 'Directory' traits: +# 'Directory' trait # ------------------------------------------------------------------------------- -class BaseDirectory(BaseUnicode): +class Directory(BaseUnicode): """ Defines a trait whose value must be the name of a directory. """ @@ -177,7 +133,7 @@ def __init__(self, entries=0, exists=False, **metadata): - """ Creates a BaseDirectory trait. + """ Creates a Directory trait. Parameters ---------- @@ -201,13 +157,10 @@ def __init__(self, if exists: self.info_text = 'an existing directory name' - super(BaseDirectory, self).__init__(value, **metadata) + super(Directory, self).__init__(value, **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. - """ + """ Validates that a specified value is valid for this trait.""" if isinstance(value, (str, bytes)): if not self.exists: return value @@ -222,44 +175,6 @@ def validate(self, object, name, value): self.error(object, name, value) -class Directory(BaseDirectory): - """ - Defines a trait whose value must be the name of a directory. - Disables the default 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) - - # lists of tuples # each element consists of : # - uncompressed (tuple[0]) extension From 252a745e43e956ada1dcc36fb8543b150be10816 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Mon, 22 Jan 2018 13:19:32 -0500 Subject: [PATCH 09/11] Revert "changing name MultiPath to MultiObject" It will be included in 2.0 This reverts commit 36ffda1dbf93dec300f6c6a0def0bf2494c81da5. --- nipype/algorithms/confounds.py | 8 +- nipype/algorithms/metrics.py | 6 +- nipype/algorithms/misc.py | 32 +++---- nipype/algorithms/modelgen.py | 12 +-- nipype/algorithms/rapidart.py | 28 +++--- nipype/interfaces/afni/model.py | 12 +-- nipype/interfaces/afni/preprocess.py | 4 +- nipype/interfaces/afni/utils.py | 10 +- nipype/interfaces/ants/legacy.py | 6 +- nipype/interfaces/ants/registration.py | 18 ++-- nipype/interfaces/ants/resampling.py | 10 +- nipype/interfaces/ants/segmentation.py | 24 ++--- .../ants/tests/test_spec_JointFusion.py | 4 +- nipype/interfaces/ants/utils.py | 8 +- nipype/interfaces/base/__init__.py | 4 +- nipype/interfaces/base/traits_extension.py | 20 ++-- nipype/interfaces/camino/convert.py | 4 +- nipype/interfaces/camino/dti.py | 4 +- nipype/interfaces/camino/utils.py | 4 +- nipype/interfaces/cmtk/cmtk.py | 8 +- nipype/interfaces/cmtk/convert.py | 22 ++--- nipype/interfaces/cmtk/nbs.py | 8 +- nipype/interfaces/cmtk/nx.py | 18 ++-- nipype/interfaces/dcm2nii.py | 26 ++--- nipype/interfaces/dcmstack.py | 4 +- .../interfaces/diffusion_toolkit/postproc.py | 4 +- nipype/interfaces/dipy/simulate.py | 8 +- nipype/interfaces/elastix/registration.py | 8 +- nipype/interfaces/freesurfer/longitudinal.py | 24 ++--- nipype/interfaces/freesurfer/model.py | 26 ++--- nipype/interfaces/freesurfer/preprocess.py | 12 +-- nipype/interfaces/freesurfer/utils.py | 4 +- nipype/interfaces/fsl/dti.py | 40 ++++---- nipype/interfaces/fsl/epi.py | 6 +- nipype/interfaces/fsl/fix.py | 10 +- nipype/interfaces/fsl/maths.py | 4 +- nipype/interfaces/fsl/model.py | 88 ++++++++--------- nipype/interfaces/fsl/preprocess.py | 24 ++--- nipype/interfaces/fsl/utils.py | 4 +- nipype/interfaces/io.py | 66 ++++++------- nipype/interfaces/matlab.py | 4 +- nipype/interfaces/minc/minc.py | 34 +++---- nipype/interfaces/mipav/developer.py | 10 +- nipype/interfaces/mne/base.py | 6 +- nipype/interfaces/mrtrix/preprocess.py | 10 +- nipype/interfaces/mrtrix3/utils.py | 2 +- nipype/interfaces/niftyseg/em.py | 4 +- nipype/interfaces/nilearn.py | 4 +- nipype/interfaces/nipy/model.py | 8 +- nipype/interfaces/nipy/preprocess.py | 20 ++-- nipype/interfaces/semtools/brains/classify.py | 2 +- .../semtools/brains/segmentation.py | 10 +- .../interfaces/semtools/brains/utilities.py | 8 +- nipype/interfaces/semtools/converters.py | 2 +- .../semtools/diffusion/diffusion.py | 6 +- .../interfaces/semtools/diffusion/gtract.py | 14 +-- .../semtools/diffusion/maxcurvature.py | 2 +- .../diffusion/tractography/commandlineonly.py | 2 +- .../diffusion/tractography/fiberprocess.py | 2 +- .../diffusion/tractography/fibertrack.py | 2 +- .../diffusion/tractography/ukftractography.py | 4 +- nipype/interfaces/semtools/featurecreator.py | 2 +- .../semtools/filtering/denoising.py | 6 +- .../semtools/filtering/featuredetection.py | 4 +- .../semtools/legacy/registration.py | 2 +- .../semtools/registration/brainsfit.py | 12 +-- .../semtools/registration/brainsresample.py | 4 +- .../semtools/registration/brainsresize.py | 2 +- .../semtools/registration/specialized.py | 40 ++++---- .../semtools/segmentation/specialized.py | 48 +++++----- .../semtools/testing/featuredetection.py | 2 +- .../testing/generateaveragelmkfile.py | 4 +- .../semtools/testing/landmarkscompare.py | 2 +- .../interfaces/semtools/utilities/brains.py | 36 +++---- nipype/interfaces/slicer/converters.py | 2 +- .../interfaces/slicer/diffusion/diffusion.py | 18 ++-- .../interfaces/slicer/filtering/arithmetic.py | 2 +- .../slicer/filtering/checkerboardfilter.py | 4 +- .../interfaces/slicer/filtering/denoising.py | 4 +- .../slicer/filtering/extractskeleton.py | 2 +- .../slicer/filtering/histogrammatching.py | 2 +- .../slicer/filtering/imagelabelcombine.py | 2 +- .../interfaces/slicer/filtering/morphology.py | 2 +- .../filtering/n4itkbiasfieldcorrection.py | 8 +- .../resamplescalarvectordwivolume.py | 10 +- .../slicer/filtering/thresholdscalarvolume.py | 2 +- .../votingbinaryholefillingimagefilter.py | 4 +- nipype/interfaces/slicer/generate_classes.py | 8 +- nipype/interfaces/slicer/legacy/converters.py | 2 +- .../slicer/legacy/diffusion/denoising.py | 8 +- nipype/interfaces/slicer/legacy/filtering.py | 4 +- .../interfaces/slicer/legacy/registration.py | 14 +-- .../interfaces/slicer/legacy/segmentation.py | 2 +- .../quantification/changequantification.py | 2 +- .../petstandarduptakevaluecomputation.py | 2 +- .../slicer/registration/brainsfit.py | 14 +-- .../slicer/registration/brainsresample.py | 4 +- .../slicer/registration/specialized.py | 44 ++++----- .../simpleregiongrowingsegmentation.py | 4 +- .../slicer/segmentation/specialized.py | 6 +- nipype/interfaces/slicer/surface.py | 8 +- nipype/interfaces/slicer/utilities.py | 2 +- nipype/interfaces/spm/base.py | 4 +- nipype/interfaces/spm/model.py | 30 +++--- nipype/interfaces/spm/preprocess.py | 94 +++++++++---------- nipype/interfaces/spm/utils.py | 16 ++-- nipype/interfaces/utility/base.py | 8 +- nipype/pipeline/engine/nodes.py | 8 +- nipype/scripts/utils.py | 6 +- nipype/utils/nipype_cmd.py | 6 +- 110 files changed, 655 insertions(+), 655 deletions(-) diff --git a/nipype/algorithms/confounds.py b/nipype/algorithms/confounds.py index 1922690437..10985edc6f 100644 --- a/nipype/algorithms/confounds.py +++ b/nipype/algorithms/confounds.py @@ -27,7 +27,7 @@ from ..external.due import BibTeX from ..interfaces.base import (traits, TraitedSpec, BaseInterface, BaseInterfaceInputSpec, File, isdefined, - InputMultiObject, OutputMultiObject) + InputMultiPath, OutputMultiPath) from ..utils import NUMPY_MMAP from ..utils.misc import normalize_mc_params @@ -360,7 +360,7 @@ def _list_outputs(self): class CompCorInputSpec(BaseInterfaceInputSpec): realigned_file = File( exists=True, mandatory=True, desc='already realigned brain image (4D)') - mask_files = InputMultiObject( + mask_files = InputMultiPath( File(exists=True), desc=('One or more mask files that determines ' 'ROI (3D). When more that one file is ' @@ -649,7 +649,7 @@ class TCompCorInputSpec(CompCorInputSpec): class TCompCorOutputSpec(CompCorOutputSpec): # and all the fields in CompCorOutputSpec - high_variance_masks = OutputMultiObject( + high_variance_masks = OutputMultiPath( File(exists=True), desc=(("voxels exceeding the variance" " threshold"))) @@ -714,7 +714,7 @@ def _list_outputs(self): class TSNRInputSpec(BaseInterfaceInputSpec): - in_file = InputMultiObject( + in_file = InputMultiPath( File(exists=True), mandatory=True, desc='realigned 4D file or a list of 3D files') diff --git a/nipype/algorithms/metrics.py b/nipype/algorithms/metrics.py index 2b3a6929e2..002b2a8216 100644 --- a/nipype/algorithms/metrics.py +++ b/nipype/algorithms/metrics.py @@ -29,7 +29,7 @@ from ..utils.misc import package_check from ..interfaces.base import (BaseInterface, traits, TraitedSpec, File, - InputMultiObject, BaseInterfaceInputSpec, + InputMultiPath, BaseInterfaceInputSpec, isdefined) from ..utils import NUMPY_MMAP @@ -382,11 +382,11 @@ def _list_outputs(self): class FuzzyOverlapInputSpec(BaseInterfaceInputSpec): - in_ref = InputMultiObject( + in_ref = InputMultiPath( File(exists=True), mandatory=True, desc='Reference image. Requires the same dimensions as in_tst.') - in_tst = InputMultiObject( + in_tst = InputMultiPath( File(exists=True), mandatory=True, desc='Test image. Requires the same dimensions as in_ref.') diff --git a/nipype/algorithms/misc.py b/nipype/algorithms/misc.py index 44844e632d..87b1fae400 100644 --- a/nipype/algorithms/misc.py +++ b/nipype/algorithms/misc.py @@ -31,7 +31,7 @@ from .. import logging from . import metrics as nam from ..interfaces.base import ( - BaseInterface, traits, TraitedSpec, File, InputMultiObject, OutputMultiObject, + BaseInterface, traits, TraitedSpec, File, InputMultiPath, OutputMultiPath, BaseInterfaceInputSpec, isdefined, DynamicTraitedSpec, Undefined) from ..utils.filemanip import fname_presuffix, split_filename, filename_to_list from ..utils import NUMPY_MMAP @@ -124,7 +124,7 @@ def _list_outputs(self): class SimpleThresholdInputSpec(BaseInterfaceInputSpec): - volumes = InputMultiObject( + 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\ @@ -133,7 +133,7 @@ class SimpleThresholdInputSpec(BaseInterfaceInputSpec): class SimpleThresholdOutputSpec(TraitedSpec): - thresholded_volumes = OutputMultiObject( + thresholded_volumes = OutputMultiPath( File(exists=True), desc="thresholded volumes") @@ -170,7 +170,7 @@ def _list_outputs(self): class ModifyAffineInputSpec(BaseInterfaceInputSpec): - volumes = InputMultiObject( + volumes = InputMultiPath( File(exists=True), desc='volumes which affine matrices will be modified', mandatory=True) @@ -183,7 +183,7 @@ class ModifyAffineInputSpec(BaseInterfaceInputSpec): class ModifyAffineOutputSpec(TraitedSpec): - transformed_volumes = OutputMultiObject(File(exist=True)) + transformed_volumes = OutputMultiPath(File(exist=True)) class ModifyAffine(BaseInterface): @@ -328,7 +328,7 @@ class Matlab2CSVInputSpec(TraitedSpec): class Matlab2CSVOutputSpec(TraitedSpec): - csv_files = OutputMultiObject( + csv_files = OutputMultiPath( File(desc='Output CSV files for each variable saved in the input .mat\ file')) @@ -503,7 +503,7 @@ def makefmtlist(output_array, typelist, rowheadingsBool, shape, class MergeCSVFilesInputSpec(TraitedSpec): - in_files = InputMultiObject( + in_files = InputMultiPath( File(exists=True), mandatory=True, desc='Input comma-separated value (CSV) files') @@ -1046,14 +1046,14 @@ def gen_noise(self, class NormalizeProbabilityMapSetInputSpec(TraitedSpec): - in_files = InputMultiObject( + 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.') class NormalizeProbabilityMapSetOutputSpec(TraitedSpec): - out_files = OutputMultiObject(File(exists=True), desc="normalized maps") + out_files = OutputMultiPath(File(exists=True), desc="normalized maps") class NormalizeProbabilityMapSet(BaseInterface): @@ -1099,10 +1099,10 @@ class SplitROIsInputSpec(TraitedSpec): class SplitROIsOutputSpec(TraitedSpec): - out_files = OutputMultiObject(File(exists=True), desc='the resulting ROIs') - out_masks = OutputMultiObject( + out_files = OutputMultiPath(File(exists=True), desc='the resulting ROIs') + out_masks = OutputMultiPath( File(exists=True), desc='a mask indicating valid values') - out_index = OutputMultiObject( + out_index = OutputMultiPath( File(exists=True), desc='arrays keeping original locations') @@ -1148,9 +1148,9 @@ def _list_outputs(self): class MergeROIsInputSpec(TraitedSpec): - in_files = InputMultiObject( + in_files = InputMultiPath( File(exists=True, mandatory=True, desc='files to be re-merged')) - in_index = InputMultiObject( + in_index = InputMultiPath( File(exists=True, mandatory=True), desc='array keeping original locations') in_reference = File(exists=True, desc='reference file') @@ -1421,7 +1421,7 @@ def merge_rois(in_files, in_idxs, in_ref, dtype=None, out_file=None): class CalculateMedianInputSpec(BaseInterfaceInputSpec): - in_files = InputMultiObject( + in_files = InputMultiPath( File( exists=True, mandatory=True, @@ -1432,7 +1432,7 @@ class CalculateMedianInputSpec(BaseInterfaceInputSpec): class CalculateMedianOutputSpec(TraitedSpec): - median_files = OutputMultiObject( + median_files = OutputMultiPath( File(exists=True), desc="One or more median images") diff --git a/nipype/algorithms/modelgen.py b/nipype/algorithms/modelgen.py index 743cca1b16..289ebc8388 100644 --- a/nipype/algorithms/modelgen.py +++ b/nipype/algorithms/modelgen.py @@ -30,7 +30,7 @@ from scipy.special import gammaln from ..utils import NUMPY_MMAP -from ..interfaces.base import (BaseInterface, TraitedSpec, InputMultiObject, +from ..interfaces.base import (BaseInterface, TraitedSpec, InputMultiPath, traits, File, Bunch, BaseInterfaceInputSpec, isdefined) from ..utils.filemanip import filename_to_list @@ -182,7 +182,7 @@ def gen_info(run_event_files): class SpecifyModelInputSpec(BaseInterfaceInputSpec): - subject_info = InputMultiObject( + subject_info = InputMultiPath( Bunch, mandatory=True, xor=['subject_info', 'event_files'], @@ -190,14 +190,14 @@ class SpecifyModelInputSpec(BaseInterfaceInputSpec): 'condition information. see ' ':ref:`SpecifyModel` or ' 'SpecifyModel.__doc__ for details') - event_files = InputMultiObject( + event_files = InputMultiPath( traits.List(File(exists=True)), mandatory=True, xor=['subject_info', 'event_files'], desc='List of event description files 1, 2 or 3 ' 'column format corresponding to onsets, ' 'durations and amplitudes') - realignment_parameters = InputMultiObject( + realignment_parameters = InputMultiPath( File(exists=True), desc='Realignment parameters returned ' 'by motion correction algorithm', @@ -210,12 +210,12 @@ class SpecifyModelInputSpec(BaseInterfaceInputSpec): "NIPY", usedefault=True, desc="Source of motion parameters") - outlier_files = InputMultiObject( + outlier_files = InputMultiPath( File(exists=True), desc='Files containing scan outlier indices ' 'that should be tossed', copyfile=False) - functional_runs = InputMultiObject( + functional_runs = InputMultiPath( traits.Either(traits.List(File(exists=True)), File(exists=True)), mandatory=True, desc='Data files for model. List of 4D ' diff --git a/nipype/algorithms/rapidart.py b/nipype/algorithms/rapidart.py index 48edc8804b..ddf8de8992 100644 --- a/nipype/algorithms/rapidart.py +++ b/nipype/algorithms/rapidart.py @@ -31,8 +31,8 @@ import scipy.io as sio from ..utils import NUMPY_MMAP -from ..interfaces.base import (BaseInterface, traits, InputMultiObject, - OutputMultiObject, TraitedSpec, File, +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, normalize_mc_params @@ -163,12 +163,12 @@ def _calc_norm_affine(affines, use_differences, brain_pts=None): class ArtifactDetectInputSpec(BaseInterfaceInputSpec): - realigned_files = InputMultiObject( + realigned_files = InputMultiPath( File(exists=True), desc=("Names of realigned functional data " "files"), mandatory=True) - realignment_parameters = InputMultiObject( + realignment_parameters = InputMultiPath( File(exists=True), mandatory=True, desc=("Names of realignment " @@ -267,22 +267,22 @@ class ArtifactDetectInputSpec(BaseInterfaceInputSpec): class ArtifactDetectOutputSpec(TraitedSpec): - outlier_files = OutputMultiObject( + outlier_files = OutputMultiPath( File(exists=True), desc=("One file for each functional run " "containing a list of 0-based indices" " corresponding to outlier volumes")) - intensity_files = OutputMultiObject( + intensity_files = OutputMultiPath( File(exists=True), desc=("One file for each functional run " "containing the global intensity " "values determined from the " "brainmask")) - norm_files = OutputMultiObject( + norm_files = OutputMultiPath( File, desc=("One file for each functional run " "containing the composite norm")) - statistic_files = OutputMultiObject( + statistic_files = OutputMultiPath( File(exists=True), desc=("One file for each functional run " "containing information about the " @@ -291,16 +291,16 @@ class ArtifactDetectOutputSpec(TraitedSpec): "details of stimulus correlated " "motion and a listing or artifacts " "by event type.")) - plot_files = OutputMultiObject( + plot_files = OutputMultiPath( File, desc=("One image file for each functional run " "containing the detected outliers")) - mask_files = OutputMultiObject( + mask_files = OutputMultiPath( File, desc=("One image file for each functional run " "containing the mask used for global " "signal calculation")) - displacement_files = OutputMultiObject( + displacement_files = OutputMultiPath( File, desc=("One image file for each " "functional run containing the " @@ -631,13 +631,13 @@ def _run_interface(self, runtime): class StimCorrInputSpec(BaseInterfaceInputSpec): - realignment_parameters = InputMultiObject( + realignment_parameters = InputMultiPath( File(exists=True), mandatory=True, desc=("Names of realignment " "parameters corresponding to " "the functional data files")) - intensity_values = InputMultiObject( + intensity_values = InputMultiPath( File(exists=True), mandatory=True, desc=("Name of file containing intensity " @@ -653,7 +653,7 @@ class StimCorrInputSpec(BaseInterfaceInputSpec): class StimCorrOutputSpec(TraitedSpec): - stimcorr_files = OutputMultiObject( + stimcorr_files = OutputMultiPath( File(exists=True), desc=("List of files containing " "correlation values")) diff --git a/nipype/interfaces/afni/model.py b/nipype/interfaces/afni/model.py index 520fbacb09..0d56f2dbb5 100644 --- a/nipype/interfaces/afni/model.py +++ b/nipype/interfaces/afni/model.py @@ -18,7 +18,7 @@ import os from ..base import (CommandLineInputSpec, CommandLine, Directory, TraitedSpec, - traits, isdefined, File, InputMultiObject, Undefined, Str) + traits, isdefined, File, InputMultiPath, Undefined, Str) from ...external.due import BibTeX from .base import (AFNICommandBase, AFNICommand, AFNICommandInputSpec, @@ -26,7 +26,7 @@ class DeconvolveInputSpec(AFNICommandInputSpec): - in_files = InputMultiObject( + in_files = InputMultiPath( File(exists=True), desc='filenames of 3D+time input datasets. More than one filename can ' 'be given and the datasets will be auto-catenated in time. ' @@ -306,7 +306,7 @@ def _list_outputs(self): class RemlfitInputSpec(AFNICommandInputSpec): # mandatory files - in_files = InputMultiObject( + in_files = InputMultiPath( File(exists=True), desc='Read time series dataset', argstr='-input "%s"', @@ -353,7 +353,7 @@ class RemlfitInputSpec(AFNICommandInputSpec): '(only with \'mask\' or \'automask\' options).', argstr='-STATmask %s', exists=True) - addbase = InputMultiObject( + addbase = InputMultiPath( File( exists=True, desc='file containing columns to add to regression matrix'), @@ -364,7 +364,7 @@ class RemlfitInputSpec(AFNICommandInputSpec): copyfile=False, sep=" ", argstr='-addbase %s') - slibase = InputMultiObject( + slibase = InputMultiPath( File( exists=True, desc='file containing columns to add to regression matrix'), @@ -381,7 +381,7 @@ class RemlfitInputSpec(AFNICommandInputSpec): 'will slow the program down, and make it use a lot more memory ' '(to hold all the matrix stuff).', argstr='-slibase %s') - slibase_sm = InputMultiObject( + slibase_sm = InputMultiPath( File( exists=True, desc='file containing columns to add to regression matrix'), diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index 6498f63acc..f8bb57e06d 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -19,7 +19,7 @@ from ...utils.filemanip import (load_json, save_json, split_filename, fname_presuffix) from ..base import (CommandLineInputSpec, CommandLine, TraitedSpec, traits, - isdefined, File, InputMultiObject, Undefined, Str) + isdefined, File, InputMultiPath, Undefined, Str) from .base import (AFNICommandBase, AFNICommand, AFNICommandInputSpec, AFNICommandOutputSpec, AFNIPythonCommandInputSpec, @@ -775,7 +775,7 @@ class BandpassInputSpec(AFNICommandInputSpec): desc='Despike each time series before other processing. Hopefully, ' 'you don\'t actually need to do this, which is why it is ' 'optional.') - orthogonalize_file = InputMultiObject( + orthogonalize_file = InputMultiPath( File(exists=True), argstr='-ort %s', desc='Also orthogonalize input to columns in f.1D. Multiple \'-ort\' ' diff --git a/nipype/interfaces/afni/utils.py b/nipype/interfaces/afni/utils.py index 36ab537d09..188ba158c0 100644 --- a/nipype/interfaces/afni/utils.py +++ b/nipype/interfaces/afni/utils.py @@ -23,7 +23,7 @@ from ...utils.filemanip import (load_json, save_json, split_filename) from ..base import (CommandLineInputSpec, CommandLine, Directory, TraitedSpec, - traits, isdefined, File, InputMultiObject, Undefined, Str) + traits, isdefined, File, InputMultiPath, Undefined, Str) from ...external.due import BibTeX from .base import (AFNICommandBase, AFNICommand, AFNICommandInputSpec, AFNICommandOutputSpec, AFNIPythonCommandInputSpec, @@ -1424,7 +1424,7 @@ class MaskTool(AFNICommand): class MergeInputSpec(AFNICommandInputSpec): - in_files = InputMultiObject( + in_files = InputMultiPath( File(desc='input file to 3dmerge', exists=True), argstr='%s', position=-1, @@ -1990,7 +1990,7 @@ class Resample(AFNICommand): class TCatInputSpec(AFNICommandInputSpec): - in_files = InputMultiObject( + in_files = InputMultiPath( File(exists=True), desc='input file to 3dTcat', argstr=' %s', @@ -2020,7 +2020,7 @@ class TCatInputSpec(AFNICommandInputSpec): class TCat(AFNICommand): """Concatenate sub-bricks from input datasets into one big 3D+time dataset. - TODO Replace InputMultiObject in_files with Traits.List, if possible. Current + TODO Replace InputMultiPath in_files with Traits.List, if possible. Current version adds extra whitespace. For complete details, see the `3dTcat Documentation. @@ -2628,7 +2628,7 @@ class Axialize(AFNICommand): class ZcatInputSpec(AFNICommandInputSpec): - in_files = InputMultiObject( + in_files = InputMultiPath( File(desc='input files to 3dZcat', exists=True), argstr='%s', position=-1, diff --git a/nipype/interfaces/ants/legacy.py b/nipype/interfaces/ants/legacy.py index 69352d117d..9ca5844426 100644 --- a/nipype/interfaces/ants/legacy.py +++ b/nipype/interfaces/ants/legacy.py @@ -18,7 +18,7 @@ from glob import glob from .base import ANTSCommand, ANTSCommandInputSpec -from ..base import TraitedSpec, File, traits, isdefined, OutputMultiObject +from ..base import TraitedSpec, File, traits, isdefined, OutputMultiPath from ...utils.filemanip import split_filename @@ -255,9 +255,9 @@ class buildtemplateparallelInputSpec(ANTSCommandInputSpec): class buildtemplateparallelOutputSpec(TraitedSpec): final_template_file = File(exists=True, desc='final ANTS template') - template_files = OutputMultiObject( + template_files = OutputMultiPath( File(exists=True), desc='Templates from different stages of iteration') - subject_outfiles = OutputMultiObject( + subject_outfiles = OutputMultiPath( File(exists=True), desc=('Outputs for each input image. Includes warp ' 'field, inverse warp, Affine, original image ' diff --git a/nipype/interfaces/ants/registration.py b/nipype/interfaces/ants/registration.py index 90411591f0..843e9b3043 100644 --- a/nipype/interfaces/ants/registration.py +++ b/nipype/interfaces/ants/registration.py @@ -14,7 +14,7 @@ import os from ...utils.filemanip import filename_to_list -from ..base import TraitedSpec, File, Str, traits, InputMultiObject, isdefined +from ..base import TraitedSpec, File, Str, traits, InputMultiPath, isdefined from .base import ANTSCommand, ANTSCommandInputSpec @@ -26,12 +26,12 @@ class ANTSInputSpec(ANTSCommandInputSpec): usedefault=False, position=1, desc='image dimension (2 or 3)') - fixed_image = InputMultiObject( + fixed_image = InputMultiPath( File(exists=True), mandatory=True, desc=('image to which the moving image is ' 'warped')) - moving_image = InputMultiObject( + moving_image = InputMultiPath( File(exists=True), argstr='%s', mandatory=True, @@ -257,7 +257,7 @@ class RegistrationInputSpec(ANTSCommandInputSpec): argstr='--dimensionality %d', usedefault=True, desc='image dimension (2 or 3)') - fixed_image = InputMultiObject( + fixed_image = InputMultiPath( File(exists=True), mandatory=True, desc='Image to which the moving_image should be transformed' @@ -269,14 +269,14 @@ class RegistrationInputSpec(ANTSCommandInputSpec): xor=['fixed_image_masks'], desc='Mask used to limit metric sampling region of the fixed image' 'in all stages') - fixed_image_masks = InputMultiObject( + fixed_image_masks = InputMultiPath( traits.Either('NULL', File(exists=True)), min_ver='2.2.0', xor=['fixed_image_mask'], desc= 'Masks used to limit metric sampling region of the fixed image, defined per registration stage' '(Use "NULL" to omit a mask at a given stage)') - moving_image = InputMultiObject( + moving_image = InputMultiPath( File(exists=True), mandatory=True, desc= @@ -289,7 +289,7 @@ class RegistrationInputSpec(ANTSCommandInputSpec): xor=['moving_image_masks'], desc='mask used to limit metric sampling region of the moving image' 'in all stages') - moving_image_masks = InputMultiObject( + moving_image_masks = InputMultiPath( traits.Either('NULL', File(exists=True)), min_ver='2.2.0', xor=['moving_image_mask'], @@ -310,14 +310,14 @@ class RegistrationInputSpec(ANTSCommandInputSpec): 'Filename for restoring the internal restorable state of the registration' ) - initial_moving_transform = InputMultiObject( + initial_moving_transform = InputMultiPath( File(exists=True), argstr='%s', desc='A transform or a list of transforms that should be applied' 'before the registration begins. Note that, when a list is given,' 'the transformations are applied in reverse order.', xor=['initial_moving_transform_com']) - invert_initial_moving_transform = InputMultiObject( + invert_initial_moving_transform = InputMultiPath( traits.Bool(), requires=["initial_moving_transform"], desc='One boolean or a list of booleans that indicate' diff --git a/nipype/interfaces/ants/resampling.py b/nipype/interfaces/ants/resampling.py index 6d7b775e28..a3f5723ba8 100644 --- a/nipype/interfaces/ants/resampling.py +++ b/nipype/interfaces/ants/resampling.py @@ -13,7 +13,7 @@ import os from .base import ANTSCommand, ANTSCommandInputSpec -from ..base import TraitedSpec, File, traits, isdefined, InputMultiObject +from ..base import TraitedSpec, File, traits, isdefined, InputMultiPath from ...utils.filemanip import split_filename @@ -55,7 +55,7 @@ class WarpTimeSeriesImageMultiTransformInputSpec(ANTSCommandInputSpec): argstr='--use-NN', desc='Use nearest neighbor interpolation') use_bspline = traits.Bool( argstr='--use-Bspline', desc='Use 3rd order B-Spline interpolation') - transformation_series = InputMultiObject( + transformation_series = InputMultiPath( File(exists=True), argstr='%s', desc='transformation file(s) to be applied', @@ -197,7 +197,7 @@ class WarpImageMultiTransformInputSpec(ANTSCommandInputSpec): argstr='--use-NN', desc='Use nearest neighbor interpolation') use_bspline = traits.Bool( argstr='--use-BSpline', desc='Use 3rd order B-Spline interpolation') - transformation_series = InputMultiObject( + transformation_series = InputMultiPath( File(exists=True), argstr='%s', desc='transformation file(s) to be applied', @@ -350,13 +350,13 @@ class ApplyTransformsInputSpec(ANTSCommandInputSpec): traits.Float(), # Gaussian/MultiLabel (sigma, alpha) traits.Float())) transforms = traits.Either( - InputMultiObject(File(exists=True)), + InputMultiPath(File(exists=True)), 'identity', 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 = InputMultiObject(traits.Bool()) + 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( diff --git a/nipype/interfaces/ants/segmentation.py b/nipype/interfaces/ants/segmentation.py index d49e46f1a7..b82db2e401 100644 --- a/nipype/interfaces/ants/segmentation.py +++ b/nipype/interfaces/ants/segmentation.py @@ -15,7 +15,7 @@ import os from ...external.due import BibTeX from ...utils.filemanip import split_filename, copyfile, which -from ..base import TraitedSpec, File, traits, InputMultiObject, OutputMultiObject, isdefined +from ..base import TraitedSpec, File, traits, InputMultiPath, OutputMultiPath, isdefined from .base import ANTSCommand, ANTSCommandInputSpec @@ -27,7 +27,7 @@ class AtroposInputSpec(ANTSCommandInputSpec): argstr='--image-dimensionality %d', usedefault=True, desc='image dimension (2, 3, or 4)') - intensity_images = InputMultiObject( + intensity_images = InputMultiPath( File(exists=True), argstr="--intensity-image %s...", mandatory=True) mask_image = File(exists=True, argstr='--mask-image %s', mandatory=True) initialization = traits.Enum( @@ -39,7 +39,7 @@ class AtroposInputSpec(ANTSCommandInputSpec): argstr="%s", requires=['number_of_tissue_classes'], mandatory=True) - prior_probability_images = InputMultiObject(File(exists=True)) + prior_probability_images = InputMultiPath(File(exists=True)) number_of_tissue_classes = traits.Int(mandatory=True) prior_weighting = traits.Float() prior_probability_threshold = traits.Float(requires=['prior_weighting']) @@ -68,7 +68,7 @@ class AtroposInputSpec(ANTSCommandInputSpec): class AtroposOutputSpec(TraitedSpec): classified_image = File(exists=True) - posteriors = OutputMultiObject(File(exist=True)) + posteriors = OutputMultiPath(File(exist=True)) class Atropos(ANTSCommand): @@ -478,7 +478,7 @@ class CorticalThicknessInputSpec(ANTSCommandInputSpec): desc='brain probability mask in template space', copyfile=False, mandatory=True) - segmentation_priors = InputMultiObject( + segmentation_priors = InputMultiPath( File(exists=True), argstr='-p %s', mandatory=True) out_prefix = traits.Str( 'antsCT_', @@ -578,7 +578,7 @@ class CorticalThicknessOutputSpec(TraitedSpec): BrainExtractionMask = File(exists=True, desc='brain extraction mask') BrainSegmentation = File(exists=True, desc='brain segmentaion image') BrainSegmentationN4 = File(exists=True, desc='N4 corrected image') - BrainSegmentationPosteriors = OutputMultiObject( + BrainSegmentationPosteriors = OutputMultiPath( File(exists=True), desc='Posterior probability images') CorticalThickness = File(exists=True, desc='cortical thickness file') TemplateToSubject1GenericAffine = File( @@ -945,17 +945,17 @@ class JointFusionInputSpec(ANTSCommandInputSpec): position=1, mandatory=True, desc='Number of modalities or features') - warped_intensity_images = InputMultiObject( + warped_intensity_images = InputMultiPath( File(exists=True), argstr="-g %s...", mandatory=True, desc='Warped atlas images') - target_image = InputMultiObject( + target_image = InputMultiPath( File(exists=True), argstr='-tg %s...', mandatory=True, desc='Target image(s)') - warped_label_images = InputMultiObject( + warped_label_images = InputMultiPath( File(exists=True), argstr="-l %s...", mandatory=True, @@ -1188,20 +1188,20 @@ class AntsJointFusionInputSpec(ANTSCommandInputSpec): 'specified, the program tries to infer the ' 'dimensionality from the input image.') target_image = traits.List( - InputMultiObject(File(exists=True)), + InputMultiPath(File(exists=True)), argstr='-t %s', mandatory=True, desc='The target image (or ' 'multimodal target images) assumed to be ' 'aligned to a common image domain.') atlas_image = traits.List( - InputMultiObject(File(exists=True)), + InputMultiPath(File(exists=True)), argstr="-g %s...", mandatory=True, desc='The atlas image (or ' 'multimodal atlas images) assumed to be ' 'aligned to a common image domain.') - atlas_segmentation_image = InputMultiObject( + atlas_segmentation_image = InputMultiPath( File(exists=True), argstr="-l %s...", mandatory=True, diff --git a/nipype/interfaces/ants/tests/test_spec_JointFusion.py b/nipype/interfaces/ants/tests/test_spec_JointFusion.py index 79f505bbec..b2ca69926a 100644 --- a/nipype/interfaces/ants/tests/test_spec_JointFusion.py +++ b/nipype/interfaces/ants/tests/test_spec_JointFusion.py @@ -2,7 +2,7 @@ from __future__ import division from builtins import range from nipype.testing import example_data -from nipype.interfaces.base import InputMultiObject +from nipype.interfaces.base import InputMultiPath from traits.trait_errors import TraitError from nipype.interfaces.ants import JointFusion import pytest @@ -83,5 +83,5 @@ def test_JointFusion_cmd(): assert at.cmdline == expected_command # setting intensity or labels with unequal lengths raises error with pytest.raises(AssertionError): - at._format_arg('warped_intensity_images', InputMultiObject, + at._format_arg('warped_intensity_images', InputMultiPath, warped_intensity_images + [example_data('im3.nii')]) diff --git a/nipype/interfaces/ants/utils.py b/nipype/interfaces/ants/utils.py index 3509b85dbc..43a3b4b98c 100644 --- a/nipype/interfaces/ants/utils.py +++ b/nipype/interfaces/ants/utils.py @@ -12,7 +12,7 @@ import os -from ..base import TraitedSpec, File, traits, InputMultiObject +from ..base import TraitedSpec, File, traits, InputMultiPath from .base import ANTSCommand, ANTSCommandInputSpec @@ -30,7 +30,7 @@ class AverageAffineTransformInputSpec(ANTSCommandInputSpec): mandatory=True, position=1, desc='Outputfname.txt: the name of the resulting transform.') - transforms = InputMultiObject( + transforms = InputMultiPath( File(exists=True), argstr='%s', mandatory=True, @@ -89,7 +89,7 @@ class AverageImagesInputSpec(ANTSCommandInputSpec): position=2, desc='Normalize: if true, the 2nd image is divided by its mean. ' 'This will select the largest image to average into.') - images = InputMultiObject( + images = InputMultiPath( File(exists=True), argstr='%s', mandatory=True, @@ -337,7 +337,7 @@ class ComposeMultiTransformInputSpec(ANTSCommandInputSpec): argstr='%s', position=2, desc='Reference image (only necessary when output is warpfield)') - transforms = InputMultiObject( + transforms = InputMultiPath( File(exists=True), argstr='%s', mandatory=True, diff --git a/nipype/interfaces/base/__init__.py b/nipype/interfaces/base/__init__.py index a570584ec2..cb24ea50a9 100644 --- a/nipype/interfaces/base/__init__.py +++ b/nipype/interfaces/base/__init__.py @@ -18,8 +18,8 @@ from .traits_extension import ( traits, Undefined, TraitDictObject, TraitListObject, TraitError, isdefined, - File, Directory, Str, DictStrStr, has_metadata, ImageFile, MultiObject, - OutputMultiObject, InputMultiObject) + File, Directory, Str, DictStrStr, has_metadata, ImageFile, MultiPath, + OutputMultiPath, InputMultiPath) from .support import (Bunch, InterfaceResult, load_template, NipypeInterfaceError) diff --git a/nipype/interfaces/base/traits_extension.py b/nipype/interfaces/base/traits_extension.py index f8618f0198..5b3e9f94d7 100644 --- a/nipype/interfaces/base/traits_extension.py +++ b/nipype/interfaces/base/traits_extension.py @@ -305,8 +305,8 @@ def has_metadata(trait, metadata, value=None, recursive=True): return count > 0 -class MultiObject(traits.List): - """ Abstract class - shared functionality of input and output MultiObject +class MultiPath(traits.List): + """ Abstract class - shared functionality of input and output MultiPath """ def validate(self, object, name, value): @@ -327,12 +327,12 @@ def validate(self, object, name, value): isinstance(self.inner_traits()[0].trait_type, traits.List) and not isinstance(self.inner_traits()[0].trait_type, - InputMultiObject) and + InputMultiPath) and isinstance(value, list) and value and not isinstance(value[0], list)): newvalue = [value] - value = super(MultiObject, self).validate(object, name, newvalue) + value = super(MultiPath, self).validate(object, name, newvalue) if value: return value @@ -340,7 +340,7 @@ def validate(self, object, name, value): self.error(object, name, value) -class OutputMultiObject(MultiObject): +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 @@ -352,9 +352,9 @@ class OutputMultiObject(MultiObject): XXX This needs to be vetted by somebody who understands traits - >>> from nipype.interfaces.base import OutputMultiObject, TraitedSpec + >>> from nipype.interfaces.base import OutputMultiPath, TraitedSpec >>> class A(TraitedSpec): - ... foo = OutputMultiObject(File(exists=False)) + ... foo = OutputMultiPath(File(exists=False)) >>> a = A() >>> a.foo @@ -386,7 +386,7 @@ def set(self, object, name, value): self.set_value(object, name, value) -class InputMultiObject(MultiObject): +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 @@ -397,9 +397,9 @@ class InputMultiObject(MultiObject): XXX This needs to be vetted by somebody who understands traits - >>> from nipype.interfaces.base import InputMultiObject, TraitedSpec + >>> from nipype.interfaces.base import InputMultiPath, TraitedSpec >>> class A(TraitedSpec): - ... foo = InputMultiObject(File(exists=False)) + ... foo = InputMultiPath(File(exists=False)) >>> a = A() >>> a.foo diff --git a/nipype/interfaces/camino/convert.py b/nipype/interfaces/camino/convert.py index 37a0651c71..3091efd348 100644 --- a/nipype/interfaces/camino/convert.py +++ b/nipype/interfaces/camino/convert.py @@ -15,7 +15,7 @@ from ...utils.filemanip import split_filename from ..base import (CommandLineInputSpec, CommandLine, traits, TraitedSpec, - File, StdOutCommandLine, OutputMultiObject, + File, StdOutCommandLine, OutputMultiPath, StdOutCommandLineInputSpec, isdefined) @@ -422,7 +422,7 @@ class ProcStreamlinesInputSpec(StdOutCommandLineInputSpec): class ProcStreamlinesOutputSpec(TraitedSpec): proc = File(exists=True, desc='Processed Streamlines') - outputroot_files = OutputMultiObject(File(exists=True)) + outputroot_files = OutputMultiPath(File(exists=True)) class ProcStreamlines(StdOutCommandLine): diff --git a/nipype/interfaces/camino/dti.py b/nipype/interfaces/camino/dti.py index 925b972a67..a3b0f74c48 100644 --- a/nipype/interfaces/camino/dti.py +++ b/nipype/interfaces/camino/dti.py @@ -15,7 +15,7 @@ from ...utils.filemanip import split_filename from ..base import (CommandLineInputSpec, CommandLine, traits, TraitedSpec, File, Directory, StdOutCommandLine, - StdOutCommandLineInputSpec, isdefined, InputMultiObject) + StdOutCommandLineInputSpec, isdefined, InputMultiPath) class DTIFitInputSpec(StdOutCommandLineInputSpec): @@ -533,7 +533,7 @@ class PicoPDFsInputSpec(StdOutCommandLineInputSpec): desc='input model type', usedefault=True) - luts = InputMultiObject( + luts = InputMultiPath( File(exists=True), argstr='-luts %s', mandatory=True, diff --git a/nipype/interfaces/camino/utils.py b/nipype/interfaces/camino/utils.py index 5345b9e64f..1146927dc5 100644 --- a/nipype/interfaces/camino/utils.py +++ b/nipype/interfaces/camino/utils.py @@ -12,12 +12,12 @@ import os from ..base import (traits, TraitedSpec, File, CommandLine, - CommandLineInputSpec, InputMultiObject) + CommandLineInputSpec, InputMultiPath) from ...utils.filemanip import split_filename class ImageStatsInputSpec(CommandLineInputSpec): - in_files = InputMultiObject( + in_files = InputMultiPath( File(exists=True), argstr='-images %s', mandatory=True, diff --git a/nipype/interfaces/cmtk/cmtk.py b/nipype/interfaces/cmtk/cmtk.py index f0a297112b..c7ca43cd4e 100644 --- a/nipype/interfaces/cmtk/cmtk.py +++ b/nipype/interfaces/cmtk/cmtk.py @@ -26,7 +26,7 @@ from ...utils import NUMPY_MMAP from ..base import (BaseInterface, BaseInterfaceInputSpec, traits, File, - TraitedSpec, Directory, OutputMultiObject, isdefined) + TraitedSpec, Directory, OutputMultiPath, isdefined) iflogger = logging.getLogger('interface') @@ -504,11 +504,11 @@ class CreateMatrixOutputSpec(TraitedSpec): desc='NetworkX graph describing the connectivity', exists=True) intersection_matrix_file = File( desc='NetworkX graph describing the connectivity', exists=True) - matrix_files = OutputMultiObject( + matrix_files = OutputMultiPath( File( desc='All of the gpickled network files output by this interface', exists=True)) - matlab_matrix_files = OutputMultiObject( + matlab_matrix_files = OutputMultiPath( File( desc='All of the MATLAB .mat files output by this interface', exists=True)) @@ -550,7 +550,7 @@ class CreateMatrixOutputSpec(TraitedSpec): filtered_tractography_by_intersections = File( desc='TrackVis file containing all fibers which connect two regions', exists=True) - filtered_tractographies = OutputMultiObject( + filtered_tractographies = OutputMultiPath( File( desc= 'TrackVis file containing only those fibers originate in one and terminate in another region', diff --git a/nipype/interfaces/cmtk/convert.py b/nipype/interfaces/cmtk/convert.py index 47ade596dd..fc2dd98f28 100644 --- a/nipype/interfaces/cmtk/convert.py +++ b/nipype/interfaces/cmtk/convert.py @@ -19,7 +19,7 @@ from ...utils.misc import package_check from ...utils.filemanip import split_filename from ..base import (BaseInterface, BaseInterfaceInputSpec, traits, File, - TraitedSpec, InputMultiObject, isdefined) + TraitedSpec, InputMultiPath, isdefined) have_cfflib = True try: @@ -31,25 +31,25 @@ class CFFConverterInputSpec(BaseInterfaceInputSpec): - graphml_networks = InputMultiObject( + graphml_networks = InputMultiPath( File(exists=True), desc='list of graphML networks') - gpickled_networks = InputMultiObject( + gpickled_networks = InputMultiPath( File(exists=True), desc='list of gpickled Networkx graphs') - gifti_surfaces = InputMultiObject( + gifti_surfaces = InputMultiPath( File(exists=True), desc='list of GIFTI surfaces') - gifti_labels = InputMultiObject( + gifti_labels = InputMultiPath( File(exists=True), desc='list of GIFTI labels') - nifti_volumes = InputMultiObject( + nifti_volumes = InputMultiPath( File(exists=True), desc='list of NIFTI volumes') - tract_files = InputMultiObject( + tract_files = InputMultiPath( File(exists=True), desc='list of Trackvis fiber files') - timeseries_files = InputMultiObject( + timeseries_files = InputMultiPath( File(exists=True), desc='list of HDF5 timeseries files') - script_files = InputMultiObject( + script_files = InputMultiPath( File(exists=True), desc='list of script files to include') - data_files = InputMultiObject( + data_files = InputMultiPath( File(exists=True), desc='list of external data files (i.e. Numpy, HD5, XML) ') @@ -225,7 +225,7 @@ def _list_outputs(self): class MergeCNetworksInputSpec(BaseInterfaceInputSpec): - in_files = InputMultiObject( + in_files = InputMultiPath( File(exists=True), mandatory=True, desc='List of CFF files to extract networks from') diff --git a/nipype/interfaces/cmtk/nbs.py b/nipype/interfaces/cmtk/nbs.py index 954b6d1b4e..954b4d53df 100644 --- a/nipype/interfaces/cmtk/nbs.py +++ b/nipype/interfaces/cmtk/nbs.py @@ -12,7 +12,7 @@ from ... import logging from ...utils.misc import package_check from ..base import (BaseInterface, BaseInterfaceInputSpec, traits, File, - TraitedSpec, InputMultiObject, OutputMultiObject, isdefined) + TraitedSpec, InputMultiPath, OutputMultiPath, isdefined) iflogger = logging.getLogger('interface') have_cv = True @@ -44,11 +44,11 @@ def ntwks_to_matrices(in_files, edge_key): class NetworkBasedStatisticInputSpec(BaseInterfaceInputSpec): - in_group1 = InputMultiObject( + in_group1 = InputMultiPath( File(exists=True), mandatory=True, desc='Networks for the first group of subjects') - in_group2 = InputMultiObject( + in_group2 = InputMultiPath( File(exists=True), mandatory=True, desc='Networks for the second group of subjects') @@ -87,7 +87,7 @@ class NetworkBasedStatisticOutputSpec(TraitedSpec): desc= 'Output network with p-values to weight the edges identified by the NBS' ) - network_files = OutputMultiObject( + network_files = OutputMultiPath( File(exists=True), desc='Output network with edges identified by the NBS') diff --git a/nipype/interfaces/cmtk/nx.py b/nipype/interfaces/cmtk/nx.py index 9a43ebce94..1072188cbc 100644 --- a/nipype/interfaces/cmtk/nx.py +++ b/nipype/interfaces/cmtk/nx.py @@ -24,7 +24,7 @@ from ...utils.filemanip import split_filename from ...utils.misc import package_check from ..base import (BaseInterface, BaseInterfaceInputSpec, traits, File, - TraitedSpec, InputMultiObject, OutputMultiObject, isdefined) + TraitedSpec, InputMultiPath, OutputMultiPath, isdefined) iflogger = logging.getLogger('interface') @@ -407,9 +407,9 @@ class NetworkXMetricsInputSpec(BaseInterfaceInputSpec): class NetworkXMetricsOutputSpec(TraitedSpec): - gpickled_network_files = OutputMultiObject( + gpickled_network_files = OutputMultiPath( File(desc='Output gpickled network files')) - matlab_matrix_files = OutputMultiObject( + matlab_matrix_files = OutputMultiPath( File(desc='Output network metrics in MATLAB .mat format')) global_measures_matlab = File( desc='Output global metrics in MATLAB .mat format') @@ -417,11 +417,11 @@ class NetworkXMetricsOutputSpec(TraitedSpec): desc='Output node metrics in MATLAB .mat format') edge_measures_matlab = File( desc='Output edge metrics in MATLAB .mat format') - node_measure_networks = OutputMultiObject( + node_measure_networks = OutputMultiPath( File(desc='Output gpickled network files for all node-based measures')) - edge_measure_networks = OutputMultiObject( + edge_measure_networks = OutputMultiPath( File(desc='Output gpickled network files for all edge-based measures')) - k_networks = OutputMultiObject( + k_networks = OutputMultiPath( File( desc= 'Output gpickled network files for the k-core, k-shell, and k-crust networks' @@ -435,7 +435,7 @@ class NetworkXMetricsOutputSpec(TraitedSpec): desc= 'Network measures for the group that return dictionaries, stored as a Pickle.' ) - matlab_dict_measures = OutputMultiObject( + matlab_dict_measures = OutputMultiPath( File( desc= 'Network measures for the group that return dictionaries, stored as matlab matrices.' @@ -594,7 +594,7 @@ def _gen_outfilename(self, name, ext): class AverageNetworksInputSpec(BaseInterfaceInputSpec): - in_files = InputMultiObject( + in_files = InputMultiPath( File(exists=True), mandatory=True, desc='Networks for a group of subjects') @@ -613,7 +613,7 @@ class AverageNetworksInputSpec(BaseInterfaceInputSpec): class AverageNetworksOutputSpec(TraitedSpec): gpickled_groupavg = File(desc='Average network saved as a NetworkX .pck') gexf_groupavg = File(desc='Average network saved as a .gexf file') - matlab_groupavgs = OutputMultiObject( + matlab_groupavgs = OutputMultiPath( File(desc='Average network saved as a .gexf file')) diff --git a/nipype/interfaces/dcm2nii.py b/nipype/interfaces/dcm2nii.py index 0fa4b3ec11..f4e8065b36 100644 --- a/nipype/interfaces/dcm2nii.py +++ b/nipype/interfaces/dcm2nii.py @@ -15,12 +15,12 @@ from copy import deepcopy from ..utils.filemanip import split_filename -from .base import (CommandLine, CommandLineInputSpec, InputMultiObject, traits, - TraitedSpec, OutputMultiObject, isdefined, File, Directory) +from .base import (CommandLine, CommandLineInputSpec, InputMultiPath, traits, + TraitedSpec, OutputMultiPath, isdefined, File, Directory) class Dcm2niiInputSpec(CommandLineInputSpec): - source_names = InputMultiObject( + source_names = InputMultiPath( File(exists=True), argstr="%s", position=-1, @@ -87,11 +87,11 @@ class Dcm2niiInputSpec(CommandLineInputSpec): class Dcm2niiOutputSpec(TraitedSpec): - converted_files = OutputMultiObject(File(exists=True)) - reoriented_files = OutputMultiObject(File(exists=True)) - reoriented_and_cropped_files = OutputMultiObject(File(exists=True)) - bvecs = OutputMultiObject(File(exists=True)) - bvals = OutputMultiObject(File(exists=True)) + converted_files = OutputMultiPath(File(exists=True)) + reoriented_files = OutputMultiPath(File(exists=True)) + reoriented_and_cropped_files = OutputMultiPath(File(exists=True)) + bvecs = OutputMultiPath(File(exists=True)) + bvals = OutputMultiPath(File(exists=True)) class Dcm2nii(CommandLine): @@ -252,7 +252,7 @@ def _gen_filename(self, name): class Dcm2niixInputSpec(CommandLineInputSpec): - source_names = InputMultiObject( + source_names = InputMultiPath( File(exists=True), argstr="%s", position=-1, @@ -298,10 +298,10 @@ class Dcm2niixInputSpec(CommandLineInputSpec): class Dcm2niixOutputSpec(TraitedSpec): - converted_files = OutputMultiObject(File(exists=True)) - bvecs = OutputMultiObject(File(exists=True)) - bvals = OutputMultiObject(File(exists=True)) - bids = OutputMultiObject(File(exists=True)) + converted_files = OutputMultiPath(File(exists=True)) + bvecs = OutputMultiPath(File(exists=True)) + bvals = OutputMultiPath(File(exists=True)) + bids = OutputMultiPath(File(exists=True)) class Dcm2niix(CommandLine): diff --git a/nipype/interfaces/dcmstack.py b/nipype/interfaces/dcmstack.py index a298157b49..80a26365f1 100644 --- a/nipype/interfaces/dcmstack.py +++ b/nipype/interfaces/dcmstack.py @@ -20,7 +20,7 @@ import nibabel as nb import imghdr -from .base import (TraitedSpec, DynamicTraitedSpec, InputMultiObject, File, +from .base import (TraitedSpec, DynamicTraitedSpec, InputMultiPath, File, Directory, traits, BaseInterface, isdefined, Undefined) from ..utils import NUMPY_MMAP @@ -96,7 +96,7 @@ def _get_out_path(self, meta, idx=None): class DcmStackInputSpec(NiftiGeneratorBaseInputSpec): dicom_files = traits.Either( - InputMultiObject(File(exists=True)), + InputMultiPath(File(exists=True)), Directory(exists=True), traits.Str(), mandatory=True) diff --git a/nipype/interfaces/diffusion_toolkit/postproc.py b/nipype/interfaces/diffusion_toolkit/postproc.py index c5570108fe..3536cc2643 100644 --- a/nipype/interfaces/diffusion_toolkit/postproc.py +++ b/nipype/interfaces/diffusion_toolkit/postproc.py @@ -14,7 +14,7 @@ absolute_import) import os -from ..base import (TraitedSpec, File, traits, CommandLine, InputMultiObject, +from ..base import (TraitedSpec, File, traits, CommandLine, InputMultiPath, CommandLineInputSpec) __docformat__ = 'restructuredtext' @@ -75,7 +75,7 @@ def _list_outputs(self): class TrackMergeInputSpec(CommandLineInputSpec): - track_files = InputMultiObject( + track_files = InputMultiPath( File(exists=True), desc="file containing tracks to be filtered", position=0, diff --git a/nipype/interfaces/dipy/simulate.py b/nipype/interfaces/dipy/simulate.py index d1c7e8776f..282f79519a 100644 --- a/nipype/interfaces/dipy/simulate.py +++ b/nipype/interfaces/dipy/simulate.py @@ -17,21 +17,21 @@ from ... import logging from ...utils import NUMPY_MMAP from ..base import (traits, TraitedSpec, BaseInterfaceInputSpec, File, - InputMultiObject, isdefined) + InputMultiPath, isdefined) from .base import DipyBaseInterface IFLOGGER = logging.getLogger('interface') class SimulateMultiTensorInputSpec(BaseInterfaceInputSpec): - in_dirs = InputMultiObject( + in_dirs = InputMultiPath( File(exists=True), mandatory=True, desc='list of fibers (principal directions)') - in_frac = InputMultiObject( + in_frac = InputMultiPath( File(exists=True), mandatory=True, desc=('volume fraction of each fiber')) - in_vfms = InputMultiObject( + in_vfms = InputMultiPath( File(exists=True), mandatory=True, desc=('volume fractions of isotropic ' diff --git a/nipype/interfaces/elastix/registration.py b/nipype/interfaces/elastix/registration.py index 127f4084d5..a19e337eb4 100644 --- a/nipype/interfaces/elastix/registration.py +++ b/nipype/interfaces/elastix/registration.py @@ -16,7 +16,7 @@ from ... import logging from .base import ElastixBaseInputSpec -from ..base import CommandLine, TraitedSpec, File, traits, InputMultiObject +from ..base import CommandLine, TraitedSpec, File, traits, InputMultiPath iflogger = logging.getLogger('interface') @@ -26,7 +26,7 @@ class RegistrationInputSpec(ElastixBaseInputSpec): exists=True, mandatory=True, argstr='-f %s', desc='fixed image') moving_image = File( exists=True, mandatory=True, argstr='-m %s', desc='moving image') - parameters = InputMultiObject( + parameters = InputMultiPath( File(exists=True), mandatory=True, argstr='-p %s...', @@ -42,9 +42,9 @@ class RegistrationInputSpec(ElastixBaseInputSpec): class RegistrationOutputSpec(TraitedSpec): - transform = InputMultiObject(File(exists=True), desc='output transform') + transform = InputMultiPath(File(exists=True), desc='output transform') warped_file = File(desc='input moving image warped to fixed image') - warped_files = InputMultiObject( + warped_files = InputMultiPath( File(exists=False), desc=('input moving image warped to fixed image at each level')) warped_files_flags = traits.List( diff --git a/nipype/interfaces/freesurfer/longitudinal.py b/nipype/interfaces/freesurfer/longitudinal.py index a911f1c467..72b71adfe1 100644 --- a/nipype/interfaces/freesurfer/longitudinal.py +++ b/nipype/interfaces/freesurfer/longitudinal.py @@ -16,7 +16,7 @@ import os from ... import logging -from ..base import (TraitedSpec, File, traits, InputMultiObject, OutputMultiObject, +from ..base import (TraitedSpec, File, traits, InputMultiPath, OutputMultiPath, isdefined) from .base import (FSCommand, FSTraitedSpec, FSCommandOpenMP, FSTraitedSpecOpenMP) @@ -27,7 +27,7 @@ class RobustTemplateInputSpec(FSTraitedSpecOpenMP): # required - in_files = InputMultiObject( + in_files = InputMultiPath( File(exists=True), mandatory=True, argstr='--mov %s', @@ -53,7 +53,7 @@ class RobustTemplateInputSpec(FSTraitedSpecOpenMP): 'values mean less sensitivity.') # optional transform_outputs = traits.Either( - InputMultiObject(File(exists=False)), + InputMultiPath(File(exists=False)), traits.Bool, argstr='--lta %s', desc='output xforms to template (for each input)') @@ -62,7 +62,7 @@ class RobustTemplateInputSpec(FSTraitedSpecOpenMP): argstr='--iscale', desc='allow also intensity scaling (default off)') scaled_intensity_outputs = traits.Either( - InputMultiObject(File(exists=False)), + InputMultiPath(File(exists=False)), traits.Bool, argstr='--iscaleout %s', desc='final intensity scales (will activate --iscale)') @@ -85,11 +85,11 @@ class RobustTemplateInputSpec(FSTraitedSpecOpenMP): default_value=False, argstr='--noit', desc='do not iterate, just create first template') - initial_transforms = InputMultiObject( + initial_transforms = InputMultiPath( File(exists=True), argstr='--ixforms %s', desc='use initial transforms (lta) on source') - in_intensity_scales = InputMultiObject( + in_intensity_scales = InputMultiPath( File(exists=True), argstr='--iscalein %s', desc='use initial intensity scales') @@ -98,9 +98,9 @@ class RobustTemplateInputSpec(FSTraitedSpecOpenMP): class RobustTemplateOutputSpec(TraitedSpec): out_file = File( exists=True, desc='output template volume (final mean/median image)') - transform_outputs = OutputMultiObject( + transform_outputs = OutputMultiPath( File(exists=True), desc="output xform files from moving to template") - scaled_intensity_outputs = OutputMultiObject( + scaled_intensity_outputs = OutputMultiPath( File(exists=True), desc="output final intensity scales") @@ -184,7 +184,7 @@ class FuseSegmentationsInputSpec(FSTraitedSpec): # required subject_id = traits.String( argstr='%s', position=-3, desc="subject_id being processed") - timepoints = InputMultiObject( + timepoints = InputMultiPath( traits.String(), mandatory=True, argstr='%s', @@ -195,19 +195,19 @@ class FuseSegmentationsInputSpec(FSTraitedSpec): mandatory=True, position=-1, desc="output fused segmentation file") - in_segmentations = InputMultiObject( + in_segmentations = InputMultiPath( File(exists=True), argstr="-a %s", mandatory=True, desc="name of aseg file to use (default: aseg.mgz) \ must include the aseg files for all the given timepoints") - in_segmentations_noCC = InputMultiObject( + in_segmentations_noCC = InputMultiPath( File(exists=True), argstr="-c %s", mandatory=True, desc="name of aseg file w/o CC labels (default: aseg.auto_noCCseg.mgz) \ must include the corresponding file for all the given timepoints") - in_norms = InputMultiObject( + in_norms = InputMultiPath( File(exists=True), argstr="-n %s", mandatory=True, diff --git a/nipype/interfaces/freesurfer/model.py b/nipype/interfaces/freesurfer/model.py index 217f717e54..4e9a4d0352 100644 --- a/nipype/interfaces/freesurfer/model.py +++ b/nipype/interfaces/freesurfer/model.py @@ -17,7 +17,7 @@ import os from ...utils.filemanip import fname_presuffix, split_filename -from ..base import (TraitedSpec, File, traits, InputMultiObject, OutputMultiObject, +from ..base import (TraitedSpec, File, traits, InputMultiPath, OutputMultiPath, Directory, isdefined) from .base import FSCommand, FSTraitedSpec from .utils import copy2subjdir @@ -58,7 +58,7 @@ class MRISPreprocInputSpec(FSTraitedSpec): argstr='--f %s', xor=('subjects', 'fsgd_file', 'subject_file'), desc='file specifying subjects separated by white space') - surf_measure_file = InputMultiObject( + surf_measure_file = InputMultiPath( File(exists=True), argstr='--is %s...', xor=('surf_measure', 'surf_measure_file', 'surf_area'), @@ -66,7 +66,7 @@ class MRISPreprocInputSpec(FSTraitedSpec): source_format = traits.Str(argstr='--srcfmt %s', desc='source format') surf_dir = traits.Str( argstr='--surfdir %s', desc='alternative directory (instead of surf)') - vol_measure_file = InputMultiObject( + vol_measure_file = InputMultiPath( traits.Tuple(File(exists=True), File(exists=True)), argstr='--iv %s %s...', desc='list of volume measure and reg file tuples') @@ -141,7 +141,7 @@ class MRISPreprocReconAllInputSpec(MRISPreprocInputSpec): argstr='--meas %s', xor=('surf_measure', 'surf_measure_file', 'surf_area'), desc='file necessary for surfmeas') - surfreg_files = InputMultiObject( + surfreg_files = InputMultiPath( File(exists=True), argstr="--surfreg %s", requires=['lh_surfreg_target', 'rh_surfreg_target'], @@ -241,7 +241,7 @@ class GLMFitInputSpec(FSTraitedSpec): argstr='--X %s', xor=_design_xor, desc='design matrix file') - contrast = InputMultiObject( + contrast = InputMultiPath( File(exists=True), argstr='--C %s...', desc='contrast file') one_sample = traits.Bool( @@ -251,7 +251,7 @@ class GLMFitInputSpec(FSTraitedSpec): no_contrast_ok = traits.Bool( argstr='--no-contrasts-ok', desc='do not fail if no contrasts specified') - per_voxel_reg = InputMultiObject( + per_voxel_reg = InputMultiPath( File(exists=True), argstr='--pvr %s...', desc='per-voxel regressors') self_reg = traits.Tuple( traits.Int, @@ -396,12 +396,12 @@ class GLMFitOutputSpec(TraitedSpec): fwhm_file = File(desc="text file with estimated smoothness") dof_file = File( desc="text file with effective degrees-of-freedom for the analysis") - gamma_file = OutputMultiObject( + gamma_file = OutputMultiPath( desc="map of contrast of regression coefficients") - gamma_var_file = OutputMultiObject( + gamma_var_file = OutputMultiPath( desc="map of regression contrast variance") - sig_file = OutputMultiObject(desc="map of F-test significance (in -log10p)") - ftest_file = OutputMultiObject(desc="map of test statistic values") + sig_file = OutputMultiPath(desc="map of F-test significance (in -log10p)") + ftest_file = OutputMultiPath(desc="map of test statistic values") spatial_eigenvectors = File( desc="map of spatial eigenvectors from residual PCA") frame_eigenvectors = File( @@ -639,7 +639,7 @@ def _gen_filename(self, name): class ConcatenateInputSpec(FSTraitedSpec): - in_files = InputMultiObject( + in_files = InputMultiPath( File(exists=True), desc='Individual volumes to be concatenated', argstr='--i %s...', @@ -1095,7 +1095,7 @@ def run(self, **inputs): class Label2VolInputSpec(FSTraitedSpec): - label_file = InputMultiObject( + label_file = InputMultiPath( File(exists=True), argstr='--label %s...', xor=('label_file', 'annot_file', 'seg_file', 'aparc_aseg'), @@ -1250,7 +1250,7 @@ class MS_LDAInputSpec(FSTraitedSpec): argstr='-W', desc=('Use the weights from a previously ' 'generated weight file')) - images = InputMultiObject( + images = InputMultiPath( File(exists=True), argstr='%s', mandatory=True, diff --git a/nipype/interfaces/freesurfer/preprocess.py b/nipype/interfaces/freesurfer/preprocess.py index d73e8c0b7f..3e70200ad3 100644 --- a/nipype/interfaces/freesurfer/preprocess.py +++ b/nipype/interfaces/freesurfer/preprocess.py @@ -25,8 +25,8 @@ from ... import logging, LooseVersion from ...utils.filemanip import fname_presuffix, check_depends from ..io import FreeSurferSource -from ..base import (TraitedSpec, File, traits, Directory, InputMultiObject, - OutputMultiObject, CommandLine, CommandLineInputSpec, +from ..base import (TraitedSpec, File, traits, Directory, InputMultiPath, + OutputMultiPath, CommandLine, CommandLineInputSpec, isdefined) from .base import (FSCommand, FSTraitedSpec, FSTraitedSpecOpenMP, FSCommandOpenMP, Info) @@ -422,7 +422,7 @@ class MRIConvertInputSpec(FSTraitedSpec): class MRIConvertOutputSpec(TraitedSpec): - out_file = OutputMultiObject(File(exists=True), desc='converted output file') + out_file = OutputMultiPath(File(exists=True), desc='converted output file') class MRIConvert(FSCommand): @@ -750,7 +750,7 @@ class ReconAllInputSpec(CommandLineInputSpec): position=0) hemi = traits.Enum( 'lh', 'rh', desc='hemisphere to process', argstr="-hemi %s") - T1_files = InputMultiObject( + T1_files = InputMultiPath( File(exists=True), argstr='-i %s...', desc='name of T1 file to process') @@ -819,7 +819,7 @@ class ReconAllInputSpec(CommandLineInputSpec): hash_files=False, desc='path to subjects directory', genfile=True) - flags = InputMultiObject( + flags = InputMultiPath( traits.Str, argstr='%s', desc='additional parameters') # Expert options @@ -2455,7 +2455,7 @@ class CARegisterInputSpec(FSTraitedSpecOpenMP): A = traits.Int( argstr='-A %d', desc='undocumented flag used in longitudinal processing') - l_files = InputMultiObject( + l_files = InputMultiPath( File(exists=False), argstr='-l %s', desc='undocumented flag used in longitudinal processing') diff --git a/nipype/interfaces/freesurfer/utils.py b/nipype/interfaces/freesurfer/utils.py index d46c347ce7..0fdfd8bfdb 100644 --- a/nipype/interfaces/freesurfer/utils.py +++ b/nipype/interfaces/freesurfer/utils.py @@ -20,7 +20,7 @@ from ... import logging from ...utils.filemanip import fname_presuffix, split_filename -from ..base import (TraitedSpec, File, traits, OutputMultiObject, isdefined, +from ..base import (TraitedSpec, File, traits, OutputMultiPath, isdefined, CommandLine, CommandLineInputSpec) from .base import (FSCommand, FSTraitedSpec, FSSurfaceCommand, FSScriptCommand, FSScriptOutputSpec, FSTraitedSpecOpenMP, FSCommandOpenMP) @@ -865,7 +865,7 @@ class SurfaceSnapshotsInputSpec(FSTraitedSpec): class SurfaceSnapshotsOutputSpec(TraitedSpec): - snapshots = OutputMultiObject( + snapshots = OutputMultiPath( File(exists=True), desc="tiff images of the surface from different perspectives") diff --git a/nipype/interfaces/fsl/dti.py b/nipype/interfaces/fsl/dti.py index e18d9451a3..cf14d1072f 100644 --- a/nipype/interfaces/fsl/dti.py +++ b/nipype/interfaces/fsl/dti.py @@ -20,8 +20,8 @@ import warnings from ...utils.filemanip import fname_presuffix, split_filename, copyfile -from ..base import (TraitedSpec, isdefined, File, Directory, InputMultiObject, - OutputMultiObject, traits) +from ..base import (TraitedSpec, isdefined, File, Directory, InputMultiPath, + OutputMultiPath, traits) from .base import (FSLCommand, FSLCommandInputSpec, Info) @@ -235,18 +235,18 @@ class FSLXCommandInputSpec(FSLCommandInputSpec): class FSLXCommandOutputSpec(TraitedSpec): - dyads = OutputMultiObject( + dyads = OutputMultiPath( File(exists=True), desc=('Mean of PDD distribution' ' in vector form.')) - fsamples = OutputMultiObject( + 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 = OutputMultiObject( + mean_fsamples = OutputMultiPath( File(exists=True), desc=('Mean of distribution on f ' 'anisotropy')) mean_S0samples = File( @@ -258,9 +258,9 @@ class FSLXCommandOutputSpec(TraitedSpec): desc=('Mean of distribution on ' 'tau samples (only with rician ' 'noise)')) - phsamples = OutputMultiObject( + phsamples = OutputMultiPath( File(exists=True), desc=('phi samples, per fiber')) - thsamples = OutputMultiObject( + thsamples = OutputMultiPath( File(exists=True), desc=('theta samples, per fiber')) @@ -375,30 +375,30 @@ class BEDPOSTX5InputSpec(FSLXCommandInputSpec): class BEDPOSTX5OutputSpec(TraitedSpec): mean_dsamples = File( exists=True, desc='Mean of distribution on diffusivity d') - mean_fsamples = OutputMultiObject( + 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 = OutputMultiObject( + mean_phsamples = OutputMultiPath( File(exists=True), desc='Mean of distribution on phi') - mean_thsamples = OutputMultiObject( + mean_thsamples = OutputMultiPath( File(exists=True), desc='Mean of distribution on theta') - merged_thsamples = OutputMultiObject( + merged_thsamples = OutputMultiPath( File(exists=True), desc=('Samples from the distribution ' 'on theta')) - merged_phsamples = OutputMultiObject( + merged_phsamples = OutputMultiPath( File(exists=True), desc=('Samples from the distribution ' 'on phi')) - merged_fsamples = OutputMultiObject( + merged_fsamples = OutputMultiPath( File(exists=True), desc=('Samples from the distribution on ' 'anisotropic volume fraction')) - dyads = OutputMultiObject( + dyads = OutputMultiPath( File(exists=True), desc='Mean of PDD distribution in vector form.') - dyads_dispersion = OutputMultiObject(File(exists=True), desc=('Dispersion')) + dyads_dispersion = OutputMultiPath(File(exists=True), desc=('Dispersion')) class BEDPOSTX5(FSLXCommand): @@ -525,9 +525,9 @@ class XFibres5(FSLXCommand): class ProbTrackXBaseInputSpec(FSLCommandInputSpec): - thsamples = InputMultiObject(File(exists=True), mandatory=True) - phsamples = InputMultiObject(File(exists=True), mandatory=True) - fsamples = InputMultiObject(File(exists=True), mandatory=True) + 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 ' @@ -547,7 +547,7 @@ class ProbTrackXBaseInputSpec(FSLCommandInputSpec): 'label file'), argstr='--seed=%s', mandatory=True) - target_masks = InputMultiObject( + target_masks = InputMultiPath( File(exits=True), desc=('list of target masks - required for ' 'seeds_to_targets classification'), @@ -694,7 +694,7 @@ class ProbTrackXOutputSpec(TraitedSpec): log = File( exists=True, desc='path/name of a text record of the command that was run') - fdt_paths = OutputMultiObject( + fdt_paths = OutputMultiPath( File(exists=True), desc=('path/name of a 3D image file ' 'containing the output connectivity ' diff --git a/nipype/interfaces/fsl/epi.py b/nipype/interfaces/fsl/epi.py index f3f444bc58..7cfbbac79a 100644 --- a/nipype/interfaces/fsl/epi.py +++ b/nipype/interfaces/fsl/epi.py @@ -24,7 +24,7 @@ from ...utils.filemanip import split_filename from ...utils import NUMPY_MMAP -from ..base import (traits, TraitedSpec, InputMultiObject, File, isdefined) +from ..base import (traits, TraitedSpec, InputMultiPath, File, isdefined) from .base import FSLCommand, FSLCommandInputSpec, Info @@ -151,7 +151,7 @@ class TOPUPInputSpec(FSLCommandInputSpec): argstr='--datain=%s', desc=('encoding direction for automatic ' 'generation of encoding_file')) - readout_times = InputMultiObject( + readout_times = InputMultiPath( traits.Float, requires=['encoding_direction'], xor=['encoding_file'], @@ -417,7 +417,7 @@ def _overload_extension(self, value, name=None): class ApplyTOPUPInputSpec(FSLCommandInputSpec): - in_files = InputMultiObject( + in_files = InputMultiPath( File(exists=True), mandatory=True, desc='name of file with images', diff --git a/nipype/interfaces/fsl/fix.py b/nipype/interfaces/fsl/fix.py index 03fcd7ac64..ebe986eb79 100644 --- a/nipype/interfaces/fsl/fix.py +++ b/nipype/interfaces/fsl/fix.py @@ -58,13 +58,13 @@ absolute_import) from ..base import (TraitedSpec, CommandLineInputSpec, CommandLine, - InputMultiObject, OutputMultiObject, BaseInterface, + InputMultiPath, OutputMultiPath, BaseInterface, BaseInterfaceInputSpec, traits, Directory, File, isdefined) import os class TrainingSetCreatorInputSpec(BaseInterfaceInputSpec): - mel_icas_in = InputMultiObject( + mel_icas_in = InputMultiPath( Directory(exists=True), copyfile=False, desc='Melodic output directories', @@ -73,7 +73,7 @@ class TrainingSetCreatorInputSpec(BaseInterfaceInputSpec): class TrainingSetCreatorOutputSpec(TraitedSpec): - mel_icas_out = OutputMultiObject( + mel_icas_out = OutputMultiPath( Directory(exists=True), copyfile=False, desc='Hand labels for noise vs signal', @@ -150,7 +150,7 @@ def _list_outputs(self): class TrainingInputSpec(CommandLineInputSpec): - mel_icas = InputMultiObject( + mel_icas = InputMultiPath( Directory(exists=True), copyfile=False, desc='Melodic output directories', @@ -193,7 +193,7 @@ def _list_outputs(self): class AccuracyTesterInputSpec(CommandLineInputSpec): - mel_icas = InputMultiObject( + mel_icas = InputMultiPath( Directory(exists=True), copyfile=False, desc='Melodic output directories', diff --git a/nipype/interfaces/fsl/maths.py b/nipype/interfaces/fsl/maths.py index c69d2fde6f..ef54b81965 100644 --- a/nipype/interfaces/fsl/maths.py +++ b/nipype/interfaces/fsl/maths.py @@ -16,7 +16,7 @@ import os import numpy as np -from ..base import (TraitedSpec, File, traits, InputMultiObject, isdefined) +from ..base import (TraitedSpec, File, traits, InputMultiPath, isdefined) from .base import FSLCommand, FSLCommandInputSpec @@ -573,7 +573,7 @@ class MultiImageMathsInput(MathsInput): mandatory=True, desc=("python formatted string of operations " "to perform")) - operand_files = InputMultiObject( + operand_files = InputMultiPath( File(exists=True), mandatory=True, desc=("list of file names to plug into op " diff --git a/nipype/interfaces/fsl/model.py b/nipype/interfaces/fsl/model.py index a135ec8157..6b2224adb4 100644 --- a/nipype/interfaces/fsl/model.py +++ b/nipype/interfaces/fsl/model.py @@ -28,7 +28,7 @@ from ...utils.misc import human_order_sorted from ...external.due import BibTeX from ..base import (File, traits, isdefined, TraitedSpec, BaseInterface, - Directory, InputMultiObject, OutputMultiObject, + Directory, InputMultiPath, OutputMultiPath, BaseInterfaceInputSpec) from .base import FSLCommand, FSLCommandInputSpec, Info @@ -93,9 +93,9 @@ class Level1DesignInputSpec(BaseInterfaceInputSpec): class Level1DesignOutputSpec(TraitedSpec): - fsf_files = OutputMultiObject( + fsf_files = OutputMultiPath( File(exists=True), desc='FSL feat specification files') - ev_files = OutputMultiObject( + ev_files = OutputMultiPath( traits.List(File(exists=True)), desc='condition information files') @@ -674,7 +674,7 @@ class FILMGLSInputSpec507(FILMGLSInputSpec505): class FILMGLSOutputSpec(TraitedSpec): - param_estimates = OutputMultiObject( + param_estimates = OutputMultiPath( File(exists=True), desc=('Parameter estimates for each ' 'column of the design matrix')) @@ -696,7 +696,7 @@ class FILMGLSOutputSpec(TraitedSpec): class FILMGLSOutputSpec507(TraitedSpec): - param_estimates = OutputMultiObject( + param_estimates = OutputMultiPath( File(exists=True), desc=('Parameter estimates for each ' 'column of the design matrix')) @@ -711,17 +711,17 @@ class FILMGLSOutputSpec507(TraitedSpec): exists=True, desc='directory storing model estimation output') thresholdac = File(exists=True, desc='The FILM autocorrelation parameters') logfile = File(exists=True, desc='FILM run logfile') - copes = OutputMultiObject( + copes = OutputMultiPath( File(exists=True), desc='Contrast estimates for each contrast') - varcopes = OutputMultiObject( + varcopes = OutputMultiPath( File(exists=True), desc='Variance estimates for each contrast') - zstats = OutputMultiObject( + zstats = OutputMultiPath( File(exists=True), desc='z-stat file for each contrast') - tstats = OutputMultiObject( + tstats = OutputMultiPath( File(exists=True), desc='t-stat file for each contrast') - fstats = OutputMultiObject( + fstats = OutputMultiPath( File(exists=True), desc='f-stat file for each contrast') - zfstats = OutputMultiObject( + zfstats = OutputMultiPath( File(exists=True), desc='z-stat file for each F contrast') @@ -863,7 +863,7 @@ def _list_outputs(self): class FEATRegisterInputSpec(BaseInterfaceInputSpec): - feat_dirs = InputMultiObject( + feat_dirs = InputMultiPath( Directory(exists=True), desc="Lower level feat dirs", mandatory=True) reg_image = File( exists=True, @@ -980,33 +980,33 @@ class FLAMEOInputSpec(FSLCommandInputSpec): class FLAMEOOutputSpec(TraitedSpec): - pes = OutputMultiObject( + pes = OutputMultiPath( File(exists=True), desc=("Parameter estimates for each column of the " "design matrix for each voxel")) - res4d = OutputMultiObject( + res4d = OutputMultiPath( File(exists=True), desc=("Model fit residual mean-squared error for " "each time point")) - copes = OutputMultiObject( + copes = OutputMultiPath( File(exists=True), desc="Contrast estimates for each contrast") - var_copes = OutputMultiObject( + var_copes = OutputMultiPath( File(exists=True), desc="Variance estimates for each contrast") - zstats = OutputMultiObject( + zstats = OutputMultiPath( File(exists=True), desc="z-stat file for each contrast") - tstats = OutputMultiObject( + tstats = OutputMultiPath( File(exists=True), desc="t-stat file for each contrast") - zfstats = OutputMultiObject( + zfstats = OutputMultiPath( File(exists=True), desc="z stat file for each f contrast") - fstats = OutputMultiObject( + fstats = OutputMultiPath( File(exists=True), desc="f-stat file for each contrast") - mrefvars = OutputMultiObject( + mrefvars = OutputMultiPath( File(exists=True), desc=("mean random effect variances for each " "contrast")) - tdof = OutputMultiObject( + tdof = OutputMultiPath( File(exists=True), desc="temporal dof file for each contrast") - weights = OutputMultiObject( + weights = OutputMultiPath( File(exists=True), desc="weights file for each contrast") stats_dir = Directory( File(exists=True), desc="directory storing model estimation output") @@ -1150,7 +1150,7 @@ class ContrastMgrInputSpec(FSLCommandInputSpec): exists=True, argstr='-f %s', desc='contrast file containing F-contrasts') - param_estimates = InputMultiObject( + param_estimates = InputMultiPath( File(exists=True), argstr='', copyfile=False, @@ -1189,19 +1189,19 @@ class ContrastMgrInputSpec(FSLCommandInputSpec): class ContrastMgrOutputSpec(TraitedSpec): - copes = OutputMultiObject( + copes = OutputMultiPath( File(exists=True), desc='Contrast estimates for each contrast') - varcopes = OutputMultiObject( + varcopes = OutputMultiPath( File(exists=True), desc='Variance estimates for each contrast') - zstats = OutputMultiObject( + zstats = OutputMultiPath( File(exists=True), desc='z-stat file for each contrast') - tstats = OutputMultiObject( + tstats = OutputMultiPath( File(exists=True), desc='t-stat file for each contrast') - fstats = OutputMultiObject( + fstats = OutputMultiPath( File(exists=True), desc='f-stat file for each contrast') - zfstats = OutputMultiObject( + zfstats = OutputMultiPath( File(exists=True), desc='z-stat file for each F contrast') - neffs = OutputMultiObject( + neffs = OutputMultiPath( File(exists=True), desc='neff file ?? for each contrast') @@ -1599,7 +1599,7 @@ def _list_outputs(self): class MELODICInputSpec(FSLCommandInputSpec): - in_files = InputMultiObject( + in_files = InputMultiPath( File(exists=True), argstr="-i %s", mandatory=True, @@ -2010,7 +2010,7 @@ def _format_arg(self, name, spec, value): class DualRegressionInputSpec(FSLCommandInputSpec): - in_files = InputMultiObject( + in_files = InputMultiPath( File(exists=True), argstr="%s", mandatory=True, @@ -2322,35 +2322,35 @@ class GLMInputSpec(FSLCommandInputSpec): class GLMOutputSpec(TraitedSpec): out_file = File( exists=True, desc=('file name of GLM parameters (if generated)')) - out_cope = OutputMultiObject( + out_cope = OutputMultiPath( File(exists=True), desc=('output file name for COPEs (either as text file or image)')) - out_z = OutputMultiObject( + out_z = OutputMultiPath( File(exists=True), desc=('output file name for COPEs (either as text file or image)')) - out_t = OutputMultiObject( + out_t = OutputMultiPath( File(exists=True), desc=('output file name for t-stats (either as text file or image)')) - out_p = OutputMultiObject( + out_p = OutputMultiPath( File(exists=True), desc=('output file name for p-values of Z-stats (either as text file ' 'or image)')) - out_f = OutputMultiObject( + out_f = OutputMultiPath( File(exists=True), desc=('output file name for F-value of full model fit')) - out_pf = OutputMultiObject( + out_pf = OutputMultiPath( File(exists=True), desc=('output file name for p-value for full model fit')) - out_res = OutputMultiObject( + out_res = OutputMultiPath( File(exists=True), desc='output file name for residuals') - out_varcb = OutputMultiObject( + out_varcb = OutputMultiPath( File(exists=True), desc='output file name for variance of COPEs') - out_sigsq = OutputMultiObject( + out_sigsq = OutputMultiPath( File(exists=True), desc=('output file name for residual noise variance sigma-square')) - out_data = OutputMultiObject( + out_data = OutputMultiPath( File(exists=True), desc='output file for preprocessed data') - out_vnscales = OutputMultiObject( + out_vnscales = OutputMultiPath( File(exists=True), desc=('output file name for scaling factors for variance ' 'normalisation')) diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index 46c99ba349..8e7b7be477 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -23,7 +23,7 @@ from nibabel import load from ...utils.filemanip import split_filename -from ..base import (TraitedSpec, File, InputMultiObject, OutputMultiObject, +from ..base import (TraitedSpec, File, InputMultiPath, OutputMultiPath, Undefined, traits, isdefined) from .base import FSLCommand, FSLCommandInputSpec, Info @@ -198,7 +198,7 @@ def _gen_filename(self, name): class FASTInputSpec(FSLCommandInputSpec): """ Defines inputs (trait classes) for FAST """ - in_files = InputMultiObject( + in_files = InputMultiPath( File(exists=True), copyfile=False, desc='image, or multi-channel set of images, ' @@ -247,7 +247,7 @@ class FASTInputSpec(FSLCommandInputSpec): desc=' initialise' ' using priors', argstr='-a %s') - other_priors = InputMultiObject( + other_priors = InputMultiPath( File(exist=True), desc='alternative prior images', argstr='-A %s', @@ -293,12 +293,12 @@ class FASTOutputSpec(TraitedSpec): exists=True, desc='path/name of binary segmented volume file' ' one val for each class _seg') - tissue_class_files = OutputMultiObject( + tissue_class_files = OutputMultiPath( File( desc=( 'path/name of binary segmented volumes one file for each class ' '_seg_x'))) - restored_image = OutputMultiObject( + restored_image = OutputMultiPath( File( desc=( 'restored images (one for each input image) named according to ' @@ -307,13 +307,13 @@ class FASTOutputSpec(TraitedSpec): 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 = OutputMultiObject( + partial_volume_files = OutputMultiPath( File( desc='path/name of partial volumes files one for each class, _pve_x' )) - bias_field = OutputMultiObject(File(desc='Estimated bias field _bias')) - probability_maps = OutputMultiObject( + bias_field = OutputMultiPath(File(desc='Estimated bias field _bias')) + probability_maps = OutputMultiPath( File(desc='filenames, one for each class, for each input, prob_x')) @@ -788,9 +788,9 @@ class MCFLIRTOutputSpec(TraitedSpec): mean_img = File( exists=True, desc="mean timeseries image (if mean_vol=True)") par_file = File(exists=True, desc="text-file with motion parameters") - mat_file = OutputMultiObject( + mat_file = OutputMultiPath( File(exists=True), desc="transformation matrices") - rms_files = OutputMultiObject( + rms_files = OutputMultiPath( File(exists=True), desc="absolute and relative displacement parameters") @@ -1970,10 +1970,10 @@ class FIRSTInputSpec(FSLCommandInputSpec): class FIRSTOutputSpec(TraitedSpec): - vtk_surfaces = OutputMultiObject( + vtk_surfaces = OutputMultiPath( File(exists=True), desc='VTK format meshes for each subcortical region') - bvars = OutputMultiObject( + bvars = OutputMultiPath( File(exists=True), desc='bvars for each subcortical region') original_segmentations = File( exists=True, diff --git a/nipype/interfaces/fsl/utils.py b/nipype/interfaces/fsl/utils.py index 6ac7c6e3a0..159e884a7c 100644 --- a/nipype/interfaces/fsl/utils.py +++ b/nipype/interfaces/fsl/utils.py @@ -30,7 +30,7 @@ from ...utils.filemanip import (load_json, save_json, split_filename, fname_presuffix) -from ..base import (traits, TraitedSpec, OutputMultiObject, File, CommandLine, +from ..base import (traits, TraitedSpec, OutputMultiPath, File, CommandLine, CommandLineInputSpec, isdefined) from .base import FSLCommand, FSLCommandInputSpec, Info @@ -467,7 +467,7 @@ class SplitInputSpec(FSLCommandInputSpec): class SplitOutputSpec(TraitedSpec): - out_files = OutputMultiObject(File(exists=True)) + out_files = OutputMultiPath(File(exists=True)) class Split(FSLCommand): diff --git a/nipype/interfaces/io.py b/nipype/interfaces/io.py index e40612f2c8..5687b3f77e 100644 --- a/nipype/interfaces/io.py +++ b/nipype/interfaces/io.py @@ -41,8 +41,8 @@ from ..utils.filemanip import copyfile, list_to_filename, filename_to_list from ..utils.misc import human_order_sorted, str2bool from .base import ( - TraitedSpec, traits, Str, File, Directory, BaseInterface, InputMultiObject, - isdefined, OutputMultiObject, DynamicTraitedSpec, Undefined, BaseInterfaceInputSpec) + TraitedSpec, traits, Str, File, Directory, BaseInterface, InputMultiPath, + isdefined, OutputMultiPath, DynamicTraitedSpec, Undefined, BaseInterfaceInputSpec) have_pybids = True try: @@ -196,13 +196,13 @@ class DataSinkInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): parameterization = traits.Bool( True, usedefault=True, desc='store output in parametrized structure') strip_dir = Directory(desc='path to strip out of filename') - substitutions = InputMultiObject( + substitutions = InputMultiPath( traits.Tuple(Str, Str), desc=('List of 2-tuples reflecting string ' 'to substitute and string to replace ' 'it with')) regexp_substitutions = \ - InputMultiObject(traits.Tuple(Str, Str), + InputMultiPath(traits.Tuple(Str, Str), desc=('List of 2-tuples reflecting a pair of a ' 'Python regexp pattern and a replacement ' 'string. Invoked after string `substitutions`')) @@ -893,7 +893,7 @@ def _add_output_traits(self, base): """ S3 specific: Downloads relevant files to a local folder specified - Using traits.Any instead out OutputMultiObject till add_trait bug + Using traits.Any instead out OutputMultiPath till add_trait bug is fixed. """ return add_traits(base, list(self.inputs.template_args.keys())) @@ -1154,7 +1154,7 @@ def __init__(self, infields=None, outfields=None, **kwargs): def _add_output_traits(self, base): """ - Using traits.Any instead out OutputMultiObject till add_trait bug + Using traits.Any instead out OutputMultiPath till add_trait bug is fixed. """ return add_traits(base, list(self.inputs.template_args.keys())) @@ -1594,7 +1594,7 @@ class FSSourceOutputSpec(TraitedSpec): loc='mri') rawavg = File( exists=True, desc='Volume formed by averaging input images', loc='mri') - ribbon = OutputMultiObject( + ribbon = OutputMultiPath( File(exists=True), desc='Volumetric maps of cortical ribbons', loc='mri', @@ -1604,103 +1604,103 @@ class FSSourceOutputSpec(TraitedSpec): exists=True, loc='mri', desc='Aparc parcellation projected into subcortical white matter') - curv = OutputMultiObject( + curv = OutputMultiPath( File(exists=True), desc='Maps of surface curvature', loc='surf') - avg_curv = OutputMultiObject( + avg_curv = OutputMultiPath( File(exists=True), desc='Average atlas curvature, sampled to subject', loc='surf') - inflated = OutputMultiObject( + inflated = OutputMultiPath( File(exists=True), desc='Inflated surface meshes', loc='surf') - pial = OutputMultiObject( + pial = OutputMultiPath( File(exists=True), desc='Gray matter/pia mater surface meshes', loc='surf') - area_pial = OutputMultiObject( + area_pial = OutputMultiPath( File(exists=True), desc='Mean area of triangles each vertex on the pial surface is ' 'associated with', loc='surf', altkey='area.pial') - curv_pial = OutputMultiObject( + curv_pial = OutputMultiPath( File(exists=True), desc='Curvature of pial surface', loc='surf', altkey='curv.pial') - smoothwm = OutputMultiObject( + smoothwm = OutputMultiPath( File(exists=True), loc='surf', desc='Smoothed original surface meshes') - sphere = OutputMultiObject( + sphere = OutputMultiPath( File(exists=True), desc='Spherical surface meshes', loc='surf') - sulc = OutputMultiObject( + sulc = OutputMultiPath( File(exists=True), desc='Surface maps of sulcal depth', loc='surf') - thickness = OutputMultiObject( + thickness = OutputMultiPath( File(exists=True), loc='surf', desc='Surface maps of cortical thickness') - volume = OutputMultiObject( + volume = OutputMultiPath( File(exists=True), desc='Surface maps of cortical volume', loc='surf') - white = OutputMultiObject( + white = OutputMultiPath( File(exists=True), desc='White/gray matter surface meshes', loc='surf') - jacobian_white = OutputMultiObject( + jacobian_white = OutputMultiPath( File(exists=True), desc='Distortion required to register to spherical atlas', loc='surf') - graymid = OutputMultiObject( + graymid = OutputMultiPath( File(exists=True), desc='Graymid/midthickness surface meshes', loc='surf', altkey=['graymid', 'midthickness']) - label = OutputMultiObject( + label = OutputMultiPath( File(exists=True), desc='Volume and surface label files', loc='label', altkey='*label') - annot = OutputMultiObject( + annot = OutputMultiPath( File(exists=True), desc='Surface annotation files', loc='label', altkey='*annot') - aparc_aseg = OutputMultiObject( + aparc_aseg = OutputMultiPath( File(exists=True), loc='mri', altkey='aparc*aseg', desc='Aparc parcellation projected into aseg volume') - sphere_reg = OutputMultiObject( + sphere_reg = OutputMultiPath( File(exists=True), loc='surf', altkey='sphere.reg', desc='Spherical registration file') - aseg_stats = OutputMultiObject( + aseg_stats = OutputMultiPath( File(exists=True), loc='stats', altkey='aseg', desc='Automated segmentation statistics file') - wmparc_stats = OutputMultiObject( + wmparc_stats = OutputMultiPath( File(exists=True), loc='stats', altkey='wmparc', desc='White matter parcellation statistics file') - aparc_stats = OutputMultiObject( + aparc_stats = OutputMultiPath( File(exists=True), loc='stats', altkey='aparc', desc='Aparc parcellation statistics files') - BA_stats = OutputMultiObject( + BA_stats = OutputMultiPath( File(exists=True), loc='stats', altkey='BA', desc='Brodmann Area statistics files') - aparc_a2009s_stats = OutputMultiObject( + aparc_a2009s_stats = OutputMultiPath( File(exists=True), loc='stats', altkey='aparc.a2009s', desc='Aparc a2009s parcellation statistics files') - curv_stats = OutputMultiObject( + curv_stats = OutputMultiPath( File(exists=True), loc='stats', altkey='curv', desc='Curvature statistics files') - entorhinal_exvivo_stats = OutputMultiObject( + entorhinal_exvivo_stats = OutputMultiPath( File(exists=True), loc='stats', altkey='entorhinal_exvivo', @@ -1868,7 +1868,7 @@ def __init__(self, infields=None, outfields=None, **kwargs): def _add_output_traits(self, base): """ - Using traits.Any instead out OutputMultiObject till add_trait bug + Using traits.Any instead out OutputMultiPath till add_trait bug is fixed. """ return add_traits(base, list(self.inputs.query_template_args.keys())) diff --git a/nipype/interfaces/matlab.py b/nipype/interfaces/matlab.py index 138c2dc3ea..fed7bfeb57 100644 --- a/nipype/interfaces/matlab.py +++ b/nipype/interfaces/matlab.py @@ -8,7 +8,7 @@ import os from .. import config -from .base import (CommandLineInputSpec, InputMultiObject, isdefined, +from .base import (CommandLineInputSpec, InputMultiPath, isdefined, CommandLine, traits, File, Directory) @@ -69,7 +69,7 @@ class MatlabInputSpec(CommandLineInputSpec): mfile = traits.Bool(True, desc='Run m-code using m-file', usedefault=True) script_file = File( 'pyscript.m', usedefault=True, desc='Name of file to write m-code to') - paths = InputMultiObject(Directory(), desc='Paths to add to matlabpath') + paths = InputMultiPath(Directory(), desc='Paths to add to matlabpath') prescript = traits.List( ["ver,", "try,"], usedefault=True, diff --git a/nipype/interfaces/minc/minc.py b/nipype/interfaces/minc/minc.py index 42df742111..a520768bde 100644 --- a/nipype/interfaces/minc/minc.py +++ b/nipype/interfaces/minc/minc.py @@ -28,7 +28,7 @@ from ..base import (TraitedSpec, CommandLineInputSpec, CommandLine, StdOutCommandLineInputSpec, StdOutCommandLine, File, - Directory, InputMultiObject, OutputMultiObject, traits, + Directory, InputMultiPath, OutputMultiPath, traits, isdefined) from .base import aggregate_filename @@ -143,14 +143,14 @@ class ExtractInputSpec(StdOutCommandLineInputSpec): 'Default value: 1.79769e+308.'), argstr='-image_maximum %s') - start = InputMultiObject( + start = InputMultiPath( traits.Int, desc='Specifies corner of hyperslab (C conventions for indices).', sep=',', argstr='-start %s', ) - count = InputMultiObject( + count = InputMultiPath( traits.Int, desc='Specifies edge lengths of hyperslab to read.', sep=',', @@ -620,7 +620,7 @@ class DumpInputSpec(StdOutCommandLineInputSpec): desc='Full annotations for C or Fortran indices in data.', xor=_xor_annotations) - variables = InputMultiObject( + variables = InputMultiPath( traits.Str, desc='Output data for specified variables only.', sep=',', @@ -688,7 +688,7 @@ def _format_arg(self, name, spec, value): class AverageInputSpec(CommandLineInputSpec): _xor_input_files = ('input_files', 'filelist') - input_files = InputMultiObject( + input_files = InputMultiPath( traits.File(exists=True), desc='input file(s)', mandatory=True, @@ -854,7 +854,7 @@ class AverageInputSpec(CommandLineInputSpec): 'binarization. Default value: -1.79769e+308'), argstr='-binvalue %s') - weights = InputMultiObject( + weights = InputMultiPath( traits.Str, desc='Specify weights for averaging (",,...").', sep=',', @@ -948,7 +948,7 @@ class Blob(CommandLine): class CalcInputSpec(CommandLineInputSpec): _xor_input_files = ('input_files', 'filelist') - input_files = InputMultiObject( + input_files = InputMultiPath( traits.File(exists=True), desc='input file(s) for calculation', mandatory=True, @@ -1756,7 +1756,7 @@ def cmdline(self): class MathInputSpec(CommandLineInputSpec): _xor_input_files = ('input_files', 'filelist') - input_files = InputMultiObject( + input_files = InputMultiPath( traits.File(exists=True), desc='input file(s) for calculation', mandatory=True, @@ -2207,7 +2207,7 @@ class ResampleInputSpec(CommandLineInputSpec): name_template='%s_resample.mnc') # This is a dummy input. - input_grid_files = InputMultiObject( + input_grid_files = InputMultiPath( traits.File, desc='input grid file(s)', ) @@ -3002,7 +3002,7 @@ def _list_outputs(self): class XfmConcatInputSpec(CommandLineInputSpec): - input_files = InputMultiObject( + input_files = InputMultiPath( traits.File(exists=True), desc='input file(s)', mandatory=True, @@ -3011,7 +3011,7 @@ class XfmConcatInputSpec(CommandLineInputSpec): position=-2) # This is a dummy input. - input_grid_files = InputMultiObject( + input_grid_files = InputMultiPath( traits.File, desc='input grid file(s)', ) @@ -3036,7 +3036,7 @@ class XfmConcatInputSpec(CommandLineInputSpec): class XfmConcatOutputSpec(TraitedSpec): output_file = File(desc='output file', exists=True) - output_grids = OutputMultiObject(File(exists=True), desc='output grids') + output_grids = OutputMultiPath(File(exists=True), desc='output grids') class XfmConcat(CommandLine): @@ -3179,7 +3179,7 @@ class NlpFitInputSpec(CommandLineInputSpec): ) # This is a dummy input. - input_grid_files = InputMultiObject( + input_grid_files = InputMultiPath( traits.File, desc='input grid file(s)', ) @@ -3270,7 +3270,7 @@ def _list_outputs(self): class XfmAvgInputSpec(CommandLineInputSpec): - input_files = InputMultiObject( + input_files = InputMultiPath( traits.File(exists=True), desc='input file(s)', mandatory=True, @@ -3279,7 +3279,7 @@ class XfmAvgInputSpec(CommandLineInputSpec): position=-2) # This is a dummy input. - input_grid_files = InputMultiObject( + input_grid_files = InputMultiPath( traits.File, desc='input grid file(s)', ) @@ -3444,7 +3444,7 @@ def _list_outputs(self): class BigAverageInputSpec(CommandLineInputSpec): - input_files = InputMultiObject( + input_files = InputMultiPath( traits.File(exists=True), desc='input file(s)', mandatory=True, @@ -3620,7 +3620,7 @@ class VolSymmInputSpec(CommandLineInputSpec): name_template='%s_vol_symm.mnc') # This is a dummy input. - input_grid_files = InputMultiObject( + input_grid_files = InputMultiPath( traits.File, desc='input grid file(s)', ) diff --git a/nipype/interfaces/mipav/developer.py b/nipype/interfaces/mipav/developer.py index ef86cadf5f..ffb9e10cc3 100644 --- a/nipype/interfaces/mipav/developer.py +++ b/nipype/interfaces/mipav/developer.py @@ -7,7 +7,7 @@ from ..base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiObject, OutputMultiObject) + InputMultiPath, OutputMultiPath) class JistLaminarVolumetricLayeringInputSpec(CommandLineInputSpec): @@ -1047,7 +1047,7 @@ class JistLaminarProfileSampling(SEMLikeCommandLine): class MedicAlgorithmMipavReorientInputSpec(CommandLineInputSpec): - inSource = InputMultiObject( + inSource = InputMultiPath( File, desc="Source", sep=";", argstr="--inSource %s") inTemplate = File(desc="Template", exists=True, argstr="--inTemplate %s") inNew = traits.Enum( @@ -1114,7 +1114,7 @@ class MedicAlgorithmMipavReorientInputSpec(CommandLineInputSpec): argstr="--inResolution %s") xPrefExt = traits.Enum( "nrrd", desc="Output File Type", argstr="--xPrefExt %s") - outReoriented = InputMultiObject( + outReoriented = InputMultiPath( File, desc="Reoriented Volume", sep=";", argstr="--outReoriented %s") null = traits.Str(desc="Execution Time", argstr="--null %s") xDefaultMem = traits.Int( @@ -1567,7 +1567,7 @@ class JistIntensityMp2rageMasking(SEMLikeCommandLine): class MedicAlgorithmThresholdToBinaryMaskInputSpec(CommandLineInputSpec): - inLabel = InputMultiObject( + inLabel = InputMultiPath( File, desc="Input volumes", sep=";", argstr="--inLabel %s") inMinimum = traits.Float( desc="Minimum threshold value.", argstr="--inMinimum %f") @@ -1580,7 +1580,7 @@ class MedicAlgorithmThresholdToBinaryMaskInputSpec(CommandLineInputSpec): argstr="--inUse %s") xPrefExt = traits.Enum( "nrrd", desc="Output File Type", argstr="--xPrefExt %s") - outBinary = InputMultiObject( + outBinary = InputMultiPath( File, desc="Binary Mask", sep=";", argstr="--outBinary %s") null = traits.Str(desc="Execution Time", argstr="--null %s") xDefaultMem = traits.Int( diff --git a/nipype/interfaces/mne/base.py b/nipype/interfaces/mne/base.py index 168a3f9d9a..14cfcd53e5 100644 --- a/nipype/interfaces/mne/base.py +++ b/nipype/interfaces/mne/base.py @@ -8,7 +8,7 @@ from ... import logging from ...utils.filemanip import list_to_filename -from ..base import (traits, File, Directory, TraitedSpec, OutputMultiObject) +from ..base import (traits, File, Directory, TraitedSpec, OutputMultiPath) from ..freesurfer.base import FSCommand, FSTraitedSpec iflogger = logging.getLogger('interface') @@ -46,7 +46,7 @@ class WatershedBEMInputSpec(FSTraitedSpec): class WatershedBEMOutputSpec(TraitedSpec): - mesh_files = OutputMultiObject( + mesh_files = OutputMultiPath( File(exists=True), desc=('Paths to the output meshes (brain, inner ' 'skull, outer skull, outer skin)')) @@ -71,7 +71,7 @@ class WatershedBEMOutputSpec(TraitedSpec): loc='bem', altkey='fif', desc='"fif" format file for EEG processing in MNE') - cor_files = OutputMultiObject( + cor_files = OutputMultiPath( File(exists=True), loc='bem/watershed/ws', altkey='COR', diff --git a/nipype/interfaces/mrtrix/preprocess.py b/nipype/interfaces/mrtrix/preprocess.py index 7c4281740f..4de430bb58 100644 --- a/nipype/interfaces/mrtrix/preprocess.py +++ b/nipype/interfaces/mrtrix/preprocess.py @@ -16,7 +16,7 @@ from ...utils.filemanip import split_filename from ..base import (CommandLineInputSpec, CommandLine, traits, TraitedSpec, - File, InputMultiObject, isdefined) + File, InputMultiPath, isdefined) class MRConvertInputSpec(CommandLineInputSpec): @@ -167,7 +167,7 @@ def _gen_outfilename(self): class DWI2TensorInputSpec(CommandLineInputSpec): - in_file = InputMultiObject( + in_file = InputMultiPath( File(exists=True), argstr='%s', mandatory=True, @@ -439,7 +439,7 @@ def _gen_outfilename(self): class MRMultiplyInputSpec(CommandLineInputSpec): - in_files = InputMultiObject( + in_files = InputMultiPath( File(exists=True), argstr='%s', mandatory=True, @@ -497,7 +497,7 @@ def _gen_outfilename(self): class MRTrixViewerInputSpec(CommandLineInputSpec): - in_files = InputMultiObject( + in_files = InputMultiPath( File(exists=True), argstr='%s', mandatory=True, @@ -841,7 +841,7 @@ def _gen_outfilename(self): class MRTransformInputSpec(CommandLineInputSpec): - in_files = InputMultiObject( + in_files = InputMultiPath( File(exists=True), argstr='%s', mandatory=True, diff --git a/nipype/interfaces/mrtrix3/utils.py b/nipype/interfaces/mrtrix3/utils.py index 0ee51f13d6..2c02de75e4 100644 --- a/nipype/interfaces/mrtrix3/utils.py +++ b/nipype/interfaces/mrtrix3/utils.py @@ -16,7 +16,7 @@ import os.path as op from ..base import (CommandLineInputSpec, CommandLine, traits, TraitedSpec, - File, InputMultiObject, isdefined) + File, InputMultiPath, isdefined) from .base import MRTrix3BaseInputSpec, MRTrix3Base diff --git a/nipype/interfaces/niftyseg/em.py b/nipype/interfaces/niftyseg/em.py index 4309c4ba46..47c0659b30 100644 --- a/nipype/interfaces/niftyseg/em.py +++ b/nipype/interfaces/niftyseg/em.py @@ -19,7 +19,7 @@ """ from ..base import (TraitedSpec, File, traits, CommandLineInputSpec, - InputMultiObject) + InputMultiPath) from .base import NiftySegCommand from ..niftyreg.base import get_custom_path @@ -52,7 +52,7 @@ class EMInputSpec(CommandLineInputSpec): desc='4D file containing the priors', xor=['no_prior', 'priors']) - priors = InputMultiObject( + priors = InputMultiPath( argstr='%s', mandatory=True, desc='List of priors filepaths.', diff --git a/nipype/interfaces/nilearn.py b/nipype/interfaces/nilearn.py index d73d01073b..3492e2e233 100644 --- a/nipype/interfaces/nilearn.py +++ b/nipype/interfaces/nilearn.py @@ -20,13 +20,13 @@ from .. import logging from ..interfaces.base import (traits, TraitedSpec, BaseInterface, - BaseInterfaceInputSpec, File, InputMultiObject) + BaseInterfaceInputSpec, File, InputMultiPath) IFLOGGER = logging.getLogger('interface') class SignalExtractionInputSpec(BaseInterfaceInputSpec): in_file = File(exists=True, mandatory=True, desc='4-D fMRI nii file') - label_files = InputMultiObject( + label_files = InputMultiPath( File(exists=True), mandatory=True, desc='a 3-D label image, with 0 denoting ' diff --git a/nipype/interfaces/nipy/model.py b/nipype/interfaces/nipy/model.py index 659b819d70..7df9cb609d 100644 --- a/nipype/interfaces/nipy/model.py +++ b/nipype/interfaces/nipy/model.py @@ -11,7 +11,7 @@ from ...utils.misc import package_check from ...utils import NUMPY_MMAP -from ..base import (BaseInterface, TraitedSpec, traits, File, OutputMultiObject, +from ..base import (BaseInterface, TraitedSpec, traits, File, OutputMultiPath, BaseInterfaceInputSpec, isdefined) have_nipy = True @@ -278,9 +278,9 @@ class EstimateContrastInputSpec(BaseInterfaceInputSpec): class EstimateContrastOutputSpec(TraitedSpec): - stat_maps = OutputMultiObject(File(exists=True)) - z_maps = OutputMultiObject(File(exists=True)) - p_maps = OutputMultiObject(File(exists=True)) + stat_maps = OutputMultiPath(File(exists=True)) + z_maps = OutputMultiPath(File(exists=True)) + p_maps = OutputMultiPath(File(exists=True)) class EstimateContrast(BaseInterface): diff --git a/nipype/interfaces/nipy/preprocess.py b/nipype/interfaces/nipy/preprocess.py index 134f0e6bc6..a3566e07a9 100644 --- a/nipype/interfaces/nipy/preprocess.py +++ b/nipype/interfaces/nipy/preprocess.py @@ -21,7 +21,7 @@ from ...utils.filemanip import split_filename, fname_presuffix from ..base import (TraitedSpec, BaseInterface, traits, BaseInterfaceInputSpec, - isdefined, File, InputMultiObject, OutputMultiObject) + isdefined, File, InputMultiPath, OutputMultiPath) have_nipy = True try: @@ -87,7 +87,7 @@ def _list_outputs(self): class FmriRealign4dInputSpec(BaseInterfaceInputSpec): - in_file = InputMultiObject( + in_file = InputMultiPath( File(exists=True), mandatory=True, desc="File to realign") tr = traits.Float(desc="TR in seconds", mandatory=True) slice_order = traits.List( @@ -107,16 +107,16 @@ class FmriRealign4dInputSpec(BaseInterfaceInputSpec): desc="Assume smooth changes across time e.g.,\ fmri series. If you don't want slice timing \ correction set this to undefined") - loops = InputMultiObject( + loops = InputMultiPath( [5], traits.Int, usedefault=True, desc="loops within each run") - between_loops = InputMultiObject( + between_loops = InputMultiPath( [5], traits.Int, usedefault=True, desc="loops used to \ realign different \ runs") - speedup = InputMultiObject( + speedup = InputMultiPath( [5], traits.Int, usedefault=True, @@ -127,8 +127,8 @@ class FmriRealign4dInputSpec(BaseInterfaceInputSpec): class FmriRealign4dOutputSpec(TraitedSpec): - out_file = OutputMultiObject(File(exists=True), desc="Realigned files") - par_file = OutputMultiObject( + out_file = OutputMultiPath(File(exists=True), desc="Realigned files") + par_file = OutputMultiPath( File(exists=True), desc="Motion parameter files") @@ -225,7 +225,7 @@ def _list_outputs(self): class SpaceTimeRealignerInputSpec(BaseInterfaceInputSpec): - in_file = InputMultiObject( + in_file = InputMultiPath( File(exists=True), mandatory=True, min_ver='0.4.0.dev', @@ -258,8 +258,8 @@ class SpaceTimeRealignerInputSpec(BaseInterfaceInputSpec): class SpaceTimeRealignerOutputSpec(TraitedSpec): - out_file = OutputMultiObject(File(exists=True), desc="Realigned files") - par_file = OutputMultiObject( + out_file = OutputMultiPath(File(exists=True), desc="Realigned files") + par_file = OutputMultiPath( File(exists=True), desc=("Motion parameter files. Angles are not " "euler angles")) diff --git a/nipype/interfaces/semtools/brains/classify.py b/nipype/interfaces/semtools/brains/classify.py index 914e869dda..89bb74f039 100644 --- a/nipype/interfaces/semtools/brains/classify.py +++ b/nipype/interfaces/semtools/brains/classify.py @@ -7,7 +7,7 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiObject, OutputMultiObject) + InputMultiPath, OutputMultiPath) class BRAINSPosteriorToContinuousClassInputSpec(CommandLineInputSpec): diff --git a/nipype/interfaces/semtools/brains/segmentation.py b/nipype/interfaces/semtools/brains/segmentation.py index ad30a06519..fae5e4f1a2 100644 --- a/nipype/interfaces/semtools/brains/segmentation.py +++ b/nipype/interfaces/semtools/brains/segmentation.py @@ -7,7 +7,7 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiObject, OutputMultiObject) + InputMultiPath, OutputMultiPath) class SimilarityIndexInputSpec(CommandLineInputSpec): @@ -56,19 +56,19 @@ class SimilarityIndex(SEMLikeCommandLine): class BRAINSTalairachInputSpec(CommandLineInputSpec): - AC = InputMultiObject( + AC = InputMultiPath( traits.Float, desc="Location of AC Point ", sep=",", argstr="--AC %s") ACisIndex = traits.Bool(desc="AC Point is Index", argstr="--ACisIndex ") - PC = InputMultiObject( + PC = InputMultiPath( traits.Float, desc="Location of PC Point ", sep=",", argstr="--PC %s") PCisIndex = traits.Bool(desc="PC Point is Index", argstr="--PCisIndex ") - SLA = InputMultiObject( + SLA = InputMultiPath( traits.Float, desc="Location of SLA Point ", sep=",", argstr="--SLA %s") SLAisIndex = traits.Bool(desc="SLA Point is Index", argstr="--SLAisIndex ") - IRP = InputMultiObject( + IRP = InputMultiPath( traits.Float, desc="Location of IRP Point ", sep=",", diff --git a/nipype/interfaces/semtools/brains/utilities.py b/nipype/interfaces/semtools/brains/utilities.py index ed77fcade4..d794c9c587 100644 --- a/nipype/interfaces/semtools/brains/utilities.py +++ b/nipype/interfaces/semtools/brains/utilities.py @@ -7,7 +7,7 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiObject, OutputMultiObject) + InputMultiPath, OutputMultiPath) class HistogramMatchingFilterInputSpec(CommandLineInputSpec): @@ -73,7 +73,7 @@ class HistogramMatchingFilter(SEMLikeCommandLine): class GenerateEdgeMapImageInputSpec(CommandLineInputSpec): - inputMRVolumes = InputMultiObject( + inputMRVolumes = InputMultiPath( File(exists=True), desc= "List of input structural MR volumes to create the maximum edgemap", @@ -146,14 +146,14 @@ class GenerateEdgeMapImage(SEMLikeCommandLine): class GeneratePurePlugMaskInputSpec(CommandLineInputSpec): - inputImageModalities = InputMultiObject( + inputImageModalities = InputMultiPath( File(exists=True), desc="List of input image file names to create pure plugs mask", argstr="--inputImageModalities %s...") threshold = traits.Float( desc="threshold value to define class membership", argstr="--threshold %f") - numberOfSubSamples = InputMultiObject( + numberOfSubSamples = InputMultiPath( traits.Int, desc= "Number of continous index samples taken at each direction of lattice space for each plug volume", diff --git a/nipype/interfaces/semtools/converters.py b/nipype/interfaces/semtools/converters.py index 11c61125be..de638935e5 100644 --- a/nipype/interfaces/semtools/converters.py +++ b/nipype/interfaces/semtools/converters.py @@ -7,7 +7,7 @@ from ..base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiObject, OutputMultiObject) + InputMultiPath, OutputMultiPath) class DWISimpleCompareInputSpec(CommandLineInputSpec): diff --git a/nipype/interfaces/semtools/diffusion/diffusion.py b/nipype/interfaces/semtools/diffusion/diffusion.py index e2bfac1616..af943a04fb 100644 --- a/nipype/interfaces/semtools/diffusion/diffusion.py +++ b/nipype/interfaces/semtools/diffusion/diffusion.py @@ -7,11 +7,11 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiObject, OutputMultiObject) + InputMultiPath, OutputMultiPath) class dtiaverageInputSpec(CommandLineInputSpec): - inputs = InputMultiObject( + inputs = InputMultiPath( File(exists=True), desc="List of all the tensor fields to be averaged", argstr="--inputs %s...") @@ -135,7 +135,7 @@ class dtiestimInputSpec(CommandLineInputSpec): "Tensor components are saved as doubles (cannot be visualized in Slicer)", argstr="--DTI_double ") verbose = traits.Bool(desc="produce verbose output", argstr="--verbose ") - defaultTensor = InputMultiObject( + defaultTensor = InputMultiPath( traits.Float, desc= "Default tensor used if estimated tensor is below a given threshold", diff --git a/nipype/interfaces/semtools/diffusion/gtract.py b/nipype/interfaces/semtools/diffusion/gtract.py index 298043bb55..999c898599 100644 --- a/nipype/interfaces/semtools/diffusion/gtract.py +++ b/nipype/interfaces/semtools/diffusion/gtract.py @@ -7,7 +7,7 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiObject, OutputMultiObject) + InputMultiPath, OutputMultiPath) class gtractTransformToDisplacementFieldInputSpec(CommandLineInputSpec): @@ -80,7 +80,7 @@ class gtractInvertBSplineTransformInputSpec(CommandLineInputSpec): hash_files=False, desc="Required: output transform file name", argstr="--outputTransform %s") - landmarkDensity = InputMultiObject( + landmarkDensity = InputMultiPath( traits.Int, desc="Number of landmark subdivisions in all 3 directions", sep=",", @@ -122,7 +122,7 @@ class gtractInvertBSplineTransform(SEMLikeCommandLine): class gtractConcatDwiInputSpec(CommandLineInputSpec): - inputVolume = InputMultiObject( + inputVolume = InputMultiPath( File(exists=True), desc= "Required: input file containing the first diffusion weighted image", @@ -1105,7 +1105,7 @@ class gtractCoRegAnatomyInputSpec(CommandLineInputSpec): numberOfIterations = traits.Int( desc="Number of iterations in the selected 3D fit", argstr="--numberOfIterations %d") - gridSize = InputMultiObject( + gridSize = InputMultiPath( traits.Int, desc="Number of grid subdivisions in all 3 directions", sep=",", @@ -1226,7 +1226,7 @@ class gtractResampleDWIInPlaceInputSpec(CommandLineInputSpec): desc= "Display debug messages, and produce debug intermediate results. 0=OFF, 1=Minimal, 10=Maximum debugging.", argstr="--debugLevel %d") - imageOutputSize = InputMultiObject( + imageOutputSize = InputMultiPath( traits.Int, desc= "The voxel lattice for the output image, padding is added if necessary. NOTE: if 0,0,0, then the inputVolume size is used.", @@ -1633,7 +1633,7 @@ class gtractTensorInputSpec(CommandLineInputSpec): desc= "Required: name of output NRRD file containing the Tensor vector image", argstr="--outputVolume %s") - medianFilterSize = InputMultiObject( + medianFilterSize = InputMultiPath( traits.Int, desc="Median filter radius in all 3 directions", sep=",", @@ -1664,7 +1664,7 @@ class gtractTensorInputSpec(CommandLineInputSpec): applyMeasurementFrame = traits.Bool( desc="Flag to apply the measurement frame to the gradient directions", argstr="--applyMeasurementFrame ") - ignoreIndex = InputMultiObject( + ignoreIndex = InputMultiPath( traits.Int, desc= "Ignore diffusion gradient index. Used to remove specific gradient directions with artifacts.", diff --git a/nipype/interfaces/semtools/diffusion/maxcurvature.py b/nipype/interfaces/semtools/diffusion/maxcurvature.py index 96c758d202..570109eb1b 100644 --- a/nipype/interfaces/semtools/diffusion/maxcurvature.py +++ b/nipype/interfaces/semtools/diffusion/maxcurvature.py @@ -7,7 +7,7 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiObject, OutputMultiObject) + InputMultiPath, OutputMultiPath) class maxcurvatureInputSpec(CommandLineInputSpec): diff --git a/nipype/interfaces/semtools/diffusion/tractography/commandlineonly.py b/nipype/interfaces/semtools/diffusion/tractography/commandlineonly.py index 5be503eb98..19adc2a817 100644 --- a/nipype/interfaces/semtools/diffusion/tractography/commandlineonly.py +++ b/nipype/interfaces/semtools/diffusion/tractography/commandlineonly.py @@ -7,7 +7,7 @@ from ....base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiObject, OutputMultiObject) + InputMultiPath, OutputMultiPath) class fiberstatsInputSpec(CommandLineInputSpec): diff --git a/nipype/interfaces/semtools/diffusion/tractography/fiberprocess.py b/nipype/interfaces/semtools/diffusion/tractography/fiberprocess.py index 9b859f70a3..c0e9dcbbaf 100644 --- a/nipype/interfaces/semtools/diffusion/tractography/fiberprocess.py +++ b/nipype/interfaces/semtools/diffusion/tractography/fiberprocess.py @@ -7,7 +7,7 @@ from ....base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiObject, OutputMultiObject) + InputMultiPath, OutputMultiPath) class fiberprocessInputSpec(CommandLineInputSpec): diff --git a/nipype/interfaces/semtools/diffusion/tractography/fibertrack.py b/nipype/interfaces/semtools/diffusion/tractography/fibertrack.py index 7e675c01b4..498cb2579d 100644 --- a/nipype/interfaces/semtools/diffusion/tractography/fibertrack.py +++ b/nipype/interfaces/semtools/diffusion/tractography/fibertrack.py @@ -7,7 +7,7 @@ from ....base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiObject, OutputMultiObject) + InputMultiPath, OutputMultiPath) class fibertrackInputSpec(CommandLineInputSpec): diff --git a/nipype/interfaces/semtools/diffusion/tractography/ukftractography.py b/nipype/interfaces/semtools/diffusion/tractography/ukftractography.py index c67964755c..11971dbb6d 100644 --- a/nipype/interfaces/semtools/diffusion/tractography/ukftractography.py +++ b/nipype/interfaces/semtools/diffusion/tractography/ukftractography.py @@ -7,7 +7,7 @@ from ....base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiObject, OutputMultiObject) + InputMultiPath, OutputMultiPath) class UKFTractographyInputSpec(CommandLineInputSpec): @@ -17,7 +17,7 @@ class UKFTractographyInputSpec(CommandLineInputSpec): "Seeds for diffusion. If not specified, full brain tractography will be performed, and the algorithm will start from every voxel in the brain mask where the Generalized Anisotropy is bigger than 0.18", exists=True, argstr="--seedsFile %s") - labels = InputMultiObject( + labels = InputMultiPath( traits.Int, desc="A vector of the ROI labels to be used", sep=",", diff --git a/nipype/interfaces/semtools/featurecreator.py b/nipype/interfaces/semtools/featurecreator.py index ff119a27aa..69ff2d675c 100644 --- a/nipype/interfaces/semtools/featurecreator.py +++ b/nipype/interfaces/semtools/featurecreator.py @@ -7,7 +7,7 @@ from ..base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiObject, OutputMultiObject) + InputMultiPath, OutputMultiPath) class GenerateCsfClippedFromClassifiedImageInputSpec(CommandLineInputSpec): diff --git a/nipype/interfaces/semtools/filtering/denoising.py b/nipype/interfaces/semtools/filtering/denoising.py index 191ec55f2a..97d687c512 100644 --- a/nipype/interfaces/semtools/filtering/denoising.py +++ b/nipype/interfaces/semtools/filtering/denoising.py @@ -7,7 +7,7 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiObject, OutputMultiObject) + InputMultiPath, OutputMultiPath) class UnbiasedNonLocalMeansInputSpec(CommandLineInputSpec): @@ -15,13 +15,13 @@ class UnbiasedNonLocalMeansInputSpec(CommandLineInputSpec): desc= "The root power of noise (sigma) in the complex Gaussian process the Rician comes from. If it is underestimated, the algorithm fails to remove the noise. If it is overestimated, over-blurring is likely to occur.", argstr="--sigma %f") - rs = InputMultiObject( + rs = InputMultiPath( traits.Int, desc= "The algorithm search for similar voxels in a neighborhood of this radius (radii larger than 5,5,5 are very slow, and the results can be only marginally better. Small radii may fail to effectively remove the noise).", sep=",", argstr="--rs %s") - rc = InputMultiObject( + rc = InputMultiPath( traits.Int, desc= "Similarity between blocks is computed as the difference between mean values and gradients. These parameters are computed fitting a hyperplane with LS inside a neighborhood of this size", diff --git a/nipype/interfaces/semtools/filtering/featuredetection.py b/nipype/interfaces/semtools/filtering/featuredetection.py index 17c98dfc80..ca4973ab43 100644 --- a/nipype/interfaces/semtools/filtering/featuredetection.py +++ b/nipype/interfaces/semtools/filtering/featuredetection.py @@ -7,7 +7,7 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiObject, OutputMultiObject) + InputMultiPath, OutputMultiPath) class GenerateSummedGradientImageInputSpec(CommandLineInputSpec): @@ -697,7 +697,7 @@ class STAPLEAnalysisInputSpec(CommandLineInputSpec): inputDimension = traits.Int( desc="Required: input image Dimension 2 or 3", argstr="--inputDimension %d") - inputLabelVolume = InputMultiObject( + inputLabelVolume = InputMultiPath( File(exists=True), desc="Required: input label volume", argstr="--inputLabelVolume %s...") diff --git a/nipype/interfaces/semtools/legacy/registration.py b/nipype/interfaces/semtools/legacy/registration.py index a020624c15..04bb425e3d 100644 --- a/nipype/interfaces/semtools/legacy/registration.py +++ b/nipype/interfaces/semtools/legacy/registration.py @@ -7,7 +7,7 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiObject, OutputMultiObject) + InputMultiPath, OutputMultiPath) class scalartransformInputSpec(CommandLineInputSpec): diff --git a/nipype/interfaces/semtools/registration/brainsfit.py b/nipype/interfaces/semtools/registration/brainsfit.py index af6dff3072..6142aac418 100644 --- a/nipype/interfaces/semtools/registration/brainsfit.py +++ b/nipype/interfaces/semtools/registration/brainsfit.py @@ -7,7 +7,7 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiObject, OutputMultiObject) + InputMultiPath, OutputMultiPath) class BRAINSFitInputSpec(CommandLineInputSpec): @@ -25,7 +25,7 @@ class BRAINSFitInputSpec(CommandLineInputSpec): desc= "Fraction of voxels of the fixed image that will be used for registration. The number has to be larger than zero and less or equal to one. Higher values increase the computation time but may give more accurate results. You can also limit the sampling focus with ROI masks and ROIAUTO mask generation. The default is 0.002 (use approximately 0.2% of voxels, resulting in 100000 samples in a 512x512x192 volume) to provide a very fast registration in most cases. Typical values range from 0.01 (1%) for low detail images to 0.2 (20%) for high detail images.", argstr="--samplingPercentage %f") - splineGridSize = InputMultiObject( + splineGridSize = InputMultiPath( traits.Int, desc= "Number of BSpline grid subdivisions along each axis of the fixed image, centered on the image space. Values must be 3 or higher for the BSpline to be correctly computed.", @@ -133,7 +133,7 @@ class BRAINSFitInputSpec(CommandLineInputSpec): desc= "Apply histogram matching operation for the input images to make them more similar. This is suitable for images of the same modality that may have different brightness or contrast, but the same overall intensity profile. Do NOT use if registering images from different modalities.", argstr="--histogramMatch ") - medianFilterSize = InputMultiObject( + medianFilterSize = InputMultiPath( traits.Int, desc= "Apply median filtering to reduce noise in the input volumes. The 3 values specify the radius for the optional MedianImageFilter preprocessing in all 3 directions (in voxels).", @@ -184,7 +184,7 @@ class BRAINSFitInputSpec(CommandLineInputSpec): desc= "Type of interpolation to be used when applying transform to moving volume. Options are Linear, NearestNeighbor, BSpline, WindowedSinc, Hamming, Cosine, Welch, Lanczos, or ResampleInPlace. The ResampleInPlace option will create an image with the same discrete voxel values and will adjust the origin and direction of the physical space interpretation.", argstr="--interpolationMode %s") - numberOfIterations = InputMultiObject( + numberOfIterations = InputMultiPath( traits.Int, desc= "The maximum number of iterations to try before stopping the optimization. When using a lower value (500-1000) then the registration is forced to terminate earlier but there is a higher risk of stopping before an optimal solution is reached.", @@ -194,7 +194,7 @@ class BRAINSFitInputSpec(CommandLineInputSpec): desc= "Starting step length of the optimizer. In general, higher values allow for recovering larger initial misalignments but there is an increased chance that the registration will not converge.", argstr="--maximumStepLength %f") - minimumStepLength = InputMultiObject( + minimumStepLength = InputMultiPath( traits.Float, desc= "Each step in the optimization takes steps at least this big. When none are possible, registration is complete. Smaller values allows the optimizer to make smaller adjustments, but the registration time may increase.", @@ -267,7 +267,7 @@ class BRAINSFitInputSpec(CommandLineInputSpec): desc= "Rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE: This value is overridden if either bsplineTransform or linearTransform is set.", argstr="--strippedOutputTransform %s") - transformType = InputMultiObject( + transformType = InputMultiPath( traits.Str, desc= "Specifies a list of registration types to be used. The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, BSpline and SyN. Specifying more than one in a comma separated list will initialize the next stage with the previous results. If registrationClass flag is used, it overrides this parameter setting.", diff --git a/nipype/interfaces/semtools/registration/brainsresample.py b/nipype/interfaces/semtools/registration/brainsresample.py index 53915cf275..f9ea80acbd 100644 --- a/nipype/interfaces/semtools/registration/brainsresample.py +++ b/nipype/interfaces/semtools/registration/brainsresample.py @@ -7,7 +7,7 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiObject, OutputMultiObject) + InputMultiPath, OutputMultiPath) class BRAINSResampleInputSpec(CommandLineInputSpec): @@ -65,7 +65,7 @@ class BRAINSResampleInputSpec(CommandLineInputSpec): argstr="--inverseTransform ") defaultValue = traits.Float( desc="Default voxel value", argstr="--defaultValue %f") - gridSpacing = InputMultiObject( + gridSpacing = InputMultiPath( traits.Int, desc= "Add warped grid to output image to help show the deformation that occured with specified spacing. A spacing of 0 in a dimension indicates that grid lines should be rendered to fall exactly (i.e. do not allow displacements off that plane). This is useful for makeing a 2D image of grid lines from the 3D space", diff --git a/nipype/interfaces/semtools/registration/brainsresize.py b/nipype/interfaces/semtools/registration/brainsresize.py index 5ea19679da..11238dd914 100644 --- a/nipype/interfaces/semtools/registration/brainsresize.py +++ b/nipype/interfaces/semtools/registration/brainsresize.py @@ -7,7 +7,7 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiObject, OutputMultiObject) + InputMultiPath, OutputMultiPath) class BRAINSResizeInputSpec(CommandLineInputSpec): diff --git a/nipype/interfaces/semtools/registration/specialized.py b/nipype/interfaces/semtools/registration/specialized.py index 5ec3c65c09..2cc08e3ec7 100644 --- a/nipype/interfaces/semtools/registration/specialized.py +++ b/nipype/interfaces/semtools/registration/specialized.py @@ -7,15 +7,15 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiObject, OutputMultiObject) + InputMultiPath, OutputMultiPath) class VBRAINSDemonWarpInputSpec(CommandLineInputSpec): - movingVolume = InputMultiObject( + movingVolume = InputMultiPath( File(exists=True), desc="Required: input moving image", argstr="--movingVolume %s...") - fixedVolume = InputMultiObject( + fixedVolume = InputMultiPath( File(exists=True), desc="Required: input fixed (target) image", argstr="--fixedVolume %s...") @@ -82,19 +82,19 @@ class VBRAINSDemonWarpInputSpec(CommandLineInputSpec): desc= "Number of image pyramid levels to use in the multi-resolution registration.", argstr="--numberOfPyramidLevels %d") - minimumFixedPyramid = InputMultiObject( + minimumFixedPyramid = InputMultiPath( traits.Int, desc= "The shrink factor for the first level of the fixed image pyramid. (i.e. start at 1/16 scale, then 1/8, then 1/4, then 1/2, and finally full scale)", sep=",", argstr="--minimumFixedPyramid %s") - minimumMovingPyramid = InputMultiObject( + minimumMovingPyramid = InputMultiPath( traits.Int, desc= "The shrink factor for the first level of the moving image pyramid. (i.e. start at 1/16 scale, then 1/8, then 1/4, then 1/2, and finally full scale)", sep=",", argstr="--minimumMovingPyramid %s") - arrayOfPyramidLevelIterations = InputMultiObject( + arrayOfPyramidLevelIterations = InputMultiPath( traits.Int, desc="The number of iterations for each pyramid level", sep=",", @@ -109,7 +109,7 @@ class VBRAINSDemonWarpInputSpec(CommandLineInputSpec): numberOfMatchPoints = traits.Int( desc="The number of match points for histrogramMatch", argstr="--numberOfMatchPoints %d") - medianFilterSize = InputMultiObject( + medianFilterSize = InputMultiPath( traits.Int, desc= "Median filter radius in all 3 directions. When images have a lot of salt and pepper noise, this step can improve the registration.", @@ -145,12 +145,12 @@ class VBRAINSDemonWarpInputSpec(CommandLineInputSpec): backgroundFillValue = traits.Int( desc="Replacement value to overwrite background when performing BOBF", argstr="--backgroundFillValue %d") - seedForBOBF = InputMultiObject( + seedForBOBF = InputMultiPath( traits.Int, desc="coordinates in all 3 directions for Seed when performing BOBF", sep=",", argstr="--seedForBOBF %s") - neighborhoodForBOBF = InputMultiObject( + neighborhoodForBOBF = InputMultiPath( traits.Int, desc= "neighborhood in all 3 directions to be included when performing BOBF", @@ -167,7 +167,7 @@ class VBRAINSDemonWarpInputSpec(CommandLineInputSpec): desc= "Genete a checkerboard image volume between the fixedVolume and the deformed movingVolume.", argstr="--outputCheckerboardVolume %s") - checkerboardPatternSubdivisions = InputMultiObject( + checkerboardPatternSubdivisions = InputMultiPath( traits.Int, desc="Number of Checkerboard subdivisions in all 3 directions", sep=",", @@ -179,7 +179,7 @@ class VBRAINSDemonWarpInputSpec(CommandLineInputSpec): outputDebug = traits.Bool( desc="Flag to write debugging images after each step.", argstr="--outputDebug ") - weightFactors = InputMultiObject( + weightFactors = InputMultiPath( traits.Float, desc="Weight fatctors for each input images", sep=",", @@ -329,19 +329,19 @@ class BRAINSDemonWarpInputSpec(CommandLineInputSpec): desc= "Number of image pyramid levels to use in the multi-resolution registration.", argstr="--numberOfPyramidLevels %d") - minimumFixedPyramid = InputMultiObject( + minimumFixedPyramid = InputMultiPath( traits.Int, desc= "The shrink factor for the first level of the fixed image pyramid. (i.e. start at 1/16 scale, then 1/8, then 1/4, then 1/2, and finally full scale)", sep=",", argstr="--minimumFixedPyramid %s") - minimumMovingPyramid = InputMultiObject( + minimumMovingPyramid = InputMultiPath( traits.Int, desc= "The shrink factor for the first level of the moving image pyramid. (i.e. start at 1/16 scale, then 1/8, then 1/4, then 1/2, and finally full scale)", sep=",", argstr="--minimumMovingPyramid %s") - arrayOfPyramidLevelIterations = InputMultiObject( + arrayOfPyramidLevelIterations = InputMultiPath( traits.Int, desc="The number of iterations for each pyramid level", sep=",", @@ -356,7 +356,7 @@ class BRAINSDemonWarpInputSpec(CommandLineInputSpec): numberOfMatchPoints = traits.Int( desc="The number of match points for histrogramMatch", argstr="--numberOfMatchPoints %d") - medianFilterSize = InputMultiObject( + medianFilterSize = InputMultiPath( traits.Int, desc= "Median filter radius in all 3 directions. When images have a lot of salt and pepper noise, this step can improve the registration.", @@ -396,12 +396,12 @@ class BRAINSDemonWarpInputSpec(CommandLineInputSpec): backgroundFillValue = traits.Int( desc="Replacement value to overwrite background when performing BOBF", argstr="--backgroundFillValue %d") - seedForBOBF = InputMultiObject( + seedForBOBF = InputMultiPath( traits.Int, desc="coordinates in all 3 directions for Seed when performing BOBF", sep=",", argstr="--seedForBOBF %s") - neighborhoodForBOBF = InputMultiObject( + neighborhoodForBOBF = InputMultiPath( traits.Int, desc= "neighborhood in all 3 directions to be included when performing BOBF", @@ -418,7 +418,7 @@ class BRAINSDemonWarpInputSpec(CommandLineInputSpec): desc= "Genete a checkerboard image volume between the fixedVolume and the deformed movingVolume.", argstr="--outputCheckerboardVolume %s") - checkerboardPatternSubdivisions = InputMultiObject( + checkerboardPatternSubdivisions = InputMultiPath( traits.Int, desc="Number of Checkerboard subdivisions in all 3 directions", sep=",", @@ -506,11 +506,11 @@ class BRAINSDemonWarp(SEMLikeCommandLine): class BRAINSTransformFromFiducialsInputSpec(CommandLineInputSpec): - fixedLandmarks = InputMultiObject( + fixedLandmarks = InputMultiPath( traits.List(traits.Float(), minlen=3, maxlen=3), desc="Ordered list of landmarks in the fixed image", argstr="--fixedLandmarks %s...") - movingLandmarks = InputMultiObject( + movingLandmarks = InputMultiPath( traits.List(traits.Float(), minlen=3, maxlen=3), desc="Ordered list of landmarks in the moving image", argstr="--movingLandmarks %s...") diff --git a/nipype/interfaces/semtools/segmentation/specialized.py b/nipype/interfaces/semtools/segmentation/specialized.py index 40b261482b..fa08b8e260 100644 --- a/nipype/interfaces/semtools/segmentation/specialized.py +++ b/nipype/interfaces/semtools/segmentation/specialized.py @@ -7,7 +7,7 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiObject, OutputMultiObject) + InputMultiPath, OutputMultiPath) class BRAINSCutInputSpec(CommandLineInputSpec): @@ -280,7 +280,7 @@ class BRAINSConstellationDetectorInputSpec(CommandLineInputSpec): desc= ", Turn on clipping the rescaled image one-tailed on input. Units of standard deviations above the mean. Very large values are very permissive. Non-positive value turns clipping off. Defaults to removing 0.00001 of a normal tail above the mean., ", argstr="--trimRescaledIntensities %f") - rescaleIntensitiesOutputRange = InputMultiObject( + rescaleIntensitiesOutputRange = InputMultiPath( traits.Int, desc= ", This pair of integers gives the lower and upper bounds on the signal portion of the output image. Out-of-field voxels are taken from BackgroundFillValue., ", @@ -304,25 +304,25 @@ class BRAINSConstellationDetectorInputSpec(CommandLineInputSpec): desc= "Type of interpolation to be used when applying transform to moving volume. Options are Linear, ResampleInPlace, NearestNeighbor, BSpline, or WindowedSinc", argstr="--interpolationMode %s") - forceACPoint = InputMultiObject( + forceACPoint = InputMultiPath( traits.Float, desc= ", Use this flag to manually specify the AC point from the original image on the command line., ", sep=",", argstr="--forceACPoint %s") - forcePCPoint = InputMultiObject( + forcePCPoint = InputMultiPath( traits.Float, desc= ", Use this flag to manually specify the PC point from the original image on the command line., ", sep=",", argstr="--forcePCPoint %s") - forceVN4Point = InputMultiObject( + forceVN4Point = InputMultiPath( traits.Float, desc= ", Use this flag to manually specify the VN4 point from the original image on the command line., ", sep=",", argstr="--forceVN4Point %s") - forceRPPoint = InputMultiObject( + forceRPPoint = InputMultiPath( traits.Float, desc= ", Use this flag to manually specify the RP point from the original image on the command line., ", @@ -480,17 +480,17 @@ class BRAINSConstellationDetector(SEMLikeCommandLine): class BRAINSCreateLabelMapFromProbabilityMapsInputSpec(CommandLineInputSpec): - inputProbabilityVolume = InputMultiObject( + inputProbabilityVolume = InputMultiPath( File(exists=True), desc="The list of proobabilityimages.", argstr="--inputProbabilityVolume %s...") - priorLabelCodes = InputMultiObject( + priorLabelCodes = InputMultiPath( traits.Int, desc= "A list of PriorLabelCode values used for coding the output label images", sep=",", argstr="--priorLabelCodes %s") - foregroundPriors = InputMultiObject( + foregroundPriors = InputMultiPath( traits.Int, desc="A list: For each Prior Label, 1 if foreground, 0 if background", sep=",", @@ -556,25 +556,25 @@ class BinaryMaskEditorBasedOnLandmarksInputSpec(CommandLineInputSpec): " The filename for the landmark definition file in the same format produced by Slicer3 (.fcsv). ", exists=True, argstr="--inputLandmarksFilename %s") - inputLandmarkNames = InputMultiObject( + inputLandmarkNames = InputMultiPath( traits.Str, desc= " A target input landmark name to be edited. This should be listed in the inputLandmakrFilename Given. ", sep=",", argstr="--inputLandmarkNames %s") - setCutDirectionForLandmark = InputMultiObject( + setCutDirectionForLandmark = InputMultiPath( traits.Str, desc= "Setting the cutting out direction of the input binary image to the one of anterior, posterior, left, right, superior or posterior. (ENUMERATION: ANTERIOR, POSTERIOR, LEFT, RIGHT, SUPERIOR, POSTERIOR) ", sep=",", argstr="--setCutDirectionForLandmark %s") - setCutDirectionForObliquePlane = InputMultiObject( + setCutDirectionForObliquePlane = InputMultiPath( traits.Str, desc= "If this is true, the mask will be thresholded out to the direction of inferior, posterior, and/or left. Default behavrior is that cutting out to the direction of superior, anterior and/or right. ", sep=",", argstr="--setCutDirectionForObliquePlane %s") - inputLandmarkNamesForObliquePlane = InputMultiObject( + inputLandmarkNamesForObliquePlane = InputMultiPath( traits.Str, desc= " Three subset landmark names of inputLandmarksFilename for a oblique plane computation. The plane computed for binary volume editing. ", @@ -611,11 +611,11 @@ class BRAINSMultiSTAPLEInputSpec(CommandLineInputSpec): "Composite T1, all label maps transofrmed into the space for this image.", exists=True, argstr="--inputCompositeT1Volume %s") - inputLabelVolume = InputMultiObject( + inputLabelVolume = InputMultiPath( File(exists=True), desc="The list of proobabilityimages.", argstr="--inputLabelVolume %s...") - inputTransform = InputMultiObject( + inputTransform = InputMultiPath( File(exists=True), desc="transforms to apply to label volumes", argstr="--inputTransform %s...") @@ -668,7 +668,7 @@ class BRAINSMultiSTAPLE(SEMLikeCommandLine): class BRAINSABCInputSpec(CommandLineInputSpec): - inputVolumes = InputMultiObject( + inputVolumes = InputMultiPath( File(exists=True), desc="The list of input image files to be segmented.", argstr="--inputVolumes %s...") @@ -687,7 +687,7 @@ class BRAINSABCInputSpec(CommandLineInputSpec): desc= "(optional) Filename to which save the final state of the registration", argstr="--saveState %s") - inputVolumeTypes = InputMultiObject( + inputVolumeTypes = InputMultiPath( traits.Str, desc="The list of input image types corresponding to the inputVolumes.", sep=",", @@ -729,7 +729,7 @@ class BRAINSABCInputSpec(CommandLineInputSpec): argstr="--subjectIntermodeTransformType %s") outputVolumes = traits.Either( traits.Bool, - InputMultiObject(File(), ), + InputMultiPath(File(), ), hash_files=False, desc= "Corrected Output Images: should specify the same number of images as inputVolume, if only one element is given, then it is used as a file pattern where %s is replaced by the imageVolumeType, and %d by the index list location.", @@ -771,7 +771,7 @@ class BRAINSABCInputSpec(CommandLineInputSpec): argstr="--interpolationMode %s") maxIterations = traits.Int( desc="Filter iterations", argstr="--maxIterations %d") - medianFilterSize = InputMultiObject( + medianFilterSize = InputMultiPath( traits.Int, desc= "The radius for the optional MedianImageFilter preprocessing in all 3 directions.", @@ -798,7 +798,7 @@ class BRAINSABCInputSpec(CommandLineInputSpec): desc= "If this threshold value is greater than zero, only pure samples are used to compute the distributions in EM classification, and only pure samples are used for KNN training. The default value is set to 0, that means not using pure plugs. However, a value of 0.2 is suggested if you want to activate using pure plugs option.", argstr="--purePlugsThreshold %f") - numberOfSubSamplesInEachPlugArea = InputMultiObject( + numberOfSubSamplesInEachPlugArea = InputMultiPath( traits.Int, desc= "Number of continous index samples taken at each direction of lattice space for each plug volume.", @@ -807,7 +807,7 @@ class BRAINSABCInputSpec(CommandLineInputSpec): atlasWarpingOff = traits.Bool( desc="Deformable registration of atlas to subject", argstr="--atlasWarpingOff ") - gridSize = InputMultiObject( + gridSize = InputMultiPath( traits.Int, desc="Grid size for atlas warping with BSplines", sep=",", @@ -815,7 +815,7 @@ class BRAINSABCInputSpec(CommandLineInputSpec): defaultSuffix = traits.Str(argstr="--defaultSuffix %s") implicitOutputs = traits.Either( traits.Bool, - InputMultiObject(File(), ), + InputMultiPath(File(), ), hash_files=False, desc= "Outputs to be made available to NiPype. Needed because not all BRAINSABC outputs have command line arguments.", @@ -842,14 +842,14 @@ class BRAINSABCOutputSpec(TraitedSpec): desc="The transform from atlas to the subject", exists=True) atlasToSubjectInitialTransform = File( desc="The initial transform from atlas to the subject", exists=True) - outputVolumes = OutputMultiObject( + outputVolumes = OutputMultiPath( File(exists=True), desc= "Corrected Output Images: should specify the same number of images as inputVolume, if only one element is given, then it is used as a file pattern where %s is replaced by the imageVolumeType, and %d by the index list location." ) outputLabels = File(desc="Output Label Image", exists=True) outputDirtyLabels = File(desc="Output Dirty Label Image", exists=True) - implicitOutputs = OutputMultiObject( + implicitOutputs = OutputMultiPath( File(exists=True), desc= "Outputs to be made available to NiPype. Needed because not all BRAINSABC outputs have command line arguments." diff --git a/nipype/interfaces/semtools/testing/featuredetection.py b/nipype/interfaces/semtools/testing/featuredetection.py index afeb967de9..e8f332c0a6 100644 --- a/nipype/interfaces/semtools/testing/featuredetection.py +++ b/nipype/interfaces/semtools/testing/featuredetection.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os diff --git a/nipype/interfaces/semtools/testing/generateaveragelmkfile.py b/nipype/interfaces/semtools/testing/generateaveragelmkfile.py index a68ee5c571..bbb414c366 100644 --- a/nipype/interfaces/semtools/testing/generateaveragelmkfile.py +++ b/nipype/interfaces/semtools/testing/generateaveragelmkfile.py @@ -3,12 +3,12 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os class GenerateAverageLmkFileInputSpec(CommandLineInputSpec): - inputLandmarkFiles = InputMultiObject( + inputLandmarkFiles = InputMultiPath( traits.Str, desc="Input landmark files names (.fcsv or .wts)", sep=",", diff --git a/nipype/interfaces/semtools/testing/landmarkscompare.py b/nipype/interfaces/semtools/testing/landmarkscompare.py index 54fdb9a568..872d6d0df0 100644 --- a/nipype/interfaces/semtools/testing/landmarkscompare.py +++ b/nipype/interfaces/semtools/testing/landmarkscompare.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os diff --git a/nipype/interfaces/semtools/utilities/brains.py b/nipype/interfaces/semtools/utilities/brains.py index 231895df18..abc696b5d9 100644 --- a/nipype/interfaces/semtools/utilities/brains.py +++ b/nipype/interfaces/semtools/utilities/brains.py @@ -7,7 +7,7 @@ from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, - InputMultiObject, OutputMultiObject) + InputMultiPath, OutputMultiPath) class BRAINSConstellationModelerInputSpec(CommandLineInputSpec): @@ -53,7 +53,7 @@ class BRAINSConstellationModelerInputSpec(CommandLineInputSpec): desc= ", Turn on clipping the rescaled image one-tailed on input. Units of standard deviations above the mean. Very large values are very permissive. Non-positive value turns clipping off. Defaults to removing 0.00001 of a normal tail above the mean., ", argstr="--trimRescaledIntensities %f") - rescaleIntensitiesOutputRange = InputMultiObject( + rescaleIntensitiesOutputRange = InputMultiPath( traits.Int, desc= ", This pair of integers gives the lower and upper bounds on the signal portion of the output image. Out-of-field voxels are taken from BackgroundFillValue., ", @@ -308,7 +308,7 @@ class BRAINSMushInputSpec(CommandLineInputSpec): hash_files=False, desc="The brain volume mask generated from the MUSH image", argstr="--outputMask %s") - seed = InputMultiObject( + seed = InputMultiPath( traits.Int, desc="Seed Point for Brain Region Filling", sep=",", @@ -332,13 +332,13 @@ class BRAINSMushInputSpec(CommandLineInputSpec): upperThresholdFactor = traits.Float( desc="Upper threshold factor for defining the brain mask", argstr="--upperThresholdFactor %f") - boundingBoxSize = InputMultiObject( + boundingBoxSize = InputMultiPath( traits.Int, desc= "Size of the cubic bounding box mask used when no brain mask is present", sep=",", argstr="--boundingBoxSize %s") - boundingBoxStart = InputMultiObject( + boundingBoxStart = InputMultiPath( traits.Int, desc= "XYZ point-coordinate for the start of the cubic bounding box mask used when no brain mask is present", @@ -566,13 +566,13 @@ class BRAINSInitializedControlPointsInputSpec(CommandLineInputSpec): hash_files=False, desc="Output Volume", argstr="--outputVolume %s") - splineGridSize = InputMultiObject( + splineGridSize = InputMultiPath( traits.Int, desc= "The number of subdivisions of the BSpline Grid to be centered on the image space. Each dimension must have at least 3 subdivisions for the BSpline to be correctly computed. ", sep=",", argstr="--splineGridSize %s") - permuteOrder = InputMultiObject( + permuteOrder = InputMultiPath( traits.Int, desc= "The permutation order for the images. The default is 0,1,2 (i.e. no permutation)", @@ -614,14 +614,14 @@ class BRAINSInitializedControlPoints(SEMLikeCommandLine): class CleanUpOverlapLabelsInputSpec(CommandLineInputSpec): - inputBinaryVolumes = InputMultiObject( + inputBinaryVolumes = InputMultiPath( File(exists=True), desc= "The list of binary images to be checked and cleaned up. Order is important. Binary volume given first always wins out. ", argstr="--inputBinaryVolumes %s...") outputBinaryVolumes = traits.Either( traits.Bool, - InputMultiObject(File(), ), + InputMultiPath(File(), ), hash_files=False, desc= "The output label map images, with integer values in it. Each label value specified in the inputLabels is combined into this output label map volume", @@ -629,7 +629,7 @@ class CleanUpOverlapLabelsInputSpec(CommandLineInputSpec): class CleanUpOverlapLabelsOutputSpec(TraitedSpec): - outputBinaryVolumes = OutputMultiObject( + outputBinaryVolumes = OutputMultiPath( File(exists=True), desc= "The output label map images, with integer values in it. Each label value specified in the inputLabels is combined into this output label map volume" @@ -707,7 +707,7 @@ class BRAINSClipInferior(SEMLikeCommandLine): class GenerateLabelMapFromProbabilityMapInputSpec(CommandLineInputSpec): - inputVolumes = InputMultiObject( + inputVolumes = InputMultiPath( File(exists=True), desc="The Input probaiblity images to be computed for lable maps", argstr="--inputVolumes %s...") @@ -782,7 +782,7 @@ class BRAINSAlignMSPInputSpec(CommandLineInputSpec): desc= ", Turn on clipping the rescaled image one-tailed on input. Units of standard deviations above the mean. Very large values are very permissive. Non-positive value turns clipping off. Defaults to removing 0.00001 of a normal tail above the mean., ", argstr="--trimRescaledIntensities %f") - rescaleIntensitiesOutputRange = InputMultiObject( + rescaleIntensitiesOutputRange = InputMultiPath( traits.Int, desc= ", This pair of integers gives the lower and upper bounds on the signal portion of the output image. Out-of-field voxels are taken from BackgroundFillValue., ", @@ -924,35 +924,35 @@ class insertMidACPCpoint(SEMLikeCommandLine): class BRAINSSnapShotWriterInputSpec(CommandLineInputSpec): - inputVolumes = InputMultiObject( + inputVolumes = InputMultiPath( File(exists=True), desc= "Input image volume list to be extracted as 2D image. Multiple input is possible. At least one input is required.", argstr="--inputVolumes %s...") - inputBinaryVolumes = InputMultiObject( + inputBinaryVolumes = InputMultiPath( File(exists=True), desc= "Input mask (binary) volume list to be extracted as 2D image. Multiple input is possible.", argstr="--inputBinaryVolumes %s...") - inputSliceToExtractInPhysicalPoint = InputMultiObject( + inputSliceToExtractInPhysicalPoint = InputMultiPath( traits.Float, desc= "2D slice number of input images. For autoWorkUp output, which AC-PC aligned, 0,0,0 will be the center.", sep=",", argstr="--inputSliceToExtractInPhysicalPoint %s") - inputSliceToExtractInIndex = InputMultiObject( + inputSliceToExtractInIndex = InputMultiPath( traits.Int, desc= "2D slice number of input images. For size of 256*256*256 image, 128 is usually used.", sep=",", argstr="--inputSliceToExtractInIndex %s") - inputSliceToExtractInPercent = InputMultiObject( + inputSliceToExtractInPercent = InputMultiPath( traits.Int, desc= "2D slice number of input images. Percentage input from 0%-100%. (ex. --inputSliceToExtractInPercent 50,50,50", sep=",", argstr="--inputSliceToExtractInPercent %s") - inputPlaneDirection = InputMultiObject( + inputPlaneDirection = InputMultiPath( traits.Int, desc= "Plane to display. In general, 0=saggital, 1=coronal, and 2=axial plane.", diff --git a/nipype/interfaces/slicer/converters.py b/nipype/interfaces/slicer/converters.py index c779498ac9..e93b994110 100644 --- a/nipype/interfaces/slicer/converters.py +++ b/nipype/interfaces/slicer/converters.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os diff --git a/nipype/interfaces/slicer/diffusion/diffusion.py b/nipype/interfaces/slicer/diffusion/diffusion.py index ebabe6c802..a088d25f8a 100644 --- a/nipype/interfaces/slicer/diffusion/diffusion.py +++ b/nipype/interfaces/slicer/diffusion/diffusion.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os @@ -87,19 +87,19 @@ class ResampleDTIVolumeInputSpec(CommandLineInputSpec): desc= "Inverse the transformation before applying it from output image to input image (only for rigid and affine transforms)", argstr="--Inverse_ITK_Transformation ") - spacing = InputMultiObject( + spacing = InputMultiPath( traits.Float, desc="Spacing along each dimension (0 means use input spacing)", sep=",", argstr="--spacing %s") - size = InputMultiObject( + size = InputMultiPath( traits.Float, desc="Size along each dimension (0 means use input size)", sep=",", argstr="--size %s") origin = traits.List( desc="Origin of the output Image", argstr="--origin %s") - direction_matrix = InputMultiObject( + direction_matrix = InputMultiPath( traits.Float, desc= "9 parameters of the direction matrix by rows (ijk to LPS if LPS transform, ijk to RAS if RAS transform)", @@ -124,7 +124,7 @@ class ResampleDTIVolumeInputSpec(CommandLineInputSpec): spline_order = traits.Int( desc="Spline Order (Spline order may be from 0 to 5)", argstr="--spline_order %d") - transform_matrix = InputMultiObject( + transform_matrix = InputMultiPath( traits.Float, desc= "12 parameters of the transform matrix by rows ( --last 3 being translation-- )", @@ -168,9 +168,9 @@ class DWIRicianLMMSEFilterInputSpec(CommandLineInputSpec): iter = traits.Int( desc="Number of iterations for the noise removal filter.", argstr="--iter %d") - re = InputMultiObject( + re = InputMultiPath( traits.Int, desc="Estimation radius.", sep=",", argstr="--re %s") - rf = InputMultiObject( + rf = InputMultiPath( traits.Int, desc="Filtering radius.", sep=",", argstr="--rf %s") mnvf = traits.Int( desc="Minimum number of voxels in kernel used for filtering.", @@ -327,9 +327,9 @@ class TractographyLabelMapSeeding(SEMLikeCommandLine): class DWIJointRicianLMMSEFilterInputSpec(CommandLineInputSpec): - re = InputMultiObject( + re = InputMultiPath( traits.Int, desc="Estimation radius.", sep=",", argstr="--re %s") - rf = InputMultiObject( + rf = InputMultiPath( traits.Int, desc="Filtering radius.", sep=",", argstr="--rf %s") ng = traits.Int( desc= diff --git a/nipype/interfaces/slicer/filtering/arithmetic.py b/nipype/interfaces/slicer/filtering/arithmetic.py index 9b79bd017c..22785e32e1 100644 --- a/nipype/interfaces/slicer/filtering/arithmetic.py +++ b/nipype/interfaces/slicer/filtering/arithmetic.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os diff --git a/nipype/interfaces/slicer/filtering/checkerboardfilter.py b/nipype/interfaces/slicer/filtering/checkerboardfilter.py index 3b3668639a..e4ad85dc5e 100644 --- a/nipype/interfaces/slicer/filtering/checkerboardfilter.py +++ b/nipype/interfaces/slicer/filtering/checkerboardfilter.py @@ -3,12 +3,12 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os class CheckerBoardFilterInputSpec(CommandLineInputSpec): - checkerPattern = InputMultiObject( + checkerPattern = InputMultiPath( traits.Int, desc= "The pattern of input 1 and input 2 in the output image. The user can specify the number of checkers in each dimension. A checkerPattern of 2,2,1 means that images will alternate in every other checker in the first two dimensions. The same pattern will be used in the 3rd dimension.", diff --git a/nipype/interfaces/slicer/filtering/denoising.py b/nipype/interfaces/slicer/filtering/denoising.py index 125ffb38d1..0dbaaebf74 100644 --- a/nipype/interfaces/slicer/filtering/denoising.py +++ b/nipype/interfaces/slicer/filtering/denoising.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os @@ -164,7 +164,7 @@ class GaussianBlurImageFilter(SEMLikeCommandLine): class MedianImageFilterInputSpec(CommandLineInputSpec): - neighborhood = InputMultiObject( + neighborhood = InputMultiPath( traits.Int, desc="The size of the neighborhood in each dimension", sep=",", diff --git a/nipype/interfaces/slicer/filtering/extractskeleton.py b/nipype/interfaces/slicer/filtering/extractskeleton.py index 8a1d92dd57..d7770c8f2e 100644 --- a/nipype/interfaces/slicer/filtering/extractskeleton.py +++ b/nipype/interfaces/slicer/filtering/extractskeleton.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os diff --git a/nipype/interfaces/slicer/filtering/histogrammatching.py b/nipype/interfaces/slicer/filtering/histogrammatching.py index f8c211d598..1b3b26b061 100644 --- a/nipype/interfaces/slicer/filtering/histogrammatching.py +++ b/nipype/interfaces/slicer/filtering/histogrammatching.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os diff --git a/nipype/interfaces/slicer/filtering/imagelabelcombine.py b/nipype/interfaces/slicer/filtering/imagelabelcombine.py index b0fd8d8e41..067a575045 100644 --- a/nipype/interfaces/slicer/filtering/imagelabelcombine.py +++ b/nipype/interfaces/slicer/filtering/imagelabelcombine.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os diff --git a/nipype/interfaces/slicer/filtering/morphology.py b/nipype/interfaces/slicer/filtering/morphology.py index d9c12708c8..913c63d5ab 100644 --- a/nipype/interfaces/slicer/filtering/morphology.py +++ b/nipype/interfaces/slicer/filtering/morphology.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os diff --git a/nipype/interfaces/slicer/filtering/n4itkbiasfieldcorrection.py b/nipype/interfaces/slicer/filtering/n4itkbiasfieldcorrection.py index b985545fe1..28f694f77e 100644 --- a/nipype/interfaces/slicer/filtering/n4itkbiasfieldcorrection.py +++ b/nipype/interfaces/slicer/filtering/n4itkbiasfieldcorrection.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os @@ -29,7 +29,7 @@ class N4ITKBiasFieldCorrectionInputSpec(CommandLineInputSpec): hash_files=False, desc="Recovered bias field (OPTIONAL)", argstr="--outputbiasfield %s") - iterations = InputMultiObject( + iterations = InputMultiPath( traits.Int, desc= "Maximum number of iterations at each level of resolution. Larger values will increase execution time, but may lead to better results.", @@ -39,7 +39,7 @@ class N4ITKBiasFieldCorrectionInputSpec(CommandLineInputSpec): desc= "Stopping criterion for the iterative bias estimation. Larger values will lead to smaller execution time.", argstr="--convergencethreshold %f") - meshresolution = InputMultiObject( + meshresolution = InputMultiPath( traits.Float, desc= "Resolution of the initial bspline grid defined as a sequence of three numbers. The actual resolution will be defined by adding the bspline order (default is 3) to the resolution in each dimension specified here. For example, 1,1,1 will result in a 4x4x4 grid of control points. This parameter may need to be adjusted based on your input image. In the multi-resolution N4 framework, the resolution of the bspline grid at subsequent iterations will be doubled. The number of resolutions is implicitly defined by Number of iterations parameter (the size of this list is the number of resolutions)", @@ -59,7 +59,7 @@ class N4ITKBiasFieldCorrectionInputSpec(CommandLineInputSpec): argstr="--bsplineorder %d") weightimage = File( desc="Weight Image", exists=True, argstr="--weightimage %s") - histogramsharpening = InputMultiObject( + histogramsharpening = InputMultiPath( traits.Float, desc= "A vector of up to three values. Non-zero values correspond to Bias Field Full Width at Half Maximum, Wiener filter noise, and Number of histogram bins.", diff --git a/nipype/interfaces/slicer/filtering/resamplescalarvectordwivolume.py b/nipype/interfaces/slicer/filtering/resamplescalarvectordwivolume.py index 618014dd47..6205b76b54 100644 --- a/nipype/interfaces/slicer/filtering/resamplescalarvectordwivolume.py +++ b/nipype/interfaces/slicer/filtering/resamplescalarvectordwivolume.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os @@ -74,19 +74,19 @@ class ResampleScalarVectorDWIVolumeInputSpec(CommandLineInputSpec): desc= "Inverse the transformation before applying it from output image to input image", argstr="--Inverse_ITK_Transformation ") - spacing = InputMultiObject( + spacing = InputMultiPath( traits.Float, desc="Spacing along each dimension (0 means use input spacing)", sep=",", argstr="--spacing %s") - size = InputMultiObject( + size = InputMultiPath( traits.Float, desc="Size along each dimension (0 means use input size)", sep=",", argstr="--size %s") origin = traits.List( desc="Origin of the output Image", argstr="--origin %s") - direction_matrix = InputMultiObject( + direction_matrix = InputMultiPath( traits.Float, desc= "9 parameters of the direction matrix by rows (ijk to LPS if LPS transform, ijk to RAS if RAS transform)", @@ -109,7 +109,7 @@ class ResampleScalarVectorDWIVolumeInputSpec(CommandLineInputSpec): "Window Function , h = Hamming , c = Cosine , w = Welch , l = Lanczos , b = Blackman", argstr="--window_function %s") spline_order = traits.Int(desc="Spline Order", argstr="--spline_order %d") - transform_matrix = InputMultiObject( + transform_matrix = InputMultiPath( traits.Float, desc= "12 parameters of the transform matrix by rows ( --last 3 being translation-- )", diff --git a/nipype/interfaces/slicer/filtering/thresholdscalarvolume.py b/nipype/interfaces/slicer/filtering/thresholdscalarvolume.py index f1ec4ba05f..041ce10990 100644 --- a/nipype/interfaces/slicer/filtering/thresholdscalarvolume.py +++ b/nipype/interfaces/slicer/filtering/thresholdscalarvolume.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os diff --git a/nipype/interfaces/slicer/filtering/votingbinaryholefillingimagefilter.py b/nipype/interfaces/slicer/filtering/votingbinaryholefillingimagefilter.py index 48b56ebeaa..9c19799d04 100644 --- a/nipype/interfaces/slicer/filtering/votingbinaryholefillingimagefilter.py +++ b/nipype/interfaces/slicer/filtering/votingbinaryholefillingimagefilter.py @@ -3,12 +3,12 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os class VotingBinaryHoleFillingImageFilterInputSpec(CommandLineInputSpec): - radius = InputMultiObject( + radius = InputMultiPath( traits.Int, desc="The radius of a hole to be filled", sep=",", diff --git a/nipype/interfaces/slicer/generate_classes.py b/nipype/interfaces/slicer/generate_classes.py index 77b1781264..6fe3ae927f 100644 --- a/nipype/interfaces/slicer/generate_classes.py +++ b/nipype/interfaces/slicer/generate_classes.py @@ -42,7 +42,7 @@ def add_class_to_package(class_codes, class_names, module_name, package_dir): imports = """from __future__ import (print_function, division, unicode_literals, absolute_import) from ..base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, - File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject) + File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath) import os\n\n\n""" f_m.write(imports) f_m.write("\n\n".join(class_codes)) @@ -266,7 +266,7 @@ def generate_class(module, for el in param.getElementsByTagName('element') ] elif param.nodeName.endswith('-vector'): - type = "InputMultiObject" + type = "InputMultiPath" if param.nodeName in [ 'file', 'directory', 'image', 'geometry', 'transform', 'table' @@ -282,7 +282,7 @@ def generate_class(module, else: traitsParams["sep"] = ',' elif param.getAttribute('multiple') == "true": - type = "InputMultiObject" + type = "InputMultiPath" if param.nodeName in [ 'file', 'directory', 'image', 'geometry', 'transform', 'table' @@ -331,7 +331,7 @@ def generate_class(module, if param.nodeName in [ 'file', 'directory', 'image', 'geometry', 'transform', 'table' - ] and type not in ["InputMultiObject", "traits.List"]: + ] and type not in ["InputMultiPath", "traits.List"]: traitsParams["exists"] = True inputTraits.append("%s = %s(%s%s)" % (name, type, parse_values(values), diff --git a/nipype/interfaces/slicer/legacy/converters.py b/nipype/interfaces/slicer/legacy/converters.py index 6d59b0c6e8..f5af1ad29b 100644 --- a/nipype/interfaces/slicer/legacy/converters.py +++ b/nipype/interfaces/slicer/legacy/converters.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os diff --git a/nipype/interfaces/slicer/legacy/diffusion/denoising.py b/nipype/interfaces/slicer/legacy/diffusion/denoising.py index 81891b9470..0cc8cce0f6 100644 --- a/nipype/interfaces/slicer/legacy/diffusion/denoising.py +++ b/nipype/interfaces/slicer/legacy/diffusion/denoising.py @@ -3,18 +3,18 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os class DWIUnbiasedNonLocalMeansFilterInputSpec(CommandLineInputSpec): - rs = InputMultiObject( + rs = InputMultiPath( traits.Int, desc= "The algorithm search for similar voxels in a neighborhood of this size (larger sizes than the default one are extremely slow).", sep=",", argstr="--rs %s") - rc = InputMultiObject( + rc = InputMultiPath( traits.Int, desc= "Similarity between blocks is measured using windows of this size.", @@ -28,7 +28,7 @@ class DWIUnbiasedNonLocalMeansFilterInputSpec(CommandLineInputSpec): desc= "The number of the closest gradients that are used to jointly filter a given gradient direction (a maximum of 5 is allowed).", argstr="--ng %d") - re = InputMultiObject( + re = InputMultiPath( traits.Int, desc= "A neighborhood of this size is used to compute the statistics for noise estimation.", diff --git a/nipype/interfaces/slicer/legacy/filtering.py b/nipype/interfaces/slicer/legacy/filtering.py index 6aee218776..aaed2350e0 100644 --- a/nipype/interfaces/slicer/legacy/filtering.py +++ b/nipype/interfaces/slicer/legacy/filtering.py @@ -2,7 +2,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os @@ -65,7 +65,7 @@ class OtsuThresholdImageFilter(SEMLikeCommandLine): class ResampleScalarVolumeInputSpec(CommandLineInputSpec): - spacing = InputMultiObject( + spacing = InputMultiPath( traits.Float, desc="Spacing along each dimension (0 means use input spacing)", sep=",", diff --git a/nipype/interfaces/slicer/legacy/registration.py b/nipype/interfaces/slicer/legacy/registration.py index 21210d5177..7f73d85d82 100644 --- a/nipype/interfaces/slicer/legacy/registration.py +++ b/nipype/interfaces/slicer/legacy/registration.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os @@ -305,13 +305,13 @@ class RigidRegistrationInputSpec(CommandLineInputSpec): desc= "Number of spatial samples to use in estimating Mattes Mutual Information. Larger values yield more accurate PDFs and improved registration quality.", argstr="--spatialsamples %d") - iterations = InputMultiObject( + iterations = InputMultiPath( traits.Int, desc= "Comma separated list of iterations. Must have the same number of elements as the learning rate.", sep=",", argstr="--iterations %s") - learningrate = InputMultiObject( + learningrate = InputMultiPath( traits.Float, desc= "Comma separated list of learning rates. Learning rate is a scale factor on the gradient of the registration objective function (gradient with respect to the parameters of the transformation) used to update the parameters of the transformation during optimization. Smaller values cause the optimizer to take smaller steps through the parameter space. Larger values are typically used early in the registration process to take large jumps in parameter space followed by smaller values to home in on the optimum value of the registration objective function. Default is: 0.01, 0.005, 0.0005, 0.0002. Must have the same number of elements as iterations.", @@ -413,13 +413,13 @@ class LinearRegistrationInputSpec(CommandLineInputSpec): desc= "Number of spatial samples to use in estimating Mattes Mutual Information. Larger values yield more accurate PDFs and improved registration quality.", argstr="--spatialsamples %d") - iterations = InputMultiObject( + iterations = InputMultiPath( traits.Int, desc= "Comma separated list of iterations. Must have the same number of elements as the learning rate.", sep=",", argstr="--iterations %s") - learningrate = InputMultiObject( + learningrate = InputMultiPath( traits.Float, desc= "Comma separated list of learning rates. Learning rate is a scale factor on the gradient of the registration objective function (gradient with respect to the parameters of the transformation) used to update the parameters of the transformation during optimization. Smaller values cause the optimizer to take smaller steps through the parameter space. Larger values are typically used early in the registration process to take large jumps in parameter space followed by smaller values to home in on the optimum value of the registration objective function. Default is: 0.01, 0.005, 0.0005, 0.0002. Must have the same number of elements as iterations.", @@ -589,11 +589,11 @@ class ExpertAutomatedRegistrationInputSpec(CommandLineInputSpec): "BSpline", desc="Method for interpolation within the optimization process", argstr="--interpolation %s") - fixedLandmarks = InputMultiObject( + fixedLandmarks = InputMultiPath( traits.List(traits.Float(), minlen=3, maxlen=3), desc="Ordered list of landmarks in the fixed image", argstr="--fixedLandmarks %s...") - movingLandmarks = InputMultiObject( + movingLandmarks = InputMultiPath( traits.List(traits.Float(), minlen=3, maxlen=3), desc="Ordered list of landmarks in the moving image", argstr="--movingLandmarks %s...") diff --git a/nipype/interfaces/slicer/legacy/segmentation.py b/nipype/interfaces/slicer/legacy/segmentation.py index 00d2bffb42..3500d50d50 100644 --- a/nipype/interfaces/slicer/legacy/segmentation.py +++ b/nipype/interfaces/slicer/legacy/segmentation.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os diff --git a/nipype/interfaces/slicer/quantification/changequantification.py b/nipype/interfaces/slicer/quantification/changequantification.py index d1ab5e3e94..5abf1b1287 100644 --- a/nipype/interfaces/slicer/quantification/changequantification.py +++ b/nipype/interfaces/slicer/quantification/changequantification.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os diff --git a/nipype/interfaces/slicer/quantification/petstandarduptakevaluecomputation.py b/nipype/interfaces/slicer/quantification/petstandarduptakevaluecomputation.py index 4dda7f24c6..0edfca3fbb 100644 --- a/nipype/interfaces/slicer/quantification/petstandarduptakevaluecomputation.py +++ b/nipype/interfaces/slicer/quantification/petstandarduptakevaluecomputation.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os diff --git a/nipype/interfaces/slicer/registration/brainsfit.py b/nipype/interfaces/slicer/registration/brainsfit.py index 739ee0f41b..adbd733976 100644 --- a/nipype/interfaces/slicer/registration/brainsfit.py +++ b/nipype/interfaces/slicer/registration/brainsfit.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os @@ -77,13 +77,13 @@ class BRAINSFitInputSpec(CommandLineInputSpec): desc= "The number of voxels sampled for mutual information computation. Increase this for a slower, more careful fit. You can also limit the sampling focus with ROI masks and ROIAUTO mask generation.", argstr="--numberOfSamples %d") - splineGridSize = InputMultiObject( + splineGridSize = InputMultiPath( traits.Int, desc= "The number of subdivisions of the BSpline Grid to be centered on the image space. Each dimension must have at least 3 subdivisions for the BSpline to be correctly computed. ", sep=",", argstr="--splineGridSize %s") - numberOfIterations = InputMultiObject( + numberOfIterations = InputMultiPath( traits.Int, desc= "The maximum number of iterations to try before failing to converge. Use an explicit limit like 500 or 1000 to manage risk of divergence", @@ -153,7 +153,7 @@ class BRAINSFitInputSpec(CommandLineInputSpec): desc= "Type of interpolation to be used when applying transform to moving volume. Options are Linear, NearestNeighbor, BSpline, WindowedSinc, or ResampleInPlace. The ResampleInPlace option will create an image with the same discrete voxel values and will adjust the origin and direction of the physical space interpretation.", argstr="--interpolationMode %s") - minimumStepLength = InputMultiObject( + minimumStepLength = InputMultiPath( traits.Float, desc= "Each step in the optimization takes steps at least this big. When none are possible, registration is complete.", @@ -191,7 +191,7 @@ class BRAINSFitInputSpec(CommandLineInputSpec): desc= "File name for the rigid component of the estimated affine transform. Can be used to rigidly register the moving image to the fixed image. NOTE: This value is overwritten if either bsplineTransform or linearTransform is set.", argstr="--strippedOutputTransform %s") - transformType = InputMultiObject( + transformType = InputMultiPath( traits.Str, desc= "Specifies a list of registration types to be used. The valid types are, Rigid, ScaleVersor3D, ScaleSkewVersor3D, Affine, and BSpline. Specifiying more than one in a comma separated list will initialize the next stage with the previous results. If registrationClass flag is used, it overrides this parameter setting.", @@ -212,7 +212,7 @@ class BRAINSFitInputSpec(CommandLineInputSpec): desc= "The index in the time series for the 3D moving image to fit, if 4-dimensional.", argstr="--movingVolumeTimeIndex %d") - medianFilterSize = InputMultiObject( + medianFilterSize = InputMultiPath( traits.Int, desc= "The radius for the optional MedianImageFilter preprocessing in all 3 directions.", @@ -296,7 +296,7 @@ class BRAINSFitInputSpec(CommandLineInputSpec): NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_02 = traits.Bool( desc="DO NOT USE THIS FLAG", argstr="--NEVER_USE_THIS_FLAG_IT_IS_OUTDATED_02 ") - permitParameterVariation = InputMultiObject( + permitParameterVariation = InputMultiPath( traits.Int, desc= "A bit vector to permit linear transform parameters to vary under optimization. The vector order corresponds with transform parameters, and beyond the end ones fill in as a default. For instance, you can choose to rotate only in x (pitch) with 1,0,0; this is mostly for expert use in turning on and off individual degrees of freedom in rotation, translation or scaling without multiplying the number of transform representations; this trick is probably meaningless when tried with the general affine transform.", diff --git a/nipype/interfaces/slicer/registration/brainsresample.py b/nipype/interfaces/slicer/registration/brainsresample.py index f1a8b559fc..a3b79681fd 100644 --- a/nipype/interfaces/slicer/registration/brainsresample.py +++ b/nipype/interfaces/slicer/registration/brainsresample.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os @@ -61,7 +61,7 @@ class BRAINSResampleInputSpec(CommandLineInputSpec): argstr="--inverseTransform ") defaultValue = traits.Float( desc="Default voxel value", argstr="--defaultValue %f") - gridSpacing = InputMultiObject( + gridSpacing = InputMultiPath( traits.Int, desc= "Add warped grid to output image to help show the deformation that occured with specified spacing. A spacing of 0 in a dimension indicates that grid lines should be rendered to fall exactly (i.e. do not allow displacements off that plane). This is useful for makeing a 2D image of grid lines from the 3D space ", diff --git a/nipype/interfaces/slicer/registration/specialized.py b/nipype/interfaces/slicer/registration/specialized.py index be72a3a4f1..9c6c3f5f20 100644 --- a/nipype/interfaces/slicer/registration/specialized.py +++ b/nipype/interfaces/slicer/registration/specialized.py @@ -3,17 +3,17 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os class ACPCTransformInputSpec(CommandLineInputSpec): - acpc = InputMultiObject( + acpc = InputMultiPath( traits.List(traits.Float(), minlen=3, maxlen=3), desc= "ACPC line, two fiducial points, one at the anterior commissure and one at the posterior commissure.", argstr="--acpc %s...") - midline = InputMultiObject( + midline = InputMultiPath( traits.List(traits.Float(), minlen=3, maxlen=3), desc= "The midline is a series of points defining the division between the hemispheres of the brain (the mid sagittal plane).", @@ -62,11 +62,11 @@ class ACPCTransform(SEMLikeCommandLine): class FiducialRegistrationInputSpec(CommandLineInputSpec): - fixedLandmarks = InputMultiObject( + fixedLandmarks = InputMultiPath( traits.List(traits.Float(), minlen=3, maxlen=3), desc="Ordered list of landmarks in the fixed image", argstr="--fixedLandmarks %s...") - movingLandmarks = InputMultiObject( + movingLandmarks = InputMultiPath( traits.List(traits.Float(), minlen=3, maxlen=3), desc="Ordered list of landmarks in the moving image", argstr="--movingLandmarks %s...") @@ -117,11 +117,11 @@ class FiducialRegistration(SEMLikeCommandLine): class VBRAINSDemonWarpInputSpec(CommandLineInputSpec): - movingVolume = InputMultiObject( + movingVolume = InputMultiPath( File(exists=True), desc="Required: input moving image", argstr="--movingVolume %s...") - fixedVolume = InputMultiObject( + fixedVolume = InputMultiPath( File(exists=True), desc="Required: input fixed (target) image", argstr="--fixedVolume %s...") @@ -188,19 +188,19 @@ class VBRAINSDemonWarpInputSpec(CommandLineInputSpec): desc= "Number of image pyramid levels to use in the multi-resolution registration.", argstr="--numberOfPyramidLevels %d") - minimumFixedPyramid = InputMultiObject( + minimumFixedPyramid = InputMultiPath( traits.Int, desc= "The shrink factor for the first level of the fixed image pyramid. (i.e. start at 1/16 scale, then 1/8, then 1/4, then 1/2, and finally full scale)", sep=",", argstr="--minimumFixedPyramid %s") - minimumMovingPyramid = InputMultiObject( + minimumMovingPyramid = InputMultiPath( traits.Int, desc= "The shrink factor for the first level of the moving image pyramid. (i.e. start at 1/16 scale, then 1/8, then 1/4, then 1/2, and finally full scale)", sep=",", argstr="--minimumMovingPyramid %s") - arrayOfPyramidLevelIterations = InputMultiObject( + arrayOfPyramidLevelIterations = InputMultiPath( traits.Int, desc="The number of iterations for each pyramid level", sep=",", @@ -215,7 +215,7 @@ class VBRAINSDemonWarpInputSpec(CommandLineInputSpec): numberOfMatchPoints = traits.Int( desc="The number of match points for histrogramMatch", argstr="--numberOfMatchPoints %d") - medianFilterSize = InputMultiObject( + medianFilterSize = InputMultiPath( traits.Int, desc= "Median filter radius in all 3 directions. When images have a lot of salt and pepper noise, this step can improve the registration.", @@ -251,12 +251,12 @@ class VBRAINSDemonWarpInputSpec(CommandLineInputSpec): backgroundFillValue = traits.Int( desc="Replacement value to overwrite background when performing BOBF", argstr="--backgroundFillValue %d") - seedForBOBF = InputMultiObject( + seedForBOBF = InputMultiPath( traits.Int, desc="coordinates in all 3 directions for Seed when performing BOBF", sep=",", argstr="--seedForBOBF %s") - neighborhoodForBOBF = InputMultiObject( + neighborhoodForBOBF = InputMultiPath( traits.Int, desc= "neighborhood in all 3 directions to be included when performing BOBF", @@ -273,7 +273,7 @@ class VBRAINSDemonWarpInputSpec(CommandLineInputSpec): desc= "Genete a checkerboard image volume between the fixedVolume and the deformed movingVolume.", argstr="--outputCheckerboardVolume %s") - checkerboardPatternSubdivisions = InputMultiObject( + checkerboardPatternSubdivisions = InputMultiPath( traits.Int, desc="Number of Checkerboard subdivisions in all 3 directions", sep=",", @@ -285,7 +285,7 @@ class VBRAINSDemonWarpInputSpec(CommandLineInputSpec): outputDebug = traits.Bool( desc="Flag to write debugging images after each step.", argstr="--outputDebug ") - weightFactors = InputMultiObject( + weightFactors = InputMultiPath( traits.Float, desc="Weight fatctors for each input images", sep=",", @@ -437,19 +437,19 @@ class BRAINSDemonWarpInputSpec(CommandLineInputSpec): desc= "Number of image pyramid levels to use in the multi-resolution registration.", argstr="--numberOfPyramidLevels %d") - minimumFixedPyramid = InputMultiObject( + minimumFixedPyramid = InputMultiPath( traits.Int, desc= "The shrink factor for the first level of the fixed image pyramid. (i.e. start at 1/16 scale, then 1/8, then 1/4, then 1/2, and finally full scale)", sep=",", argstr="--minimumFixedPyramid %s") - minimumMovingPyramid = InputMultiObject( + minimumMovingPyramid = InputMultiPath( traits.Int, desc= "The shrink factor for the first level of the moving image pyramid. (i.e. start at 1/16 scale, then 1/8, then 1/4, then 1/2, and finally full scale)", sep=",", argstr="--minimumMovingPyramid %s") - arrayOfPyramidLevelIterations = InputMultiObject( + arrayOfPyramidLevelIterations = InputMultiPath( traits.Int, desc="The number of iterations for each pyramid level", sep=",", @@ -464,7 +464,7 @@ class BRAINSDemonWarpInputSpec(CommandLineInputSpec): numberOfMatchPoints = traits.Int( desc="The number of match points for histrogramMatch", argstr="--numberOfMatchPoints %d") - medianFilterSize = InputMultiObject( + medianFilterSize = InputMultiPath( traits.Int, desc= "Median filter radius in all 3 directions. When images have a lot of salt and pepper noise, this step can improve the registration.", @@ -504,12 +504,12 @@ class BRAINSDemonWarpInputSpec(CommandLineInputSpec): backgroundFillValue = traits.Int( desc="Replacement value to overwrite background when performing BOBF", argstr="--backgroundFillValue %d") - seedForBOBF = InputMultiObject( + seedForBOBF = InputMultiPath( traits.Int, desc="coordinates in all 3 directions for Seed when performing BOBF", sep=",", argstr="--seedForBOBF %s") - neighborhoodForBOBF = InputMultiObject( + neighborhoodForBOBF = InputMultiPath( traits.Int, desc= "neighborhood in all 3 directions to be included when performing BOBF", @@ -526,7 +526,7 @@ class BRAINSDemonWarpInputSpec(CommandLineInputSpec): desc= "Genete a checkerboard image volume between the fixedVolume and the deformed movingVolume.", argstr="--outputCheckerboardVolume %s") - checkerboardPatternSubdivisions = InputMultiObject( + checkerboardPatternSubdivisions = InputMultiPath( traits.Int, desc="Number of Checkerboard subdivisions in all 3 directions", sep=",", diff --git a/nipype/interfaces/slicer/segmentation/simpleregiongrowingsegmentation.py b/nipype/interfaces/slicer/segmentation/simpleregiongrowingsegmentation.py index dba833edae..d466ccc1ac 100644 --- a/nipype/interfaces/slicer/segmentation/simpleregiongrowingsegmentation.py +++ b/nipype/interfaces/slicer/segmentation/simpleregiongrowingsegmentation.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os @@ -27,7 +27,7 @@ class SimpleRegionGrowingSegmentationInputSpec(CommandLineInputSpec): desc= "The integer value (0-255) to use for the segmentation results. This will determine the color of the segmentation that will be generated by the Region growing algorithm", argstr="--labelvalue %d") - seed = InputMultiObject( + seed = InputMultiPath( traits.List(traits.Float(), minlen=3, maxlen=3), desc="Seed point(s) for region growing", argstr="--seed %s...") diff --git a/nipype/interfaces/slicer/segmentation/specialized.py b/nipype/interfaces/slicer/segmentation/specialized.py index 0f467b8976..fdfeb74e37 100644 --- a/nipype/interfaces/slicer/segmentation/specialized.py +++ b/nipype/interfaces/slicer/segmentation/specialized.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os @@ -85,7 +85,7 @@ class EMSegmentCommandLineInputSpec(CommandLineInputSpec): desc= "The file name that the segmentation result volume will be written to.", argstr="--resultVolumeFileName %s") - targetVolumeFileNames = InputMultiObject( + targetVolumeFileNames = InputMultiPath( File(exists=True), desc= "File names of target volumes (to be segmented). The number of target images must be equal to the number of target images specified in the parameter set, and these images must be spatially aligned.", @@ -146,7 +146,7 @@ class EMSegmentCommandLineInputSpec(CommandLineInputSpec): disableCompression = traits.Bool( desc="Don't use compression when writing result image to disk.", argstr="--disableCompression ") - atlasVolumeFileNames = InputMultiObject( + atlasVolumeFileNames = InputMultiPath( File(exists=True), desc= "Use an alternative atlas to the one that is specified by the mrml file - note the order matters ! ", diff --git a/nipype/interfaces/slicer/surface.py b/nipype/interfaces/slicer/surface.py index d5b0713c14..6a1dfe2cc0 100644 --- a/nipype/interfaces/slicer/surface.py +++ b/nipype/interfaces/slicer/surface.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os @@ -263,7 +263,7 @@ class ModelMakerInputSpec(CommandLineInputSpec): argstr="--color %s") modelSceneFile = traits.Either( traits.Bool, - InputMultiObject(File(), ), + InputMultiPath(File(), ), hash_files=False, desc= "Generated models, under a model hierarchy node. Models are imported into Slicer under a model hierarchy node, and their colors are set by the color table associated with the input label map volume. The model hierarchy node must be created before running the model maker, by selecting Create New ModelHierarchy from the Models drop down menu. If you're running from the command line, a model hierarchy node in a new mrml scene will be created for you.", @@ -276,7 +276,7 @@ class ModelMakerInputSpec(CommandLineInputSpec): desc= "Generate models for all labels in the input volume. select this option if you want to create all models that correspond to all values in a labelmap volume (using the Joint Smoothing option below is useful with this option). Ignores Labels, Start Label, End Label settings. Skips label 0.", argstr="--generateAll ") - labels = InputMultiObject( + labels = InputMultiPath( traits.Int, desc= "A comma separated list of label values from which to make models. f you specify a list of Labels, it will override any start/end label settings. If you click Generate All Models it will override the list of labels and any start/end label settings.", @@ -335,7 +335,7 @@ class ModelMakerInputSpec(CommandLineInputSpec): class ModelMakerOutputSpec(TraitedSpec): - modelSceneFile = OutputMultiObject( + modelSceneFile = OutputMultiPath( File(exists=True), desc= "Generated models, under a model hierarchy node. Models are imported into Slicer under a model hierarchy node, and their colors are set by the color table associated with the input label map volume. The model hierarchy node must be created before running the model maker, by selecting Create New ModelHierarchy from the Models drop down menu. If you're running from the command line, a model hierarchy node in a new mrml scene will be created for you." diff --git a/nipype/interfaces/slicer/utilities.py b/nipype/interfaces/slicer/utilities.py index 94125d6ec0..5faf640570 100644 --- a/nipype/interfaces/slicer/utilities.py +++ b/nipype/interfaces/slicer/utilities.py @@ -3,7 +3,7 @@ """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" -from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiObject, OutputMultiObject +from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os diff --git a/nipype/interfaces/spm/base.py b/nipype/interfaces/spm/base.py index 4f4dd716f6..cb0416392a 100644 --- a/nipype/interfaces/spm/base.py +++ b/nipype/interfaces/spm/base.py @@ -30,7 +30,7 @@ # Local imports from ... import logging from ...utils import spm_docs as sd, NUMPY_MMAP -from ..base import (BaseInterface, traits, isdefined, InputMultiObject, +from ..base import (BaseInterface, traits, isdefined, InputMultiPath, BaseInterfaceInputSpec, Directory, Undefined, ImageFile, PackageInfo) from ..matlab import MatlabCommand @@ -241,7 +241,7 @@ def no_spm(): class SPMCommandInputSpec(BaseInterfaceInputSpec): matlab_cmd = traits.Str(desc='matlab command to use') - paths = InputMultiObject(Directory(), desc='Paths to add to matlabpath') + paths = InputMultiPath(Directory(), desc='Paths to add to matlabpath') mfile = traits.Bool(True, desc='Run m-code using m-file', usedefault=True) use_mcr = traits.Bool(desc='Run m-code using SPM MCR') use_v8struct = traits.Bool( diff --git a/nipype/interfaces/spm/model.py b/nipype/interfaces/spm/model.py index a715cbce7c..f7df523587 100644 --- a/nipype/interfaces/spm/model.py +++ b/nipype/interfaces/spm/model.py @@ -28,7 +28,7 @@ from ...utils.filemanip import (filename_to_list, list_to_filename, split_filename) from ..base import (Bunch, traits, TraitedSpec, File, Directory, - OutputMultiObject, InputMultiObject, isdefined) + OutputMultiPath, InputMultiPath, isdefined) from .base import (SPMCommand, SPMCommandInputSpec, scans_for_fnames, ImageFileSPM) @@ -218,24 +218,24 @@ class EstimateModelInputSpec(SPMCommandInputSpec): class EstimateModelOutputSpec(TraitedSpec): mask_image = ImageFileSPM( exists=True, desc='binary mask to constrain estimation') - beta_images = OutputMultiObject( + beta_images = OutputMultiPath( ImageFileSPM(exists=True), desc='design parameter estimates') residual_image = ImageFileSPM( exists=True, desc='Mean-squared image of the residuals') - residual_images = OutputMultiObject( + residual_images = OutputMultiPath( ImageFileSPM(exists=True), desc="individual residual images (requires `write_residuals`") RPVimage = ImageFileSPM(exists=True, desc='Resels per voxel image') spm_mat_file = File(exists=True, desc='Updated SPM mat file') labels = ImageFileSPM(exists=True, desc="label file") - SDerror = OutputMultiObject( + SDerror = OutputMultiPath( ImageFileSPM(exists=True), desc="Images of the standard deviation of the error") - ARcoef = OutputMultiObject( + ARcoef = OutputMultiPath( ImageFileSPM(exists=True), desc="Images of the AR coefficient") - Cbetas = OutputMultiObject( + Cbetas = OutputMultiPath( ImageFileSPM(exists=True), desc="Images of the parameter posteriors") - SDbetas = OutputMultiObject( + SDbetas = OutputMultiPath( ImageFileSPM(exists=True), desc="Images of the standard deviation of parameter posteriors") @@ -344,7 +344,7 @@ class EstimateContrastInputSpec(SPMCommandInputSpec): F contrasts, the condition list should contain previously defined T-contrasts.""", mandatory=True) - beta_images = InputMultiObject( + beta_images = InputMultiPath( File(exists=True), desc=('Parameter estimates of the ' 'design matrix'), @@ -362,13 +362,13 @@ class EstimateContrastInputSpec(SPMCommandInputSpec): class EstimateContrastOutputSpec(TraitedSpec): - con_images = OutputMultiObject( + con_images = OutputMultiPath( File(exists=True), desc='contrast images from a t-contrast') - spmT_images = OutputMultiObject( + spmT_images = OutputMultiPath( File(exists=True), desc='stat images from a t-contrast') - ess_images = OutputMultiObject( + ess_images = OutputMultiPath( File(exists=True), desc='contrast images from an F-contrast') - spmF_images = OutputMultiObject( + spmF_images = OutputMultiPath( File(exists=True), desc='stat images from an F-contrast') spm_mat_file = File(exists=True, desc='Updated SPM mat file') @@ -862,8 +862,8 @@ def aggregate_outputs(self, runtime=None, needed_outputs=None): class FactorialDesignInputSpec(SPMCommandInputSpec): spm_mat_dir = Directory( exists=True, field='dir', desc='directory to store SPM.mat file (opt)') - # Need to make an alias of InputMultiObject; the inputs below are not Path - covariates = InputMultiObject( + # Need to make an alias of InputMultiPath; the inputs below are not Path + covariates = InputMultiPath( traits.Dict( key_trait=traits.Enum('vector', 'name', 'interaction', 'centering')), @@ -1092,7 +1092,7 @@ class MultipleRegressionDesignInputSpec(FactorialDesignInputSpec): field='des.mreg.incint', usedefault=True, desc='Include intercept in design') - user_covariates = InputMultiObject( + user_covariates = InputMultiPath( traits.Dict(key_trait=traits.Enum('vector', 'name', 'centering')), field='des.mreg.mcov', desc=('covariate dictionary {vector, ' diff --git a/nipype/interfaces/spm/preprocess.py b/nipype/interfaces/spm/preprocess.py index 8e3f6c7ac0..47c9fd77a4 100644 --- a/nipype/interfaces/spm/preprocess.py +++ b/nipype/interfaces/spm/preprocess.py @@ -22,8 +22,8 @@ # Local imports from ...utils.filemanip import (fname_presuffix, filename_to_list, list_to_filename, split_filename) -from ..base import (OutputMultiObject, TraitedSpec, isdefined, traits, - InputMultiObject, File) +from ..base import (OutputMultiPath, TraitedSpec, isdefined, traits, + InputMultiPath, File) from .base import (SPMCommand, scans_for_fname, func_is_3d, scans_for_fnames, SPMCommandInputSpec, ImageFileSPM) @@ -31,7 +31,7 @@ class SliceTimingInputSpec(SPMCommandInputSpec): - in_files = InputMultiObject( + in_files = InputMultiPath( traits.Either( traits.List(ImageFileSPM(exists=True)), ImageFileSPM(exists=True)), field='scans', @@ -67,7 +67,7 @@ class SliceTimingInputSpec(SPMCommandInputSpec): class SliceTimingOutputSpec(TraitedSpec): - timecorrected_files = OutputMultiObject( + timecorrected_files = OutputMultiPath( traits.Either(traits.List(File(exists=True)), File(exists=True)), desc='slice time corrected files') @@ -124,7 +124,7 @@ def _list_outputs(self): class RealignInputSpec(SPMCommandInputSpec): - in_files = InputMultiObject( + in_files = InputMultiPath( ImageFileSPM(exists=True), field='data', mandatory=True, @@ -195,7 +195,7 @@ class RealignInputSpec(SPMCommandInputSpec): class RealignOutputSpec(TraitedSpec): mean_image = File(exists=True, desc='Mean image file from the realignment') - modified_in_files = OutputMultiObject( + modified_in_files = OutputMultiPath( traits.Either(traits.List(File(exists=True)), File(exists=True)), desc=('Copies of all files passed to ' 'in_files. Headers will have ' @@ -204,14 +204,14 @@ class RealignOutputSpec(TraitedSpec): 'optionally to first do that, ' 'extract a mean image, and ' 're-align to that mean image.')) - realigned_files = OutputMultiObject( + realigned_files = OutputMultiPath( traits.Either(traits.List(File(exists=True)), File(exists=True)), desc=('If jobtype is write or estwrite, ' 'these will be the resliced files.' ' Otherwise, they will be copies ' 'of in_files that have had their ' 'headers rewritten.')) - realignment_parameters = OutputMultiObject( + realignment_parameters = OutputMultiPath( File(exists=True), desc=('Estimated translation and ' 'rotation parameters')) @@ -314,7 +314,7 @@ class CoregisterInputSpec(SPMCommandInputSpec): field='ref', desc='reference file to register to', copyfile=False) - source = InputMultiObject( + source = InputMultiPath( ImageFileSPM(exists=True), field='source', desc='file to register to target', @@ -326,7 +326,7 @@ class CoregisterInputSpec(SPMCommandInputSpec): 'write', desc='one of: estimate, write, estwrite', usedefault=True) - apply_to_files = InputMultiObject( + apply_to_files = InputMultiPath( File(exists=True), field='other', desc='files to apply transformation to', @@ -377,9 +377,9 @@ class CoregisterInputSpec(SPMCommandInputSpec): class CoregisterOutputSpec(TraitedSpec): - coregistered_source = OutputMultiObject( + coregistered_source = OutputMultiPath( File(exists=True), desc='Coregistered source files') - coregistered_files = OutputMultiObject( + coregistered_files = OutputMultiPath( File(exists=True), desc='Coregistered other files') @@ -461,7 +461,7 @@ class NormalizeInputSpec(SPMCommandInputSpec): mandatory=True, xor=['parameter_file'], copyfile=False) - source = InputMultiObject( + source = InputMultiPath( ImageFileSPM(exists=True), field='subj.source', xor=['parameter_file'], @@ -474,7 +474,7 @@ class NormalizeInputSpec(SPMCommandInputSpec): 'write', usedefault=True, desc='Estimate, Write or do both') - apply_to_files = InputMultiObject( + apply_to_files = InputMultiPath( traits.Either(File(exists=True), traits.List(File(exists=True))), field='subj.resample', desc='files to apply transformation to', @@ -549,14 +549,14 @@ class NormalizeInputSpec(SPMCommandInputSpec): class NormalizeOutputSpec(TraitedSpec): - normalization_parameters = OutputMultiObject( + normalization_parameters = OutputMultiPath( File(exists=True), desc=('MAT files containing ' 'the normalization ' 'parameters')) - normalized_source = OutputMultiObject( + normalized_source = OutputMultiPath( File(exists=True), desc='Normalized source files') - normalized_files = OutputMultiObject( + normalized_files = OutputMultiPath( File(exists=True), desc='Normalized other files') @@ -665,7 +665,7 @@ class Normalize12InputSpec(SPMCommandInputSpec): xor=['deformation_file'], mandatory=True, copyfile=True) - apply_to_files = InputMultiObject( + apply_to_files = InputMultiPath( traits.Either( ImageFileSPM(exists=True), traits.List(ImageFileSPM(exists=True))), field='subj.resample', @@ -767,17 +767,17 @@ class Normalize12InputSpec(SPMCommandInputSpec): class Normalize12OutputSpec(TraitedSpec): - deformation_field = OutputMultiObject( + deformation_field = OutputMultiPath( File(exists=True), desc=('NIfTI file containing 3 ' 'deformation fields for the ' 'deformation in x, y and z ' 'dimension')) - normalized_image = OutputMultiObject( + normalized_image = OutputMultiPath( File(exists=True), desc=('Normalized file that needed to ' 'be aligned')) - normalized_files = OutputMultiObject( + normalized_files = OutputMultiPath( File(exists=True), desc='Normalized other files') @@ -875,7 +875,7 @@ def _list_outputs(self): class SegmentInputSpec(SPMCommandInputSpec): - data = InputMultiObject( + data = InputMultiPath( ImageFileSPM(exists=True), field='data', desc='one scan per subject', @@ -1098,7 +1098,7 @@ def _list_outputs(self): class NewSegmentInputSpec(SPMCommandInputSpec): - channel_files = InputMultiObject( + channel_files = InputMultiPath( ImageFileSPM(exists=True), mandatory=True, desc="A list of files to be segmented", @@ -1164,14 +1164,14 @@ class NewSegmentOutputSpec(TraitedSpec): traits.List(File(exists=True)), desc=('modulated+normalized class ' 'images')) - transformation_mat = OutputMultiObject( + transformation_mat = OutputMultiPath( File(exists=True), desc='Normalization transformation') - bias_corrected_images = OutputMultiObject( + bias_corrected_images = OutputMultiPath( File(exists=True), desc='bias corrected images') - bias_field_images = OutputMultiObject( + bias_field_images = OutputMultiPath( File(exists=True), desc='bias field images') - forward_deformation_field = OutputMultiObject(File(exists=True)) - inverse_deformation_field = OutputMultiObject(File(exists=True)) + forward_deformation_field = OutputMultiPath(File(exists=True)) + inverse_deformation_field = OutputMultiPath(File(exists=True)) class NewSegment(SPMCommand): @@ -1314,7 +1314,7 @@ def _list_outputs(self): class SmoothInputSpec(SPMCommandInputSpec): - in_files = InputMultiObject( + in_files = InputMultiPath( ImageFileSPM(exists=True), field='data', desc='list of files to smooth', @@ -1335,7 +1335,7 @@ class SmoothInputSpec(SPMCommandInputSpec): class SmoothOutputSpec(TraitedSpec): - smoothed_files = OutputMultiObject(File(exists=True), desc='smoothed files') + smoothed_files = OutputMultiPath(File(exists=True), desc='smoothed files') class Smooth(SPMCommand): @@ -1510,12 +1510,12 @@ class DARTELNorm2MNIInputSpec(SPMCommandInputSpec): mandatory=True, desc="DARTEL template", field='mni_norm.template') - flowfield_files = InputMultiObject( + flowfield_files = InputMultiPath( ImageFileSPM(exists=True), mandatory=True, desc="DARTEL flow fields u_rc1*", field='mni_norm.data.subjs.flowfields') - apply_to_files = InputMultiObject( + apply_to_files = InputMultiPath( ImageFileSPM(exists=True), desc="Files to apply the transform to", field='mni_norm.data.subjs.images', @@ -1548,7 +1548,7 @@ class DARTELNorm2MNIInputSpec(SPMCommandInputSpec): class DARTELNorm2MNIOutputSpec(TraitedSpec): - normalized_files = OutputMultiObject( + normalized_files = OutputMultiPath( File(exists=True), desc='Normalized files in MNI space') normalization_parameter_file = File( exists=True, desc=('Transform parameters to MNI ' @@ -1618,13 +1618,13 @@ def _list_outputs(self): class CreateWarpedInputSpec(SPMCommandInputSpec): - image_files = InputMultiObject( + image_files = InputMultiPath( ImageFileSPM(exists=True), mandatory=True, desc="A list of files to be warped", field='crt_warped.images', copyfile=False) - flowfield_files = InputMultiObject( + flowfield_files = InputMultiPath( ImageFileSPM(exists=True), copyfile=False, desc="DARTEL flow fields u_rc1*", @@ -1695,7 +1695,7 @@ def _list_outputs(self): class ApplyDeformationFieldInputSpec(SPMCommandInputSpec): - in_files = InputMultiObject( + in_files = InputMultiPath( ImageFileSPM(exists=True), mandatory=True, field='fnames') deformation_field = File(exists=True, mandatory=True, field='comp{1}.def') reference_volume = ImageFileSPM( @@ -1708,7 +1708,7 @@ class ApplyDeformationFieldInputSpec(SPMCommandInputSpec): class ApplyDeformationFieldOutputSpec(TraitedSpec): - out_files = OutputMultiObject(File(exists=True)) + out_files = OutputMultiPath(File(exists=True)) class ApplyDeformations(SPMCommand): @@ -1743,7 +1743,7 @@ def _list_outputs(self): class VBMSegmentInputSpec(SPMCommandInputSpec): - in_files = InputMultiObject( + in_files = InputMultiPath( ImageFileSPM(exists=True), desc="A list of files to be segmented", field='estwrite.data', @@ -1930,22 +1930,22 @@ class VBMSegmentOuputSpec(TraitedSpec): traits.List(File(exists=True)), desc=('modulated+normalized class ' 'images')) - transformation_mat = OutputMultiObject( + transformation_mat = OutputMultiPath( File(exists=True), desc='Normalization transformation') - bias_corrected_images = OutputMultiObject( + bias_corrected_images = OutputMultiPath( File(exists=True), desc='bias corrected images') - normalized_bias_corrected_images = OutputMultiObject( + normalized_bias_corrected_images = OutputMultiPath( File(exists=True), desc='bias corrected images') - pve_label_native_images = OutputMultiObject(File(exists=True)) - pve_label_normalized_images = OutputMultiObject(File(exists=True)) - pve_label_registered_images = OutputMultiObject(File(exists=True)) + pve_label_native_images = OutputMultiPath(File(exists=True)) + pve_label_normalized_images = OutputMultiPath(File(exists=True)) + pve_label_registered_images = OutputMultiPath(File(exists=True)) - forward_deformation_field = OutputMultiObject(File(exists=True)) - inverse_deformation_field = OutputMultiObject(File(exists=True)) + forward_deformation_field = OutputMultiPath(File(exists=True)) + inverse_deformation_field = OutputMultiPath(File(exists=True)) - jacobian_determinant_images = OutputMultiObject(File(exists=True)) + jacobian_determinant_images = OutputMultiPath(File(exists=True)) class VBMSegment(SPMCommand): diff --git a/nipype/interfaces/spm/utils.py b/nipype/interfaces/spm/utils.py index 1186e85193..5dd6c05e4d 100644 --- a/nipype/interfaces/spm/utils.py +++ b/nipype/interfaces/spm/utils.py @@ -9,8 +9,8 @@ from ...utils.filemanip import (split_filename, fname_presuffix, filename_to_list, list_to_filename) -from ..base import (TraitedSpec, isdefined, File, traits, OutputMultiObject, - InputMultiObject) +from ..base import (TraitedSpec, isdefined, File, traits, OutputMultiPath, + InputMultiPath) from .base import (SPMCommandInputSpec, SPMCommand, scans_for_fnames, scans_for_fname) @@ -248,7 +248,7 @@ def _list_outputs(self): class ApplyInverseDeformationInput(SPMCommandInputSpec): - in_files = InputMultiObject( + in_files = InputMultiPath( File(exists=True), mandatory=True, field='fnames', @@ -288,7 +288,7 @@ class ApplyInverseDeformationInput(SPMCommandInputSpec): class ApplyInverseDeformationOutput(TraitedSpec): - out_files = OutputMultiObject(File(exists=True), desc='Transformed files') + out_files = OutputMultiPath(File(exists=True), desc='Transformed files') class ApplyInverseDeformation(SPMCommand): @@ -335,7 +335,7 @@ def _list_outputs(self): class ResliceToReferenceInput(SPMCommandInputSpec): - in_files = InputMultiObject( + in_files = InputMultiPath( File(exists=True), mandatory=True, field='fnames', @@ -365,7 +365,7 @@ class ResliceToReferenceInput(SPMCommandInputSpec): class ResliceToReferenceOutput(TraitedSpec): - out_files = OutputMultiObject(File(exists=True), desc='Transformed files') + out_files = OutputMultiPath(File(exists=True), desc='Transformed files') class ResliceToReference(SPMCommand): @@ -411,7 +411,7 @@ def _list_outputs(self): class DicomImportInputSpec(SPMCommandInputSpec): - in_files = InputMultiObject( + in_files = InputMultiPath( File(exists=True), mandatory=True, field='data', @@ -449,7 +449,7 @@ class DicomImportInputSpec(SPMCommandInputSpec): class DicomImportOutputSpec(TraitedSpec): - out_files = OutputMultiObject(File(exists=True), desc='converted files') + out_files = OutputMultiPath(File(exists=True), desc='converted files') class DicomImport(SPMCommand): diff --git a/nipype/interfaces/utility/base.py b/nipype/interfaces/utility/base.py index 8f716f49be..87eb51e61b 100644 --- a/nipype/interfaces/utility/base.py +++ b/nipype/interfaces/utility/base.py @@ -19,7 +19,7 @@ import nibabel as nb from ..base import (traits, TraitedSpec, DynamicTraitedSpec, File, Undefined, - isdefined, OutputMultiObject, InputMultiObject, BaseInterface, + isdefined, OutputMultiPath, InputMultiPath, BaseInterface, BaseInterfaceInputSpec, Str) from ..io import IOBase, add_traits from ...utils.filemanip import filename_to_list, copyfile, split_filename @@ -372,14 +372,14 @@ def _list_outputs(self): class SelectInputSpec(BaseInterfaceInputSpec): - inlist = InputMultiObject( + inlist = InputMultiPath( traits.Any, mandatory=True, desc='list of values to choose from') - index = InputMultiObject( + index = InputMultiPath( traits.Int, mandatory=True, desc='0-based indices of values to choose') class SelectOutputSpec(TraitedSpec): - out = OutputMultiObject(traits.Any, desc='list of selected values') + out = OutputMultiPath(traits.Any, desc='list of selected values') class Select(IOBase): diff --git a/nipype/pipeline/engine/nodes.py b/nipype/pipeline/engine/nodes.py index 677b410997..054f9a622c 100644 --- a/nipype/pipeline/engine/nodes.py +++ b/nipype/pipeline/engine/nodes.py @@ -36,7 +36,7 @@ loadpkl, split_filename, load_json, makedirs, emptydirs, savepkl, to_str) -from ...interfaces.base import (traits, InputMultiObject, CommandLine, Undefined, +from ...interfaces.base import (traits, InputMultiPath, CommandLine, Undefined, DynamicTraitedSpec, Bunch, InterfaceResult, Interface, isdefined) from .utils import ( @@ -980,9 +980,9 @@ def _create_dynamic_traits(self, basetraits, fields=None, nitems=None): if name in fields and ((nitems is None) or (nitems > 1)): logger.debug('adding multipath trait: %s', name) if self.nested: - output.add_trait(name, InputMultiObject(traits.Any())) + output.add_trait(name, InputMultiPath(traits.Any())) else: - output.add_trait(name, InputMultiObject(spec.trait_type)) + output.add_trait(name, InputMultiPath(spec.trait_type)) else: output.add_trait(name, traits.Trait(spec)) setattr(output, name, Undefined) @@ -1018,7 +1018,7 @@ def _get_hashval(self): hashinputs.remove_trait(name) hashinputs.add_trait( name, - InputMultiObject( + InputMultiPath( self._interface.inputs.traits()[name].trait_type)) logger.debug('setting hashinput %s-> %s', name, getattr(self._inputs, name)) diff --git a/nipype/scripts/utils.py b/nipype/scripts/utils.py index 08f2c077a0..f4b8a86fb1 100644 --- a/nipype/scripts/utils.py +++ b/nipype/scripts/utils.py @@ -12,7 +12,7 @@ import json from .instance import import_module -from ..interfaces.base import InputMultiObject, traits +from ..interfaces.base import InputMultiPath, traits # different context options CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help']) @@ -92,7 +92,7 @@ def add_args_options(arg_parser, interface): has_multiple_inner_traits = True if getattr(spec, "mandatory", False): - if spec.is_trait_type(InputMultiObject): + if spec.is_trait_type(InputMultiPath): args["nargs"] = "+" elif spec.is_trait_type(traits.List): if (spec.trait_type.minlen == spec.trait_type.maxlen) and \ @@ -111,7 +111,7 @@ def add_args_options(arg_parser, interface): ' argument: {}.'.format(name))) arg_parser.add_argument(name, help=desc, **args) else: - if spec.is_trait_type(InputMultiObject): + if spec.is_trait_type(InputMultiPath): args["nargs"] = "*" elif spec.is_trait_type(traits.List): if (spec.trait_type.minlen == spec.trait_type.maxlen) and \ diff --git a/nipype/utils/nipype_cmd.py b/nipype/utils/nipype_cmd.py index c8669a5b5f..b31795aa92 100644 --- a/nipype/utils/nipype_cmd.py +++ b/nipype/utils/nipype_cmd.py @@ -7,7 +7,7 @@ import inspect import sys -from ..interfaces.base import Interface, InputMultiObject, traits +from ..interfaces.base import Interface, InputMultiPath, traits from .misc import str2bool @@ -38,11 +38,11 @@ def add_options(parser=None, module=None, function=None): args["action"] = 'store_true' if hasattr(spec, "mandatory") and spec.mandatory: - if spec.is_trait_type(InputMultiObject): + if spec.is_trait_type(InputMultiPath): args["nargs"] = "+" parser.add_argument(name, help=desc, **args) else: - if spec.is_trait_type(InputMultiObject): + if spec.is_trait_type(InputMultiPath): args["nargs"] = "*" parser.add_argument( "--%s" % name, dest=name, help=desc, **args) From 11212a44f921497198a8c77c618485cbe8c25270 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Mon, 22 Jan 2018 14:47:03 -0500 Subject: [PATCH 10/11] removing extra line from misc.py --- nipype/utils/misc.py | 1 - 1 file changed, 1 deletion(-) diff --git a/nipype/utils/misc.py b/nipype/utils/misc.py index a7487539d6..6b7629e32a 100644 --- a/nipype/utils/misc.py +++ b/nipype/utils/misc.py @@ -285,7 +285,6 @@ def dict_diff(dold, dnew, indent=0): # Values in common keys would differ quite often, # so we need to join the messages together for k in new_keys.intersection(old_keys): - same = False try: new, old = dnew[k], dold[k] same = new == old From c1ab0013b70a507417e1300801ec1f43f05903f3 Mon Sep 17 00:00:00 2001 From: Dorota Jarecka Date: Mon, 22 Jan 2018 14:56:21 -0500 Subject: [PATCH 11/11] a small changes of comments about synchronize --- nipype/pipeline/engine/utils.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/nipype/pipeline/engine/utils.py b/nipype/pipeline/engine/utils.py index d34e2523fe..9082722b6c 100644 --- a/nipype/pipeline/engine/utils.py +++ b/nipype/pipeline/engine/utils.py @@ -1158,9 +1158,6 @@ def _standardize_iterables(node): iterables = node.iterables # The candidate iterable fields fields = set(node.inputs.copyable_trait_names()) - # Flag indicating whether the iterables are in the alternate - # synchronize form and are not converted to a standard format. - # synchronize = False # OE: commented out since it is not used # A synchronize iterables node without an itersource can be in # [fields, value tuples] format rather than # [(field, value list), (field, value list), ...]