spatialdata icon indicating copy to clipboard operation
spatialdata copied to clipboard

`_filter_table_by_elements` doesn't work for blobs dataset

Open Sonja-Stockhaus opened this issue 2 years ago • 3 comments

Hi @LucaMarconato

@timtreis said you're already having issues with some relational query functions, just wanted to let you know that I ran into this issue today:

from spatialdata._core.query.relational_query import match_table_to_element
from spatialdata.datasets import blobs
blob = blobs()
match_table_to_element(blob, "blobs_labels")

gives me AttributeError: 'SpatialImage' object has no attribute 'index' grafik

Sonja-Stockhaus avatar Sep 04 '23 15:09 Sonja-Stockhaus

Current theory is that in the data, there are 27 (0 for bg plus 26 labels?) numbers whereas the table doesn't hold data for the data for the background and therefore only has 26

timtreis avatar Sep 05 '23 09:09 timtreis

Also breaks the following notebook: https://spatialdata.scverse.org/en/latest/tutorials/notebooks/notebooks/examples/technology_mibitof.html

timtreis avatar Sep 05 '23 11:09 timtreis

Thanks for reporting. I have fixed the bug in https://github.com/scverse/spatialdata/pull/367

Also, I have made two related PRs to improve the usability of get_values():

  • https://github.com/scverse/spatialdata/pull/368
  • https://github.com/scverse/spatialdata/pull/369

The specific bug reported by @Sonja-Stockhaus is now fixed. Anyway, the mibitof notebook is still broken, apparently still for the same reason.

I will look into it and report back here.

LucaMarconato avatar Oct 10 '23 10:10 LucaMarconato