-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
Hi there,
I'm wondering if you have any advice on incorporating H&E images into SpatialFeatureExperiments objects--specifically images with an alignment matrix as exported by Xenium Explorer, where pixel/micron conversion and to deal with flipped y-axis coordinates.
I managed to get the aligned image in:
bbox1 <- c(xmin = 7500, xmax = 8500, ymin = -5500, ymax = -4500)
bboxes_sf <- st_as_sfc(st_bbox(bbox1))
p1 <- plotImage(sfe, image_id = "morphology_focus", channel = 3:1, show_axes = TRUE,
dark = TRUE, normalize_channels = TRUE) +
geom_sf(data = bboxes_sf, fill = NA, color = "white", linewidth = 0.5)
p2 <- plotImage(sfe, image_id = "HE", channel = 1:3, show_axes = TRUE,
normalize_channels = TRUE) +
geom_sf(data = bboxes_sf, fill = NA, color = "white", linewidth = 0.5)
cowplot::plot_grid(p1, p2, align="h")
But any functions that use a bbox to view a subset of the image fail.
> plotImage(sfe, image_id = "HE", channel = 1:3,
+ bbox = bbox1, normalize_channels = TRUE)
Error in .jcall("RBioFormats", "Ljava/lang/Object;", "readPixels", i, :
java.lang.IllegalArgumentException: Invalid array size: 0 x 0 x 1 x 3
Though standard Xenium bundle images work fine:
plotImage(sfe, image_id = "morphology_focus", channel = 3:1,
bbox = bbox1, normalize_channels = TRUE)
If you have a workflow that has worked for you, it would be greatly appreciated!
Metadata
Metadata
Assignees
Labels
No labels