Skip to content
tianboqiPublic

About

Fluorescence-based Structure Tensor Analysis

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

FluoSTA

Structure Tensor Analysis for axon bundle tracking on fluorescence images from cleared brain tissue.

Workflow

1. Compute structure tensor (sta_flow.py)

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 results

Outputs are written to results/dog0.5gau2.0/: v3.nii.gz, coherence.nii.gz, fsl_tensor.nii.gz, bmask.nii.gz, smask.nii.gz.

2. Track streamlines (sta_track.py)

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.1

3. Filter streamlines (sta_filter.py)

Prunes 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.tck

Dependencies

numpy nibabel scipy scikit-image dipy numba

Install with:

pip install numpy nibabel scipy scikit-image dipy numba

numba is optional for sta_track.py — tracking will fall back to pure Python if unavailable.

Usage help

Each script prints detailed usage with python <script>.py -h.


Tianbo Qi, Scripps Research, 2025
Part of the code was adapted from MIRACL

About

Fluorescence-based Structure Tensor Analysis

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages