Skip to content

ENH: Support tckgen -select in MRtrix3 v3+ #2823

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jan 21, 2019
2 changes: 1 addition & 1 deletion .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Josh Warner <[email protected]> JDWarner <[email protected]
Josh Warner <[email protected]> Josh Warner (Mac) <[email protected]>
Kai Schlamp <[email protected]> medihack <[email protected]>Jessica Forbes <[email protected]> jessicaforbes <[email protected]>
Katie Bottenhorn <[email protected]> 62442katieb <[email protected]>
Kesshi Jordan <[email protected]> Kesshi Jordan <[email protected]>
Kesshi Jordan <[email protected]> Kesshi Jordan <[email protected]>
Kesshi Jordan <[email protected]> Kesshi Jordan <[email protected]>
Kesshi Jordan <[email protected]> Kesshi Jordan <[email protected]>
Kesshi Jordan <[email protected]> Kesshi Jordan <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ To participate in the Nipype development related discussions please use the foll

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

You can even hangout with the Nipype developers in their
You can even hangout with the Nipype developers in their
`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.)


Expand Down
4 changes: 2 additions & 2 deletions doc/devel/interface_specs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ In case of trouble, we encourage you to post on `NeuroStars <https://neurostars.
NeuroStars.org is a platform similar to StackOverflow but dedicated to neuroinformatics.
You can also post on the nipype developers mailing list: http://mail.python.org/mailman/listinfo/neuroimaging.
As we are sharing a mailing list with the nipy community, please add ``[nipype]`` to the message title.
Alternatively, you're welcome to chat with us in the Nipype
`Gitter <https://gitter.im/nipy/nipype>`_ channel or in the
Alternatively, you're welcome to chat with us in the Nipype
`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.)

Expand Down
2 changes: 1 addition & 1 deletion nipype/interfaces/dcm2nii.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ class Dcm2niix(CommandLine):
converts any files in the directory containing the files in the list. We
also do not support nested filenames with this option. **Thus all files
must have a common root directory.**

>>> converter = Dcm2niix()
>>> converter.inputs.source_names = ['functional_1.dcm', 'functional_2.dcm']
>>> converter.inputs.compression = 5
Expand Down
14 changes: 10 additions & 4 deletions nipype/interfaces/fsl/tests/test_auto_Eddy.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
def test_Eddy_inputs():
input_map = dict(
args=dict(argstr='%s', ),
cnr_maps=dict(
argstr='--cnr_maps',
min_ver='5.0.10',
),
dont_peas=dict(argstr='--dont_peas', ),
dont_sep_offs_move=dict(argstr='--dont_sep_offs_move', ),
environ=dict(
Expand Down Expand Up @@ -71,11 +75,13 @@ def test_Eddy_inputs():
),
output_type=dict(),
repol=dict(argstr='--repol', ),
residuals=dict(
argstr='--residuals',
min_ver='5.0.10',
),
session=dict(argstr='--session=%s', ),
slm=dict(argstr='--slm=%s', ),
use_cuda=dict(),
cnr_maps=dict(argstr='--cnr_maps', min_ver='5.0.10', ),
residuals=dict(argstr='--residuals', min_ver='5.0.10', ),
)
inputs = Eddy.input_spec()

Expand All @@ -84,15 +90,15 @@ def test_Eddy_inputs():
assert getattr(inputs.traits()[key], metakey) == value
def test_Eddy_outputs():
output_map = dict(
out_cnr_maps=dict(),
out_corrected=dict(),
out_movement_rms=dict(),
out_outlier_report=dict(),
out_parameter=dict(),
out_residuals=dict(),
out_restricted_movement_rms=dict(),
out_rotated_bvecs=dict(),
out_shell_alignment_parameters=dict(),
out_cnr_maps=dict(),
out_residuals=dict(),
)
outputs = Eddy.output_spec()

Expand Down
9 changes: 8 additions & 1 deletion nipype/interfaces/mrtrix3/tests/test_auto_Tractography.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ def test_Tractography_inputs():
argstr='-samples %d',
usedefault=True,
),
n_tracks=dict(argstr='-number %d', ),
n_tracks=dict(
argstr='-number %d',
max_ver=0.4,
),
n_trials=dict(argstr='-trials %d', ),
noprecompt=dict(argstr='-noprecomputed', ),
nthreads=dict(
Expand Down Expand Up @@ -77,6 +80,10 @@ def test_Tractography_inputs():
xor=['seed_image', 'seed_grid_voxel'],
),
seed_sphere=dict(argstr='-seed_sphere %f,%f,%f,%f', ),
select=dict(
argstr='-select %d',
min_ver=3,
),
sph_trait=dict(argstr='%f,%f,%f,%f', ),
step_size=dict(argstr='-step %f', ),
stop=dict(argstr='-stop', ),
Expand Down
7 changes: 7 additions & 0 deletions nipype/interfaces/mrtrix3/tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ class TractographyInputSpec(MRTrix3BaseInputSpec):
'is 90deg x stepsize / voxelsize)'))
n_tracks = traits.Int(
argstr='-number %d',
max_ver=0.4,
desc=('set the desired number of tracks. The program will continue'
' to generate tracks until this number of tracks have been '
'selected and written to the output file'))
select = traits.Int(
argstr='-select %d',
min_ver=3,
desc=('set the desired number of tracks. The program will continue'
' to generate tracks until this number of tracks have been '
'selected and written to the output file'))
Expand Down
4 changes: 2 additions & 2 deletions nipype/interfaces/spm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

from .base import (Info, SPMCommand, logger, no_spm, scans_for_fname,
scans_for_fnames)
from .preprocess import (FieldMap, SliceTiming, Realign, RealignUnwarp,
from .preprocess import (FieldMap, SliceTiming, Realign, RealignUnwarp,
Coregister, Normalize, Normalize12, Segment,
Smooth, NewSegment, DARTEL, DARTELNorm2MNI,
Smooth, NewSegment, DARTEL, DARTELNorm2MNI,
CreateWarped, VBMSegment)
from .model import (Level1Design, EstimateModel, EstimateContrast, Threshold,
OneSampleTTestDesign, TwoSampleTTestDesign,
Expand Down
74 changes: 37 additions & 37 deletions nipype/interfaces/spm/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ class RealignUnwarpInputSpec(SPMCommandInputSpec):
traits.Either(ImageFileSPM(exists=True),
traits.List(ImageFileSPM(exists=True))),
field='data.scans',
mandatory=True,
mandatory=True,
copyfile=True,
desc='list of filenames to realign and unwarp')
phase_map = File(
Expand All @@ -452,52 +452,52 @@ class RealignUnwarpInputSpec(SPMCommandInputSpec):
'behaviour, the same map will be used for all sessions',
copyfile=False)
quality = traits.Range(
low=0.0,
high=1.0,
low=0.0,
high=1.0,
field='eoptions.quality',
desc='0.1 = fast, 1.0 = precise')
fwhm = traits.Range(
low=0.0,
low=0.0,
field='eoptions.fwhm',
desc='gaussian smoothing kernel width')
separation = traits.Range(
low=0.0,
low=0.0,
field='eoptions.sep',
desc='sampling separation in mm')
register_to_mean = traits.Bool(
field='eoptions.rtm',
desc='Indicate whether realignment is done to the mean image')
weight_img = File(
exists=True,
exists=True,
field='eoptions.weight',
desc='filename of weighting image')
interp = traits.Range(
low=0,
high=7,
low=0,
high=7,
field='eoptions.einterp',
desc='degree of b-spline used for interpolation')
wrap = traits.List(
traits.Int(),
minlen=3,
traits.Int(),
minlen=3,
maxlen=3,
field='eoptions.ewrap',
desc='Check if interpolation should wrap in [x,y,z]')
est_basis_func = traits.List(
traits.Int(),
minlen=2,
traits.Int(),
minlen=2,
maxlen=2,
field='uweoptions.basfcn',
desc='Number of basis functions to use for each dimension')
est_reg_order = traits.Range(
low=0,
high=3,
low=0,
high=3,
field='uweoptions.regorder',
desc=('This parameter determines how to balance the compromise between likelihood '
'maximization and smoothness maximization of the estimated field.'))
est_reg_factor = traits.ListInt(
[100000],
[100000],
field='uweoptions.lambda',
minlen=1,
minlen=1,
maxlen=1,
usedefault=True,
desc='Regularisation factor. Default: 100000 (medium).')
Expand All @@ -506,60 +506,60 @@ class RealignUnwarpInputSpec(SPMCommandInputSpec):
desc=('Jacobian deformations. In theory a good idea to include them, '
' in practice a bad idea. Default: No.'))
est_first_order_effects = traits.List(
traits.Int(),
minlen=1,
traits.Int(),
minlen=1,
maxlen=6,
field='uweoptions.fot',
desc='First order effects should only depend on pitch and roll, i.e. [4 5]')
est_second_order_effects = traits.List(
traits.Int(),
minlen=1,
traits.Int(),
minlen=1,
maxlen=6,
field='uweoptions.sot',
desc='List of second order terms to model second derivatives of.')
est_unwarp_fwhm = traits.Range(
low=0.0,
low=0.0,
field='uweoptions.uwfwhm',
desc='gaussian smoothing kernel width for unwarp')
est_re_est_mov_par = traits.Bool(
field='uweoptions.rem',
desc='Re-estimate movement parameters at each unwarping iteration.')
est_num_of_iterations = traits.ListInt(
[5],
[5],
field='uweoptions.noi',
minlen=1,
maxlen=1,
minlen=1,
maxlen=1,
usedefault=True,
desc='Number of iterations.')
est_taylor_expansion_point = traits.String(
'Average',
'Average',
field='uweoptions.expround',
usedefault=True,
desc='Point in position space to perform Taylor-expansion around.')
reslice_which = traits.ListInt(
[2, 1],
[2, 1],
field='uwroptions.uwwhich',
minlen=2,
maxlen=2,
minlen=2,
maxlen=2,
usedefault=True,
desc='determines which images to reslice')
reslice_interp = traits.Range(
low=0,
high=7,
low=0,
high=7,
field='uwroptions.rinterp',
desc='degree of b-spline used for interpolation')
reslice_wrap = traits.List(
traits.Int(),
minlen=3,
traits.Int(),
minlen=3,
maxlen=3,
field='uwroptions.wrap',
desc='Check if interpolation should wrap in [x,y,z]')
reslice_mask = traits.Bool(
field='uwroptions.mask',
desc='True/False mask output image')
out_prefix = traits.String(
'u',
field='uwroptions.prefix',
'u',
field='uwroptions.prefix',
usedefault=True,
desc='realigned and unwarped output prefix')

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

class RealignUnwarp(SPMCommand):
"""Use spm_uw_estimate for estimating within subject registration and unwarping
of time series. Function accepts only one single field map. If in_files is a
of time series. Function accepts only one single field map. If in_files is a
list of files they will be treated as separate sessions but associated to the
same fieldmap.

Expand Down Expand Up @@ -617,7 +617,7 @@ def _format_arg(self, opt, spec, val):
keep4d=False,
separate_sessions=True)
return super(RealignUnwarp, self)._format_arg(opt, spec, val)


def _parse_inputs(self, skip=()):

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

if isdefined(self.inputs.in_files):
if isinstance(self.inputs.in_files, list):
data = [dict(scans = sess, pmscan = pmscan)
data = [dict(scans = sess, pmscan = pmscan)
for sess in spmdict['data']['scans']]
else:
data = [dict(scans = spmdict['data']['scans'], pmscan = pmscan)]
Expand Down
2 changes: 1 addition & 1 deletion nipype/pipeline/engine/tests/test_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ def test_write_graph_runs(tmpdir):

assert os.path.exists('graph.dot') or os.path.exists(
'graph_detailed.dot')

try:
os.remove('graph.dot')
except OSError:
Expand Down
2 changes: 1 addition & 1 deletion nipype/pipeline/plugins/legacymultiproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class NonDaemonMixin(object):
@property
def daemon(self):
return False

@daemon.setter
def daemon(self, val):
pass
Expand Down