@@ -1468,6 +1468,7 @@ function btnSetTissue_Callback(this, hObject, eventdata)
14681468
14691469 if evalin(' base' ,' exist('' cst'' )' ) && evalin(' base' ,' exist('' pln'' )' )
14701470 try
1471+ matRad_cfg = MatRad_Config .instance();
14711472 % parse variables from base-workspace
14721473 cst = evalin(' base' ,' cst' );
14731474 pln = evalin(' base' ,' pln' );
@@ -1476,9 +1477,27 @@ function btnSetTissue_Callback(this, hObject, eventdata)
14761477 fileName = [pln .radiationMode ' _' pln .machine ];
14771478 load(fileName );
14781479
1479- % check for available cell types characterized by alphaX and betaX
1480- for i = 1 : size(machine .data(1 ).alphaX,2 )
1481- CellType{i } = [num2str(machine .data(1 ).alphaX(i )) ' ' num2str(machine .data(1 ).betaX(i ))];
1480+ % biological model
1481+ if isfield(matRad_cfg .defaults .bioModel ,pln .radiationMode )
1482+ defaultModel = matRad_cfg .defaults .bioModel.(pln .radiationMode );
1483+ else
1484+ defaultModel = matRad_cfg .defaults .bioModel .fallback ;
1485+ end
1486+ if ~isfield(pln ,' bioModel' )
1487+ pln.bioModel = defaultModel ;
1488+ end
1489+
1490+ bioModel = matRad_BiologicalModel .validate(pln .bioModel ,pln .radiationMode );
1491+
1492+ [availableAlphaX , availableBetaX ] = bioModel .getAvailableTissueParameters(pln );
1493+
1494+ if ~isempty(availableAlphaX ) && ~isempty(availableBetaX )
1495+ for i = 1 : size(availableAlphaX ,2 )
1496+ CellType{i } = [num2str(availableAlphaX(i )) ' ' num2str(availableBetaX(i ))];
1497+ columnformat = {' char' ,CellType ,' numeric' };
1498+ end
1499+ else
1500+ columnformat = {' char' ,' numeric' ,' numeric' };
14821501 end
14831502
14841503 % fill table data array
@@ -1507,16 +1526,42 @@ function btnSetTissue_Callback(this, hObject, eventdata)
15071526 % set focus
15081527 figure(figTissue );
15091528 else
1510- figTissue = figure(' Name' ,' Set Tissue Parameters' ,' Color' ,[.5 .5 .5 ],' NumberTitle' ,' off' ,' OuterPosition' ,...
1511- [ceil(ScreenSize(3 )/2 ) 100 Width Height ]);
1529+ figTissue = figure(' Name' ,' Set Tissue Parameters' , ...
1530+ ' NumberTitle' ,' off' , ...
1531+ ' OuterPosition' ,[ceil(ScreenSize(3 )/2 ) 100 Width Height ],...
1532+ ' Color' ,matRad_cfg .gui .backgroundColor );
15121533 end
15131534
15141535 % define the tissue parameter table
15151536 cNames = {' VOI' ,' alphaX betaX' ,' alpha beta ratio' };
1516- columnformat = {' char' ,CellType ,' numeric' };
1537+ % columnformat = {'char',CellType,'numeric'};
1538+
1539+ % design table colors
1540+ colorMatrix = repmat(matRad_cfg .gui .elementColor ,size(data ,1 ),1 );
1541+ ix2 = 2 : 2 : size(data ,1 );
1542+ if ~isempty(ix2 )
1543+ shadeColor = rgb2hsv(matRad_cfg .gui .elementColor );
1544+ if shadeColor(3 ) < 0.5
1545+ shadeColor(3 ) = shadeColor(3 )*1.5 + 0.1 ;
1546+ else
1547+ shadeColor(3 ) = shadeColor(3 )*0.5 - 0.1 ;
1548+ end
1549+
1550+ colorMatrix(ix2 ,: ) = repmat(hsv2rgb(shadeColor ),numel(ix2 ),1 );
1551+ end
1552+
1553+
1554+ % Create the uitable
1555+ tissueTable = uitable(' Parent' , figTissue , ...
1556+ ' Data' , data , ...
1557+ ' ColumnEditable' ,[false true false ],...
1558+ ' ColumnName' ,cNames , ...
1559+ ' ColumnFormat' ,columnformat , ...
1560+ ' Position' ,[50 150 10 10 ], ...
1561+ ' ForegroundColor' ,matRad_cfg .gui .textColor ,...
1562+ ' BackgroundColor' ,colorMatrix ,...
1563+ ' RowStriping' ,' on' );
15171564
1518- tissueTable = uitable(' Parent' , figTissue ,' Data' , data ,' ColumnEditable' ,[false true false ],...
1519- ' ColumnName' ,cNames , ' ColumnFormat' ,columnformat ,' Position' ,[50 150 10 10 ]);
15201565 set(tissueTable ,' CellEditCallback' ,@(hObject ,eventdata ) tissueTable_CellEditCallback(this ,hObject ,eventdata ));
15211566 % set width and height
15221567 currTablePos = get(tissueTable ,' Position' );
@@ -1525,14 +1570,27 @@ function btnSetTissue_Callback(this, hObject, eventdata)
15251570 currTablePos(4 ) = currTableExt(4 );
15261571 set(tissueTable ,' Position' ,currTablePos );
15271572
1573+ themeParams = {' BackgroundColor' , matRad_cfg .gui .backgroundColor ,...
1574+ ' ForegroundColor' ,matRad_cfg .gui .textColor ,...
1575+ ' FontSize' ,matRad_cfg .gui .fontSize ,...
1576+ ' FontName' ,matRad_cfg .gui .fontName ,...
1577+ ' FontWeight' ,matRad_cfg .gui .fontWeight };
1578+
15281579 % define two buttons with callbacks
1529- uicontrol(' Parent' , figTissue ,' Style' , ' pushbutton' , ' String' , ' Save&Close' ,...
1580+ uicontrol(' Parent' , figTissue , ...
1581+ ' Style' , ' pushbutton' , ...
1582+ ' String' , ' Save&Close' ,...
15301583 ' Position' , [Width -(0.25 * Width ) 0.1 * Height 70 30 ],...
1531- ' Callback' , @(hpb ,eventdata )SaveTissueParameters(this ,hpb ,eventdata ));
1584+ ' Callback' , @(hpb ,eventdata )SaveTissueParameters(this ,hpb ,eventdata ),...
1585+ themeParams{: });
15321586
1533- uicontrol(' Parent' , figTissue ,' Style' , ' pushbutton' , ' String' , ' Cancel&Close' ,...
1587+ uicontrol(' Parent' , ...
1588+ figTissue ,' Style' , ...
1589+ ' pushbutton' , ...
1590+ ' String' , ' Cancel&Close' ,...
15341591 ' Position' , [Width -(0.5 * Width ) 0.1 * Height 80 30 ],...
1535- ' Callback' , ' close' );
1592+ ' Callback' , ' close' , ...
1593+ themeParams{: });
15361594 catch ME
15371595 this .showWarning(' Could not set Tissue parameter update! Reason: %s\n ' ,ME .message )
15381596 end
0 commit comments