nipype.interfaces.fsl.dti module

The fsl module provides classes for interfacing with the FSL command line tools. This was written to work with FSL version 4.1.4.

BEDPOSTX

Link to code

alias of BEDPOSTX5

BEDPOSTX5

Link to code

Bases: FSLXCommand

Wrapped executable: bedpostx.

BEDPOSTX stands for Bayesian Estimation of Diffusion Parameters Obtained using Sampling Techniques. The X stands for modelling Crossing Fibres. bedpostx runs Markov Chain Monte Carlo sampling to build up distributions on diffusion parameters at each voxel. It creates all the files necessary for running probabilistic tractography. For an overview of the modelling carried out within bedpostx see this technical report.

Note

Consider using niflow.nipype1.workflows.fsl.dmri.create_bedpostx_pipeline() instead.

Example

>>> from nipype.interfaces import fsl
>>> bedp = fsl.BEDPOSTX5(bvecs='bvecs', bvals='bvals', dwi='diffusion.nii',
...                     mask='mask.nii', n_fibres=1)
>>> bedp.cmdline
'bedpostx bedpostx -b 0 --burnin_noard=0 --forcedir -n 1 -j 5000 -s 1 --updateproposalevery=40'
bvalsa pathlike object or string representing an existing file

B values file.

bvecsa pathlike object or string representing an existing file

B vectors file.

dwia pathlike object or string representing an existing file

Diffusion weighted image data file.

maska pathlike object or string representing an existing file

Bet binary mask file.

n_fibresan integer >= 1

Maximum number of fibres to fit in each voxel. Maps to a command-line argument: -n %d. (Nipype default value: 2)

out_dira pathlike object or string representing a directory

Output directory. Maps to a command-line argument: %s (position: 1). (Nipype default value: bedpostx)

all_arda boolean

Turn ARD on on all fibres. Maps to a command-line argument: --allard. Mutually exclusive with inputs: no_ard, all_ard.

argsa string

Additional parameters to the command. Maps to a command-line argument: %s.

burn_inan integer >= 0

Total num of jumps at start of MCMC to be discarded. Maps to a command-line argument: -b %d. (Nipype default value: 0)

burn_in_no_ardan integer >= 0

Num of burnin jumps before the ard is imposed. Maps to a command-line argument: --burnin_noard=%d. (Nipype default value: 0)

cnlineara boolean

Initialise with constrained nonlinear fitting. Maps to a command-line argument: --cnonlinear. Mutually exclusive with inputs: no_spat, non_linear, cnlinear.

environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

Environment variables. (Nipype default value: {})

f0_arda boolean

Noise floor model: add to the model an unattenuated signal compartment f0. Maps to a command-line argument: --f0 --ardf0. Mutually exclusive with inputs: f0_noard, f0_ard, all_ard.

f0_noarda boolean

Noise floor model: add to the model an unattenuated signal compartment f0. Maps to a command-line argument: --f0. Mutually exclusive with inputs: f0_noard, f0_ard.

force_dira boolean

Use the actual directory name given (do not add + to make a new directory). Maps to a command-line argument: --forcedir. (Nipype default value: True)

fudgean integer

ARD fudge factor. Maps to a command-line argument: -w %d.

grad_deva pathlike object or string representing an existing file

Grad_dev file, if gradnonlin, -g is True.

gradnonlina boolean

Consider gradient nonlinearities, default off. Maps to a command-line argument: -g.

logdira pathlike object or string representing a directory

Maps to a command-line argument: --logdir=%s.

model1 or 2 or 3

Use monoexponential (1, default, required for single-shell) or multiexponential (2, multi-shell) model. Maps to a command-line argument: -model %d.

n_jumpsan integer

Num of jumps to be made by MCMC. Maps to a command-line argument: -j %d. (Nipype default value: 5000)

no_arda boolean

Turn ARD off on all fibres. Maps to a command-line argument: --noard. Mutually exclusive with inputs: no_ard, all_ard.

no_spata boolean

Initialise with tensor, not spatially. Maps to a command-line argument: --nospat. Mutually exclusive with inputs: no_spat, non_linear, cnlinear.

non_lineara boolean

Initialise with nonlinear fitting. Maps to a command-line argument: --nonlinear. Mutually exclusive with inputs: no_spat, non_linear, cnlinear.

output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’ or ‘GIFTI’

FSL output type.

riciana boolean

Use Rician noise modeling. Maps to a command-line argument: --rician.

sample_everyan integer >= 0

Num of jumps for each sample (MCMC). Maps to a command-line argument: -s %d. (Nipype default value: 1)

seedan integer

Seed for pseudo random number generator. Maps to a command-line argument: --seed=%d.

update_proposal_everyan integer >= 1

Num of jumps for each update to the proposal density std (MCMC). Maps to a command-line argument: --updateproposalevery=%d. (Nipype default value: 40)

use_gpua boolean

Use the GPU version of bedpostx.

dyadsa list of items which are a pathlike object or string representing an existing file

Mean of PDD distribution in vector form.

dyads_dispersiona list of items which are a pathlike object or string representing an existing file

Dispersion.

mean_S0samplesa pathlike object or string representing an existing file

Mean of distribution on T2w baseline signal intensity S0.

mean_dsamplesa pathlike object or string representing an existing file

Mean of distribution on diffusivity d.

mean_fsamplesa list of items which are a pathlike object or string representing an existing file

Mean of distribution on f anisotropy.

mean_phsamplesa list of items which are a pathlike object or string representing an existing file

Mean of distribution on phi.

mean_thsamplesa list of items which are a pathlike object or string representing an existing file

