-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FFF Kernel Creation & Clarification on Input Data #8
Comments
Just wanted to follow up with my progress thus far. Let me know if this issue is more suited for the main matRad repo. It appears that dose calculation was failing because in matRad_calcPhotonDoseBixel, some of the dose values are less than 0. I see that matRad already performs a correction factor for numerical instability.
I have changed it so that all values below 0 are set to 0, and was able to perform dose calculation without issue.
Obviously this is a non-ideal solution, but I'm not sure why I'm getting negative dose values as large as -3e-5. My colleague has built a script to export plan data from matRad into Eclipse for dose calculation. It appears that even with this error, our FFF matRad machine file is more accurate than the generic one. One last note, I am not setting the I would love to hear about others' experience with generating an FFF machine file! |
Hi @markbangert @wahln @mingersming, apologies for tagging, just doing so in case notifications for this repo are disabled. I have some more updates on this project.
We are seeing a large discrepancy in centerline PDD between the two cases. The PDD fall off is much steeper in matRad than in Eclipse. Please see the figures below. Does anyone have any insight on what could be causing this? We are happy to send our kernel/and or base data for analysis in case there is something weird with our data. |
Hi @edwardwang1, So far I have the following comments:
|
The output factor should be normalized to the field 10x10 cm^2, but the OF depends on the field size (even in your graph). I don't get the question. |
In my stuff it seems to be normalized to 10cm depth at 990 SSD (so normalized in the isocenter), but as long as the correct SSD and depth are set in the script it should work anyways. But just to make sure - are you confident the TPR is correct? Since it is not only a normalization, since PDD is usually measured at fixed SSD with moving detector, while TPR is defined for fixed SAD) and consequently if corrections need to be applied (e.g. inverse square). I think the extrapolation to 0 is done within the script. |
Hi @wahln Thank you for the reply! We are currently trying to build a machine file for Varian Truebeam. However, our center is getting an Ethos soon, so we would like to move towards that eventually as well. Regarding the output factor, our physicist collaborator gave us this table below. However, the the OF.dat in the base data only has 2 columns. Originally, to create OF.dat we took the values from the table at a single column (there by fixing the field size in the X-direction). I'm pretty sure this is incorrect. What we are doing now is taking the diagonal values of the table, and calculating r=sqrt(x^2 + y^2). If this is also incorrect please let me know. I will give the TPR a more thorough look. We are using the data that was collected when the machine was first commissioned, so I assume the necessary adjustments were made, but I will double check with the physics team. |
Ah yes, the output factor is not perfectly symmetric in x/y, which we assume in the script (the script only considers square fields). Regarding your PDDs between Eclipse and matRad, Something is fishy there, maybe at import / depth plot. If you look at the intensity plot, the dose reduced to around 30% of the max value at 200 mm depth in water within matRad, but in your line-plot, it some gets close to zero after 160mm. |
I think your TPR would make sense compared to the also shallow falloff of your depth dose. But something in the comparison is fishy, as said above. |
By the way if you want to have faster calculation time, you can also try to create a very large single bixel. Something like pln.bixelWidth = 50 (depending on your field size you want to validate). |
Hi Niklas, We have fixed our issue with the water phantom PDDs not matching. Embarrassingly, we were using a different sized cube between matRad and Eclipse. After matching the cube sizes, the PDDs became very similar. We still have negative doses during matRad_calcPhotonDoseBixel, but hopefully flooring them to 0 will not affect our downstream tasks. Thanks for your help. |
Hi all, @wahln @markbangert @mingersming (tagging in case notifications are off) Reopening this issue because I have some further questions. All experiments below are run in the master branch. I have modified my protocol such that I directly importing an Eclipse plan into matRad, to avoid any possibility of setup error. I am using a 80x80x80cm phantom with a 40x40x40cm PTV inside it. After importing the CT, RTPlan, RTStruct and RTDose from Eclipse, I perform the dose calculation in matRad using: I have been able to reproduce my results that my custom machine in matRad matches the exported Eclipse dose in both cross beam profile and the PDD at 10x10cm field size. At 40x40cm field size, there are some slight deviations in the crossbeam profiles, but not the PDD. Lastly, I created a IMRT plan for lung in Eclipse, and imported it into matRad. Then, I used the matRad GUI to recalculate the dose (with the "Recalc" button). The animation below is the line profile in the y-direction. There are some differences that are visible, which I believe is due to the heterogeneity in the lung. I see that matRad has a heterogenietyCorrection branch - I will look into it to see if it improves the results. Following this issue,, I tried setting `pln.propDoseCalc.useCustomPrimaryPhotonFluence' to True, but this did not have any effect in the matRad calculated dose (the doses are identical) for the water phantom. This is the case for my custom machine, as well as the generic machine. I also tried changing the flag when recalculating the lung IMRT case - it also had no effect. I am happy to send my waterphantom mat file in case someone wants to try and reproduce! |
Hi @edwardwang1, I'm still a bit worried about the lateral water profile differences. First of all, the dose calculation seems to cut the profile way to early. The penumbra also seems too sharp in the low-dose region. Regarding the parameter |
Hi @wahln, Thanks for the response. Good eye! I didn't even notice the profile being cut off. I have repeated the water phantom crossbeam profile analysis using the dev branch, and it seems that the profile is still being cut off (animations below). I used matRadGUI in the dev branch to re-import my DICOM to take care of any differences in coordinates. The code that I used was:
I believe I came across a small bug. Line 158 of matRad_PhotonPencilBeamSVDEngine.m To fix this, I simply added the line below to the Additionally, running the pencil beam calculation gives the following warning. Perhaps it's related to the profile being cut off? Regarding 'pln.propDoseCalc.useCustomPrimaryPhotonFluence', you are correct that the bixelWidth is indeed being set to Lastly, how is field size specified/calculated in matRad? I know for a single bixel, field size is equal to the bixel width. In Eclipse, the user can specify a field size. How would I do this in matRad for a beam composed of multiple bixels? |
It might indeed be related to the kernel cut off, but I am not sure. Could also be the geometricLateralCutOff; %lateral geometric cut-off in mm, used for raytracing and geometry
dosimetricLateralCutOff; %relative dosimetric cut-off (in fraction of values calculated) Those can also be defined in I would suggest trying to increase the geometric cut-off before thinking about wider kernels. When you use bixels / beamlets for IMRT, matRad does not really consider available field size (or field size limits set with jaws, for example). More generally, matRad does not consider machine parameters related to beam limiting devices (if you look in the machine file, there is also no information regarding this). We rely on the user then to make sure what they compute lines up with their machines. And thanks about the error report, I will fix it on the dev branch (check e0404/matRad@1e107b3). |
Hello,
I am attempting to use this repository to create an 6MV FFF kernel for use in matRad. I have obtained the relevant input data, and was able to run the ppbkc.m script to generate the machine data. However, the calculated kernels seem incorrect (see Figure), and dose calculation in matRad fails. I suspect that there is an error in my input data.
To be specific, here are the steps to generate the input data.
TPR: We calculated TPR from PDD data by simply normalizing the data to the value at 5cm (the standard at our institution). Our measured data only goes down to 30x30mm field size. I understand that we need to perform an extrapolation to obtain the TPR at 0 field size. What was the type of model that was fitted to perform the extrapolation?
OF: We have the OF for a variety of field sizes, however it seems that this repository only takes in one field size. Based on the of.dat files in the referenceData and synergy folders, the field size appears to be 10cm. Is this correct always, or should we be picking a different field size based on our other measurements?
Below, please find the other images generated using the ppbkc.m script.
Thank you
The text was updated successfully, but these errors were encountered: