Closed moutazhelal closed 1 year ago
Hi @moutazhelal Can you provide a bit more information and the Giotto version you're using? Did this error also occur with the examples? Also pinging @jiajic on this thread who might help with any image specific issues. Thanks, Ruben
Thanks for the awesome Giotto Suite,
I also got the 'externalptr' error when plotting spots on the tissue image.
This appears only after opening the Giotto object in new R session and is likely because the magick objects are not saved correctly to the Giotto object when using magick with the future package. (see https://cran.r-project.org/web/packages/future/vignettes/future-4-non-exportable-objects.html)
Giotto_object@images[[img_1142243F_lowres]][[mg_object]] Error: Image pointer is dead. You cannot save or cache image objects between R sessions.
As a workaround, I'm currently importing the spatial images again after each Giotto object reload.
## Function to re-import images
reimport_imgs2 <- function(gobj) {
for (n in 1:length(gobj@images)) {
gobj@images[[n]]@mg_object =
magick::image_read(gobj@images[[n]]@file_path)
}
return(gobj)
}
Hi @iivario thank you for continuing this discussion,
Unfortunately, the 'externalptr error' issue has been a longstanding and unavoidable one with larger files such as images both to improve performance and to save on file sizes.
The workaround that you arrived at is the same one that we did, and it is implemented as the function reconnectGiottoImages()
which should work based on the filepaths recorded in the image object's @file_path
slot. So as long as the file path has not changed it should work without any specific parameters other than the gobject
. There's also a more manual workflow to reconnecting image media that is accessed by setting the parameter auto_reconnect
to FALSE
and supplying the new full image paths to the image_path
or largeImage_path
params as named lists (the names should be the respective names of the images that were used in the gobject)
In the future, we are planning to implement it into Giotto-specific save and load functions, and that should provide a more native solution.
Thanks, George
Closing this with a general comment:
We've worked on new functions saveGiotto()
and loadGiotto
, which are essentially wrappers around the basesaveRDS()
or qsave
function from the qs package. They allow you to save the new Giotto Suite (> 3.0) objects into a folder structure and also load them back in. It should also work between different machines.
Dear authors,
Thank you fro reading my message,
I have encountered an Error in displaying the tissue image underneath for example clusters or gene expression. the plot is generated without any problems if I set show_image = F but if I choose to show the image it does not produce an out put I am using this to plot the figure
But this Error comes up
Could you help me solve this issue?
Thank you very much, Best