Mean of distribution on theta.

merged_fsamplesa list of items which are a pathlike object or string representing an existing file

Samples from the distribution on anisotropic volume fraction.

merged_phsamplesa list of items which are a pathlike object or string representing an existing file

Samples from the distribution on phi.

merged_thsamplesa list of items which are a pathlike object or string representing an existing file

Samples from the distribution on theta.

DTIFit

Link to code

Bases: FSLCommand

Wrapped executable: dtifit.

Use FSL dtifit command for fitting a diffusion tensor model at each voxel

Example

>>> from nipype.interfaces import fsl
>>> dti = fsl.DTIFit()
>>> dti.inputs.dwi = 'diffusion.nii'
>>> dti.inputs.bvecs = 'bvecs'
>>> dti.inputs.bvals = 'bvals'
>>> dti.inputs.base_name = 'TP'
>>> dti.inputs.mask = 'mask.nii'
>>> dti.cmdline
'dtifit -k diffusion.nii -o TP -m mask.nii -r bvecs -b bvals'
bvalsa pathlike object or string representing an existing file

B values file. Maps to a command-line argument: -b %s (position: 4).

bvecsa pathlike object or string representing an existing file

B vectors file. Maps to a command-line argument: -r %s (position: 3).

dwia pathlike object or string representing an existing file

Diffusion weighted image data file. Maps to a command-line argument: -k %s (position: 0).

maska pathlike object or string representing an existing file

Bet binary mask file. Maps to a command-line argument: -m %s (position: 2).

argsa string

Additional parameters to the command. Maps to a command-line argument: %s.

base_namea string

Base_name that all output files will start with. Maps to a command-line argument: -o %s (position: 1). (Nipype default value: dtifit_)

cnia pathlike object or string representing an existing file

Input counfound regressors. Maps to a command-line argument: --cni=%s.

environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

Environment variables. (Nipype default value: {})

gradnonlina pathlike object or string representing an existing file

Gradient non linearities. Maps to a command-line argument: --gradnonlin=%s.

little_bita boolean

Only process small area of brain. Maps to a command-line argument: --littlebit.

max_xan integer

Max x. Maps to a command-line argument: -X %d.

max_yan integer

Max y. Maps to a command-line argument: -Y %d.

max_zan integer

Max z. Maps to a command-line argument: -Z %d.

min_xan integer

Min x. Maps to a command-line argument: -x %d.

min_yan integer

Min y. Maps to a command-line argument: -y %d.

min_zan integer

Min z. Maps to a command-line argument: -z %d.

output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’ or ‘GIFTI’

FSL output type.

save_tensora boolean

Save the elements of the tensor. Maps to a command-line argument: --save_tensor.

ssea boolean

Output sum of squared errors. Maps to a command-line argument: --sse.

FAa pathlike object or string representing an existing file

Path/name of file with the fractional anisotropy.

L1a pathlike object or string representing an existing file

Path/name of file with the 1st eigenvalue.

L2a pathlike object or string representing an existing file

Path/name of file with the 2nd eigenvalue.

L3a pathlike object or string representing an existing file

Path/name of file with the 3rd eigenvalue.

MDa pathlike object or string representing an existing file

Path/name of file with the mean diffusivity.

MOa pathlike object or string representing an existing file

Path/name of file with the mode of anisotropy.

S0a pathlike object or string representing an existing file

Path/name of file with the raw T2 signal with no diffusion weighting.

V1a pathlike object or string representing an existing file

Path/name of file with the 1st eigenvector.

V2a pathlike object or string representing an existing file

Path/name of file with the 2nd eigenvector.

V3a pathlike object or string representing an existing file

Path/name of file with the 3rd eigenvector.

ssea pathlike object or string representing an existing file

Path/name of file with the summed squared error.

tensora pathlike object or string representing an existing file

Path/name of file with the 4D tensor volume.

DistanceMap

Link to code

Bases: FSLCommand

Wrapped executable: distancemap.

Use FSL’s distancemap to generate a map of the distance to the nearest nonzero voxel.

Example

>>> import nipype.interfaces.fsl as fsl
>>> mapper = fsl.DistanceMap()
>>> mapper.inputs.in_file = "skeleton_mask.nii.gz"
>>> mapper.run()
in_filea pathlike object or string representing an existing file

Image to calculate distance values for. Maps to a command-line argument: --in=%s.

argsa string

Additional parameters to the command. Maps to a command-line argument: %s.

distance_mapa pathlike object or string representing a file

Distance map to write. Maps to a command-line argument: --out=%s.

environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

Environment variables. (Nipype default value: {})

invert_inputa boolean

Invert input image. Maps to a command-line argument: --invert.

local_max_filea boolean or a pathlike object or string representing a file

Write an image of the local maxima. Maps to a command-line argument: --localmax=%s.

mask_filea pathlike object or string representing an existing file

Binary mask to constrain calculations. Maps to a command-line argument: --mask=%s.

output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’ or ‘GIFTI’

FSL output type.

distance_mapa pathlike object or string representing an existing file

Value is distance to nearest nonzero voxels.

local_max_filea pathlike object or string representing a file

Image of local maxima.

FSLXCommand

Link to code

Bases: FSLCommand

Base support for xfibres and bedpostx

bvalsa pathlike object or string representing an existing file

B values file. Maps to a command-line argument: --bvals=%s.

bvecsa pathlike object or string representing an existing file

B vectors file. Maps to a command-line argument: --bvecs=%s.

dwia pathlike object or string representing an existing file

Diffusion weighted image data file. Maps to a command-line argument: --data=%s.

maska pathlike object or string representing an existing file

Brain binary mask file (i.e. from BET). Maps to a command-line argument: --mask=%s.

n_fibresan integer >= 1

Maximum number of fibres to fit in each voxel. Maps to a command-line argument: --nfibres=%d. (Nipype default value: 2)

all_arda boolean

Turn ARD on on all fibres. Maps to a command-line argument: --allard. Mutually exclusive with inputs: no_ard, all_ard.

argsa string

Additional parameters to the command. Maps to a command-line argument: %s.

burn_inan integer >= 0

Total num of jumps at start of MCMC to be discarded. Maps to a command-line argument: --burnin=%d. (Nipype default value: 0)

burn_in_no_ardan integer >= 0

Num of burnin jumps before the ard is imposed. Maps to a command-line argument: --burnin_noard=%d. (Nipype default value: 0)

cnlineara boolean

Initialise with constrained nonlinear fitting. Maps to a command-line argument: --cnonlinear. Mutually exclusive with inputs: no_spat, non_linear, cnlinear.

environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

Environment variables. (Nipype default value: {})

f0_arda boolean

Noise floor model: add to the model an unattenuated signal compartment f0. Maps to a command-line argument: --f0 --ardf0. Mutually exclusive with inputs: f0_noard, f0_ard, all_ard.

f0_noarda boolean

Noise floor model: add to the model an unattenuated signal compartment f0. Maps to a command-line argument: --f0. Mutually exclusive with inputs: f0_noard, f0_ard.

force_dira boolean

Use the actual directory name given (do not add + to make a new directory). Maps to a command-line argument: --forcedir. (Nipype default value: True)

fudgean integer

ARD fudge factor. Maps to a command-line argument: --fudge=%d.

logdira pathlike object or string representing a directory

Maps to a command-line argument: --logdir=%s. (Nipype default value: .)

model1 or 2 or 3

Use monoexponential (1, default, required for single-shell) or multiexponential (2, multi-shell) model. Maps to a command-line argument: --model=%d.

n_jumpsan integer

Num of jumps to be made by MCMC. Maps to a command-line argument: --njumps=%d. (Nipype default value: 5000)

no_arda boolean

Turn ARD off on all fibres. Maps to a command-line argument: --noard. Mutually exclusive with inputs: no_ard, all_ard.

no_spata boolean

Initialise with tensor, not spatially. Maps to a command-line argument: --nospat. Mutually exclusive with inputs: no_spat, non_linear, cnlinear.

non_lineara boolean

Initialise with nonlinear fitting. Maps to a command-line argument: --nonlinear. Mutually exclusive with inputs: no_spat, non_linear, cnlinear.

output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’ or ‘GIFTI’

FSL output type.

riciana boolean

Use Rician noise modeling. Maps to a command-line argument: --rician.

sample_everyan integer >= 0

Num of jumps for each sample (MCMC). Maps to a command-line argument: --sampleevery=%d. (Nipype default value: 1)

seedan integer

Seed for pseudo random number generator. Maps to a command-line argument: --seed=%d.

update_proposal_everyan integer >= 1

Num of jumps for each update to the proposal density std (MCMC). Maps to a command-line argument: --updateproposalevery=%d. (Nipype default value: 40)

dyadsa list of items which are a pathlike object or string representing an existing file

Mean of PDD distribution in vector form.

fsamplesa list of items which are a pathlike object or string representing an existing file

Samples from the distribution on f anisotropy.

mean_S0samplesa pathlike object or string representing an existing file

Mean of distribution on T2w baseline signal intensity S0.

mean_dsamplesa pathlike object or string representing an existing file

Mean of distribution on diffusivity d.

mean_fsamplesa list of items which are a pathlike object or string representing an existing file

Mean of distribution on f anisotropy.

mean_tausamplesa pathlike object or string representing an existing file

Mean of distribution on tau samples (only with rician noise).

phsamplesa list of items which are a pathlike object or string representing an existing file

Phi samples, per fiber.

thsamplesa list of items which are a pathlike object or string representing an existing file

Theta samples, per fiber.

FindTheBiggest

Link to code

Bases: FSLCommand

Wrapped executable: find_the_biggest.

Use FSL find_the_biggest for performing hard segmentation on the outputs of connectivity-based thresholding in probtrack. For complete details, see the FDT Documentation.

Example

>>> from nipype.interfaces import fsl
>>> ldir = ['seeds_to_M1.nii', 'seeds_to_M2.nii']
>>> fBig = fsl.FindTheBiggest(in_files=ldir, out_file='biggestSegmentation')
>>> fBig.cmdline
'find_the_biggest seeds_to_M1.nii seeds_to_M2.nii biggestSegmentation'
in_filesa list of items which are a pathlike object or string representing an existing file

A list of input volumes or a singleMatrixFile. Maps to a command-line argument: %s (position: 0).

argsa string

Additional parameters to the command. Maps to a command-line argument: %s.

environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

Environment variables. (Nipype default value: {})

out_filea pathlike object or string representing a file

File with the resulting segmentation. Maps to a command-line argument: %s (position: 2).

output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’ or ‘GIFTI’

FSL output type.

out_filea pathlike object or string representing an existing file

Output file indexed in order of input files. Maps to a command-line argument: %s.

MakeDyadicVectors

Link to code

Bases: FSLCommand

Wrapped executable: make_dyadic_vectors.

Create vector volume representing mean principal diffusion direction and its uncertainty (dispersion)

phi_vola pathlike object or string representing an existing file

Maps to a command-line argument: %s (position: 1).

theta_vola pathlike object or string representing an existing file

Maps to a command-line argument: %s (position: 0).

argsa string

Additional parameters to the command. Maps to a command-line argument: %s.

environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

Environment variables. (Nipype default value: {})

maska pathlike object or string representing an existing file

Maps to a command-line argument: %s (position: 2).

outputa pathlike object or string representing a file

Maps to a command-line argument: %s (position: 3). (Nipype default value: dyads)

output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’ or ‘GIFTI’

FSL output type.

perca float

The {perc}% angle of the output cone of uncertainty (output will be in degrees). Maps to a command-line argument: %f (position: 4).

dispersion : a pathlike object or string representing an existing file dyads : a pathlike object or string representing an existing file

ProbTrackX

Link to code

Bases: FSLCommand

Wrapped executable: probtrackx.

Use FSL probtrackx for tractography on bedpostx results

Examples

>>> from nipype.interfaces import fsl
>>> pbx = fsl.ProbTrackX(samples_base_name='merged', mask='mask.nii',     seed='MASK_average_thal_right.nii', mode='seedmask',     xfm='trans.mat', n_samples=3, n_steps=10, force_dir=True, opd=True,     os2t=True, target_masks = ['targets_MASK1.nii', 'targets_MASK2.nii'],     thsamples='merged_thsamples.nii', fsamples='merged_fsamples.nii',     phsamples='merged_phsamples.nii', out_dir='.')
>>> pbx.cmdline
'probtrackx --forcedir -m mask.nii --mode=seedmask --nsamples=3 --nsteps=10 --opd --os2t --dir=. --samples=merged --seed=MASK_average_thal_right.nii --targetmasks=targets.txt --xfm=trans.mat'

fsamples : a list of items which are a pathlike object or string representing an existing file mask : a pathlike object or string representing an existing file

Bet binary mask file in diffusion space. Maps to a command-line argument: -m %s.

phsamples : a list of items which are a pathlike object or string representing an existing file seed : a pathlike object or string representing an existing file or a list of items which are a pathlike object or string representing an existing file or a list of items which are a list of from 3 to 3 items which are an integer

Seed volume(s), or voxel(s) or freesurfer label file. Maps to a command-line argument: --seed=%s.

thsamples : a list of items which are a pathlike object or string representing an existing file

argsa string

Additional parameters to the command. Maps to a command-line argument: %s.

avoid_mpa pathlike object or string representing an existing file

Reject pathways passing through locations given by this mask. Maps to a command-line argument: --avoid=%s.

c_thresha float

Curvature threshold - default=0.2. Maps to a command-line argument: --cthr=%.3f.

correct_path_distributiona boolean

Correct path distribution for the length of the pathways. Maps to a command-line argument: --pd.

dist_thresha float

Discards samples shorter than this threshold (in mm - default=0). Maps to a command-line argument: --distthresh=%.3f.

environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

Environment variables. (Nipype default value: {})

fibstan integer

Force a starting fibre for tracking - default=1, i.e. first fibre orientation. Only works if randfib==0. Maps to a command-line argument: --fibst=%d.

force_dira boolean

Use the actual directory name given - i.e. do not add + to make a new directory. Maps to a command-line argument: --forcedir. (Nipype default value: True)

inv_xfma pathlike object or string representing a file

Transformation matrix taking DTI space to seed space (compulsory when using a warp_field for seeds_to_dti). Maps to a command-line argument: --invxfm=%s.

loop_checka boolean

Perform loop_checks on paths - slower, but allows lower curvature threshold. Maps to a command-line argument: --loopcheck.

mask2a pathlike object or string representing an existing file

Second bet binary mask (in diffusion space) in twomask_symm mode. Maps to a command-line argument: --mask2=%s.

mesha pathlike object or string representing an existing file

Freesurfer-type surface descriptor (in ascii format). Maps to a command-line argument: --mesh=%s.

mod_eulera boolean

Use modified euler streamlining. Maps to a command-line argument: --modeuler.

mode‘simple’ or ‘two_mask_symm’ or ‘seedmask’

Options: simple (single seed voxel), seedmask (mask of seed voxels), twomask_symm (two bet binary masks). Maps to a command-line argument: --mode=%s.

n_samplesan integer

Number of samples - default=5000. Maps to a command-line argument: --nsamples=%d. (Nipype default value: 5000)

n_stepsan integer

Number of steps per sample - default=2000. Maps to a command-line argument: --nsteps=%d.

networka boolean

Activate network mode - only keep paths going through at least one seed mask (required if multiple seed masks). Maps to a command-line argument: --network.

opda boolean

Outputs path distributions. Maps to a command-line argument: --opd. (Nipype default value: True)

os2ta boolean

Outputs seeds to targets. Maps to a command-line argument: --os2t.

out_dira pathlike object or string representing an existing directory

Directory to put the final volumes in. Maps to a command-line argument: --dir=%s.

output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’ or ‘GIFTI’

FSL output type.

rand_fib0 or 1 or 2 or 3

Options: 0 - default, 1 - to randomly sample initial fibres (with f > fibthresh), 2 - to sample in proportion fibres (with f>fibthresh) to f, 3 - to sample ALL populations at random (even if f<fibthresh). Maps to a command-line argument: --randfib=%d.

random_seedan integer

Random seed. Maps to a command-line argument: --rseed=%d.

s2tastexta boolean

Output seed-to-target counts as a text file (useful when seeding from a mesh). Maps to a command-line argument: --s2tastext.

sample_random_pointsa float

Sample random points within seed voxels. Maps to a command-line argument: --sampvox=%.3f.

samples_base_namea string

