Skip to content

Commit 842027e

Browse files
authored
Merge branch 'dev' into dev_bioModelMerging
2 parents 8fa1308 + 205cfac commit 842027e

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

matRad/doseCalc/+DoseEngines/matRad_ParticleHongPencilBeamEngine.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@
7474
matRad_cfg.dispError('Invalid Lateral Model');
7575
end
7676

77-
bixel.physicalDose = bixel.baseData.LatCutOff.CompFac * L .* kernels.Z;
77+
if length(bixel.baseData.LatCutOff.CompFac) > 1
78+
bixel.baseData.LatCutOff.CompFac = matRad_interp1(bixel.baseData.LatCutOff.depths', bixel.baseData.LatCutOff.CompFac', bixel.radDepths);
79+
end
80+
bixel.physicalDose = bixel.baseData.LatCutOff.CompFac .* L .* kernels.Z;
7881

7982
% check if we have valid dose values
8083
if any(isnan(bixel.physicalDose)) || any(bixel.physicalDose<0)

matRad/doseCalc/+DoseEngines/matRad_ParticlePencilBeamEngineAbstract.m

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -673,14 +673,15 @@ function calcLateralParticleCutOff(this,cutOffLevel,stfElement)
673673

674674
% Find radius at which integrated dose becomes
675675
% bigger than cutoff * IDD
676+
676677
switch this.cutOffMethod
677678
case 'integral'
678679
IX = find(cumArea >= idd(j) * cutOffLevel,1, 'first');
679680
this.machine.data(energyIx).LatCutOff.CompFac = cutOffLevel^-1;
680681
case 'relative'
681682
IX = find(dose_r <= (1-cutOffLevel) * max(dose_r), 1, 'first');
682683
relFac = cumArea(IX)./cumArea(end); % (or idd(j)) to find the appropriate integral of dose
683-
this.machine.data(energyIx).LatCutOff.CompFac = relFac^-1;
684+
this.machine.data(energyIx).LatCutOff.CompFac(j) = relFac^-1;
684685
otherwise
685686
matRad_cfg.dispError('LateralParticleCutOff: Invalid Cutoff Method. Must be ''integral'' or ''relative''!');
686687
end
@@ -831,14 +832,17 @@ function calcLateralParticleCutOff(this,cutOffLevel,stfElement)
831832
else
832833
idd = this.machine.data(energyIx).Z;
833834
end
835+
if length(TmpCompFac)>1
836+
TmpCompFac = matRad_interp1(depthValues, TmpCompFac', radDepths);
837+
end
834838
subplot(312),plot(this.machine.data(energyIx).depths,idd*conversionFactor,'k','LineWidth',2),grid on,hold on
835839
plot(radDepths - this.machine.data(energyIx).offset,vDoseInt,'r--','LineWidth',2),hold on,
836-
plot(radDepths - this.machine.data(energyIx).offset,vDoseInt * TmpCompFac,'bx','LineWidth',1),hold on,
840+
plot(radDepths - this.machine.data(energyIx).offset,vDoseInt .* TmpCompFac,'bx','LineWidth',1),hold on,
837841
legend({'original IDD',['cut off IDD at ' num2str(cutOffLevel) '%'],'cut off IDD with compensation'},'Location','northwest'),
838842
xlabel('z [mm]'),ylabel('[MeV cm^2 /(g * primary)]'),set(gca,'FontSize',12)
839843

840844
totEnergy = trapz(this.machine.data(energyIx).depths,idd*conversionFactor) ;
841-
totEnergyCutOff = trapz(radDepths,vDoseInt * TmpCompFac) ;
845+
totEnergyCutOff = trapz(radDepths,vDoseInt .* TmpCompFac) ;
842846
relDiff = ((totEnergy/totEnergyCutOff)-1)*100;
843847
title(['rel diff of integral dose ' num2str(relDiff) '%']);
844848
baseData.LatCutOff.CompFac = TmpCompFac;

0 commit comments

Comments
 (0)