|
| 1 | + |
| 2 | +######################################## |
| 3 | +Radiological vs neurological conventions |
| 4 | +######################################## |
| 5 | + |
| 6 | +It is relatively common to talk about images being in "radiological" compared |
| 7 | +to "neurological" convention, but the terms can be used in different and |
| 8 | +confusing ways. |
| 9 | + |
| 10 | +See :doc:`coordinate_systems` for background on voxel space, reference space |
| 11 | +and affines. |
| 12 | + |
| 13 | +************************************************ |
| 14 | +Neurological and radiological display convention |
| 15 | +************************************************ |
| 16 | + |
| 17 | +Radiologists like looking at their images with the patient's left on the right |
| 18 | +of the image. If they are looking at a brain image, it is as if they were |
| 19 | +looking at the brain slice from the point of view of the patient's feet. |
| 20 | +Neurologists like looking at brain images with the patient's right on the |
| 21 | +right of the image. This perspective is as if the neurologist is looking at |
| 22 | +the slice from the top of the patient's head. The convention is one of image |
| 23 | +display. The image can have any voxel arrangement on disk or memory, and any |
| 24 | +output reference space; it is only necessary for the software displaying the |
| 25 | +image to know the reference space and the (probably affine) mapping between |
| 26 | +voxel space and reference space; then the software can work out which voxels |
| 27 | +are on the left or right of the subject and flip the images to the taste of |
| 28 | +the viewer. We could unpack these uses as *neurological display convention* |
| 29 | +and *radiological display convention*. |
| 30 | + |
| 31 | +************************************** |
| 32 | +Neurological / radiological voxel axes |
| 33 | +************************************** |
| 34 | + |
| 35 | +Radiological and neurological are sometimes used to refer to particular |
| 36 | +alignments of the voxel input axes to scanner RAS+ output axes. If we look at |
| 37 | +the affine mapping between voxel space and scanner RAS+, we may find that |
| 38 | +moving along the first voxel axis by one unit results in a equivalent scanner |
| 39 | +RAS+ movement that is mainly left to right. This can happen with a diagonal |
| 40 | +3x3 part of the affine mapping to scanner RAS+ (see |
| 41 | +:doc:`coordinate_systems`): |
| 42 | + |
| 43 | +.. plot:: |
| 44 | + :context: |
| 45 | + :nofigs: |
| 46 | + |
| 47 | + >>> import numpy as np |
| 48 | + >>> from nibabel.affines import apply_affine |
| 49 | + >>> diag_affine = np.array([[3., 0, 0, 0], |
| 50 | + ... [0, 3., 0, 0], |
| 51 | + ... [0, 0, 4.5, 0], |
| 52 | + ... [0, 0, 0, 1]]) |
| 53 | + >>> ijk = [1, 0, 0] # moving one unit on the first voxel axis |
| 54 | + >>> apply_affine(diag_affine, ijk) |
| 55 | + array([ 3., 0., 0.]) |
| 56 | + |
| 57 | +In this case the voxel axes are aligned to the output axes, in the sense that |
| 58 | +moving in a positive direction on the first voxel axis results in increasing |
| 59 | +values on the "R+" output axis, and similarly for the second voxel axis with |
| 60 | +output "A+" and the third voxel axis with output "S+". |
| 61 | + |
| 62 | +Some people therefore refer to this alignment of voxel and RAS+ axes as |
| 63 | +*RAS voxel axes*. |
| 64 | + |
| 65 | +**************************************** |
| 66 | +Neurological / radiological voxel layout |
| 67 | +**************************************** |
| 68 | + |
| 69 | +Very confusingly, some people also refer to images with "RAS" voxel axes as |
| 70 | +having "neurological" voxel layout. This is because the simplest way to |
| 71 | +display slices from this voxel array will result in the left of the subject |
| 72 | +appearing towards the left hand side of the screen and therefore neurological |
| 73 | +display convention. If we take a slice $k$ over the third axis of the image |
| 74 | +data array (``img_data[:, :, k]``), the resulting slice will have a first |
| 75 | +array axis going from left to right in terms of spatial position and the |
| 76 | +second array axis going from posterior to anterior. If we display this image |
| 77 | +with the first axis going from left to right on screen and the second from |
| 78 | +bottom to top, it will have the subject's right towards the right of the |
| 79 | +screen, and anterior towards the top of the screen, as neurologists like it. |
| 80 | +Here we are showing the middle slice of :download:`an image |
| 81 | +</downloads/someones_anatomy.nii.gz>` with RAS voxel axes: |
| 82 | + |
| 83 | +.. plot:: |
| 84 | + :context: |
| 85 | + |
| 86 | + >>> import nibabel as nib |
| 87 | + >>> import matplotlib.pyplot as plt |
| 88 | + >>> img = nib.load('downloads/someones_anatomy.nii.gz') |
| 89 | + >>> # The 3x3 part of the affine is diagonal with all +ve values |
| 90 | + >>> img.affine |
| 91 | + array([[ 2.75, 0. , 0. , -78. ], |
| 92 | + [ 0. , 2.75, 0. , -91. ], |
| 93 | + [ 0. , 0. , 2.75, -91. ], |
| 94 | + [ 0. , 0. , 0. , 1. ]]) |
| 95 | + >>> img_data = img.get_data() |
| 96 | + >>> a_slice = img_data[:, :, 28] |
| 97 | + >>> # Need transpose to put first axis left-right, second bottom-top |
| 98 | + >>> plt.imshow(a_slice.T, cmap="gray", origin="lower") |
| 99 | + |
| 100 | +This slice does have the voxels from the right of isocenter towards the right |
| 101 | +of the screen, neurology style. |
| 102 | + |
| 103 | +Similarly, an "LAS" alignment of voxel axes to RAS+ axes would result in an |
| 104 | +image with the left of the subject towards the right of the screen, as |
| 105 | +radiologists like it. "LAS" voxel axes can also be called "radiological" |
| 106 | +voxel layout for this reason [#memory-layout]_. |
| 107 | + |
| 108 | +Over time it has become more common for the scanner to generate images with |
| 109 | +almost any orientation of the voxel axes relative to the reference axes. |
| 110 | +Maybe for this reason, the terms "radiological" and "neurological" are less |
| 111 | +commonly used as applied to voxel layout. We nipyers try to avoid the |
| 112 | +terms neurological or radiological for voxel layout because they can make it |
| 113 | +harder to separate the idea of voxel and reference space axes and the affine |
| 114 | +as a mapping between them. |
| 115 | + |
| 116 | +.. rubric:: Footnotes |
| 117 | + |
| 118 | +.. [#memory-layout] We have deliberately not fully defined what we mean by |
| 119 | + "voxel layout" in the text. Conceptually, an image array could be stored |
| 120 | + in any layout on disk; the definition of the image format specifies how |
| 121 | + the image reader should interpret the data on disk to return the right |
| 122 | + array value for a given voxel coordinate. The relationship of the values |
| 123 | + on disk to the coordinate values in the array has no bearing on the fact |
| 124 | + that the voxel axes align to the output axes. In practice the terms RAS / |
| 125 | + neurological and LAS / radiogical as applied to voxel layout appear to |
| 126 | + refer exclusively to the situation where image arrays are stored in |
| 127 | + "Fortran array layout" on disk. Imagine an image array of shape $(I, J, |
| 128 | + K)$ with values of length $v$. For an image of 64-bit floating point |
| 129 | + values, $v = 8$. An image array is stored in Fortran array layout only if |
| 130 | + the value for voxel coordinate (1, 0, 0) is $v$ bytes on disk from the |
| 131 | + value for (0, 0, 0); (0, 1, 0) is $I * v$ bytes from (0, 0, 0); and (0, 0, |
| 132 | + 1) is $I * J * v$ bytes from (0, 0, 0). Analyze_ and NIfTI_ images use |
| 133 | + Fortran array layout. |
| 134 | +
|
| 135 | +.. include:: links_names.txt |
0 commit comments