@@ -242,8 +242,8 @@ Where:
242
242
243
243
For later convenience we also define values useful for 3D volumes:
244
244
245
- * $s$ : slice index to the slice plane. The first slice index is zero.
246
- * $\D elta{s}$ - spacing in mm between slices.
245
+ * $s$ : Slice index to the slice plane. The first slice index is zero.
246
+ * $\D elta{s}$ - Spacing in mm between slices.
247
247
248
248
.. _dicom-3d-affines :
249
249
@@ -307,13 +307,13 @@ first voxel in the last (slice index = $N-1$) slice to mm space. So:
307
307
308
308
.. math ::
309
309
310
- \left (\begin {smallmatrix}T^N\\ 1 \end {smallmatrix}\right ) = A \left (\begin {smallmatrix}0 \\ 0 \\- 1 + N \\ 1 \end {smallmatrix}\right )
310
+ \left (\begin {smallmatrix}T^N\\ 1 \end {smallmatrix}\right ) = A \left (\begin {smallmatrix}0 \\ 0 \\ N - 1 \\ 1 \end {smallmatrix}\right )
311
311
312
312
From this it follows that:
313
313
314
314
.. math ::
315
315
316
- \begin {Bmatrix}k_{{1 }} : \frac {T^{1 }_{{1 }} - T^{N }_{{1 }}}{1 - N }, & k_{{2 }} : \frac {T^{1 }_{{2 }} - T^{N }_{{2 }}}{1 - N }, & k_{{3 }} : \frac {T^{1 }_{{3 }} - T^{N }_{{3 }}}{1 - N }\end {Bmatrix}
316
+ \begin {Bmatrix}k_{{1 }} : \frac {T^{N }_{{1 }} - T^{1 }_{{1 }}}{N - 1 }, & k_{{2 }} : \frac {T^{N }_{{2 }} - T^{1 }_{{2 }}}{N - 1 }, & k_{{3 }} : \frac {T^{N }_{{3 }} - T^{1 }_{{3 }}}{N - 1 }\end {Bmatrix}
317
317
318
318
and therefore:
319
319
@@ -324,13 +324,17 @@ and therefore:
324
324
325
325
.. math ::
326
326
327
- A_{multi} = \left (\begin {smallmatrix}F_{{11 }} \Delta {r} & F_{{12 }} \Delta {c} & \frac {T^{1 }_{{1 }} - T^{N }_{{1 }}}{1 - N } & T^{1 }_{{1 }}\\ F_{{21 }} \Delta {r} & F_{{22 }} \Delta {c} & \frac {T^{1 }_{{2 }} - T^{N }_{{2 }}}{1 - N } & T^{1 }_{{2 }}\\ F_{{31 }} \Delta {r} & F_{{32 }} \Delta {c} & \frac {T^{1 }_{{3 }} - T^{N }_{{3 }}}{1 - N } & T^{1 }_{{3 }}\\ 0 & 0 & 0 & 1 \end {smallmatrix}\right )
327
+ A_{multi} = \left (\begin {smallmatrix}F_{{11 }} \Delta {r} & F_{{12 }} \Delta {c} & \frac {T^{N }_{{1 }} - T^{1 }_{{1 }}}{N - 1 } & T^{1 }_{{1 }}\\ F_{{21 }} \Delta {r} & F_{{22 }} \Delta {c} & \frac {T^{N }_{{2 }} - T^{1 }_{{2 }}}{N - 1 } & T^{1 }_{{2 }}\\ F_{{31 }} \Delta {r} & F_{{32 }} \Delta {c} & \frac {T^{N }_{{3 }} - T^{1 }_{{3 }}}{N - 1 } & T^{1 }_{{3 }}\\ 0 & 0 & 0 & 1 \end {smallmatrix}\right )
328
328
329
329
A_{single} = \left (\begin {smallmatrix}F_{{11 }} \Delta {r} & F_{{12 }} \Delta {c} & \Delta {s} n_{{1 }} & T^{1 }_{{1 }}\\ F_{{21 }} \Delta {r} & F_{{22 }} \Delta {c} & \Delta {s} n_{{2 }} & T^{1 }_{{2 }}\\ F_{{31 }} \Delta {r} & F_{{32 }} \Delta {c} & \Delta {s} n_{{3 }} & T^{1 }_{{3 }}\\ 0 & 0 & 0 & 1 \end {smallmatrix}\right )
330
330
331
331
See :download: `derivations/spm_dicom_orient.py ` for the derivations and
332
332
some explanations.
333
333
334
+ For a single slice $N=1$ the affine matrix is $A_{single}$. In this
335
+ case, the slice spacing $\D elta{s}$ may be obtained by the Spacing
336
+ Between Slices (0018,0088) attribute in units of mm, if it exists.
337
+
334
338
.. _dicom-z-from-slice :
335
339
336
340
Working out the Z coordinates for a set of slices
0 commit comments