# loading of toy-patient objects (decrease dxyz and increase beam.nb for better
# result)
step <- 5
patient <- toy.load.patient (modality = c("rtdose", "rtstruct"), roi.name = "eye",
dxyz = rep (step, 3), beam.nb = 3)
D <- patient$rtdose[[1]]
struct <- patient$rtstruct[[1]]
T.MAT <- patient$T.MAT
# creation of the list of target binary volumes
target.roi.idx <- select.names (struct$roi.info$roi.pseudo, roi.sname = "ptv")
healthy.roi.idx <- select.names (struct$roi.info$roi.pseudo, roi.sname = "eye")
target.bin.list <- lapply (target.roi.idx , function (idx) {
vr <- nesting.roi (D, struct, roi.idx = idx, xyz.margin = c (5, 5, 5),
T.MAT = T.MAT, alias = struct$roi.info$name[idx])
b <- bin.from.roi(vr, struct, roi.idx = idx, T.MAT = T.MAT,
alias = struct$roi.info$name[idx], verbose = FALSE)
})
names (target.bin.list) <- struct$roi.info$name[target.roi.idx]
healthy.bin.list <- lapply (healthy.roi.idx , function (idx) {
vr <- nesting.roi (D, struct, roi.idx = idx, xyz.margin = c (5, 5, 5),
T.MAT = T.MAT, alias = struct$roi.info$name[idx])
b <- bin.from.roi(vr, struct, roi.idx = idx, T.MAT = T.MAT,
alias = struct$roi.info$name[idx], verbose = FALSE)
})
names (healthy.bin.list) <- struct$roi.info$name[healthy.roi.idx]
indices <- rt.indices.from.bin (D, target.bin.list, healthy.bin.list,
presc.dose = 50,
conformity.indices = c("PITV", "PDS", "CI.lomax2003",
"CN", "NCI", "DSC","COIN"),
verbose = FALSE)
indices[c("dosimetry","volume", "conformity","homogeneity","gradient")]
head(indices$DVH)
Run the code above in your browser using DataLab