0
votes

My problem is, that I have to develop a program, that can open DICOM CT images in C# (without any library) and I should process the axial, coronal and sagittal images as well. I have figured these out, but the coronal and sagittal image reslution is not right. I checked out a million forums and questions, but I just didn't get the right way to find the coronal, sagittal resolutions. If someone can give me a formula or something I would be very happy.

As far as I saw these are the information needed to get the resoltion:

  • Width and Height: 512x512
  • Number of images: 518
  • (0018, 0050) Slice Thickness: 1.25
  • (0018, 0080) Spacing Between Slices: 0.625
  • (0028, 0030) Pixel Spacing: 0.845703 / 0.845703

But I calculate the Spacing Between Slices from the (0020, 0032) Image Position (Patient), which is 0.625 And I don't really know what is the connection between these information, what is the formula to get the right resolution. And my exact question is: What is the resolution of the coronal, and sagittal images?

If you guys need any more information about the slices just let me know. Thank you in advance :)

EDIT: I checked with RadiAnt DICOM Viewer that the coronal/sagittal resolution should be 512x383. If anyone knows the formula why the result is 383. Please let me know. Meanwhile I'll try to figure out myself.

3

3 Answers

2
votes

there is no clear answer for resolution. You should not forget that in DICOM you have the PixelSpacing, which you do not have in "normal images".

a typical image must always have a equidistant grid to be displayed correctly on screen. But in dicom you can have a image with 100x100 pixels and pixelspacing 1.0\1.0, and you can have a image with 100x200 pixels and pixelspacing 1.0\0.5. A valid DICOM-Viewer would display both images the same way. the second image has more pixels, but they are smaller. resulting in the same display as the first image.

So its obvious, that the height of the stack of images is 518*0,625 = 323,75 mm. So you have many possibilities:

  • you could create a 512x324 image, set pixelspacing to 0.845703\1.0 and calculate (interpolate) the z-values.
  • The best solution would be, to take the pixel data as they are, without any interpolation, so without any loss of data. Then you have a grid of 512x518 pixels. the pixelspacing would be 0.845703\0.625. Thats because the spacing in x-direction comes from the spacing of pixels in the original data and the spacing in y-direction is the distance between the slices.
  • But: there are some DICOM-Viewers out there who do not deal correctly with not-equidistant pixels. of if you export the image into jpegs and let window/browser display the image then you need equidistant pixels. Therefore you have to choose a number of pixels, so that in sum the heigh is 323,75mm when you have a pixel spacing of 0.845703mm. This are 323,75 / 0.845703 = 382,817 ~ 383 pixels. So if you generate a 512x383 pixel image, where you have to do interpolation of the slices, you can create a image with equidistant pixelspacing of 0.845703\0.845703.
1
votes

I assume:

  1. "Number of series": 518 should read "Number of images": 518?
  2. Spacing between slices = length of the difference vector of Image Position Patient between two adjacent slices (value in DICOM header should be identical with calculated value. If not, I would recommend to use the calculated value).

In this case:

Resolution of saggital silces = Resolution of coronal slices = 512 slices, each with 512x518 pixels (Sagittal: height * number of slices, Coronal: width * number of slices)

Pixel Spacing saggital = pixel spacing coronal = 0.845703 * 0.625.

Slice distance sagittal = slice distance coronal = 0.845703 mm

Side note: Using a DICOM toolkit for reading the slices would be highly recommended. The fact that you can read this particular exam does not tell you that you are capable of reading any exam. There are many pitfalls in DICOM's low level encoding rules.

0
votes

I think I've managed to get a close solution. 1-2 pixels off from the RadiAnt version, but this is the best I could get:

Coronal image height/Sagittal image width: number of images * spacing between slices / pixel spacing

For example: 518 * 0.625 / 0.845703 = 382

RadiAnt image resolution: 512x383. My image resolution: 512x382

This solution works for some studies I tested with, but not for one or two from the internet. As kritzel_sw said it may vary. Hope this one will help a little for somebody else as well.