Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find number of images in a DICOM study?

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

like image 982
Arash Avatar asked Oct 03 '22 04:10

Arash


1 Answers

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.

like image 128
David Simic Avatar answered Oct 04 '22 18:10

David Simic