# Creation of a reference volume and measured volume
# loading of toy-patient objects (decrease dxyz for better result)
patient <- toy.load.patient (modality = c ("rtdose", "rtstruct"),
roi.name = "ptv", dxyz = c (5, 5, 5))
D.ref <- patient$rtdose[[1]]
# We will assume that the measured dose is equal to the reference dose shifted
# by 3 pixels on the x axis
D.meas <- vol.copy (D.ref, alias = "measured_dose")
D.meas$vol3D.data[1:(D.meas$n.ijk[1] - 3) ,,] <- D.ref$vol3D.data[4:D.ref$n.ijk[1],,]
D.max <- as.numeric(quantile(as.numeric(D.ref$vol3D.data),
probs = 99.99/100, na.rm = TRUE))
abs_chi <- rt.chi.index (D.meas, D.ref, vol.max = D.max, delta.r = 6)
abs_chi$chi.info
# Display chi index at isocenter
G.iso <- patient$rtstruct[[1]]$roi.info$Gz[
patient$rtstruct[[1]]$roi.info$name == "ptv"]
display.plane(abs_chi, view.coord = G.iso,
bottom.col = c ("#00FF00", "#007F00", "#FF8000", "#FF0000",
"#AF0000"),
bottom.breaks = c (0, 0.8, 1, 1.2, 1.5, abs_chi$max.pixel),
interpolate = FALSE, bg = "blue")
Run the code above in your browser using DataLab