orthanc-web, wado-rs request / mime response

Hello,

It appears that the Orthanc-web plugin returns the dicom file wrapped in a MIME header. When I query a couple other DICOM servers I receive the raw DICOM file.

Is this a standard? Are DICOM clients going to expect/handle the MIME file?

curl http:///api/studies/2.16.124.113543.6021.1.1.2684016975.24736.1536256719.1/series/2.16.124.113543.6021.1.2.2684016975.24736.1536256720.3/instances/2.16.124.113543.6021.1.3.2684016975.24736.1536256720.7 --output mydicom2.dcm

-Markus

I tried adding a header as well:

Hello,

Check out the specification of WADO-RS (DICOMweb):
https://www.dicomstandard.org/dicomweb/retrieve-wado-rs-and-wado-uri/

http://dicom.nema.org/medical/dicom/current/output/chtml/part18/sect_6.5.html

As can be seen from this specification, the return type is always “multipart/related”:
https://en.wikipedia.org/wiki/MIME#Related

This means that WADO-RS servers must return a sequence of DICOM files encapsulated within MIME headers, which is precisely what you observed.

To retrieve one single DICOM file without the MIME headers, you can use the URI “/instances/{…}/file” in the custom REST API of Orthanc:
http://book.orthanc-server.com/users/rest.html#browsing-from-the-patient-down-to-the-instance

HTH,
Sébastien-

Thanks Sebastian!

A follow up question…

So in WADO-RS there is no way to get a raw image/frame, using curl, for example. It will always come back in MIME format?

WADO-URI (WADO) is the only way to preview images or download raw DICOM files?

  • Markus

Hello,

Yes, according to the DICOMweb specification, all the WADO-RS primitives return multipart answers (except the “WADO-RS - Retrieve Rendered Transaction” endpoint, but the latter cannot be used to retrieve the raw DICOM instances).

However, I have indeed forgotten to mention the fact that WADO-URI can be used to retrieve the DICOM instances. WADO-URI is also implemented by the Orthanc DICOMweb plugin. Here is a working example:

curl -s ‘http://localhost:8042/wado?requestType=WADO&contentType=application/dicom&objectUID=1.3.12.2.1107.5.2.33.37097.2012042312584353711037262’ > instance.dcm

The parameter “objectUID” corresponds to the DICOM tag “SOPInstanceUID” of the instance you wish to download. The value of this “SOPInstanceUID” tag can be retrieved from a QIDO-RS lookup:
http://dicom.nema.org/medical/dicom/current/output/html/part18.html#sect_6.7.1

Note that other DICOMweb servers than Orthanc might require you to provide the “studyUID” and “seriesUID” arguments as well, that respectively correspond to the “StudyInstanceUID” and “SeriesInstanceUID” tags of the instance of interest.

As a final note, you can find implementation notes for the WADO-URI part of the DICOMweb plugin at the following address:
https://www.codeproject.com/Articles/797118/Implementing-a-WADO-Server-using-Orthanc

HTH,
Sébastien-