# loading of toy-patient objects (decrease dxyz for better result)
step <- 5
patient <- toy.load.patient (modality = c("ct", "rtstruct"),
roi.name = c("eye", "optical nerve", "brain"),
dxyz = rep (step, 3))
CT <- patient$ct[[1]]
S <- patient$rtstruct[[1]]
# "optical nerve" binary, with modality "binary" and "weight"
binl <- bin.from.roi (CT, struct = S, roi.sname = "left optical",
alias = "left_optical_nerve", verbose = FALSE,
modality = "binary")
binr <- bin.from.roi (CT, struct = S, roi.sname = "right optical",
alias = "right_optical_nerve", verbose = FALSE,
modality = "weight")
view.coord <- S$roi.info[S$roi.info$roi.pseudo == "leftopticalnerve",]$Gz
palette <- grey.colors(100, start = 0, end = 1,
alpha = c(0, rep(1,99)))
plot(S, view.coord = view.coord, main ="optical nerves")
plot(binl, view.coord = view.coord, col = palette,
cut.interpolate = FALSE, add = TRUE)
plot(binr, view.coord = view.coord, col =palette,
cut.interpolate = FALSE, add = TRUE)
plot(S, view.coord = view.coord, lwd = 2, add= TRUE)
if (FALSE) {
# with a smaller step
step <- 1
patient <- toy.load.patient (modality = c("ct", "rtstruct"),
roi.name = c("eye", "optical nerve", "brain"),
dxyz = rep (step, 3))
CT <- patient$ct[[1]]
S <- patient$rtstruct[[1]]
#' view.coord <- S$roi.info[S$roi.info$roi.pseudo == "leftopticalnerve",]$Gz
# "optical nerve" binary without inclusions management
bin <- bin.from.roi (CT, struct = S, roi.sname = "left optical",
alias = "left_optical_nerve", within = FALSE,
verbose = FALSE)
display.plane (CT, top = bin, struct = S, view.coord = view.coord,
legend.shift = -80, interpolate = FALSE, main = "Left nerve")
# "optical nerve" binary with inclusions management
bin <- bin.from.roi (CT, struct = S, roi.sname = "left optical",
alias = "left_optical_nerve", within = TRUE,
verbose = FALSE)
display.plane (CT, top = bin, struct = S, view.coord = view.coord,
legend.shift = -80, interpolate = FALSE, main = "Left nerve")
}
Run the code above in your browser using DataLab