"CompletedSeries" event: is it reliable ? How is it computed ?

Hello, while browsing the docs, I discovered there exist an event “OrthancPluginChangeType_CompletedSeries” [1] that may be sent to plugins (the Python plugin in my case).
And I’m wondering how Orthanc can ever determine that a series is completed.

I looked up in the source code and found the method ServerIndex::ComputeExpectedNumberOfInstances(…) but as I understand it only handles 3 limited cases and is not a generic method that would always work.

So my question is: can I rely on this event being sent even for MR, CT or whatever dicom is being received by Orthanc?

Thank you for the good job Orthanc guys

François

[1] https://sdk.orthanc-server.com/group__Callbacks.html#ga212054ee2cad2d8db0e0aa3102d7ced2

Hello,

The DICOM standard does not specify a systematic way to indicate the number of instances in a series, except for some IODs.

As a consequence, Orthanc implements a heuristics, as can be seen in function “ComputeExpectedNumberOfInstances()”:
https://hg.orthanc-server.com/orthanc/file/Orthanc-1.7.3/OrthancServer/Sources/ServerIndex.cpp#l527

If you handle IODs that don’t provide the “DICOM_TAG_IMAGES_IN_ACQUISITION”, “DICOM_TAG_NUMBER_OF_TEMPORAL_POSITIONS”, “DICOM_TAG_NUMBER_OF_SLICES”, “DICOM_TAG_NUMBER_OF_TIME_SLICES”, or “DICOM_TAG_CARDIAC_NUMBER_OF_IMAGES”, Orthanc cannot guess the number of instances in the series.

The “ChangeType_StableSeries” event is how most DICOM/PACS servers work: If no new instance is received during some time (that is known as the “stable age” in Orthanc), the series is considered as complete.

HTH,
Sébastien-

Thanks a lot Sebastien, it helps a lot

As a complement, you might also be interested in learning about DICOM storage commitment:
https://book.orthanc-server.com/users/storage-commitment.html