Skip to content

Commit feea3ed

Browse files
committed
changing the name of the argument to set default values for traits
1 parent dc09e00 commit feea3ed

File tree

13 files changed

+56
-43
lines changed

13 files changed

+56
-43
lines changed

nipype/algorithms/confounds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ class CompCorInputSpec(BaseInterfaceInputSpec):
396396
desc=('use polynomial regression '
397397
'pre-component extraction'))
398398
regress_poly_degree = traits.Range(
399-
low=1, default=1, usedefault=True, desc='the degree polynomial to use')
399+
low=1, value=1, usedefault=True, desc='the degree polynomial to use')
400400
header_prefix = traits.Str(
401401
desc=('the desired header for the output tsv '
402402
'file (one column). If undefined, will '

nipype/algorithms/mesh.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ class MeshWarpMathsInputSpec(BaseInterfaceInputSpec):
289289
float_trait,
290290
File(exists=True),
291291
default=1.0,
292+
usedefault=True,
292293
mandatory=True,
293294
desc='image, float or tuple of floats to act as operator')
294295

nipype/interfaces/afni/utils.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,8 @@ class CatInputSpec(AFNICommandInputSpec):
479479
File(exists=True), argstr="%s", mandatory=True, position=-2)
480480
out_file = File(
481481
argstr='> %s',
482-
default='catout.1d',
482+
value='catout.1d',
483+
usedefault=True,
483484
desc='output (concatenated) file name',
484485
position=-1,
485486
mandatory=True)
@@ -1610,6 +1611,7 @@ class NwarpApplyInputSpec(CommandLineInputSpec):
16101611
desc='the name of the master dataset, which defines the output grid',
16111612
argstr='-master %s')
16121613
interp = traits.Enum(
1614+
'wsinc5'
16131615
'NN',
16141616
'nearestneighbour',
16151617
'nearestneighbor',
@@ -1619,11 +1621,11 @@ class NwarpApplyInputSpec(CommandLineInputSpec):
16191621
'tricubic',
16201622
'quintic',
16211623
'triquintic',
1622-
'wsinc5',
16231624
desc='defines interpolation method to use during warp',
16241625
argstr='-interp %s',
1625-
default='wsinc5')
1626+
usedefault=True)
16261627
ainterp = traits.Enum(
1628+
'wsinc5'
16271629
'NN',
16281630
'nearestneighbour',
16291631
'nearestneighbor',
@@ -1633,11 +1635,10 @@ class NwarpApplyInputSpec(CommandLineInputSpec):
16331635
'tricubic',
16341636
'quintic',
16351637
'triquintic',
1636-
'wsinc5',
16371638
desc='specify a different interpolation method than might '
16381639
'be used for the warp',
16391640
argstr='-ainterp %s',
1640-
default='wsinc5')
1641+
usedefault=True)
16411642
out_file = File(
16421643
name_template='%s_Nwarp',
16431644
desc='output image file name',
@@ -1696,13 +1697,14 @@ class NwarpCatInputSpec(AFNICommandInputSpec):
16961697
inv_warp = traits.Bool(
16971698
desc='invert the final warp before output', argstr='-iwarp')
16981699
interp = traits.Enum(
1700+
'wsinc5'
16991701
'linear',
17001702
'quintic',
17011703
'wsinc5',
17021704
desc='specify a different interpolation method than might '
17031705
'be used for the warp',
17041706
argstr='-interp %s',
1705-
default='wsinc5')
1707+
usedefault=True)
17061708
expad = traits.Int(
17071709
desc='Pad the nonlinear warps by the given number of voxels voxels in '
17081710
'all directions. The warp displacements are extended by linear '
@@ -1841,7 +1843,6 @@ class OneDToolPyInputSpec(AFNIPythonCommandInputSpec):
18411843
show_cormat_warnings = traits.File(
18421844
desc='Write cormat warnings to a file',
18431845
argstr="-show_cormat_warnings |& tee %s",
1844-
default="out.cormat_warn.txt",
18451846
usedefault=False,
18461847
position=-1,
18471848
xor=['out_file'])

nipype/interfaces/ants/registration.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class ANTSInputSpec(ANTSCommandInputSpec):
9898
symmetry_type = traits.Float(requires=['delta_time'], desc='')
9999

100100
use_histogram_matching = traits.Bool(
101-
argstr='%s', default=True, usedefault=True)
101+
argstr='%s', default_value=True, usedefault=True)
102102
number_of_iterations = traits.List(
103103
traits.Int(), argstr='--number-of-iterations %s', sep='x')
104104
smoothing_sigmas = traits.List(
@@ -324,7 +324,7 @@ class RegistrationInputSpec(ANTSCommandInputSpec):
324324
1,
325325
2,
326326
argstr='%s',
327-
default=0,
327+
usedefault=True,
328328
xor=['initial_moving_transform'],
329329
desc="Align the moving_image nad fixed_image befor registration using"
330330
"the geometric center of the images (=0), the image intensities (=1),"
@@ -405,20 +405,20 @@ class RegistrationInputSpec(ANTSCommandInputSpec):
405405

406406
write_composite_transform = traits.Bool(
407407
argstr='--write-composite-transform %d',
408-
default=False,
408+
default_value=False,
409409
usedefault=True,
410410
desc='')
411411
collapse_output_transforms = traits.Bool(
412412
argstr='--collapse-output-transforms %d',
413-
default=True,
413+
default_value=True,
414414
usedefault=True, # This should be true for explicit completeness
415415
desc=('Collapse output transforms. Specifically, enabling this option '
416416
'combines all adjacent linear transforms and composes all '
417417
'adjacent displacement field transforms before writing the '
418418
'results to disk.'))
419419
initialize_transforms_per_stage = traits.Bool(
420420
argstr='--initialize-transforms-per-stage %d',
421-
default=False,
421+
default_value=False,
422422
usedefault=True, # This should be true for explicit completeness
423423
desc=
424424
('Initialize linear transforms from the previous stage. By enabling this option, '
@@ -430,7 +430,7 @@ class RegistrationInputSpec(ANTSCommandInputSpec):
430430
# values instead of booleans
431431
float = traits.Bool(
432432
argstr='--float %d',
433-
default=False,
433+
default_value=False,
434434
desc='Use float instead of double for computations.')
435435

436436
transforms = traits.List(
@@ -532,7 +532,7 @@ class RegistrationInputSpec(ANTSCommandInputSpec):
532532
usedefault=True,
533533
desc="The Lower quantile to clip image ranges")
534534

535-
verbose = traits.Bool(argstr='-v', default=False)
535+
verbose = traits.Bool(argstr='-v', default_value=False, usedefault=True)
536536

537537

538538
class RegistrationOutputSpec(TraitedSpec):
@@ -1386,7 +1386,7 @@ class MeasureImageSimilarityInputSpec(ANTSCommandInputSpec):
13861386
)
13871387
metric_weight = traits.Float(
13881388
requires=['metric'],
1389-
default=1.0,
1389+
default_value=1.0,
13901390
usedefault=True,
13911391
desc='The "metricWeight" variable is not used.',
13921392
)
@@ -1401,7 +1401,6 @@ class MeasureImageSimilarityInputSpec(ANTSCommandInputSpec):
14011401
"Regular",
14021402
"Random",
14031403
requires=['metric'],
1404-
default="None",
14051404
usedefault=True,
14061405
desc='Manner of choosing point set over which to optimize the metric. '
14071406
'Defaults to "None" (i.e. a dense sampling of one sample per voxel).')

nipype/interfaces/ants/resampling.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,8 @@ class ApplyTransformsInputSpec(ANTSCommandInputSpec):
359359
desc='output a composite warp file instead of a transformed image')
360360
float = traits.Bool(
361361
argstr='--float %d',
362-
default=False,
362+
default_value=False,
363+
usedefault=True,
363364
desc='Use float instead of double for computations.')
364365

