- Rust 99.3%
- PowerShell 0.7%
| .vscode | ||
| dicom-ul-patched | ||
| src | ||
| .gitignore | ||
| Cargo.toml | ||
| config.toml | ||
| install-service.ps1 | ||
| LICENSE | ||
| README.md | ||
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.