Skip to content

Commit 7871798

Browse files
committed
correcting traits to remove warnings
1 parent f490108 commit 7871798

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+327
-143
lines changed

nipype/algorithms/confounds.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ class CompCorInputSpec(BaseInterfaceInputSpec):
391391
'extraction')
392392
use_regress_poly = traits.Bool(
393393
True,
394+
usedefault=True,
394395
deprecated='0.15.0',
395396
new_name='pre_filter',
396397
desc=('use polynomial regression '

nipype/algorithms/rapidart.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,9 @@ class ArtifactDetectInputSpec(BaseInterfaceInputSpec):
234234
desc=("Mask threshold to be used if mask_type"
235235
" is 'thresh'."))
236236
intersect_mask = traits.Bool(
237-
True, desc=("Intersect the masks when computed from "
238-
"spm_global."))
237+
True, usedefault=True,
238+
desc=("Intersect the masks when computed from "
239+
"spm_global."))
239240
save_plot = traits.Bool(
240241
True, desc="save plots containing outliers", usedefault=True)
241242
plot_type = traits.Enum(

nipype/algorithms/tests/test_auto_ACompCor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def test_ACompCor_inputs():
3232
use_regress_poly=dict(
3333
deprecated='0.15.0',
3434
new_name='pre_filter',
35+
usedefault=True,
3536
),
3637
)
3738
inputs = ACompCor.input_spec()

nipype/algorithms/tests/test_auto_ArtifactDetect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def test_ArtifactDetect_inputs():
1212
nohash=True,
1313
usedefault=True,
1414
),
15-
intersect_mask=dict(),
15+
intersect_mask=dict(usedefault=True, ),
1616
mask_file=dict(),
1717
mask_threshold=dict(),
1818
mask_type=dict(mandatory=True, ),

nipype/algorithms/tests/test_auto_TCompCor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def test_TCompCor_inputs():
3333
use_regress_poly=dict(
3434
deprecated='0.15.0',
3535
new_name='pre_filter',
36+
usedefault=True,
3637
),
3738
)
3839
inputs = TCompCor.input_spec()

