前立腺癌を考える。前立腺の高さでのCTとIMRT治療計画はこんな感じ。
恥骨、両側大腿骨、直腸がある。骨は線量減衰効果が大きめで、直腸は放射線に弱めで特に当たる線量を落としたい。
カージオイドと楕円を組み合わせてそれっぽい断面を作る。
Vs <- c(4/3, 3/2, 19/12, 5/3, 11/6, 0) * pi #胸部誘導の置く角度 ra <- 4 #胸部誘導を置く遠さ。あまり関係ない。 Vs_xy <- cbind(ra*cos(Vs), ra*sin(Vs)) #胸部誘導の座標 theta <- seq(0, 2, length=1000) * pi #心ベクトルの回転 a0 <- 0.6 #心ベクトルの長さ #心ベクトルの座標 #カージオイドを採用する。 x0 <- a0*(1+cos(theta))*cos(theta) y0 <- -a0*(1+cos(theta))*sin(theta) xyCT <- array(0, c(length(theta), 2, 6)) dimnames(xyCT) <- list(NULL, NULL, c("prostate", "rectum", "pubic", "right", "left", "body")) #前立腺 xyCT[, , 1] <- t(rbind(cos(theta), sin(theta))*a0*c(1, -1)) * (1+cos(theta)) #直腸 rr <- c(0.45, 0.4) #円の半径 xyr0 <- c(-0.65, 0) #円の中心座標 xyCT[, , 2] <- t(rbind(cos(theta), sin(theta)) * rr + xyr0) #恥骨 rpb <- c(0.1, 0.5) #円の半径 xypb0 <- c(1.5, 0) #円の中心座標 xyCT[, , 3] <- t(rbind(cos(theta), sin(theta)) * rpb + xypb0) #大腿骨 rfrl <- c(0.7, 0.7) #円の半径 xyfr0 <- c(0.3, 2.3) #円の中心座標 xyfl0 <- xyfr0*c(1, -1) xyCT[, , 4] <- t(rbind(cos(theta), sin(theta)) * rfrl + xyfr0) xyCT[, , 5] <- t(rbind(cos(theta), sin(theta)) * rfrl + xyfl0) #体 rbd <- c(2, 4) #円の半径 xybd0 <- c(0.2, 0) #円の中心座標 xyCT[, , 6] <- t(rbind(cos(theta), sin(theta)) * rbd + xybd0) xylim <- range(xyCT) plot(0, type="n", xlim=xylim, ylim=xylim) for(i in seq(dim(xyCT)[3])){points(xyCT[, , i], type="l", col=i) }
beam <- array(NA, c(length(raddig), 2, 3)) dimnames(beam) <- list(NULL, c("intercept", "coef"), c("centor", "right", "left")) for(i in seq(raddig)){ xb <- c(xyg[1], xyrad[i, 1]) yb <- c(xyg[2], xyrad[i, 2]) coef0 <- diff(yb) / diff(xb) beam[i, "coef", ] <- coef0 beam[i, "intercept", 1] <- sum(xyrad[i, ] * c(-coef0, 1)) for(j in seq(2)){ beam[i, "intercept", j+1] <- sum(xyradwd[i, , j] * c(-coef0, 1)) } } plot(0, type="n", xlim=xylim, ylim=xylim) for(i in seq(dim(xyCT)[3])){points(xyCT[, , i], type="l", col=i)} for(i in seq(nrow(xyrad))){segments(xyradwd[i, 1, 1], xyradwd[i, 2, 1], xyradwd[i, 1, 2], xyradwd[i, 2, 2], col=i)} for(i in seq(raddig)){ for(j in seq(2)){ abline(beam[i, , j+1], lty=2, col=i) }}