Skip to content
Image mapping using the LDDMM algorithm, implemented in tensorflow
Branch: master
Clone or download
Pull request Compare This branch is 6 commits behind dtward:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
180517_Downsample.hdr
180517_Downsample.img
180517_ch1_Downsample.hdr
180517_ch1_Downsample.img
Adt27-55_02_Adt27-55_02_MNI.hdr
Adt27-55_02_Adt27-55_02_MNI.img
Adt27-55_03_Adt27-55_03_MNI.hdr
Adt27-55_03_Adt27-55_03_MNI.img
Example_Human_MRI.ipynb
Example_Human_MRI_Resection.ipynb
Example_Mouse_Allen_to_Fluoro.ipynb
Example_Mouse_Nissl.ipynb
Example_Utilities.ipynb
Example_iDISCO_rat_waxholm.ipynb
Examples.ipynb
FluoroAtlas_Downsample.hdr
FluoroAtlas_Downsample.img
LICENSE
PMD2052_orig_target_STS_clean.hdr
PMD2052_orig_target_STS_clean.img
PMD3097_orig_target_STS_clean.hdr
PMD3097_orig_target_STS_clean.img
README.md
__init__.py
average_template_50.hdr
average_template_50.img
command_line_example.sh
example_affine.txt
human_mri_example_atlas.png
human_mri_example_deformed_atlas.png
human_mri_example_error_end.png
human_mri_example_error_start.png
human_mri_example_target.png
lddmm.py
vis.py

README.md

image_lddmm_tensorflow

Introduction

Image mapping using the LDDMM algorithm, implemented in tensorflow. Deformable registration between well characterized atlas images and observed target images allows for labelling of anatomical parcellations to interprete data, and quantification of atrophy, growth, or shape change. Multi modality images and missing data are handled using DR IT MD, Deformable registration with intensity transform and missing data, described in https://doi.org/10.1101/494005.

This package contains functions to run deformable image registration in python, using tensorflow to handle high performance computing issues.

Below shows an illustration of deforming an atlas human MRI to match a target human MRI. The second row shows the error before and after the alignment. The decrease in error is particularly noticible in the lateral ventricle.

Atlas Target
Human MRI atlas Human MRI target
Initial Error Final Error
Human MRI atlas Human MRI target
Deformed atlas Human MRI target

Examples

Please see Example*.ipynb to see various examples. Ideally you will find one that is similar to your desired application, and you can run it on your data with minimal changes.

Installation

This package requires tensorflow running in python 3, as well as several other pythonpackages. These packages are numpy for working with arrays, matplotlib for generating figures, nibabel for reading neuroimages, ipython and jupyter for running interactive notebooks.

Below is an example of how to install this package in unix. You will need python 3.4, 3.5, or 3.6, and virtualenv. Instructions for installing these can be found on https://www.tensorflow.org/install/. You will also need git.

# set up virtual environment
ENVLOCATION=~/lddmm_env
./virtualenv $ENVLOCATION

# activate virtual environment
source $LOCATION/bin/activate

# install requirements
pip3 install ipython jupyter tensorflow numpy matplotlib nibabel

# clone git repo
INSTALLLOCATION=~
cd $INSTALLLOCATION
git clone https://github.com/dtward/image_lddmm_tensorflow.git

# start jupyter notebook
jupyter-notebook

# jupyter will start in your web browser
# navigate to one of the example files, and click on kernel->restart & run all

Other methods (including GPU) and troubleshooting for installing tensorflow can be found here https://www.tensorflow.org/install/

To do

  1. (coding) Optimize for GPU.
  2. (application) Incorporate more example model organisms, and choose optimal parameters fo reach.
You can’t perform that action at this time.