# loading of toy-patient objects (decrease dxyz for better result)
step <- 4
patient <- toy.load.patient (modality = "mr", dxyz = rep (step, 3))
MR <- patient$mr[[1]]
# mid-volume point
mid.point <- apply (get.extreme.pt (MR),1,mean)
plane <- get.plane (MR, origin = mid.point, interpolate = TRUE)
display.kplane (plane, interpolate = FALSE)
plane <- get.plane (MR, origin = mid.point, xgrid = seq (-50, 50, 1),
ygrid = seq (-50, 50, 1), interpolate = TRUE)
display.kplane (plane, interpolate = FALSE)
# 3 points on the inclined plane
pts <- t ((MR$xyz.from.ijk %*% MR$cube.idx) [1:3 , c (1, 2, 7)])
orientation <- orientation.create (A = pts[1,], B = pts[2,], C = pts[3,])
origin <- apply (pts, 2, mean)
plane <- get.plane (MR, origin = origin,
plane.orientation = orientation, interpolate = TRUE)
display.kplane (plane, interpolate = FALSE)
orientation <- orientation.create (A = c (0, 0, 0) , B = c (1, 1, 0),
C = c (-1, 1, 0))
plane <- get.plane (MR, origin = origin,
plane.orientation = orientation, interpolate = TRUE)
display.kplane (plane, interpolate = FALSE)
Run the code above in your browser using DataLab