# loading of toy-patient objects (decrease dxyz and increase beam.nb for
# better result)
step <- 5
patient <- toy.load.patient (modality = c("ct","mr", "rtdose", "rtstruct"),
dxyz = rep (step, 3), beam.nb = 3)
MR <- patient$mr[[1]]
CT <- patient$ct[[1]]
D <- patient$rtdose[[1]]
S <- patient$rtstruct[[1]]
# display 1
layout (matrix(c(1,1,2,3), ncol=2), widths=c(1,0.2))
plot (CT, view.coord = 0, col = pal.RVV(255))
S_plot <- plot (S, view.coord = 0, add = TRUE, lwd = 2)
display.palette (col = pal.RVV(255), main="HU")
display.legend (S_plot, bg="white", text.col="black", lwd = 2, cex = 1.1)
# display 2
layout (matrix(c (1, 1, 2, 3), ncol = 2), widths = c (1, 0.2))
# Coordinates of the PTV barycenter in CT frame of reference
G <- as.numeric (S$roi.info[S$roi.info$roi.pseudo == "ptv",
c ("Gx", "Gy", "Gz")])
# Coordinates of the PTV baricenter in MR frame of reference
G_MR <- as.numeric (c(G, 1) %*%
t(get.rigid.M(CT$ref.pseudo, MR$ref.pseudo,
T.MAT = patient$T.MAT)))[1:3]
plot (MR, view.type = "sagi", view.coord = G_MR,
col = grey.colors (255, start = 0, end = 1),
breaks = seq (0, 500, length.out = 256) , bg = "darkblue")
plot (vol.in.new.ref(D, MR$ref.pseudo, T.MAT = patient$T.MAT),
view.type = "sagi", view.coord = G_MR,
col = pal.rainbow(255), add = TRUE)
display.palette (col = grey.colors (255, start = 0, end = 1),
breaks = seq (0, 500, length.out = 256), main="MR")
display.palette (col = pal.rainbow(255),
breaks = seq (D$min.pixel, D$max.pixel, length.out = 256),
main="Gy")
layout(1)
Run the code above in your browser using DataLab