Orthanc Dicom Web plugin cannot process wado-rs request

Hi Authors,

I have a sample dicom file (attached in the email). I used the latest docker images jodogne/orthanc-plugins to launch the Orthanc

docker run -p 4242:4242 -p 8042:8042 --rm jodogne/orthanc-plugins /etc/orthanc/ --verbose

After uploading the dicom file, I used POSTMAN to get the instance, but the status is 400

curl -uorthanc:orthanc localhost:8042/dicom-web/studies/1.3.46.670589.33.1.63702409294903716700001.5381967759611381689/series/1.3.46.670589.33.1.63702411387164387200001.5051879167575221341/instances/1.3.46.670589.33.1.63702411421312340300001.5148235627224632052/frames/1
{

“HttpError” : “Bad Request”,
“HttpStatus” : 400,
“Message” : “Bad file format”,
“Method” : “GET”,
“OrthancError” : “Bad file format”,
“OrthancStatus” : 15,
“Uri” : “/dicom-web/studies/1.3.46.670589.33.1.63702409294903716700001.5381967759611381689/series/1.3.46.670589.33.1.63702411387164387200001.5051879167575221341/instances/1.3.46.670589.33.1.63702411421312340300001.5148235627224632052/frames/1”
}

Here are the logs from Orthanc running in Verbose mode

I0911 15:42:02.264529 HttpServer.cpp:813] GET /dicom-web/studies/1.3.46.670589.33.1.63702409294903716700001.5381967759611381689/series/1.3.46.670589.33.1.63702411387164387200001.5051879167575221341/instances/1.3.46.670589.33.1.63702411421312340300001.5148235627224632052/frames/1
I0911 15:42:02.264617 OrthancPlugins.cpp:1812] Delegating HTTP request to plugin for URI: /dicom-web/studies/1.3.46.670589.33.1.63702409294903716700001.5381967759611381689/series/1.3.46.670589.33.1.63702411387164387200001.5051879167575221341/instances/1.3.46.670589.33.1.63702411421312340300001.5148235627224632052/frames/1
I0911 15:42:02.265001 OrthancPlugins.cpp:2385] Plugin making REST GET call on URI /instances/990659c0-2d1f43f5-d74cb9c3-19d657b7-8dec113e/series (built-in API)
I0911 15:42:02.265418 OrthancPlugins.cpp:2385] Plugin making REST GET call on URI /instances/990659c0-2d1f43f5-d74cb9c3-19d657b7-8dec113e/study (built-in API)
I0911 15:42:02.265642 OrthancPlugins.cpp:2385] Plugin making REST GET call on URI /instances/990659c0-2d1f43f5-d74cb9c3-19d657b7-8dec113e/file (built-in API)
I0911 15:42:02.265729 FilesystemStorage.cpp:144] Reading attachment “8cd3792f-6dc7-4811-a898-09163c9e6451” of “DICOM” content type
I0911 15:42:02.266554 PluginsManager.cpp:172] DICOMweb RetrieveFrames on 990659c0-2d1f43f5-d74cb9c3-19d657b7-8dec113e, frames: 1
I0911 15:42:02.266586 PluginsManager.cpp:172] DICOMweb RetrieveFrames: Transcoding instance 990659c0-2d1f43f5-d74cb9c3-19d657b7-8dec113e to transfer syntax 1.2.840.10008.1.2.1
E0911 15:42:02.271582 PluginsManager.cpp:197] Exception while invoking plugin service 4013: Bad file format
E0911 15:42:02.272524 PluginsErrorDictionary.cpp:111] Exception inside the plugin engine: Bad file format

I tried to search through the group and saw discussion at: https://groups.google.com/g/orthanc-users/c/09kQWvYnuE8/m/KgB51Pk6AgAJ , however with url:
localhost:8042/dicom-web/studies/1.3.46.670589.33.1.63702409294903716700001.5381967759611381689/series/1.3.46.670589.33.1.63702411387164387200001.5051879167575221341/instances/1.3.46.670589.33.1.63702411421312340300001.5148235627224632052

the status is 200. So I think this issue is not related to the previous discuss. Can you please help to identify if this is the bug in DicomWeb Plugin ?

Thanks,
Chris

FCF7A0B3 (520 KB)

Hello,

Your DICOM file is broken.

It has the DICOM tag (07a1,1011) set to “PMSCT_RLE1”, which indicates a proprietary compression scheme. But, your pixel data is not encoded using this so-called “ELSCINT1 PMSCT_RLE1” compression, so Orthanc cannot decode the image.

Everything works properly if you delete the (07a1,1011) tag prior to sending the DICOM file to Orthanc. Here is the command line to remove this tag thanks to DCMTK command-line tools:

$ dcmodify -e ‘07a1,1011’ ./FCF7A0B3

HTH,
Sébastien-

Thanks Sebastien,

With older plugin 1.1 (https://lsb.orthanc-server.com/plugin-dicom-web/1.1/) there is no issue with decoding my original file, but plugin 1.2 has this issue. So version 1.2 has more code that validates the condition of (07a1,1011) tag ? Is version 1.2 not compatible with 1.1 ?

Vào lúc 23:32:22 UTC+7 ngày Thứ Sáu, 11 tháng 9, 2020, s.jo...@gmail.com đã viết:

By the way this private is coming from the Phillips Modality, and older version of Dicom Web plugin and other PACS like Dcm4Chee can process this, so is there a better solution than deleting this tag ?

Vào lúc 23:49:32 UTC+7 ngày Thứ Sáu, 11 tháng 9, 2020, Christopher đã viết:

The DICOMweb plugin 1.2 has been fully refactored to provide transcoding, which had the side-effect of turning it as less tolerant to proprietary DICOM formats. That’s the problem with DICOM proprietary extensions:
https://book.orthanc-server.com/faq/proprietary.html

In a perfect world, Philips would provide sample files and would fund free and open-source software to provide a reference implementation of their compression schemes, so as to make them publicly available to the benefit of the whole medical imaging community.

In the real world, free and open-source maintainers spend hours to reverse-engineer proprietary protocols by trial and error on their free time.

I’ll have another look at this issue to see if I can help you.

Looks like I managed to access the raw frames in the presence of the ELSCINT1 proprietary format:
https://hg.orthanc-server.com/orthanc/rev/dbd74fa2f446

This patch in the Orthanc core should solve your issue with DICOMweb plugin 1.2. The patch will be part of forthcoming 1.7.4 release. Feedback is welcome!

Sébastien-