-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEA] Support PDF report as DCM #365
Comments
Thanks @a-parida12 for the issue. We had been discussing the need of DICOM Encapsulated PDF support for a bit, and since I had already contributed reusable code, it was a matter of properly arranging the classes and create the DICOM PDF IOD with very few lines of new code. Please see the closed issue #362 and the closed pull request #366 Since content for DICOM Encapsulated PDF can come from many sources, e.g. scanned doc or dynamically created with certain template wrapping AI result, the decision was made to separate the generation of PDF from the DICOM PDF creation with the latter taking in the PDF bytes or a path to PDF file. This way, a user can create specifically formatted PDF generators for use with the App SDK writer. More flexibility, and the App SDK Please see what can be enhanced and create PR to get your contribution in the SDK. |
# pip install pdf2dcm
from pdf2dcm import Pdf2EncapsDCM
converter = Pdf2EncapsDCM()
converted_dcm = converter.run(path_pdf='tests/test_data/test_file.pdf', path_template_dcm='tests/test_data/CT_small.dcm', suffix =".dcm")
print(converted_dcm)
# [ 'tests/test_data/test_file.dcm' ] Could you please try this on the files that you internally test. |
Hi @a-parida12, I did get you package a try, and found errors (semantical or design errors, not necessarily code error).
Writing a DICOM Encapsulated PDF is super simple, once the PDF bytes or file is available. The MONAI Deploy App SDK's DICOM PDF Writer has more features in that it gives the App dev users flexibility to associating the DICOM PDF instance with existing study or in a completely new study, supports setting important tags called for by IHE Profiles, properly setting the date/time/timezone even in on-cloud execution, etc. Your implementation is a good attempt, but unfortunately does not satisfy App SDK requirements. Please use App SDK's DCOM PDF Writer. |
@MMelQin Thanks for running the analysis and pointing out the flaws in the setup. I will work on improving it on a later date. For now closing the issue as it does makes sense to keep it open. |
@a-parida12 Thank you so much for your contribution. The DICOM Encapsulated PDF in the App SDK is designed to fit into App SDK realm, so I do see your standalone package is good for general use. |
Is your feature request related to a problem? Please describe.
Most of the time we generate automatic reports in markdown format to be exported as pdf. It is possible to encapsulate the pdf inside a DCM to be stored back in the PACS/RIS systems.
Describe the solution you'd like
I have created this PyPI package (pdf2dcm)[https://github.com/a-parida12/pdf2dcm]. Wouldn't it be a good idea to integrate it within the deploy SDK to support storing PDF reports as DICOMs?
The text was updated successfully, but these errors were encountered: