dosePaintSetup.asv 4.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. %% script to apply non-uniform prescription in IMRT dose optimization
  2. % prescription matrix 'PTVDosePlus.bin' and 'PTVDoseMinus.bin'
  3. % addpath('C:\Documents and Settings\Steve\Desktop\daveTPS\photonDoseCalc\scripts_m');
  4. % addpath('C:\Documents and Settings\Steve\Desktop\daveTPS\opt\linlsqUtil');
  5. % open prescription in sparse format matlab structure and create PTV mask
  6. %
  7. % presc.x_count (int)
  8. % presc.y_count (int)
  9. % presc.z_count (int)
  10. % presc.Nind (int)
  11. % presc.non_zero_indices (int32)
  12. % presc.non_zero_values (single)
  13. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\AV003f\Doses\AV003f_Continuous_cropped.am');
  14. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\AV003f\Doses\AV003f_PVC_Continuous_cropped.am');
  15. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\AV003f\Doses\AV003f_Threshold_cropped.am');
  16. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\AV003f\Doses\AV003f_PVC_Threshold_cropped.am');
  17. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\AV004c\Doses\AV004c_Continuous_cropped.am');
  18. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\AV004c\Doses\AV004c_PVC_Continuous_cropped.am');
  19. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\AV004c\Doses\AV004c_Threshold_cropped.am');
  20. pet = am2geom('D:\FTP\Dose Painting\AAPM09\AV004c\Doses\AV004c_PVC_Threshold_cropped.am');
  21. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\HN002b\Doses\HN002b_Continuous_cropped.am');
  22. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\HN002b\Doses\HN002b_PVC_Continuous_cropped.am');
  23. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\HN002b\Doses\HN002b_Threshold_cropped.am');
  24. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\HN002b\Doses\HN002b_PVC_Threshold_cropped.am');
  25. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\AV001c\Doses\AV001c_Continuous_cropped.am');
  26. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\AV001c\Doses\AV001c_PVC_Continuous_cropped.am');
  27. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\AV001c\Doses\AV001c_Threshold_cropped.am');
  28. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\AV001c\Doses\AV001c_PVC_Threshold_cropped.am');
  29. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\AV001f\Doses\AV001f_Continuous_cropped.am');
  30. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\AV001f\Doses\AV001f_PVC_Continuous_cropped.am');
  31. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\AV001f\Doses\AV001f_Threshold_cropped.am');
  32. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\AV001f\Doses\AV001f_PVC_Threshold_cropped.am');
  33. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\HN003c\Doses\HN003c_Continuous_cropped.am');
  34. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\HN003c\Doses\HN003c_PVC_Continuous_cropped.am');
  35. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\HN003c\Doses\HN003c_Threshold_cropped.am');
  36. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\HN003c\Doses\HN003c_PVC_Threshold_cropped.am');
  37. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\AV004f\Doses\AV004f_Continuous_cropped.am');
  38. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\AV004f\Doses\AV004f_PVC_Continuous_cropped.am');
  39. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\AV004f\Doses\AV004f_Threshold_cropped.am');
  40. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\AV004f\Doses\AV004f_PVC_Threshold_cropped.am');
  41. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\AV002f\Doses\AV002f_Continuous_cropped.am');
  42. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\AV002f\Doses\AV002f_PVC_Continuous_cropped.am');
  43. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\AV002f\Doses\AV002f_Threshold_cropped.am');
  44. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\AV002f\Doses\AV002f_PVC_Threshold_cropped.am');
  45. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\AV005c\Doses\AV005c_Continuous_cropped.am');
  46. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\AV005c\Doses\AV005c_PVC_Continuous_cropped.am');
  47. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\AV005c\Doses\AV005c_Threshold_cropped.am');
  48. % pet = am2geom('D:\FTP\Dose Painting\AAPM09\AV005c\Doses\AV005c_PVC_Threshold_cropped.am');
  49. % load('D:\FTP\Dose Painting\AAPM09\HN003c\Doses\HN003c_U01_3MM_continuous.mat');
  50. % load('D:\FTP\Dose Painting\AAPM09\HN003c\Doses\HN003c_U01_5MM_continuous.mat');
  51. % load('D:\FTP\Dose Painting\AAPM09\HN003c\Doses\HN003c_U01_7MM_continuous.mat');
  52. %
  53. % load('D:\FTP\Dose Painting\AAPM09\HN003c\Doses\HN003c_U01_3MM_SUV70_threshold.mat');
  54. % load('D:\FTP\Dose Painting\AAPM09\HN003c\Doses\HN003c_U01_5MM_SUV70_threshold.mat');
  55. % load('D:\FTP\Dose Painting\AAPM09\HN003c\Doses\HN003c_U01_7MM_SUV70_threshold.mat');
  56. %
  57. % load('D:\FTP\Dose Painting\AAPM09\HN003c\Doses\HN003c_U01_3MM_SUV40_CTV54_GTV72.mat');
  58. load('D:\FTP\Dose Painting\AAPM09\HN003c\Doses\HN003c_U01_5MM_SUV40_CTV54_GTV72.mat');
  59. % load('D:\FTP\Dose Painting\AAPM09\HN003c\Doses\HN003c_U01_7MM_SUV40_CTV54_GTV72.mat');
  60. %
  61. % load('D:\FTP\Dose Painting\AAPM09\HN003c\Doses\HN003c_U01_5MM_SUV40_CTV54_GTV94.mat');
  62. % load('D:\FTP\Dose Painting\AAPM09\HN003c\Doses\HN003c_U01_5MM_SUV40_CTV54_GTV99.mat');
  63. petSparse = sparse3D(presc);
  64. % petSparse = sparse3D(pet.data);
  65. petSparse.Nind = length(petSparse.non_zero_indices);
  66. % write prescription to file
  67. write_presc(petSparse,'GTV');
  68. fprintf('Uniform prescription sucessfully replaced with non-uniform prescription.\n');