-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathrun.m
46 lines (37 loc) · 1.17 KB
/
run.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
% Example for setting up problem with FluenceMapOpt
clear all; close all; clc;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% For each organ included in the plan, create a structure containing the
% following fields:
%
% name: string used in data files
% constraints: cell of organ constraints
%
% Each term has the following fields ('unif' doesn't need 'percent'):
%
% type: string 'unif', 'ldvc', or 'udvc'
% dose: dose in Gy
% percent: no more than p% receives more than (udvc) or less than (ldvc)
% specified dose value
% weight: weight in objective function
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% PTV - prostate
ptv.name = 'PTV_68';
ptv.terms = {struct('type','unif','dose',81,'weight',1)};
% OAR - rectum
oar.name = 'Rectum';
oar.terms = {struct('type','udvc','dose',50,'percent',50,'weight',1)};
% Create problem instance
structs = {ptv,oar};
prob = FluenceMapOpt(structs);
% Calculate beamlet intensities
prob.calcBeams();
% Plot objective function
prob.plotObj();
% Plot dose-volume histogram
prob.plotDVH();
% Plot beamlet intensities
prob.plotBeams();
% Plot dose
prob.plotDose();