## load a MRIaggr object
data(MRIaggr.Pat1_red, package = "MRIaggr")
#### 1- MRIaggr method
## raw parameter
multiplot(MRIaggr.Pat1_red, param = "TTP_t0", legend = FALSE, main = "TTP_t0 - slice ",
palette=rainbow(10), breaks = seq(0,10) - 10^{-10})
## thresholded parameter
calcThresholdMRIaggr(MRIaggr.Pat1_red, param = c("TTP_t0","MTT_t0"),threshold = 1:10,
name_newparam = c("TTP.th_t0","MTT.th_t0"),
update.object = TRUE, overwrite = TRUE)
multiplot(MRIaggr.Pat1_red, param = "TTP.th_t0", main = "TTP.th_t0 - slice",
legend = FALSE,palette = rainbow(10), breaks = (0:10) - 10^{-10})
## 1st correction
calcThresholdMRIaggr(MRIaggr.Pat1_red, param = c("TTP_t0","MTT_t0"),threshold = 1:10,
rm.CSF = TRUE, hemisphere = "lesion",
name_newparam = c("TTP.red_t0","MTT.red_t0"),
update.object = TRUE, overwrite = TRUE)
multiplot(MRIaggr.Pat1_red, param = "TTP.red_t0", main = "TTP.red_t0 - slice",
legend = FALSE, palette = rainbow(10), breaks = (0:10) - 10^{-10})
## 2nd correction
calcThresholdMRIaggr(MRIaggr.Pat1_red, param = c("TTP_t0","MTT_t0"), threshold = 1:10,
rm.CSF = TRUE, hemisphere = "lesion", name_newparam = c("TTP.GR_t0","MTT.GR_t0"),
GRalgo = TRUE, seed = c("MASK_T2_FLAIR_t2","MASK_DWI_t0"), W.range = sqrt(2),
update.object = TRUE, overwrite = TRUE)
multiplot(MRIaggr.Pat1_red, param = "TTP.GR_t0", main = "TTP.GR_t0 - slice",
legend = FALSE, palette = rainbow(10), breaks = (0:10) - 10^{-10})
#### 2- data.frame function ####
## raw parameter
multiplot(MRIaggr.Pat1_red, param = "TTP_t0", legend = FALSE, main = "TTP_t0 - slice ",
palette=rainbow(10), breaks = seq(0,10) - 10^{-10})
## thresholded parameter
data <- selectContrast(MRIaggr.Pat1_red,
param = c("TTP_t0","MTT_t0","hemisphere","CSF","WM","GM"))
hypo_Th1_10 <- calcThreshold(data,param = c("TTP_t0","MTT_t0"), threshold = 1:10)
multiplot(selectCoords(MRIaggr.Pat1_red), main = "TTP_t0_th - slice ",
hypo_Th1_10[,1], legend = FALSE, palette = rainbow(10), breaks = (0:10) - 10^{-10})
## 1st correction
data$CSF <- as.numeric(apply(data[,c("CSF","WM","GM")], 1, which.max) == 1)
hypoC_Th1_10 <- calcThreshold(data,param = c("TTP_t0","MTT_t0"), threshold = 1:10,
hemisphere = "left", rm.CSF = TRUE)
multiplot(selectCoords(MRIaggr.Pat1_red), main = "TTP_t0_thC - slice",
hypoC_Th1_10[,1], legend = FALSE, palette = rainbow(10), breaks = (0:10) - 10^{-10})
## 2nd correction
maskN <- c("MASK_T2_FLAIR_t2","MASK_DWI_t0")
data[, maskN] <- selectContrast(MRIaggr.Pat1_red, param = maskN)
W <- calcW(MRIaggr.Pat1_red, range = sqrt(2 * 1.875^2 + 0.001), row.norm = TRUE, upper = NULL,
spatial_res = c(1.875,1.875,6))$W
max(spam::rowSums(W > 0))
hypoCC_Th1_10 <- calcThreshold(data, param = c("TTP_t0","MTT_t0"), threshold = 1:10,
hemisphere = "left", rm.CSF = TRUE,
GRalgo = TRUE, seed = c("MASK_T2_FLAIR_t2","MASK_DWI_t0"), W = W)
multiplot(selectCoords(MRIaggr.Pat1_red), main = "TTP_t0_thCC - slice",
hypoCC_Th1_10[,1], legend = FALSE, palette = rainbow(10), breaks = (0:10) - 10^{-10})
Run the code above in your browser using DataLab