How to find number of images in a DICOM study?
Asked Answered
T

3

7

Is it possible to find number of images in a DICOM study by reading a DICOM header of a file in that study?

I am developing a Java application that receives DICOM studies from different sources. I just want to check if a study has been received completely.

Unfortunately I cannot rely on reading DICOMDIR as in many cases the studies do not have that file. I am also familiar with dcm4che and imageJ libraries.

Cheers, Arash

Tabloid answered 13/12, 2013 at 0:16 Comment(5)
You've tagged your question with ImageJ and Dcm4Che. Are you looking for code on how to do this using ImageJ and Dcm4Che?Imitate
Yeah, I'm looking for code in Java using dcm4che.Tabloid
Try using the Dcm4Che API (I recommend Dcm4Che3 the latest version) to use the referenced series sequence to solve your problem. Post the code here and if you have problems I will help.Imitate
Hi @medphys-pl, thank you for the comment, I had a look at my dicom files and noticed that they don't have any referenced series sequence tag (0008,1115). Do you know any alternative way?Tabloid
@Tabloid please see my answer which outlines how to do this. Basically this info is not present in any dicom image file itself, but needs to be retrieved from the sender (if the sender is a PACS it will often support this via a Query / Retrieve request).Nylons
N
8

The number of images in a series is not present in the dicom image file itself. This is auxiliary information, and the only way to obtain it is for someone to compute it after the fact and make it available to you.

This is often already done by the sender (with high certainty if it is a PACS) and can be made available to the receiver in a DICOM compliant manner via a Query / Retrieve request (keep reading to the end for details).

Contrary to what other answers have stated, dicom tag (0020, 0013) does not correspond to the number of instances within a series. Instead it identifies the instance within the series, and typically tracks the order in which the image was taken within that particular series.

As Brett stated in his answer, this is because it is effectively impossible for the creator of the file to truly know the final image count (due to all kinds of realities that can kick in) and so is not present in the file itself but needs to be determined after the fact.

The good news is that the sender should already have (and often will have if it is a PACS) done the counting for you, and will make this info available via DICOM tag "Number Of Series Related Instances (0020,1209)" via a Query / Retrieve.

There will also generally be a tag corresponding to number of series in the study, DICOM tag "Number of Study Related Series(0020,1206)."

To reiterate, these tags can often be obtained from a properly formed Query / Retrieve request to the sender, however they are not present in the image files themselves.

Nylons answered 12/1, 2017 at 17:27 Comment(0)
P
1

The number of study related instances tag (0020, 1208) is intended to be able to communicate this information. As you noted in a previous response, however, this is not reliable. The problem is that you are looking at a single instance of the study. It is effectively impossible to guarantee that the creator of that file knew (knows) about all current instances in that study. For example, a modality may know how many instances it creates and sends to the archive. However, at some later date evidence objects (such as presentation states, key objects or structured reports) can be added. This changes the number of instances in the study, but does not (necessarily) change any existing part 10 files.

Palsgrave answered 24/5, 2014 at 13:50 Comment(1)
This is incorrect. Tag (0020, 0013) is the instance number of the instance, it does not indicate the number of instances in a series, but rather identifies the instance in the series.Nylons
W
-3

We find number of Images in Tag.InstanceNumber (0020,0013).

Weizmann answered 20/2, 2014 at 12:42 Comment(2)
Yeah that's what I used as well. But it's not very reliable.Tabloid
Tag (0020, 0013) is the instance number of the instance, it does not indicate the number of instances in a series, but rather identifies the instance in the series.Nylons

© 2022 - 2024 — McMap. All rights reserved.