diff --git a/dots-and-boxplots/Ph1BoxplotsDSC.png b/dots-and-boxplots/Ph1BoxplotsDSC.png index d70d3df..bedb96c 100644 Binary files a/dots-and-boxplots/Ph1BoxplotsDSC.png and b/dots-and-boxplots/Ph1BoxplotsDSC.png differ diff --git a/dots-and-boxplots/Ph1BoxplotsDSC_ue.png b/dots-and-boxplots/Ph1BoxplotsDSC_ue.png new file mode 100644 index 0000000..2cb58d5 Binary files /dev/null and b/dots-and-boxplots/Ph1BoxplotsDSC_ue.png differ diff --git a/dots-and-boxplots/Ph1BoxplotsNSD.png b/dots-and-boxplots/Ph1BoxplotsNSD.png index cd9f4c1..d652e67 100644 Binary files a/dots-and-boxplots/Ph1BoxplotsNSD.png and b/dots-and-boxplots/Ph1BoxplotsNSD.png differ diff --git a/dots-and-boxplots/Ph2BoxplotsDSC.png b/dots-and-boxplots/Ph2BoxplotsDSC.png index ce4cd35..f51deb4 100644 Binary files a/dots-and-boxplots/Ph2BoxplotsDSC.png and b/dots-and-boxplots/Ph2BoxplotsDSC.png differ diff --git a/dots-and-boxplots/Ph2BoxplotsDSC_ue.png b/dots-and-boxplots/Ph2BoxplotsDSC_ue.png new file mode 100644 index 0000000..5c13e25 Binary files /dev/null and b/dots-and-boxplots/Ph2BoxplotsDSC_ue.png differ diff --git a/dots-and-boxplots/Ph2BoxplotsNSD.png b/dots-and-boxplots/Ph2BoxplotsNSD.png index 503101e..fe36437 100644 Binary files a/dots-and-boxplots/Ph2BoxplotsNSD.png and b/dots-and-boxplots/Ph2BoxplotsNSD.png differ diff --git a/msd-dot-boxplots.R b/msd-dot-boxplots.R index b69b201..e8e4122 100644 --- a/msd-dot-boxplots.R +++ b/msd-dot-boxplots.R @@ -1,78 +1,92 @@ library(rstudioapi) current_path = rstudioapi::getActiveDocumentContext()$path setwd(dirname(current_path)) library(ggplot2) +library(RColorBrewer) source("msd-prepare-data.R") ########################### # Define functions ########################### - dot_and_boxplots <- function(data, title, metric) { + colourCount = length(unique(data$subtask)) + getPalette = colorRampPalette(brewer.pal(8, "Set1")) p <- ggplot(data, aes(x=alg_name, y=value, fill=subtask)) + geom_boxplot() + geom_point(position=position_jitterdodge(), alpha = 0.2, size=1, color = "#5e5858") + facet_grid(task ~ .) + ggtitle(title) + scale_y_continuous(breaks=c(0,0.5,1)) + + #scale_fill_brewer("Spectral") + + scale_fill_manual(values = getPalette(colourCount)) + xlab("Algorithm") + ylab(metric) + labs(fill = "Target ROI") + theme(axis.text.x = element_text(size = 12, angle = 90, vjust = 0.5, hjust=1), axis.text.y = element_text(size = 13), legend.text = element_text(size = 13), legend.title = element_text(size= 16), axis.title = element_text(size= 16), strip.text = element_text(size = 12), title = element_text(size=16) ) return(p) } ########################### # Read and prepare challenge data ########################### msd_data_matrix <- prepare_data() msd_data_matrix_ph1 <- subset(msd_data_matrix, phase == 1) msd_data_matrix_ph2 <- subset(msd_data_matrix, phase == 2) ########################### # Phase 1 ########################### msd_data_matrix_ph1$alg_name <- factor(msd_data_matrix_ph1$alg_name, c("nnU-Net", "K.A.V.athlon", "NVDLMED", "Lupin", "CerebriuDIKU", "LS Wang's Group", "MIMI", "Whale", "UBIlearn", "VST", "BCVuniandes", "BUT", "A-REUMI01","jiafucang", "LfB", "AI-MED","Lesswire1", "EdwardMa12593", "RegionTec" )) + +msd_data_matrix_ph1$subtask <- factor(msd_data_matrix_ph1$subtask, + c("Edema", "Non-enhancing tumor", "Enhancing tumor", + "Left atrium", "Anterior", "Posterior", + "Liver", "Liver tumor", "Lung tumor", + "Pancreas","Tumor mass", + "Prostate PZ", "Prostate TZ" + )) + # DSC plt_ph1_dsc <- dot_and_boxplots(subset(msd_data_matrix_ph1, score == "DSC"), "Development Phase", "DSC") ggsave(file="dots-and-boxplots/Ph1BoxplotsDSC.png", plot=plt_ph1_dsc, width=12, height=13) # NSD plt_ph1_nsd <- dot_and_boxplots(subset(msd_data_matrix_ph1, score == "NSD"), "Development Phase", "NSD") ggsave(file="dots-and-boxplots/Ph1BoxplotsNSD.png", plot=plt_ph1_nsd, width=12, height=13) ########################### # Phase 2 ########################### msd_data_matrix_ph2$alg_name <- factor(msd_data_matrix_ph2$alg_name, c("nnU-Net", "NVDLMED", "K.A.V.athlon", "LS Wang's Group", "CerebriuDIKU", "MIMI", "Whale", "UBIlearn", "LfB", "jiafucang", "A-REUMI01", "AI-MED","Lupin", "VST","Lesswire1", "BUT", "BCVuniandes", "EdwardMa12593", "RegionTec" )) # DSC plt_ph2_dsc <- dot_and_boxplots(subset(msd_data_matrix_ph2, score == "DSC"), "Mystery Phase", "DSC") ggsave(file="dots-and-boxplots/Ph2BoxplotsDSC.png", plot=plt_ph2_dsc, width=12, height=13) # NSD plt_ph2_nsd <- dot_and_boxplots(subset(msd_data_matrix_ph2, score == "NSD"), "Mystery Phase", "NSD") ggsave(file="dots-and-boxplots/Ph2BoxplotsNSD.png", plot=plt_ph2_nsd, width=12, height=13) +