From 7a57201ca327ac964375f7b79452f9b8e4e628ab Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Thu, 3 Oct 2024 12:13:39 +0200 Subject: [PATCH] fixed dtype of "roi_intensities_normalised" if threshold_value != "NaN" --- dap/algos/roi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dap/algos/roi.py b/dap/algos/roi.py index e144370..451416b 100644 --- a/dap/algos/roi.py +++ b/dap/algos/roi.py @@ -37,7 +37,7 @@ def calc_roi(results, data, pixel_mask_pf): roi_area = (ix2 - ix1) * (iy2 - iy1) roi_sum_norm = roi_sum / roi_area else: - roi_sum_norm = np.nanmean(data_roi) + roi_sum_norm = np.nanmean(data_roi, dtype=float) # data_roi is np.float32, which cannot be json serialized roi_indices_x = [ix1, ix2] roi_proj_x = np.nansum(data_roi, axis=0).tolist()