scverse / napari-spatialdata

Interactive visualization of spatial omics data
https://spatialdata.scverse.org/projects/napari/en/latest/
BSD 3-Clause "New" or "Revised" License
41 stars 17 forks source link

Radius of circles is not affected by coordinate transformations #179

Closed LucaMarconato closed 8 months ago

LucaMarconato commented 1 year ago

The behavior appears for instance with this dataset: https://github.com/giovp/spatialdata-sandbox/blob/main/visium/to_zarr.py.

A fix would be to use the same logic as here: https://github.com/scverse/spatialdata/blob/0446efff1ea8e5f31e5d901d83cf5eb38a72cc4d/src/spatialdata/_core/operations/transform.py#L364. If convenient, we can put this code in a helper function to avoid code duplication.

@timtreis @Sonja-Stockhaus can you please point me to the code used by spatialdata-plot to handle this case?

timtreis commented 1 year ago

Line https://github.com/scverse/spatialdata-plot/blob/c1cc849eb8821d42326e34595dc7780f9186824f/src/spatialdata_plot/pl/render.py#L276 and onwards 👍 Essentially we add the artists and then apply the transformations. So I doubt you can easily transfer it to Napari :/

LucaMarconato commented 1 year ago

Thanks @timtreis. Actually I realized that in the spatialdata branch, where I didn't have this bug, napari was automatically adjusting the radius. In that branch I was using ellipses instead of points, so I think this is probably a bug of napari that could be fixed upstream.

LucaMarconato commented 9 months ago

Reported here: https://github.com/napari/napari/issues/6649

LucaMarconato commented 8 months ago

Somehow the bug is still present, I will check this again after we merge the multi_table branch with https://github.com/scverse/napari-spatialdata/pull/199.

LucaMarconato commented 8 months ago

The bug was reintroduced with the multi_table PR, now it's fixed again, but the radius actually turns out to be incorrect, I will track this in another issue: https://github.com/scverse/napari-spatialdata/issues/209.