make_ROI_goals.m 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  1. function make_ROI_goals (Geometry, beamlets, beamlets_joined, patient)
  2. % this is a support function for NLP_beamlet_optimizer. It creates the
  3. % goals planned for specific patients.
  4. switch patient
  5. case 'patient'
  6. ROI_goals.optGoal = make_ROI_goals_Pat(Geometry, beamlets);
  7. ROI_goals.optGoal_beam = make_ROI_goals_Pat(Geometry, beamlets_joined);
  8. ROI_goals.optGoal_idx=[1,2];
  9. ROI_goals.targetMinMax_idx=[1,3];
  10. case 'tomoPhantom'
  11. ROI_goals.optGoal = make_ROI_goals_Pat2(Geometry, beamlets);
  12. ROI_goals.optGoal_beam = make_ROI_goals_Pat2(Geometry, beamlets_joined);
  13. ROI_goals.optGoal_idx=[1,3];
  14. ROI_goals.targetMinMax_idx=[1,2];
  15. case 'phantom_HD'
  16. ROI_goals.optGoal = make_ROI_goals(Geometry, beamlets);
  17. ROI_goals.optGoal_beam = make_ROI_goals(Geometry, beamlets_joined);
  18. ROI_goals.optGoal_idx=[1,3];
  19. ROI_goals.targetMinMax_idx=[1,2];
  20. case 'doggo'
  21. % optGoal = make_ROI_goals_DOG(Geometry, beamlets);
  22. % optGoal_beam = make_ROI_goals_DOG(Geometry, beamlets_joined);
  23. ROI_goals.optGoal = make_ROI_goals_DOG_2(Geometry, beamlets);
  24. ROI_goals.optGoal_beam = make_ROI_goals_DOG_2(Geometry, beamlets_joined);
  25. ROI_goals.optGoal_idx=[1,2];
  26. ROI_goals.targetMinMax_idx=[1,3];
  27. case 'gbm_005'
  28. ROI_goals.optGoal = make_ROI_goals_gbm_005(Geometry, beamlets);
  29. ROI_goals.optGoal_beam = make_ROI_goals_gbm_005(Geometry, beamlets_joined);
  30. ROI_goals.optGoal_idx=[1,3]; % indeces of volumes you want on histogram
  31. ROI_goals.targetMinMax_idx=[1,2]; % indeces of limits for min/max target volume
  32. otherwise
  33. error('invalid case')
  34. end
  35. save(['C:\010-work\003_localGit\WiscPlan_v2\optGoals\' patient, '.mat'], 'ROI_goals')
  36. end
  37. % ---- MAKE ROI GOALS ----
  38. % min, max, min_sq, max_sq, LeastSquare, min_perc_Volume, max_perc_Volume
  39. function optGoal = make_ROI_goals_Pat(Geometry, beamlets)
  40. optGoal={};
  41. % -- START DEFINITION OF GOAL --
  42. goal_1.name = 'Target_min';
  43. goal_1.ROI_name = Geometry.ROIS{1, 2}.name;
  44. ROI_idx = Geometry.ROIS{1, 2}.ind;
  45. goal_1.ROI_idx = ROI_idx;
  46. goal_1.imgDim = size(Geometry.data);
  47. goal_1.D_final = 60;
  48. goal_1.function = 'min';
  49. goal_1.beamlets_pruned = beamlets(ROI_idx, :);
  50. goal_1.target = ones(numel(ROI_idx), 1) * goal_1.D_final;
  51. goal_1.opt_weight = 10 / numel(ROI_idx); % normalize to volume of target area
  52. goal_1.dvh_col = [0.9, 0.2, 0.2]; % color of the final DVH plot
  53. % assign target
  54. optGoal{end+1}=goal_1;
  55. % -- END DEFINITION OF GOAL --
  56. % -- START DEFINITION OF GOAL --
  57. goal_2.name = 'Target_max';
  58. goal_2.ROI_name = Geometry.ROIS{1, 2}.name;
  59. ROI_idx = Geometry.ROIS{1, 2}.ind;
  60. goal_2.ROI_idx = ROI_idx;
  61. goal_2.imgDim = size(Geometry.data);
  62. goal_2.D_final = 65;
  63. goal_2.function = 'max';
  64. goal_2.beamlets_pruned = beamlets(ROI_idx, :);
  65. goal_2.target = ones(numel(ROI_idx), 1) * goal_2.D_final;
  66. goal_2.opt_weight = 0.8 / numel(ROI_idx); % normalize to volume of target area
  67. goal_2.dvh_col = [0.9, 0.2, 0.2]; % color of the final DVH plot
  68. % assign target
  69. optGoal{end+1}=goal_2;
  70. % -- END DEFINITION OF GOAL --
  71. % -- START DEFINITION OF GOAL --
  72. goal_3.name = 'ROI 1_max';
  73. goal_3.ROI_name = Geometry.ROIS{1, 3}.name;
  74. ROI_idx = Geometry.ROIS{1, 3}.ind;
  75. goal_3.ROI_idx = ROI_idx;
  76. goal_3.imgDim = size(Geometry.data);
  77. goal_3.D_final = 10;
  78. goal_3.function = 'max';
  79. goal_3.beamlets_pruned = beamlets(ROI_idx, :);
  80. goal_3.target = ones(numel(ROI_idx), 1) * goal_3.D_final;
  81. goal_3.opt_weight = 2 / numel(ROI_idx); % normalize to volume of target area
  82. goal_3.dvh_col = [0.2, 0.9, 0.2]; % color of the final DVH plot
  83. % assign target
  84. optGoal{end+1}=goal_3;
  85. % -- END DEFINITION OF GOAL --
  86. end
  87. function optGoal = make_ROI_goals_Pat2(Geometry, beamlets)
  88. optGoal={};
  89. % -- START DEFINITION OF GOAL --
  90. goal_1.name = 'Target_min';
  91. goal_1.ROI_name = Geometry.ROIS{1, 2}.name;
  92. ROI_idx = Geometry.ROIS{1, 2}.ind;
  93. goal_1.ROI_idx = ROI_idx;
  94. goal_1.imgDim = size(Geometry.data);
  95. goal_1.D_final = 62;
  96. goal_1.function = 'min';
  97. goal_1.beamlets_pruned = beamlets(ROI_idx, :);
  98. goal_1.target_alpha = 1.00;
  99. goal_1.target = ones(numel(ROI_idx), 1) * goal_1.D_final;
  100. goal_1.opt_weight = 10 / numel(ROI_idx); % normalize to volume of target area
  101. goal_1.dvh_col = [0.9, 0.2, 0.2]; % color of the final DVH plot
  102. % assign target
  103. optGoal{end+1}=goal_1;
  104. % -- END DEFINITION OF GOAL --
  105. % -- START DEFINITION OF GOAL --
  106. goal_2.name = 'Target_max';
  107. goal_2.ROI_name = Geometry.ROIS{1, 2}.name;
  108. ROI_idx = Geometry.ROIS{1, 2}.ind;
  109. goal_2.ROI_idx = ROI_idx;
  110. goal_2.imgDim = size(Geometry.data);
  111. goal_2.D_final = 63;
  112. goal_2.function = 'max';
  113. goal_2.beamlets_pruned = beamlets(ROI_idx, :);
  114. goal_1.target_alpha = 1.05;
  115. goal_2.target = ones(numel(ROI_idx), 1) * goal_2.D_final;
  116. goal_2.opt_weight = 2 / numel(ROI_idx); % normalize to volume of target area
  117. goal_2.dvh_col = [0.9, 0.2, 0.2]; % color of the final DVH plot
  118. % assign target
  119. optGoal{end+1}=goal_2;
  120. % -- END DEFINITION OF GOAL --
  121. % -- START DEFINITION OF GOAL --
  122. goal_3.name = 'ROI 1_max';
  123. goal_3.ROI_name = Geometry.ROIS{1, 3}.name;
  124. ROI_idx = Geometry.ROIS{1, 3}.ind;
  125. goal_3.ROI_idx = ROI_idx;
  126. goal_3.imgDim = size(Geometry.data);
  127. goal_3.D_final = 10;
  128. goal_3.function = 'max';
  129. goal_3.beamlets_pruned = beamlets(ROI_idx, :);
  130. goal_3.target = ones(numel(ROI_idx), 1) * goal_3.D_final;
  131. goal_3.opt_weight = 2 / numel(ROI_idx); % normalize to volume of target area
  132. goal_3.dvh_col = [0.2, 0.9, 0.2]; % color of the final DVH plot
  133. % assign target
  134. optGoal{end+1}=goal_3;
  135. % -- END DEFINITION OF GOAL --
  136. % -- START DEFINITION OF GOAL --
  137. goal_4.name = 'Ring_max';
  138. goal_4.ROI_name = Geometry.ROIS{1, 6}.name;
  139. ROI_idx = Geometry.ROIS{1, 6}.ind;
  140. goal_4.ROI_idx = ROI_idx;
  141. goal_4.imgDim = size(Geometry.data);
  142. goal_4.D_final = 56;
  143. goal_4.function = 'max_sq';
  144. goal_4.beamlets_pruned = beamlets(ROI_idx, :);
  145. goal_4.target = ones(numel(ROI_idx), 1) * goal_4.D_final;
  146. goal_4.opt_weight = 1 / numel(ROI_idx); % normalize to volume of target area
  147. goal_4.dvh_col = [0.9, 0.2, 0.2]; % color of the final DVH plot
  148. % assign target
  149. optGoal{end+1}=goal_4;
  150. % -- END DEFINITION OF GOAL --
  151. end
  152. function optGoal = make_ROI_goals_DOG(Geometry, beamlets)
  153. optGoal={};
  154. % -- START DEFINITION OF GOAL --
  155. goal_1.name = 'Target_min';
  156. goal_1.ROI_name = Geometry.ROIS{1, 1}.name;
  157. ROI_idx = Geometry.ROIS{1, 1}.ind;
  158. goal_1.ROI_idx = ROI_idx;
  159. goal_1.imgDim = size(Geometry.data);
  160. goal_1.D_final = 62;
  161. goal_1.function = 'min_sq';
  162. goal_1.beamlets_pruned = beamlets(ROI_idx, :);
  163. goal_1.target = ones(numel(ROI_idx), 1) * goal_1.D_final;
  164. goal_1.opt_weight = 10 / numel(ROI_idx); % normalize to volume of target area
  165. goal_1.dvh_col = [0.9, 0.2, 0.2]; % color of the final DVH plot
  166. % assign target
  167. optGoal{end+1}=goal_1;
  168. % -- END DEFINITION OF GOAL --
  169. % -- START DEFINITION OF GOAL --
  170. goal_2.name = 'Doggo_max';
  171. goal_2.ROI_name = Geometry.ROIS{1, 4}.name;
  172. ROI_idx = Geometry.ROIS{1, 4}.ind;
  173. goal_2.ROI_idx = ROI_idx;
  174. goal_2.imgDim = size(Geometry.data);
  175. goal_2.D_final = 20;
  176. goal_2.function = 'max_sq';
  177. goal_2.beamlets_pruned = beamlets(ROI_idx, :);
  178. goal_2.target = ones(numel(ROI_idx), 1) * goal_2.D_final;
  179. goal_2.opt_weight = 0.2 / numel(ROI_idx); % normalize to volume of target area
  180. goal_2.dvh_col = [0.2, 0.9, 0.2]; % color of the final DVH plot
  181. % assign target
  182. optGoal{end+1}=goal_2;
  183. % -- END DEFINITION OF GOAL --
  184. % -- START DEFINITION OF GOAL --
  185. goal_3.name = 'Target_max';
  186. goal_3.ROI_name = Geometry.ROIS{1, 1}.name;
  187. ROI_idx = Geometry.ROIS{1, 1}.ind;
  188. goal_3.ROI_idx = ROI_idx;
  189. goal_3.imgDim = size(Geometry.data);
  190. goal_3.D_final = 63;
  191. goal_3.function = 'max_sq';
  192. goal_3.beamlets_pruned = beamlets(ROI_idx, :);
  193. goal_3.target = ones(numel(ROI_idx), 1) * goal_3.D_final;
  194. goal_3.opt_weight = 2 / numel(ROI_idx); % normalize to volume of target area
  195. goal_3.dvh_col = [0.9, 0.2, 0.2]; % color of the final DVH plot
  196. % assign target
  197. optGoal{end+1}=goal_3;
  198. % -- END DEFINITION OF GOAL --
  199. % -- START DEFINITION OF GOAL --
  200. goal_3.name = 'Doggo_max2';
  201. goal_3.ROI_name = Geometry.ROIS{1, 4}.name;
  202. ROI_idx = Geometry.ROIS{1, 4}.ind;
  203. goal_3.ROI_idx = ROI_idx;
  204. goal_3.imgDim = size(Geometry.data);
  205. goal_3.D_final = 50;
  206. goal_3.function = 'max_sq';
  207. goal_3.beamlets_pruned = beamlets(ROI_idx, :);
  208. goal_3.target = ones(numel(ROI_idx), 1) * goal_3.D_final;
  209. goal_3.opt_weight = 1 / numel(ROI_idx); % normalize to volume of target area
  210. goal_3.dvh_col = [0.2, 0.9, 0.2]; % color of the final DVH plot
  211. % assign target
  212. optGoal{end+1}=goal_3;
  213. % -- END DEFINITION OF GOAL --
  214. end
  215. function optGoal = make_ROI_goals_DOG_2(Geometry, beamlets)
  216. optGoal={};
  217. % -- START DEFINITION OF GOAL --
  218. goal_1.name = 'Target_min';
  219. goal_1.ROI_name = Geometry.ROIS{1, 1}.name;
  220. ROI_idx = Geometry.ROIS{1, 1}.ind;
  221. goal_1.ROI_idx = ROI_idx;
  222. goal_1.imgDim = size(Geometry.data);
  223. goal_1.D_final = 62;
  224. goal_1.function = 'min_sq';
  225. goal_1.beamlets_pruned = beamlets(ROI_idx, :);
  226. goal_1.target_alpha = 1.00;
  227. goal_1.target = ones(numel(ROI_idx), 1) * goal_1.D_final;
  228. goal_1.opt_weight = 10 / numel(ROI_idx); % normalize to volume of target area
  229. goal_1.dvh_col = [0.9, 0.2, 0.2]; % color of the final DVH plot
  230. % assign target
  231. optGoal{end+1}=goal_1;
  232. % -- END DEFINITION OF GOAL --
  233. % -- START DEFINITION OF GOAL --
  234. goal_2.name = 'Doggo_max';
  235. goal_2.ROI_name = Geometry.ROIS{1, 4}.name;
  236. ROI_idx = Geometry.ROIS{1, 4}.ind;
  237. goal_2.ROI_idx = ROI_idx;
  238. goal_2.imgDim = size(Geometry.data);
  239. goal_2.D_final = 20;
  240. goal_2.function = 'max_sq';
  241. goal_2.beamlets_pruned = beamlets(ROI_idx, :);
  242. goal_2.target = ones(numel(ROI_idx), 1) * goal_2.D_final;
  243. goal_2.opt_weight = 0.2 / numel(ROI_idx); % normalize to volume of target area
  244. goal_2.dvh_col = [0.2, 0.9, 0.2]; % color of the final DVH plot
  245. % assign target
  246. optGoal{end+1}=goal_2;
  247. % -- END DEFINITION OF GOAL --
  248. % -- START DEFINITION OF GOAL --
  249. goal_3.name = 'Target_max';
  250. goal_3.ROI_name = Geometry.ROIS{1, 1}.name;
  251. ROI_idx = Geometry.ROIS{1, 1}.ind;
  252. goal_3.ROI_idx = ROI_idx;
  253. goal_3.imgDim = size(Geometry.data);
  254. goal_3.D_final = 63;
  255. goal_3.function = 'max_sq';
  256. goal_3.beamlets_pruned = beamlets(ROI_idx, :);
  257. goal_3.target_alpha = 1.05;
  258. goal_3.target = ones(numel(ROI_idx), 1) * goal_3.D_final;
  259. goal_3.opt_weight = 2 / numel(ROI_idx); % normalize to volume of target area
  260. goal_3.dvh_col = [0.9, 0.2, 0.2]; % color of the final DVH plot
  261. % assign target
  262. optGoal{end+1}=goal_3;
  263. % -- END DEFINITION OF GOAL --
  264. % -- START DEFINITION OF GOAL --
  265. goal_4.name = 'Doggo_max2';
  266. goal_4.ROI_name = Geometry.ROIS{1, 4}.name;
  267. ROI_idx = Geometry.ROIS{1, 4}.ind;
  268. goal_4.ROI_idx = ROI_idx;
  269. goal_4.imgDim = size(Geometry.data);
  270. goal_4.D_final = 50;
  271. goal_4.function = 'max_sq';
  272. goal_4.beamlets_pruned = beamlets(ROI_idx, :);
  273. goal_4.target = ones(numel(ROI_idx), 1) * goal_4.D_final;
  274. goal_4.opt_weight = 1 / numel(ROI_idx); % normalize to volume of target area
  275. goal_4.dvh_col = [0.2, 0.9, 0.2]; % color of the final DVH plot
  276. % assign target
  277. optGoal{end+1}=goal_4;
  278. % -- END DEFINITION OF GOAL --
  279. end
  280. function optGoal = make_ROI_goals_DOG_3(Geometry, beamlets)
  281. optGoal={};
  282. % -- START DEFINITION OF GOAL --
  283. goal_1.name = 'Target_min';
  284. goal_1.ROI_name = Geometry.ROIS{1, 1}.name;
  285. ROI_idx = Geometry.ROIS{1, 1}.ind;
  286. goal_1.ROI_idx = ROI_idx;
  287. goal_1.imgDim = size(Geometry.data);
  288. goal_1.D_final = 62;
  289. goal_1.function = 'min_perc_Volume';
  290. goal_1.beamlets_pruned = beamlets(ROI_idx, :);
  291. goal_1.target_alpha = 1.00;
  292. goal_1.target = ones(numel(ROI_idx), 1) * goal_1.D_final;
  293. goal_1.opt_weight = 10 / numel(ROI_idx); % normalize to volume of target area
  294. goal_1.dvh_col = [0.9, 0.2, 0.2]; % color of the final DVH plot
  295. % assign target
  296. optGoal{end+1}=goal_1;
  297. % -- END DEFINITION OF GOAL --
  298. % -- START DEFINITION OF GOAL --
  299. goal_2.name = 'Doggo_max';
  300. goal_2.ROI_name = Geometry.ROIS{1, 4}.name;
  301. ROI_idx = Geometry.ROIS{1, 4}.ind;
  302. goal_2.ROI_idx = ROI_idx;
  303. goal_2.imgDim = size(Geometry.data);
  304. goal_2.D_final = 20;
  305. goal_2.function = 'max_sq';
  306. goal_2.beamlets_pruned = beamlets(ROI_idx, :);
  307. goal_2.targetImg = ones(numel(ROI_idx), 1) * goal_2.D_final;
  308. goal_2.target = ones(numel(ROI_idx), 1) * goal_2.D_final;
  309. goal_2.opt_weight = 0.2 / numel(ROI_idx); % normalize to volume of target area
  310. goal_2.dvh_col = [0.2, 0.9, 0.2]; % color of the final DVH plot
  311. % assign target
  312. optGoal{end+1}=goal_2;
  313. % -- END DEFINITION OF GOAL --
  314. % -- START DEFINITION OF GOAL --
  315. goal_3.name = 'Target_max';
  316. goal_3.ROI_name = Geometry.ROIS{1, 1}.name;
  317. ROI_idx = Geometry.ROIS{1, 1}.ind;
  318. goal_3.ROI_idx = ROI_idx;
  319. goal_3.imgDim = size(Geometry.data);
  320. goal_3.D_final = 63;
  321. goal_3.function = 'max_perc_Volume';
  322. goal_3.beamlets_pruned = beamlets(ROI_idx, :);
  323. goal_3.target_alpha = 1.05;
  324. goal_3.target = ones(numel(ROI_idx), 1) * goal_3.D_final;
  325. goal_3.opt_weight = 0.5 / numel(ROI_idx); % normalize to volume of target area
  326. goal_3.dvh_col = [0.9, 0.2, 0.2]; % color of the final DVH plot
  327. % assign target
  328. optGoal{end+1}=goal_3;
  329. % -- END DEFINITION OF GOAL --
  330. % -- START DEFINITION OF GOAL --
  331. goal_4.name = 'Doggo_max2';
  332. goal_4.ROI_name = Geometry.ROIS{1, 4}.name;
  333. ROI_idx = Geometry.ROIS{1, 4}.ind;
  334. goal_4.ROI_idx = ROI_idx;
  335. goal_4.imgDim = size(Geometry.data);
  336. goal_4.D_final = 50;
  337. goal_4.function = 'max_sq';
  338. goal_4.beamlets_pruned = beamlets(ROI_idx, :);
  339. goal_4.target = ones(numel(ROI_idx), 1) * goal_4.D_final;
  340. goal_4.opt_weight = 1 / numel(ROI_idx); % normalize to volume of target area
  341. goal_4.dvh_col = [0.2, 0.9, 0.2]; % color of the final DVH plot
  342. % assign target
  343. optGoal{end+1}=goal_4;
  344. % -- END DEFINITION OF GOAL --
  345. end
  346. function optGoal = make_ROI_goals_gbm_005(Geometry, beamlets)
  347. optGoal={};
  348. pathIn = '\\Mpufs5\data_wnx1\_Data\Glioma_aus\FET_FGL005\B1\Processed\';
  349. [minDose, minDose_meta] = nrrdread([pathIn 'RODP_files\FET_FGL005_B1_DP_minDose.nrrd']);
  350. [maxDose, maxDose_meta] = nrrdread([pathIn 'RODP_files\FET_FGL005_B1_DP_maxDose.nrrd']);
  351. minDose = double(minDose);
  352. maxDose = double(maxDose);
  353. % -- START DEFINITION OF GOAL --
  354. goal_1.name = 'CTV_min';
  355. goal_1.ROI_name = Geometry.ROIS{1, 1}.name;
  356. ROI_idx = Geometry.ROIS{1, 1}.ind;
  357. goal_1.ROI_idx = ROI_idx;
  358. goal_1.imgDim = size(Geometry.data);
  359. goal_1.D_final = minDose(ROI_idx);
  360. goal_1.function = 'min';
  361. goal_1.beamlets_pruned = beamlets(ROI_idx, :);
  362. % goal_1.target_alpha = 1.00;
  363. goal_1.target = 60 % minDose(ROI_idx);
  364. goal_1.opt_weight = 40 / numel(ROI_idx); % normalize to volume of target area
  365. goal_1.dvh_col = [0.9, 0.2, 0.2]; % color of the final DVH plot
  366. % assign target
  367. optGoal{end+1}=goal_1;
  368. % -- END DEFINITION OF GOAL --
  369. % -- START DEFINITION OF GOAL --
  370. goal_2.name = 'CTV_max';
  371. goal_2.ROI_name = Geometry.ROIS{1, 1}.name;
  372. ROI_idx = Geometry.ROIS{1, 1}.ind;
  373. goal_2.ROI_idx = ROI_idx;
  374. goal_2.imgDim = size(Geometry.data);
  375. goal_2.D_final = maxDose(ROI_idx);
  376. goal_2.function = 'max_sq';
  377. goal_2.beamlets_pruned = beamlets(ROI_idx, :);
  378. % goal_1.target_alpha = 1.00;
  379. goal_2.target = 60 % maxDose(ROI_idx);
  380. goal_2.opt_weight = 2 / numel(ROI_idx); % normalize to volume of target area
  381. goal_2.dvh_col = [0.9, 0.2, 0.2]; % color of the final DVH plot
  382. % assign target
  383. optGoal{end+1}=goal_2;
  384. % -- END DEFINITION OF GOAL --
  385. % -- START DEFINITION OF GOAL --
  386. goal_3.name = 'head_max';
  387. goal_3.ROI_name = Geometry.ROIS{1, 2}.name;
  388. ROI_idx = Geometry.ROIS{1, 2}.ind;
  389. goal_3.ROI_idx = ROI_idx;
  390. goal_3.imgDim = size(Geometry.data);
  391. goal_3.D_final = 0.1;
  392. goal_3.function = 'max_sq';
  393. goal_3.beamlets_pruned = beamlets(ROI_idx, :);
  394. goal_3.target = ones(numel(ROI_idx), 1) * goal_3.D_final;
  395. goal_3.opt_weight = 7 / numel(ROI_idx); % normalize to volume of target area
  396. goal_3.dvh_col = [0.2, 0.9, 0.2]; % color of the final DVH plot
  397. % assign target
  398. optGoal{end+1}=goal_3;
  399. % -- END DEFINITION OF GOAL --
  400. end