|
121 | 121 |
|
122 | 122 |
|
123 | 123 | pln.propStf.bixelWidth = 5; % [mm] template grid distance |
124 | | -pln.propStf.templateRoot = matRad_getTemplateRoot(ct,cst); % mass center of |
125 | | -% target in x and y and bottom in z |
| 124 | + |
| 125 | +%Template Type |
| 126 | +pln.propStf.template.type = 'checkerboard'; % 'checkerboard' if template is created automatically |
| 127 | + % 'manual' if template is needed as preset manually (see below) |
| 128 | + |
| 129 | +%Template Root - mass center of target in x and y and bottom in z |
| 130 | +pln.propStf.template.root = matRad_getTemplateRoot(ct,cst); |
126 | 131 |
|
127 | 132 | % Here, we define active needles as 1 and inactive needles |
128 | 133 | % as 0. This is the x-y plane and needles point in z direction. |
129 | 134 | % A checkerboard pattern is frequantly used. The whole geometry will become |
130 | 135 | % clearer when it is displayed in 3D view in the next section. |
131 | | - |
132 | | -pln.propStf.template.activeNeedles = [0 0 0 1 0 1 0 1 0 1 0 0 0;... % 7.0 |
133 | | - 0 0 1 0 1 0 0 0 1 0 1 0 0;... % 6.5 |
134 | | - 0 1 0 1 0 1 0 1 0 1 0 1 0;... % 6.0 |
135 | | - 1 0 1 0 1 0 0 0 1 0 1 0 1;... % 5.5 |
136 | | - 0 1 0 1 0 1 0 1 0 1 0 1 0;... % 5.0 |
137 | | - 1 0 1 0 1 0 0 0 1 0 1 0 1;... % 4.5 |
138 | | - 0 1 0 1 0 1 0 1 0 1 0 1 0;... % 4.0 |
139 | | - 1 0 1 0 1 0 0 0 1 0 1 0 1;... % 4.5 |
140 | | - 0 1 0 1 0 1 0 1 0 1 0 1 0;... % 3.0 |
141 | | - 1 0 1 0 1 0 1 0 1 0 1 0 1;... % 2.5 |
142 | | - 0 1 0 1 0 1 0 1 0 1 0 1 0;... % 2.0 |
143 | | - 1 0 1 0 1 0 0 0 0 0 1 0 1;... % 1.5 |
144 | | - 0 0 0 0 0 0 0 0 0 0 0 0 0]; % 1.0 |
145 | | - %A a B b C c D d E e F f G |
146 | | - |
147 | | -pln.propStf.isoCenter = matRad_getIsoCenter(cst,ct,0); % target center |
148 | | - |
149 | | - |
| 136 | +if strcmp(pln.propStf.template.type,'manual') |
| 137 | + pln.propStf.template.activeNeedles = [0 0 0 1 0 1 0 1 0 1 0 0 0;... % 7.0 |
| 138 | + 0 0 1 0 1 0 0 0 1 0 1 0 0;... % 6.5 |
| 139 | + 0 1 0 1 0 1 0 1 0 1 0 1 0;... % 6.0 |
| 140 | + 1 0 1 0 1 0 0 0 1 0 1 0 1;... % 5.5 |
| 141 | + 0 1 0 1 0 1 0 1 0 1 0 1 0;... % 5.0 |
| 142 | + 1 0 1 0 1 0 0 0 1 0 1 0 1;... % 4.5 |
| 143 | + 0 1 0 1 0 1 0 1 0 1 0 1 0;... % 4.0 |
| 144 | + 1 0 1 0 1 0 0 0 1 0 1 0 1;... % 4.5 |
| 145 | + 0 1 0 1 0 1 0 1 0 1 0 1 0;... % 3.0 |
| 146 | + 1 0 1 0 1 0 1 0 1 0 1 0 1;... % 2.5 |
| 147 | + 0 1 0 1 0 1 0 1 0 1 0 1 0;... % 2.0 |
| 148 | + 1 0 1 0 1 0 0 0 0 0 1 0 1;... % 1.5 |
| 149 | + 0 0 0 0 0 0 0 0 0 0 0 0 0]; % 1.0 |
| 150 | + %A a B b C c D d E e F f G |
| 151 | +end |
150 | 152 |
|
151 | 153 | %% II.1 - dose calculation options |
152 | 154 | % for dose calculation we use eather the 2D or the 1D formalism proposed by |
|
176 | 178 | else |
177 | 179 | pln.propOpt.optimizer = 'IPOPT'; |
178 | 180 | end |
| 181 | + |
| 182 | +pln.propOpt.optimizer = 'IPOPT'; |
179 | 183 | %% II.1 - book keeping |
180 | 184 | % Some field names have to be kept although they don't have a direct |
181 | 185 | % relevance for brachy therapy. |
|
189 | 193 |
|
190 | 194 | %% II.1 - view plan |
191 | 195 | % Et voila! Our treatment plan structure is ready. Lets have a look: |
192 | | -display(pln); |
| 196 | +disp(pln); |
193 | 197 |
|
194 | 198 |
|
195 | 199 | %% II.2 Steering Seed Positions From STF |
196 | 200 | % The steering file struct contains all needls/catheter geometry with the |
197 | 201 | % target volume, number of needles, seeds and the positions of all needles |
198 | 202 | % The one in the end enables visualization. |
199 | 203 |
|
200 | | -stf = matRad_generateStf(ct,cst,pln,1); |
| 204 | +stf = matRad_generateStf(ct,cst,pln); |
| 205 | + |
201 | 206 |
|
202 | 207 | %% II.2 - view stf |
203 | 208 | % The 3D view is interesting, but we also want to know how the stf struct |
204 | 209 | % looks like. |
205 | | - |
206 | | -display(stf) |
| 210 | +disp(stf); |
207 | 211 |
|
208 | 212 | %% II.3 - Dose Calculation |
209 | 213 | % Let's generate dosimetric information by pre-computing a dose influence |
|
226 | 230 | %% IV.1 Plot the Resulting Dose Slice |
227 | 231 | % Let's plot the transversal iso-center dose slice |
228 | 232 |
|
229 | | -slice = matRad_world2cubeIndex(pln.propStf.isoCenter(1,:),ct); |
| 233 | +slice = matRad_world2cubeIndex(matRad_getIsoCenter(cst,ct),ct); |
230 | 234 | slice = slice(3); |
231 | 235 | figure |
232 | 236 | imagesc(resultGUI.physicalDose(:,:,slice)),colorbar, colormap(jet); |
|
0 commit comments