Subsections of Basics
Weasis Architecture
Weasis is built on a modular architecture powered by OSGi: the dynamic module system for Java. This design allows for a highly flexible, dynamic, and extendable structure. At its core, Weasis utilizes the Apache Felix OSGi framework, a lightweight open-source implementation of the OSGi specification.
Key Architectural Features
The following diagrams illustrate the main plugin types (known as bundles in OSGi terminology) and their relationships. These include Viewer, Viewer Tool Pane, Tool Bar, Data Explorer, and Codec bundles, which are dynamically registered using Declarative Services—a mechanism to seamlessly provide or consume services in the OSGi environment.
Understanding The Categories of Plugins
Weasis employs a modular approach, where individual plugins (or bundles in OSGi terminology) handle specific functionalities. Here are the plugin categories represented by layers in the diagram:
- Media Viewer and Editor
This category handles the main viewing and editing functionalities. Except the 2D viewer, it includes specialized viewers for different modalities and representations. - UI Aggregator
UI Aggregator plugins bring together various interface components to create a cohesive and user-friendly experience. They dynamically adapt the interface to include provided tools or modules, ensuring that Weasis remains customizable and modular. - Data Access and Management (Data Explorer)
This category focuses on managing how data is loaded, retrieved, and handled within the system. - Codec (Media Decoding)
Codec plugins are responsible for decoding and interpreting medical media files in the DICOM format and other supported formats. They sometimes include native libraries. - Utility and Core Services
This plugin provides essential utility functions and core services needed to support the other modules.
Each of these categories contributes to the flexibility and extensibility of Weasis, enabling it to be customized and adapted to different clinical and research workflows.
Fragment Bundles
A fragment bundle is a special type of bundle that is attached to a host bundle to provide additional resources or classes. In Weasis, fragment bundles are used to provide translations and native libraries for codecs. This design allows for a clean separation of concerns and ensures that only the required resources are loaded at runtime.
Bundle Translation Management
Each bundle has its translation files packaged in a separate bundle fragment (ending in i18n
), an OSGi concept that merges these files dynamically during runtime. This design allows translations to be maintained independently, and they are automatically loaded by the application whenever they are available.
Codec Support with Native Libraries
Certain Codec bundles contain fragments with native libraries (using JNI wrappers). The Weasis launcher dynamically loads only the required native binaries relevant to the platform on which it is running, ensuring lightweight and efficient operation.
Shortcuts
Keyboard and Mouse Shortcuts
Here is a list of the most common keyboard and mouse shortcuts in Weasis. The shortcuts are divided into different categories for better understanding.
Central panel containing viewers and editors
Shortcut | Action |
---|---|
Ctrl + Tab | Select the next tab (since v4.2.1 ) |
Ctrl + Shift + Tab | Select the previous tab (since v4.2.1 ) |
Ctrl + Shift + E | Open a the docking panel list for selection |
Ctrl + M | Maximize/Restore the selected tab |
Ctrl + W | Close the tab |
Tab Right-click | Open the contextual menu for more options |
Selected view in the 2D DICOM Viewer
Shortcut | Action |
---|---|
Left Arrow | Display previous series (since v4.2.1 ) |
Right Arrow | Display next series (since v4.2.1 ) |
Page Up | Display first series (since v4.2.1 ) |
Page Down | Display last series (since v4.2.1 ) |
Ctrl + Left Arrow | Display previous study (since v4.2.1 ) |
Ctrl + Right Arrow | Display next study (since v4.2.1 ) |
Ctrl + Page Up | Display first study (since v4.2.1 ) |
Ctrl + Page Down | Display last study (since v4.2.1 ) |
Up Arrow | Display previous image (since v4.2.1 ) |
Down Arrow | Display next image (since v4.2.1 ) |
Home | Display first image (since v4.2.1 ) |
End | Display last image (since v4.2.1 ) |
Shift + Up Arrow | Go 10 images back (since v4.2.1 ) |
Shift + Down Arrow | Go 10 images forward (since v4.2.1 ) |
Ctrl + Up Arrow | Display previous patient (since v4.2.1 ) |
Ctrl + Down Arrow | Display next patient (since v4.2.1 ) |
Ctrl + Home | Display first patient (since v4.2.1 ) |
Ctrl + End | Display last patient (since v4.2.1 ) |
Tab | Go the next view when layout has more than one view |
Shift + Tab | Go the previous view when layout has more than one view |
Alt + Arrows | Move image of 5 pixels (since v4.2.1 ) |
Alt + Shift + Arrows | Move image of 10 pixels (since v4.2.1 ) |
Ctrl + Plus (+) | Zoom in (since v4.2.1 ) |
Ctrl + Minus (-) | Zoom out (since v4.2.1 ) |
Ctrl + Enter | Set zoom to best fit (since v4.2.1 ) |
T | Translate (pan) the image canvas |
W | Window / Level |
S | Series scroll |
Z | Zoom |
R | Rotation |
H | Crosshair: in multiview mode synchronizes the crosshair position to all the views (Note: Ctrl + click or Ctrl + Shift + click allows changing the Window/Level values) |
C | Cine Start / Stop |
M | Measure |
D | Distance measurement |
A | Angle measurement |
Y | Polyline measurement |
B | Textbox |
Q | Context menu |
Ctrl + Spacebar | Change to the next action |
Ctrl + mouse drag | Accelerate the current action |
Ctrl + Shift + mouse drag | Accelerate more the current action |
Alt + R | 90° rotation (clockwise) |
Alt + L | 90° rotation (counterclockwise) |
Alt + F | Flip horizontally (after rotation action) |
0 1 2 3… | DICOM presets |
K | Toggle key image state |
Spacebar | Show/Hide all the annotations (three states) |
I | Show/Hide all the annotations (three states) |
Escape | Reset the selected view |
P | Print view(s) with the operating system printer |
Right-click | Open the contextual menu for more options |
Double click or F11 | Toggle fullscreen (F11 since v4.5.2 ) |
Drag files/directories (from the OS file manager) |
Open DICOMs files |
Selected view in the MPR Viewer
MPR view inherits the same shortcuts as the 2D viewer, with the following additional shortcuts since v4.5.2 :
Shortcut | Action |
---|---|
Alt + A | Center crosshair of the selected view |
Alt + S | Show/Hide the crosshair center of the selected view |
Alt + D | Show/Hide the crosshair of the selected view |
Alt + C | Center crosshair of all views |
Alt + V | Show/Hide the crosshair center of all views |
Alt + B | Show/Hide the crosshair of all views |
DICOM explorer
Shortcut | Action |
---|---|
Ctrl + click on the thumbnail | Select multiple series |
Click on a thumbnail and then Shift + click on another one | Select all series between |
Ctrl + A | Select all the series |
Home or Page Up | Select the first series |
End or Page Down | Select the last series |
Up Arrow | Select previous series |
Down Arrow | Select next series |
Enter | Open the selected series in the default viewer |
Click + drag a thumbnail in the main view | Display a series |
Right-click | Open the contextual menu for more options |
Drag files/directories (from the OS file manager) |
Open DICOMs files |
Note
Downloading Priorities: Selecting a thumbnail gives the best priority to download.
Graphics
Shortcut | Action |
---|---|
Click on a graphic | Select a Graphics |
Click + mouse drag | In selection mode: select all the graphics inside the selection area. In drawing mode: draw the selected graphic shape. |
Ctrl + A | Select all the graphics |
Ctrl + D | Deselect all the graphics |
Delete | Delete the selected graphics |
Shift + click on a graphic | In selection mode: add or remove a graphic to the current selection. In drawing mode: force to draw on another graphic (without shift the graphic is selected). |
Double click | Stop adding points for polyline (also available in the context menu) |
Right-click | Open the contextual menu for more options |
Tips and Tricks
Window / Level Adjustment
- Move the mouse horizontally to the right to increase the window width (reduce the perceived contrast).
- Move the mouse vertically upwards to lower the window center (increase the perceived brightness).
Tip: Use Preferences to reverse the direction of level adjustments.
Drawing a Segment
You can draw a segment in two ways:
- Click + Drag: Click, drag to draw, then release.
- Click > Release > Drag: Click to start, release, drag to draw, and release again.
Customize
Subsections of Customize
Integration
How to launch Weasis from any environments
Here we present how to launch Weasis with associated images from any context either using weasis-pacs-connector or by building your own connector. The launch of the application is based on the weasis protocol available since Version3.5.3.
Using weasis-pacs-connector allows a high degree of integration and facilitates connection to a PACS. Here are some of the advantages:
- Automatically build a manifest according to a configuration with a PACS
- The initial URL starts with HTTP and is then redirected to weasis:// (as weasis:// is not allowed by wiki, blog…)
- Manages to build the manifest simultaneously with the start of Weasis (Loading time optimization)
- The URL returns a manifest ID which can be requested only once (and must be consumed within 5 min)
However, it is also possible
- To build your own connector for particular integrations
- To let Weasis querying DICOMWeb services directly.
Note
Requires Weasis installed on the system with the native installer.
Use weasis-pacs-connector
For connecting to dcm4chee web interface, follow the instructions in Installing Weasis in DCM4CHEE. Otherwise, refer to the documentation of weasis-pacs-connector.
Standard workflow when connecting Weasis to a PACS, RIS, EMR, EPR or any web interface:
The schema above shows that the queries to the PACS are made at the same time as the viewer starts. This makes it possible to optimize the launch by simultaneously launching weasis and building the manifest.
Note
Tip
weasis-pacs-connector services allow either to build a manifest from a PACS via DICOM C-Find or to upload the manifest by http POST.
Build your own connector
This documentation describes how to create your own connector without weasis-pacs-connector and with different DICOM archive types. The weasis protocol allows you to build URIs to launch Weasis according to different configurations and allows to load DICOM files locally or remotely.
Here are examples with XML manifests or with DICOMWeb RESTful services.
Build an XML manifest
Use $dicom:get to load a XML manifest returned by your service.
$dicom:get -w "https://myservice/manifest?studyUID=2.16.756.5.5.100.397184556.14391.1373576413.1508"
Build an XML file containing the UIDs of the images which will be retrieved from Weasis. There is XLS to validate the content of xml. This output file can be either compressed in gzip or uncompressed. Here is an example:
<?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>
Note
Important Parameters (except mandatory parameters defined in xsd):
PatientBirthDate
helps to identify a patient.StudyDate,
StudyTime
,Modality
,SeriesNumber
andInstanceNumber
help to sort data before downloading images.SeriesDescription
andStudyDescription
allow immediately displaying the descriptions before downloading the images.
Tip
From Weasis 2.5 it is possible to have multiple archives (allows several arcQuery tags) and the presentations tag which contains the image annotations.
Build an XML manifest (no WADO server)
This example requires only a WEB server. Weasis will download DICOM files by URLs.
Use $dicom:get to load a XML manifest containing direct links Launch
$dicom:get -w "https://nroduit.github.io/demo-archive/Lumbar/mf.xml"
Note
Required Parameters:
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)- See in the previous note above.
Download directly with DICOMWeb RESTful services
This integration requires a PACS/VNA with DICOMweb services (QUERY/RETRIEVE) where the requests are managed directly by Weasis. Here are some of the advantages:
- Straightforward integration
- Do not require to install weasis-pacs-connector
- Allow passing token directly in headers (not in the URL)
The following configurations allow images to be loaded by initiating the request from a WEB context. However, it is possible to access DICOMWeb services by initiating the request directly from the Weasis import.
Use $dicom:rs to load DICOM files. Here are some configuration examples of DICOMweb applications:
dcm4chee-arc-light
This configuration requires at least dcm4chee-arc-light 5.22.2 and Weasis 3.6.0. To activate Weasis in dcm4chee-arc-light user interface, you need to add the four following properties in the web portal from the left menu Configuration > Devices > dcm4chee-arc > Extensions > Edit extension > Child Objects > Web Applications > DCM4CHEE
IID_PATIENT_URL=weasis://$dicom:rs --url "{{qidoBaseURL}}{{qidoBasePath}}" -r "patientID={{patientID}}" --query-ext "&includedefaults=false" -H "Authorization: Bearer {{access_token}}"
IID_STUDY_URL=weasis://$dicom:rs --url "{{qidoBaseURL}}{{qidoBasePath}}" -r "studyUID={{studyUID}}" --query-ext "&includedefaults=false" -H "Authorization: Bearer {{access_token}}"
IID_URL_TARGET=_self
The properties can also be passed directly to the docker-compose.env file:
IID_PATIENT_URL=weasis://$dicom:rs --url "{{qidoBaseURL}}{{qidoBasePath}}" -r "patientID={{patientID}}" --query-ext "\&includedefaults=false" -H "Authorization: Bearer {{access_token}}"
IID_STUDY_URL=weasis://$dicom:rs --url "{{qidoBaseURL}}{{qidoBasePath}}" -r "studyUID={{studyUID}}" --query-ext "\&includedefaults=false" -H "Authorization: Bearer {{access_token}}"
IID_URL_TARGET=_self
Finally, refresh the page for having the viewer button.
Warning
Configuration notes:
- See configuration for versions before 5.22.2.
- From 5.24.0 {{qidoBaseURL}} must be replaced by your base URL (e.g. https://pacs2.test.com:8443)
- The character ‘&’ must be escaped in the Docker environment variables.
- The Authorization header is not required for unsecure service.
- URL with HTTPS requires a real valid certificate; otherwise, the certificate must be imported into the Weasis Java keystore. For testing purposes in secure mode, you can use the HTTP URL if it is mapped in the OIDC client of keycloack (–url “http://
:8080/dcm4chee-arc/aets/DCM4CHEE/rs”).
Note
Known issue: Weasis cannot open the images because of the token length which is cut by IE and Chrome only under Windows. It is working with Firefox on Windows.
Orthanc WEB Server
https://www.orthanc-server.com/static.php?page=dicomweb
$dicom:rs --url "https://demo.orthanc-server.com/dicom-web" -r "patientID=ozp00SjY2xG"
Currently, the DICOMWeb service of Orthanc doesn’t support:
- Thumbnail service is not implemented.
Google Cloud Healthcare API
https://cloud.google.com/healthcare/docs/how-tos/dicomweb
$weasis:config pro="dicom.qido.query.multi.params true" $dicom:rs --url "https://healthcare.googleapis.com/v1beta1/projects/chc-nih-chest-xray/locations/us-central1/datasets/nih-chest-xray/dicomStores/nih-chest-xray/dicomWeb" -r "studyUID=1.3.6.1.4.1.11129.5.5.184301693334578016850836775758484230512396" -H "Authorization: Bearer <your-token>"
Currently, the DICOMWeb service for getting thumbnails doesn’t work in the Google API.
Note
<your-token>
must be replaced by a valid token.
DICOMcloud (for Azure cloud)
https://github.com/DICOMcloud/DICOMcloud
$dicom:rs --url "https://dicomcloud.azurewebsites.net/api" -r "studyUID=1.3.6.1.4.1.14519.5.2.1.4429.7055.198257099234774234268879426857"
Note
The demo server is no longer accessible.
Currently, the DICOMWeb service of DICOMcloud doesn’t support:
- Thumbnail service is not implemented.
Preferences
ViewerHub (is a separate project that will be available soon) is a tool designed for managing server-side Weasis preferences across all native client installations. The preferences are defined in each release package (bin-dist/weasis/conf
within weasis-native.zip
) and can be modified either through the ViewerHub web portal or via the Weasis protocol with the pro
parameter.
Some server-side preferences are applied by Weasis only during the initial launch, as they can later be adjusted in the Weasis user interface. On the other hand, certain server-side preferences are utilized by Weasis during every launch and cannot be modified through the User Interface (client-side).
Changing Preferences in Weasis
Client-Side Preferences
Local preferences can be modified in the following ways:
- Through the Weasis User Interface: Navigate to File > Preferences.
- Using the Weasis Protocol: Use the weasis:config command with the
pro
parameter.
Server-Side Preferences
Server-side preferences can be updated using any of the following methods:
- Through the ViewerHub Web Portal: Manage preferences directly via the web portal for all users, for user group or for a specific hostname.
- By Extending the Configuration File: Create a new JSON file to extend the
base.json
configuration.
Priority order for loading a property
Here is the priority order to set a property:
- Java System property providing from parameters of weasis:config or the launching URI)
- Property defined in weasis/conf/xxx.json
- The default value of the property (see table below)
Example to change language property (It will work only during the first launch of Weasis on a user session, otherwise delete ${user.home}/.weasis/preferences/).
- If you are using weasis-pacs-connector, add the property
locale.lang.code
:http://localhost:8080/weasis-pacs-connector/weasis?patientID=9702672&pro="locale.lang.code%20fr_CH"
- Add the property in weasis/conf/xxx.json:
locale.lang.code=fr_CH
- The default value is “en_US”
List of Preferences
The preferences listed below are extracted from the base.json
file, which is located in the source code.
The properties are grouped into categories (note: not all categories are shown in the list below), and each property includes the following details:
- Property Key: The name of the property, used as a key by the viewer.
- Default Value: The property’s default value, provided after the arrow. If it is marked as
Null
, the property is not set by default. - First Badge: The JavaType of the property, indicating its type in Java (String, Integer, Boolean, etc.).
- Second Badge: Represents the Type, defining how the viewer handles the property:
- F: Processed only during the viewer’s initial launch as it can be adjusted in the client-side preferences.
- A: Always processed by the viewer.
- AP: Always processed by the viewer but only from
base.json
or other.json
files.
- Description: A brief explanation of the property, provided on the second line.
Dicom Category
-
weasis.aet
Null
string
A
Calling AETitle for DICOM send and Dicomizer publish. ? null means displaying the DICOM calling node combobox otherwise the combo is not displayed and the value is directly used -
weasis.dicom.root.uid
2.25
string
A
Set values for dicom root UID when creating DICOM objects (KO or PR). See company list at https://www.iana.org/assignments/enterprise-numbers -
weasis.download.immediately
true
boolean
F
Start to download series immediately -
download.concurrent.series
3
int
A
The number of concurrently downloaded series -
download.concurrent.series.images
4
int
A
The number of concurrently downloaded images in a series
General Category
-
weasis.theme
org.weasis.launcher.FlatWeasisTheme
string
F
FaltLaf Look and feel, see https://www.formdev.com/flatlaf/themes/ -
weasis.confirm.closing
false
boolean
F
Show a message of confirmation when closing the application -
locale.lang.code
en
string
F
Language code (see Java Locale: https://www.oracle.com/java/technologies/javase/jdk20-suported-locales.html). Default value is "en". -
locale.format.code
system
string
F
If value is "system" then the locale of the operating system will be used (in client-side). See Java Locale: https://www.oracle.com/java/technologies/javase/jdk20-suported-locales.html
Launch Category
-
felix.native.processor.alias.arm_le
armv7a
string
A
Processor alias for 32-bit arm native libraries -
weasis.clean.previous.version
false
boolean
A
If true, the bundle cache is cleared when the weasis version has changed from the previous launch -
weasis.main.ui
weasis-base-ui
string
A
Application main user interface bundle. Mandatory with the default launcher. -
weasis.name
Weasis
string
AP
Change the name of the application everywhere in UI -
weasis.profile
default
string
AP
Application profile: when no profile name is provided, the value is "default". It allows having a custom preferences' directory on the client side (will not share preferences with other Weasis instances) -
weasis.user
Null
string
AP
Defines a user name to store its own preferences. Null value will be the system user. -
weasis.pref.store.local.session
Null
string
AP
Store user preferences when weasis.user is not specified (only with remote preferences service) -
flatlaf.uiScale
Null
string
F
Specifies a custom scale factor used to scale the user interface. Allowed values: e.g. 1.5, 1.5x, 150% or 144dpi (96dpi is 100%) -
weasis.resources.url
${dollar}{weasis.codebase.url}/resources.zip
string
A
Application resources (logo, presets, LUTs, dicom annotations configuration...) "resources.zip" is downloaded again only when the last modified date has changed -
weasis.show.disclaimer
true
boolean
A
Show a disclaimer at the first launch of Weasis (requires to be accepted to start the application) -
weasis.show.release
true
boolean
A
Show a message when the release has changed -
weasis.update.release
true
boolean
A
Show a message when a new release is available -
weasis.portable.dicom.directory
dicom,DICOM,IMAGES,images
string
A
For loading automatically DICOMs in the portable Weasis distribution (CD/DVD). Comma-separated directories relative to the Weasis executable file.
Log Category
-
felix.log.level
1
int
A
Set the logging levels for OSGI framework 0=None / 1(default)=Error / 2=Warning / 3=Information / 4=Debug -
org.apache.sling.commons.log.level
INFO
string
F
Application logging level. This may be any of the defined logging levels TRACE, DEBUG, INFO, WARN, ERROR -
org.apache.sling.commons.log.file.activate
false
boolean
F
Activation of rolling log files -
org.apache.sling.commons.log.file.number
20
int
F
The max number of rolling log files -
org.apache.sling.commons.log.file.size
10MB
string
F
The max size of a rolling log file -
org.apache.sling.commons.log.pattern
%d{dd.MM.yyyy HH:mm:ss.SSS} *%-5level* [%thread] %logger{36}: %msg%ex{3}%n
string
F
Log pattern: {0} The timestamp of type java.util.Date, {1} the log marker, {2} the name of the current thread, {3} the name of the logger, {4} the debug level and {5} the actual debug message. -
org.apache.sling.commons.log.stack.limit
3
int
F
Defines the maximum number of lines for stack trace (0 => NONE, -1 => ALL). Default value is 3 -
audit.log
false
boolean
A
Audit log for giving statistics about usage of Weasis
Ui Category
-
weasis.import.images
true
boolean
A
Show the import image toolbar and menu -
weasis.import.dicom
true
boolean
A
Show the DICOM import menu and dialog -
weasis.import.dicom.qr
true
boolean
A
Show the DICOM Q/R page in the DICOM Export dialog -
weasis.export.dicom
true
boolean
A
Show the DICOM export menu and dialog -
weasis.export.dicom.send
true
boolean
A
Show the send page in the DICOM Export dialog -
weasis.toolbar.mouse.buttons
7170
int
A
Show all mouse buttons. Sum of LEFT=1024 + MIDDLE=2048 + RIGHT=4096 + SCROLL=2. Show all:7170 and show none:0. -
weasis.all.cinetoolbar.visible
false
boolean
A
Show all the cine toolbars -
weasis.all.keyobjecttoolbar.visible
false
boolean
A
Show all the key object toolbars -
weasis-dicom-viewer2d.all.rotationtoolbar.visible
false
boolean
A
Show the rotation toolbars in DICOM 2D viewer -
weasis.contextmenu.lutShape
false
boolean
A
Show LUT Shape in the contextual menu -
weasis.contextmenu.lut
false
boolean
A
Show LUT in the contextual menu -
weasis.contextmenu.filter
false
boolean
A
Show Filter in the contextual menu -
weasis.plugins.license
true
boolean
A
Show license activation in Help menu
Viewer Category
-
weasis.color.wl.apply
true
boolean
F
Allow applying Window/Level on color images -
weasis.level.inverse
true
boolean
F
Inverse level direction (moving the cursor down to increase brightness -
weasis.apply.latest.pr
false
boolean
F
Apply by default the most recent Presentation State to the related image -
weasis.force.3d
false
boolean
A
Force to detect a graphic card at every launch -
weasis.toolbar.mouse.left
winLevel
string
F
Left mouse button action, possible values: pan|winLevel|sequence|zoom|rotation|measure|drawings|contextMenu|crosshair|none -
weasis.toolbar.mouse.middle
pan
string
F
Middle mouse button action, possible values: pan|winLevel|sequence|zoom|rotation|measure|drawings|contextMenu|crosshair|none -
weasis.toolbar.mouse.right
contextMenu
string
F
Right mouse button action, possible values: pan|winLevel|sequence|zoom|rotation|measure|drawings|contextMenu|crosshair|none -
weasis.toolbar.mouse.wheel
sequence
string
F
Mouse wheel action, possible values: sequence|zoom|rotation|none
Customize resources
The default resources are located:
- With ViewerHub you can upload a new package “resources.zip” for a specific release.
- For the installed distribution in installedPath/app/resources
How to add DICOM nodes or DICOM printers at the server-side
- From the graphical user interface, configure the DICOM printers from File > Print > DICOM Print or DICOM nodes from File > Preferences > Dicom node list
- Go to the folder ${user.home}/.weasis/data/weasis-dicom-explorer
- Copy the desired configuration files: dicomNodes.xml, dicomPrinterNodes.xml, dicomWebNodes.xml and dicomCallingNodes.xml
- Paste at the root path of resources. For web distribution, unzip, place files and zip again.
- The new configurations should appear for all the users as non-editable configurations in Weasis
Build Plugins
How to build and install a plugin
This page provides a guide on creating new Weasis plugins and explains how to integrate them into the distributions. For details on configuring the development environment, refer to this guidelines page.
Types of Plugins in Weasis
The following list describes the types of plugins, the interfaces they implement and the factories they use:
- Media Viewer or Editor
- Represents the main central panel and implements either
ViewerPlugin
orImageViewerPlugin
. - The factory for this type implements
SeriesViewerFactory
. - For DICOM special modalities, you can use
DicomSpecialElementFactory
to associate a viewer to a specific DICOM object.
- Represents the main central panel and implements either
- Toolbar Associated with a Viewer
- Implements the
Toolbar
orDynamicToolbar
interface. - The factory for this type implements
InsertableFactory
- Implements the
- Tool Associated with a Viewer
- Represents the right panel and implements
DockableTool
. - The factory for this type implements
InsertableFactory
.
- Represents the right panel and implements
- Data Explorer
- The explorer model implements
DataExplorerModel
. - The explorer view implements
DataExplorerView
. - The factory for this type implements
DataExplorerViewFactory
.
- The explorer model implements
- Import Data into an Explorer
- Adds a new page into the DICOM Import UI with
ImportDicom
. - The factory for this type implements
DicomImportFactory
.
- Adds a new page into the DICOM Import UI with
- Export Data from an Explorer
- Adds a new page into the DICOM Export UI with
ExportDicom
- The factory for this type implements
DicomExportFactory
.
- Adds a new page into the DICOM Export UI with
- Media Codec
- Implements the
Codec
interface to decode and encode media files related to a file extension or a mime type.
- Implements the
- Preferences
- Implements
PreferencesPageFactory
to add a new page in the Preferences dialog.
- Implements
- UI Aggregator
- Represents the bundle for the application’s main user interface which aggregates various interface components.
- The Maven artifact for this bundle must be defined in the
base.json
file (e.g., code:weasis.main.ui
value:weasis-base-ui
).
Note
The factories are used to create the instances of the plugins and are registered as OSGi services. For performance reasons, the factories are created at startup and the plugins are created only if they are needed.
Tip
For more information about the plugin hierarchy and their relationships, refer to the Weasis Architecture.
Building Plugins Using Maven Archetype
- To add the Weasis archetypes to your local Maven repository, go to the
Weasis/archetype
directory and execute the following command:mvn install
- Navigate to the target folder, which should be the parent folder of the new plugin project, and execute the following command to create your plugin:
mvn archetype:generate -DarchetypeCatalog=local
- When prompted, enter the number of one of the archetypes. Currently, the following archetypes are available:
weasis-plugin-base-viewer-archetype
: Example of a toolbar and tool for a non-DICOM viewer.weasis-plugin-dicom-viewer-archetype
: Example of a toolbar and tool for a DICOM viewer.
- Modify the generated project as needed.
- In the pom.xml file, ensure the
<relativePath>
tag corresponds to the location of your Weasis source folder. By default, the value is<relativePath>../Weasis/weasis-parent/pom.xml</relativePath>
(In this scenario, the plugin resides in the same parent folder as the Weasis source code). - When the relative path is set correctly,
<version>${revision}${changelist}</version>
in the pom.xml file will automatically be updated to the latest version of the Weasis source. - For easier version management in the pom.xml, you can remove
<version>
at the project level to inherit it from the parent.
- In the pom.xml file, ensure the
- Build the plugin by executing the following command in the plugin project directory:
mvn clean install
Integrating Plugins into Weasis Distributions
Once the plugin is built, it can be integrated into the Weasis distributions either locally or remotely.
Warning
The plugin depends on the Weasis framework, and its version must align with the version of the Weasis distribution being integrated.
If the versions do not match, the plugin may fail to start and produce an error such as org.osgi.framework.BundleException: Unable to resolve myplugin ….
Testing the Plugin
To test the plugin with an installed version of Weasis without making any changes to the installed directory, create a JSON file that extends the configuration specified in base.json.
- Create a new json file (e.g.,
myplugin.json
) with the following content:{ "weasisPreferences": [ { "code": "org.osgi.framework.startlevel.beginning", "value": "550" }, { "code": "felix.auto.start.500", "value": "file:///git/myplugin/target/myplugin-4.5.2.jar", "description": "Myplugin - a viewer for ..." } ] }
- Update the content of
myplugin.json
as required:- Ensure the plugin start level (above 500) is lower than the OSGi beginning level (above 550). Avoid using values below this range to prevent conflicts with other plugins.
- For easier testing, use an absolute JAR path that matches your local plugin directory. Use a URI format for the path like:
file:///D:/git/myplugin/target/myplugin-4.5.2.jar
file:///git/myplugin/target/myplugin-4.5.2.jar
file:///git/myplugin/target/myplugin-4.5.2.jar
- Launch Weasis with your configuration:
- Use the following parameter to extend the configuration (adapt the path to your local file):
$weasis:config pro="felix.extended.config.properties file:///D:/git/myplugin/myplugin.json"
$weasis:config pro="felix.extended.config.properties file:///git/myplugin/myplugin.json"
$weasis:config pro="felix.extended.config.properties file:///git/myplugin/myplugin.json"
- Build a valid URI with the above parameter (see How to build an URI) and launch Weasis from the command on a terminal:Construct a valid URI using the parameter mentioned above (refer to How to build a URI)) and launch Weasis from the terminal using a command:
start weasis://%24weasis%3Aconfig%20pro%3D%22felix.extended.config.properties%20file%3A%2F%2F%2FD%3A%2Fgit%2Fmyplugin%2Fmyplugin.json%22
xdg-open weasis://%24weasis%3Aconfig%20pro%3D%22felix.extended.config.properties%20file%3A%2F%2F%2Fgit%2Fmyplugin%2Fmyplugin.json%22
open weasis://%24weasis%3Aconfig%20pro%3D%22felix.extended.config.properties%20file%3A%2F%2F%2Fgit%2Fmyplugin%2Fmyplugin.json%22
- Use the following parameter to extend the configuration (adapt the path to your local file):
Using ViewerHub
This feature will be available soon. It will allow you to manage the plugins and their configurations directly from the ViewerHub web portal.
Build OSGi Services
All the plugin type described in the list above are OSGi services that are registered and aggregated in the GUI. Building the plugin from the Maven archetype will configure the OSGi service automatically. For adding new OSGi services, here is the procedure:
-
Create a class that implements the
Insertable
interface and represents a visual component. For example:public class MyPrefView extends AbstractItemDialogPage { public MyPrefView() { super("My Preferences", 100); // Provide a name and the page position initGUI(); } private void initGUI() { // Add a basic JLabel to the preference panel for demonstration add(new JLabel("Welcome to My Preferences!")); } @Override public void closeAdditionalWindow() { // Handle any cleanup or saving preferences when closing } @Override public void resetToDefaultValues() { // Reset preferences to default values } }
-
Create a class that implements one of the plugin factories and include the annotations
@Component
and the@Service
parameter. For example:@org.osgi.service.component.annotations.Component(service = PreferencesPageFactory.class) public class MyViewerPrefFactory implements PreferencesPageFactory { @Override public AbstractItemDialogPage createInstance(Hashtable<String, Object> properties) { return new MyPrefView(); } @Override public boolean isComponentCreatedByThisFactory(Insertable component) { return component instanceof MyPrefView; } }
Tip
For more details on annotations, refer to the Apache Felix SCR Annotations documentation.
Weasis Commands
The commands listed below can be applied at start-up or in a telnet session. All the commands starting with “dcmview2d:” allow you to drive Weasis and are not adapted to be used at start-up.
Info
This page matches to Weasis 3.5.1 or higher. The syntax of usage comes from POSIX.
To obtain the list of commands, after starting Weasis, open a local telnet session of the OSGI Console and type lb
for getting the list of bundles and their state or type help
for getting all the available commands:
telnet localhost 17179
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
____________________________
Welcome to Apache Felix Gogo
g!
List of Weasis commands
dcmview2d:layout
g! dcmview2d:layout
Select a split-screen layout
Usage: dcmview2d:layout ( -n NUMBER | -i ID )
-n --number=NUMBER select the best matching number of views
-i --id=ID select the layout from its identifier
-? --help show help
dcmview2d:mouseLeftAction
g! dcmview2d:mouseLeftAction
Change the mouse left action
Usage: dcmview2d:mouseLeftAction COMMAND
COMMAND is (sequence|winLevel|zoom|pan|rotation|crosshair|measure|draw|contextMenu|none)
-? --help show help
dcmview2d:move
g! dcmview2d:move
Pan the selected image
Usage: dcmview2d:move -- X Y
X and Y are Integer. It is mandatory to have '--' (end of options) for negative values
-? --help show help
dcmview2d:reset
g! dcmview2d:reset
Reset image display
Usage: dcmview2d:reset (-a | COMMAND...)
COMMAND is (winLevel|zoom|pan|rotation)
-a --all reset to original display
-? --help show help
dcmview2d:scroll
g! dcmview2d:scroll
Scroll into the images of the selected series
Usage: dcmview2d:scroll ( -s NUMBER | -i NUMBER | -d NUMBER)
-s --set=NUMBER set a new value from 1 to series size
-i --increase=NUMBER increase of some amount
-d --decrease=NUMBER decrease of some amount
-? --help show help
dcmview2d:synch
g! dcmview2d:synch
Set a synchronization mode
Usage: dcmview2d:synch VALUE
VALUE is (None|Stack|Tile)
-? --help show help
dcmview2d:wl
g! dcmview2d:wl
Change the window/level values of the selected image (increase or decrease into a normalized range of 4096)
Usage: dcmview2d:wl -- WIN LEVEL
WIN and LEVEL are Integer. It is mandatory to have '--' (end of options) for negative values
-? --help show help
dcmview2d:zoom
g! dcmview2d:zoom
Change the zoom value of the selected image
Usage: dcmview2d:zoom (set VALUE | increase NUMBER | decrease NUMBER)
-s --set=VALUE [decimal value] set a new value from 0.0 to 12.0 (zoom magnitude, 0.0 => default, -200.0 => best fit, -100.0 => real size)
-i --increase=NUMBER increase of some amount
-d --decrease=NUMBER decrease of some amount
-? --help show help
dicom:get
g! dicom:get
Load DICOM files remotely or locally
Usage: dicom:get ([-l PATH]... [-w URI]... [-r URI]... [-p] [-i DATA]... [-z URI]...)
PATH is either a directory(recursive) or a file
-l --local=PATH open DICOMs from local disk
-r --remote=URI open DICOMs from an URI
-w --wado=URI open DICOMs from an XML manifest
-z --zip=URI open DICOM ZIP from an URI
-p --portable open DICOMs from configured directories at the same level of the executable
-i --iwado=DATA open DICOMs from an XML manifest (GZIP-Base64)
-? --help show help
dicom:close
g! dicom:close
Close DICOM files
Usage: dicom:close (-a | ([-y UID]... [-s UID]...))
-a --all close all the patients
-p --patient=ID close a patient from its patient ID (since v4.4.1)
-y --study=UID close a study, UID is Study Instance UID
-s --series=UID close a series, UID is Series Instance UID
-? --help show help
dicom:rs
g! dicom:rs
Load DICOM files from DICOMWeb API (QIDO/WADO-RS)
Usage: dicom:rs -u URL -r QUERYPARAMS... [-H HEADER]... [--query-header HEADER]... [--retrieve-header HEADER]... [--query-ext EXT] [--retrieve-ext EXT] [--accept-ext EXT]
-u --url=URL URL of the DICOMWeb service
-r --request=QUERYPARAMS Query params of the URL, see weasis-pacs-connector
-H --header=HEADER Pass custom header(s) to all the requests
--query-header=HEADER Pass custom header(s) to the query requests (QIDO)
--retrieve-header=HEADER Pass custom header(s) to the retrieve requests (WADO)
--query-ext=EXT Additionnal parameters for Query URL (QIDO)
--retrieve-ext=EXT Additionnal parameters for Retrieve URL (WADO)
--accept-ext=EXT Additionnal parameters for DICOM multipart/related Accept header of the retrieve URL (WADO). Default value is: transfer-syntax=*
--show-whole-study when downloading a series, show all the other series (ready for download) from the same study
-? --help show help
image:get
g! image:get
Load images remotely or locally
Usage: image:get ([-f file]... [-u url]...)
-f --file=FILE open an image from a file
-u --url=URL open an image from an URL
-? --help show help
image close
g! image:close
Close images
Usage: dicom:close (-a | ([-g UID]... [-s UID]...))
-a --all close all series
-g --group=UID close a group from its UID
-s --series=UID close an series/image from its UID
-? --help show help
weasis:info
g! weasis:info
Show information about Weasis
Usage: weasis:info (-v | -a)
-v --version show version
-a --all show weasis specifications
-? --help show help
weasis:ui
g! weasis:ui
Manage user interface
Usage: weasis:ui (-q | -v)
-q --quit shutdown Weasis
-v --visible set window on top
-? --help show help
acquire:patient
g! acquire:patient
Load Patient Context from the first argument
Usage: acquire:patient (-x | -i | -s | -u) arg
arg is an XML text in UTF8 or an url with the option '--url'
-x --xml open Patient Context from an XML data containing all DICOM Tags
-i --inbound open Patient Context from an XML data containing all DICOM Tags, decoding syntax is [Base64/GZip]
-s --iurlsafe open Patient Context from an XML data containing all DICOM Tags, decoding syntax is [Base64_URL_SAFE/GZip]
-u --url open Patient Context from an URL (XML file containing all DICOM TAGs)
-? --help show help
weasis:config (only at launch)
This command can be used only at launch, see Modify the launch parameters
Note
For identifying the commands at start-up, the symbol “$” must be added before the command (not required in the OSGI console). See examples below.
Warning
Special characters: A command containing special characters like ‘&’ or space must be within quotes or double quotes. Example:
dicom:get -w "http://localhost/weasis-pacs-connector/manifest?patientID=97026728&modalitiesInStudy=MR"
Depending the command line system, quotes or double quote needs to be escaped with a backslash. Ex. simple quote must be escaped in Eclipse but not in Intellij.
Dicom Conformance
Compatibility of DICOM Transfer Syntax
This table lists the DICOM Transfer Syntaxes supported by Weasis.
Transfer Syntax UID | Media Type | Description | Read | Write |
---|---|---|---|---|
1.2.840.10008.1.2 | Implicit VR - Little Endian | yes | No | |
1.2.840.10008.1.2.1 | Explicit VR - Little Endian | yes | Yes | |
1.2.840.10008.1.2.1.99 | Deflated Explicit VR Little Endian | yes | No | |
1.2.840.10008.1.2.2 | Explicit VR Big Endian (Retired) | yes | No | |
1.2.840.10008.1.2.5 | RLE (Run Length Encoding) Lossless | yes | No | |
1.2.840.10008.1.2.4.50 | image/jpeg | JPEG Baseline (Process 1): Default Transfer Syntax for Lossy JPEG 8 Bit Image Compression | yes | Yes |
1.2.840.10008.1.2.4.51 | image/jpeg | JPEG Extended (Process 2 & 4): Default Transfer Syntax for Lossy JPEG 12 Bit Image Compression (Process 4 only) | yes | Yes |
1.2.840.10008.1.2.4.53 | image/jpeg | JPEG Spectral Selection, Non-Hierarchical (Process 6 & 8) (Retired) | yes | No |
1.2.840.10008.1.2.4.55 | image/jpeg | JPEG Full Progression, Non-Hierarchical (Process 10 & 12) (Retired) | yes | No |
1.2.840.10008.1.2.4.57 | image/jpeg | JPEG Lossless, Non-Hierarchical (Process 14) | yes | Yes |
1.2.840.10008.1.2.4.70 | image/jpeg | JPEG Lossless, Non-Hierarchical, First-Order Prediction (Process 14 [Selection Value 1]) | yes | Yes |
1.2.840.10008.1.2.4.80 | image/jls | JPEG-LS Lossless Image Compression | yes | Yes |
1.2.840.10008.1.2.4.81 | image/jls | JPEG-LS Lossy (Near-Lossless) Image Compression | yes | Yes |
1.2.840.10008.1.2.4.90 | image/jp2 | JPEG 2000 Image Compression (Lossless Only) | yes | Yes |
1.2.840.10008.1.2.4.91 | image/jp2 | JPEG 2000 Image Compression | yes | Yes |
1.2.840.10008.1.2.4.92 | image/jpx | JPEG 2000 Part 2 Multi-component Image Compression (Lossless Only) | yes | No |
1.2.840.10008.1.2.4.93 | image/jpx | JPEG 2000 Part 2 Multi-component Image Compression | yes | No |
1.2.840.10008.1.2.4.201 | image/jphc | High-Throughput JPEG 2000 Image Compression (Lossless Only) | yes | No |
1.2.840.10008.1.2.4.202 | image/jphc | High-Throughput JPEG 2000 with RPCL Options Image Compression (Lossless Only) | yes | No |
1.2.840.10008.1.2.4.203 | image/jphc | High-Throughput JPEG 2000 Image Compression | yes | No |
Transfer Syntax UID | Media Type | Description | Read | Write |
---|---|---|---|---|
1.2.840.10008.1.2.6.1 | mime type | RFC 2557 MIME Encapsulation | yes | No |
1.2.840.10008.1.2.4.100 | video/mpeg | MPEG-2 Main Profile Main Level | yes | No |
1.2.840.10008.1.2.4.101 | video/mpeg | MPEG-2 Main Profile High Level | yes | No |
1.2.840.10008.1.2.4.102 | video/mp4 | MPEG-4 AVC/H.264 High Profile / Level 4.1 | yes | No |
1.2.840.10008.1.2.4.103 | video/mp4 | MPEG-4 AVC/H.264 BD-compatible High Profile / Level 4.1 | yes | No |
1.2.840.10008.1.2.4.104 | video/mp4 | MPEG-4 AVC/H.264 High Profile / Level 4.2 For 2D Video | yes | No |
1.2.840.10008.1.2.4.105 | video/mp4 | MPEG-4 AVC/H.264 High Profile / Level 4.2 For 3D Video | yes | No |
1.2.840.10008.1.2.4.106 | video/mp4 | MPEG-4 AVC/H.264 Stereo High Profile / Level 4.2 | yes | No |
1.2.840.10008.1.2.4.107 | video/H265 | HEVC/H.265 Main Profile / Level 5.1 | yes | No |
1.2.840.10008.1.2.4.108 | video/H265 | HEVC/H.265 Main 10 Profile / Level 5.1 | yes | No |
Note
The latter groups of TSUIDs are opened by the default system application associated with the MIME type.
Supported “Photometric Interpretation” pixel format
This table lists the Photometric Interpretation supported by Weasis.
Photometric Interpretation | Description | Supported |
---|---|---|
MONOCHROME1 | grey level image description (high values=dark, low values=bright) | yes |
MONOCHROME2 | grey level image description (high values=bright, low values=dark) | yes |
PALETTE COLOR | pseudo color image description | yes |
RGB | true color image description | yes |
YBR_FULL | true color image description | yes |
YBR_FULL_422 | true color image description | yes |
YBR_PARTIAL_422 | true color image description (Retired) | yes |
YBR_PARTIAL_420 | true color image description | yes |
YBR_ICT | true color image description (JPEG-2000) | yes |
YBR_RCT | true color image description (JPEG-2000) | yes |