|
PACS System 0.1.0
PACS DICOM system library
|
Language: English | 한국어
A modern C++20 PACS (Picture Archiving and Communication System) implementation built entirely on the kcenon ecosystem without external DICOM libraries. This project implements the DICOM standard from scratch, leveraging the existing high-performance infrastructure.
Key Characteristics:
Current Phase: ✅ Phase 4 Complete - Advanced Services & Production Hardening
| Phase | Scope | Status |
|---|---|---|
| Phase 1: Foundation | DICOM Core, Tag Dictionary, File I/O (Part 10), Transfer Syntax | ✅ Complete |
| Phase 2: Network Protocol | Upper Layer Protocol (PDU), Association State Machine, DIMSE-C, Compression Codecs | ✅ Complete |
| Phase 3: Core Services | Storage SCP/SCU, File Storage, Index Database, Query/Retrieve, Logging, Monitoring | ✅ Complete |
| Phase 4: Advanced Services | REST API, DICOMweb, AI Integration, Client Module, Cloud Storage, Print Management, Security, Workflow, Annotation/Viewer | ✅ Complete |
Test Coverage: 1,980+ tests passing across 141+ test files |
For detailed feature lists per phase, see Features.
| Service | SOP Class | Status |
|---|---|---|
| Verification | 1.2.840.10008.1.1 | ✅ Complete |
| CT Storage | 1.2.840.10008.5.1.4.1.1.2 | ✅ Complete |
| MR Storage | 1.2.840.10008.5.1.4.1.1.4 | ✅ Complete |
| US Storage | 1.2.840.10008.5.1.4.1.1.6.x | ✅ Complete |
| XA Storage | 1.2.840.10008.5.1.4.1.1.12.x | ✅ Complete |
| XRF Storage | 1.2.840.10008.5.1.4.1.1.12.2 | ✅ Complete |
| X-Ray Storage | 1.2.840.10008.5.1.4.1.1.1.1 | ✅ Complete |
| Patient Root Q/R | 1.2.840.10008.5.1.4.1.2.1.x | ✅ Complete |
| Study Root Q/R | 1.2.840.10008.5.1.4.1.2.2.x | ✅ Complete |
| Modality Worklist | 1.2.840.10008.5.1.4.31 | ✅ Complete |
| MPPS | 1.2.840.10008.3.1.2.3.3 | ✅ Complete |
| Storage Commitment | 1.2.840.10008.1.20.1 | ✅ Complete |
| NM Storage | 1.2.840.10008.5.1.4.1.1.20 | ✅ Complete |
| PET Storage | 1.2.840.10008.5.1.4.1.1.128 | ✅ Complete |
| RT Storage | 1.2.840.10008.5.1.4.1.1.481.x | ✅ Complete |
| SR Storage | 1.2.840.10008.5.1.4.1.1.88.x | ✅ Complete |
| SEG Storage | 1.2.840.10008.5.1.4.1.1.66.4 | ✅ Complete |
| MG Storage | 1.2.840.10008.5.1.4.1.1.1.2.x | ✅ Complete |
| CR Storage | 1.2.840.10008.5.1.4.1.1.1 | ✅ Complete |
| SC Storage | 1.2.840.10008.5.1.4.1.1.7 | ✅ Complete |
| Basic Grayscale Print | 1.2.840.10008.5.1.1.9 | ✅ Complete |
| Basic Color Print | 1.2.840.10008.5.1.1.18 | ✅ Complete |
| Printer | 1.2.840.10008.5.1.1.16 | ✅ Complete |
| Transfer Syntax | UID | Status |
|---|---|---|
| Implicit VR Little Endian | 1.2.840.10008.1.2 | ✅ Complete |
| Explicit VR Little Endian | 1.2.840.10008.1.2.1 | ✅ Complete |
| Explicit VR Big Endian | 1.2.840.10008.1.2.2 | ✅ Complete |
| JPEG Baseline (Process 1) | 1.2.840.10008.1.2.4.50 | ✅ Complete |
| JPEG Lossless (Process 14) | 1.2.840.10008.1.2.4.70 | ✅ Complete |
| JPEG 2000 Lossless | 1.2.840.10008.1.2.4.90 | ✅ Complete |
| JPEG 2000 Lossy | 1.2.840.10008.1.2.4.91 | ✅ Complete |
| JPEG-LS Lossless | 1.2.840.10008.1.2.4.80 | ✅ Complete |
| JPEG-LS Near-Lossless | 1.2.840.10008.1.2.4.81 | ✅ Complete |
| RLE Lossless | 1.2.840.10008.1.2.5 | ✅ Complete |
For the full DICOM Conformance Statement, see DICOM Conformance Statement.
| Feature | Default | Description | Pulls In | Prerequisites |
|---|---|---|---|---|
| aws | off | AWS S3 integration for cloud-based PACS storage | aws-sdk-cpp (S3) | – |
| azure | off | Azure Blob storage integration for cloud-based PACS storage | azure-storage-blobs-cpp | – |
| codecs | off | Image compression codecs (JPEG, JPEG 2000, HTJ2K, JPEG-LS, PNG) | libjpeg-turbo, openjpeg, charls, openjph, libpng | – |
| rest-api | off | DICOMweb REST API via Crow HTTP framework | crow | – |
| ssl | off | TLS/SSL support for secure DICOM associations | openssl | – |
| storage | off | SQLite3-based PACS storage and indexing | sqlite3 | – |
| testing | off | Unit tests and benchmarks | gtest, benchmark | – |
vcpkg install kcenon-pacs-systemvcpkg install kcenon-pacs-system[storage,ssl]vcpkg install kcenon-pacs-system[storage,codecs,ssl,rest-api]vcpkg install kcenon-pacs-system[storage,codecs,ssl,aws,rest-api]All Platforms:
Linux (Ubuntu 24.04+):
macOS:
Windows:
sqlite3, openssl, fmt, gtestTest Results: 1,980+ tests passing across 141+ test files (Core, Encoding, Network, Services, Storage, Security, Web, Workflow, Client, AI, Monitoring, Integration)
In your CMakeLists.txt:
When writing code for Windows compatibility, wrap std::min and std::max calls in parentheses to prevent conflicts with Windows.h macros:
The project includes 32 example applications. Build them with:
| Category | Tool | Description |
|---|---|---|
| File Utilities | dcm_dump | Inspect DICOM file metadata |
dcm_info | Display DICOM file summary | |
dcm_modify | Modify DICOM tags (dcmtk-compatible) | |
dcm_conv | Convert Transfer Syntax | |
dcm_anonymize | De-identify DICOM files (PS3.15) | |
dcm_dir | Create/manage DICOMDIR (PS3.10) | |
dcm_to_json | Convert DICOM to JSON (PS3.18) | |
json_to_dcm | Convert JSON to DICOM (PS3.18) | |
dcm_to_xml | Convert DICOM to XML (PS3.19) | |
xml_to_dcm | Convert XML to DICOM (PS3.19) | |
img_to_dcm | Convert JPEG images to DICOM | |
dcm_extract | Extract pixel data to image formats | |
db_browser | Browse PACS index database | |
| Network | echo_scu / echo_scp | DICOM connectivity verification |
secure_dicom | TLS-secured DICOM Echo SCU/SCP | |
store_scu / store_scp | DICOM Storage (C-STORE) | |
query_scu | Query client (C-FIND) | |
find_scu | dcmtk-compatible C-FIND SCU | |
retrieve_scu | Retrieve client (C-MOVE/C-GET) | |
move_scu | dcmtk-compatible C-MOVE SCU | |
get_scu | dcmtk-compatible C-GET SCU | |
print_scu | Print Management client (PS3.4 Annex H) | |
| Servers | qr_scp | Query/Retrieve SCP (C-FIND/C-MOVE/C-GET) |
worklist_scu / worklist_scp | Modality Worklist (MWL) | |
mpps_scu / mpps_scp | Modality Performed Procedure Step | |
pacs_server | Full PACS server with configuration | |
| Testing | integration_tests | End-to-end workflow tests |
Verify DICOM connectivity:
Send a DICOM file:
Query studies by patient name:
Inspect a DICOM file:
For complete CLI documentation with all options, see CLI Reference.
Ecosystem reference: common_system — Tier 0: Result<T>, IExecutor, event bus container_system — Tier 1: DICOM data serialization thread_system — Tier 1: Thread pool (via network_system) logger_system — Tier 2: Logging infrastructure (via network_system) monitoring_system — Tier 3: Metrics and observability (optional) network_system — Tier 4: TCP/TLS transport for DICOM database_system — Tier 3: Database abstraction (optional)
For the complete IEC 62304 SOUP register with versions, licenses, and safety classifications, see docs/SOUP.md.
This project leverages the following kcenon ecosystem components:
| System | Purpose | Key Features |
|---|---|---|
| common_system | Foundation interfaces | IExecutor, Result<T>, Event Bus |
| container_system | Data serialization | Type-safe values, SIMD acceleration |
| thread_system | Concurrency | Thread pools, lock-free queues |
| logger_system | Logging | Async logging, 4.34M msg/s |
| monitoring_system | Observability | Metrics, distributed tracing |
| network_system | Network I/O | TCP/TLS, async operations |
| database_system | Database abstraction | SQL injection prevention, multi-DB support (Optional) |
| Module | Location | Description |
|---|---|---|
| Core | include/pacs/core/ | DICOM tags, elements, datasets, Part 10 file I/O, tag dictionary |
| Encoding | include/pacs/encoding/ | VR types, transfer syntaxes, compression codecs (JPEG, JP2K, JPLS, RLE) |
| Network | include/pacs/network/ | PDU encoding/decoding, association state machine, DIMSE protocol |
| Services | include/pacs/services/ | SCP/SCU implementations, SOP class registry, IOD validators |
| Storage | include/pacs/storage/ | File storage, SQLite indexing, cloud storage (S3/Azure), HSM |
| Security | include/pacs/security/ | RBAC, anonymization (PS3.15), digital signatures, TLS |
| Monitoring | include/pacs/monitoring/ | Health checks, Prometheus metrics |
| Web | include/pacs/web/ | REST API (Crow), DICOMweb (WADO/STOW/QIDO) |
| Client | include/pacs/client/ | Job, routing, sync, prefetch, remote node management |
| Workflow | include/pacs/workflow/ | Auto prefetch, task scheduler, study lock manager |
| AI | include/pacs/ai/ | AI service connector, result handler (SR/SEG) |
| Integration | include/pacs/integration/ | Ecosystem adapters (container, network, thread, logger, monitoring) |
For the full file-level directory tree, see Project Structure.
PACS System provides C++20 module support as an alternative to the header-based interface.
| Module | Contents |
|---|---|
kcenon.pacs | Primary module (imports all partitions) |
kcenon.pacs:core | Core DICOM data structures and utilities |
kcenon.pacs:network | DICOM network protocol (DIMSE) |
kcenon.pacs:storage | DICOM file storage and retrieval |
kcenon.pacs:encoding | Transfer syntax and codec support |
kcenon.pacs:services | DICOM service implementations (C-STORE, C-FIND, etc.) |
kcenon.pacs:security | TLS and authentication |
kcenon.pacs:web | DICOMweb REST API |
kcenon.pacs:workflow | Workflow management |
Note: C++20 modules are experimental. The header-based interface remains the primary API.
Database Integration:
The PACS system leverages the thread_system library for high-performance concurrent operations. The thread system migration (Epic #153) has been successfully completed, replacing all direct std::thread usage with modern C++20 abstractions including jthread support and cancellation tokens. See PERFORMANCE_RESULTS.md for detailed benchmark results and MIGRATION_COMPLETE.md for the migration summary.
| Metric | Result |
|---|---|
| Association Latency | < 1 ms |
| C-ECHO Throughput | 89,964 msg/s |
| C-STORE Throughput | 31,759 store/s |
| Concurrent Operations | 124 ops/s (10 workers) |
| Graceful Shutdown | 110 ms (with active connections) |
| Data Rate (512x512) | 9,247 MB/s |
| Metric | Value |
|---|---|
| Header Files | 282 files |
| Source Files | 204 files |
| Header LOC | ~76800 lines |
| Source LOC | ~110100 lines |
| Example LOC | ~35700 lines |
| Test LOC | ~85300 lines |
| Total LOC | ~307800 lines |
| Test Files | 180 files |
| Test Cases | 2584+ tests |
| Example Programs | 32 apps |
| Documentation | 83 markdown files |
| CI/CD Workflows | 14 workflows |
| Version | 0.1.0 |
| Last Updated | 2026-04-09 |
Contributions are welcome! Please read our contributing guidelines before submitting pull requests.
This project is licensed under the BSD 3-Clause License - see the [LICENSE](LICENSE) file for details.
Made with ❤️ by 🍀☀🌕🌥 🌊