An application brokering incoming DICOM DIMSE messages to a DICOMWeb client. Use it as a Windows or a Linux systemd service.
  • Rust 99.3%
  • PowerShell 0.7%
Find a file
2026-04-01 14:14:53 +02:00
.vscode fix: different initalizations, Association release error 2026-04-01 11:20:10 +02:00
dicom-ul-patched fix: c-echo, qido requests, c-get 2026-04-01 10:16:08 +02:00
src fix: buffering when retrieving 2026-04-01 14:14:53 +02:00
.gitignore chore: replace qido implementation with dicom-web 2026-03-28 22:21:38 +01:00
Cargo.toml fix: buffering when retrieving 2026-04-01 14:14:53 +02:00
config.toml fix: c-echo, qido requests, c-get 2026-04-01 10:16:08 +02:00
install-service.ps1 chore: build and install 2026-03-29 09:52:41 +02:00
LICENSE Initial commit 2026-03-28 20:03:33 +01:00
README.md chore: update README 2026-03-30 20:13:32 +02:00

dicom-broker

A broker translating incoming DICOM DIMSE messages to DICOMWeb, written in Rust. Designed to run as a Windows Service; also supported as a Linux systemd service.

Base assumptions:

  • The DIMSE connection is made locally and unencrypted
  • The HTTP connection to the DICOMWeb backend uses TLS

Current implementation

  • C-FIND <-> QIDO-RS - query at Study, Series and Instance level
  • C-GET <-> WADO-RS - get at Study, Series and Instance level

Currently Missing

  • C-STORE <-> STOW-RS - store instances

Also see the Issues list.

Configuration

The broker is configured via a TOML file (default: config.toml).

[scp]
ae_title = "DICOM-BROKER"   # AE title advertised by this broker
host = "0.0.0.0"            # bind address
port = 11112                 # DICOM listen port
max_pdu_length = 65535       # maximum PDU length in bytes

[dicomweb]
base_url = "https://host/dicomweb"   # DICOMWeb base URL

[log]
level = "info"               # trace | debug | info | warn | error
# file = "/var/log/dicom-broker/dicom-broker.log"  # omit to log to stdout

All [scp] and [log] fields are optional and fall back to the defaults shown above. [dicomweb].base_url is required.

DICOM DIMSE

The application handles 10 parallel associations at the same time. This number can be configured in the settings.

Any additional associations will be rejected.

DICOMWeb

TLS

For self-signed certificates the certificate must be installed in the system trust store for TLS verification to succeed.

Building

Prerequisites: Rust toolchain (stable) — see https://rustup.rs.

cargo build --release

The resulting binary is at target/release/dicom-broker (Linux) or target\release\dicom-broker.exe (Windows).

Installation

Linux (systemd)

1. Install the binary and config

sudo cp target/release/dicom-broker /usr/local/bin/
sudo mkdir -p /etc/dicom-broker
sudo cp config.toml /etc/dicom-broker/config.toml

2. Create a dedicated service user

sudo useradd --system --no-create-home --shell /usr/sbin/nologin dicom-broker

3. Create the systemd unit file

/etc/systemd/system/dicom-broker.service:

[Unit]
Description=DICOM-to-DICOMWeb broker service
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/dicom-broker --config /etc/dicom-broker/config.toml run
Restart=on-failure
RestartSec=5
User=dicom-broker
Group=dicom-broker
# Ensure SIGINT is used so the Ctrl-C handler fires on stop
KillSignal=SIGINT

[Install]
WantedBy=multi-user.target

4. Enable and start

sudo systemctl daemon-reload
sudo systemctl enable --now dicom-broker
sudo systemctl status dicom-broker

View logs:

journalctl -u dicom-broker -f

Windows (Service Control Manager)

All service management subcommands require an elevated (Administrator) command prompt.

Use the install-service.ps1 script or perform the manual steps:

1. Install the service

dicom-broker.exe --config C:\ProgramData\DicomBroker\config.toml install

This registers the service with the SCM set to start automatically.

2. Start / stop the service

dicom-broker.exe start
dicom-broker.exe stop

Alternatively use the standard Windows tools (services.msc, sc.exe, PowerShell).

3. Remove the service

dicom-broker.exe uninstall

Logs are written to the file path configured under [log] file in config.toml. If no file is configured, output goes to stdout (visible when running interactively).

Running interactively

On both platforms the broker can be run in the foreground without installing a service, which is useful for testing:

dicom-broker --config config.toml run

Press Ctrl-C to stop.