@@ -278,7 +278,7 @@ function btnLoadMat_Callback(this, hObject, event)
278278 set(handles .txtInfo ,' String' ,' loaded and ready' );
279279
280280 if evalin(' base' ,' exist('' pln'' )' )
281-
281+ pln = evalin( ' base ' , ' pln ' );
282282
283283 % ct cst and pln available; ready for dose calculation
284284 set(handles .txtInfo ,' String' ,' ready for dose calculation' );
@@ -287,9 +287,10 @@ function btnLoadMat_Callback(this, hObject, event)
287287 set(handles .exportDicomButton ,' Enable' ,' on' );
288288
289289 % check if stf exists
290- if evalin(' base' ,' exist('' stf'' )' )
290+ if evalin(' base' ,' exist('' stf'' )' )
291+ stf = evalin(' base' ,' stf' );
291292 % check if dij, stf and pln match
292- [plnStfMatch , msg ] = matRad_comparePlnStf(evalin( ' base ' , ' pln' ),evalin( ' base ' , ' stf' ) );
293+ [plnStfMatch , msg ] = matRad_comparePlnStf(pln , stf );
293294 if plnStfMatch
294295 % plan is ready for optimization
295296 set(handles .txtInfo ,' String' ,' ready for dose calculation' );
@@ -301,8 +302,11 @@ function btnLoadMat_Callback(this, hObject, event)
301302 end
302303
303304 % check if dij exist
304- if evalin(' base' ,' exist('' dij'' )' ) && plnStfMatch && ~evalin(' base' ,' pln.propOpt.conf3D' )
305- [dijStfMatch , msg ] = matRad_compareDijStf(evalin(' base' ,' dij' ),evalin(' base' ,' stf' ));
305+ conf3D = isfield(pln ,' propOpt' ) && isfield(pln .propOpt ,' conf3D' ) && pln .propOpt .conf3D ;
306+
307+ if evalin(' base' ,' exist('' dij'' )' ) && plnStfMatch && ~conf3D
308+ dij = evalin(' base' ,' dij' );
309+ [dijStfMatch , msg ] = matRad_compareDijStf(dij ,stf );
306310 if dijStfMatch
307311 set(handles .txtInfo ,' String' ,' ready for optimization' );
308312 set(handles .btnOptimize ,' Enable' ,' on' );
@@ -416,7 +420,7 @@ function btnCalcDose_Callback(this, hObject, eventdata)
416420 dij = matRad_calcDoseInfluence(evalin(' base' ,' ct' ),evalin(' base' ,' cst' ),stf ,pln );
417421
418422 % prepare dij for 3d conformal
419- if isfield(pln .propOpt ,' conf3D' ) && pln .propOpt .conf3D
423+ if isfield(pln , ' propOpt ' ) && isfield( pln .propOpt ,' conf3D' ) && pln .propOpt .conf3D
420424 dij = matRad_collapseDij(dij );
421425 end
422426 % assign results to base worksapce
0 commit comments