From 280587a265e21a2d67b0aaea08f3ea7b976a641b Mon Sep 17 00:00:00 2001 From: Simon Birkholz Date: Fri, 11 Apr 2025 12:37:17 +0200 Subject: [PATCH] Allow the viewer to return ImageData that is not uint8 --- cuvis/Viewer.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cuvis/Viewer.py b/cuvis/Viewer.py index 5e7c0df..395b2b6 100644 --- a/cuvis/Viewer.py +++ b/cuvis/Viewer.py @@ -42,11 +42,9 @@ def _create_view_data(self, new_handle: int) -> Union[dict[str, ImageData], Imag new_handle, i, view_data): raise SDKException() - if view_data.data.format == CUVIS_imbuffer_format["imbuffer_format_uint8"]: - view_array[view_data.id] = ImageData(img_buf=view_data.data, - dformat=view_data.data.format) - else: - raise SDKException("Unsupported viewer bit depth!") + view_array[view_data.id] = ImageData(img_buf=view_data.data, + dformat=view_data.data.format) + if len(view_array.keys()) == 1: # if only one value is available, do not wrap in dictionary return list(view_array.values())[0]