|
2 | 2 | "cells": [ |
3 | 3 | { |
4 | 4 | "cell_type": "markdown", |
5 | | - "id": "fac4dff7", |
| 5 | + "id": "a41f16fb", |
6 | 6 | "metadata": {}, |
7 | 7 | "source": [ |
8 | 8 | "# Introduction to dMRI data" |
|
11 | 11 | { |
12 | 12 | "cell_type": "code", |
13 | 13 | "execution_count": null, |
14 | | - "id": "8c58eea3", |
| 14 | + "id": "95dc8c25", |
15 | 15 | "metadata": { |
16 | 16 | "tags": [ |
17 | 17 | "remove-cell" |
|
28 | 28 | }, |
29 | 29 | { |
30 | 30 | "cell_type": "markdown", |
31 | | - "id": "6079c59f", |
| 31 | + "id": "da052ddd", |
32 | 32 | "metadata": {}, |
33 | 33 | "source": [ |
34 | 34 | "Diffusion imaging probes the random, microscopic movement of water molecules by using MRI sequences that are sensitive to the geometry and environmental organization surrounding these protons.\n", |
|
40 | 40 | { |
41 | 41 | "cell_type": "code", |
42 | 42 | "execution_count": null, |
43 | | - "id": "44fe4b07", |
| 43 | + "id": "946abc6d", |
44 | 44 | "metadata": { |
45 | 45 | "tags": [ |
46 | 46 | "remove-input" |
47 | 47 | ] |
48 | 48 | }, |
49 | 49 | "outputs": [], |
50 | 50 | "source": [ |
51 | | - "HTML(\"\"\"<video loop=\"yes\" muted=\"yes\" autoplay=\"yes\" controls=\"yes\"><source src=\"../assets/videos/dMRI-signal-movie.mp4\" type=\"video/mp4\"/></video>\"\"\")" |
| 51 | + "HTML(\"\"\"<video loop=\"yes\" muted=\"yes\" autoplay=\"yes\" controls=\"yes\"><source src=\"../videos/dMRI-signal-movie.mp4\" type=\"video/mp4\"/></video>\"\"\")" |
52 | 52 | ] |
53 | 53 | }, |
54 | 54 | { |
55 | 55 | "cell_type": "markdown", |
56 | | - "id": "b993d0ac", |
| 56 | + "id": "3abc4df2", |
57 | 57 | "metadata": {}, |
58 | 58 | "source": [ |
59 | 59 | "*Sourced from Dr. A. Rokem, DIPY Workshop 2021*\n", |
|
86 | 86 | { |
87 | 87 | "cell_type": "code", |
88 | 88 | "execution_count": null, |
89 | | - "id": "14885d6a", |
| 89 | + "id": "c5a0b738", |
90 | 90 | "metadata": {}, |
91 | 91 | "outputs": [], |
92 | 92 | "source": [ |
|
124 | 124 | }, |
125 | 125 | { |
126 | 126 | "cell_type": "markdown", |
127 | | - "id": "7581f5f8", |
| 127 | + "id": "fe4c7e01", |
128 | 128 | "metadata": {}, |
129 | 129 | "source": [ |
130 | 130 | "This code implements several *attributes* as well as a *behavior* - the `__len__` *method*.\n", |
|
136 | 136 | { |
137 | 137 | "cell_type": "code", |
138 | 138 | "execution_count": null, |
139 | | - "id": "868f5734", |
| 139 | + "id": "fb24834b", |
140 | 140 | "metadata": {}, |
141 | 141 | "outputs": [], |
142 | 142 | "source": [ |
|
152 | 152 | }, |
153 | 153 | { |
154 | 154 | "cell_type": "markdown", |
155 | | - "id": "84cf1c50", |
| 155 | + "id": "17fe71bd", |
156 | 156 | "metadata": {}, |
157 | 157 | "source": [ |
158 | 158 | "The output of this `print()` statement is telling us that this (simulated) dataset has 64 diffusion-weighted samples.\n", |
|
169 | 169 | { |
170 | 170 | "cell_type": "code", |
171 | 171 | "execution_count": null, |
172 | | - "id": "5ebc1a4d", |
| 172 | + "id": "e18a2488", |
173 | 173 | "metadata": {}, |
174 | 174 | "outputs": [], |
175 | 175 | "source": [ |
|
183 | 183 | }, |
184 | 184 | { |
185 | 185 | "cell_type": "markdown", |
186 | | - "id": "8e5fc8b2", |
| 186 | + "id": "ed3a0dc1", |
187 | 187 | "metadata": {}, |
188 | 188 | "source": [ |
189 | 189 | "In this case, the dataset is reporting to have 102 diffusion-weighted samples.\n", |
|
195 | 195 | { |
196 | 196 | "cell_type": "code", |
197 | 197 | "execution_count": null, |
198 | | - "id": "9df1aa93", |
| 198 | + "id": "3500222f", |
199 | 199 | "metadata": {}, |
200 | 200 | "outputs": [], |
201 | 201 | "source": [ |
|
204 | 204 | }, |
205 | 205 | { |
206 | 206 | "cell_type": "markdown", |
207 | | - "id": "c2dbe2bb", |
| 207 | + "id": "c3a27f6a", |
208 | 208 | "metadata": {}, |
209 | 209 | "source": [ |
210 | 210 | "Perhaps, the most interesting aspect of our DWI data structure is that it allows indexed access.\n", |
|
214 | 214 | { |
215 | 215 | "cell_type": "code", |
216 | 216 | "execution_count": null, |
217 | | - "id": "3dc30f25", |
| 217 | + "id": "a00aad1e", |
218 | 218 | "metadata": {}, |
219 | 219 | "outputs": [], |
220 | 220 | "source": [ |
|
225 | 225 | }, |
226 | 226 | { |
227 | 227 | "cell_type": "markdown", |
228 | | - "id": "56e5c29b", |
| 228 | + "id": "3e4631a6", |
229 | 229 | "metadata": {}, |
230 | 230 | "source": [ |
231 | 231 | "## Visualizing the data\n", |
|
246 | 246 | { |
247 | 247 | "cell_type": "code", |
248 | 248 | "execution_count": null, |
249 | | - "id": "d5a8df5e", |
| 249 | + "id": "a922378b", |
250 | 250 | "metadata": { |
251 | 251 | "tags": [ |
252 | 252 | "hide-cell" |
|
261 | 261 | }, |
262 | 262 | { |
263 | 263 | "cell_type": "markdown", |
264 | | - "id": "19a93483", |
| 264 | + "id": "dce21b10", |
265 | 265 | "metadata": {}, |
266 | 266 | "source": [ |
267 | 267 | "When calling `plot_dwi()`, we will be required a 3D data object, and optionally, an `affine` orientation matrix and a `gradient` or b-vector.\n", |
|
281 | 281 | { |
282 | 282 | "cell_type": "code", |
283 | 283 | "execution_count": null, |
284 | | - "id": "815446a5", |
| 284 | + "id": "53318d78", |
285 | 285 | "metadata": { |
286 | 286 | "tags": [ |
287 | 287 | "hide-cell" |
|
296 | 296 | { |
297 | 297 | "cell_type": "code", |
298 | 298 | "execution_count": null, |
299 | | - "id": "2afc9c73", |
| 299 | + "id": "e998629a", |
300 | 300 | "metadata": { |
301 | 301 | "tags": [ |
302 | 302 | "hide-cell" |
|
310 | 310 | }, |
311 | 311 | { |
312 | 312 | "cell_type": "markdown", |
313 | | - "id": "7253e78e", |
| 313 | + "id": "3c737783", |
314 | 314 | "metadata": {}, |
315 | 315 | "source": [ |
316 | 316 | "Diffusion that exhibits directionality in the same direction as the gradient results in a loss of signal.\n", |
|
334 | 334 | { |
335 | 335 | "cell_type": "code", |
336 | 336 | "execution_count": null, |
337 | | - "id": "c76d4f1d", |
| 337 | + "id": "7e0105e2", |
338 | 338 | "metadata": { |
339 | 339 | "tags": [ |
340 | 340 | "hide-cell" |
|
347 | 347 | }, |
348 | 348 | { |
349 | 349 | "cell_type": "markdown", |
350 | | - "id": "36be2121", |
| 350 | + "id": "1eb0e4f0", |
351 | 351 | "metadata": {}, |
352 | 352 | "source": [ |
353 | 353 | "We get a $4\\times102$ -- three spatial coordinates ($b_x$, $b_y$, $b_z$) of the unit-norm \"*b-vector*\", plus the gradient sensitization magnitude (the \"*b-value*\"), with a total of 102 different orientations for the case at hand.\n", |
|
363 | 363 | { |
364 | 364 | "cell_type": "code", |
365 | 365 | "execution_count": null, |
366 | | - "id": "c6c5dcca", |
| 366 | + "id": "997899de", |
367 | 367 | "metadata": { |
368 | 368 | "tags": [ |
369 | 369 | "hide-cell" |
|
376 | 376 | }, |
377 | 377 | { |
378 | 378 | "cell_type": "markdown", |
379 | | - "id": "4f22f9f9", |
| 379 | + "id": "3a7d6697", |
380 | 380 | "metadata": {}, |
381 | 381 | "source": [ |
382 | 382 | "Later, we'll refer to this array as the gradient table.\n", |
|
395 | 395 | { |
396 | 396 | "cell_type": "code", |
397 | 397 | "execution_count": null, |
398 | | - "id": "bb4cae0d", |
| 398 | + "id": "0caf42c7", |
399 | 399 | "metadata": {}, |
400 | 400 | "outputs": [], |
401 | 401 | "source": [ |
|
406 | 406 | }, |
407 | 407 | { |
408 | 408 | "cell_type": "markdown", |
409 | | - "id": "b48d1407", |
| 409 | + "id": "c682e45b", |
410 | 410 | "metadata": {}, |
411 | 411 | "source": [ |
412 | 412 | "We've projected all of the gradient directions onto the surface of a sphere, with each unique gradient strength colour-coded.\n", |
|
423 | 423 | "default_lexer": "python" |
424 | 424 | }, |
425 | 425 | "kernelspec": { |
426 | | - "display_name": "Python 3 (ipykernel)", |
| 426 | + "display_name": "Python 3", |
427 | 427 | "language": "python", |
428 | 428 | "name": "python3" |
429 | | - }, |
430 | | - "language_info": { |
431 | | - "codemirror_mode": { |
432 | | - "name": "ipython", |
433 | | - "version": 3 |
434 | | - }, |
435 | | - "file_extension": ".py", |
436 | | - "mimetype": "text/x-python", |
437 | | - "name": "python", |
438 | | - "nbconvert_exporter": "python", |
439 | | - "pygments_lexer": "ipython3", |
440 | | - "version": "3.11.13" |
441 | 429 | } |
442 | 430 | }, |
443 | 431 | "nbformat": 4, |
|
0 commit comments