squidpy
squidpy copied to clipboard
read image from Vizgen data (for Napari)
Hi,
Thank you for developping this amazing tool! I am currently working on breast Vizgen data (available online) and I was wondering what should be the input for the image on napari.
I thought it would be the file micron_to_mosaic_pixel_transform.csv, but when I do that:
img = sq.im.ImageContainer("micron_to_mosaic_pixel_transform.csv") I got the message: "ValueError: Unable to handle path"
When I do that:
import imageio
image = imageio.imread("micron_to_mosaic_pixel_transform.csv")
img = sq.im.ImageContainer(image)
I got: "ValueError: Could not find a backend to open micron_to_mosaic_pixel_transform.csv`` with iomode ri`."
Do you think you can help me with that ?
Thanks a lot,
@anidj What I know imageContainer from the napari libarray only accepts image data in the form of numpy arrays/image formate etc. You need to first read the date into a pandas dataframes and then use below codes:
`import pandas as pd
import napari
data = pd.read_csv("micron_to_mosaic_pixel_transform.csv")
with napari.gui_qt():
viewer = napari.Viewer()
# display the data as a table layer
viewer.add_table(data)`
This should able to display the date in the pixel transform formate (table layer in the napari viewer). Please keep in mind that I have not tested the code above
Any developments on this? Have been trying to interactively visualize some VizGen data using SquidPy, with no success so far. Seems like the developers didn't anticipate that users might want to do that with VizGen data?
No, I wasn't able to do it yet
hey all! apologies for late reply! We don't support such functionality with squidpy but we do with spatialdata!
see IO for vizgen: https://spatialdata.scverse.org/projects/io/en/latest/generated/spatialdata_io.merscope.html you might have to install from main as a bug was fixed recently
visualize with napari. you can take a look at this nanostring tutorial but vizgen data is relatively similar in terms of what can be visualized: https://spatialdata.scverse.org/projects/napari/en/latest/notebooks/nanostring_analysis.html
HTH!