Structure Tensor Analysis for axon bundle tracking on fluorescence images from cleared brain tissue.
Estimates local fiber orientation by computing the structure tensor eigenvector field (v3) and a coherence map from a 3D fluorescence image.
python sta_flow.py --input image.nii.gz --brainmask brain.nii.gz --seedmask seed.nii.gz \
--dog 0.5 --gauss 2.0 --outdir resultsOutputs are written to results/dog0.5gau2.0/: v3.nii.gz, coherence.nii.gz, fsl_tensor.nii.gz, bmask.nii.gz, smask.nii.gz.
Propagates streamlines from seed voxels along the v3 direction field using Numba-accelerated nearest-neighbor sampling.
python sta_track.py --v3 v3.nii.gz --seeds smask.nii.gz --mask bmask.nii.gz \
--out streamlines.tck --step 1e-3 --angle 35 --density 0.1Prunes streamlines by suffix-mean intensity, coherence, and/or turning angle.
python sta_filter.py --in_tck streamlines.tck --img FA.nii.gz \
--threshold 0.2 --angle_max 45 --out_tck filtered.tcknumpy nibabel scipy scikit-image dipy numba
Install with:
pip install numpy nibabel scipy scikit-image dipy numbanumba is optional for sta_track.py — tracking will fall back to pure Python if unavailable.
Each script prints detailed usage with python <script>.py -h.
Tianbo Qi, Scripps Research, 2025
Part of the code was adapted from MIRACL