nipype/interfaces/afni/preprocess.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1612,6 +1612,7 @@ class OutlierCountInputSpec(CommandLineInputSpec):
16121612
value=1e-3,
16131613
low=0.0,
16141614
high=1.0,
1615+
usedefault=True,
16151616
argstr='-qthr %.5f',
16161617
desc='indicate a value for q to compute alpha')
16171618
autoclip = traits.Bool(
@@ -1681,7 +1682,7 @@ class OutlierCount(CommandLine):
16811682
>>> toutcount = afni.OutlierCount()
16821683
>>> toutcount.inputs.in_file = 'functional.nii'
16831684
>>> toutcount.cmdline # doctest: +ELLIPSIS
1684-
'3dToutcount functional.nii'
1685+
'3dToutcount -qthr 0.00100 functional.nii'
16851686
>>> res = toutcount.run() # doctest: +SKIP
16861687
16871688
"""

nipype/interfaces/afni/tests/test_auto_OutlierCount.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ def test_OutlierCount_inputs():
5959
output_name='out_outliers',
6060
),
6161
polort=dict(argstr='-polort %d', ),
62-
qthr=dict(argstr='-qthr %.5f', ),
62+
qthr=dict(
63+
argstr='-qthr %.5f',
64+
usedefault=True,
65+
),
6366
save_outliers=dict(usedefault=True, ),
6467
terminal_output=dict(
6568
deprecated='1.0.0',

nipype/interfaces/ants/registration.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ class RegistrationInputSpec(ANTSCommandInputSpec):
338338
desc='the metric(s) to use for each stage. '
339339
'Note that multiple metrics per stage are not supported '
340340
'in ANTS 1.9.1 and earlier.')
341-
metric_weight_item_trait = traits.Float(1.0)
341+
metric_weight_item_trait = traits.Float(1.0, usedefault=True)
342342
metric_weight_stage_trait = traits.Either(
343343
metric_weight_item_trait, traits.List(metric_weight_item_trait))
344344
metric_weight = traits.List(
@@ -349,7 +349,7 @@ class RegistrationInputSpec(ANTSCommandInputSpec):
349349
mandatory=True,
350350
desc='the metric weight(s) for each stage. '
351351
'The weights must sum to 1 per stage.')
352-
radius_bins_item_trait = traits.Int(5)
352+
radius_bins_item_trait = traits.Int(5, usedefault=True)
353353
radius_bins_stage_trait = traits.Either(
354354
radius_bins_item_trait, traits.List(radius_bins_item_trait))
355355
radius_or_number_of_bins = traits.List(
@@ -1521,10 +1521,10 @@ class RegistrationSynQuickInputSpec(ANTSCommandInputSpec):
15211521

15221522
use_histogram_matching = traits.Bool(False, argstr='-j %d',
15231523
desc='use histogram matching')
1524-
histogram_bins = traits.Int(default_value=32, argstr='-r %d',
1524+
histogram_bins = traits.Int(default_value=32, usedefault=True, argstr='-r %d',
15251525
desc='histogram bins for mutual information in SyN stage \
15261526
(default = 32)')
1527-
spline_distance = traits.Int(default_value=26, argstr='-s %d',
1527+
spline_distance = traits.Int(default_value=26, usedefault=True, argstr='-s %d',
15281528
desc='spline distance for deformable B-spline SyN transform \
15291529
(default = 26)')
15301530
precision_type = traits.Enum('double', 'float', argstr='-p %s',
@@ -1554,7 +1554,7 @@ class RegistrationSynQuick(ANTSCommand):
15541554
>>> reg.inputs.moving_image = 'moving1.nii'
15551555
>>> reg.inputs.num_threads = 2
15561556
>>> reg.cmdline
1557-
'antsRegistrationSynQuick.sh -d 3 -f fixed1.nii -m moving1.nii -n 2 -o transform -p d -t s'
1557+
'antsRegistrationSynQuick.sh -d 3 -f fixed1.nii -r 32 -m moving1.nii -n 2 -o transform -p d -s 26 -t s'
15581558
>>> reg.run() # doctest: +SKIP
15591559
15601560
example for multiple images
@@ -1565,7 +1565,7 @@ class RegistrationSynQuick(ANTSCommand):
15651565
>>> reg.inputs.moving_image = ['moving1.nii', 'moving2.nii']
15661566
>>> reg.inputs.num_threads = 2
15671567
>>> reg.cmdline
1568-
'antsRegistrationSynQuick.sh -d 3 -f fixed1.nii -f fixed2.nii -m moving1.nii -m moving2.nii -n 2 -o transform -p d -t s'
1568+
'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'
15691569
>>> reg.run() # doctest: +SKIP
15701570
"""
15711571

nipype/interfaces/ants/segmentation.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,12 +1511,12 @@ class KellyKapowskiInputSpec(ANTSCommandInputSpec):
15111511
desc="Gradient step size for the optimization.")
15121512

15131513
smoothing_variance = traits.Float(
1514-
1.0,
1514+
1.0, usedefault=True,
15151515
argstr="--smoothing-variance %f",
15161516
desc="Defines the Gaussian smoothing of the hit and total images.")
15171517

15181518
smoothing_velocity_field = traits.Float(
1519-
1.5,
1519+
1.5, usedefault=True,
15201520
argstr="--smoothing-velocity-field-parameter %f",
15211521
desc=
15221522
"Defines the Gaussian smoothing of the velocity field (default = 1.5).\n"
@@ -1528,12 +1528,12 @@ class KellyKapowskiInputSpec(ANTSCommandInputSpec):
15281528
desc="Sets the option for B-spline smoothing of the velocity field.")
15291529

