fullRO_mergeBeams.m 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. function fullRO_mergeBeams(Geometry)
  2. % this function loops through a full RO folder and merges all the beamlets
  3. str = input('Enter num of beam batches: ','s');
  4. % get the full RO folder
  5. beamlet_dir = uigetdir([Geometry.patient_dir ], 'Select full RO folder' );
  6. if beamlet_dir == 0
  7. disp('no file selected, aborting')
  8. return
  9. end
  10. % loop through all scenario folders
  11. files = dir(beamlet_dir);
  12. % Get a logical vector that tells which is a directory.
  13. dirFlags = [files.isdir];
  14. % Extract only those that are directories.
  15. scenarioList = files(dirFlags);
  16. idxList = [1:numel(scenarioList)];
  17. for i = 3:numel(idxList);
  18. scenario_i = idxList(i);
  19. scenario_path = [scenarioList(scenario_i).folder, '\', scenarioList(scenario_i).name];
  20. merge_beamlets(str2double(str), scenario_path);
  21. disp(['Scenario ' num2str(i) ' merged!'])
  22. end
  23. disp('All scenario beamlets merged!')
  24. end