Replies: 4 comments 7 replies
-
We are working on this feature in the underlying image rendering library Viv hms-dbmi/viv#609 but currently only OME-TIFF and OME-NGFF (v3) are supported. |
Beta Was this translation helpful? Give feedback.
-
import tifffile
from scipy.ndimage import zoom
channels = ['dapi_stack.tif', 'membrane_stack.tif']
czyx_stack = tifffile.imread(channels)
levels = 4
tile = (256, 256)
compression = 'adobe_deflate'
with tifffile.TiffWriter('czyx_stack.ome.tiff', bigtiff=True) as tif:
tif.write(
czyx_stack,
subifds=levels,
tile=tile,
compression=compression,
metadata={'axes': 'czyx', 'Channel': {'Name': channels}},
)
for level in range(levels):
czyx_stack = zoom(
czyx_stack, (1, 1, 0.5, 0.5), order=1, prefilter=False
)
tif.write(
czyx_stack,
subfiletype=1,
tile=tile,
compression=compression,
) |
Beta Was this translation helpful? Give feedback.
-
Thanks to @cgohlke and @keller-mark I end up with this configuration for vitessce. As a follow up, is there a way to add in molecule or cell set data from another dataset? vc = VitessceConfig(name='merfish', description='MERFISH measurements in the mouse ileum')
dataset = vc.add_dataset(name='ileum').add_object(AnnDataWrapper(gdata,
cell_set_obs=["leiden_final"], cell_set_obs_names=["Leiden"], spatial_centroid_obsm="spatial" , expression_matrix="X" ))
dataset2 = vc.add_dataset(name='jeff').add_object(
OmeTiffWrapper(img_path="czyx_stack.ome.tiff", name='ileum'),)
spatial = vc.add_view(cm.SPATIAL, dataset=dataset)
tiff = vc.add_view(cm.SPATIAL, dataset=dataset2) I get a vitessce instance with 2 coordinated spatial windows, one with the tiff and a corresponding plot with centroids and cell labels. Is there a way to overlay |
Beta Was this translation helpful? Give feedback.
-
I'm trying to get Merfish images from https://datadryad.org/stash/dataset/doi:10.5061/dryad.jm63xsjb2 which are two single-channel tiffs with 8 z-layers, one dapi stain and another for Na+/K+-ATPase. I would like to combine these images with either SpatialExperiment or anndata for downstream analysis but I'm having issues with these data formats; they tend to break on image data when using the supplied wrappers and I don't think there is any support for these images in vitessce anyways if I tried to write my own wrapper. Is there a way to import single channel tiffs into vitessce or viv? This way I can separate the cell-label, cell-boundary data, and molecule data and plot that spatially over the tiffs for the stain. Otherwise, I'll need to find a way to get this data into ome-tiff or ome-ngff so I can visualize the data in Vitessce.
Beta Was this translation helpful? Give feedback.
All reactions