Page History
...
* Just for testing, I recommended that you run MAX with "--xml-ops=none" as shown above which prevents any XML files from being written. We can talk about this later. So for now, all the results (along with A LOT of other info) will be printed to the screen.
5. pixel-size and slice-spacing
Error (6501) results if the slice spacing is wrong. Here's one way to get the slice spacing from the DICOM images: The most reliable DICOM tag to use is "Image Position Patient" (0020,0032). A typical dump of this tag from an image looks like this:
0020 0032 34 // REL Image Position
Patient//-209.800003-193.600006-72.199997
It is a Type 1 tag, so it's always going to be present and should be reliable. Since CT images are axials, the z position of each image is the final coordinate number: -72.2mm in this case. The most reliable way of doing this is to extract the z coordinates from all the images, sort them, and then see what the delta-z value is.
(Watch out when parsing these lines: The "\" can cause problems if the numeral immediately following it is a 0 (zero). In many programming/scripting situations, "\0" represents a null which could signal the end of the string!!)