Query to modality by rest API

I need to run a query to modality by rest API to know how many images there are for each series of a given study.

POST to /modalities/{id}/query

query.Level = 'SERIES';
query.Query = {
    "StudyInstanceUID" : "{StudyInstanceUID}",
}

For each series I can only know the series instance UID.

Hello,

I am unsure to understand your question.

If you want to know the number of instances contained in each series returned by a C-FIND SCU request, add the “Number of Series Related Instances” (0020,1209) in your query [1].

Please however note that the support of this tag is optional, and might thus be unsupported by the modality you are querying.

HTH,
Sébastien-

[1] https://www.medicalconnections.co.uk/kb/Counting_Studies_Series_and_Instances

query.Level = 'SERIES';
query.Query = {
    "StudyInstanceUID" : "{StudyInstanceUID}",
    "NumberOfSeriesRelatedInstances": ''"
}

W0608 11:35:04.136894 DicomUserConnection.cpp:435] Tag not allowed for this C-Find level, will be ignored: (0020,1209)

Adding the tag "Number of Series Related Instances" (0020,1209) Orthanc return an error.

Nice catch!

The fix is now included in the mainline, and will be part of forthcoming Orthanc 1.0.1:
https://bitbucket.org/sjodogne/orthanc/commits/9e021b2b348b6585bdbc2d8128844587152ba70e

Thanks,
Sébastien-

Thank You! I love this project...