Skip to content

Conversation

@MMelQin
Copy link
Collaborator

@MMelQin MMelQin commented Nov 20, 2025

This pull request adds a custom pydicom decoder plugin using NVIDIA's nvImageCodec library to accelerate DICOM image decompression for various JPEG and JPEG2000 transfer syntaxes.

Key Changes:

  • Implements a new decoder plugin in decoder_nvimgcodec.py supporting 9 DICOM transfer syntaxes (JPEG Baseline, Extended, Lossless, JPEG2000, and HTJ2K variants)
  • Integrates the decoder into DICOMSeriesToVolumeOperator to automatically register the plugin during initialization
  • Exposes the decoder module through the operators package interface

Special note on testing:

The approach for testing is to compare the decoded pixel values from nvImgCodec against those from the built-in decoders, be it GDCM, libjpeg or else, essentially measuring against the known good ones.
The unit tests have confirmed that for all the supported syntaxes the decoded pixels by nvImgCodec match those from the existing pydicom default decoders.

Performance:
Performance testing was also carried out using a function included in the test module. Again, test dcm files are from the pydicom package and the results show overall latency reduction with nvImgCodec as back end. It's worth noting that with multi-frame dicom pixel data, more reduction is observed, and would be more with more custom processing batching pixel data from multiple instances
results.md

@MMelQin MMelQin requested a review from Copilot November 20, 2025 16:25
Copilot finished reviewing on behalf of MMelQin November 20, 2025 16:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds GPU-accelerated DICOM image decompression capabilities using NVIDIA's nvImageCodec library. The implementation creates a custom pydicom decoder plugin that supports 9 JPEG and JPEG2000 transfer syntaxes, automatically registering during the DICOMSeriesToVolumeOperator initialization.

  • Implements a new decoder plugin module (decoder_nvimgcodec.py) that integrates with pydicom's pixels backend
  • Automatically registers the decoder plugin when creating DICOMSeriesToVolumeOperator instances
  • Exposes the decoder module through the operators package interface

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 12 comments.

File Description
monai/deploy/operators/decoder_nvimgcodec.py New module implementing nvImageCodec-based decoder plugin with functions for availability checking, frame decoding, plugin registration, and helper utilities for module path resolution
monai/deploy/operators/dicom_series_to_volume_operator.py Integrates decoder plugin by importing the module and calling registration during operator initialization
monai/deploy/operators/__init__.py Exposes the decoder module through package imports and adds it to __all__ list

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

MMelQin and others added 21 commits December 3, 2025 11:50
Signed-off-by: M Q <[email protected]>
Signed-off-by: M Q <[email protected]>
Signed-off-by: M Q <[email protected]>
Signed-off-by: M Q <[email protected]>
Signed-off-by: M Q <[email protected]>
Signed-off-by: M Q <[email protected]>
Signed-off-by: M Q <[email protected]>
Signed-off-by: M Q <[email protected]>
* Fix handling of JPEG color space
* Added JPEG2000 precision support
* Updates PhotometricInterpretation to RGB when color space conversion is applied

Passes all JPEG, JPEG2000 and HTJ2K tests

Signed-off-by: Joaquin Anton Guirao <[email protected]>
Signed-off-by: M Q <[email protected]>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 4, 2025

@MMelQin MMelQin requested review from bluna301 and chezhia December 4, 2025 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants