In-vivo diffusion analysis (INDI)
Post-processing pipeline for in-vivo cardiac diffusion tensor imaging.
This software is a post-processing pipeline designed for in-vivo cardiac diffusion tensor imaging. It currently accepts Siemens and Philips diffusion weighted DICOM data, as well as anonymised NIFTI data. It also supports both STEAM and spin-echo data.
After the data is loaded, the pipeline performs the following steps:
- Image registration
- Image curation
- Tensor fitting
- Segmentation
- Export results
INDI runs from the command line, and when processing a dataset for the first time, INDI will require user input (pop-up matplotlib windows) which will be saved for future runs.
For more details:
See documentation for details on the post-processing pipeline.
See YAML settings for run configuration details.
Software has been tested on:
- macOS 15.0 with python 3.12
- Ubuntu 22.04 with python 3.12
- Windows 11 with python 3.12
Then clone the repository.
git clone https://github.com/ImperialCollegeLondon/INDI.git
You may need to instal Xcode and Xcode’s Command Line Tools package as well, with this command:
xcode-select --install
Then install homebrew.
With homebrew install python 3.12:
brew install [email protected]
Also install imagemagick:
brew install imagemagick
Install the python environment in the INDI root directory:
python3.12 -m venv .venv
source .venv/bin/activate
pip install -U pip setuptools wheel pip-tools
pip install -r requirements.txt
install imagemagick:
sudo apt install imagemagick
Install miniforge: Miniforge
Install the python environment with conda:
conda env create -f environment-cpu.yml
Or alternatively, if you have a CUDA compatible GPU for Win or Linux:
conda env create -f environment-gpu.yml
Install miniforge: Miniforge
Install the python environment with conda:
conda env create -f environment-cpu.yml
Or alternatively, if you have a CUDA compatible GPU for Win or Linux:
conda env create -f environment-gpu.yml
Install imagemagick.
For development, also install the git hook scripts:
pre-commit install
Now pre-commit will run automatically on git commit. You can also run it manually with:
pre-commit run --all-files
This is required to ensure code quality and style before committing code changes.
We are going to post-process a synthetic phantom dataset with non-rigid distortions. Please unzip the phantom data.
The test_phantom_cdti_dicoms
folder contains a subfolder named diffusion_images
with the cdti simulated DICOMs. The DICOM files contain noisy diffusion weighted images with periodic non-rigid distortions, simulating a typical in-vivo scan.
INDI always looks recursively for subfolders named diffusion_images
. The DICOM files must be inside this folder.
Before running we should have a look at the settings.yaml
file, and check if the parameters makes sense. See YAML settings for more information. For this phantom example, the default settings should be fine.
Then run in the INDI python environment:
python main.py <data_path>
Where <data_path>
is a folder that must contain at least a subfolder named diffusion_images
with all the
DICOM files.
In the video tutorial below we show how to run INDI with the phantom data:
INDI is licensed under the terms of the BSD license. Please see the LICENSE file.
If you use this software, please credit this website and "The CMR unit, Royal Brompton Hospital".
- Royal Brompton Hospital (Guy's and St Thomas' NHS Foundation Trust), London UK.
- Imperial College, London UK.
- This work was supported by the British Heart Foundation RG/19/1/34160 and RG/F/23/110115.
- Chan Zuckerberg Initiative DAF, an advised fund of the Silicon Valley Community Foundation: 2024-337787.
- EPSRC Healthcare Technologies EP/X014010/1.