# Creation of back.vol
CT <- vol.create (c(80, 80,40), c(1.2, 1.2, 2),
pt000 = c(-50.4,-50.4,-39), modality = "ct",
default.value = as.integer(-997), value.sd = 1)
# Creation of a cuboid
cuboid <- bin.cuboid(CT, side = c(29.7, 20.0, 20.2),
center = c(-10.9, -20.4, -10.6))
# Creation of a cylinder
cylinder <- bin.cylinder(CT, center =c(10.3, 15.6, 0.7),
radius = c(10, 20), height = 50,
orientation = c(0.5150381, 0.7423287, 0.4285837,
-0.8571673, 0.4460361, 0.2575190))
# Creation of an ellipsoid
ellipsoid <- bin.ellipsoid(CT, center = c(-20.1, 0.1, 5),
radius = c(3.3, 6.2, 5.3))
# Display
k.idx <- unique(which(cuboid$vol3D.data>0, arr.ind = TRUE)[,3]) - 1
display.3D.stack(cuboid, k.idx, border = FALSE,
col = c("#FFFFFF00", "#EBDFDFFF", "#D8BFBFFF", "#C59F9FFF",
"#B27F7FFF", "#9F5F5FFF", "#8C3F3FFF", "#791F1FFF",
"#660000FF"))
k.idx <- unique(which(cylinder$vol3D.data>0, arr.ind = TRUE)[,3]) - 1
display.3D.stack(cylinder, k.idx, border = FALSE,
col = c("#FFFFFF00", "#DFEBDFFF", "#BFD8BFFF", "#9FC59FFF",
"#7FB27FFF", "#5F9F5FFF", "#3F8C3FFF", "#1F791FFF",
"#006600FF"))
k.idx <- unique(which(ellipsoid$vol3D.data>0, arr.ind = TRUE)[,3]) - 1
display.3D.stack(ellipsoid, k.idx, border = FALSE,
col = c("#FFFFFF00", "#DFDFEBFF", "#BFBFD8FF", "#9F9FC5FF",
"#7F7FB2FF", "#5F5F9FFF", "#3F3F8CFF", "#1F1F79FF",
"#000066FF"))
Run the code above in your browser using DataLab