The rootname/base_name for samples files. Maps to a command-line argument: --samples=%s. (Nipype default value: merged)

seed_refa pathlike object or string representing an existing file

Reference vol to define seed space in simple mode - diffusion space assumed if absent. Maps to a command-line argument: --seedref=%s.

step_lengtha float

Step_length in mm - default=0.5. Maps to a command-line argument: --steplength=%.3f.

stop_maska pathlike object or string representing an existing file

Stop tracking at locations given by this mask file. Maps to a command-line argument: --stop=%s.

target_masksa list of items which are a pathlike object or string representing a file

List of target masks - required for seeds_to_targets classification. Maps to a command-line argument: --targetmasks=%s.

use_anisotropya boolean

Use anisotropy to constrain tracking. Maps to a command-line argument: --usef.

verbose0 or 1 or 2

Verbose level, [0-2]. Level 2 is required to output particle files. Maps to a command-line argument: --verbose=%d.

waypointsa pathlike object or string representing an existing file

Waypoint mask or ascii list of waypoint masks - only keep paths going through ALL the masks. Maps to a command-line argument: --waypoints=%s.

xfma pathlike object or string representing an existing file

Transformation matrix taking seed space to DTI space (either FLIRT matrix or FNIRT warp_field) - default is identity. Maps to a command-line argument: --xfm=%s.

fdt_pathsa list of items which are a pathlike object or string representing an existing file

Path/name of a 3D image file containing the output connectivity distribution to the seed mask.

loga pathlike object or string representing an existing file

Path/name of a text record of the command that was run.

particle_filesa list of items which are a pathlike object or string representing an existing file

Files describing all of the tract samples. Generated only if verbose is set to 2.

targetsa list of items which are a pathlike object or string representing an existing file

A list with all generated seeds_to_target files.

way_totala pathlike object or string representing an existing file

Path/name of a text file containing a single number corresponding to the total number of generated tracts that have not been rejected by inclusion/exclusion mask criteria.

ProbTrackX2

Link to code

Bases: ProbTrackX

Wrapped executable: probtrackx2.

Use FSL probtrackx2 for tractography on bedpostx results

Examples

>>> from nipype.interfaces import fsl
>>> pbx2 = fsl.ProbTrackX2()
>>> pbx2.inputs.seed = 'seed_source.nii.gz'
>>> pbx2.inputs.thsamples = 'merged_th1samples.nii.gz'
>>> pbx2.inputs.fsamples = 'merged_f1samples.nii.gz'
>>> pbx2.inputs.phsamples = 'merged_ph1samples.nii.gz'
>>> pbx2.inputs.mask = 'nodif_brain_mask.nii.gz'
>>> pbx2.inputs.out_dir = '.'
>>> pbx2.inputs.n_samples = 3
>>> pbx2.inputs.n_steps = 10
>>> pbx2.cmdline
'probtrackx2 --forcedir -m nodif_brain_mask.nii.gz --nsamples=3 --nsteps=10 --opd --dir=. --samples=merged --seed=seed_source.nii.gz'

fsamples : a list of items which are a pathlike object or string representing an existing file mask : a pathlike object or string representing an existing file

Bet binary mask file in diffusion space. Maps to a command-line argument: -m %s.

phsamples : a list of items which are a pathlike object or string representing an existing file seed : a pathlike object or string representing an existing file or a list of items which are a pathlike object or string representing an existing file or a list of items which are a list of from 3 to 3 items which are an integer

Seed volume(s), or voxel(s) or freesurfer label file. Maps to a command-line argument: --seed=%s.

thsamples : a list of items which are a pathlike object or string representing an existing file

argsa string

Additional parameters to the command. Maps to a command-line argument: %s.

avoid_mpa pathlike object or string representing an existing file

Reject pathways passing through locations given by this mask. Maps to a command-line argument: --avoid=%s.

c_thresha float

Curvature threshold - default=0.2. Maps to a command-line argument: --cthr=%.3f.

colmask4a pathlike object or string representing an existing file

Mask for columns of matrix4 (default=seed mask). Maps to a command-line argument: --colmask4=%s.

correct_path_distributiona boolean

Correct path distribution for the length of the pathways. Maps to a command-line argument: --pd.

dist_thresha float

Discards samples shorter than this threshold (in mm - default=0). Maps to a command-line argument: --distthresh=%.3f.

distthresh1a float

Discards samples (in matrix1) shorter than this threshold (in mm - default=0). Maps to a command-line argument: --distthresh1=%.3f.

distthresh3a float

Discards samples (in matrix3) shorter than this threshold (in mm - default=0). Maps to a command-line argument: --distthresh3=%.3f.

environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

Environment variables. (Nipype default value: {})

fibstan integer

Force a starting fibre for tracking - default=1, i.e. first fibre orientation. Only works if randfib==0. Maps to a command-line argument: --fibst=%d.

fopda pathlike object or string representing an existing file

Other mask for binning tract distribution. Maps to a command-line argument: --fopd=%s.

force_dira boolean

Use the actual directory name given - i.e. do not add + to make a new directory. Maps to a command-line argument: --forcedir. (Nipype default value: True)

inv_xfma pathlike object or string representing a file

Transformation matrix taking DTI space to seed space (compulsory when using a warp_field for seeds_to_dti). Maps to a command-line argument: --invxfm=%s.

loop_checka boolean

Perform loop_checks on paths - slower, but allows lower curvature threshold. Maps to a command-line argument: --loopcheck.

lrtarget3a pathlike object or string representing an existing file

Column-space mask used for Nxn connectivity matrix. Maps to a command-line argument: --lrtarget3=%s.

