workflows.dmri.fsl.utils

apply_all_corrections()

Link to code

Combines two lists of linear transforms with the deformation field map obtained typically after the SDC process. Additionally, computes the corresponding bspline coefficients and the map of determinants of the jacobian.

Graph

digraph UnwarpArtifacts{

  label="UnwarpArtifacts";

  UnwarpArtifacts_inputnode[label="inputnode (utility)"];

  UnwarpArtifacts_SplitDWIs[label="SplitDWIs (fsl)"];

  UnwarpArtifacts_ConvertWarp[label="ConvertWarp (fsl)"];

  UnwarpArtifacts_Reference[label="Reference (utility)"];

  UnwarpArtifacts_CoeffComp[label="CoeffComp (fsl)"];

  UnwarpArtifacts_JacobianComp[label="JacobianComp (fsl)"];

  UnwarpArtifacts_UnwarpDWIs[label="UnwarpDWIs (fsl)"];

  UnwarpArtifacts_ModulateDWIs[label="ModulateDWIs (fsl)"];

  UnwarpArtifacts_RemoveNegative[label="RemoveNegative (fsl)"];

  UnwarpArtifacts_MergeDWIs[label="MergeDWIs (fsl)"];

  UnwarpArtifacts_outputnode[label="outputnode (utility)"];

  UnwarpArtifacts_inputnode -> UnwarpArtifacts_ConvertWarp;

  UnwarpArtifacts_inputnode -> UnwarpArtifacts_ConvertWarp;

  UnwarpArtifacts_inputnode -> UnwarpArtifacts_ConvertWarp;

  UnwarpArtifacts_inputnode -> UnwarpArtifacts_ConvertWarp;

  UnwarpArtifacts_inputnode -> UnwarpArtifacts_SplitDWIs;

  UnwarpArtifacts_SplitDWIs -> UnwarpArtifacts_UnwarpDWIs;

  UnwarpArtifacts_SplitDWIs -> UnwarpArtifacts_Reference;

  UnwarpArtifacts_ConvertWarp -> UnwarpArtifacts_UnwarpDWIs;

  UnwarpArtifacts_ConvertWarp -> UnwarpArtifacts_CoeffComp;

  UnwarpArtifacts_ConvertWarp -> UnwarpArtifacts_outputnode;

  UnwarpArtifacts_Reference -> UnwarpArtifacts_UnwarpDWIs;

  UnwarpArtifacts_Reference -> UnwarpArtifacts_CoeffComp;

  UnwarpArtifacts_Reference -> UnwarpArtifacts_JacobianComp;

  UnwarpArtifacts_CoeffComp -> UnwarpArtifacts_JacobianComp;

  UnwarpArtifacts_CoeffComp -> UnwarpArtifacts_outputnode;

  UnwarpArtifacts_JacobianComp -> UnwarpArtifacts_ModulateDWIs;

  UnwarpArtifacts_JacobianComp -> UnwarpArtifacts_outputnode;

  UnwarpArtifacts_UnwarpDWIs -> UnwarpArtifacts_ModulateDWIs;

  UnwarpArtifacts_ModulateDWIs -> UnwarpArtifacts_RemoveNegative;

  UnwarpArtifacts_RemoveNegative -> UnwarpArtifacts_MergeDWIs;

  UnwarpArtifacts_MergeDWIs -> UnwarpArtifacts_outputnode;

}

cleanup_edge_pipeline()

Link to code

Perform some de-spiking filtering to clean up the edge of the fieldmap (copied from fsl_prepare_fieldmap)

Graph

digraph Cleanup{

  label="Cleanup";

  Cleanup_inputnode[label="inputnode (utility)"];

  Cleanup_MskErode[label="MskErode (fsl)"];

  Cleanup_NewMask[label="NewMask (fsl)"];

  Cleanup_Despike[label="Despike (fsl)"];

  Cleanup_ApplyMask[label="ApplyMask (fsl)"];

  Cleanup_Merge[label="Merge (utility)"];

  Cleanup_AddEdge[label="AddEdge (fsl)"];

  Cleanup_outputnode[label="outputnode (utility)"];

  Cleanup_inputnode -> Cleanup_Despike;

  Cleanup_inputnode -> Cleanup_Despike;

  Cleanup_inputnode -> Cleanup_AddEdge;

  Cleanup_inputnode -> Cleanup_NewMask;

  Cleanup_inputnode -> Cleanup_MskErode;

  Cleanup_MskErode -> Cleanup_Merge;

  Cleanup_MskErode -> Cleanup_NewMask;

  Cleanup_NewMask -> Cleanup_ApplyMask;

  Cleanup_Despike -> Cleanup_ApplyMask;

  Cleanup_ApplyMask -> Cleanup_Merge;

  Cleanup_Merge -> Cleanup_AddEdge;

  Cleanup_AddEdge -> Cleanup_outputnode;

}

dwi_flirt()

Link to code

Generates a workflow for linear registration of dwi volumes

Graph