15301530
number_integration_points = traits.Int(
1531-
10,
1531+
10, usedefault=True,
15321532
argstr="--number-of-integration-points %d",
15331533
desc="Number of compositions of the diffeomorphism per iteration.")
15341534

15351535
max_invert_displacement_field_iters = traits.Int(
1536-
20,
1536+
20, usedefault=True,
15371537
argstr="--maximum-number-of-invert-displacement-field-iterations %d",
15381538
desc="Maximum number of iterations for estimating the invert \n"
15391539
"displacement field.")
@@ -1574,16 +1574,12 @@ class KellyKapowski(ANTSCommand):
15741574
>>> kk.inputs.dimension = 3
15751575
>>> kk.inputs.segmentation_image = "segmentation0.nii.gz"
15761576
>>> kk.inputs.convergence = "[45,0.0,10]"
1577-
>>> kk.inputs.gradient_step = 0.025
1578-
>>> kk.inputs.smoothing_variance = 1.0
1579-
>>> kk.inputs.smoothing_velocity_field = 1.5
1580-
>>> #kk.inputs.use_bspline_smoothing = False
1581-
>>> kk.inputs.number_integration_points = 10
15821577
>>> kk.inputs.thickness_prior_estimate = 10
15831578
>>> kk.cmdline
15841579
'KellyKapowski --convergence "[45,0.0,10]" \
15851580
--output "[segmentation0_cortical_thickness.nii.gz,segmentation0_warped_white_matter.nii.gz]" \
1586-
--image-dimensionality 3 --gradient-step 0.025000 --number-of-integration-points 10 \
1581+
--image-dimensionality 3 --gradient-step 0.025000 \
1582+
--maximum-number-of-invert-displacement-field-iterations 20 --number-of-integration-points 10 \
15871583
--segmentation-image "[segmentation0.nii.gz,2,3]" --smoothing-variance 1.000000 \
15881584
--smoothing-velocity-field-parameter 1.500000 --thickness-prior-estimate 10.000000'
15891585

nipype/interfaces/ants/tests/test_auto_KellyKapowski.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,29 @@ def test_KellyKapowski_inputs():
3939
),
4040
max_invert_displacement_field_iters=dict(
4141
argstr=
42-
'--maximum-number-of-invert-displacement-field-iterations %d', ),
42+
'--maximum-number-of-invert-displacement-field-iterations %d',
43+
usedefault=True,
44+
),
4345
num_threads=dict(
4446
nohash=True,
4547
usedefault=True,
4648
),
4749
number_integration_points=dict(
48-
argstr='--number-of-integration-points %d', ),
50+
argstr='--number-of-integration-points %d',
51+
usedefault=True,
52+
),
4953
segmentation_image=dict(
5054
argstr='--segmentation-image "%s"',
5155
mandatory=True,
5256
),
53-
smoothing_variance=dict(argstr='--smoothing-variance %f', ),
57+
smoothing_variance=dict(
58+
argstr='--smoothing-variance %f',
59+
usedefault=True,
60+
),
5461
smoothing_velocity_field=dict(
55-
argstr='--smoothing-velocity-field-parameter %f', ),
62+
argstr='--smoothing-velocity-field-parameter %f',
63+
usedefault=True,
64+
),
5665
terminal_output=dict(
5766
deprecated='1.0.0',
5867
nohash=True,

nipype/interfaces/ants/tests/test_auto_Registration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def test_Registration_inputs():
7171
requires=['metric'],
7272
usedefault=True,
7373
),
74-
metric_weight_item_trait=dict(),
74+
metric_weight_item_trait=dict(usedefault=True, ),
7575
metric_weight_stage_trait=dict(),
7676
moving_image=dict(mandatory=True, ),
7777
moving_image_mask=dict(
@@ -97,7 +97,7 @@ def test_Registration_inputs():
9797
usedefault=True,
9898
),
9999
output_warped_image=dict(hash_files=False, ),
100-
radius_bins_item_trait=dict(),
100+
radius_bins_item_trait=dict(usedefault=True, ),
101101
radius_bins_stage_trait=dict(),
102102
radius_or_number_of_bins=dict(
103103
requires=['metric_weight'],

nipype/interfaces/ants/tests/test_auto_RegistrationSynQuick.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ def test_RegistrationSynQuick_inputs():
1818
argstr='-f %s...',
1919
mandatory=True,
2020
),
21-
histogram_bins=dict(argstr='-r %d', ),
21+
histogram_bins=dict(
22+
argstr='-r %d',
23+
usedefault=True,
24+
),
2225
ignore_exception=dict(
2326
deprecated='1.0.0',
2427
nohash=True,
@@ -40,7 +43,10 @@ def test_RegistrationSynQuick_inputs():
4043
argstr='-p %s',
4144
usedefault=True,
4245
),
43-
spline_distance=dict(argstr='-s %d', ),
46+
spline_distance=dict(
47+
argstr='-s %d',
48+
usedefault=True,
49+
),
4450
terminal_output=dict(
4551
deprecated='1.0.0',
4652
nohash=True,

nipype/interfaces/dipy/preprocess.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ class DenoiseInputSpec(TraitedSpec):
106106
desc=('mask in which the standard deviation of noise '
107107
'will be computed'),
108108
exists=True)
109-
patch_radius = traits.Int(1, desc='patch radius')
110-
block_radius = traits.Int(5, desc='block_radius')
109+
patch_radius = traits.Int(1, usedefault=True, desc='patch radius')
110+
block_radius = traits.Int(5, usedefault=True, desc='block_radius')
111111
snr = traits.Float(desc='manually set an SNR')
112112