meshspace‘caret’ or ‘freesurfer’ or ‘first’ or ‘vox’

Mesh reference space - either “caret” (default) or “freesurfer” or “first” or “vox”. Maps to a command-line argument: --meshspace=%s.

mod_eulera boolean

Use modified euler streamlining. Maps to a command-line argument: --modeuler.

n_samplesan integer

Number of samples - default=5000. Maps to a command-line argument: --nsamples=%d. (Nipype default value: 5000)

n_stepsan integer

Number of steps per sample - default=2000. Maps to a command-line argument: --nsteps=%d.

networka boolean

Activate network mode - only keep paths going through at least one seed mask (required if multiple seed masks). Maps to a command-line argument: --network.

omatrix1a boolean

Output matrix1 - SeedToSeed Connectivity. Maps to a command-line argument: --omatrix1.

omatrix2a boolean

Output matrix2 - SeedToLowResMask. Maps to a command-line argument: --omatrix2. Requires inputs: target2.

omatrix3a boolean

Output matrix3 (NxN connectivity matrix). Maps to a command-line argument: --omatrix3. Requires inputs: target3, lrtarget3.

omatrix4a boolean

Output matrix4 - DtiMaskToSeed (special Oxford Sparse Format). Maps to a command-line argument: --omatrix4.

onewayconditiona boolean

Apply waypoint conditions to each half tract separately. Maps to a command-line argument: --onewaycondition.

opda boolean

Outputs path distributions. Maps to a command-line argument: --opd. (Nipype default value: True)

os2ta boolean

Outputs seeds to targets. Maps to a command-line argument: --os2t.

out_dira pathlike object or string representing an existing directory

Directory to put the final volumes in. Maps to a command-line argument: --dir=%s.

output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’ or ‘GIFTI’

FSL output type.

rand_fib0 or 1 or 2 or 3

Options: 0 - default, 1 - to randomly sample initial fibres (with f > fibthresh), 2 - to sample in proportion fibres (with f>fibthresh) to f, 3 - to sample ALL populations at random (even if f<fibthresh). Maps to a command-line argument: --randfib=%d.

random_seedan integer

Random seed. Maps to a command-line argument: --rseed=%d.

s2tastexta boolean

Output seed-to-target counts as a text file (useful when seeding from a mesh). Maps to a command-line argument: --s2tastext.

sample_random_pointsa float

Sample random points within seed voxels. Maps to a command-line argument: --sampvox=%.3f.

samples_base_namea string

The rootname/base_name for samples files. Maps to a command-line argument: --samples=%s. (Nipype default value: merged)

seed_refa pathlike object or string representing an existing file

Reference vol to define seed space in simple mode - diffusion space assumed if absent. Maps to a command-line argument: --seedref=%s.

simplea boolean

Rack from a list of voxels (seed must be a ASCII list of coordinates). Maps to a command-line argument: --simple.

step_lengtha float

Step_length in mm - default=0.5. Maps to a command-line argument: --steplength=%.3f.

stop_maska pathlike object or string representing an existing file

Stop tracking at locations given by this mask file. Maps to a command-line argument: --stop=%s.

target2a pathlike object or string representing an existing file

Low resolution binary brain mask for storing connectivity distribution in matrix2 mode. Maps to a command-line argument: --target2=%s.

target3a pathlike object or string representing an existing file

Mask used for NxN connectivity matrix (or Nxn if lrtarget3 is set). Maps to a command-line argument: --target3=%s.

target4a pathlike object or string representing an existing file

Brain mask in DTI space. Maps to a command-line argument: --target4=%s.

target_masksa list of items which are a pathlike object or string representing a file

List of target masks - required for seeds_to_targets classification. Maps to a command-line argument: --targetmasks=%s.

use_anisotropya boolean

Use anisotropy to constrain tracking. Maps to a command-line argument: --usef.

verbose0 or 1 or 2

Verbose level, [0-2]. Level 2 is required to output particle files. Maps to a command-line argument: --verbose=%d.

waycond‘OR’ or ‘AND’

Waypoint condition. Either “AND” (default) or “OR”. Maps to a command-line argument: --waycond=%s.

wayordera boolean

Reject streamlines that do not hit waypoints in given order. Only valid if waycond=AND. Maps to a command-line argument: --wayorder.

waypointsa pathlike object or string representing an existing file

Waypoint mask or ascii list of waypoint masks - only keep paths going through ALL the masks. Maps to a command-line argument: --waypoints=%s.

xfma pathlike object or string representing an existing file

Transformation matrix taking seed space to DTI space (either FLIRT matrix or FNIRT warp_field) - default is identity. Maps to a command-line argument: --xfm=%s.

fdt_pathsa list of items which are a pathlike object or string representing an existing file

Path/name of a 3D image file containing the output connectivity distribution to the seed mask.

loga pathlike object or string representing an existing file

Path/name of a text record of the command that was run.

lookup_tractspacea pathlike object or string representing an existing file

Lookup_tractspace generated by –omatrix2 option.

matrix1_dota pathlike object or string representing an existing file

Output matrix1.dot - SeedToSeed Connectivity.

matrix2_dota pathlike object or string representing an existing file

Output matrix2.dot - SeedToLowResMask.

matrix3_dota pathlike object or string representing an existing file

Output matrix3 - NxN connectivity matrix.

network_matrixa pathlike object or string representing an existing file

The network matrix generated by –omatrix1 option.

particle_filesa list of items which are a pathlike object or string representing an existing file

Files describing all of the tract samples. Generated only if verbose is set to 2.

targetsa list of items which are a pathlike object or string representing an existing file

