From 4395b6ebf253bf4848d97ff327d48a9d1a748982 Mon Sep 17 00:00:00 2001 From: Francesco Padovani Date: Wed, 20 Nov 2024 12:20:13 +0100 Subject: [PATCH] fix: correctly check if time dim is needed in preComputedMinMaxValues --- cellacdc/widgets.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cellacdc/widgets.py b/cellacdc/widgets.py index e2bd7321..feb3cc03 100755 --- a/cellacdc/widgets.py +++ b/cellacdc/widgets.py @@ -6313,9 +6313,13 @@ def preComputedMinMaxValues(self, data: dict): self.minMaxValuesMapper = {} for pos_i, posData in enumerate(data): img_data = posData.img_data - if posData.img_data.ndim == 2: + requires_time_dim = ( + posData.img_data.ndim == 2 + or (posData.img_data.ndim == 3 and posData.SizeZ > 1) + ) + if requires_time_dim: img_data = (img_data,) - + for frame_i, image in enumerate(img_data): if image.ndim == 2: image = (image,)