MONAI icon indicating copy to clipboard operation
MONAI copied to clipboard

Print what package should be installed when suitable writer is missing

Open holgerroth opened this issue 1 year ago • 6 comments

Is your feature request related to a problem? Please describe. I used SaveImage(..., output_ext=".png") but got this error message

monai.utils.module.OptionalImportError: No ImageWriter backend found for png.

This was after pip install monai in a clean environment.

Describe the solution you'd like It would be great if the error message would include a description of how to fix the issue, e..g. "Please install pillow". Initially I installed simpleitk which also didn't have the png writer apparently, and I got the same error.

Describe alternatives you've considered n/a

Additional context Happened with monai==1.3.2

holgerroth avatar Aug 01 '24 16:08 holgerroth

Same would apply for LoadImage and image readers for different formats

holgerroth avatar Aug 01 '24 16:08 holgerroth

Hi, can i work on this issue? I'm a beginner and i'm a self learner.

Matteoilgiaco avatar Sep 30 '25 12:09 Matteoilgiaco

Hi @Matteoilgiaco , that would be great! Thanks for your interest in contributing to MONAI.

holgerroth avatar Sep 30 '25 13:09 holgerroth

Can i work on this issue. if the issue resolved can i add on my resume as contribution

iloveme81189-del avatar Oct 12 '25 17:10 iloveme81189-del

@iloveme81189-del. Please coordinate with @Matteoilgiaco. Maybe you two can collaborate on this task?

holgerroth avatar Oct 12 '25 19:10 holgerroth

Hi, I’ve submitted a fix for this issue in PR #8625. The PR adds a clearer error message when SaveImage can’t find a suitable writer and points users to the package they need to install (e.g. Pillow). Please take a look when you have a moment.

songhahaha66 avatar Nov 05 '25 14:11 songhahaha66