Skip to content

BinaryWiz4rd/DiffusionTensorImaging

Repository files navigation

DTI Tractography Pipeline with DIPY

Python 3.8+ DIPY

This repository contains a Python-based pipeline for Diffusion Tensor Imaging (DTI) reconstruction and Fiber Tractography. Using the DIPY library, the script processes diffusion-weighted magnetic resonance imaging (dMRI) data, fits a tensor model, and generates 3D streamlines representing white matter pathways.

DTI Tractography Visualization
Interactive 3D visualization generated by the pipeline.


Academic Context

This repository was a supplementary tool for a presentation made for a Medical Imaging course:


Pipeline Overview

The pipeline automates the following neuroimaging steps:

  1. Data Acquisition: Automatically fetches the Stanford HARDI dataset for demonstration via fetch_stanford_hardi().
  2. Tensor Reconstruction: Fits a TensorModel to the diffusion data to calculate Fractional Anisotropy (FA) maps.
  3. Cleaning & Seeding:
    • Identifies organized white matter by masking FA > 0.4.
    • Generates seeds from the mask with a density of [1, 1, 1].
  4. Tractography:
    • Uses Seed-based tracking via LocalTracking.
    • Implements a ThresholdStoppingCriterion (stopping at FA < 0.2).
    • Filters streamlines by length (min 40 nodes) to remove noise.
  5. Visualization:
    • Renders a 3D scene with direction-colored stream tubes.
    • Includes an interactive FA slicer with 50% opacity.
    • Automatically saves a high-resolution snapshot as Clinical_Tractography_Final.png.

Getting Started

Requirements

Ensure you have a Python environment (3.8+) with the following dependencies:

pip install numpy nibabel dipy fury

About

Python-based DTI reconstruction and fiber tractography pipeline using DIPY and FURY. Includes FA mapping and 3D streamline visualization.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages