You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"This notebook uses the example NIfTI from NiBabel's documentation (\"`someones_anatomy.nii.gz`\") and creates several derived versions of it with different orientations, including oblique physical axes (i.e., the physical axes are rotated w.r.t. the canonical axes of the array), ordering of axes (e.g., RSA), and axis flips (e.g., LAS)."
10
+
]
11
+
},
12
+
{
13
+
"cell_type": "markdown",
14
+
"metadata": {},
15
+
"source": [
16
+
"### Preamble\n",
17
+
"Prepare a Python environment and use a temporal directory for the outputs. After that, fetch the actual file from NiBabel documentation."
"Let's first visualize the example image, and retain some copies of the original header and affine."
94
+
]
95
+
},
78
96
{
79
97
"cell_type": "code",
80
98
"execution_count": 3,
@@ -112,6 +130,14 @@
112
130
"nii.orthoview()"
113
131
]
114
132
},
133
+
{
134
+
"cell_type": "markdown",
135
+
"metadata": {},
136
+
"source": [
137
+
"### Generating variants\n",
138
+
"Playing with the affine header and the data array ordering of axes and elements we generate several versions of the dataset with different orientations (LAS, LPS, oblique, LPS oblique)."
"### Testing the variants with *NiTransforms*, *AFNI*, *ANTs*, and *FSL*, with a rigid-body transform\n",
469
+
"Now, let's use these variants to check how they affect in concatenation with other transforms\n",
470
+
"\n",
471
+
"First, we check that, as *NiBabel* represents the data array disregarding the affine, the `.orthoview()` visualization of the *oblique* image shows the same apparent data orientation as for the original file."
472
+
]
473
+
},
422
474
{
423
475
"cell_type": "code",
424
476
"execution_count": 5,
@@ -451,6 +503,13 @@
451
503
"new.orthoview()"
452
504
]
453
505
},
506
+
{
507
+
"cell_type": "markdown",
508
+
"metadata": {},
509
+
"source": [
510
+
"**Create a transform**. We test with a rigid-body transformation with 3 rotations and 3 translations"
Copy file name to clipboardExpand all lines: docs/notebooks/02_afni_deoblique.ipynb
+29-3Lines changed: 29 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,12 @@
4
4
"cell_type": "markdown",
5
5
"metadata": {},
6
6
"source": [
7
-
"## AFNI Deoblique"
7
+
"## AFNI Deoblique\n",
8
+
"\n",
9
+
"This notebook explores the implementation of *deobliquing* operations in AFNI, in order to be able to correctly manipulate transforms generated by the tool, and to produce transforms that can be correctly applied with AFNI.\n",
10
+
"Most of the preparation comes from the previous notebook.\n",
0 commit comments