From 2dc2a025e2d0b9ee83ff6ca9f4f4df68fd271865 Mon Sep 17 00:00:00 2001 From: Marios Dallas Date: Mon, 5 May 2025 12:31:35 +0200 Subject: [PATCH 1/2] Brachy GUI FIX Fixed the dose slicer review and the last warning dialog regarding unrecognised fieldName of numOfRays by adding the isoCenter line in the example script and the numOfRays = NaN in the brachy stf gen accordingly. --- examples/matRad_example15_brachy.m | 4 ++++ matRad/gui/matRad_MainGUI.m | 2 ++ matRad/gui/widgets/matRad_PlanWidget.m | 2 +- .../gui/widgets/matRad_VisualizationWidget.m | 22 +++++++++++++++---- matRad/steering/matRad_StfGeneratorBrachy.m | 1 + 5 files changed, 26 insertions(+), 5 deletions(-) diff --git a/examples/matRad_example15_brachy.m b/examples/matRad_example15_brachy.m index 085d0609e..1685c803d 100644 --- a/examples/matRad_example15_brachy.m +++ b/examples/matRad_example15_brachy.m @@ -190,6 +190,9 @@ pln.propStf.couchAngles = []; pln.propStf.numOfBeams = 0; pln.numOfFractions = 1; +pln.propStf.isoCenter = matRad_getIsoCenter(cst, ct, 0); +pln.propStf.numOfRays = NaN ; + %% II.1 - view plan % Et voila! Our treatment plan structure is ready. Lets have a look: @@ -225,6 +228,7 @@ % visualize the optimized dose cubes. resultGUI = matRad_fluenceOptimization(dij,cst,pln); + matRadGUI; %% IV.1 Plot the Resulting Dose Slice diff --git a/matRad/gui/matRad_MainGUI.m b/matRad/gui/matRad_MainGUI.m index bd4a0eb86..9f3225230 100644 --- a/matRad/gui/matRad_MainGUI.m +++ b/matRad/gui/matRad_MainGUI.m @@ -34,6 +34,7 @@ DVHStatsWidget eventListeners GammaWidget + forceClose = false; end @@ -41,6 +42,7 @@ methods(Access = protected) + function this = createMenuBar(this) h1 = this.guiHandle; folder = fileparts(mfilename('fullpath')); diff --git a/matRad/gui/widgets/matRad_PlanWidget.m b/matRad/gui/widgets/matRad_PlanWidget.m index 9eacde823..d0bf44721 100644 --- a/matRad/gui/widgets/matRad_PlanWidget.m +++ b/matRad/gui/widgets/matRad_PlanWidget.m @@ -300,7 +300,7 @@ h30 = uicontrol(... 'Parent',h12,... 'Units','normalized',... - 'String',{'Generic','generic_MCsquare'},... + 'String',{'Generic','generic_MCsquare','HDR','LDR'},... 'TooltipString',txt,... 'Style','popupmenu',... 'Value',1,... diff --git a/matRad/gui/widgets/matRad_VisualizationWidget.m b/matRad/gui/widgets/matRad_VisualizationWidget.m index 50a8aa224..8c18b64fd 100644 --- a/matRad/gui/widgets/matRad_VisualizationWidget.m +++ b/matRad/gui/widgets/matRad_VisualizationWidget.m @@ -652,10 +652,24 @@ function getFromViewingWidget(this) set(handles.sliderBeamSelection,'Min',1,'Max',1, 'Value',1,'SliderStep',[1 1]); end - % Offset Slider (profile plot) - set(handles.sliderOffset,'Min',this.viewingWidgetHandle.OffsetMinMax(1),'Max',this.viewingWidgetHandle.OffsetMinMax(2),... - 'Value',this.viewingWidgetHandle.profileOffset,... - 'SliderStep',this.viewingWidgetHandle.OffsetSliderStep); + % Offset Slider (profile plot) + + if isfield(this.viewingWidgetHandle, 'OffsetMinMax') && ... + numel(this.viewingWidgetHandle.OffsetMinMax) >= 2 && ... + all(isfinite(this.viewingWidgetHandle.OffsetMinMax)) + + set(handles.sliderOffset, ... + 'Min', this.viewingWidgetHandle.OffsetMinMax(1), ... + 'Max', this.viewingWidgetHandle.OffsetMinMax(2), ... + 'Value', this.viewingWidgetHandle.profileOffset, ... + 'SliderStep', this.viewingWidgetHandle.OffsetSliderStep); + else + warning('OffsetMinMax is improperly defined. Skipping offset slider setup.'); + end + + + + %CT Scenario Slider if numScen > 1 diff --git a/matRad/steering/matRad_StfGeneratorBrachy.m b/matRad/steering/matRad_StfGeneratorBrachy.m index 3a4de97f6..2944268c4 100644 --- a/matRad/steering/matRad_StfGeneratorBrachy.m +++ b/matRad/steering/matRad_StfGeneratorBrachy.m @@ -102,6 +102,7 @@ function initialize(this) stf.numOfSeedsPerNeedle = this.needle.seedsNo; stf.numOfNeedles = sum(this.template.activeNeedles(:)); stf.totalNumOfBixels = stf.numOfSeedsPerNeedle * stf.numOfNeedles; % means total number of seeds + stf.numOfRays = NaN; %% generate 2D template points % the template origin is set at its center. In the image coordinate system, From fdd019440edc9be1f71f9114af1322534b64ed3d Mon Sep 17 00:00:00 2001 From: Marios Dallas Date: Mon, 5 May 2025 13:12:30 +0200 Subject: [PATCH 2/2] Brachy GUI fix v2 Re Replaced the old visualisationWidget code with the old one. The problem wasnt there, it was in the example script :) --- matRad/gui/widgets/matRad_VisualizationWidget.m | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/matRad/gui/widgets/matRad_VisualizationWidget.m b/matRad/gui/widgets/matRad_VisualizationWidget.m index 8c18b64fd..c747039b9 100644 --- a/matRad/gui/widgets/matRad_VisualizationWidget.m +++ b/matRad/gui/widgets/matRad_VisualizationWidget.m @@ -653,19 +653,9 @@ function getFromViewingWidget(this) end % Offset Slider (profile plot) - - if isfield(this.viewingWidgetHandle, 'OffsetMinMax') && ... - numel(this.viewingWidgetHandle.OffsetMinMax) >= 2 && ... - all(isfinite(this.viewingWidgetHandle.OffsetMinMax)) - - set(handles.sliderOffset, ... - 'Min', this.viewingWidgetHandle.OffsetMinMax(1), ... - 'Max', this.viewingWidgetHandle.OffsetMinMax(2), ... - 'Value', this.viewingWidgetHandle.profileOffset, ... - 'SliderStep', this.viewingWidgetHandle.OffsetSliderStep); - else - warning('OffsetMinMax is improperly defined. Skipping offset slider setup.'); - end + set(handles.sliderOffset,'Min',this.viewingWidgetHandle.OffsetMinMax(1),'Max',this.viewingWidgetHandle.OffsetMinMax(2),... + 'Value',this.viewingWidgetHandle.profileOffset,... + 'SliderStep',this.viewingWidgetHandle.OffsetSliderStep);