From 14f819220f65bd7549c8322769acba74584cc890 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Wed, 20 Apr 2016 18:15:23 -0400 Subject: [PATCH 1/5] fix: deprecated interfaces and tests --- nipype/interfaces/fsl/dti.py | 257 +----------------- .../fsl/tests/test_auto_BEDPOSTX4.py | 104 ------- .../fsl/tests/test_auto_XFibres4.py | 89 ------ nipype/interfaces/fsl/tests/test_dti.py | 29 -- nipype/testing/tests/test_utils.py | 2 +- 5 files changed, 3 insertions(+), 478 deletions(-) delete mode 100644 nipype/interfaces/fsl/tests/test_auto_BEDPOSTX4.py delete mode 100644 nipype/interfaces/fsl/tests/test_auto_XFibres4.py diff --git a/nipype/interfaces/fsl/dti.py b/nipype/interfaces/fsl/dti.py index 84e44e4f7a..35ff067414 100644 --- a/nipype/interfaces/fsl/dti.py +++ b/nipype/interfaces/fsl/dti.py @@ -406,261 +406,8 @@ class XFibres5(FSLXCommand): input_spec = XFibres5InputSpec output_spec = FSLXCommandOutputSpec - -class XFibres4InputSpec(FSLCommandInputSpec): - dwi = File(exists=True, argstr="--data=%s", mandatory=True) - mask = File(exists=True, argstr="--mask=%s", mandatory=True) - gradnonlin = File(exists=True, argstr="--gradnonlin=%s") - bvecs = File(exists=True, argstr="--bvecs=%s", mandatory=True) - bvals = File(exists=True, argstr="--bvals=%s", mandatory=True) - logdir = Directory("logdir", argstr="--logdir=%s", usedefault=True) - n_fibres = traits.Range(low=1, argstr="--nfibres=%d", - desc="Maximum nukmber of fibres to fit in each voxel") - fudge = traits.Int(argstr="--fudge=%d", - desc="ARD fudge factor") - n_jumps = traits.Range(low=1, argstr="--njumps=%d", - desc="Num of jumps to be made by MCMC") - burn_in = traits.Range(low=0, argstr="--burnin=%d", - desc="Total num of jumps at start of MCMC to be discarded") - burn_in_no_ard = traits.Range(low=0, argstr="--burninnoard=%d", - desc="num of burnin jumps before the ard is imposed") - sample_every = traits.Range(low=0, argstr="--sampleevery=%d", - desc="Num of jumps for each sample (MCMC)") - update_proposal_every = traits.Range(low=1, argstr="--updateproposalevery=%d", - desc="Num of jumps for each update to the proposal density std (MCMC)") - seed = traits.Int(argstr="--seed=%d", desc="seed for pseudo random number generator") - model = traits.Int(argstr="--model=%d", desc="Which model to use. \ -1=mono-exponential (default and required for single shell). 2=continous \ -exponential (for multi-shell experiments)") - - _xor_inputs1 = ('no_ard', 'all_ard') - no_ard = traits.Bool(argstr="--noard", desc="Turn ARD off on all fibres", xor=_xor_inputs1) - all_ard = traits.Bool(argstr="--allard", desc="Turn ARD on on all fibres", xor=_xor_inputs1) - - _xor_inputs2 = ('no_spat', 'non_linear') - no_spat = traits.Bool(argstr="--nospat", desc="Initialise with tensor, not spatially", xor=_xor_inputs2) - non_linear = traits.Bool(argstr="--nonlinear", desc="Initialise with nonlinear fitting", xor=_xor_inputs2) - force_dir = traits.Bool(True, - desc='use the actual directory name given - i.e. ' + - 'do not add + to make a new directory', - argstr='--forcedir', usedefault=True) - - -class XFibres4OutputSpec(TraitedSpec): - dyads = OutputMultiPath(File(exists=True), desc="Mean of PDD distribution in vector form.") - fsamples = OutputMultiPath(File(exists=True), desc="Samples from the distribution on anisotropic volume fraction") - mean_dsamples = File(exists=True, desc="Mean of distribution on diffusivity d") - mean_fsamples = OutputMultiPath(File(exists=True), desc="Mean of distribution on f anisotropy") - mean_S0samples = File(exists=True, desc="Samples from S0 distribution") - phsamples = OutputMultiPath(File(exists=True), desc="Samples from the distribution on phi") - thsamples = OutputMultiPath(File(exists=True), desc="Samples from the distribution on theta") - - -class XFibres4(FSLCommand): - """ - Perform model parameters estimation for local (voxelwise) diffusion - parameters - - .. deprecated:: 0.9.2 - Use :class:`.XFibres5` instead. - - - """ - _cmd = "xfibres" - input_spec = XFibres4InputSpec - output_spec = XFibres4OutputSpec - - def __init__(self, **inputs): - warnings.warn(('Deprecated: Please use XFIBERS5 instead. This ' - 'interface will be removed in version 0.11.'), - DeprecationWarning) - super(XFibres4, self).__init__(**inputs) - - def _list_outputs(self): - outputs = self.output_spec().get() - outputs["mean_dsamples"] = self._gen_fname("mean_dsamples", - cwd=self.inputs.logdir) - outputs["mean_S0samples"] = self._gen_fname("mean_S0samples", - cwd=self.inputs.logdir) - outputs["dyads"] = [] - outputs["fsamples"] = [] - outputs["mean_fsamples"] = [] - outputs["phsamples"] = [] - outputs["thsamples"] = [] - for i in range(1, self.inputs.n_fibres + 1): - outputs["dyads"].append(self._gen_fname("dyads%d" % i, - cwd=self.inputs.logdir)) - outputs["fsamples"].append(self._gen_fname("f%dsamples" % i, - cwd=self.inputs.logdir)) - outputs["mean_fsamples"].append(self._gen_fname("mean_f%dsamples" % i, - cwd=self.inputs.logdir)) - outputs["phsamples"].append(self._gen_fname("ph%dsamples" % i, - cwd=self.inputs.logdir)) - outputs["thsamples"].append(self._gen_fname("th%dsamples" % i, - cwd=self.inputs.logdir)) - - return outputs - - -class BEDPOSTX4InputSpec(XFibres4InputSpec): - dwi = File(exists=True, desc='diffusion weighted image data file', - mandatory=True) - mask = File(exists=True, desc='bet binary mask file', mandatory=True) - bvecs = File(exists=True, desc='b vectors file', mandatory=True) - bvals = File(exists=True, desc='b values file', mandatory=True) - bpx_directory = Directory('bedpostx', argstr='%s', usedefault=True, - desc=('the name for this subject\'s bedpostx' - ' folder')) - fibres = traits.Int(2, argstr='-n %d', desc='number of fibres per voxel') - weight = traits.Float(1.00, argstr='-w %.2f', - desc=('ARD weight, more weight means less' - ' secondary fibres per voxel')) - burn_period = traits.Int(1000, argstr='-b %d', desc='burnin period') - jumps = traits.Int(1250, argstr='-j %d', desc='number of jumps') - sampling = traits.Int(25, argstr='-s %d', desc='sample every') - model = traits.Enum(1, 2, argstr='-model %d', - desc=('model choice: monoexponential (1) or ' - 'multiexponential (2). ')) - nlgradient = traits.Bool(False, argstr='-g', desc=('consider gradient' - 'nonlinearities, default off')) - no_cuda = traits.Bool(False, argstr='-c', - desc=('do not use CUDA capable hardware/queue ' - '(if found)')) - - -class BEDPOSTX4OutputSpec(TraitedSpec): - bpx_out_directory = Directory(exists=True, - desc='path/name of directory with all ' + - 'bedpostx output files for this subject') - xfms_directory = Directory(exists=True, - desc='path/name of directory with the ' + - 'tranformation matrices') - merged_thsamples = traits.List(File(exists=True), - desc='a list of path/name of 4D volume ' + - 'with samples from the distribution ' + - 'on theta') - merged_phsamples = traits.List(File(exists=True), - desc='a list of path/name of file with ' - 'samples from the distribution on phi') - merged_fsamples = traits.List(File(exists=True), - desc='a list of path/name of 4D volume ' + - 'with samples from the distribution ' + - 'on anisotropic volume fraction') - mean_thsamples = traits.List(File(exists=True), - desc='a list of path/name of 3D volume with mean of distribution on theta') - mean_phsamples = traits.List(File(exists=True), - desc='a list of path/name of 3D volume with mean of distribution on phi') - mean_fsamples = traits.List(File(exists=True), - desc='a list of path/name of 3D volume with mean of distribution on f anisotropy') - dyads = traits.List(File(exists=True), desc='a list of path/name of mean of PDD distribution in vector form') - - -class BEDPOSTX4(FSLCommand): - """ - bedpostx has an old interface, implemented here - - - Example - ------- - - >>> from nipype.interfaces import fsl - >>> bedp = fsl.BEDPOSTX4(bpx_directory='subjdir', bvecs='bvecs', \ -bvals='bvals', dwi='diffusion.nii', mask='mask.nii', fibres=1) - >>> bedp.cmdline - 'bedpostx subjdir -n 1 --forcedir --logdir=logdir' - - """ - - _cmd = 'bedpostx' - input_spec = BEDPOSTX4InputSpec - output_spec = BEDPOSTX4OutputSpec - _can_resume = True - - def __init__(self, **inputs): - warnings.warn(('Deprecated: Please use BEDPOSTX5 or ' - 'create_bedpostx_pipeline instead. This interface will ' - 'be removed in version 0.11.'), DeprecationWarning) - super(BEDPOSTX4, self).__init__(**inputs) - - def _get_bedpostx_dir(self): - return os.path.join(os.getcwd(), self.inputs.bpx_directory) - - def _run_interface(self, runtime, correct_return_codes=[0]): - - # create the subject specific bpx_directory - bpx_directory = self._get_bedpostx_dir() - if not os.path.exists(bpx_directory): - os.makedirs(bpx_directory) - - _, _, ext = split_filename(self.inputs.mask) - shutil.copyfile(self.inputs.mask, - os.path.join(self.inputs.bpx_directory, - 'nodif_brain_mask' + ext)) - _, _, ext = split_filename(self.inputs.dwi) - shutil.copyfile(self.inputs.dwi, - os.path.join(self.inputs.bpx_directory, 'data' + ext)) - shutil.copyfile(self.inputs.bvals, - os.path.join(self.inputs.bpx_directory, 'bvals')) - shutil.copyfile(self.inputs.bvecs, - os.path.join(self.inputs.bpx_directory, 'bvecs')) - - runtime = super(BEDPOSTX4, self)._run_interface(runtime, - correct_return_codes) - if runtime.stderr: - self.raise_exception(runtime) - return runtime - - def _list_outputs(self): - outputs = self.output_spec().get() - bpx_directory = self._get_bedpostx_dir() - outputs['bpx_out_directory'] = os.path.join(bpx_directory + '.bedpostX') - outputs['xfms_directory'] = os.path.join(bpx_directory + '.bedpostX', - 'xfms') - - for k in list(outputs.keys()): - if k not in ('outputtype', 'environ', 'args', 'bpx_out_directory', - 'xfms_directory'): - outputs[k] = [] - - for n in range(self.inputs.fibres): - outputs['merged_thsamples'].append(self._gen_fname( - 'merged_th' + repr(n + 1) + 'samples', - suffix='', cwd=outputs['bpx_out_directory'])) - outputs['merged_phsamples'].append(self._gen_fname( - 'merged_ph' + repr(n + 1) + 'samples', - suffix='', cwd=outputs['bpx_out_directory'])) - outputs['merged_fsamples'].append(self._gen_fname( - 'merged_f' + repr(n + 1) + 'samples', - suffix='', cwd=outputs['bpx_out_directory'])) - outputs['mean_thsamples'].append(self._gen_fname( - 'mean_th' + repr(n + 1) + 'samples', - suffix='', cwd=outputs['bpx_out_directory'])) - outputs['mean_phsamples'].append(self._gen_fname( - 'mean_ph' + repr(n + 1) + 'samples', - suffix='', cwd=outputs['bpx_out_directory'])) - outputs['mean_fsamples'].append(self._gen_fname( - 'mean_f' + repr(n + 1) + 'samples', - suffix='', cwd=outputs['bpx_out_directory'])) - outputs['dyads'].append(self._gen_fname( - 'dyads' + repr(n + 1), - suffix='', cwd=outputs['bpx_out_directory'])) - return outputs - - -if (Info.version() and LooseVersion(Info.version()) >= LooseVersion('5.0.0')): - CurrentXFibres = XFibres5 - CurrentBEDPOST = BEDPOSTX5 -else: - CurrentXFibres = XFibres4 - CurrentBEDPOST = BEDPOSTX4 - - -class XFibres(CurrentXFibres): - pass - - -class BEDPOSTX(CurrentBEDPOST): - pass +XFibres = XFibres5 +BEDPOSTX = BEDPOSTX5 class ProbTrackXBaseInputSpec(FSLCommandInputSpec): diff --git a/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX4.py b/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX4.py deleted file mode 100644 index ca71395c20..0000000000 --- a/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX4.py +++ /dev/null @@ -1,104 +0,0 @@ -# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT -from ....testing import assert_equal -from ..dti import BEDPOSTX4 - - -def test_BEDPOSTX4_inputs(): - input_map = dict(all_ard=dict(argstr='--allard', - xor=('no_ard', 'all_ard'), - ), - args=dict(argstr='%s', - ), - bpx_directory=dict(argstr='%s', - usedefault=True, - ), - burn_in=dict(argstr='--burnin=%d', - ), - burn_in_no_ard=dict(argstr='--burninnoard=%d', - ), - burn_period=dict(argstr='-b %d', - ), - bvals=dict(mandatory=True, - ), - bvecs=dict(mandatory=True, - ), - dwi=dict(mandatory=True, - ), - environ=dict(nohash=True, - usedefault=True, - ), - fibres=dict(argstr='-n %d', - ), - force_dir=dict(argstr='--forcedir', - usedefault=True, - ), - fudge=dict(argstr='--fudge=%d', - ), - gradnonlin=dict(argstr='--gradnonlin=%s', - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), - jumps=dict(argstr='-j %d', - ), - logdir=dict(argstr='--logdir=%s', - usedefault=True, - ), - mask=dict(mandatory=True, - ), - model=dict(argstr='-model %d', - ), - n_fibres=dict(argstr='--nfibres=%d', - ), - n_jumps=dict(argstr='--njumps=%d', - ), - nlgradient=dict(argstr='-g', - ), - no_ard=dict(argstr='--noard', - xor=('no_ard', 'all_ard'), - ), - no_cuda=dict(argstr='-c', - ), - no_spat=dict(argstr='--nospat', - xor=('no_spat', 'non_linear'), - ), - non_linear=dict(argstr='--nonlinear', - xor=('no_spat', 'non_linear'), - ), - output_type=dict(), - sample_every=dict(argstr='--sampleevery=%d', - ), - sampling=dict(argstr='-s %d', - ), - seed=dict(argstr='--seed=%d', - ), - terminal_output=dict(nohash=True, - ), - update_proposal_every=dict(argstr='--updateproposalevery=%d', - ), - weight=dict(argstr='-w %.2f', - ), - ) - inputs = BEDPOSTX4.input_spec() - - for key, metadata in list(input_map.items()): - for metakey, value in list(metadata.items()): - yield assert_equal, getattr(inputs.traits()[key], metakey), value - - -def test_BEDPOSTX4_outputs(): - output_map = dict(bpx_out_directory=dict(), - dyads=dict(), - mean_fsamples=dict(), - mean_phsamples=dict(), - mean_thsamples=dict(), - merged_fsamples=dict(), - merged_phsamples=dict(), - merged_thsamples=dict(), - xfms_directory=dict(), - ) - outputs = BEDPOSTX4.output_spec() - - for key, metadata in list(output_map.items()): - for metakey, value in list(metadata.items()): - yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/fsl/tests/test_auto_XFibres4.py b/nipype/interfaces/fsl/tests/test_auto_XFibres4.py deleted file mode 100644 index 5fa46bb954..0000000000 --- a/nipype/interfaces/fsl/tests/test_auto_XFibres4.py +++ /dev/null @@ -1,89 +0,0 @@ -# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT -from ....testing import assert_equal -from ..dti import XFibres4 - - -def test_XFibres4_inputs(): - input_map = dict(all_ard=dict(argstr='--allard', - xor=('no_ard', 'all_ard'), - ), - args=dict(argstr='%s', - ), - burn_in=dict(argstr='--burnin=%d', - ), - burn_in_no_ard=dict(argstr='--burninnoard=%d', - ), - bvals=dict(argstr='--bvals=%s', - mandatory=True, - ), - bvecs=dict(argstr='--bvecs=%s', - mandatory=True, - ), - dwi=dict(argstr='--data=%s', - mandatory=True, - ), - environ=dict(nohash=True, - usedefault=True, - ), - force_dir=dict(argstr='--forcedir', - usedefault=True, - ), - fudge=dict(argstr='--fudge=%d', - ), - gradnonlin=dict(argstr='--gradnonlin=%s', - ), - ignore_exception=dict(nohash=True, - usedefault=True, - ), - logdir=dict(argstr='--logdir=%s', - usedefault=True, - ), - mask=dict(argstr='--mask=%s', - mandatory=True, - ), - model=dict(argstr='--model=%d', - ), - n_fibres=dict(argstr='--nfibres=%d', - ), - n_jumps=dict(argstr='--njumps=%d', - ), - no_ard=dict(argstr='--noard', - xor=('no_ard', 'all_ard'), - ), - no_spat=dict(argstr='--nospat', - xor=('no_spat', 'non_linear'), - ), - non_linear=dict(argstr='--nonlinear', - xor=('no_spat', 'non_linear'), - ), - output_type=dict(), - sample_every=dict(argstr='--sampleevery=%d', - ), - seed=dict(argstr='--seed=%d', - ), - terminal_output=dict(nohash=True, - ), - update_proposal_every=dict(argstr='--updateproposalevery=%d', - ), - ) - inputs = XFibres4.input_spec() - - for key, metadata in list(input_map.items()): - for metakey, value in list(metadata.items()): - yield assert_equal, getattr(inputs.traits()[key], metakey), value - - -def test_XFibres4_outputs(): - output_map = dict(dyads=dict(), - fsamples=dict(), - mean_S0samples=dict(), - mean_dsamples=dict(), - mean_fsamples=dict(), - phsamples=dict(), - thsamples=dict(), - ) - outputs = XFibres4.output_spec() - - for key, metadata in list(output_map.items()): - for metakey, value in list(metadata.items()): - yield assert_equal, getattr(outputs.traits()[key], metakey), value diff --git a/nipype/interfaces/fsl/tests/test_dti.py b/nipype/interfaces/fsl/tests/test_dti.py index 43a3e4becf..414d79421b 100644 --- a/nipype/interfaces/fsl/tests/test_dti.py +++ b/nipype/interfaces/fsl/tests/test_dti.py @@ -47,35 +47,6 @@ def clean_directory(outdir, old_wd): os.chdir(old_wd) -# test bedpostx -@skipif(no_fsl) -def test_oldbedpostx2(): - filelist, outdir, cwd = create_files_in_directory() - bpx = fsl.BEDPOSTX() - - # make sure command gets called - yield assert_equal, bpx.cmd, 'bedpostx' - - # test raising error with mandatory args absent - yield assert_raises, ValueError, bpx.run - - # .inputs based parameters setting - bpx2 = fsl.BEDPOSTX4() - bpx2.inputs.mask = example_data('mask.nii') - bpx2.inputs.dwi = example_data('diffusion.nii') - bpx2.inputs.bvals = example_data('bvals') - bpx2.inputs.bvecs = example_data('bvecs') - bpx2.inputs.fibres = 2 - bpx2.inputs.weight = 0.3 - bpx2.inputs.burn_period = 200 - bpx2.inputs.jumps = 500 - bpx2.inputs.sampling = 20 - actualCmdline = sorted(bpx2.cmdline.split()) - cmd = 'bedpostx bedpostx -b 200 -n 2 -j 500 -s 20 -w 0.30 --forcedir --logdir=logdir' - desiredCmdline = sorted(cmd.split()) - yield assert_equal, actualCmdline, desiredCmdline - - # test dtifit @skipif(no_fsl) def test_dtifit2(): diff --git a/nipype/testing/tests/test_utils.py b/nipype/testing/tests/test_utils.py index 64be810008..d7bd7d6861 100644 --- a/nipype/testing/tests/test_utils.py +++ b/nipype/testing/tests/test_utils.py @@ -12,7 +12,7 @@ def test_tempfatfs(): try: fatfs = TempFATFS() - except IOError: + except (IOError, OSError): warnings.warn("Cannot mount FAT filesystems with FUSE") else: with fatfs as tmpdir: From 5ec6afa6e65e8f8dacbd50083b526f4fcdf3ca16 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Wed, 20 Apr 2016 19:16:32 -0400 Subject: [PATCH 2/5] fix: trait metadata using make specs --- nipype/interfaces/afni/preprocess.py | 2 +- .../interfaces/afni/tests/test_auto_FWHMx.py | 2 +- nipype/interfaces/dipy/reconstruction.py | 4 +- nipype/interfaces/dipy/tests/test_auto_CSD.py | 6 +- nipype/interfaces/freesurfer/model.py | 15 +-- nipype/interfaces/freesurfer/preprocess.py | 52 ++++---- nipype/interfaces/freesurfer/registration.py | 15 +-- .../freesurfer/tests/test_auto_Aparc2Aseg.py | 9 +- .../freesurfer/tests/test_auto_Apas2Aseg.py | 1 - .../freesurfer/tests/test_auto_CALabel.py | 6 - .../freesurfer/tests/test_auto_CANormalize.py | 2 - .../freesurfer/tests/test_auto_CARegister.py | 7 - .../freesurfer/tests/test_auto_Contrast.py | 3 +- .../freesurfer/tests/test_auto_Curvature.py | 4 - .../tests/test_auto_CurvatureStats.py | 7 +- .../freesurfer/tests/test_auto_EMRegister.py | 3 - .../tests/test_auto_EditWMwithAseg.py | 3 +- .../freesurfer/tests/test_auto_FixTopology.py | 4 - .../freesurfer/tests/test_auto_Label2Annot.py | 3 - .../freesurfer/tests/test_auto_Label2Label.py | 4 +- .../freesurfer/tests/test_auto_MRIFill.py | 2 - .../freesurfer/tests/test_auto_MRIsCALabel.py | 3 - .../freesurfer/tests/test_auto_MRIsCalc.py | 3 - .../freesurfer/tests/test_auto_MRIsInflate.py | 4 +- .../tests/test_auto_MakeSurfaces.py | 15 +-- .../freesurfer/tests/test_auto_Normalize.py | 5 +- .../freesurfer/tests/test_auto_Paint.py | 4 +- .../tests/test_auto_ParcellationStats.py | 11 +- .../tests/test_auto_RegisterAVItoTalairach.py | 3 +- .../tests/test_auto_RelabelHypointensities.py | 2 - .../freesurfer/tests/test_auto_RemoveNeck.py | 4 +- .../freesurfer/tests/test_auto_SegStats.py | 2 - .../tests/test_auto_SegStatsReconAll.py | 2 - .../freesurfer/tests/test_auto_SegmentCC.py | 3 +- .../tests/test_auto_SmoothTessellation.py | 1 - .../freesurfer/tests/test_auto_Sphere.py | 6 +- .../freesurfer/tests/test_auto_VolumeMask.py | 5 +- nipype/interfaces/freesurfer/utils.py | 126 +++++++++--------- nipype/interfaces/io.py | 3 +- nipype/interfaces/minc/minc.py | 33 ++--- .../minc/tests/test_auto_Average.py | 1 - .../minc/tests/test_auto_BigAverage.py | 1 - .../interfaces/minc/tests/test_auto_Calc.py | 1 - .../interfaces/minc/tests/test_auto_Math.py | 1 - .../interfaces/minc/tests/test_auto_Norm.py | 4 - .../interfaces/minc/tests/test_auto_ToEcat.py | 1 - .../interfaces/minc/tests/test_auto_XfmAvg.py | 1 - .../minc/tests/test_auto_XfmConcat.py | 4 +- nipype/interfaces/tests/test_auto_DataSink.py | 4 +- 49 files changed, 139 insertions(+), 268 deletions(-) diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index df1f590f5d..599b180401 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -2178,7 +2178,7 @@ class FWHMxInputSpec(CommandLineInputSpec): 'is not given, the program picks q=NT/30. -detrend disables -demed, and includes ' '-unif.') demed = traits.Bool( - False, argstr='-demed', xorg=['detrend'], + False, argstr='-demed', xor=['detrend'], desc='If the input dataset has more than one sub-brick (e.g., has a time axis), then ' 'subtract the median of each voxel\'s time series before processing FWHM. This will ' 'tend to remove intrinsic spatial structure and leave behind the noise.') diff --git a/nipype/interfaces/afni/tests/test_auto_FWHMx.py b/nipype/interfaces/afni/tests/test_auto_FWHMx.py index f35aa66b62..f77c859c76 100644 --- a/nipype/interfaces/afni/tests/test_auto_FWHMx.py +++ b/nipype/interfaces/afni/tests/test_auto_FWHMx.py @@ -20,7 +20,7 @@ def test_FWHMx_inputs(): compat=dict(argstr='-compat', ), demed=dict(argstr='-demed', - xorg=['detrend'], + xor=['detrend'], ), detrend=dict(argstr='-detrend', usedefault=True, diff --git a/nipype/interfaces/dipy/reconstruction.py b/nipype/interfaces/dipy/reconstruction.py index 6a01eacbf0..a0030674fa 100644 --- a/nipype/interfaces/dipy/reconstruction.py +++ b/nipype/interfaces/dipy/reconstruction.py @@ -276,9 +276,9 @@ def _list_outputs(self): class CSDInputSpec(DipyBaseInterfaceInputSpec): in_mask = File(exists=True, desc=('input mask in which compute tensors')) response = File(exists=True, desc=('single fiber estimated response')) - sh_order = traits.Int(8, exists=True, usedefault=True, + sh_order = traits.Int(8, usedefault=True, desc=('maximal shperical harmonics order')) - save_fods = traits.Bool(True, exists=True, usedefault=True, + save_fods = traits.Bool(True, usedefault=True, desc=('save fODFs in file')) out_fods = File(desc=('fODFs output file name')) diff --git a/nipype/interfaces/dipy/tests/test_auto_CSD.py b/nipype/interfaces/dipy/tests/test_auto_CSD.py index d99aac4527..9cec40e056 100644 --- a/nipype/interfaces/dipy/tests/test_auto_CSD.py +++ b/nipype/interfaces/dipy/tests/test_auto_CSD.py @@ -19,11 +19,9 @@ def test_CSD_inputs(): out_fods=dict(), out_prefix=dict(), response=dict(), - save_fods=dict(exists=True, - usedefault=True, + save_fods=dict(usedefault=True, ), - sh_order=dict(exists=True, - usedefault=True, + sh_order=dict(usedefault=True, ), ) inputs = CSD.input_spec() diff --git a/nipype/interfaces/freesurfer/model.py b/nipype/interfaces/freesurfer/model.py index 5196292835..9b825b9c55 100644 --- a/nipype/interfaces/freesurfer/model.py +++ b/nipype/interfaces/freesurfer/model.py @@ -654,7 +654,7 @@ class SegStatsInputSpec(FSTraitedSpec): wm_vol_from_surf = traits.Bool(argstr='--surf-wm-vol', desc='Compute wm volume from surf') cortex_vol_from_surf = traits.Bool(argstr='--surf-ctx-vol', desc='Compute cortex volume from surf') non_empty_only = traits.Bool(argstr='--nonempty', desc='Only report nonempty segmentations') - empty = traits.Bool(argstr="--empty", mandatory=False, + empty = traits.Bool(argstr="--empty", desc="Report on segmentations listed in the color table") mask_file = File(exists=True, argstr='--mask %s', desc='Mask volume (same size as seg') @@ -690,7 +690,7 @@ class SegStatsInputSpec(FSTraitedSpec): desc="Compute volume of total gray matter") euler = traits.Bool(argstr="--euler", desc="Write out number of defect holes in orig.nofix based on the euler number") - in_intensity = File(argstr="--in %s --in-intensity-name %s", mandatory=False, + in_intensity = File(argstr="--in %s --in-intensity-name %s", desc="Undocumented input norm.mgz file") intensity_units = traits.Enum('MR', argstr="--in-intensity-units %s", requires=["in_intensity"], desc="Intensity units") @@ -1083,14 +1083,13 @@ class Label2LabelInputSpec(FSTraitedSpec): source_subject = traits.String(argstr="--srcsubject %s", mandatory=True, desc="Source subject name") # optional - out_file = File(argstr="--trglabel %s", mandatory=False, + out_file = File(argstr="--trglabel %s", name_source=['source_label'], name_template='%s_converted', hash_files=False, keep_extension=True, desc="Target label") registration_method = traits.Enum('surface', 'volume', usedefault=True, argstr="--regmethod %s", desc="Registration method") - copy_inputs = traits.Bool(mandatory=False, - desc="If running as a node, set this to True." + + copy_inputs = traits.Bool(desc="If running as a node, set this to True." + "This will copy the input files to the node " + "directory.") @@ -1180,11 +1179,11 @@ class Label2AnnotInputSpec(FSTraitedSpec): orig = File(exists=True, mandatory=True, desc="implicit {hemisphere}.orig") # optional - keep_max = traits.Bool(argstr="--maxstatwinner", mandatory=False, + keep_max = traits.Bool(argstr="--maxstatwinner", desc="Keep label with highest 'stat' value") - verbose_off = traits.Bool(argstr="--noverbose", mandatory=False, + verbose_off = traits.Bool(argstr="--noverbose", desc="Turn off overlap and stat override messages") - color_table = File(argstr="--ctab %s", mandatory=False, exists=True, + color_table = File(argstr="--ctab %s", exists=True, desc="File that defines the structure names, their indices, and their color") copy_inputs = traits.Bool(desc="copy implicit inputs and create a temp subjects_dir") diff --git a/nipype/interfaces/freesurfer/preprocess.py b/nipype/interfaces/freesurfer/preprocess.py index 0acb34076e..332f74cab8 100644 --- a/nipype/interfaces/freesurfer/preprocess.py +++ b/nipype/interfaces/freesurfer/preprocess.py @@ -1502,11 +1502,11 @@ class NormalizeInputSpec(FSTraitedSpec): # optional gradient = traits.Int(1, argstr="-g %d", usedefault=False, desc="use max intensity/mm gradient g (default=1)") - mask = File(argstr="-mask %s", mandatory=False, exists=True, + mask = File(argstr="-mask %s", exists=True, desc="The input mask file for Normalize") - segmentation = File(argstr="-aseg %s", mandatory=False, + segmentation = File(argstr="-aseg %s", exists=True, desc="The input segmentation for Normalize") - transform = File(exists=True, mandatory=False, + transform = File(exists=True, desc="Tranform file from the header of the input file") @@ -1551,9 +1551,9 @@ class CANormalizeInputSpec(FSTraitedSpec): transform = File(argstr='%s', exists=True, mandatory=True, position=-2, desc="The tranform file in lta format") # optional - mask = File(argstr='-mask %s', exists=True, mandatory=False, + mask = File(argstr='-mask %s', exists=True, desc="Specifies volume to use as mask") - control_points = File(argstr='-c %s', mandatory=False, + control_points = File(argstr='-c %s', desc="File name for the output control points") long_file = File(argstr='-long %s', desc='undocumented flag used in longitudinal processing') @@ -1596,20 +1596,20 @@ class CARegisterInputSpec(FSTraitedSpecOpenMP): #required in_file = File(argstr='%s', exists=True, mandatory=True, position=-3, desc="The input volume for CARegister") - out_file = File(argstr='%s', mandatory=False, position=-1, + out_file = File(argstr='%s', position=-1, genfile=True, desc="The output volume for CARegister") - template = File(argstr='%s', exists=True, mandatory=False, + template = File(argstr='%s', exists=True, position=-2, desc="The template file in gca format") # optional - mask = File(argstr='-mask %s', exists=True, mandatory=False, + mask = File(argstr='-mask %s', exists=True, desc="Specifies volume to use as mask") - invert_and_save = traits.Bool(argstr='-invert-and-save', mandatory=False, position=-4, + invert_and_save = traits.Bool(argstr='-invert-and-save', position=-4, desc="Invert and save the .m3z multi-dimensional talaraich transform to x, y, and z .mgz files") no_big_ventricles = traits.Bool( - argstr='-nobigventricles', mandatory=False, desc="No big ventricles") - transform = File(argstr='-T %s', exists=True, mandatory=False, + argstr='-nobigventricles', desc="No big ventricles") + transform = File(argstr='-T %s', exists=True, desc="Specifies transform in lta format") - align = traits.String(argstr='-align-%s', mandatory=False, + align = traits.String(argstr='-align-%s', desc="Specifies when to perform alignment") levels = traits.Int( argstr='-levels %d', @@ -1675,17 +1675,18 @@ class CALabelInputSpec(FSTraitedSpecOpenMP): intensities = File(argstr="-r %s", exists=True, desc="input label intensities file(used in longitudinal processing)") no_big_ventricles = traits.Bool( - argstr="-nobigventricles", mandatory=False, desc="No big ventricles") - align = traits.Bool(argstr="-align", mandatory=False, desc="Align CALabel") + argstr="-nobigventricles", desc="No big ventricles") + align = traits.Bool(argstr="-align", desc="Align CALabel") prior = traits.Float(argstr="-prior %.1f", - mandatory=False, desc="Prior for CALabel") + desc="Prior for CALabel") relabel_unlikely = traits.Tuple(traits.Int, traits.Float, argstr="-relabel_unlikely %d %.1f", - desc="Reclassify voxels at least some std devs from the mean using some size Gaussian window", - mandatory=False) - label = traits.File(argstr="-l %s", mandatory=False, exists=True, + desc=("Reclassify voxels at least some std" + " devs from the mean using some size" + " Gaussian window")) + label = traits.File(argstr="-l %s", exists=True, desc="Undocumented flag. Autorecon3 uses ../label/{hemisphere}.cortex.label as input file") - aseg = traits.File(argstr="-aseg %s", mandatory=False, exists=True, + aseg = traits.File(argstr="-aseg %s", exists=True, desc="Undocumented flag. Autorecon3 uses ../mri/aseg.presurf.mgz as input file") @@ -1742,11 +1743,11 @@ class MRIsCALabelInputSpec(FSTraitedSpecOpenMP): hash_files=False, name_template="%s.aparc.annot", desc="Annotated surface output file") # optional - label = traits.File(argstr="-l %s", mandatory=False, exists=True, + label = traits.File(argstr="-l %s", exists=True, desc="Undocumented flag. Autorecon3 uses ../label/{hemisphere}.cortex.label as input file") - aseg = traits.File(argstr="-aseg %s", mandatory=False, exists=True, + aseg = traits.File(argstr="-aseg %s", exists=True, desc="Undocumented flag. Autorecon3 uses ../mri/aseg.presurf.mgz as input file") - seed = traits.Int(argstr="-seed %d", mandatory=False, + seed = traits.Int(argstr="-seed %d", desc="") copy_inputs = traits.Bool(desc="Copies implicit inputs to node directory " + "and creates a temp subjects_directory. " + @@ -1835,8 +1836,7 @@ class SegmentCCInputSpec(FSTraitedSpec): subject_id = traits.String('subject_id', argstr="%s", mandatory=True, position=-1, usedefault=True, desc="Subject name") - copy_inputs = traits.Bool(mandatory=False, - desc="If running as a node, set this to True." + + copy_inputs = traits.Bool(desc="If running as a node, set this to True." + "This will copy the input files to the node " + "directory.") @@ -1979,10 +1979,10 @@ class EditWMwithAsegInputSpec(FSTraitedSpec): desc="Input brain/T1 file") seg_file = File(argstr="%s", position=-2, mandatory=True, exists=True, desc="Input presurf segmentation file") - out_file = File(argstr="%s", position=-1, mandtaory=True, exists=False, + out_file = File(argstr="%s", position=-1, mandatory=True, exists=False, desc="File to be written as output") # optional - keep_in = traits.Bool(argstr="-keep-in", mandatory=False, + keep_in = traits.Bool(argstr="-keep-in", desc="Keep edits as found in input volume") class EditWMwithAsegOutputSpec(TraitedSpec): diff --git a/nipype/interfaces/freesurfer/registration.py b/nipype/interfaces/freesurfer/registration.py index 1eb8321d9c..2df1f77111 100644 --- a/nipype/interfaces/freesurfer/registration.py +++ b/nipype/interfaces/freesurfer/registration.py @@ -113,8 +113,8 @@ class RegisterAVItoTalairachInputSpec(FSTraitedSpec): position=1, desc="The target file") vox2vox = File(argstr='%s', exists=True, mandatory=True, position=2, desc="The vox2vox file") - out_file = File('talairach.auto.xfm', usedfault=True, - argstr='%s', mandatory=False, + out_file = File('talairach.auto.xfm', usedefault=True, + argstr='%s', position=3, desc="The transform output") @@ -179,10 +179,10 @@ class EMRegisterInputSpec(FSTraitedSpecOpenMP): skull = traits.Bool( argstr="-skull", desc="align to atlas containing skull (uns=5)") mask = File(argstr="-mask %s", exists=True, - mandatory=False, desc="use volume as a mask") - nbrspacing = traits.Int(argstr="-uns %d", mandatory=False, + desc="use volume as a mask") + nbrspacing = traits.Int(argstr="-uns %d", desc="align to atlas containing skull setting unknown_nbr_spacing = nbrspacing") - transform = File(argstr="-t %s", exists=True, mandatory=False, + transform = File(argstr="-t %s", exists=True, desc="Previously computed transform") @@ -287,9 +287,8 @@ class PaintInputSpec(FSTraitedSpec): template = File(argstr="%s", exists=True, mandatory=True, position=-3, desc="Template file") # optional - template_param = traits.Int( - mandatory=False, desc="Frame number of the input template") - averages = traits.Int(argstr="-a %d", mandatory=False, + template_param = traits.Int(desc="Frame number of the input template") + averages = traits.Int(argstr="-a %d", desc="Average curvature patterns") out_file = File(argstr="%s", exists=False, position=-1, name_template="%s.avg_curv", hash_files=False, diff --git a/nipype/interfaces/freesurfer/tests/test_auto_Aparc2Aseg.py b/nipype/interfaces/freesurfer/tests/test_auto_Aparc2Aseg.py index 8925054f05..d4e2c57b75 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_Aparc2Aseg.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_Aparc2Aseg.py @@ -9,25 +9,20 @@ def test_Aparc2Aseg_inputs(): args=dict(argstr='%s', ), aseg=dict(argstr='--aseg %s', - mandatory=False, - ), - copy_inputs=dict(mandatory=False, ), + copy_inputs=dict(), ctxseg=dict(argstr='--ctxseg %s', - mandatory=False, ), environ=dict(nohash=True, usedefault=True, ), filled=dict(), hypo_wm=dict(argstr='--hypo-as-wm', - mandatory=False, ), ignore_exception=dict(nohash=True, usedefault=True, ), label_wm=dict(argstr='--labelwm', - mandatory=False, ), lh_annotation=dict(mandatory=True, ), @@ -51,7 +46,6 @@ def test_Aparc2Aseg_inputs(): ribbon=dict(mandatory=True, ), rip_unknown=dict(argstr='--rip-unknown', - mandatory=False, ), subject_id=dict(argstr='--s %s', mandatory=True, @@ -61,7 +55,6 @@ def test_Aparc2Aseg_inputs(): terminal_output=dict(nohash=True, ), volmask=dict(argstr='--volmask', - mandatory=False, ), ) inputs = Aparc2Aseg.input_spec() diff --git a/nipype/interfaces/freesurfer/tests/test_auto_Apas2Aseg.py b/nipype/interfaces/freesurfer/tests/test_auto_Apas2Aseg.py index 8a82249f2a..12ba0eab6f 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_Apas2Aseg.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_Apas2Aseg.py @@ -31,7 +31,6 @@ def test_Apas2Aseg_inputs(): def test_Apas2Aseg_outputs(): output_map = dict(out_file=dict(argstr='%s', - mandatory=False, ), ) outputs = Apas2Aseg.output_spec() diff --git a/nipype/interfaces/freesurfer/tests/test_auto_CALabel.py b/nipype/interfaces/freesurfer/tests/test_auto_CALabel.py index 0eb2fd9f6f..fb09708a0e 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_CALabel.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_CALabel.py @@ -5,12 +5,10 @@ def test_CALabel_inputs(): input_map = dict(align=dict(argstr='-align', - mandatory=False, ), args=dict(argstr='%s', ), aseg=dict(argstr='-aseg %s', - mandatory=False, ), environ=dict(nohash=True, usedefault=True, @@ -27,10 +25,8 @@ def test_CALabel_inputs(): intensities=dict(argstr='-r %s', ), label=dict(argstr='-l %s', - mandatory=False, ), no_big_ventricles=dict(argstr='-nobigventricles', - mandatory=False, ), num_threads=dict(), out_file=dict(argstr='%s', @@ -38,10 +34,8 @@ def test_CALabel_inputs(): position=-1, ), prior=dict(argstr='-prior %.1f', - mandatory=False, ), relabel_unlikely=dict(argstr='-relabel_unlikely %d %.1f', - mandatory=False, ), subjects_dir=dict(), template=dict(argstr='%s', diff --git a/nipype/interfaces/freesurfer/tests/test_auto_CANormalize.py b/nipype/interfaces/freesurfer/tests/test_auto_CANormalize.py index fd7f707988..3b46642cf8 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_CANormalize.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_CANormalize.py @@ -11,7 +11,6 @@ def test_CANormalize_inputs(): position=-3, ), control_points=dict(argstr='-c %s', - mandatory=False, ), environ=dict(nohash=True, usedefault=True, @@ -26,7 +25,6 @@ def test_CANormalize_inputs(): long_file=dict(argstr='-long %s', ), mask=dict(argstr='-mask %s', - mandatory=False, ), out_file=dict(argstr='%s', hash_files=False, diff --git a/nipype/interfaces/freesurfer/tests/test_auto_CARegister.py b/nipype/interfaces/freesurfer/tests/test_auto_CARegister.py index c7e39c5910..de99f1de09 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_CARegister.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_CARegister.py @@ -7,7 +7,6 @@ def test_CARegister_inputs(): input_map = dict(A=dict(argstr='-A %d', ), align=dict(argstr='-align-%s', - mandatory=False, ), args=dict(argstr='%s', ), @@ -22,7 +21,6 @@ def test_CARegister_inputs(): position=-3, ), invert_and_save=dict(argstr='-invert-and-save', - mandatory=False, position=-4, ), l_files=dict(argstr='-l %s', @@ -30,26 +28,21 @@ def test_CARegister_inputs(): levels=dict(argstr='-levels %d', ), mask=dict(argstr='-mask %s', - mandatory=False, ), no_big_ventricles=dict(argstr='-nobigventricles', - mandatory=False, ), num_threads=dict(), out_file=dict(argstr='%s', genfile=True, - mandatory=False, position=-1, ), subjects_dir=dict(), template=dict(argstr='%s', - mandatory=False, position=-2, ), terminal_output=dict(nohash=True, ), transform=dict(argstr='-T %s', - mandatory=False, ), ) inputs = CARegister.input_spec() diff --git a/nipype/interfaces/freesurfer/tests/test_auto_Contrast.py b/nipype/interfaces/freesurfer/tests/test_auto_Contrast.py index 33cb39cb49..cf1c4bc800 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_Contrast.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_Contrast.py @@ -8,8 +8,7 @@ def test_Contrast_inputs(): ), args=dict(argstr='%s', ), - copy_inputs=dict(mandatory=False, - ), + copy_inputs=dict(), cortex=dict(mandatory=True, ), environ=dict(nohash=True, diff --git a/nipype/interfaces/freesurfer/tests/test_auto_Curvature.py b/nipype/interfaces/freesurfer/tests/test_auto_Curvature.py index 851c2acff9..f01070aeb7 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_Curvature.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_Curvature.py @@ -7,7 +7,6 @@ def test_Curvature_inputs(): input_map = dict(args=dict(argstr='%s', ), averages=dict(argstr='-a %d', - mandatory=False, ), copy_input=dict(), distances=dict(argstr='-distances %d %d', @@ -24,16 +23,13 @@ def test_Curvature_inputs(): position=-2, ), n=dict(argstr='-n', - mandatory=False, ), save=dict(argstr='-w', - mandatory=False, ), subjects_dir=dict(), terminal_output=dict(nohash=True, ), threshold=dict(argstr='-thresh %.3f', - mandatory=False, ), ) inputs = Curvature.input_spec() diff --git a/nipype/interfaces/freesurfer/tests/test_auto_CurvatureStats.py b/nipype/interfaces/freesurfer/tests/test_auto_CurvatureStats.py index f99a4ce72b..1400e6f626 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_CurvatureStats.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_CurvatureStats.py @@ -6,8 +6,7 @@ def test_CurvatureStats_inputs(): input_map = dict(args=dict(argstr='%s', ), - copy_inputs=dict(mandatory=False, - ), + copy_inputs=dict(), curvfile1=dict(argstr='%s', mandatory=True, position=-2, @@ -27,7 +26,6 @@ def test_CurvatureStats_inputs(): usedefault=True, ), min_max=dict(argstr='-m', - mandatory=False, ), out_file=dict(argstr='-o %s', hash_files=False, @@ -41,15 +39,12 @@ def test_CurvatureStats_inputs(): ), subjects_dir=dict(), surface=dict(argstr='-F %s', - mandatory=False, ), terminal_output=dict(nohash=True, ), values=dict(argstr='-G', - mandatory=False, ), write=dict(argstr='--writeCurvatureFiles', - mandatory=False, ), ) inputs = CurvatureStats.input_spec() diff --git a/nipype/interfaces/freesurfer/tests/test_auto_EMRegister.py b/nipype/interfaces/freesurfer/tests/test_auto_EMRegister.py index ab363afb49..e1933778b3 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_EMRegister.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_EMRegister.py @@ -17,10 +17,8 @@ def test_EMRegister_inputs(): position=-3, ), mask=dict(argstr='-mask %s', - mandatory=False, ), nbrspacing=dict(argstr='-uns %d', - mandatory=False, ), num_threads=dict(), out_file=dict(argstr='%s', @@ -40,7 +38,6 @@ def test_EMRegister_inputs(): terminal_output=dict(nohash=True, ), transform=dict(argstr='-t %s', - mandatory=False, ), ) inputs = EMRegister.input_spec() diff --git a/nipype/interfaces/freesurfer/tests/test_auto_EditWMwithAseg.py b/nipype/interfaces/freesurfer/tests/test_auto_EditWMwithAseg.py index 47da3a0cb9..fb236ac87c 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_EditWMwithAseg.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_EditWMwithAseg.py @@ -21,10 +21,9 @@ def test_EditWMwithAseg_inputs(): position=-4, ), keep_in=dict(argstr='-keep-in', - mandatory=False, ), out_file=dict(argstr='%s', - mandtaory=True, + mandatory=True, position=-1, ), seg_file=dict(argstr='%s', diff --git a/nipype/interfaces/freesurfer/tests/test_auto_FixTopology.py b/nipype/interfaces/freesurfer/tests/test_auto_FixTopology.py index 13ed1db43c..198ac05ecf 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_FixTopology.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_FixTopology.py @@ -12,7 +12,6 @@ def test_FixTopology_inputs(): usedefault=True, ), ga=dict(argstr='-ga', - mandatory=False, ), hemisphere=dict(argstr='%s', mandatory=True, @@ -30,13 +29,10 @@ def test_FixTopology_inputs(): in_wm=dict(mandatory=True, ), mgz=dict(argstr='-mgz', - mandatory=False, ), seed=dict(argstr='-seed %d', - mandatory=False, ), sphere=dict(argstr='-sphere %s', - mandatory=False, ), subject_id=dict(argstr='%s', mandatory=True, diff --git a/nipype/interfaces/freesurfer/tests/test_auto_Label2Annot.py b/nipype/interfaces/freesurfer/tests/test_auto_Label2Annot.py index d2d350eb71..deed12d317 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_Label2Annot.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_Label2Annot.py @@ -7,7 +7,6 @@ def test_Label2Annot_inputs(): input_map = dict(args=dict(argstr='%s', ), color_table=dict(argstr='--ctab %s', - mandatory=False, ), copy_inputs=dict(), environ=dict(nohash=True, @@ -23,7 +22,6 @@ def test_Label2Annot_inputs(): mandatory=True, ), keep_max=dict(argstr='--maxstatwinner', - mandatory=False, ), orig=dict(mandatory=True, ), @@ -38,7 +36,6 @@ def test_Label2Annot_inputs(): terminal_output=dict(nohash=True, ), verbose_off=dict(argstr='--noverbose', - mandatory=False, ), ) inputs = Label2Annot.input_spec() diff --git a/nipype/interfaces/freesurfer/tests/test_auto_Label2Label.py b/nipype/interfaces/freesurfer/tests/test_auto_Label2Label.py index 3f9bf3de98..8ca41467ec 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_Label2Label.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_Label2Label.py @@ -6,8 +6,7 @@ def test_Label2Label_inputs(): input_map = dict(args=dict(argstr='%s', ), - copy_inputs=dict(mandatory=False, - ), + copy_inputs=dict(), environ=dict(nohash=True, usedefault=True, ), @@ -20,7 +19,6 @@ def test_Label2Label_inputs(): out_file=dict(argstr='--trglabel %s', hash_files=False, keep_extension=True, - mandatory=False, name_source=['source_label'], name_template='%s_converted', ), diff --git a/nipype/interfaces/freesurfer/tests/test_auto_MRIFill.py b/nipype/interfaces/freesurfer/tests/test_auto_MRIFill.py index fdf495a8ec..042305c7ad 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_MRIFill.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_MRIFill.py @@ -23,13 +23,11 @@ def test_MRIFill_inputs(): position=-1, ), segmentation=dict(argstr='-segmentation %s', - mandatory=False, ), subjects_dir=dict(), terminal_output=dict(nohash=True, ), transform=dict(argstr='-xform %s', - mandatory=False, ), ) inputs = MRIFill.input_spec() diff --git a/nipype/interfaces/freesurfer/tests/test_auto_MRIsCALabel.py b/nipype/interfaces/freesurfer/tests/test_auto_MRIsCALabel.py index 5c6932a1cb..2ff1ccd31d 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_MRIsCALabel.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_MRIsCALabel.py @@ -7,7 +7,6 @@ def test_MRIsCALabel_inputs(): input_map = dict(args=dict(argstr='%s', ), aseg=dict(argstr='-aseg %s', - mandatory=False, ), canonsurf=dict(argstr='%s', mandatory=True, @@ -31,7 +30,6 @@ def test_MRIsCALabel_inputs(): usedefault=True, ), label=dict(argstr='-l %s', - mandatory=False, ), num_threads=dict(), out_file=dict(argstr='%s', @@ -42,7 +40,6 @@ def test_MRIsCALabel_inputs(): position=-1, ), seed=dict(argstr='-seed %d', - mandatory=False, ), smoothwm=dict(mandatory=True, ), diff --git a/nipype/interfaces/freesurfer/tests/test_auto_MRIsCalc.py b/nipype/interfaces/freesurfer/tests/test_auto_MRIsCalc.py index 9f110ef29a..b8263b5ebf 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_MRIsCalc.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_MRIsCalc.py @@ -21,17 +21,14 @@ def test_MRIsCalc_inputs(): position=-3, ), in_file2=dict(argstr='%s', - mandatory=False, position=-1, xor=['in_float', 'in_int'], ), in_float=dict(argstr='%f', - mandatory=False, position=-1, xor=['in_file2', 'in_int'], ), in_int=dict(argstr='%d', - mandatory=False, position=-1, xor=['in_file2', 'in_float'], ), diff --git a/nipype/interfaces/freesurfer/tests/test_auto_MRIsInflate.py b/nipype/interfaces/freesurfer/tests/test_auto_MRIsInflate.py index ef5e0c0beb..99ce0e1b8e 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_MRIsInflate.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_MRIsInflate.py @@ -18,7 +18,6 @@ def test_MRIsInflate_inputs(): position=-2, ), no_save_sulc=dict(argstr='-no-save-sulc', - mandatory=False, xor=['out_sulc'], ), out_file=dict(argstr='%s', @@ -28,8 +27,7 @@ def test_MRIsInflate_inputs(): name_template='%s.inflated', position=-1, ), - out_sulc=dict(mandatory=False, - xor=['no_save_sulc'], + out_sulc=dict(xor=['no_save_sulc'], ), subjects_dir=dict(), terminal_output=dict(nohash=True, diff --git a/nipype/interfaces/freesurfer/tests/test_auto_MakeSurfaces.py b/nipype/interfaces/freesurfer/tests/test_auto_MakeSurfaces.py index a34894fe99..5dd36f9628 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_MakeSurfaces.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_MakeSurfaces.py @@ -6,13 +6,11 @@ def test_MakeSurfaces_inputs(): input_map = dict(args=dict(argstr='%s', ), - copy_inputs=dict(mandatory=False, - ), + copy_inputs=dict(), environ=dict(nohash=True, usedefault=True, ), fix_mtl=dict(argstr='-fix_mtl', - mandatory=False, ), hemisphere=dict(argstr='%s', mandatory=True, @@ -22,15 +20,12 @@ def test_MakeSurfaces_inputs(): usedefault=True, ), in_T1=dict(argstr='-T1 %s', - mandatory=False, ), in_aseg=dict(argstr='-aseg %s', - mandatory=False, ), in_filled=dict(mandatory=True, ), - in_label=dict(mandatory=False, - xor=['noaparc'], + in_label=dict(xor=['noaparc'], ), in_orig=dict(argstr='-orig %s', mandatory=True, @@ -43,21 +38,16 @@ def test_MakeSurfaces_inputs(): maximum=dict(argstr='-max %.1f', ), mgz=dict(argstr='-mgz', - mandatory=False, ), no_white=dict(argstr='-nowhite', - mandatory=False, ), noaparc=dict(argstr='-noaparc', - mandatory=False, xor=['in_label'], ), orig_pial=dict(argstr='-orig_pial %s', - mandatory=False, requires=['in_label'], ), orig_white=dict(argstr='-orig_white %s', - mandatory=False, ), subject_id=dict(argstr='%s', mandatory=True, @@ -70,7 +60,6 @@ def test_MakeSurfaces_inputs(): white=dict(argstr='-white %s', ), white_only=dict(argstr='-whiteonly', - mandatory=False, ), ) inputs = MakeSurfaces.input_spec() diff --git a/nipype/interfaces/freesurfer/tests/test_auto_Normalize.py b/nipype/interfaces/freesurfer/tests/test_auto_Normalize.py index 626367a8f5..304983e629 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_Normalize.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_Normalize.py @@ -20,7 +20,6 @@ def test_Normalize_inputs(): position=-2, ), mask=dict(argstr='-mask %s', - mandatory=False, ), out_file=dict(argstr='%s', hash_files=False, @@ -30,13 +29,11 @@ def test_Normalize_inputs(): position=-1, ), segmentation=dict(argstr='-aseg %s', - mandatory=False, ), subjects_dir=dict(), terminal_output=dict(nohash=True, ), - transform=dict(mandatory=False, - ), + transform=dict(), ) inputs = Normalize.input_spec() diff --git a/nipype/interfaces/freesurfer/tests/test_auto_Paint.py b/nipype/interfaces/freesurfer/tests/test_auto_Paint.py index 488613ffb7..e34c646324 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_Paint.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_Paint.py @@ -7,7 +7,6 @@ def test_Paint_inputs(): input_map = dict(args=dict(argstr='%s', ), averages=dict(argstr='-a %d', - mandatory=False, ), environ=dict(nohash=True, usedefault=True, @@ -31,8 +30,7 @@ def test_Paint_inputs(): mandatory=True, position=-3, ), - template_param=dict(mandatory=False, - ), + template_param=dict(), terminal_output=dict(nohash=True, ), ) diff --git a/nipype/interfaces/freesurfer/tests/test_auto_ParcellationStats.py b/nipype/interfaces/freesurfer/tests/test_auto_ParcellationStats.py index ffa0569c40..07fc98b147 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_ParcellationStats.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_ParcellationStats.py @@ -10,8 +10,7 @@ def test_ParcellationStats_inputs(): ), brainmask=dict(mandatory=True, ), - copy_inputs=dict(mandatory=False, - ), + copy_inputs=dict(), cortex_label=dict(), environ=dict(nohash=True, usedefault=True, @@ -24,14 +23,11 @@ def test_ParcellationStats_inputs(): usedefault=True, ), in_annotation=dict(argstr='-a %s', - mandatory=False, xor=['in_label'], ), in_cortex=dict(argstr='-cortex %s', - mandatory=False, ), in_label=dict(argstr='-l %s', - mandatory=False, xor=['in_annotatoin', 'out_color'], ), lh_pial=dict(mandatory=True, @@ -39,16 +35,13 @@ def test_ParcellationStats_inputs(): lh_white=dict(mandatory=True, ), mgz=dict(argstr='-mgz', - mandatory=False, ), out_color=dict(argstr='-c %s', genfile=True, - mandatory=False, xor=['in_label'], ), out_table=dict(argstr='-f %s', genfile=True, - mandatory=False, requires=['tabular_output'], ), rh_pial=dict(mandatory=True, @@ -64,11 +57,9 @@ def test_ParcellationStats_inputs(): ), subjects_dir=dict(), surface=dict(argstr='%s', - mandatory=False, position=-1, ), tabular_output=dict(argstr='-b', - mandatory=False, ), terminal_output=dict(nohash=True, ), diff --git a/nipype/interfaces/freesurfer/tests/test_auto_RegisterAVItoTalairach.py b/nipype/interfaces/freesurfer/tests/test_auto_RegisterAVItoTalairach.py index c44974ea4f..8b45a00097 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_RegisterAVItoTalairach.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_RegisterAVItoTalairach.py @@ -17,9 +17,8 @@ def test_RegisterAVItoTalairach_inputs(): position=0, ), out_file=dict(argstr='%s', - mandatory=False, position=3, - usedfault=True, + usedefault=True, ), subjects_dir=dict(), target=dict(argstr='%s', diff --git a/nipype/interfaces/freesurfer/tests/test_auto_RelabelHypointensities.py b/nipype/interfaces/freesurfer/tests/test_auto_RelabelHypointensities.py index b60cefd5c4..63d1bee291 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_RelabelHypointensities.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_RelabelHypointensities.py @@ -31,7 +31,6 @@ def test_RelabelHypointensities_inputs(): ), subjects_dir=dict(), surf_directory=dict(argstr='%s', - mandatory=False, position=-2, usedefault=True, ), @@ -47,7 +46,6 @@ def test_RelabelHypointensities_inputs(): def test_RelabelHypointensities_outputs(): output_map = dict(out_file=dict(argstr='%s', - mandatory=False, ), ) outputs = RelabelHypointensities.output_spec() diff --git a/nipype/interfaces/freesurfer/tests/test_auto_RemoveNeck.py b/nipype/interfaces/freesurfer/tests/test_auto_RemoveNeck.py index 0009c46e9b..278d6848d4 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_RemoveNeck.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_RemoveNeck.py @@ -13,8 +13,7 @@ def test_RemoveNeck_inputs(): usedefault=True, ), in_file=dict(argstr='%s', - exisits=True, - madatory=True, + mandatory=True, position=-4, ), out_file=dict(argstr='%s', @@ -25,7 +24,6 @@ def test_RemoveNeck_inputs(): position=-1, ), radius=dict(argstr='-radius %d', - mandatory=False, ), subjects_dir=dict(), template=dict(argstr='%s', diff --git a/nipype/interfaces/freesurfer/tests/test_auto_SegStats.py b/nipype/interfaces/freesurfer/tests/test_auto_SegStats.py index b5f69c87b7..5fa5871743 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_SegStats.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_SegStats.py @@ -31,7 +31,6 @@ def test_SegStats_inputs(): xor=('color_table_file', 'default_color_table', 'gca_color_table'), ), empty=dict(argstr='--empty', - mandatory=False, ), environ=dict(nohash=True, usedefault=True, @@ -56,7 +55,6 @@ def test_SegStats_inputs(): in_file=dict(argstr='--i %s', ), in_intensity=dict(argstr='--in %s --in-intensity-name %s', - mandatory=False, ), intensity_units=dict(argstr='--in-intensity-units %s', requires=['in_intensity'], diff --git a/nipype/interfaces/freesurfer/tests/test_auto_SegStatsReconAll.py b/nipype/interfaces/freesurfer/tests/test_auto_SegStatsReconAll.py index 4c0f8dcde6..518d119a97 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_SegStatsReconAll.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_SegStatsReconAll.py @@ -33,7 +33,6 @@ def test_SegStatsReconAll_inputs(): xor=('color_table_file', 'default_color_table', 'gca_color_table'), ), empty=dict(argstr='--empty', - mandatory=False, ), environ=dict(nohash=True, usedefault=True, @@ -58,7 +57,6 @@ def test_SegStatsReconAll_inputs(): in_file=dict(argstr='--i %s', ), in_intensity=dict(argstr='--in %s --in-intensity-name %s', - mandatory=False, ), intensity_units=dict(argstr='--in-intensity-units %s', requires=['in_intensity'], diff --git a/nipype/interfaces/freesurfer/tests/test_auto_SegmentCC.py b/nipype/interfaces/freesurfer/tests/test_auto_SegmentCC.py index 48864c566c..c1b6c6585f 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_SegmentCC.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_SegmentCC.py @@ -6,8 +6,7 @@ def test_SegmentCC_inputs(): input_map = dict(args=dict(argstr='%s', ), - copy_inputs=dict(mandatory=False, - ), + copy_inputs=dict(), environ=dict(nohash=True, usedefault=True, ), diff --git a/nipype/interfaces/freesurfer/tests/test_auto_SmoothTessellation.py b/nipype/interfaces/freesurfer/tests/test_auto_SmoothTessellation.py index 57a56972f2..f34dfefbbc 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_SmoothTessellation.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_SmoothTessellation.py @@ -36,7 +36,6 @@ def test_SmoothTessellation_inputs(): position=-1, ), seed=dict(argstr='-seed %d', - mandatory=False, ), smoothing_iterations=dict(argstr='-n %d', ), diff --git a/nipype/interfaces/freesurfer/tests/test_auto_Sphere.py b/nipype/interfaces/freesurfer/tests/test_auto_Sphere.py index 7705829bb8..ceab66da9f 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_Sphere.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_Sphere.py @@ -18,22 +18,18 @@ def test_Sphere_inputs(): position=-2, ), in_smoothwm=dict(copyfile=True, - mandatory=False, ), magic=dict(argstr='-q', - mandatory=False, requires=['in_smoothwm'], ), num_threads=dict(), - out_file=dict(Desc='Output file for Sphere', - argstr='%s', + out_file=dict(argstr='%s', hash_files=False, name_source=['in_file'], name_template='%s.sphere', position=-1, ), seed=dict(argstr='-seed %d', - mandatory=False, ), subjects_dir=dict(), terminal_output=dict(nohash=True, diff --git a/nipype/interfaces/freesurfer/tests/test_auto_VolumeMask.py b/nipype/interfaces/freesurfer/tests/test_auto_VolumeMask.py index c87f8716b5..945f639739 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_VolumeMask.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_VolumeMask.py @@ -8,8 +8,7 @@ def test_VolumeMask_inputs(): ), aseg=dict(xor=['in_aseg'], ), - copy_inputs=dict(mandatory=False, - ), + copy_inputs=dict(), environ=dict(nohash=True, usedefault=True, ), @@ -17,7 +16,6 @@ def test_VolumeMask_inputs(): usedefault=True, ), in_aseg=dict(argstr='--aseg_name %s', - mandatory=False, xor=['aseg'], ), left_ribbonlabel=dict(argstr='--label_left_ribbon %d', @@ -41,7 +39,6 @@ def test_VolumeMask_inputs(): mandatory=True, ), save_ribbon=dict(argstr='--save_ribbon', - mandatory=False, ), subject_id=dict(argstr='%s', mandatory=True, diff --git a/nipype/interfaces/freesurfer/utils.py b/nipype/interfaces/freesurfer/utils.py index 6f03a11f6e..b8ba2a3260 100644 --- a/nipype/interfaces/freesurfer/utils.py +++ b/nipype/interfaces/freesurfer/utils.py @@ -1123,7 +1123,7 @@ class SmoothTessellationInputSpec(FSTraitedSpec): out_file = File(argstr='%s', position=-1, genfile=True, desc='output filename or True to generate one') out_curvature_file = File(argstr='-c %s', desc='Write curvature to ?h.curvname (default "curv")') out_area_file = File(argstr='-b %s', desc='Write area to ?h.areaname (default "area")') - seed = traits.Int(argstr="-seed %d", mandatory=False, + seed = traits.Int(argstr="-seed %d", desc="Seed for setting random number generator") @@ -1515,7 +1515,7 @@ class TalairachQC(FSScriptCommand): class RemoveNeckInputSpec(FSTraitedSpec): - in_file = File(argstr="%s", exisits=True, madatory=True, + in_file = File(argstr="%s", exists=True, mandatory=True, position=-4, desc="Input file for RemoveNeck") out_file = File(argstr="%s", exists=False, name_source=['in_file'], name_template="%s_noneck", @@ -1526,7 +1526,7 @@ class RemoveNeckInputSpec(FSTraitedSpec): template = File(argstr="%s", exists=True, mandatory=True, position=-2, desc="Input template file for RemoveNeck") # optional - radius = traits.Int(argstr="-radius %d", mandatory=False, desc="Radius") + radius = traits.Int(argstr="-radius %d", desc="Radius") class RemoveNeckOutputSpec(TraitedSpec): @@ -1569,9 +1569,9 @@ class MRIFillInputSpec(FSTraitedSpec): out_file = File(argstr="%s", mandatory=True, exists=False, position=-1, desc="Output filled volume file name for MRIFill") # optional - segmentation = File(argstr="-segmentation %s", mandatory=False, exists=True, + segmentation = File(argstr="-segmentation %s", exists=True, desc="Input segmentation file for MRIFill") - transform = File(argstr="-xform %s", mandatory=False, exists=True, + transform = File(argstr="-xform %s", exists=True, desc="Input transform file for MRIFill") log_file = File(argstr="-a %s", desc="Output log file for MRIFill") @@ -1616,10 +1616,10 @@ class MRIsInflateInputSpec(FSTraitedSpec): hash_files=False, keep_extension=True, desc="Output file for MRIsInflate") # optional - out_sulc = File(mandatory=False, exists=False, + out_sulc = File( exists=False, xor=['no_save_sulc'], desc="Output sulc file") - no_save_sulc = traits.Bool(argstr='-no-save-sulc', mandatory=False, + no_save_sulc = traits.Bool(argstr='-no-save-sulc', xor=['out_sulc'], desc="Do not save sulc file as output") @@ -1663,14 +1663,14 @@ class SphereInputSpec(FSTraitedSpecOpenMP): out_file = File(argstr="%s", position=-1, exists=False, name_source=['in_file'], hash_files=False, name_template='%s.sphere', - Desc="Output file for Sphere") + desc="Output file for Sphere") # optional - seed = traits.Int(argstr="-seed %d", mandatory=False, + seed = traits.Int(argstr="-seed %d", desc="Seed for setting random number generator") - magic = traits.Bool(argstr="-q", mandatory=False, + magic = traits.Bool(argstr="-q", requires=['in_smoothwm'], desc="No documentation. Direct questions to analysis-bugs@nmr.mgh.harvard.edu") - in_smoothwm = File(mandatory=False, exists=True, copyfile=True, + in_smoothwm = File( exists=True, copyfile=True, desc="Input surface required when -q flag is not selected") @@ -1719,13 +1719,13 @@ class FixTopologyInputSpec(FSTraitedSpec): "in place.") # optional - seed = traits.Int(argstr="-seed %d", mandatory=False, + seed = traits.Int(argstr="-seed %d", desc="Seed for setting random number generator") - ga = traits.Bool(argstr="-ga", mandatory=False, + ga = traits.Bool(argstr="-ga", desc="No documentation. Direct questions to analysis-bugs@nmr.mgh.harvard.edu") - mgz = traits.Bool(argstr="-mgz", mandatory=False, + mgz = traits.Bool(argstr="-mgz", desc="No documentation. Direct questions to analysis-bugs@nmr.mgh.harvard.edu") - sphere = traits.File(argstr="-sphere %s", mandatory=False, + sphere = traits.File(argstr="-sphere %s", desc="Sphere input file") @@ -1877,27 +1877,27 @@ class MakeSurfacesInputSpec(FSTraitedSpec): desc="Implicit input file filled.mgz") # optional in_white = File(exists=True, desc="Implicit input that is sometimes used") - in_label = File(exists=True, mandatory=False, xor=['noaparc'], + in_label = File(exists=True, xor=['noaparc'], desc="Implicit input label/.aparc.annot") - orig_white = File(argstr="-orig_white %s", exists=True, mandatory=False, + orig_white = File(argstr="-orig_white %s", exists=True, desc="Specify a white surface to start with") - orig_pial = File(argstr="-orig_pial %s", exists=True, mandatory=False, requires=['in_label'], + orig_pial = File(argstr="-orig_pial %s", exists=True, requires=['in_label'], desc="Specify a pial surface to start with") - fix_mtl = traits.Bool(argstr="-fix_mtl", mandatory=False, + fix_mtl = traits.Bool(argstr="-fix_mtl", desc="Undocumented flag") - no_white = traits.Bool(argstr="-nowhite", mandatory=False, + no_white = traits.Bool(argstr="-nowhite", desc="Undocumented flag") - white_only = traits.Bool(argstr="-whiteonly", mandatory=False, + white_only = traits.Bool(argstr="-whiteonly", desc="Undocumented flage") in_aseg = File(argstr="-aseg %s", exists=True, - mandatory=False, desc="Input segmentation file") - in_T1 = File(argstr="-T1 %s", exists=True, mandatory=False, + desc="Input segmentation file") + in_T1 = File(argstr="-T1 %s", exists=True, desc="Input brain or T1 file") mgz = traits.Bool( - argstr="-mgz", mandatory=False, + argstr="-mgz", desc="No documentation. Direct questions to analysis-bugs@nmr.mgh.harvard.edu") noaparc = traits.Bool( - argstr="-noaparc", mandatory=False, xor=['in_label'], + argstr="-noaparc", xor=['in_label'], desc="No documentation. Direct questions to analysis-bugs@nmr.mgh.harvard.edu") maximum = traits.Float( argstr="-max %.1f", desc="No documentation (used for longitudinal processing)") @@ -1905,7 +1905,7 @@ class MakeSurfacesInputSpec(FSTraitedSpec): argstr="-long", desc="No documentation (used for longitudinal processing)") white = traits.String(argstr="-white %s", desc="White surface name") - copy_inputs = traits.Bool(mandatory=False, + copy_inputs = traits.Bool( desc="If running as a node, set this to True." + "This will copy the input files to the node " + "directory.") @@ -2046,12 +2046,12 @@ class CurvatureInputSpec(FSTraitedSpec): copyfile=True, desc="Input file for Curvature") # optional threshold = traits.Float( - argstr="-thresh %.3f", mandatory=False, desc="Undocumented input threshold") - n = traits.Bool(argstr="-n", mandatory=False, + argstr="-thresh %.3f", desc="Undocumented input threshold") + n = traits.Bool(argstr="-n", desc="Undocumented boolean flag") - averages = traits.Int(argstr="-a %d", mandatory=False, + averages = traits.Int(argstr="-a %d", desc="Perform this number iterative averages of curvature measure before saving") - save = traits.Bool(argstr="-w", mandatory=False, + save = traits.Bool(argstr="-w", desc="Save curvature files (will only generate screen output without this option)") distances = traits.Tuple(traits.Int, traits.Int, argstr="-distances %d %d", desc="Undocumented input integer distances") @@ -2102,7 +2102,7 @@ def _list_outputs(self): class CurvatureStatsInputSpec(FSTraitedSpec): - surface = File(argstr="-F %s", mandatory=False, exists=True, + surface = File(argstr="-F %s", exists=True, desc="Specify surface file for CurvatureStats") curvfile1 = File(argstr="%s", position=-2, mandatory=True, exists=True, desc="Input file for CurvatureStats") @@ -2118,13 +2118,13 @@ class CurvatureStatsInputSpec(FSTraitedSpec): name_source=['hemisphere'], name_template='%s.curv.stats', hash_files=False, desc="Output curvature stats file") # optional - min_max = traits.Bool(argstr="-m", mandatory=False, + min_max = traits.Bool(argstr="-m", desc="Output min / max information for the processed curvature.") - values = traits.Bool(argstr="-G", mandatory=False, + values = traits.Bool(argstr="-G", desc="Triggers a series of derived curvature values") - write = traits.Bool(argstr="--writeCurvatureFiles", mandatory=False, + write = traits.Bool(argstr="--writeCurvatureFiles", desc="Write curvature files") - copy_inputs = traits.Bool(mandatory=False, + copy_inputs = traits.Bool( desc="If running as a node, set this to True." + "This will copy the input files to the node " + "directory.") @@ -2250,11 +2250,11 @@ class MRIsCalcInputSpec(FSTraitedSpec): desc="Output file after calculation") # optional - in_file2 = File(argstr="%s", exists=True, position=-1, mandatory=False, + in_file2 = File(argstr="%s", exists=True, position=-1, xor=['in_float', 'in_int'], desc="Input file 2") - in_float = traits.Float(argstr="%f", position=-1, mandatory=False, + in_float = traits.Float(argstr="%f", position=-1, xor=['in_file2', 'in_int'], desc="Input float") - in_int = traits.Int(argstr="%d", position=-1, mandatory=False, + in_int = traits.Int(argstr="%d", position=-1, xor=['in_file2', 'in_float'], desc="Input integer") @@ -2322,14 +2322,13 @@ class VolumeMaskInputSpec(FSTraitedSpec): position=-1, argstr="%s", mandatory=True, desc="Subject being processed") # optional - in_aseg = File(argstr="--aseg_name %s", mandatory=False, + in_aseg = File(argstr="--aseg_name %s", exists=True, xor=['aseg'], desc="Input aseg file for VolumeMask") - save_ribbon = traits.Bool(argstr="--save_ribbon", mandatory=False, + save_ribbon = traits.Bool(argstr="--save_ribbon", desc="option to save just the ribbon for the " + "hemispheres in the format ?h.ribbon.mgz") - copy_inputs = traits.Bool(mandatory=False, - desc="If running as a node, set this to True." + + copy_inputs = traits.Bool(desc="If running as a node, set this to True." + "This will copy the implicit input files to the " + "node directory.") @@ -2434,24 +2433,23 @@ class ParcellationStatsInputSpec(FSTraitedSpec): cortex_label = File(exists=True, desc="implicit input file {hemi}.cortex.label") # optional - surface = traits.String(position=-1, argstr="%s", mandatory=False, + surface = traits.String(position=-1, argstr="%s", desc="Input surface (e.g. 'white')") - mgz = traits.Bool(argstr="-mgz", mandatory=False, + mgz = traits.Bool(argstr="-mgz", desc="Look for mgz files") - in_cortex = traits.File(argstr="-cortex %s", mandatory=False, exists=True, + in_cortex = traits.File(argstr="-cortex %s", exists=True, desc="Input cortex label") - in_annotation = traits.File(argstr="-a %s", mandatory=False, exists=True, xor=['in_label'], + in_annotation = traits.File(argstr="-a %s", exists=True, xor=['in_label'], desc="compute properties for each label in the annotation file separately") - in_label = traits.File(argstr="-l %s", mandatory=False, exists=True, xor=['in_annotatoin', 'out_color'], + in_label = traits.File(argstr="-l %s", exists=True, xor=['in_annotatoin', 'out_color'], desc="limit calculations to specified label") - tabular_output = traits.Bool(argstr="-b", mandatory=False, + tabular_output = traits.Bool(argstr="-b", desc="Tabular output") - out_table = traits.File(argstr="-f %s", mandatory=False, exists=False, genfile=True, + out_table = traits.File(argstr="-f %s", exists=False, genfile=True, requires=['tabular_output'], desc="Table output to tablefile") - out_color = traits.File(argstr="-c %s", mandatory=False, exists=False, genfile=True, xor=['in_label'], + out_color = traits.File(argstr="-c %s", exists=False, genfile=True, xor=['in_label'], desc="Output annotation files's colortable to text file") - copy_inputs = traits.Bool(mandatory=False, - desc="If running as a node, set this to True." + + copy_inputs = traits.Bool(desc="If running as a node, set this to True." + "This will copy the input files to the node " + "directory.") th3 = traits.Bool(argstr="-th3", requires=["cortex_label"], @@ -2600,8 +2598,7 @@ class ContrastInputSpec(FSTraitedSpec): desc="Implicit input file mri/orig.mgz") rawavg = File(exists=True, mandatory=True, desc="Implicit input file mri/rawavg.mgz") - copy_inputs = traits.Bool(mandatory=False, - desc="If running as a node, set this to True." + + copy_inputs = traits.Bool(desc="If running as a node, set this to True." + "This will copy the input files to the node " + "directory.") @@ -2681,7 +2678,7 @@ class RelabelHypointensitiesInputSpec(FSTraitedSpec): aseg = File(argstr="%s", position=-3, mandatory=True, exists=True, desc="Input aseg file") surf_directory = traits.Directory('.', argstr="%s", position=-2, exists=True, - mandatory=False, usedefault=True, + usedefault=True, desc="Directory containing lh.white and rh.white") out_file = File(argstr="%s", position=-1, exists=False, name_source=['aseg'], name_template='%s.hypos.mgz', @@ -2690,7 +2687,7 @@ class RelabelHypointensitiesInputSpec(FSTraitedSpec): class RelabelHypointensitiesOutputSpec(TraitedSpec): - out_file = File(argstr="%s", exists=False, mandatory=False, + out_file = File(argstr="%s", exists=False, desc="Output aseg file") @@ -2748,26 +2745,25 @@ class Aparc2AsegInputSpec(FSTraitedSpec): # optional filled = File(exists=True, desc="Implicit input filled file. Only required with FS v5.3.") - aseg = File(argstr="--aseg %s", mandatory=False, exists=True, + aseg = File(argstr="--aseg %s", exists=True, desc="Input aseg file") - volmask = traits.Bool(argstr="--volmask", mandatory=False, + volmask = traits.Bool(argstr="--volmask", desc="Volume mask flag") - ctxseg = File(argstr="--ctxseg %s", mandatory=False, exists=True, + ctxseg = File(argstr="--ctxseg %s", exists=True, desc="") - label_wm = traits.Bool(argstr="--labelwm", mandatory=False, + label_wm = traits.Bool(argstr="--labelwm", desc=""" For each voxel labeled as white matter in the aseg, re-assign its label to be that of the closest cortical point if its distance is less than dmaxctx """) - hypo_wm = traits.Bool(argstr="--hypo-as-wm", mandatory=False, + hypo_wm = traits.Bool(argstr="--hypo-as-wm", desc="Label hypointensities as WM") - rip_unknown = traits.Bool(argstr="--rip-unknown", mandatory=False, + rip_unknown = traits.Bool(argstr="--rip-unknown", desc="Do not label WM based on 'unknown' corical label") a2009s = traits.Bool(argstr="--a2009s", desc="Using the a2009s atlas") - copy_inputs = traits.Bool(mandatory=False, - desc="If running as a node, set this to True." + + copy_inputs = traits.Bool(desc="If running as a node, set this to True." + "This will copy the input files to the node " + "directory.") @@ -2861,7 +2857,7 @@ class Apas2AsegInputSpec(FSTraitedSpec): class Apas2AsegOutputSpec(TraitedSpec): - out_file = File(argstr="%s", exists=False, mandatory=False, + out_file = File(argstr="%s", exists=False, desc="Output aseg file") diff --git a/nipype/interfaces/io.py b/nipype/interfaces/io.py index 6f0ad3bc32..7bc0ff358c 100644 --- a/nipype/interfaces/io.py +++ b/nipype/interfaces/io.py @@ -211,8 +211,7 @@ class DataSinkInputSpec(DynamicTraitedSpec, BaseInterfaceInputSpec): encrypt_bucket_keys = traits.Bool(desc='Flag indicating whether to use S3 '\ 'server-side AES-256 encryption') # Set this if user wishes to override the bucket with their own - bucket = traits.Generic(mandatory=False, - desc='Boto3 S3 bucket for manual override of bucket') + bucket = traits.Str(desc='Boto3 S3 bucket for manual override of bucket') # Set this if user wishes to have local copy of files as well local_copy = traits.Str(desc='Copy files locally as well as to S3 bucket') diff --git a/nipype/interfaces/minc/minc.py b/nipype/interfaces/minc/minc.py index c54e855125..36efd2eef3 100644 --- a/nipype/interfaces/minc/minc.py +++ b/nipype/interfaces/minc/minc.py @@ -485,7 +485,6 @@ class ToEcatInputSpec(CommandLineInputSpec): output_file = File( desc='output file', - mandatory=False, genfile=True, argstr='%s', position=-1, @@ -663,9 +662,8 @@ class AverageInputSpec(CommandLineInputSpec): _xor_input_files = ('input_files', 'filelist') input_files = InputMultiPath( - traits.File, + traits.File(exists=True), desc='input file(s)', - exists=True, mandatory=True, sep=' ', argstr='%s', @@ -917,9 +915,8 @@ class CalcInputSpec(CommandLineInputSpec): _xor_input_files = ('input_files', 'filelist') input_files = InputMultiPath( - traits.File, + traits.File(exists=True), desc='input file(s) for calculation', - exists=True, mandatory=True, sep=' ', argstr='%s', @@ -1733,9 +1730,8 @@ class MathInputSpec(CommandLineInputSpec): _xor_input_files = ('input_files', 'filelist') input_files = InputMultiPath( - traits.File, + traits.File(exists=True), desc='input file(s) for calculation', - exists=True, mandatory=True, sep=' ', argstr='%s', @@ -2604,9 +2600,9 @@ class NormInputSpec(CommandLineInputSpec): usedefault=True, default_value=True) - cutoff = traits.Float( - min=0, - max=100, + cutoff = traits.Range( + low=0.0, + high=100.0, desc='Cutoff value to use to calculate thresholds by a histogram PcT in %. [default: 0.01]', argstr='-cutoff %s', ) @@ -2626,9 +2622,9 @@ class NormInputSpec(CommandLineInputSpec): desc='Threshold the image (set values below threshold_perc to -out_floor).', argstr='-threshold') - threshold_perc = traits.Float( - min=0, - max=100, + threshold_perc = traits.Range( + low=0.0, + high=100.0, desc='Threshold percentage (0.1 == lower 10% of intensity range) [default: 0.1].', argstr='-threshold_perc %s') @@ -2981,9 +2977,8 @@ def _list_outputs(self): class XfmConcatInputSpec(CommandLineInputSpec): input_files = InputMultiPath( - traits.File, + traits.File(exists=True), desc='input file(s)', - exists=True, mandatory=True, sep=' ', argstr='%s', @@ -3015,7 +3010,7 @@ class XfmConcatInputSpec(CommandLineInputSpec): class XfmConcatOutputSpec(TraitedSpec): output_file = File(desc='output file', exists=True) - output_grids = OutputMultiPath(desc='output grids', exists=True) + output_grids = OutputMultiPath(File(exists=True), desc='output grids') class XfmConcat(CommandLine): @@ -3247,9 +3242,8 @@ def _list_outputs(self): class XfmAvgInputSpec(CommandLineInputSpec): input_files = InputMultiPath( - traits.File, + traits.File(exists=True), desc='input file(s)', - exists=True, mandatory=True, sep=' ', argstr='%s', @@ -3425,9 +3419,8 @@ def _list_outputs(self): class BigAverageInputSpec(CommandLineInputSpec): input_files = InputMultiPath( - traits.File, + traits.File(exists=True), desc='input file(s)', - exists=True, mandatory=True, sep=' ', argstr='%s', diff --git a/nipype/interfaces/minc/tests/test_auto_Average.py b/nipype/interfaces/minc/tests/test_auto_Average.py index 7eb22fb4b9..ffcc3d5a6b 100644 --- a/nipype/interfaces/minc/tests/test_auto_Average.py +++ b/nipype/interfaces/minc/tests/test_auto_Average.py @@ -63,7 +63,6 @@ def test_Average_inputs(): usedefault=True, ), input_files=dict(argstr='%s', - exists=True, mandatory=True, position=-2, sep=' ', diff --git a/nipype/interfaces/minc/tests/test_auto_BigAverage.py b/nipype/interfaces/minc/tests/test_auto_BigAverage.py index fb71302049..1ddb3f2e08 100644 --- a/nipype/interfaces/minc/tests/test_auto_BigAverage.py +++ b/nipype/interfaces/minc/tests/test_auto_BigAverage.py @@ -16,7 +16,6 @@ def test_BigAverage_inputs(): usedefault=True, ), input_files=dict(argstr='%s', - exists=True, mandatory=True, position=-2, sep=' ', diff --git a/nipype/interfaces/minc/tests/test_auto_Calc.py b/nipype/interfaces/minc/tests/test_auto_Calc.py index c5d39cdb38..08168c0df2 100644 --- a/nipype/interfaces/minc/tests/test_auto_Calc.py +++ b/nipype/interfaces/minc/tests/test_auto_Calc.py @@ -68,7 +68,6 @@ def test_Calc_inputs(): ignore_nan=dict(argstr='-ignore_nan', ), input_files=dict(argstr='%s', - exists=True, mandatory=True, position=-2, sep=' ', diff --git a/nipype/interfaces/minc/tests/test_auto_Math.py b/nipype/interfaces/minc/tests/test_auto_Math.py index 95e8ac30c4..52ee62b165 100644 --- a/nipype/interfaces/minc/tests/test_auto_Math.py +++ b/nipype/interfaces/minc/tests/test_auto_Math.py @@ -79,7 +79,6 @@ def test_Math_inputs(): ignore_nan=dict(argstr='-ignore_nan', ), input_files=dict(argstr='%s', - exists=True, mandatory=True, position=-2, sep=' ', diff --git a/nipype/interfaces/minc/tests/test_auto_Norm.py b/nipype/interfaces/minc/tests/test_auto_Norm.py index a7deaca0ea..d0044f6ee3 100644 --- a/nipype/interfaces/minc/tests/test_auto_Norm.py +++ b/nipype/interfaces/minc/tests/test_auto_Norm.py @@ -13,8 +13,6 @@ def test_Norm_inputs(): usedefault=True, ), cutoff=dict(argstr='-cutoff %s', - max=100, - min=0, ), environ=dict(nohash=True, usedefault=True, @@ -55,8 +53,6 @@ def test_Norm_inputs(): threshold_bmt=dict(argstr='-threshold_bmt', ), threshold_perc=dict(argstr='-threshold_perc %s', - max=100, - min=0, ), upper=dict(argstr='-upper %s', ), diff --git a/nipype/interfaces/minc/tests/test_auto_ToEcat.py b/nipype/interfaces/minc/tests/test_auto_ToEcat.py index 27349fc805..cda7a12179 100644 --- a/nipype/interfaces/minc/tests/test_auto_ToEcat.py +++ b/nipype/interfaces/minc/tests/test_auto_ToEcat.py @@ -34,7 +34,6 @@ def test_ToEcat_inputs(): genfile=True, hash_files=False, keep_extension=False, - mandatory=False, name_source=['input_file'], name_template='%s_to_ecat.v', position=-1, diff --git a/nipype/interfaces/minc/tests/test_auto_XfmAvg.py b/nipype/interfaces/minc/tests/test_auto_XfmAvg.py index 1721e861fc..66e70f0a0c 100644 --- a/nipype/interfaces/minc/tests/test_auto_XfmAvg.py +++ b/nipype/interfaces/minc/tests/test_auto_XfmAvg.py @@ -24,7 +24,6 @@ def test_XfmAvg_inputs(): ignore_nonlinear=dict(argstr='-ignore_nonline', ), input_files=dict(argstr='%s', - exists=True, mandatory=True, position=-2, sep=' ', diff --git a/nipype/interfaces/minc/tests/test_auto_XfmConcat.py b/nipype/interfaces/minc/tests/test_auto_XfmConcat.py index 5ae6b6bef1..af46985fd3 100644 --- a/nipype/interfaces/minc/tests/test_auto_XfmConcat.py +++ b/nipype/interfaces/minc/tests/test_auto_XfmConcat.py @@ -16,7 +16,6 @@ def test_XfmConcat_inputs(): usedefault=True, ), input_files=dict(argstr='%s', - exists=True, mandatory=True, position=-2, sep=' ', @@ -43,8 +42,7 @@ def test_XfmConcat_inputs(): def test_XfmConcat_outputs(): output_map = dict(output_file=dict(), - output_grids=dict(exists=True, - ), + output_grids=dict(), ) outputs = XfmConcat.output_spec() diff --git a/nipype/interfaces/tests/test_auto_DataSink.py b/nipype/interfaces/tests/test_auto_DataSink.py index 38cb7c1915..c84e98f17b 100644 --- a/nipype/interfaces/tests/test_auto_DataSink.py +++ b/nipype/interfaces/tests/test_auto_DataSink.py @@ -7,9 +7,7 @@ def test_DataSink_inputs(): input_map = dict(_outputs=dict(usedefault=True, ), base_directory=dict(), - bucket=dict(mandatory=False, - trait_value=True, - ), + bucket=dict(), container=dict(), creds_path=dict(), encrypt_bucket_keys=dict(), From 6bbc559aeb1e6ad1fa8703a053ead1ec482117f9 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Wed, 20 Apr 2016 19:16:53 -0400 Subject: [PATCH 3/5] fix: deprecated interfaces --- nipype/interfaces/fsl/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nipype/interfaces/fsl/__init__.py b/nipype/interfaces/fsl/__init__.py index 4f6b5c38fc..b2f524b3be 100644 --- a/nipype/interfaces/fsl/__init__.py +++ b/nipype/interfaces/fsl/__init__.py @@ -25,8 +25,7 @@ from .dti import (BEDPOSTX, XFibres, DTIFit, ProbTrackX, ProbTrackX2, VecReg, ProjThresh, FindTheBiggest, DistanceMap, - TractSkeleton, MakeDyadicVectors, BEDPOSTX5, XFibres5, - BEDPOSTX4, XFibres4) + TractSkeleton, MakeDyadicVectors, BEDPOSTX5, XFibres5) from .maths import (ChangeDataType, Threshold, MeanImage, ApplyMask, IsotropicSmooth, TemporalFilter, DilateImage, ErodeImage, SpatialFilter, UnaryMaths, BinaryMaths, MultiImageMaths) From 6d80ea6c3c98545eb3c951d52129df9bb6a5c8b6 Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Wed, 20 Apr 2016 21:42:53 -0400 Subject: [PATCH 4/5] fix: missing dummy test file --- nipype/testing/data/input1.xfm | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 nipype/testing/data/input1.xfm diff --git a/nipype/testing/data/input1.xfm b/nipype/testing/data/input1.xfm new file mode 100644 index 0000000000..e69de29bb2 From dbc1afe9393e2a893c4b49a64968b4c90183c74e Mon Sep 17 00:00:00 2001 From: Satrajit Ghosh Date: Wed, 20 Apr 2016 21:43:22 -0400 Subject: [PATCH 5/5] rel: update to release candidate 1 --- CHANGES | 2 +- nipype/info.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 5c927ac77c..1de391fd9f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,4 @@ -Next release +Release 0.12.0-rc1 (April 20, 2016) ============ * ENH: Add nipype_crash_search command (https://github.com/nipy/nipype/pull/1422) diff --git a/nipype/info.py b/nipype/info.py index aa9db1a4b6..08aba268a2 100644 --- a/nipype/info.py +++ b/nipype/info.py @@ -10,7 +10,7 @@ _version_major = 0 _version_minor = 12 _version_micro = 0 -_version_extra = '-dev' # Remove -dev for release +_version_extra = '-rc1' # Remove -dev for release def get_nipype_gitversion():