The apparent diffusion coefficient is a measure compute from diffusion-weighted images and supposed to represent real physical values. See https://radiopaedia.org/articles/diffusion-weighted-imaging-1 and https://radiopaedia.org/articles/apparent-diffusion-coefficient-1 for more information.

This script computes an ADC images from two DWI images. Let's take a look at our source images.

DWI b0DWI b1000

The scripts requires two input files and the b-value of the second image.


In [3]:
medpy_apparent_diffusion_coefficient.py -h


usage: medpy_apparent_diffusion_coefficient.py [-h] [-t THRESHOLD] [-v] [-d]
                                               [-f]
                                               b0image bximage b output

Computes the apparent diffusion coefficient from two diffusion weighted
MRI images. The output image will be of type float.

Normally diffusion weight (DW) MRI images are acquired once with a
b-value of 0 (which we call b0) and once with another b-value (which we
call bx) such as 500, 800 or 1000. The latter is typical for brain MRIs.
This results in a single b0 DW image and three bx DW images, one for each
direction.

Usually the three bx DW images are already combined into an isotropic
average image (which we call abx) denoting the length of the three-dimensional
vector formed by the the three bx images.

The formula presented in [1] is applied to the b0 and abx images to
compute the apparent diffusion coefficient (ADC):

ADC = -bx-value * ln(abx-image / b0-image)

To cope with zero-values in the images, we apply a-priori a
thresholding to the b0 + abx DW image, set all lower values to 0 and
apply the formula only to the remaining intensities. Note that the
default threshold is chosen using Otsu's and is good for most cases.
(Thanks to Nils at the UKE in Hamburg, Germany for this hint!)

We restrain from implementing a method working on more DW images, that
were acquired with multiple b-values, as [2] observed that this might
lead to worse results.

[1] "Understanding Diffusion MR Imaging Techniques: From Scalar
Diffusion-weighted Imaging to Diffusion Tensor Imaging and Beyond" by
Patric Hagmann et al.
[2] "Understanding the Mathematics Involved in Calculating Apparent
Diffusion Coefficient Maps" by Michael Yong Park and Jae Young Byun

Copyright (C) 2013 Oskar Maier
This program comes with ABSOLUTELY NO WARRANTY; This is free software,
and you are welcome to redistribute it under certain conditions; see
the LICENSE file or <http://www.gnu.org/licenses/> for details.   
                  

positional arguments:
  b0image               the diffusion weighted image required with b=0
  bximage               the diffusion weighted image required with b=x
  b                     the b-value used to acquire the bx-image (i.e. x)
  output                the computed apparent diffusion coefficient image

optional arguments:
  -h, --help            show this help message and exit
  -t THRESHOLD, --threshold THRESHOLD
                        set a fixed threshold for the input images to mask the
                        computation
  -v, --verbose         verbose output
  -d                    Display debug information.
  -f, --force           overwrite existing files

That means we have to call it like this.


In [1]:
medpy_apparent_diffusion_coefficient.py resources/b0.nii.gz resources/b1000.nii.gz 1000 output/adc.nii.gz

Which results in

The results are more impressive with actual 3D volumes, from which reliable value can be computed.


In [ ]: