Giter VIP home page Giter VIP logo

Comments (5)

ilan-gold avatar ilan-gold commented on July 20, 2024

I believe you need to use a list not numpy arrays, but that is based on limited experience: https://github.com/hubmapconsortium/portal-containers/blob/dc568234c76017c7cd9644a4d15ef0f7b9d84e24/containers/sprm-to-anndata/context/main.py#L57-L66
Also, I could be wrong about this, but you probably also need to store the centroid. I'm going to open an issue to look into this so it doesn't fall off my radar.
Also as a heads up vitessce/vitessce#927 is coming.....so if you want to future-proof what you are doing now for that (i.e switch the segmentation visualization to bioformats6 image pyramids of the masks in the future and use those instead of polygons), I'd recommend storing the centroid as well since it will be needed for selection (spatial_centroid_obsm)

In short, I'd say 1) stick to basic python types like lists and 2) also store the centroid.

Thanks for trying this stuff out!!!!

from vitessce-python.

NHPatterson avatar NHPatterson commented on July 20, 2024

Ok great. Are there example SPRM data files around somewhere I could download? If I load those up I can take a look at all the pieces of data that go into the AnnData based on the link you posted.

It's my pleasure to try vitessce out for this application. I'll definitely let you know about my experience too 👍

from vitessce-python.

ilan-gold avatar ilan-gold commented on July 20, 2024

@NHPatterson I can message you a test HuBMAP dataset and view config. The IEC is pushing at the moment trying to get it out the door and we only have data on the test instance which is IP whitelisted.

from vitessce-python.

NHPatterson avatar NHPatterson commented on July 20, 2024

Thanks for this. I now understand the issue. It seems the AnnData store ( and zarr) can't accept ragged arrays.

From the dataset you sent me:

adata_proc.obsm["poly"].shape
Out: (11377, 1, 10, 2)

Essentially each polygon must be represented by 9 points in this case (one redundant vertex). It seems downsample_shape
in the linked script above performs this operation. I think the bit-mask solution will address this issue but may have issues with overlapping regions-of-interest? We sometimes have annotations for both gross (i.e., occupying >1/4 of the image area) and fine morphology.

I don't know what's possible here to address the polygon coordinate issue, but perhaps a string parser could be employed using WKT representation? This would produce one string for every polygon regardless of number of vertices. But this is now likely out of the scope of this issue. 😄

from vitessce-python.

ilan-gold avatar ilan-gold commented on July 20, 2024

@NHPatterson I agree with you on the last point certainly - I was trying to conform to the old way of doing this in Vitessce in cells.json with the AnnData stuff so I ended up just re-implementing it but there's nothing to stop us from busting out a parser or something. That would certainly be nice. Message me an example of you think could go wrong with the BitmaskLayer, would be very curious to understand.

from vitessce-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.