How to launch Weasis from any environments
There are two Weasis distributions: the WEB distribution (weasis.war) and the portable distribution (weasis-portable.zip). Here we are talking about how to connect the WEB distribution with any web application. This documentation is adapted for Weasis 2.5 and superior (for previous versions see the wiki history).
The easiest way to launch Weasis from a web context is to use weasis-pacs-connector. For connecting to dcm4chee web interface, follow the instructions in Installing Weasis in DCM4CHEE.
weasis-pacs-connector
weasis-pacs-connector: standard usage
weasis-pacs-connector: when embedding the xml manifest
Execute JNLP
JNLP is generally executed from a web browser but it can be also executed from the operating system by the command:
javaws http://localhost:8080/weasis-pacs-connector/viewer.jnlp?patientID=9702672
See also new way to launch Java Webstart
Build your own connector
There are two requirements:
Build a Java Webstart file (.jnlp) for launching Weasis. This file has at least one dynamic parameter (<argument>$dicom:get ... </argument>) that is the reference to the xml file containing the UIDs (This is the second point).
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE jnlp PUBLIC "-//Sun Microsystems, Inc//DTD JNLP Descriptor 6.0//EN" "http://java.sun.com/dtd/JNLP-6.0.dtd"> <jnlp spec="1.6+" codebase="http://localhost:8080/weasis" href=""> <information> <title>Weasis</title> <vendor>Weasis Team</vendor> <description>DICOM images viewer</description> <description kind="short">An application to visualize and analyze DICOM images.</description> <description kind="one-line">DICOM images viewer</description> <description kind="tooltip">Weasis</description> </information> <security> <all-permissions /> </security> <resources> <!-- Requires Java SE 8 for Weasis 2.5 and superior --> <j2se version="1.8+" href="http://java.sun.com/products/autodl/j2se" initial-heap-size="128m" max-heap-size="768m" /> <j2se version="1.8+" initial-heap-size="128m" max-heap-size="768m" /> <jar href="http://localhost:8080/weasis/weasis-launcher.jar" main="true" /> <jar href="http://localhost:8080/weasis/felix.jar" /> <!-- Optional library (Substance Look and feel, only since version 1.0.8). Requires the new Java Plug-in introduced in the Java SE 6 update 10 release.For previous JRE 6, substance.jnlp needs a static codebase URL --> <extension href="http://localhost:8080/weasis/substance.jnlp" /> <!-- Allows to get files in pack200 compression, only since Weasis 1.1.2 --> <property name="jnlp.packEnabled" value="true" /> <!-- ================================================================================================================= --> <!-- Security Workaround. Add prefix "jnlp.weasis" for having a fully trusted application without signing jnlp (only since weasis 1.2.9), http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6653241 --> <!-- Required parameter. Define the location of config.properties (the OSGI configuration and the list of plug-ins to install/start) --> <property name="jnlp.weasis.felix.config.properties" value="http://localhost:8080/weasis/conf/config.properties" /> <!-- Optional parameter. Define the location of ext-config.properties (extend/override config.properties) --> <property name="jnlp.weasis.felix.extended.config.properties" value="http://localhost:8080/weasis-ext/conf/ext-config.properties" /> <!-- Required parameter. Define the code base of Weasis for the JNLP --> <property name="jnlp.weasis.weasis.codebase.url" value="http://localhost:8080/weasis" /> <!-- Optional parameter. Define the code base ext of Weasis for the JNLP --> <property name="jnlp.weasis.weasis.codebase.ext.url" value="http://localhost:8080/weasis-ext" /> <!-- Required parameter. OSGI console parameter --> <property name="jnlp.weasis.gosh.args" value="-sc telnetd -p 17179 start" /> <!-- Optional parameter. Allows to have the Weasis menu bar in the top bar on Mac OS X (works only with the native Aqua look and feel) --> <property name="jnlp.weasis.apple.laf.useScreenMenuBar" value="true" /> <!-- Optional parameter. Allows to get plug-ins translations --> <property name="jnlp.weasis.weasis.i18n" value="http://localhost:8080/weasis-i18n" /> <!-- Optional Weasis Documentation --> <!-- <property name="jnlp.weasis.weasis.help.url" value="${cdb}/../weasis-doc" /> --> <!-- ================================================================================================================= --> </resources> <application-desc main-class="org.weasis.launcher.WebstartLauncher"> <!-- Example for opening dicom files from remote xml file --> <argument>$dicom:get -w "http://localhost:8080/dcm4chee-web/wadoQueries/wado_query3888637380.xml.gz"</argument> <!-- Example for opening dicom files from local foler --> <argument>$dicom:get -l "/home/Images/MRIX LUMBAR/"</argument> <!-- Example for opening dicom files by embedding the xml file encoded in gzip and then in base64, it must be in one line without space at the beginning --> <argument>$dicom:get -i "H4sIAAAAAAAAALVV7Y+aMBz+vr+i6XdLXwDBHHdxpy4mvgX0dvtkOqnaBOGO1qn//RUQnW5uy3JHCC2/1+d5Wsrdw36TgB8iVzJLA0gQhkCkiyyW6SqAW71seBA83H+62/E4m79uR..."</argument> <!-- Example for opening dicom files from URLs --> <argument>$dicom:get -r "http://server/images/img1.dcm http://server/images/img2.dcm"</argument> </application-desc> </jnlp>
Customize JNLP
Replace "http://localhost:8080/weasis" by your server location and "<argument>...</argument>" by your data to load. Adapt other parameters if necessary.
Web service for building jnlp based on templates
weasis-pacs-connector services return jnlp and they allow either to build a manifest from a PACS via DICOM C-Find or to upload the manifest by http POST (http://localhost:8080/weasis-pacs-connector/viewer?upload=manifest).
- Build an XML file containing the UIDs of the images which will be retrieved from Weasis. There is XLS schema to validate the content of xml. This file can be either compressed in gzip or uncompressed. Here is an example (required Weasis 2.5 and superior):
<?xml version="1.0" encoding="UTF-8" ?> <manifest xmlns="http://www.weasis.org/xsd/2.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <arcQuery additionnalParameters="" arcId="1001" baseUrl="http://archive-weasis.rhcloud.com/archive/wado" requireOnlySOPInstanceUID="false"> <Patient PatientID="H13885_9M" PatientName="TEST NON SQUARE PIXELS" PatientSex="F"> <Study AccessionNumber="" ReferringPhysicianName="" StudyDate="20130711" StudyDescription="TEST NON SQUARE PIXELS" StudyID="PKD" StudyInstanceUID="2.16.756.5.5.100.397184556.14391.1373576413.1508" StudyTime="170013"> <Series Modality="US" SeriesDescription="NON SQUARE PIXELS: PIXEL ASPECT RATIO" SeriesInstanceUID="1.2.40.0.13.1.1.87878503032592846377547034671833520632" SeriesNumber="2"> <Instance InstanceNumber="107" SOPInstanceUID="1.2.40.0.13.1.1.126082073005720329436273995268222863740"/> </Series> <Series Modality="MR" SeriesDescription="NON SQUARE PIXELS: PIXEL SPACING" SeriesInstanceUID="2.16.756.5.5.100.397184556.7220.1373578035.1" SeriesNumber="40001"> <Instance InstanceNumber="1" SOPInstanceUID="2.16.756.5.5.100.397184556.7220.1373578035.1.0"/> <Instance InstanceNumber="2" SOPInstanceUID="2.16.756.5.5.100.397184556.7220.1373578035.1.1"/> <Instance InstanceNumber="3" SOPInstanceUID="2.16.756.5.5.100.397184556.7220.1373578035.1.2"/> <Instance InstanceNumber="4" SOPInstanceUID="2.16.756.5.5.100.397184556.7220.1373578035.1.3"/> </Series> <Series Modality="MR" SeriesDescription="NON SQUARE PIXELS: PIXEL SPACING" SeriesInstanceUID="2.16.756.5.5.100.397184556.7220.1373578664.2" SeriesNumber="50001"> <Instance InstanceNumber="1" SOPInstanceUID="2.16.756.5.5.100.397184556.7220.1373578664.2.0"/> <Instance InstanceNumber="2" SOPInstanceUID="2.16.756.5.5.100.397184556.7220.1373578664.2.1"/> <Instance InstanceNumber="3" SOPInstanceUID="2.16.756.5.5.100.397184556.7220.1373578664.2.2"/> <Instance InstanceNumber="4" SOPInstanceUID="2.16.756.5.5.100.397184556.7220.1373578664.2.3"/> </Series> </Study> </Patient> </arcQuery> </manifest>
Important Parameters (except mandatory parameters):
PatientBirthDate help to identify a patient.
StudyDate, StudyTime, Modality, SeriesNumber and InstanceNumber help to sort data before downloading images.
WadoTransferSyntaxUID and WadoCompressionRate (when tsuid is lossy compression) allow to select in which transfer syntax the images are transfered to the viewer. A wado request without transfer syntax should return the original syntax (this is the case in dcm4chee) or DICOMs encoded in Explicit VR Little Endian
SeriesDescription and StudyDescription allow to immediately display the descriptions before downloading the images.
PACS requirement
The example above requires a PACS with a WADO server to retrieve the images.
Example: requires only a WEB server (Weasis will only download files - no WADO requests) and Weasis 2.5 and superior
<?xml version="1.0" encoding="utf-8" ?> <manifest xmlns="http://www.weasis.org/xsd/2.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <arcQuery additionnalParameters="" arcId="1001" baseUrl="http://archive-weasis.rhcloud.com/archive/wado" requireOnlySOPInstanceUID="false"> <Patient PatientBirthDate="20010901" PatientID="017589" PatientName="Validate WADAKOKOA"> <Study StudyDate="20100421" StudyDescription="胸部立位 V→D犬4" StudyInstanceUID="1.2.392.200036.9107.500.11141010042100073" StudyTime="113836"> <Series DirectDownloadThumbnail="thumb_4563173729424544.jpg" Modality="CR" SeriesDescription="V→D犬4" SeriesInstanceUID="1.2.392.200036.9107.500.305.1410.141010042100073.121" SeriesNumber="1"> <Instance DirectDownloadFile="image_4563173729424543.dcm" InstanceNumber="1" SOPInstanceUID="1.2.392.200036.9107.500.305.1410.20100421.114831.109.101410"/> <Instance DirectDownloadFile="image_4563173729424544.dcm" InstanceNumber="2" SOPInstanceUID="1.2.392.200036.9107.500.305.1410.20100421.114828.234.101410"/> <Instance DirectDownloadFile="image_4563173729424545.dcm" InstanceNumber="3" SOPInstanceUID="1.2.392.200036.9107.500.305.1410.20100421.114823.421.101410"/> </Series> </Study> </Patient> </arcQuery> </manifest>
Important Parameters:
The same ones as above.
DirectDownloadFile defines the URL of the DICOM file to download (the final URL is the combination of wadoURL + DirectDownloadFile)
DirectDownloadThumbnail defines the URL of the JPEG file representing the series (the final URL is the combination of wadoURL + DirectDownloadThumbnail)