spatialdata-io icon indicating copy to clipboard operation
spatialdata-io copied to clipboard

Problem of reading dbit-seq image

Open KaiLi-2324 opened this issue 1 year ago • 1 comments

Hi @LucaMarconato . Thanks for developing spatialdata-io, it is super helpful in processing spatial data. I wanted to use this package to process my dbit-seq data, but I had trouble reading the dbit-seq image with sd.models.Image2DModel.parse function. It said "ValueError: Wrong dims: ('y', 'x'). Expected ('c', 'y', 'x').". My image is (2000, 2000), and it seems that the Image2DModel doesn't work well with my data. Do you have any suggestions on this? Thanks very much!

Image

KaiLi-2324 avatar Jan 26 '25 14:01 KaiLi-2324

Hi @KaiLi-2324, thanks for your interest in the package. Adding a dummy dimension by reshaping the array will be enough to solve your problem. If you have images with single channels, Image2DModel.parse() will expect the shape (1, y, x). For instance if you use numpy you can do np.expand_dims(x, 0).

LucaMarconato avatar Jan 30 '25 17:01 LucaMarconato