From 65bef47c943e78e0ff201f95883b1edf281d7858 Mon Sep 17 00:00:00 2001 From: Kwok-shing Chan Date: Tue, 11 Oct 2022 22:51:18 +0200 Subject: [PATCH] prevent missing output dir --- .../sepia_handle_panel_analysis_segmentation_AHEAD.m | 3 ++- .../sepia_handle_panel_analysis_segmentation_CIT168RL.m | 3 ++- .../sepia_handle_panel_analysis_segmentation_MuSus100.m | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gui_func/panel/Analysis_method/sepia_handle_panel_analysis_segmentation_AHEAD.m b/gui_func/panel/Analysis_method/sepia_handle_panel_analysis_segmentation_AHEAD.m index 211c5cc..75d78ef 100644 --- a/gui_func/panel/Analysis_method/sepia_handle_panel_analysis_segmentation_AHEAD.m +++ b/gui_func/panel/Analysis_method/sepia_handle_panel_analysis_segmentation_AHEAD.m @@ -105,7 +105,7 @@ [h.Analysis.segmentation.AHEAD.text.outputDir,... h.Analysis.segmentation.AHEAD.edit.outputDir,... h.Analysis.segmentation.AHEAD.button.outputDir] = sepia_construct_text_edit_button(panelParent,... - 'Ourpur directory:',[],open_icon,pos,wratio); + 'Ourpur directory:',pwd,open_icon,pos,wratio); % correct bias field option pos = [left(1) bottom(14) width height]; h.Analysis.segmentation.AHEAD.checkbox.biasCorr = uicontrol('Parent',panelParent,'backgroundcolor',get(h.fig,'color'),'Style','checkbox','units','normalized',... @@ -217,6 +217,7 @@ function PushbuttonStart_Analysis_segmentation_Callback(source,eventdata,h) % output outputDir = get(h.Analysis.segmentation.AHEAD.edit.outputDir, 'String'); % if the output directory does not exist then create the directory +if isempty(outputDir); outputDir = fullfile(pwd,'segmentation_sepia');end if exist(outputDir,'dir') ~= 7; mkdir(outputDir); end % create a new m file diff --git a/gui_func/panel/Analysis_method/sepia_handle_panel_analysis_segmentation_CIT168RL.m b/gui_func/panel/Analysis_method/sepia_handle_panel_analysis_segmentation_CIT168RL.m index 55b1b48..d1ba871 100644 --- a/gui_func/panel/Analysis_method/sepia_handle_panel_analysis_segmentation_CIT168RL.m +++ b/gui_func/panel/Analysis_method/sepia_handle_panel_analysis_segmentation_CIT168RL.m @@ -99,7 +99,7 @@ [h.Analysis.segmentation.CIT168RL.text.outputDir,... h.Analysis.segmentation.CIT168RL.edit.outputDir,... h.Analysis.segmentation.CIT168RL.button.outputDir] = sepia_construct_text_edit_button(panelParent,... - 'Ourpur directory:',[],open_icon,pos,wratio); + 'Ourpur directory:',pwd,open_icon,pos,wratio); % correct bias field option pos = [left(1) bottom(13) width height]; h.Analysis.segmentation.CIT168RL.checkbox.biasCorr = uicontrol('Parent',panelParent,'backgroundcolor',get(h.fig,'color'),'Style','checkbox','units','normalized',... @@ -208,6 +208,7 @@ function PushbuttonStart_Analysis_segmentation_Callback(source,eventdata,h) % output outputDir = get(h.Analysis.segmentation.CIT168RL.edit.outputDir, 'String'); % if the output directory does not exist then create the directory +if isempty(outputDir); outputDir = fullfile(pwd,'segmentation_sepia');end if exist(outputDir,'dir') ~= 7; mkdir(outputDir); end % create a new m file diff --git a/gui_func/panel/Analysis_method/sepia_handle_panel_analysis_segmentation_MuSus100.m b/gui_func/panel/Analysis_method/sepia_handle_panel_analysis_segmentation_MuSus100.m index 4d16263..f99f0dd 100644 --- a/gui_func/panel/Analysis_method/sepia_handle_panel_analysis_segmentation_MuSus100.m +++ b/gui_func/panel/Analysis_method/sepia_handle_panel_analysis_segmentation_MuSus100.m @@ -105,7 +105,7 @@ [h.Analysis.segmentation.MuSus100.text.outputDir,... h.Analysis.segmentation.MuSus100.edit.outputDir,... h.Analysis.segmentation.MuSus100.button.outputDir] = sepia_construct_text_edit_button(panelParent,... - 'Ourpur directory:',[],open_icon,pos,wratio); + 'Ourpur directory:',pwd,open_icon,pos,wratio); % correct bias field option pos = [left(1) bottom(14) width height]; h.Analysis.segmentation.MuSus100.checkbox.biasCorr = uicontrol('Parent',panelParent,'backgroundcolor',get(h.fig,'color'),'Style','checkbox','units','normalized',... @@ -217,6 +217,7 @@ function PushbuttonStart_Analysis_segmentation_Callback(source,eventdata,h) % output outputDir = get(h.Analysis.segmentation.MuSus100.edit.outputDir, 'String'); % if the output directory does not exist then create the directory +if isempty(outputDir); outputDir = fullfile(pwd,'segmentation_sepia');end if exist(outputDir,'dir') ~= 7; mkdir(outputDir); end % create a new m file