[MINC-users] Wikibook coordinate conversion documentation fixed

Peter Neelin peter.neelin at gmail.com
Mon Jun 16 09:57:56 EDT 2014


Hi Alex and Tarek,

On Sat, Jun 14, 2014 at 12:59 PM, Alex Zijdenbos <zijdenbos at gmail.com>
wrote:


> Nice work! It's good to have this coordinate business straightened out once
>

Yes, thanks Tarek for finding this error and fixing it. If you are using
column vectors, then each axis unit vector (direction cosines) becomes a
column of the transformation matrix.


> and for all, as it is invariably problematic, especially for new MINC users
> - and in fact, I am not sure I'd ever wrapped my head completely around the
> direction cosines bit :-)
>

Apart from the name, the direction cosines are really not that hard. They
are just the unit vector along the axis in the positive direction. The
language is borrowed from the ACR-NEMA 1.0 standard ("Direction cosines of
the R axis of the image system with respect to the patient coordinate axes
x,y,z") which has been carried over into DICOM 3.0 ("The direction cosines
of the first row and the first column with respect to the patient"). For
the record, minc attributes are largely borrowed/inspired/generalized from
the ACR-NEMA 1.0 standard of which I had a copy in early 1992 when minc was
created (coincidentally, DICOM appeared at around the same time).

The tricky bit is the start attribute. Conceptually it is simple - an
offset along the axis (parallel to the axis). I chose this because one
could then ignore the rotation (direction cosines) and properly handle
translation. This was based on the assumption that broken (naive)
implementations would handle scaling and translation but ignore rotation of
the sampling grid. Unfortunately, it makes it a bit more complicated to
calculate the full transformation matrix. ACR-NEMA/DICOM chose to use the
position of the first pixel in the patient frame, which makes calculating
the full transformation matrix easy. Basically, they assume that naive
implementations will do the scaling, but will not worry about rotation or
translation.

In some sense, we were guessing as to what a naive/limited implementation
would choose to honour. In retrospect, I think that they may have made the
better choice because it is easier to understand and most software now
handles the full transformation matrix correctly (although the lack of
invariance under rotation still bothers me, as does the fact that it does
not generalize well to independent axes).

Regardless, the minc community is pretty much stuck with my choice from 22
years ago, since change something as fundamental as coordinate system
definition is a hard thing to do.


>
> 3) Related to 2), we may want to clarify explicitly here that a MINC image
> is a lattice of point samples, which I think is often not obvious to
> people. In this context, the statement: "The voxel coordinate values are
> nonnegative integers ranging from zero to one less than the number of data
> points along the axis, with the origin fixed at one corner of the image"
> may be confusing to some: if you consider the step size as the "width" of a
> voxel (which I think most people would do), then the voxel coordinate
> origin is actually half a voxel into the image, or conversely, what people
> might consider the "corner" of a standard MNI 1.00mm image, actually has
> voxel coordinates (-0.5, -0.5, -0.5), which is also _not_ the start
> coordinate.
>

I am not alone in this choice. This is consistent with ACR-NEMA/DICOM -
from the DICOM standard: "The Image Position (0020,0032) specifies the x,
y, and z coordinates of the upper left hand corner of the image; it is the
center of the first voxel transmitted". I think that it reflects the
physicist/engineering perspective that medical imaging data is a sampling
with both sampling frequency (voxel separation) and resolution (voxel
width). Computer scientists tend to like to think about images as blocks -
this has annoyed me for years.

Anyway, I just want to be clear that the matrices presented in those
documents are not defining of the coordinate system. The definition is
pretty simple (pulled from my head right now, so perhaps not expressed as
clearly as possible):

For each axis (spatial dimension) there is a start, step and set of
direction cosines.
The direction cosines are the unit vector of the axis in the patient frame,
oriented in the positive direction (largest component must be positive).
The start is the real-world (millimetres) signed offset of the centre of
the first sample along (parallel to) the axis.
The step is the real-world (millimetres) sample separation, with a sign
chosen to indicate positive or negative direction.

The patient frame is defined as it is in DICOM, except that left-to-right
is positive (Alan Evans bias) and posterior-to-anterior is positive (my
bias towards human-oriented screen coordinates, a la Iris GL library rather
than X and others, plus the desire for a right-handed coordinate system).

Hope that this helps to clarify. Tarek, please confirm that everything is
consistent.

Peter
-- 
Peter Neelin
(peter.neelin at gmail.com)


More information about the MINC-users mailing list