如何构建可扩展的云DICOM-WEB服务 | DICOM Cloud

如何利用开源项目,构建分布式DICOM-WEB服务. 总体架构 Apache-kafka 作为消息队列.开发阶段可用RedPanda 替代. Apache-Doris 作为数据仓库.提供DicomStateMeta,DicomImageMeta 及WadoAccessLog 存储,提供查询及统计分析. PostgreSQL 作为数据库.提供数据存储功能.及检查索引功能.只存储PatientInformation,StudyInformation,SeriesInformation 这一级别的元数据.充分利用关系数据库的ACID特性.后续可用Citus进行扩容. Redis 作为缓存.提供数据缓存功能. Nginx 作为反向代理服务器.提供负载均衡,静态文件,TLS透传等 收图文件服务接收的文件,先存储到本地,再通过 kafka 发送到消息队列. MessageBody = { TransferSyntax, SopInstancheUID, StudyInstanceUID,SeriesInstanceUID, PatientID, FileName, FileSize, FilePath } 消息分发到多个队列: 存储队列: 存储文件信息,文件存储路径,文件大小. 索引队列: 提取文件TAG信息, 包括PatientInfomation, StudyInformation, SeriesInformation, ImageInformation.并写入Doris库 转换队列: 对于部分传输语法,因为Cornerstone3D无法解析,需要转换成CornerstoneJS能够解析的格式.转换失败的写入Doris转换记录表. 服务用途及说明 服务 用途 wado-server DICOM Web WADO-RS API实现,support oauth2. wado-storescp CStoreSCP Provider,write dicom file to disk. and publish message to kafka:storage_queue,log_queue wado-consumer consumer storage-queue,and publish message to kafka:dicom_state_queue,dicom_image_queue,use stream_load write to doris wado-webworker generate metadata for wado-server and update related instances for series and study. wado-server DICOM Web WADO-RS API 接口实现 ,根据配置选项决定是否开启 OAuth2 认证. wado-storescp DICOM CStoreSCP 服务,接收DICOM文件并写入磁盘,同是分发消息到Kafka: storage_queue,log_queue - 1.存储文件路径: ${ROOT}/<TenantID>/<StudyInstanceUID>/<SeriesInstanceUID>/<SopInstanceUID>.dcm - 2.往消息队列: storage_queue ,log_queue 发送消息 wado-consumer 消费Kafka消息队列storage_queue ,提取DicomStateMeta 到主数据库,并通过消息队列:dicom_state_queue,dicom_image_queue发布DicomStateMeta,DicomImageMeta 到Doris数据库 - 1.从storage-queue读,往dicom_state_queue,dicom_image_queue写 - 2.提取DicomStateMeta 到主数据库, - 3.通过消息队列:dicom_state_queue,dicom_image_queue发布DicomStateMeta,DicomImageMeta 到Doris数据库 Stream_Load 模式 wado-webworker 定期扫描数据库,根据最后更新时间生成JSON格式的metadata用于加速WADO-Server的访问 总结 后续的相关子系统的介绍均围绕这里的进行展开. ...

November 19, 2025

dabase access and DICOM Object Metadata Extraction - Comprehensive Medical Imaging Data Processing

DICOM Object Metadata Extraction System The [dicom_object_meta.rs] module provides comprehensive extraction capabilities for DICOM medical imaging metadata, processing hundreds of standardized DICOM tags to create structured data representations. Metadata Categories Patient Information Extracts critical patient identifiers and demographics: Patient name, ID, and demographics Birth date and sex Medical record numbers Accession numbers Study Metadata Processes study-level information: Study instance UID and description Study date and time Referring physician information Study ID and accession numbers Series Information Handles series-specific data: ...

November 23, 2025

DICOM File Transfer and Conversion - Medical Imaging Format Transformation

title: “DICOM File Transfer and Conversion - Medical Imaging Format Transformation” description: “Learn how DICOM file transfer and conversion capabilities handle various medical imaging transfer syntaxes with GDCM integration for seamless format transformation.” keywords: [“DICOM conversion”, “medical imaging”, “file transfer”, “transfer syntax”, “GDCM integration”, “image processing”, “format transformation”] date: 2024-01-01T00:00:00+08:00 draft: false DICOM File Transfer and Conversion System The [change_file_transfer.rs] module provides comprehensive DICOM file transfer syntax conversion capabilities, enabling seamless format transformation for medical imaging systems using GDCM integration. ...

November 23, 2025

DICOM Server Common Library

DICOM Server Common Library 这是一个用于 DICOM 医疗影像系统的通用库,提供了各种核心功能模块。 功能模块 DICOM-Cloud Part Tow 4.1 Common Module Introduce DICOM-Cloud Part Tow 4.2 storage configuration DICOM-Cloud Part Tow 4.3 database factory DICOM-Cloud Part Tow 4.4 Redis DICOM-Cloud Part Tow 4.4 Kafka Message Publish DICOM-Cloud Part Tow 4.6 Extract Dicom Information DICOM-Cloud Part Tow 4.7 Security DICOM-Cloud Part Tow 4.8 Write File To Storage 项目概述 该库旨在为 DICOM 服务器提供可重用的组件,包括配置加载、数据库访问、缓存管理、消息传递等功能。 GoTo Summary : how-to-build-cloud-dicom

