|
a |
|
b/installation/README.md |
|
|
1 |
# Installation |
|
|
2 |
|
|
|
3 |
## Table of Contents |
|
|
4 |
|
|
|
5 |
- [Getting Started](#Getting-Started) |
|
|
6 |
- [Pre-trained Models](#Pre-trained-Models) |
|
|
7 |
- [Automated Scripts](#Automated-Scripts) |
|
|
8 |
* [Segmentation](#Automated-Scripts) |
|
|
9 |
* [Motion Estimation](#Motion-Estimation) |
|
|
10 |
* [Strain Analysis](#Strain-Analysis) |
|
|
11 |
|
|
|
12 |
## Getting Started |
|
|
13 |
|
|
|
14 |
Install the requirements: |
|
|
15 |
|
|
|
16 |
- Linux or macOS |
|
|
17 |
- Python 3 |
|
|
18 |
- CPU or NVIDIA GPU + CUDA CuDNN |
|
|
19 |
|
|
|
20 |
- Clone this repo: |
|
|
21 |
```bash |
|
|
22 |
git clone -b master --single-branch https://github.com/moralesq/DeepStrain.git |
|
|
23 |
cd DeepStrain |
|
|
24 |
``` |
|
|
25 |
- Install TensorFlow and dependencies from https://www.tensorflow.org/install |
|
|
26 |
- Install python libraries |
|
|
27 |
|
|
|
28 |
For pip users: |
|
|
29 |
```bash |
|
|
30 |
bash ./scripts/install_pip.sh |
|
|
31 |
``` |
|
|
32 |
|
|
|
33 |
## Pre-trained Models |
|
|
34 |
|
|
|
35 |
- Download some test data in nifti format: |
|
|
36 |
```bash |
|
|
37 |
bash ./datasets/download_sample_dataset.sh |
|
|
38 |
``` |
|
|
39 |
- Download the pre-trained models (i.e., carson and carmen): |
|
|
40 |
```bash |
|
|
41 |
bash ./pretrained_models/download_model.sh |
|
|
42 |
``` |
|
|
43 |
|
|
|
44 |
## Automated Scripts |
|
|
45 |
|
|
|
46 |
### Segmentation |
|
|
47 |
|
|
|
48 |
- Generate segmentations with the model for 3D niftis: |
|
|
49 |
```bash |
|
|
50 |
bash ./scripts/test_segmentation.sh ./datasets/sample_nifti_3D NIFTI ./results/sample_nifti_3D |
|
|
51 |
``` |
|
|
52 |
The test results will be saved to a nifti file here: `./results/sample_nifti_3D/`. |
|
|
53 |
|
|
|
54 |
- Generate segmentations with the model for 4D (3D+time) niftis: |
|
|
55 |
```bash |
|
|
56 |
bash ./scripts/test_segmentation.sh ./datasets/sample_nifti_4D NIFTI ./results/sample_nifti_3D |
|
|
57 |
``` |
|
|
58 |
The test results will be saved to a nifti file here: `./results/sample_nifti_4D/`. |
|
|
59 |
|
|
|
60 |
### Motion Estimation |
|
|
61 |
|
|
|
62 |
- Generate motion estimates with the model for 4D (3D+time) niftis. Note that for motion estimation only 4D is supported: |
|
|
63 |
```bash |
|
|
64 |
bash ./scripts/test_motion.sh ./datasets/sample_nifti_4D NIFTI ./results/sample_nifti_4D |
|
|
65 |
``` |
|
|
66 |
The test results will be saved to a h5 file here: `./results/sample_nifti_4D/`. |
|
|
67 |
|
|
|
68 |
- Generate both segmentation and motion estimates with the model for 4D (3D+time) niftis: |
|
|
69 |
```bash |
|
|
70 |
bash ./scripts/test_segmentation_motion.sh ./datasets/sample_nifti_4D NIFTI ./results/sample_nifti_4D |
|
|
71 |
``` |
|
|
72 |
The test results will be saved to nifti and h5 files here: `./results/sample_nifti_4D/`. |
|
|
73 |
|
|
|
74 |
### Strain Analysis |
|
|
75 |
|
|
|
76 |
- After the segmentations and motion estimates have been generated, we can use both to calculate myocardial strain. Note that we're passing the output folder from the previous runs: |
|
|
77 |
```bash |
|
|
78 |
bash ./scripts/test_strain.sh ./results/sample_nifti_4D |
|
|
79 |
``` |
|
|
80 |
The test results (4D radial and circumferential strain) will be saved to nifti files here: `./results/sample_nifti_4D/`. |