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
See :download:`derivations/spm_dicom_orient.py` for the derivations and
264
332
some explanations.
@@ -305,7 +373,7 @@ and 'ImagePositionPatient' for $j$ is:
305
373
306
374
.. math::
307
375
308
-
T^j = \left(\begin{smallmatrix}T^{1}_{{1}} + c_{{1}} d \Delta_{slices}\\T^{1}_{{2}} + c_{{2}} d \Delta_{slices}\\T^{1}_{{3}} + c_{{3}} d \Delta_{slices}\end{smallmatrix}\right)
376
+
T^j = \left(\begin{smallmatrix}T^{1}_{{1}} + \Delta{s} d n_{{1}}\\T^{1}_{{2}} + \Delta{s} d n_{{2}}\\T^{1}_{{3}} + \Delta{s} d n_{{3}}\end{smallmatrix}\right)
309
377
310
378
Remember that the third column of $A$ gives the vector resulting from a
311
379
unit change in the slice voxel coordinate. So, the
@@ -315,18 +383,24 @@ $\mathbf{a}$ is the position of the first voxel in some slice (here
315
383
slice 1, therefore $\mathbf{a} = T^1$) and $\mathbf{b}$ is $d$ times the
316
384
third colum of $A$. Obviously $d$ can be negative or positive. This
317
385
leads to various ways of recovering something that is proportional to
318
-
$d$ plus a constant. SPM takes the inner product of $T^j$ with the unit
319
-
vector component of third column of $A_j$ - in the descriptions here,
320
-
this is the vector $\mathbf{c}$:
386
+
$d$ plus a constant. The algorithm suggested in this `ITK post on
387
+
ordering slices`_ - and the one used by SPM - is to take the inner
388
+
product of $T^j$ with the unit vector component of third column of
389
+
$A_j$ - in the descriptions here, this is the vector $\mathbf{n}$:
390
+
391
+
.. _ITK post on ordering slices: http://www.itk.org/pipermail/insight-users/2003-September/004762.html
321
392
322
393
.. math::
323
394
324
-
T^j \cdot\mathbf{c} = \left(\begin{smallmatrix}c_{{1}} T^{1}_{{1}} + c_{{2}} T^{1}_{{2}} + c_{{3}} T^{1}_{{3}} + d \Delta_{slices} c_{{1}}^{2} + d \Delta_{slices} c_{{2}}^{2} + d \Delta_{slices} c_{{3}}^{2}\end{smallmatrix}\right)
395
+
T^j \cdot\mathbf{c} = \left(\begin{smallmatrix}T^{1}_{{1}} n_{{1}} + T^{1}_{{2}} n_{{2}} + T^{1}_{{3}} n_{{3}} + \Delta{s} d n_{{1}}^{2} + \Delta{s} d n_{{2}}^{2} + \Delta{s} d n_{{3}}^{2}\end{smallmatrix}\right)
396
+
397
+
This is the distance of 'ImagePositionPatient' along the slice direction
398
+
cosine.
325
399
326
400
The unknown $T^1$ terms pool into a constant, and the operation has the
327
-
neat feature that, because the $c_N^2$ terms, by definition, sum to 1,
328
-
the whole can be expressed as $\lambda + \Delta_{slices} d$ - i.e. it is
329
-
equal to the slice voxel size ($\Delta_{slices}$) multiplied by $d$,
401
+
neat feature that, because the $n_{123}^2$ terms, by definition, sum to 1,
402
+
the whole can be expressed as $\lambda + \Delta{s} d$ - i.e. it is
403
+
equal to the slice voxel size ($\Delta{s}$) multiplied by $d$,
330
404
plus a constant.
331
405
332
406
Again, see :download:`derivations/spm_dicom_orient.py` for the derivations.
0 commit comments