# nroduit/weasis architecture

> Architecture diagram of the GitHub repository nroduit/weasis, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nroduit/weasis
- Repository: https://github.com/nroduit/weasis

## Overview

##### Project type and purpose
- This is Weasis, an open-source, modular, desktop and web-capable DICOM viewer platform written in Java. It uses a plugin/OSGi-style architecture to load and run a family of image viewers (2D, 3D, SR, ECG, RT, audio, etc.), acquisition tools, and distribution scripts, all orchestrated via a Launcher module.

##### File structure
- Top-level pom.xml defines a multi-module Maven build.
- Key modules:
- weasis-launcher: the Java Swing entry point and OSGi bootstrapping container.
- weasis-core: core APIs (image I/O, plugin registry, task management, GUI abstractions).
- weasis-base: foundational “base” UI and explorer libraries.
- weasis-dicom: a parent with submodules for DICOM viewers (viewer2d, viewer3d), explorers, codecs, services (AU, SR, RT, wave).
- weasis-acquire: image acquisition editor and explorer.
- weasis-imageio: image-codec utilities independent from DICOM.
- weasis-distributions & snap: packaging (installers, Docker, Snapcraft).
- tests & archetype: integration tests and a project archetype for custom plugins.
- Configuration files: OSGi activators, META-INF, layout XMLs, Maven build workflows, Dockerfile, snapcraft.yaml.

##### README for additional insights
- Confirms a plugin API for custom viewers.
- Lists DICOM network features (C-GET, C-MOVE, WADO, STOW-RS), DICOM export (ISO, ZIP, DICOMDIR).
- Mentions desktop and web launch modes, high-DPI Swing UI, multi-language support.

##### Elements
- Launcher (blue)
- Core/Base (green)
- Plugins (orange grouped by functionality)
- Packaging (gray)
- External services (purple)
- Rectangles for modules

##### Detail
- Plugin registry in core and the Activator mechanism.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Launcher Layer
    subgraph "Launcher Layer"
        WL["weasis-launcher"]:::launcher
    end

    %% Core Layer
    subgraph "Core Layer"
        WC["weasis-core"]:::core
        WBE["weasis-base-explorer"]:::core
        WBU["weasis-base-ui"]:::core
        WV2["weasis-base-viewer2d"]:::core
    end

    %% Plugin Modules
    subgraph "Plugin Modules"
        subgraph "DICOM Suite" 
            WDIC["weasis-dicom"]:::plugin
            W3D["weasis-dicom-3d (viewer3d)"]:::plugin
            WAU["weasis-dicom-au"]:::plugin
            WCOD["weasis-dicom-codec"]:::plugin
            WEXP["weasis-dicom-explorer"]:::plugin
            WISO["weasis-dicom-isowriter"]:::plugin
            WQR["weasis-dicom-qr"]:::plugin
            WRT["weasis-dicom-rt"]:::plugin
            WSND["weasis-dicom-send"]:::plugin
            WSR["weasis-dicom-sr"]:::plugin
            WV22["weasis-dicom-viewer2d"]:::plugin
            WWAV["weasis-dicom-wave"]:::plugin
        end
        subgraph "Other Plugins"
            WAC_ED["weasis-acquire-editor"]:::plugin
            WAC_EX["weasis-acquire-explorer"]:::plugin
            WIMGIO["weasis-imageio"]:::plugin
        end
    end

    %% Packaging Layer
    subgraph "Packaging Layer"
        WDIS["weasis-distributions"]:::packaging
        SNAP["Snapcraft"]:::packaging
    end

    %% External Services
    subgraph "External Services"
        PACS["PACS/DICOMWeb Server"]:::external
    end

    %% Relationships
    WL -->|"loads bundles"| WC
    WL -->|"loads bundles"| WBE
    WL -->|"loads bundles"| WBU
    WL -->|"loads bundles"| WV2

    WC -->|"provides plugin registry"| WDIC
    WC -->|"provides plugin registry"| W3D
    WC -->|"provides plugin registry"| WAU
    WC -->|"provides plugin registry"| WCOD
    WC -->|"provides plugin registry"| WEXP
    WC -->|"provides plugin registry"| WISO
    WC -->|"provides plugin registry"| WQR
    WC -->|"provides plugin registry"| WRT
    WC -->|"provides plugin registry"| WSND
    WC -->|"provides plugin registry"| WSR
    WC -->|"provides plugin registry"| WV22
    WC -->|"provides plugin registry"| WWAV
    WC -->|"provides plugin registry"| WAC_ED
    WC -->|"provides plugin registry"| WAC_EX
    WC -->|"provides plugin registry"| WIMGIO

    WDIC -->|"parent for submodules"| W3D
    W3D -->|"uses OpenGL via Jogamp"| WC

    %% DICOM network communication
    WV22 -->|"C-GET/C-MOVE/WADO"| PACS
    WQR -->|"Query/Retrieve (C-GET/C-MOVE)"| PACS
    WSND -->|"Store SCU/STOW-RS"| PACS

    %% UI calls core API
    WBE -->|"invokes GUI abstractions"| WC
    WBU -->|"invokes GUI abstractions"| WC
    WV2 -->|"invokes image I/O"| WC

    %% Packaging consumes artifacts
    WDIS -->|"consumes Maven artifacts"| WL
    WDIS -->|"builds Docker"| SNAP
    SNAP -->|"creates Snap package"| WDIS

    %% Click Events
    click WL "https://github.com/nroduit/weasis/blob/master/weasis-launcher/pom.xml"
    click WC "https://github.com/nroduit/weasis/blob/master/weasis-core/pom.xml"
    click WBE "https://github.com/nroduit/weasis/blob/master/weasis-base/weasis-base-explorer/pom.xml"
    click WBU "https://github.com/nroduit/weasis/blob/master/weasis-base/weasis-base-ui/pom.xml"
    click WV2 "https://github.com/nroduit/weasis/blob/master/weasis-base/weasis-base-viewer2d/pom.xml"
    click WDIC "https://github.com/nroduit/weasis/blob/master/weasis-dicom/pom.xml"
    click W3D "https://github.com/nroduit/weasis/blob/master/weasis-dicom/weasis-dicom-3d/viewer3d/pom.xml"
    click WAU "https://github.com/nroduit/weasis/blob/master/weasis-dicom/weasis-dicom-au/pom.xml"
    click WCOD "https://github.com/nroduit/weasis/blob/master/weasis-dicom/weasis-dicom-codec/pom.xml"
    click WEXP "https://github.com/nroduit/weasis/blob/master/weasis-dicom/weasis-dicom-explorer/pom.xml"
    click WISO "https://github.com/nroduit/weasis/blob/master/weasis-dicom/weasis-dicom-isowriter/pom.xml"
    click WQR "https://github.com/nroduit/weasis/blob/master/weasis-dicom/weasis-dicom-qr/pom.xml"
    click WRT "https://github.com/nroduit/weasis/blob/master/weasis-dicom/weasis-dicom-rt/pom.xml"
    click WSND "https://github.com/nroduit/weasis/blob/master/weasis-dicom/weasis-dicom-send/pom.xml"
    click WSR "https://github.com/nroduit/weasis/blob/master/weasis-dicom/weasis-dicom-sr/pom.xml"
    click WV22 "https://github.com/nroduit/weasis/blob/master/weasis-dicom/weasis-dicom-viewer2d/pom.xml"
    click WWAV "https://github.com/nroduit/weasis/blob/master/weasis-dicom/weasis-dicom-wave/pom.xml"
    click WAC_ED "https://github.com/nroduit/weasis/blob/master/weasis-acquire/weasis-acquire-editor/pom.xml"
    click WAC_EX "https://github.com/nroduit/weasis/blob/master/weasis-acquire/weasis-acquire-explorer/pom.xml"
    click WIMGIO "https://github.com/nroduit/weasis/blob/master/weasis-imageio/pom.xml"
    click WDIS "https://github.com/nroduit/weasis/blob/master/weasis-distributions/pom.xml"
    click SNAP "https://github.com/nroduit/weasis/blob/master/snap/snapcraft.yaml"

    %% Styles
    classDef launcher fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef core fill:#98FB98,stroke:#333,stroke-width:1px
    classDef plugin fill:#FFA500,stroke:#333,stroke-width:1px
    classDef packaging fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef external fill:#DDA0DD,stroke:#333,stroke-width:1px
```
