Skip to content

render_images rescaling issue with unit16 data #507

@sophiamaedler

Description

@sophiamaedler

I am trying to render an image layer using spatialdata plot:

from spatialdata import read_zarr
import spatialdata_plot 
import matplotlib.pyplot as plt

sdata = read_zarr("test_sdata.zarr")

fig, axs = plt.subplots(1, 2, figsize=(10, 5))
sdata.pl.render_images("input_image", channel=["Hoechst", "Alexa488"]).pl.show(ax = axs[0])
sdata.pl.render_images("input_image", channel="Hoechst").pl.show(ax = axs[1])

Single-channel images work as expected but on multi-channel overviews the scaling of my data is changed. I suspect this is a result of my data being stored as unit16.

Image

I previously plotted the same data (its part of our testing data) without issues in older spatialdata plot versions (0.2.11) and got expected visual outputs. I am seeing the issues in the newer releases (currently on 0.2.13).

Image

Happy to send the test object, I can't seem to upload it unfortunately (I guess its too large).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions