Skip to content
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

Make dcm2jpg ReadImage interface or writeImage method public #1388

Open
cmolodowitch opened this issue Jan 19, 2024 · 2 comments
Open

Make dcm2jpg ReadImage interface or writeImage method public #1388

cmolodowitch opened this issue Jan 19, 2024 · 2 comments

Comments

@cmolodowitch
Copy link

I want to use the dcm2jpg tool to create a JPG file programmatically rather than via the command-line.

However, currently the only way to do so is via the static main() method. This is because both the writeImage() method and the ReadImage interface are private access. Although the setReadImage() method is public access, we can't actually use it since ReadImage is private. This means calling convert() will fail because the readImage attribute is null. And since writeImage() is also private, we can't get around the problem by calling it directly instead of using convert().

It would great if either the ReadImage interface or the writeImage() method (or both) could be made public access, as this would allow easier programmatic usage of this tool. Ideally I'd prefer the writeImage() method, as I actually need both the file and the BufferedImage object that's written to it, but being able to use the convert method would also work.

@nroduit
Copy link
Member

nroduit commented Jan 30, 2024

You can try weasis-dicom-tools which provides an API

@cmolodowitch
Copy link
Author

You can try weasis-dicom-tools which provides an API

Thanks for the suggestion! I'll take a look.

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

No branches or pull requests

2 participants