I'll need to repeat myself here:
- No you cannot use Slice Thickness (0018,0050) to compute the Reconstruction Interval.
See an in depth answer here: https://stackoverflow.com/a/15116116/136285
Technically this question is an exact duplicate of:
But for completeness let's describe the algorithm here again:
The DICOM standard is online at http://dicom.nema.org/. The "Image
Orientation Patient" tag gives the direction cosines for the rows and
columns for the three axes defined above. Your typical axial slices will
have a value 1/0/0/0/1/0
: rows increase from left to right, columns
increase from posterior to anterior. This is your everyday "looking up
from the bottom of the head with the eyeballs up" image.
In your images, IOP = 0.999794\0.000000\-0.020289\-0.020127\-0.126071\-0.991817
. So this is a
slightly-rotated coronal acquisition: rows increase from left to right,
and columns increase from head to foot.
The "Image Position Patient"
tag gives the coordinates of the first
voxel in the image in the "RAH" coordinate system, relative to some
origin.
The steps it takes when reconstructing a volume are these, first, calculate the slice normal from IOP:
normal[0] = cosines[1]*cosines[5] - cosines[2]*cosines[4];
normal[1] = cosines[2]*cosines[3] - cosines[0]*cosines[5];
normal[2] = cosines[0]*cosines[4] - cosines[1]*cosines[3];
You only have to do this once for all slices in the volume. Next, for
each slice, calculate the distance along the slice normal using the IPP
tag ("dist" is initialized to zero before reading the first slice) :
for (int i = 0; i < 3; ++i) dist += normal[i]*ipp[i];
Then order the slices according to the value "dist". Finally, once
you've read in all the slices, calculate the z-spacing as the difference
between the "dist" values for the first two slices (or use an average, or even a more complex algorithm to detect missing slices).
Original reference: