From 898f0ed4e0b91ae084a65e8be737d449161f0b27 Mon Sep 17 00:00:00 2001 From: mattobny Date: Tue, 14 Nov 2023 16:41:50 -0500 Subject: [PATCH] Adjust NA handling for image plotting --- R/gg_info_layers.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/gg_info_layers.R b/R/gg_info_layers.R index e93b616..e0954e3 100644 --- a/R/gg_info_layers.R +++ b/R/gg_info_layers.R @@ -1251,6 +1251,7 @@ plot_spat_image_layer_ggplot = function(gg_obj, if(dim(img_array)[3] == 1) { img_array_RGB = array(NA, dim = c(dim(img_array)[1:2],3)) img_array_RGB[,,1:3] = img_array + img_array_RGB[is.na(img_array_RGB)] = 0 } else { img_array_RGB = img_array } @@ -1320,6 +1321,7 @@ plot_spat_image_layer_ggplot = function(gg_obj, if(dim(img_array)[3] == 1) { img_array_RGB = array(NA, dim = c(dim(img_array)[1:2],3)) img_array_RGB[,,1:3] = img_array + img_array_RGB[is.na(img_array_RGB)] = 0 } else { img_array_RGB = img_array }