diff --git a/matRad_computeSSD.m b/matRad_computeSSD.m index f9189f69b..811277bb7 100644 --- a/matRad_computeSSD.m +++ b/matRad_computeSSD.m @@ -35,6 +35,9 @@ mode = 'first'; end +% booleon to show warnings only once in the console +boolShowWarning = true; + % set density threshold for SSD computation densityThreshold = 0.05; @@ -50,13 +53,16 @@ {ct.cube{1}}); ixSSD = find(rho{1} > densityThreshold,1,'first'); - - if isempty(ixSSD) - warning('ray does not hit patient. Trying to fix afterwards...'); - elseif ixSSD(1) == 1 - warning('Surface for SSD calculation starts directly in first voxel of CT\n'); + if boolShowWarning + if isempty(ixSSD) + matRad_dispToConsole('ray does not hit patient. Trying to fix afterwards...',[],'warning'); + boolShowWarning = false; + elseif ixSSD(1) == 1 + matRad_dispToConsole('Surface for SSD calculation starts directly in first voxel of CT\n',[],'warning'); + boolShowWarning = false; + end end - + % calculate SSD SSD{j} = double(2 * stf(i).SAD * alpha(ixSSD)); stf(i).ray(j).SSD = SSD{j}; diff --git a/matRad_dispToConsole.m b/matRad_dispToConsole.m index 342b7d704..42cdda068 100644 --- a/matRad_dispToConsole.m +++ b/matRad_dispToConsole.m @@ -48,7 +48,7 @@ function matRad_dispToConsole(string,param,typeOfMessage,formatSpec) if param.logLevel < 4 - fprintf(string); + fprintf(['[\bWarning:]\b ' string]); end