seurat icon indicating copy to clipboard operation
seurat copied to clipboard

Shifted high resolution image with Load10X_Spatial()?

Open Mnew1288 opened this issue 3 years ago • 4 comments

Hi,

I am not sure it's a bug or not. Anyway, no problem to use the default low resolution PNG image. But when I used the high resolution PNG image, I got something like this: test

code: plot2 <- SpatialFeaturePlot(MG.spatila_data, features = "nCount_Spatial") + theme(legend.position = "right")

Seems the dots are not overlapped with the image. By the way. I noticed my section is pretty small and have only 375 dots on it.

Thanks

Mnew1288 avatar Feb 10 '22 15:02 Mnew1288

Hi, I have the same issue. The plot does not overlay correctly when high resolution PNG image is used. ACTA2_small Could you fix that? Thank you!

Lily-life avatar Mar 16 '22 15:03 Lily-life

When I loaded high resolution image, SpatialFeaturePlot cannot works well.

img <- Read10X_Image(paste(dat.dir,'spatial',sep='/'),image.name = 'tissue_hires_image.png') seurat.obj <- Load10X_Spatial(dat.dir,image=img)

Could you fix it? Thank you.

I used Seurat 4.1.1 捕获

biosyssun avatar Jun 23 '22 08:06 biosyssun

Hi, @biosyssun I encountered the same problem. Have you solved it? Could you help me?

jincanke avatar Jul 06 '22 07:07 jincanke

Hi,

I encountered the same problem as @Mnew1288 and I found a solution that works for me. I noticed that the points seemed scaled down small in the upper left corner and I figured that we must be using the wrong scalefactor. Seurat uses something they call scalefactors to adjust the size of the dots/image. This is stored in object@[email protected] and there are 4 of these scale factors: spot, fiducial, hires, and lowres. Seurat seems to expect in general that low-res images are being used, so it uses the lowres scalefactor during plotting. Since we're trying to use the high-res image, we want to use the hires scalefactor instead. I don't there's a direct way to tell Seurat to do this, but instead we can just set the lowres scalefactor to the hires scalefactor. Like this:

object@images@[email protected]$lowres = object@images@[email protected]$hires

Hope this helps!

ggruenhagen3 avatar Jul 25 '22 19:07 ggruenhagen3

@ggruenhagen3 thank you so much for this solution!

lsudupe avatar Nov 15 '22 14:11 lsudupe

And how to upscale the spot size ?

BenjaminDEMAILLE avatar Mar 06 '23 11:03 BenjaminDEMAILLE

It works for me. Thanks so much @ggruenhagen3

Byronxy avatar Sep 01 '23 00:09 Byronxy

Thanks so much for providing folks with a workaround @ggruenhagen3 🙌

As of v5.1.0 it is finally possible to pass image.scale = "hires" to SpatialDimPlot and SpatialFeaturePlot which should resolve this issue. If the spot size isn't quite to your liking it can also be adjusted using pt.size.factor (default is 1.6).

Closing for now but feel free to open another issue if you run into any other issue 😄

dcollins15 avatar May 10 '24 20:05 dcollins15