Repository navigation
Dynamic DICOM Endpoints with Diomede - Final Report #195
jess-tech-lab
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Dynamic DICOM Endpoints with Diomede - Final Report
Over the summer of 2026, I worked on Diomede, a load‑aware orchestration system for dynamic DICOM endpoint selection. This page serves as my official GSoC work product summary.
Static DICOM routing still impacts many real clinical environments, where scanners send studies to a single hard‑coded endpoint. That model works only as long as the destination node is healthy, uncongested, and not running out of disk space. When it isn’t, radiology workflows stall. The goal of this project is to replace those static assumptions with a dynamic, telemetry‑driven routing layer that preserves reliability under realistic failure conditions.
Project overview
Project: Towards Dynamic DICOM Endpoints with Diomede
Areas: Distributed systems, medical imaging, DICOM, cloud infrastructure
At a high level, Diomede introduces a self‑healing, load‑aware orchestration layer on top of the open‑source Orthanc PACS server. Instead of pushing every study to a single fixed endpoint, scanners (via an edge agent) talk to an orchestrator that continuously monitors multiple regional Orthanc nodes and chooses the most suitable destination for each study in real time.
Key design goals:
Architecture and components
As shown in the architecture above, Diomede is built as a system of cooperating services organized in a star topology; the main components include:
Regional Orthanc nodes
Cloud‑hosted Orthanc instances (e.g., in us‑east1, eu‑west1, asia‑northeast1, af‑south1) act as regional PACS endpoints. They expose standard DICOM services plus a REST API for telemetry and ingesting instances via HTTP.
Telemetry daemon
A background process that polls each Orthanc node’s
/statistics,/jobs?expand, and/systemendpoints to collect metrics such as queue depth, disk usage, and configuration parameters. It writes this data into Redis with a time‑to‑live (TTL), so stale node metrics expire automatically.FastAPI orchestrator
Maintains the live node registry in Redis and implements an HTTP endpoint (
/get-best-node) that evaluates a scoring function over all healthy nodes to choose the best routing destination for each incoming study.Edge agent (Orthanc + forwarder)
A local Orthanc instance acts as a DICOM receiver for existing scanners. A multi-threaded, asynchronous Python forwarder monitors new instances, executes RTT latency probes, processes concurrent jobs, queries the orchestrator for a target destination, streams image bytes to the chosen cloud Orthanc node, and removes the local copy to prevent disk exhaustion. This preserves compatibility with legacy DICOM devices while centralizing routing logic in the orchestrator.
Simulation scanner
A Python
asyncio+httpxharness that generates synthetic DICOM traffic and failure scenarios without requiring physical imaging equipment. I used this extensively for load and failover testing.All services are containerized using Docker and Docker Compose for reproducible deployments across regions, and Redis provides lightweight in‑memory state for node telemetry with automatic cleanup via TTL.
Routing model and scoring function
The orchestration logic is deliberately simple and transparent. The telemetry daemon periodically queries each node to estimate:
TotalDiskSizeMBandTotalUncompressedSizeMB./system.Each node n is scored as:
where RTT_ref = 100 ms, and the default weights are:
w_q = 0.5, w_r = 0.35, and w_d = 0.15.
Intuitively:
The scoring model is pluggable. In practice, this means an operator can prioritize latency, storage safety, or queue avoidance differently by adjusting weights or swapping the function, without changing the DICOM edge behavior.
What I implemented during GSoC
During GSoC 2026, I focused on delivering an end‑to‑end, measurable system rather than simply a theoretical design. Concretely, I implemented:
Orthanc‑based edge and regional topology
Telemetry collection and Redis integration
/statistics,/jobs?expand, and/systemon each node.FastAPI orchestrator
/get-best-nodeendpoint that reads the current node registry, applies the scoring function, and returns the best candidate as a simple JSON payload.Edge forwarding workflow
Simulation and benchmarking harness
asyncioandhttpxto generate realistic burst and concurrent traffic.Evaluation: performance and reliability
I evaluated Diomede from four perspectives: routing decision latency, routing correctness, failover behavior, and end‑to‑end transfer success.
Routing decision latency
To understand overhead introduced by the orchestration layer, I measured the
/get-best-nodeendpoint with both single requests and sustained concurrent load.These results indicate the routing step is lightweight and does not become a bottleneck compared to typical DICOM transfer times.
Routing correctness
Speed is only useful if the system chooses the right node. I tested routing correctness by rotating synthetic queue‑depth levels across four Orthanc nodes while keeping network latency and disk space fixed, then issuing repeated routing requests after telemetry updates.
This confirms that routing decisions are sensitive to live telemetry, not a static preference for a single default node.
Failover detection and recovery
I evaluated failover behavior by taking regional nodes offline under two failure modes: process stops and network partitions. For each region and failure mode, I measured the time to detect failure and the time to detect recovery after the node returned.
This behavior reflects the orchestrator’s fixed 10‑second health‑check interval and provides a predictable upper bound on how long a failed node may remain in the routing pool.
End‑to‑end transfer success
Finally, I validated the full forwarding pipeline from edge to cloud, including behavior under mid‑transfer failures.
This shows that the system not only detects failures but continues to preserve delivery reliability during them, masking short‑lived outages from the perspective of the overall DICOM workflow.
Code and merge history
Below is an outline of where my work lives upstream.
Documentation & Setup Guides
Core components
Orchestrator and telemetry code
src/orchestrator/main.py– FastAPI app and routing logic.daemon.py– Telemetry daemon process.scorer.py&weighted_scorer.py– Scoring logic for orchestration.Edge agent and forwarder
src/edge/forwarder.py– Python process that watches for new instances and forwards them.orthanc_source.py– Orthanc integration module.transport.py– Network transport handling.Simulation and benchmarking harness
src/simulator/generate_dicom.py– Synthetic DICOM/scanner data generator.send_dicom_native.py&send_dicom_rest.py– Sending scripts for DICOM benchmarking across native and REST protocols.Selected pull requests and merge history
Dynamic Routing & Orchestration Engine
Health Telemetry & Node State Management
Edge Agent & PACS Integration
Benchmarking, Simulation, & Load Testing
Performance Optimization & Infrastructure
System Documentation & Onboarding
For a complete list of changes, see:
is:pr is:merged author:jess-tech-labcommits?author=jess-tech-labWhat’s left and future work
Further enhancements to make the solution more enterprise-ready could include:
Improve system resiliency: Persist RTT metrics in Redis to accelerate recovery during server restarts, and deploy an Orchestrator cluster to eliminate single-point-of-failure risks.
Policy‑aware routing: Incorporate additional factors such as modality priority, study urgency, and patient or site‑specific policies into the scoring function instead of relying solely on queue depth, disk, and RTT.
Reduce failover latency: Experiment with shorter health‑check intervals or push‑based heartbeats to detect node failures faster without overloading nodes.
Real‑world workload validation: Test the system against real scanner traffic and larger‑scale deployments to validate behavior beyond synthetic loads.
Centralized monitoring and observability: Configure a centralized dashboard for real-time tracking of regional node loads, routing decisions, and system performance over time.
Lessons learned
This project was as much about designing a robust pipeline as it was about writing code. A few key takeaways for me:
Simple scoring beats complicated rules.
A clear, tunable scoring function made debugging and tuning significantly easier than a black‑box approach.
Telemetry and TTLs are powerful together.
Using Redis TTL as a way to detect inactive nodes turned out to be a clean way to handle nodes joining and leaving without adding complicated logic.
Evaluate the system, not just the components.
Measuring end‑to‑end transfer success under failures gave a more honest view of reliability than looking at routing latency or correctness in isolation.
Compatibility matters in healthcare.
The edge Orthanc + forwarder architecture allows for improved routing without requiring any changes to existing scanners, which is essential in real deployments.
Acknowledgments
I’m incredibly grateful to my mentors, Dr. Pradeeban Kathiravelu & Ananth Reddy, for their invaluable guidance, code reviews, and continuous support throughout this project. Their feedback helped refine both the architecture and the evaluation approach and made this a much more rigorous and rewarding experience.
If you’d like to learn more or discuss the project, feel free to reach out to me at jessihuang07@gmail.com.
All reactions