A list with all generated seeds_to_target files.

way_totala pathlike object or string representing an existing file

Path/name of a text file containing a single number corresponding to the total number of generated tracts that have not been rejected by inclusion/exclusion mask criteria.

ProjThresh

Link to code

Bases: FSLCommand

Wrapped executable: proj_thresh.

Use FSL proj_thresh for thresholding some outputs of probtrack For complete details, see the FDT Documentation <http://www.fmrib.ox.ac.uk/fsl/fdt/fdt_thresh.html>

Example

>>> from nipype.interfaces import fsl
>>> ldir = ['seeds_to_M1.nii', 'seeds_to_M2.nii']
>>> pThresh = fsl.ProjThresh(in_files=ldir, threshold=3)
>>> pThresh.cmdline
'proj_thresh seeds_to_M1.nii seeds_to_M2.nii 3'
in_filesa list of items which are a pathlike object or string representing an existing file

A list of input volumes. Maps to a command-line argument: %s (position: 0).

thresholdan integer

Threshold indicating minimum number of seed voxels entering this mask region. Maps to a command-line argument: %d (position: 1).

argsa string

Additional parameters to the command. Maps to a command-line argument: %s.

environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

Environment variables. (Nipype default value: {})

output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’ or ‘GIFTI’

FSL output type.

out_filesa list of items which are a pathlike object or string representing an existing file

Path/name of output volume after thresholding.

TractSkeleton

Link to code

Bases: FSLCommand

Wrapped executable: tbss_skeleton.

Use FSL’s tbss_skeleton to skeletonise an FA image or project arbitrary values onto a skeleton.

