matRad_rc load BOXPHANTOM.mat pln.radiationMode = 'protons'; pln.machine = 'generic_MCsquare'; pln.numOfFractions = 1; pln.propStf.bixelWidth = 5; pln.propStf.longitudinalSpotSpacing = 3; pln.propStf.gantryAngles = 0; pln.propStf.couchAngles = 0; pln.propStf.numOfBeams = numel(pln.propStf.gantryAngles); pln.propStf.isoCenter = ones(pln.propStf.numOfBeams,1) * matRad_getIsoCenter(cst,ct,0); pln.propDoseCalc.doseGrid.resolution.x = 3; pln.propDoseCalc.doseGrid.resolution.y = 3; pln.propDoseCalc.doseGrid.resolution.z = 3; pln.propDoseCalc.airOffsetCorrection = true; modelName = 'none'; quantityOpt = 'physicalDose'; pln.bioParam = matRad_bioModel(pln.radiationMode,quantityOpt,modelName); pln.propOpt.optimizer = 'IPOPT'; pln.propOpt.runDAO = false; pln.propOpt.runSequencing = false; pln.multScen = matRad_multScen(ct,'nomScen'); pln.propStf.useRangeShifter = false; pln.propDoseCalc.calcLET = true; pln.propDoseCalc.externalCalculation = true; stf = matRad_generateSingleBixelStf(ct,cst,pln); pln.propDoseCalc.engine = 'MCsquare'; pln.propDoseCalc.numHistoriesPerBeamlet = 1e6; dij = matRad_calcDoseInfluence(ct, cst,stf, pln); resultGUI = matRad_calcCubes(ones(dij.totalNumOfBixels,1),dij); %% Monte Carlo dose calculation pln.propDoseCalc.engine = 'MCsquare'; %pln.propDoseCalc.engine = 'TOPAS'; pln.propDoseCalc.numHistoriesDirect = 1e6; resultGUI_MC = matRad_calcDoseDirect(ct,stf,pln,cst,resultGUI.w);