digraph DWICoregistration{

  label="DWICoregistration";

  DWICoregistration_inputnode[label="inputnode (utility)"];

  DWICoregistration_MskDilate[label="MskDilate (fsl)"];

  DWICoregistration_Bias[label="Bias (ants)"];

  DWICoregistration_B0Equalize[label="B0Equalize (utility)"];

  DWICoregistration_SplitDWIs[label="SplitDWIs (fsl)"];

  DWICoregistration_DWEqualize[label="DWEqualize (utility)"];

  DWICoregistration_InitXforms[label="InitXforms (utility)"];

  DWICoregistration_CoRegistration[label="CoRegistration (fsl)"];

  DWICoregistration_RemoveNegative[label="RemoveNegative (fsl)"];

  DWICoregistration_MergeDWIs[label="MergeDWIs (fsl)"];

  DWICoregistration_outputnode[label="outputnode (utility)"];

  DWICoregistration_inputnode -> DWICoregistration_InitXforms;

  DWICoregistration_inputnode -> DWICoregistration_InitXforms;

  DWICoregistration_inputnode -> DWICoregistration_MskDilate;

  DWICoregistration_inputnode -> DWICoregistration_SplitDWIs;

  DWICoregistration_inputnode -> DWICoregistration_Bias;

  DWICoregistration_inputnode -> DWICoregistration_Bias;

  DWICoregistration_inputnode -> DWICoregistration_B0Equalize;

  DWICoregistration_MskDilate -> DWICoregistration_CoRegistration;

  DWICoregistration_MskDilate -> DWICoregistration_CoRegistration;

  DWICoregistration_MskDilate -> DWICoregistration_DWEqualize;

  DWICoregistration_Bias -> DWICoregistration_B0Equalize;

  DWICoregistration_B0Equalize -> DWICoregistration_CoRegistration;

  DWICoregistration_SplitDWIs -> DWICoregistration_DWEqualize;

  DWICoregistration_DWEqualize -> DWICoregistration_CoRegistration;

  DWICoregistration_InitXforms -> DWICoregistration_CoRegistration;

  DWICoregistration_CoRegistration -> DWICoregistration_RemoveNegative;

  DWICoregistration_CoRegistration -> DWICoregistration_outputnode;

  DWICoregistration_RemoveNegative -> DWICoregistration_MergeDWIs;

  DWICoregistration_MergeDWIs -> DWICoregistration_outputnode;

}

vsm2warp()

Link to code

Converts a voxel shift map (vsm) to a displacements field (warp).

Graph

digraph Shiftmap2Warping{

  label="Shiftmap2Warping";

  Shiftmap2Warping_inputnode[label="inputnode (utility)"];

  Shiftmap2Warping_Fix_hdr[label="Fix_hdr (utility)"];

  Shiftmap2Warping_ScaleField[label="ScaleField (fsl)"];

  Shiftmap2Warping_vsm2dfm[label="vsm2dfm (fsl)"];

  Shiftmap2Warping_outputnode[label="outputnode (utility)"];

  Shiftmap2Warping_inputnode -> Shiftmap2Warping_vsm2dfm;

  Shiftmap2Warping_inputnode -> Shiftmap2Warping_vsm2dfm;

  Shiftmap2Warping_inputnode -> Shiftmap2Warping_Fix_hdr;

  Shiftmap2Warping_inputnode -> Shiftmap2Warping_Fix_hdr;

  Shiftmap2Warping_inputnode -> Shiftmap2Warping_ScaleField;

  Shiftmap2Warping_Fix_hdr -> Shiftmap2Warping_ScaleField;

  Shiftmap2Warping_ScaleField -> Shiftmap2Warping_vsm2dfm;

  Shiftmap2Warping_vsm2dfm -> Shiftmap2Warping_outputnode;

}

add_empty_vol()

Link to code

Adds an empty vol to the phase difference image

b0_average()

Link to code

A function that averages the b0 volumes from a DWI dataset. As current dMRI data are being acquired with all b-values > 0.0, the lowb volumes are selected by specifying the parameter max_b.

Warning

b0 should be already registered (head motion artifact should be corrected).

b0_indices()

Link to code

Extract the indices of slices in a b-values file with a low b value

compute_readout()

Link to code

Computes readout time from epi params (see eddy documentation).

Warning

params['echospacing'] should be in sec units.

copy_hdr()

Link to code

demean_image()

Link to code

Demean image data inside mask

eddy_rotate_bvecs()

Link to code

Rotates the input bvec file accordingly with a list of parameters sourced from eddy, as explained here.

enhance()

Link to code

extract_bval()

Link to code

Writes an image containing only the volumes with b-value specified at input

hmc_split()

Link to code

Selects the reference and moving volumes from a dwi dataset for the purpose of HMC.

insert_mat()

Link to code

rads2radsec()

Link to code

Converts input phase difference map to rads

recompose_dwi()

Link to code

Recompose back the dMRI data accordingly the b-values table after EC correction

recompose_xfm()

Link to code

Insert identity transformation matrices in b0 volumes to build up a list

remove_comp()

Link to code

Removes the volume volid from the 4D nifti file

reorient_bvecs()

Link to code

Checks reorientations of in_dwi w.r.t. old_dwi and reorients the in_bvec table accordingly.

rotate_bvecs()

Link to code

Rotates the input bvec file accordingly with a list of matrices.

Note

the input affine matrix transforms points in the destination image to their corresponding coordinates in the original image. Therefore, this matrix should be inverted first, as we want to know the target position of \vec{r}.

siemens2rads()

Link to code

Converts input phase difference map to rads

time_avg()

Link to code

Average the input time-series, selecting the indices given in index

Warning

time steps should be already registered (corrected for head motion artifacts).