Open Erhushenshou opened 2 years ago
I have not fully familiar with this code, since it was written by @markbangert and @mingersming, but here's my guesswork at the first part of the code:
https://github.com/e0404/photonPencilBeamKernelCalc/blob/c2296dd625c93b626cb4ed3d0e47ad2c96891c9f/ppbkc.m#L42-L51 Note that in the paper it say that the determination of the beta values is not critical. The fmincon performs a fit, and I think these fits are somewhat heuristic to get to similar magnitudes in the paper, but I could be wrong.
https://github.com/e0404/photonPencilBeamKernelCalc/blob/c2296dd625c93b626cb4ed3d0e47ad2c96891c9f/ppbkc.m#L53-L56 The weights are obtained not directly by a least squares fit, but by building a linear system. A matrix of all pairwise multiplications of D_i is built (mx1) together with a matrix containing the products of D_i with the measured TPRs. Solving this with Matlab’s backslash operator fits a set of weights for each TPR so it is closely reproduced by multiplication with the weights.
I still find it hard to understand why beta could be calculated through optimizing (log(mu)-log(x))/(mu-x) = dmax,dmax-1/mu,1/,u. And why is it that Di.T D/(D.TTpr)=Wi, while the formula in the paper should be . If it is Singular value decomposion in matrix, why is that? Can Mark's email be shared so that confusio could be explained. Great thanks.
The equation you showed, which is Eq. 18 in the paper, is handled later directly together with the kernel part from Eq. 19. https://github.com/e0404/photonPencilBeamKernelCalc/blob/master/ppbkc.m#L105-116
The derivative from (18) is numerically approximated from the linearly fitted W_ri
for all field sizes. From this, the lateral kernels are then directly computed.
Regarding the determination of the beta, it is really purely heuristic. The maxPos_fun describes the maximum position of a depth dose component. The betas are chosen to create depth dose components with (1) a maximum close to the one averaged of all TPR measurments, (3) a deep maximum at 1/mu, and (2) a maximum in-between. One could surely find other heuristics or find the "best" beta values / depth dose components, but there does not seem to be the need for it as long as you are choosing somewhat reasonable betas given the physical motivation behind the curves.
Thanks for reply. So what are the physical considerations and aspects of choosing to create depth dose components with (1) a maximum close to the one averaged of all TPR measurments, (3) a deep maximum at 1/mu, and (2) a maximum in-between?
For the exact values, there is none afaik. These values are chosen to "mimic" what isolation of primary and small/large field scatter would give according to the paper. Sorry that I can't give a more satisfying answer here. But note that the decomposition does not need a physical motivation, you could also choose a purely mathematical one, or, as in our case, a heuristic. If you want to choose different values, do it.
Hi Mark, I am new to TPS calculation algorithms. I have trouble in reading your code in ppbkc.m as to generate kernel.
I don't quite understand this algorithm. I can't find any detailed formulas in Bortfeld et al.(1993) article. Can you help me get through this that I can understand the whole algorithm better. If I learn more, I have more capabilities to join the open source team for TPS algorithms. Thanks.
Tonio