Home · Quickstart · Documentation · Citation · NiPy

# workflows.dmri.fsl.dti

## `create_bedpostx_pipeline()`

Link to code

Creates a pipeline that does the same as bedpostx script from FSL - calculates diffusion model parameters (distributions not MLE) voxelwise for the whole volume (by splitting it slicewise).

### Example

    >>> nipype_bedpostx = create_bedpostx_pipeline("nipype_bedpostx")
    >>> nipype_bedpostx.inputs.inputnode.dwi = 'diffusion.nii'
    >>> nipype_bedpostx.inputs.inputnode.mask = 'mask.nii'
    >>> nipype_bedpostx.inputs.inputnode.bvecs = 'bvecs'
    >>> nipype_bedpostx.inputs.inputnode.bvals = 'bvals'
    >>> nipype_bedpostx.inputs.xfibres.n_fibres = 2
    >>> nipype_bedpostx.inputs.xfibres.fudge = 1
    >>> nipype_bedpostx.inputs.xfibres.burn_in = 1000
    >>> nipype_bedpostx.inputs.xfibres.n_jumps = 1250
    >>> nipype_bedpostx.inputs.xfibres.sample_every = 25
    >>> nipype_bedpostx.run()

Inputs:

    inputnode.dwi
    inputnode.mask

Outputs:

    outputnode.thsamples
    outputnode.phsamples
    outputnode.fsamples
    outputnode.mean_thsamples
    outputnode.mean_phsamples
    outputnode.mean_fsamples
    outputnode.dyads
    outputnode.dyads_dispersion

### Graph

## `create_dmri_preprocessing()`

Link to code

Creates a workflow that chains the necessary pipelines to correct for motion, eddy currents, and, if selected, susceptibility artifacts in EPI dMRI sequences.

IMPORTANT NOTICE: this workflow rotates the b-vectors, so please be adviced that not all the dicom converters ensure the consistency between the resulting nifti orientation and the b matrix table (e.g. dcm2nii checks it).

### Example

    >>> nipype_dmri_preprocess = create_dmri_preprocessing("nipype_dmri_prep")
    >>> nipype_dmri_preprocess.inputs.inputnode.in_file = 'diffusion.nii'
    >>> nipype_dmri_preprocess.inputs.inputnode.in_bvec = 'diffusion.bvec'
    >>> nipype_dmri_preprocess.inputs.inputnode.ref_num = 0
    >>> nipype_dmri_preprocess.inputs.inputnode.fieldmap_mag = 'magnitude.nii'
    >>> nipype_dmri_preprocess.inputs.inputnode.fieldmap_pha = 'phase.nii'
    >>> nipype_dmri_preprocess.inputs.inputnode.te_diff = 2.46
    >>> nipype_dmri_preprocess.inputs.inputnode.epi_echospacing = 0.77
    >>> nipype_dmri_preprocess.inputs.inputnode.epi_rev_encoding = False
    >>> nipype_dmri_preprocess.inputs.inputnode.pi_accel_factor = True
    >>> nipype_dmri_preprocess.run()

Inputs:

    inputnode.in_file - The diffusion data
    inputnode.in_bvec - The b-matrix file, in FSL format and consistent with the in_file orientation
    inputnode.ref_num - The reference volume (a b=0 volume in dMRI)
    inputnode.fieldmap_mag - The magnitude of the fieldmap
    inputnode.fieldmap_pha - The phase difference of the fieldmap
    inputnode.te_diff - TE increment used (in msec.) on the fieldmap acquisition (generally 2.46ms for 3T scanners)
    inputnode.epi_echospacing - The EPI EchoSpacing parameter (in msec.)
    inputnode.epi_rev_encoding - True if reverse encoding was used (generally False)
    inputnode.pi_accel_factor - Parallel imaging factor (aka GRAPPA acceleration factor)
    inputnode.vsm_sigma - Sigma (in mm.) of the gaussian kernel used for in-slice smoothing of the deformation field (voxel shift map, vsm)

Outputs:

    outputnode.dmri_corrected
    outputnode.bvec_rotated

Optional arguments::
  use_fieldmap - True if there are fieldmap files that should be used (default True) fieldmap_registration - True if registration to fieldmap should be performed (default False)

### Graph

## `create_eddy_correct_pipeline()`

Link to code

