-
Notifications
You must be signed in to change notification settings - Fork 81
Closed
Labels
bug 🚨Something isn't workingSomething isn't working
Description
Hey @timtreis , @LucaMarconato ,
So in the branch feature/get_extent there is the new get_extent function which should be outsourced from spatialdata-plot.
I just compared it to the _get_extent function from spatialdata-plot and it looks like both compute the same numbers but the spatialdata output has the x and y coordinates switched which seems to be a bug. I added code to hopefully reproduce the issue.
Would be cool if you could have a look at it :)
import spatialdata as sd
import spatialdata_plot
# This example doesn't really work with blobs (bc it has identical x and y extents), so I used the example data from https://s3.embl.de/spatialdata/spatialdata-sandbox/visium_associated_xenium_io.zip
visium_sdata = sd.read_zarr("visium_associated_xenium_io.zarr")
print("Old function (from spatialdata-plot):")
print(spatialdata_plot.pl.utils._get_extent(visium_sdata))
# output format is [xmin, xmax, ymin, ymax], so for "global" I get xmax = 19505print("New function (from spatialdata):")
print(sd._core.data_extent.get_extent(visium_sdata, coordinate_system="global"))
# This would imply ymax = 19505
print("Ground truth:")
print(visium_sdata.images)
# (c: 3, y: 21571, x: 19505) would mean the spatialdata output is incorrect because x and y are swapped
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bug 🚨Something isn't workingSomething isn't working


