function get_full_dose(path_in) % path_in='C:\010-work\003_localGit\WiscPlan_v2\WiscPlanPhotonkV125\PatientData'; optResultsFile = [path_in, '\matlab_files\optResults.mat']; load(optResultsFile); D = read_ryan_beamlets([path_in '\beamlet_batch_files\beamletbatch0.bin'],'ryan sum', optResults.weights{end}); optResults.batchNames{end+1} = optResults.batchNames{end}; optResults.dose{end+1} = D; optResults.weights{end+1} = optResults.weights{end}; save(optResultsFile, 'optResults', 'optSettings'); %% save also in alter format NLP_result.dose = double(D); NLP_result.weights = double(optResults.weights{end}); save([path_in, '\matlab_files\Classical_opt.mat'], 'NLP_result');