113113

nipype/interfaces/dipy/tests/test_auto_Denoise.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55

66
def test_Denoise_inputs():
77
input_map = dict(
8-
block_radius=dict(),
8+
block_radius=dict(usedefault=True, ),
99
in_file=dict(mandatory=True, ),
1010
in_mask=dict(),
1111
noise_mask=dict(),
1212
noise_model=dict(
1313
mandatory=True,
1414
usedefault=True,
1515
),
16-
patch_radius=dict(),
16+
patch_radius=dict(usedefault=True, ),
1717
signal_mask=dict(),
1818
snr=dict(),
1919
)

nipype/interfaces/dtitk/tests/test_auto_BinThresh.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def test_BinThresh_inputs():
3030
argstr='%g',
3131
mandatory=True,
3232
position=2,
33+
usedefault=True,
3334
),
3435
out_file=dict(
3536
argstr='%s',
@@ -52,6 +53,7 @@ def test_BinThresh_inputs():
5253
argstr='%g',
5354
mandatory=True,
5455
position=3,
56+
usedefault=True,
5557
),
5658
)
5759
inputs = BinThresh.input_spec()

nipype/interfaces/dtitk/tests/test_auto_BinThreshTASK.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def test_BinThreshTask_inputs():
3030
argstr='%g',
3131
mandatory=True,
3232
position=2,
33+
usedefault=True,
3334
),
3435
out_file=dict(
3536
argstr='%s',
@@ -52,6 +53,7 @@ def test_BinThreshTask_inputs():
5253
argstr='%g',
5354
mandatory=True,
5455
position=3,
56+
usedefault=True,
5557
),
5658
)
5759
inputs = BinThreshTask.input_spec()

