Weasis Web Protocol
The web protocol allows launching Weasis in a web context from a specific URI scheme: weasis://parameters
Requires Weasis 3.5 (or superior) installed on the system with a native installer.
How to use the weasis protocol
- From a web page, just make a link starting with weasis:// (see below How to build an URI)
Note
Some web frameworks such as the wiki or the URL field of some browsers only support the standard protocols (http, ftp…). To solve this problem, it is necessary to use a URL redirection starting with http like the one proposed in weasis-pacs-connector:
http://<your-host>:8080/weasis-pacs-connector/weasis?patientID=TESTS
- From the command line:
start weasis://%24dicom%3Aget+-w+%22https%3A%2F%2Fnroduit.github.io%2Fdemo-archive%2FLumbar%2Fmf.xml%22
xdg-open weasis://%24dicom%3Aget+-w+%22https%3A%2F%2Fnroduit.github.io%2Fdemo-archive%2FLumbar%2Fmf.xml%22
open weasis://%24dicom%3Aget+-w+%22https%3A%2F%2Fnroduit.github.io%2Fdemo-archive%2FLumbar%2Fmf.xml%22
When first used in a browser, a popup appears to confirm the opening of the weasis protocol. On Windows, it is possible to make sure that this message never appears by adding a browser policy which allows the URI weasis://*
- With IE/Edge the policy is applied by the native installer.
- With Chrome the policy is applied by the native installer (Windows and Linux), see how to manage URLWhitelist (d).
How to build an URI
The URI scheme “weasis://” allows you to launch Weasis from the system’s URI handler while the URI path allows you to build Weasis commands.
weasis-pacs-connector will help to build dynamically the manifest (the references of the images to be loaded) and the launch parameters (user, profile, plugins…). It will also manage user preferences.
To build an URI (weasis://path) without weasis-pacs-connector, you must choose one or more commands, encode the commands, and add the scheme weasis://
as prefix. Here is an example of loading an image:
- Use $dicom:get to load an image from URL
$dicom:get -r "https://nroduit.github.io/demo-archive/us-palette.dcm"
- Format the URI path with a URL encoder
%24dicom%3Aget+-r+%22https%3A%2F%2Fnroduit.github.io%2Fdemo-archive%2Fus-palette.dcm%22
- Make a link by adding “weasis://” at the beginning Open the remote image
To load multiple remote images, it is recommended to use a manifest listing the references of the images to be loaded. The easiest way to dynamically build this manifest is to use weasis-pacs-connector. However, it is possible to build it differently with the following instructions.
Examples to load images
If you use weasis-pacs-connector, please refer to Launch Weasis.
- Use $dicom:get to load a static XML manifest containing direct links (without WADO server)
Launch
$dicom:get -w "https://nroduit.github.io/demo-archive/Lumbar/mf.xml"
- Use $dicom:rs to load DICOM files with DICOMWeb RESTful services (see other examples)
Launch
$dicom:rs --url "https://demo.orthanc-server.com/dicom-web" -r "patientID=5Yp0E"
- Use $dicom:get to load an image from URL and remove all the previous images if Weasis is already open
Launch
$dicom:close --all $dicom:get -r "https://nroduit.github.io/demo-archive/us-palette.dcm"
- Use $dicom:get to load multiple local folders and a remote image
Launch
$dicom:get -l "D:/DICOM/Overlay" -l "D:/DICOM/Shutter" -r "https://nroduit.github.io/demo-archive/us-palette.dcm"
- Use $image:get to load a non DICOM image
Launch
$image:get -u "https://user-images.githubusercontent.com/993975/59107662-6c9ed300-8939-11e9-83ee-28f2725f4ae1.jpg"
Modify the launch parameters
The command for modifying the configuration at launch is $weasis:config
which can have different arguments:
- cdb is the Weasis web context (The URL of weasis.war). If the value is null, the weasis version installed from the native installer is used. In the weasis-pacs-connector configuration, the default value is defined by
weasis.base.url
. - cdb-ext is the extension web context of Weasis (The URL of weasis-ext.war containing additionnal plugins). In the weasis-pacs-connector configuration, the default value is defined by
weasis.ext.url
. - arg is an argument for the launcher. The value must start by $, like arg="$dicom:close –all" (Note: the value can also be directly in the base URI, outside $weasis:config). Single-valued argument but can be specified multiple times.
- pro is a property for the launcher containing a key and a value separate by a space. Single-valued property but can be specified multiple times.
- auth is the web authorization parameter
- wcfg is the URL the remote Weasis configuration service.
Here are some examples that modify the launcher properties without using weasis-pacs-connector:
- Configuration for launching Weasis Dicomizer
Launch
$weasis:config pro="felix.extended.config.properties file:conf/dicomizer.json" pro="gosh.port 17181"
- Change the user, by default is the one of the current system session. The local preferences are associated to a user.
Launch
$weasis:config pro="weasis.user user2"