Skip to content

Commit 8c08414

Browse files
committed
octave fix
1 parent bb8ec01 commit 8c08414

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

matRad/doseCalc/+DoseEngines/matRad_TopasMCEngine.m

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,24 +1362,25 @@ function writeScorers(obj,fID,beamIx)
13621362
scorerTxt = strrep(scorerTxt, 'Alpha/', ['Alpha' num2str(PhaseNum) '/']);
13631363
scorerTxt = strrep(scorerTxt, 'Beta/', ['Beta' num2str(PhaseNum) '/']);
13641364
scorerTxt = strrep(scorerTxt, '/RBE', ['/RBE' num2str(PhaseNum)]);
1365-
if contains(lower(obj.scorer.RBE_model{i}),'mcn')
1365+
if ~isempty(regexp(obj.scorer.RBE_model{i}, 'mcn', 'ignorecase'))
13661366
scorerTxt = strrep(scorerTxt, '_alpha_MCN', ['_alpha_MCN-matRad_cube' num2str(PhaseNum)]);
13671367
scorerTxt = strrep(scorerTxt, '_beta_MCN', ['_beta_MCN-matRad_cube' num2str(PhaseNum)]);
1368-
elseif contains(lower(obj.scorer.RBE_model{i}),'wed')
1368+
elseif ~isempty(regexp(obj.scorer.RBE_model{i}, 'wed', 'ignorecase'))
13691369
scorerTxt = strrep(scorerTxt, '_alpha_WED', ['_alpha_WED-matRad_cube' num2str(PhaseNum)]);
13701370
scorerTxt = strrep(scorerTxt, '_beta_WED', ['_beta_WED-matRad_cube' num2str(PhaseNum)]);
1371-
elseif contains(lower(obj.scorer.RBE_model{i}),'lem')
1371+
elseif ~isempty(regexp(obj.scorer.RBE_model{i}, 'lem', 'ignorecase'))
13721372
scorerTxt = strrep(scorerTxt, '_alpha_LEM', ['_alpha_LEM-matRad_cube' num2str(PhaseNum)]);
13731373
scorerTxt = strrep(scorerTxt, '_beta_LEM', ['_beta_LEM-matRad_cube' num2str(PhaseNum)]);
13741374
scorerTxt = strrep(scorerTxt, '_RBE_LEM', ['_RBE_LEM-matRad_cube' num2str(PhaseNum)]);
1375-
elseif contains(lower(obj.scorer.RBE_model{i}),'libamtrack')
1375+
elseif ~isempty(regexp(obj.scorer.RBE_model{i}, 'libamtrack', 'ignorecase'))
13761376
scorerTxt = strrep(scorerTxt, '_alpha_libamtrack', ['_alpha_libamtrack-matRad_cube' num2str(PhaseNum)]);
13771377
scorerTxt = strrep(scorerTxt, '_beta_libamtrack', ['_beta_libamtrack-matRad_cube' num2str(PhaseNum)]);
13781378
scorerTxt = strrep(scorerTxt, '_RBE_libamtrack', ['_RBE_libamtrack-matRad_cube' num2str(PhaseNum)]);
13791379
end
13801380
%dont allways write cell lines
1381-
if contains(scorerTxt,'### HCP Tabulated ###')
1382-
scorerTxt = extractBefore(scorerTxt, '### HCP Tabulated ###');
1381+
idx = strfind(scorerTxt, '### HCP Tabulated ###');
1382+
if ~isempty(idx)
1383+
scorerTxt = scorerTxt(1:idx(1)-1);
13831384
end
13841385
fprintf(fID,'\n%s\n\n',scorerTxt);
13851386
scorerInString = {'tabulatedAlpha', 'tabulatedBeta', 'RBE', 'McNamaraAlpha', 'McNamaraBeta', 'WedenbergAlpha', 'WedenbergBeta'};

0 commit comments

Comments
 (0)