1
0

nrrd2ROI.m 961 B

1234567891011121314151617181920212223242526
  1. function Geometry=nrrd2ROI(Geometry, patient_dir)
  2. %% -----===== Get ROI mask =====-----
  3. while true
  4. newRoi = questdlg('Do you want to load another ROI?','New ROI','Yes','No','No')
  5. switch newRoi
  6. case 'Yes'
  7. [TRGT_in, TRGT_path, ~] = uigetfile(['C:\010-work\003_localGit\WiscPlan_v2\data\','*.nrrd']);
  8. if TRGT_in==0 % no file selected, no change to CT data
  9. warning('No file selected!')
  10. else
  11. [TRGT_img, meta]=nrrdread([TRGT_path, TRGT_in]);
  12. end
  13. Geometry.ROIS{end+1}.ind = find(TRGT_img>0);
  14. str = input('Enter ROI name: \n','s');
  15. Geometry.ROIS{end}.name= str;
  16. save(fullfile(patient_dir, 'matlab_files', 'Geometry.mat'), 'Geometry');
  17. case 'No'
  18. break
  19. end
  20. end
  21. end