8

Due to showing MPR view based on Dicoms. I've made a 3D array from series of dicom files. And I show it from Coronal and Sagittal sides.

My 3D array includes: 

 - z = count of dicoms
 - c = column value for every dicoms
 - r = Row value for every dicoms

But I have a problem. When there is some space between slices, image is made by this way doesn't show a correct view. Because I can not think of simulation distance between them!

I don't know how to calculate space between slices? I want to add extra space between slices. for example, If space between slices is 4. I have to add 4 time z inner slices.

I hope to arrive my mean.

Omid Nazifi
  • 5,235
  • 8
  • 30
  • 56

3 Answers3

23

Image Position (Patient) and Image Orientation (Patient) are the two only attributes you should ever used when computing distance between slices. For more details see here or here. For an actual implementation see here, this implementation also does take into account Frame Of Reference UID, as well as Gantry/Detector Tilt.

This question is the question #1 asked on comp.protocols.dicom.

Please see ImageJ bug


I believe the answer from @Matt is erroneous, let me clarify a few things here.

  • No: 'DICOM does not have an attribute called Spacing Between Slices'. That is very wrong (technically it does not even mean anything).

DICOM defines IODs which define the set of required attributes available in an SOP Class Instance. Let's consider two very common cases: CT Image Storage (legacy) and MR Image Storage (legacy). So we need to compare the set of attributes in between:

  1. CT Image IOD Modules
  2. MR Image IOD Modules

Now let's say we want to check that MR Image Storage support Spacing Between Slices, it is easy to jump to:

However it is much harder to find this attribute for CT Image Storage: simply because this attribute does not exist (per standard). So the only time you would find such attribute would be within an extended SOP Class (some vendors may decide that Spacing Between Slices attribute make sense within their extended SOP Class Instance).

  • Mixing in the same answer both Spacing Between Slices and Slice Thickness (0018,0050) is very confusing for new users.

I agree that Slice Thickness is perfectly defined in the standard for both CT Image Storage and MR Image Storage since they both include Image Plane Module Attributes, however let's not exchange one for the other.

I found a nice summary of Slice Thickness vs Spacing Between Slices here (if you scroll to the section, you can even play the small demo) :

In step and shoot CT the Slice Thickness and Spacing Between Slices are identical so there is no big issue here. However for helical CT those values are not the same and can vary in any direction (they are independent).

[…] Slice Thickness is determined by the detector width and pitch, while reconstruction interval (=Spacing Between Slices) can be chosen arbitrarily. […]

In conclusion to compute (safely!) the Spacing Between Slices (= Reconstruction Interval), it is much safer to use Image Orientation (Patient) and Image Position (Patient) since they are available in either MR Image Storage or CT Image Storage instances.


All of the above was written before CP-2061, which moved the attribute to the Image Plane Module and made the attribute available to CT now:

malat
  • 12,152
  • 13
  • 89
  • 158
  • Would you mind explaining why only the two should be taken into account? – Francesco Pasa Jan 25 '17 at 07:43
  • @FrancescoPasa I've referenced two links. Do you want me to copy/paste what is described over here ? – malat Jan 25 '17 at 08:23
  • 1
    You are right, I am sorry for the stupid question. So basically it's due to the fact that there can be inconsistences in the Slice Thickness (0018, 0050) and Spacing Between Slices (0018,0088) attributes due to differences between machines and softwares and it the distance is adjusted on the fly, right? – Francesco Pasa Jan 25 '17 at 08:36
  • 1
    @FrancescoPasa yes I've updated my answer to point to a small java demo to understand the principles. – malat Jan 25 '17 at 08:47
17

DICOM has an attribute called Spacing Between Slices (0018, 0088) that gives the distance between two adjacent slices (perpendicular to the image plane) and it also has an attribute called Slice Thickness (0018, 0050) that gives the thickness of the imaged slice (the image plane exists at the center of the slice, with half of the volume above the plane and half below). Image Position (Patient) (0020, 0032) and Image Orientation (Patient) (0020, 0037) are also useful attributes for computing spatial relationships between slices.

For a more detailed explanation, see section C.7.6.2 of part 3 of the DICOM standard. (p. 409)

WARNING: Please be aware that different vendors use the same dicom tags for addressing different things. For instance, the attribute Spacing Between Slices (0018, 0088) means two different things depending on the vendor. See this table to have a guide, and this thread for an explanation.

Tommaso Di Noto
  • 1,208
  • 1
  • 13
  • 24
Matt
  • 2,339
  • 1
  • 21
  • 37
  • Thanks @Matt for your answer. I've used *SpacingBetweenSlices(0018, 0088)* for simulation of space between slices. Should I use *SliceThickness(0018, 0050)* for calculating real space? if yes, How come? – Omid Nazifi Feb 19 '13 at 06:19
  • 1
    You need both pieces of information. Slice thickness tells you what region of space contributed to the pixel values in a given slice. If the slice thickness is less than the spacing between slices, then there is a gap region between the slices that was not imaged. If the slice thickness is greater than the spacing between slices, then the slices overlap (there exists a region that contributed information to both of the adjacent slices). – Matt Feb 19 '13 at 16:18
  • 1
    See at @malat answer, you should not rely on the Spacing Between Slices nor Slice Thickness to compute the space between slices. – Dese Jul 15 '19 at 16:34
  • @Dese You're reading way too much into my answer. I didn't advocate a particular method. I called attention to a few attributes that are relevant to the topic and directed the OP to read the fine manual, which is the ultimate authority on the topic. – Matt Jul 15 '19 at 17:25
2

As discussed in the previous answers, it is not straightforward how to calculate space between DICOM slices. Let's phrase the question differently: How to store DICOM slices in a 3D volume, i.e. a list of equally spaced slices for rendering (guess you want to upload into a 3D texture).

This is because the actual position that a CT slice is captured might not be identical to the position selected by the radiologist. A dataset might have been configured to capture 1 mm slices, but the CT returns slices at position 0.0 mm, 0.997 mm, 2.010 mm, ...

If you use an attribute such as Spacing Between Slices to calculate the size of the 3D volume, you will obtain subtle rounding errors easily. Don't go there.

Rather it is essential to use Image Position (Patient) (0020, 0032) and then perform an optimization to figure our how the slices could be fit into an grid.

Typical problems in practice to consider:

  • Missing slices (interpolate? Gap?)
  • Out of step slices (hardware defect? data defect?)
Christopher Oezbek
  • 23,994
  • 6
  • 61
  • 85