365366

nipype/interfaces/freesurfer/preprocess.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1785,7 +1785,6 @@ class RobustRegisterInputSpec(FSTraitedSpec):
17851785
out_reg_file = traits.Either(
17861786
True,
17871787
File,
1788-
default=True,
17891788
usedefault=True,
17901789
argstr='--lta %s',
17911790
desc='registration file; either True or filename')

nipype/interfaces/freesurfer/registration.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,6 @@ class MRICoregInputSpec(FSTraitedSpec):
422422
True,
423423
File,
424424
argstr='--lta %s',
425-
default=True,
426425
usedefault=True,
427426
desc='output registration file (LTA format)')
428427
out_reg_file = traits.Either(

nipype/interfaces/freesurfer/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,7 +1383,6 @@ class MRIPretessInputSpec(FSTraitedSpec):
13831383
traits.Str('wm'),
13841384
traits.Int(1),
13851385
argstr='%s',
1386-
default='wm',
13871386
mandatory=True,
13881387
usedefault=True,
13891388
position=-3,
@@ -1946,7 +1945,8 @@ class CheckTalairachAlignmentInputSpec(FSTraitedSpec):
19461945
desc="specify subject's name")
19471946
# optional
19481947
threshold = traits.Float(
1949-
default=0.010,
1948+
default_value=0.010,
1949+
usedefault=True,
19501950
argstr='-T %.3f',
19511951
desc="Talairach transforms for subjects with p-values <= T " +
19521952
"are considered as very unlikely default=0.010")

