spatialdata-plot
spatialdata-plot copied to clipboard
Images with alpha channel being plotted incorrectly
Hey! I've come across an issue when trying to plot some images where one of the channels is an alpha level. This is a visium image that was submitted to cellxgene.
sdata.pl.render_images().pl.show("d551b400-b2e5-454d-b5a9-ece03e6b4739")
As you can see, this looks quite funny. I don't think it's an issue with the image, since plotting it through other routes appears normal:
Plotting with matplotlib
import matplotlib.pyplot as plt
img = sdata.images["d551b400-b2e5-454d-b5a9-ece03e6b4739_library"].compute()
plt.imshow(img.transpose("y", "x", "c"))
Plotting with squidpy
from spatialdata_io.experimental import from_legacy_anndata, to_legacy_anndata
import squidpy as sq
adata = to_legacy_anndata(sdata, include_images=True)
sq.pl.spatial_scatter(adata)
It seems to me like the alpha level is being misinterpreted in spatialdata_plot.