|
a |
|
b/.ipynb_checkpoints/demo-checkpoint.ipynb |
|
|
1 |
{ |
|
|
2 |
"cells": [ |
|
|
3 |
{ |
|
|
4 |
"cell_type": "markdown", |
|
|
5 |
"metadata": {}, |
|
|
6 |
"source": [ |
|
|
7 |
"Let's load some sample dasets to test the code. " |
|
|
8 |
] |
|
|
9 |
}, |
|
|
10 |
{ |
|
|
11 |
"cell_type": "code", |
|
|
12 |
"execution_count": 102, |
|
|
13 |
"metadata": {}, |
|
|
14 |
"outputs": [ |
|
|
15 |
{ |
|
|
16 |
"name": "stdout", |
|
|
17 |
"output_type": "stream", |
|
|
18 |
"text": [ |
|
|
19 |
"Downloading...\n", |
|
|
20 |
"From: https://drive.google.com/uc?id=1QZNgRojYpYBLzUQJntWAmw1QwQMh4H50\n", |
|
|
21 |
"To: /tf/Dropbox (Partners HealthCare)/ubuntu/docker/repos/DeepStrain/datasets/sample_nifti_3D/patient101_frame14.nii.gz\n", |
|
|
22 |
"100%|████████████████████████████████████████| 667k/667k [00:00<00:00, 7.39MB/s]\n", |
|
|
23 |
"Downloading...\n", |
|
|
24 |
"From: https://drive.google.com/uc?id=1zFJM_qQKwz85xiYpX3XBRqhL0SQwy-Iw\n", |
|
|
25 |
"To: /tf/Dropbox (Partners HealthCare)/ubuntu/docker/repos/DeepStrain/datasets/sample_nifti_3D/patient101_frame01.nii.gz\n", |
|
|
26 |
"100%|████████████████████████████████████████| 664k/664k [00:00<00:00, 3.10MB/s]\n", |
|
|
27 |
"Downloading...\n", |
|
|
28 |
"From: https://drive.google.com/uc?id=1FqTquCYhLD2-EKxmCR9A5zt5265AEPdQ\n", |
|
|
29 |
"To: /tf/Dropbox (Partners HealthCare)/ubuntu/docker/repos/DeepStrain/datasets/sample_nifti_4D/patient101_4d.nii.gz\n", |
|
|
30 |
"20.0MB [00:01, 17.2MB/s]\n" |
|
|
31 |
] |
|
|
32 |
} |
|
|
33 |
], |
|
|
34 |
"source": [ |
|
|
35 |
"!bash ./datasets/download_sample_dataset.sh" |
|
|
36 |
] |
|
|
37 |
}, |
|
|
38 |
{ |
|
|
39 |
"cell_type": "markdown", |
|
|
40 |
"metadata": {}, |
|
|
41 |
"source": [ |
|
|
42 |
"Load the pre-trained models that attached to the publication. This will download the cardiac segmentation and motion estimation trained parameters: " |
|
|
43 |
] |
|
|
44 |
}, |
|
|
45 |
{ |
|
|
46 |
"cell_type": "code", |
|
|
47 |
"execution_count": 103, |
|
|
48 |
"metadata": {}, |
|
|
49 |
"outputs": [ |
|
|
50 |
{ |
|
|
51 |
"name": "stdout", |
|
|
52 |
"output_type": "stream", |
|
|
53 |
"text": [ |
|
|
54 |
"Note: available models are carson_Jan2021, carmen_Jan2021\n", |
|
|
55 |
"Downloading models ...\n", |
|
|
56 |
"Downloading...\n", |
|
|
57 |
"From: https://drive.google.com/uc?id=1rINpNPZ4_lT9XuFB6Q7gyna_L4O3AIY9\n", |
|
|
58 |
"To: /tf/Dropbox (Partners HealthCare)/ubuntu/docker/repos/DeepStrain/pretrained_models/carson_Jan2021.h5\n", |
|
|
59 |
"229MB [00:12, 18.6MB/s] \n", |
|
|
60 |
"Downloading...\n", |
|
|
61 |
"From: https://drive.google.com/uc?id=10eMGoYYa4xFdwFuiwC7bwVSJ6b-bx7Ni\n", |
|
|
62 |
"To: /tf/Dropbox (Partners HealthCare)/ubuntu/docker/repos/DeepStrain/pretrained_models/carmen_Jan2021.h5\n", |
|
|
63 |
"449MB [00:23, 18.9MB/s] \n" |
|
|
64 |
] |
|
|
65 |
} |
|
|
66 |
], |
|
|
67 |
"source": [ |
|
|
68 |
"!bash ./pretrained_models/download_model.sh" |
|
|
69 |
] |
|
|
70 |
}, |
|
|
71 |
{ |
|
|
72 |
"cell_type": "markdown", |
|
|
73 |
"metadata": {}, |
|
|
74 |
"source": [ |
|
|
75 |
"Test segmentation on 3D data in NIFTI format. " |
|
|
76 |
] |
|
|
77 |
}, |
|
|
78 |
{ |
|
|
79 |
"cell_type": "code", |
|
|
80 |
"execution_count": 104, |
|
|
81 |
"metadata": {}, |
|
|
82 |
"outputs": [ |
|
|
83 |
{ |
|
|
84 |
"name": "stdout", |
|
|
85 |
"output_type": "stream", |
|
|
86 |
"text": [ |
|
|
87 |
"+ DATAROOT=./datasets/sample_nifti_3D\n", |
|
|
88 |
"+ DATAFORMAT=NIFTI\n", |
|
|
89 |
"+ RESULTS_DIR=./results/sample_nifti_3D\n", |
|
|
90 |
"+ CARSON_PATH=../private_models/main_carson_model.h5\n", |
|
|
91 |
"+ CARMEN_PATH=./pretrained_models/carmen_Jan2021.h5\n", |
|
|
92 |
"+ PIPELINE=segmentation\n", |
|
|
93 |
"+ CUDA_VISIBLE_DEVICES=\n", |
|
|
94 |
"+ python ./test.py --dataroot ./datasets/sample_nifti_3D --dataformat NIFTI --results_dir ./results/sample_nifti_3D --pretrained_models_netS ../private_models/main_carson_model.h5 --pretrained_models_netME ./pretrained_models/carmen_Jan2021.h5 --pipeline segmentation\n", |
|
|
95 |
"2021-02-14 18:02:27.114286: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.1\n", |
|
|
96 |
"2021-02-14 18:02:29.315607: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcuda.so.1\n", |
|
|
97 |
"2021-02-14 18:02:29.340591: E tensorflow/stream_executor/cuda/cuda_driver.cc:314] failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected\n", |
|
|
98 |
"2021-02-14 18:02:29.340649: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:169] retrieving CUDA diagnostic information for host: e990b504c5b4\n", |
|
|
99 |
"2021-02-14 18:02:29.340666: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:176] hostname: e990b504c5b4\n", |
|
|
100 |
"2021-02-14 18:02:29.340797: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:200] libcuda reported version is: 450.102.4\n", |
|
|
101 |
"2021-02-14 18:02:29.340843: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:204] kernel reported version is: 450.102.4\n", |
|
|
102 |
"2021-02-14 18:02:29.340860: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:310] kernel version seems to match DSO: 450.102.4\n", |
|
|
103 |
"2021-02-14 18:02:29.341267: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations: AVX2 FMA\n", |
|
|
104 |
"To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.\n", |
|
|
105 |
"2021-02-14 18:02:29.352981: I tensorflow/core/platform/profile_utils/cpu_utils.cc:104] CPU Frequency: 1696155000 Hz\n", |
|
|
106 |
"2021-02-14 18:02:29.353521: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x4ad3bc0 initialized for platform Host (this does not guarantee that XLA will be used). Devices:\n", |
|
|
107 |
"2021-02-14 18:02:29.353563: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version\n", |
|
|
108 |
"/tf/Dropbox (Partners HealthCare)/ubuntu/docker/repos/DeepStrain/data/nifti_dataset.py:77: UserWarning: Affine in nifti might be set incorrectly. Setting to affine=affine*zooms\n", |
|
|
109 |
" warnings.warn(\"Affine in nifti might be set incorrectly. Setting to affine=affine*zooms\")\n", |
|
|
110 |
"/tf/Dropbox (Partners HealthCare)/ubuntu/docker/repos/DeepStrain/data/nifti_dataset.py:77: UserWarning: Affine in nifti might be set incorrectly. Setting to affine=affine*zooms\n", |
|
|
111 |
" warnings.warn(\"Affine in nifti might be set incorrectly. Setting to affine=affine*zooms\")\n" |
|
|
112 |
] |
|
|
113 |
} |
|
|
114 |
], |
|
|
115 |
"source": [ |
|
|
116 |
"!bash ./scripts/test_segmentation.sh ./datasets/sample_nifti_3D NIFTI ./results/sample_nifti_3D" |
|
|
117 |
] |
|
|
118 |
}, |
|
|
119 |
{ |
|
|
120 |
"cell_type": "markdown", |
|
|
121 |
"metadata": {}, |
|
|
122 |
"source": [ |
|
|
123 |
"Test segmentation on 4D (3D + time) data in NIFTI format. " |
|
|
124 |
] |
|
|
125 |
}, |
|
|
126 |
{ |
|
|
127 |
"cell_type": "code", |
|
|
128 |
"execution_count": 105, |
|
|
129 |
"metadata": {}, |
|
|
130 |
"outputs": [ |
|
|
131 |
{ |
|
|
132 |
"name": "stdout", |
|
|
133 |
"output_type": "stream", |
|
|
134 |
"text": [ |
|
|
135 |
"+ DATAROOT=./datasets/sample_nifti_4D\n", |
|
|
136 |
"+ DATAFORMAT=NIFTI\n", |
|
|
137 |
"+ RESULTS_DIR=./results/sample_nifti_4D\n", |
|
|
138 |
"+ CARSON_PATH=../private_models/main_carson_model.h5\n", |
|
|
139 |
"+ CARMEN_PATH=./pretrained_models/carmen_Jan2021.h5\n", |
|
|
140 |
"+ PIPELINE=segmentation\n", |
|
|
141 |
"+ CUDA_VISIBLE_DEVICES=\n", |
|
|
142 |
"+ python ./test.py --dataroot ./datasets/sample_nifti_4D --dataformat NIFTI --results_dir ./results/sample_nifti_4D --pretrained_models_netS ../private_models/main_carson_model.h5 --pretrained_models_netME ./pretrained_models/carmen_Jan2021.h5 --pipeline segmentation\n", |
|
|
143 |
"2021-02-14 18:02:36.541501: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.1\n", |
|
|
144 |
"2021-02-14 18:02:38.748517: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcuda.so.1\n", |
|
|
145 |
"2021-02-14 18:02:38.772471: E tensorflow/stream_executor/cuda/cuda_driver.cc:314] failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected\n", |
|
|
146 |
"2021-02-14 18:02:38.772523: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:169] retrieving CUDA diagnostic information for host: e990b504c5b4\n", |
|
|
147 |
"2021-02-14 18:02:38.772544: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:176] hostname: e990b504c5b4\n", |
|
|
148 |
"2021-02-14 18:02:38.772684: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:200] libcuda reported version is: 450.102.4\n", |
|
|
149 |
"2021-02-14 18:02:38.772733: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:204] kernel reported version is: 450.102.4\n", |
|
|
150 |
"2021-02-14 18:02:38.772749: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:310] kernel version seems to match DSO: 450.102.4\n", |
|
|
151 |
"2021-02-14 18:02:38.773126: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations: AVX2 FMA\n", |
|
|
152 |
"To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.\n", |
|
|
153 |
"2021-02-14 18:02:38.784659: I tensorflow/core/platform/profile_utils/cpu_utils.cc:104] CPU Frequency: 1696155000 Hz\n", |
|
|
154 |
"2021-02-14 18:02:38.785149: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x6260db0 initialized for platform Host (this does not guarantee that XLA will be used). Devices:\n", |
|
|
155 |
"2021-02-14 18:02:38.785202: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version\n", |
|
|
156 |
"/tf/Dropbox (Partners HealthCare)/ubuntu/docker/repos/DeepStrain/data/nifti_dataset.py:77: UserWarning: Affine in nifti might be set incorrectly. Setting to affine=affine*zooms\n", |
|
|
157 |
" warnings.warn(\"Affine in nifti might be set incorrectly. Setting to affine=affine*zooms\")\n" |
|
|
158 |
] |
|
|
159 |
} |
|
|
160 |
], |
|
|
161 |
"source": [ |
|
|
162 |
"!bash ./scripts/test_segmentation.sh ./datasets/sample_nifti_4D NIFTI ./results/sample_nifti_4D" |
|
|
163 |
] |
|
|
164 |
}, |
|
|
165 |
{ |
|
|
166 |
"cell_type": "markdown", |
|
|
167 |
"metadata": {}, |
|
|
168 |
"source": [ |
|
|
169 |
"Test motion on 4D (3D + time) data in NIFTI format. Motion is only avilable for 4D data. " |
|
|
170 |
] |
|
|
171 |
}, |
|
|
172 |
{ |
|
|
173 |
"cell_type": "code", |
|
|
174 |
"execution_count": 106, |
|
|
175 |
"metadata": {}, |
|
|
176 |
"outputs": [ |
|
|
177 |
{ |
|
|
178 |
"name": "stdout", |
|
|
179 |
"output_type": "stream", |
|
|
180 |
"text": [ |
|
|
181 |
"+ DATAROOT=./datasets/sample_nifti_4D\n", |
|
|
182 |
"+ DATAFORMAT=NIFTI\n", |
|
|
183 |
"+ RESULTS_DIR=./results/sample_nifti_4D\n", |
|
|
184 |
"+ CARSON_PATH=./pretrained_models/carson_Jan2021.h5\n", |
|
|
185 |
"+ CARMEN_PATH=./pretrained_models/carmen_Jan2021.h5\n", |
|
|
186 |
"+ PIPELINE=motion\n", |
|
|
187 |
"+ CUDA_VISIBLE_DEVICES=\n", |
|
|
188 |
"+ python ./test.py --dataroot ./datasets/sample_nifti_4D --dataformat NIFTI --results_dir ./results/sample_nifti_4D --pretrained_models_netS ./pretrained_models/carson_Jan2021.h5 --pretrained_models_netME ./pretrained_models/carmen_Jan2021.h5 --pipeline motion\n", |
|
|
189 |
"2021-02-14 18:03:25.301883: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.1\n", |
|
|
190 |
"2021-02-14 18:03:27.512196: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcuda.so.1\n", |
|
|
191 |
"2021-02-14 18:03:27.536612: E tensorflow/stream_executor/cuda/cuda_driver.cc:314] failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected\n", |
|
|
192 |
"2021-02-14 18:03:27.536661: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:169] retrieving CUDA diagnostic information for host: e990b504c5b4\n", |
|
|
193 |
"2021-02-14 18:03:27.536678: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:176] hostname: e990b504c5b4\n", |
|
|
194 |
"2021-02-14 18:03:27.536807: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:200] libcuda reported version is: 450.102.4\n", |
|
|
195 |
"2021-02-14 18:03:27.536855: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:204] kernel reported version is: 450.102.4\n", |
|
|
196 |
"2021-02-14 18:03:27.536872: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:310] kernel version seems to match DSO: 450.102.4\n", |
|
|
197 |
"2021-02-14 18:03:27.537213: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations: AVX2 FMA\n", |
|
|
198 |
"To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.\n", |
|
|
199 |
"2021-02-14 18:03:27.549271: I tensorflow/core/platform/profile_utils/cpu_utils.cc:104] CPU Frequency: 1696155000 Hz\n", |
|
|
200 |
"2021-02-14 18:03:27.549656: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x4af9c90 initialized for platform Host (this does not guarantee that XLA will be used). Devices:\n", |
|
|
201 |
"2021-02-14 18:03:27.549686: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version\n", |
|
|
202 |
"/tf/Dropbox (Partners HealthCare)/ubuntu/docker/repos/DeepStrain/data/nifti_dataset.py:77: UserWarning: Affine in nifti might be set incorrectly. Setting to affine=affine*zooms\n", |
|
|
203 |
" warnings.warn(\"Affine in nifti might be set incorrectly. Setting to affine=affine*zooms\")\n", |
|
|
204 |
"2021-02-14 18:03:38.911740: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 1946157056 exceeds 10% of free system memory.\n", |
|
|
205 |
"2021-02-14 18:03:39.743555: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 1946157056 exceeds 10% of free system memory.\n", |
|
|
206 |
"2021-02-14 18:03:40.195599: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 1946157056 exceeds 10% of free system memory.\n", |
|
|
207 |
"2021-02-14 18:03:40.499049: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 1946157056 exceeds 10% of free system memory.\n", |
|
|
208 |
"2021-02-14 18:03:41.084644: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 1946157056 exceeds 10% of free system memory.\n" |
|
|
209 |
] |
|
|
210 |
} |
|
|
211 |
], |
|
|
212 |
"source": [ |
|
|
213 |
"!bash ./scripts/test_motion.sh ./datasets/sample_nifti_4D NIFTI ./results/sample_nifti_4D" |
|
|
214 |
] |
|
|
215 |
}, |
|
|
216 |
{ |
|
|
217 |
"cell_type": "markdown", |
|
|
218 |
"metadata": {}, |
|
|
219 |
"source": [ |
|
|
220 |
"Test both segmentation and motion on 4D niftis. " |
|
|
221 |
] |
|
|
222 |
}, |
|
|
223 |
{ |
|
|
224 |
"cell_type": "code", |
|
|
225 |
"execution_count": 107, |
|
|
226 |
"metadata": {}, |
|
|
227 |
"outputs": [ |
|
|
228 |
{ |
|
|
229 |
"name": "stdout", |
|
|
230 |
"output_type": "stream", |
|
|
231 |
"text": [ |
|
|
232 |
"+ DATAROOT=./datasets/sample_nifti_4D\n", |
|
|
233 |
"+ DATAFORMAT=NIFTI\n", |
|
|
234 |
"+ RESULTS_DIR=./results/sample_nifti_4D\n", |
|
|
235 |
"+ CARSON_PATH=./pretrained_models/carson_Jan2021.h5\n", |
|
|
236 |
"+ CARMEN_PATH=./pretrained_models/carmen_Jan2021.h5\n", |
|
|
237 |
"+ PIPELINE=segmentation_motion\n", |
|
|
238 |
"+ CUDA_VISIBLE_DEVICES=\n", |
|
|
239 |
"+ python ./test.py --dataroot ./datasets/sample_nifti_4D --dataformat NIFTI --results_dir ./results/sample_nifti_4D --pretrained_models_netS ./pretrained_models/carson_Jan2021.h5 --pretrained_models_netME ./pretrained_models/carmen_Jan2021.h5 --pipeline segmentation_motion\n", |
|
|
240 |
"2021-02-14 18:04:19.796322: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.1\n", |
|
|
241 |
"2021-02-14 18:04:21.998095: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcuda.so.1\n", |
|
|
242 |
"2021-02-14 18:04:22.024630: E tensorflow/stream_executor/cuda/cuda_driver.cc:314] failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected\n", |
|
|
243 |
"2021-02-14 18:04:22.024683: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:169] retrieving CUDA diagnostic information for host: e990b504c5b4\n", |
|
|
244 |
"2021-02-14 18:04:22.024704: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:176] hostname: e990b504c5b4\n", |
|
|
245 |
"2021-02-14 18:04:22.024818: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:200] libcuda reported version is: 450.102.4\n", |
|
|
246 |
"2021-02-14 18:04:22.024863: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:204] kernel reported version is: 450.102.4\n", |
|
|
247 |
"2021-02-14 18:04:22.024878: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:310] kernel version seems to match DSO: 450.102.4\n", |
|
|
248 |
"2021-02-14 18:04:22.025239: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations: AVX2 FMA\n", |
|
|
249 |
"To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.\n", |
|
|
250 |
"2021-02-14 18:04:22.036833: I tensorflow/core/platform/profile_utils/cpu_utils.cc:104] CPU Frequency: 1696155000 Hz\n", |
|
|
251 |
"2021-02-14 18:04:22.037295: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x5482b60 initialized for platform Host (this does not guarantee that XLA will be used). Devices:\n", |
|
|
252 |
"2021-02-14 18:04:22.037323: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version\n", |
|
|
253 |
"/tf/Dropbox (Partners HealthCare)/ubuntu/docker/repos/DeepStrain/data/nifti_dataset.py:77: UserWarning: Affine in nifti might be set incorrectly. Setting to affine=affine*zooms\n", |
|
|
254 |
" warnings.warn(\"Affine in nifti might be set incorrectly. Setting to affine=affine*zooms\")\n", |
|
|
255 |
"/tf/Dropbox (Partners HealthCare)/ubuntu/docker/repos/DeepStrain/data/nifti_dataset.py:77: UserWarning: Affine in nifti might be set incorrectly. Setting to affine=affine*zooms\n", |
|
|
256 |
" warnings.warn(\"Affine in nifti might be set incorrectly. Setting to affine=affine*zooms\")\n", |
|
|
257 |
"2021-02-14 18:05:17.144698: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 1946157056 exceeds 10% of free system memory.\n", |
|
|
258 |
"2021-02-14 18:05:17.945462: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 1946157056 exceeds 10% of free system memory.\n", |
|
|
259 |
"2021-02-14 18:05:18.392550: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 1946157056 exceeds 10% of free system memory.\n", |
|
|
260 |
"2021-02-14 18:05:18.698553: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 1946157056 exceeds 10% of free system memory.\n", |
|
|
261 |
"2021-02-14 18:05:19.246800: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 1946157056 exceeds 10% of free system memory.\n" |
|
|
262 |
] |
|
|
263 |
} |
|
|
264 |
], |
|
|
265 |
"source": [ |
|
|
266 |
"!bash ./scripts/test_segmentation_motion.sh ./datasets/sample_nifti_4D NIFTI ./results/sample_nifti_4D" |
|
|
267 |
] |
|
|
268 |
}, |
|
|
269 |
{ |
|
|
270 |
"cell_type": "markdown", |
|
|
271 |
"metadata": {}, |
|
|
272 |
"source": [ |
|
|
273 |
"After the segmentations and motion estimates have been generated, we can use both calculate myocardial strain. Note that we're passing the output folder from the previous runs. " |
|
|
274 |
] |
|
|
275 |
}, |
|
|
276 |
{ |
|
|
277 |
"cell_type": "code", |
|
|
278 |
"execution_count": 108, |
|
|
279 |
"metadata": {}, |
|
|
280 |
"outputs": [ |
|
|
281 |
{ |
|
|
282 |
"name": "stdout", |
|
|
283 |
"output_type": "stream", |
|
|
284 |
"text": [ |
|
|
285 |
"+ RESULTS_DIR=./results/sample_nifti_4D\n", |
|
|
286 |
"+ PIPELINE=strain\n", |
|
|
287 |
"+ CUDA_VISIBLE_DEVICES=\n", |
|
|
288 |
"+ python ./test.py --dataroot ./results/sample_nifti_4D --results_dir ./results/sample_nifti_4D --pipeline strain\n", |
|
|
289 |
"2021-02-14 18:05:58.124863: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.1\n", |
|
|
290 |
"0.0 0.0\n", |
|
|
291 |
"-0.0028643845930383114 1.082031278527137e-05\n", |
|
|
292 |
"0.050226276271155106 -0.08250821851016393\n", |
|
|
293 |
"0.0565662083407661 -0.08721526046380865\n", |
|
|
294 |
"0.06341052114161663 -0.09039004858265032\n", |
|
|
295 |
"0.062187569151276205 -0.09092932158690682\n", |
|
|
296 |
"0.06273986208445685 -0.09008545707566279\n", |
|
|
297 |
"0.06704142900754055 -0.09048872862980738\n", |
|
|
298 |
"0.06900019280843682 -0.09202953300260222\n", |
|
|
299 |
"0.06752667505148324 -0.09357088160323081\n", |
|
|
300 |
"0.062176541303209334 -0.09396584141478774\n", |
|
|
301 |
"0.05509482533956014 -0.09227094988109329\n", |
|
|
302 |
"-0.011429068055575722 -0.006970679116830844\n", |
|
|
303 |
"0.04503282824559175 -0.08830198004612085\n", |
|
|
304 |
"0.03627042423655744 -0.08262235528522073\n", |
|
|
305 |
"0.029786156419924492 -0.07606680680357371\n", |
|
|
306 |
"0.026712081007800637 -0.06975290381524307\n", |
|
|
307 |
"0.019263847211321777 -0.06391941641474\n", |
|
|
308 |
"0.007899134163335668 -0.055720237241491964\n", |
|
|
309 |
"-0.005480475496803074 -0.03917932457221275\n", |
|
|
310 |
"-0.00592674874319504 -0.010661710877623127\n", |
|
|
311 |
"-0.0024683947363135297 -0.0014360990600069954\n", |
|
|
312 |
"-0.0021524594363897293 5.030914597078318e-05\n", |
|
|
313 |
"-0.026725685733460826 -0.02099679369525766\n", |
|
|
314 |
"-0.02529592552751031 -0.03299636940750714\n", |
|
|
315 |
"-0.010376969736070649 -0.04378397382622917\n", |
|
|
316 |
"0.002002523134231003 -0.05443799860918108\n", |
|
|
317 |
"0.015893347546116793 -0.06210413845861033\n", |
|
|
318 |
"0.02648765196612738 -0.06909838143488618\n", |
|
|
319 |
"0.03835757750338634 -0.0751729741905356\n" |
|
|
320 |
] |
|
|
321 |
} |
|
|
322 |
], |
|
|
323 |
"source": [ |
|
|
324 |
"!bash ./scripts/test_strain.sh ./results/sample_nifti_4D" |
|
|
325 |
] |
|
|
326 |
}, |
|
|
327 |
{ |
|
|
328 |
"cell_type": "code", |
|
|
329 |
"execution_count": null, |
|
|
330 |
"metadata": {}, |
|
|
331 |
"outputs": [], |
|
|
332 |
"source": [] |
|
|
333 |
}, |
|
|
334 |
{ |
|
|
335 |
"cell_type": "code", |
|
|
336 |
"execution_count": null, |
|
|
337 |
"metadata": {}, |
|
|
338 |
"outputs": [], |
|
|
339 |
"source": [] |
|
|
340 |
}, |
|
|
341 |
{ |
|
|
342 |
"cell_type": "code", |
|
|
343 |
"execution_count": null, |
|
|
344 |
"metadata": {}, |
|
|
345 |
"outputs": [], |
|
|
346 |
"source": [] |
|
|
347 |
} |
|
|
348 |
], |
|
|
349 |
"metadata": { |
|
|
350 |
"kernelspec": { |
|
|
351 |
"display_name": "Python 3", |
|
|
352 |
"language": "python", |
|
|
353 |
"name": "python3" |
|
|
354 |
}, |
|
|
355 |
"language_info": { |
|
|
356 |
"codemirror_mode": { |
|
|
357 |
"name": "ipython", |
|
|
358 |
"version": 3 |
|
|
359 |
}, |
|
|
360 |
"file_extension": ".py", |
|
|
361 |
"mimetype": "text/x-python", |
|
|
362 |
"name": "python", |
|
|
363 |
"nbconvert_exporter": "python", |
|
|
364 |
"pygments_lexer": "ipython3", |
|
|
365 |
"version": "3.6.9" |
|
|
366 |
} |
|
|
367 |
}, |
|
|
368 |
"nbformat": 4, |
|
|
369 |
"nbformat_minor": 2 |
|
|
370 |
} |