nipype/interfaces/fsl/dti.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class FSLXCommandInputSpec(FSLCommandInputSpec):
144144
n_fibres = traits.Range(
145145
usedefault=True,
146146
low=1,
147-
default=2,
147+
value=2,
148148
argstr='--nfibres=%d',
149149
desc=('Maximum number of fibres to fit in each voxel'),
150150
mandatory=True)
@@ -161,24 +161,28 @@ class FSLXCommandInputSpec(FSLCommandInputSpec):
161161
5000, argstr='--njumps=%d', desc='Num of jumps to be made by MCMC')
162162
burn_in = traits.Range(
163163
low=0,
164-
default=0,
164+
value=0,
165+
usedefault=True,
165166
argstr='--burnin=%d',
166167
desc=('Total num of jumps at start of MCMC to be '
167168
'discarded'))
168169
burn_in_no_ard = traits.Range(
169170
low=0,
170-
default=0,
171+
value=0,
172+
usedefault=True,
171173
argstr='--burninnoard=%d',
172174
desc=('num of burnin jumps before the ard is'
173175
' imposed'))
174176
sample_every = traits.Range(
175177
low=0,
176-
default=1,
178+
value=1,
179+
usedefault=True,
177180
argstr='--sampleevery=%d',
178181
desc='Num of jumps for each sample (MCMC)')
179182
update_proposal_every = traits.Range(
180183
low=1,
181-
default=40,
184+
value=40,
185+
usedefault=True,
182186
argstr='--updateproposalevery=%d',
183187
desc=('Num of jumps for each update '
184188
'to the proposal density std '
@@ -322,7 +326,7 @@ class BEDPOSTX5InputSpec(FSLXCommandInputSpec):
322326
n_fibres = traits.Range(
323327
usedefault=True,
324328
low=1,
325-
default=2,
329+
value=2,
326330
argstr='-n %d',
327331
desc=('Maximum number of fibres to fit in each voxel'),
328332
mandatory=True)
@@ -339,13 +343,15 @@ class BEDPOSTX5InputSpec(FSLXCommandInputSpec):
339343
5000, argstr='-j %d', desc='Num of jumps to be made by MCMC')
340344
burn_in = traits.Range(
341345
low=0,
342-
default=0,
346+
value=0,
347+
usedefault=True,
343348
argstr='-b %d',
344349
desc=('Total num of jumps at start of MCMC to be '
345350
'discarded'))
346351
sample_every = traits.Range(
347352
low=0,
348-
default=1,
353+
value=1,
354+
usedefault=True,
349355
argstr='-s %d',
350356
desc='Num of jumps for each sample (MCMC)')
351357
out_dir = Directory(

nipype/interfaces/fsl/model.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class Level1DesignInputSpec(BaseInterfaceInputSpec):
5656
desc=("which regressors to make orthogonal e.g., "
5757
"{1: {0:0,1:0,2:0}, 2: {0:1,1:1,2:0}} to make the second "
5858
"regressor in a 2-regressor model orthogonal to the first."),
59-
default={})
59+
value={}, usedefault=True)
6060
model_serial_correlations = traits.Bool(
6161
desc="Option to model serial correlations using an \
6262
autoregressive estimator (order 1). Setting this option is only \
@@ -525,7 +525,7 @@ class FILMGLSInputSpec(FSLCommandInputSpec):
525525
design_file = File(
526526
exists=True, position=-2, argstr='%s', desc='design matrix file')
527527
threshold = traits.Range(
528-
default=1000.,
528+
value=1000.,
529529
low=0.0,
530530
argstr='%f',
531531
position=-1,
@@ -589,7 +589,7 @@ class FILMGLSInputSpec505(FSLCommandInputSpec):
589589
design_file = File(
590590
exists=True, position=-2, argstr='--pd=%s', desc='design matrix file')
591591
threshold = traits.Range(
592-
default=1000.,
592+
value=1000.,
593593
low=0.0,
594594
argstr='--thr=%f',
595595
position=-1,
@@ -645,7 +645,7 @@ class FILMGLSInputSpec505(FSLCommandInputSpec):
645645

646646
class FILMGLSInputSpec507(FILMGLSInputSpec505):
647647
threshold = traits.Float(
648-
default=-1000.,
648+
default_value=-1000.,
649649
argstr='--thr=%f',
650650
position=-1,
651651
usedefault=True,

0 commit comments

Comments
 (0)