Closed ni484call5 closed 3 months ago
You are on the right track.
pln
struct and an stf
struct. The pln
should be quite easy to set up using the examples, as it contains mainly meta-information. The stf
is a bit more complicated. There's two options:
stf
. Then, depending on the log file contents, you could change the respective variables (i.e. spot positions, MUs, etc.) directly in the stf
. stf
from the log file directly. There's information about the data structure here: https://github.com/e0404/matRad/wiki/The-stf-struct . The link is not yet up-to-date with our dev branch, which allows some more variables (i.e. to manage the MU calibration if present in the machine file). Basically, you would need to iterate over all spots in your log-file and derive the correct positions in the ray coordinate system for each spot (all coordinates relative to isocenter, which makes it more simple with BEV data from the log file). Happy to help you with this along the way if you encounter obstacles or wonder about a specific thing / variable from the log-file to correctly set-up in the stf
.
This issue was automatically marked as stale because it has been sitting there for 14 days without activity. It will be closed in 14 days if no further activity occurs.
Thanks your reply.
As your first suggestion, I replace value, spot position and mu, in plan with the one recorded in log file. Then, import the modified RT plan into .mat
file with the import function in matRadGUI and calculating dose with the .mat file
. The process works well.
Next step, In order to increase app efficiency and save time, I try to import only original RTPlan and CT, no RTStruct, into matRad by dicom import function in matRadGUI. The .mat
file is created well. Then, using matRad_calcDoseDirect.m
with it, the .mat file
,
In the first case, an patient RT plan, the dose distribution shown on matRad is broken.
In the second case, an 10*10*10 uniform 2Gy physical dose deposited in water tank, the error shows up
Warning: ray does not hit patient. Trying to fix afterwards...
Error using matRad_computeSSD>matRad_closestNeighbourSSD (line 100)
Could not fix SSD calculation.
Error in matRad_computeSSD (line 77) stf(i).ray(j).SSD = matRad_closestNeighbourSSD(rayPos_bev, SSD, rayPos_bev(j,:));
Error in matRad_calcDoseInit (line 148) stf = matRad_computeSSD(stf,ct);
Error in matRad_calcParticleDose (line 39) matRad_calcDoseInit;
Error in matRad_calcDoseDirect (line 74) dij = matRad_calcParticleDose(ct,stf,pln,cst,calcDoseDirect);
Error in nL_excutePlan (line 12)
I'll try to figure out the importance of RTStruct in the process mentioned above and the possibility to skip it while import RTPlan and calculate dose.
regards,
nicholas
matRad uses the contours to internally figure out where to calculate results. I would suggest to at least have a contour for the whole patient body and a target contour. I've never seen the behavior you observe in your dose distribution, but it can be very well related to missing contours. Also rays missing the patient can be related to that.
Also I suggest to run your stuff with our current "dev" branch.
Hello,
I'm trying to import log file, recorded by nozzle while beam on in carbon therapy, to matRad and recalculating dose in TG119 phantom. The dose calculated from log file by matRad will be compared with origin treatment planning by the method of 2 dimension gamma index. For the purpose mentioned above, I've built base data for specific machine matching machine.data.Z, depth, sigma etc with log file. And next, I guess i should convert log file to stf and use matRad_calcDoseDirect.m. While I can't figure out how to do that? Or you will suggest me to do that by importing log file through matRad_importDicom.m?
regards, nicholas