# loading of toy-patient objects (decrease dxyz for better result)
step <- 5
patient <- toy.load.patient (modality = c ("mr", "rtstruct"),
dxyz = rep (step, 3))
MR <- patient$mr[[1]]
S <- patient$rtstruct[[1]]
cluster.vol <- struct.clustering (MR, S, T.MAT = patient$T.MAT, verbose = FALSE)
head (cluster.vol$cluster.info)
# Display
n = nrow(cluster.vol$cluster.info)
col = paste0(c ("#000000", rainbow (n-1)),"af")
breaks <- seq (cluster.vol$min.pixel - 0.5, cluster.vol$max.pixel + 0.5,
length.out = n+1)
par0 <- par()
par(mfrow = c(1,2), mar = c(1,15,1,1))
display.palette(col, factors = cluster.vol$cluster.info$label)
par(mar = c(1, 1, 1, 1))
display.plane (MR, cluster.vol, main = "RoI clustering", view.coord = 0,
top.col = col, top.breaks = breaks, interpolate = FALSE)
par(mfrow= par0$mfrow,mar=par0$mar)
Run the code above in your browser using DataLab