Skip to content

Conversation

@MMelQin
Copy link
Collaborator

@MMelQin MMelQin commented Oct 9, 2022

This PR is to:

  • split from the existing text SR writer the dicom_utils module for reusable classes and function, e.g. equipment info, model info, DICOM common module writer for study, patient, SOP commons, etc.
  • the DICOM Text Writer becomes much smaller and clearer to read
  • the DICOM Encapsulated PDF write is added with minimal amount of code. This new writer take in either PDF bytes or a file path to load byte from, optionally with a DICOM Series for copying study level tags, and writes the DICOM Encapsulated PDF instance file. The loaded PDF in bytes are validated for being PDF with the use of PyPDF2
  • the app that uses the Text SR writer, mednist classification, is updated with simple change. This app is also used as the tester, even though the writers have test function for testing the operator standalone
  • the license for the third party PyPDF2 is added

By the way, the SonarCloud failures are false positives, on some bogus code duplication findings. I have reviewed them and marking them as info.

Screenshot of the DICOM Text SR and Encapsulated PDF viewed in MicroDICOM:

image

image

Screenshot of actual PDF opened from MicroDICOM
image

Signed-off-by: M Q mingmelvinq@nvidia.com

Signed-off-by: M Q <mingmelvinq@nvidia.com>
@MMelQin MMelQin changed the title Created dicom_utils for common obj and func, and added DICOM PDF Writer Add DICOM PDF Writer and split dicom_utils common module out of Text SR Writer Oct 9, 2022
Signed-off-by: M Q <mingmelvinq@nvidia.com>
Signed-off-by: M Q <mingmelvinq@nvidia.com>
Signed-off-by: M Q <mingmelvinq@nvidia.com>
@MMelQin MMelQin self-assigned this Oct 9, 2022
@MMelQin MMelQin added the enhancement New feature or request label Oct 9, 2022
Signed-off-by: M Q <mingmelvinq@nvidia.com>
Signed-off-by: M Q <mingmelvinq@nvidia.com>
Signed-off-by: M Q <mingmelvinq@nvidia.com>
Signed-off-by: M Q <mingmelvinq@nvidia.com>
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

No Coverage information No Coverage information
7.1% 7.1% Duplication

@MMelQin
Copy link
Collaborator Author

MMelQin commented Oct 13, 2022

Reviewed off-line.

@MMelQin MMelQin merged commit 9fa416d into main Oct 13, 2022
@MMelQin MMelQin deleted the mqin/DICOM_Encapsulated_PDF_issue_362 branch March 17, 2023 20:58
SimoneBendazzoli93 pushed a commit to SimoneBendazzoli93/monai-deploy-app-sdk that referenced this pull request Jul 17, 2025
…SR Writer (Project-MONAI#366)

* Created dicom_utils for common obj and func, and added DICOM PDF Writer

Signed-off-by: M Q <mingmelvinq@nvidia.com>

* Formatting update

Signed-off-by: M Q <mingmelvinq@nvidia.com>

* Fix flake8 complaints

Signed-off-by: M Q <mingmelvinq@nvidia.com>

* Address mypy complaints

Signed-off-by: M Q <mingmelvinq@nvidia.com>

* Formatting

Signed-off-by: M Q <mingmelvinq@nvidia.com>

* Change to use full path of dicom_utils

Signed-off-by: M Q <mingmelvinq@nvidia.com>

* Replace Union with Optional

Signed-off-by: M Q <mingmelvinq@nvidia.com>

* Replace unused Union

Signed-off-by: M Q <mingmelvinq@nvidia.com>

* Update the year in the copyright notice

Signed-off-by: M Q <mingmelvinq@nvidia.com>

Signed-off-by: M Q <mingmelvinq@nvidia.com>
Signed-off-by: Simone Bendazzoli <simben@kth.se>
SimoneBendazzoli93 pushed a commit to SimoneBendazzoli93/monai-deploy-app-sdk that referenced this pull request Jul 17, 2025
…SR Writer (Project-MONAI#366)

* Created dicom_utils for common obj and func, and added DICOM PDF Writer

Signed-off-by: M Q <mingmelvinq@nvidia.com>

* Formatting update

Signed-off-by: M Q <mingmelvinq@nvidia.com>

* Fix flake8 complaints

Signed-off-by: M Q <mingmelvinq@nvidia.com>

* Address mypy complaints

Signed-off-by: M Q <mingmelvinq@nvidia.com>

* Formatting

Signed-off-by: M Q <mingmelvinq@nvidia.com>

* Change to use full path of dicom_utils

Signed-off-by: M Q <mingmelvinq@nvidia.com>

* Replace Union with Optional

Signed-off-by: M Q <mingmelvinq@nvidia.com>

* Replace unused Union

Signed-off-by: M Q <mingmelvinq@nvidia.com>

* Update the year in the copyright notice

Signed-off-by: M Q <mingmelvinq@nvidia.com>

Signed-off-by: M Q <mingmelvinq@nvidia.com>
Signed-off-by: Simone Bendazzoli <simben@kth.se>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEA]Create DICOM Encapsulated PDF object with provided bytes of a PDF file

2 participants