Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

This repository contains the codes created or used for the analysis in the paper "Cognitive and White-Matter Compartment Models Reveal Selective Relations between Corticospinal Tract Microstructure and Simple Reaction Time"


For more information on the codes, please contact:


The pipeline is shown as:


Following steps correspond to the order in the pipeline. All MATLAB functions and bash scripts are provided.

  1. Preprocessing of DWI files

    FSL tools (

  2. DTI tensor fitting

    FSL tools (

  3. NODDI fitting

    NODDI toolbox (

  4. Probabilistic Tractography

    FSL tools (

    • Seed, waypoint and target masks to generate Corticospinal tracts, Optic radiations and Cingulum Bundles are given in the ROI folder. The scripts to generate subject-soecific ROIs are given in the Bash folder.
  5. Group mask

    • call_createGroupProbImage.m
    • createGroupProbImage.m
  6. Skeletonization ./Skeleton director

  • Main_tractSkeleton.m

    • removeVoxel.m
    • pruneBranchSkel.m
    • organizeSkelLine.m
    • spline3dCurveInterpolation.m
    • limitSkelwithImage.m
    • divideSkel.m
    • assignVoxel2Skeleton.m
  • VSK toolbox (

    additional functions for the VSK

    • findFirstandLastPointsTract.m
    • findBoxVolume.m
    • findImageCenter.m

    modified functions of the VSK

    • skel_Distmethod_mod.m
    • skel_thinningmethod_mod.m
  • resampleSkeleton.m

    • bordersWayPointROI_CST.m
    • divideSkelOverlap.m
    • assignVoxel2SkeletonOverlap.m
    • writeLabelImageOverlap.m
    • euclideanDist3.m
  • Visualization functions

    • visualizeObject.m
    • visualizeObjectSkel.m
  1. Individual Mapping of DTI and NODDI metrics ./TractStat Directory
  • Erode the FA maps

    tbss_1_preproc (FSL)

  • Create WM masks from T1 images of subjects and register to native DWI space (b0) so that the FA and MD can be masked.

  • Register the tracts (fdt) back to the native DWI space

  • Main_tractSkeletonStatFA.m

  • Main_tractSkeletonStatNODDI.m

    • averageFAMDtractSkeletonOverlapReg.m
    • saveAlongTractMetrixTxt.m
    • plotMetricsAlongTract.m
  • Main_tractSkeletonStatWholeTract.m

    • averagetract.m
  1. Statistics ./TractStat Directory
  • statFunctList
    • statPalmImageCluster_CSV_TFCE.m

    • statPalmImageCluster_findSignificant.m

      • plotRegTract.m
    • statMapCorrSkel2GroupIm.m

      Note that: Any image viewer can be used to visualize the significant segments of the tracts - findIgnoranceColumns.m

-Partial Correlation on the whole tract

  • statPartialCorrWholeTract.m

Dependency on other toolboxes:

Auxiliary functions:

  • takemeanNan.m
  • takesemNan.m
  • bootciMeanNan.m

Change the following files according to your environment:

  • Set the root path in 'setDirectory.m'
  • Run setEnvironment.m
  • Run call_createGroupProbImage


Along Tract Analysis of DWI



No releases published


No packages published