mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-24 21:38:13 +08:00
1.7 KiB
1.7 KiB
Cellxgene Visium Beta
How it works
- Launch
cellxgeneas normal. - If the loaded dataset has spatial information available, the image data will be loaded on startup.
- On the toolbar, next to the Zoom icon, a
Toggle imagebutton will now appear. Click on it and the image will be added as an underlay. - You can now use any
cellxgenefunctionality and the image will still be present. If you pan and zoom, the image will also be panned and zoomed. - If you want to hide the image, you can click on
Toggle imageagain
In order for the image to be displayed with the correct size and alignment, the H5AD needs to have a few requirements. See the following section to learn more.
h5ad requirements
- The spatial embedding layer should be contained in
obsmand be namedX_spatial. Other layers can exist, but only this one will have the spatial feature enabled. - A
spatialdict needs to be defined in theunsdictionary. - Inside the
spatialdict, animagesdict must be defined. - The
imagesdict must contain ahireskey, which should reference an image encoded as an RGB matrix (i.e., a three-dimensional matrix of sizeheight x width x 3where the final dimension has the RGB values for each pixel) - The
imagesdict must contain ascalefactorsdict. This should in turn contain atissue_hires_scalefkey, which should reference a floating point number.
Moreover, in order to have the image correctly aligned with the dots, the following must be true:
tissue_hires_scalefshould represent the ratio between the embedding layerX_spatialand the image matrix. In particular, if you multiplyX_spatialbytissue_hires_scalef, you should obtain an array of points that ovelap the tissue image if you plot them in a plane.