Weasis

835 views
Skip to first unread message

Ric Smi

unread,
Jun 24, 2022, 6:02:08 PM6/24/22
to Orthanc Users
Dear All,

I am trying to launch Weasis from my web application. Mimicking an example given in the Weasis web site accessing Orthanc studies via dicom-web.

I tried via reverse proxy and directly but could not get the studies displayed.

Getting error in Verbose
Unsupported return MIME type: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2, will return DICOM+JSON

Any idea what could be the issue?

I have attached verbose.
Orthanc.log

Alain Mazy

unread,
Jun 27, 2022, 3:42:05 AM6/27/22
to Ric Smi, Orthanc Users
Hi

Looks like the QIDO-RS request has an "Accept" HTTP Header set to "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"    while it should be "application/json

e.g with curl commands:
- curl -H "Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" http://localhost:8044/dicom-web/studies/1.2.276.0.7230010.3.1.2.2831156000.1.1499097860.742568/series  => shows your error message but returns a correct response

The reported accept header looks like the ones set by a browser while Orthanc shall be contacted by Weasis HTTP client that should set the Accept Header correctly.  I would suggest that you get in touch with the Weasis support to get more information....

HTH,

Alain

--
You received this message because you are subscribed to the Google Groups "Orthanc Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orthanc-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/orthanc-users/e63c01de-76e7-4932-b9a8-11f88f728f46n%40googlegroups.com.

Ric Smi

unread,
Jun 27, 2022, 9:56:03 AM6/27/22
to Orthanc Users
Dear Alain,

Thank you so much for the response.

Kindly note I have attached a sample html page. It has an <a> tag to launch sample patient directly from Orthanc-Server on my local Weasis. This works flawless. If I replace href attribute to my localhost (reverse proxy) then I was hoping that it would work as well but it does not. This means either my nginx configuration could be incorrect or my Orthanc configuration is missing something since Orthanc Web Server sample provided by Weasis works.

Any advise please?

Please note I have attached nginx configuration and Orthanc configuration.

Thank you again!!
nginx.conf
orthanc.json
Test.html
dicomweb.json

Diego Victor de Jesus

unread,
Jun 27, 2022, 7:40:36 PM6/27/22
to Orthanc Users
Hello! Here is my configuration to work with Weasis. Hope it works for you.

Weasis DICOM node:
weasis.png

Simplified nginx.conf file (dockerized NGINX, 2 load balanced Orthanc reader instances)

worker_processes auto;

events {
    worker_connections  1024;
}

http {
    resolver 127.0.0.11 ipv6=off;
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    keepalive_timeout  65;

    tcp_nopush          on;
    tcp_nodelay         on;
    types_hash_max_size 2048;
    
    upstream readerOrthancsNightly {
        least_conn;
        server orthanc-reader-nightly-1;
        server orthanc-reader-nightly-2;
    }

    server {
        listen 80;
        server_name localhost;

        gzip on;
        gzip_comp_level 5;
        gzip_min_length 1000;
        gzip_types      text/css text/javascript text/xml text/plain text/x-component application/javascript application/json application/xml application/rss+xml font/truetype font/opentype application/vnd.ms-fontobject image/svg+xml;
        gzip_proxied    no-cache no-store private expired auth;
        client_max_body_size 50M;

        location /orthanc-nightly-reader {
            proxy_pass http://readerOrthancsNightly;
            proxy_set_header HOST $host:$server_port;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-Host $host:$server_port;
            proxy_set_header X-Forwarded-Port $server_port;
            proxy_set_header X-Forwarded-Server $host;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            rewrite /orthanc-nightly-reader(.*) $1 break;
            add_header 'Access-Control-Allow-Credentials' 'true';
            add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
            add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
            add_header 'Access-Control-Allow-Origin' '*';
            proxy_read_timeout 600s;
            proxy_connect_timeout 600s;
        }
    }
}

DicomWeb configuration:

"DicomWeb": {
    "Enable": true, // Whether DICOMweb support is enabled
    "Root": "/dicom-web/", // Root URI of the DICOMweb API (for QIDO-RS, STOW-RS and WADO-RS)
    "EnableWado": true, // Whether WADO-URI (previously known as WADO) support is enabled
    "WadoRoot": "/wado", // Root URI of the WADO-URI (aka. WADO) API
    "StudiesMetadata": "MainDicomTags",
    "PublicRoot": "/###PUBLIC_ROOT###/dicom-web/",
    "Ssl": ###DICOM_WEB_SSL###,
    "QidoCaseSensitive": false // For QIDO-RS server, whether search is case sensitive (since release 0.5)
  },

Since you are behind NGINX, I guess you will need PublicRoot set (see https://groups.google.com/g/orthanc-users/c/Z-GYyBiBHp4/m/85gKyDyvBAAJ). In my case, the "###????###" values are replaced at build time with Docker.

Ric Smi

unread,
Jun 29, 2022, 3:59:27 PM6/29/22
to Orthanc Users
Hello Diego,

Thank you so much for your help! I followed your post and now I have a working Weasis with Othanc.

Thank you Alain for your assistance.

Best regards,
Reply all
Reply to author
Forward
0 new messages