YangLabHKUST / STitch3D

Construction of a 3D whole organism spatial atlas by joint modeling of multiple slices
https://stitch3d-tutorial.readthedocs.io/en/latest/index.html#
MIT License
52 stars 2 forks source link

Cannot produce figure in Example 2 3D visualization in R #12

Closed cristalliao closed 1 year ago

cristalliao commented 1 year ago

Dear Professors, I have problems producing figures in Example 2 3D visualization in R. I already have "clustering_result.csv" in the "results_human_heart" file. However, when I run the R code in the tutorial, the R studio does not provide me with the figure.

Screen Shot 2023-05-03 at 2 13 17 pm

Code in R:

rm(list = ls())
options(warn=-1)
library(rgl)
library(misc3d)
knitr::knit_hooks$set(webgl = hook_webgl)
source("/albona/nobackup2/xiaoyinl/STitch3D_analysis_and_dataset/STitch3D/plot3D_func.R")
clusters <- c(0,1,2,3,4)
cluster_colors <- c("#7570b3","#1b9e77","#d95f02","#66a61e","#e7298a")
um <- c(-0.8227578, -0.5278972, 0.2107004, 0,
        -0.5608635, 0.8141541, -0.1502849, 0,
        -0.0922074, -0.2418221, -0.9659296, 0,
        0, 0, 0, 1) #set the initial view of the 3D plot
spot_radius <- 0.3
axis_rescale <- c(-1,1,2)

plot3D_clusters(directory = "/albona/nobackup2/xiaoyinl/STitch3D_analysis_and_dataset/results_human_heart",
                clusters = clusters,
                cluster_colors = cluster_colors,
                um = um,
                spot_radius = spot_radius,
                axis_rescale = axis_rescale
                )

But no figure like the one below:

Screen Shot 2023-05-03 at 2 11 48 pm

Could you please help me to check where the problem is? Thanks a lot!

Best regards, Cristal

gefeiwang commented 1 year ago

Hi Cristal,

Maybe it is caused by the same issue here: https://github.com/YangLabHKUST/STitch3D/issues/6#issuecomment-1537264243.