1 00:00:04,500 --> 00:00:09,350 In this video, we'll solve our simple example in LibreOffice. 2 00:00:09,350 --> 00:00:11,310 Go ahead and open the spreadsheet, 3 00:00:11,310 --> 00:00:12,100 IMRT_SimpleExample. 4 00:00:14,730 --> 00:00:18,400 At the top of the spreadsheet, you should see our data. 5 00:00:18,400 --> 00:00:21,560 For each beamlet and each voxel, we 6 00:00:21,560 --> 00:00:24,200 have the dose that that beamlet gives 7 00:00:24,200 --> 00:00:27,560 to that voxel at unit intensity. 8 00:00:27,560 --> 00:00:32,860 So we have this data for voxel one, voxel two, voxel three, 9 00:00:32,860 --> 00:00:35,750 all the way up to voxel nine. 10 00:00:35,750 --> 00:00:39,650 Each row corresponds to one of the six beamlets. 11 00:00:39,650 --> 00:00:41,810 This is the data that we saw on the slides 12 00:00:41,810 --> 00:00:44,200 in the previous video. 13 00:00:44,200 --> 00:00:47,660 Below the data, we've outlined our decision variables, 14 00:00:47,660 --> 00:00:50,530 which are the intensities of the beamlets. 15 00:00:50,530 --> 00:00:55,560 So for beamlets one through six, we have one decision variable. 16 00:00:55,560 --> 00:00:59,700 These six decision variables are outlined in yellow. 17 00:00:59,700 --> 00:01:01,770 Right now, the decision variable cells 18 00:01:01,770 --> 00:01:06,870 are blank, because the values will be filled in by Solver. 19 00:01:06,870 --> 00:01:10,440 Below the decision variables, we have our objective. 20 00:01:10,440 --> 00:01:15,160 Our objective is to minimize the total dose to healthy tissue. 21 00:01:15,160 --> 00:01:20,750 The healthy-tissue voxels are voxels one, three, five, six, 22 00:01:20,750 --> 00:01:22,200 and nine. 23 00:01:22,200 --> 00:01:25,320 So let's go ahead and build our objective in the blue cell 24 00:01:25,320 --> 00:01:27,070 here. 25 00:01:27,070 --> 00:01:30,150 So first, we want to add up the total dose 26 00:01:30,150 --> 00:01:34,310 that each beamlet gives to voxel one. 27 00:01:34,310 --> 00:01:36,690 So here we'll use the function that we 28 00:01:36,690 --> 00:01:40,060 used in the previous lecture, sumproduct. 29 00:01:40,060 --> 00:01:44,840 So type an equals sign, and then sumproduct, 30 00:01:44,840 --> 00:01:50,400 and select all of the decision variables, semicolon, and then 31 00:01:50,400 --> 00:01:52,420 all of the doses. 32 00:01:52,420 --> 00:01:55,440 This will add up the total dose that beamlet one gives 33 00:01:55,440 --> 00:01:58,400 to voxel one, plus the total dose beamlet two 34 00:01:58,400 --> 00:02:00,910 gives to voxel one, plus the total dose 35 00:02:00,910 --> 00:02:04,700 beamlet three gives to voxel one, etc. 36 00:02:04,700 --> 00:02:08,210 Now we want to repeat this for voxels three, five, six, 37 00:02:08,210 --> 00:02:11,460 and nine-- the other healthy-tissue voxels. 38 00:02:11,460 --> 00:02:13,830 So go ahead and type a plus sign, 39 00:02:13,830 --> 00:02:18,540 and then sumproduct, again, the six decision variables, 40 00:02:18,540 --> 00:02:24,380 semicolon, and this time, select the dose data for voxel three. 41 00:02:24,380 --> 00:02:28,240 Now let's repeat this again, but this time for voxel five. 42 00:02:28,240 --> 00:02:30,620 So sumproduct, and then the decision 43 00:02:30,620 --> 00:02:35,050 variables, and the dose data for voxel five. 44 00:02:35,050 --> 00:02:40,410 Now for voxel six, sumproduct, the decision variables, 45 00:02:40,410 --> 00:02:45,170 semicolon, and the dose data for voxel six. 46 00:02:45,170 --> 00:02:49,650 And lastly, we're going to add the sumproduct of the decision 47 00:02:49,650 --> 00:02:55,900 variables, semicolon, and then scroll over to voxel nine, 48 00:02:55,900 --> 00:02:58,620 and select the dose data for voxel nine. 49 00:02:58,620 --> 00:03:01,480 Close the parentheses, and hit Enter. 50 00:03:01,480 --> 00:03:04,390 You should see that the objective has a 0 right now, 51 00:03:04,390 --> 00:03:06,690 because none of our decision-variable values 52 00:03:06,690 --> 00:03:07,960 are filled in. 53 00:03:07,960 --> 00:03:10,420 When Solver fills in our decision variables, 54 00:03:10,420 --> 00:03:14,040 our objective value will be here. 55 00:03:14,040 --> 00:03:17,370 Below the objective is our constraints. 56 00:03:17,370 --> 00:03:20,520 The first four constraints make sure that each voxel 57 00:03:20,520 --> 00:03:24,290 of the tumor is getting a dose of at least 7. 58 00:03:24,290 --> 00:03:27,350 The last constraint makes sure that the spinal cord 59 00:03:27,350 --> 00:03:30,760 receives a dose of no more than 5. 60 00:03:30,760 --> 00:03:33,870 Let's go ahead and construct our constraints. 61 00:03:33,870 --> 00:03:36,820 For the first four constraints, the left-hand side 62 00:03:36,820 --> 00:03:40,100 is going to be the total dose that that voxel of the tumor 63 00:03:40,100 --> 00:03:41,190 gets. 64 00:03:41,190 --> 00:03:44,100 So for voxel two, we have the left-hand side 65 00:03:44,100 --> 00:03:48,340 is equal to the sumproduct of the decision 66 00:03:48,340 --> 00:03:55,210 variables, semicolon, and then the data for voxel two. 67 00:03:55,210 --> 00:03:57,610 Close the parentheses, and hit Enter. 68 00:03:57,610 --> 00:03:59,880 We want to make sure that this value is 69 00:03:59,880 --> 00:04:03,230 greater than or equal to 7. 70 00:04:03,230 --> 00:04:05,430 Now let's repeat this for voxel four. 71 00:04:05,430 --> 00:04:10,060 So equals sumproduct, and then, in parentheses, 72 00:04:10,060 --> 00:04:13,840 select the decision variables, semicolon, 73 00:04:13,840 --> 00:04:16,149 and the data for voxel four. 74 00:04:16,149 --> 00:04:22,260 Again, we also want this one to be greater than or equal to 7. 75 00:04:22,260 --> 00:04:24,570 Now let's repeat this for voxel seven. 76 00:04:24,570 --> 00:04:31,140 So sumproduct of the decision variables, semicolon, and then 77 00:04:31,140 --> 00:04:40,670 the data for voxel seven, again, greater than or equal to 7. 78 00:04:40,670 --> 00:04:45,250 And lastly, for voxel eight, we want the sumproduct 79 00:04:45,250 --> 00:04:49,590 of the decision variables, and the data for voxel eight 80 00:04:49,590 --> 00:04:58,350 this time to also be greater than or equal to 7. 81 00:04:58,350 --> 00:05:00,540 And our last constraint, we want to make sure 82 00:05:00,540 --> 00:05:03,350 that the total dose to voxel five, 83 00:05:03,350 --> 00:05:06,170 the spinal cord voxel-- so sumproduct 84 00:05:06,170 --> 00:05:12,430 of the decision variables, and then the data for voxel five, 85 00:05:12,430 --> 00:05:17,270 is less than or equal to 5. 86 00:05:17,270 --> 00:05:18,790 The remaining constraints we have 87 00:05:18,790 --> 00:05:20,570 are the non-negativity constraints, 88 00:05:20,570 --> 00:05:23,660 which we'll add in directly in the Solver. 89 00:05:23,660 --> 00:05:29,250 So now go ahead and go to the Tools menu, and select Solver. 90 00:05:29,250 --> 00:05:31,770 The Solver window should pop up. 91 00:05:31,770 --> 00:05:34,870 First we need to tell Solver what our objective is. 92 00:05:34,870 --> 00:05:37,690 So go ahead and delete what's in "Target cell", 93 00:05:37,690 --> 00:05:40,700 and making sure that your cursor is in "Target cell", 94 00:05:40,700 --> 00:05:43,680 select the blue objective cell. 95 00:05:43,680 --> 00:05:46,830 Now, we want to change "Maximum" to "Minimum", because we're 96 00:05:46,830 --> 00:05:51,080 trying to minimize the total dose to healthy tissue, 97 00:05:51,080 --> 00:05:56,360 and our decision variables should be the six yellow cells. 98 00:05:56,360 --> 00:05:58,300 Now let's add in our constraints. 99 00:05:58,300 --> 00:06:00,680 So in the first "Cell reference" box, 100 00:06:00,680 --> 00:06:02,920 let's select the first four constraints. 101 00:06:02,920 --> 00:06:05,350 Because they're all greater than or equal to constraints, 102 00:06:05,350 --> 00:06:07,710 we can add them in together. 103 00:06:07,710 --> 00:06:11,380 And change the "Operator" to greater than or equal to, 104 00:06:11,380 --> 00:06:16,400 and then in "Value", select the four right-hand sides. 105 00:06:16,400 --> 00:06:18,700 Now let's add in the spinal-cord constraint. 106 00:06:18,700 --> 00:06:20,850 So in the next "Cell reference" box, 107 00:06:20,850 --> 00:06:23,360 select the spinal cord left-hand side, 108 00:06:23,360 --> 00:06:25,030 make sure that "Operator" is less than 109 00:06:25,030 --> 00:06:27,910 or equal to, and in the second "Value" box, 110 00:06:27,910 --> 00:06:31,430 select the spinal cord, right-hand side. 111 00:06:31,430 --> 00:06:33,720 Now let's add our non-negativity constraints. 112 00:06:33,720 --> 00:06:37,230 So in the "Cell reference", just directly pick the six decision 113 00:06:37,230 --> 00:06:45,530 variables, and make sure the "Operator" 114 00:06:45,530 --> 00:06:51,330 is greater than or equal to, and the "Value" should just be 0. 115 00:06:51,330 --> 00:06:53,060 Now, in the Options, make sure you've 116 00:06:53,060 --> 00:06:58,370 selected the Linear Solver, and click OK. 117 00:06:58,370 --> 00:07:01,710 Now go ahead and hit Solve. 118 00:07:01,710 --> 00:07:03,480 You should see a solving result that 119 00:07:03,480 --> 00:07:05,750 says: "Solving successfully finished. 120 00:07:05,750 --> 00:07:08,490 Result: 22.75". 121 00:07:08,490 --> 00:07:11,750 That's the optimal objective function value. 122 00:07:11,750 --> 00:07:14,770 Go ahead and select Keep Result. 123 00:07:14,770 --> 00:07:17,240 Now let's take a look at our solution. 124 00:07:17,240 --> 00:07:19,350 So the optimal solution is to have 125 00:07:19,350 --> 00:07:23,070 beamlet one at an intensity 2.25, 126 00:07:23,070 --> 00:07:26,180 beamlet two at an intensity of 0, 127 00:07:26,180 --> 00:07:28,980 beamlet three at an intensity of 3, 128 00:07:28,980 --> 00:07:32,420 beamlet four at an intensity of 3.5, 129 00:07:32,420 --> 00:07:35,430 beamlet five at an intensity of 2.5, 130 00:07:35,430 --> 00:07:39,270 and beamlet six at an intensity of 0. 131 00:07:39,270 --> 00:07:42,010 This makes sense, because beamlet two goes 132 00:07:42,010 --> 00:07:45,620 across the spinal cord, and beamlet six only 133 00:07:45,620 --> 00:07:48,940 goes down healthy-tissue voxels. 134 00:07:48,940 --> 00:07:50,840 And if we look at our constraints, 135 00:07:50,840 --> 00:07:55,340 we can double-check that each tumor voxel is receiving a dose 136 00:07:55,340 --> 00:07:59,400 of at least 7 -- one tumor voxel gets a dose of 8 -- 137 00:07:59,400 --> 00:08:02,340 and the spinal cord is receiving a dose of 5, 138 00:08:02,340 --> 00:08:05,700 which is the maximum possible dose. 139 00:08:05,700 --> 00:08:09,660 In the next video, we'll see an example of a real problem, 140 00:08:09,660 --> 00:08:14,070 and how big the problem is on an actual tumor case.