Creates a pipeline that replaces eddy_correct script in FSL. It takes a series of diffusion weighted images and linearly co-registers them to one reference image. No rotation of the B-matrix is performed, so this pipeline should be executed after the motion correction pipeline.

### Example

    >>> nipype_eddycorrect = create_eddy_correct_pipeline("nipype_eddycorrect")
    >>> nipype_eddycorrect.inputs.inputnode.in_file = 'diffusion.nii'
    >>> nipype_eddycorrect.inputs.inputnode.ref_num = 0
    >>> nipype_eddycorrect.run()

Inputs:

    inputnode.in_file
    inputnode.ref_num

Outputs:

    outputnode.eddy_corrected

### Graph

## `create_motion_correct_pipeline()`

Link to code

Creates a pipeline that corrects for motion artifact in dMRI sequences. It takes a series of diffusion weighted images and rigidly corregisters them to one reference image. Finally, the b-matrix is rotated accordingly (Leemans et al. 2009 - http://www.ncbi.nlm.nih.gov/pubmed/19319973), making use of the rotation matrix obtained by FLIRT.

IMPORTANT NOTICE: this workflow rotates the b-vectors, so please be adviced that not all the dicom converters ensure the consistency between the resulting nifti orientation and the b matrix table (e.g. dcm2nii checks it).

### Example

    >>> nipype_motioncorrect = create_motion_correct_pipeline("nipype_motioncorrect")
    >>> nipype_motioncorrect.inputs.inputnode.in_file = 'diffusion.nii'
    >>> nipype_motioncorrect.inputs.inputnode.in_bvec = 'diffusion.bvec'
    >>> nipype_motioncorrect.inputs.inputnode.ref_num = 0
    >>> nipype_motioncorrect.run()

Inputs:

    inputnode.in_file
    inputnode.ref_num
    inputnode.in_bvec

Outputs:

    outputnode.motion_corrected
    outputnode.out_bvec

### Graph

## `create_susceptibility_correct_pipeline()`

Link to code

Replaces the epidewarp.fsl script (http://www.nmr.mgh.harvard.edu/~greve/fbirn/b0/epidewarp.fsl) for susceptibility distortion correction of dMRI & fMRI acquired with EPI sequences and the fieldmap information (Jezzard et al., 1995) using FSL’s FUGUE. The registration to the (warped) fieldmap (strictly following the original script) is available using fieldmap_registration=True.

### Example

    >>> nipype_epicorrect = create_susceptibility_correct_pipeline("nipype_epicorrect", fieldmap_registration=False)
    >>> nipype_epicorrect.inputs.inputnode.in_file = 'diffusion.nii'
    >>> nipype_epicorrect.inputs.inputnode.fieldmap_mag = 'magnitude.nii'
    >>> nipype_epicorrect.inputs.inputnode.fieldmap_pha = 'phase.nii'
    >>> nipype_epicorrect.inputs.inputnode.te_diff = 2.46
    >>> nipype_epicorrect.inputs.inputnode.epi_echospacing = 0.77
    >>> nipype_epicorrect.inputs.inputnode.epi_rev_encoding = False
    >>> nipype_epicorrect.inputs.inputnode.ref_num = 0
    >>> nipype_epicorrect.inputs.inputnode.pi_accel_factor = 1.0
    >>> nipype_epicorrect.run()

Inputs:

    inputnode.in_file - The volume acquired with EPI sequence
    inputnode.fieldmap_mag - The magnitude of the fieldmap
    inputnode.fieldmap_pha - The phase difference of the fieldmap
    inputnode.te_diff - Time difference between TE in ms.
    inputnode.epi_echospacing - The echo spacing (aka dwell time) in the EPI sequence
    inputnode.epi_ph_encoding_dir - The phase encoding direction in EPI acquisition (default y)
    inputnode.epi_rev_encoding - True if it is acquired with reverse encoding
    inputnode.pi_accel_factor - Acceleration factor used for EPI parallel imaging (GRAPPA)
    inputnode.vsm_sigma - Sigma value of the gaussian smoothing filter applied to the vsm (voxel shift map)
    inputnode.ref_num - The reference volume (B=0 in dMRI or a central frame in fMRI)

Outputs:

    outputnode.epi_corrected

Optional arguments:

    fieldmap_registration - True if registration to fieldmap should be done (default False)

### Graph

## `transpose()`

Link to code