# loading of toy-patient objects (decrease dxyz)
step <- 5
patient <- toy.load.patient (modality = c("ct", "sct","rtstruct"),
roi.name = c("eye", "brain","gizzard"),
dxyz = rep (step, 3))
patient$ct[[1]]$description
patient$ct[[2]]$description
# Calculation of eye zone and ptv metrics
err.metrics.from.roi(obj = patient$ct[[2]], obj.ref = patient$ct[[1]],
struct = patient$rtstruct[[1]], roi.sname = c("eye","ptv"),
T.MAT= patient$T.MAT)
# Calculation of metrics on delimited zones on all RoIs
err.metrics.from.roi(obj = patient$ct[[2]], obj.ref = patient$ct[[1]],
struct = patient$rtstruct[[1]],
T.MAT= patient$T.MAT)
# Calculation on all volume
err.metrics.from.roi(obj = patient$ct[[2]], obj.ref = patient$ct[[1]],
T.MAT= patient$T.MAT)
# Calculation using err.metrics.from.bin. The binary selection must first be
# created.
roi.idx <- select.names(patient$rtstruct[[1]]$roi.info$roi.pseudo,
roi.sname = c("eye","ptv"))
bin.ROI <- lapply (roi.idx, function(idx){
bin.from.roi (patient$ct[[1]], struct = patient$rtstruct[[1]],
roi.idx = idx, T.MAT = patient$T.MAT,
alias = patient$rtstruct[[1]]$roi.info$roi.pseudo[idx],
description = patient$rtstruct[[1]]$roi.info$name[idx],
modality = "weight")})
names (bin.ROI) <-patient$rtstruct[[1]]$roi.info$name[roi.idx]
err.metrics.from.bin (obj = patient$ct[[2]], obj.ref = patient$ct[[1]],
bin.list = bin.ROI, T.MAT= patient$T.MAT)
Run the code above in your browser using DataLab