November 23, 2025

DICOM Storage Configuration and |Medical Imaging Storage Management - Efficient DICOM File Organization

Storage Configuration and Management System The storage_config.rs module provides intelligent storage management for medical imaging systems, optimizing file organization and path management for large-scale DICOM archives. Storage Architecture Hierarchical Directory Structure Implements a logical directory hierarchy based on medical imaging metadata: Tenant-based organization for multi-tenant deployments Date-based grouping for efficient retrieval UID-based separation for unique identification Path Management Generates consistent, predictable paths for all DICOM files and associated metadata. Key Features UID Hashing Uses SeaHash algorithm to create fixed-length hashed identifiers for secure, predictable path generation while maintaining patient privacy. ...

November 23, 2025

Medical Imaging Certificate Management - Secure Healthcare System Authentication

Certificate Management System for Medical Imaging The cert_helper.rs module provides comprehensive certificate management capabilities for securing medical imaging systems, implementing Public Key Infrastructure (PKI) with X.509 certificates and OpenSSL integration. Security Architecture Certificate Authority (CA) Management Implements a complete CA system for issuing and managing certificates within medical imaging environments. Client Certificate Generation Generates client certificates with machine-specific bindings for enhanced security. Server Certificate Management Creates server certificates for HTTPS and DICOM TLS connections. ...

November 23, 2025

Redis 缓存 |Redis Key Management for DICOM Server - High Performance Caching

Redis Key Management in DICOM Server The redis_key.rs module is a critical component of the DICOM server infrastructure, providing high-performance caching capabilities for medical imaging metadata and authentication data. This module implements intelligent key generation and caching strategies to significantly reduce database load and improve response times. Core Features Authentication Caching The module efficiently caches JWKS (JSON Web Key Set) URLs, which are essential for OAuth2/OpenID Connect authentication in medical imaging systems. This reduces authentication overhead and improves security token validation performance. ...

November 23, 2025

消息队列|Kafka Message Processing for Medical Imaging - Scalable Healthcare Data Streaming

Kafka Message Processing System for Medical Imaging The [message_sender_kafka.rs] module provides robust Kafka integration for medical imaging systems, enabling scalable, reliable message processing for DICOM metadata and imaging workflows. Message Processing Architecture High-Throughput Design Implements batch processing and compression to handle large volumes of medical imaging metadata with minimal resource consumption. Reliable Delivery Features built-in retry mechanisms and error handling to ensure message delivery even in challenging network conditions. Topic Segregation Uses separate Kafka topics for different message types: ...

November 23, 2025

配置管理 DICOM Server Configuration Management - Flexible Multi-Environment Setup

Server Configuration Management System The server_config.rs module provides a robust configuration management system for DICOM servers, supporting complex multi-environment deployments with flexible configuration sources. Configuration Architecture Multi-Source Configuration Loading The system supports configuration loading from multiple sources: JSON configuration files (application.dev.json, application.test.json) Environment variables with prefix support Secure credential management Environment-Specific Settings Different environments (development, testing, production) can have distinct configurations while maintaining consistency through shared structures. Core Configuration Components Database Configuration Supports multiple database backends including MySQL, PostgreSQL, and Doris with secure password handling and connection string generation. ...

November 23, 2025

DICOM 医疗影像系统的 Rust 实践:如何实现多数据库模式的支持|构建可扩展的云DICOM-WEB服务

概述 在这个篇文章中,我们将介绍如何使用Rust实现一个可扩展的云DICOM-WEB服务,该服务支持多种数据库模式,如MySQL、PostgreSQL和MongoDB。 准备工作 接口定义,或是说是 trait 定义 dicom_dbprovider.rs use crate::dicom_meta::{DicomJsonMeta, DicomStateMeta}; use async_trait::async_trait; use thiserror::Error; #[derive(Error, Debug)] pub enum DbError { #[error("Database operation failed: {0}")] DatabaseError(String), #[error("DataRow not exists: {0}")] RecordNotExists(String), #[error("Record already exists")] AlreadyExists, #[error("Entity extraction failed: {0}")] ExtractionFailed(String), #[error("Transaction failed: {0}")] TransactionFailed(String), } pub fn current_time() -> chrono::NaiveDateTime { chrono::Local::now().naive_local() } #[async_trait] pub trait DbProvider: Send + Sync { async fn save_state_info(&self, state_meta: &DicomStateMeta) -> Result<(), DbError>; async fn save_state_list(&self, state_meta: &[DicomStateMeta]) -> Result<(), DbError>; async fn save_json_list(&self, state_meta: &[DicomJsonMeta]) -> Result<(), DbError>; async fn get_state_metaes( &self, tenant_id: &str, study_uid: &str, ) -> Result<Vec<DicomStateMeta>, DbError>; /* * 获取需要生成JSON格式的Metadata的序列信息. * end_time: 截止时间. */ async fn get_json_metaes(&self, end_time: chrono::NaiveDateTime) -> Result<Vec<DicomStateMeta>, DbError>; async fn get_json_meta(&self, tenant_id:&str, study_uid: &str, series_uid: &str)->Result<DicomJsonMeta, DbError>; } 实现 3.1 MySQL数据库实现 ...

November 20, 2025