|
1 | 1 | # Single Shell Free Water Elimination Diffusion Tensor Model |
2 | 2 |
|
3 | | -This is a Python implementation of a Single Shell Free Water Elimination Model |
4 | | -the follows the papers listed in the references section below. **This software |
5 | | -is written for educational purposes only and is untested. Please do not use it |
6 | | -for anything important without doing your own testing.** |
| 3 | +This is a Python implementation of a Free Water Elimination Model for the |
| 4 | +analysis of Single Shell Diffusion Tensor MRI Images. We would like to |
| 5 | +[separate out the signal decay of extracellular free water from water that is |
| 6 | +in the vicinity of cellular |
| 7 | +tissue](http://pnl.bwh.harvard.edu/portfolio-item/free-water/). This is an |
| 8 | +ill-posed problem because there are infinitely many solutions. So constraints |
| 9 | +are imposed via the time evolution of a gradient flow on a Riemannian manifold |
| 10 | +to get a unique solution. The resulting optimization problem is solved via |
| 11 | +gradient descent. **This software is written for educational purposes only**. |
7 | 12 |
|
8 | | -There is a separate effort by @mvgolub and @RafaelNH to put in an expanded |
9 | | -single shell model into the [Dipy](http://nipy.org/dipy/index.html) |
10 | | -respository. Please follow along at the [Dipy Issue Tracker |
11 | | -#827](https://github.com/nipy/dipy/issues/827). When the Dipy version is ready, |
12 | | -it is likely to be better tested, more user friendly, efficient and have more |
13 | | -features than the version in this repository. |
| 13 | + |
| 14 | +|  | |
| 15 | +|:---:| |
| 16 | +| *Fig 1. Free Water corrected Fractional Anisotropy* | |
14 | 17 |
|
15 | 18 | ## Software requirements |
16 | 19 |
|
| 20 | +This code was developed with the following packages. |
| 21 | + |
17 | 22 | * Python 3.6.3 |
18 | 23 | * [Dipy 0.14.0](http://nipy.org/dipy/index.html) |
19 | 24 |
|
20 | 25 | ## Getting Started |
21 | 26 |
|
22 | | -* `git checkout` this repository |
| 27 | +* Download with git. `git checkout https://github.com/sameerd/DiffusionTensorImaging.git` |
23 | 28 | * Follow one of the two examples |
24 | | - * The [Example.ipynb](notebooks/Example.ipynb) Jupyter Notebook has an overview of how to use this repository |
25 | | - * The [example.py](notebooks/example.py) file has an example of how to use this code in a script or pipeline |
26 | | -* Check for model convergence |
| 29 | + * [example.py](example.py) : python script that can be used in a pipeline with local data. |
| 30 | + * [Example.ipynb](notebooks/Example.ipynb) : Jupyter Notebook with an interactive overview of how to use this repository with publicly available data |
| 31 | +* Check that the first panel (marked `loss` below) converges |
27 | 32 |
|
28 | | - |
| 33 | +|  | |
| 34 | +|:---:| |
| 35 | +| *Fig 2. Loss function panels* | |
29 | 36 |
|
30 | | -Currently the code has conveience functions to return the `free water map`, the free water corrected `mean diffusivity`, and the free water corrected `Fractional Anisotropy`. |
31 | | - |
32 | | - |
33 | 37 |
|
| 38 | +If the model isn't converging, you can try reducing the time step `dt` or |
| 39 | +increase the number of iterations. Once you are sure about convergence, you can |
| 40 | +use the code's convenience functions to return the `free water map`, the free |
| 41 | +water corrected `mean diffusivity`, and the free water corrected `Fractional |
| 42 | +Anisotropy` (see Fig 1. above). |
34 | 43 |
|
35 | 44 | ## Documentation |
36 | 45 |
|
37 | 46 | * This [README](README.md) file has an overview of how to use this repository. |
38 | | -* The mathematics behind the implementation is written out in the [SingleShellFreewater.pdf](./doc/SingleShellFreeWater.pdf) file. |
39 | | -* The core of the implementation is in the [freewater.py](./pymods/freewater.py) file. |
| 47 | +* The [SingleShellFreewater.pdf](./doc/SingleShellFreeWater.pdf) file helps describe what the code is doing in the language of mathematics and ties it to the reference papers. |
| 48 | +* The core of the implementation is in the [freewater.py](./pymods/freewater.py) file and the interface class in [freewater\_runner.py](./pymods/freewater_runner.py). |
| 49 | + |
| 50 | +## Caveats |
| 51 | +* **This software is untested. Please do your own testing before using it.** |
| 52 | + |
| 53 | +* There is a separate effort by @mvgolub and @RafaelNH to put in an expanded |
| 54 | +single shell model into the [Dipy](http://nipy.org/dipy/index.html) |
| 55 | +repository. Please follow along at the [Dipy Issue Tracker |
| 56 | +#827](https://github.com/nipy/dipy/issues/827). When the Dipy version is ready, |
| 57 | +it is likely to be better tested, more user friendly, efficient and have more |
| 58 | +features than the version in this repository. |
| 59 | + |
| 60 | +## Memory Usage |
| 61 | + |
| 62 | +On a recent test, a volume of size 100x100x10 with approximately 200 gradient |
| 63 | +directions consumed around 3GB of memory and took approximately 30 minutes to |
| 64 | +run using a 2GHz AMD opteron 6100 Series processor. A more realistically sized |
| 65 | +larger volume will take longer to run and consume more memory. Try to make sure |
| 66 | +that there is enough memory to prevent swapping to disk. |
| 67 | + |
40 | 68 |
|
41 | 69 | ## References |
42 | 70 |
|
|
0 commit comments