diff --git a/nipype/algorithms/confounds.py b/nipype/algorithms/confounds.py index bc1028beb2..a660a0fbae 100644 --- a/nipype/algorithms/confounds.py +++ b/nipype/algorithms/confounds.py @@ -390,13 +390,12 @@ class CompCorInputSpec(BaseInterfaceInputSpec): desc='Detrend time series prior to component ' 'extraction') use_regress_poly = traits.Bool( - True, deprecated='0.15.0', new_name='pre_filter', desc=('use polynomial regression ' 'pre-component extraction')) regress_poly_degree = traits.Range( - low=1, default=1, usedefault=True, desc='the degree polynomial to use') + low=1, value=1, usedefault=True, desc='the degree polynomial to use') header_prefix = traits.Str( desc=('the desired header for the output tsv ' 'file (one column). If undefined, will ' diff --git a/nipype/algorithms/mesh.py b/nipype/algorithms/mesh.py index a0830935fe..ba1be626b7 100644 --- a/nipype/algorithms/mesh.py +++ b/nipype/algorithms/mesh.py @@ -289,6 +289,7 @@ class MeshWarpMathsInputSpec(BaseInterfaceInputSpec): float_trait, File(exists=True), default=1.0, + usedefault=True, mandatory=True, desc='image, float or tuple of floats to act as operator') diff --git a/nipype/algorithms/rapidart.py b/nipype/algorithms/rapidart.py index c68276b828..8df51c0a9e 100644 --- a/nipype/algorithms/rapidart.py +++ b/nipype/algorithms/rapidart.py @@ -234,8 +234,9 @@ class ArtifactDetectInputSpec(BaseInterfaceInputSpec): desc=("Mask threshold to be used if mask_type" " is 'thresh'.")) intersect_mask = traits.Bool( - True, desc=("Intersect the masks when computed from " - "spm_global.")) + True, usedefault=True, + desc=("Intersect the masks when computed from " + "spm_global.")) save_plot = traits.Bool( True, desc="save plots containing outliers", usedefault=True) plot_type = traits.Enum( diff --git a/nipype/algorithms/tests/test_auto_ArtifactDetect.py b/nipype/algorithms/tests/test_auto_ArtifactDetect.py index 1de952cf78..2ab28f60f3 100644 --- a/nipype/algorithms/tests/test_auto_ArtifactDetect.py +++ b/nipype/algorithms/tests/test_auto_ArtifactDetect.py @@ -12,7 +12,7 @@ def test_ArtifactDetect_inputs(): nohash=True, usedefault=True, ), - intersect_mask=dict(), + intersect_mask=dict(usedefault=True, ), mask_file=dict(), mask_threshold=dict(), mask_type=dict(mandatory=True, ), diff --git a/nipype/algorithms/tests/test_auto_MeshWarpMaths.py b/nipype/algorithms/tests/test_auto_MeshWarpMaths.py index 99b6bb7391..5c9c04a3c5 100644 --- a/nipype/algorithms/tests/test_auto_MeshWarpMaths.py +++ b/nipype/algorithms/tests/test_auto_MeshWarpMaths.py @@ -13,7 +13,10 @@ def test_MeshWarpMaths_inputs(): ), in_surf=dict(mandatory=True, ), operation=dict(usedefault=True, ), - operator=dict(mandatory=True, ), + operator=dict( + mandatory=True, + usedefault=True, + ), out_file=dict(usedefault=True, ), out_warp=dict(usedefault=True, ), ) diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index 595605e38b..ac1fdec14b 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -1612,6 +1612,7 @@ class OutlierCountInputSpec(CommandLineInputSpec): value=1e-3, low=0.0, high=1.0, + usedefault=True, argstr='-qthr %.5f', desc='indicate a value for q to compute alpha') autoclip = traits.Bool( @@ -1681,7 +1682,7 @@ class OutlierCount(CommandLine): >>> toutcount = afni.OutlierCount() >>> toutcount.inputs.in_file = 'functional.nii' >>> toutcount.cmdline # doctest: +ELLIPSIS - '3dToutcount functional.nii' + '3dToutcount -qthr 0.00100 functional.nii' >>> res = toutcount.run() # doctest: +SKIP """ diff --git a/nipype/interfaces/afni/tests/test_auto_Cat.py b/nipype/interfaces/afni/tests/test_auto_Cat.py index d42d87cc67..2dee8aefa1 100644 --- a/nipype/interfaces/afni/tests/test_auto_Cat.py +++ b/nipype/interfaces/afni/tests/test_auto_Cat.py @@ -38,6 +38,7 @@ def test_Cat_inputs(): argstr='> %s', mandatory=True, position=-1, + usedefault=True, ), out_fint=dict( argstr='-f', diff --git a/nipype/interfaces/afni/tests/test_auto_NwarpApply.py b/nipype/interfaces/afni/tests/test_auto_NwarpApply.py index 68ec40b6f0..53aa3c3602 100644 --- a/nipype/interfaces/afni/tests/test_auto_NwarpApply.py +++ b/nipype/interfaces/afni/tests/test_auto_NwarpApply.py @@ -20,7 +20,10 @@ def test_NwarpApply_inputs(): argstr='-source %s', mandatory=True, ), - interp=dict(argstr='-interp %s', ), + interp=dict( + argstr='-interp %s', + usedefault=True, + ), inv_warp=dict(argstr='-iwarp', ), master=dict(argstr='-master %s', ), out_file=dict( diff --git a/nipype/interfaces/afni/tests/test_auto_NwarpCat.py b/nipype/interfaces/afni/tests/test_auto_NwarpCat.py index 065e2b8b61..c904c13246 100644 --- a/nipype/interfaces/afni/tests/test_auto_NwarpCat.py +++ b/nipype/interfaces/afni/tests/test_auto_NwarpCat.py @@ -21,7 +21,10 @@ def test_NwarpCat_inputs(): mandatory=True, position=-1, ), - interp=dict(argstr='-interp %s', ), + interp=dict( + argstr='-interp %s', + usedefault=True, + ), inv_warp=dict(argstr='-iwarp', ), num_threads=dict( nohash=True, diff --git a/nipype/interfaces/afni/tests/test_auto_OneDToolPy.py b/nipype/interfaces/afni/tests/test_auto_OneDToolPy.py index 1404e58eca..ec105a96ec 100644 --- a/nipype/interfaces/afni/tests/test_auto_OneDToolPy.py +++ b/nipype/interfaces/afni/tests/test_auto_OneDToolPy.py @@ -34,7 +34,6 @@ def test_OneDToolPy_inputs(): show_cormat_warnings=dict( argstr='-show_cormat_warnings |& tee %s', position=-1, - usedefault=False, xor=['out_file'], ), show_indices_interest=dict(argstr='-show_indices_interest', ), diff --git a/nipype/interfaces/afni/tests/test_auto_OutlierCount.py b/nipype/interfaces/afni/tests/test_auto_OutlierCount.py index 3fd22356ed..ce55e7a1ed 100644 --- a/nipype/interfaces/afni/tests/test_auto_OutlierCount.py +++ b/nipype/interfaces/afni/tests/test_auto_OutlierCount.py @@ -59,7 +59,10 @@ def test_OutlierCount_inputs(): output_name='out_outliers', ), polort=dict(argstr='-polort %d', ), - qthr=dict(argstr='-qthr %.5f', ), + qthr=dict( + argstr='-qthr %.5f', + usedefault=True, + ), save_outliers=dict(usedefault=True, ), terminal_output=dict( deprecated='1.0.0', diff --git a/nipype/interfaces/afni/utils.py b/nipype/interfaces/afni/utils.py index cb01ae4a2b..1f33e4de3a 100644 --- a/nipype/interfaces/afni/utils.py +++ b/nipype/interfaces/afni/utils.py @@ -479,7 +479,8 @@ class CatInputSpec(AFNICommandInputSpec): File(exists=True), argstr="%s", mandatory=True, position=-2) out_file = File( argstr='> %s', - default='catout.1d', + value='catout.1d', + usedefault=True, desc='output (concatenated) file name', position=-1, mandatory=True) @@ -1610,6 +1611,7 @@ class NwarpApplyInputSpec(CommandLineInputSpec): desc='the name of the master dataset, which defines the output grid', argstr='-master %s') interp = traits.Enum( + 'wsinc5', 'NN', 'nearestneighbour', 'nearestneighbor', @@ -1619,10 +1621,9 @@ class NwarpApplyInputSpec(CommandLineInputSpec): 'tricubic', 'quintic', 'triquintic', - 'wsinc5', desc='defines interpolation method to use during warp', argstr='-interp %s', - default='wsinc5') + usedefault=True) ainterp = traits.Enum( 'NN', 'nearestneighbour', @@ -1636,8 +1637,7 @@ class NwarpApplyInputSpec(CommandLineInputSpec): 'wsinc5', desc='specify a different interpolation method than might ' 'be used for the warp', - argstr='-ainterp %s', - default='wsinc5') + argstr='-ainterp %s') out_file = File( name_template='%s_Nwarp', desc='output image file name', @@ -1670,7 +1670,7 @@ class NwarpApply(AFNICommandBase): >>> nwarp.inputs.master = 'NWARP' >>> nwarp.inputs.warp = "'Fred_WARP+tlrc Fred.Xaff12.1D'" >>> nwarp.cmdline - "3dNwarpApply -source Fred+orig -master NWARP -prefix Fred+orig_Nwarp -nwarp \'Fred_WARP+tlrc Fred.Xaff12.1D\'" + "3dNwarpApply -source Fred+orig -interp wsinc5 -master NWARP -prefix Fred+orig_Nwarp -nwarp \'Fred_WARP+tlrc Fred.Xaff12.1D\'" >>> res = nwarp.run() # doctest: +SKIP """ @@ -1696,13 +1696,13 @@ class NwarpCatInputSpec(AFNICommandInputSpec): inv_warp = traits.Bool( desc='invert the final warp before output', argstr='-iwarp') interp = traits.Enum( + 'wsinc5', 'linear', 'quintic', - 'wsinc5', desc='specify a different interpolation method than might ' 'be used for the warp', argstr='-interp %s', - default='wsinc5') + usedefault=True) expad = traits.Int( desc='Pad the nonlinear warps by the given number of voxels voxels in ' 'all directions. The warp displacements are extended by linear ' @@ -1764,7 +1764,7 @@ class NwarpCat(AFNICommand): >>> nwarpcat.inputs.in_files = ['Q25_warp+tlrc.HEAD', ('IDENT', 'structural.nii')] >>> nwarpcat.inputs.out_file = 'Fred_total_WARP' >>> nwarpcat.cmdline - "3dNwarpCat -prefix Fred_total_WARP Q25_warp+tlrc.HEAD 'IDENT(structural.nii)'" + "3dNwarpCat -interp wsinc5 -prefix Fred_total_WARP Q25_warp+tlrc.HEAD 'IDENT(structural.nii)'" >>> res = nwarpcat.run() # doctest: +SKIP """ @@ -1841,8 +1841,6 @@ class OneDToolPyInputSpec(AFNIPythonCommandInputSpec): show_cormat_warnings = traits.File( desc='Write cormat warnings to a file', argstr="-show_cormat_warnings |& tee %s", - default="out.cormat_warn.txt", - usedefault=False, position=-1, xor=['out_file']) show_indices_interest = traits.Bool( diff --git a/nipype/interfaces/ants/registration.py b/nipype/interfaces/ants/registration.py index 5efdae17f2..6b1e20811c 100644 --- a/nipype/interfaces/ants/registration.py +++ b/nipype/interfaces/ants/registration.py @@ -17,7 +17,6 @@ class ANTSInputSpec(ANTSCommandInputSpec): 3, 2, argstr='%d', - usedefault=False, position=1, desc='image dimension (2 or 3)') fixed_image = InputMultiPath( @@ -98,7 +97,7 @@ class ANTSInputSpec(ANTSCommandInputSpec): symmetry_type = traits.Float(requires=['delta_time'], desc='') use_histogram_matching = traits.Bool( - argstr='%s', default=True, usedefault=True) + argstr='%s', default_value=True, usedefault=True) number_of_iterations = traits.List( traits.Int(), argstr='--number-of-iterations %s', sep='x') smoothing_sigmas = traits.List( @@ -324,7 +323,6 @@ class RegistrationInputSpec(ANTSCommandInputSpec): 1, 2, argstr='%s', - default=0, xor=['initial_moving_transform'], desc="Align the moving_image nad fixed_image befor registration using" "the geometric center of the images (=0), the image intensities (=1)," @@ -339,7 +337,7 @@ class RegistrationInputSpec(ANTSCommandInputSpec): desc='the metric(s) to use for each stage. ' 'Note that multiple metrics per stage are not supported ' 'in ANTS 1.9.1 and earlier.') - metric_weight_item_trait = traits.Float(1.0) + metric_weight_item_trait = traits.Float(1.0, usedefault=True) metric_weight_stage_trait = traits.Either( metric_weight_item_trait, traits.List(metric_weight_item_trait)) metric_weight = traits.List( @@ -350,7 +348,7 @@ class RegistrationInputSpec(ANTSCommandInputSpec): mandatory=True, desc='the metric weight(s) for each stage. ' 'The weights must sum to 1 per stage.') - radius_bins_item_trait = traits.Int(5) + radius_bins_item_trait = traits.Int(5, usedefault=True) radius_bins_stage_trait = traits.Either( radius_bins_item_trait, traits.List(radius_bins_item_trait)) radius_or_number_of_bins = traits.List( @@ -405,12 +403,12 @@ class RegistrationInputSpec(ANTSCommandInputSpec): write_composite_transform = traits.Bool( argstr='--write-composite-transform %d', - default=False, + default_value=False, usedefault=True, desc='') collapse_output_transforms = traits.Bool( argstr='--collapse-output-transforms %d', - default=True, + default_value=True, usedefault=True, # This should be true for explicit completeness desc=('Collapse output transforms. Specifically, enabling this option ' 'combines all adjacent linear transforms and composes all ' @@ -418,7 +416,7 @@ class RegistrationInputSpec(ANTSCommandInputSpec): 'results to disk.')) initialize_transforms_per_stage = traits.Bool( argstr='--initialize-transforms-per-stage %d', - default=False, + default_value=False, usedefault=True, # This should be true for explicit completeness desc= ('Initialize linear transforms from the previous stage. By enabling this option, ' @@ -430,7 +428,7 @@ class RegistrationInputSpec(ANTSCommandInputSpec): # values instead of booleans float = traits.Bool( argstr='--float %d', - default=False, + default_value=False, desc='Use float instead of double for computations.') transforms = traits.List( @@ -532,7 +530,7 @@ class RegistrationInputSpec(ANTSCommandInputSpec): usedefault=True, desc="The Lower quantile to clip image ranges") - verbose = traits.Bool(argstr='-v', default=False) + verbose = traits.Bool(argstr='-v', default_value=False, usedefault=True) class RegistrationOutputSpec(TraitedSpec): @@ -1386,7 +1384,7 @@ class MeasureImageSimilarityInputSpec(ANTSCommandInputSpec): ) metric_weight = traits.Float( requires=['metric'], - default=1.0, + default_value=1.0, usedefault=True, desc='The "metricWeight" variable is not used.', ) @@ -1401,7 +1399,6 @@ class MeasureImageSimilarityInputSpec(ANTSCommandInputSpec): "Regular", "Random", requires=['metric'], - default="None", usedefault=True, desc='Manner of choosing point set over which to optimize the metric. ' 'Defaults to "None" (i.e. a dense sampling of one sample per voxel).') @@ -1523,10 +1520,10 @@ class RegistrationSynQuickInputSpec(ANTSCommandInputSpec): use_histogram_matching = traits.Bool(False, argstr='-j %d', desc='use histogram matching') - histogram_bins = traits.Int(default_value=32, argstr='-r %d', + histogram_bins = traits.Int(default_value=32, usedefault=True, argstr='-r %d', desc='histogram bins for mutual information in SyN stage \ (default = 32)') - spline_distance = traits.Int(default_value=26, argstr='-s %d', + spline_distance = traits.Int(default_value=26, usedefault=True, argstr='-s %d', desc='spline distance for deformable B-spline SyN transform \ (default = 26)') precision_type = traits.Enum('double', 'float', argstr='-p %s', @@ -1556,7 +1553,7 @@ class RegistrationSynQuick(ANTSCommand): >>> reg.inputs.moving_image = 'moving1.nii' >>> reg.inputs.num_threads = 2 >>> reg.cmdline - 'antsRegistrationSyNQuick.sh -d 3 -f fixed1.nii -m moving1.nii -n 2 -o transform -p d -t s' + 'antsRegistrationSyNQuick.sh -d 3 -f fixed1.nii -r 32 -m moving1.nii -n 2 -o transform -p d -s 26 -t s' >>> reg.run() # doctest: +SKIP example for multiple images @@ -1567,7 +1564,8 @@ class RegistrationSynQuick(ANTSCommand): >>> reg.inputs.moving_image = ['moving1.nii', 'moving2.nii'] >>> reg.inputs.num_threads = 2 >>> reg.cmdline - 'antsRegistrationSyNQuick.sh -d 3 -f fixed1.nii -f fixed2.nii -m moving1.nii -m moving2.nii -n 2 -o transform -p d -t s' + 'antsRegistrationSyNQuick.sh -d 3 -f fixed1.nii -f fixed2.nii -r 32 -m moving1.nii -m moving2.nii \ +-n 2 -o transform -p d -s 26 -t s' >>> reg.run() # doctest: +SKIP """ diff --git a/nipype/interfaces/ants/resampling.py b/nipype/interfaces/ants/resampling.py index addbb7232e..fe730aef78 100644 --- a/nipype/interfaces/ants/resampling.py +++ b/nipype/interfaces/ants/resampling.py @@ -359,7 +359,8 @@ class ApplyTransformsInputSpec(ANTSCommandInputSpec): desc='output a composite warp file instead of a transformed image') float = traits.Bool( argstr='--float %d', - default=False, + default_value=False, + usedefault=True, desc='Use float instead of double for computations.') @@ -380,7 +381,7 @@ class ApplyTransforms(ANTSCommand): >>> at.inputs.reference_image = 'fixed1.nii' >>> at.inputs.transforms = 'identity' >>> at.cmdline - 'antsApplyTransforms --default-value 0 --input moving1.nii \ + 'antsApplyTransforms --default-value 0 --float 0 --input moving1.nii \ --interpolation Linear --output moving1_trans.nii \ --reference-image fixed1.nii -t identity' @@ -394,9 +395,9 @@ class ApplyTransforms(ANTSCommand): >>> at.inputs.transforms = ['ants_Warp.nii.gz', 'trans.mat'] >>> at.inputs.invert_transform_flags = [False, False] >>> at.cmdline - 'antsApplyTransforms --default-value 0 --dimensionality 3 --input moving1.nii --interpolation Linear \ ---output deformed_moving1.nii --reference-image fixed1.nii --transform [ ants_Warp.nii.gz, 0 ] \ ---transform [ trans.mat, 0 ]' + 'antsApplyTransforms --default-value 0 --dimensionality 3 --float 0 --input moving1.nii \ +--interpolation Linear --output deformed_moving1.nii --reference-image fixed1.nii \ +--transform [ ants_Warp.nii.gz, 0 ] --transform [ trans.mat, 0 ]' >>> at1 = ApplyTransforms() >>> at1.inputs.dimension = 3 @@ -409,9 +410,9 @@ class ApplyTransforms(ANTSCommand): >>> at1.inputs.transforms = ['ants_Warp.nii.gz', 'trans.mat'] >>> at1.inputs.invert_transform_flags = [False, False] >>> at1.cmdline - 'antsApplyTransforms --default-value 0 --dimensionality 3 --input moving1.nii --interpolation BSpline[ 5 ] \ ---output deformed_moving1.nii --reference-image fixed1.nii --transform [ ants_Warp.nii.gz, 0 ] \ ---transform [ trans.mat, 0 ]' + 'antsApplyTransforms --default-value 0 --dimensionality 3 --float 0 --input moving1.nii \ +--interpolation BSpline[ 5 ] --output deformed_moving1.nii --reference-image fixed1.nii \ +--transform [ ants_Warp.nii.gz, 0 ] --transform [ trans.mat, 0 ]' """ _cmd = 'antsApplyTransforms' input_spec = ApplyTransformsInputSpec diff --git a/nipype/interfaces/ants/segmentation.py b/nipype/interfaces/ants/segmentation.py index 7d798f9c2d..f6a3f5da97 100644 --- a/nipype/interfaces/ants/segmentation.py +++ b/nipype/interfaces/ants/segmentation.py @@ -1063,7 +1063,6 @@ class DenoiseImageInputSpec(ANTSCommandInputSpec): 3, 4, argstr='-d %d', - usedefault=False, desc='This option forces the image to be treated ' 'as a specified-dimensional image. If not ' 'specified, the program tries to infer the ' @@ -1163,7 +1162,6 @@ class AntsJointFusionInputSpec(ANTSCommandInputSpec): 2, 4, argstr='-d %d', - usedefault=False, desc='This option forces the image to be treated ' 'as a specified-dimensional image. If not ' 'specified, the program tries to infer the ' @@ -1231,7 +1229,6 @@ class AntsJointFusionInputSpec(ANTSCommandInputSpec): 'PC', 'MSQ', argstr='-m %s', - usedefault=False, desc=('Metric to be used in determining the most similar ' 'neighborhood patch. Options include Pearson\'s ' 'correlation (PC) and mean squares (MSQ). Default = ' @@ -1261,10 +1258,10 @@ class AntsJointFusionInputSpec(ANTSCommandInputSpec): out_label_fusion = File( argstr="%s", hash_files=False, desc='The output label fusion image.') out_intensity_fusion_name_format = traits.Str( - 'antsJointFusionIntensity_%d.nii.gz', argstr="", desc='Optional intensity fusion ' - 'image file name format.') + 'image file name format. ' + '(e.g. "antsJointFusionIntensity_%d.nii.gz")') out_label_post_prob_name_format = traits.Str( 'antsJointFusionPosterior_%d.nii.gz', requires=['out_label_fusion', 'out_intensity_fusion_name_format'], @@ -1511,12 +1508,12 @@ class KellyKapowskiInputSpec(ANTSCommandInputSpec): desc="Gradient step size for the optimization.") smoothing_variance = traits.Float( - 1.0, + 1.0, usedefault=True, argstr="--smoothing-variance %f", desc="Defines the Gaussian smoothing of the hit and total images.") smoothing_velocity_field = traits.Float( - 1.5, + 1.5, usedefault=True, argstr="--smoothing-velocity-field-parameter %f", desc= "Defines the Gaussian smoothing of the velocity field (default = 1.5).\n" @@ -1528,12 +1525,12 @@ class KellyKapowskiInputSpec(ANTSCommandInputSpec): desc="Sets the option for B-spline smoothing of the velocity field.") number_integration_points = traits.Int( - 10, + 10, usedefault=True, argstr="--number-of-integration-points %d", desc="Number of compositions of the diffeomorphism per iteration.") max_invert_displacement_field_iters = traits.Int( - 20, + 20, usedefault=True, argstr="--maximum-number-of-invert-displacement-field-iterations %d", desc="Maximum number of iterations for estimating the invert \n" "displacement field.") @@ -1574,16 +1571,12 @@ class KellyKapowski(ANTSCommand): >>> kk.inputs.dimension = 3 >>> kk.inputs.segmentation_image = "segmentation0.nii.gz" >>> kk.inputs.convergence = "[45,0.0,10]" - >>> kk.inputs.gradient_step = 0.025 - >>> kk.inputs.smoothing_variance = 1.0 - >>> kk.inputs.smoothing_velocity_field = 1.5 - >>> #kk.inputs.use_bspline_smoothing = False - >>> kk.inputs.number_integration_points = 10 >>> kk.inputs.thickness_prior_estimate = 10 >>> kk.cmdline 'KellyKapowski --convergence "[45,0.0,10]" \ --output "[segmentation0_cortical_thickness.nii.gz,segmentation0_warped_white_matter.nii.gz]" \ ---image-dimensionality 3 --gradient-step 0.025000 --number-of-integration-points 10 \ +--image-dimensionality 3 --gradient-step 0.025000 \ +--maximum-number-of-invert-displacement-field-iterations 20 --number-of-integration-points 10 \ --segmentation-image "[segmentation0.nii.gz,2,3]" --smoothing-variance 1.000000 \ --smoothing-velocity-field-parameter 1.500000 --thickness-prior-estimate 10.000000' diff --git a/nipype/interfaces/ants/tests/test_auto_ANTS.py b/nipype/interfaces/ants/tests/test_auto_ANTS.py index b066461ba5..e19c43b4e7 100644 --- a/nipype/interfaces/ants/tests/test_auto_ANTS.py +++ b/nipype/interfaces/ants/tests/test_auto_ANTS.py @@ -11,7 +11,6 @@ def test_ANTS_inputs(): dimension=dict( argstr='%d', position=1, - usedefault=False, ), environ=dict( nohash=True, diff --git a/nipype/interfaces/ants/tests/test_auto_AntsJointFusion.py b/nipype/interfaces/ants/tests/test_auto_AntsJointFusion.py index 2302344e7b..fe84354739 100644 --- a/nipype/interfaces/ants/tests/test_auto_AntsJointFusion.py +++ b/nipype/interfaces/ants/tests/test_auto_AntsJointFusion.py @@ -26,10 +26,7 @@ def test_AntsJointFusion_inputs(): argstr='-c', usedefault=True, ), - dimension=dict( - argstr='-d %d', - usedefault=False, - ), + dimension=dict(argstr='-d %d', ), environ=dict( nohash=True, usedefault=True, @@ -62,10 +59,7 @@ def test_AntsJointFusion_inputs(): out_label_post_prob_name_format=dict( requires=['out_label_fusion', 'out_intensity_fusion_name_format'], ), - patch_metric=dict( - argstr='-m %s', - usedefault=False, - ), + patch_metric=dict(argstr='-m %s', ), patch_radius=dict( argstr='-p %s', maxlen=3, diff --git a/nipype/interfaces/ants/tests/test_auto_ApplyTransforms.py b/nipype/interfaces/ants/tests/test_auto_ApplyTransforms.py index 32d04bace8..c00c068649 100644 --- a/nipype/interfaces/ants/tests/test_auto_ApplyTransforms.py +++ b/nipype/interfaces/ants/tests/test_auto_ApplyTransforms.py @@ -15,7 +15,10 @@ def test_ApplyTransforms_inputs(): nohash=True, usedefault=True, ), - float=dict(argstr='--float %d', ), + float=dict( + argstr='--float %d', + usedefault=True, + ), ignore_exception=dict( deprecated='1.0.0', nohash=True, diff --git a/nipype/interfaces/ants/tests/test_auto_AverageAffineTransform.py b/nipype/interfaces/ants/tests/test_auto_AverageAffineTransform.py index e322852428..80bb7a0804 100644 --- a/nipype/interfaces/ants/tests/test_auto_AverageAffineTransform.py +++ b/nipype/interfaces/ants/tests/test_auto_AverageAffineTransform.py @@ -10,7 +10,6 @@ def test_AverageAffineTransform_inputs(): argstr='%d', mandatory=True, position=0, - usedefault=False, ), environ=dict( nohash=True, diff --git a/nipype/interfaces/ants/tests/test_auto_CreateJacobianDeterminantImage.py b/nipype/interfaces/ants/tests/test_auto_CreateJacobianDeterminantImage.py index b789de0633..c8acb58593 100644 --- a/nipype/interfaces/ants/tests/test_auto_CreateJacobianDeterminantImage.py +++ b/nipype/interfaces/ants/tests/test_auto_CreateJacobianDeterminantImage.py @@ -28,7 +28,6 @@ def test_CreateJacobianDeterminantImage_inputs(): argstr='%d', mandatory=True, position=0, - usedefault=False, ), num_threads=dict( nohash=True, diff --git a/nipype/interfaces/ants/tests/test_auto_DenoiseImage.py b/nipype/interfaces/ants/tests/test_auto_DenoiseImage.py index 5bbf4f2d51..8a69113eff 100644 --- a/nipype/interfaces/ants/tests/test_auto_DenoiseImage.py +++ b/nipype/interfaces/ants/tests/test_auto_DenoiseImage.py @@ -6,10 +6,7 @@ def test_DenoiseImage_inputs(): input_map = dict( args=dict(argstr='%s', ), - dimension=dict( - argstr='-d %d', - usedefault=False, - ), + dimension=dict(argstr='-d %d', ), environ=dict( nohash=True, usedefault=True, diff --git a/nipype/interfaces/ants/tests/test_auto_KellyKapowski.py b/nipype/interfaces/ants/tests/test_auto_KellyKapowski.py index ec61845fe5..1bff8a1aa3 100644 --- a/nipype/interfaces/ants/tests/test_auto_KellyKapowski.py +++ b/nipype/interfaces/ants/tests/test_auto_KellyKapowski.py @@ -39,20 +39,29 @@ def test_KellyKapowski_inputs(): ), max_invert_displacement_field_iters=dict( argstr= - '--maximum-number-of-invert-displacement-field-iterations %d', ), + '--maximum-number-of-invert-displacement-field-iterations %d', + usedefault=True, + ), num_threads=dict( nohash=True, usedefault=True, ), number_integration_points=dict( - argstr='--number-of-integration-points %d', ), + argstr='--number-of-integration-points %d', + usedefault=True, + ), segmentation_image=dict( argstr='--segmentation-image "%s"', mandatory=True, ), - smoothing_variance=dict(argstr='--smoothing-variance %f', ), + smoothing_variance=dict( + argstr='--smoothing-variance %f', + usedefault=True, + ), smoothing_velocity_field=dict( - argstr='--smoothing-velocity-field-parameter %f', ), + argstr='--smoothing-velocity-field-parameter %f', + usedefault=True, + ), terminal_output=dict( deprecated='1.0.0', nohash=True, diff --git a/nipype/interfaces/ants/tests/test_auto_MultiplyImages.py b/nipype/interfaces/ants/tests/test_auto_MultiplyImages.py index 5ed884cf0a..08488ce72b 100644 --- a/nipype/interfaces/ants/tests/test_auto_MultiplyImages.py +++ b/nipype/interfaces/ants/tests/test_auto_MultiplyImages.py @@ -10,7 +10,6 @@ def test_MultiplyImages_inputs(): argstr='%d', mandatory=True, position=0, - usedefault=False, ), environ=dict( nohash=True, diff --git a/nipype/interfaces/ants/tests/test_auto_Registration.py b/nipype/interfaces/ants/tests/test_auto_Registration.py index 4d41498314..d3129bb559 100644 --- a/nipype/interfaces/ants/tests/test_auto_Registration.py +++ b/nipype/interfaces/ants/tests/test_auto_Registration.py @@ -71,7 +71,7 @@ def test_Registration_inputs(): requires=['metric'], usedefault=True, ), - metric_weight_item_trait=dict(), + metric_weight_item_trait=dict(usedefault=True, ), metric_weight_stage_trait=dict(), moving_image=dict(mandatory=True, ), moving_image_mask=dict( @@ -97,7 +97,7 @@ def test_Registration_inputs(): usedefault=True, ), output_warped_image=dict(hash_files=False, ), - radius_bins_item_trait=dict(), + radius_bins_item_trait=dict(usedefault=True, ), radius_bins_stage_trait=dict(), radius_or_number_of_bins=dict( requires=['metric_weight'], @@ -126,7 +126,10 @@ def test_Registration_inputs(): ), use_estimate_learning_rate_once=dict(), use_histogram_matching=dict(usedefault=True, ), - verbose=dict(argstr='-v', ), + verbose=dict( + argstr='-v', + usedefault=True, + ), winsorize_lower_quantile=dict( argstr='%s', usedefault=True, diff --git a/nipype/interfaces/ants/tests/test_auto_RegistrationSynQuick.py b/nipype/interfaces/ants/tests/test_auto_RegistrationSynQuick.py index d481b810d5..dadf894e49 100644 --- a/nipype/interfaces/ants/tests/test_auto_RegistrationSynQuick.py +++ b/nipype/interfaces/ants/tests/test_auto_RegistrationSynQuick.py @@ -18,7 +18,10 @@ def test_RegistrationSynQuick_inputs(): argstr='-f %s...', mandatory=True, ), - histogram_bins=dict(argstr='-r %d', ), + histogram_bins=dict( + argstr='-r %d', + usedefault=True, + ), ignore_exception=dict( deprecated='1.0.0', nohash=True, @@ -40,7 +43,10 @@ def test_RegistrationSynQuick_inputs(): argstr='-p %s', usedefault=True, ), - spline_distance=dict(argstr='-s %d', ), + spline_distance=dict( + argstr='-s %d', + usedefault=True, + ), terminal_output=dict( deprecated='1.0.0', nohash=True, diff --git a/nipype/interfaces/ants/utils.py b/nipype/interfaces/ants/utils.py index 1813951175..932d852133 100644 --- a/nipype/interfaces/ants/utils.py +++ b/nipype/interfaces/ants/utils.py @@ -15,7 +15,6 @@ class AverageAffineTransformInputSpec(ANTSCommandInputSpec): 3, 2, argstr='%d', - usedefault=False, mandatory=True, position=0, desc='image dimension (2 or 3)') @@ -129,7 +128,6 @@ class MultiplyImagesInputSpec(ANTSCommandInputSpec): 3, 2, argstr='%d', - usedefault=False, mandatory=True, position=0, desc='image dimension (2 or 3)') @@ -185,7 +183,6 @@ class CreateJacobianDeterminantImageInputSpec(ANTSCommandInputSpec): 3, 2, argstr='%d', - usedefault=False, mandatory=True, position=0, desc='image dimension (2 or 3)') diff --git a/nipype/interfaces/base/tests/test_core.py b/nipype/interfaces/base/tests/test_core.py index 5d9bdbfa04..fe1b3a227e 100644 --- a/nipype/interfaces/base/tests/test_core.py +++ b/nipype/interfaces/base/tests/test_core.py @@ -174,7 +174,7 @@ def __init__(self, **inputs): assert {} == check_dict(data_dict, tsthash2.inputs.get_traitsfree()) _, hashvalue = tsthash.inputs.get_hashval(hash_method='timestamp') - assert 'ec5755e07287e04a4b409e03b77a517c' == hashvalue + assert '8562a5623562a871115eb14822ee8d02' == hashvalue class MinVerInputSpec(nib.TraitedSpec): diff --git a/nipype/interfaces/dipy/preprocess.py b/nipype/interfaces/dipy/preprocess.py index 99b43da4c6..2a08c1eae0 100644 --- a/nipype/interfaces/dipy/preprocess.py +++ b/nipype/interfaces/dipy/preprocess.py @@ -106,8 +106,8 @@ class DenoiseInputSpec(TraitedSpec): desc=('mask in which the standard deviation of noise ' 'will be computed'), exists=True) - patch_radius = traits.Int(1, desc='patch radius') - block_radius = traits.Int(5, desc='block_radius') + patch_radius = traits.Int(1, usedefault=True, desc='patch radius') + block_radius = traits.Int(5, usedefault=True, desc='block_radius') snr = traits.Float(desc='manually set an SNR') diff --git a/nipype/interfaces/dipy/tests/test_auto_Denoise.py b/nipype/interfaces/dipy/tests/test_auto_Denoise.py index 2f748f5074..88a1bc5314 100644 --- a/nipype/interfaces/dipy/tests/test_auto_Denoise.py +++ b/nipype/interfaces/dipy/tests/test_auto_Denoise.py @@ -5,7 +5,7 @@ def test_Denoise_inputs(): input_map = dict( - block_radius=dict(), + block_radius=dict(usedefault=True, ), in_file=dict(mandatory=True, ), in_mask=dict(), noise_mask=dict(), @@ -13,7 +13,7 @@ def test_Denoise_inputs(): mandatory=True, usedefault=True, ), - patch_radius=dict(), + patch_radius=dict(usedefault=True, ), signal_mask=dict(), snr=dict(), ) diff --git a/nipype/interfaces/dtitk/tests/test_auto_BinThresh.py b/nipype/interfaces/dtitk/tests/test_auto_BinThresh.py index 1004dd42cb..8425da5fc0 100644 --- a/nipype/interfaces/dtitk/tests/test_auto_BinThresh.py +++ b/nipype/interfaces/dtitk/tests/test_auto_BinThresh.py @@ -30,6 +30,7 @@ def test_BinThresh_inputs(): argstr='%g', mandatory=True, position=2, + usedefault=True, ), out_file=dict( argstr='%s', @@ -52,6 +53,7 @@ def test_BinThresh_inputs(): argstr='%g', mandatory=True, position=3, + usedefault=True, ), ) inputs = BinThresh.input_spec() diff --git a/nipype/interfaces/dtitk/tests/test_auto_BinThreshTASK.py b/nipype/interfaces/dtitk/tests/test_auto_BinThreshTASK.py index 1f49ddce43..96147f3d0c 100644 --- a/nipype/interfaces/dtitk/tests/test_auto_BinThreshTASK.py +++ b/nipype/interfaces/dtitk/tests/test_auto_BinThreshTASK.py @@ -30,6 +30,7 @@ def test_BinThreshTask_inputs(): argstr='%g', mandatory=True, position=2, + usedefault=True, ), out_file=dict( argstr='%s', @@ -52,6 +53,7 @@ def test_BinThreshTask_inputs(): argstr='%g', mandatory=True, position=3, + usedefault=True, ), ) inputs = BinThreshTask.input_spec() diff --git a/nipype/interfaces/dtitk/utils.py b/nipype/interfaces/dtitk/utils.py index 274ea2914e..3ed6e61395 100644 --- a/nipype/interfaces/dtitk/utils.py +++ b/nipype/interfaces/dtitk/utils.py @@ -265,9 +265,11 @@ class BinThreshInputSpec(CommandLineInputSpec): out_file = File(desc='output path', position=1, argstr="%s", keep_extension=True, name_source='in_file', name_template='%s_thrbin') - lower_bound = traits.Float(0.01, position=2, argstr="%g", mandatory=True, + lower_bound = traits.Float(0.01, usedefault=True, + position=2, argstr="%g", mandatory=True, desc='lower bound of binarization range') - upper_bound = traits.Float(100, position=3, argstr="%g", mandatory=True, + upper_bound = traits.Float(100, usedefault=True, + position=3, argstr="%g", mandatory=True, desc='upper bound of binarization range') inside_value = traits.Float(1, position=4, argstr="%g", usedefault=True, mandatory=True, desc='value for voxels in ' diff --git a/nipype/interfaces/elastix/base.py b/nipype/interfaces/elastix/base.py index 56233c8eaa..39fd4a449e 100644 --- a/nipype/interfaces/elastix/base.py +++ b/nipype/interfaces/elastix/base.py @@ -26,7 +26,7 @@ class ElastixBaseInputSpec(CommandLineInputSpec): argstr='-out %s', desc='output directory') num_threads = traits.Int( - 1, + 1, usedefault=True, argstr='-threads %01d', nohash=True, desc='set the maximum number of threads of elastix') diff --git a/nipype/interfaces/elastix/registration.py b/nipype/interfaces/elastix/registration.py index a19e337eb4..cb0395904a 100644 --- a/nipype/interfaces/elastix/registration.py +++ b/nipype/interfaces/elastix/registration.py @@ -65,7 +65,7 @@ class Registration(CommandLine): >>> reg.inputs.moving_image = 'moving1.nii' >>> reg.inputs.parameters = ['elastix.txt'] >>> reg.cmdline - 'elastix -f fixed1.nii -m moving1.nii -out ./ -p elastix.txt' + 'elastix -f fixed1.nii -m moving1.nii -threads 1 -out ./ -p elastix.txt' """ @@ -162,7 +162,7 @@ class ApplyWarp(CommandLine): >>> reg.inputs.moving_image = 'moving1.nii' >>> reg.inputs.transform_file = 'TransformParameters.0.txt' >>> reg.cmdline - 'transformix -in moving1.nii -out ./ -tp TransformParameters.0.txt' + 'transformix -in moving1.nii -threads 1 -out ./ -tp TransformParameters.0.txt' """ @@ -205,7 +205,7 @@ class AnalyzeWarp(CommandLine): >>> reg = AnalyzeWarp() >>> reg.inputs.transform_file = 'TransformParameters.0.txt' >>> reg.cmdline - 'transformix -def all -jac all -jacmat all -out ./ -tp TransformParameters.0.txt' + 'transformix -def all -jac all -jacmat all -threads 1 -out ./ -tp TransformParameters.0.txt' """ @@ -252,7 +252,7 @@ class PointsWarp(CommandLine): >>> reg.inputs.points_file = 'surf1.vtk' >>> reg.inputs.transform_file = 'TransformParameters.0.txt' >>> reg.cmdline - 'transformix -out ./ -def surf1.vtk -tp TransformParameters.0.txt' + 'transformix -threads 1 -out ./ -def surf1.vtk -tp TransformParameters.0.txt' """ diff --git a/nipype/interfaces/elastix/tests/test_auto_AnalyzeWarp.py b/nipype/interfaces/elastix/tests/test_auto_AnalyzeWarp.py index a9318dd8b5..6f60a845f5 100644 --- a/nipype/interfaces/elastix/tests/test_auto_AnalyzeWarp.py +++ b/nipype/interfaces/elastix/tests/test_auto_AnalyzeWarp.py @@ -18,6 +18,7 @@ def test_AnalyzeWarp_inputs(): num_threads=dict( argstr='-threads %01d', nohash=True, + usedefault=True, ), output_path=dict( argstr='-out %s', diff --git a/nipype/interfaces/elastix/tests/test_auto_ApplyWarp.py b/nipype/interfaces/elastix/tests/test_auto_ApplyWarp.py index 1006da7807..a927790cf0 100644 --- a/nipype/interfaces/elastix/tests/test_auto_ApplyWarp.py +++ b/nipype/interfaces/elastix/tests/test_auto_ApplyWarp.py @@ -22,6 +22,7 @@ def test_ApplyWarp_inputs(): num_threads=dict( argstr='-threads %01d', nohash=True, + usedefault=True, ), output_path=dict( argstr='-out %s', diff --git a/nipype/interfaces/elastix/tests/test_auto_PointsWarp.py b/nipype/interfaces/elastix/tests/test_auto_PointsWarp.py index 4f98b4a037..183d035bde 100644 --- a/nipype/interfaces/elastix/tests/test_auto_PointsWarp.py +++ b/nipype/interfaces/elastix/tests/test_auto_PointsWarp.py @@ -18,6 +18,7 @@ def test_PointsWarp_inputs(): num_threads=dict( argstr='-threads %01d', nohash=True, + usedefault=True, ), output_path=dict( argstr='-out %s', diff --git a/nipype/interfaces/elastix/tests/test_auto_Registration.py b/nipype/interfaces/elastix/tests/test_auto_Registration.py index d456ee083d..810279947e 100644 --- a/nipype/interfaces/elastix/tests/test_auto_Registration.py +++ b/nipype/interfaces/elastix/tests/test_auto_Registration.py @@ -29,6 +29,7 @@ def test_Registration_inputs(): num_threads=dict( argstr='-threads %01d', nohash=True, + usedefault=True, ), output_path=dict( argstr='-out %s', diff --git a/nipype/interfaces/freesurfer/model.py b/nipype/interfaces/freesurfer/model.py index 1c39726e34..58d168e2d7 100644 --- a/nipype/interfaces/freesurfer/model.py +++ b/nipype/interfaces/freesurfer/model.py @@ -358,7 +358,7 @@ class GLMFitInputSpec(FSTraitedSpec): force_perm = traits.Bool( argstr='--perm-force', desc='force perumtation test, even when design matrix is not orthog') - diag = traits.Int('--diag %d', desc='Gdiag_no : set diagnositc level') + diag = traits.Int(argstr='--diag %d', desc='Gdiag_no : set diagnositc level') diag_cluster = traits.Bool( argstr='--diag-cluster', desc='save sig volume and exit from first sim loop') diff --git a/nipype/interfaces/freesurfer/preprocess.py b/nipype/interfaces/freesurfer/preprocess.py index 7226230516..1bd1fa6252 100644 --- a/nipype/interfaces/freesurfer/preprocess.py +++ b/nipype/interfaces/freesurfer/preprocess.py @@ -408,7 +408,7 @@ class MRIConvertInputSpec(FSTraitedSpec): argstr='--sdcmlist %s', desc='list of DICOM files for conversion') template_info = traits.Bool( - '--template_info', desc='dump info about template') + argstr='--template_info', desc='dump info about template') crop_gdf = traits.Bool(argstr='--crop_gdf', desc='apply GDF cropping') zero_ge_z_offset = traits.Bool( argstr='--zero_ge_z_offset', desc='zero ge z offset ???') @@ -2133,7 +2133,7 @@ class MNIBiasCorrectionInputSpec(FSTraitedSpec): desc="output volume. Output can be any format accepted by mri_convert. " + "If the output format is COR, then the directory must exist.") iterations = traits.Int( - 4, + 4, usedefault=True, argstr="--n %d", desc= "Number of iterations to run nu_correct. Default is 4. This is the number of times " @@ -2292,9 +2292,7 @@ class NormalizeInputSpec(FSTraitedSpec): desc="The output file for Normalize") # optional gradient = traits.Int( - 1, argstr="-g %d", - usedefault=False, desc="use max intensity/mm gradient g (default=1)") mask = File( argstr="-mask %s", diff --git a/nipype/interfaces/freesurfer/tests/test_auto_CheckTalairachAlignment.py b/nipype/interfaces/freesurfer/tests/test_auto_CheckTalairachAlignment.py index 2fe3e13da7..753029c8d2 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_CheckTalairachAlignment.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_CheckTalairachAlignment.py @@ -32,7 +32,10 @@ def test_CheckTalairachAlignment_inputs(): deprecated='1.0.0', nohash=True, ), - threshold=dict(argstr='-T %.3f', ), + threshold=dict( + argstr='-T %.3f', + usedefault=True, + ), ) inputs = CheckTalairachAlignment.input_spec() diff --git a/nipype/interfaces/freesurfer/tests/test_auto_GLMFit.py b/nipype/interfaces/freesurfer/tests/test_auto_GLMFit.py index b310eded87..a6a3aadcb4 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_GLMFit.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_GLMFit.py @@ -21,7 +21,7 @@ def test_GLMFit_inputs(): argstr='--X %s', xor=('fsgd', 'design', 'one_sample'), ), - diag=dict(), + diag=dict(argstr='--diag %d', ), diag_cluster=dict(argstr='--diag-cluster', ), environ=dict( nohash=True, diff --git a/nipype/interfaces/freesurfer/tests/test_auto_MNIBiasCorrection.py b/nipype/interfaces/freesurfer/tests/test_auto_MNIBiasCorrection.py index fcbf7c0ffa..4ff44524ee 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_MNIBiasCorrection.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_MNIBiasCorrection.py @@ -20,7 +20,10 @@ def test_MNIBiasCorrection_inputs(): argstr='--i %s', mandatory=True, ), - iterations=dict(argstr='--n %d', ), + iterations=dict( + argstr='--n %d', + usedefault=True, + ), mask=dict(argstr='--mask %s', ), no_rescale=dict(argstr='--no-rescale', ), out_file=dict( diff --git a/nipype/interfaces/freesurfer/tests/test_auto_MRIConvert.py b/nipype/interfaces/freesurfer/tests/test_auto_MRIConvert.py index cd27862330..c1c65e90d2 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_MRIConvert.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_MRIConvert.py @@ -99,7 +99,7 @@ def test_MRIConvert_inputs(): subject_name=dict(argstr='--subject_name %s', ), subjects_dir=dict(), te=dict(argstr='-te %d', ), - template_info=dict(), + template_info=dict(argstr='--template_info', ), template_type=dict(argstr='--template_type %s', ), terminal_output=dict( deprecated='1.0.0', diff --git a/nipype/interfaces/freesurfer/tests/test_auto_Normalize.py b/nipype/interfaces/freesurfer/tests/test_auto_Normalize.py index 9d907403f2..810b3f5537 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_Normalize.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_Normalize.py @@ -10,10 +10,7 @@ def test_Normalize_inputs(): nohash=True, usedefault=True, ), - gradient=dict( - argstr='-g %d', - usedefault=False, - ), + gradient=dict(argstr='-g %d', ), ignore_exception=dict( deprecated='1.0.0', nohash=True, diff --git a/nipype/interfaces/freesurfer/tests/test_auto_OneSampleTTest.py b/nipype/interfaces/freesurfer/tests/test_auto_OneSampleTTest.py index c8b6422dd0..0d81e6c229 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_OneSampleTTest.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_OneSampleTTest.py @@ -21,7 +21,7 @@ def test_OneSampleTTest_inputs(): argstr='--X %s', xor=('fsgd', 'design', 'one_sample'), ), - diag=dict(), + diag=dict(argstr='--diag %d', ), diag_cluster=dict(argstr='--diag-cluster', ), environ=dict( nohash=True, diff --git a/nipype/interfaces/freesurfer/tests/test_preprocess.py b/nipype/interfaces/freesurfer/tests/test_preprocess.py index a0d06884ca..f9fc09515a 100644 --- a/nipype/interfaces/freesurfer/tests/test_preprocess.py +++ b/nipype/interfaces/freesurfer/tests/test_preprocess.py @@ -132,19 +132,19 @@ def test_mandatory_outvol(create_files_in_directory): base, ext2 = os.path.splitext(base) ext = ext2 + ext - assert mni.cmdline == ('mri_nu_correct.mni --i %s --o %s_output%s' % + assert mni.cmdline == ('mri_nu_correct.mni --i %s --n 4 --o %s_output%s' % (filelist[0], base, ext)) # test with custom outfile mni.inputs.out_file = 'new_corrected_file.mgz' assert mni.cmdline == ( - 'mri_nu_correct.mni --i %s --o new_corrected_file.mgz' % (filelist[0])) + 'mri_nu_correct.mni --i %s --n 4 --o new_corrected_file.mgz' % (filelist[0])) # constructor based tests mni2 = freesurfer.MNIBiasCorrection( - in_file=filelist[0], out_file='bias_corrected_output', iterations=4) + in_file=filelist[0], out_file='bias_corrected_output', iterations=2) assert mni2.cmdline == ( - 'mri_nu_correct.mni --i %s --n 4 --o bias_corrected_output' % + 'mri_nu_correct.mni --i %s --n 2 --o bias_corrected_output' % filelist[0]) diff --git a/nipype/interfaces/freesurfer/utils.py b/nipype/interfaces/freesurfer/utils.py index d6aec7b8a7..58df63a946 100644 --- a/nipype/interfaces/freesurfer/utils.py +++ b/nipype/interfaces/freesurfer/utils.py @@ -1946,7 +1946,8 @@ class CheckTalairachAlignmentInputSpec(FSTraitedSpec): desc="specify subject's name") # optional threshold = traits.Float( - default=0.010, + default_value=0.010, + usedefault=True, argstr='-T %.3f', desc="Talairach transforms for subjects with p-values <= T " + "are considered as very unlikely default=0.010") diff --git a/nipype/interfaces/fsl/aroma.py b/nipype/interfaces/fsl/aroma.py index d7f8251bd8..7967ba2f58 100644 --- a/nipype/interfaces/fsl/aroma.py +++ b/nipype/interfaces/fsl/aroma.py @@ -28,7 +28,8 @@ class ICA_AROMAInputSpec(CommandLineInputSpec): xor=['feat_dir'], desc='volume to be denoised') out_dir = Directory( - 'out', genfile=True, argstr='-o %s', desc='output directory') + 'out', usedefault=True, mandatory=True, + argstr='-o %s', desc='output directory') mask = File( exists=True, argstr='-m %s', @@ -128,10 +129,7 @@ class ICA_AROMA(CommandLine): def _list_outputs(self): outputs = self.output_spec().get() - if isdefined(self.inputs.out_dir): - outputs['out_dir'] = os.path.abspath(self.inputs.out_dir) - else: - outputs['out_dir'] = self._gen_filename('out_dir') + outputs['out_dir'] = os.path.abspath(self.inputs.out_dir) out_dir = outputs['out_dir'] if self.inputs.denoise_type in ('aggr', 'both'): @@ -141,7 +139,3 @@ def _list_outputs(self): outputs['nonaggr_denoised_file'] = os.path.join( out_dir, 'denoised_func_data_nonaggr.nii.gz') return outputs - - def _gen_filename(self, name): - if name == 'out_dir': - return os.getcwd() diff --git a/nipype/interfaces/fsl/dti.py b/nipype/interfaces/fsl/dti.py index dab3c3ca11..f318b5cb15 100644 --- a/nipype/interfaces/fsl/dti.py +++ b/nipype/interfaces/fsl/dti.py @@ -144,7 +144,7 @@ class FSLXCommandInputSpec(FSLCommandInputSpec): n_fibres = traits.Range( usedefault=True, low=1, - default=2, + value=2, argstr='--nfibres=%d', desc=('Maximum number of fibres to fit in each voxel'), mandatory=True) @@ -158,27 +158,32 @@ class FSLXCommandInputSpec(FSLCommandInputSpec): 'shell) model')) fudge = traits.Int(argstr='--fudge=%d', desc='ARD fudge factor') n_jumps = traits.Int( - 5000, argstr='--njumps=%d', desc='Num of jumps to be made by MCMC') + 5000, usedefault=True, + argstr='--njumps=%d', desc='Num of jumps to be made by MCMC') burn_in = traits.Range( low=0, - default=0, + value=0, + usedefault=True, argstr='--burnin=%d', desc=('Total num of jumps at start of MCMC to be ' 'discarded')) burn_in_no_ard = traits.Range( low=0, - default=0, + value=0, + usedefault=True, argstr='--burninnoard=%d', desc=('num of burnin jumps before the ard is' ' imposed')) sample_every = traits.Range( low=0, - default=1, + value=1, + usedefault=True, argstr='--sampleevery=%d', desc='Num of jumps for each sample (MCMC)') update_proposal_every = traits.Range( low=1, - default=40, + value=40, + usedefault=True, argstr='--updateproposalevery=%d', desc=('Num of jumps for each update ' 'to the proposal density std ' @@ -322,7 +327,7 @@ class BEDPOSTX5InputSpec(FSLXCommandInputSpec): n_fibres = traits.Range( usedefault=True, low=1, - default=2, + value=2, argstr='-n %d', desc=('Maximum number of fibres to fit in each voxel'), mandatory=True) @@ -336,16 +341,19 @@ class BEDPOSTX5InputSpec(FSLXCommandInputSpec): 'shell) model')) fudge = traits.Int(argstr='-w %d', desc='ARD fudge factor') n_jumps = traits.Int( - 5000, argstr='-j %d', desc='Num of jumps to be made by MCMC') + 5000, usedefault=True, + argstr='-j %d', desc='Num of jumps to be made by MCMC') burn_in = traits.Range( low=0, - default=0, + value=0, + usedefault=True, argstr='-b %d', desc=('Total num of jumps at start of MCMC to be ' 'discarded')) sample_every = traits.Range( low=0, - default=1, + value=1, + usedefault=True, argstr='-s %d', desc='Num of jumps for each sample (MCMC)') out_dir = Directory( @@ -416,7 +424,8 @@ class BEDPOSTX5(FSLXCommand): >>> bedp = fsl.BEDPOSTX5(bvecs='bvecs', bvals='bvals', dwi='diffusion.nii', ... mask='mask.nii', n_fibres=1) >>> bedp.cmdline - 'bedpostx bedpostx --forcedir -n 1' + 'bedpostx bedpostx -b 0 --burninnoard=0 --forcedir -n 1 -j 5000 \ +-s 1 --updateproposalevery=40' """ @@ -842,7 +851,6 @@ class ProbTrackX2InputSpec(ProbTrackXBaseInputSpec): simple = traits.Bool( desc=('rack from a list of voxels (seed must be a ' 'ASCII list of coordinates)'), - usedefault=False, argstr='--simple') fopd = File( exists=True, diff --git a/nipype/interfaces/fsl/epi.py b/nipype/interfaces/fsl/epi.py index e1b09230c8..e45a94ed2c 100644 --- a/nipype/interfaces/fsl/epi.py +++ b/nipype/interfaces/fsl/epi.py @@ -199,14 +199,16 @@ class TOPUPInputSpec(FSLCommandInputSpec): # TODO: the following traits admit values separated by commas, one value # per registration level inside topup. warp_res = traits.Float( - 10.0, + 10.0, usedefault=True, argstr='--warpres=%f', desc=('(approximate) resolution (in mm) of warp ' 'basis for the different sub-sampling levels' '.')) - subsamp = traits.Int(1, argstr='--subsamp=%d', desc='sub-sampling scheme') + subsamp = traits.Int(1, usedefault=True, + argstr='--subsamp=%d', desc='sub-sampling scheme') fwhm = traits.Float( 8.0, + usedefault=True, argstr='--fwhm=%f', desc='FWHM (in mm) of gaussian smoothing kernel') config = traits.String( @@ -216,9 +218,10 @@ class TOPUPInputSpec(FSLCommandInputSpec): desc=('Name of config file specifying command line ' 'arguments')) max_iter = traits.Int( - 5, argstr='--miter=%d', desc='max # of non-linear iterations') + 5, usedefault=True, + argstr='--miter=%d', desc='max # of non-linear iterations') reg_lambda = traits.Float( - 1.0, + 1.0, usedefault=True, argstr='--miter=%0.f', desc=('lambda weighting value of the ' 'regularisation term')) @@ -256,7 +259,7 @@ class TOPUPInputSpec(FSLCommandInputSpec): desc=('Minimisation method 0=Levenberg-Marquardt, ' '1=Scaled Conjugate Gradient')) splineorder = traits.Int( - 3, + 3, usedefault=True, argstr='--splineorder=%d', desc=('order of spline, 2->Qadratic spline, ' '3->Cubic spline')) @@ -318,9 +321,11 @@ class TOPUP(FSLCommand): >>> topup.inputs.output_type = "NIFTI_GZ" >>> topup.cmdline # doctest: +ELLIPSIS 'topup --config=b02b0.cnf --datain=topup_encoding.txt \ ---imain=b0_b0rev.nii --out=b0_b0rev_base --iout=b0_b0rev_corrected.nii.gz \ +--fwhm=8.000000 --imain=b0_b0rev.nii --miter=5 \ +--out=b0_b0rev_base --iout=b0_b0rev_corrected.nii.gz \ --fout=b0_b0rev_field.nii.gz --jacout=jac --logout=b0_b0rev_topup.log \ ---rbmout=xfm --dfout=warpfield' +--rbmout=xfm --dfout=warpfield --miter=1 --splineorder=3 --subsamp=1 \ +--warpres=10.000000' >>> res = topup.run() # doctest: +SKIP """ @@ -599,13 +604,13 @@ class EddyInputSpec(FSLCommandInputSpec): desc='Interpolation model for estimation step') nvoxhp = traits.Int( - 1000, + 1000, usedefault=True, argstr='--nvoxhp=%s', desc=('# of voxels used to estimate the ' 'hyperparameters')) fudge_factor = traits.Float( - 10.0, + 10.0, usedefault=True, argstr='--ff=%s', desc=('Fudge factor for hyperparameter ' 'error variance')) @@ -628,7 +633,8 @@ class EddyInputSpec(FSLCommandInputSpec): 'the parameters'), argstr='--fwhm=%s') - niter = traits.Int(5, argstr='--niter=%s', desc='Number of iterations') + niter = traits.Int(5, usedefault=True, + argstr='--niter=%s', desc='Number of iterations') method = traits.Enum( 'jac', @@ -710,14 +716,14 @@ class Eddy(FSLCommand): >>> eddy.inputs.in_bval = 'bvals.scheme' >>> eddy.inputs.use_cuda = True >>> eddy.cmdline # doctest: +ELLIPSIS - 'eddy_cuda --acqp=epi_acqp.txt --bvals=bvals.scheme --bvecs=bvecs.scheme \ ---imain=epi.nii --index=epi_index.txt --mask=epi_mask.nii \ ---out=.../eddy_corrected' + 'eddy_cuda --ff=10.0 --acqp=epi_acqp.txt --bvals=bvals.scheme \ +--bvecs=bvecs.scheme --imain=epi.nii --index=epi_index.txt \ +--mask=epi_mask.nii --niter=5 --nvoxhp=1000 --out=.../eddy_corrected' >>> eddy.inputs.use_cuda = False >>> eddy.cmdline # doctest: +ELLIPSIS - 'eddy_openmp --acqp=epi_acqp.txt --bvals=bvals.scheme \ + 'eddy_openmp --ff=10.0 --acqp=epi_acqp.txt --bvals=bvals.scheme \ --bvecs=bvecs.scheme --imain=epi.nii --index=epi_index.txt \ ---mask=epi_mask.nii --out=.../eddy_corrected' +--mask=epi_mask.nii --niter=5 --nvoxhp=1000 --out=.../eddy_corrected' >>> res = eddy.run() # doctest: +SKIP """ diff --git a/nipype/interfaces/fsl/maths.py b/nipype/interfaces/fsl/maths.py index c7636da785..3862cea8c7 100644 --- a/nipype/interfaces/fsl/maths.py +++ b/nipype/interfaces/fsl/maths.py @@ -221,7 +221,6 @@ class PercentileImageInput(MathsInput): perc = traits.Range( low=0, high=100, - usedefault=False, argstr="%f", position=5, desc=("nth percentile (0-100) of FULL RANGE " diff --git a/nipype/interfaces/fsl/model.py b/nipype/interfaces/fsl/model.py index 1d6a2e1fee..86c25e922d 100644 --- a/nipype/interfaces/fsl/model.py +++ b/nipype/interfaces/fsl/model.py @@ -56,7 +56,7 @@ class Level1DesignInputSpec(BaseInterfaceInputSpec): desc=("which regressors to make orthogonal e.g., " "{1: {0:0,1:0,2:0}, 2: {0:1,1:1,2:0}} to make the second " "regressor in a 2-regressor model orthogonal to the first."), - default={}) + usedefault=True) model_serial_correlations = traits.Bool( desc="Option to model serial correlations using an \ autoregressive estimator (order 1). Setting this option is only \ @@ -525,7 +525,7 @@ class FILMGLSInputSpec(FSLCommandInputSpec): design_file = File( exists=True, position=-2, argstr='%s', desc='design matrix file') threshold = traits.Range( - default=1000., + value=1000., low=0.0, argstr='%f', position=-1, @@ -589,7 +589,7 @@ class FILMGLSInputSpec505(FSLCommandInputSpec): design_file = File( exists=True, position=-2, argstr='--pd=%s', desc='design matrix file') threshold = traits.Range( - default=1000., + value=1000., low=0.0, argstr='--thr=%f', position=-1, @@ -645,7 +645,7 @@ class FILMGLSInputSpec505(FSLCommandInputSpec): class FILMGLSInputSpec507(FILMGLSInputSpec505): threshold = traits.Float( - default=-1000., + default_value=-1000., argstr='--thr=%f', position=-1, usedefault=True, diff --git a/nipype/interfaces/fsl/possum.py b/nipype/interfaces/fsl/possum.py index 6eca7fb117..50b88db185 100644 --- a/nipype/interfaces/fsl/possum.py +++ b/nipype/interfaces/fsl/possum.py @@ -30,30 +30,30 @@ class B0CalcInputSpec(FSLCommandInputSpec): desc='filename of B0 output volume') x_grad = traits.Float( - 0.0, + 0.0, usedefault=True, argstr='--gx=%0.4f', desc='Value for zeroth-order x-gradient field (per mm)') y_grad = traits.Float( - 0.0, + 0.0, usedefault=True, argstr='--gy=%0.4f', desc='Value for zeroth-order y-gradient field (per mm)') z_grad = traits.Float( - 0.0, + 0.0, usedefault=True, argstr='--gz=%0.4f', desc='Value for zeroth-order z-gradient field (per mm)') x_b0 = traits.Float( - 0.0, + 0.0, usedefault=True, argstr='--b0x=%0.2f', xor=['xyz_b0'], desc='Value for zeroth-order b0 field (x-component), in Tesla') y_b0 = traits.Float( - 0.0, + 0.0, usedefault=True, argstr='--b0y=%0.2f', xor=['xyz_b0'], desc='Value for zeroth-order b0 field (y-component), in Tesla') z_b0 = traits.Float( - 1.0, + 1.0, usedefault=True, argstr='--b0=%0.2f', xor=['xyz_b0'], desc='Value for zeroth-order b0 field (z-component), in Tesla') @@ -67,19 +67,21 @@ class B0CalcInputSpec(FSLCommandInputSpec): desc='Zeroth-order B0 field in Tesla') delta = traits.Float( - -9.45e-6, argstr='-d %e', desc='Delta value (chi_tissue - chi_air)') + -9.45e-6, usedefault=True, + argstr='-d %e', desc='Delta value (chi_tissue - chi_air)') chi_air = traits.Float( - 4.0e-7, argstr='--chi0=%e', desc='susceptibility of air') + 4.0e-7, usedefault=True, + argstr='--chi0=%e', desc='susceptibility of air') compute_xyz = traits.Bool( - False, + False, usedefault=True, argstr='--xyz', desc='calculate and save all 3 field components (i.e. x,y,z)') extendboundary = traits.Float( - 1.0, + 1.0, usedefault=True, argstr='--extendboundary=%0.2f', desc='Relative proportion to extend voxels at boundary') directconv = traits.Bool( - False, + False, usedefault=True, argstr='--directconv', desc='use direct (image space) convolution, not FFT') @@ -104,7 +106,9 @@ class B0Calc(FSLCommand): >>> b0calc.inputs.z_b0 = 3.0 >>> b0calc.inputs.output_type = "NIFTI_GZ" >>> b0calc.cmdline - 'b0calc -i tissue+air_map.nii -o tissue+air_map_b0field.nii.gz --b0=3.00' + 'b0calc -i tissue+air_map.nii -o tissue+air_map_b0field.nii.gz --chi0=4.000000e-07 \ +-d -9.450000e-06 --extendboundary=1.00 --b0x=0.00 --gx=0.0000 --b0y=0.00 --gy=0.0000 \ +--b0=3.00 --gz=0.0000' """ diff --git a/nipype/interfaces/fsl/preprocess.py b/nipype/interfaces/fsl/preprocess.py index be5891c6cf..201106502f 100644 --- a/nipype/interfaces/fsl/preprocess.py +++ b/nipype/interfaces/fsl/preprocess.py @@ -1458,7 +1458,6 @@ class SUSANInputSpec(FSLCommandInputSpec): maxlen=2, argstr='', position=6, - default=[], usedefault=True, desc='determines whether the smoothing area (USAN) is to be ' 'found from secondary images (0, 1 or 2). A negative ' diff --git a/nipype/interfaces/fsl/tests/test_auto_B0Calc.py b/nipype/interfaces/fsl/tests/test_auto_B0Calc.py index 23a3c1a944..cdb53b27f4 100644 --- a/nipype/interfaces/fsl/tests/test_auto_B0Calc.py +++ b/nipype/interfaces/fsl/tests/test_auto_B0Calc.py @@ -6,15 +6,30 @@ def test_B0Calc_inputs(): input_map = dict( args=dict(argstr='%s', ), - chi_air=dict(argstr='--chi0=%e', ), - compute_xyz=dict(argstr='--xyz', ), - delta=dict(argstr='-d %e', ), - directconv=dict(argstr='--directconv', ), + chi_air=dict( + argstr='--chi0=%e', + usedefault=True, + ), + compute_xyz=dict( + argstr='--xyz', + usedefault=True, + ), + delta=dict( + argstr='-d %e', + usedefault=True, + ), + directconv=dict( + argstr='--directconv', + usedefault=True, + ), environ=dict( nohash=True, usedefault=True, ), - extendboundary=dict(argstr='--extendboundary=%0.2f', ), + extendboundary=dict( + argstr='--extendboundary=%0.2f', + usedefault=True, + ), ignore_exception=dict( deprecated='1.0.0', nohash=True, @@ -39,23 +54,35 @@ def test_B0Calc_inputs(): ), x_b0=dict( argstr='--b0x=%0.2f', + usedefault=True, xor=['xyz_b0'], ), - x_grad=dict(argstr='--gx=%0.4f', ), + x_grad=dict( + argstr='--gx=%0.4f', + usedefault=True, + ), xyz_b0=dict( argstr='--b0x=%0.2f --b0y=%0.2f --b0=%0.2f', xor=['x_b0', 'y_b0', 'z_b0'], ), y_b0=dict( argstr='--b0y=%0.2f', + usedefault=True, xor=['xyz_b0'], ), - y_grad=dict(argstr='--gy=%0.4f', ), + y_grad=dict( + argstr='--gy=%0.4f', + usedefault=True, + ), z_b0=dict( argstr='--b0=%0.2f', + usedefault=True, xor=['xyz_b0'], ), - z_grad=dict(argstr='--gz=%0.4f', ), + z_grad=dict( + argstr='--gz=%0.4f', + usedefault=True, + ), ) inputs = B0Calc.input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX5.py b/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX5.py index 91a9d304fd..e71e14eba7 100644 --- a/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX5.py +++ b/nipype/interfaces/fsl/tests/test_auto_BEDPOSTX5.py @@ -10,8 +10,14 @@ def test_BEDPOSTX5_inputs(): xor=('no_ard', 'all_ard'), ), args=dict(argstr='%s', ), - burn_in=dict(argstr='-b %d', ), - burn_in_no_ard=dict(argstr='--burninnoard=%d', ), + burn_in=dict( + argstr='-b %d', + usedefault=True, + ), + burn_in_no_ard=dict( + argstr='--burninnoard=%d', + usedefault=True, + ), bvals=dict(mandatory=True, ), bvecs=dict(mandatory=True, ), cnlinear=dict( @@ -51,7 +57,10 @@ def test_BEDPOSTX5_inputs(): mandatory=True, usedefault=True, ), - n_jumps=dict(argstr='-j %d', ), + n_jumps=dict( + argstr='-j %d', + usedefault=True, + ), no_ard=dict( argstr='--noard', xor=('no_ard', 'all_ard'), @@ -72,13 +81,19 @@ def test_BEDPOSTX5_inputs(): ), output_type=dict(), rician=dict(argstr='--rician', ), - sample_every=dict(argstr='-s %d', ), + sample_every=dict( + argstr='-s %d', + usedefault=True, + ), seed=dict(argstr='--seed=%d', ), terminal_output=dict( deprecated='1.0.0', nohash=True, ), - update_proposal_every=dict(argstr='--updateproposalevery=%d', ), + update_proposal_every=dict( + argstr='--updateproposalevery=%d', + usedefault=True, + ), use_gpu=dict(), ) inputs = BEDPOSTX5.input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_Eddy.py b/nipype/interfaces/fsl/tests/test_auto_Eddy.py index d973412fcc..0b3d35c5e0 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Eddy.py +++ b/nipype/interfaces/fsl/tests/test_auto_Eddy.py @@ -16,7 +16,10 @@ def test_Eddy_inputs(): field=dict(argstr='--field=%s', ), field_mat=dict(argstr='--field_mat=%s', ), flm=dict(argstr='--flm=%s', ), - fudge_factor=dict(argstr='--ff=%s', ), + fudge_factor=dict( + argstr='--ff=%s', + usedefault=True, + ), fwhm=dict(argstr='--fwhm=%s', ), ignore_exception=dict( deprecated='1.0.0', @@ -55,12 +58,18 @@ def test_Eddy_inputs(): interp=dict(argstr='--interp=%s', ), is_shelled=dict(argstr='--data_is_shelled', ), method=dict(argstr='--resamp=%s', ), - niter=dict(argstr='--niter=%s', ), + niter=dict( + argstr='--niter=%s', + usedefault=True, + ), num_threads=dict( nohash=True, usedefault=True, ), - nvoxhp=dict(argstr='--nvoxhp=%s', ), + nvoxhp=dict( + argstr='--nvoxhp=%s', + usedefault=True, + ), out_base=dict( argstr='--out=%s', usedefault=True, diff --git a/nipype/interfaces/fsl/tests/test_auto_FSLXCommand.py b/nipype/interfaces/fsl/tests/test_auto_FSLXCommand.py index bb9856338c..d317f87fef 100644 --- a/nipype/interfaces/fsl/tests/test_auto_FSLXCommand.py +++ b/nipype/interfaces/fsl/tests/test_auto_FSLXCommand.py @@ -10,8 +10,14 @@ def test_FSLXCommand_inputs(): xor=('no_ard', 'all_ard'), ), args=dict(argstr='%s', ), - burn_in=dict(argstr='--burnin=%d', ), - burn_in_no_ard=dict(argstr='--burninnoard=%d', ), + burn_in=dict( + argstr='--burnin=%d', + usedefault=True, + ), + burn_in_no_ard=dict( + argstr='--burninnoard=%d', + usedefault=True, + ), bvals=dict( argstr='--bvals=%s', mandatory=True, @@ -64,7 +70,10 @@ def test_FSLXCommand_inputs(): mandatory=True, usedefault=True, ), - n_jumps=dict(argstr='--njumps=%d', ), + n_jumps=dict( + argstr='--njumps=%d', + usedefault=True, + ), no_ard=dict( argstr='--noard', xor=('no_ard', 'all_ard'), @@ -79,13 +88,19 @@ def test_FSLXCommand_inputs(): ), output_type=dict(), rician=dict(argstr='--rician', ), - sample_every=dict(argstr='--sampleevery=%d', ), + sample_every=dict( + argstr='--sampleevery=%d', + usedefault=True, + ), seed=dict(argstr='--seed=%d', ), terminal_output=dict( deprecated='1.0.0', nohash=True, ), - update_proposal_every=dict(argstr='--updateproposalevery=%d', ), + update_proposal_every=dict( + argstr='--updateproposalevery=%d', + usedefault=True, + ), ) inputs = FSLXCommand.input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_ICA_AROMA.py b/nipype/interfaces/fsl/tests/test_auto_ICA_AROMA.py index 6d5851c918..f51b9b315e 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ICA_AROMA.py +++ b/nipype/interfaces/fsl/tests/test_auto_ICA_AROMA.py @@ -54,7 +54,8 @@ def test_ICA_AROMA_inputs(): ), out_dir=dict( argstr='-o %s', - genfile=True, + mandatory=True, + usedefault=True, ), terminal_output=dict( deprecated='1.0.0', diff --git a/nipype/interfaces/fsl/tests/test_auto_Level1Design.py b/nipype/interfaces/fsl/tests/test_auto_Level1Design.py index 13100792c5..75e075ab49 100644 --- a/nipype/interfaces/fsl/tests/test_auto_Level1Design.py +++ b/nipype/interfaces/fsl/tests/test_auto_Level1Design.py @@ -14,7 +14,7 @@ def test_Level1Design_inputs(): ), interscan_interval=dict(mandatory=True, ), model_serial_correlations=dict(mandatory=True, ), - orthogonalization=dict(), + orthogonalization=dict(usedefault=True, ), session_info=dict(mandatory=True, ), ) inputs = Level1Design.input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_PercentileImage.py b/nipype/interfaces/fsl/tests/test_auto_PercentileImage.py index f04ce1aa84..9e1f5462e5 100644 --- a/nipype/interfaces/fsl/tests/test_auto_PercentileImage.py +++ b/nipype/interfaces/fsl/tests/test_auto_PercentileImage.py @@ -47,7 +47,6 @@ def test_PercentileImage_inputs(): perc=dict( argstr='%f', position=5, - usedefault=False, ), terminal_output=dict( deprecated='1.0.0', diff --git a/nipype/interfaces/fsl/tests/test_auto_ProbTrackX2.py b/nipype/interfaces/fsl/tests/test_auto_ProbTrackX2.py index 975fbb5ac5..5eac35d6e5 100644 --- a/nipype/interfaces/fsl/tests/test_auto_ProbTrackX2.py +++ b/nipype/interfaces/fsl/tests/test_auto_ProbTrackX2.py @@ -79,10 +79,7 @@ def test_ProbTrackX2_inputs(): mandatory=True, ), seed_ref=dict(argstr='--seedref=%s', ), - simple=dict( - argstr='--simple', - usedefault=False, - ), + simple=dict(argstr='--simple', ), step_length=dict(argstr='--steplength=%.3f', ), stop_mask=dict(argstr='--stop=%s', ), target2=dict(argstr='--target2=%s', ), diff --git a/nipype/interfaces/fsl/tests/test_auto_TOPUP.py b/nipype/interfaces/fsl/tests/test_auto_TOPUP.py index 5d39a78524..eb7e236287 100644 --- a/nipype/interfaces/fsl/tests/test_auto_TOPUP.py +++ b/nipype/interfaces/fsl/tests/test_auto_TOPUP.py @@ -26,7 +26,10 @@ def test_TOPUP_inputs(): usedefault=True, ), estmov=dict(argstr='--estmov=%d', ), - fwhm=dict(argstr='--fwhm=%f', ), + fwhm=dict( + argstr='--fwhm=%f', + usedefault=True, + ), ignore_exception=dict( deprecated='1.0.0', nohash=True, @@ -37,7 +40,10 @@ def test_TOPUP_inputs(): mandatory=True, ), interp=dict(argstr='--interp=%s', ), - max_iter=dict(argstr='--miter=%d', ), + max_iter=dict( + argstr='--miter=%d', + usedefault=True, + ), minmet=dict(argstr='--minmet=%d', ), numprec=dict(argstr='--numprec=%s', ), out_base=dict( @@ -86,18 +92,30 @@ def test_TOPUP_inputs(): requires=['encoding_direction'], xor=['encoding_file'], ), - reg_lambda=dict(argstr='--miter=%0.f', ), + reg_lambda=dict( + argstr='--miter=%0.f', + usedefault=True, + ), regmod=dict(argstr='--regmod=%s', ), regrid=dict(argstr='--regrid=%d', ), scale=dict(argstr='--scale=%d', ), - splineorder=dict(argstr='--splineorder=%d', ), + splineorder=dict( + argstr='--splineorder=%d', + usedefault=True, + ), ssqlambda=dict(argstr='--ssqlambda=%d', ), - subsamp=dict(argstr='--subsamp=%d', ), + subsamp=dict( + argstr='--subsamp=%d', + usedefault=True, + ), terminal_output=dict( deprecated='1.0.0', nohash=True, ), - warp_res=dict(argstr='--warpres=%f', ), + warp_res=dict( + argstr='--warpres=%f', + usedefault=True, + ), ) inputs = TOPUP.input_spec() diff --git a/nipype/interfaces/fsl/tests/test_auto_XFibres5.py b/nipype/interfaces/fsl/tests/test_auto_XFibres5.py index 77e8b06013..de4b520206 100644 --- a/nipype/interfaces/fsl/tests/test_auto_XFibres5.py +++ b/nipype/interfaces/fsl/tests/test_auto_XFibres5.py @@ -10,8 +10,14 @@ def test_XFibres5_inputs(): xor=('no_ard', 'all_ard'), ), args=dict(argstr='%s', ), - burn_in=dict(argstr='--burnin=%d', ), - burn_in_no_ard=dict(argstr='--burninnoard=%d', ), + burn_in=dict( + argstr='--burnin=%d', + usedefault=True, + ), + burn_in_no_ard=dict( + argstr='--burninnoard=%d', + usedefault=True, + ), bvals=dict( argstr='--bvals=%s', mandatory=True, @@ -65,7 +71,10 @@ def test_XFibres5_inputs(): mandatory=True, usedefault=True, ), - n_jumps=dict(argstr='--njumps=%d', ), + n_jumps=dict( + argstr='--njumps=%d', + usedefault=True, + ), no_ard=dict( argstr='--noard', xor=('no_ard', 'all_ard'), @@ -80,13 +89,19 @@ def test_XFibres5_inputs(): ), output_type=dict(), rician=dict(argstr='--rician', ), - sample_every=dict(argstr='--sampleevery=%d', ), + sample_every=dict( + argstr='--sampleevery=%d', + usedefault=True, + ), seed=dict(argstr='--seed=%d', ), terminal_output=dict( deprecated='1.0.0', nohash=True, ), - update_proposal_every=dict(argstr='--updateproposalevery=%d', ), + update_proposal_every=dict( + argstr='--updateproposalevery=%d', + usedefault=True, + ), ) inputs = XFibres5.input_spec() diff --git a/nipype/interfaces/minc/minc.py b/nipype/interfaces/minc/minc.py index ba2071a594..8ac8babe52 100644 --- a/nipype/interfaces/minc/minc.py +++ b/nipype/interfaces/minc/minc.py @@ -394,8 +394,6 @@ class ConvertInputSpec(CommandLineInputSpec): low=0, desc= 'Set the target block size for chunking (0 default, >1 block size).', - value=0, - usedefault=False, argstr='-chunk %d', ) @@ -621,8 +619,6 @@ class DumpInputSpec(StdOutCommandLineInputSpec): line_length = traits.Range( low=0, desc='Line length maximum in data section (default 80).', - value=80, - usedefault=False, argstr='-l %d') netcdf_name = traits.Str( @@ -786,6 +782,7 @@ class AverageInputSpec(CommandLineInputSpec): low=0, desc='Specify the maximum size of the internal buffers (in kbytes).', value=4096, + usedefault=True, argstr='-max_buffer_size_in_kb %d', ) @@ -1048,8 +1045,6 @@ class CalcInputSpec(CommandLineInputSpec): max_buffer_size_in_kb = traits.Range( low=0, desc='Specify the maximum size of the internal buffers (in kbytes).', - value=0, - usedefault=False, argstr='-max_buffer_size_in_kb %d') _xor_check_dimensions = ( @@ -1122,10 +1117,8 @@ class CalcInputSpec(CommandLineInputSpec): ))) eval_width = traits.Int( - 200, desc='Number of voxels to evaluate simultaneously.', - argstr='-eval_width %s', - usedefault=False) + argstr='-eval_width %s') class CalcOutputSpec(TraitedSpec): @@ -1311,7 +1304,7 @@ class BeastInputSpec(CommandLineInputSpec): desc='Specify configuration file.', argstr='-configuration %s') voxel_size = traits.Int( - 4, + 4, usedefault=True, desc=('Specify voxel size for calculations (4, 2, or 1).' 'Default value: 4. Assumes no multiscale. Use configuration' 'file for multiscale.'), @@ -1325,30 +1318,30 @@ class BeastInputSpec(CommandLineInputSpec): default_value=True) patch_size = traits.Int( - 1, + 1, usedefault=True, desc='Specify patch size for single scale approach. Default value: 1.', argstr='-patch_size %s') search_area = traits.Int( - 2, + 2, usedefault=True, desc= 'Specify size of search area for single scale approach. Default value: 2.', argstr='-search_area %s') confidence_level_alpha = traits.Float( - 0.5, + 0.5, usedefault=True, desc='Specify confidence level Alpha. Default value: 0.5', argstr='-alpha %s') smoothness_factor_beta = traits.Float( - 0.5, + 0.5, usedefault=True, desc='Specify smoothness factor Beta. Default value: 0.25', argstr='-beta %s') threshold_patch_selection = traits.Float( - 0.95, + 0.95, usedefault=True, desc='Specify threshold for patch selection. Default value: 0.95', argstr='-threshold %s') number_selected_images = traits.Int( - 20, + 20, usedefault=True, desc='Specify number of selected images. Default value: 20', argstr='-selection_num %s') @@ -1428,7 +1421,7 @@ class PikInputSpec(CommandLineInputSpec): # --lookup ==> arguments to pass to minclookup scale = traits.Int( - 2, + 2, usedefault=True, desc=('Scaling factor for resulting image. By default images are' 'output at twice their original resolution.'), argstr='--scale %s') @@ -1636,13 +1629,12 @@ class BlurInputSpec(CommandLineInputSpec): mandatory=True) dimensions = traits.Enum( + 3, 1, 2, - 3, desc= 'Number of dimensions to blur (either 1,2 or 3). Default value: 3.', - argstr='-dimensions %s', - default=3) + argstr='-dimensions %s') class BlurOutputSpec(TraitedSpec): @@ -1843,6 +1835,7 @@ class MathInputSpec(CommandLineInputSpec): low=0, desc='Specify the maximum size of the internal buffers (in kbytes).', value=4096, + usedefault=True, argstr='-max_buffer_size_in_kb %d', ) diff --git a/nipype/interfaces/minc/tests/test_auto_Average.py b/nipype/interfaces/minc/tests/test_auto_Average.py index e93fc3fc88..db2309f36e 100644 --- a/nipype/interfaces/minc/tests/test_auto_Average.py +++ b/nipype/interfaces/minc/tests/test_auto_Average.py @@ -98,7 +98,10 @@ def test_Average_inputs(): sep=' ', xor=('input_files', 'filelist'), ), - max_buffer_size_in_kb=dict(argstr='-max_buffer_size_in_kb %d', ), + max_buffer_size_in_kb=dict( + argstr='-max_buffer_size_in_kb %d', + usedefault=True, + ), no_check_dimensions=dict( argstr='-nocheck_dimensions', xor=('check_dimensions', 'no_check_dimensions'), diff --git a/nipype/interfaces/minc/tests/test_auto_Beast.py b/nipype/interfaces/minc/tests/test_auto_Beast.py index 92f3e4c2d1..f01747625b 100644 --- a/nipype/interfaces/minc/tests/test_auto_Beast.py +++ b/nipype/interfaces/minc/tests/test_auto_Beast.py @@ -14,7 +14,10 @@ def test_Beast_inputs(): argstr='-clobber', usedefault=True, ), - confidence_level_alpha=dict(argstr='-alpha %s', ), + confidence_level_alpha=dict( + argstr='-alpha %s', + usedefault=True, + ), configuration_file=dict(argstr='-configuration %s', ), environ=dict( nohash=True, @@ -40,7 +43,10 @@ def test_Beast_inputs(): load_moments=dict(argstr='-load_moments', ), median_filter=dict(argstr='-median', ), nlm_filter=dict(argstr='-nlm_filter', ), - number_selected_images=dict(argstr='-selection_num %s', ), + number_selected_images=dict( + argstr='-selection_num %s', + usedefault=True, + ), output_file=dict( argstr='%s', hash_files=False, @@ -48,17 +54,32 @@ def test_Beast_inputs(): name_template='%s_beast_mask.mnc', position=-1, ), - patch_size=dict(argstr='-patch_size %s', ), + patch_size=dict( + argstr='-patch_size %s', + usedefault=True, + ), probability_map=dict(argstr='-probability', ), same_resolution=dict(argstr='-same_resolution', ), - search_area=dict(argstr='-search_area %s', ), - smoothness_factor_beta=dict(argstr='-beta %s', ), + search_area=dict( + argstr='-search_area %s', + usedefault=True, + ), + smoothness_factor_beta=dict( + argstr='-beta %s', + usedefault=True, + ), terminal_output=dict( deprecated='1.0.0', nohash=True, ), - threshold_patch_selection=dict(argstr='-threshold %s', ), - voxel_size=dict(argstr='-voxel_size %s', ), + threshold_patch_selection=dict( + argstr='-threshold %s', + usedefault=True, + ), + voxel_size=dict( + argstr='-voxel_size %s', + usedefault=True, + ), ) inputs = Beast.input_spec() diff --git a/nipype/interfaces/minc/tests/test_auto_Calc.py b/nipype/interfaces/minc/tests/test_auto_Calc.py index eee80e97d5..aa8fa85091 100644 --- a/nipype/interfaces/minc/tests/test_auto_Calc.py +++ b/nipype/interfaces/minc/tests/test_auto_Calc.py @@ -23,10 +23,7 @@ def test_Calc_inputs(): nohash=True, usedefault=True, ), - eval_width=dict( - argstr='-eval_width %s', - usedefault=False, - ), + eval_width=dict(argstr='-eval_width %s', ), expfile=dict( argstr='-expfile %s', mandatory=True, @@ -108,10 +105,7 @@ def test_Calc_inputs(): position=-2, sep=' ', ), - max_buffer_size_in_kb=dict( - argstr='-max_buffer_size_in_kb %d', - usedefault=False, - ), + max_buffer_size_in_kb=dict(argstr='-max_buffer_size_in_kb %d', ), no_check_dimensions=dict( argstr='-nocheck_dimensions', xor=('check_dimensions', 'no_check_dimensions'), diff --git a/nipype/interfaces/minc/tests/test_auto_Convert.py b/nipype/interfaces/minc/tests/test_auto_Convert.py index 8d827acb28..40b67e4374 100644 --- a/nipype/interfaces/minc/tests/test_auto_Convert.py +++ b/nipype/interfaces/minc/tests/test_auto_Convert.py @@ -6,10 +6,7 @@ def test_Convert_inputs(): input_map = dict( args=dict(argstr='%s', ), - chunk=dict( - argstr='-chunk %d', - usedefault=False, - ), + chunk=dict(argstr='-chunk %d', ), clobber=dict( argstr='-clobber', usedefault=True, diff --git a/nipype/interfaces/minc/tests/test_auto_Dump.py b/nipype/interfaces/minc/tests/test_auto_Dump.py index ff2237f58a..052f0cf0f0 100644 --- a/nipype/interfaces/minc/tests/test_auto_Dump.py +++ b/nipype/interfaces/minc/tests/test_auto_Dump.py @@ -36,10 +36,7 @@ def test_Dump_inputs(): mandatory=True, position=-2, ), - line_length=dict( - argstr='-l %d', - usedefault=False, - ), + line_length=dict(argstr='-l %d', ), netcdf_name=dict(argstr='-n %s', ), out_file=dict( argstr='> %s', diff --git a/nipype/interfaces/minc/tests/test_auto_Math.py b/nipype/interfaces/minc/tests/test_auto_Math.py index c5215e80b7..3406f50571 100644 --- a/nipype/interfaces/minc/tests/test_auto_Math.py +++ b/nipype/interfaces/minc/tests/test_auto_Math.py @@ -109,7 +109,10 @@ def test_Math_inputs(): invert=dict(argstr='-invert -const %s', ), isnan=dict(argstr='-isnan', ), log=dict(argstr='-log -const2 %s %s', ), - max_buffer_size_in_kb=dict(argstr='-max_buffer_size_in_kb %d', ), + max_buffer_size_in_kb=dict( + argstr='-max_buffer_size_in_kb %d', + usedefault=True, + ), maximum=dict(argstr='-maximum', ), minimum=dict(argstr='-minimum', ), nisnan=dict(argstr='-nisnan', ), diff --git a/nipype/interfaces/minc/tests/test_auto_Pik.py b/nipype/interfaces/minc/tests/test_auto_Pik.py index a822fb0574..85e601a27f 100644 --- a/nipype/interfaces/minc/tests/test_auto_Pik.py +++ b/nipype/interfaces/minc/tests/test_auto_Pik.py @@ -53,7 +53,10 @@ def test_Pik_inputs(): png=dict(xor=('jpg', 'png'), ), sagittal_offset=dict(argstr='--sagittal_offset %s', ), sagittal_offset_perc=dict(argstr='--sagittal_offset_perc %d', ), - scale=dict(argstr='--scale %s', ), + scale=dict( + argstr='--scale %s', + usedefault=True, + ), slice_x=dict( argstr='-x', xor=('slice_z', 'slice_y', 'slice_x'), diff --git a/nipype/interfaces/mrtrix3/preprocess.py b/nipype/interfaces/mrtrix3/preprocess.py index f11094a430..fe3efa2a90 100644 --- a/nipype/interfaces/mrtrix3/preprocess.py +++ b/nipype/interfaces/mrtrix3/preprocess.py @@ -41,7 +41,7 @@ class ResponseSDInputSpec(MRTrix3BaseInputSpec): in_mask = File( exists=True, argstr='-mask %s', desc='provide initial mask image') max_sh = traits.Int( - 8, + 8, usedefault=True, argstr='-lmax %d', desc='maximum harmonic degree of response function') @@ -65,7 +65,7 @@ class ResponseSD(MRTrix3Base): >>> resp.inputs.algorithm = 'tournier' >>> resp.inputs.grad_fsl = ('bvecs', 'bvals') >>> resp.cmdline # doctest: +ELLIPSIS - 'dwi2response tournier -fslgrad bvecs bvals dwi.mif wm.txt' + 'dwi2response tournier -fslgrad bvecs bvals -lmax 8 dwi.mif wm.txt' >>> resp.run() # doctest: +SKIP """ diff --git a/nipype/interfaces/mrtrix3/reconst.py b/nipype/interfaces/mrtrix3/reconst.py index fcfe042284..6583c58996 100644 --- a/nipype/interfaces/mrtrix3/reconst.py +++ b/nipype/interfaces/mrtrix3/reconst.py @@ -39,7 +39,7 @@ class FitTensorInputSpec(MRTrix3BaseInputSpec): argstr='-method %s', desc=('select method used to perform the fitting')) reg_term = traits.Float( - 5.e3, + 5.e3, usedefault=True, argstr='-regularisation %f', desc=('specify the strength of the regularisation term on the ' 'magnitude of the tensor elements (default = 5000). This ' @@ -64,7 +64,8 @@ class FitTensor(MRTrix3Base): >>> tsr.inputs.in_mask = 'mask.nii.gz' >>> tsr.inputs.grad_fsl = ('bvecs', 'bvals') >>> tsr.cmdline # doctest: +ELLIPSIS - 'dwi2tensor -fslgrad bvecs bvals -mask mask.nii.gz dwi.mif dti.mif' + 'dwi2tensor -fslgrad bvecs bvals -mask mask.nii.gz \ +-regularisation 5000.000000 dwi.mif dti.mif' >>> tsr.run() # doctest: +SKIP """ @@ -102,9 +103,11 @@ class EstimateFODInputSpec(MRTrix3BaseInputSpec): mandatory=True, desc='output WM ODF') gm_txt = File(argstr='%s', position=-4, desc='GM response text file') - gm_odf = File('gm.mif', argstr='%s', position=-3, desc='output GM ODF') + gm_odf = File('gm.mif', usedefault=True, argstr='%s', + position=-3, desc='output GM ODF') csf_txt = File(argstr='%s', position=-2, desc='CSF response text file') - csf_odf = File('csf.mif', argstr='%s', position=-1, desc='output CSF ODF') + csf_odf = File('csf.mif', usedefault=True, argstr='%s', + position=-1, desc='output CSF ODF') mask_file = File(exists=True, argstr='-mask %s', desc='mask image') # DW Shell selection options @@ -114,7 +117,7 @@ class EstimateFODInputSpec(MRTrix3BaseInputSpec): argstr='-shell %s', desc='specify one or more dw gradient shells') max_sh = traits.Int( - 8, + 8, usedefault=True, argstr='-lmax %d', desc='maximum harmonic degree of response function') in_dirs = File( @@ -146,7 +149,7 @@ class EstimateFOD(MRTrix3Base): >>> fod.inputs.wm_txt = 'wm.txt' >>> fod.inputs.grad_fsl = ('bvecs', 'bvals') >>> fod.cmdline # doctest: +ELLIPSIS - 'dwi2fod -fslgrad bvecs bvals csd dwi.mif wm.txt wm.mif' + 'dwi2fod -fslgrad bvecs bvals -lmax 8 csd dwi.mif wm.txt wm.mif gm.mif csf.mif' >>> fod.run() # doctest: +SKIP """ diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_EstimateFOD.py b/nipype/interfaces/mrtrix3/tests/test_auto_EstimateFOD.py index d59948dd74..69cf79e2d4 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_EstimateFOD.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_EstimateFOD.py @@ -15,6 +15,7 @@ def test_EstimateFOD_inputs(): csf_odf=dict( argstr='%s', position=-1, + usedefault=True, ), csf_txt=dict( argstr='%s', @@ -27,6 +28,7 @@ def test_EstimateFOD_inputs(): gm_odf=dict( argstr='%s', position=-3, + usedefault=True, ), gm_txt=dict( argstr='%s', @@ -48,7 +50,10 @@ def test_EstimateFOD_inputs(): position=-7, ), mask_file=dict(argstr='-mask %s', ), - max_sh=dict(argstr='-lmax %d', ), + max_sh=dict( + argstr='-lmax %d', + usedefault=True, + ), nthreads=dict( argstr='-nthreads %d', nohash=True, diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_FitTensor.py b/nipype/interfaces/mrtrix3/tests/test_auto_FitTensor.py index dc2ab8261f..3afdf8e8b9 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_FitTensor.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_FitTensor.py @@ -37,7 +37,10 @@ def test_FitTensor_inputs(): position=-1, usedefault=True, ), - reg_term=dict(argstr='-regularisation %f', ), + reg_term=dict( + argstr='-regularisation %f', + usedefault=True, + ), terminal_output=dict( deprecated='1.0.0', nohash=True, diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_ResponseSD.py b/nipype/interfaces/mrtrix3/tests/test_auto_ResponseSD.py index 01104d2d20..0c63e38ae6 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_ResponseSD.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_ResponseSD.py @@ -39,7 +39,10 @@ def test_ResponseSD_inputs(): position=-5, ), in_mask=dict(argstr='-mask %s', ), - max_sh=dict(argstr='-lmax %d', ), + max_sh=dict( + argstr='-lmax %d', + usedefault=True, + ), mtt_file=dict( argstr='%s', position=-4, diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_TensorMetrics.py b/nipype/interfaces/mrtrix3/tests/test_auto_TensorMetrics.py index 20cba01dd2..5026270301 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_TensorMetrics.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_TensorMetrics.py @@ -9,6 +9,7 @@ def test_TensorMetrics_inputs(): component=dict( argstr='-num %s', sep=',', + usedefault=True, ), environ=dict( nohash=True, diff --git a/nipype/interfaces/mrtrix3/tests/test_auto_Tractography.py b/nipype/interfaces/mrtrix3/tests/test_auto_Tractography.py index a540fc99ec..603a6a7a24 100644 --- a/nipype/interfaces/mrtrix3/tests/test_auto_Tractography.py +++ b/nipype/interfaces/mrtrix3/tests/test_auto_Tractography.py @@ -41,7 +41,10 @@ def test_Tractography_inputs(): max_seed_attempts=dict(argstr='-max_seed_attempts %d', ), max_tracks=dict(argstr='-maxnum %d', ), min_length=dict(argstr='-minlength %f', ), - n_samples=dict(argstr='-samples %d', ), + n_samples=dict( + argstr='-samples %d', + usedefault=True, + ), n_tracks=dict(argstr='-number %d', ), n_trials=dict(argstr='-trials %d', ), noprecompt=dict(argstr='-noprecomputed', ), @@ -55,7 +58,10 @@ def test_Tractography_inputs(): position=-1, usedefault=True, ), - out_seeds=dict(argstr='-output_seeds %s', ), + out_seeds=dict( + argstr='-output_seeds %s', + usedefault=True, + ), power=dict(argstr='-power %d', ), roi_excl=dict(argstr='-exclude %s', ), roi_incl=dict(argstr='-include %s', ), diff --git a/nipype/interfaces/mrtrix3/tracking.py b/nipype/interfaces/mrtrix3/tracking.py index 2c2476acae..e8bf15a33f 100644 --- a/nipype/interfaces/mrtrix3/tracking.py +++ b/nipype/interfaces/mrtrix3/tracking.py @@ -124,7 +124,7 @@ class TractographyInputSpec(MRTrix3BaseInputSpec): argstr='-power %d', desc=('raise the FOD to the power specified (default is 1/nsamples)')) n_samples = traits.Int( - 4, + 4, usedefault=True, argstr='-samples %d', desc=('set the number of FOD samples to take per step for the 2nd ' 'order (iFOD2) method')) @@ -208,7 +208,7 @@ class TractographyInputSpec(MRTrix3BaseInputSpec): 'algorithm should attempt to find an appropriate tracking' ' direction from a given seed point')) out_seeds = File( - 'out_seeds.nii.gz', + 'out_seeds.nii.gz', usedefault=True, argstr='-output_seeds %s', desc=('output the seed location of all successful streamlines to' ' a file')) @@ -262,7 +262,8 @@ class Tractography(MRTrix3Base): >>> tk.inputs.roi_mask = 'mask.nii.gz' >>> tk.inputs.seed_sphere = (80, 100, 70, 10) >>> tk.cmdline # doctest: +ELLIPSIS - 'tckgen -algorithm iFOD2 -mask mask.nii.gz -seed_sphere \ + 'tckgen -algorithm iFOD2 -samples 4 -output_seeds out_seeds.nii.gz \ +-mask mask.nii.gz -seed_sphere \ 80.000000,100.000000,70.000000,10.000000 fods.mif tracked.tck' >>> tk.run() # doctest: +SKIP """ diff --git a/nipype/interfaces/mrtrix3/utils.py b/nipype/interfaces/mrtrix3/utils.py index 779cd829fc..c40c09e92e 100644 --- a/nipype/interfaces/mrtrix3/utils.py +++ b/nipype/interfaces/mrtrix3/utils.py @@ -182,7 +182,8 @@ class TensorMetricsInputSpec(CommandLineInputSpec): out_eval = File( argstr='-value %s', desc='output selected eigenvalue(s) file') component = traits.List( - [1, 2, 3], + [1], + usedefault=True, argstr='-num %s', sep=',', desc=('specify the desired eigenvalue/eigenvector(s). Note that ' @@ -221,7 +222,7 @@ class TensorMetrics(CommandLine): >>> comp.inputs.in_file = 'dti.mif' >>> comp.inputs.out_fa = 'fa.mif' >>> comp.cmdline # doctest: +ELLIPSIS - 'tensor2metric -fa fa.mif dti.mif' + 'tensor2metric -num 1 -fa fa.mif dti.mif' >>> comp.run() # doctest: +SKIP """ @@ -266,7 +267,6 @@ class ComputeTDIInputSpec(CommandLineInputSpec): desc='specify output image data type') use_dec = traits.Bool(argstr='-dec', desc='perform mapping in DEC space') dixel = File( - 'dixels.txt', argstr='-dixel %s', desc='map streamlines to' 'dixels within each voxel. Directions are stored as' diff --git a/nipype/interfaces/niftyseg/em.py b/nipype/interfaces/niftyseg/em.py index d378e0ad3e..e9c749c282 100644 --- a/nipype/interfaces/niftyseg/em.py +++ b/nipype/interfaces/niftyseg/em.py @@ -54,16 +54,21 @@ class EMInputSpec(CommandLineInputSpec): # iterations max_iter = traits.Int( argstr='-max_iter %s', - default=100, + default_value=100, + usedefault=True, desc='Maximum number of iterations') min_iter = traits.Int( - argstr='-min_iter %s', default=0, desc='Minimun number of iterations') + argstr='-min_iter %s', + default_value=0, + usedefault=True, + desc='Minimum number of iterations') # other options bc_order_val = traits.Int( argstr='-bc_order %s', - default=3, + default_value=3, + usedefault=True, desc='Polynomial order for the bias field') mrf_beta_val = traits.Float( @@ -72,7 +77,11 @@ class EMInputSpec(CommandLineInputSpec): desc = 'Bias field correction will run only if the ratio of improvement \ is below bc_thresh. (default=0 [OFF])' - bc_thresh_val = traits.Float(argstr='-bc_thresh %s', default=0, desc=desc) + bc_thresh_val = traits.Float( + argstr='-bc_thresh %s', + default_value=0, + usedefault=True, + desc=desc) desc = 'Amount of regularization over the diagonal of the covariance \ matrix [above 1]' @@ -134,7 +143,8 @@ class EM(NiftySegCommand): >>> node.inputs.in_file = 'im1.nii' >>> node.inputs.no_prior = 4 >>> node.cmdline - 'seg_EM -in im1.nii -nopriors 4 -bc_out im1_bc_em.nii.gz -out im1_em.nii.gz -out_outlier im1_outlier_em.nii.gz' + 'seg_EM -in im1.nii -bc_order 3 -bc_thresh 0 -max_iter 100 -min_iter 0 -nopriors 4 \ +-bc_out im1_bc_em.nii.gz -out im1_em.nii.gz -out_outlier im1_outlier_em.nii.gz' """ _cmd = get_custom_path('seg_EM', env_dir='NIFTYSEGDIR') diff --git a/nipype/interfaces/niftyseg/tests/test_auto_EM.py b/nipype/interfaces/niftyseg/tests/test_auto_EM.py index 715a3cadac..4bd851fffb 100644 --- a/nipype/interfaces/niftyseg/tests/test_auto_EM.py +++ b/nipype/interfaces/niftyseg/tests/test_auto_EM.py @@ -6,8 +6,14 @@ def test_EM_inputs(): input_map = dict( args=dict(argstr='%s', ), - bc_order_val=dict(argstr='-bc_order %s', ), - bc_thresh_val=dict(argstr='-bc_thresh %s', ), + bc_order_val=dict( + argstr='-bc_order %s', + usedefault=True, + ), + bc_thresh_val=dict( + argstr='-bc_thresh %s', + usedefault=True, + ), environ=dict( nohash=True, usedefault=True, @@ -23,8 +29,14 @@ def test_EM_inputs(): position=4, ), mask_file=dict(argstr='-mask %s', ), - max_iter=dict(argstr='-max_iter %s', ), - min_iter=dict(argstr='-min_iter %s', ), + max_iter=dict( + argstr='-max_iter %s', + usedefault=True, + ), + min_iter=dict( + argstr='-min_iter %s', + usedefault=True, + ), mrf_beta_val=dict(argstr='-mrf_beta %s', ), no_prior=dict( argstr='-nopriors %s', diff --git a/nipype/interfaces/petpvc.py b/nipype/interfaces/petpvc.py index 59f87b482f..598dd898c5 100644 --- a/nipype/interfaces/petpvc.py +++ b/nipype/interfaces/petpvc.py @@ -44,15 +44,19 @@ class PETPVCInputSpec(CommandLineInputSpec): default_value=False, argstr="-d") n_iter = traits.Int( - desc="Number of iterations", default_value=10, argstr="-n %d") + desc="Number of iterations", default_value=10, usedefault=True, + argstr="-n %d") n_deconv = traits.Int( desc="Number of deconvolution iterations", default_value=10, + usedefault=True, argstr="-k %d") alpha = traits.Float( - desc="Alpha value", default_value=1.5, argstr="-a %.4f") + desc="Alpha value", default_value=1.5, usedefault=True, + argstr="-a %.4f") stop_crit = traits.Float( - desc="Stopping criterion", default_value=0.01, argstr="-a %.4f") + desc="Stopping criterion", default_value=0.01, usedefault=True, + argstr="-a %.4f") class PETPVCOutputSpec(TraitedSpec): diff --git a/nipype/interfaces/tests/test_auto_PETPVC.py b/nipype/interfaces/tests/test_auto_PETPVC.py index f08c9b6d44..fd7d5cf571 100644 --- a/nipype/interfaces/tests/test_auto_PETPVC.py +++ b/nipype/interfaces/tests/test_auto_PETPVC.py @@ -5,7 +5,10 @@ def test_PETPVC_inputs(): input_map = dict( - alpha=dict(argstr='-a %.4f', ), + alpha=dict( + argstr='-a %.4f', + usedefault=True, + ), args=dict(argstr='%s', ), debug=dict( argstr='-d', @@ -40,8 +43,14 @@ def test_PETPVC_inputs(): argstr='-m %s', mandatory=True, ), - n_deconv=dict(argstr='-k %d', ), - n_iter=dict(argstr='-n %d', ), + n_deconv=dict( + argstr='-k %d', + usedefault=True, + ), + n_iter=dict( + argstr='-n %d', + usedefault=True, + ), out_file=dict( argstr='-o %s', genfile=True, @@ -51,7 +60,10 @@ def test_PETPVC_inputs(): argstr='-p %s', mandatory=True, ), - stop_crit=dict(argstr='-a %.4f', ), + stop_crit=dict( + argstr='-a %.4f', + usedefault=True, + ), terminal_output=dict( deprecated='1.0.0', nohash=True, diff --git a/tools/checkspecs.py b/tools/checkspecs.py index 6ef7df8677..273a707950 100644 --- a/tools/checkspecs.py +++ b/tools/checkspecs.py @@ -272,6 +272,25 @@ def test_specs(self, uri): if key == 'mandatory' and trait.mandatory is not None and not trait.mandatory: bad_specs.append( [uri, c, 'Inputs', traitname, 'mandatory=False']) + if key == "usedefault" and trait.__dict__[key] == False: + bad_specs.append( + [uri, c, 'Inputs', traitname, 'usedefault=False']) + # checking if traits that have default_value different that the trits default one + # also have `usedefault` specified; + # excluding TraitCompound + # excluding Enum: always has default value (the first value) + # excluding Tuple: takes tuple of inner traits default values as default, but doesn't use it + # for Range assuming that if default == low, it's likely that usedefault should be False + # (for Range traits takes low as a default default + if trait.trait_type.__class__.__name__ not in ['TraitCompound', "Tuple", "Enum"]\ + and trait.default and "usedefault" not in trait.__dict__\ + and "requires" not in trait.__dict__\ + and "xor" not in trait.__dict__: + if trait.trait_type.__class__.__name__ is "Range"\ + and trait.default == trait.trait_type._low: + continue + bad_specs.append( + [uri, c, 'Inputs', traitname, 'default value is set, no value for usedefault']) if not classinst.output_spec: continue