From b37a710ab3043ec4bc6c2e5d847a0356cf5ac278 Mon Sep 17 00:00:00 2001 From: Tim Treis Date: Tue, 29 Aug 2023 17:10:43 +0200 Subject: [PATCH 1/2] Disabled default normalisation --- src/spatialdata_plot/pl/basic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spatialdata_plot/pl/basic.py b/src/spatialdata_plot/pl/basic.py index 20c49d38..51839213 100644 --- a/src/spatialdata_plot/pl/basic.py +++ b/src/spatialdata_plot/pl/basic.py @@ -306,7 +306,7 @@ def render_images( na_color: str | tuple[float, ...] | None = (0.0, 0.0, 0.0, 0.0), palette: ListedColormap | str | None = None, alpha: float = 1.0, - quantiles_for_norm: tuple[float | None, float | None] = (3.0, 99.8), # defaults from CSBDeep + quantiles_for_norm: tuple[float | None, float | None] = (None, None), **kwargs: Any, ) -> sd.SpatialData: """ From 9ebe0cca16676d8de2754853c7c6ca320fd21bb6 Mon Sep 17 00:00:00 2001 From: Tim Treis Date: Tue, 29 Aug 2023 17:16:28 +0200 Subject: [PATCH 2/2] Removed default numeric values from remaining locations --- src/spatialdata_plot/pl/render.py | 2 +- src/spatialdata_plot/pl/utils.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/spatialdata_plot/pl/render.py b/src/spatialdata_plot/pl/render.py index a08016ff..62ad0dce 100644 --- a/src/spatialdata_plot/pl/render.py +++ b/src/spatialdata_plot/pl/render.py @@ -377,7 +377,7 @@ class ImageRenderParams: channel: list[str] | list[int] | int | str | None = None palette: ListedColormap | str | None = None alpha: float = 1.0 - quantiles_for_norm: tuple[float | None, float | None] = (3.0, 99.8) # defaults from CSBDeep + quantiles_for_norm: tuple[float | None, float | None] = (None, None) def _render_images( diff --git a/src/spatialdata_plot/pl/utils.py b/src/spatialdata_plot/pl/utils.py index 8678d5c0..ee9e6541 100644 --- a/src/spatialdata_plot/pl/utils.py +++ b/src/spatialdata_plot/pl/utils.py @@ -613,8 +613,8 @@ def _get_hex_colors_for_continous_values(values: pd.Series, cmap_name: str = "vi def _normalize( img: xr.DataArray, - pmin: float | None = 3.0, - pmax: float | None = 99.8, + pmin: float | None = None, + pmax: float | None = None, eps: float = 1e-20, clip: bool = False, name: str = "normed",