Skip to content

Commit 233566a

Browse files
committed
new focus spot spacing Lookup name
1 parent 5785ec0 commit 233566a

8 files changed

+37
-13
lines changed

examples/matRad_example13_fitAnalyticalParticleBaseData.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,18 +109,18 @@
109109
pln.radiationMode = 'protons';
110110

111111
% create meta machine data
112-
machine.meta.machine = 'example'; %name of the machine
112+
machine.meta.name = 'example'; %name of the machine
113113
machine.meta.radiationMode = 'protons'; %modality
114114
machine.meta.dataType = 'singleGauss'; %singleGauss or doubleGauss
115115
machine.meta.created_on = date;
116116
machine.meta.created_by = 'matRad_example';
117117
machine.meta.SAD = (2218 + 1839) / 2; %This is the (virtual) source to axis distance
118118
machine.meta.BAMStoIsoDist = 420.0; %distance from beam nozzle ot isocenter
119-
machine.meta.LUT_bxWidthminFWHM = [0, Inf; 5 ,5]; %Specifies which minimum FWHM to use as spot sice for which ranges of lateral spot distance (here, each spot distance of 0 to to Inf gets at least 5mm wide spots
119+
machine.meta.LUTspotSize = [0, Inf; 5 ,5]; %Specifies which minimum FWHM to use as spot sice for which ranges of lateral spot distance (here, each spot distance of 0 to to Inf gets at least 5mm wide spots
120120
machine.meta.fitAirOffset = 420.0; %Tells matRad how much "air" was considered during fitting. Set this to 0 if the fit is obtained in vacuum and no air transport is simulated up to the phantom. matRad assumes that the phantom starts at the isocenter.
121121

122122
% Now add the example machine to the pln and then save it
123-
pln.machine = machine.meta.machine;
123+
pln.machine = machine.meta.name;
124124
pln.radiationMode = machine.meta.radiationMode;
125125
fileName = [pln.radiationMode '_' pln.machine];
126126
filePath = fullfile(matRad_cfg.userfolders{1},'machines',[fileName '.mat']);
10 Bytes
Binary file not shown.

matRad/doseCalc/+DoseEngines/matRad_ParticleAnalyticalBortfeldEngine.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,10 @@ function calcLateralParticleCutOff(this,cutOffLevel,~)
365365
return;
366366
end
367367

368-
checkMeta = all(isfield(machine.meta,{'SAD','BAMStoIsoDist','LUT_bxWidthminFWHM','dataType'}));
368+
checkMeta = all(isfield(machine.meta,{'SAD','BAMStoIsoDist','dataType'}));
369+
370+
%Superseded names from older machine file versions
371+
checkMeta = checkMeta && any(isfield(machine.meta,{'LUTspotSize','LUT_bxWidthminFWHM'}));
369372

370373
dataType = machine.meta.dataType;
371374
if strcmp(dataType,'singleGauss')

matRad/doseCalc/+DoseEngines/matRad_ParticleFineSamplingPencilBeamEngine.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,10 @@ function setDefaults(this)
424424
return;
425425
end
426426

427-
checkMeta = all(isfield(machine.meta,{'SAD','BAMStoIsoDist','LUT_bxWidthminFWHM','dataType'}));
427+
checkMeta = all(isfield(machine.meta,{'SAD','BAMStoIsoDist','dataType'}));
428+
429+
%Superseded names from older machine file versions
430+
checkMeta = checkMeta && any(isfield(machine.meta,{'LUTspotSize','LUT_bxWidthminFWHM'}));
428431

429432
dataType = machine.meta.dataType;
430433
if strcmp(dataType,'singleGauss')

matRad/doseCalc/+DoseEngines/matRad_ParticleHongPencilBeamEngine.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,10 @@
124124
return;
125125
end
126126

127-
checkMeta = all(isfield(machine.meta,{'SAD','BAMStoIsoDist','LUT_bxWidthminFWHM','dataType'}));
127+
checkMeta = all(isfield(machine.meta,{'SAD','BAMStoIsoDist','dataType'}));
128+
129+
%Superseded names from older machine file versions
130+
checkMeta = checkMeta && any(isfield(machine.meta,{'LUTspotSize','LUT_bxWidthminFWHM'}));
128131

129132
dataType = machine.meta.dataType;
130133
if strcmp(dataType,'singleGauss')

matRad/steering/matRad_StfGeneratorExternalRayBixelAbstract.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ function initialize(this)
472472
%checkBasic
473473
available = isfield(machine,'meta') && isfield(machine,'data');
474474

475-
available = available && isfield(machine.meta,'machine');
475+
available = available && any(isfield(machine.meta,{'machine','name'}));
476476

477477
available = available && isfield(machine.meta,'SAD') && isscalar(machine.meta.SAD);
478478

matRad/steering/matRad_StfGeneratorParticleIMPT.m

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@
4747

4848
isoCenterInCubeCoords = matRad_world2cubeCoords(beam.isoCenter,this.ct);
4949

50+
if isfield(this.machine.meta,'LUT_bxWidthminFWHM')
51+
LUTspotSize = this.machine.meta.LUT_bxWidthminFWHM;
52+
else
53+
LUTspotSize = this.machine.meta.LUTspotSize;
54+
end
55+
56+
5057
beam.numOfBixelsPerRay = zeros(1,beam.numOfRays);
5158

5259
for j = beam.numOfRays:-1:1
@@ -172,10 +179,10 @@
172179

173180
% book keeping & calculate focus index
174181
beam.numOfBixelsPerRay(j) = numel([beam.ray(j).energy]);
175-
currentMinimumFWHM = matRad_interp1(this.machine.meta.LUT_bxWidthminFWHM(1,:)',...
176-
this.machine.meta.LUT_bxWidthminFWHM(2,:)',...
182+
currentMinimumFWHM = matRad_interp1(LUTspotSize(1,:)',...
183+
LUTspotSize(2,:)',...
177184
this.bixelWidth, ...
178-
this.machine.meta.LUT_bxWidthminFWHM(2,end));
185+
LUTspotSize(2,end));
179186
focusIx = ones(beam.numOfBixelsPerRay(j),1);
180187
[~, vEnergyIx] = min(abs(bsxfun(@minus,[this.machine.data.energy]',...
181188
repmat(beam.ray(j).energy,length([this.machine.data]),1))));

matRad/steering/matRad_StfGeneratorParticleSingleBeamlet.m

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,18 @@ function createPatientGeometry(this)
170170

171171
% get the focus index
172172
if isfield(this.machine.meta,'LUT_bxWidthminFWHM')
173-
currentMinimumFWHM = matRad_interp1(this.machine.meta.LUT_bxWidthminFWHM(1,:)',...
174-
this.machine.meta.LUT_bxWidthminFWHM(2,:)',...
173+
LUTspotSize = this.machine.meta.LUT_bxWidthminFWHM;
174+
elseif isfield(this.machine.meta,'LUTspotSize')
175+
LUTspotSize = this.machine.meta.LUTspotSize;
176+
else
177+
LUTspotSize = [];
178+
end
179+
180+
if ~isempty(LUTspotSize)
181+
currentMinimumFWHM = matRad_interp1(LUTspotSize(1,:)',...
182+
LUTspotSize(2,:)',...
175183
beam.bixelWidth, ...
176-
this.machine.meta.LUT_bxWidthminFWHM(2,end));
184+
LUTspotSize(2,end));
177185

178186
beam.ray.focusIx = find(this.machine.data(vEnergyIx).initFocus.SisFWHMAtIso > currentMinimumFWHM,1,'first');
179187
else

0 commit comments

Comments
 (0)