diff --git a/matRad/doseCalc/+DoseEngines/matRad_PencilBeamEngineAbstract.m b/matRad/doseCalc/+DoseEngines/matRad_PencilBeamEngineAbstract.m index 8833847c9..be64d33e9 100644 --- a/matRad/doseCalc/+DoseEngines/matRad_PencilBeamEngineAbstract.m +++ b/matRad/doseCalc/+DoseEngines/matRad_PencilBeamEngineAbstract.m @@ -531,6 +531,10 @@ function setDefaults(this) end end + if this.keepRadDepthCubes && ~isempty(this.radDepthCubes) + dij.radDepthCubes = this.radDepthCubes; + end + dij = this.finalizeDose@DoseEngines.matRad_DoseEngineBase(dij); end end diff --git a/matRad/rayTracing/matRad_siddonRayTracer.m b/matRad/rayTracing/matRad_siddonRayTracer.m index a4cd45a40..c1cc9313e 100644 --- a/matRad/rayTracing/matRad_siddonRayTracer.m +++ b/matRad/rayTracing/matRad_siddonRayTracer.m @@ -84,10 +84,11 @@ doesHit = false; for t = tvalues p = sourcePoint + t*(targetPoint - sourcePoint); - if (p(1) >= xPlane_1 && p(1) <= xPlane_end && ... - p(2) >= yPlane_1 && p(2) <= yPlane_end && ... - p(3) >= zPlane_1 && p(3) <= zPlane_end) + lowerPlanes = [xPlane_1,yPlane_1,zPlane_1] - sqrt(eps); + upperPlanes = [xPlane_end,yPlane_end,zPlane_end] + sqrt(eps); + if all(p > lowerPlanes & p < upperPlanes) doesHit = true; + continue; end end