Orthanc query support for 'Modalities in Study'

I’m trying to make sense of how Orthanc supports the C-FIND (query) when doing a Study-level search on 0008,0061 (Modalities in Study). According to DICOM, the key should be a single modality, and the result should be all studies CONTAINING that modality (I have studies containing multiple modalities, like OT, US, SR)

The problem is that Orthanc does not return (all) the expected studies.

For example, I have studies with the following modalities:
OT\US
OT
OT\SR
OT\SR\US
OT\SR\US
OT
OT\US
SR\US

Query for modalities in study with key “US” should yield 5 results, but I get only 2:
OT/US and OT/US

Query for modalities in study with key ‘SR’ should yield 4 results, but I get only 2:
SR\US and OT\SR

Query for modalities in study with key ‘OT’ should yield 7 results, but I get only 4:
OT\SR\US, OT\SR\US, OT and OT.

Moreover, it seems I am able to send multiple modalities in my key field (which DICOM says should not be allowed):
Key “OT\SR\US” (in any order) gives me all 8 images as a hit.

I can’t find any specific info on this method of querying, anyone who can shed light on this, please do…Any help would be appreciated.

Hi Dennis,

I have been able to reproduce the same behaviour here. I have 16 studies with MR and only 14 are returned.

However, this happens because I have a very weird data set in which I have 3 studies with the same StudyInstanceUID. Could you have the same kind of issue ? By adding more search criteria like a filter on the PatientName, I’m able to isolate them. If you don’t have such a weird data set, any chance you could share an anonymized dataset for us to reproduce ?

First filter without PatientName → return only 1 “random” study out of the 3 duplicates
C:\Users\Alain>findscu -S -k QueryRetrieveLevel=Study -k StudyInstanceUID=1.3.12.2.1107.5.2.43.166083.30000021090217112999000000001 -k PatientID -k PatientName=* -k ModalitiesInStudy=MR localhost 4242
I: ---------------------------
I: Find Response: 1 (Pending)
I:
I: # Dicom-Data-Set
I: # Used TransferSyntax: Little Endian Explicit
I: (0008,0005) CS [ISO_IR 100] # 10, 1 SpecificCharacterSet
I: (0008,0052) CS [Study ] # 6, 1 QueryRetrieveLevel
I: (0008,0054) AE [ORTHANC ] # 8, 1 RetrieveAETitle
I: (0008,0061) CS [MR] # 2, 1 ModalitiesInStudy
I: (0010,0010) PN [alert(0)] # 8, 1 PatientName
I: (0010,0020) LO [alert(0)] # 8, 1 PatientID
I: (0020,000d) UI [1.3.12.2.1107.5.2.43.166083.30000021090217112999000000001 ] # 58, 1 StudyInstanceUID
I:

Second filter with a PatientName filter → return the right study out of the 3 duplicates
C:\Users\Alain>findscu -S -k QueryRetrieveLevel=Study -k StudyInstanceUID=1.3.12.2.1107.5.2.43.166083.30000021090217112999000000001 -k PatientID -k PatientName=s* -k ModalitiesInStudy=MR localhost 4242
I: ---------------------------
I: Find Response: 1 (Pending)
I:
I: # Dicom-Data-Set
I: # Used TransferSyntax: Little Endian Explicit
I: (0008,0005) CS [ISO_IR 100] # 10, 1 SpecificCharacterSet
I: (0008,0052) CS [Study ] # 6, 1 QueryRetrieveLevel
I: (0008,0054) AE [ORTHANC ] # 8, 1 RetrieveAETitle
I: (0008,0061) CS [MR] # 2, 1 ModalitiesInStudy
I: (0010,0010) PN [single ’ quote] # 14, 1 PatientName
I: (0010,0020) LO [single ’ quote] # 14, 1 PatientID
I: (0020,000d) UI [1.3.12.2.1107.5.2.43.166083.30000021090217112999000000001 ] # 58, 1 StudyInstanceUID
I:

Third filter with a PatientName filter → return the right study out of the 3 duplicates

C:\Users\Alain>findscu -S -k QueryRetrieveLevel=Study -k StudyInstanceUID=1.3.12.2.1107.5.2.43.166083.30000021090217112999000000001 -k PatientID -k PatientName=D -k ModalitiesInStudy=MR localhost 4242
I: ---------------------------
I: Find Response: 1 (Pending)
I:
I: # Dicom-Data-Set
I: # Used TransferSyntax: Little Endian Explicit
I: (0008,0005) CS [ISO_IR 100] # 10, 1 SpecificCharacterSet
I: (0008,0052) CS [Study ] # 6, 1 QueryRetrieveLevel
I: (0008,0054) AE [ORTHANC ] # 8, 1 RetrieveAETitle
I: (0008,0061) CS [MR] # 2, 1 ModalitiesInStudy
I: (0010,0010) PN [; DROP table *; ] # 16, 1 PatientName
I: (0010,0020) LO [; DROP table *; ] # 16, 1 PatientID
I: (0020,000d) UI [1.3.12.2.1107.5.2.43.166083.30000021090217112999000000001 ] # 58, 1 StudyInstanceUID
I:

And, indeed with Orthanc, searching for OT\SR\US will return all studies with at least one modality amongst these 3. If this is not the expected behaviour, could you point me to a reference of the DICOM standard that says so ? And, is this actually a problem ?

Best regards,

Alain.

Alain,

I don’t think my studies have duplicate study UIDs since that is the key field we use to group images together. I will see if I can send you my datasets.
As for the last issue, I don’t think it’s a problem, I just did not expect it since it is not standard DICOM. I based myself on this article: https://www.medicalconnections.co.uk/kb/Filtering-On-And-Retrieving-The-Modality-In-A-C-FIND (last paragraph). This being possible at least provides us with a workaround for now.

Best regards,

Dennis