Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion monai/data/image_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,12 @@ def resolve_writer(ext_name, error_if_not_found=True) -> Sequence:
except Exception: # other writer init errors indicating it exists
avail_writers.append(_writer)
if not avail_writers and error_if_not_found:
raise OptionalImportError(f"No ImageWriter backend found for {fmt}.")
_supported = ", ".join(sorted(SUPPORTED_WRITERS.keys()))
raise OptionalImportError(
f"No ImageWriter backend found for {fmt}. "
f"Supported formats: {_supported}. "
f"Please install a suitable package such as 'nibabel', 'itk', or 'Pillow'."
)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
writer_tuple = ensure_tuple(avail_writers)
SUPPORTED_WRITERS[fmt] = writer_tuple
return writer_tuple
Expand Down
Loading