Skip to content

Commit f2a21fd

Browse files
authored
Merge pull request #2823 from jguillon/fix/mrtrix3-tckgen-option
ENH: Support tckgen -select in MRtrix3 v3+
2 parents dedf5ca + beb062c commit f2a21fd

File tree

10 files changed

+61
-47
lines changed

10 files changed

+61
-47
lines changed

Diff for: .mailmap

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Josh Warner <[email protected]> JDWarner <[email protected]
9393
Josh Warner <[email protected]> Josh Warner (Mac) <[email protected]>
9494
Kai Schlamp <[email protected]> medihack <[email protected]>Jessica Forbes <[email protected]> jessicaforbes <[email protected]>
9595
Katie Bottenhorn <[email protected]> 62442katieb <[email protected]>
96-
Kesshi Jordan <[email protected]> Kesshi Jordan <[email protected]>
96+
Kesshi Jordan <[email protected]> Kesshi Jordan <[email protected]>
9797
Kesshi Jordan <[email protected]> Kesshi Jordan <[email protected]>
9898
Kesshi Jordan <[email protected]> Kesshi Jordan <[email protected]>
9999
Kesshi Jordan <[email protected]> Kesshi Jordan <[email protected]>

Diff for: README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ To participate in the Nipype development related discussions please use the foll
9191

9292
Please add *[nipype]* to the subject line when posting on the mailing list.
9393

94-
You can even hangout with the Nipype developers in their
94+
You can even hangout with the Nipype developers in their
9595
`Gitter <https://gitter.im/nipy/nipype>`_ channel or in the BrainHack `Slack <https://brainhack.slack.com/messages/C1FR76RAL>`_ channel. (Click `here <https://brainhack-slack-invite.herokuapp.com>`_ to join the Slack workspace.)
9696

9797

Diff for: doc/devel/interface_specs.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ In case of trouble, we encourage you to post on `NeuroStars <https://neurostars.
1212
NeuroStars.org is a platform similar to StackOverflow but dedicated to neuroinformatics.
1313
You can also post on the nipype developers mailing list: http://mail.python.org/mailman/listinfo/neuroimaging.
1414
As we are sharing a mailing list with the nipy community, please add ``[nipype]`` to the message title.
15-
Alternatively, you're welcome to chat with us in the Nipype
16-
`Gitter <https://gitter.im/nipy/nipype>`_ channel or in the
15+
Alternatively, you're welcome to chat with us in the Nipype
16+
`Gitter <https://gitter.im/nipy/nipype>`_ channel or in the
1717
BrainHack `Slack <https://brainhack.slack.com/messages/C1FR76RAL>`_ channel.
1818
(Click `here <https://brainhack-slack-invite.herokuapp.com>`_ to join the Slack workspace.)
1919

Diff for: nipype/interfaces/dcm2nii.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ class Dcm2niix(CommandLine):
374374
converts any files in the directory containing the files in the list. We
375375
also do not support nested filenames with this option. **Thus all files
376376
must have a common root directory.**
377-
377+
378378
>>> converter = Dcm2niix()
379379
>>> converter.inputs.source_names = ['functional_1.dcm', 'functional_2.dcm']
380380
>>> converter.inputs.compression = 5

Diff for: nipype/interfaces/mrtrix3/tests/test_auto_Tractography.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ def test_Tractography_inputs():
4040
argstr='-samples %d',
4141
usedefault=True,
4242
),
43-
n_tracks=dict(argstr='-number %d', ),
43+
n_tracks=dict(
44+
argstr='-number %d',
45+
max_ver='0.4',
46+
),
4447
n_trials=dict(argstr='-trials %d', ),
4548
noprecompt=dict(argstr='-noprecomputed', ),
4649
nthreads=dict(
@@ -77,6 +80,10 @@ def test_Tractography_inputs():
7780
xor=['seed_image', 'seed_grid_voxel'],
7881
),
7982
seed_sphere=dict(argstr='-seed_sphere %f,%f,%f,%f', ),
83+
select=dict(
84+
argstr='-select %d',
85+
min_ver='3',
86+
),
8087
sph_trait=dict(argstr='%f,%f,%f,%f', ),
8188
step_size=dict(argstr='-step %f', ),
8289
stop=dict(argstr='-stop', ),

Diff for: nipype/interfaces/mrtrix3/tracking.py

+7
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ class TractographyInputSpec(MRTrix3BaseInputSpec):
7676
'is 90deg x stepsize / voxelsize)'))
7777
n_tracks = traits.Int(
7878
argstr='-number %d',
79+
max_ver='0.4',
80+
desc=('set the desired number of tracks. The program will continue'
81+
' to generate tracks until this number of tracks have been '
82+
'selected and written to the output file'))
83+
select = traits.Int(
84+
argstr='-select %d',
85+
min_ver='3',
7986
desc=('set the desired number of tracks. The program will continue'
8087
' to generate tracks until this number of tracks have been '
8188
'selected and written to the output file'))

Diff for: nipype/interfaces/spm/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
from .base import (Info, SPMCommand, logger, no_spm, scans_for_fname,
77
scans_for_fnames)
8-
from .preprocess import (FieldMap, SliceTiming, Realign, RealignUnwarp,
8+
from .preprocess import (FieldMap, SliceTiming, Realign, RealignUnwarp,
99
Coregister, Normalize, Normalize12, Segment,
10-
Smooth, NewSegment, DARTEL, DARTELNorm2MNI,
10+
Smooth, NewSegment, DARTEL, DARTELNorm2MNI,
1111
CreateWarped, VBMSegment)
1212
from .model import (Level1Design, EstimateModel, EstimateContrast, Threshold,
1313
OneSampleTTestDesign, TwoSampleTTestDesign,

Diff for: nipype/interfaces/spm/preprocess.py

+37-37
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ class RealignUnwarpInputSpec(SPMCommandInputSpec):
443443
traits.Either(ImageFileSPM(exists=True),
444444
traits.List(ImageFileSPM(exists=True))),
445445
field='data.scans',
446-
mandatory=True,
446+
mandatory=True,
447447
copyfile=True,
448448
desc='list of filenames to realign and unwarp')
449449
phase_map = File(
@@ -452,52 +452,52 @@ class RealignUnwarpInputSpec(SPMCommandInputSpec):
452452
'behaviour, the same map will be used for all sessions',
453453
copyfile=False)
454454
quality = traits.Range(
455-
low=0.0,
456-
high=1.0,
455+
low=0.0,
456+
high=1.0,
457457
field='eoptions.quality',
458458
desc='0.1 = fast, 1.0 = precise')
459459
fwhm = traits.Range(
460-
low=0.0,
460+
low=0.0,
461461
field='eoptions.fwhm',
462462
desc='gaussian smoothing kernel width')
463463
separation = traits.Range(
464-
low=0.0,
464+
low=0.0,
465465
field='eoptions.sep',
466466
desc='sampling separation in mm')
467467
register_to_mean = traits.Bool(
468468
field='eoptions.rtm',
469469
desc='Indicate whether realignment is done to the mean image')
470470
weight_img = File(
471-
exists=True,
471+
exists=True,
472472
field='eoptions.weight',
473473
desc='filename of weighting image')
474474
interp = traits.Range(
475-
low=0,
476-
high=7,
475+
low=0,
476+
high=7,
477477
field='eoptions.einterp',
478478
desc='degree of b-spline used for interpolation')
479479
wrap = traits.List(
480-
traits.Int(),
481-
minlen=3,
480+
traits.Int(),
481+
minlen=3,
482482
maxlen=3,
483483
field='eoptions.ewrap',
484484
desc='Check if interpolation should wrap in [x,y,z]')
485485
est_basis_func = traits.List(
486-
traits.Int(),
487-
minlen=2,
486+
traits.Int(),
487+
minlen=2,
488488
maxlen=2,
489489
field='uweoptions.basfcn',
490490
desc='Number of basis functions to use for each dimension')
491491
est_reg_order = traits.Range(
492-
low=0,
493-
high=3,
492+
low=0,
493+
high=3,
494494
field='uweoptions.regorder',
495495
desc=('This parameter determines how to balance the compromise between likelihood '
496496
'maximization and smoothness maximization of the estimated field.'))
497497
est_reg_factor = traits.ListInt(
498-
[100000],
498+
[100000],
499499
field='uweoptions.lambda',
500-
minlen=1,
500+
minlen=1,
501501
maxlen=1,
502502
usedefault=True,
503503
desc='Regularisation factor. Default: 100000 (medium).')
@@ -506,60 +506,60 @@ class RealignUnwarpInputSpec(SPMCommandInputSpec):
506506
desc=('Jacobian deformations. In theory a good idea to include them, '
507507
' in practice a bad idea. Default: No.'))
508508
est_first_order_effects = traits.List(
509-
traits.Int(),
510-
minlen=1,
509+
traits.Int(),
510+
minlen=1,
511511
maxlen=6,
512512
field='uweoptions.fot',
513513
desc='First order effects should only depend on pitch and roll, i.e. [4 5]')
514514
est_second_order_effects = traits.List(
515-
traits.Int(),
516-
minlen=1,
515+
traits.Int(),
516+
minlen=1,
517517
maxlen=6,
518518
field='uweoptions.sot',
519519
desc='List of second order terms to model second derivatives of.')
520520
est_unwarp_fwhm = traits.Range(
521-
low=0.0,
521+
low=0.0,
522522
field='uweoptions.uwfwhm',
523523
desc='gaussian smoothing kernel width for unwarp')
524524
est_re_est_mov_par = traits.Bool(
525525
field='uweoptions.rem',
526526
desc='Re-estimate movement parameters at each unwarping iteration.')
527527
est_num_of_iterations = traits.ListInt(
528-
[5],
528+
[5],
529529
field='uweoptions.noi',
530-
minlen=1,
531-
maxlen=1,
530+
minlen=1,
531+
maxlen=1,
532532
usedefault=True,
533533
desc='Number of iterations.')
534534
est_taylor_expansion_point = traits.String(
535-
'Average',
535+
'Average',
536536
field='uweoptions.expround',
537537
usedefault=True,
538538
desc='Point in position space to perform Taylor-expansion around.')
539539
reslice_which = traits.ListInt(
540-
[2, 1],
540+
[2, 1],
541541
field='uwroptions.uwwhich',
542-
minlen=2,
543-
maxlen=2,
542+
minlen=2,
543+
maxlen=2,
544544
usedefault=True,
545545
desc='determines which images to reslice')
546546
reslice_interp = traits.Range(
547-
low=0,
548-
high=7,
547+
low=0,
548+
high=7,
549549
field='uwroptions.rinterp',
550550
desc='degree of b-spline used for interpolation')
551551
reslice_wrap = traits.List(
552-
traits.Int(),
553-
minlen=3,
552+
traits.Int(),
553+
minlen=3,
554554
maxlen=3,
555555
field='uwroptions.wrap',
556556
desc='Check if interpolation should wrap in [x,y,z]')
557557
reslice_mask = traits.Bool(
558558
field='uwroptions.mask',
559559
desc='True/False mask output image')
560560
out_prefix = traits.String(
561-
'u',
562-
field='uwroptions.prefix',
561+
'u',
562+
field='uwroptions.prefix',
563563
usedefault=True,
564564
desc='realigned and unwarped output prefix')
565565

@@ -585,7 +585,7 @@ class RealignUnwarpOutputSpec(TraitedSpec):
585585

586586
class RealignUnwarp(SPMCommand):
587587
"""Use spm_uw_estimate for estimating within subject registration and unwarping
588-
of time series. Function accepts only one single field map. If in_files is a
588+
of time series. Function accepts only one single field map. If in_files is a
589589
list of files they will be treated as separate sessions but associated to the
590590
same fieldmap.
591591
@@ -617,7 +617,7 @@ def _format_arg(self, opt, spec, val):
617617
keep4d=False,
618618
separate_sessions=True)
619619
return super(RealignUnwarp, self)._format_arg(opt, spec, val)
620-
620+
621621

622622
def _parse_inputs(self, skip=()):
623623

@@ -630,7 +630,7 @@ def _parse_inputs(self, skip=()):
630630

631631
if isdefined(self.inputs.in_files):
632632
if isinstance(self.inputs.in_files, list):
633-
data = [dict(scans = sess, pmscan = pmscan)
633+
data = [dict(scans = sess, pmscan = pmscan)
634634
for sess in spmdict['data']['scans']]
635635
else:
636636
data = [dict(scans = spmdict['data']['scans'], pmscan = pmscan)]

Diff for: nipype/pipeline/engine/tests/test_engine.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ def test_write_graph_runs(tmpdir):
441441

442442
assert os.path.exists('graph.dot') or os.path.exists(
443443
'graph_detailed.dot')
444-
444+
445445
try:
446446
os.remove('graph.dot')
447447
except OSError:

Diff for: nipype/pipeline/plugins/legacymultiproc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class NonDaemonMixin(object):
8181
@property
8282
def daemon(self):
8383
return False
84-
84+
8585
@daemon.setter
8686
def daemon(self, val):
8787
pass

0 commit comments

Comments
 (0)