nipype/interfaces/dtitk/utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,11 @@ class BinThreshInputSpec(CommandLineInputSpec):
265265
out_file = File(desc='output path', position=1, argstr="%s",
266266
keep_extension=True, name_source='in_file',
267267
name_template='%s_thrbin')
268-
lower_bound = traits.Float(0.01, position=2, argstr="%g", mandatory=True,
268+
lower_bound = traits.Float(0.01, usedefault=True,
269+
position=2, argstr="%g", mandatory=True,
269270
desc='lower bound of binarization range')
270-
upper_bound = traits.Float(100, position=3, argstr="%g", mandatory=True,
271+
upper_bound = traits.Float(100, usedefault=True,
272+
position=3, argstr="%g", mandatory=True,
271273
desc='upper bound of binarization range')
272274
inside_value = traits.Float(1, position=4, argstr="%g", usedefault=True,
273275
mandatory=True, desc='value for voxels in '

nipype/interfaces/elastix/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ElastixBaseInputSpec(CommandLineInputSpec):
2626
argstr='-out %s',
2727
desc='output directory')
2828
num_threads = traits.Int(
29-
1,
29+
1, usedefault=True,
3030
argstr='-threads %01d',
3131
nohash=True,
3232
desc='set the maximum number of threads of elastix')

nipype/interfaces/elastix/registration.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class Registration(CommandLine):
6565
>>> reg.inputs.moving_image = 'moving1.nii'
6666
>>> reg.inputs.parameters = ['elastix.txt']
6767
>>> reg.cmdline
68-
'elastix -f fixed1.nii -m moving1.nii -out ./ -p elastix.txt'
68+
'elastix -f fixed1.nii -m moving1.nii -threads 1 -out ./ -p elastix.txt'
6969
7070
7171
"""
@@ -162,7 +162,7 @@ class ApplyWarp(CommandLine):
162162
>>> reg.inputs.moving_image = 'moving1.nii'
163163
>>> reg.inputs.transform_file = 'TransformParameters.0.txt'
164164
>>> reg.cmdline
165-
'transformix -in moving1.nii -out ./ -tp TransformParameters.0.txt'
165+
'transformix -in moving1.nii -threads 1 -out ./ -tp TransformParameters.0.txt'
166166
167167
168168
"""
@@ -205,7 +205,7 @@ class AnalyzeWarp(CommandLine):
205205
>>> reg = AnalyzeWarp()
206206
>>> reg.inputs.transform_file = 'TransformParameters.0.txt'
207207
>>> reg.cmdline
208-
'transformix -def all -jac all -jacmat all -out ./ -tp TransformParameters.0.txt'
208+
'transformix -def all -jac all -jacmat all -threads 1 -out ./ -tp TransformParameters.0.txt'
209209
210210
211211
"""
@@ -252,7 +252,7 @@ class PointsWarp(CommandLine):
252252
>>> reg.inputs.points_file = 'surf1.vtk'
253253
>>> reg.inputs.transform_file = 'TransformParameters.0.txt'
254254
>>> reg.cmdline
255-
'transformix -out ./ -def surf1.vtk -tp TransformParameters.0.txt'
255+
'transformix -threads 1 -out ./ -def surf1.vtk -tp TransformParameters.0.txt'
256256
257257
258258
"""

nipype/interfaces/elastix/tests/test_auto_AnalyzeWarp.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def test_AnalyzeWarp_inputs():
1818
num_threads=dict(
1919
argstr='-threads %01d',
2020
nohash=True,
21+
usedefault=True,
2122
),
2223
output_path=dict(
2324
argstr='-out %s',

nipype/interfaces/elastix/tests/test_auto_ApplyWarp.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def test_ApplyWarp_inputs():
2222
num_threads=dict(
2323
argstr='-threads %01d',
2424
nohash=True,
25+
usedefault=True,
2526
),
2627
output_path=dict(
2728
argstr='-out %s',

nipype/interfaces/elastix/tests/test_auto_PointsWarp.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def test_PointsWarp_inputs():
1818
num_threads=dict(
1919
argstr='-threads %01d',
2020
nohash=True,
21+
usedefault=True,
2122
),
2223
output_path=dict(
2324
argstr='-out %s',

nipype/interfaces/elastix/tests/test_auto_Registration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def test_Registration_inputs():
2929
num_threads=dict(
3030
argstr='-threads %01d',
3131
nohash=True,
32+
usedefault=True,
3233
),
3334
output_path=dict(
3435
argstr='-out %s',

0 commit comments

Comments
 (0)