Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support loading polygon shapes from SpatialData #1835

Open
Tracked by #1834
keller-mark opened this issue Apr 1, 2024 · 1 comment
Open
Tracked by #1834

Support loading polygon shapes from SpatialData #1835

keller-mark opened this issue Apr 1, 2024 · 1 comment
Labels
feature New feature or request spatialdata

Comments

@keller-mark
Copy link
Member

keller-mark commented Apr 1, 2024

User story

User has segmentations that are represented using polygon shapes within a SpatialData object. User wants to visualize these segmentations using Vitessce without converting them to a different data format/representation.

Preferred solution

Implement a new FileType and data loader class that returns the polygon shapes as the obsSegmentations data type with obsSegmentationsType === 'polygon'

export type ObsSegmentationsPolygons = {

This will require knowledge of how the SpatialData stores Shape elements on-disk. Some relevant resources that may help are:

Relevant places in the code:

Possible alternatives

@LucaMarconato
Copy link

A note on this. For the disk representation of shapes we plan to transition from using the GeoPandas ragged-array representation (Zarr) to the GeoParquet representation, also supported natively by GeoPandas. This change would be beneficial for interoperability because the GeoParquet is widely supported.

Practically, from the Python side it will amount to use to_parquet() and read_parquet() from geopandas, but we haven't done it yet because we need to do in a backward compatible way and also providing a data migration CLI (the data migration will be lightweight because the heavy data are images, labels and tables; all of which have a stable data format that will not change).

I think therefore that for this hackathon we could already try the GeoParquet representation if it makes the implementation easier, and then add the support for the current version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request spatialdata
Projects
None yet
Development

No branches or pull requests

2 participants