There are two ways to use this interface. To create a skeleton from an FA image, just supply the in_file and set skeleton_file to True (or specify a skeleton filename. To project values onto a skeleton, you must set project_data to True, and then also supply values for threshold, distance_map, and data_file. The search_mask_file and use_cingulum_mask inputs are also used in data projection, but use_cingulum_mask is set to True by default. This mask controls where the projection algorithm searches within a circular space around a tract, rather than in a single perpendicular direction.

Example

>>> import nipype.interfaces.fsl as fsl
>>> skeletor = fsl.TractSkeleton()
>>> skeletor.inputs.in_file = "all_FA.nii.gz"
>>> skeletor.inputs.skeleton_file = True
>>> skeletor.run()
in_filea pathlike object or string representing an existing file

Input image (typically mean FA volume). Maps to a command-line argument: -i %s.

alt_data_filea pathlike object or string representing an existing file

4D non-FA data to project onto skeleton. Maps to a command-line argument: -a %s.

alt_skeletona pathlike object or string representing an existing file

Alternate skeleton to use. Maps to a command-line argument: -s %s.

argsa string

Additional parameters to the command. Maps to a command-line argument: %s.

data_filea pathlike object or string representing an existing file

4D data to project onto skeleton (usually FA).

distance_mapa pathlike object or string representing an existing file

Distance map image.

environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

Environment variables. (Nipype default value: {})

output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’ or ‘GIFTI’

FSL output type.

project_dataa boolean

Project data onto skeleton. Maps to a command-line argument: -p %.3f %s %s %s %s. Requires inputs: threshold, distance_map, data_file.

projected_dataa pathlike object or string representing a file

Input data projected onto skeleton.

search_mask_filea pathlike object or string representing an existing file

Mask in which to use alternate search rule. Mutually exclusive with inputs: use_cingulum_mask.

skeleton_filea boolean or a pathlike object or string representing a file

Write out skeleton image. Maps to a command-line argument: -o %s.

thresholda float

Skeleton threshold value.

use_cingulum_maska boolean

Perform alternate search using built-in cingulum mask. Mutually exclusive with inputs: search_mask_file. (Nipype default value: True)

projected_dataa pathlike object or string representing a file

Input data projected onto skeleton.

skeleton_filea pathlike object or string representing a file

Tract skeleton image.

VecReg

Link to code

Bases: FSLCommand

Wrapped executable: vecreg.

Use FSL vecreg for registering vector data For complete details, see the FDT Documentation <http://www.fmrib.ox.ac.uk/fsl/fdt/fdt_vecreg.html>

Example

>>> from nipype.interfaces import fsl
>>> vreg = fsl.VecReg(in_file='diffusion.nii',                  affine_mat='trans.mat',                  ref_vol='mni.nii',                  out_file='diffusion_vreg.nii')
>>> vreg.cmdline
'vecreg -t trans.mat -i diffusion.nii -o diffusion_vreg.nii -r mni.nii'
in_filea pathlike object or string representing an existing file

Filename for input vector or tensor field. Maps to a command-line argument: -i %s.

ref_vola pathlike object or string representing an existing file

Filename for reference (target) volume. Maps to a command-line argument: -r %s.

affine_mata pathlike object or string representing an existing file

Filename for affine transformation matrix. Maps to a command-line argument: -t %s.

argsa string

Additional parameters to the command. Maps to a command-line argument: %s.

environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

Environment variables. (Nipype default value: {})

interpolation‘nearestneighbour’ or ‘trilinear’ or ‘sinc’ or ‘spline’

Interpolation method : nearestneighbour, trilinear (default), sinc or spline. Maps to a command-line argument: --interp=%s.

maska pathlike object or string representing an existing file

Brain mask in input space. Maps to a command-line argument: -m %s.

out_filea pathlike object or string representing a file

Filename for output registered vector or tensor field. Maps to a command-line argument: -o %s.

output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’ or ‘GIFTI’

FSL output type.

ref_maska pathlike object or string representing an existing file

Brain mask in output space (useful for speed up of nonlinear reg). Maps to a command-line argument: --refmask=%s.

rotation_mata pathlike object or string representing an existing file

Filename for secondary affine matrix if set, this will be used for the rotation of the vector/tensor field. Maps to a command-line argument: --rotmat=%s.

rotation_warpa pathlike object or string representing an existing file

Filename for secondary warp field if set, this will be used for the rotation of the vector/tensor field. Maps to a command-line argument: --rotwarp=%s.

warp_fielda pathlike object or string representing an existing file

Filename for 4D warp field for nonlinear registration. Maps to a command-line argument: -w %s.

out_filea pathlike object or string representing an existing file

Path/name of filename for the registered vector or tensor field.

XFibres

Link to code

alias of XFibres5

XFibres5

Link to code

Bases: FSLXCommand

Wrapped executable: xfibres.

Perform model parameters estimation for local (voxelwise) diffusion parameters

bvalsa pathlike object or string representing an existing file

B values file. Maps to a command-line argument: --bvals=%s.

bvecsa pathlike object or string representing an existing file

B vectors file. Maps to a command-line argument: --bvecs=%s.

dwia pathlike object or string representing an existing file

Diffusion weighted image data file. Maps to a command-line argument: --data=%s.

maska pathlike object or string representing an existing file

Brain binary mask file (i.e. from BET). Maps to a command-line argument: --mask=%s.

n_fibresan integer >= 1

Maximum number of fibres to fit in each voxel. Maps to a command-line argument: --nfibres=%d. (Nipype default value: 2)

all_arda boolean

Turn ARD on on all fibres. Maps to a command-line argument: --allard. Mutually exclusive with inputs: no_ard, all_ard.

argsa string

Additional parameters to the command. Maps to a command-line argument: %s.

burn_inan integer >= 0

Total num of jumps at start of MCMC to be discarded. Maps to a command-line argument: --burnin=%d. (Nipype default value: 0)

burn_in_no_ardan integer >= 0

Num of burnin jumps before the ard is imposed. Maps to a command-line argument: --burnin_noard=%d. (Nipype default value: 0)

cnlineara boolean

Initialise with constrained nonlinear fitting. Maps to a command-line argument: --cnonlinear. Mutually exclusive with inputs: no_spat, non_linear, cnlinear.

environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

Environment variables. (Nipype default value: {})

f0_arda boolean

Noise floor model: add to the model an unattenuated signal compartment f0. Maps to a command-line argument: --f0 --ardf0. Mutually exclusive with inputs: f0_noard, f0_ard, all_ard.

f0_noarda boolean

Noise floor model: add to the model an unattenuated signal compartment f0. Maps to a command-line argument: --f0. Mutually exclusive with inputs: f0_noard, f0_ard.

force_dira boolean

Use the actual directory name given (do not add + to make a new directory). Maps to a command-line argument: --forcedir. (Nipype default value: True)

fudgean integer

ARD fudge factor. Maps to a command-line argument: --fudge=%d.

gradnonlina pathlike object or string representing an existing file

Gradient file corresponding to slice. Maps to a command-line argument: --gradnonlin=%s.

logdira pathlike object or string representing a directory

Maps to a command-line argument: --logdir=%s. (Nipype default value: .)

model1 or 2 or 3

Use monoexponential (1, default, required for single-shell) or multiexponential (2, multi-shell) model. Maps to a command-line argument: --model=%d.

n_jumpsan integer

Num of jumps to be made by MCMC. Maps to a command-line argument: --njumps=%d. (Nipype default value: 5000)

no_arda boolean

Turn ARD off on all fibres. Maps to a command-line argument: --noard. Mutually exclusive with inputs: no_ard, all_ard.

no_spata boolean

Initialise with tensor, not spatially. Maps to a command-line argument: --nospat. Mutually exclusive with inputs: no_spat, non_linear, cnlinear.

non_lineara boolean

Initialise with nonlinear fitting. Maps to a command-line argument: --nonlinear. Mutually exclusive with inputs: no_spat, non_linear, cnlinear.

output_type‘NIFTI’ or ‘NIFTI_PAIR’ or ‘NIFTI_GZ’ or ‘NIFTI_PAIR_GZ’ or ‘GIFTI’

FSL output type.

riciana boolean

Use Rician noise modeling. Maps to a command-line argument: --rician.

sample_everyan integer >= 0

Num of jumps for each sample (MCMC). Maps to a command-line argument: --sampleevery=%d. (Nipype default value: 1)

seedan integer

Seed for pseudo random number generator. Maps to a command-line argument: --seed=%d.

update_proposal_everyan integer >= 1

Num of jumps for each update to the proposal density std (MCMC). Maps to a command-line argument: --updateproposalevery=%d. (Nipype default value: 40)

dyadsa list of items which are a pathlike object or string representing an existing file

Mean of PDD distribution in vector form.

fsamplesa list of items which are a pathlike object or string representing an existing file

Samples from the distribution on f anisotropy.

mean_S0samplesa pathlike object or string representing an existing file

Mean of distribution on T2w baseline signal intensity S0.

mean_dsamplesa pathlike object or string representing an existing file

Mean of distribution on diffusivity d.

mean_fsamplesa list of items which are a pathlike object or string representing an existing file

Mean of distribution on f anisotropy.

mean_tausamplesa pathlike object or string representing an existing file

Mean of distribution on tau samples (only with rician noise).

phsamplesa list of items which are a pathlike object or string representing an existing file

Phi samples, per fiber.

thsamplesa list of items which are a pathlike object or string representing an existing file

Theta samples, per fiber.