Added DICOM C-GET, C-MOVE and DICOMWeb support#6
Open
ThalesMMS wants to merge 50 commits intoOPALE-dev:masterfrom
Open
Added DICOM C-GET, C-MOVE and DICOMWeb support#6ThalesMMS wants to merge 50 commits intoOPALE-dev:masterfrom
ThalesMMS wants to merge 50 commits intoOPALE-dev:masterfrom
Conversation
Fixed issue with DcmSwift handing 12-bit data. Refactors DicomImage to provide a unified image(forFrame:wwl:inverted:) method for both macOS and iOS, supporting window/level adjustment and inversion for monochrome images. Adds a new renderFrame method for accurate grayscale rendering, handles both compressed and uncompressed images, and improves code clarity and maintainability. Also updates PhotometricInterpretation to be a String-backed enum.
…-and-add-tests feat: expose ROI measurement service
…nc-support Add asynchronous DicomTool utilities
…r-methods Add window level calculator with modality presets and conversions
…arge-images Add concurrent 16-bit image processing fallback
…use-for-images feat: reuse drawing context and cache processed image
…functions Optimize pixel processing and translate comments
Introduces OPTIMIZATION_REVIEW.md summarizing integrated and missing optimizations in DcmSwift. Refactors DicomTool.swift to remove dependency on DicomServiceProtocol, implements direct DICOM decoding and display logic, improves window/level handling, and adds utility methods for pixel data extraction and validation.
Replaces DCMImgView with DicomPixelView and migrates all image rendering logic into DcmSwift/Graphics, introducing Metal-based GPU acceleration (MetalAccelerator, MetalShaders, Shaders.metal). Removes legacy References files, updates documentation and usage examples, and adds PixelService. Updates networking and data handling for improved performance and reliability. Package.swift now includes Metal shader resources.
…du-dicom Ensure C-FIND PDVs and text padding follow DICOM
…tion-for-performance Optimize Metal window-level pipeline for better parallelism
Refactored C-FIND request handling to send command and dataset in separate PDUs, and updated response parsing for fragmented datasets. Fixed AE title padding to use spaces instead of nulls. Enhanced UserInfo PDU construction to include Implementation UID and Version. Added test scripts for C-FIND and C-ECHO operations.
…ations-implementation Fix dataset flags and group length for C-MOVE and C-GET RQ
…ion-for-performance-ibb8h2
…tion-for-performance-ibb8h2 Optimize Metal window-level pipeline for better parallelism
…coder-and-dcmimgview
…coder-and-dcmimgview-056qdh Use memory-mapped Data for faster input streams
…es-and-progress Stream pixel frames and reuse Metal buffers for GPU windowing
…currency Refactor windowing with Swift concurrency
…r-mtlbuffers feat: add Metal buffer cache and RGB support
…s-using-vdsp Optimize window/level with vDSP
…ata-reading feat: stream DICOM pixel data fragments
Replaces async/await task groups with DispatchQueue.concurrentPerform for concurrent window/level and LUT application, improving performance and compatibility. Updates DicomPixelView to use background tasks for 8-bit window/level processing, with fallback for older OS versions. Refines Accelerate usage for type conversion, and updates Metal shader and dispatch logic to support variable output components and more robust threadgroup handling.
Refactors CFindRQ to send both the command and dataset together in a single P-DATA-TF PDU, updating CommandDataSetType handling per DICOM PS 3.7. Adds a unit test to verify correct PDV packing and CommandDataSetType values.
Enhances DIMSE C-GET and C-STORE handling to support correct PDV packing, multi-fragment C-STORE sub-operations, and robust file saving with proper Part-10 meta headers. Adds support for more DICOM modalities, improves memory management for large files, and fixes presentation context selection for responses. Includes new tests for C-GET DIMSE packing and DataTF status handling, and improves QIDOClient modality query logic.
The README has been rewritten to provide a comprehensive overview of DcmSwift, including GPU-accelerated image processing, full networking (DIMSE and DICOMweb), performance optimizations, and production readiness. It now details key features, architecture, benchmarks, main APIs, integration steps, and command-line tool usage, offering clearer guidance for developers and highlighting the library's capabilities and requirements.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces support for C-MOVE and C-GET DIMSE services, and adds a new module for DICOMweb WADO-RS communication. These changes extend the library's networking capabilities to cover additional query/retrieve workflows.
Summary of Additions:
New DIMSE Services:
C-MOVE SCU: Enables instructing a remote AE to initiate a C-STORE sub-operation to a specified destination.
C-GET SCU: Enables retrieving DICOM objects directly over the request association via C-STORE sub-operations.
DICOMweb (WADO-RS) Module:
A new networking stack for DICOMweb has been added, using
URLSessionand Swift'sasync/await.This allows for retrieving DICOM objects (studies, series, instances) from RESTful DICOMweb servers.
Implementation Details:
1. C-MOVE and C-GET Implementation
New
ServiceClassUserclassesCMoveSCU.swiftandCGetSCU.swifthave been added to manage the client-side logic.The corresponding DIMSE messages (
CMoveRQ/RSP,CGetRQ/RSP) are now implemented, including handling for sub-operation counters.New command-line executables,
DcmMoveandDcmGet, have been added for direct use and testing of these services.2. DICOMweb (WADO-RS) Implementation
The new DICOMweb module is structured as follows:
DICOMWebClient.swift: A base client for handling HTTP requests and authentication (Basic, Bearer Token).MultipartParser.swift: A new utility to parsemultipart/relatedresponses, which is necessary for WADO-RS. It correctly identifies boundaries and extracts each DICOM part from the response body.WADOClient.swift: Implements the WADO-RS specification, providing high-level methods to retrieve studies, series, and instances. It uses theMultipartParserto decode the server's response intoDicomFileobjects.DICOMWebService.swift: A facade that provides a simplified API for using the DICOMweb services.How to Test:
Testing DIMSE Services (C-MOVE / C-GET)
Requires a PACS that supports the Query/Retrieve Service Class.
C-MOVE Example:
C-GET Example:
Testing DICOMweb (WADO-RS)
Requires a DICOMweb-enabled server (e.g., Orthanc, dcm4chee).
Example Swift Code: