Comments (5)
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.
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.
@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.
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.
@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)
- Failed to load model class "Anymodel" HOT 2
- Publish a Vitessce notebook on Posit Connect HOT 11
- AnnDataWrapper - support for obsSpots, obsPoints, etc.
- OmeTiffWrapper - support coordinationValues and fileType: "image.ome-tiff"
- Minimal example for obsSegmentations.json for visualizing polygons in Spatial View HOT 2
- Adding scale bar to spatial view image
- ValueError: data too large for non-BigTIFF file HOT 4
- Additional improvements to adata_to_multivec_zarr function
- Add option for widget to communicate directly with Zarr store (no local HTTP server) HOT 2
- Bumping supported Anndata Version? HOT 1
- Support automatic instantiation of Wrapper objects HOT 2
- Support using JSX for writing plugin views
- Setting colors for obsSets? HOT 2
- Helper function to use adata.uns[obs_set_col + "_colors"] for initial obs set colors
- Notebooks environment.yml PackageNotFoundError for starlette==0.14.0
- Notebooks errors (list)
- Adding Vitessce widgets to a visualization dashboard HOT 1
- Define a plugin class/dataclass to couple on_config_change and anywidget.invoke handlers with plugin_esm HOT 1
- Support writing plugin_esm using local file with anywidget FileContents
- Ability to use comparative views + pageMode in a Jupyter notebook
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vitessce-python.