scverse / spatialdata-io

BSD 3-Clause "New" or "Revised" License
29 stars 17 forks source link

error from minimalistic reading of xenium data #132

Closed EliHei2 closed 4 days ago

EliHei2 commented 2 months ago

Hola! just updated both spatialdata and spatialdata-io trying to read a generic xenium dataset with the following line, I get the error bellow:

sdata = spatialdata_io.xenium(
        'Xenium_V1_FFPE_Human_Breast_IDC', 
        morphology_mip=False, 
        morphology_focus=False, 
        cell_boundaries=False,
        cells_as_circles=False,
        cell_labels=False,
        nucleus_labels=False
    )
    if cell_labels_indices_mapping is not None:
UnboundLocalError: local variable 'cell_labels_indices_mapping' referenced before assignment
LucaMarconato commented 2 months ago

Hola! Well spotted 🥸 Fixed with https://github.com/scverse/spatialdata-io/releases/tag/v0.1.2, which also adds the parameter aligned_images: bool, to skip some extra H&E or IF images sometimes present in more recent datasets.

EliHei2 commented 2 months ago

Thanks Luca! Sorry for opening again, there's another error still, which I can guess where's it from (i.e., not reading cell boundaries) but leave it here:

line 344, in _get_polygons
    assert index.equals(idx)
AssertionError
LucaMarconato commented 4 days ago

Got back to this today. I have tried to replicate with the same argument but that line doesn't give me an error. I think the bug is now solved.

If you encounter it please feel free to reopen; in such a case please detail a link to a public dataset that can be used to replicate the bug, and to the code used to call the xenium() function.