Skip to content

Commit 4af92f5

Browse files
committed
changed default from PCA to stack
1 parent 7712eb2 commit 4af92f5

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/spatialdata_plot/pl/basic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ def render_images(
468468
palette: list[str] | str | None = None,
469469
alpha: float | int = 1.0,
470470
scale: str | None = None,
471-
multichannel_strategy: str = "pca",
471+
multichannel_strategy: str = "stack",
472472
bg_threshold: float = 1e-4,
473473
**kwargs: Any,
474474
) -> sd.SpatialData:
@@ -512,10 +512,10 @@ def render_images(
512512
3) "full": Renders the full image without rasterization. In the case of
513513
multiscale images, the highest resolution scale is selected. Note that
514514
this may result in long computing times for large images.
515-
multichannel_strategy : str, default "pca"
515+
multichannel_strategy : str, default "stack"
516516
Method for rendering images with more than 3 channels.
517-
"pca": Uses PCA to reduce the number of channels to 3.
518517
"stack": Samples categorical colors and stacks the channels.
518+
"pca": Uses PCA to reduce the number of channels to 3.
519519
bg_threshold : float, default 1e-4
520520
Threshold below which values are considered background in the PCA dimred for images with 3+ channels.
521521
kwargs

src/spatialdata_plot/pl/render.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,7 @@ def _render_images(
846846
else:
847847
layers = {}
848848
for ch_idx, ch in enumerate(channels):
849+
print(channels, ch)
849850
layers[ch_idx] = img.sel(c=ch).copy(deep=True).squeeze()
850851
if isinstance(render_params.cmap_params, list):
851852
ch_norm = render_params.cmap_params[ch_idx].norm

src/spatialdata_plot/pl/render_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class ImageRenderParams:
125125
percentiles_for_norm: tuple[float | None, float | None] = (None, None)
126126
scale: str | None = None
127127
zorder: int = 0
128-
multichannel_strategy: str = "pca"
128+
multichannel_strategy: str = "stack"
129129
bg_threshold: float = 1e-4
130130

131131

0 commit comments

Comments
 (0)