From 39117ccda6ccedb559262df371205b39f93744cb Mon Sep 17 00:00:00 2001 From: Thomas Hiller Date: Tue, 9 Jul 2019 16:39:10 +0200 Subject: [PATCH] NUCLEUSinv & NUCLEUSmod update: 1. new feature: added a new color theme: *black* 2. adjusted the dark color theme to new darker background colors 3. several minor improvements under the hood NUCLEUSinv 1. extended the BAM NMR tomograph import filter (takes care now also of background measurements) 2. new feature: the Matlab internal `lsqnonneg` is now the default multi-exponential LSQ option even if the Optimization Toolbox is availabe 3. new feature: If the Optimization Toolbox is available the user can choose between `lsqnonneg` and `lsqlin` otherwise see point 2 4. bug fix: `lsqlin` was not working properly (default settings adjusted) 5. bug fix: the tool tips were not properly updated when the solver or regularization option changed (fixed now) --- NUCLEUSinv/NUCLEUSinv.m | 6 +- NUCLEUSinv/NUCLEUSinv_createGUI.m | 23 +- NUCLEUSinv/NUCLEUSinv_createMenus.m | 72 +- .../NUCLEUSinv_createPanelInversionJoint.m | 2 +- .../NUCLEUSinv_createPanelInversionStd.m | 91 +- NUCLEUSinv/NUCLEUSinv_createPanelPlots.m | 18 +- NUCLEUSinv/NUCLEUSinv_createStatusbar.m | 9 +- NUCLEUSinv/NUCLEUSinv_loadDefaults.m | 4 +- NUCLEUSinv/NUCLEUSinv_updateInterface.m | 23 +- NUCLEUSmod/NUCLEUSmod.m | 4 +- NUCLEUSmod/NUCLEUSmod_createGUI.m | 4 + NUCLEUSmod/NUCLEUSmod_createMenus.m | 3 + NUCLEUSmod/NUCLEUSmod_createPanelPlots.m | 6 +- NUCLEUSmod/NUCLEUSmod_loadDefaults.m | 1 - callbacks/menus/onMenuExpert.m | 19 + callbacks/menus/onMenuExtraColor.m | 8 + callbacks/menus/onMenuExtraShow.m | 3 +- callbacks/menus/onMenuHelp.m | 2 +- callbacks/menus/onMenuJointInversion.m | 2 +- callbacks/menus/onMenuSolver.m | 92 + callbacks/popup/onPopupInvjointType.m | 2 +- doc/menu.html | 2 +- doc/nucleus/NUCLEUSinv/NUCLEUSinv.html | 6 +- .../NUCLEUSinv/NUCLEUSinv_createGUI.html | 451 ++--- .../NUCLEUSinv/NUCLEUSinv_createMenus.html | 761 ++++---- .../NUCLEUSinv_createPanelInversionJoint.html | 2 +- .../NUCLEUSinv_createPanelInversionStd.html | 369 ++-- .../NUCLEUSinv_createPanelPlots.html | 18 +- .../NUCLEUSinv_createStatusbar.html | 99 +- .../NUCLEUSinv/NUCLEUSinv_loadDefaults.html | 296 +-- .../NUCLEUSinv_updateInterface.html | 1697 ++++++++--------- doc/nucleus/NUCLEUSmod/NUCLEUSmod.html | 4 +- .../NUCLEUSmod/NUCLEUSmod_createGUI.html | 281 +-- .../NUCLEUSmod/NUCLEUSmod_createMenus.html | 71 +- .../NUCLEUSmod_createPanelPlots.html | 6 +- .../NUCLEUSmod/NUCLEUSmod_loadDefaults.html | 53 +- doc/nucleus/callbacks/menus/menu.html | 2 +- doc/nucleus/callbacks/menus/onMenuExpert.html | 153 +- .../callbacks/menus/onMenuExportData.html | 2 +- .../callbacks/menus/onMenuExportGraphics.html | 2 +- .../callbacks/menus/onMenuExtraColor.html | 88 +- .../callbacks/menus/onMenuExtraGraphics.html | 2 +- .../callbacks/menus/onMenuExtraRhoBounds.html | 2 +- .../callbacks/menus/onMenuExtraShow.html | 75 +- doc/nucleus/callbacks/menus/onMenuHelp.html | 4 +- doc/nucleus/callbacks/menus/onMenuImport.html | 2 +- .../callbacks/menus/onMenuJointInversion.html | 4 +- .../callbacks/menus/onMenuRestartQuit.html | 2 +- doc/nucleus/callbacks/menus/onMenuSolver.html | 166 ++ .../callbacks/popup/onPopupInvjointType.html | 2 +- .../functions/import/LoadNMRData_bamtom.html | 316 ++- .../functions/interface/PhaseView.html | 651 +++---- .../calculateGuiOnMonitorPosition.html | 4 +- .../functions/interface/changeColorTheme.html | 326 ++-- .../interface/displayStatusText.html | 2 +- .../functions/interface/exportGraphics.html | 409 ++-- doc/nucleus/functions/interface/fixAxes.html | 2 +- .../functions/interface/getColorTheme.html | 241 ++- .../interface/importCalibrationData.html | 171 ++ .../functions/interface/importNMRdata.html | 859 +++++---- doc/nucleus/functions/interface/menu.html | 2 +- .../interface/onFigureSizeChange.html | 53 +- .../interface/runInversionBatch.html | 14 +- .../functions/interface/runInversionStd.html | 34 +- .../interface/showExtraGraphics.html | 535 +++--- .../interface/showFitStatistics.html | 576 +++--- .../interface/showParameterInfo.html | 72 +- .../functions/interface/switchToolTips.html | 12 +- .../functions/interface/updatePlotsCPS.html | 213 ++- .../interface/updatePlotsDistribution.html | 4 +- .../updatePlotsDistributionInfo.html | 4 +- .../interface/updatePlotsGeometryType.html | 104 +- .../interface/updatePlotsJointInversion.html | 457 ++--- .../functions/interface/updatePlotsNMR.html | 194 +- .../functions/interface/updatePlotsPSD.html | 140 +- .../interface/updatePlotsSignal.html | 682 +++---- .../interface/updateStatusInformation.html | 93 +- .../functions/interface/updateToolTips.html | 236 +++ .../inversion/applyRegularization.html | 87 +- .../inversion/createKernelMatrix.html | 2 +- .../functions/inversion/fitDataFree.html | 234 +-- .../functions/inversion/fitDataLSQ.html | 343 ++++ .../functions/inversion/fitDataNNLS.html | 339 ---- .../functions/inversion/getFitErrors.html | 2 +- .../functions/inversion/getTLogMean.html | 2 +- doc/nucleus/functions/inversion/menu.html | 2 +- functions/import/LoadNMRData_bamtom.m | 79 +- functions/interface/PhaseView.m | 57 +- .../interface/calculateGuiOnMonitorPosition.m | 4 +- functions/interface/changeColorTheme.m | 121 +- functions/interface/exportGraphics.m | 13 +- functions/interface/getColorTheme.m | 115 +- functions/interface/importCalibrationData.m | 97 + functions/interface/importNMRdata.m | 77 +- functions/interface/onFigureSizeChange.m | 3 + functions/interface/runInversionBatch.m | 10 +- functions/interface/runInversionStd.m | 30 +- functions/interface/showExtraGraphics.m | 15 + functions/interface/showFitStatistics.m | 112 +- functions/interface/showParameterInfo.m | 4 +- functions/interface/switchToolTips.m | 6 +- functions/interface/updatePlotsCPS.m | 9 +- functions/interface/updatePlotsDistribution.m | 4 +- .../interface/updatePlotsDistributionInfo.m | 4 +- functions/interface/updatePlotsGeometryType.m | 6 +- .../interface/updatePlotsJointInversion.m | 15 +- functions/interface/updatePlotsNMR.m | 2 + functions/interface/updatePlotsPSD.m | 12 +- functions/interface/updatePlotsSignal.m | 24 +- functions/interface/updateStatusInformation.m | 9 +- functions/interface/updateToolTips.m | 163 ++ functions/inversion/applyRegularization.m | 29 +- functions/inversion/fitDataFree.m | 16 +- .../inversion/{fitDataNNLS.m => fitDataLSQ.m} | 32 +- 114 files changed, 7506 insertions(+), 5995 deletions(-) create mode 100644 callbacks/menus/onMenuSolver.m create mode 100644 doc/nucleus/callbacks/menus/onMenuSolver.html create mode 100644 doc/nucleus/functions/interface/importCalibrationData.html create mode 100644 doc/nucleus/functions/interface/updateToolTips.html create mode 100644 doc/nucleus/functions/inversion/fitDataLSQ.html delete mode 100644 doc/nucleus/functions/inversion/fitDataNNLS.html create mode 100644 functions/interface/importCalibrationData.m create mode 100644 functions/interface/updateToolTips.m rename functions/inversion/{fitDataNNLS.m => fitDataLSQ.m} (89%) diff --git a/NUCLEUSinv/NUCLEUSinv.m b/NUCLEUSinv/NUCLEUSinv.m index 2f645cd..7fe3d54 100644 --- a/NUCLEUSinv/NUCLEUSinv.m +++ b/NUCLEUSinv/NUCLEUSinv.m @@ -38,8 +38,8 @@ if ~isempty(h0); close(h0); end %% GUI 'header' info and defaults -myui.version = '0.1.7'; -myui.date = '27.06.2019'; +myui.version = '0.1.8'; +myui.date = '08.07.2019'; myui.author = 'Thomas Hiller'; myui.email = 'thomas.hiller[at]leibniz-liag.de'; myui.fontsize = 10; @@ -76,7 +76,7 @@ Mver = ver; for i = 1:size(Mver,2) if strcmp(Mver(i).Name,'Optimization Toolbox') - data.info.optim = 'on'; + data.info.has_optim = 'on'; end if strfind(Mver(i).Name,'Statistics') data.info.stat = 'on'; diff --git a/NUCLEUSinv/NUCLEUSinv_createGUI.m b/NUCLEUSinv/NUCLEUSinv_createGUI.m index 781615a..b053368 100644 --- a/NUCLEUSinv/NUCLEUSinv_createGUI.m +++ b/NUCLEUSinv/NUCLEUSinv_createGUI.m @@ -15,6 +15,7 @@ function NUCLEUSinv_createGUI(h,wbon) % NUCLEUSinv_createGUI(gcf,1) % % Other m-files required: +% changeColorTheme.m % NUCLEUSinv_createMenus.m % NUCLEUSinv_createPanelData.m % NUCLEUSinv_createPanelProcess.m @@ -22,8 +23,11 @@ function NUCLEUSinv_createGUI(h,wbon) % NUCLEUSinv_createPanelInversionStd.m % NUCLEUSinv_createPanelInversionJoint.m % NUCLEUSinv_createPanelPlots.m -% NUCLEUSinv_createPanelInfo -% NUCLEUSinv_createStatusbar +% NUCLEUSinv_createPanelInfo.m +% NUCLEUSinv_createStatusbar.m +% switchToolTips.m +% updateStatusInformation.m +% updateToolTips.m % % Subfunctions: % none @@ -71,7 +75,7 @@ function NUCLEUSinv_createGUI(h,wbon) if wbon waitbar(1/steps,hwb,'loading GUI elements - menus'); end -gui = NUCLEUSinv_createMenus(gui); +gui = NUCLEUSinv_createMenus(data,gui); %% MAIN GUI "BOX" % make everything invisible during creation @@ -79,10 +83,11 @@ function NUCLEUSinv_createGUI(h,wbon) % gui.main = uix.VBox('Parent',gui.figh); % top part for settings and plots -gui.top = uix.HBoxFlex('Parent',gui.main,'Spacing',5); +gui.top = uix.HBoxFlex('Parent',gui.main,'Spacing',0); % bottom part for the statusbar gui.bottom = uix.HBox('Parent',gui.main); -set(gui.main,'Heights',[-1 20]); +% minimum heights of main elements +set(gui.main,'Heights',[-1 20],'MinimumHeights',[250+4*22 20]); % all control panels are on the left inside a vertically scrollable panel gui.left = uix.ScrollingPanel('Parent',gui.top); @@ -117,7 +122,7 @@ function NUCLEUSinv_createGUI(h,wbon) % panel header is always 22 high set(gui.panels.main,'Heights',myui.heights(2,:),... 'MinimumHeights',[250 22 22 22 22]); -set(gui.left,'Heights',-1,'MinimumHeights',593); +set(gui.left,'Heights',-1,'MinimumHeights',250+109+22+190+22); % 1. data panel if wbon @@ -149,7 +154,7 @@ function NUCLEUSinv_createGUI(h,wbon) end % adjust the default joint inversion method depending on Optimization % toolbox availability -switch data.info.optim +switch data.info.has_optim case 'on' data.invjoint.invtype = 'free'; case 'off' @@ -187,11 +192,14 @@ function NUCLEUSinv_createGUI(h,wbon) set(gui.panels.invjoint.main,'Minimized',true); set(gui.center,'Heights',[-1 -1 22]); set(gui.plots.CPSPanel,'Minimized',true); +% minimum size of bottom status bar +set(gui.bottom,'MinimumWidths',610); % make the GUI visible again; "gui" needs to be saved because % otherwise "fixAxes" throws an error (in NUCLEUSmod); strangely here it % also works without it, but I put it for consistency reasons setappdata(h,'gui',gui); +% changeColorTheme('INV',myui.colors.theme); set(gui.main,'Visible','on'); %% enable all menus @@ -208,6 +216,7 @@ function NUCLEUSinv_createGUI(h,wbon) setappdata(h,'data',data); displayStatusText(gui,'NUCLEUSinv successfully started'); updateStatusInformation; +updateToolTips; end diff --git a/NUCLEUSinv/NUCLEUSinv_createMenus.m b/NUCLEUSinv/NUCLEUSinv_createMenus.m index b480959..a8c5f16 100644 --- a/NUCLEUSinv/NUCLEUSinv_createMenus.m +++ b/NUCLEUSinv/NUCLEUSinv_createMenus.m @@ -1,10 +1,11 @@ -function gui = NUCLEUSinv_createMenus(gui) +function gui = NUCLEUSinv_createMenus(data,gui) %NUCLEUSinv_createMenus creates all GUI menus % % Syntax: -% gui = NUCLEUSinv_createMenus(gui) +% gui = NUCLEUSinv_createMenus(gui,data) % % Inputs: +% data - figure data structure % gui - figure gui elements structure % % Outputs: @@ -215,7 +216,27 @@ set(gui.menu.extra_expert_off,'Checked','on'); end -% 2.2 joint inversion (on/off) +% 2.2 optimization toolbox (on/off) +switch gui.myui.inidata.expertmode + case 'on' + switch data.info.has_optim + case 'on' + gui.menu.extra_solver = uimenu(gui.menu.extra,... + 'Label','LSQ Solver','Enable','on'); + case 'off' + gui.menu.extra_solver = uimenu(gui.menu.extra,... + 'Label','LSQ Solver','Enable','off'); + end + case 'off' + gui.menu.extra_solver = uimenu(gui.menu.extra,... + 'Label','LSQ Solver','Enable','off'); +end +gui.menu.extra_solver_lsqlin = uimenu(gui.menu.extra_solver,... + 'Label','LSQLIN (Optim. TB)','Callback',@onMenuSolver); +gui.menu.extra_solver_lsqnonneg = uimenu(gui.menu.extra_solver,... + 'Label','LSQNONNEG (default)','Checked','on','Callback',@onMenuSolver); + +% 2.3 joint inversion (on/off) switch gui.myui.inidata.expertmode case 'on' gui.menu.extra_joint = uimenu(gui.menu.extra,... @@ -230,11 +251,11 @@ 'Label','Off','Checked','on','Callback',@onMenuJointInversion); -% 2.3 settings +% 2.4 settings gui.menu.extra_settings = uimenu(gui.menu.extra,... 'Label','Settings'); -% 2.3.1 inversion info (on/off) +% 2.4.1 inversion info (on/off) gui.menu.extra_settings_invinfo = uimenu(gui.menu.extra_settings,... 'Label','Inversion Display'); gui.menu.extra_settings_invinfo_on = uimenu(gui.menu.extra_settings_invinfo,... @@ -248,7 +269,7 @@ set(gui.menu.extra_settings_invinfo_off,'Checked','on'); end -% 2.3.2 tooltips (on/off) +% 2.4.2 tooltips (on/off) gui.menu.extra_settings_tooltips = uimenu(gui.menu.extra_settings,... 'Label','Tooltips'); gui.menu.extra_settings_tooltips_on = uimenu(gui.menu.extra_settings_tooltips,... @@ -262,7 +283,7 @@ set(gui.menu.extra_settings_tooltips_off,'Checked','on'); end -% 2.3.3 INFO fields in plot panels (on/off) +% 2.4.3 INFO fields in plot panels (on/off) gui.menu.extra_settings_infofields = uimenu(gui.menu.extra_settings,... 'Label','INFO fields'); gui.menu.extra_settings_infofields_on = uimenu(gui.menu.extra_settings_infofields ,... @@ -270,18 +291,21 @@ gui.menu.extra_settings_infofields_off = uimenu(gui.menu.extra_settings_infofields,... 'Label','Off','Checked','on','Callback',@onMenuExtraShow); -% 2.3.4 color theme +% 2.4.4 color theme gui.menu.extra_settings_theme = uimenu(gui.menu.extra_settings,... 'Label','Color Theme'); -% 2.3.4.1 default color theme +% 2.4.4.1 default color theme gui.menu.extra_settings_theme_standard = uimenu(gui.menu.extra_settings_theme,... 'Label','standard','Callback',@onMenuExtraColor); -% 2.3.4.2 basic color theme +% 2.4.4.2 basic color theme gui.menu.extra_settings_theme_basic = uimenu(gui.menu.extra_settings_theme,... 'Label','basic','Callback',@onMenuExtraColor); -% 2.3.4.3 dark color theme +% 2.4.4.3 dark color theme gui.menu.extra_settings_theme_dark = uimenu(gui.menu.extra_settings_theme,... 'Label','dark','Callback',@onMenuExtraColor); +% 2.4.4.4 black color theme +gui.menu.extra_settings_theme_black = uimenu(gui.menu.extra_settings_theme,... + 'Label','black','Callback',@onMenuExtraColor); switch gui.myui.inidata.colortheme case 'standard' set(gui.menu.extra_settings_theme_standard,'Checked','on'); @@ -289,48 +313,50 @@ set(gui.menu.extra_settings_theme_basic,'Checked','on'); case 'dark' set(gui.menu.extra_settings_theme_dark,'Checked','on'); + case 'black' + set(gui.menu.extra_settings_theme_black,'Checked','on'); end -% 2.3.5 joint inversion settings +% 2.4.5 joint inversion settings gui.menu.extra_settings_joint = uimenu(gui.menu.extra_settings,... 'Label','Joint Inversion','Enable','off','Separator','on'); -% 2.3.5.1 joint inversion settings +% 2.4.5.1 joint inversion settings gui.menu.extra_settings_joint_rhobounds = uimenu(gui.menu.extra_settings_joint,... 'Label','Surface relaxivity bounds','Callback',@onMenuExtraRhoBounds); -% 2.4 figures +% 2.5 figures gui.menu.extra_graphics = uimenu(gui.menu.extra,... 'Label','Figures'); -% 2.4.1 parameter file info +% 2.5.1 parameter file info gui.menu.extra_graphics_parinfo = uimenu(gui.menu.extra_graphics,... 'Label','Parameter Info','Callback',@onMenuExtraShow); -% 2.4.2 fit statistics +% 2.5.2 fit statistics gui.menu.extra_graphics_stats = uimenu(gui.menu.extra_graphics,... 'Label','Fit statistics','Callback',@onMenuExtraGraphics); switch gui.myui.inidata.expertmode case 'on' - % 2.4.3 amplitude over time + % 2.5.3 amplitude over time gui.menu.extra_graphics_amp = uimenu(gui.menu.extra_graphics,... 'Label','AMP-TLGM-SNR','Callback',@onMenuExtraGraphics); - % 2.4.4 amplitude vs tlgm + % 2.5.4 amplitude vs tlgm gui.menu.extra_graphics_amp2 = uimenu(gui.menu.extra_graphics,... 'Label','AMP vs TLGM','Callback',@onMenuExtraGraphics); - % 2.4.5 relaxation time distribution over time + % 2.5.5 relaxation time distribution over time gui.menu.extra_graphics_rtd = uimenu(gui.menu.extra_graphics,... 'Label','RTD','Callback',@onMenuExtraGraphics); case 'off' - % 2.4.3 amplitude over time + % 2.5.3 amplitude over time gui.menu.extra_graphics_amp = uimenu(gui.menu.extra_graphics,... 'Label','AMP-TLGM-SNR','Enable','off','Callback',@onMenuExtraGraphics); - % 2.4.4 amplitude vs tlgm + % 2.5.4 amplitude vs tlgm gui.menu.extra_graphics_amp2 = uimenu(gui.menu.extra_graphics,... 'Label','AMP vs TLGM','Enable','off','Callback',@onMenuExtraGraphics); - % 2.4.5 relaxation time distribution over time + % 2.5.5 relaxation time distribution over time gui.menu.extra_graphics_rtd = uimenu(gui.menu.extra_graphics,... 'Label','RTD','Enable','off','Callback',@onMenuExtraGraphics); end -% 2.5 PhaseView +% 2.6 PhaseView gui.menu.extra_phaseview = uimenu(gui.menu.extra,... 'Label','PhaseView','Callback',@PhaseView); diff --git a/NUCLEUSinv/NUCLEUSinv_createPanelInversionJoint.m b/NUCLEUSinv/NUCLEUSinv_createPanelInversionJoint.m index c017721..5065213 100644 --- a/NUCLEUSinv/NUCLEUSinv_createPanelInversionJoint.m +++ b/NUCLEUSinv/NUCLEUSinv_createPanelInversionJoint.m @@ -98,7 +98,7 @@ 'String','inversion method'); tstr = 'tba'; -switch data.info.optim +switch data.info.has_optim case 'on' gui.popup_handles.invjoint_InvType = uicontrol('Parent',gui.panels.invjoint.HBox1,... 'Style','popup','FontSize',myui.fontsize,... diff --git a/NUCLEUSinv/NUCLEUSinv_createPanelInversionStd.m b/NUCLEUSinv/NUCLEUSinv_createPanelInversionStd.m index 8917b7e..c8b6189 100644 --- a/NUCLEUSinv/NUCLEUSinv_createPanelInversionStd.m +++ b/NUCLEUSinv/NUCLEUSinv_createPanelInversionStd.m @@ -59,55 +59,13 @@ gui.text_handles.invstd_InvType = uicontrol('Parent',gui.panels.invstd.HBox1,... 'Style','text','FontSize',myui.fontsize,'HorizontalAlignment','center',... 'String','inversion method'); -switch data.info.optim - case 'on' - switch data.info.ExpertMode - case 'on' - tstr = ['Choose between different inversion (fitting) methods.

',... - 'Available options:
',... - 'Mono exp. Mono-exponential fitting.
',... - 'X free exp. Multi-exponential fitting with up to 5 free relaxation times.
',... - 'Multi exp. (LSQLIN) Multi-exponential fitting with Optimization Toolbox.
',... - 'Multi exp. (ILA) Multi-exponential fitting using an Inverse Laplace transform.

',... - 'Depending on the chosen method there are additional options available.

',... - 'Default value:
',... - 'Multi exp. (LSQLIN)
']; - istring = {'Mono exp.','Several free exp. (2-5)','Multi exp. (LSQLIN)','Multi exp. (InvLaplace)'}; - case 'off' - tstr = ['Choose between different inversion (fitting) methods.

',... - 'Available options:
',... - 'Mono exp. Mono-exponential fitting.
',... - 'X free exp. Multi-exponential fitting with up to 5 free relaxation times.
',... - 'Multi exp. (LSQLIN) Multi-exponential fitting with Optimization Toolbox.
',... - 'Depending on the chosen method there are additional options available.

',... - 'Default value:
',... - 'Multi exp. (LSQLIN)
']; - istring = {'Mono exp.','Several free exp. (2-5)','Multi exp. (LSQLIN)'}; - end +switch data.info.ExpertMode + case 'on' + tstr = ' '; + istring = {'Mono exp.','Several free exp. (2-5)','Multi exp. (LSQ)','Multi exp. (InvLaplace)'}; case 'off' - switch data.info.ExpertMode - case 'on' - tstr = ['Choose between different inversion (fitting) methods.

',... - 'Available options:
',... - 'Mono exp. Mono-exponential fitting.
',... - 'Several free exp. Multi-exponential fitting with up to 5 free relaxation times.
',... - 'Multi exp. (NNLS) Multi-exponential fitting with Non Negative Least Squares (NNLS).
',... - 'Multi exp. (ILA) Multi-exponential fitting using an Inverse Laplace transform.

',... - 'Depending on the chosen method there are additional options available.

',... - 'Default value:
',... - 'Multi exp. (NNLS)
']; - istring = {'Mono exp.','Several free exp. (2-5)','Multi exp. (NNLS)','Multi exp. (InvLaplace)'}; - case 'off' - tstr = ['Choose between different inversion (fitting) methods.

',... - 'Available options:
',... - 'Mono exp. Mono-exponential fitting.
',... - 'Several free exp. Multi-exponential fitting with up to 5 free relaxation times.
',... - 'Multi exp. (NNLS) Multi-exponential fitting with Non Negative Least Squares (NNLS).
',... - 'Depending on the chosen method there are additional options available.

',... - 'Default value:
',... - 'Multi exp. (NNLS)
']; - istring = {'Mono exp.','Several free exp. (2-5)','Multi exp. (NNLS)'}; - end + tstr = ' '; + istring = {'Mono exp.','Several free exp. (2-5)','Multi exp. (LSQ)'}; end gui.popup_handles.invstd_InvType = uicontrol('Parent',gui.panels.invstd.HBox1,... 'Style','popup','String',istring,'FontSize',myui.fontsize,'Enable','off','Value',3,... @@ -140,40 +98,11 @@ 'String','regularization options'); switch data.info.ExpertMode case 'on' - tstr = ['Choose additional options depending on the chosen inversion (fitting) method.

',... - 'Available options:
',... - 'Mono exp.:
',... - 'none
',... - 'X free exp.:
',... - '1-5 choose how many free relaxation times to use.
',... - 'Multi exp.:
',... - 'Manual Manual regularization.
',... - 'IterChi2 Find Chi2=1 iteratively.
',... - 'Tikhonov (GCV) Tikhonov regularization (SVD-Toolbox).
',... - 'TSVD (GCV) Regularization via Truncated SVD (SVD-Toolbox).
',... - 'DSVD (GCV) Regularization via Damped SVD (SVD-Toolbox).
',... - 'Discrep. Regularization according to discrepancy principle (SVD-Toolbox).
',... - 'L-curve Perform the L-curve test to find optimal regularization parameter lambda.
',... - 'Multi exp. (ILA):
',... - 'Manual Manual regularization.
',... - 'Automatic Automatic regularization.

',... - 'Default value:
',... - 'Manual
']; + tstr = ' '; rstring = {'Manual','Iterative Chi2','Tikhonov (SVD)','TSVD (SVD)',... 'DSVD (SVD)','Discrep. (SVD)','L-curve'}; case 'off' - tstr = ['Choose additional options depending on the chosen inversion (fitting) method.

',... - 'Available options:
',... - 'Mono exp.:
',... - 'none
',... - 'X free exp.:
',... - '1-5 choose how many free relaxation times to use.
',... - 'Multi exp.:
',... - 'Manual Manual regularization.
',... - 'IterChi2 Find Chi2=1 iteratively.
',... - 'L-curve Perform the L-curve test to find optimal regularization parameter lambda.

',... - 'Default value:
',... - 'Manual
']; + tstr = ' '; rstring = {'Manual','Iterative Chi2','L-curve'}; end gui.popup_handles.invstd_InvTypeOpt = uicontrol('Parent',gui.panels.invstd.HBox3,... @@ -187,9 +116,9 @@ 'HorizontalAlignment','center','String','smoothness constraint (L-order)'); tstr = ['Choose the smoothness constraint for the multi-exponential fitting routines.

',... 'Available options:
',... - 'Mono exp. | X free exp.:
',... + 'Mono exp. | Several free exp. (2-5):
',... 'none
',... - 'Multi exp. (NNLS/LSQLIN) | Multi exp. (ILA):
',... + 'Multi exp. (LSQ) | Multi exp. (ILA):
',... '',... '0 Zeroth-order smoothness constraint.
',... '1 First-order smoothness constraint.
',... diff --git a/NUCLEUSinv/NUCLEUSinv_createPanelPlots.m b/NUCLEUSinv/NUCLEUSinv_createPanelPlots.m index 0c7541d..fe4cf01 100644 --- a/NUCLEUSinv/NUCLEUSinv_createPanelPlots.m +++ b/NUCLEUSinv/NUCLEUSinv_createPanelPlots.m @@ -43,11 +43,11 @@ %% 1. panel - Processing - PROC and RAW data gui.plots.Signal.ProcTab = uix.VBox('Parent',gui.plots.SignalPanel,... - 'Spacing',3,'Padding',3); + 'Spacing',5,'Padding',0); gui.plots.Signal.RawTab = uix.VBox('Parent',gui.plots.SignalPanel,... - 'Spacing',3,'Padding',3); + 'Spacing',5,'Padding',0); gui.plots.Signal.AllTab = uix.VBox('Parent',gui.plots.SignalPanel,... - 'Spacing',3,'Padding',3); + 'Spacing',5,'Padding',0); gui.plots.SignalPanel.TabTitles = {'PROC','RAW','ALL (joint)'}; gui.plots.SignalPanel.TabWidth = 75; gui.plots.SignalPanel.TabEnables = {'on','on','off'}; @@ -86,7 +86,7 @@ % now the actual axes 1 gui.axes_handles.raw = axes('Parent',gui.plots.Signal.Raw.box1,'Box','on'); set(get(gui.axes_handles.raw,'XLabel'),'String','time [s]'); -set(get(gui.axes_handles.raw,'YLabel'),'String','amplitude [a.u.]'); +set(get(gui.axes_handles.raw,'YLabel'),'String','\Reeal'); % the axes has a context menu gui.cm_handles.axes_raw = uicontextmenu(gui.figh); gui.cm_handles.axes_raw_xaxis = uimenu(gui.cm_handles.axes_raw,... @@ -100,7 +100,7 @@ % now the actual axes 2 gui.axes_handles.imag = axes('Parent',gui.plots.Signal.Raw.box2,'Box','on'); set(get(gui.axes_handles.imag,'XLabel'),'String',''); -set(get(gui.axes_handles.imag,'YLabel'),'String',''); +set(get(gui.axes_handles.imag,'YLabel'),'String','\Immag'); set(gui.axes_handles.imag,'XTickLabel',''); set(gui.axes_handles.imag,'YTickLabel',''); @@ -130,11 +130,11 @@ %% 2. panel - Distributions - RTD, PSD and PSDJ data gui.plots.Dist.RTDTab = uix.HBox('Parent',gui.plots.DistPanel,... - 'Spacing',3,'Padding',3); + 'Spacing',0,'Padding',0); gui.plots.Dist.PSDTab = uix.HBox('Parent',gui.plots.DistPanel,... - 'Spacing',3,'Padding',3); + 'Spacing',0,'Padding',0); gui.plots.Dist.PSDJTab = uix.HBox('Parent',gui.plots.DistPanel,... - 'Spacing',3,'Padding',3); + 'Spacing',0,'Padding',0); gui.plots.DistPanel.TabTitles = {'RTD','PSD','PSD (joint)'}; gui.plots.DistPanel.TabWidth = 75; gui.plots.DistPanel.TabEnables = {'on','on','off'}; @@ -192,7 +192,7 @@ %% 3. panel - CPS data gui.plots.CPSTab = uix.HBox('Parent',gui.plots.CPSPanel,... - 'Spacing',3,'Padding',3); + 'Spacing',0,'Padding',0); gui.plots.CPSPanel.Title = 'CPS (joint)'; %% 3.1 the CPS axes diff --git a/NUCLEUSinv/NUCLEUSinv_createStatusbar.m b/NUCLEUSinv/NUCLEUSinv_createStatusbar.m index a83ee44..2fa7b56 100644 --- a/NUCLEUSinv/NUCLEUSinv_createStatusbar.m +++ b/NUCLEUSinv/NUCLEUSinv_createStatusbar.m @@ -36,12 +36,13 @@ gui.panels.status.main = uix.Panel('Parent',gui.statusbar); gui.panels.status.mode = uix.Panel('Parent',gui.statusbar); gui.panels.status.optim = uix.Panel('Parent',gui.statusbar); +gui.panels.status.solver = uix.Panel('Parent',gui.statusbar); gui.panels.status.stats = uix.Panel('Parent',gui.statusbar); gui.panels.status.joint = uix.Panel('Parent',gui.statusbar); gui.panels.status.invinfo = uix.Panel('Parent',gui.statusbar); gui.panels.status.tooltips = uix.Panel('Parent',gui.statusbar); % adjust their widths -set(gui.statusbar,'Widths',[400 -1 -1 -1 -1 -1 -1]); +set(gui.statusbar,'Widths',[400 -1 -1 -1 -1 -1 -1 -1]); %% add the individual text fields gui.textStatus = uicontrol('Style','Text','Parent',gui.panels.status.main,'String','',... @@ -49,9 +50,11 @@ gui.textMode = uicontrol('Style','Text','Parent',gui.panels.status.mode,'String','',... 'HorizontalAlignment','left','FontSize',8); gui.textOptim = uicontrol('Style','Text','Parent',gui.panels.status.optim,'String','',... - 'HorizontalAlignment','left','FontSize',8,'ForegroundColor',[0.4 0.4 0.4]); + 'HorizontalAlignment','left','FontSize',8); +gui.textSolver = uicontrol('Style','Text','Parent',gui.panels.status.solver,'String','',... + 'HorizontalAlignment','left','FontSize',8); gui.textStats = uicontrol('Style','Text','Parent',gui.panels.status.stats,'String','',... - 'HorizontalAlignment','left','FontSize',8,'ForegroundColor',[0.4 0.4 0.4]); + 'HorizontalAlignment','left','FontSize',8); gui.textJoint = uicontrol('Style','Text','Parent',gui.panels.status.joint,'String','',... 'HorizontalAlignment','left','FontSize',8); gui.textInvinfo = uicontrol('Style','Text','Parent',gui.panels.status.invinfo,'String','',... diff --git a/NUCLEUSinv/NUCLEUSinv_loadDefaults.m b/NUCLEUSinv/NUCLEUSinv_loadDefaults.m index 31cfdfa..247f34e 100644 --- a/NUCLEUSinv/NUCLEUSinv_loadDefaults.m +++ b/NUCLEUSinv/NUCLEUSinv_loadDefaults.m @@ -47,7 +47,9 @@ out.info.InvInfo = 'on'; out.info.ToolTips = 'off'; % Optimization and Statistics toolbox availability is checked later -out.info.optim = 'off'; +% lsqnonneg is the default lsq-solver +out.info.has_optim = 'off'; +out.info.solver = 'lsqnonneg'; out.info.stat = 'off'; %% process panel defaults diff --git a/NUCLEUSinv/NUCLEUSinv_updateInterface.m b/NUCLEUSinv/NUCLEUSinv_updateInterface.m index 43331a1..9ce47fd 100644 --- a/NUCLEUSinv/NUCLEUSinv_updateInterface.m +++ b/NUCLEUSinv/NUCLEUSinv_updateInterface.m @@ -58,7 +58,7 @@ gui = updateTimescale(gui,data.process.timescale); if data.invstd.porosity <= 1 set(gui.edit_handles.invstd_porosity,'Enable','on',... - 'BackgroundColor','w',... + 'BackgroundColor',gui.myui.colors.editBG,... 'String',num2str(data.invstd.porosity)); else set(gui.edit_handles.invstd_porosity,'Enable','on',... @@ -68,16 +68,8 @@ %% update standard inversion panel % inversion method popup - switch data.info.optim - case 'on' - istring = {'Mono exp.','Several free exp. (2-5)',... - 'Multi exp. (LSQLIN)',... - 'Multi exp. (InvLaplace)'}; - case 'off' - istring = {'Mono exp.','Several free exp. (2-5)',... - 'Multi exp. (NNLS)',... - 'Multi exp. (InvLaplace)'}; - end + istring = {'Mono exp.','Several free exp. (2-5)',... + 'Multi exp. (LSQ)','Multi exp. (InvLaplace)'}; set(gui.popup_handles.invstd_InvType,'String',istring); switch data.invstd.invtype case 'mono' @@ -527,14 +519,7 @@ %% update standard inversion panel % inversion method popup - switch data.info.optim - case 'on' - istring = {'Mono exp.','Several free exp. (2-5)',... - 'Multi exp. (LSQLIN)'}; - case 'off' - istring = {'Mono exp.','Several free exp. (2-5)',... - 'Multi exp. (NNLS)'}; - end + istring = {'Mono exp.','Several free exp. (2-5)','Multi exp. (LSQ)'}; set(gui.popup_handles.invstd_InvType,'String',istring); switch data.invstd.invtype case 'mono' diff --git a/NUCLEUSmod/NUCLEUSmod.m b/NUCLEUSmod/NUCLEUSmod.m index 75bb34d..fa946d2 100644 --- a/NUCLEUSmod/NUCLEUSmod.m +++ b/NUCLEUSmod/NUCLEUSmod.m @@ -41,8 +41,8 @@ if ~isempty(h0); close(h0); end %% GUI 'header' info and defaults -myui.version = '0.1.7'; -myui.date = '27.06.2019'; +myui.version = '0.1.8'; +myui.date = '08.07.2019'; myui.author = 'Thomas Hiller'; myui.email = 'thomas.hiller[at]leibniz-liag.de'; myui.fontsize = 10; diff --git a/NUCLEUSmod/NUCLEUSmod_createGUI.m b/NUCLEUSmod/NUCLEUSmod_createGUI.m index b2adeed..7ff2c5c 100644 --- a/NUCLEUSmod/NUCLEUSmod_createGUI.m +++ b/NUCLEUSmod/NUCLEUSmod_createGUI.m @@ -15,13 +15,16 @@ function NUCLEUSmod_createGUI(h,wbon) % NUCLEUSmod_createGUI(gcf,1) % % Other m-files required: +% fixAxes.m % NUCLEUSmod_createMenus.m % NUCLEUSmod_createPanelGeometry.m % NUCLEUSmod_createPanelCPS.m % NUCLEUSmod_createPanelNMR.m % NUCLEUSmod_createPanelPlots.m +% % Subfunctions: % none +% % MAT-files required: % none % @@ -127,6 +130,7 @@ function NUCLEUSmod_createGUI(h,wbon) setappdata(h,'gui',gui); setappdata(h,'data',data); displayStatusText(gui,'NUCLEUSmod successfully started'); +fixAxes(gui.plots.cps.box); end diff --git a/NUCLEUSmod/NUCLEUSmod_createMenus.m b/NUCLEUSmod/NUCLEUSmod_createMenus.m index 8f5820f..aaa3752 100644 --- a/NUCLEUSmod/NUCLEUSmod_createMenus.m +++ b/NUCLEUSmod/NUCLEUSmod_createMenus.m @@ -117,6 +117,9 @@ % 2.1.2.3 dark color theme gui.menu.extra_settings_theme_dark = uimenu(gui.menu.extra_settings_theme,... 'Label','dark','Callback',@onMenuExtraColor); +% 2.1.2.4 black color theme +gui.menu.extra_settings_theme_black = uimenu(gui.menu.extra_settings_theme,... + 'Label','black','Callback',@onMenuExtraColor); %% 3. Help gui.menu.help = uimenu(gui.figh,... diff --git a/NUCLEUSmod/NUCLEUSmod_createPanelPlots.m b/NUCLEUSmod/NUCLEUSmod_createPanelPlots.m index 54795c1..9a18aa6 100644 --- a/NUCLEUSmod/NUCLEUSmod_createPanelPlots.m +++ b/NUCLEUSmod/NUCLEUSmod_createPanelPlots.m @@ -33,15 +33,15 @@ %% create the individual BoxPanels gui.plots.GeoPanel = uix.BoxPanel('Parent',gui.right,... 'Title','Pore Size Distribution','TitleColor',myui.colors.GEO,... - 'ForegroundColor',myui.colors.BoxTitle,'Padding',3,... + 'ForegroundColor',myui.colors.BoxTitle,'Padding',0,... 'MinimizeFcn',@minimizePanel); gui.plots.CPSPanel = uix.BoxPanel('Parent',gui.right,... 'Title','Capillary Pressure Saturation Curve','TitleColor',myui.colors.CPS,...... - 'ForegroundColor',myui.colors.BoxTitle,'Padding',3,... + 'ForegroundColor',myui.colors.BoxTitle,'Padding',0,... 'MinimizeFcn',@minimizePanel); gui.plots.NMRPanel = uix.BoxPanel('Parent',gui.right,... 'Title','NMR Signals','TitleColor',myui.colors.NMR,... - 'ForegroundColor',myui.colors.BoxTitle,'Padding',3,... + 'ForegroundColor',myui.colors.BoxTitle,'Padding',0,... 'MinimizeFcn',@minimizePanel); % adjust heights diff --git a/NUCLEUSmod/NUCLEUSmod_loadDefaults.m b/NUCLEUSmod/NUCLEUSmod_loadDefaults.m index 37f859d..c382e05 100644 --- a/NUCLEUSmod/NUCLEUSmod_loadDefaults.m +++ b/NUCLEUSmod/NUCLEUSmod_loadDefaults.m @@ -88,7 +88,6 @@ % use linear y-axes as default (log=1, lin=2) out.nmr.logliny = 2; - return %------------- END OF CODE -------------- diff --git a/callbacks/menus/onMenuExpert.m b/callbacks/menus/onMenuExpert.m index 3338f19..a79a785 100644 --- a/callbacks/menus/onMenuExpert.m +++ b/callbacks/menus/onMenuExpert.m @@ -57,6 +57,16 @@ function onMenuExpert(src,~) setappdata(fig,'data',data); setappdata(fig,'gui',gui); + % deactivate solver menu and set to default + onMenuSolver(gui.menu.extra_solver_lsqnonneg); + % get changed GUI data + data = getappdata(fig,'data'); + set(gui.menu.extra_solver,'Enable','off'); + + % update GUI data + setappdata(fig,'data',data); + setappdata(fig,'gui',gui); + % deactivate joint inversion panels onMenuJointInversion(gui.menu.extra_joint_off); % get changed GUI data @@ -79,6 +89,14 @@ function onMenuExpert(src,~) set(gui.menu.extra_expert_on,'Checked','on'); set(gui.menu.extra_expert_off,'Checked','off'); + % activate solver menu if optimization toolbox is available + switch data.info.has_optim + case 'on' + set(gui.menu.extra_solver,'Enable','on'); + case 'off' + set(gui.menu.extra_solver,'Enable','off'); + end + % activate joint inversion menu set(gui.menu.extra_joint,'Enable','on'); @@ -97,6 +115,7 @@ function onMenuExpert(src,~) NUCLEUSinv_updateInterface; % update status information updateStatusInformation; +updateToolTips; onFigureSizeChange(fig); end diff --git a/callbacks/menus/onMenuExtraColor.m b/callbacks/menus/onMenuExtraColor.m index 3ce7562..036a45c 100644 --- a/callbacks/menus/onMenuExtraColor.m +++ b/callbacks/menus/onMenuExtraColor.m @@ -44,14 +44,22 @@ function onMenuExtraColor(src,~) set(gui.menu.extra_settings_theme_standard,'Checked','on'); set(gui.menu.extra_settings_theme_basic,'Checked','off'); set(gui.menu.extra_settings_theme_dark,'Checked','off'); + set(gui.menu.extra_settings_theme_black,'Checked','off'); case 'basic' set(gui.menu.extra_settings_theme_standard,'Checked','off'); set(gui.menu.extra_settings_theme_basic,'Checked','on'); set(gui.menu.extra_settings_theme_dark,'Checked','off'); + set(gui.menu.extra_settings_theme_black,'Checked','off'); case 'dark' set(gui.menu.extra_settings_theme_standard,'Checked','off'); set(gui.menu.extra_settings_theme_basic,'Checked','off'); set(gui.menu.extra_settings_theme_dark,'Checked','on'); + set(gui.menu.extra_settings_theme_black,'Checked','off'); + case 'black' + set(gui.menu.extra_settings_theme_standard,'Checked','off'); + set(gui.menu.extra_settings_theme_basic,'Checked','off'); + set(gui.menu.extra_settings_theme_dark,'Checked','off'); + set(gui.menu.extra_settings_theme_black,'Checked','on'); end % adjust the colors diff --git a/callbacks/menus/onMenuExtraShow.m b/callbacks/menus/onMenuExtraShow.m index ddb51da..208778d 100644 --- a/callbacks/menus/onMenuExtraShow.m +++ b/callbacks/menus/onMenuExtraShow.m @@ -141,8 +141,7 @@ function onMenuExtraShow(src,~) otherwise % nothing to do - end - + end end setappdata(fig,'gui',gui); diff --git a/callbacks/menus/onMenuHelp.m b/callbacks/menus/onMenuHelp.m index 13c3b0d..c8c5d19 100644 --- a/callbacks/menus/onMenuHelp.m +++ b/callbacks/menus/onMenuHelp.m @@ -50,7 +50,7 @@ function onMenuHelp(src,~) info{end+1,1} = ['date: ',myui.date]; info{end+1,1} = ' '; - switch data.info.optim + switch data.info.has_optim case 'on' info{end+1,1} = 'Optimization Toolbox: IS available.'; info{end+1,1} = 'All inversion features can be used.'; diff --git a/callbacks/menus/onMenuJointInversion.m b/callbacks/menus/onMenuJointInversion.m index abec7d0..c4d327d 100644 --- a/callbacks/menus/onMenuJointInversion.m +++ b/callbacks/menus/onMenuJointInversion.m @@ -142,7 +142,7 @@ function onMenuJointInversion(src,~) set(gui.popup_handles.invjoint_geometry_type,'Enable','on'); set(gui.push_handles.invjoint_run,'Enable','on'); % choose default inversion method - switch data.info.optim + switch data.info.has_optim case 'on' data.invjoint.invtype = 'free'; case 'off' diff --git a/callbacks/menus/onMenuSolver.m b/callbacks/menus/onMenuSolver.m new file mode 100644 index 0000000..ba15832 --- /dev/null +++ b/callbacks/menus/onMenuSolver.m @@ -0,0 +1,92 @@ +function onMenuSolver(src,~) +%onMenuSolver handles the call from the menu that allows to choose the LSQ +%solver +% +% Syntax: +% onMenuSolver +% +% Inputs: +% src - handle of the calling object +% +% Outputs: +% none +% +% Example: +% onMenuSolver(src,~) +% +% Other m-files required: +% NUCLEUSinv_updateInterface +% updateStatusInformation +% +% Subfunctions: +% none +% +% MAT-files required: +% none +% +% See also: NUCLEUSinv +% Author: Thomas Hiller +% email: thomas.hiller[at]leibniz-liag.de +% License: MIT License (at end) + +%------------- BEGIN CODE -------------- + +%% get GUI handle and data +fig = findobj('Tag','INV'); +gui = getappdata(fig,'gui'); +data = getappdata(fig,'data'); + +% solver +solver = get(src,'Label'); + +% switch solver +if strfind(solver,'LSQLIN') + data.info.solver = 'lsqlin'; + % menu entry + set(gui.menu.extra_solver_lsqlin,'Checked','on'); + set(gui.menu.extra_solver_lsqnonneg,'Checked','off'); + + % update the tooltips + +elseif strfind(solver,'LSQNONNEG') + data.info.solver = 'lsqnonneg'; + % menu entry + set(gui.menu.extra_solver_lsqlin,'Checked','off'); + set(gui.menu.extra_solver_lsqnonneg,'Checked','on'); +end + +% update GUI data +setappdata(fig,'data',data); +setappdata(fig,'gui',gui); +% update interface +NUCLEUSinv_updateInterface; +% update status information +updateStatusInformation; +updateToolTips; + +end + +%------------- END OF CODE -------------- + +%% License: +% MIT License +% +% Copyright (c) 2019 Thomas Hiller +% +% Permission is hereby granted, free of charge, to any person obtaining a copy +% of this software and associated documentation files (the "Software"), to deal +% in the Software without restriction, including without limitation the rights +% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +% copies of the Software, and to permit persons to whom the Software is +% furnished to do so, subject to the following conditions: +% +% The above copyright notice and this permission notice shall be included in all +% copies or substantial portions of the Software. +% +% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +% SOFTWARE. \ No newline at end of file diff --git a/callbacks/popup/onPopupInvjointType.m b/callbacks/popup/onPopupInvjointType.m index a67f215..e6100e0 100644 --- a/callbacks/popup/onPopupInvjointType.m +++ b/callbacks/popup/onPopupInvjointType.m @@ -43,7 +43,7 @@ function onPopupInvjointType(src,~) case 1 % free % if the optimization toolbox is not there then the fixed % inversion is the default - switch data.info.optim + switch data.info.has_optim case 'on' data.invjoint.invtype = 'free'; case 'off' diff --git a/doc/menu.html b/doc/menu.html index 0816461..e60bf3d 100644 --- a/doc/menu.html +++ b/doc/menu.html @@ -16,7 +16,7 @@

Matlab Index

Matlab Directories

- +
Generated by m2html © 2005
diff --git a/doc/nucleus/NUCLEUSinv/NUCLEUSinv.html b/doc/nucleus/NUCLEUSinv/NUCLEUSinv.html index 6e65e45..5e4aee8 100644 --- a/doc/nucleus/NUCLEUSinv/NUCLEUSinv.html +++ b/doc/nucleus/NUCLEUSinv/NUCLEUSinv.html @@ -111,8 +111,8 @@

SOURCE CODE ^if ~isempty(h0); close(h0); end 0039 0040 %% GUI 'header' info and defaults -0041 myui.version = '0.1.7'; -0042 myui.date = '27.06.2019'; +0041 myui.version = '0.1.8'; +0042 myui.date = '08.07.2019'; 0043 myui.author = 'Thomas Hiller'; 0044 myui.email = 'thomas.hiller[at]leibniz-liag.de'; 0045 myui.fontsize = 10; @@ -149,7 +149,7 @@

SOURCE CODE ^for i = 1:size(Mver,2) 0078 if strcmp(Mver(i).Name,'Optimization Toolbox') -0079 data.info.optim = 'on'; +0079 data.info.has_optim = 'on'; 0080 end 0081 if strfind(Mver(i).Name,'Statistics') 0082 data.info.stat = 'on'; diff --git a/doc/nucleus/NUCLEUSinv/NUCLEUSinv_createGUI.html b/doc/nucleus/NUCLEUSinv/NUCLEUSinv_createGUI.html index e9192cb..d4ae5a9 100644 --- a/doc/nucleus/NUCLEUSinv/NUCLEUSinv_createGUI.html +++ b/doc/nucleus/NUCLEUSinv/NUCLEUSinv_createGUI.html @@ -42,6 +42,7 @@

DESCRIPTION ^DESCRIPTION ^DESCRIPTION ^CROSS-REFERENCE INFORMATION ^

This function calls: +
  • NUCLEUSinv_createMenus creates all GUI menus
  • NUCLEUSinv_createPanelData creates data panel
  • NUCLEUSinv_createPanelInfo creates status bar
  • NUCLEUSinv_createPanelInversionJoint creates joint inversion panel
  • NUCLEUSinv_createPanelInversionStd creates standard inversion panel
  • NUCLEUSinv_createPanelPetro creates Petrophysics panel
  • NUCLEUSinv_createPanelPlots creates graphics panel
  • NUCLEUSinv_createPanelProcess creates process panel
  • NUCLEUSinv_createStatusbar creates status bar
  • NUCLEUSinv_processINI processes the ini-file
  • displayStatusText clears all axes of a given figure
  • getColorTheme returns the colors of the selected color theme
  • minimizePanel handles the minimization/maximization of all box-panels for
  • switchToolTips switches GUI tool tips either "on" or "off"
  • updateStatusInformation updates all fields inside the bottom status bar
  • updateToolTips updates tool tip entries dependent on the chosen settings
  • This function is called by:
    • NUCLEUSinv is a graphical user interface (GUI) to invert NMR relaxometry
    @@ -93,226 +97,235 @@

    SOURCE CODE ^% NUCLEUSinv_createGUI(gcf,1) 0016 % 0017 % Other m-files required: -0018 % NUCLEUSinv_createMenus.m -0019 % NUCLEUSinv_createPanelData.m -0020 % NUCLEUSinv_createPanelProcess.m -0021 % NUCLEUSinv_createPanelPetro -0022 % NUCLEUSinv_createPanelInversionStd.m -0023 % NUCLEUSinv_createPanelInversionJoint.m -0024 % NUCLEUSinv_createPanelPlots.m -0025 % NUCLEUSinv_createPanelInfo -0026 % NUCLEUSinv_createStatusbar -0027 % -0028 % Subfunctions: -0029 % none -0030 % -0031 % MAT-files required: -0032 % none -0033 % -0034 % See also: NUCLEUSinv -0035 % Author: Thomas Hiller -0036 % email: thomas.hiller[at]leibniz-liag.de -0037 % License: MIT License (at end) -0038 -0039 %------------- BEGIN CODE -------------- -0040 -0041 %% get figure data -0042 gui = getappdata(h,'gui'); -0043 data = getappdata(h,'data'); +0018 % changeColorTheme.m +0019 % NUCLEUSinv_createMenus.m +0020 % NUCLEUSinv_createPanelData.m +0021 % NUCLEUSinv_createPanelProcess.m +0022 % NUCLEUSinv_createPanelPetro +0023 % NUCLEUSinv_createPanelInversionStd.m +0024 % NUCLEUSinv_createPanelInversionJoint.m +0025 % NUCLEUSinv_createPanelPlots.m +0026 % NUCLEUSinv_createPanelInfo.m +0027 % NUCLEUSinv_createStatusbar.m +0028 % switchToolTips.m +0029 % updateStatusInformation.m +0030 % updateToolTips.m +0031 % +0032 % Subfunctions: +0033 % none +0034 % +0035 % MAT-files required: +0036 % none +0037 % +0038 % See also: NUCLEUSinv +0039 % Author: Thomas Hiller +0040 % email: thomas.hiller[at]leibniz-liag.de +0041 % License: MIT License (at end) +0042 +0043 %------------- BEGIN CODE -------------- 0044 -0045 %% init wait-bar -0046 if wbon -0047 hwb = waitbar(0,'loading ...','Name','NUCLEUSinv initialization','Visible','off'); -0048 steps = 8; -0049 if ~isempty(h) -0050 posf = get(h,'Position'); -0051 set(hwb,'Units','Pixel') -0052 posw = get(hwb,'Position'); -0053 set(hwb,'Position',[posf(1)+posf(3)/2-posw(3)/2 posf(2)+posf(4)/2-posw(4)/2 posw(3:4)]); -0054 end -0055 set(hwb,'Visible','on'); -0056 end -0057 -0058 %% import ini-file -0059 gui = NUCLEUSinv_processINI(gui); -0060 myui = gui.myui; -0061 % apply color theme -0062 myui.colors = getColorTheme('INV',gui.myui.inidata.colortheme); -0063 % get import path -0064 data.import.path = myui.inidata.importpath; -0065 % info stuff -0066 data.info.ExpertMode = myui.inidata.expertmode; -0067 data.info.InvInfo = myui.inidata.invinfo; -0068 data.info.ToolTips = myui.inidata.tooltips; -0069 -0070 %% uimenus -0071 if wbon -0072 waitbar(1/steps,hwb,'loading GUI elements - menus'); -0073 end -0074 gui = NUCLEUSinv_createMenus(gui); -0075 -0076 %% MAIN GUI "BOX" -0077 % make everything invisible during creation -0078 gui.main = uix.VBox('Parent',gui.figh,'Visible','off'); -0079 % gui.main = uix.VBox('Parent',gui.figh); -0080 -0081 % top part for settings and plots -0082 gui.top = uix.HBoxFlex('Parent',gui.main,'Spacing',5); -0083 % bottom part for the statusbar -0084 gui.bottom = uix.HBox('Parent',gui.main); -0085 set(gui.main,'Heights',[-1 20]); -0086 -0087 % all control panels are on the left inside a vertically scrollable panel -0088 gui.left = uix.ScrollingPanel('Parent',gui.top); -0089 % all graphics are in the center inside a vertical box -0090 gui.center = uix.VBox('Parent',gui.top,'Spacing',3); -0091 % all info fields are on the right inside a vertical box -0092 gui.right = uix.HBox('Parent',gui.top,'Spacing',3); -0093 % fix size of the settings side to 400 pixel -0094 % set(gui.top,'Widths',[400 -1 210]); -0095 set(gui.top,'Widths',[400 -1 -1]); -0096 set(gui.top,'MinimumWidths',[400 200 10]); -0097 -0098 %% A. settings column -0099 gui.panels.main = uix.VBox('Parent',gui.left); -0100 gui.panels.data.main = uix.BoxPanel('Parent',gui.panels.main,'Title','NMR Data',... -0101 'TitleColor',myui.colors.BoxDAT,'ForegroundColor',myui.colors.BoxTitle); -0102 gui.panels.process.main = uix.BoxPanel('Parent',gui.panels.main,... -0103 'Title','Simple Processing','MinimizeFcn',@minimizePanel,... -0104 'TitleColor',myui.colors.BoxPRC,'ForegroundColor',myui.colors.BoxTitle); -0105 gui.panels.petro.main = uix.BoxPanel('Parent',gui.panels.main,... -0106 'Title','Petro Parameter','MinimizeFcn',@minimizePanel,... -0107 'TitleColor',myui.colors.BoxCBW,'ForegroundColor',myui.colors.BoxTitle); -0108 gui.panels.invstd.main = uix.BoxPanel('Parent',gui.panels.main,... -0109 'Title','Standard Inversion','MinimizeFcn',@minimizePanel,... -0110 'TitleColor',myui.colors.BoxINV,'ForegroundColor',myui.colors.BoxTitle); -0111 gui.panels.invjoint.main = uix.BoxPanel('Parent',gui.panels.main,... -0112 'Title','Joint Inversion','MinimizeFcn',@minimizePanel,... -0113 'TitleColor',myui.colors.BoxCPS,'ForegroundColor',myui.colors.BoxTitle); -0114 -0115 % adjust the heights of all left-column-panels -0116 myui.heights = [250 22 22 22 22; -1 109 137 190 299]; -0117 % panel header is always 22 high -0118 set(gui.panels.main,'Heights',myui.heights(2,:),... -0119 'MinimumHeights',[250 22 22 22 22]); -0120 set(gui.left,'Heights',-1,'MinimumHeights',593); -0121 -0122 % 1. data panel -0123 if wbon -0124 waitbar(2/steps,hwb,'loading GUI elements - data'); -0125 end -0126 [gui,myui] = NUCLEUSinv_createPanelData(gui,myui); -0127 -0128 % 2. processing data panel -0129 if wbon -0130 waitbar(3/steps,hwb,'loading GUI elements - process'); -0131 end -0132 [gui,myui] = NUCLEUSinv_createPanelProcess(data,gui,myui); -0133 -0134 % 3. petro parameter panel -0135 if wbon -0136 waitbar(4/steps,hwb,'loading GUI elements - petro'); -0137 end -0138 [gui,myui] = NUCLEUSinv_createPanelPetro(data,gui,myui); -0139 -0140 % 4. standard inversion panel -0141 if wbon -0142 waitbar(5/steps,hwb,'loading GUI elements - standard inversion'); -0143 end -0144 [gui,myui] = NUCLEUSinv_createPanelInversionStd(data,gui,myui); -0145 -0146 % 5. joint inversion panel -0147 if wbon -0148 waitbar(6/steps,hwb,'loading GUI elements - joint inversion'); -0149 end -0150 % adjust the default joint inversion method depending on Optimization -0151 % toolbox availability -0152 switch data.info.optim -0153 case 'on' -0154 data.invjoint.invtype = 'free'; -0155 case 'off' -0156 data.invjoint.invtype = 'fixed'; -0157 end -0158 [gui,myui] = NUCLEUSinv_createPanelInversionJoint(data,gui,myui); -0159 -0160 %% B. graphics column -0161 if wbon -0162 waitbar(7/steps,hwb,'loading GUI elements - graphics'); -0163 end -0164 [gui,myui] = NUCLEUSinv_createPanelPlots(gui,myui); -0165 -0166 %% C. Info column -0167 if wbon -0168 waitbar(8/steps,hwb,'loading GUI elements - info column'); -0169 end -0170 gui = NUCLEUSinv_createPanelInfo(gui); -0171 -0172 % delete wait-bar -0173 if wbon -0174 delete(hwb); -0175 end +0045 %% get figure data +0046 gui = getappdata(h,'gui'); +0047 data = getappdata(h,'data'); +0048 +0049 %% init wait-bar +0050 if wbon +0051 hwb = waitbar(0,'loading ...','Name','NUCLEUSinv initialization','Visible','off'); +0052 steps = 8; +0053 if ~isempty(h) +0054 posf = get(h,'Position'); +0055 set(hwb,'Units','Pixel') +0056 posw = get(hwb,'Position'); +0057 set(hwb,'Position',[posf(1)+posf(3)/2-posw(3)/2 posf(2)+posf(4)/2-posw(4)/2 posw(3:4)]); +0058 end +0059 set(hwb,'Visible','on'); +0060 end +0061 +0062 %% import ini-file +0063 gui = NUCLEUSinv_processINI(gui); +0064 myui = gui.myui; +0065 % apply color theme +0066 myui.colors = getColorTheme('INV',gui.myui.inidata.colortheme); +0067 % get import path +0068 data.import.path = myui.inidata.importpath; +0069 % info stuff +0070 data.info.ExpertMode = myui.inidata.expertmode; +0071 data.info.InvInfo = myui.inidata.invinfo; +0072 data.info.ToolTips = myui.inidata.tooltips; +0073 +0074 %% uimenus +0075 if wbon +0076 waitbar(1/steps,hwb,'loading GUI elements - menus'); +0077 end +0078 gui = NUCLEUSinv_createMenus(data,gui); +0079 +0080 %% MAIN GUI "BOX" +0081 % make everything invisible during creation +0082 gui.main = uix.VBox('Parent',gui.figh,'Visible','off'); +0083 % gui.main = uix.VBox('Parent',gui.figh); +0084 +0085 % top part for settings and plots +0086 gui.top = uix.HBoxFlex('Parent',gui.main,'Spacing',0); +0087 % bottom part for the statusbar +0088 gui.bottom = uix.HBox('Parent',gui.main); +0089 % minimum heights of main elements +0090 set(gui.main,'Heights',[-1 20],'MinimumHeights',[250+4*22 20]); +0091 +0092 % all control panels are on the left inside a vertically scrollable panel +0093 gui.left = uix.ScrollingPanel('Parent',gui.top); +0094 % all graphics are in the center inside a vertical box +0095 gui.center = uix.VBox('Parent',gui.top,'Spacing',3); +0096 % all info fields are on the right inside a vertical box +0097 gui.right = uix.HBox('Parent',gui.top,'Spacing',3); +0098 % fix size of the settings side to 400 pixel +0099 % set(gui.top,'Widths',[400 -1 210]); +0100 set(gui.top,'Widths',[400 -1 -1]); +0101 set(gui.top,'MinimumWidths',[400 200 10]); +0102 +0103 %% A. settings column +0104 gui.panels.main = uix.VBox('Parent',gui.left); +0105 gui.panels.data.main = uix.BoxPanel('Parent',gui.panels.main,'Title','NMR Data',... +0106 'TitleColor',myui.colors.BoxDAT,'ForegroundColor',myui.colors.BoxTitle); +0107 gui.panels.process.main = uix.BoxPanel('Parent',gui.panels.main,... +0108 'Title','Simple Processing','MinimizeFcn',@minimizePanel,... +0109 'TitleColor',myui.colors.BoxPRC,'ForegroundColor',myui.colors.BoxTitle); +0110 gui.panels.petro.main = uix.BoxPanel('Parent',gui.panels.main,... +0111 'Title','Petro Parameter','MinimizeFcn',@minimizePanel,... +0112 'TitleColor',myui.colors.BoxCBW,'ForegroundColor',myui.colors.BoxTitle); +0113 gui.panels.invstd.main = uix.BoxPanel('Parent',gui.panels.main,... +0114 'Title','Standard Inversion','MinimizeFcn',@minimizePanel,... +0115 'TitleColor',myui.colors.BoxINV,'ForegroundColor',myui.colors.BoxTitle); +0116 gui.panels.invjoint.main = uix.BoxPanel('Parent',gui.panels.main,... +0117 'Title','Joint Inversion','MinimizeFcn',@minimizePanel,... +0118 'TitleColor',myui.colors.BoxCPS,'ForegroundColor',myui.colors.BoxTitle); +0119 +0120 % adjust the heights of all left-column-panels +0121 myui.heights = [250 22 22 22 22; -1 109 137 190 299]; +0122 % panel header is always 22 high +0123 set(gui.panels.main,'Heights',myui.heights(2,:),... +0124 'MinimumHeights',[250 22 22 22 22]); +0125 set(gui.left,'Heights',-1,'MinimumHeights',250+109+22+190+22); +0126 +0127 % 1. data panel +0128 if wbon +0129 waitbar(2/steps,hwb,'loading GUI elements - data'); +0130 end +0131 [gui,myui] = NUCLEUSinv_createPanelData(gui,myui); +0132 +0133 % 2. processing data panel +0134 if wbon +0135 waitbar(3/steps,hwb,'loading GUI elements - process'); +0136 end +0137 [gui,myui] = NUCLEUSinv_createPanelProcess(data,gui,myui); +0138 +0139 % 3. petro parameter panel +0140 if wbon +0141 waitbar(4/steps,hwb,'loading GUI elements - petro'); +0142 end +0143 [gui,myui] = NUCLEUSinv_createPanelPetro(data,gui,myui); +0144 +0145 % 4. standard inversion panel +0146 if wbon +0147 waitbar(5/steps,hwb,'loading GUI elements - standard inversion'); +0148 end +0149 [gui,myui] = NUCLEUSinv_createPanelInversionStd(data,gui,myui); +0150 +0151 % 5. joint inversion panel +0152 if wbon +0153 waitbar(6/steps,hwb,'loading GUI elements - joint inversion'); +0154 end +0155 % adjust the default joint inversion method depending on Optimization +0156 % toolbox availability +0157 switch data.info.has_optim +0158 case 'on' +0159 data.invjoint.invtype = 'free'; +0160 case 'off' +0161 data.invjoint.invtype = 'fixed'; +0162 end +0163 [gui,myui] = NUCLEUSinv_createPanelInversionJoint(data,gui,myui); +0164 +0165 %% B. graphics column +0166 if wbon +0167 waitbar(7/steps,hwb,'loading GUI elements - graphics'); +0168 end +0169 [gui,myui] = NUCLEUSinv_createPanelPlots(gui,myui); +0170 +0171 %% C. Info column +0172 if wbon +0173 waitbar(8/steps,hwb,'loading GUI elements - info column'); +0174 end +0175 gui = NUCLEUSinv_createPanelInfo(gui); 0176 -0177 %% D. status bar -0178 gui = NUCLEUSinv_createStatusbar(gui); -0179 -0180 %% finalize -0181 % minimize all petro and joint inversion related panels at startup -0182 tmp_h = myui.heights(2,:); -0183 tmp_h(3) = myui.heights(1,3); -0184 tmp_h(5) = myui.heights(1,5); -0185 set(gui.panels.main,'Heights',tmp_h); -0186 set(gui.panels.petro.main,'Minimized',true); -0187 set(gui.panels.invjoint.main,'Minimized',true); -0188 set(gui.center,'Heights',[-1 -1 22]); -0189 set(gui.plots.CPSPanel,'Minimized',true); -0190 -0191 % make the GUI visible again; "gui" needs to be saved because -0192 % otherwise "fixAxes" throws an error (in NUCLEUSmod); strangely here it -0193 % also works without it, but I put it for consistency reasons -0194 setappdata(h,'gui',gui); -0195 set(gui.main,'Visible','on'); -0196 -0197 %% enable all menus -0198 set(gui.menu.file,'Enable','on'); -0199 set(gui.menu.extra,'Enable','on'); -0200 set(gui.menu.help,'Enable','on'); -0201 -0202 %% process tooltip preferences -0203 switchToolTips(gui,myui.inidata.tooltips); +0177 % delete wait-bar +0178 if wbon +0179 delete(hwb); +0180 end +0181 +0182 %% D. status bar +0183 gui = NUCLEUSinv_createStatusbar(gui); +0184 +0185 %% finalize +0186 % minimize all petro and joint inversion related panels at startup +0187 tmp_h = myui.heights(2,:); +0188 tmp_h(3) = myui.heights(1,3); +0189 tmp_h(5) = myui.heights(1,5); +0190 set(gui.panels.main,'Heights',tmp_h); +0191 set(gui.panels.petro.main,'Minimized',true); +0192 set(gui.panels.invjoint.main,'Minimized',true); +0193 set(gui.center,'Heights',[-1 -1 22]); +0194 set(gui.plots.CPSPanel,'Minimized',true); +0195 % minimum size of bottom status bar +0196 set(gui.bottom,'MinimumWidths',610); +0197 +0198 % make the GUI visible again; "gui" needs to be saved because +0199 % otherwise "fixAxes" throws an error (in NUCLEUSmod); strangely here it +0200 % also works without it, but I put it for consistency reasons +0201 setappdata(h,'gui',gui); +0202 % changeColorTheme('INV',myui.colors.theme); +0203 set(gui.main,'Visible','on'); 0204 -0205 %% update the GUI data -0206 gui.myui = myui; -0207 setappdata(h,'gui',gui); -0208 setappdata(h,'data',data); -0209 displayStatusText(gui,'NUCLEUSinv successfully started'); -0210 updateStatusInformation; -0211 -0212 end -0213 -0214 %------------- END OF CODE -------------- -0215 -0216 %% License: -0217 % MIT License -0218 % -0219 % Copyright (c) 2018 Thomas Hiller -0220 % -0221 % Permission is hereby granted, free of charge, to any person obtaining a copy -0222 % of this software and associated documentation files (the "Software"), to deal -0223 % in the Software without restriction, including without limitation the rights -0224 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -0225 % copies of the Software, and to permit persons to whom the Software is -0226 % furnished to do so, subject to the following conditions: +0205 %% enable all menus +0206 set(gui.menu.file,'Enable','on'); +0207 set(gui.menu.extra,'Enable','on'); +0208 set(gui.menu.help,'Enable','on'); +0209 +0210 %% process tooltip preferences +0211 switchToolTips(gui,myui.inidata.tooltips); +0212 +0213 %% update the GUI data +0214 gui.myui = myui; +0215 setappdata(h,'gui',gui); +0216 setappdata(h,'data',data); +0217 displayStatusText(gui,'NUCLEUSinv successfully started'); +0218 updateStatusInformation; +0219 updateToolTips; +0220 +0221 end +0222 +0223 %------------- END OF CODE -------------- +0224 +0225 %% License: +0226 % MIT License 0227 % -0228 % The above copyright notice and this permission notice shall be included in all -0229 % copies or substantial portions of the Software. -0230 % -0231 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -0232 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -0233 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -0234 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -0235 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -0236 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -0237 % SOFTWARE. +0228 % Copyright (c) 2018 Thomas Hiller +0229 % +0230 % Permission is hereby granted, free of charge, to any person obtaining a copy +0231 % of this software and associated documentation files (the "Software"), to deal +0232 % in the Software without restriction, including without limitation the rights +0233 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0234 % copies of the Software, and to permit persons to whom the Software is +0235 % furnished to do so, subject to the following conditions: +0236 % +0237 % The above copyright notice and this permission notice shall be included in all +0238 % copies or substantial portions of the Software. +0239 % +0240 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0241 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0242 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0243 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0244 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0245 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0246 % SOFTWARE.
    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/NUCLEUSinv/NUCLEUSinv_createMenus.html b/doc/nucleus/NUCLEUSinv/NUCLEUSinv_createMenus.html index 982bd76..2c737a5 100644 --- a/doc/nucleus/NUCLEUSinv/NUCLEUSinv_createMenus.html +++ b/doc/nucleus/NUCLEUSinv/NUCLEUSinv_createMenus.html @@ -23,15 +23,16 @@

    PURPOSE ^ creates all GUI menus

    SYNOPSIS ^

    -
    function gui = NUCLEUSinv_createMenus(gui)
    +
    function gui = NUCLEUSinv_createMenus(data,gui)

    DESCRIPTION ^

    NUCLEUSinv_createMenus creates all GUI menus
     
      Syntax:
    -       gui = NUCLEUSinv_createMenus(gui)
    +       gui = NUCLEUSinv_createMenus(gui,data)
     
      Inputs:
    +       data - figure data structure
            gui - figure gui elements structure
     
      Outputs:
    @@ -58,7 +59,7 @@ 

    DESCRIPTION ^CROSS-REFERENCE INFORMATION ^

    This function calls: +
  • onMenuExpert handles the call from the menu that activates / deactivates
  • onMenuExportData handles the calls from the export menu
  • onMenuExportGraphics handles the graphics export menu and calls the export
  • onMenuExtraColor handles the color theme menu of both GUIs
  • onMenuExtraGraphics handles the extra menu entries to show additional
  • onMenuExtraRhoBounds sets inversion bounds for the surface relaxivity
  • onMenuExtraShow handles the extra menu entries to show additional
  • onMenuHelp shows the Help Information for both GUIs
  • onMenuImport handles the import menu entries
  • onMenuJointInversion handles the call from the menu that activates / deactivates
  • onMenuRestartQuit restarts or closes the GUIs
  • onMenuSolver handles the call from the menu that allows to choose the LSQ
  • PhaseView is an extra subGUI to visualize the phase of a T2 signal
  • This function is called by: @@ -67,376 +68,402 @@

    CROSS-REFERENCE INFORMATION ^
 
 
 <h2><a name=SOURCE CODE ^

    -
    0001 function gui = NUCLEUSinv_createMenus(gui)
    +
    0001 function gui = NUCLEUSinv_createMenus(data,gui)
     0002 %NUCLEUSinv_createMenus creates all GUI menus
     0003 %
     0004 % Syntax:
    -0005 %       gui = NUCLEUSinv_createMenus(gui)
    +0005 %       gui = NUCLEUSinv_createMenus(gui,data)
     0006 %
     0007 % Inputs:
    -0008 %       gui - figure gui elements structure
    -0009 %
    -0010 % Outputs:
    -0011 %       gui
    -0012 %
    -0013 % Example:
    -0014 %       gui = NUCLEUSinv_createMenus(gui)
    -0015 %
    -0016 % Other m-files required:
    -0017 %       none
    -0018 %
    -0019 % Subfunctions:
    -0020 %       none
    -0021 %
    -0022 % MAT-files required:
    -0023 %       none
    -0024 %
    -0025 % See also: NUCLEUSinv
    -0026 % Author: Thomas Hiller
    -0027 % email: thomas.hiller[at]leibniz-liag.de
    -0028 % License: MIT License (at end)
    -0029 
    -0030 %------------- BEGIN CODE --------------
    -0031 
    -0032 %% 1. File
    -0033 gui.menu.file = uimenu(gui.figh,...
    -0034     'Label','File','Enable','off');
    -0035 
    -0036 % 1.1 Import
    -0037 gui.menu.file_import = uimenu(gui.menu.file,...
    -0038     'Label','Import');
    -0039 %
    -0040 lastimport = gui.myui.inidata.lastimport;
    -0041 ind = strfind(lastimport,'_');
    -0042 tag = lastimport(1:ind-1);
    -0043 label = lastimport(ind+1:end);
    -0044 gui.menu.file_import_lastimport = uimenu(gui.menu.file_import,...
    -0045     'Label',label,'Tag',tag,'Callback',@onMenuImport);
    -0046 % 1.1.1 Lab
    -0047 gui.menu.file_import_lab = uimenu(gui.menu.file_import,...
    -0048     'Label','Lab');
    -0049 % 1.1.1.1 BAM
    -0050 gui.menu.file_import_lab_bam = uimenu(gui.menu.file_import_lab,...
    -0051     'Label','BAM');
    -0052 % 1.1.1.1.1 BAM TOM
    -0053 gui.menu.file_import_lab_bam_tom = uimenu(gui.menu.file_import_lab_bam,...
    -0054     'Label','BAM TOM','Tag','Lab','Callback',@onMenuImport);
    -0055 % 1.1.1.2 BGR
    -0056 gui.menu.file_import_lab_bgr = uimenu(gui.menu.file_import_lab,...
    -0057     'Label','BGR');
    -0058 % 1.1.1.2.1 BGR std
    -0059 gui.menu.file_import_lab_bgr_std = uimenu(gui.menu.file_import_lab_bgr,...
    -0060     'Label','BGR std','Tag','Lab','Callback',@onMenuImport);
    -0061 % 1.1.1.2.2 BGR org
    -0062 gui.menu.file_import_lab_bgr_org = uimenu(gui.menu.file_import_lab_bgr,...
    -0063     'Label','BGR org','Tag','Lab','Callback',@onMenuImport);
    -0064 % 1.1.1.2.3 BGR mat
    -0065 gui.menu.file_import_lab_bgr_mat = uimenu(gui.menu.file_import_lab_bgr,...
    -0066     'Label','BGR mat','Tag','Lab','Callback',@onMenuImport);
    -0067 % 1.1.1.3 CoreLab ascii
    -0068 gui.menu.file_import_lab_corelab = uimenu(gui.menu.file_import_lab,...
    -0069     'Label','CoreLab ascii','Tag','Lab','Callback',@onMenuImport);
    -0070 % 1.1.1.4 LIAG
    -0071 gui.menu.file_import_lab_liag = uimenu(gui.menu.file_import_lab,...
    -0072     'Label','LIAG');
    -0073 % 1.1.1.4.1 LIAG
    -0074 gui.menu.file_import_lab_liag_single = uimenu(gui.menu.file_import_lab_liag,...
    -0075     'Label','LIAG single','Tag','Lab','Callback',@onMenuImport);
    -0076 % 1.1.1.4.2 LIAG
    -0077 gui.menu.file_import_lab_liag_project = uimenu(gui.menu.file_import_lab_liag,...
    -0078     'Label','LIAG from project','Tag','Lab','Callback',@onMenuImport);
    -0079 % 1.1.1.5 MOUSE
    -0080 gui.menu.file_import_lab_mouse = uimenu(gui.menu.file_import_lab,...
    -0081     'Label','MOUSE','Tag','Lab','Callback',@onMenuImport);
    -0082 % 1.1.1.6 RWTH
    -0083 gui.menu.file_import_lab_rwth = uimenu(gui.menu.file_import_lab,...
    -0084     'Label','RWTH');
    -0085 % 1.1.1.6.1 RWTH ascii
    -0086 gui.menu.file_import_lab_rwth_ascii = uimenu(gui.menu.file_import_lab_rwth,...
    -0087     'Label','RWTH ascii','Tag','Lab','Callback',@onMenuImport);
    -0088 % 1.1.1.6.2 RWTH field
    -0089 gui.menu.file_import_lab_rwth_field = uimenu(gui.menu.file_import_lab_rwth,...
    -0090     'Label','RWTH field','Tag','Lab','Callback',@onMenuImport);
    -0091 % 1.1.1.6.3 Dart
    -0092 gui.menu.file_import_lab_rwth_dart = uimenu(gui.menu.file_import_lab_rwth,...
    -0093     'Label','Dart','Tag','Lab','Callback',@onMenuImport);
    -0094 
    -0095 % 1.1.2 Ascii
    -0096 gui.menu.file_import_ascii = uimenu(gui.menu.file_import,...
    -0097     'Label','Ascii');
    -0098 % 1.1.2.1 T1
    -0099 gui.menu.file_import_lab_ascii_T1 = uimenu(gui.menu.file_import_ascii,...
    -0100     'Label','T1','Tag','Ascii','Callback',@onMenuImport);
    -0101 % 1.1.2.2 T2
    -0102 gui.menu.file_import_lab_ascii_T2 = uimenu(gui.menu.file_import_ascii,...
    -0103     'Label','T2','Tag','Ascii','Callback',@onMenuImport);
    -0104 
    -0105 % 1.1.3 Excel
    -0106 gui.menu.file_import_excel = uimenu(gui.menu.file_import,...
    -0107     'Label','Excel');
    -0108 % 1.1.3.1 T1
    -0109 gui.menu.file_import_lab_excel_T1 = uimenu(gui.menu.file_import_excel,...
    -0110     'Label','T1','Tag','Excel','Callback',@onMenuImport);
    -0111 % 1.1.3.2 T2
    -0112 gui.menu.file_import_lab_excel_T2 = uimenu(gui.menu.file_import_excel,...
    -0113     'Label','T2','Tag','Excel','Callback',@onMenuImport);
    -0114 
    -0115 % 1.1.4 NUCLEUSinv
    -0116 gui.menu.file_import_nmrinv = uimenu(gui.menu.file_import,...
    -0117     'Label','NUCLEUSinv','Separator','on');
    -0118 % 1.1.4.1 NUCLEUSinv session file
    -0119 gui.menu.file_import_nmrinv_file = uimenu(gui.menu.file_import_nmrinv,...
    -0120     'Label','Session','Tag','NUCLEUSinv','Callback',@onMenuImport);
    -0121 
    -0122 % 1.1.5 NUCLEUSmod
    -0123 gui.menu.file_import_nmrmod = uimenu(gui.menu.file_import,...
    -0124     'Label','NUCLEUSmod');
    -0125 % 1.1.5.1 NUCLEUSmod from file
    -0126 gui.menu.file_import_nmrmod_file = uimenu(gui.menu.file_import_nmrmod,...
    -0127     'Label','File','Tag','NUCLEUSmod','Callback',@onMenuImport);
    -0128 % 1.1.5.2 NUCLEUSmod from GUI
    -0129 gui.menu.file_import_nmrmod_gui = uimenu(gui.menu.file_import_nmrmod,....
    -0130     'Label','GUI','Tag','NUCLEUSmod','Callback',@onMenuImport);
    -0131 
    -0132 % 1.2 Export
    -0133 gui.menu.file_export = uimenu(gui.menu.file,...
    -0134     'Label','Export');
    -0135 % 1.2.1 Data
    -0136 gui.menu.file_export_data = uimenu(gui.menu.file_export,...
    -0137     'Label','Data');
    -0138 % 1.2.1.1 GUI raw data mat-file
    -0139 gui.menu.file_export_data_GUImat = uimenu(gui.menu.file_export_data,...
    -0140     'Label','NUCLEUSinv (raw)','Callback',@onMenuExportData);
    -0141 % 1.2.1.2 GUI session mat-file
    -0142 gui.menu.file_export_data_GUImat = uimenu(gui.menu.file_export_data,...
    -0143     'Label','NUCLEUSinv (session)','Callback',@onMenuExportData);
    -0144 % 1.2.1.3 Inversion results single xls
    -0145 gui.menu.file_export_data_invstd_excel = uimenu(gui.menu.file_export_data,...
    -0146     'Label','EXCEL single (std)','Separator','on','Callback',@onMenuExportData);
    -0147 % 1.2.1.4 Inversion results single mat-file
    -0148 gui.menu.file_export_data_invstd_mat_single = uimenu(gui.menu.file_export_data,...
    -0149     'Label','MAT single (std)','Callback',@onMenuExportData);
    -0150 % 1.2.1.5 Inversion results all mat-file
    -0151 gui.menu.file_export_data_invstd_mat_all = uimenu(gui.menu.file_export_data,...
    -0152     'Label','MAT all (std)','Callback',@onMenuExportData);
    -0153 % 1.2.1.6 Joint Inversion results xls
    -0154 gui.menu.file_export_data_invjoint_excel = uimenu(gui.menu.file_export_data,...
    -0155     'Label','EXCEL all (joint)','Separator','on','Enable','off',...
    -0156     'Callback',@onMenuExportData);
    -0157 % 1.2.1.7 Joint Inversion results mat-file
    -0158 gui.menu.file_export_data_invjoint_mat = uimenu(gui.menu.file_export_data,...
    -0159     'Label','MAT all (joint)','Enable','off','Callback',@onMenuExportData);
    -0160 % 1.2.1.8 LIAG archive
    -0161 gui.menu.file_export_data_liag_archive = uimenu(gui.menu.file_export_data,...
    -0162     'Label','LIAG archive','Separator','on','Callback',@onMenuExportData);
    -0163 % 1.2.1.9 LIAG CSV T2
    -0164 gui.menu.file_export_data_liag_csvT2 = uimenu(gui.menu.file_export_data,...
    -0165     'Label','LIAG CSV T2','Callback',@onMenuExportData);
    -0166 
    -0167 % 1.2.2 Graphics
    -0168 gui.menu.file_export_graphics = uimenu(gui.menu.file_export,...
    -0169     'Label','Graphics');
    -0170 % 1.2.2.1 Layout
    -0171 gui.menu.file_export_graphics_layout = uimenu(gui.menu.file_export_graphics,...
    -0172     'Label','Layout');
    -0173 % 1.2.2.1.1 Layout vertical
    -0174 gui.menu.file_export_graphics_layout_vert = uimenu(gui.menu.file_export_graphics_layout,...
    -0175     'Label','vert','Checked','on','Callback',@onMenuExportGraphics);
    -0176 % 1.2.2.1.2 Layout horizontal
    -0177 gui.menu.file_export_graphics_layout_horz = uimenu(gui.menu.file_export_graphics_layout,...
    -0178     'Label','horz','Callback',@onMenuExportGraphics);
    -0179 % 1.2.2.2 fig
    -0180 gui.menu.file_export_graphics_fig = uimenu(gui.menu.file_export_graphics,...
    -0181     'Label','FIG','Callback',@onMenuExportGraphics);
    -0182 % 1.2.2.3 png
    -0183 gui.menu.file_export_graphicspng = uimenu(gui.menu.file_export_graphics,...
    -0184     'Label','PNG','Callback',@onMenuExportGraphics);
    -0185 % 1.2.2.4 tiff
    -0186 gui.menu.file_export_graphicstiff = uimenu(gui.menu.file_export_graphics,...
    -0187     'Label','TIFF','Callback',@onMenuExportGraphics);
    -0188 % 1.2.2.5 eps
    -0189 gui.menu.file_export_graphicseps = uimenu(gui.menu.file_export_graphics,...
    -0190     'Label','EPS','Callback',@onMenuExportGraphics);
    -0191 
    -0192 % 1.3 Restart
    -0193 gui.menu.file_restart = uimenu(gui.menu.file,...
    -0194     'Label','Restart','Separator','on','Callback',@onMenuRestartQuit);
    -0195 
    -0196 % 1.4 Quit
    -0197 gui.menu.file_quit = uimenu(gui.menu.file,...
    -0198     'Label','Quit','Separator','on','Callback',@onMenuRestartQuit);
    -0199 
    -0200 %% 2. Extras
    -0201 gui.menu.extra = uimenu(gui.figh,...
    -0202     'Label','Extra','Enable','off');
    -0203 
    -0204 % 2.1 expert mode (on/off)
    -0205 gui.menu.extra_expert = uimenu(gui.menu.extra,...
    -0206     'Label','Expert Mode');
    -0207 gui.menu.extra_expert_on = uimenu(gui.menu.extra_expert,...
    -0208     'Label','On','Callback',@onMenuExpert);
    -0209 gui.menu.extra_expert_off = uimenu(gui.menu.extra_expert,...
    -0210     'Label','Off','Callback',@onMenuExpert);
    -0211 switch gui.myui.inidata.expertmode
    -0212     case 'on'
    -0213         set(gui.menu.extra_expert_on,'Checked','on');
    -0214     case 'off'
    -0215         set(gui.menu.extra_expert_off,'Checked','on');
    -0216 end
    -0217 
    -0218 % 2.2 joint inversion (on/off)
    -0219 switch gui.myui.inidata.expertmode
    -0220     case 'on'
    -0221         gui.menu.extra_joint = uimenu(gui.menu.extra,...
    -0222             'Label','Joint Inversion','Enable','on');
    -0223     case 'off'
    -0224         gui.menu.extra_joint = uimenu(gui.menu.extra,...
    -0225             'Label','Joint Inversion','Enable','off');
    -0226 end
    -0227 gui.menu.extra_joint_on = uimenu(gui.menu.extra_joint,...
    -0228     'Label','On','Callback',@onMenuJointInversion);
    -0229 gui.menu.extra_joint_off = uimenu(gui.menu.extra_joint,...
    -0230     'Label','Off','Checked','on','Callback',@onMenuJointInversion);
    -0231 
    -0232 
    -0233 % 2.3 settings
    -0234 gui.menu.extra_settings = uimenu(gui.menu.extra,...
    -0235     'Label','Settings');
    -0236 
    -0237 % 2.3.1 inversion info (on/off)
    -0238 gui.menu.extra_settings_invinfo = uimenu(gui.menu.extra_settings,...
    -0239     'Label','Inversion Display');
    -0240 gui.menu.extra_settings_invinfo_on = uimenu(gui.menu.extra_settings_invinfo,...
    -0241     'Label','On','Callback',@onMenuExtraShow);
    -0242 gui.menu.extra_settings_invinfo_off = uimenu(gui.menu.extra_settings_invinfo,...
    -0243     'Label','Off','Callback',@onMenuExtraShow);
    -0244 switch gui.myui.inidata.invinfo
    -0245     case 'on'
    -0246         set(gui.menu.extra_settings_invinfo_on,'Checked','on');
    -0247     case 'off'
    -0248         set(gui.menu.extra_settings_invinfo_off,'Checked','on');
    -0249 end
    -0250 
    -0251 % 2.3.2 tooltips (on/off)
    -0252 gui.menu.extra_settings_tooltips = uimenu(gui.menu.extra_settings,...
    -0253     'Label','Tooltips');
    -0254 gui.menu.extra_settings_tooltips_on = uimenu(gui.menu.extra_settings_tooltips,...
    -0255     'Label','On','Callback',@onMenuExtraShow);
    -0256 gui.menu.extra_settings_tooltips_off = uimenu(gui.menu.extra_settings_tooltips,...
    -0257     'Label','Off','Callback',@onMenuExtraShow);
    -0258 switch gui.myui.inidata.tooltips
    -0259     case 'on'
    -0260         set(gui.menu.extra_settings_tooltips_on,'Checked','on');
    -0261     case 'off'
    -0262         set(gui.menu.extra_settings_tooltips_off,'Checked','on');
    -0263 end
    -0264 
    -0265 % 2.3.3 INFO fields in plot panels (on/off)
    -0266 gui.menu.extra_settings_infofields = uimenu(gui.menu.extra_settings,...
    -0267     'Label','INFO fields');
    -0268 gui.menu.extra_settings_infofields_on = uimenu(gui.menu.extra_settings_infofields ,...
    -0269     'Label','On','Callback',@onMenuExtraShow);
    -0270 gui.menu.extra_settings_infofields_off = uimenu(gui.menu.extra_settings_infofields,...
    -0271     'Label','Off','Checked','on','Callback',@onMenuExtraShow);
    -0272 
    -0273 % 2.3.4 color theme
    -0274 gui.menu.extra_settings_theme = uimenu(gui.menu.extra_settings,...
    -0275     'Label','Color Theme');
    -0276 % 2.3.4.1 default color theme
    -0277 gui.menu.extra_settings_theme_standard = uimenu(gui.menu.extra_settings_theme,...
    -0278     'Label','standard','Callback',@onMenuExtraColor);
    -0279 % 2.3.4.2 basic color theme
    -0280 gui.menu.extra_settings_theme_basic = uimenu(gui.menu.extra_settings_theme,...
    -0281     'Label','basic','Callback',@onMenuExtraColor);
    -0282 % 2.3.4.3 dark color theme
    -0283 gui.menu.extra_settings_theme_dark = uimenu(gui.menu.extra_settings_theme,...
    -0284     'Label','dark','Callback',@onMenuExtraColor);
    -0285 switch gui.myui.inidata.colortheme
    -0286     case 'standard'
    -0287         set(gui.menu.extra_settings_theme_standard,'Checked','on');
    -0288     case 'basic'
    -0289         set(gui.menu.extra_settings_theme_basic,'Checked','on');
    -0290     case 'dark'
    -0291         set(gui.menu.extra_settings_theme_dark,'Checked','on');
    -0292 end
    +0008 %       data - figure data structure
    +0009 %       gui - figure gui elements structure
    +0010 %
    +0011 % Outputs:
    +0012 %       gui
    +0013 %
    +0014 % Example:
    +0015 %       gui = NUCLEUSinv_createMenus(gui)
    +0016 %
    +0017 % Other m-files required:
    +0018 %       none
    +0019 %
    +0020 % Subfunctions:
    +0021 %       none
    +0022 %
    +0023 % MAT-files required:
    +0024 %       none
    +0025 %
    +0026 % See also: NUCLEUSinv
    +0027 % Author: Thomas Hiller
    +0028 % email: thomas.hiller[at]leibniz-liag.de
    +0029 % License: MIT License (at end)
    +0030 
    +0031 %------------- BEGIN CODE --------------
    +0032 
    +0033 %% 1. File
    +0034 gui.menu.file = uimenu(gui.figh,...
    +0035     'Label','File','Enable','off');
    +0036 
    +0037 % 1.1 Import
    +0038 gui.menu.file_import = uimenu(gui.menu.file,...
    +0039     'Label','Import');
    +0040 %
    +0041 lastimport = gui.myui.inidata.lastimport;
    +0042 ind = strfind(lastimport,'_');
    +0043 tag = lastimport(1:ind-1);
    +0044 label = lastimport(ind+1:end);
    +0045 gui.menu.file_import_lastimport = uimenu(gui.menu.file_import,...
    +0046     'Label',label,'Tag',tag,'Callback',@onMenuImport);
    +0047 % 1.1.1 Lab
    +0048 gui.menu.file_import_lab = uimenu(gui.menu.file_import,...
    +0049     'Label','Lab');
    +0050 % 1.1.1.1 BAM
    +0051 gui.menu.file_import_lab_bam = uimenu(gui.menu.file_import_lab,...
    +0052     'Label','BAM');
    +0053 % 1.1.1.1.1 BAM TOM
    +0054 gui.menu.file_import_lab_bam_tom = uimenu(gui.menu.file_import_lab_bam,...
    +0055     'Label','BAM TOM','Tag','Lab','Callback',@onMenuImport);
    +0056 % 1.1.1.2 BGR
    +0057 gui.menu.file_import_lab_bgr = uimenu(gui.menu.file_import_lab,...
    +0058     'Label','BGR');
    +0059 % 1.1.1.2.1 BGR std
    +0060 gui.menu.file_import_lab_bgr_std = uimenu(gui.menu.file_import_lab_bgr,...
    +0061     'Label','BGR std','Tag','Lab','Callback',@onMenuImport);
    +0062 % 1.1.1.2.2 BGR org
    +0063 gui.menu.file_import_lab_bgr_org = uimenu(gui.menu.file_import_lab_bgr,...
    +0064     'Label','BGR org','Tag','Lab','Callback',@onMenuImport);
    +0065 % 1.1.1.2.3 BGR mat
    +0066 gui.menu.file_import_lab_bgr_mat = uimenu(gui.menu.file_import_lab_bgr,...
    +0067     'Label','BGR mat','Tag','Lab','Callback',@onMenuImport);
    +0068 % 1.1.1.3 CoreLab ascii
    +0069 gui.menu.file_import_lab_corelab = uimenu(gui.menu.file_import_lab,...
    +0070     'Label','CoreLab ascii','Tag','Lab','Callback',@onMenuImport);
    +0071 % 1.1.1.4 LIAG
    +0072 gui.menu.file_import_lab_liag = uimenu(gui.menu.file_import_lab,...
    +0073     'Label','LIAG');
    +0074 % 1.1.1.4.1 LIAG
    +0075 gui.menu.file_import_lab_liag_single = uimenu(gui.menu.file_import_lab_liag,...
    +0076     'Label','LIAG single','Tag','Lab','Callback',@onMenuImport);
    +0077 % 1.1.1.4.2 LIAG
    +0078 gui.menu.file_import_lab_liag_project = uimenu(gui.menu.file_import_lab_liag,...
    +0079     'Label','LIAG from project','Tag','Lab','Callback',@onMenuImport);
    +0080 % 1.1.1.5 MOUSE
    +0081 gui.menu.file_import_lab_mouse = uimenu(gui.menu.file_import_lab,...
    +0082     'Label','MOUSE','Tag','Lab','Callback',@onMenuImport);
    +0083 % 1.1.1.6 RWTH
    +0084 gui.menu.file_import_lab_rwth = uimenu(gui.menu.file_import_lab,...
    +0085     'Label','RWTH');
    +0086 % 1.1.1.6.1 RWTH ascii
    +0087 gui.menu.file_import_lab_rwth_ascii = uimenu(gui.menu.file_import_lab_rwth,...
    +0088     'Label','RWTH ascii','Tag','Lab','Callback',@onMenuImport);
    +0089 % 1.1.1.6.2 RWTH field
    +0090 gui.menu.file_import_lab_rwth_field = uimenu(gui.menu.file_import_lab_rwth,...
    +0091     'Label','RWTH field','Tag','Lab','Callback',@onMenuImport);
    +0092 % 1.1.1.6.3 Dart
    +0093 gui.menu.file_import_lab_rwth_dart = uimenu(gui.menu.file_import_lab_rwth,...
    +0094     'Label','Dart','Tag','Lab','Callback',@onMenuImport);
    +0095 
    +0096 % 1.1.2 Ascii
    +0097 gui.menu.file_import_ascii = uimenu(gui.menu.file_import,...
    +0098     'Label','Ascii');
    +0099 % 1.1.2.1 T1
    +0100 gui.menu.file_import_lab_ascii_T1 = uimenu(gui.menu.file_import_ascii,...
    +0101     'Label','T1','Tag','Ascii','Callback',@onMenuImport);
    +0102 % 1.1.2.2 T2
    +0103 gui.menu.file_import_lab_ascii_T2 = uimenu(gui.menu.file_import_ascii,...
    +0104     'Label','T2','Tag','Ascii','Callback',@onMenuImport);
    +0105 
    +0106 % 1.1.3 Excel
    +0107 gui.menu.file_import_excel = uimenu(gui.menu.file_import,...
    +0108     'Label','Excel');
    +0109 % 1.1.3.1 T1
    +0110 gui.menu.file_import_lab_excel_T1 = uimenu(gui.menu.file_import_excel,...
    +0111     'Label','T1','Tag','Excel','Callback',@onMenuImport);
    +0112 % 1.1.3.2 T2
    +0113 gui.menu.file_import_lab_excel_T2 = uimenu(gui.menu.file_import_excel,...
    +0114     'Label','T2','Tag','Excel','Callback',@onMenuImport);
    +0115 
    +0116 % 1.1.4 NUCLEUSinv
    +0117 gui.menu.file_import_nmrinv = uimenu(gui.menu.file_import,...
    +0118     'Label','NUCLEUSinv','Separator','on');
    +0119 % 1.1.4.1 NUCLEUSinv session file
    +0120 gui.menu.file_import_nmrinv_file = uimenu(gui.menu.file_import_nmrinv,...
    +0121     'Label','Session','Tag','NUCLEUSinv','Callback',@onMenuImport);
    +0122 
    +0123 % 1.1.5 NUCLEUSmod
    +0124 gui.menu.file_import_nmrmod = uimenu(gui.menu.file_import,...
    +0125     'Label','NUCLEUSmod');
    +0126 % 1.1.5.1 NUCLEUSmod from file
    +0127 gui.menu.file_import_nmrmod_file = uimenu(gui.menu.file_import_nmrmod,...
    +0128     'Label','File','Tag','NUCLEUSmod','Callback',@onMenuImport);
    +0129 % 1.1.5.2 NUCLEUSmod from GUI
    +0130 gui.menu.file_import_nmrmod_gui = uimenu(gui.menu.file_import_nmrmod,....
    +0131     'Label','GUI','Tag','NUCLEUSmod','Callback',@onMenuImport);
    +0132 
    +0133 % 1.2 Export
    +0134 gui.menu.file_export = uimenu(gui.menu.file,...
    +0135     'Label','Export');
    +0136 % 1.2.1 Data
    +0137 gui.menu.file_export_data = uimenu(gui.menu.file_export,...
    +0138     'Label','Data');
    +0139 % 1.2.1.1 GUI raw data mat-file
    +0140 gui.menu.file_export_data_GUImat = uimenu(gui.menu.file_export_data,...
    +0141     'Label','NUCLEUSinv (raw)','Callback',@onMenuExportData);
    +0142 % 1.2.1.2 GUI session mat-file
    +0143 gui.menu.file_export_data_GUImat = uimenu(gui.menu.file_export_data,...
    +0144     'Label','NUCLEUSinv (session)','Callback',@onMenuExportData);
    +0145 % 1.2.1.3 Inversion results single xls
    +0146 gui.menu.file_export_data_invstd_excel = uimenu(gui.menu.file_export_data,...
    +0147     'Label','EXCEL single (std)','Separator','on','Callback',@onMenuExportData);
    +0148 % 1.2.1.4 Inversion results single mat-file
    +0149 gui.menu.file_export_data_invstd_mat_single = uimenu(gui.menu.file_export_data,...
    +0150     'Label','MAT single (std)','Callback',@onMenuExportData);
    +0151 % 1.2.1.5 Inversion results all mat-file
    +0152 gui.menu.file_export_data_invstd_mat_all = uimenu(gui.menu.file_export_data,...
    +0153     'Label','MAT all (std)','Callback',@onMenuExportData);
    +0154 % 1.2.1.6 Joint Inversion results xls
    +0155 gui.menu.file_export_data_invjoint_excel = uimenu(gui.menu.file_export_data,...
    +0156     'Label','EXCEL all (joint)','Separator','on','Enable','off',...
    +0157     'Callback',@onMenuExportData);
    +0158 % 1.2.1.7 Joint Inversion results mat-file
    +0159 gui.menu.file_export_data_invjoint_mat = uimenu(gui.menu.file_export_data,...
    +0160     'Label','MAT all (joint)','Enable','off','Callback',@onMenuExportData);
    +0161 % 1.2.1.8 LIAG archive
    +0162 gui.menu.file_export_data_liag_archive = uimenu(gui.menu.file_export_data,...
    +0163     'Label','LIAG archive','Separator','on','Callback',@onMenuExportData);
    +0164 % 1.2.1.9 LIAG CSV T2
    +0165 gui.menu.file_export_data_liag_csvT2 = uimenu(gui.menu.file_export_data,...
    +0166     'Label','LIAG CSV T2','Callback',@onMenuExportData);
    +0167 
    +0168 % 1.2.2 Graphics
    +0169 gui.menu.file_export_graphics = uimenu(gui.menu.file_export,...
    +0170     'Label','Graphics');
    +0171 % 1.2.2.1 Layout
    +0172 gui.menu.file_export_graphics_layout = uimenu(gui.menu.file_export_graphics,...
    +0173     'Label','Layout');
    +0174 % 1.2.2.1.1 Layout vertical
    +0175 gui.menu.file_export_graphics_layout_vert = uimenu(gui.menu.file_export_graphics_layout,...
    +0176     'Label','vert','Checked','on','Callback',@onMenuExportGraphics);
    +0177 % 1.2.2.1.2 Layout horizontal
    +0178 gui.menu.file_export_graphics_layout_horz = uimenu(gui.menu.file_export_graphics_layout,...
    +0179     'Label','horz','Callback',@onMenuExportGraphics);
    +0180 % 1.2.2.2 fig
    +0181 gui.menu.file_export_graphics_fig = uimenu(gui.menu.file_export_graphics,...
    +0182     'Label','FIG','Callback',@onMenuExportGraphics);
    +0183 % 1.2.2.3 png
    +0184 gui.menu.file_export_graphicspng = uimenu(gui.menu.file_export_graphics,...
    +0185     'Label','PNG','Callback',@onMenuExportGraphics);
    +0186 % 1.2.2.4 tiff
    +0187 gui.menu.file_export_graphicstiff = uimenu(gui.menu.file_export_graphics,...
    +0188     'Label','TIFF','Callback',@onMenuExportGraphics);
    +0189 % 1.2.2.5 eps
    +0190 gui.menu.file_export_graphicseps = uimenu(gui.menu.file_export_graphics,...
    +0191     'Label','EPS','Callback',@onMenuExportGraphics);
    +0192 
    +0193 % 1.3 Restart
    +0194 gui.menu.file_restart = uimenu(gui.menu.file,...
    +0195     'Label','Restart','Separator','on','Callback',@onMenuRestartQuit);
    +0196 
    +0197 % 1.4 Quit
    +0198 gui.menu.file_quit = uimenu(gui.menu.file,...
    +0199     'Label','Quit','Separator','on','Callback',@onMenuRestartQuit);
    +0200 
    +0201 %% 2. Extras
    +0202 gui.menu.extra = uimenu(gui.figh,...
    +0203     'Label','Extra','Enable','off');
    +0204 
    +0205 % 2.1 expert mode (on/off)
    +0206 gui.menu.extra_expert = uimenu(gui.menu.extra,...
    +0207     'Label','Expert Mode');
    +0208 gui.menu.extra_expert_on = uimenu(gui.menu.extra_expert,...
    +0209     'Label','On','Callback',@onMenuExpert);
    +0210 gui.menu.extra_expert_off = uimenu(gui.menu.extra_expert,...
    +0211     'Label','Off','Callback',@onMenuExpert);
    +0212 switch gui.myui.inidata.expertmode
    +0213     case 'on'
    +0214         set(gui.menu.extra_expert_on,'Checked','on');
    +0215     case 'off'
    +0216         set(gui.menu.extra_expert_off,'Checked','on');
    +0217 end
    +0218 
    +0219 % 2.2 optimization toolbox (on/off)
    +0220 switch gui.myui.inidata.expertmode
    +0221     case 'on'
    +0222         switch data.info.has_optim
    +0223             case 'on'
    +0224                 gui.menu.extra_solver = uimenu(gui.menu.extra,...
    +0225                     'Label','LSQ Solver','Enable','on');
    +0226             case 'off'
    +0227                 gui.menu.extra_solver = uimenu(gui.menu.extra,...
    +0228                     'Label','LSQ Solver','Enable','off');
    +0229         end        
    +0230     case 'off'
    +0231         gui.menu.extra_solver = uimenu(gui.menu.extra,...
    +0232             'Label','LSQ Solver','Enable','off');
    +0233 end
    +0234 gui.menu.extra_solver_lsqlin = uimenu(gui.menu.extra_solver,...
    +0235     'Label','LSQLIN (Optim. TB)','Callback',@onMenuSolver);
    +0236 gui.menu.extra_solver_lsqnonneg = uimenu(gui.menu.extra_solver,...
    +0237     'Label','LSQNONNEG (default)','Checked','on','Callback',@onMenuSolver);
    +0238 
    +0239 % 2.3 joint inversion (on/off)
    +0240 switch gui.myui.inidata.expertmode
    +0241     case 'on'
    +0242         gui.menu.extra_joint = uimenu(gui.menu.extra,...
    +0243             'Label','Joint Inversion','Enable','on');
    +0244     case 'off'
    +0245         gui.menu.extra_joint = uimenu(gui.menu.extra,...
    +0246             'Label','Joint Inversion','Enable','off');
    +0247 end
    +0248 gui.menu.extra_joint_on = uimenu(gui.menu.extra_joint,...
    +0249     'Label','On','Callback',@onMenuJointInversion);
    +0250 gui.menu.extra_joint_off = uimenu(gui.menu.extra_joint,...
    +0251     'Label','Off','Checked','on','Callback',@onMenuJointInversion);
    +0252 
    +0253 
    +0254 % 2.4 settings
    +0255 gui.menu.extra_settings = uimenu(gui.menu.extra,...
    +0256     'Label','Settings');
    +0257 
    +0258 % 2.4.1 inversion info (on/off)
    +0259 gui.menu.extra_settings_invinfo = uimenu(gui.menu.extra_settings,...
    +0260     'Label','Inversion Display');
    +0261 gui.menu.extra_settings_invinfo_on = uimenu(gui.menu.extra_settings_invinfo,...
    +0262     'Label','On','Callback',@onMenuExtraShow);
    +0263 gui.menu.extra_settings_invinfo_off = uimenu(gui.menu.extra_settings_invinfo,...
    +0264     'Label','Off','Callback',@onMenuExtraShow);
    +0265 switch gui.myui.inidata.invinfo
    +0266     case 'on'
    +0267         set(gui.menu.extra_settings_invinfo_on,'Checked','on');
    +0268     case 'off'
    +0269         set(gui.menu.extra_settings_invinfo_off,'Checked','on');
    +0270 end
    +0271 
    +0272 % 2.4.2 tooltips (on/off)
    +0273 gui.menu.extra_settings_tooltips = uimenu(gui.menu.extra_settings,...
    +0274     'Label','Tooltips');
    +0275 gui.menu.extra_settings_tooltips_on = uimenu(gui.menu.extra_settings_tooltips,...
    +0276     'Label','On','Callback',@onMenuExtraShow);
    +0277 gui.menu.extra_settings_tooltips_off = uimenu(gui.menu.extra_settings_tooltips,...
    +0278     'Label','Off','Callback',@onMenuExtraShow);
    +0279 switch gui.myui.inidata.tooltips
    +0280     case 'on'
    +0281         set(gui.menu.extra_settings_tooltips_on,'Checked','on');
    +0282     case 'off'
    +0283         set(gui.menu.extra_settings_tooltips_off,'Checked','on');
    +0284 end
    +0285 
    +0286 % 2.4.3 INFO fields in plot panels (on/off)
    +0287 gui.menu.extra_settings_infofields = uimenu(gui.menu.extra_settings,...
    +0288     'Label','INFO fields');
    +0289 gui.menu.extra_settings_infofields_on = uimenu(gui.menu.extra_settings_infofields ,...
    +0290     'Label','On','Callback',@onMenuExtraShow);
    +0291 gui.menu.extra_settings_infofields_off = uimenu(gui.menu.extra_settings_infofields,...
    +0292     'Label','Off','Checked','on','Callback',@onMenuExtraShow);
     0293 
    -0294 % 2.3.5 joint inversion settings
    -0295 gui.menu.extra_settings_joint = uimenu(gui.menu.extra_settings,...
    -0296     'Label','Joint Inversion','Enable','off','Separator','on');
    -0297 % 2.3.5.1 joint inversion settings
    -0298 gui.menu.extra_settings_joint_rhobounds = uimenu(gui.menu.extra_settings_joint,...
    -0299     'Label','Surface relaxivity bounds','Callback',@onMenuExtraRhoBounds);
    -0300 
    -0301 % 2.4 figures
    -0302 gui.menu.extra_graphics = uimenu(gui.menu.extra,...
    -0303     'Label','Figures');
    -0304 % 2.4.1 parameter file info
    -0305 gui.menu.extra_graphics_parinfo = uimenu(gui.menu.extra_graphics,...
    -0306     'Label','Parameter Info','Callback',@onMenuExtraShow);
    -0307 % 2.4.2 fit statistics
    -0308 gui.menu.extra_graphics_stats = uimenu(gui.menu.extra_graphics,...
    -0309     'Label','Fit statistics','Callback',@onMenuExtraGraphics);
    -0310 switch gui.myui.inidata.expertmode
    -0311     case 'on'
    -0312         % 2.4.3 amplitude over time
    -0313         gui.menu.extra_graphics_amp = uimenu(gui.menu.extra_graphics,...
    -0314             'Label','AMP-TLGM-SNR','Callback',@onMenuExtraGraphics);
    -0315         % 2.4.4 amplitude vs tlgm
    -0316         gui.menu.extra_graphics_amp2 = uimenu(gui.menu.extra_graphics,...
    -0317             'Label','AMP vs TLGM','Callback',@onMenuExtraGraphics);
    -0318         % 2.4.5 relaxation time distribution over time
    -0319         gui.menu.extra_graphics_rtd = uimenu(gui.menu.extra_graphics,...
    -0320             'Label','RTD','Callback',@onMenuExtraGraphics);
    -0321     case 'off'
    -0322         % 2.4.3 amplitude over time
    -0323         gui.menu.extra_graphics_amp = uimenu(gui.menu.extra_graphics,...
    -0324             'Label','AMP-TLGM-SNR','Enable','off','Callback',@onMenuExtraGraphics);
    -0325         % 2.4.4 amplitude vs tlgm
    -0326         gui.menu.extra_graphics_amp2 = uimenu(gui.menu.extra_graphics,...
    -0327             'Label','AMP vs TLGM','Enable','off','Callback',@onMenuExtraGraphics);
    -0328         % 2.4.5 relaxation time distribution over time
    -0329         gui.menu.extra_graphics_rtd = uimenu(gui.menu.extra_graphics,...
    -0330             'Label','RTD','Enable','off','Callback',@onMenuExtraGraphics);
    -0331 end
    -0332 
    -0333 % 2.5 PhaseView
    -0334 gui.menu.extra_phaseview = uimenu(gui.menu.extra,...
    -0335     'Label','PhaseView','Callback',@PhaseView);
    -0336 
    -0337 %% 3. Help
    -0338 gui.menu.help = uimenu(gui.figh,...
    -0339     'Label','Help','Enable','off');
    -0340 
    -0341 % 3.1 About
    -0342 gui.menu.help_about = uimenu(gui.menu.help,...
    -0343     'Label','About','Callback',@onMenuHelp);
    -0344 
    -0345 return
    -0346 
    -0347 %------------- END OF CODE --------------
    -0348 
    -0349 %% License:
    -0350 % MIT License
    -0351 %
    -0352 % Copyright (c) 2018 Thomas Hiller
    -0353 %
    -0354 % Permission is hereby granted, free of charge, to any person obtaining a copy
    -0355 % of this software and associated documentation files (the "Software"), to deal
    -0356 % in the Software without restriction, including without limitation the rights
    -0357 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    -0358 % copies of the Software, and to permit persons to whom the Software is
    -0359 % furnished to do so, subject to the following conditions:
    -0360 %
    -0361 % The above copyright notice and this permission notice shall be included in all
    -0362 % copies or substantial portions of the Software.
    -0363 %
    -0364 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    -0365 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    -0366 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    -0367 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    -0368 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    -0369 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    -0370 % SOFTWARE.
    +0294 % 2.4.4 color theme +0295 gui.menu.extra_settings_theme = uimenu(gui.menu.extra_settings,... +0296 'Label','Color Theme'); +0297 % 2.4.4.1 default color theme +0298 gui.menu.extra_settings_theme_standard = uimenu(gui.menu.extra_settings_theme,... +0299 'Label','standard','Callback',@onMenuExtraColor); +0300 % 2.4.4.2 basic color theme +0301 gui.menu.extra_settings_theme_basic = uimenu(gui.menu.extra_settings_theme,... +0302 'Label','basic','Callback',@onMenuExtraColor); +0303 % 2.4.4.3 dark color theme +0304 gui.menu.extra_settings_theme_dark = uimenu(gui.menu.extra_settings_theme,... +0305 'Label','dark','Callback',@onMenuExtraColor); +0306 % 2.4.4.4 black color theme +0307 gui.menu.extra_settings_theme_black = uimenu(gui.menu.extra_settings_theme,... +0308 'Label','black','Callback',@onMenuExtraColor); +0309 switch gui.myui.inidata.colortheme +0310 case 'standard' +0311 set(gui.menu.extra_settings_theme_standard,'Checked','on'); +0312 case 'basic' +0313 set(gui.menu.extra_settings_theme_basic,'Checked','on'); +0314 case 'dark' +0315 set(gui.menu.extra_settings_theme_dark,'Checked','on'); +0316 case 'black' +0317 set(gui.menu.extra_settings_theme_black,'Checked','on'); +0318 end +0319 +0320 % 2.4.5 joint inversion settings +0321 gui.menu.extra_settings_joint = uimenu(gui.menu.extra_settings,... +0322 'Label','Joint Inversion','Enable','off','Separator','on'); +0323 % 2.4.5.1 joint inversion settings +0324 gui.menu.extra_settings_joint_rhobounds = uimenu(gui.menu.extra_settings_joint,... +0325 'Label','Surface relaxivity bounds','Callback',@onMenuExtraRhoBounds); +0326 +0327 % 2.5 figures +0328 gui.menu.extra_graphics = uimenu(gui.menu.extra,... +0329 'Label','Figures'); +0330 % 2.5.1 parameter file info +0331 gui.menu.extra_graphics_parinfo = uimenu(gui.menu.extra_graphics,... +0332 'Label','Parameter Info','Callback',@onMenuExtraShow); +0333 % 2.5.2 fit statistics +0334 gui.menu.extra_graphics_stats = uimenu(gui.menu.extra_graphics,... +0335 'Label','Fit statistics','Callback',@onMenuExtraGraphics); +0336 switch gui.myui.inidata.expertmode +0337 case 'on' +0338 % 2.5.3 amplitude over time +0339 gui.menu.extra_graphics_amp = uimenu(gui.menu.extra_graphics,... +0340 'Label','AMP-TLGM-SNR','Callback',@onMenuExtraGraphics); +0341 % 2.5.4 amplitude vs tlgm +0342 gui.menu.extra_graphics_amp2 = uimenu(gui.menu.extra_graphics,... +0343 'Label','AMP vs TLGM','Callback',@onMenuExtraGraphics); +0344 % 2.5.5 relaxation time distribution over time +0345 gui.menu.extra_graphics_rtd = uimenu(gui.menu.extra_graphics,... +0346 'Label','RTD','Callback',@onMenuExtraGraphics); +0347 case 'off' +0348 % 2.5.3 amplitude over time +0349 gui.menu.extra_graphics_amp = uimenu(gui.menu.extra_graphics,... +0350 'Label','AMP-TLGM-SNR','Enable','off','Callback',@onMenuExtraGraphics); +0351 % 2.5.4 amplitude vs tlgm +0352 gui.menu.extra_graphics_amp2 = uimenu(gui.menu.extra_graphics,... +0353 'Label','AMP vs TLGM','Enable','off','Callback',@onMenuExtraGraphics); +0354 % 2.5.5 relaxation time distribution over time +0355 gui.menu.extra_graphics_rtd = uimenu(gui.menu.extra_graphics,... +0356 'Label','RTD','Enable','off','Callback',@onMenuExtraGraphics); +0357 end +0358 +0359 % 2.6 PhaseView +0360 gui.menu.extra_phaseview = uimenu(gui.menu.extra,... +0361 'Label','PhaseView','Callback',@PhaseView); +0362 +0363 %% 3. Help +0364 gui.menu.help = uimenu(gui.figh,... +0365 'Label','Help','Enable','off'); +0366 +0367 % 3.1 About +0368 gui.menu.help_about = uimenu(gui.menu.help,... +0369 'Label','About','Callback',@onMenuHelp); +0370 +0371 return +0372 +0373 %------------- END OF CODE -------------- +0374 +0375 %% License: +0376 % MIT License +0377 % +0378 % Copyright (c) 2018 Thomas Hiller +0379 % +0380 % Permission is hereby granted, free of charge, to any person obtaining a copy +0381 % of this software and associated documentation files (the "Software"), to deal +0382 % in the Software without restriction, including without limitation the rights +0383 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0384 % copies of the Software, and to permit persons to whom the Software is +0385 % furnished to do so, subject to the following conditions: +0386 % +0387 % The above copyright notice and this permission notice shall be included in all +0388 % copies or substantial portions of the Software. +0389 % +0390 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0391 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0392 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0393 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0394 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0395 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0396 % SOFTWARE.

    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/NUCLEUSinv/NUCLEUSinv_createPanelInversionJoint.html b/doc/nucleus/NUCLEUSinv/NUCLEUSinv_createPanelInversionJoint.html index 75ba9f3..4209fc2 100644 --- a/doc/nucleus/NUCLEUSinv/NUCLEUSinv_createPanelInversionJoint.html +++ b/doc/nucleus/NUCLEUSinv/NUCLEUSinv_createPanelInversionJoint.html @@ -170,7 +170,7 @@

    SOURCE CODE ^'String','inversion method'); 0099 tstr = 'tba'; 0100 -0101 switch data.info.optim +0101 switch data.info.has_optim 0102 case 'on' 0103 gui.popup_handles.invjoint_InvType = uicontrol('Parent',gui.panels.invjoint.HBox1,... 0104 'Style','popup','FontSize',myui.fontsize,... diff --git a/doc/nucleus/NUCLEUSinv/NUCLEUSinv_createPanelInversionStd.html b/doc/nucleus/NUCLEUSinv/NUCLEUSinv_createPanelInversionStd.html index 2230d03..de5b383 100644 --- a/doc/nucleus/NUCLEUSinv/NUCLEUSinv_createPanelInversionStd.html +++ b/doc/nucleus/NUCLEUSinv/NUCLEUSinv_createPanelInversionStd.html @@ -131,226 +131,155 @@

    SOURCE CODE ^'Parent',gui.panels.invstd.HBox1,... 0060 'Style','text','FontSize',myui.fontsize,'HorizontalAlignment','center',... 0061 'String','inversion method'); -0062 switch data.info.optim -0063 case 'on' -0064 switch data.info.ExpertMode -0065 case 'on' -0066 tstr = ['<HTML>Choose between different inversion (fitting) methods.<br><br>',... -0067 '<u>Available options:</u><br>',... -0068 '<b>Mono exp.</b> Mono-exponential fitting.<br>',... -0069 '<b>X free exp.</b> Multi-exponential fitting with up to 5 free relaxation times.<br>',... -0070 '<b>Multi exp. (LSQLIN)</b> Multi-exponential fitting with Optimization Toolbox.<br>',... -0071 '<b>Multi exp. (ILA)</b> Multi-exponential fitting using an Inverse Laplace transform.<br><br>',... -0072 'Depending on the chosen method there are additional options available.<br><br>',... -0073 '<u>Default value:</u><br>',... -0074 '<b>Multi exp. (LSQLIN)</b><br>']; -0075 istring = {'Mono exp.','Several free exp. (2-5)','Multi exp. (LSQLIN)','Multi exp. (InvLaplace)'}; -0076 case 'off' -0077 tstr = ['<HTML>Choose between different inversion (fitting) methods.<br><br>',... -0078 '<u>Available options:</u><br>',... -0079 '<b>Mono exp.</b> Mono-exponential fitting.<br>',... -0080 '<b>X free exp.</b> Multi-exponential fitting with up to 5 free relaxation times.<br>',... -0081 '<b>Multi exp. (LSQLIN)</b> Multi-exponential fitting with Optimization Toolbox.<br>',... -0082 'Depending on the chosen method there are additional options available.<br><br>',... -0083 '<u>Default value:</u><br>',... -0084 '<b>Multi exp. (LSQLIN)</b><br>']; -0085 istring = {'Mono exp.','Several free exp. (2-5)','Multi exp. (LSQLIN)'}; -0086 end -0087 case 'off' -0088 switch data.info.ExpertMode -0089 case 'on' -0090 tstr = ['<HTML>Choose between different inversion (fitting) methods.<br><br>',... -0091 '<u>Available options:</u><br>',... -0092 '<b>Mono exp.</b> Mono-exponential fitting.<br>',... -0093 '<b>Several free exp.</b> Multi-exponential fitting with up to 5 free relaxation times.<br>',... -0094 '<b>Multi exp. (NNLS)</b> Multi-exponential fitting with Non Negative Least Squares (NNLS).<br>',... -0095 '<b>Multi exp. (ILA)</b> Multi-exponential fitting using an Inverse Laplace transform.<br><br>',... -0096 'Depending on the chosen method there are additional options available.<br><br>',... -0097 '<u>Default value:</u><br>',... -0098 '<b>Multi exp. (NNLS)</b><br>']; -0099 istring = {'Mono exp.','Several free exp. (2-5)','Multi exp. (NNLS)','Multi exp. (InvLaplace)'}; -0100 case 'off' -0101 tstr = ['<HTML>Choose between different inversion (fitting) methods.<br><br>',... -0102 '<u>Available options:</u><br>',... -0103 '<b>Mono exp.</b> Mono-exponential fitting.<br>',... -0104 '<b>Several free exp.</b> Multi-exponential fitting with up to 5 free relaxation times.<br>',... -0105 '<b>Multi exp. (NNLS)</b> Multi-exponential fitting with Non Negative Least Squares (NNLS).<br>',... -0106 'Depending on the chosen method there are additional options available.<br><br>',... -0107 '<u>Default value:</u><br>',... -0108 '<b>Multi exp. (NNLS)</b><br>']; -0109 istring = {'Mono exp.','Several free exp. (2-5)','Multi exp. (NNLS)'}; -0110 end -0111 end -0112 gui.popup_handles.invstd_InvType = uicontrol('Parent',gui.panels.invstd.HBox1,... -0113 'Style','popup','String',istring,'FontSize',myui.fontsize,'Enable','off','Value',3,... -0114 'UserData',struct('Tooltipstr',tstr),'Callback',@onPopupInvstdType); -0115 set(gui.panels.invstd.HBox1,'Widths',[200 -1]); -0116 -0117 %% min and max values of relaxation time distribution -0118 gui.text_handles.invstd_RTDtimes = uicontrol('Parent',gui.panels.invstd.HBox2,... -0119 'Style','text','FontSize',myui.fontsize,'String','RTD - min [s] | max [s] | # / dec'); -0120 tstr = 'Lower bound of relaxation time spectra.'; -0121 gui.edit_handles.invstd_time_min = uicontrol('Parent',gui.panels.invstd.HBox2,... -0122 'Style','edit','String',num2str(data.invstd.time(1,1)),'FontSize',myui.fontsize,... -0123 'UserData',struct('Tooltipstr',tstr,'defaults',[data.invstd.time(1,1) 1 1]),... -0124 'Tag','invstd_time','Enable','off','Callback',@onEditValue); -0125 tstr = 'Upper bound of relaxation time spectra.'; -0126 gui.edit_handles.invstd_time_max = uicontrol('Parent',gui.panels.invstd.HBox2,... -0127 'Style','edit','String',num2str(data.invstd.time(1,2)),'FontSize',myui.fontsize,... -0128 'UserData',struct('Tooltipstr',tstr,'defaults',[data.invstd.time(1,2) 1 2]),... -0129 'Tag','invstd_time','Enable','off','Callback',@onEditValue); -0130 tstr = 'Number of steps per decade.'; -0131 gui.edit_handles.invstd_Ntime = uicontrol('Parent',gui.panels.invstd.HBox2,... -0132 'Style','edit','String',num2str(data.invstd.Ntime),'FontSize',myui.fontsize,... -0133 'UserData',struct('Tooltipstr',tstr,'defaults',[data.invstd.Ntime 1 1]),... -0134 'Tag','invstd_Ntime','Enable','off','Callback',@onEditValue); -0135 set(gui.panels.invstd.HBox2,'Widths',[200 -1 -1 -1]); -0136 -0137 %% optional inversion settings depending on inversion type -0138 gui.text_handles.invstd_InvTypeOpt = uicontrol('Parent',gui.panels.invstd.HBox3,... -0139 'Style','text','FontSize',myui.fontsize,'HorizontalAlignment','center',... -0140 'String','regularization options'); -0141 switch data.info.ExpertMode -0142 case 'on' -0143 tstr = ['<HTML>Choose additional options depending on the chosen inversion (fitting) method.<br><br>',... -0144 '<u>Available options:</u><br>',... -0145 '<font color="red">Mono exp.:<br>',... -0146 '<font color="black"><b>none</b><br>',... -0147 '<font color="red">X free exp.:<br>',... -0148 '<font color="black"><b>1-5</b> choose how many free relaxation times to use.<br>',... -0149 '<font color="red">Multi exp.:<br>',... -0150 '<font color="black"><b>Manual</b> Manual regularization.<br>',... -0151 '<font color="black"><b>IterChi2</b> Find Chi2=1 iteratively.<br>',... -0152 '<font color="black"><b>Tikhonov (GCV)</b> Tikhonov regularization (SVD-Toolbox).<br>',... -0153 '<font color="black"><b>TSVD (GCV)</b> Regularization via Truncated SVD (SVD-Toolbox).<br>',... -0154 '<font color="black"><b>DSVD (GCV)</b> Regularization via Damped SVD (SVD-Toolbox).<br>',... -0155 '<font color="black"><b>Discrep.</b> Regularization according to discrepancy principle (SVD-Toolbox).<br>',... -0156 '<font color="black"><b>L-curve</b> Perform the L-curve test to find optimal regularization parameter lambda.<br>',... -0157 '<font color="red">Multi exp. (ILA):<br>',... -0158 '<font color="black"><b>Manual</b> Manual regularization.<br>',... -0159 '<font color="black"><b>Automatic</b> Automatic regularization.<br><br>',... -0160 '<u>Default value:</u><br>',... -0161 '<b>Manual</b><br>']; -0162 rstring = {'Manual','Iterative Chi2','Tikhonov (SVD)','TSVD (SVD)',... -0163 'DSVD (SVD)','Discrep. (SVD)','L-curve'}; -0164 case 'off' -0165 tstr = ['<HTML>Choose additional options depending on the chosen inversion (fitting) method.<br><br>',... -0166 '<u>Available options:</u><br>',... -0167 '<font color="red">Mono exp.:<br>',... -0168 '<font color="black"><b>none</b><br>',... -0169 '<font color="red">X free exp.:<br>',... -0170 '<font color="black"><b>1-5</b> choose how many free relaxation times to use.<br>',... -0171 '<font color="red">Multi exp.:<br>',... -0172 '<font color="black"><b>Manual</b> Manual regularization.<br>',... -0173 '<font color="black"><b>IterChi2</b> Find Chi2=1 iteratively.<br>',... -0174 '<font color="black"><b>L-curve</b> Perform the L-curve test to find optimal regularization parameter lambda.<br><br>',... -0175 '<u>Default value:</u><br>',... -0176 '<b>Manual</b><br>']; -0177 rstring = {'Manual','Iterative Chi2','L-curve'}; -0178 end -0179 gui.popup_handles.invstd_InvTypeOpt = uicontrol('Parent',gui.panels.invstd.HBox3,... -0180 'Style','popup','String',rstring,'FontSize',myui.fontsize,'Enable','off','Value',1,... -0181 'UserData',struct('Tooltipstr',tstr),'Callback',@onPopupInvstdTypeOptional); -0182 set(gui.panels.invstd.HBox3,'Widths',[200 -1]); -0183 -0184 %% smoothness constraint / order of regularized solution -0185 gui.text_handles.invstd_Lorder = uicontrol('Parent',gui.panels.invstd.HBox4,... -0186 'Style','text','FontSize',myui.fontsize,... -0187 'HorizontalAlignment','center','String','smoothness constraint (L-order)'); -0188 tstr = ['<HTML>Choose the smoothness constraint for the multi-exponential fitting routines.<br><br>',... -0189 '<u>Available options:</u><br>',... -0190 '<font color="red">Mono exp. | X free exp.:<br>',... -0191 '<font color="black"><b>none</b><br>',... -0192 '<font color="red">Multi exp. (NNLS/LSQLIN) | Multi exp. (ILA):<br>',... -0193 '<font color="black">',... -0194 '<b>0</b> Zeroth-order smoothness constraint.<br>',... -0195 '<b>1</b> First-order smoothness constraint.<br>',... -0196 '<b>2</b> Second-order smoothness constraint.<br><br>',... -0197 '<u>Default value:</u><br>',... -0198 '<b>1</b><br>']; -0199 gui.radio_handles.invstd_Lorder0 = uicontrol('Parent',gui.panels.invstd.HBox4,... -0200 'Style','radiobutton','String','0','Tag','invstd','FontSize',myui.fontsize,... -0201 'UserData',struct('Tooltipstr',tstr),'Enable','off','Callback',@onRadioLorder); -0202 gui.radio_handles.invstd_Lorder1 = uicontrol('Parent',gui.panels.invstd.HBox4,... -0203 'Style','radiobutton','String','1','Tag','invstd','FontSize',myui.fontsize,... -0204 'UserData',struct('Tooltipstr',tstr),'Enable','off','Callback',@onRadioLorder); -0205 gui.radio_handles.invstd_Lorder2 = uicontrol('Parent',gui.panels.invstd.HBox4,... -0206 'Style','radiobutton','String','2','Tag','invstd','FontSize',myui.fontsize,... -0207 'UserData',struct('Tooltipstr',tstr),'Enable','off','Callback',@onRadioLorder); -0208 set(gui.panels.invstd.HBox4,'Widths',[200 -1 -1 -1]); -0209 -0210 %% min and max values of the L-curve -0211 gui.text_handles.invstd_lambda = uicontrol('Parent',gui.panels.invstd.HBox5,... -0212 'Style','text','FontSize',myui.fontsize,... -0213 'String','lambda - min | max | #'); -0214 tstr = 'Lambda value / Smallest Lambda in range.'; -0215 gui.edit_handles.invstd_lambda_min = uicontrol('Parent',gui.panels.invstd.HBox5,... -0216 'Style','edit','String',num2str(data.invstd.lambda),'FontSize',myui.fontsize,... -0217 'UserData',struct('Tooltipstr',tstr,'defaults',[data.invstd.lambdaR(1,1) 1 1]),... -0218 'Tag','invstd_lambdaR','Enable','off','Callback',@onEditValue); -0219 tstr = 'Largest Lambda in range.'; -0220 gui.edit_handles.invstd_lambda_max = uicontrol('Parent',gui.panels.invstd.HBox5,... -0221 'Style','edit','String',num2str(data.invstd.lambdaR(1,2)),... -0222 'UserData',struct('Tooltipstr',tstr,'defaults',[data.invstd.lambdaR(1,2) 1 2]),... -0223 'Tag','invstd_lambdaR','FontSize',myui.fontsize,... -0224 'Enable','off','Callback',@onEditValue); -0225 tstr = 'Number of Lambdas in L-curve.'; -0226 gui.edit_handles.invstd_NlambdaR = uicontrol('Parent',gui.panels.invstd.HBox5,... -0227 'Style','edit','String',num2str(data.invstd.NlambdaR),... -0228 'UserData',struct('Tooltipstr',tstr,'defaults',[data.invstd.NlambdaR 1 1]),... -0229 'Tag','invstd_NlambdaR','FontSize',myui.fontsize,... -0230 'Enable','off','Callback',@onEditValue); -0231 set(gui.panels.invstd.HBox5,'Widths',[200 -1 -1 -1]); -0232 -0233 %% RUN button -0234 gui.text_handles.invstd_run = uicontrol('Parent',gui.panels.invstd.HBox6,... -0235 'Style','text','FontSize',myui.fontsize,'HorizontalAlignment','center',... -0236 'String','run Inversion'); -0237 gui.push_handles.invstd_run = uicontrol('Parent',gui.panels.invstd.HBox6,'Enable','off',... -0238 'String','<HTML><u>R</u>UN','FontSize',myui.fontsize,'BackGroundColor','g',... -0239 'Tag','std','UserData',1,'Callback',@onPushRun); -0240 set(gui.panels.invstd.HBox6,'Widths',[200 -1]); -0241 -0242 %% Java Hack to adjust vertical alignment of text fields -0243 jh = findjobj(gui.text_handles.invstd_InvType); -0244 jh.setVerticalAlignment(javax.swing.JLabel.CENTER); -0245 jh = findjobj(gui.text_handles.invstd_RTDtimes); -0246 jh.setVerticalAlignment(javax.swing.JLabel.CENTER); -0247 jh = findjobj(gui.text_handles.invstd_InvTypeOpt); -0248 jh.setVerticalAlignment(javax.swing.JLabel.CENTER); -0249 jh = findjobj(gui.text_handles.invstd_Lorder); -0250 jh.setVerticalAlignment(javax.swing.JLabel.CENTER); -0251 jh = findjobj(gui.text_handles.invstd_lambda); -0252 jh.setVerticalAlignment(javax.swing.JLabel.CENTER); -0253 jh = findjobj(gui.text_handles.invstd_run); -0254 jh.setVerticalAlignment(javax.swing.JLabel.CENTER); -0255 -0256 return -0257 -0258 %------------- END OF CODE -------------- -0259 -0260 %% License: -0261 % MIT License -0262 % -0263 % Copyright (c) 2018 Thomas Hiller -0264 % -0265 % Permission is hereby granted, free of charge, to any person obtaining a copy -0266 % of this software and associated documentation files (the "Software"), to deal -0267 % in the Software without restriction, including without limitation the rights -0268 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -0269 % copies of the Software, and to permit persons to whom the Software is -0270 % furnished to do so, subject to the following conditions: -0271 % -0272 % The above copyright notice and this permission notice shall be included in all -0273 % copies or substantial portions of the Software. -0274 % -0275 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -0276 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -0277 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -0278 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -0279 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -0280 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -0281 % SOFTWARE.

    +0062 switch data.info.ExpertMode +0063 case 'on' +0064 tstr = ' '; +0065 istring = {'Mono exp.','Several free exp. (2-5)','Multi exp. (LSQ)','Multi exp. (InvLaplace)'}; +0066 case 'off' +0067 tstr = ' '; +0068 istring = {'Mono exp.','Several free exp. (2-5)','Multi exp. (LSQ)'}; +0069 end +0070 gui.popup_handles.invstd_InvType = uicontrol('Parent',gui.panels.invstd.HBox1,... +0071 'Style','popup','String',istring,'FontSize',myui.fontsize,'Enable','off','Value',3,... +0072 'UserData',struct('Tooltipstr',tstr),'Callback',@onPopupInvstdType); +0073 set(gui.panels.invstd.HBox1,'Widths',[200 -1]); +0074 +0075 %% min and max values of relaxation time distribution +0076 gui.text_handles.invstd_RTDtimes = uicontrol('Parent',gui.panels.invstd.HBox2,... +0077 'Style','text','FontSize',myui.fontsize,'String','RTD - min [s] | max [s] | # / dec'); +0078 tstr = 'Lower bound of relaxation time spectra.'; +0079 gui.edit_handles.invstd_time_min = uicontrol('Parent',gui.panels.invstd.HBox2,... +0080 'Style','edit','String',num2str(data.invstd.time(1,1)),'FontSize',myui.fontsize,... +0081 'UserData',struct('Tooltipstr',tstr,'defaults',[data.invstd.time(1,1) 1 1]),... +0082 'Tag','invstd_time','Enable','off','Callback',@onEditValue); +0083 tstr = 'Upper bound of relaxation time spectra.'; +0084 gui.edit_handles.invstd_time_max = uicontrol('Parent',gui.panels.invstd.HBox2,... +0085 'Style','edit','String',num2str(data.invstd.time(1,2)),'FontSize',myui.fontsize,... +0086 'UserData',struct('Tooltipstr',tstr,'defaults',[data.invstd.time(1,2) 1 2]),... +0087 'Tag','invstd_time','Enable','off','Callback',@onEditValue); +0088 tstr = 'Number of steps per decade.'; +0089 gui.edit_handles.invstd_Ntime = uicontrol('Parent',gui.panels.invstd.HBox2,... +0090 'Style','edit','String',num2str(data.invstd.Ntime),'FontSize',myui.fontsize,... +0091 'UserData',struct('Tooltipstr',tstr,'defaults',[data.invstd.Ntime 1 1]),... +0092 'Tag','invstd_Ntime','Enable','off','Callback',@onEditValue); +0093 set(gui.panels.invstd.HBox2,'Widths',[200 -1 -1 -1]); +0094 +0095 %% optional inversion settings depending on inversion type +0096 gui.text_handles.invstd_InvTypeOpt = uicontrol('Parent',gui.panels.invstd.HBox3,... +0097 'Style','text','FontSize',myui.fontsize,'HorizontalAlignment','center',... +0098 'String','regularization options'); +0099 switch data.info.ExpertMode +0100 case 'on' +0101 tstr = ' '; +0102 rstring = {'Manual','Iterative Chi2','Tikhonov (SVD)','TSVD (SVD)',... +0103 'DSVD (SVD)','Discrep. (SVD)','L-curve'}; +0104 case 'off' +0105 tstr = ' '; +0106 rstring = {'Manual','Iterative Chi2','L-curve'}; +0107 end +0108 gui.popup_handles.invstd_InvTypeOpt = uicontrol('Parent',gui.panels.invstd.HBox3,... +0109 'Style','popup','String',rstring,'FontSize',myui.fontsize,'Enable','off','Value',1,... +0110 'UserData',struct('Tooltipstr',tstr),'Callback',@onPopupInvstdTypeOptional); +0111 set(gui.panels.invstd.HBox3,'Widths',[200 -1]); +0112 +0113 %% smoothness constraint / order of regularized solution +0114 gui.text_handles.invstd_Lorder = uicontrol('Parent',gui.panels.invstd.HBox4,... +0115 'Style','text','FontSize',myui.fontsize,... +0116 'HorizontalAlignment','center','String','smoothness constraint (L-order)'); +0117 tstr = ['<HTML>Choose the smoothness constraint for the multi-exponential fitting routines.<br><br>',... +0118 '<u>Available options:</u><br>',... +0119 '<font color="red">Mono exp. | Several free exp. (2-5):<br>',... +0120 '<font color="black"><b>none</b><br>',... +0121 '<font color="red">Multi exp. (LSQ) | Multi exp. (ILA):<br>',... +0122 '<font color="black">',... +0123 '<b>0</b> Zeroth-order smoothness constraint.<br>',... +0124 '<b>1</b> First-order smoothness constraint.<br>',... +0125 '<b>2</b> Second-order smoothness constraint.<br><br>',... +0126 '<u>Default value:</u><br>',... +0127 '<b>1</b><br>']; +0128 gui.radio_handles.invstd_Lorder0 = uicontrol('Parent',gui.panels.invstd.HBox4,... +0129 'Style','radiobutton','String','0','Tag','invstd','FontSize',myui.fontsize,... +0130 'UserData',struct('Tooltipstr',tstr),'Enable','off','Callback',@onRadioLorder); +0131 gui.radio_handles.invstd_Lorder1 = uicontrol('Parent',gui.panels.invstd.HBox4,... +0132 'Style','radiobutton','String','1','Tag','invstd','FontSize',myui.fontsize,... +0133 'UserData',struct('Tooltipstr',tstr),'Enable','off','Callback',@onRadioLorder); +0134 gui.radio_handles.invstd_Lorder2 = uicontrol('Parent',gui.panels.invstd.HBox4,... +0135 'Style','radiobutton','String','2','Tag','invstd','FontSize',myui.fontsize,... +0136 'UserData',struct('Tooltipstr',tstr),'Enable','off','Callback',@onRadioLorder); +0137 set(gui.panels.invstd.HBox4,'Widths',[200 -1 -1 -1]); +0138 +0139 %% min and max values of the L-curve +0140 gui.text_handles.invstd_lambda = uicontrol('Parent',gui.panels.invstd.HBox5,... +0141 'Style','text','FontSize',myui.fontsize,... +0142 'String','lambda - min | max | #'); +0143 tstr = 'Lambda value / Smallest Lambda in range.'; +0144 gui.edit_handles.invstd_lambda_min = uicontrol('Parent',gui.panels.invstd.HBox5,... +0145 'Style','edit','String',num2str(data.invstd.lambda),'FontSize',myui.fontsize,... +0146 'UserData',struct('Tooltipstr',tstr,'defaults',[data.invstd.lambdaR(1,1) 1 1]),... +0147 'Tag','invstd_lambdaR','Enable','off','Callback',@onEditValue); +0148 tstr = 'Largest Lambda in range.'; +0149 gui.edit_handles.invstd_lambda_max = uicontrol('Parent',gui.panels.invstd.HBox5,... +0150 'Style','edit','String',num2str(data.invstd.lambdaR(1,2)),... +0151 'UserData',struct('Tooltipstr',tstr,'defaults',[data.invstd.lambdaR(1,2) 1 2]),... +0152 'Tag','invstd_lambdaR','FontSize',myui.fontsize,... +0153 'Enable','off','Callback',@onEditValue); +0154 tstr = 'Number of Lambdas in L-curve.'; +0155 gui.edit_handles.invstd_NlambdaR = uicontrol('Parent',gui.panels.invstd.HBox5,... +0156 'Style','edit','String',num2str(data.invstd.NlambdaR),... +0157 'UserData',struct('Tooltipstr',tstr,'defaults',[data.invstd.NlambdaR 1 1]),... +0158 'Tag','invstd_NlambdaR','FontSize',myui.fontsize,... +0159 'Enable','off','Callback',@onEditValue); +0160 set(gui.panels.invstd.HBox5,'Widths',[200 -1 -1 -1]); +0161 +0162 %% RUN button +0163 gui.text_handles.invstd_run = uicontrol('Parent',gui.panels.invstd.HBox6,... +0164 'Style','text','FontSize',myui.fontsize,'HorizontalAlignment','center',... +0165 'String','run Inversion'); +0166 gui.push_handles.invstd_run = uicontrol('Parent',gui.panels.invstd.HBox6,'Enable','off',... +0167 'String','<HTML><u>R</u>UN','FontSize',myui.fontsize,'BackGroundColor','g',... +0168 'Tag','std','UserData',1,'Callback',@onPushRun); +0169 set(gui.panels.invstd.HBox6,'Widths',[200 -1]); +0170 +0171 %% Java Hack to adjust vertical alignment of text fields +0172 jh = findjobj(gui.text_handles.invstd_InvType); +0173 jh.setVerticalAlignment(javax.swing.JLabel.CENTER); +0174 jh = findjobj(gui.text_handles.invstd_RTDtimes); +0175 jh.setVerticalAlignment(javax.swing.JLabel.CENTER); +0176 jh = findjobj(gui.text_handles.invstd_InvTypeOpt); +0177 jh.setVerticalAlignment(javax.swing.JLabel.CENTER); +0178 jh = findjobj(gui.text_handles.invstd_Lorder); +0179 jh.setVerticalAlignment(javax.swing.JLabel.CENTER); +0180 jh = findjobj(gui.text_handles.invstd_lambda); +0181 jh.setVerticalAlignment(javax.swing.JLabel.CENTER); +0182 jh = findjobj(gui.text_handles.invstd_run); +0183 jh.setVerticalAlignment(javax.swing.JLabel.CENTER); +0184 +0185 return +0186 +0187 %------------- END OF CODE -------------- +0188 +0189 %% License: +0190 % MIT License +0191 % +0192 % Copyright (c) 2018 Thomas Hiller +0193 % +0194 % Permission is hereby granted, free of charge, to any person obtaining a copy +0195 % of this software and associated documentation files (the "Software"), to deal +0196 % in the Software without restriction, including without limitation the rights +0197 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0198 % copies of the Software, and to permit persons to whom the Software is +0199 % furnished to do so, subject to the following conditions: +0200 % +0201 % The above copyright notice and this permission notice shall be included in all +0202 % copies or substantial portions of the Software. +0203 % +0204 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0205 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0206 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0207 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0208 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0209 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0210 % SOFTWARE.
    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/NUCLEUSinv/NUCLEUSinv_createPanelPlots.html b/doc/nucleus/NUCLEUSinv/NUCLEUSinv_createPanelPlots.html index 610a717..8135e9c 100644 --- a/doc/nucleus/NUCLEUSinv/NUCLEUSinv_createPanelPlots.html +++ b/doc/nucleus/NUCLEUSinv/NUCLEUSinv_createPanelPlots.html @@ -115,11 +115,11 @@

    SOURCE CODE ^%% 1. panel - Processing - PROC and RAW data 0045 gui.plots.Signal.ProcTab = uix.VBox('Parent',gui.plots.SignalPanel,... -0046 'Spacing',3,'Padding',3); +0046 'Spacing',5,'Padding',0); 0047 gui.plots.Signal.RawTab = uix.VBox('Parent',gui.plots.SignalPanel,... -0048 'Spacing',3,'Padding',3); +0048 'Spacing',5,'Padding',0); 0049 gui.plots.Signal.AllTab = uix.VBox('Parent',gui.plots.SignalPanel,... -0050 'Spacing',3,'Padding',3); +0050 'Spacing',5,'Padding',0); 0051 gui.plots.SignalPanel.TabTitles = {'PROC','RAW','ALL (joint)'}; 0052 gui.plots.SignalPanel.TabWidth = 75; 0053 gui.plots.SignalPanel.TabEnables = {'on','on','off'}; @@ -158,7 +158,7 @@

    SOURCE CODE ^% now the actual axes 1 0087 gui.axes_handles.raw = axes('Parent',gui.plots.Signal.Raw.box1,'Box','on'); 0088 set(get(gui.axes_handles.raw,'XLabel'),'String','time [s]'); -0089 set(get(gui.axes_handles.raw,'YLabel'),'String','amplitude [a.u.]'); +0089 set(get(gui.axes_handles.raw,'YLabel'),'String','\Reeal'); 0090 % the axes has a context menu 0091 gui.cm_handles.axes_raw = uicontextmenu(gui.figh); 0092 gui.cm_handles.axes_raw_xaxis = uimenu(gui.cm_handles.axes_raw,... @@ -172,7 +172,7 @@

    SOURCE CODE ^% now the actual axes 2 0101 gui.axes_handles.imag = axes('Parent',gui.plots.Signal.Raw.box2,'Box','on'); 0102 set(get(gui.axes_handles.imag,'XLabel'),'String',''); -0103 set(get(gui.axes_handles.imag,'YLabel'),'String',''); +0103 set(get(gui.axes_handles.imag,'YLabel'),'String','\Immag'); 0104 set(gui.axes_handles.imag,'XTickLabel',''); 0105 set(gui.axes_handles.imag,'YTickLabel',''); 0106 @@ -202,11 +202,11 @@

    SOURCE CODE ^%% 2. panel - Distributions - RTD, PSD and PSDJ data 0132 gui.plots.Dist.RTDTab = uix.HBox('Parent',gui.plots.DistPanel,... -0133 'Spacing',3,'Padding',3); +0133 'Spacing',0,'Padding',0); 0134 gui.plots.Dist.PSDTab = uix.HBox('Parent',gui.plots.DistPanel,... -0135 'Spacing',3,'Padding',3); +0135 'Spacing',0,'Padding',0); 0136 gui.plots.Dist.PSDJTab = uix.HBox('Parent',gui.plots.DistPanel,... -0137 'Spacing',3,'Padding',3); +0137 'Spacing',0,'Padding',0); 0138 gui.plots.DistPanel.TabTitles = {'RTD','PSD','PSD (joint)'}; 0139 gui.plots.DistPanel.TabWidth = 75; 0140 gui.plots.DistPanel.TabEnables = {'on','on','off'}; @@ -264,7 +264,7 @@

    SOURCE CODE ^%% 3. panel - CPS data 0194 gui.plots.CPSTab = uix.HBox('Parent',gui.plots.CPSPanel,... -0195 'Spacing',3,'Padding',3); +0195 'Spacing',0,'Padding',0); 0196 gui.plots.CPSPanel.Title = 'CPS (joint)'; 0197 0198 %% 3.1 the CPS axes diff --git a/doc/nucleus/NUCLEUSinv/NUCLEUSinv_createStatusbar.html b/doc/nucleus/NUCLEUSinv/NUCLEUSinv_createStatusbar.html index f0c7b85..f2347fd 100644 --- a/doc/nucleus/NUCLEUSinv/NUCLEUSinv_createStatusbar.html +++ b/doc/nucleus/NUCLEUSinv/NUCLEUSinv_createStatusbar.html @@ -102,55 +102,58 @@

    SOURCE CODE ^'Parent',gui.statusbar); 0037 gui.panels.status.mode = uix.Panel('Parent',gui.statusbar); 0038 gui.panels.status.optim = uix.Panel('Parent',gui.statusbar); -0039 gui.panels.status.stats = uix.Panel('Parent',gui.statusbar); -0040 gui.panels.status.joint = uix.Panel('Parent',gui.statusbar); -0041 gui.panels.status.invinfo = uix.Panel('Parent',gui.statusbar); -0042 gui.panels.status.tooltips = uix.Panel('Parent',gui.statusbar); -0043 % adjust their widths -0044 set(gui.statusbar,'Widths',[400 -1 -1 -1 -1 -1 -1]); -0045 -0046 %% add the individual text fields -0047 gui.textStatus = uicontrol('Style','Text','Parent',gui.panels.status.main,'String','',... -0048 'HorizontalAlignment','left','FontSize',8); -0049 gui.textMode = uicontrol('Style','Text','Parent',gui.panels.status.mode,'String','',... -0050 'HorizontalAlignment','left','FontSize',8); -0051 gui.textOptim = uicontrol('Style','Text','Parent',gui.panels.status.optim,'String','',... -0052 'HorizontalAlignment','left','FontSize',8,'ForegroundColor',[0.4 0.4 0.4]); -0053 gui.textStats = uicontrol('Style','Text','Parent',gui.panels.status.stats,'String','',... -0054 'HorizontalAlignment','left','FontSize',8,'ForegroundColor',[0.4 0.4 0.4]); -0055 gui.textJoint = uicontrol('Style','Text','Parent',gui.panels.status.joint,'String','',... -0056 'HorizontalAlignment','left','FontSize',8); -0057 gui.textInvinfo = uicontrol('Style','Text','Parent',gui.panels.status.invinfo,'String','',... -0058 'HorizontalAlignment','left','FontSize',8); -0059 gui.textTooltips = uicontrol('Style','Text','Parent',gui.panels.status.tooltips,'String','',... -0060 'HorizontalAlignment','left','FontSize',8); -0061 -0062 return -0063 -0064 %------------- END OF CODE -------------- -0065 -0066 %% License: -0067 % MIT License -0068 % -0069 % Copyright (c) 2018 Thomas Hiller -0070 % -0071 % Permission is hereby granted, free of charge, to any person obtaining a copy -0072 % of this software and associated documentation files (the "Software"), to deal -0073 % in the Software without restriction, including without limitation the rights -0074 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -0075 % copies of the Software, and to permit persons to whom the Software is -0076 % furnished to do so, subject to the following conditions: -0077 % -0078 % The above copyright notice and this permission notice shall be included in all -0079 % copies or substantial portions of the Software. +0039 gui.panels.status.solver = uix.Panel('Parent',gui.statusbar); +0040 gui.panels.status.stats = uix.Panel('Parent',gui.statusbar); +0041 gui.panels.status.joint = uix.Panel('Parent',gui.statusbar); +0042 gui.panels.status.invinfo = uix.Panel('Parent',gui.statusbar); +0043 gui.panels.status.tooltips = uix.Panel('Parent',gui.statusbar); +0044 % adjust their widths +0045 set(gui.statusbar,'Widths',[400 -1 -1 -1 -1 -1 -1 -1]); +0046 +0047 %% add the individual text fields +0048 gui.textStatus = uicontrol('Style','Text','Parent',gui.panels.status.main,'String','',... +0049 'HorizontalAlignment','left','FontSize',8); +0050 gui.textMode = uicontrol('Style','Text','Parent',gui.panels.status.mode,'String','',... +0051 'HorizontalAlignment','left','FontSize',8); +0052 gui.textOptim = uicontrol('Style','Text','Parent',gui.panels.status.optim,'String','',... +0053 'HorizontalAlignment','left','FontSize',8); +0054 gui.textSolver = uicontrol('Style','Text','Parent',gui.panels.status.solver,'String','',... +0055 'HorizontalAlignment','left','FontSize',8); +0056 gui.textStats = uicontrol('Style','Text','Parent',gui.panels.status.stats,'String','',... +0057 'HorizontalAlignment','left','FontSize',8); +0058 gui.textJoint = uicontrol('Style','Text','Parent',gui.panels.status.joint,'String','',... +0059 'HorizontalAlignment','left','FontSize',8); +0060 gui.textInvinfo = uicontrol('Style','Text','Parent',gui.panels.status.invinfo,'String','',... +0061 'HorizontalAlignment','left','FontSize',8); +0062 gui.textTooltips = uicontrol('Style','Text','Parent',gui.panels.status.tooltips,'String','',... +0063 'HorizontalAlignment','left','FontSize',8); +0064 +0065 return +0066 +0067 %------------- END OF CODE -------------- +0068 +0069 %% License: +0070 % MIT License +0071 % +0072 % Copyright (c) 2018 Thomas Hiller +0073 % +0074 % Permission is hereby granted, free of charge, to any person obtaining a copy +0075 % of this software and associated documentation files (the "Software"), to deal +0076 % in the Software without restriction, including without limitation the rights +0077 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0078 % copies of the Software, and to permit persons to whom the Software is +0079 % furnished to do so, subject to the following conditions: 0080 % -0081 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -0082 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -0083 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -0084 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -0085 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -0086 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -0087 % SOFTWARE. +0081 % The above copyright notice and this permission notice shall be included in all +0082 % copies or substantial portions of the Software. +0083 % +0084 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0085 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0086 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0087 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0088 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0089 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0090 % SOFTWARE.
    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/NUCLEUSinv/NUCLEUSinv_loadDefaults.html b/doc/nucleus/NUCLEUSinv/NUCLEUSinv_loadDefaults.html index 06395c7..389a298 100644 --- a/doc/nucleus/NUCLEUSinv/NUCLEUSinv_loadDefaults.html +++ b/doc/nucleus/NUCLEUSinv/NUCLEUSinv_loadDefaults.html @@ -116,156 +116,158 @@

    SOURCE CODE ^'on'; 0048 out.info.ToolTips = 'off'; 0049 % Optimization and Statistics toolbox availability is checked later -0050 out.info.optim = 'off'; -0051 out.info.stat = 'off'; -0052 -0053 %% process panel defaults -0054 % first data sample of the signal -0055 out.process.start = 1; -0056 % last data sample of the signal (0 resets it to take the full signal) -0057 out.process.end = 0; -0058 % re-sampling (gating) of the raw signal 'log' | 'lin' | 'none' -0059 % depends on signal type 'T1' or 'T2' -0060 out.process.gatetype = 'log'; -0061 % maximum number of echoes per gate -0062 out.process.Nechoes = 50; -0063 % normalize signal to 1 (no=0, yes=1) -0064 out.process.norm = 0; -0065 % scale factor for normalization -0066 out.process.normfac = 1; -0067 % time scale of the signal 's' | 'ms' -0068 out.process.timescale = 's'; -0069 % corresponding scale factor (s=1) | (ms=1000) -0070 out.process.timefac = 1; -0071 -0072 %% petrophysical parameters panel -0073 % surface relaxivity [µm/s] -0074 out.param.rho = 10; -0075 % surface to volume ratio factor a [-] 1/T = rho*(S/V) = rho*a/R -0076 out.param.a = 2; -0077 % T cutoff time between clay bound (CBW) and irreducible water (BVI) in [ms] -0078 out.param.CBWcutoff = 3; -0079 % T cutoff time between irreducible (BVI) and movable water (BVM) in [ms] -0080 out.param.BVIcutoff = 33; -0081 % calibration sample volume -0082 out.param.calibVol = 1; -0083 % calibration sample NMR amplitude -0084 out.param.calibAmp = 1; -0085 % sample volume -0086 out.param.sampVol = 1; -0087 -0088 % NMR porosity calibration data -0089 % calibration volume (water -0090 out.calib.vol = 1; -0091 % calibration amplitude (water) -0092 out.calib.amp = 1; -0093 % calibration factor -0094 out.calib.fac = 1; -0095 % calibration name -0096 out.calib.name = ''; -0097 -0098 %% standard inversion panel defaults -0099 % inversion methods to choose from -0100 % 'mono' | 'free' | 'NNLS' | 'ILA' -0101 out.invstd.invtype = 'NNLS'; -0102 % when inversion method is 'free' choose No. of free relaxation times -0103 out.invstd.freeDT = 2; -0104 % regularization options for multi-exponential fitting routines -0105 % 'NNLS' and 'ILA' -0106 out.invstd.regtype = 'manual'; -0107 % smoothness constraint (order) for multi-exponential fitting routines -0108 % 'NNLS' and 'ILA' -0109 out.invstd.Lorder = 1; -0110 % regularization parameter for multi-exponential fitting routines -0111 % 'NNLS' and 'ILA' -0112 out.invstd.lambda = 1; -0113 % L-curve range (lambda) for multi-exponential fitting routine 'NNLS' -0114 out.invstd.lambdaR = [1e-3 1e2]; -0115 % initial L-curve range (lambda) for multi-exponential fitting routine -0116 % 'NNLS' -0117 out.invstd.lambdaRinit = [1e-3 1e2]; -0118 % number of lambda values in L-curve -0119 out.invstd.NlambdaR = 20; -0120 % range for RTD [min max] in [s] -0121 out.invstd.time = [1e-4 1e2]; -0122 % number of points per decade in RTD -0123 out.invstd.Ntime = 30; -0124 % noise level (taken from data if available) -0125 out.invstd.noise = 0; -0126 % water bulk relaxation time [s] -0127 out.invstd.Tbulk = 1e6; -0128 % porosity value between 0 and 1 [-] -0129 out.invstd.porosity = 1; -0130 -0131 %% joint inversion panel defaults -0132 % joint inversion methods to choose 'free' | 'fixed' | 'shape' -0133 out.invjoint.invtype = 'free'; -0134 % pore size distribution in [m] -0135 out.invjoint.radii = [1e-8 1e-2]; -0136 % No. of steps per decade in pore size distribution -0137 out.invjoint.Nradii = 25; -0138 % regularization options for joint inversion 'free' -0139 out.invjoint.regtype = 'manual'; -0140 % smoothness constraint (order) for joint inversion 'free' -0141 out.invjoint.Lorder = 1; -0142 % regularization parameter for joint inversion 'free' -0143 out.invjoint.lambda = 1; -0144 % L-curve range (lambda) for joint inversion 'free' -0145 out.invjoint.lambdaR = [1e-3 1e2]; -0146 % initial L-curve range (lambda) for joint inversion 'free' -0147 out.invjoint.lambdaRinit = [1e-3 1e2]; -0148 out.invjoint.NlambdaR = 20; -0149 % available pore geometries 'cyl' | 'ang' | 'poly' -0150 out.invjoint.geometry_type = 'cyl'; -0151 % number of polygon sides for geometry 'poly' (3 to 12) -0152 out.invjoint.polyN = 3; -0153 % angle alpha [deg] - fixed to 90° -0154 out.invjoint.alpha = 90; -0155 % angle beta [deg] - changed by user -0156 out.invjoint.beta = 60; -0157 % gamma [deg] - alpha-beta -0158 out.invjoint.gamma = 30; -0159 % start value rho [µm/s] -0160 out.invjoint.rhostart = 20; -0161 % lower and upper boundary for rho [µm/s] -0162 out.invjoint.rhobounds = [0.01 1000]; -0163 % sart value beta [deg] -0164 out.invjoint.anglestart = 25; -0165 -0166 % pressure settings -0167 % CPS table initial values (use,p,S,drain/imb) -0168 out.pressure.table = {true,0,1,'D'}; -0169 % pressure units 'Pa' | 'kPa' | 'MPa' | 'bar' -0170 out.pressure.unit = 'Pa'; -0171 % corresponding scale factors - 1 | 1e-3 | 1e-6 | 1e-5 -0172 out.pressure.unitfac = 1; -0173 -0174 return +0050 % lsqnonneg is the default lsq-solver +0051 out.info.has_optim = 'off'; +0052 out.info.solver = 'lsqnonneg'; +0053 out.info.stat = 'off'; +0054 +0055 %% process panel defaults +0056 % first data sample of the signal +0057 out.process.start = 1; +0058 % last data sample of the signal (0 resets it to take the full signal) +0059 out.process.end = 0; +0060 % re-sampling (gating) of the raw signal 'log' | 'lin' | 'none' +0061 % depends on signal type 'T1' or 'T2' +0062 out.process.gatetype = 'log'; +0063 % maximum number of echoes per gate +0064 out.process.Nechoes = 50; +0065 % normalize signal to 1 (no=0, yes=1) +0066 out.process.norm = 0; +0067 % scale factor for normalization +0068 out.process.normfac = 1; +0069 % time scale of the signal 's' | 'ms' +0070 out.process.timescale = 's'; +0071 % corresponding scale factor (s=1) | (ms=1000) +0072 out.process.timefac = 1; +0073 +0074 %% petrophysical parameters panel +0075 % surface relaxivity [µm/s] +0076 out.param.rho = 10; +0077 % surface to volume ratio factor a [-] 1/T = rho*(S/V) = rho*a/R +0078 out.param.a = 2; +0079 % T cutoff time between clay bound (CBW) and irreducible water (BVI) in [ms] +0080 out.param.CBWcutoff = 3; +0081 % T cutoff time between irreducible (BVI) and movable water (BVM) in [ms] +0082 out.param.BVIcutoff = 33; +0083 % calibration sample volume +0084 out.param.calibVol = 1; +0085 % calibration sample NMR amplitude +0086 out.param.calibAmp = 1; +0087 % sample volume +0088 out.param.sampVol = 1; +0089 +0090 % NMR porosity calibration data +0091 % calibration volume (water +0092 out.calib.vol = 1; +0093 % calibration amplitude (water) +0094 out.calib.amp = 1; +0095 % calibration factor +0096 out.calib.fac = 1; +0097 % calibration name +0098 out.calib.name = ''; +0099 +0100 %% standard inversion panel defaults +0101 % inversion methods to choose from +0102 % 'mono' | 'free' | 'NNLS' | 'ILA' +0103 out.invstd.invtype = 'NNLS'; +0104 % when inversion method is 'free' choose No. of free relaxation times +0105 out.invstd.freeDT = 2; +0106 % regularization options for multi-exponential fitting routines +0107 % 'NNLS' and 'ILA' +0108 out.invstd.regtype = 'manual'; +0109 % smoothness constraint (order) for multi-exponential fitting routines +0110 % 'NNLS' and 'ILA' +0111 out.invstd.Lorder = 1; +0112 % regularization parameter for multi-exponential fitting routines +0113 % 'NNLS' and 'ILA' +0114 out.invstd.lambda = 1; +0115 % L-curve range (lambda) for multi-exponential fitting routine 'NNLS' +0116 out.invstd.lambdaR = [1e-3 1e2]; +0117 % initial L-curve range (lambda) for multi-exponential fitting routine +0118 % 'NNLS' +0119 out.invstd.lambdaRinit = [1e-3 1e2]; +0120 % number of lambda values in L-curve +0121 out.invstd.NlambdaR = 20; +0122 % range for RTD [min max] in [s] +0123 out.invstd.time = [1e-4 1e2]; +0124 % number of points per decade in RTD +0125 out.invstd.Ntime = 30; +0126 % noise level (taken from data if available) +0127 out.invstd.noise = 0; +0128 % water bulk relaxation time [s] +0129 out.invstd.Tbulk = 1e6; +0130 % porosity value between 0 and 1 [-] +0131 out.invstd.porosity = 1; +0132 +0133 %% joint inversion panel defaults +0134 % joint inversion methods to choose 'free' | 'fixed' | 'shape' +0135 out.invjoint.invtype = 'free'; +0136 % pore size distribution in [m] +0137 out.invjoint.radii = [1e-8 1e-2]; +0138 % No. of steps per decade in pore size distribution +0139 out.invjoint.Nradii = 25; +0140 % regularization options for joint inversion 'free' +0141 out.invjoint.regtype = 'manual'; +0142 % smoothness constraint (order) for joint inversion 'free' +0143 out.invjoint.Lorder = 1; +0144 % regularization parameter for joint inversion 'free' +0145 out.invjoint.lambda = 1; +0146 % L-curve range (lambda) for joint inversion 'free' +0147 out.invjoint.lambdaR = [1e-3 1e2]; +0148 % initial L-curve range (lambda) for joint inversion 'free' +0149 out.invjoint.lambdaRinit = [1e-3 1e2]; +0150 out.invjoint.NlambdaR = 20; +0151 % available pore geometries 'cyl' | 'ang' | 'poly' +0152 out.invjoint.geometry_type = 'cyl'; +0153 % number of polygon sides for geometry 'poly' (3 to 12) +0154 out.invjoint.polyN = 3; +0155 % angle alpha [deg] - fixed to 90° +0156 out.invjoint.alpha = 90; +0157 % angle beta [deg] - changed by user +0158 out.invjoint.beta = 60; +0159 % gamma [deg] - alpha-beta +0160 out.invjoint.gamma = 30; +0161 % start value rho [µm/s] +0162 out.invjoint.rhostart = 20; +0163 % lower and upper boundary for rho [µm/s] +0164 out.invjoint.rhobounds = [0.01 1000]; +0165 % sart value beta [deg] +0166 out.invjoint.anglestart = 25; +0167 +0168 % pressure settings +0169 % CPS table initial values (use,p,S,drain/imb) +0170 out.pressure.table = {true,0,1,'D'}; +0171 % pressure units 'Pa' | 'kPa' | 'MPa' | 'bar' +0172 out.pressure.unit = 'Pa'; +0173 % corresponding scale factors - 1 | 1e-3 | 1e-6 | 1e-5 +0174 out.pressure.unitfac = 1; 0175 -0176 %------------- END OF CODE -------------- +0176 return 0177 -0178 %% License: -0179 % MIT License -0180 % -0181 % Copyright (c) 2018 Thomas Hiller +0178 %------------- END OF CODE -------------- +0179 +0180 %% License: +0181 % MIT License 0182 % -0183 % Permission is hereby granted, free of charge, to any person obtaining a copy -0184 % of this software and associated documentation files (the "Software"), to deal -0185 % in the Software without restriction, including without limitation the rights -0186 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -0187 % copies of the Software, and to permit persons to whom the Software is -0188 % furnished to do so, subject to the following conditions: -0189 % -0190 % The above copyright notice and this permission notice shall be included in all -0191 % copies or substantial portions of the Software. -0192 % -0193 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -0194 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -0195 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -0196 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -0197 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -0198 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -0199 % SOFTWARE. +0183 % Copyright (c) 2018 Thomas Hiller +0184 % +0185 % Permission is hereby granted, free of charge, to any person obtaining a copy +0186 % of this software and associated documentation files (the "Software"), to deal +0187 % in the Software without restriction, including without limitation the rights +0188 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0189 % copies of the Software, and to permit persons to whom the Software is +0190 % furnished to do so, subject to the following conditions: +0191 % +0192 % The above copyright notice and this permission notice shall be included in all +0193 % copies or substantial portions of the Software. +0194 % +0195 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0196 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0197 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0198 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0199 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0200 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0201 % SOFTWARE.
    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/NUCLEUSinv/NUCLEUSinv_updateInterface.html b/doc/nucleus/NUCLEUSinv/NUCLEUSinv_updateInterface.html index eb29b7e..4edcbbf 100644 --- a/doc/nucleus/NUCLEUSinv/NUCLEUSinv_updateInterface.html +++ b/doc/nucleus/NUCLEUSinv/NUCLEUSinv_updateInterface.html @@ -70,7 +70,7 @@

    CROSS-REFERENCE INFORMATION ^
 </ul>
 This function is called by:
 <ul style= -
  • onEditValue updates all edit field values, checks for wrong inputs and
  • onListboxData handles the calls from the context menu of the data
  • onMenuExpert handles the call from the menu that activates / deactivates
  • onMenuJointInversion handles the call from the menu that activates / deactivates
  • onPopupInvjointGeometryType selects the joint inversion geometry (dependent
  • onPopupInvjointPolyN handles the call from the popup menu to select the
  • onPopupInvjointType selects the joint inversion method ("free", "fixed" or
  • onPopupInvjointTypeOptional select regularization option for the joint
  • onPopupInvstdType selects the inversion method for the standard inversion
  • onPopupInvstdTypeOptional select regularization option for the standard
  • onPopupPressureUnits select pressure unit ("Pa", "kPa", "MPa" or "bar")
  • onRadioGates selects the re-sampling / gating method ("log", "lin" or "none")
  • onRadioLorder selects the smoothness constraint for the multi-exponential
  • onRadioNormalize selects whether to normalize a NMR signal to 1
  • onRadioTimescale selects whether the time scale should be "s" or "ms"
  • calibratePorosity determines a sample's porosity from a calibration
  • clearInversion removes inversion results from the internal data structure
  • importASCIIdata imports NMR data from ASCII files
  • importCPSdata imports CPS data from an ASCII dat-file. See the "examples"
  • importEXCELdata imports NMR data from Excel files
  • importINV2INV imports a previously saved NUCLEUSinv session
  • importMOD2INV
  • importNMRdata is the general import routine for NMR data
  • removeSignalFromList removes the chosen NMR signal from the GUI
  • runInversionStd controls the standard inversion process to invert a
  • +
  • onEditValue updates all edit field values, checks for wrong inputs and
  • onListboxData handles the calls from the context menu of the data
  • onMenuExpert handles the call from the menu that activates / deactivates
  • onMenuJointInversion handles the call from the menu that activates / deactivates
  • onMenuSolver handles the call from the menu that allows to choose the LSQ
  • onPopupInvjointGeometryType selects the joint inversion geometry (dependent
  • onPopupInvjointPolyN handles the call from the popup menu to select the
  • onPopupInvjointType selects the joint inversion method ("free", "fixed" or
  • onPopupInvjointTypeOptional select regularization option for the joint
  • onPopupInvstdType selects the inversion method for the standard inversion
  • onPopupInvstdTypeOptional select regularization option for the standard
  • onPopupPressureUnits select pressure unit ("Pa", "kPa", "MPa" or "bar")
  • onRadioGates selects the re-sampling / gating method ("log", "lin" or "none")
  • onRadioLorder selects the smoothness constraint for the multi-exponential
  • onRadioNormalize selects whether to normalize a NMR signal to 1
  • onRadioTimescale selects whether the time scale should be "s" or "ms"
  • calibratePorosity determines a sample's porosity from a calibration
  • clearInversion removes inversion results from the internal data structure
  • importASCIIdata imports NMR data from ASCII files
  • importCPSdata imports CPS data from an ASCII dat-file. See the "examples"
  • importCalibrationData
  • importEXCELdata imports NMR data from Excel files
  • importINV2INV imports a previously saved NUCLEUSinv session
  • importMOD2INV
  • importNMRdata is the general import routine for NMR data
  • removeSignalFromList removes the chosen NMR signal from the GUI
  • runInversionStd controls the standard inversion process to invert a
  • SUBFUNCTIONS ^

    @@ -138,7 +138,7 @@

    SOURCE CODE ^updateTimescale(gui,data.process.timescale); 0059 if data.invstd.porosity <= 1 0060 set(gui.edit_handles.invstd_porosity,'Enable','on',... -0061 'BackgroundColor','w',... +0061 'BackgroundColor',gui.myui.colors.editBG,... 0062 'String',num2str(data.invstd.porosity)); 0063 else 0064 set(gui.edit_handles.invstd_porosity,'Enable','on',... @@ -148,887 +148,872 @@

    SOURCE CODE ^%% update standard inversion panel 0070 % inversion method popup -0071 switch data.info.optim -0072 case 'on' -0073 istring = {'Mono exp.','Several free exp. (2-5)',... -0074 'Multi exp. (LSQLIN)',... -0075 'Multi exp. (InvLaplace)'}; -0076 case 'off' -0077 istring = {'Mono exp.','Several free exp. (2-5)',... -0078 'Multi exp. (NNLS)',... -0079 'Multi exp. (InvLaplace)'}; -0080 end -0081 set(gui.popup_handles.invstd_InvType,'String',istring); -0082 switch data.invstd.invtype -0083 case 'mono' -0084 % inversion method popup -0085 set(gui.popup_handles.invstd_InvType,'Value',1,'Enable','on'); -0086 -0087 % additional inversion settings -0088 set(gui.popup_handles.invstd_InvTypeOpt,'Enable','off',... -0089 'Value',1,'String','none'); -0090 set(gui.text_handles.invstd_InvTypeOpt,... -0091 'String','No extra options'); -0092 -0093 % lambda, smoothness constraint and RTD limits -0094 gui = updateLambda(gui,data.invstd.regtype,0,0,0); -0095 gui = updateLorder(gui,data.invstd.invtype,data.invstd.Lorder); -0096 gui = updateInvstdTime(gui,data.invstd.invtype,0,0); +0071 istring = {'Mono exp.','Several free exp. (2-5)',... +0072 'Multi exp. (LSQ)','Multi exp. (InvLaplace)'}; +0073 set(gui.popup_handles.invstd_InvType,'String',istring); +0074 switch data.invstd.invtype +0075 case 'mono' +0076 % inversion method popup +0077 set(gui.popup_handles.invstd_InvType,'Value',1,'Enable','on'); +0078 +0079 % additional inversion settings +0080 set(gui.popup_handles.invstd_InvTypeOpt,'Enable','off',... +0081 'Value',1,'String','none'); +0082 set(gui.text_handles.invstd_InvTypeOpt,... +0083 'String','No extra options'); +0084 +0085 % lambda, smoothness constraint and RTD limits +0086 gui = updateLambda(gui,data.invstd.regtype,0,0,0); +0087 gui = updateLorder(gui,data.invstd.invtype,data.invstd.Lorder); +0088 gui = updateInvstdTime(gui,data.invstd.invtype,0,0); +0089 +0090 % Tbulk +0091 set(gui.edit_handles.invstd_Tbulk,'Enable','off',... +0092 'String',num2str(data.invstd.Tbulk)); +0093 +0094 case 'free' +0095 % inversion method popup +0096 set(gui.popup_handles.invstd_InvType,'Value',2,'Enable','on'); 0097 -0098 % Tbulk -0099 set(gui.edit_handles.invstd_Tbulk,'Enable','off',... -0100 'String',num2str(data.invstd.Tbulk)); -0101 -0102 case 'free' -0103 % inversion method popup -0104 set(gui.popup_handles.invstd_InvType,'Value',2,'Enable','on'); -0105 -0106 % additional inversion settings -0107 set(gui.popup_handles.invstd_InvTypeOpt,'Enable','on',... -0108 'Value',data.invstd.freeDT,... -0109 'String',{'1','2','3','4','5'}); -0110 set(gui.text_handles.invstd_InvTypeOpt,... -0111 'String','No. of free decay times T'); -0112 -0113 % lambda, smoothness constraint and RTD limits -0114 gui = updateLambda(gui,data.invstd.regtype,0,0,0); -0115 gui = updateLorder(gui,data.invstd.invtype,data.invstd.Lorder); -0116 gui = updateInvstdTime(gui,data.invstd.invtype,0,0); +0098 % additional inversion settings +0099 set(gui.popup_handles.invstd_InvTypeOpt,'Enable','on',... +0100 'Value',data.invstd.freeDT,... +0101 'String',{'1','2','3','4','5'}); +0102 set(gui.text_handles.invstd_InvTypeOpt,... +0103 'String','No. of free decay times T'); +0104 +0105 % lambda, smoothness constraint and RTD limits +0106 gui = updateLambda(gui,data.invstd.regtype,0,0,0); +0107 gui = updateLorder(gui,data.invstd.invtype,data.invstd.Lorder); +0108 gui = updateInvstdTime(gui,data.invstd.invtype,0,0); +0109 +0110 % Tbulk +0111 set(gui.edit_handles.invstd_Tbulk,'Enable','off',... +0112 'String',num2str(data.invstd.Tbulk)); +0113 +0114 case 'NNLS' +0115 % inversion method popup +0116 set(gui.popup_handles.invstd_InvType,'Value',3,'Enable','on'); 0117 -0118 % Tbulk -0119 set(gui.edit_handles.invstd_Tbulk,'Enable','off',... -0120 'String',num2str(data.invstd.Tbulk)); -0121 -0122 case 'NNLS' -0123 % inversion method popup -0124 set(gui.popup_handles.invstd_InvType,'Value',3,'Enable','on'); -0125 -0126 % additional inversion settings -0127 set(gui.popup_handles.invstd_InvTypeOpt,'Enable','on',... -0128 'String',{'Manual','Iterative Chi2','Tikhonov (SVD)','TSVD (SVD)',... -0129 'DSVD (SVD)','Discrep. (SVD)','L-curve'}); -0130 set(gui.text_handles.invstd_InvTypeOpt,... -0131 'String','regularization options'); -0132 -0133 % regularization options -0134 switch data.invstd.regtype -0135 case 'manual' -0136 set(gui.popup_handles.invstd_InvTypeOpt,'Value',1); -0137 case 'iterchi2' -0138 set(gui.popup_handles.invstd_InvTypeOpt,'Value',2); -0139 case 'gcv_tikh' -0140 set(gui.popup_handles.invstd_InvTypeOpt,'Value',3); -0141 case 'gcv_trunc' -0142 set(gui.popup_handles.invstd_InvTypeOpt,'Value',4); -0143 case 'gcv_damp' -0144 set(gui.popup_handles.invstd_InvTypeOpt,'Value',5); -0145 case 'discrep' -0146 set(gui.popup_handles.invstd_InvTypeOpt,'Value',6); -0147 case 'lcurve' -0148 set(gui.popup_handles.invstd_InvTypeOpt,'Value',7); -0149 end -0150 -0151 % lambda, smoothness constraint and RTD limits -0152 gui = updateLambda(gui,data.invstd.regtype,data.invstd.lambda,... -0153 data.invstd.lambdaR,data.invstd.NlambdaR); -0154 gui = updateLorder(gui,data.invstd.invtype,data.invstd.Lorder); -0155 gui = updateInvstdTime(gui,data.invstd.invtype,data.invstd.time,... -0156 data.invstd.Ntime); +0118 % additional inversion settings +0119 set(gui.popup_handles.invstd_InvTypeOpt,'Enable','on',... +0120 'String',{'Manual','Iterative Chi2','Tikhonov (SVD)','TSVD (SVD)',... +0121 'DSVD (SVD)','Discrep. (SVD)','L-curve'}); +0122 set(gui.text_handles.invstd_InvTypeOpt,... +0123 'String','regularization options'); +0124 +0125 % regularization options +0126 switch data.invstd.regtype +0127 case 'manual' +0128 set(gui.popup_handles.invstd_InvTypeOpt,'Value',1); +0129 case 'iterchi2' +0130 set(gui.popup_handles.invstd_InvTypeOpt,'Value',2); +0131 case 'gcv_tikh' +0132 set(gui.popup_handles.invstd_InvTypeOpt,'Value',3); +0133 case 'gcv_trunc' +0134 set(gui.popup_handles.invstd_InvTypeOpt,'Value',4); +0135 case 'gcv_damp' +0136 set(gui.popup_handles.invstd_InvTypeOpt,'Value',5); +0137 case 'discrep' +0138 set(gui.popup_handles.invstd_InvTypeOpt,'Value',6); +0139 case 'lcurve' +0140 set(gui.popup_handles.invstd_InvTypeOpt,'Value',7); +0141 end +0142 +0143 % lambda, smoothness constraint and RTD limits +0144 gui = updateLambda(gui,data.invstd.regtype,data.invstd.lambda,... +0145 data.invstd.lambdaR,data.invstd.NlambdaR); +0146 gui = updateLorder(gui,data.invstd.invtype,data.invstd.Lorder); +0147 gui = updateInvstdTime(gui,data.invstd.invtype,data.invstd.time,... +0148 data.invstd.Ntime); +0149 +0150 % Tbulk +0151 set(gui.edit_handles.invstd_Tbulk,'Enable','on',... +0152 'String',num2str(data.invstd.Tbulk)); +0153 +0154 case 'ILA' +0155 % inversion method popup +0156 set(gui.popup_handles.invstd_InvType,'Value',4,'Enable','on'); 0157 -0158 % Tbulk -0159 set(gui.edit_handles.invstd_Tbulk,'Enable','on',... -0160 'String',num2str(data.invstd.Tbulk)); -0161 -0162 case 'ILA' -0163 % inversion method popup -0164 set(gui.popup_handles.invstd_InvType,'Value',4,'Enable','on'); -0165 -0166 % additional inversion settings -0167 set(gui.popup_handles.invstd_InvTypeOpt,'Enable','on',... -0168 'String',{'Manual','Automatic'}); -0169 set(gui.text_handles.invstd_InvTypeOpt,... -0170 'String','regularization options'); -0171 -0172 % regularization options -0173 switch data.invstd.regtype -0174 case 'manual' -0175 set(gui.popup_handles.invstd_InvTypeOpt,'Value',1); -0176 case 'auto' -0177 set(gui.popup_handles.invstd_InvTypeOpt,'Value',2); -0178 data.invstd.lambda = -1; -0179 end -0180 -0181 % lambda, smoothness constraint and RTD limits -0182 gui = updateLambda(gui,data.invstd.regtype,data.invstd.lambda,... -0183 data.invstd.lambdaR,data.invstd.NlambdaR); -0184 gui = updateLorder(gui,data.invstd.invtype,data.invstd.Lorder); -0185 gui = updateInvstdTime(gui,data.invstd.invtype,data.invstd.time,... -0186 data.invstd.Ntime); -0187 -0188 % Tbulk -0189 set(gui.edit_handles.invstd_Tbulk,'Enable','on',... -0190 'String',num2str(data.invstd.Tbulk)); -0191 end -0192 -0193 % updates CBW, BVI, rho and a -0194 gui = updateParams(gui,data.invstd.invtype,data.param); -0195 -0196 %% update joint inversion panel -0197 % depending if it is activated or not -0198 switch data.info.JointInv -0199 case 'on' -0200 % inversion method dependent -0201 switch data.invjoint.invtype -0202 case 'free' -0203 % inversion method popup -0204 set(gui.popup_handles.invjoint_InvType,'Value',1,'Enable','on'); -0205 -0206 % PSD limits -0207 gui = updateInvjointRadii(gui,data.invjoint.invtype,... -0208 data.invjoint.radii,data.invjoint.Nradii); -0209 -0210 % additional inversion settings -0211 set(gui.popup_handles.invjoint_InvTypeOpt,'Enable','on'); +0158 % additional inversion settings +0159 set(gui.popup_handles.invstd_InvTypeOpt,'Enable','on',... +0160 'String',{'Manual','Automatic'}); +0161 set(gui.text_handles.invstd_InvTypeOpt,... +0162 'String','regularization options'); +0163 +0164 % regularization options +0165 switch data.invstd.regtype +0166 case 'manual' +0167 set(gui.popup_handles.invstd_InvTypeOpt,'Value',1); +0168 case 'auto' +0169 set(gui.popup_handles.invstd_InvTypeOpt,'Value',2); +0170 data.invstd.lambda = -1; +0171 end +0172 +0173 % lambda, smoothness constraint and RTD limits +0174 gui = updateLambda(gui,data.invstd.regtype,data.invstd.lambda,... +0175 data.invstd.lambdaR,data.invstd.NlambdaR); +0176 gui = updateLorder(gui,data.invstd.invtype,data.invstd.Lorder); +0177 gui = updateInvstdTime(gui,data.invstd.invtype,data.invstd.time,... +0178 data.invstd.Ntime); +0179 +0180 % Tbulk +0181 set(gui.edit_handles.invstd_Tbulk,'Enable','on',... +0182 'String',num2str(data.invstd.Tbulk)); +0183 end +0184 +0185 % updates CBW, BVI, rho and a +0186 gui = updateParams(gui,data.invstd.invtype,data.param); +0187 +0188 %% update joint inversion panel +0189 % depending if it is activated or not +0190 switch data.info.JointInv +0191 case 'on' +0192 % inversion method dependent +0193 switch data.invjoint.invtype +0194 case 'free' +0195 % inversion method popup +0196 set(gui.popup_handles.invjoint_InvType,'Value',1,'Enable','on'); +0197 +0198 % PSD limits +0199 gui = updateInvjointRadii(gui,data.invjoint.invtype,... +0200 data.invjoint.radii,data.invjoint.Nradii); +0201 +0202 % additional inversion settings +0203 set(gui.popup_handles.invjoint_InvTypeOpt,'Enable','on'); +0204 +0205 % regularization options +0206 switch data.invjoint.regtype +0207 case 'manual' +0208 set(gui.popup_handles.invjoint_InvTypeOpt,'Value',1); +0209 case 'lcurve' +0210 set(gui.popup_handles.invjoint_InvTypeOpt,'Value',2); +0211 end 0212 -0213 % regularization options -0214 switch data.invjoint.regtype -0215 case 'manual' -0216 set(gui.popup_handles.invjoint_InvTypeOpt,'Value',1); -0217 case 'lcurve' -0218 set(gui.popup_handles.invjoint_InvTypeOpt,'Value',2); -0219 end -0220 -0221 % smoothness constraint and lambda -0222 gui = updateLorderJoint(gui,data.invjoint.invtype,... -0223 data.invjoint.Lorder); -0224 gui = updateLambdaJoint(gui,data.invjoint.regtype,... -0225 data.invjoint.lambda,data.invjoint.lambdaR,... -0226 data.invjoint.NlambdaR,data.invstd.regtype); -0227 -0228 % start values -0229 set(gui.edit_handles.invjoint_rhostart,'Enable','on'); -0230 set(gui.edit_handles.invjoint_anglestart,'Enable','off'); -0231 -0232 % geometry type dependent -0233 switch data.invjoint.geometry_type -0234 case 'cyl' -0235 % geometry popup -0236 set(gui.popup_handles.invjoint_geometry_type,... -0237 'Value',1,'Enable','on'); -0238 -0239 % polygon sides and corresponding angle beta -0240 set(gui.popup_handles.invjoint_polyN,'Enable','off',... -0241 'Value',data.invjoint.polyN-2); -0242 set(gui.edit_handles.invjoint_beta,'Enable','off'); -0243 -0244 % angles -0245 set(gui.edit_handles.invjoint_alpha,'String',''); -0246 set(gui.edit_handles.invjoint_beta,'String',''); -0247 set(gui.edit_handles.invjoint_gamma,'String',''); -0248 -0249 case 'ang' -0250 % geometry popup -0251 set(gui.popup_handles.invjoint_geometry_type,... -0252 'Value',2,'Enable','on'); -0253 -0254 % polygon sides and corresponding angle beta -0255 set(gui.popup_handles.invjoint_polyN,'Enable','off',... -0256 'Value',data.invjoint.polyN-2); -0257 set(gui.edit_handles.invjoint_beta,'Enable','on'); +0213 % smoothness constraint and lambda +0214 gui = updateLorderJoint(gui,data.invjoint.invtype,... +0215 data.invjoint.Lorder); +0216 gui = updateLambdaJoint(gui,data.invjoint.regtype,... +0217 data.invjoint.lambda,data.invjoint.lambdaR,... +0218 data.invjoint.NlambdaR,data.invstd.regtype); +0219 +0220 % start values +0221 set(gui.edit_handles.invjoint_rhostart,'Enable','on'); +0222 set(gui.edit_handles.invjoint_anglestart,'Enable','off'); +0223 +0224 % geometry type dependent +0225 switch data.invjoint.geometry_type +0226 case 'cyl' +0227 % geometry popup +0228 set(gui.popup_handles.invjoint_geometry_type,... +0229 'Value',1,'Enable','on'); +0230 +0231 % polygon sides and corresponding angle beta +0232 set(gui.popup_handles.invjoint_polyN,'Enable','off',... +0233 'Value',data.invjoint.polyN-2); +0234 set(gui.edit_handles.invjoint_beta,'Enable','off'); +0235 +0236 % angles +0237 set(gui.edit_handles.invjoint_alpha,'String',''); +0238 set(gui.edit_handles.invjoint_beta,'String',''); +0239 set(gui.edit_handles.invjoint_gamma,'String',''); +0240 +0241 case 'ang' +0242 % geometry popup +0243 set(gui.popup_handles.invjoint_geometry_type,... +0244 'Value',2,'Enable','on'); +0245 +0246 % polygon sides and corresponding angle beta +0247 set(gui.popup_handles.invjoint_polyN,'Enable','off',... +0248 'Value',data.invjoint.polyN-2); +0249 set(gui.edit_handles.invjoint_beta,'Enable','on'); +0250 +0251 % angles +0252 set(gui.edit_handles.invjoint_alpha,... +0253 'String',num2str(data.invjoint.alpha)); +0254 set(gui.edit_handles.invjoint_beta,... +0255 'String',num2str(data.invjoint.beta)); +0256 set(gui.edit_handles.invjoint_gamma,... +0257 'String',num2str(data.invjoint.gamma)); 0258 -0259 % angles -0260 set(gui.edit_handles.invjoint_alpha,... -0261 'String',num2str(data.invjoint.alpha)); -0262 set(gui.edit_handles.invjoint_beta,... -0263 'String',num2str(data.invjoint.beta)); -0264 set(gui.edit_handles.invjoint_gamma,... -0265 'String',num2str(data.invjoint.gamma)); -0266 -0267 case 'poly' -0268 % geometry popup -0269 set(gui.popup_handles.invjoint_geometry_type,... -0270 'Value',3,'Enable','on'); -0271 -0272 % polygon sides and corresponding angle beta -0273 set(gui.popup_handles.invjoint_polyN,'Enable','on',... -0274 'Value',data.invjoint.polyN-2); -0275 set(gui.edit_handles.invjoint_beta,'Enable','off'); -0276 -0277 % angles -0278 polyangle = ((data.invjoint.polyN-2)/data.invjoint.polyN)*180; -0279 set(gui.edit_handles.invjoint_alpha,... -0280 'String',''); -0281 set(gui.edit_handles.invjoint_beta,... -0282 'String',num2str(polyangle)); -0283 set(gui.edit_handles.invjoint_gamma,... -0284 'String',''); -0285 end +0259 case 'poly' +0260 % geometry popup +0261 set(gui.popup_handles.invjoint_geometry_type,... +0262 'Value',3,'Enable','on'); +0263 +0264 % polygon sides and corresponding angle beta +0265 set(gui.popup_handles.invjoint_polyN,'Enable','on',... +0266 'Value',data.invjoint.polyN-2); +0267 set(gui.edit_handles.invjoint_beta,'Enable','off'); +0268 +0269 % angles +0270 polyangle = ((data.invjoint.polyN-2)/data.invjoint.polyN)*180; +0271 set(gui.edit_handles.invjoint_alpha,... +0272 'String',''); +0273 set(gui.edit_handles.invjoint_beta,... +0274 'String',num2str(polyangle)); +0275 set(gui.edit_handles.invjoint_gamma,... +0276 'String',''); +0277 end +0278 +0279 case 'fixed' +0280 % inversion method popup +0281 set(gui.popup_handles.invjoint_InvType,'Value',2,'Enable','on'); +0282 +0283 % PSD limits +0284 gui = updateInvjointRadii(gui,data.invjoint.invtype,... +0285 data.invjoint.radii,data.invjoint.Nradii); 0286 -0287 case 'fixed' -0288 % inversion method popup -0289 set(gui.popup_handles.invjoint_InvType,'Value',2,'Enable','on'); -0290 -0291 % PSD limits -0292 gui = updateInvjointRadii(gui,data.invjoint.invtype,... -0293 data.invjoint.radii,data.invjoint.Nradii); -0294 -0295 % additional inversion settings -0296 set(gui.popup_handles.invjoint_InvTypeOpt,'Enable','off'); +0287 % additional inversion settings +0288 set(gui.popup_handles.invjoint_InvTypeOpt,'Enable','off'); +0289 +0290 % regularization options +0291 switch data.invjoint.regtype +0292 case 'manual' +0293 set(gui.popup_handles.invjoint_InvTypeOpt,'Value',1); +0294 case 'lcurve' +0295 set(gui.popup_handles.invjoint_InvTypeOpt,'Value',2); +0296 end 0297 -0298 % regularization options -0299 switch data.invjoint.regtype -0300 case 'manual' -0301 set(gui.popup_handles.invjoint_InvTypeOpt,'Value',1); -0302 case 'lcurve' -0303 set(gui.popup_handles.invjoint_InvTypeOpt,'Value',2); -0304 end -0305 -0306 % smoothness constraint and lambda -0307 gui = updateLorderJoint(gui,data.invjoint.invtype,... -0308 data.invjoint.Lorder); -0309 gui = updateLambdaJoint(gui,'none',data.invjoint.lambda,... -0310 data.invjoint.lambdaR,data.invjoint.NlambdaR,... -0311 data.invstd.regtype); -0312 -0313 % start values -0314 set(gui.edit_handles.invjoint_rhostart,'Enable','on'); -0315 set(gui.edit_handles.invjoint_anglestart,'Enable','off'); -0316 -0317 % geometry type dependent -0318 switch data.invjoint.geometry_type -0319 case 'cyl' -0320 % geometry popup -0321 set(gui.popup_handles.invjoint_geometry_type,... -0322 'Value',1,'Enable','on'); -0323 -0324 % polygon sides and corresponding angle beta -0325 set(gui.popup_handles.invjoint_polyN,'Enable','off',... -0326 'Value',data.invjoint.polyN-2); -0327 set(gui.edit_handles.invjoint_beta,'Enable','off'); -0328 -0329 % angles -0330 set(gui.edit_handles.invjoint_alpha,'String',''); -0331 set(gui.edit_handles.invjoint_beta,'String',''); -0332 set(gui.edit_handles.invjoint_gamma,'String',''); -0333 -0334 case 'ang' -0335 % geometry popup -0336 set(gui.popup_handles.invjoint_geometry_type,... -0337 'Value',2,'Enable','on'); -0338 -0339 % polygon sides and corresponding angle beta -0340 set(gui.popup_handles.invjoint_polyN,'Enable','off',... -0341 'Value',data.invjoint.polyN-2); -0342 set(gui.edit_handles.invjoint_beta,'Enable','on'); +0298 % smoothness constraint and lambda +0299 gui = updateLorderJoint(gui,data.invjoint.invtype,... +0300 data.invjoint.Lorder); +0301 gui = updateLambdaJoint(gui,'none',data.invjoint.lambda,... +0302 data.invjoint.lambdaR,data.invjoint.NlambdaR,... +0303 data.invstd.regtype); +0304 +0305 % start values +0306 set(gui.edit_handles.invjoint_rhostart,'Enable','on'); +0307 set(gui.edit_handles.invjoint_anglestart,'Enable','off'); +0308 +0309 % geometry type dependent +0310 switch data.invjoint.geometry_type +0311 case 'cyl' +0312 % geometry popup +0313 set(gui.popup_handles.invjoint_geometry_type,... +0314 'Value',1,'Enable','on'); +0315 +0316 % polygon sides and corresponding angle beta +0317 set(gui.popup_handles.invjoint_polyN,'Enable','off',... +0318 'Value',data.invjoint.polyN-2); +0319 set(gui.edit_handles.invjoint_beta,'Enable','off'); +0320 +0321 % angles +0322 set(gui.edit_handles.invjoint_alpha,'String',''); +0323 set(gui.edit_handles.invjoint_beta,'String',''); +0324 set(gui.edit_handles.invjoint_gamma,'String',''); +0325 +0326 case 'ang' +0327 % geometry popup +0328 set(gui.popup_handles.invjoint_geometry_type,... +0329 'Value',2,'Enable','on'); +0330 +0331 % polygon sides and corresponding angle beta +0332 set(gui.popup_handles.invjoint_polyN,'Enable','off',... +0333 'Value',data.invjoint.polyN-2); +0334 set(gui.edit_handles.invjoint_beta,'Enable','on'); +0335 +0336 % angles +0337 set(gui.edit_handles.invjoint_alpha,... +0338 'String',num2str(data.invjoint.alpha)); +0339 set(gui.edit_handles.invjoint_beta,... +0340 'String',num2str(data.invjoint.beta)); +0341 set(gui.edit_handles.invjoint_gamma,... +0342 'String',num2str(data.invjoint.gamma)); 0343 -0344 % angles -0345 set(gui.edit_handles.invjoint_alpha,... -0346 'String',num2str(data.invjoint.alpha)); -0347 set(gui.edit_handles.invjoint_beta,... -0348 'String',num2str(data.invjoint.beta)); -0349 set(gui.edit_handles.invjoint_gamma,... -0350 'String',num2str(data.invjoint.gamma)); -0351 -0352 case 'poly' -0353 % geometry popup -0354 set(gui.popup_handles.invjoint_geometry_type,... -0355 'Value',3,'Enable','on'); -0356 -0357 % polygon sides and corresponding angle beta -0358 set(gui.popup_handles.invjoint_polyN,'Enable','on',... -0359 'Value',data.invjoint.polyN-2); -0360 set(gui.edit_handles.invjoint_beta,'Enable','off'); -0361 -0362 % angles -0363 polyangle = ((data.invjoint.polyN-2)/data.invjoint.polyN)*180; -0364 set(gui.edit_handles.invjoint_alpha,... -0365 'String',''); -0366 set(gui.edit_handles.invjoint_beta,... -0367 'String',num2str(polyangle)); -0368 set(gui.edit_handles.invjoint_gamma,... -0369 'String',''); -0370 end +0344 case 'poly' +0345 % geometry popup +0346 set(gui.popup_handles.invjoint_geometry_type,... +0347 'Value',3,'Enable','on'); +0348 +0349 % polygon sides and corresponding angle beta +0350 set(gui.popup_handles.invjoint_polyN,'Enable','on',... +0351 'Value',data.invjoint.polyN-2); +0352 set(gui.edit_handles.invjoint_beta,'Enable','off'); +0353 +0354 % angles +0355 polyangle = ((data.invjoint.polyN-2)/data.invjoint.polyN)*180; +0356 set(gui.edit_handles.invjoint_alpha,... +0357 'String',''); +0358 set(gui.edit_handles.invjoint_beta,... +0359 'String',num2str(polyangle)); +0360 set(gui.edit_handles.invjoint_gamma,... +0361 'String',''); +0362 end +0363 +0364 case 'shape' +0365 % inversion method popup +0366 set(gui.popup_handles.invjoint_InvType,'Value',3,'Enable','on'); +0367 +0368 % PSD limits +0369 gui = updateInvjointRadii(gui,data.invjoint.invtype,... +0370 data.invjoint.radii,data.invjoint.Nradii); 0371 -0372 case 'shape' -0373 % inversion method popup -0374 set(gui.popup_handles.invjoint_InvType,'Value',3,'Enable','on'); -0375 -0376 % PSD limits -0377 gui = updateInvjointRadii(gui,data.invjoint.invtype,... -0378 data.invjoint.radii,data.invjoint.Nradii); -0379 -0380 % additional inversion settings -0381 set(gui.popup_handles.invjoint_InvTypeOpt,'Enable','off'); +0372 % additional inversion settings +0373 set(gui.popup_handles.invjoint_InvTypeOpt,'Enable','off'); +0374 +0375 % regularization options +0376 switch data.invjoint.regtype +0377 case 'manual' +0378 set(gui.popup_handles.invjoint_InvTypeOpt,'Value',1); +0379 case 'lcurve' +0380 set(gui.popup_handles.invjoint_InvTypeOpt,'Value',2); +0381 end 0382 -0383 % regularization options -0384 switch data.invjoint.regtype -0385 case 'manual' -0386 set(gui.popup_handles.invjoint_InvTypeOpt,'Value',1); -0387 case 'lcurve' -0388 set(gui.popup_handles.invjoint_InvTypeOpt,'Value',2); -0389 end -0390 -0391 % smoothness constraint and lambda -0392 gui = updateLorderJoint(gui,data.invjoint.invtype,... -0393 data.invjoint.Lorder); -0394 gui = updateLambdaJoint(gui,'none',data.invjoint.lambda,... -0395 data.invjoint.lambdaR,data.invjoint.NlambdaR,data.invstd.regtype); -0396 -0397 % start values -0398 set(gui.edit_handles.invjoint_rhostart,'Enable','on'); -0399 set(gui.edit_handles.invjoint_anglestart,'Enable','on'); -0400 -0401 % geometry type dependent -0402 switch data.invjoint.geometry_type -0403 case 'cyl' -0404 % geometry popup -0405 set(gui.popup_handles.invjoint_geometry_type,... -0406 'Value',1,'Enable','on'); -0407 -0408 % polygon sides and corresponding angle beta -0409 set(gui.popup_handles.invjoint_polyN,'Enable','off',... -0410 'Value',data.invjoint.polyN-2); -0411 set(gui.edit_handles.invjoint_beta,'Enable','off'); -0412 -0413 % angles -0414 set(gui.edit_handles.invjoint_alpha,'String',''); -0415 set(gui.edit_handles.invjoint_beta,'String',''); -0416 set(gui.edit_handles.invjoint_gamma,'String',''); -0417 -0418 case 'ang' -0419 % geometry popup -0420 set(gui.popup_handles.invjoint_geometry_type,... -0421 'Value',2,'Enable','on'); -0422 -0423 % polygon sides and corresponding angle beta -0424 set(gui.popup_handles.invjoint_polyN,'Enable','off',... -0425 'Value',data.invjoint.polyN-2); -0426 set(gui.edit_handles.invjoint_beta,'Enable','off'); +0383 % smoothness constraint and lambda +0384 gui = updateLorderJoint(gui,data.invjoint.invtype,... +0385 data.invjoint.Lorder); +0386 gui = updateLambdaJoint(gui,'none',data.invjoint.lambda,... +0387 data.invjoint.lambdaR,data.invjoint.NlambdaR,data.invstd.regtype); +0388 +0389 % start values +0390 set(gui.edit_handles.invjoint_rhostart,'Enable','on'); +0391 set(gui.edit_handles.invjoint_anglestart,'Enable','on'); +0392 +0393 % geometry type dependent +0394 switch data.invjoint.geometry_type +0395 case 'cyl' +0396 % geometry popup +0397 set(gui.popup_handles.invjoint_geometry_type,... +0398 'Value',1,'Enable','on'); +0399 +0400 % polygon sides and corresponding angle beta +0401 set(gui.popup_handles.invjoint_polyN,'Enable','off',... +0402 'Value',data.invjoint.polyN-2); +0403 set(gui.edit_handles.invjoint_beta,'Enable','off'); +0404 +0405 % angles +0406 set(gui.edit_handles.invjoint_alpha,'String',''); +0407 set(gui.edit_handles.invjoint_beta,'String',''); +0408 set(gui.edit_handles.invjoint_gamma,'String',''); +0409 +0410 case 'ang' +0411 % geometry popup +0412 set(gui.popup_handles.invjoint_geometry_type,... +0413 'Value',2,'Enable','on'); +0414 +0415 % polygon sides and corresponding angle beta +0416 set(gui.popup_handles.invjoint_polyN,'Enable','off',... +0417 'Value',data.invjoint.polyN-2); +0418 set(gui.edit_handles.invjoint_beta,'Enable','off'); +0419 +0420 % angles +0421 set(gui.edit_handles.invjoint_alpha,... +0422 'String',num2str(data.invjoint.alpha)); +0423 set(gui.edit_handles.invjoint_beta,... +0424 'String',num2str(data.invjoint.beta)); +0425 set(gui.edit_handles.invjoint_gamma,... +0426 'String',num2str(data.invjoint.gamma)); 0427 -0428 % angles -0429 set(gui.edit_handles.invjoint_alpha,... -0430 'String',num2str(data.invjoint.alpha)); -0431 set(gui.edit_handles.invjoint_beta,... -0432 'String',num2str(data.invjoint.beta)); -0433 set(gui.edit_handles.invjoint_gamma,... -0434 'String',num2str(data.invjoint.gamma)); -0435 -0436 case 'poly' -0437 % geometry popup -0438 set(gui.popup_handles.invjoint_geometry_type,... -0439 'Value',3,'Enable','on'); -0440 -0441 % polygon sides and corresponding angle beta -0442 set(gui.popup_handles.invjoint_polyN,'Enable','on',... -0443 'Value',data.invjoint.polyN-2); -0444 set(gui.edit_handles.invjoint_beta,'Enable','off'); -0445 -0446 % angles -0447 polyangle = ((data.invjoint.polyN-2)/data.invjoint.polyN)*180; -0448 set(gui.edit_handles.invjoint_alpha,... -0449 'String',''); -0450 set(gui.edit_handles.invjoint_beta,... -0451 'String',num2str(polyangle)); -0452 set(gui.edit_handles.invjoint_gamma,... -0453 'String',''); -0454 end -0455 end -0456 -0457 case 'off' -0458 % inversion method popup -0459 set(gui.popup_handles.invjoint_InvType,'Value',1,'Enable','off'); -0460 -0461 % PSD limits -0462 gui = updateInvjointRadii(gui,'off',0,0); +0428 case 'poly' +0429 % geometry popup +0430 set(gui.popup_handles.invjoint_geometry_type,... +0431 'Value',3,'Enable','on'); +0432 +0433 % polygon sides and corresponding angle beta +0434 set(gui.popup_handles.invjoint_polyN,'Enable','on',... +0435 'Value',data.invjoint.polyN-2); +0436 set(gui.edit_handles.invjoint_beta,'Enable','off'); +0437 +0438 % angles +0439 polyangle = ((data.invjoint.polyN-2)/data.invjoint.polyN)*180; +0440 set(gui.edit_handles.invjoint_alpha,... +0441 'String',''); +0442 set(gui.edit_handles.invjoint_beta,... +0443 'String',num2str(polyangle)); +0444 set(gui.edit_handles.invjoint_gamma,... +0445 'String',''); +0446 end +0447 end +0448 +0449 case 'off' +0450 % inversion method popup +0451 set(gui.popup_handles.invjoint_InvType,'Value',1,'Enable','off'); +0452 +0453 % PSD limits +0454 gui = updateInvjointRadii(gui,'off',0,0); +0455 +0456 % additional inversion settings +0457 set(gui.popup_handles.invjoint_InvTypeOpt,'Enable','off'); +0458 +0459 % smoothness constraint and lambda +0460 gui = updateLorderJoint(gui,'off',0); +0461 gui = updateLambdaJoint(gui,'none',data.invjoint.lambda,... +0462 data.invjoint.lambdaR,data.invjoint.NlambdaR,data.invstd.regtype); 0463 -0464 % additional inversion settings -0465 set(gui.popup_handles.invjoint_InvTypeOpt,'Enable','off'); -0466 -0467 % smoothness constraint and lambda -0468 gui = updateLorderJoint(gui,'off',0); -0469 gui = updateLambdaJoint(gui,'none',data.invjoint.lambda,... -0470 data.invjoint.lambdaR,data.invjoint.NlambdaR,data.invstd.regtype); -0471 -0472 % polygon sides and angles -0473 set(gui.popup_handles.invjoint_polyN,'Enable','off'); -0474 set(gui.edit_handles.invjoint_alpha,'Enable','off'); -0475 set(gui.edit_handles.invjoint_beta,'Enable','off'); -0476 set(gui.edit_handles.invjoint_gamma,'Enable','off'); -0477 -0478 % start values -0479 set(gui.edit_handles.invjoint_rhostart,'Enable','off'); -0480 set(gui.edit_handles.invjoint_anglestart,'Enable','off'); -0481 end -0482 -0483 % this is always updated -0484 switch data.pressure.unit -0485 case 'Pa' -0486 set(gui.popup_handles.invjoint_pressure_units,'Value',1); -0487 case 'kPa' -0488 set(gui.popup_handles.invjoint_pressure_units,'Value',2); -0489 case 'MPa' -0490 set(gui.popup_handles.invjoint_pressure_units,'Value',3); -0491 case 'bar' -0492 set(gui.popup_handles.invjoint_pressure_units,'Value',4); -0493 end -0494 set(gui.table_handles.invjoint_table,... -0495 'ColumnName',{'use',['p [',data.pressure.unit,']'],'S [-]','D / I'}) -0496 -0497 table = data.pressure.table; -0498 for i = 1:size(table,1) -0499 table{i,2} = table{i,2}.*data.pressure.unitfac; -0500 end -0501 set(gui.table_handles.invjoint_table,'Data',table); -0502 -0503 case 'off' -0504 %% update the processing panel -0505 set(gui.edit_handles.process_start,'Enable','on',... -0506 'String',num2str(data.process.start)); -0507 set(gui.edit_handles.process_end,'Enable','on',... -0508 'String',num2str(data.process.end)); -0509 set(gui.edit_handles.process_Nechoes,'Enable','on',... -0510 'String',num2str(data.process.Nechoes)); -0511 -0512 gui = updateGatetype(gui,data.process.gatetype); -0513 set(gui.radio_handles.process_normalize_on,'Enable','off','Value',0); -0514 set(gui.radio_handles.process_normalize_off,'Enable','off','Value',1); -0515 set(gui.radio_handles.process_timescale_s,'Enable','off','Value',1); -0516 set(gui.radio_handles.process_timescale_ms,'Enable','off','Value',0); -0517 -0518 if data.invstd.porosity <= 1 -0519 set(gui.edit_handles.invstd_porosity,'Enable','on',... -0520 'BackgroundColor','w',... -0521 'String',num2str(data.invstd.porosity)); -0522 else -0523 set(gui.edit_handles.invstd_porosity,'Enable','on',... -0524 'BackgroundColor','r',... -0525 'String',num2str(data.invstd.porosity)); -0526 end -0527 -0528 %% update standard inversion panel -0529 % inversion method popup -0530 switch data.info.optim -0531 case 'on' -0532 istring = {'Mono exp.','Several free exp. (2-5)',... -0533 'Multi exp. (LSQLIN)'}; -0534 case 'off' -0535 istring = {'Mono exp.','Several free exp. (2-5)',... -0536 'Multi exp. (NNLS)'}; -0537 end -0538 set(gui.popup_handles.invstd_InvType,'String',istring); -0539 switch data.invstd.invtype -0540 case 'mono' -0541 % inversion method popup -0542 set(gui.popup_handles.invstd_InvType,'Value',1,'Enable','on'); +0464 % polygon sides and angles +0465 set(gui.popup_handles.invjoint_polyN,'Enable','off'); +0466 set(gui.edit_handles.invjoint_alpha,'Enable','off'); +0467 set(gui.edit_handles.invjoint_beta,'Enable','off'); +0468 set(gui.edit_handles.invjoint_gamma,'Enable','off'); +0469 +0470 % start values +0471 set(gui.edit_handles.invjoint_rhostart,'Enable','off'); +0472 set(gui.edit_handles.invjoint_anglestart,'Enable','off'); +0473 end +0474 +0475 % this is always updated +0476 switch data.pressure.unit +0477 case 'Pa' +0478 set(gui.popup_handles.invjoint_pressure_units,'Value',1); +0479 case 'kPa' +0480 set(gui.popup_handles.invjoint_pressure_units,'Value',2); +0481 case 'MPa' +0482 set(gui.popup_handles.invjoint_pressure_units,'Value',3); +0483 case 'bar' +0484 set(gui.popup_handles.invjoint_pressure_units,'Value',4); +0485 end +0486 set(gui.table_handles.invjoint_table,... +0487 'ColumnName',{'use',['p [',data.pressure.unit,']'],'S [-]','D / I'}) +0488 +0489 table = data.pressure.table; +0490 for i = 1:size(table,1) +0491 table{i,2} = table{i,2}.*data.pressure.unitfac; +0492 end +0493 set(gui.table_handles.invjoint_table,'Data',table); +0494 +0495 case 'off' +0496 %% update the processing panel +0497 set(gui.edit_handles.process_start,'Enable','on',... +0498 'String',num2str(data.process.start)); +0499 set(gui.edit_handles.process_end,'Enable','on',... +0500 'String',num2str(data.process.end)); +0501 set(gui.edit_handles.process_Nechoes,'Enable','on',... +0502 'String',num2str(data.process.Nechoes)); +0503 +0504 gui = updateGatetype(gui,data.process.gatetype); +0505 set(gui.radio_handles.process_normalize_on,'Enable','off','Value',0); +0506 set(gui.radio_handles.process_normalize_off,'Enable','off','Value',1); +0507 set(gui.radio_handles.process_timescale_s,'Enable','off','Value',1); +0508 set(gui.radio_handles.process_timescale_ms,'Enable','off','Value',0); +0509 +0510 if data.invstd.porosity <= 1 +0511 set(gui.edit_handles.invstd_porosity,'Enable','on',... +0512 'BackgroundColor','w',... +0513 'String',num2str(data.invstd.porosity)); +0514 else +0515 set(gui.edit_handles.invstd_porosity,'Enable','on',... +0516 'BackgroundColor','r',... +0517 'String',num2str(data.invstd.porosity)); +0518 end +0519 +0520 %% update standard inversion panel +0521 % inversion method popup +0522 istring = {'Mono exp.','Several free exp. (2-5)','Multi exp. (LSQ)'}; +0523 set(gui.popup_handles.invstd_InvType,'String',istring); +0524 switch data.invstd.invtype +0525 case 'mono' +0526 % inversion method popup +0527 set(gui.popup_handles.invstd_InvType,'Value',1,'Enable','on'); +0528 +0529 % additional inversion settings +0530 set(gui.popup_handles.invstd_InvTypeOpt,'Enable','off',... +0531 'Value',1,'String','none'); +0532 set(gui.text_handles.invstd_InvTypeOpt,... +0533 'String','No extra options'); +0534 +0535 % lambda, smoothness constraint and RTD limits +0536 gui = updateLambda(gui,data.invstd.regtype,0,0,0); +0537 gui = updateLorder(gui,data.invstd.invtype,data.invstd.Lorder); +0538 gui = updateInvstdTime(gui,data.invstd.invtype,0,0); +0539 +0540 % Tbulk +0541 set(gui.edit_handles.invstd_Tbulk,'Enable','off',... +0542 'String',num2str(data.invstd.Tbulk)); 0543 -0544 % additional inversion settings -0545 set(gui.popup_handles.invstd_InvTypeOpt,'Enable','off',... -0546 'Value',1,'String','none'); -0547 set(gui.text_handles.invstd_InvTypeOpt,... -0548 'String','No extra options'); -0549 -0550 % lambda, smoothness constraint and RTD limits -0551 gui = updateLambda(gui,data.invstd.regtype,0,0,0); -0552 gui = updateLorder(gui,data.invstd.invtype,data.invstd.Lorder); -0553 gui = updateInvstdTime(gui,data.invstd.invtype,0,0); +0544 case 'free' +0545 % inversion method popup +0546 set(gui.popup_handles.invstd_InvType,'Value',2,'Enable','on'); +0547 +0548 % additional inversion settings +0549 set(gui.popup_handles.invstd_InvTypeOpt,'Enable','on',... +0550 'Value',data.invstd.freeDT,... +0551 'String',{'1','2','3','4','5'}); +0552 set(gui.text_handles.invstd_InvTypeOpt,... +0553 'String','No. of free decay times T'); 0554 -0555 % Tbulk -0556 set(gui.edit_handles.invstd_Tbulk,'Enable','off',... -0557 'String',num2str(data.invstd.Tbulk)); -0558 -0559 case 'free' -0560 % inversion method popup -0561 set(gui.popup_handles.invstd_InvType,'Value',2,'Enable','on'); -0562 -0563 % additional inversion settings -0564 set(gui.popup_handles.invstd_InvTypeOpt,'Enable','on',... -0565 'Value',data.invstd.freeDT,... -0566 'String',{'1','2','3','4','5'}); -0567 set(gui.text_handles.invstd_InvTypeOpt,... -0568 'String','No. of free decay times T'); -0569 -0570 % lambda, smoothness constraint and RTD limits -0571 gui = updateLambda(gui,data.invstd.regtype,0,0,0); -0572 gui = updateLorder(gui,data.invstd.invtype,data.invstd.Lorder); -0573 gui = updateInvstdTime(gui,data.invstd.invtype,0,0); -0574 -0575 % Tbulk -0576 set(gui.edit_handles.invstd_Tbulk,'Enable','off',... -0577 'String',num2str(data.invstd.Tbulk)); -0578 -0579 case 'NNLS' -0580 % inversion method popup -0581 set(gui.popup_handles.invstd_InvType,'Value',3,'Enable','on'); -0582 -0583 % additional inversion settings -0584 set(gui.popup_handles.invstd_InvTypeOpt,'Enable','on',... -0585 'String',{'Manual','Iterative Chi2','L-curve'}); -0586 set(gui.text_handles.invstd_InvTypeOpt,... -0587 'String','regularization options'); -0588 -0589 % regularization options -0590 switch data.invstd.regtype -0591 case 'manual' -0592 set(gui.popup_handles.invstd_InvTypeOpt,'Value',1); -0593 case 'iterchi2' -0594 set(gui.popup_handles.invstd_InvTypeOpt,'Value',2); -0595 case 'lcurve' -0596 set(gui.popup_handles.invstd_InvTypeOpt,'Value',3); -0597 end +0555 % lambda, smoothness constraint and RTD limits +0556 gui = updateLambda(gui,data.invstd.regtype,0,0,0); +0557 gui = updateLorder(gui,data.invstd.invtype,data.invstd.Lorder); +0558 gui = updateInvstdTime(gui,data.invstd.invtype,0,0); +0559 +0560 % Tbulk +0561 set(gui.edit_handles.invstd_Tbulk,'Enable','off',... +0562 'String',num2str(data.invstd.Tbulk)); +0563 +0564 case 'NNLS' +0565 % inversion method popup +0566 set(gui.popup_handles.invstd_InvType,'Value',3,'Enable','on'); +0567 +0568 % additional inversion settings +0569 set(gui.popup_handles.invstd_InvTypeOpt,'Enable','on',... +0570 'String',{'Manual','Iterative Chi2','L-curve'}); +0571 set(gui.text_handles.invstd_InvTypeOpt,... +0572 'String','regularization options'); +0573 +0574 % regularization options +0575 switch data.invstd.regtype +0576 case 'manual' +0577 set(gui.popup_handles.invstd_InvTypeOpt,'Value',1); +0578 case 'iterchi2' +0579 set(gui.popup_handles.invstd_InvTypeOpt,'Value',2); +0580 case 'lcurve' +0581 set(gui.popup_handles.invstd_InvTypeOpt,'Value',3); +0582 end +0583 +0584 % lambda, smoothness constraint and RTD limits +0585 gui = updateLambda(gui,data.invstd.regtype,data.invstd.lambda,... +0586 data.invstd.lambdaR,data.invstd.NlambdaR); +0587 data.invstd.Lorder = 1; +0588 set(gui.radio_handles.invstd_Lorder0,'Value',0,'Enable','off'); +0589 set(gui.radio_handles.invstd_Lorder1,'Value',1,'Enable','off'); +0590 set(gui.radio_handles.invstd_Lorder2,'Value',0,'Enable','off'); +0591 +0592 set(gui.edit_handles.invstd_time_min,'Enable','on',... +0593 'String',num2str(data.invstd.time(1))); +0594 set(gui.edit_handles.invstd_time_max,'Enable','on',... +0595 'String',num2str(data.invstd.time(2))); +0596 set(gui.edit_handles.invstd_Ntime,'Enable','off',... +0597 'String',num2str(data.invstd.Ntime)); 0598 -0599 % lambda, smoothness constraint and RTD limits -0600 gui = updateLambda(gui,data.invstd.regtype,data.invstd.lambda,... -0601 data.invstd.lambdaR,data.invstd.NlambdaR); -0602 data.invstd.Lorder = 1; -0603 set(gui.radio_handles.invstd_Lorder0,'Value',0,'Enable','off'); -0604 set(gui.radio_handles.invstd_Lorder1,'Value',1,'Enable','off'); -0605 set(gui.radio_handles.invstd_Lorder2,'Value',0,'Enable','off'); -0606 -0607 set(gui.edit_handles.invstd_time_min,'Enable','on',... -0608 'String',num2str(data.invstd.time(1))); -0609 set(gui.edit_handles.invstd_time_max,'Enable','on',... -0610 'String',num2str(data.invstd.time(2))); -0611 set(gui.edit_handles.invstd_Ntime,'Enable','off',... -0612 'String',num2str(data.invstd.Ntime)); -0613 -0614 % Tbulk -0615 set(gui.edit_handles.invstd_Tbulk,'Enable','on',... -0616 'String',num2str(data.invstd.Tbulk)); -0617 end -0618 -0619 %% update petro parameter panel -0620 data.param.CBWcutoff = 3; -0621 data.param.BVIcutoff = 33; -0622 data.param.rho = 10; -0623 data.param.a = 2; -0624 setappdata(fig,'data',data); -0625 set(gui.edit_handles.param_CBW,'Enable','off',... -0626 'String',num2str(data.param.CBWcutoff)); -0627 set(gui.edit_handles.param_BVI,'Enable','off',... -0628 'String',num2str(data.param.BVIcutoff)); -0629 set(gui.edit_handles.param_rho,'Enable','off',... -0630 'String',num2str(data.param.rho)); -0631 set(gui.edit_handles.param_geom,'Enable','off',... -0632 'String',num2str(data.param.a)); -0633 set(gui.edit_handles.param_calibVol,'Enable','on',... -0634 'String',num2str(data.param.calibVol)); -0635 set(gui.edit_handles.param_calibAmp,'Enable','on',... -0636 'String',num2str(data.param.calibAmp)); -0637 set(gui.edit_handles.param_sampVol,'Enable','on',... -0638 'String',num2str(data.param.sampVol)); -0639 end -0640 -0641 % Matlab needs some time -0642 pause(0.001); -0643 -0644 end -0645 -0646 %% sub functions -0647 function gui = updateGatetype(gui,gatetype) -0648 -0649 set(gui.radio_handles.process_gates_log,'Enable','on'); -0650 set(gui.radio_handles.process_gates_lin,'Enable','on'); -0651 set(gui.radio_handles.process_gates_none,'Enable','on'); -0652 -0653 switch gatetype -0654 -0655 case 'log' -0656 -0657 set(gui.radio_handles.process_gates_log,'Value',1); -0658 set(gui.radio_handles.process_gates_lin,'Value',0); -0659 set(gui.radio_handles.process_gates_none,'Value',0); -0660 set(gui.edit_handles.process_Nechoes,'Enable','on'); -0661 -0662 case 'lin' -0663 -0664 set(gui.radio_handles.process_gates_log,'Value',0); -0665 set(gui.radio_handles.process_gates_lin,'Value',1); -0666 set(gui.radio_handles.process_gates_none,'Value',0); -0667 set(gui.edit_handles.process_Nechoes,'Enable','on'); -0668 -0669 case 'raw' -0670 -0671 set(gui.radio_handles.process_gates_log,'Value',0); -0672 set(gui.radio_handles.process_gates_lin,'Value',0); -0673 set(gui.radio_handles.process_gates_none,'Value',1); -0674 set(gui.edit_handles.process_Nechoes,'Enable','off'); -0675 -0676 end -0677 -0678 end -0679 -0680 function gui = updateNormalize(gui,norm) -0681 -0682 switch norm -0683 case 0 -0684 set(gui.radio_handles.process_normalize_on,'Enable','on','Value',0); -0685 set(gui.radio_handles.process_normalize_off,'Enable','on','Value',1); -0686 -0687 case 1 -0688 set(gui.radio_handles.process_normalize_on,'Enable','on','Value',1); -0689 set(gui.radio_handles.process_normalize_off,'Enable','on','Value',0); -0690 end -0691 -0692 end -0693 -0694 function gui = updateTimescale(gui,timescale) -0695 -0696 switch timescale -0697 -0698 case 's' -0699 set(gui.radio_handles.process_timescale_s,'Enable','on','Value',1); -0700 set(gui.radio_handles.process_timescale_ms,'Enable','on','Value',0); -0701 set(gui.text_handles.invstd_RTDtimes,'String','RTD - min [s] | max [s] | # / dec',... -0702 'FontSize',10); -0703 set(gui.text_handles.petro_Tbulk,'String',... -0704 ['Tbulk [s] | ',char(hex2dec('03C1')),' [µm/s] | geom']); -0705 -0706 case 'ms' -0707 set(gui.radio_handles.process_timescale_s,'Enable','on','Value',0); -0708 set(gui.radio_handles.process_timescale_ms,'Enable','on','Value',1); -0709 set(gui.text_handles.invstd_RTDtimes,'String','RTD - min [ms] | max [ms] | # / dec',... -0710 'FontSize',9); -0711 set(gui.text_handles.petro_Tbulk,'String',... -0712 ['Tbulk [ms] | ',char(hex2dec('03C1')),' [µm/s] | geom']); -0713 end -0714 +0599 % Tbulk +0600 set(gui.edit_handles.invstd_Tbulk,'Enable','on',... +0601 'String',num2str(data.invstd.Tbulk)); +0602 end +0603 +0604 %% update petro parameter panel +0605 data.param.CBWcutoff = 3; +0606 data.param.BVIcutoff = 33; +0607 data.param.rho = 10; +0608 data.param.a = 2; +0609 setappdata(fig,'data',data); +0610 set(gui.edit_handles.param_CBW,'Enable','off',... +0611 'String',num2str(data.param.CBWcutoff)); +0612 set(gui.edit_handles.param_BVI,'Enable','off',... +0613 'String',num2str(data.param.BVIcutoff)); +0614 set(gui.edit_handles.param_rho,'Enable','off',... +0615 'String',num2str(data.param.rho)); +0616 set(gui.edit_handles.param_geom,'Enable','off',... +0617 'String',num2str(data.param.a)); +0618 set(gui.edit_handles.param_calibVol,'Enable','on',... +0619 'String',num2str(data.param.calibVol)); +0620 set(gui.edit_handles.param_calibAmp,'Enable','on',... +0621 'String',num2str(data.param.calibAmp)); +0622 set(gui.edit_handles.param_sampVol,'Enable','on',... +0623 'String',num2str(data.param.sampVol)); +0624 end +0625 +0626 % Matlab needs some time +0627 pause(0.001); +0628 +0629 end +0630 +0631 %% sub functions +0632 function gui = updateGatetype(gui,gatetype) +0633 +0634 set(gui.radio_handles.process_gates_log,'Enable','on'); +0635 set(gui.radio_handles.process_gates_lin,'Enable','on'); +0636 set(gui.radio_handles.process_gates_none,'Enable','on'); +0637 +0638 switch gatetype +0639 +0640 case 'log' +0641 +0642 set(gui.radio_handles.process_gates_log,'Value',1); +0643 set(gui.radio_handles.process_gates_lin,'Value',0); +0644 set(gui.radio_handles.process_gates_none,'Value',0); +0645 set(gui.edit_handles.process_Nechoes,'Enable','on'); +0646 +0647 case 'lin' +0648 +0649 set(gui.radio_handles.process_gates_log,'Value',0); +0650 set(gui.radio_handles.process_gates_lin,'Value',1); +0651 set(gui.radio_handles.process_gates_none,'Value',0); +0652 set(gui.edit_handles.process_Nechoes,'Enable','on'); +0653 +0654 case 'raw' +0655 +0656 set(gui.radio_handles.process_gates_log,'Value',0); +0657 set(gui.radio_handles.process_gates_lin,'Value',0); +0658 set(gui.radio_handles.process_gates_none,'Value',1); +0659 set(gui.edit_handles.process_Nechoes,'Enable','off'); +0660 +0661 end +0662 +0663 end +0664 +0665 function gui = updateNormalize(gui,norm) +0666 +0667 switch norm +0668 case 0 +0669 set(gui.radio_handles.process_normalize_on,'Enable','on','Value',0); +0670 set(gui.radio_handles.process_normalize_off,'Enable','on','Value',1); +0671 +0672 case 1 +0673 set(gui.radio_handles.process_normalize_on,'Enable','on','Value',1); +0674 set(gui.radio_handles.process_normalize_off,'Enable','on','Value',0); +0675 end +0676 +0677 end +0678 +0679 function gui = updateTimescale(gui,timescale) +0680 +0681 switch timescale +0682 +0683 case 's' +0684 set(gui.radio_handles.process_timescale_s,'Enable','on','Value',1); +0685 set(gui.radio_handles.process_timescale_ms,'Enable','on','Value',0); +0686 set(gui.text_handles.invstd_RTDtimes,'String','RTD - min [s] | max [s] | # / dec',... +0687 'FontSize',10); +0688 set(gui.text_handles.petro_Tbulk,'String',... +0689 ['Tbulk [s] | ',char(hex2dec('03C1')),' [µm/s] | geom']); +0690 +0691 case 'ms' +0692 set(gui.radio_handles.process_timescale_s,'Enable','on','Value',0); +0693 set(gui.radio_handles.process_timescale_ms,'Enable','on','Value',1); +0694 set(gui.text_handles.invstd_RTDtimes,'String','RTD - min [ms] | max [ms] | # / dec',... +0695 'FontSize',9); +0696 set(gui.text_handles.petro_Tbulk,'String',... +0697 ['Tbulk [ms] | ',char(hex2dec('03C1')),' [µm/s] | geom']); +0698 end +0699 +0700 end +0701 +0702 function gui = updateInvstdTime(gui,invtype,time,Ntime) +0703 +0704 switch invtype +0705 +0706 case {'mono','free'} +0707 set(gui.edit_handles.invstd_time_min,'Enable','off'); +0708 set(gui.edit_handles.invstd_time_max,'Enable','off'); +0709 set(gui.edit_handles.invstd_Ntime,'Enable','off'); +0710 +0711 case {'ILA','NNLS'} +0712 set(gui.edit_handles.invstd_time_min,'Enable','on','String',num2str(time(1))); +0713 set(gui.edit_handles.invstd_time_max,'Enable','on','String',num2str(time(2))); +0714 set(gui.edit_handles.invstd_Ntime,'Enable','on','String',num2str(Ntime)); 0715 end 0716 -0717 function gui = updateInvstdTime(gui,invtype,time,Ntime) +0717 end 0718 -0719 switch invtype -0720 -0721 case {'mono','free'} -0722 set(gui.edit_handles.invstd_time_min,'Enable','off'); -0723 set(gui.edit_handles.invstd_time_max,'Enable','off'); -0724 set(gui.edit_handles.invstd_Ntime,'Enable','off'); -0725 -0726 case {'ILA','NNLS'} -0727 set(gui.edit_handles.invstd_time_min,'Enable','on','String',num2str(time(1))); -0728 set(gui.edit_handles.invstd_time_max,'Enable','on','String',num2str(time(2))); -0729 set(gui.edit_handles.invstd_Ntime,'Enable','on','String',num2str(Ntime)); -0730 end -0731 -0732 end -0733 -0734 function gui = updateInvjointRadii(gui,invtype,radii,Nradii) -0735 -0736 switch invtype -0737 case {'fixed','shape','off'} -0738 set(gui.edit_handles.invjoint_radii_min,'Enable','off'); -0739 set(gui.edit_handles.invjoint_radii_max,'Enable','off'); -0740 set(gui.edit_handles.invjoint_Nradii,'Enable','off'); -0741 -0742 case {'free'} -0743 set(gui.edit_handles.invjoint_radii_min,'Enable','on','String',num2str(radii(1))); -0744 set(gui.edit_handles.invjoint_radii_max,'Enable','on','String',num2str(radii(2))); -0745 set(gui.edit_handles.invjoint_Nradii,'Enable','on','String',num2str(Nradii)); -0746 end -0747 -0748 end -0749 -0750 function gui = updateLambda(gui,regtype,lambda,lambdaR,NlambdaR) -0751 -0752 switch regtype -0753 case 'none' -0754 set(gui.edit_handles.invstd_lambda_min,'Enable','off'); -0755 set(gui.edit_handles.invstd_lambda_max,'Enable','off'); -0756 set(gui.edit_handles.invstd_NlambdaR,'Enable','off'); -0757 gui.plots.DistPanel.TabTitles = {'RTD','PSD','PSD (joint)'}; -0758 -0759 case 'manual' -0760 set(gui.edit_handles.invstd_lambda_min,'Enable','on','String',num2str(lambda)); -0761 set(gui.edit_handles.invstd_lambda_max,'Enable','off'); -0762 set(gui.edit_handles.invstd_NlambdaR,'Enable','off'); -0763 gui.plots.DistPanel.TabTitles = {'RTD','PSD','PSD (joint)'}; -0764 -0765 case 'auto' -0766 set(gui.edit_handles.invstd_lambda_min,'Enable','off','String',num2str(lambda)); -0767 set(gui.edit_handles.invstd_lambda_max,'Enable','off'); -0768 set(gui.edit_handles.invstd_NlambdaR,'Enable','off'); -0769 gui.plots.DistPanel.TabTitles = {'RTD','PSD','PSD (joint)'}; -0770 -0771 case 'lcurve' -0772 set(gui.edit_handles.invstd_lambda_min,'Enable','on','String',num2str(lambdaR(1))); -0773 set(gui.edit_handles.invstd_lambda_max,'Enable','on','String',num2str(lambdaR(2))); -0774 set(gui.edit_handles.invstd_NlambdaR,'Enable','on','String',num2str(NlambdaR)); -0775 gui.plots.DistPanel.TabTitles = {'L-CURVE','RMS','PSD (joint)'}; -0776 -0777 case 'iterchi2' -0778 set(gui.edit_handles.invstd_lambda_min,'Enable','on','String',num2str(lambdaR(1))); -0779 set(gui.edit_handles.invstd_lambda_max,'Enable','on','String',num2str(lambdaR(2))); -0780 set(gui.edit_handles.invstd_NlambdaR,'Enable','off','String',num2str(NlambdaR)); -0781 gui.plots.DistPanel.TabTitles = {'CHI2','RMS','PSD (joint)'}; -0782 -0783 case {'gcv_tikh','gcv_trunc','gcv_damp','discrep'} -0784 set(gui.edit_handles.invstd_lambda_min,'Enable','off','String',num2str(lambda)); -0785 set(gui.edit_handles.invstd_lambda_max,'Enable','off'); -0786 set(gui.edit_handles.invstd_NlambdaR,'Enable','off'); -0787 gui.plots.DistPanel.TabTitles = {'RTD','PSD','PSD (joint)'}; -0788 end -0789 -0790 end -0791 -0792 function gui = updateLambdaJoint(gui,regtype,lambda,lambdaR,NlambdaR,regtypestd) -0793 -0794 switch regtype -0795 case 'none' -0796 switch regtypestd -0797 case 'lcurve' -0798 set(gui.edit_handles.invjoint_lambda_min,'Enable','off'); -0799 set(gui.edit_handles.invjoint_lambda_max,'Enable','off'); -0800 set(gui.edit_handles.invjoint_NlambdaR,'Enable','off'); -0801 gui.plots.DistPanel.TabTitles = {'L-CURVE','RMS','PSD (joint)'}; -0802 -0803 case 'iterchi2' -0804 set(gui.edit_handles.invjoint_lambda_min,'Enable','off'); +0719 function gui = updateInvjointRadii(gui,invtype,radii,Nradii) +0720 +0721 switch invtype +0722 case {'fixed','shape','off'} +0723 set(gui.edit_handles.invjoint_radii_min,'Enable','off'); +0724 set(gui.edit_handles.invjoint_radii_max,'Enable','off'); +0725 set(gui.edit_handles.invjoint_Nradii,'Enable','off'); +0726 +0727 case {'free'} +0728 set(gui.edit_handles.invjoint_radii_min,'Enable','on','String',num2str(radii(1))); +0729 set(gui.edit_handles.invjoint_radii_max,'Enable','on','String',num2str(radii(2))); +0730 set(gui.edit_handles.invjoint_Nradii,'Enable','on','String',num2str(Nradii)); +0731 end +0732 +0733 end +0734 +0735 function gui = updateLambda(gui,regtype,lambda,lambdaR,NlambdaR) +0736 +0737 switch regtype +0738 case 'none' +0739 set(gui.edit_handles.invstd_lambda_min,'Enable','off'); +0740 set(gui.edit_handles.invstd_lambda_max,'Enable','off'); +0741 set(gui.edit_handles.invstd_NlambdaR,'Enable','off'); +0742 gui.plots.DistPanel.TabTitles = {'RTD','PSD','PSD (joint)'}; +0743 +0744 case 'manual' +0745 set(gui.edit_handles.invstd_lambda_min,'Enable','on','String',num2str(lambda)); +0746 set(gui.edit_handles.invstd_lambda_max,'Enable','off'); +0747 set(gui.edit_handles.invstd_NlambdaR,'Enable','off'); +0748 gui.plots.DistPanel.TabTitles = {'RTD','PSD','PSD (joint)'}; +0749 +0750 case 'auto' +0751 set(gui.edit_handles.invstd_lambda_min,'Enable','off','String',num2str(lambda)); +0752 set(gui.edit_handles.invstd_lambda_max,'Enable','off'); +0753 set(gui.edit_handles.invstd_NlambdaR,'Enable','off'); +0754 gui.plots.DistPanel.TabTitles = {'RTD','PSD','PSD (joint)'}; +0755 +0756 case 'lcurve' +0757 set(gui.edit_handles.invstd_lambda_min,'Enable','on','String',num2str(lambdaR(1))); +0758 set(gui.edit_handles.invstd_lambda_max,'Enable','on','String',num2str(lambdaR(2))); +0759 set(gui.edit_handles.invstd_NlambdaR,'Enable','on','String',num2str(NlambdaR)); +0760 gui.plots.DistPanel.TabTitles = {'L-CURVE','RMS','PSD (joint)'}; +0761 +0762 case 'iterchi2' +0763 set(gui.edit_handles.invstd_lambda_min,'Enable','on','String',num2str(lambdaR(1))); +0764 set(gui.edit_handles.invstd_lambda_max,'Enable','on','String',num2str(lambdaR(2))); +0765 set(gui.edit_handles.invstd_NlambdaR,'Enable','off','String',num2str(NlambdaR)); +0766 gui.plots.DistPanel.TabTitles = {'CHI2','RMS','PSD (joint)'}; +0767 +0768 case {'gcv_tikh','gcv_trunc','gcv_damp','discrep'} +0769 set(gui.edit_handles.invstd_lambda_min,'Enable','off','String',num2str(lambda)); +0770 set(gui.edit_handles.invstd_lambda_max,'Enable','off'); +0771 set(gui.edit_handles.invstd_NlambdaR,'Enable','off'); +0772 gui.plots.DistPanel.TabTitles = {'RTD','PSD','PSD (joint)'}; +0773 end +0774 +0775 end +0776 +0777 function gui = updateLambdaJoint(gui,regtype,lambda,lambdaR,NlambdaR,regtypestd) +0778 +0779 switch regtype +0780 case 'none' +0781 switch regtypestd +0782 case 'lcurve' +0783 set(gui.edit_handles.invjoint_lambda_min,'Enable','off'); +0784 set(gui.edit_handles.invjoint_lambda_max,'Enable','off'); +0785 set(gui.edit_handles.invjoint_NlambdaR,'Enable','off'); +0786 gui.plots.DistPanel.TabTitles = {'L-CURVE','RMS','PSD (joint)'}; +0787 +0788 case 'iterchi2' +0789 set(gui.edit_handles.invjoint_lambda_min,'Enable','off'); +0790 set(gui.edit_handles.invjoint_lambda_max,'Enable','off'); +0791 set(gui.edit_handles.invjoint_NlambdaR,'Enable','off'); +0792 gui.plots.DistPanel.TabTitles = {'CHI2','RMS','PSD (joint)'}; +0793 +0794 otherwise +0795 set(gui.edit_handles.invjoint_lambda_min,'Enable','off'); +0796 set(gui.edit_handles.invjoint_lambda_max,'Enable','off'); +0797 set(gui.edit_handles.invjoint_NlambdaR,'Enable','off'); +0798 gui.plots.DistPanel.TabTitles = {'RTD','PSD','PSD (joint)'}; +0799 end +0800 +0801 case 'manual' +0802 switch regtypestd +0803 case 'lcurve' +0804 set(gui.edit_handles.invjoint_lambda_min,'Enable','on','String',num2str(lambda)); 0805 set(gui.edit_handles.invjoint_lambda_max,'Enable','off'); 0806 set(gui.edit_handles.invjoint_NlambdaR,'Enable','off'); -0807 gui.plots.DistPanel.TabTitles = {'CHI2','RMS','PSD (joint)'}; +0807 gui.plots.DistPanel.TabTitles = {'L-CURVE','RMS','PSD (joint)'}; 0808 0809 otherwise -0810 set(gui.edit_handles.invjoint_lambda_min,'Enable','off'); +0810 set(gui.edit_handles.invjoint_lambda_min,'Enable','on','String',num2str(lambda)); 0811 set(gui.edit_handles.invjoint_lambda_max,'Enable','off'); 0812 set(gui.edit_handles.invjoint_NlambdaR,'Enable','off'); 0813 gui.plots.DistPanel.TabTitles = {'RTD','PSD','PSD (joint)'}; 0814 end 0815 -0816 case 'manual' -0817 switch regtypestd -0818 case 'lcurve' -0819 set(gui.edit_handles.invjoint_lambda_min,'Enable','on','String',num2str(lambda)); -0820 set(gui.edit_handles.invjoint_lambda_max,'Enable','off'); -0821 set(gui.edit_handles.invjoint_NlambdaR,'Enable','off'); -0822 gui.plots.DistPanel.TabTitles = {'L-CURVE','RMS','PSD (joint)'}; -0823 -0824 otherwise -0825 set(gui.edit_handles.invjoint_lambda_min,'Enable','on','String',num2str(lambda)); -0826 set(gui.edit_handles.invjoint_lambda_max,'Enable','off'); -0827 set(gui.edit_handles.invjoint_NlambdaR,'Enable','off'); -0828 gui.plots.DistPanel.TabTitles = {'RTD','PSD','PSD (joint)'}; -0829 end -0830 -0831 case 'lcurve' -0832 set(gui.edit_handles.invjoint_lambda_min,'Enable','on','String',num2str(lambdaR(1))); -0833 set(gui.edit_handles.invjoint_lambda_max,'Enable','on','String',num2str(lambdaR(2))); -0834 set(gui.edit_handles.invjoint_NlambdaR,'Enable','on','String',num2str(NlambdaR)); -0835 gui.plots.DistPanel.TabTitles = {'L-CURVE','RMS','PSD (joint)'}; -0836 end -0837 -0838 end -0839 -0840 function gui = updateLorder(gui,invtype,Lorder) -0841 -0842 switch invtype -0843 case {'mono','free'} -0844 set(gui.radio_handles.invstd_Lorder0,'Enable','off'); -0845 set(gui.radio_handles.invstd_Lorder1,'Enable','off'); -0846 set(gui.radio_handles.invstd_Lorder2,'Enable','off'); -0847 -0848 case {'ILA','NNLS'} -0849 set(gui.radio_handles.invstd_Lorder0,'Enable','on'); -0850 set(gui.radio_handles.invstd_Lorder1,'Enable','on'); -0851 set(gui.radio_handles.invstd_Lorder2,'Enable','on'); -0852 -0853 switch Lorder -0854 case 0 -0855 set(gui.radio_handles.invstd_Lorder0,'Value',1); -0856 set(gui.radio_handles.invstd_Lorder1,'Value',0); -0857 set(gui.radio_handles.invstd_Lorder2,'Value',0); -0858 -0859 case 1 -0860 set(gui.radio_handles.invstd_Lorder0,'Value',0); -0861 set(gui.radio_handles.invstd_Lorder1,'Value',1); -0862 set(gui.radio_handles.invstd_Lorder2,'Value',0); -0863 -0864 case 2 -0865 set(gui.radio_handles.invstd_Lorder0,'Value',0); -0866 set(gui.radio_handles.invstd_Lorder1,'Value',0); -0867 set(gui.radio_handles.invstd_Lorder2,'Value',1); -0868 end -0869 end -0870 -0871 end -0872 -0873 function gui = updateLorderJoint(gui,invtype,Lorder) -0874 -0875 switch invtype -0876 case {'fixed','shape','off'} -0877 set(gui.radio_handles.invjoint_Lorder0,'Enable','off'); -0878 set(gui.radio_handles.invjoint_Lorder1,'Enable','off'); -0879 set(gui.radio_handles.invjoint_Lorder2,'Enable','off'); -0880 -0881 case 'free' -0882 set(gui.radio_handles.invjoint_Lorder0,'Enable','on'); -0883 set(gui.radio_handles.invjoint_Lorder1,'Enable','on'); -0884 set(gui.radio_handles.invjoint_Lorder2,'Enable','on'); -0885 -0886 switch Lorder -0887 case 0 -0888 set(gui.radio_handles.invjoint_Lorder0,'Value',1); -0889 set(gui.radio_handles.invjoint_Lorder1,'Value',0); -0890 set(gui.radio_handles.invjoint_Lorder2,'Value',0); -0891 -0892 case 1 -0893 set(gui.radio_handles.invjoint_Lorder0,'Value',0); -0894 set(gui.radio_handles.invjoint_Lorder1,'Value',1); -0895 set(gui.radio_handles.invjoint_Lorder2,'Value',0); -0896 -0897 case 2 -0898 set(gui.radio_handles.invjoint_Lorder0,'Value',0); -0899 set(gui.radio_handles.invjoint_Lorder1,'Value',0); -0900 set(gui.radio_handles.invjoint_Lorder2,'Value',1); -0901 end -0902 end -0903 -0904 end -0905 -0906 function gui = updateParams(gui,invtype,p) -0907 -0908 switch invtype -0909 case {'mono','free'} -0910 set(gui.edit_handles.param_CBW,'Enable','off','String',num2str(p.CBWcutoff)); -0911 set(gui.edit_handles.param_BVI,'Enable','off','String',num2str(p.BVIcutoff)); -0912 set(gui.edit_handles.param_rho,'Enable','on','String',num2str(p.rho)); -0913 set(gui.edit_handles.param_geom,'Enable','on','String',num2str(p.a)); -0914 -0915 case {'ILA','NNLS'} -0916 set(gui.edit_handles.param_CBW,'Enable','on','String',num2str(p.CBWcutoff)); -0917 set(gui.edit_handles.param_BVI,'Enable','on','String',num2str(p.BVIcutoff)); -0918 set(gui.edit_handles.param_rho,'Enable','on','String',num2str(p.rho)); -0919 set(gui.edit_handles.param_geom,'Enable','on','String',num2str(p.a)); -0920 -0921 end -0922 set(gui.edit_handles.param_calibVol,'Enable','on','String',num2str(p.calibVol)); -0923 set(gui.edit_handles.param_calibAmp,'Enable','on','String',num2str(p.calibAmp)); -0924 set(gui.edit_handles.param_sampVol,'Enable','on','String',num2str(p.sampVol)); -0925 -0926 end -0927 -0928 %------------- END OF CODE -------------- -0929 -0930 %% License: -0931 % MIT License -0932 % -0933 % Copyright (c) 2018 Thomas Hiller -0934 % -0935 % Permission is hereby granted, free of charge, to any person obtaining a copy -0936 % of this software and associated documentation files (the "Software"), to deal -0937 % in the Software without restriction, including without limitation the rights -0938 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -0939 % copies of the Software, and to permit persons to whom the Software is -0940 % furnished to do so, subject to the following conditions: -0941 % -0942 % The above copyright notice and this permission notice shall be included in all -0943 % copies or substantial portions of the Software. -0944 % -0945 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -0946 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -0947 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -0948 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -0949 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -0950 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -0951 % SOFTWARE. +0816 case 'lcurve' +0817 set(gui.edit_handles.invjoint_lambda_min,'Enable','on','String',num2str(lambdaR(1))); +0818 set(gui.edit_handles.invjoint_lambda_max,'Enable','on','String',num2str(lambdaR(2))); +0819 set(gui.edit_handles.invjoint_NlambdaR,'Enable','on','String',num2str(NlambdaR)); +0820 gui.plots.DistPanel.TabTitles = {'L-CURVE','RMS','PSD (joint)'}; +0821 end +0822 +0823 end +0824 +0825 function gui = updateLorder(gui,invtype,Lorder) +0826 +0827 switch invtype +0828 case {'mono','free'} +0829 set(gui.radio_handles.invstd_Lorder0,'Enable','off'); +0830 set(gui.radio_handles.invstd_Lorder1,'Enable','off'); +0831 set(gui.radio_handles.invstd_Lorder2,'Enable','off'); +0832 +0833 case {'ILA','NNLS'} +0834 set(gui.radio_handles.invstd_Lorder0,'Enable','on'); +0835 set(gui.radio_handles.invstd_Lorder1,'Enable','on'); +0836 set(gui.radio_handles.invstd_Lorder2,'Enable','on'); +0837 +0838 switch Lorder +0839 case 0 +0840 set(gui.radio_handles.invstd_Lorder0,'Value',1); +0841 set(gui.radio_handles.invstd_Lorder1,'Value',0); +0842 set(gui.radio_handles.invstd_Lorder2,'Value',0); +0843 +0844 case 1 +0845 set(gui.radio_handles.invstd_Lorder0,'Value',0); +0846 set(gui.radio_handles.invstd_Lorder1,'Value',1); +0847 set(gui.radio_handles.invstd_Lorder2,'Value',0); +0848 +0849 case 2 +0850 set(gui.radio_handles.invstd_Lorder0,'Value',0); +0851 set(gui.radio_handles.invstd_Lorder1,'Value',0); +0852 set(gui.radio_handles.invstd_Lorder2,'Value',1); +0853 end +0854 end +0855 +0856 end +0857 +0858 function gui = updateLorderJoint(gui,invtype,Lorder) +0859 +0860 switch invtype +0861 case {'fixed','shape','off'} +0862 set(gui.radio_handles.invjoint_Lorder0,'Enable','off'); +0863 set(gui.radio_handles.invjoint_Lorder1,'Enable','off'); +0864 set(gui.radio_handles.invjoint_Lorder2,'Enable','off'); +0865 +0866 case 'free' +0867 set(gui.radio_handles.invjoint_Lorder0,'Enable','on'); +0868 set(gui.radio_handles.invjoint_Lorder1,'Enable','on'); +0869 set(gui.radio_handles.invjoint_Lorder2,'Enable','on'); +0870 +0871 switch Lorder +0872 case 0 +0873 set(gui.radio_handles.invjoint_Lorder0,'Value',1); +0874 set(gui.radio_handles.invjoint_Lorder1,'Value',0); +0875 set(gui.radio_handles.invjoint_Lorder2,'Value',0); +0876 +0877 case 1 +0878 set(gui.radio_handles.invjoint_Lorder0,'Value',0); +0879 set(gui.radio_handles.invjoint_Lorder1,'Value',1); +0880 set(gui.radio_handles.invjoint_Lorder2,'Value',0); +0881 +0882 case 2 +0883 set(gui.radio_handles.invjoint_Lorder0,'Value',0); +0884 set(gui.radio_handles.invjoint_Lorder1,'Value',0); +0885 set(gui.radio_handles.invjoint_Lorder2,'Value',1); +0886 end +0887 end +0888 +0889 end +0890 +0891 function gui = updateParams(gui,invtype,p) +0892 +0893 switch invtype +0894 case {'mono','free'} +0895 set(gui.edit_handles.param_CBW,'Enable','off','String',num2str(p.CBWcutoff)); +0896 set(gui.edit_handles.param_BVI,'Enable','off','String',num2str(p.BVIcutoff)); +0897 set(gui.edit_handles.param_rho,'Enable','on','String',num2str(p.rho)); +0898 set(gui.edit_handles.param_geom,'Enable','on','String',num2str(p.a)); +0899 +0900 case {'ILA','NNLS'} +0901 set(gui.edit_handles.param_CBW,'Enable','on','String',num2str(p.CBWcutoff)); +0902 set(gui.edit_handles.param_BVI,'Enable','on','String',num2str(p.BVIcutoff)); +0903 set(gui.edit_handles.param_rho,'Enable','on','String',num2str(p.rho)); +0904 set(gui.edit_handles.param_geom,'Enable','on','String',num2str(p.a)); +0905 +0906 end +0907 set(gui.edit_handles.param_calibVol,'Enable','on','String',num2str(p.calibVol)); +0908 set(gui.edit_handles.param_calibAmp,'Enable','on','String',num2str(p.calibAmp)); +0909 set(gui.edit_handles.param_sampVol,'Enable','on','String',num2str(p.sampVol)); +0910 +0911 end +0912 +0913 %------------- END OF CODE -------------- +0914 +0915 %% License: +0916 % MIT License +0917 % +0918 % Copyright (c) 2018 Thomas Hiller +0919 % +0920 % Permission is hereby granted, free of charge, to any person obtaining a copy +0921 % of this software and associated documentation files (the "Software"), to deal +0922 % in the Software without restriction, including without limitation the rights +0923 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0924 % copies of the Software, and to permit persons to whom the Software is +0925 % furnished to do so, subject to the following conditions: +0926 % +0927 % The above copyright notice and this permission notice shall be included in all +0928 % copies or substantial portions of the Software. +0929 % +0930 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0931 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0932 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0933 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0934 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0935 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0936 % SOFTWARE.
    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/NUCLEUSmod/NUCLEUSmod.html b/doc/nucleus/NUCLEUSmod/NUCLEUSmod.html index b1ebba5..3538f7a 100644 --- a/doc/nucleus/NUCLEUSmod/NUCLEUSmod.html +++ b/doc/nucleus/NUCLEUSmod/NUCLEUSmod.html @@ -117,8 +117,8 @@

    SOURCE CODE ^if ~isempty(h0); close(h0); end 0042 0043 %% GUI 'header' info and defaults -0044 myui.version = '0.1.7'; -0045 myui.date = '27.06.2019'; +0044 myui.version = '0.1.8'; +0045 myui.date = '08.07.2019'; 0046 myui.author = 'Thomas Hiller'; 0047 myui.email = 'thomas.hiller[at]leibniz-liag.de'; 0048 myui.fontsize = 10; diff --git a/doc/nucleus/NUCLEUSmod/NUCLEUSmod_createGUI.html b/doc/nucleus/NUCLEUSmod/NUCLEUSmod_createGUI.html index bcf1296..d9e8b85 100644 --- a/doc/nucleus/NUCLEUSmod/NUCLEUSmod_createGUI.html +++ b/doc/nucleus/NUCLEUSmod/NUCLEUSmod_createGUI.html @@ -42,13 +42,16 @@

    DESCRIPTION ^DESCRIPTION ^CROSS-REFERENCE INFORMATION ^

    This function calls: +
  • NUCLEUSmod_createMenus creates all GUI menus
  • NUCLEUSmod_createPanelCPS creates pressure panel
  • NUCLEUSmod_createPanelGeometry creates geometry panel
  • NUCLEUSmod_createPanelNMR creates NMR panel
  • NUCLEUSmod_createPanelPlots creates graphics panel
  • displayStatusText clears all axes of a given figure
  • fixAxes fixes an ugly Matlab bug when resizing a box-panel which holds an
  • minimizePanel handles the minimization/maximization of all box-panels for
  • This function is called by:
    • NUCLEUSmod is a graphical user interface (GUI) to forward model NMR
    @@ -87,145 +90,149 @@

    SOURCE CODE ^% NUCLEUSmod_createGUI(gcf,1) 0016 % 0017 % Other m-files required: -0018 % NUCLEUSmod_createMenus.m -0019 % NUCLEUSmod_createPanelGeometry.m -0020 % NUCLEUSmod_createPanelCPS.m -0021 % NUCLEUSmod_createPanelNMR.m -0022 % NUCLEUSmod_createPanelPlots.m -0023 % Subfunctions: -0024 % none -0025 % MAT-files required: +0018 % fixAxes.m +0019 % NUCLEUSmod_createMenus.m +0020 % NUCLEUSmod_createPanelGeometry.m +0021 % NUCLEUSmod_createPanelCPS.m +0022 % NUCLEUSmod_createPanelNMR.m +0023 % NUCLEUSmod_createPanelPlots.m +0024 % +0025 % Subfunctions: 0026 % none 0027 % -0028 % See also: NUCLEUSmod -0029 % Author: Thomas Hiller -0030 % email: thomas.hiller[at]leibniz-liag.de -0031 % License: MIT License (at end) -0032 -0033 %------------- BEGIN CODE -------------- -0034 -0035 %% get figure data -0036 gui = getappdata(h,'gui'); -0037 data = getappdata(h,'data'); -0038 myui = gui.myui; -0039 -0040 %% init wait-bar -0041 if wbon -0042 hwb = waitbar(0,'loading ...','Name','NUCLEUSmod initialization','Visible','off'); -0043 steps = 5; -0044 if ~isempty(h) -0045 posf = get(h,'Position'); -0046 set(hwb,'Units','Pixel') -0047 posw = get(hwb,'Position'); -0048 set(hwb,'Position',[posf(1)+posf(3)/2-posw(3)/2 posf(2)+posf(4)/2-posw(4)/2 posw(3:4)]); -0049 end -0050 set(hwb,'Visible','on'); -0051 end -0052 -0053 %% uimenus -0054 if wbon -0055 waitbar(1/steps,hwb,'loading GUI elements - menus'); -0056 end -0057 gui = NUCLEUSmod_createMenus(gui); -0058 -0059 %% MAIN GUI "BOX" -0060 % make everything invisible during creation -0061 gui.main = uix.HBox('Parent',gui.figh,'Visible','off'); -0062 % gui.main = uix.HBox('Parent',gui.figh); -0063 -0064 % all control panels are on the left inside a vertically scrollable panel -0065 gui.left = uix.ScrollingPanel('Parent',gui.main); -0066 % all graphics are on the right inside a vertical box -0067 gui.right = uix.VBox('Parent',gui.main,'Spacing',3); -0068 % fix size of the settings side to 400 pixel -0069 set(gui.main,'Widths',[400 -1]); -0070 -0071 %% A. settings column -0072 gui.panels.main = uix.VBox('Parent',gui.left); -0073 gui.panels.geometry.main = uix.BoxPanel('Parent',gui.panels.main,'Title','Geometry',... -0074 'TitleColor',myui.colors.GEO,'ForegroundColor',myui.colors.BoxTitle,'MinimizeFcn',@minimizePanel); -0075 gui.panels.cps.main = uix.BoxPanel('Parent',gui.panels.main,'Title','Pressure / Saturation',... -0076 'TitleColor',myui.colors.CPS,'ForegroundColor',myui.colors.BoxTitle,'MinimizeFcn',@minimizePanel); -0077 gui.panels.nmr.main = uix.BoxPanel('Parent',gui.panels.main,'Title','NMR',... -0078 'TitleColor',myui.colors.NMR,'ForegroundColor',myui.colors.BoxTitle,'MinimizeFcn',@minimizePanel); -0079 gui.panels.status.main = uix.Panel('Parent',gui.panels.main); -0080 gui.textStatus = uicontrol('Style','Text','Parent',gui.panels.status.main,'String','',... -0081 'HorizontalAlignment','left','FontSize',8); -0082 -0083 % adjust the heights of all left-column-panels -0084 myui.heights = [22 22 22 20; 249 -1 139 20]; -0085 % panel header is always 22 high -0086 set(gui.panels.main,'Heights',myui.heights(2,:)); -0087 set(gui.left,'Heights',-1,'MinimumHeights',700); -0088 -0089 % 1. geometry panel -0090 if wbon -0091 waitbar(2/steps,hwb,'loading GUI elements - geometry'); -0092 end -0093 [gui,myui] = NUCLEUSmod_createPanelGeometry(data,gui,myui); -0094 -0095 % 2. CPS panel -0096 if wbon -0097 waitbar(3/steps,hwb,'loading GUI elements - pressure'); -0098 end -0099 [gui,myui] = NUCLEUSmod_createPanelCPS(data,gui,myui); -0100 -0101 % 3. NMR panel -0102 if wbon -0103 waitbar(4/steps,hwb,'loading GUI elements - NMR'); -0104 end -0105 [gui,myui] = NUCLEUSmod_createPanelNMR(data,gui,myui); -0106 -0107 -0108 %% B. graphics column -0109 if wbon -0110 waitbar(5/steps,hwb,'loading GUI elements - graphics'); -0111 end -0112 [gui,myui] = NUCLEUSmod_createPanelPlots(gui,myui); -0113 -0114 % delete wait-bar -0115 if wbon -0116 delete(hwb); -0117 end -0118 -0119 %% finalize -0120 % make the main GUI visible again; "gui" needs to be saved because -0121 % otherwise "fixAxes" throws an error -0122 setappdata(h,'gui',gui); -0123 set(gui.main,'Visible','on'); -0124 -0125 % update the GUI data -0126 gui.myui = myui; -0127 setappdata(h,'gui',gui); -0128 setappdata(h,'data',data); -0129 displayStatusText(gui,'NUCLEUSmod successfully started'); -0130 -0131 end -0132 -0133 %------------- END OF CODE -------------- +0028 % MAT-files required: +0029 % none +0030 % +0031 % See also: NUCLEUSmod +0032 % Author: Thomas Hiller +0033 % email: thomas.hiller[at]leibniz-liag.de +0034 % License: MIT License (at end) +0035 +0036 %------------- BEGIN CODE -------------- +0037 +0038 %% get figure data +0039 gui = getappdata(h,'gui'); +0040 data = getappdata(h,'data'); +0041 myui = gui.myui; +0042 +0043 %% init wait-bar +0044 if wbon +0045 hwb = waitbar(0,'loading ...','Name','NUCLEUSmod initialization','Visible','off'); +0046 steps = 5; +0047 if ~isempty(h) +0048 posf = get(h,'Position'); +0049 set(hwb,'Units','Pixel') +0050 posw = get(hwb,'Position'); +0051 set(hwb,'Position',[posf(1)+posf(3)/2-posw(3)/2 posf(2)+posf(4)/2-posw(4)/2 posw(3:4)]); +0052 end +0053 set(hwb,'Visible','on'); +0054 end +0055 +0056 %% uimenus +0057 if wbon +0058 waitbar(1/steps,hwb,'loading GUI elements - menus'); +0059 end +0060 gui = NUCLEUSmod_createMenus(gui); +0061 +0062 %% MAIN GUI "BOX" +0063 % make everything invisible during creation +0064 gui.main = uix.HBox('Parent',gui.figh,'Visible','off'); +0065 % gui.main = uix.HBox('Parent',gui.figh); +0066 +0067 % all control panels are on the left inside a vertically scrollable panel +0068 gui.left = uix.ScrollingPanel('Parent',gui.main); +0069 % all graphics are on the right inside a vertical box +0070 gui.right = uix.VBox('Parent',gui.main,'Spacing',3); +0071 % fix size of the settings side to 400 pixel +0072 set(gui.main,'Widths',[400 -1]); +0073 +0074 %% A. settings column +0075 gui.panels.main = uix.VBox('Parent',gui.left); +0076 gui.panels.geometry.main = uix.BoxPanel('Parent',gui.panels.main,'Title','Geometry',... +0077 'TitleColor',myui.colors.GEO,'ForegroundColor',myui.colors.BoxTitle,'MinimizeFcn',@minimizePanel); +0078 gui.panels.cps.main = uix.BoxPanel('Parent',gui.panels.main,'Title','Pressure / Saturation',... +0079 'TitleColor',myui.colors.CPS,'ForegroundColor',myui.colors.BoxTitle,'MinimizeFcn',@minimizePanel); +0080 gui.panels.nmr.main = uix.BoxPanel('Parent',gui.panels.main,'Title','NMR',... +0081 'TitleColor',myui.colors.NMR,'ForegroundColor',myui.colors.BoxTitle,'MinimizeFcn',@minimizePanel); +0082 gui.panels.status.main = uix.Panel('Parent',gui.panels.main); +0083 gui.textStatus = uicontrol('Style','Text','Parent',gui.panels.status.main,'String','',... +0084 'HorizontalAlignment','left','FontSize',8); +0085 +0086 % adjust the heights of all left-column-panels +0087 myui.heights = [22 22 22 20; 249 -1 139 20]; +0088 % panel header is always 22 high +0089 set(gui.panels.main,'Heights',myui.heights(2,:)); +0090 set(gui.left,'Heights',-1,'MinimumHeights',700); +0091 +0092 % 1. geometry panel +0093 if wbon +0094 waitbar(2/steps,hwb,'loading GUI elements - geometry'); +0095 end +0096 [gui,myui] = NUCLEUSmod_createPanelGeometry(data,gui,myui); +0097 +0098 % 2. CPS panel +0099 if wbon +0100 waitbar(3/steps,hwb,'loading GUI elements - pressure'); +0101 end +0102 [gui,myui] = NUCLEUSmod_createPanelCPS(data,gui,myui); +0103 +0104 % 3. NMR panel +0105 if wbon +0106 waitbar(4/steps,hwb,'loading GUI elements - NMR'); +0107 end +0108 [gui,myui] = NUCLEUSmod_createPanelNMR(data,gui,myui); +0109 +0110 +0111 %% B. graphics column +0112 if wbon +0113 waitbar(5/steps,hwb,'loading GUI elements - graphics'); +0114 end +0115 [gui,myui] = NUCLEUSmod_createPanelPlots(gui,myui); +0116 +0117 % delete wait-bar +0118 if wbon +0119 delete(hwb); +0120 end +0121 +0122 %% finalize +0123 % make the main GUI visible again; "gui" needs to be saved because +0124 % otherwise "fixAxes" throws an error +0125 setappdata(h,'gui',gui); +0126 set(gui.main,'Visible','on'); +0127 +0128 % update the GUI data +0129 gui.myui = myui; +0130 setappdata(h,'gui',gui); +0131 setappdata(h,'data',data); +0132 displayStatusText(gui,'NUCLEUSmod successfully started'); +0133 fixAxes(gui.plots.cps.box); 0134 -0135 %% License: -0136 % MIT License -0137 % -0138 % Copyright (c) 2018 Thomas Hiller -0139 % -0140 % Permission is hereby granted, free of charge, to any person obtaining a copy -0141 % of this software and associated documentation files (the "Software"), to deal -0142 % in the Software without restriction, including without limitation the rights -0143 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -0144 % copies of the Software, and to permit persons to whom the Software is -0145 % furnished to do so, subject to the following conditions: -0146 % -0147 % The above copyright notice and this permission notice shall be included in all -0148 % copies or substantial portions of the Software. -0149 % -0150 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -0151 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -0152 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -0153 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -0154 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -0155 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -0156 % SOFTWARE. +0135 end +0136 +0137 %------------- END OF CODE -------------- +0138 +0139 %% License: +0140 % MIT License +0141 % +0142 % Copyright (c) 2018 Thomas Hiller +0143 % +0144 % Permission is hereby granted, free of charge, to any person obtaining a copy +0145 % of this software and associated documentation files (the "Software"), to deal +0146 % in the Software without restriction, including without limitation the rights +0147 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0148 % copies of the Software, and to permit persons to whom the Software is +0149 % furnished to do so, subject to the following conditions: +0150 % +0151 % The above copyright notice and this permission notice shall be included in all +0152 % copies or substantial portions of the Software. +0153 % +0154 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0155 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0156 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0157 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0158 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0159 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0160 % SOFTWARE.
    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/NUCLEUSmod/NUCLEUSmod_createMenus.html b/doc/nucleus/NUCLEUSmod/NUCLEUSmod_createMenus.html index e8c1afa..42d6009 100644 --- a/doc/nucleus/NUCLEUSmod/NUCLEUSmod_createMenus.html +++ b/doc/nucleus/NUCLEUSmod/NUCLEUSmod_createMenus.html @@ -186,41 +186,44 @@

    SOURCE CODE ^% 2.1.2.3 dark color theme 0118 gui.menu.extra_settings_theme_dark = uimenu(gui.menu.extra_settings_theme,... 0119 'Label','dark','Callback',@onMenuExtraColor); -0120 -0121 %% 3. Help -0122 gui.menu.help = uimenu(gui.figh,... -0123 'Label','Help'); -0124 -0125 % 3.1 About -0126 gui.menu.help_about = uimenu(gui.menu.help,... -0127 'Label','About','Callback',@onMenuHelp); -0128 -0129 return -0130 -0131 %------------- END OF CODE -------------- -0132 -0133 %% License: -0134 % MIT License -0135 % -0136 % Copyright (c) 2018 Thomas Hiller -0137 % -0138 % Permission is hereby granted, free of charge, to any person obtaining a copy -0139 % of this software and associated documentation files (the "Software"), to deal -0140 % in the Software without restriction, including without limitation the rights -0141 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -0142 % copies of the Software, and to permit persons to whom the Software is -0143 % furnished to do so, subject to the following conditions: -0144 % -0145 % The above copyright notice and this permission notice shall be included in all -0146 % copies or substantial portions of the Software. +0120 % 2.1.2.4 black color theme +0121 gui.menu.extra_settings_theme_black = uimenu(gui.menu.extra_settings_theme,... +0122 'Label','black','Callback',@onMenuExtraColor); +0123 +0124 %% 3. Help +0125 gui.menu.help = uimenu(gui.figh,... +0126 'Label','Help'); +0127 +0128 % 3.1 About +0129 gui.menu.help_about = uimenu(gui.menu.help,... +0130 'Label','About','Callback',@onMenuHelp); +0131 +0132 return +0133 +0134 %------------- END OF CODE -------------- +0135 +0136 %% License: +0137 % MIT License +0138 % +0139 % Copyright (c) 2018 Thomas Hiller +0140 % +0141 % Permission is hereby granted, free of charge, to any person obtaining a copy +0142 % of this software and associated documentation files (the "Software"), to deal +0143 % in the Software without restriction, including without limitation the rights +0144 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0145 % copies of the Software, and to permit persons to whom the Software is +0146 % furnished to do so, subject to the following conditions: 0147 % -0148 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -0149 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -0150 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -0151 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -0152 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -0153 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -0154 % SOFTWARE. +0148 % The above copyright notice and this permission notice shall be included in all +0149 % copies or substantial portions of the Software. +0150 % +0151 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0152 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0153 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0154 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0155 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0156 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0157 % SOFTWARE.
    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/NUCLEUSmod/NUCLEUSmod_createPanelPlots.html b/doc/nucleus/NUCLEUSmod/NUCLEUSmod_createPanelPlots.html index 3938e3e..e4bf449 100644 --- a/doc/nucleus/NUCLEUSmod/NUCLEUSmod_createPanelPlots.html +++ b/doc/nucleus/NUCLEUSmod/NUCLEUSmod_createPanelPlots.html @@ -103,15 +103,15 @@

    SOURCE CODE ^%% create the individual BoxPanels 0034 gui.plots.GeoPanel = uix.BoxPanel('Parent',gui.right,... 0035 'Title','Pore Size Distribution','TitleColor',myui.colors.GEO,... -0036 'ForegroundColor',myui.colors.BoxTitle,'Padding',3,... +0036 'ForegroundColor',myui.colors.BoxTitle,'Padding',0,... 0037 'MinimizeFcn',@minimizePanel); 0038 gui.plots.CPSPanel = uix.BoxPanel('Parent',gui.right,... 0039 'Title','Capillary Pressure Saturation Curve','TitleColor',myui.colors.CPS,...... -0040 'ForegroundColor',myui.colors.BoxTitle,'Padding',3,... +0040 'ForegroundColor',myui.colors.BoxTitle,'Padding',0,... 0041 'MinimizeFcn',@minimizePanel); 0042 gui.plots.NMRPanel = uix.BoxPanel('Parent',gui.right,... 0043 'Title','NMR Signals','TitleColor',myui.colors.NMR,... -0044 'ForegroundColor',myui.colors.BoxTitle,'Padding',3,... +0044 'ForegroundColor',myui.colors.BoxTitle,'Padding',0,... 0045 'MinimizeFcn',@minimizePanel); 0046 0047 % adjust heights diff --git a/doc/nucleus/NUCLEUSmod/NUCLEUSmod_loadDefaults.html b/doc/nucleus/NUCLEUSmod/NUCLEUSmod_loadDefaults.html index 989674c..167b3d3 100644 --- a/doc/nucleus/NUCLEUSmod/NUCLEUSmod_loadDefaults.html +++ b/doc/nucleus/NUCLEUSmod/NUCLEUSmod_loadDefaults.html @@ -155,33 +155,32 @@

    SOURCE CODE ^% use linear y-axes as default (log=1, lin=2) 0089 out.nmr.logliny = 2; 0090 -0091 -0092 return -0093 -0094 %------------- END OF CODE -------------- -0095 -0096 %% License: -0097 % MIT License -0098 % -0099 % Copyright (c) 2018 Thomas Hiller -0100 % -0101 % Permission is hereby granted, free of charge, to any person obtaining a copy -0102 % of this software and associated documentation files (the "Software"), to deal -0103 % in the Software without restriction, including without limitation the rights -0104 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -0105 % copies of the Software, and to permit persons to whom the Software is -0106 % furnished to do so, subject to the following conditions: -0107 % -0108 % The above copyright notice and this permission notice shall be included in all -0109 % copies or substantial portions of the Software. -0110 % -0111 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -0112 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -0113 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -0114 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -0115 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -0116 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -0117 % SOFTWARE. +0091 return +0092 +0093 %------------- END OF CODE -------------- +0094 +0095 %% License: +0096 % MIT License +0097 % +0098 % Copyright (c) 2018 Thomas Hiller +0099 % +0100 % Permission is hereby granted, free of charge, to any person obtaining a copy +0101 % of this software and associated documentation files (the "Software"), to deal +0102 % in the Software without restriction, including without limitation the rights +0103 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0104 % copies of the Software, and to permit persons to whom the Software is +0105 % furnished to do so, subject to the following conditions: +0106 % +0107 % The above copyright notice and this permission notice shall be included in all +0108 % copies or substantial portions of the Software. +0109 % +0110 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0111 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0112 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0113 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0114 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0115 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0116 % SOFTWARE.
    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/callbacks/menus/menu.html b/doc/nucleus/callbacks/menus/menu.html index 00d85e3..c3dd169 100644 --- a/doc/nucleus/callbacks/menus/menu.html +++ b/doc/nucleus/callbacks/menus/menu.html @@ -18,7 +18,7 @@

    Index for nucleus\callbacks\menus

    Matlab files in this directory:

    +
  • onMenuExpert
  • onMenuExportData
  • onMenuExportGraphics
  • onMenuExtraColor
  • onMenuExtraGraphics
  • onMenuExtraRhoBounds
  • onMenuExtraShow
  • onMenuHelp
  • onMenuImport
  • onMenuJointInversion
  • onMenuRestartQuit
  • onMenuSolver
  • diff --git a/doc/nucleus/callbacks/menus/onMenuExpert.html b/doc/nucleus/callbacks/menus/onMenuExpert.html index a2ff7e5..eae25e4 100644 --- a/doc/nucleus/callbacks/menus/onMenuExpert.html +++ b/doc/nucleus/callbacks/menus/onMenuExpert.html @@ -66,10 +66,10 @@

    DESCRIPTION ^CROSS-REFERENCE INFORMATION ^

    This function calls: +
  • NUCLEUSinv_updateInterface updates all GUI elements
  • onMenuJointInversion handles the call from the menu that activates / deactivates
  • onMenuSolver handles the call from the menu that allows to choose the LSQ
  • makeINIfile creates or updates the ini-File
  • onFigureSizeChange fixes an ugly Matlab bug when resizing a box-panel
  • updateStatusInformation updates all fields inside the bottom status bar
  • updateToolTips updates tool tip entries dependent on the chosen settings
  • This function is called by: +
  • NUCLEUSinv_createMenus creates all GUI menus
  • enableGUIelements activates all necessary GUI elements after successful
  • importINV2INV imports a previously saved NUCLEUSinv session
  • @@ -134,74 +134,93 @@

    SOURCE CODE ^'data',data); 0058 setappdata(fig,'gui',gui); 0059 -0060 % deactivate joint inversion panels -0061 onMenuJointInversion(gui.menu.extra_joint_off); +0060 % deactivate solver menu and set to default +0061 onMenuSolver(gui.menu.extra_solver_lsqnonneg); 0062 % get changed GUI data 0063 data = getappdata(fig,'data'); -0064 INVdata = getappdata(fig,'INVdata'); -0065 % default std inversion settings -0066 data.invstd.invtype = 'NNLS'; -0067 data.invstd.regtype = 'manual'; -0068 data.invstd.lambda = 1; -0069 % deactivate joint inversion menu -0070 set(gui.menu.extra_joint,'Enable','off'); -0071 -0072 set(gui.menu.extra_graphics_amp,'Enable','off'); -0073 set(gui.menu.extra_graphics_amp2,'Enable','off'); -0074 set(gui.menu.extra_graphics_rtd,'Enable','off'); -0075 -0076 case 'On' -0077 data.info.ExpertMode = 'on'; -0078 % menu entry -0079 set(gui.menu.extra_expert_on,'Checked','on'); -0080 set(gui.menu.extra_expert_off,'Checked','off'); +0064 set(gui.menu.extra_solver,'Enable','off'); +0065 +0066 % update GUI data +0067 setappdata(fig,'data',data); +0068 setappdata(fig,'gui',gui); +0069 +0070 % deactivate joint inversion panels +0071 onMenuJointInversion(gui.menu.extra_joint_off); +0072 % get changed GUI data +0073 data = getappdata(fig,'data'); +0074 INVdata = getappdata(fig,'INVdata'); +0075 % default std inversion settings +0076 data.invstd.invtype = 'NNLS'; +0077 data.invstd.regtype = 'manual'; +0078 data.invstd.lambda = 1; +0079 % deactivate joint inversion menu +0080 set(gui.menu.extra_joint,'Enable','off'); 0081 -0082 % activate joint inversion menu -0083 set(gui.menu.extra_joint,'Enable','on'); -0084 -0085 set(gui.menu.extra_graphics_amp,'Enable','on'); -0086 set(gui.menu.extra_graphics_amp2,'Enable','on'); -0087 set(gui.menu.extra_graphics_rtd,'Enable','on'); -0088 end -0089 -0090 % update GUI data -0091 setappdata(fig,'data',data); -0092 setappdata(fig,'gui',gui); -0093 % update ini-file -0094 gui.myui.inidata.expertmode = data.info.ExpertMode; -0095 gui = makeINIfile(gui,'update'); -0096 % update interface -0097 NUCLEUSinv_updateInterface; -0098 % update status information -0099 updateStatusInformation; -0100 onFigureSizeChange(fig); -0101 -0102 end -0103 -0104 %------------- END OF CODE -------------- -0105 -0106 %% License: -0107 % MIT License -0108 % -0109 % Copyright (c) 2018 Thomas Hiller -0110 % -0111 % Permission is hereby granted, free of charge, to any person obtaining a copy -0112 % of this software and associated documentation files (the "Software"), to deal -0113 % in the Software without restriction, including without limitation the rights -0114 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -0115 % copies of the Software, and to permit persons to whom the Software is -0116 % furnished to do so, subject to the following conditions: -0117 % -0118 % The above copyright notice and this permission notice shall be included in all -0119 % copies or substantial portions of the Software. -0120 % -0121 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -0122 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -0123 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -0124 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -0125 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -0126 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -0127 % SOFTWARE. +0082 set(gui.menu.extra_graphics_amp,'Enable','off'); +0083 set(gui.menu.extra_graphics_amp2,'Enable','off'); +0084 set(gui.menu.extra_graphics_rtd,'Enable','off'); +0085 +0086 case 'On' +0087 data.info.ExpertMode = 'on'; +0088 % menu entry +0089 set(gui.menu.extra_expert_on,'Checked','on'); +0090 set(gui.menu.extra_expert_off,'Checked','off'); +0091 +0092 % activate solver menu if optimization toolbox is available +0093 switch data.info.has_optim +0094 case 'on' +0095 set(gui.menu.extra_solver,'Enable','on'); +0096 case 'off' +0097 set(gui.menu.extra_solver,'Enable','off'); +0098 end +0099 +0100 % activate joint inversion menu +0101 set(gui.menu.extra_joint,'Enable','on'); +0102 +0103 set(gui.menu.extra_graphics_amp,'Enable','on'); +0104 set(gui.menu.extra_graphics_amp2,'Enable','on'); +0105 set(gui.menu.extra_graphics_rtd,'Enable','on'); +0106 end +0107 +0108 % update GUI data +0109 setappdata(fig,'data',data); +0110 setappdata(fig,'gui',gui); +0111 % update ini-file +0112 gui.myui.inidata.expertmode = data.info.ExpertMode; +0113 gui = makeINIfile(gui,'update'); +0114 % update interface +0115 NUCLEUSinv_updateInterface; +0116 % update status information +0117 updateStatusInformation; +0118 updateToolTips; +0119 onFigureSizeChange(fig); +0120 +0121 end +0122 +0123 %------------- END OF CODE -------------- +0124 +0125 %% License: +0126 % MIT License +0127 % +0128 % Copyright (c) 2018 Thomas Hiller +0129 % +0130 % Permission is hereby granted, free of charge, to any person obtaining a copy +0131 % of this software and associated documentation files (the "Software"), to deal +0132 % in the Software without restriction, including without limitation the rights +0133 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0134 % copies of the Software, and to permit persons to whom the Software is +0135 % furnished to do so, subject to the following conditions: +0136 % +0137 % The above copyright notice and this permission notice shall be included in all +0138 % copies or substantial portions of the Software. +0139 % +0140 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0141 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0142 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0143 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0144 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0145 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0146 % SOFTWARE.
    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/callbacks/menus/onMenuExportData.html b/doc/nucleus/callbacks/menus/onMenuExportData.html index 8755b9c..67f51a5 100644 --- a/doc/nucleus/callbacks/menus/onMenuExportData.html +++ b/doc/nucleus/callbacks/menus/onMenuExportData.html @@ -62,7 +62,7 @@

    CROSS-REFERENCE INFORMATION ^
 <li><a href=exportData exports data from both GUIs into various formats
  • exportINV exports NUCLEUSinv GUI data to a mat-file
  • This function is called by: +
  • NUCLEUSinv_createMenus creates all GUI menus
  • NUCLEUSmod_createMenus creates all GUI menus
  • diff --git a/doc/nucleus/callbacks/menus/onMenuExportGraphics.html b/doc/nucleus/callbacks/menus/onMenuExportGraphics.html index 2b12feb..7892e5d 100644 --- a/doc/nucleus/callbacks/menus/onMenuExportGraphics.html +++ b/doc/nucleus/callbacks/menus/onMenuExportGraphics.html @@ -64,7 +64,7 @@

    CROSS-REFERENCE INFORMATION ^
 <li><a href=exportGraphics exports graphics from both GUIs into various formats This function is called by: +
  • NUCLEUSinv_createMenus creates all GUI menus
  • NUCLEUSmod_createMenus creates all GUI menus
  • diff --git a/doc/nucleus/callbacks/menus/onMenuExtraColor.html b/doc/nucleus/callbacks/menus/onMenuExtraColor.html index eac95f3..fb5178f 100644 --- a/doc/nucleus/callbacks/menus/onMenuExtraColor.html +++ b/doc/nucleus/callbacks/menus/onMenuExtraColor.html @@ -61,7 +61,7 @@

    CROSS-REFERENCE INFORMATION ^
 <li><a href=changeColorTheme changes the color theme of the calling figure This function is called by: +
  • NUCLEUSinv_createMenus creates all GUI menus
  • NUCLEUSmod_createMenus creates all GUI menus
  • @@ -113,45 +113,53 @@

    SOURCE CODE ^'Checked','on'); 0045 set(gui.menu.extra_settings_theme_basic,'Checked','off'); 0046 set(gui.menu.extra_settings_theme_dark,'Checked','off'); -0047 case 'basic' -0048 set(gui.menu.extra_settings_theme_standard,'Checked','off'); -0049 set(gui.menu.extra_settings_theme_basic,'Checked','on'); -0050 set(gui.menu.extra_settings_theme_dark,'Checked','off'); -0051 case 'dark' -0052 set(gui.menu.extra_settings_theme_standard,'Checked','off'); -0053 set(gui.menu.extra_settings_theme_basic,'Checked','off'); -0054 set(gui.menu.extra_settings_theme_dark,'Checked','on'); -0055 end -0056 -0057 % adjust the colors -0058 changeColorTheme(fig_tag,label); -0059 -0060 end -0061 -0062 %------------- END OF CODE -------------- -0063 -0064 %% License: -0065 % MIT License -0066 % -0067 % Copyright (c) 2018 Thomas Hiller -0068 % -0069 % Permission is hereby granted, free of charge, to any person obtaining a copy -0070 % of this software and associated documentation files (the "Software"), to deal -0071 % in the Software without restriction, including without limitation the rights -0072 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -0073 % copies of the Software, and to permit persons to whom the Software is -0074 % furnished to do so, subject to the following conditions: -0075 % -0076 % The above copyright notice and this permission notice shall be included in all -0077 % copies or substantial portions of the Software. -0078 % -0079 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -0080 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -0081 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -0082 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -0083 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -0084 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -0085 % SOFTWARE. +0047 set(gui.menu.extra_settings_theme_black,'Checked','off'); +0048 case 'basic' +0049 set(gui.menu.extra_settings_theme_standard,'Checked','off'); +0050 set(gui.menu.extra_settings_theme_basic,'Checked','on'); +0051 set(gui.menu.extra_settings_theme_dark,'Checked','off'); +0052 set(gui.menu.extra_settings_theme_black,'Checked','off'); +0053 case 'dark' +0054 set(gui.menu.extra_settings_theme_standard,'Checked','off'); +0055 set(gui.menu.extra_settings_theme_basic,'Checked','off'); +0056 set(gui.menu.extra_settings_theme_dark,'Checked','on'); +0057 set(gui.menu.extra_settings_theme_black,'Checked','off'); +0058 case 'black' +0059 set(gui.menu.extra_settings_theme_standard,'Checked','off'); +0060 set(gui.menu.extra_settings_theme_basic,'Checked','off'); +0061 set(gui.menu.extra_settings_theme_dark,'Checked','off'); +0062 set(gui.menu.extra_settings_theme_black,'Checked','on'); +0063 end +0064 +0065 % adjust the colors +0066 changeColorTheme(fig_tag,label); +0067 +0068 end +0069 +0070 %------------- END OF CODE -------------- +0071 +0072 %% License: +0073 % MIT License +0074 % +0075 % Copyright (c) 2018 Thomas Hiller +0076 % +0077 % Permission is hereby granted, free of charge, to any person obtaining a copy +0078 % of this software and associated documentation files (the "Software"), to deal +0079 % in the Software without restriction, including without limitation the rights +0080 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0081 % copies of the Software, and to permit persons to whom the Software is +0082 % furnished to do so, subject to the following conditions: +0083 % +0084 % The above copyright notice and this permission notice shall be included in all +0085 % copies or substantial portions of the Software. +0086 % +0087 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0088 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0089 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0090 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0091 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0092 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0093 % SOFTWARE.
    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/callbacks/menus/onMenuExtraGraphics.html b/doc/nucleus/callbacks/menus/onMenuExtraGraphics.html index 211de93..858015c 100644 --- a/doc/nucleus/callbacks/menus/onMenuExtraGraphics.html +++ b/doc/nucleus/callbacks/menus/onMenuExtraGraphics.html @@ -62,7 +62,7 @@

    CROSS-REFERENCE INFORMATION ^
 <li><a href=showExtraGraphics shows additional figures for long time NMR lab
  • showFitStatistics shows an extra fit statistics figure (for T2 data)
  • This function is called by: +
  • NUCLEUSinv_createMenus creates all GUI menus
  • diff --git a/doc/nucleus/callbacks/menus/onMenuExtraRhoBounds.html b/doc/nucleus/callbacks/menus/onMenuExtraRhoBounds.html index 35c4a75..a4c71a3 100644 --- a/doc/nucleus/callbacks/menus/onMenuExtraRhoBounds.html +++ b/doc/nucleus/callbacks/menus/onMenuExtraRhoBounds.html @@ -61,7 +61,7 @@

    CROSS-REFERENCE INFORMATION ^
 </ul>
 This function is called by:
 <ul style= -
  • NUCLEUSinv_createMenus creates all GUI menus
  • +
  • NUCLEUSinv_createMenus creates all GUI menus
  • diff --git a/doc/nucleus/callbacks/menus/onMenuExtraShow.html b/doc/nucleus/callbacks/menus/onMenuExtraShow.html index 02141a1..1bc9132 100644 --- a/doc/nucleus/callbacks/menus/onMenuExtraShow.html +++ b/doc/nucleus/callbacks/menus/onMenuExtraShow.html @@ -63,7 +63,7 @@

    CROSS-REFERENCE INFORMATION ^
 <li><a href=onPushShowHide shows/hides the INFO column on the right side of NUCLEUSinv
  • makeINIfile creates or updates the ini-File
  • showParameterInfo shows the parameter file info (if available)
  • switchToolTips switches GUI tool tips either "on" or "off"
  • updateStatusInformation updates all fields inside the bottom status bar
  • This function is called by: +
  • NUCLEUSinv_createMenus creates all GUI menus
  • NUCLEUSmod_createMenus creates all GUI menus
  • updateToolTips updates tool tip entries dependent on the chosen settings
  • @@ -212,43 +212,42 @@

    SOURCE CODE ^otherwise 0143 % nothing to do -0144 end -0145 -0146 end -0147 -0148 setappdata(fig,'gui',gui); -0149 setappdata(fig,'data',data); -0150 switch fig_tag -0151 case 'INV' -0152 updateStatusInformation; -0153 end -0154 -0155 end -0156 -0157 %------------- END OF CODE -------------- -0158 -0159 %% License: -0160 % MIT License -0161 % -0162 % Copyright (c) 2018 Thomas Hiller -0163 % -0164 % Permission is hereby granted, free of charge, to any person obtaining a copy -0165 % of this software and associated documentation files (the "Software"), to deal -0166 % in the Software without restriction, including without limitation the rights -0167 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -0168 % copies of the Software, and to permit persons to whom the Software is -0169 % furnished to do so, subject to the following conditions: -0170 % -0171 % The above copyright notice and this permission notice shall be included in all -0172 % copies or substantial portions of the Software. -0173 % -0174 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -0175 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -0176 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -0177 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -0178 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -0179 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -0180 % SOFTWARE. +0144 end +0145 end +0146 +0147 setappdata(fig,'gui',gui); +0148 setappdata(fig,'data',data); +0149 switch fig_tag +0150 case 'INV' +0151 updateStatusInformation; +0152 end +0153 +0154 end +0155 +0156 %------------- END OF CODE -------------- +0157 +0158 %% License: +0159 % MIT License +0160 % +0161 % Copyright (c) 2018 Thomas Hiller +0162 % +0163 % Permission is hereby granted, free of charge, to any person obtaining a copy +0164 % of this software and associated documentation files (the "Software"), to deal +0165 % in the Software without restriction, including without limitation the rights +0166 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0167 % copies of the Software, and to permit persons to whom the Software is +0168 % furnished to do so, subject to the following conditions: +0169 % +0170 % The above copyright notice and this permission notice shall be included in all +0171 % copies or substantial portions of the Software. +0172 % +0173 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0174 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0175 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0176 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0177 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0178 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0179 % SOFTWARE.
    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/callbacks/menus/onMenuHelp.html b/doc/nucleus/callbacks/menus/onMenuHelp.html index 7c74d7e..021ecfa 100644 --- a/doc/nucleus/callbacks/menus/onMenuHelp.html +++ b/doc/nucleus/callbacks/menus/onMenuHelp.html @@ -61,7 +61,7 @@

    CROSS-REFERENCE INFORMATION ^
 </ul>
 This function is called by:
 <ul style= -
  • NUCLEUSinv_createMenus creates all GUI menus
  • NUCLEUSmod_createMenus creates all GUI menus
  • +
  • NUCLEUSinv_createMenus creates all GUI menus
  • NUCLEUSmod_createMenus creates all GUI menus
  • @@ -119,7 +119,7 @@

    SOURCE CODE ^'date: ',myui.date]; 0051 info{end+1,1} = ' '; 0052 -0053 switch data.info.optim +0053 switch data.info.has_optim 0054 case 'on' 0055 info{end+1,1} = 'Optimization Toolbox: IS available.'; 0056 info{end+1,1} = 'All inversion features can be used.'; diff --git a/doc/nucleus/callbacks/menus/onMenuImport.html b/doc/nucleus/callbacks/menus/onMenuImport.html index 5fe904a..7481fa4 100644 --- a/doc/nucleus/callbacks/menus/onMenuImport.html +++ b/doc/nucleus/callbacks/menus/onMenuImport.html @@ -67,7 +67,7 @@

    CROSS-REFERENCE INFORMATION ^
 <li><a href=onMenuImport handles the import menu entries
  • importASCIIdata imports NMR data from ASCII files
  • importEXCELdata imports NMR data from Excel files
  • importINV2INV imports a previously saved NUCLEUSinv session
  • importMOD2INV
  • importMOD2MOD imports previously saved NUCLEUSmod data back into the GUI
  • importNMRdata is the general import routine for NMR data
  • makeINIfile creates or updates the ini-File
  • uncheckImportMenus unchecks all import menus in NUCLEUSinv
  • This function is called by: +
  • NUCLEUSinv_createMenus creates all GUI menus
  • NUCLEUSmod_createMenus creates all GUI menus
  • onMenuImport handles the import menu entries
  • diff --git a/doc/nucleus/callbacks/menus/onMenuJointInversion.html b/doc/nucleus/callbacks/menus/onMenuJointInversion.html index 18a20dd..cc857e6 100644 --- a/doc/nucleus/callbacks/menus/onMenuJointInversion.html +++ b/doc/nucleus/callbacks/menus/onMenuJointInversion.html @@ -68,7 +68,7 @@

    CROSS-REFERENCE INFORMATION ^
 <li><a href=NUCLEUSinv_updateInterface updates all GUI elements
  • clearSingleAxis clears an individual axis
  • fixAxes fixes an ugly Matlab bug when resizing a box-panel which holds an
  • onFigureSizeChange fixes an ugly Matlab bug when resizing a box-panel
  • updateInfo updates the information shown in all information list boxes
  • updatePlotsSignal plots the raw and processed NMR signals in NUCLEUSinv
  • updateStatusInformation updates all fields inside the bottom status bar
  • This function is called by: +
  • NUCLEUSinv_createMenus creates all GUI menus
  • onMenuExpert handles the call from the menu that activates / deactivates
  • importINV2INV imports a previously saved NUCLEUSinv session
  • @@ -218,7 +218,7 @@

    SOURCE CODE ^'Enable','on'); 0143 set(gui.push_handles.invjoint_run,'Enable','on'); 0144 % choose default inversion method -0145 switch data.info.optim +0145 switch data.info.has_optim 0146 case 'on' 0147 data.invjoint.invtype = 'free'; 0148 case 'off' diff --git a/doc/nucleus/callbacks/menus/onMenuRestartQuit.html b/doc/nucleus/callbacks/menus/onMenuRestartQuit.html index ce1deea..9d0eb42 100644 --- a/doc/nucleus/callbacks/menus/onMenuRestartQuit.html +++ b/doc/nucleus/callbacks/menus/onMenuRestartQuit.html @@ -62,7 +62,7 @@

    CROSS-REFERENCE INFORMATION ^
 <li><a href=NUCLEUSinv is a graphical user interface (GUI) to invert NMR relaxometry
  • NUCLEUSmod is a graphical user interface (GUI) to forward model NMR
  • This function is called by: +
  • NUCLEUSinv_createMenus creates all GUI menus
  • NUCLEUSmod_createMenus creates all GUI menus
  • diff --git a/doc/nucleus/callbacks/menus/onMenuSolver.html b/doc/nucleus/callbacks/menus/onMenuSolver.html new file mode 100644 index 0000000..bedb159 --- /dev/null +++ b/doc/nucleus/callbacks/menus/onMenuSolver.html @@ -0,0 +1,166 @@ + + + + Description of onMenuSolver + + + + + + + + + + + +

    onMenuSolver +

    + +

    PURPOSE ^

    +
    handles the call from the menu that allows to choose the LSQ
    + +

    SYNOPSIS ^

    +
    function onMenuSolver(src,~)
    + +

    DESCRIPTION ^

    +
    onMenuSolver handles the call from the menu that allows to choose the LSQ
    +solver
    +
    + Syntax:
    +       onMenuSolver
    +
    + Inputs:
    +       src - handle of the calling object
    +
    + Outputs:
    +       none
    +
    + Example:
    +       onMenuSolver(src,~)
    +
    + Other m-files required:
    +       NUCLEUSinv_updateInterface
    +       updateStatusInformation
    +
    + Subfunctions:
    +       none
    +
    + MAT-files required:
    +       none
    +
    + See also: NUCLEUSinv
    + Author: Thomas Hiller
    + email: thomas.hiller[at]leibniz-liag.de
    + License: MIT License (at end)
    + + +

    CROSS-REFERENCE INFORMATION ^

    +This function calls: + +This function is called by: + + + + + +

    SOURCE CODE ^

    +
    0001 function onMenuSolver(src,~)
    +0002 %onMenuSolver handles the call from the menu that allows to choose the LSQ
    +0003 %solver
    +0004 %
    +0005 % Syntax:
    +0006 %       onMenuSolver
    +0007 %
    +0008 % Inputs:
    +0009 %       src - handle of the calling object
    +0010 %
    +0011 % Outputs:
    +0012 %       none
    +0013 %
    +0014 % Example:
    +0015 %       onMenuSolver(src,~)
    +0016 %
    +0017 % Other m-files required:
    +0018 %       NUCLEUSinv_updateInterface
    +0019 %       updateStatusInformation
    +0020 %
    +0021 % Subfunctions:
    +0022 %       none
    +0023 %
    +0024 % MAT-files required:
    +0025 %       none
    +0026 %
    +0027 % See also: NUCLEUSinv
    +0028 % Author: Thomas Hiller
    +0029 % email: thomas.hiller[at]leibniz-liag.de
    +0030 % License: MIT License (at end)
    +0031 
    +0032 %------------- BEGIN CODE --------------
    +0033 
    +0034 %% get GUI handle and data
    +0035 fig = findobj('Tag','INV');
    +0036 gui = getappdata(fig,'gui');
    +0037 data = getappdata(fig,'data');
    +0038 
    +0039 % solver
    +0040 solver = get(src,'Label');
    +0041 
    +0042 % switch solver
    +0043 if strfind(solver,'LSQLIN')
    +0044         data.info.solver = 'lsqlin';
    +0045         % menu entry
    +0046         set(gui.menu.extra_solver_lsqlin,'Checked','on');
    +0047         set(gui.menu.extra_solver_lsqnonneg,'Checked','off');
    +0048         
    +0049         % update the tooltips
    +0050 
    +0051 elseif strfind(solver,'LSQNONNEG')
    +0052         data.info.solver = 'lsqnonneg';
    +0053         % menu entry
    +0054         set(gui.menu.extra_solver_lsqlin,'Checked','off');
    +0055         set(gui.menu.extra_solver_lsqnonneg,'Checked','on');
    +0056 end
    +0057 
    +0058 % update GUI data
    +0059 setappdata(fig,'data',data);
    +0060 setappdata(fig,'gui',gui);
    +0061 % update interface
    +0062 NUCLEUSinv_updateInterface;
    +0063 % update status information
    +0064 updateStatusInformation;
    +0065 updateToolTips;
    +0066 
    +0067 end
    +0068 
    +0069 %------------- END OF CODE --------------
    +0070 
    +0071 %% License:
    +0072 % MIT License
    +0073 %
    +0074 % Copyright (c) 2019 Thomas Hiller
    +0075 %
    +0076 % Permission is hereby granted, free of charge, to any person obtaining a copy
    +0077 % of this software and associated documentation files (the "Software"), to deal
    +0078 % in the Software without restriction, including without limitation the rights
    +0079 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    +0080 % copies of the Software, and to permit persons to whom the Software is
    +0081 % furnished to do so, subject to the following conditions:
    +0082 %
    +0083 % The above copyright notice and this permission notice shall be included in all
    +0084 % copies or substantial portions of the Software.
    +0085 %
    +0086 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    +0087 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    +0088 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    +0089 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    +0090 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    +0091 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    +0092 % SOFTWARE.
    +
    Generated by m2html © 2005
    + + \ No newline at end of file diff --git a/doc/nucleus/callbacks/popup/onPopupInvjointType.html b/doc/nucleus/callbacks/popup/onPopupInvjointType.html index 2de9a09..5570608 100644 --- a/doc/nucleus/callbacks/popup/onPopupInvjointType.html +++ b/doc/nucleus/callbacks/popup/onPopupInvjointType.html @@ -113,7 +113,7 @@

    SOURCE CODE ^case 1 % free 0044 % if the optimization toolbox is not there then the fixed 0045 % inversion is the default -0046 switch data.info.optim +0046 switch data.info.has_optim 0047 case 'on' 0048 data.invjoint.invtype = 'free'; 0049 case 'off' diff --git a/doc/nucleus/functions/import/LoadNMRData_bamtom.html b/doc/nucleus/functions/import/LoadNMRData_bamtom.html index 68ded69..c8ddb13 100644 --- a/doc/nucleus/functions/import/LoadNMRData_bamtom.html +++ b/doc/nucleus/functions/import/LoadNMRData_bamtom.html @@ -46,6 +46,7 @@

    DESCRIPTION ^SOURCE CODE ^% 0020 % Other m-files required: 0021 % fixParameterString -0022 % -0023 % Subfunctions: -0024 % LoadDataFile -0025 % LoadParameterFile -0026 % -0027 % MAT-files required: -0028 % none -0029 % -0030 % See also: NUCLEUSinv -0031 % Author: Thomas Hiller -0032 % email: thomas.hiller[at]leibniz-liag.de -0033 % License: MIT License (at end) -0034 -0035 %------------- BEGIN CODE -------------- -0036 -0037 %% start processing the files -0038 % load Parameter file -0039 [parData] = LoadParameterFile(in.path,[in.name,'.par']); -0040 % check if T1 or T2 data -0041 if ~isempty(strfind(parData.measurementType,'CPMG')) -0042 T1T2flag = 'T2'; -0043 else -0044 T1T2flag = 'T1'; -0045 end -0046 -0047 switch T1T2flag -0048 case 'T1' -0049 parData = []; -0050 nmrData = []; -0051 -0052 helpdlg({'function: LoadNMRData_bamtom',... -0053 'T1 data import not yet implemented'},'not yet implemented'); -0054 case 'T2' +0022 % rotateT2phase +0023 % +0024 % Subfunctions: +0025 % LoadDataFile +0026 % LoadParameterFile +0027 % +0028 % MAT-files required: +0029 % none +0030 % +0031 % See also: NUCLEUSinv +0032 % Author: Thomas Hiller +0033 % email: thomas.hiller[at]leibniz-liag.de +0034 % License: MIT License (at end) +0035 +0036 %------------- BEGIN CODE -------------- +0037 +0038 %% start processing the files +0039 % load Parameter file +0040 [parData] = LoadParameterFile(in.path,[in.name,'.par']); +0041 % check if T1 or T2 data +0042 if ~isempty(strfind(parData.measurementType,'CPMG')) +0043 T1T2flag = 'T2'; +0044 else +0045 T1T2flag = 'T1'; +0046 end +0047 +0048 switch T1T2flag +0049 case 'T1' +0050 parData = []; +0051 nmrData = []; +0052 +0053 helpdlg({'function: LoadNMRData_bamtom',... +0054 'T1 data import not yet implemented'},'not yet implemented'); 0055 -0056 % read all 'nslices' measurements -0057 nslices = parData.nSlices; -0058 ncsvfiles = numel(dir(fullfile(in.path,'*.csv'))); -0059 -0060 if nslices == ncsvfiles -0061 -0062 nmrData = cell(1,nslices); -0063 for i = 1:nslices -0064 % find data file -0065 file = dir(fullfile(in.path,['*',sprintf('%03d',i),'.csv'])); -0066 -0067 % read the data file -0068 data = LoadDataFile(in.path,file.name,T1T2flag); -0069 -0070 % save the NMR data -0071 nmrData{i}.flag = data.flag; -0072 nmrData{i}.T1IRfac = 1; -0073 nmrData{i}.time = data.time; -0074 nmrData{i}.signal = data.signal; -0075 nmrData{i}.raw = data.raw; -0076 nmrData{i}.phase = data.phase; -0077 nmrData{i}.phase_bam = data.phase_bam; -0078 clear data -0079 -0080 % get file statistics -0081 nmrData{i}.datfile = file.name; -0082 nmrData{i}.date = file.date; -0083 nmrData{i}.datenum = file.datenum; -0084 nmrData{i}.bytes = file.bytes; -0085 end -0086 -0087 else -0088 -0089 files = dir(fullfile(in.path,'*.csv')); -0090 nmrData = cell(1,ncsvfiles); -0091 for i = 1:ncsvfiles -0092 % read the data file -0093 data = LoadDataFile(in.path,files(i).name,T1T2flag); -0094 -0095 % save the NMR data -0096 nmrData{i}.flag = data.flag; -0097 nmrData{i}.T1IRfac = 1; -0098 nmrData{i}.time = data.time; -0099 nmrData{i}.signal = data.signal; -0100 nmrData{i}.raw = data.raw; -0101 nmrData{i}.phase = data.phase; -0102 nmrData{i}.phase_bam = data.phase_bam; -0103 clear data -0104 -0105 % get file statistics -0106 nmrData{i}.datfile = files(i).name; -0107 nmrData{i}.date = files(i).date; -0108 nmrData{i}.datenum = files(i).datenum; -0109 nmrData{i}.bytes = files(i).bytes; -0110 end -0111 end -0112 end -0113 -0114 % save data to output struct -0115 out.parData = parData; -0116 out.nmrData = nmrData; -0117 -0118 end -0119 -0120 %% load NMR data file -0121 function [data] = LoadDataFile(datapath,fname,flag) -0122 -0123 d = importdata(fullfile(datapath,fname),'\t',3); -0124 -0125 % phase -0126 tmpstr = d.textdata{2,1}; -0127 colonstr = strfind(tmpstr,':'); -0128 data.phase_bam = str2double(tmpstr(colonstr+1:end-4)); -0129 % to compare the BAM TOM phase with the NUCLEUS fit phase shift and flip -0130 % the phase value -0131 data.phase_bam = -1*(data.phase_bam + pi); -0132 -0133 % standard data -0134 data.flag = flag; -0135 data.time = d.data(:,1); -0136 switch flag -0137 case 'T1' -0138 data.signal = d.data(:,2); -0139 case 'T2' -0140 data.signal = complex(d.data(:,2),d.data(:,3)); -0141 [data.signal,data.phase] = rotateT2phase(data.signal); -0142 end +0056 case 'T2' +0057 % find all csv files +0058 files = dir(fullfile(in.path,'*.csv')); +0059 nfiles = numel(files); +0060 nmrData = cell(1,nfiles); +0061 for i = 1:nfiles +0062 % read the data file +0063 data = LoadDataFile(in.path,files(i).name,T1T2flag); +0064 +0065 % save the NMR data +0066 nmrData{i}.flag = data.flag; +0067 nmrData{i}.T1IRfac = 1; +0068 nmrData{i}.time = data.time; +0069 nmrData{i}.signal = data.signal; +0070 nmrData{i}.raw = data.raw; +0071 nmrData{i}.phase = data.phase; +0072 nmrData{i}.phase_bam = data.phase_bam; +0073 clear data +0074 +0075 % get file statistics +0076 nmrData{i}.datfile = files(i).name; +0077 nmrData{i}.date = files(i).date; +0078 nmrData{i}.datenum = files(i).datenum; +0079 nmrData{i}.bytes = files(i).bytes; +0080 end +0081 end +0082 +0083 % save data to output struct +0084 out.parData = parData; +0085 out.nmrData = nmrData; +0086 +0087 end +0088 +0089 %% load NMR data file +0090 function [data] = LoadDataFile(datapath,fname,flag) +0091 +0092 d = importdata(fullfile(datapath,fname),'\t',3); +0093 +0094 % phase +0095 tmpstr = d.textdata{2,1}; +0096 colonstr = strfind(tmpstr,':'); +0097 data.phase_bam = str2double(tmpstr(colonstr+1:end-4)); +0098 % to compare the BAM TOM phase with the NUCLEUS fit phase shift and flip +0099 % the phase value +0100 data.phase_bam = -1*(data.phase_bam + pi); +0101 +0102 % standard data +0103 data.flag = flag; +0104 data.time = d.data(:,1); +0105 switch flag +0106 case 'T1' +0107 data.signal = d.data(:,2); +0108 case 'T2' +0109 data.signal = complex(d.data(:,2),d.data(:,3)); +0110 [data.signal,data.phase] = rotateT2phase(data.signal); +0111 end +0112 +0113 % save raw data +0114 data.raw.time = data.time; +0115 data.raw.signal = data.signal; +0116 +0117 end +0118 +0119 %% load parameter file +0120 function [data] = LoadParameterFile(datapath,fname) +0121 +0122 fid = fopen(fullfile(datapath,fname)); +0123 d = textscan(fid,'%s','Delimiter','\n'); +0124 fclose(fid); +0125 +0126 for i = 1:size(d{1},1) +0127 str = char(d{1}(i)); +0128 if ~isempty(str) && ~strcmp(str(1),'#') +0129 str = fixParameterString(str); +0130 if ~isempty(strfind(str,'coilName')) || ~isempty(strfind(str,'measurementType')) +0131 streq = strfind(str,'='); +0132 newstr = [str(1:streq(1)),'''',strtrim(str(streq(1)+1:end)),'''']; +0133 str = newstr; +0134 end +0135 eval(['data.',str,';']); +0136 end +0137 end +0138 data.all = d; +0139 +0140 end +0141 +0142 %------------- END OF CODE -------------- 0143 -0144 % save raw data -0145 data.raw.time = data.time; -0146 data.raw.signal = data.signal; -0147 -0148 end -0149 -0150 %% load parameter file -0151 function [data] = LoadParameterFile(datapath,fname) -0152 -0153 fid = fopen(fullfile(datapath,fname)); -0154 d = textscan(fid,'%s','Delimiter','\n'); -0155 fclose(fid); -0156 -0157 for i = 1:size(d{1},1) -0158 str = char(d{1}(i)); -0159 if ~isempty(str) && ~strcmp(str(1),'#') -0160 str = fixParameterString(str); -0161 if ~isempty(strfind(str,'coilName')) || ~isempty(strfind(str,'measurementType')) -0162 streq = strfind(str,'='); -0163 newstr = [str(1:streq(1)),'''',strtrim(str(streq(1)+1:end)),'''']; -0164 str = newstr; -0165 end -0166 eval(['data.',str,';']); -0167 end -0168 end -0169 data.all = d; -0170 -0171 end -0172 -0173 %------------- END OF CODE -------------- -0174 -0175 %% License: -0176 % MIT License -0177 % -0178 % Copyright (c) 2019 Thomas Hiller -0179 % -0180 % Permission is hereby granted, free of charge, to any person obtaining a copy -0181 % of this software and associated documentation files (the "Software"), to deal -0182 % in the Software without restriction, including without limitation the rights -0183 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -0184 % copies of the Software, and to permit persons to whom the Software is -0185 % furnished to do so, subject to the following conditions: -0186 % -0187 % The above copyright notice and this permission notice shall be included in all -0188 % copies or substantial portions of the Software. -0189 % -0190 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -0191 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -0192 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -0193 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -0194 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -0195 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -0196 % SOFTWARE. +0144 %% License: +0145 % MIT License +0146 % +0147 % Copyright (c) 2019 Thomas Hiller +0148 % +0149 % Permission is hereby granted, free of charge, to any person obtaining a copy +0150 % of this software and associated documentation files (the "Software"), to deal +0151 % in the Software without restriction, including without limitation the rights +0152 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0153 % copies of the Software, and to permit persons to whom the Software is +0154 % furnished to do so, subject to the following conditions: +0155 % +0156 % The above copyright notice and this permission notice shall be included in all +0157 % copies or substantial portions of the Software. +0158 % +0159 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0160 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0161 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0162 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0163 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0164 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0165 % SOFTWARE.
    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/functions/interface/PhaseView.html b/doc/nucleus/functions/interface/PhaseView.html index 301d047..d6d1c13 100644 --- a/doc/nucleus/functions/interface/PhaseView.html +++ b/doc/nucleus/functions/interface/PhaseView.html @@ -66,7 +66,7 @@

    CROSS-REFERENCE INFORMATION ^
 <li><a href=clearAllAxes clears all axes of a given figure This function is called by: +
  • NUCLEUSinv_createMenus creates all GUI menus
  • onListboxData handles the calls from the context menu of the data
  • SUBFUNCTIONS ^

    @@ -114,331 +114,344 @@

    SOURCE CODE ^'figure','toplevel'); 0039 nucleus.data = getappdata(fig,'data'); 0040 nucleus.gui = getappdata(fig,'gui'); -0041 -0042 %% proceed if there is data -0043 if isfield(nucleus.data,'results') -0044 if isfield(nucleus.data.results,'nmrraw') && isfield(nucleus.data.results,'nmrproc') -0045 -0046 % check if the figure is already open -0047 fig_phase = findobj('Tag','PHASEVIEW'); -0048 % if not, create it -0049 if isempty(fig_phase) -0050 % draw the figure on top of NUCLEUSinv -0051 fig_phase = figure('Name','NUCLEUSinv - PhaseView',... -0052 'NumberTitle','off','ToolBar','none','Tag','PHASEVIEW'); -0053 pos0 = get(fig,'Position'); -0054 pos1 = get(fig_phase,'Position'); -0055 cent(1) = (pos0(1)+pos0(3)/2); -0056 cent(2) = (pos0(2)+pos0(4)/2); -0057 set(fig_phase,'Position',[cent(1)-pos0(3)/3 pos0(2) pos0(3)/1.5 pos0(4)]); -0058 -0059 % create the layout -0060 gui.main = uix.VBox('Parent',fig_phase,'Spacing',5,'Padding',5); -0061 gui.row1 = uicontainer('Parent',gui.main); % axes real -0062 gui.row2 = uicontainer('Parent',gui.main); % axes imag -0063 gui.row3 = uicontainer('Parent',gui.main); % axes SSE -0064 gui.row4 = uix.HBox('Parent',gui.main,'Spacing',5); % control elements -0065 set(gui.main,'Heights',[-1 -1 -1 90]); -0066 -0067 % all axes -0068 gui.axes_handles.real = axes('Parent',gui.row1); -0069 gui.axes_handles.imag = axes('Parent',gui.row2); -0070 gui.axes_handles.sse = axes('Parent',gui.row3); -0071 -0072 % 3 horizontal boxes -0073 uix.Empty('Parent',gui.row4); -0074 gui.vbox1 = uix.VBox('Parent',gui.row4,'Spacing',5,'Padding',5); % control elements -0075 uix.Empty('Parent',gui.row4); -0076 set(gui.row4,'Widths',[-1 -2 -1]); -0077 -0078 % edit field -0079 gui.hbox11 = uix.HBox('Parent',gui.vbox1,'Spacing',5); -0080 uix.Empty('Parent',gui.hbox11); -0081 gui.edit_phase = uicontrol('Parent',gui.hbox11,... -0082 'Style','edit','FontSize',nucleus.gui.myui.fontsize,'Tag','phase',... -0083 'String',num2str(0),... -0084 'Callback',@pv_updatePhase); -0085 uix.Empty('Parent',gui.hbox11); -0086 set(gui.hbox11,'Widths',[-1 -1 -1]); -0087 -0088 % slider -0089 gui.hbox12 = uix.HBox('Parent',gui.vbox1,'Spacing',5); -0090 gui.hbox121 = uix.HBox('Parent',gui.hbox12,'Spacing',5); -0091 gui.text_down = uicontrol('Parent',gui.hbox121,'Style','text',... -0092 'String','down','FontSize',nucleus.gui.myui.fontsize,... -0093 'HorizontalAlignment','right'); -0094 gui.slider = uicontrol('Parent',gui.hbox12,'Style','slider',... -0095 'Min',-180,'Max',180,'Value',0,'SliderStep',[0.1/360 5/360],... -0096 'Callback',@pv_updateSlider); -0097 gui.hbox122 = uix.HBox('Parent',gui.hbox12,'Spacing',5); -0098 gui.text_up = uicontrol('Parent',gui.hbox122,'Style','text',... -0099 'String','up','FontSize',nucleus.gui.myui.fontsize,... -0100 'HorizontalAlignment','left'); -0101 set(gui.hbox12,'Widths',[-1 -9 -1]); -0102 -0103 % buttons -0104 gui.hbox13 = uix.HBox('Parent',gui.vbox1,'Spacing',5); -0105 uix.Empty('Parent',gui.hbox13); -0106 gui.push_default = uicontrol('Parent',gui.hbox13,... -0107 'Style','pushbutton','FontSize',nucleus.gui.myui.fontsize,'Tag','default',... -0108 'String','DEFAULT','Callback',@pv_onPushDefault); -0109 uix.Empty('Parent',gui.hbox13); -0110 gui.push_save = uicontrol('Parent',gui.hbox13,... -0111 'Style','pushbutton','FontSize',nucleus.gui.myui.fontsize,'Tag','save',... -0112 'String','KEEP','Callback',@pv_onPushSave); -0113 uix.Empty('Parent',gui.hbox13); -0114 set(gui.hbox13,'Widths',[-1 -2 -1 -2 -1]); -0115 -0116 set(gui.vbox1,'Heights',[-1 20 -1]); -0117 -0118 % Java Hack to adjust vertical alignment of text fields -0119 jh = findjobj(gui.text_down); -0120 jh.setVerticalAlignment(javax.swing.JLabel.CENTER); -0121 jh = findjobj(gui.text_up); -0122 jh.setVerticalAlignment(javax.swing.JLabel.CENTER); -0123 -0124 % store some main GUI settings -0125 gui.myui = nucleus.gui.myui; -0126 -0127 % save to GUI -0128 setappdata(fig_phase,'gui',gui); -0129 end -0130 % if the figure is already open load the GUI data -0131 gui = getappdata(fig_phase,'gui'); -0132 -0133 % clear all axes -0134 clearAllAxes(fig_phase); -0135 -0136 if strcmp(nucleus.data.results.nmrproc.T1T2,'T2') -0137 -0138 %% get signal to show -0139 nmrraw = nucleus.data.results.nmrraw; -0140 loglinx = get(nucleus.gui.cm_handles.axes_raw_xaxis,'Label'); -0141 -0142 % axes setting -0143 data.loglinx = loglinx; -0144 % phase from import-fit -0145 data.phase_default = rad2deg(nucleus.data.results.nmrraw.phase); -0146 % phase used in PhaseView -0147 data.phase = data.phase_default; -0148 set(gui.edit_phase,'String',num2str(data.phase)); -0149 set(gui.slider,'Value',data.phase); -0150 % time -0151 data.time = nmrraw.t; -0152 -0153 % original unrotated signal -0154 data.signal_raw = nmrraw.s * exp(1i*deg2rad(shift_phase(-data.phase))); -0155 % rotated signal -0156 data.signal_rot = nmrraw.s; -0157 data.s_max = max(real(data.signal_rot)); -0158 -0159 % SSE data -0160 beta_range = 0:1:360; -0161 SSE = data.signal_raw*exp(1i*deg2rad(beta_range)); -0162 t0 = zeros(size(SSE)); -0163 residual_i = t0-imag(SSE); -0164 residual_r = t0-real(SSE); -0165 sse_i = sum(residual_i.^2,1); -0166 sse_r = sum(residual_r.^2,1)*-1; -0167 data.beta_range = beta_range; -0168 data.sse_i = sse_i; -0169 data.sse_r = sse_r; -0170 -0171 setappdata(fig_phase,'data',data); -0172 setappdata(fig_phase,'gui',gui); -0173 pv_showSignal(fig_phase); -0174 else -0175 helpdlg({'function: PhaseView',... -0176 'Cannot continue because there is no T2 data!'},... -0177 'No T2 data.'); -0178 delete(fig_phase); -0179 end -0180 -0181 else -0182 helpdlg({'function: PhaseView',... -0183 'Cannot continue because no data loaded or selected!'},... -0184 'Load NMR data first.'); -0185 end -0186 else -0187 helpdlg({'function: PhaseView',... -0188 'Cannot continue because no data loaded or selected!'},... -0189 'Load NMR data first.'); -0190 end -0191 -0192 end -0193 -0194 function pv_onPushDefault(src,~) -0195 fig_phase = ancestor(src,'figure','toplevel'); -0196 gui = getappdata(fig_phase,'gui'); -0197 data = getappdata(fig_phase,'data'); -0198 -0199 data.phase = data.phase_default; -0200 set(gui.slider,'Value',data.phase); -0201 set(gui.edit_phase,'String',num2str(data.phase)); -0202 -0203 data.signal_rot = data.signal_raw * exp(1i*deg2rad(shift_phase(data.phase))); -0204 -0205 setappdata(fig_phase,'data',data); -0206 setappdata(fig_phase,'gui',gui); -0207 pv_showSignal(fig_phase); +0041 colors = nucleus.gui.myui.colors; +0042 +0043 %% proceed if there is data +0044 if isfield(nucleus.data,'results') +0045 if isfield(nucleus.data.results,'nmrraw') && isfield(nucleus.data.results,'nmrproc') +0046 +0047 % check if the figure is already open +0048 fig_phase = findobj('Tag','PHASEVIEW'); +0049 % if not, create it +0050 if isempty(fig_phase) +0051 % draw the figure on top of NUCLEUSinv +0052 fig_phase = figure('Name','NUCLEUSinv - PhaseView',... +0053 'NumberTitle','off','ToolBar','none','Tag','PHASEVIEW'); +0054 pos0 = get(fig,'Position'); +0055 pos1 = get(fig_phase,'Position'); +0056 cent(1) = (pos0(1)+pos0(3)/2); +0057 cent(2) = (pos0(2)+pos0(4)/2); +0058 set(fig_phase,'Position',[cent(1)-pos0(3)/3 pos0(2) pos0(3)/1.5 pos0(4)]); +0059 +0060 % create the layout +0061 gui.main = uix.VBox('Parent',fig_phase,'BackGroundColor',colors.panelBG,'Spacing',5,'Padding',5); +0062 gui.row1 = uicontainer('Parent',gui.main,'BackGroundColor',colors.panelBG); % axes real +0063 gui.row2 = uicontainer('Parent',gui.main,'BackGroundColor',colors.panelBG); % axes imag +0064 gui.row3 = uicontainer('Parent',gui.main,'BackGroundColor',colors.panelBG); % axes SSE +0065 gui.row4 = uix.HBox('Parent',gui.main,'BackGroundColor',colors.panelBG,'Spacing',5); % control elements +0066 set(gui.main,'Heights',[-1 -1 -1 90]); +0067 +0068 % all axes +0069 gui.axes_handles.real = axes('Parent',gui.row1,... +0070 'Color',colors.axisBG,'XColor',colors.axisFG,... +0071 'YColor',colors.axisFG); +0072 gui.axes_handles.imag = axes('Parent',gui.row2,... +0073 'Color',colors.axisBG,'XColor',colors.axisFG,... +0074 'YColor',colors.axisFG); +0075 gui.axes_handles.sse = axes('Parent',gui.row3,... +0076 'Color',colors.axisBG,'XColor',colors.axisFG,... +0077 'YColor',colors.axisFG); +0078 +0079 % 3 horizontal boxes +0080 uix.Empty('Parent',gui.row4); +0081 gui.vbox1 = uix.VBox('Parent',gui.row4,'BackGroundColor',colors.panelBG,'Spacing',5,'Padding',5); % control elements +0082 uix.Empty('Parent',gui.row4); +0083 set(gui.row4,'Widths',[-1 -2 -1]); +0084 +0085 % edit field +0086 gui.hbox11 = uix.HBox('Parent',gui.vbox1,'BackGroundColor',colors.panelBG,'Spacing',5); +0087 uix.Empty('Parent',gui.hbox11); +0088 gui.edit_phase = uicontrol('Parent',gui.hbox11,... +0089 'Style','edit','FontSize',nucleus.gui.myui.fontsize,'Tag','phase',... +0090 'String',num2str(0),'BackGroundColor',colors.editBG,... +0091 'ForeGroundColor',colors.panelFG,... +0092 'Callback',@pv_updatePhase); +0093 uix.Empty('Parent',gui.hbox11); +0094 set(gui.hbox11,'Widths',[-1 -1 -1]); +0095 +0096 % slider +0097 gui.hbox12 = uix.HBox('Parent',gui.vbox1,'BackGroundColor',colors.panelBG,'Spacing',5); +0098 gui.hbox121 = uix.HBox('Parent',gui.hbox12,'BackGroundColor',colors.panelBG,'Spacing',5); +0099 gui.text_down = uicontrol('Parent',gui.hbox121,'Style','text',... +0100 'String','down','FontSize',nucleus.gui.myui.fontsize,... +0101 'BackGroundColor',colors.panelBG,'ForeGroundColor',colors.panelFG,... +0102 'HorizontalAlignment','right'); +0103 gui.slider = uicontrol('Parent',gui.hbox12,'Style','slider',... +0104 'Min',-180,'Max',180,'Value',0,'SliderStep',[0.1/360 5/360],... +0105 'Callback',@pv_updateSlider); +0106 gui.hbox122 = uix.HBox('Parent',gui.hbox12,'BackGroundColor',colors.panelBG,'Spacing',5); +0107 gui.text_up = uicontrol('Parent',gui.hbox122,'Style','text',... +0108 'String','up','FontSize',nucleus.gui.myui.fontsize,... +0109 'BackGroundColor',colors.panelBG,'ForeGroundColor',colors.panelFG,... +0110 'HorizontalAlignment','left'); +0111 set(gui.hbox12,'Widths',[-1 -9 -1]); +0112 +0113 % buttons +0114 gui.hbox13 = uix.HBox('Parent',gui.vbox1,'BackGroundColor',colors.panelBG,'Spacing',5); +0115 uix.Empty('Parent',gui.hbox13); +0116 gui.push_default = uicontrol('Parent',gui.hbox13,... +0117 'Style','pushbutton','FontSize',nucleus.gui.myui.fontsize,'Tag','default',... +0118 'String','DEFAULT','Callback',@pv_onPushDefault); +0119 uix.Empty('Parent',gui.hbox13); +0120 gui.push_save = uicontrol('Parent',gui.hbox13,... +0121 'Style','pushbutton','FontSize',nucleus.gui.myui.fontsize,'Tag','save',... +0122 'String','KEEP','Callback',@pv_onPushSave); +0123 uix.Empty('Parent',gui.hbox13); +0124 set(gui.hbox13,'Widths',[-1 -2 -1 -2 -1]); +0125 +0126 set(gui.vbox1,'Heights',[-1 20 -1]); +0127 +0128 % Java Hack to adjust vertical alignment of text fields +0129 jh = findjobj(gui.text_down); +0130 jh.setVerticalAlignment(javax.swing.JLabel.CENTER); +0131 jh = findjobj(gui.text_up); +0132 jh.setVerticalAlignment(javax.swing.JLabel.CENTER); +0133 +0134 % store some main GUI settings +0135 gui.myui = nucleus.gui.myui; +0136 +0137 % save to GUI +0138 setappdata(fig_phase,'gui',gui); +0139 end +0140 % if the figure is already open load the GUI data +0141 gui = getappdata(fig_phase,'gui'); +0142 +0143 % clear all axes +0144 clearAllAxes(fig_phase); +0145 +0146 if strcmp(nucleus.data.results.nmrproc.T1T2,'T2') +0147 +0148 %% get signal to show +0149 nmrraw = nucleus.data.results.nmrraw; +0150 loglinx = get(nucleus.gui.cm_handles.axes_raw_xaxis,'Label'); +0151 +0152 % axes setting +0153 data.loglinx = loglinx; +0154 % phase from import-fit +0155 data.phase_default = rad2deg(nucleus.data.results.nmrraw.phase); +0156 % phase used in PhaseView +0157 data.phase = data.phase_default; +0158 set(gui.edit_phase,'String',num2str(data.phase)); +0159 set(gui.slider,'Value',data.phase); +0160 % time +0161 data.time = nmrraw.t; +0162 +0163 % original unrotated signal +0164 data.signal_raw = nmrraw.s * exp(1i*deg2rad(shift_phase(-data.phase))); +0165 % rotated signal +0166 data.signal_rot = nmrraw.s; +0167 data.s_max = max(real(data.signal_rot)); +0168 +0169 % SSE data +0170 beta_range = 0:1:360; +0171 SSE = data.signal_raw*exp(1i*deg2rad(beta_range)); +0172 t0 = zeros(size(SSE)); +0173 residual_i = t0-imag(SSE); +0174 residual_r = t0-real(SSE); +0175 sse_i = sum(residual_i.^2,1); +0176 sse_r = sum(residual_r.^2,1)*-1; +0177 data.beta_range = beta_range; +0178 data.sse_i = sse_i; +0179 data.sse_r = sse_r; +0180 +0181 setappdata(fig_phase,'data',data); +0182 setappdata(fig_phase,'gui',gui); +0183 pv_showSignal(fig_phase); +0184 else +0185 helpdlg({'function: PhaseView',... +0186 'Cannot continue because there is no T2 data!'},... +0187 'No T2 data.'); +0188 delete(fig_phase); +0189 end +0190 +0191 else +0192 helpdlg({'function: PhaseView',... +0193 'Cannot continue because no data loaded or selected!'},... +0194 'Load NMR data first.'); +0195 end +0196 else +0197 helpdlg({'function: PhaseView',... +0198 'Cannot continue because no data loaded or selected!'},... +0199 'Load NMR data first.'); +0200 end +0201 +0202 end +0203 +0204 function pv_onPushDefault(src,~) +0205 fig_phase = ancestor(src,'figure','toplevel'); +0206 gui = getappdata(fig_phase,'gui'); +0207 data = getappdata(fig_phase,'data'); 0208 -0209 end -0210 -0211 function pv_onPushSave(src,~) -0212 fig_phase = ancestor(src,'figure','toplevel'); -0213 gui = getappdata(fig_phase,'gui'); -0214 data = getappdata(fig_phase,'data'); -0215 -0216 fig = findobj('Tag','INV'); -0217 nucleus.data = getappdata(fig,'data'); -0218 nucleus.gui = getappdata(fig,'gui'); -0219 -0220 % get the selected signal ID -0221 id = get(nucleus.gui.listbox_handles.signal,'Value'); -0222 % update phase -0223 nucleus.data.import.NMR.data{id}.phase = deg2rad(data.phase); -0224 nucleus.data.results.nmrraw.phase = deg2rad(data.phase); -0225 % update signal -0226 nucleus.data.import.NMR.data{id}.signal = data.signal_rot; -0227 nucleus.data.results.nmrraw.s = data.signal_rot; -0228 -0229 % update GUI data -0230 setappdata(fig,'data',nucleus.data); -0231 -0232 end -0233 -0234 function pv_showSignal(fig_phase) -0235 data = getappdata(fig_phase,'data'); -0236 gui = getappdata(fig_phase,'gui'); -0237 -0238 % axes handles -0239 ax1 = gui.axes_handles.real; -0240 ax2 = gui.axes_handles.imag; -0241 ax3 = gui.axes_handles.sse; -0242 % clear all axes -0243 clearAllAxes(fig_phase); -0244 -0245 plot(data.time,real(data.signal_rot),'Color',gui.myui.colors.RE,'Parent',ax1); -0246 plot(data.time,imag(data.signal_rot),'Color',gui.myui.colors.IM,'Parent',ax2); +0209 data.phase = data.phase_default; +0210 set(gui.slider,'Value',data.phase); +0211 set(gui.edit_phase,'String',num2str(data.phase)); +0212 +0213 data.signal_rot = data.signal_raw * exp(1i*deg2rad(shift_phase(data.phase))); +0214 +0215 setappdata(fig_phase,'data',data); +0216 setappdata(fig_phase,'gui',gui); +0217 pv_showSignal(fig_phase); +0218 +0219 end +0220 +0221 function pv_onPushSave(src,~) +0222 fig_phase = ancestor(src,'figure','toplevel'); +0223 gui = getappdata(fig_phase,'gui'); +0224 data = getappdata(fig_phase,'data'); +0225 +0226 fig = findobj('Tag','INV'); +0227 nucleus.data = getappdata(fig,'data'); +0228 nucleus.gui = getappdata(fig,'gui'); +0229 +0230 % get the selected signal ID +0231 id = get(nucleus.gui.listbox_handles.signal,'Value'); +0232 % update phase +0233 nucleus.data.import.NMR.data{id}.phase = deg2rad(data.phase); +0234 nucleus.data.results.nmrraw.phase = deg2rad(data.phase); +0235 % update signal +0236 nucleus.data.import.NMR.data{id}.signal = data.signal_rot; +0237 nucleus.data.results.nmrraw.s = data.signal_rot; +0238 +0239 % update GUI data +0240 setappdata(fig,'data',nucleus.data); +0241 +0242 end +0243 +0244 function pv_showSignal(fig_phase) +0245 data = getappdata(fig_phase,'data'); +0246 gui = getappdata(fig_phase,'gui'); 0247 -0248 switch data.loglinx -0249 case 'x-axis -> lin' % log axes -0250 xticks = floor(log10(data.time(1)))-1:1:log10(max(data.time))+1; -0251 set(ax1,'XScale','log','XLim',[data.time(1) max(data.time)],'XTick',10.^xticks); -0252 set(ax2,'XScale','log','XLim',[data.time(1) max(data.time)],'XTick',10.^xticks); -0253 case 'x-axis -> log' % lin axes -0254 set(ax1,'XScale','lin','XLim',[0 max(data.time)],'XTickMode','auto'); -0255 set(ax2,'XScale','lin','XLim',[0 max(data.time)],'XTickMode','auto'); -0256 end -0257 grid(ax1,'on'); -0258 grid(ax2,'on'); -0259 -0260 hold(ax2,'on'); -0261 line(get(ax2,'XLim'),[0 0],'LineStyle','--','Color','k','LineWidth',1,'Parent',ax2); -0262 hold(ax2,'off'); -0263 -0264 %residual of current phase angle -0265 res_r = zeros(size(data.time))-real(data.signal_rot); -0266 res_i = zeros(size(data.time))-imag(data.signal_rot); -0267 sse_r = sum(res_r.^2); -0268 sse_i = sum(res_i.^2); -0269 -0270 set(get(ax1,'XLabel'),'String','time'); -0271 set(get(ax1,'YLabel'),'String','\Reeal'); -0272 text(0.975,0.8,['\Sigma \epsilon^2 = ',sprintf('%6.5e',sse_r)],... -0273 'HorizontalAlignment','right','BackgroundColor','w','Units','normalized',... -0274 'FontSize',12,'Parent',ax1); -0275 set(get(ax2,'XLabel'),'String','time'); -0276 set(get(ax2,'YLabel'),'String','\Immag'); -0277 text(0.975,0.8,['\Sigma \epsilon^2 = ',sprintf('%6.5e',sse_i)],... -0278 'HorizontalAlignment','right','BackgroundColor','w','Units','normalized',... -0279 'FontSize',12,'Parent',ax2); -0280 -0281 hold(ax3,'on'); -0282 ymin = min([-1.*data.sse_r data.sse_i]); -0283 ymax = max([-1.*data.sse_r data.sse_i]); -0284 plot(data.beta_range-180,-1.*data.sse_r,'Color',gui.myui.colors.RE,'Parent',ax3); -0285 plot(data.beta_range-180,data.sse_i,'Color',gui.myui.colors.IM,'Parent',ax3); -0286 line([data.phase data.phase],[ymin ymax],'Color','k','LineStyle','--','Parent',ax3) -0287 lgh = legend(ax3,'\Reeal','\Immag','\phi'); -0288 set(lgh,'FontSize',12); -0289 -0290 set(ax3,'XLim',[-180 180],'XTick',-180:30:180); -0291 set(ax3,'YLim',[ymin ymax]); -0292 set(get(ax3,'XLabel'),'String','phase \phi [deg]'); -0293 set(get(ax3,'YLabel'),'String','\Sigma \epsilon^2'); -0294 hold(ax3,'off'); -0295 -0296 set(ax1,'FontSize',gui.myui.fontsize); -0297 set(ax2,'FontSize',gui.myui.fontsize); -0298 set(ax3,'FontSize',gui.myui.fontsize); -0299 -0300 set(get(ax1,'YLabel'),'FontSize',16); -0301 set(get(ax2,'YLabel'),'FontSize',16); +0248 % axes handles +0249 ax1 = gui.axes_handles.real; +0250 ax2 = gui.axes_handles.imag; +0251 ax3 = gui.axes_handles.sse; +0252 % clear all axes +0253 clearAllAxes(fig_phase); +0254 hold(ax1,'on'); +0255 hold(ax2,'on'); +0256 hold(ax3,'on'); +0257 +0258 plot(data.time,real(data.signal_rot),'Color',gui.myui.colors.RE,'Parent',ax1); +0259 plot(data.time,imag(data.signal_rot),'Color',gui.myui.colors.IM,'Parent',ax2); +0260 +0261 switch data.loglinx +0262 case 'x-axis -> lin' % log axes +0263 xticks = floor(log10(data.time(1)))-1:1:log10(max(data.time))+1; +0264 set(ax1,'XScale','log','XLim',[data.time(1) max(data.time)],'XTick',10.^xticks); +0265 set(ax2,'XScale','log','XLim',[data.time(1) max(data.time)],'XTick',10.^xticks); +0266 case 'x-axis -> log' % lin axes +0267 set(ax1,'XScale','lin','XLim',[0 max(data.time)],'XTickMode','auto'); +0268 set(ax2,'XScale','lin','XLim',[0 max(data.time)],'XTickMode','auto'); +0269 end +0270 grid(ax1,'on'); +0271 grid(ax2,'on'); +0272 +0273 line(get(ax2,'XLim'),[0 0],'LineStyle','--','Color',gui.myui.colors.axisL,'LineWidth',1,'Parent',ax2); +0274 hold(ax2,'off'); +0275 +0276 %residual of current phase angle +0277 res_r = zeros(size(data.time))-real(data.signal_rot); +0278 res_i = zeros(size(data.time))-imag(data.signal_rot); +0279 sse_r = sum(res_r.^2); +0280 sse_i = sum(res_i.^2); +0281 +0282 set(get(ax1,'XLabel'),'String','time'); +0283 set(get(ax1,'YLabel'),'String','\Reeal'); +0284 text(0.975,0.8,['\Sigma \epsilon^2 = ',sprintf('%6.5e',sse_r)],... +0285 'HorizontalAlignment','right','BackgroundColor',gui.myui.colors.axisBG,... +0286 'Color',gui.myui.colors.panelFG,'Units','normalized',... +0287 'FontSize',12,'Parent',ax1); +0288 set(get(ax2,'XLabel'),'String','time'); +0289 set(get(ax2,'YLabel'),'String','\Immag'); +0290 text(0.975,0.8,['\Sigma \epsilon^2 = ',sprintf('%6.5e',sse_i)],... +0291 'HorizontalAlignment','right','BackgroundColor',gui.myui.colors.axisBG,... +0292 'Color',gui.myui.colors.panelFG,'Units','normalized',... +0293 'FontSize',12,'Parent',ax2); +0294 +0295 ymin = min([-1.*data.sse_r data.sse_i]); +0296 ymax = max([-1.*data.sse_r data.sse_i]); +0297 plot(data.beta_range-180,-1.*data.sse_r,'Color',gui.myui.colors.RE,'Parent',ax3); +0298 plot(data.beta_range-180,data.sse_i,'Color',gui.myui.colors.IM,'Parent',ax3); +0299 line([data.phase data.phase],[ymin ymax],'Color',gui.myui.colors.axisL,'LineStyle','--','Parent',ax3) +0300 lgh = legend(ax3,'\Reeal','\Immag','\phi'); +0301 set(lgh,'FontSize',12,'TextColor',gui.myui.colors.panelFG); 0302 -0303 end -0304 -0305 function pv_updateSlider(src,~) -0306 fig_phase = ancestor(src,'figure','toplevel'); -0307 gui = getappdata(fig_phase,'gui'); -0308 data = getappdata(fig_phase,'data'); -0309 -0310 data.phase = get(gui.slider,'Value'); -0311 set(gui.edit_phase,'String',num2str(data.phase)); +0303 set(ax3,'XLim',[-180 180],'XTick',-180:30:180); +0304 set(ax3,'YLim',[ymin ymax]); +0305 set(get(ax3,'XLabel'),'String','phase \phi [deg]'); +0306 set(get(ax3,'YLabel'),'String','\Sigma \epsilon^2'); +0307 hold(ax3,'off'); +0308 +0309 set(ax1,'FontSize',gui.myui.fontsize); +0310 set(ax2,'FontSize',gui.myui.fontsize); +0311 set(ax3,'FontSize',gui.myui.fontsize); 0312 -0313 data.signal_rot = data.signal_raw * exp(1i*deg2rad(shift_phase(data.phase))); -0314 -0315 setappdata(fig_phase,'data',data); -0316 setappdata(fig_phase,'gui',gui); -0317 pv_showSignal(fig_phase); -0318 -0319 end -0320 -0321 function pv_updatePhase(src,~) -0322 fig_phase = ancestor(src,'figure','toplevel'); -0323 gui = getappdata(fig_phase,'gui'); -0324 data = getappdata(fig_phase,'data'); +0313 set(get(ax1,'YLabel'),'FontSize',16); +0314 set(get(ax2,'YLabel'),'FontSize',16); +0315 +0316 end +0317 +0318 function pv_updateSlider(src,~) +0319 fig_phase = ancestor(src,'figure','toplevel'); +0320 gui = getappdata(fig_phase,'gui'); +0321 data = getappdata(fig_phase,'data'); +0322 +0323 data.phase = get(gui.slider,'Value'); +0324 set(gui.edit_phase,'String',num2str(data.phase)); 0325 -0326 data.phase = str2double(get(gui.edit_phase,'String')); -0327 set(gui.slider,'Value',data.phase); -0328 -0329 data.signal_rot = data.signal_raw * exp(1i*deg2rad(shift_phase(data.phase))); -0330 -0331 setappdata(fig_phase,'data',data); -0332 setappdata(fig_phase,'gui',gui); -0333 pv_showSignal(fig_phase); -0334 -0335 end -0336 -0337 function phase = shift_phase(phase) -0338 % shifts the phase values from [-180,180] to [0,360] -0339 phase = phase + 180; -0340 end +0326 data.signal_rot = data.signal_raw * exp(1i*deg2rad(shift_phase(data.phase))); +0327 +0328 setappdata(fig_phase,'data',data); +0329 setappdata(fig_phase,'gui',gui); +0330 pv_showSignal(fig_phase); +0331 +0332 end +0333 +0334 function pv_updatePhase(src,~) +0335 fig_phase = ancestor(src,'figure','toplevel'); +0336 gui = getappdata(fig_phase,'gui'); +0337 data = getappdata(fig_phase,'data'); +0338 +0339 data.phase = str2double(get(gui.edit_phase,'String')); +0340 set(gui.slider,'Value',data.phase); 0341 -0342 %------------- END OF CODE -------------- +0342 data.signal_rot = data.signal_raw * exp(1i*deg2rad(shift_phase(data.phase))); 0343 -0344 %% License: -0345 % MIT License -0346 % -0347 % Copyright (c) 2019 Thomas Hiller -0348 % -0349 % Permission is hereby granted, free of charge, to any person obtaining a copy -0350 % of this software and associated documentation files (the "Software"), to deal -0351 % in the Software without restriction, including without limitation the rights -0352 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -0353 % copies of the Software, and to permit persons to whom the Software is -0354 % furnished to do so, subject to the following conditions: -0355 % -0356 % The above copyright notice and this permission notice shall be included in all -0357 % copies or substantial portions of the Software. -0358 % -0359 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -0360 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -0361 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -0362 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -0363 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -0364 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -0365 % SOFTWARE. +0344 setappdata(fig_phase,'data',data); +0345 setappdata(fig_phase,'gui',gui); +0346 pv_showSignal(fig_phase); +0347 +0348 end +0349 +0350 function phase = shift_phase(phase) +0351 % shifts the phase values from [-180,180] to [0,360] +0352 phase = phase + 180; +0353 end +0354 +0355 %------------- END OF CODE -------------- +0356 +0357 %% License: +0358 % MIT License +0359 % +0360 % Copyright (c) 2019 Thomas Hiller +0361 % +0362 % Permission is hereby granted, free of charge, to any person obtaining a copy +0363 % of this software and associated documentation files (the "Software"), to deal +0364 % in the Software without restriction, including without limitation the rights +0365 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0366 % copies of the Software, and to permit persons to whom the Software is +0367 % furnished to do so, subject to the following conditions: +0368 % +0369 % The above copyright notice and this permission notice shall be included in all +0370 % copies or substantial portions of the Software. +0371 % +0372 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0373 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0374 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0375 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0376 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0377 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0378 % SOFTWARE.
    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/functions/interface/calculateGuiOnMonitorPosition.html b/doc/nucleus/functions/interface/calculateGuiOnMonitorPosition.html index f3b3702..81e6402 100644 --- a/doc/nucleus/functions/interface/calculateGuiOnMonitorPosition.html +++ b/doc/nucleus/functions/interface/calculateGuiOnMonitorPosition.html @@ -115,7 +115,7 @@

    SOURCE CODE ^if numel(scr) > 4 0046 % dual screen mode 0047 % GUI on second screen -0048 gh = 720; % reference height +0048 gh = 728; % reference height 0049 gw = ceil(gh*aspect_ratio); % reference width (1152) 0050 if any(scr(:,1)<0) 0051 pos = [-sw+(sw-gw)/2 (sh-gh)/3 gw gh]; @@ -131,7 +131,7 @@

    SOURCE CODE ^if any(scr(:,4)<800) 0062 gh = 600; % reference height for small screens 0063 else -0064 gh = 720; % reference height +0064 gh = 728; % reference height 0065 end 0066 gw = ceil(gh*aspect_ratio); % reference width (960) 0067 pos = [(sw-gw)/2 (sh-gh)/2 gw gh]; diff --git a/doc/nucleus/functions/interface/changeColorTheme.html b/doc/nucleus/functions/interface/changeColorTheme.html index c646a21..558c3cb 100644 --- a/doc/nucleus/functions/interface/changeColorTheme.html +++ b/doc/nucleus/functions/interface/changeColorTheme.html @@ -42,7 +42,14 @@

    DESCRIPTION ^DESCRIPTION ^CROSS-REFERENCE INFORMATION ^

    This function calls: +
  • getColorTheme returns the colors of the selected color theme
  • makeINIfile creates or updates the ini-File
  • updatePlotsCPS plots the CPS curve into the corresponding NUCLEUSmod axis
  • updatePlotsDistribution plots the RTD and PSD curves into NUCLEUSinv
  • updatePlotsJointInversion plots the joint-inversion results in NUCLEUSinv
  • updatePlotsNMR plots the forward modeled NMR data in NUCLEUSmod
  • updatePlotsPSD plots the pore size distribution in NUCLEUSmod
  • updatePlotsSignal plots the raw and processed NMR signals in NUCLEUSinv
  • This function is called by: @@ -85,125 +92,204 @@

    SOURCE CODE ^% changeColorTheme('INV','basic') 0016 % 0017 % Other m-files required: -0018 % none -0019 % -0020 % Subfunctions: -0021 % none -0022 % -0023 % MAT-files required: -0024 % none -0025 % -0026 % See also: NUCLEUSinv, NUCLEUSmod -0027 % Author: Thomas Hiller -0028 % email: thomas.hiller[at]leibniz-liag.de -0029 % License: MIT License (at end) -0030 -0031 %------------- BEGIN CODE -------------- -0032 -0033 %% get GUI handle and data -0034 fig = findobj('Tag',fig_tag); -0035 gui = getappdata(fig,'gui'); -0036 data = getappdata(fig,'data'); -0037 INVdata = getappdata(fig,'INVdata'); -0038 myui = gui.myui; +0018 % getColorTheme.m +0019 % makeINIfile.m +0020 % updatePlotsSignal.m +0021 % updatePlotsDistribution.m +0022 % updatePlotsJointInversion.m +0023 % updatePlotsPSD.m +0024 % updatePlotsCPS.m +0025 % updatePlotsNMR.m +0026 % +0027 % Subfunctions: +0028 % none +0029 % +0030 % MAT-files required: +0031 % none +0032 % +0033 % See also: NUCLEUSinv, NUCLEUSmod +0034 % Author: Thomas Hiller +0035 % email: thomas.hiller[at]leibniz-liag.de +0036 % License: MIT License (at end) +0037 +0038 %------------- BEGIN CODE -------------- 0039 -0040 % update the colors -0041 myui.colors = getColorTheme(fig_tag,th); -0042 -0043 % switch depending on the calling figure -0044 switch fig_tag -0045 case 'INV' -0046 -0047 % update ini-file -0048 myui.inidata.colortheme = th; -0049 gui.myui = myui; -0050 gui = makeINIfile(gui,'update'); -0051 -0052 % update the GUI elements -0053 set(gui.panels.data.main,'TitleColor',myui.colors.BoxDAT,... -0054 'ForegroundColor',myui.colors.BoxTitle); -0055 set(gui.panels.process.main,'TitleColor',myui.colors.BoxPRC,... -0056 'ForegroundColor',myui.colors.BoxTitle); -0057 set(gui.panels.petro.main,'TitleColor',myui.colors.BoxCBW,... -0058 'ForegroundColor',myui.colors.BoxTitle); -0059 set(gui.panels.invstd.main,'TitleColor',myui.colors.BoxINV,... -0060 'ForegroundColor',myui.colors.BoxTitle); -0061 set(gui.panels.invjoint.main,'TitleColor',myui.colors.BoxCPS,... -0062 'ForegroundColor',myui.colors.BoxTitle); -0063 set(gui.plots.SignalPanel,'BackgroundColor',myui.colors.TabSIG); -0064 set(gui.plots.DistPanel,'BackgroundColor',myui.colors.TabDIST); -0065 set(gui.plots.CPSPanel,'TitleColor',myui.colors.BoxCPS,... -0066 'ForegroundColor',myui.colors.BoxTitle); -0067 -0068 % check if there is data and change the colors accordingly -0069 gui.myui = myui; -0070 setappdata(fig,'gui',gui); -0071 if isfield(data,'results') -0072 updatePlotsSignal; -0073 if isfield(data.results,'invstd') -0074 updatePlotsDistribution; -0075 for i = 1:size(INVdata,1) -0076 if isstruct(INVdata{i}) -0077 % color the background -0078 strL = get(gui.listbox_handles.signal,'String'); -0079 str1 = data.import.NMR.filesShort{i}; -0080 str2 = ['<HTML><BODY bgcolor="rgb(',... -0081 sprintf('%d,%d,%d',gui.myui.colors.listINV.*255),... -0082 ')">',str1,'</BODY></HTML>']; -0083 strL{i} = str2; -0084 set(gui.listbox_handles.signal,'String',strL); -0085 end -0086 end -0087 end -0088 if isfield(data.results,'invjoint') -0089 updatePlotsJointInversion; -0090 end -0091 end -0092 -0093 case 'MOD' -0094 % update the GUI elements -0095 set(gui.panels.geometry.main,'TitleColor',myui.colors.GEO,... -0096 'ForegroundColor',myui.colors.BoxTitle); -0097 set(gui.panels.cps.main,'TitleColor',myui.colors.CPS,... -0098 'ForegroundColor',myui.colors.BoxTitle); -0099 set(gui.panels.nmr.main,'TitleColor',myui.colors.NMR,... -0100 'ForegroundColor',myui.colors.BoxTitle); -0101 set(gui.plots.GeoPanel,'TitleColor',myui.colors.GEO,... -0102 'ForegroundColor',myui.colors.BoxTitle); -0103 set(gui.plots.CPSPanel,'TitleColor',myui.colors.CPS,... -0104 'ForegroundColor',myui.colors.BoxTitle); -0105 set(gui.plots.NMRPanel,'TitleColor',myui.colors.NMR,... -0106 'ForegroundColor',myui.colors.BoxTitle); -0107 gui.myui = myui; -0108 setappdata(fig,'gui',gui); -0109 end -0110 -0111 end -0112 -0113 %------------- END OF CODE -------------- -0114 -0115 %% License: -0116 % MIT License -0117 % -0118 % Copyright (c) 2018 Thomas Hiller -0119 % -0120 % Permission is hereby granted, free of charge, to any person obtaining a copy -0121 % of this software and associated documentation files (the "Software"), to deal -0122 % in the Software without restriction, including without limitation the rights -0123 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -0124 % copies of the Software, and to permit persons to whom the Software is -0125 % furnished to do so, subject to the following conditions: -0126 % -0127 % The above copyright notice and this permission notice shall be included in all -0128 % copies or substantial portions of the Software. -0129 % -0130 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -0131 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -0132 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -0133 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -0134 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -0135 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -0136 % SOFTWARE. +0040 %% get GUI handle and data +0041 fig = findobj('Tag',fig_tag); +0042 gui = getappdata(fig,'gui'); +0043 data = getappdata(fig,'data'); +0044 myui = gui.myui; +0045 +0046 % update the colors +0047 myui.colors = getColorTheme(fig_tag,th); +0048 +0049 % switch depending on the calling figure +0050 switch fig_tag +0051 case 'INV' +0052 INVdata = getappdata(fig,'INVdata'); +0053 +0054 % update ini-file +0055 myui.inidata.colortheme = th; +0056 gui.myui = myui; +0057 gui = makeINIfile(gui,'update'); +0058 +0059 % set the background color for all uicontainer (HBox, VBox, etc.) +0060 h = findall(fig,'-depth',inf,'Type','uicontainer'); +0061 set(h,'BackGroundColor',myui.colors.panelBG); +0062 +0063 % edit field (axes labels) +0064 h = findall(fig,'Type','uicontrol','-and','Style','edit'); +0065 set(h,'BackGroundColor',myui.colors.editBG,'ForeGroundColor',myui.colors.panelFG); +0066 +0067 % axes +0068 h = findall(fig,'Type','Axes'); +0069 set(h,'Color',myui.colors.axisBG,'XColor',myui.colors.axisFG,'YColor',myui.colors.axisFG); +0070 +0071 % text field +0072 h = findobj(fig,'Type','uicontrol','-and','Style','text'); +0073 set(h,'BackGroundColor',myui.colors.panelBG,'ForeGroundColor',myui.colors.panelFG); +0074 +0075 % radio controls +0076 h = findobj(fig,'Type','uicontrol','-and','Style','radiobutton'); +0077 set(h,'BackGroundColor',myui.colors.panelBG,'ForeGroundColor',myui.colors.panelFG); +0078 +0079 % popup controls +0080 h = findobj(fig,'Type','uicontrol','-and','Style','popup'); +0081 set(h,'BackGroundColor',myui.colors.editBG,'ForeGroundColor',myui.colors.panelFG); +0082 +0083 % listbox controls +0084 h = findobj(fig,'Type','uicontrol','-and','Style','listbox'); +0085 set(h,'BackGroundColor',myui.colors.editBG,'ForeGroundColor',myui.colors.panelFG); +0086 +0087 % uitable +0088 h = findobj(fig,'Type','uitable'); +0089 set(h,'BackGroundColor',myui.colors.tableBG,'ForeGroundColor',myui.colors.tableFG); +0090 +0091 % update the GUI elements +0092 set(gui.panels.data.main,'TitleColor',myui.colors.BoxDAT,... +0093 'ForegroundColor',myui.colors.BoxTitle); +0094 set(gui.panels.process.main,'TitleColor',myui.colors.BoxPRC,... +0095 'ForegroundColor',myui.colors.BoxTitle); +0096 set(gui.panels.petro.main,'TitleColor',myui.colors.BoxCBW,... +0097 'ForegroundColor',myui.colors.BoxTitle); +0098 set(gui.panels.invstd.main,'TitleColor',myui.colors.BoxINV,... +0099 'ForegroundColor',myui.colors.BoxTitle); +0100 set(gui.panels.invjoint.main,'TitleColor',myui.colors.BoxCPS,... +0101 'ForegroundColor',myui.colors.BoxTitle,'BackgroundColor',myui.colors.panelBG); +0102 set(gui.panels.invjoint.Tabs,'BackgroundColor',myui.colors.panelBG,... +0103 'ForeGroundColor',myui.colors.panelFG) +0104 set(gui.plots.SignalPanel,'BackgroundColor',myui.colors.TabSIG,... +0105 'ForeGroundColor',myui.colors.BoxTitle); +0106 set(gui.plots.DistPanel,'BackgroundColor',myui.colors.TabDIST,... +0107 'ForeGroundColor',myui.colors.BoxTitle); +0108 set(gui.plots.CPSPanel,'TitleColor',myui.colors.BoxCPS,... +0109 'ForegroundColor',myui.colors.BoxTitle); +0110 set(gui.panels.info.signal,'BackgroundColor',myui.colors.panelBG,... +0111 'ForeGroundColor',myui.colors.panelFG); +0112 set(gui.panels.info.dist,'BackgroundColor',myui.colors.panelBG,... +0113 'ForeGroundColor',myui.colors.panelFG); +0114 set(gui.panels.info.cps,'BackgroundColor',myui.colors.panelBG,... +0115 'ForeGroundColor',myui.colors.panelFG); +0116 +0117 % update axes +0118 gui.myui = myui; +0119 setappdata(fig,'gui',gui); +0120 if isfield(data,'results') +0121 updatePlotsSignal; +0122 if isfield(data.results,'invstd') +0123 updatePlotsDistribution; +0124 end +0125 if isfield(data.results,'invjoint') +0126 updatePlotsJointInversion; +0127 end +0128 end +0129 % update listbox entries +0130 for i = 1:size(INVdata,1) +0131 if isstruct(INVdata{i}) +0132 % color the background +0133 strL = get(gui.listbox_handles.signal,'String'); +0134 str1 = data.import.NMR.filesShort{i}; +0135 str2 = ['<HTML><BODY bgcolor="rgb(',... +0136 sprintf('%d,%d,%d',gui.myui.colors.listINV.*255),... +0137 ')">',str1,'</BODY></HTML>']; +0138 strL{i} = str2; +0139 set(gui.listbox_handles.signal,'String',strL); +0140 end +0141 end +0142 +0143 case 'MOD' +0144 % set the background color for all uicontainer (HBox, VBox, etc.) +0145 h = findall(fig,'-depth',inf,'Type','uicontainer'); +0146 set(h,'BackGroundColor',myui.colors.panelBG); +0147 +0148 % edit field (axes labels) +0149 h = findall(fig,'Type','uicontrol','-and','Style','edit'); +0150 set(h,'BackGroundColor',myui.colors.editBG,'ForeGroundColor',myui.colors.panelFG); +0151 +0152 % axes +0153 h = findall(fig,'Type','Axes'); +0154 set(h,'Color',myui.colors.axisBG,'XColor',myui.colors.axisFG,'YColor',myui.colors.axisFG); +0155 +0156 % text field +0157 h = findobj(fig,'Type','uicontrol','-and','Style','text'); +0158 set(h,'BackGroundColor',myui.colors.panelBG,'ForeGroundColor',myui.colors.panelFG); +0159 +0160 % popup controls +0161 h = findobj(fig,'Type','uicontrol','-and','Style','popup'); +0162 set(h,'BackGroundColor',myui.colors.editBG,'ForeGroundColor',myui.colors.panelFG); +0163 +0164 % uitable +0165 h = findobj(fig,'Type','uitable'); +0166 set(h,'BackGroundColor',myui.colors.tableBG,'ForeGroundColor',myui.colors.tableFG); +0167 +0168 % update the GUI elements +0169 set(gui.panels.geometry.main,'TitleColor',myui.colors.GEO,... +0170 'ForegroundColor',myui.colors.BoxTitle); +0171 set(gui.panels.cps.main,'TitleColor',myui.colors.CPS,... +0172 'ForegroundColor',myui.colors.BoxTitle); +0173 set(gui.panels.nmr.main,'TitleColor',myui.colors.NMR,... +0174 'ForegroundColor',myui.colors.BoxTitle); +0175 set(gui.plots.GeoPanel,'TitleColor',myui.colors.GEO,... +0176 'ForegroundColor',myui.colors.BoxTitle); +0177 set(gui.plots.CPSPanel,'TitleColor',myui.colors.CPS,... +0178 'ForegroundColor',myui.colors.BoxTitle); +0179 set(gui.plots.NMRPanel,'TitleColor',myui.colors.NMR,... +0180 'ForegroundColor',myui.colors.BoxTitle); +0181 gui.myui = myui; +0182 setappdata(fig,'gui',gui); +0183 +0184 % update the axes +0185 updatePlotsPSD; +0186 updatePlotsCPS; +0187 updatePlotsNMR; +0188 end +0189 +0190 end +0191 +0192 %------------- END OF CODE -------------- +0193 +0194 %% License: +0195 % MIT License +0196 % +0197 % Copyright (c) 2018 Thomas Hiller +0198 % +0199 % Permission is hereby granted, free of charge, to any person obtaining a copy +0200 % of this software and associated documentation files (the "Software"), to deal +0201 % in the Software without restriction, including without limitation the rights +0202 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0203 % copies of the Software, and to permit persons to whom the Software is +0204 % furnished to do so, subject to the following conditions: +0205 % +0206 % The above copyright notice and this permission notice shall be included in all +0207 % copies or substantial portions of the Software. +0208 % +0209 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0210 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0211 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0212 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0213 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0214 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0215 % SOFTWARE.
    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/functions/interface/displayStatusText.html b/doc/nucleus/functions/interface/displayStatusText.html index 6f177e8..b524fdd 100644 --- a/doc/nucleus/functions/interface/displayStatusText.html +++ b/doc/nucleus/functions/interface/displayStatusText.html @@ -62,7 +62,7 @@

    CROSS-REFERENCE INFORMATION ^
 </ul>
 This function is called by:
 <ul style= -
  • NUCLEUSinv_createGUI controls the creation of all GUI elements
  • NUCLEUSmod_createGUI controls the creation of all GUI elements
  • calculateNMR calculates the NMR signals for the full and partially saturated
  • caluclatePressureSaturation calculates the geometry dependent pressure
  • exportData exports data from both GUIs into various formats
  • exportGraphics exports graphics from both GUIs into various formats
  • exportINV exports NUCLEUSinv GUI data to a mat-file
  • importNMRdata is the general import routine for NMR data
  • runInversionBatch batch processes the inversion using for all NMR signals
  • runInversionJoint controls the joint inversion process to infer a pore size
  • runInversionStd controls the standard inversion process to invert a
  • useSignalAsCalibration uses E0 as porosity calibration factor.
  • +
  • NUCLEUSinv_createGUI controls the creation of all GUI elements
  • NUCLEUSmod_createGUI controls the creation of all GUI elements
  • calculateNMR calculates the NMR signals for the full and partially saturated
  • caluclatePressureSaturation calculates the geometry dependent pressure
  • exportData exports data from both GUIs into various formats
  • exportGraphics exports graphics from both GUIs into various formats
  • exportINV exports NUCLEUSinv GUI data to a mat-file
  • importCalibrationData
  • importNMRdata is the general import routine for NMR data
  • runInversionBatch batch processes the inversion using for all NMR signals
  • runInversionJoint controls the joint inversion process to infer a pore size
  • runInversionStd controls the standard inversion process to invert a
  • useSignalAsCalibration uses E0 as porosity calibration factor.
  • diff --git a/doc/nucleus/functions/interface/exportGraphics.html b/doc/nucleus/functions/interface/exportGraphics.html index 19f6a89..653f8be 100644 --- a/doc/nucleus/functions/interface/exportGraphics.html +++ b/doc/nucleus/functions/interface/exportGraphics.html @@ -108,7 +108,7 @@

    SOURCE CODE ^% get GUI position 0039 posf = get(fig,'Position'); 0040 % opening the figure -0041 expfig = figure; +0041 expfig = figure('Color',gui.myui.colors.panelBG); 0042 0043 % check which layout 0044 switch get(gui.menu.file_export_graphics_layout_vert,'Checked') @@ -218,213 +218,216 @@

    SOURCE CODE ^% add the legend(s) and remove the info lines (CBW etc) from the 0149 % distribution plots 0150 if isjoint -0151 legend(ax1,'show'); -0152 legend(ax3,'show'); -0153 h1 = findobj([ax1 ax2 ax3],'Tag','infolines'); -0154 h2 = findobj([ax1 ax2 ax3],'Tag','TLGM'); -0155 else -0156 legend(ax1,'show'); -0157 h1 = findobj([ax1 ax2],'Tag','infolines'); -0158 h2 = findobj([ax1 ax2],'Tag','TLGM'); -0159 end -0160 if ~isempty(h1) -0161 delete(h1); +0151 lgh1 = legend(ax1,'show'); +0152 lgh2 = legend(ax3,'show'); +0153 set(lgh1,'TextColor',gui.myui.colors.panelFG); +0154 set(lgh2,'TextColor',gui.myui.colors.panelFG); +0155 h1 = findobj([ax1 ax2 ax3],'Tag','infolines'); +0156 h2 = findobj([ax1 ax2 ax3],'Tag','TLGM'); +0157 else +0158 lgh = legend(ax1,'show'); +0159 set(lgh,'TextColor',gui.myui.colors.panelFG); +0160 h1 = findobj([ax1 ax2],'Tag','infolines'); +0161 h2 = findobj([ax1 ax2],'Tag','TLGM'); 0162 end -0163 if ~isempty(h2) -0164 delete(h2); +0163 if ~isempty(h1) +0164 delete(h1); 0165 end -0166 -0167 % adjust the export figure height and axes size -0168 switch horzvert -0169 case 'horz' -0170 axis(ax1,'square'); -0171 axis(ax2,'square'); -0172 if isjoint -0173 axis(ax3,'square'); -0174 end -0175 set(expfig,'Position',[posf(1) posf(2)*1.25 posf(3) posf(4)*0.75]); -0176 case 'vert' -0177 set(expfig,'Position',[posf(1)+300 posf(2) (posf(3)-300)*0.8 posf(4)*0.8]); -0178 end -0179 -0180 % adjust the figure layout on A4 -0181 figno = get(expfig,'Number'); -0182 if isjoint -0183 figname = ['Figure ',num2str(figno),... -0184 ': joint inv ',data.invjoint.invtype,' ',... -0185 data.invjoint.geometry_type]; -0186 else -0187 figname = ['Figure ',num2str(figno),... -0188 ': std inv ',data.invstd.invtype]; -0189 end -0190 set(expfig,'Name',figname,'NumberTitle','off'); -0191 switch horzvert -0192 case 'horz' -0193 set(expfig,'PaperType','A4','PaperUnits','centimeters',... -0194 'PaperOrientation','landscape'); -0195 set(expfig,'PaperPositionMode','manual',... -0196 'PaperPosition',[0.6 3.8 28.4 13.3]); -0197 case 'vert' -0198 set(expfig,'PaperType','A4','PaperUnits','centimeters',... -0199 'PaperOrientation','portrait'); -0200 if isjoint -0201 set(expfig,'PaperPositionMode','manual',... -0202 'PaperPosition',[0.6 3.8 18 19.5]); -0203 else +0166 if ~isempty(h2) +0167 delete(h2); +0168 end +0169 +0170 % adjust the export figure height and axes size +0171 switch horzvert +0172 case 'horz' +0173 axis(ax1,'square'); +0174 axis(ax2,'square'); +0175 if isjoint +0176 axis(ax3,'square'); +0177 end +0178 set(expfig,'Position',[posf(1) posf(2)*1.25 posf(3) posf(4)*0.75]); +0179 case 'vert' +0180 set(expfig,'Position',[posf(1)+300 posf(2) (posf(3)-300)*0.8 posf(4)*0.8]); +0181 end +0182 +0183 % adjust the figure layout on A4 +0184 figno = get(expfig,'Number'); +0185 if isjoint +0186 figname = ['Figure ',num2str(figno),... +0187 ': joint inv ',data.invjoint.invtype,' ',... +0188 data.invjoint.geometry_type]; +0189 else +0190 figname = ['Figure ',num2str(figno),... +0191 ': std inv ',data.invstd.invtype]; +0192 end +0193 set(expfig,'Name',figname,'NumberTitle','off'); +0194 switch horzvert +0195 case 'horz' +0196 set(expfig,'PaperType','A4','PaperUnits','centimeters',... +0197 'PaperOrientation','landscape'); +0198 set(expfig,'PaperPositionMode','manual',... +0199 'PaperPosition',[0.6 3.8 28.4 13.3]); +0200 case 'vert' +0201 set(expfig,'PaperType','A4','PaperUnits','centimeters',... +0202 'PaperOrientation','portrait'); +0203 if isjoint 0204 set(expfig,'PaperPositionMode','manual',... -0205 'PaperPosition',[1.5 5 18 19.5]); -0206 end -0207 end -0208 set(expfig,'Renderer','painter'); -0209 % not nice but necessary (otherwise the uiputfile-dialog is hidden) -0210 drawnow; -0211 -0212 case 'MOD' -0213 % create dummy subplots on the export figure to extract the -0214 % standard positions -0215 switch horzvert -0216 case 'horz' -0217 ax1 = subplot(1,3,1,'Parent',expfig); -0218 ax2 = subplot(1,3,2,'Parent',expfig); -0219 ax3 = subplot(1,3,3,'Parent',expfig); -0220 case 'vert' -0221 ax1 = subplot(3,1,1,'Parent',expfig); -0222 ax2 = subplot(3,1,2,'Parent',expfig); -0223 ax3 = subplot(3,1,3,'Parent',expfig); -0224 end -0225 pos1 = get(ax1,'Position'); -0226 pos2 = get(ax2,'Position'); -0227 pos3 = get(ax3,'Position'); -0228 delete(ax1);delete(ax2);delete(ax3); -0229 -0230 % copy the GUI axes to the export figure -0231 ax1 = copyobj(gui.axes_handles.geo,expfig); -0232 ax2 = copyobj(gui.axes_handles.cps,expfig); -0233 ax3 = copyobj(gui.axes_handles.nmr,expfig); -0234 % and update with the standard positions -0235 set(ax1,'Position',pos1); -0236 set(ax2,'Position',pos2); -0237 set(ax3,'Position',pos3); -0238 lh2 = legend(ax2,'show','Location','NorthEast'); -0239 set(lh2,'FontSize',10); -0240 -0241 % adjust the export figure height and axes size -0242 switch horzvert -0243 case 'horz' -0244 axis(ax1,'square'); -0245 axis(ax2,'square'); -0246 axis(ax3,'square'); -0247 ax11 = copyobj(gui.axes_handles.type,expfig); -0248 set(ax11,'Position',[0.27 0.625 0.08 0.08]); -0249 set(expfig,'Position',[posf(1) posf(2)*1.25 posf(3) posf(4)*0.75]); -0250 case 'vert' -0251 ax11 = copyobj(gui.axes_handles.type,expfig); -0252 set(ax11,'Position',[0.8 0.825 0.08 0.08]); -0253 set(expfig,'Position',[posf(1)+300 posf(2) (posf(3)-300)*0.8 posf(4)*0.8]); -0254 end -0255 -0256 % adjust the figure layout on A4 -0257 figno = get(expfig,'Number'); -0258 type = get(gui.popup_handles.geometry_type,'String'); -0259 type = type{get(gui.popup_handles.geometry_type,'Value')}; -0260 figname = ['Figure ',num2str(figno),': ',type]; -0261 set(expfig,'Name',figname,'NumberTitle','off'); -0262 switch horzvert -0263 case 'horz' -0264 set(expfig,'PaperType','A4','PaperUnits','centimeters',... -0265 'PaperOrientation','landscape'); -0266 case 'vert' +0205 'PaperPosition',[0.6 3.8 18 19.5]); +0206 else +0207 set(expfig,'PaperPositionMode','manual',... +0208 'PaperPosition',[1.5 5 18 19.5]); +0209 end +0210 end +0211 set(expfig,'Renderer','painter'); +0212 % not nice but necessary (otherwise the uiputfile-dialog is hidden) +0213 drawnow; +0214 +0215 case 'MOD' +0216 % create dummy subplots on the export figure to extract the +0217 % standard positions +0218 switch horzvert +0219 case 'horz' +0220 ax1 = subplot(1,3,1,'Parent',expfig); +0221 ax2 = subplot(1,3,2,'Parent',expfig); +0222 ax3 = subplot(1,3,3,'Parent',expfig); +0223 case 'vert' +0224 ax1 = subplot(3,1,1,'Parent',expfig); +0225 ax2 = subplot(3,1,2,'Parent',expfig); +0226 ax3 = subplot(3,1,3,'Parent',expfig); +0227 end +0228 pos1 = get(ax1,'Position'); +0229 pos2 = get(ax2,'Position'); +0230 pos3 = get(ax3,'Position'); +0231 delete(ax1);delete(ax2);delete(ax3); +0232 +0233 % copy the GUI axes to the export figure +0234 ax1 = copyobj(gui.axes_handles.geo,expfig); +0235 ax2 = copyobj(gui.axes_handles.cps,expfig); +0236 ax3 = copyobj(gui.axes_handles.nmr,expfig); +0237 % and update with the standard positions +0238 set(ax1,'Position',pos1); +0239 set(ax2,'Position',pos2); +0240 set(ax3,'Position',pos3); +0241 lh2 = legend(ax2,'show','Location','NorthEast'); +0242 set(lh2,'FontSize',10,'TextColor',gui.myui.colors.panelFG); +0243 +0244 % adjust the export figure height and axes size +0245 switch horzvert +0246 case 'horz' +0247 axis(ax1,'square'); +0248 axis(ax2,'square'); +0249 axis(ax3,'square'); +0250 ax11 = copyobj(gui.axes_handles.type,expfig); +0251 set(ax11,'Position',[0.27 0.625 0.08 0.08]); +0252 set(expfig,'Position',[posf(1) posf(2)*1.25 posf(3) posf(4)*0.75]); +0253 case 'vert' +0254 ax11 = copyobj(gui.axes_handles.type,expfig); +0255 set(ax11,'Position',[0.8 0.825 0.08 0.08]); +0256 set(expfig,'Position',[posf(1)+300 posf(2) (posf(3)-300)*0.8 posf(4)*0.8]); +0257 end +0258 +0259 % adjust the figure layout on A4 +0260 figno = get(expfig,'Number'); +0261 type = get(gui.popup_handles.geometry_type,'String'); +0262 type = type{get(gui.popup_handles.geometry_type,'Value')}; +0263 figname = ['Figure ',num2str(figno),': ',type]; +0264 set(expfig,'Name',figname,'NumberTitle','off'); +0265 switch horzvert +0266 case 'horz' 0267 set(expfig,'PaperType','A4','PaperUnits','centimeters',... -0268 'PaperOrientation','portrait'); -0269 set(expfig,'PaperPositionMode','manual',... -0270 'PaperPosition',[1.5 5 18 19.5]); -0271 end -0272 set(expfig,'Renderer','painter'); -0273 % not nice but necessary (otherwise the uiputfile-dialog is hidden) -0274 drawnow; -0275 end -0276 -0277 %% export to file -0278 switch format -0279 case {'png','tiff','eps'} -0280 -0281 switch format -0282 case 'png' -0283 statstr = 'PNG'; -0284 putext = '*.png'; -0285 put1 = 'Portable Network Graphics file'; -0286 driver = '-dpng'; -0287 case 'tiff' -0288 statstr = 'TIFF'; -0289 putext = '*.tiff'; -0290 put1 = 'TIFF file'; -0291 driver = '-dtiff'; -0292 case 'eps' -0293 statstr = 'EPS'; -0294 putext = '*.eps'; -0295 put1 = 'EPS file'; -0296 driver = '-depsc'; -0297 end -0298 -0299 displayStatusText(gui,['Saving ',statstr,'-file ...']); -0300 -0301 switch fig_tag -0302 case 'INV' -0303 [FileName,PathName,~] = uiputfile({putext,put1},... -0304 ['NUCLEUSinv: Save ',statstr,' Graphics'],... -0305 fullfile(pwd,'NUCLEUSinv_inversion')); -0306 case 'MOD' -0307 [FileName,PathName,~] = uiputfile({putext,put1},... -0308 ['NUCLEUSmod: Save ',statstr,' Graphics'],... -0309 fullfile(pwd,'NUCLEUSmod_forward')); -0310 end -0311 if ~isequal(FileName,0) || ~isequal(PathName,0) -0312 print(expfig,fullfile(PathName,FileName),'-r300',driver); -0313 close(expfig); -0314 displayStatusText(gui,['Saving ',statstr,'-file ... done.']); -0315 else -0316 displayStatusText(gui,['Saving ',statstr,'-file ... canceled.']); -0317 figure(expfig); -0318 end -0319 otherwise -0320 % nothing to do ... fig-files are not saved automatically -0321 end -0322 -0323 if nargout > 0 -0324 varargout{1} = expfig; -0325 if isjoint -0326 varargout{2} = [ax1 ax2 ax3]; -0327 else -0328 varargout{2} = [ax1 ax2]; -0329 end -0330 end -0331 -0332 end -0333 -0334 %------------- END OF CODE -------------- -0335 -0336 %% License: -0337 % MIT License -0338 % -0339 % Copyright (c) 2018 Thomas Hiller -0340 % -0341 % Permission is hereby granted, free of charge, to any person obtaining a copy -0342 % of this software and associated documentation files (the "Software"), to deal -0343 % in the Software without restriction, including without limitation the rights -0344 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -0345 % copies of the Software, and to permit persons to whom the Software is -0346 % furnished to do so, subject to the following conditions: -0347 % -0348 % The above copyright notice and this permission notice shall be included in all -0349 % copies or substantial portions of the Software. +0268 'PaperOrientation','landscape'); +0269 case 'vert' +0270 set(expfig,'PaperType','A4','PaperUnits','centimeters',... +0271 'PaperOrientation','portrait'); +0272 set(expfig,'PaperPositionMode','manual',... +0273 'PaperPosition',[1.5 5 18 19.5]); +0274 end +0275 set(expfig,'Renderer','painter'); +0276 % not nice but necessary (otherwise the uiputfile-dialog is hidden) +0277 drawnow; +0278 end +0279 +0280 %% export to file +0281 switch format +0282 case {'png','tiff','eps'} +0283 +0284 switch format +0285 case 'png' +0286 statstr = 'PNG'; +0287 putext = '*.png'; +0288 put1 = 'Portable Network Graphics file'; +0289 driver = '-dpng'; +0290 case 'tiff' +0291 statstr = 'TIFF'; +0292 putext = '*.tiff'; +0293 put1 = 'TIFF file'; +0294 driver = '-dtiff'; +0295 case 'eps' +0296 statstr = 'EPS'; +0297 putext = '*.eps'; +0298 put1 = 'EPS file'; +0299 driver = '-depsc'; +0300 end +0301 +0302 displayStatusText(gui,['Saving ',statstr,'-file ...']); +0303 +0304 switch fig_tag +0305 case 'INV' +0306 [FileName,PathName,~] = uiputfile({putext,put1},... +0307 ['NUCLEUSinv: Save ',statstr,' Graphics'],... +0308 fullfile(pwd,'NUCLEUSinv_inversion')); +0309 case 'MOD' +0310 [FileName,PathName,~] = uiputfile({putext,put1},... +0311 ['NUCLEUSmod: Save ',statstr,' Graphics'],... +0312 fullfile(pwd,'NUCLEUSmod_forward')); +0313 end +0314 if ~isequal(FileName,0) || ~isequal(PathName,0) +0315 print(expfig,fullfile(PathName,FileName),'-r300',driver); +0316 close(expfig); +0317 displayStatusText(gui,['Saving ',statstr,'-file ... done.']); +0318 else +0319 displayStatusText(gui,['Saving ',statstr,'-file ... canceled.']); +0320 figure(expfig); +0321 end +0322 otherwise +0323 % nothing to do ... fig-files are not saved automatically +0324 end +0325 +0326 if nargout > 0 +0327 varargout{1} = expfig; +0328 if isjoint +0329 varargout{2} = [ax1 ax2 ax3]; +0330 else +0331 varargout{2} = [ax1 ax2]; +0332 end +0333 end +0334 +0335 end +0336 +0337 %------------- END OF CODE -------------- +0338 +0339 %% License: +0340 % MIT License +0341 % +0342 % Copyright (c) 2018 Thomas Hiller +0343 % +0344 % Permission is hereby granted, free of charge, to any person obtaining a copy +0345 % of this software and associated documentation files (the "Software"), to deal +0346 % in the Software without restriction, including without limitation the rights +0347 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0348 % copies of the Software, and to permit persons to whom the Software is +0349 % furnished to do so, subject to the following conditions: 0350 % -0351 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -0352 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -0353 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -0354 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -0355 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -0356 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -0357 % SOFTWARE. +0351 % The above copyright notice and this permission notice shall be included in all +0352 % copies or substantial portions of the Software. +0353 % +0354 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0355 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0356 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0357 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0358 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0359 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0360 % SOFTWARE.
    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/functions/interface/fixAxes.html b/doc/nucleus/functions/interface/fixAxes.html index 9845cf9..e3bcd9c 100644 --- a/doc/nucleus/functions/interface/fixAxes.html +++ b/doc/nucleus/functions/interface/fixAxes.html @@ -65,7 +65,7 @@

    CROSS-REFERENCE INFORMATION ^
 </ul>
 This function is called by:
 <ul style= -
  • NUCLEUSinv_createPanelPlots creates graphics panel
  • NUCLEUSmod_createPanelPlots creates graphics panel
  • onMenuJointInversion handles the call from the menu that activates / deactivates
  • +
  • NUCLEUSinv_createPanelPlots creates graphics panel
  • NUCLEUSmod_createGUI controls the creation of all GUI elements
  • NUCLEUSmod_createPanelPlots creates graphics panel
  • onMenuJointInversion handles the call from the menu that activates / deactivates
  • diff --git a/doc/nucleus/functions/interface/getColorTheme.html b/doc/nucleus/functions/interface/getColorTheme.html index 7f07629..3ce09f5 100644 --- a/doc/nucleus/functions/interface/getColorTheme.html +++ b/doc/nucleus/functions/interface/getColorTheme.html @@ -119,81 +119,174 @@

    SOURCE CODE ^% blue 0050 colors.IM = [119 172 48]./255; % green 0051 colors.FIT = [217 83 25]./255; % red -0052 case 'basic' -0053 colors.BoxTitle = [1 1 1]; % white -0054 colors.BoxDAT = [0.05 0.25 0.5]; % dark blue -0055 colors.BoxINV = [0.05 0.25 0.5]; % dark blue -0056 colors.BoxPRC = [0.05 0.25 0.5]; % dark blue -0057 colors.BoxCPS = [0.05 0.25 0.5]; % dark blue -0058 colors.BoxCBW = [0.05 0.25 0.5]; % dark blue -0059 colors.TabSIG = [0.94 0.94 0.94]; % grey -0060 colors.TabDIST = [0.94 0.94 0.94]; % grey -0061 colors.listINV = [0 164 0]./255; % green -0062 colors.RE = [0 0 255./255]; % blue -0063 colors.IM = [0 164 0]./255; % green -0064 colors.FIT = [255 0 0]./255; % red -0065 case 'dark' -0066 colors.BoxTitle = [1 1 1]; % white -0067 colors.BoxDAT = [0.35 0.35 0.35]; % grey -0068 colors.BoxINV = [0.35 0.35 0.35]; % grey -0069 colors.BoxPRC = [0.35 0.35 0.35]; % grey -0070 colors.BoxCPS = [0.35 0.35 0.35]; % grey -0071 colors.BoxCBW = [0.35 0.35 0.35]; % grey -0072 colors.TabSIG = [0.94 0.94 0.94]; % grey -0073 colors.TabDIST = [0.94 0.94 0.94]; % grey -0074 colors.listINV = [0 164 0]./255; % green -0075 colors.IM = [0 148 0]./255; % green -0076 colors.RE = [0 0 148]./255; % blue -0077 colors.FIT = [148 0 0]./255; % red -0078 end -0079 -0080 case 'MOD' -0081 % chose selected theme -0082 switch th -0083 case 'standard' +0052 colors.editBG = [1 1 1]; % white +0053 colors.panelBG = [0.94 0.94 0.94]; % default grey +0054 colors.panelFG = [0 0 0]; % black +0055 colors.axisBG = [1 1 1]; % white +0056 colors.axisFG = [0.15 0.15 0.15]; % dark grey +0057 colors.axisL = [0.5 0.5 0.5]; % medium grey +0058 colors.tableBG = [1 1 1; 0.94 0.94 0.94]; % default white & grey +0059 colors.tableFG = [0 0 0]; % black +0060 +0061 case 'basic' +0062 colors.BoxTitle = [1 1 1]; % white +0063 colors.BoxDAT = [0.05 0.25 0.5]; % dark blue +0064 colors.BoxINV = [0.05 0.25 0.5]; % dark blue +0065 colors.BoxPRC = [0.05 0.25 0.5]; % dark blue +0066 colors.BoxCPS = [0.05 0.25 0.5]; % dark blue +0067 colors.BoxCBW = [0.05 0.25 0.5]; % dark blue +0068 colors.TabSIG = [0.05 0.25 0.5]; % dark blue +0069 colors.TabDIST = [0.05 0.25 0.5]; % dark blue +0070 colors.listINV = [0 164 0]./255; % green +0071 colors.RE = [0 0 255./255]; % blue +0072 colors.IM = [0 164 0]./255; % green +0073 colors.FIT = [255 0 0]./255; % red +0074 colors.editBG = [1 1 1]; % white +0075 colors.panelBG = [0.94 0.94 0.94]; % default grey +0076 colors.panelFG = [0 0 0]; % black +0077 colors.axisBG = [1 1 1]; % white +0078 colors.axisFG = [0.15 0.15 0.15]; % dark grey +0079 colors.axisL = [0.5 0.5 0.5]; % medium grey +0080 colors.tableBG = [1 1 1; 0.94 0.94 0.94]; % default white & grey +0081 colors.tableFG = [0 0 0]; % black +0082 +0083 case 'dark' 0084 colors.BoxTitle = [0 0 0]; % black -0085 colors.GEO = [189 183 107]./255; % darkkhaki -0086 colors.NMR = [143 188 143]./255; % darkseagreen -0087 colors.CPS = [100 149 237]./255; % cornflowerblue -0088 case 'basic' -0089 colors.BoxTitle = [1 1 1]; % white -0090 colors.GEO = [0.05 0.25 0.5]; % dark blue -0091 colors.NMR = [0.05 0.25 0.5]; % dark blue -0092 colors.CPS = [0.05 0.25 0.5]; % dark blue -0093 case 'dark' -0094 colors.BoxTitle = [1 1 1]; % white -0095 colors.GEO = [0.35 0.35 0.35]; % grey -0096 colors.NMR = [0.35 0.35 0.35]; % grey -0097 colors.CPS = [0.35 0.35 0.35]; % grey -0098 end -0099 end -0100 -0101 end -0102 -0103 %------------- END OF CODE -------------- -0104 -0105 %% License: -0106 % MIT License -0107 % -0108 % Copyright (c) 2018 Thomas Hiller -0109 % -0110 % Permission is hereby granted, free of charge, to any person obtaining a copy -0111 % of this software and associated documentation files (the "Software"), to deal -0112 % in the Software without restriction, including without limitation the rights -0113 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -0114 % copies of the Software, and to permit persons to whom the Software is -0115 % furnished to do so, subject to the following conditions: -0116 % -0117 % The above copyright notice and this permission notice shall be included in all -0118 % copies or substantial portions of the Software. -0119 % -0120 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -0121 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -0122 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -0123 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -0124 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -0125 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -0126 % SOFTWARE. +0085 colors.BoxDAT = [222 184 135]./255; % burlywood +0086 colors.BoxINV = [189 183 107]./255; % darkkhaki +0087 colors.BoxPRC = [143 188 143]./255; % darkseagreen +0088 colors.BoxCPS = [100 149 237]./255; % cornflowerblue +0089 colors.BoxCBW = [216 112 147]./255; % palevioletred +0090 colors.TabSIG = [143 188 143]./255; % darkseagreen +0091 colors.TabDIST = [189 183 107]./255; % darkkhaki +0092 colors.listINV = [189 183 107]./255; % darkkhaki +0093 colors.RE = [0 114 189]./255; % blue +0094 colors.IM = [119 172 48]./255; % green +0095 colors.FIT = [217 83 25]./255; % red +0096 colors.editBG = [0.1 0.1 0.1]; % very dark grey +0097 colors.panelBG = [0.2 0.2 0.2]; % black +0098 colors.panelFG = [1 1 1]; % white +0099 colors.axisBG = [0.1 0.1 0.1]; % very dark grey +0100 colors.axisFG = [1 1 1]; % white +0101 colors.axisL = [0.8 0.8 0.8]; % very light grey +0102 colors.tableBG = [0.1 0.1 0.1; 0.2 0.2 0.2]; % default white & grey +0103 colors.tableFG = [1 1 1]; % white +0104 +0105 case 'black' +0106 colors.BoxTitle = [1 1 1]; % white +0107 colors.BoxDAT = [0.35 0.35 0.35]; % grey +0108 colors.BoxINV = [0.35 0.35 0.35]; % grey +0109 colors.BoxPRC = [0.35 0.35 0.35]; % grey +0110 colors.BoxCPS = [0.35 0.35 0.35]; % grey +0111 colors.BoxCBW = [0.35 0.35 0.35]; % grey +0112 colors.TabSIG = [0.35 0.35 0.35]; % grey +0113 colors.TabDIST = [0.35 0.35 0.35]; % grey +0114 colors.listINV = [189 183 107]./255; % darkkhaki +0115 colors.RE = [0 114 189]./255; % blue +0116 colors.IM = [119 172 48]./255; % green +0117 colors.FIT = [217 83 25]./255; % red +0118 colors.editBG = [0 0 0]; % very dark grey +0119 colors.panelBG = [0 0 0]; % black +0120 colors.panelFG = [1 1 1]; % white +0121 colors.axisBG = [0 0 0]; % very dark grey +0122 colors.axisFG = [1 1 1]; % white +0123 colors.axisL = [0.9 0.9 0.9]; % very light grey +0124 colors.tableBG = [0 0 0 ; 0.1 0.1 0.1]; % default white & grey +0125 colors.tableFG = [1 1 1]; % white +0126 +0127 end +0128 +0129 case 'MOD' +0130 % chose selected theme +0131 switch th +0132 case 'standard' +0133 colors.BoxTitle = [0 0 0]; % black +0134 colors.GEO = [189 183 107]./255; % darkkhaki +0135 colors.NMR = [143 188 143]./255; % darkseagreen +0136 colors.CPS = [100 149 237]./255; % cornflowerblue +0137 +0138 colors.editBG = [1 1 1]; % white +0139 colors.panelBG = [0.94 0.94 0.94]; % default grey +0140 colors.panelFG = [0 0 0]; % black +0141 colors.axisBG = [1 1 1]; % white +0142 colors.axisFG = [0.15 0.15 0.15]; % dark grey +0143 colors.axisL = [0.3 0.3 0.3]; % medium grey +0144 colors.tableBG = [1 1 1; 0.94 0.94 0.94]; % default white & grey +0145 colors.tableFG = [0 0 0]; % black +0146 +0147 case 'basic' +0148 colors.BoxTitle = [1 1 1]; % white +0149 colors.GEO = [0.05 0.25 0.5]; % dark blue +0150 colors.NMR = [0.05 0.25 0.5]; % dark blue +0151 colors.CPS = [0.05 0.25 0.5]; % dark blue +0152 +0153 colors.editBG = [1 1 1]; % white +0154 colors.panelBG = [0.94 0.94 0.94]; % default grey +0155 colors.panelFG = [0 0 0]; % black +0156 colors.axisBG = [1 1 1]; % white +0157 colors.axisFG = [0.15 0.15 0.15]; % dark grey +0158 colors.axisL = [0.3 0.3 0.3]; % medium grey +0159 colors.tableBG = [1 1 1; 0.94 0.94 0.94]; % default white & grey +0160 colors.tableFG = [0 0 0]; % black +0161 +0162 case 'dark' +0163 colors.BoxTitle = [0 0 0]; % black +0164 colors.GEO = [189 183 107]./255; % darkkhaki +0165 colors.NMR = [143 188 143]./255; % darkseagreen +0166 colors.CPS = [100 149 237]./255; % cornflowerblue +0167 +0168 colors.editBG = [0.1 0.1 0.1]; % very dark grey +0169 colors.panelBG = [0.2 0.2 0.2]; % black +0170 colors.panelFG = [1 1 1]; % white +0171 colors.axisBG = [0.15 0.15 0.15]; % dark grey +0172 colors.axisFG = [1 1 1]; % white +0173 colors.axisL = [0.9 0.9 0.9]; % very light grey +0174 colors.tableBG = [0.1 0.1 0.1; 0.2 0.2 0.2]; % default white & grey +0175 colors.tableFG = [1 1 1]; % white +0176 +0177 case 'black' +0178 colors.BoxTitle = [1 1 1]; % white +0179 colors.GEO = [0.35 0.35 0.35]; % grey +0180 colors.NMR = [0.35 0.35 0.35]; % grey +0181 colors.CPS = [0.35 0.35 0.35]; % grey +0182 +0183 colors.editBG = [0 0 0]; % very dark grey +0184 colors.panelBG = [0 0 0]; % black +0185 colors.panelFG = [1 1 1]; % white +0186 colors.axisBG = [0 0 0]; % dark grey +0187 colors.axisFG = [1 1 1]; % white +0188 colors.axisL = [0.9 0.9 0.9]; % very light grey +0189 colors.tableBG = [0 0 0; 0.1 0.1 0.1]; % default white & grey +0190 colors.tableFG = [1 1 1]; % white +0191 end +0192 end +0193 +0194 end +0195 +0196 %------------- END OF CODE -------------- +0197 +0198 %% License: +0199 % MIT License +0200 % +0201 % Copyright (c) 2018 Thomas Hiller +0202 % +0203 % Permission is hereby granted, free of charge, to any person obtaining a copy +0204 % of this software and associated documentation files (the "Software"), to deal +0205 % in the Software without restriction, including without limitation the rights +0206 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0207 % copies of the Software, and to permit persons to whom the Software is +0208 % furnished to do so, subject to the following conditions: +0209 % +0210 % The above copyright notice and this permission notice shall be included in all +0211 % copies or substantial portions of the Software. +0212 % +0213 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0214 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0215 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0216 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0217 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0218 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0219 % SOFTWARE.
    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/functions/interface/importCalibrationData.html b/doc/nucleus/functions/interface/importCalibrationData.html new file mode 100644 index 0000000..f4abf20 --- /dev/null +++ b/doc/nucleus/functions/interface/importCalibrationData.html @@ -0,0 +1,171 @@ + + + + Description of importCalibrationData + + + + + + + + + + + +

    importCalibrationData +

    + +

    PURPOSE ^

    +
    + +

    SYNOPSIS ^

    +
    function importCalibrationData
    + +

    DESCRIPTION ^

    +
    importCalibrationdata imports previously saved calibration data for
    +porosity determination
    +
    + Syntax:
    +       importCalibrationdata
    +
    + Inputs:
    +       none
    +
    + Outputs:
    +       none
    +
    + Example:
    +       importCalibrationdata
    +
    + Other m-files required:
    +       displayStatusText
    +       NUCLEUSinv_updateInterface
    +
    + Subfunctions:
    +       none
    +
    + MAT-files required:
    +       none
    +
    + See also: NUCLEUSinv
    + Author: Thomas Hiller
    + email: thomas.hiller[at]leibniz-liag.de
    + License: MIT License (at end)
    + + +

    CROSS-REFERENCE INFORMATION ^

    +This function calls: + +This function is called by: +
      +
    + + + + +

    SOURCE CODE ^

    +
    0001 function importCalibrationData
    +0002 %importCalibrationdata imports previously saved calibration data for
    +0003 %porosity determination
    +0004 %
    +0005 % Syntax:
    +0006 %       importCalibrationdata
    +0007 %
    +0008 % Inputs:
    +0009 %       none
    +0010 %
    +0011 % Outputs:
    +0012 %       none
    +0013 %
    +0014 % Example:
    +0015 %       importCalibrationdata
    +0016 %
    +0017 % Other m-files required:
    +0018 %       displayStatusText
    +0019 %       NUCLEUSinv_updateInterface
    +0020 %
    +0021 % Subfunctions:
    +0022 %       none
    +0023 %
    +0024 % MAT-files required:
    +0025 %       none
    +0026 %
    +0027 % See also: NUCLEUSinv
    +0028 % Author: Thomas Hiller
    +0029 % email: thomas.hiller[at]leibniz-liag.de
    +0030 % License: MIT License (at end)
    +0031 
    +0032 %------------- BEGIN CODE --------------
    +0033 
    +0034 %% get GUI handle and data
    +0035 fig = findobj('Tag','INV');
    +0036 gui = getappdata(fig,'gui');
    +0037 data = getappdata(fig,'data');
    +0038 
    +0039 % get file name
    +0040 CALIBpath = -1;
    +0041 CALIBfile = -1;
    +0042 if isfield(data.import,'path')
    +0043     [CALIBfile,CALIBpath] = uigetfile(fullfile(data.import.path,'*.mat'),...
    +0044     'Choose Calibration file');
    +0045 else
    +0046     [CALIBfile,CALIBpath] = uigetfile(fullfile(pwd,'*.mat'),...
    +0047         'Choose Calibration file');
    +0048 end
    +0049 
    +0050 % only continue if user didn't cancel
    +0051 if sum([CALIBpath CALIBfile]) > 0
    +0052     
    +0053     indata = load(fullfile(CALIBpath,CALIBfile),'calib');
    +0054     if isfield(indata,'calib')
    +0055         % update the GUI data fields
    +0056         data.calib = indata.calib;
    +0057         data.param.calibV = data.calib.vol;
    +0058         data.param.useporosity = 1;
    +0059         
    +0060         % update the GUI data
    +0061         setappdata(fig,'data',data);
    +0062         NUCLEUSinv_updateInterface;
    +0063         
    +0064         % show info message
    +0065         displayStatusText(gui,'Calibration data successfully imported');
    +0066     else
    +0067         helpdlg({'function: importCalibrationdata',...
    +0068             'No calibration data in this file.'},'No calibration data');
    +0069     end    
    +0070 end
    +0071 
    +0072 end
    +0073 
    +0074 %------------- END OF CODE --------------
    +0075 
    +0076 %% License:
    +0077 % MIT License
    +0078 %
    +0079 % Copyright (c) 2018 Thomas Hiller
    +0080 %
    +0081 % Permission is hereby granted, free of charge, to any person obtaining a copy
    +0082 % of this software and associated documentation files (the "Software"), to deal
    +0083 % in the Software without restriction, including without limitation the rights
    +0084 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    +0085 % copies of the Software, and to permit persons to whom the Software is
    +0086 % furnished to do so, subject to the following conditions:
    +0087 %
    +0088 % The above copyright notice and this permission notice shall be included in all
    +0089 % copies or substantial portions of the Software.
    +0090 %
    +0091 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    +0092 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    +0093 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    +0094 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    +0095 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    +0096 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    +0097 % SOFTWARE.
    +
    Generated by m2html © 2005
    + + \ No newline at end of file diff --git a/doc/nucleus/functions/interface/importNMRdata.html b/doc/nucleus/functions/interface/importNMRdata.html index c375f03..278817e 100644 --- a/doc/nucleus/functions/interface/importNMRdata.html +++ b/doc/nucleus/functions/interface/importNMRdata.html @@ -580,412 +580,463 @@

    SOURCE CODE ^if nslices == ncsvfiles -0499 % create z-vector -0500 p = out.parData; -0501 zslice = linspace(p.startPos,p.endPos,p.nSlices)'; -0502 data.import.BAM.use_z = true; -0503 data.import.BAM.zslice = zslice; -0504 if numel(zslice) > 1 -0505 for i = 1:numel(zslice) -0506 tmp = shownames{i}; -0507 shownames{i} = [tmp,' z:',sprintf('%5.4f',zslice(i))]; -0508 end -0509 end -0510 else -0511 data.import.BAM.use_z = false; -0512 data.import.BAM.zslice = 1:1:ncsvfiles; -0513 end -0514 end -0515 -0516 % update the global data structure -0517 data.import.NMR.files = fnames; -0518 data.import.NMR.filesShort = shownames; -0519 -0520 end -0521 -0522 %% -0523 function [data,gui] = importDataLIAG(data,gui) -0524 -0525 in.path = fullfile(data.import.path); -0526 in.fileformat = data.import.fileformat; -0527 out = LoadNMRData_driver(in); -0528 -0529 fnames = struct; -0530 % shownames is just a dummy to hold all data file names that -0531 % will be shown in the listbox -0532 shownames = cell(1,1); -0533 -0534 c = 0; -0535 for j = 1:size(out.nmrData,2) -0536 % the individual file names -0537 c = c + 1; -0538 fnames(c).parfile = 'acqu.par'; -0539 fnames(c).datafile = out.nmrData{j}.datfile; -0540 fnames(c).T2specfile = ''; -0541 -0542 shownames{c} = fnames(c).datafile; -0543 -0544 % the NMR data -0545 % here we fix the time scale from [ms] to [s] -0546 if max(out.nmrData{j}.time) > 100 -0547 out.nmrData{j}.time = out.nmrData{j}.time/1000; -0548 out.nmrData{j}.raw.time = out.nmrData{j}.raw.time/1000; -0549 end -0550 data.import.NMR.data{c} = out.nmrData{j}; -0551 data.import.NMR.para{c} = out.parData; -0552 end -0553 -0554 % update the global data structure -0555 data.import.NMR.files = fnames; -0556 data.import.NMR.filesShort = shownames; -0557 -0558 end -0559 -0560 %% -0561 function [data,gui] = importDataLIAGproject(data,gui) -0562 -0563 % 1) show all folders and ask for sample -0564 subdirs = dir(data.import.path); -0565 % remove the dot-dirs -0566 subdirs = subdirs(~ismember({subdirs.name},{'.','..'})); -0567 -0568 fnames = {subdirs.name}; -0569 [indx,~] = listdlg('PromptString','Select Sample:',... -0570 'SelectionMode','single',... -0571 'ListString',fnames); +0498 % check for background file ("Leermessung") +0499 has_bg = false; +0500 for i = 1:numel(fnames) +0501 if ~isempty(strfind(fnames(i).datafile,'000')) +0502 has_bg = true; +0503 index_bg = i; +0504 break; +0505 end +0506 end +0507 +0508 if has_bg +0509 % background data set +0510 bg = data.import.NMR.data{index_bg}; +0511 +0512 % vector of indices of the files that get corrected +0513 ind_files = 1:1:ncsvfiles; +0514 ind_files(ind_files==index_bg) = []; +0515 +0516 for i = ind_files +0517 % subtract the background signal +0518 s = data.import.NMR.data{i}.signal; +0519 s_bg = bg.signal; +0520 s(1:numel(s_bg)) = complex( real(s(1:numel(s_bg)))-... +0521 real(s_bg),imag(s(1:numel(s_bg)))-imag(s_bg) ); +0522 % update original data set +0523 data.import.NMR.data{i}.signal = s; +0524 end +0525 +0526 % check if the number of slices is equal to the number of files +0527 % (excluding the background file) +0528 if nslices == numel(ind_files) +0529 % create z-vector +0530 p = out.parData; +0531 zslice = linspace(p.startPos,p.endPos,p.nSlices)'; +0532 data.import.BAM.use_z = true; +0533 data.import.BAM.zslice = zslice; +0534 if numel(zslice) > 1 +0535 c = 0; +0536 for i = ind_files +0537 c = c + 1; +0538 tmp = shownames{i}; +0539 shownames{i} = [tmp,' z:',sprintf('%5.4f',zslice(c))]; +0540 end +0541 end +0542 else +0543 data.import.BAM.use_z = false; +0544 data.import.BAM.zslice = 1:1:max([numel(ind_files) 1]); +0545 end +0546 +0547 else +0548 if nslices == ncsvfiles +0549 % create z-vector +0550 p = out.parData; +0551 zslice = linspace(p.startPos,p.endPos,p.nSlices)'; +0552 data.import.BAM.use_z = true; +0553 data.import.BAM.zslice = zslice; +0554 if numel(zslice) > 1 +0555 for i = 1:numel(zslice) +0556 tmp = shownames{i}; +0557 shownames{i} = [tmp,' z:',sprintf('%5.4f',zslice(i))]; +0558 end +0559 end +0560 else +0561 data.import.BAM.use_z = false; +0562 data.import.BAM.zslice = 1:1:ncsvfiles; +0563 end +0564 end +0565 end +0566 +0567 % update the global data structure +0568 data.import.NMR.files = fnames; +0569 data.import.NMR.filesShort = shownames; +0570 +0571 end 0572 -0573 if ~isempty(indx) -0574 % 2) check corresponding SampleParameter.par file for reference and -0575 % calibration sample and other parameters -0576 datapath = fullfile(data.import.path,fnames{indx}); -0577 % load SampleParameter file for sample -0578 [SampleParameter] = loadGUIParameters(datapath,'SampleParameters.par'); -0579 if isfield(SampleParameter,'sampleVolume') -0580 dataVol = SampleParameter.sampleVolume; -0581 else -0582 dataVol = 1; -0583 end -0584 -0585 % 2a) background file #1 -0586 backgroundFile1 = SampleParameter.backgroundFile; -0587 if isempty(backgroundFile1) -0588 bnames = {subdirs.name}; -0589 bnames(indx) = []; -0590 [indb,~] = listdlg('PromptString','Select Background File:',... -0591 'SelectionMode','single',... -0592 'ListString',bnames); -0593 if ~isempty(indb) -0594 backgroundFile1 = bnames{indb}; -0595 else -0596 backgroundFile1 = ''; -0597 end -0598 end -0599 if ~isempty(backgroundFile1) -0600 ind = strfind(backgroundFile1,filesep); -0601 if ~isempty(ind) -0602 backgroundFile1 = backgroundFile1(ind(end)+1:end); -0603 end -0604 fileInList = ismember(fnames,{backgroundFile1}); -0605 if any(fileInList) -0606 backgroundpath1 = fullfile(data.import.path,fnames{fileInList}); -0607 end -0608 else -0609 backgroundpath1 = ''; -0610 backgroundFile1 = ''; -0611 end -0612 backVol = 1; -0613 -0614 % 2b) calibration file -0615 c = 0; -0616 if isfield(SampleParameter,'calibrationFile0') -0617 c = c + 1; -0618 calibrationFiles{c} = SampleParameter.calibrationFile0; -0619 end -0620 if isfield(SampleParameter,'calibrationFile1') -0621 c = c + 1; -0622 calibrationFiles{c} = SampleParameter.calibrationFile1; -0623 end -0624 if isfield(SampleParameter,'calibrationFile2') -0625 c = c + 1; -0626 calibrationFiles{c} = SampleParameter.calibrationFile2; -0627 end -0628 if isfield(SampleParameter,'calibrationFile3') -0629 c = c + 1; -0630 calibrationFiles{c} = SampleParameter.calibrationFile3; -0631 end -0632 -0633 % find the non-empty one -0634 ind = ismember(calibrationFiles,{''}); -0635 % there are three possibilities: 0, 1 and more than 1 calib. files -0636 calibrationFiles(ind) = []; -0637 if isempty(calibrationFiles) -0638 cnames = {subdirs.name}; -0639 cnames(indx) = []; -0640 [indc,~] = listdlg('PromptString','Select Calibration File:',... -0641 'SelectionMode','single',... -0642 'ListString',cnames); -0643 if ~isempty(indc) -0644 calibrationFiles = cnames{indc}; -0645 else -0646 calibrationFiles = ''; -0647 end -0648 else -0649 % if there are more than one let the user select the correct one -0650 if numel(calibrationFiles) > 1 -0651 [ind,~] = listdlg('PromptString','Select Calibration File:',... -0652 'SelectionMode','single',... -0653 'ListString',calibrationFiles); -0654 calibrationFiles = calibrationFiles{ind}; -0655 else -0656 calibrationFiles = calibrationFiles{1}; -0657 end -0658 end -0659 if ~isempty(calibrationFiles) -0660 ind = strfind(calibrationFiles,filesep); -0661 if ~isempty(ind) -0662 calibrationFiles = calibrationFiles(ind(end)+1:end); -0663 end -0664 fileInList = ismember(fnames,{calibrationFiles}); -0665 if any(fileInList) -0666 calibrationpath = fullfile(data.import.path,fnames{fileInList}); -0667 end -0668 else -0669 calibrationpath = ''; -0670 calibrationFiles = ''; -0671 end -0672 -0673 if ~isempty(calibrationpath) -0674 [SampleParameterC] = loadGUIParameters(calibrationpath,'SampleParameters.par'); -0675 if isfield(SampleParameterC,'sampleVolume') -0676 calibVol = SampleParameterC.sampleVolume; -0677 else -0678 calibVol = 1; -0679 end -0680 -0681 % 2a) background file #2 -0682 backgroundFile2 = SampleParameterC.backgroundFile; -0683 if isempty(backgroundFile2) -0684 bnames = {subdirs.name}; -0685 bnames(indx) = []; -0686 [indb,~] = listdlg('PromptString','Select Background File for Calibration:',... -0687 'SelectionMode','single',... -0688 'ListString',bnames); -0689 if ~isempty(indb) -0690 backgroundFile2 = bnames{indb}; -0691 else -0692 backgroundFile2 = ''; -0693 end -0694 end -0695 if ~isempty(backgroundFile2) -0696 ind = strfind(backgroundFile2,filesep); -0697 if ~isempty(ind) -0698 backgroundFile2 = backgroundFile2(ind(end)+1:end); -0699 end -0700 fileInList = ismember(fnames,{backgroundFile2}); -0701 if any(fileInList) -0702 backgroundpath2 = fullfile(data.import.path,fnames{fileInList}); -0703 end -0704 else -0705 backgroundpath2 = ''; -0706 backgroundFile2 = ''; -0707 end -0708 else -0709 calibVol = 1; -0710 backgroundpath2 = ''; -0711 backgroundFile2 = ''; -0712 end -0713 -0714 % 3) now load the data -0715 workpaths = {datapath,calibrationpath,backgroundpath1,backgroundpath2}; -0716 workfiles = {fnames{indx},[calibrationFiles,' - calibration'],... -0717 [backgroundFile1,' - backgroundS'],[backgroundFile2,' - backgroundC']}; -0718 out = cell(size(workpaths)); -0719 count = 0; -0720 keep = false(size(workpaths)); -0721 for i = 1:numel(workpaths) -0722 if ~isempty(workpaths{i}) -0723 workdirs = dir(workpaths{i}); -0724 workdirs = workdirs(~ismember({workdirs.name},{'.','..'})); -0725 isT2 = ismember({workdirs.name},{'T2CPMG'}); -0726 if any(isT2) -0727 keep(i) = true; -0728 count = count + 1; -0729 T2path = fullfile(workdirs(isT2).folder,workdirs(isT2).name); -0730 in.path = T2path; -0731 in.fileformat = data.import.fileformat; -0732 out{i} = LoadNMRData_driver(in); -0733 end -0734 end -0735 end -0736 -0737 if isempty(backgroundpath1) -0738 ref1 = struct; -0739 else -0740 background1 = out{3}; -0741 % get the background data 1 -0742 ref1.t = background1.nmrData{1}.time; -0743 ref1.s = background1.nmrData{1}.signal; -0744 [ref1.s,~] = rotateT2phase(ref1.s); -0745 end -0746 -0747 if isempty(backgroundpath2) -0748 ref2 = struct; -0749 else -0750 background2 = out{4}; -0751 % get the background data 2 -0752 ref2.t = background2.nmrData{1}.time; -0753 ref2.s = background2.nmrData{1}.signal; -0754 [ref2.s,~] = rotateT2phase(ref2.s); -0755 end -0756 -0757 workpaths = workpaths(keep); -0758 workfiles = workfiles(keep); -0759 out = out(keep); -0760 -0761 ffnames = struct; -0762 % shownames is just a dummy to hold all data file names that -0763 % will be shown in the listbox -0764 shownames = cell(1,1); -0765 -0766 for i = 1:count -0767 ffnames(i).parfile = 'acqu.par'; -0768 ffnames(i).datafile = workfiles{i}; -0769 ffnames(i).T2specfile = ''; -0770 -0771 shownames{i} = ffnames(i).datafile; -0772 -0773 % the NMR data -0774 out{i}.nmrData{1}.time = out{i}.nmrData{1}.time/1000; -0775 out{i}.nmrData{1}.raw.time = out{i}.nmrData{1}.raw.time/1000; -0776 data.import.NMR.data{i} = out{i}.nmrData{1}; -0777 data.import.NMR.para{i} = out{i}.parData; -0778 data.import.NMR.para{i}.SampleParameter = SampleParameter; -0779 -0780 % subtract the background signal -0781 s = data.import.NMR.data{i}.signal; -0782 if i==1 && isfield(ref1,'s') -0783 s(1:numel(ref1.s)) = complex( real(s(1:numel(ref1.s)))-... -0784 real(ref1.s),imag(s(1:numel(ref1.s)))-imag(ref1.s) ); -0785 elseif i==2 && isfield(ref2,'s') -0786 s(1:numel(ref2.s)) = complex( real(s(1:numel(ref2.s)))-... -0787 real(ref2.s),imag(s(1:numel(ref2.s)))-imag(ref2.s) ); -0788 end -0789 -0790 data.import.NMR.data{i}.signal = s; -0791 data.import.NMR.data{i}.raw.signal = s; -0792 -0793 if ~isempty(strfind(workfiles{i},' - background')) -0794 data.import.LIAG.sampleVol(i) = backVol; -0795 elseif ~isempty(strfind(workfiles{i},' - calibration')) -0796 data.import.LIAG.sampleVol(i) = calibVol; -0797 elseif isempty(strfind(workfiles{i},' - background')) &&... -0798 isempty(strfind(workfiles{i},' - calibration')) -0799 data.import.LIAG.sampleVol(i) = dataVol; -0800 end -0801 end -0802 data.import.LIAG.Tbulk = 1e6; -0803 data.import.LIAG.workpaths = workpaths; -0804 data.import.LIAG.datapath = datapath; -0805 data.import.LIAG.calibrationpath = calibrationpath; -0806 data.import.LIAG.backgroundpath1 = backgroundpath1; -0807 data.import.LIAG.backgroundpath2 = backgroundpath2; -0808 -0809 % update the global data structure -0810 data.import.NMR.files = ffnames; -0811 data.import.NMR.filesShort = shownames; -0812 -0813 end -0814 -0815 end -0816 -0817 %% -0818 function [data,gui] = importDataMouse(data,gui) -0819 -0820 in.path = fullfile(data.import.path); -0821 in.fileformat = data.import.fileformat; -0822 out = LoadNMRData_driver(in); -0823 -0824 fnames = struct; -0825 % shownames is just a dummy to hold all data file names that -0826 % will be shown in the listbox -0827 shownames = cell(1,1); -0828 -0829 c = 0; -0830 for j = 1:size(out.nmrData,2) -0831 % the individual file names -0832 c = c + 1; -0833 fnames(c).parfile = 'acq.par'; -0834 fnames(c).datafile = out.nmrData{j}.datfile; -0835 fnames(c).T2specfile = ''; -0836 -0837 shownames{c} = ['T2_',fnames(c).datafile]; -0838 -0839 % the NMR data -0840 % here we fix the time scale from [ms] to [s] -0841 if max(out.nmrData{j}.time) > 100 -0842 out.nmrData{j}.time = out.nmrData{j}.time/1000; -0843 out.nmrData{j}.raw.time = out.nmrData{j}.raw.time/1000; -0844 end -0845 data.import.NMR.data{c} = out.nmrData{j}; -0846 data.import.NMR.para{c} = out.parData; -0847 end -0848 -0849 % update the global data structure -0850 data.import.NMR.files = fnames; -0851 data.import.NMR.filesShort = shownames; -0852 -0853 end -0854 -0855 %% -0856 function data = loadGUIParameters(datapath,fname) -0857 fid = fopen(fullfile(datapath,fname)); -0858 d = textscan(fid,'%s','Delimiter','\n'); -0859 fclose(fid); -0860 data = struct; -0861 for i = 1:size(d{1},1) -0862 str = char(d{1}(i)); -0863 str = fixParameterString(str); -0864 eval(['data.',str,';']); -0865 end -0866 -0867 end -0868 -0869 %% -0870 function data = loadGUIrawdata(data,NMRpath,NMRfile) -0871 -0872 load(fullfile(NMRpath,'NUCLEUSinv_raw.mat'),'savedata'); -0873 -0874 data.import.file = NMRfile; -0875 data.import.path = NMRpath; -0876 data.import.NMR = savedata; -0877 -0878 end +0573 %% +0574 function [data,gui] = importDataLIAG(data,gui) +0575 +0576 in.path = fullfile(data.import.path); +0577 in.fileformat = data.import.fileformat; +0578 out = LoadNMRData_driver(in); +0579 +0580 fnames = struct; +0581 % shownames is just a dummy to hold all data file names that +0582 % will be shown in the listbox +0583 shownames = cell(1,1); +0584 +0585 c = 0; +0586 for j = 1:size(out.nmrData,2) +0587 % the individual file names +0588 c = c + 1; +0589 fnames(c).parfile = 'acqu.par'; +0590 fnames(c).datafile = out.nmrData{j}.datfile; +0591 fnames(c).T2specfile = ''; +0592 +0593 shownames{c} = fnames(c).datafile; +0594 +0595 % the NMR data +0596 % here we fix the time scale from [ms] to [s] +0597 if max(out.nmrData{j}.time) > 100 +0598 out.nmrData{j}.time = out.nmrData{j}.time/1000; +0599 out.nmrData{j}.raw.time = out.nmrData{j}.raw.time/1000; +0600 end +0601 data.import.NMR.data{c} = out.nmrData{j}; +0602 data.import.NMR.para{c} = out.parData; +0603 end +0604 +0605 % update the global data structure +0606 data.import.NMR.files = fnames; +0607 data.import.NMR.filesShort = shownames; +0608 +0609 end +0610 +0611 %% +0612 function [data,gui] = importDataLIAGproject(data,gui) +0613 +0614 % 1) show all folders and ask for sample +0615 subdirs = dir(data.import.path); +0616 % remove the dot-dirs +0617 subdirs = subdirs(~ismember({subdirs.name},{'.','..'})); +0618 +0619 fnames = {subdirs.name}; +0620 [indx,~] = listdlg('PromptString','Select Sample:',... +0621 'SelectionMode','single',... +0622 'ListString',fnames); +0623 +0624 if ~isempty(indx) +0625 % 2) check corresponding SampleParameter.par file for reference and +0626 % calibration sample and other parameters +0627 datapath = fullfile(data.import.path,fnames{indx}); +0628 % load SampleParameter file for sample +0629 [SampleParameter] = loadGUIParameters(datapath,'SampleParameters.par'); +0630 if isfield(SampleParameter,'sampleVolume') +0631 dataVol = SampleParameter.sampleVolume; +0632 else +0633 dataVol = 1; +0634 end +0635 +0636 % 2a) background file #1 +0637 backgroundFile1 = SampleParameter.backgroundFile; +0638 if isempty(backgroundFile1) +0639 bnames = {subdirs.name}; +0640 bnames(indx) = []; +0641 [indb,~] = listdlg('PromptString','Select Background File:',... +0642 'SelectionMode','single',... +0643 'ListString',bnames); +0644 if ~isempty(indb) +0645 backgroundFile1 = bnames{indb}; +0646 else +0647 backgroundFile1 = ''; +0648 end +0649 end +0650 if ~isempty(backgroundFile1) +0651 ind = strfind(backgroundFile1,filesep); +0652 if ~isempty(ind) +0653 backgroundFile1 = backgroundFile1(ind(end)+1:end); +0654 end +0655 fileInList = ismember(fnames,{backgroundFile1}); +0656 if any(fileInList) +0657 backgroundpath1 = fullfile(data.import.path,fnames{fileInList}); +0658 end +0659 else +0660 backgroundpath1 = ''; +0661 backgroundFile1 = ''; +0662 end +0663 backVol = 1; +0664 +0665 % 2b) calibration file +0666 c = 0; +0667 if isfield(SampleParameter,'calibrationFile0') +0668 c = c + 1; +0669 calibrationFiles{c} = SampleParameter.calibrationFile0; +0670 end +0671 if isfield(SampleParameter,'calibrationFile1') +0672 c = c + 1; +0673 calibrationFiles{c} = SampleParameter.calibrationFile1; +0674 end +0675 if isfield(SampleParameter,'calibrationFile2') +0676 c = c + 1; +0677 calibrationFiles{c} = SampleParameter.calibrationFile2; +0678 end +0679 if isfield(SampleParameter,'calibrationFile3') +0680 c = c + 1; +0681 calibrationFiles{c} = SampleParameter.calibrationFile3; +0682 end +0683 +0684 % find the non-empty one +0685 ind = ismember(calibrationFiles,{''}); +0686 % there are three possibilities: 0, 1 and more than 1 calib. files +0687 calibrationFiles(ind) = []; +0688 if isempty(calibrationFiles) +0689 cnames = {subdirs.name}; +0690 cnames(indx) = []; +0691 [indc,~] = listdlg('PromptString','Select Calibration File:',... +0692 'SelectionMode','single',... +0693 'ListString',cnames); +0694 if ~isempty(indc) +0695 calibrationFiles = cnames{indc}; +0696 else +0697 calibrationFiles = ''; +0698 end +0699 else +0700 % if there are more than one let the user select the correct one +0701 if numel(calibrationFiles) > 1 +0702 [ind,~] = listdlg('PromptString','Select Calibration File:',... +0703 'SelectionMode','single',... +0704 'ListString',calibrationFiles); +0705 calibrationFiles = calibrationFiles{ind}; +0706 else +0707 calibrationFiles = calibrationFiles{1}; +0708 end +0709 end +0710 if ~isempty(calibrationFiles) +0711 ind = strfind(calibrationFiles,filesep); +0712 if ~isempty(ind) +0713 calibrationFiles = calibrationFiles(ind(end)+1:end); +0714 end +0715 fileInList = ismember(fnames,{calibrationFiles}); +0716 if any(fileInList) +0717 calibrationpath = fullfile(data.import.path,fnames{fileInList}); +0718 end +0719 else +0720 calibrationpath = ''; +0721 calibrationFiles = ''; +0722 end +0723 +0724 if ~isempty(calibrationpath) +0725 [SampleParameterC] = loadGUIParameters(calibrationpath,'SampleParameters.par'); +0726 if isfield(SampleParameterC,'sampleVolume') +0727 calibVol = SampleParameterC.sampleVolume; +0728 else +0729 calibVol = 1; +0730 end +0731 +0732 % 2a) background file #2 +0733 backgroundFile2 = SampleParameterC.backgroundFile; +0734 if isempty(backgroundFile2) +0735 bnames = {subdirs.name}; +0736 bnames(indx) = []; +0737 [indb,~] = listdlg('PromptString','Select Background File for Calibration:',... +0738 'SelectionMode','single',... +0739 'ListString',bnames); +0740 if ~isempty(indb) +0741 backgroundFile2 = bnames{indb}; +0742 else +0743 backgroundFile2 = ''; +0744 end +0745 end +0746 if ~isempty(backgroundFile2) +0747 ind = strfind(backgroundFile2,filesep); +0748 if ~isempty(ind) +0749 backgroundFile2 = backgroundFile2(ind(end)+1:end); +0750 end +0751 fileInList = ismember(fnames,{backgroundFile2}); +0752 if any(fileInList) +0753 backgroundpath2 = fullfile(data.import.path,fnames{fileInList}); +0754 end +0755 else +0756 backgroundpath2 = ''; +0757 backgroundFile2 = ''; +0758 end +0759 else +0760 calibVol = 1; +0761 backgroundpath2 = ''; +0762 backgroundFile2 = ''; +0763 end +0764 +0765 % 3) now load the data +0766 workpaths = {datapath,calibrationpath,backgroundpath1,backgroundpath2}; +0767 workfiles = {fnames{indx},[calibrationFiles,' - calibration'],... +0768 [backgroundFile1,' - backgroundS'],[backgroundFile2,' - backgroundC']}; +0769 out = cell(size(workpaths)); +0770 count = 0; +0771 keep = false(size(workpaths)); +0772 for i = 1:numel(workpaths) +0773 if ~isempty(workpaths{i}) +0774 workdirs = dir(workpaths{i}); +0775 workdirs = workdirs(~ismember({workdirs.name},{'.','..'})); +0776 isT2 = ismember({workdirs.name},{'T2CPMG'}); +0777 if any(isT2) +0778 keep(i) = true; +0779 count = count + 1; +0780 T2path = fullfile(workdirs(isT2).folder,workdirs(isT2).name); +0781 in.path = T2path; +0782 in.fileformat = data.import.fileformat; +0783 out{i} = LoadNMRData_driver(in); +0784 end +0785 end +0786 end +0787 +0788 if isempty(backgroundpath1) +0789 ref1 = struct; +0790 else +0791 background1 = out{3}; +0792 % get the background data 1 +0793 ref1.t = background1.nmrData{1}.time; +0794 ref1.s = background1.nmrData{1}.signal; +0795 [ref1.s,~] = rotateT2phase(ref1.s); +0796 end +0797 +0798 if isempty(backgroundpath2) +0799 ref2 = struct; +0800 else +0801 background2 = out{4}; +0802 % get the background data 2 +0803 ref2.t = background2.nmrData{1}.time; +0804 ref2.s = background2.nmrData{1}.signal; +0805 [ref2.s,~] = rotateT2phase(ref2.s); +0806 end +0807 +0808 workpaths = workpaths(keep); +0809 workfiles = workfiles(keep); +0810 out = out(keep); +0811 +0812 ffnames = struct; +0813 % shownames is just a dummy to hold all data file names that +0814 % will be shown in the listbox +0815 shownames = cell(1,1); +0816 +0817 for i = 1:count +0818 ffnames(i).parfile = 'acqu.par'; +0819 ffnames(i).datafile = workfiles{i}; +0820 ffnames(i).T2specfile = ''; +0821 +0822 shownames{i} = ffnames(i).datafile; +0823 +0824 % the NMR data +0825 out{i}.nmrData{1}.time = out{i}.nmrData{1}.time/1000; +0826 out{i}.nmrData{1}.raw.time = out{i}.nmrData{1}.raw.time/1000; +0827 data.import.NMR.data{i} = out{i}.nmrData{1}; +0828 data.import.NMR.para{i} = out{i}.parData; +0829 data.import.NMR.para{i}.SampleParameter = SampleParameter; +0830 +0831 % subtract the background signal +0832 s = data.import.NMR.data{i}.signal; +0833 if i==1 && isfield(ref1,'s') +0834 s(1:numel(ref1.s)) = complex( real(s(1:numel(ref1.s)))-... +0835 real(ref1.s),imag(s(1:numel(ref1.s)))-imag(ref1.s) ); +0836 elseif i==2 && isfield(ref2,'s') +0837 s(1:numel(ref2.s)) = complex( real(s(1:numel(ref2.s)))-... +0838 real(ref2.s),imag(s(1:numel(ref2.s)))-imag(ref2.s) ); +0839 end +0840 +0841 data.import.NMR.data{i}.signal = s; +0842 data.import.NMR.data{i}.raw.signal = s; +0843 +0844 if ~isempty(strfind(workfiles{i},' - background')) +0845 data.import.LIAG.sampleVol(i) = backVol; +0846 elseif ~isempty(strfind(workfiles{i},' - calibration')) +0847 data.import.LIAG.sampleVol(i) = calibVol; +0848 elseif isempty(strfind(workfiles{i},' - background')) &&... +0849 isempty(strfind(workfiles{i},' - calibration')) +0850 data.import.LIAG.sampleVol(i) = dataVol; +0851 end +0852 end +0853 data.import.LIAG.Tbulk = 1e6; +0854 data.import.LIAG.workpaths = workpaths; +0855 data.import.LIAG.datapath = datapath; +0856 data.import.LIAG.calibrationpath = calibrationpath; +0857 data.import.LIAG.backgroundpath1 = backgroundpath1; +0858 data.import.LIAG.backgroundpath2 = backgroundpath2; +0859 +0860 % update the global data structure +0861 data.import.NMR.files = ffnames; +0862 data.import.NMR.filesShort = shownames; +0863 +0864 end +0865 +0866 end +0867 +0868 %% +0869 function [data,gui] = importDataMouse(data,gui) +0870 +0871 in.path = fullfile(data.import.path); +0872 in.fileformat = data.import.fileformat; +0873 out = LoadNMRData_driver(in); +0874 +0875 fnames = struct; +0876 % shownames is just a dummy to hold all data file names that +0877 % will be shown in the listbox +0878 shownames = cell(1,1); 0879 -0880 %------------- END OF CODE -------------- -0881 -0882 %% License: -0883 % MIT License -0884 % -0885 % Copyright (c) 2018 Thomas Hiller -0886 % -0887 % Permission is hereby granted, free of charge, to any person obtaining a copy -0888 % of this software and associated documentation files (the "Software"), to deal -0889 % in the Software without restriction, including without limitation the rights -0890 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -0891 % copies of the Software, and to permit persons to whom the Software is -0892 % furnished to do so, subject to the following conditions: -0893 % -0894 % The above copyright notice and this permission notice shall be included in all -0895 % copies or substantial portions of the Software. -0896 % -0897 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -0898 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -0899 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -0900 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -0901 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -0902 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -0903 % SOFTWARE. +0880 c = 0; +0881 for j = 1:size(out.nmrData,2) +0882 % the individual file names +0883 c = c + 1; +0884 fnames(c).parfile = 'acq.par'; +0885 fnames(c).datafile = out.nmrData{j}.datfile; +0886 fnames(c).T2specfile = ''; +0887 +0888 shownames{c} = ['T2_',fnames(c).datafile]; +0889 +0890 % the NMR data +0891 % here we fix the time scale from [ms] to [s] +0892 if max(out.nmrData{j}.time) > 100 +0893 out.nmrData{j}.time = out.nmrData{j}.time/1000; +0894 out.nmrData{j}.raw.time = out.nmrData{j}.raw.time/1000; +0895 end +0896 data.import.NMR.data{c} = out.nmrData{j}; +0897 data.import.NMR.para{c} = out.parData; +0898 end +0899 +0900 % update the global data structure +0901 data.import.NMR.files = fnames; +0902 data.import.NMR.filesShort = shownames; +0903 +0904 end +0905 +0906 %% +0907 function data = loadGUIParameters(datapath,fname) +0908 fid = fopen(fullfile(datapath,fname)); +0909 d = textscan(fid,'%s','Delimiter','\n'); +0910 fclose(fid); +0911 data = struct; +0912 for i = 1:size(d{1},1) +0913 str = char(d{1}(i)); +0914 str = fixParameterString(str); +0915 eval(['data.',str,';']); +0916 end +0917 +0918 end +0919 +0920 %% +0921 function data = loadGUIrawdata(data,NMRpath,NMRfile) +0922 +0923 load(fullfile(NMRpath,'NUCLEUSinv_raw.mat'),'savedata'); +0924 +0925 data.import.file = NMRfile; +0926 data.import.path = NMRpath; +0927 data.import.NMR = savedata; +0928 +0929 end +0930 +0931 %------------- END OF CODE -------------- +0932 +0933 %% License: +0934 % MIT License +0935 % +0936 % Copyright (c) 2018 Thomas Hiller +0937 % +0938 % Permission is hereby granted, free of charge, to any person obtaining a copy +0939 % of this software and associated documentation files (the "Software"), to deal +0940 % in the Software without restriction, including without limitation the rights +0941 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0942 % copies of the Software, and to permit persons to whom the Software is +0943 % furnished to do so, subject to the following conditions: +0944 % +0945 % The above copyright notice and this permission notice shall be included in all +0946 % copies or substantial portions of the Software. +0947 % +0948 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0949 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0950 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0951 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0952 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0953 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0954 % SOFTWARE.
    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/functions/interface/menu.html b/doc/nucleus/functions/interface/menu.html index 2251d4a..a02c7dc 100644 --- a/doc/nucleus/functions/interface/menu.html +++ b/doc/nucleus/functions/interface/menu.html @@ -18,7 +18,7 @@

    Index for nucleus\functions\interface

    Matlab files in this directory:

    +
  • PhaseView
  • beautifyAxes
  • calculateGeometry
  • calculateGuiOnMonitorPosition
  • calculateNMR
  • calibratePorosity
  • caluclatePressureSaturation
  • changeColorTheme
  • checkIfInversionExists
  • cleanupGUIData
  • clearAllAxes
  • clearInversion
  • clearSingleAxis
  • displayStatusText
  • enableGUIelements
  • exportData
  • exportGraphics
  • exportINV
  • findParentOfType
  • fixAxes
  • getColorIndex
  • getColorTheme
  • importASCIIdata
  • importCPSdata
  • importCalibrationData
  • importEXCELdata
  • importINV2INV
  • importMOD2INV
  • importMOD2MOD
  • importNMRdata
  • makeINIfile
  • minimizePanel
  • moveEntryInList
  • onFigureSizeChange
  • processNMRData
  • processNMRDataControl
  • readINIfile
  • removeCalculationFields
  • removeInversionFields
  • removeSignalFromList
  • resortDataList
  • runInversionBatch
  • runInversionJoint
  • runInversionStd
  • showExtraGraphics
  • showFitStatistics
  • showParameterInfo
  • switchToolTips
  • uncheckImportMenus
  • updateCPSTable
  • updateCPSTableSize
  • updateInfo
  • updateNMRsignals
  • updatePlotsCPS
  • updatePlotsDistribution
  • updatePlotsDistributionInfo
  • updatePlotsGeometryType
  • updatePlotsIterChi
  • updatePlotsJointInversion
  • updatePlotsLcurve
  • updatePlotsNMR
  • updatePlotsPSD
  • updatePlotsSignal
  • updateStatusInformation
  • updateToolTips
  • useSignalAsCalibration
  • Other Matlab-specific files in this directory:

    This function is called by: @@ -97,7 +97,7 @@

    SOURCE CODE ^% fitDataFree 0020 % fitDataFree_fmin 0021 % fitDataInvLaplace -0022 % fitDataNNLS +0022 % fitDataLSQ 0023 % onPushRun 0024 % onPushStop 0025 % processNMRDataControl @@ -185,7 +185,7 @@

    SOURCE CODE ^if isfield(data.results.nmrproc,'W') 0112 param.W = data.results.nmrproc.W; 0113 end @@ -197,7 +197,7 @@

    SOURCE CODE ^if isfield(data.results.nmrproc,'W') 0124 param.W = data.results.nmrproc.W; 0125 end @@ -214,12 +214,12 @@

    SOURCE CODE ^if isfield(data.results.nmrproc,'W') 0141 param.W = data.results.nmrproc.W; 0142 end 0143 -0144 invstd = fitDataNNLS(data.results.nmrproc.t,... +0144 invstd = fitDataLSQ(data.results.nmrproc.t,... 0145 data.results.nmrproc.s,param); 0146 0147 case 'ILA' diff --git a/doc/nucleus/functions/interface/runInversionStd.html b/doc/nucleus/functions/interface/runInversionStd.html index 828ebba..7d705c4 100644 --- a/doc/nucleus/functions/interface/runInversionStd.html +++ b/doc/nucleus/functions/interface/runInversionStd.html @@ -48,7 +48,7 @@

    DESCRIPTION ^DESCRIPTION ^CROSS-REFERENCE INFORMATION ^

    This function calls: +
  • NUCLEUSinv_updateInterface updates all GUI elements
  • onPushRun handles the callbacks to all RUN push buttons in both GUIs and
  • onPushShowHide shows/hides the INFO column on the right side of NUCLEUSinv
  • onPushStop recognizes that a STOP push button was pressed and resets the
  • calibratePorosity determines a sample's porosity from a calibration
  • clearAllAxes clears all axes of a given figure
  • clearSingleAxis clears an individual axis
  • displayStatusText clears all axes of a given figure
  • removeInversionFields deletes all inversion result fields from NUCLEUSinv
  • showFitStatistics shows an extra fit statistics figure (for T2 data)
  • updateInfo updates the information shown in all information list boxes
  • updatePlotsDistribution plots the RTD and PSD curves into NUCLEUSinv
  • updatePlotsIterChi plots the results of the chi2 iteration
  • updatePlotsLcurve
  • updatePlotsSignal plots the raw and processed NMR signals in NUCLEUSinv
  • useSignalAsCalibration uses E0 as porosity calibration factor.
  • fitDataFree is a control routine that uses 'lsqcurvefit' to fit NMR data
  • fitDataInvLaplace is a control routine that uses an Inverse Laplace
  • fitDataLSQ is a control routine that fits NMR data multi-exponentially;
  • getLambdaFromLCurve estimates the regularization parameter lambda according
  • This function is called by:
    • onPushRun handles the callbacks to all RUN push buttons in both GUIs and
    @@ -110,7 +110,7 @@

    SOURCE CODE ^% fitDataFree 0022 % fitDataFree_fmin 0023 % fitDataInvLaplace -0024 % fitDataNNLS +0024 % fitDataLSQ 0025 % getLambdaFromLCurve 0026 % NUCLEUSinv_updateInterface 0027 % onPushRun @@ -199,7 +199,7 @@

    SOURCE CODE ^if isfield(data.results.nmrproc,'W') 0111 param.W = data.results.nmrproc.W; 0112 end -0113 param.optim = data.info.optim; +0113 param.solver = data.info.solver; 0114 0115 % status bar information 0116 infostring = 'L-curve calculation ... '; @@ -227,7 +227,7 @@

    SOURCE CODE ^% if "UserData" is 1 STOP was not pressed -> continue 0139 if get(gui.push_handles.invstd_run,'UserData') == 1 0140 param.lambda = lambda_range(i); -0141 invdata = fitDataNNLS(data.results.nmrproc.t,data.results.nmrproc.s,param); +0141 invdata = fitDataLSQ(data.results.nmrproc.t,data.results.nmrproc.s,param); 0142 % output data 0143 RMS(i) = invdata.rms; 0144 RN(i) = invdata.rn; @@ -289,7 +289,7 @@

    SOURCE CODE ^if isfield(data.results.nmrproc,'W') 0201 param.W = data.results.nmrproc.W; 0202 end -0203 param.optim = data.info.optim; +0203 param.solver = data.info.solver; 0204 0205 % status bar information 0206 infostring = 'Chi2 iteration ... '; @@ -303,7 +303,7 @@

    SOURCE CODE ^for i = 1:length(lambda_range) 0216 param.lambda = lambda_range(i); -0217 invdata = fitDataNNLS(data.results.nmrproc.t,data.results.nmrproc.s,param); +0217 invdata = fitDataLSQ(data.results.nmrproc.t,data.results.nmrproc.s,param); 0218 % output data 0219 chi2(i) = invdata.chi2; 0220 end @@ -323,7 +323,7 @@

    SOURCE CODE ^fitDataNNLS(data.results.nmrproc.t,data.results.nmrproc.s,param); +0237 invdata = fitDataLSQ(data.results.nmrproc.t,data.results.nmrproc.s,param); 0238 % output data 0239 c = invdata.chi2; 0240 @@ -410,12 +410,12 @@

    SOURCE CODE ^if isfield(data.results.nmrproc,'W') 0326 param.W = data.results.nmrproc.W; 0327 end 0328 % status bar information -0329 switch data.info.optim +0329 switch data.info.has_optim 0330 case 'on' 0331 infostring = 'Inversion using ''Optimization Toolbox'' ... '; 0332 case 'off' @@ -429,12 +429,12 @@

    SOURCE CODE ^if isfield(data.results.nmrproc,'W') 0345 param.W = data.results.nmrproc.W; 0346 end 0347 % status bar information -0348 switch data.info.optim +0348 switch data.info.has_optim 0349 case 'on' 0350 infostring = 'Inversion using ''Optimization Toolbox'' ... '; 0351 case 'off' @@ -472,20 +472,20 @@

    SOURCE CODE ^if isfield(data.results.nmrproc,'W') 0388 param.W = data.results.nmrproc.W; 0389 end 0390 0391 % status bar information -0392 switch data.info.optim -0393 case 'on' +0392 switch data.info.solver +0393 case 'lsqlin' 0394 infostring = 'Inversion using ''Optimization Toolbox'' ... '; -0395 case 'off' +0395 case 'lsqnonneg' 0396 infostring = 'Inversion using ''lsqnonneg'' ... '; 0397 end 0398 displayStatusText(gui,infostring); -0399 invstd = fitDataNNLS(data.results.nmrproc.t,... +0399 invstd = fitDataLSQ(data.results.nmrproc.t,... 0400 data.results.nmrproc.s,param); 0401 end 0402 % normalize to 1 diff --git a/doc/nucleus/functions/interface/showExtraGraphics.html b/doc/nucleus/functions/interface/showExtraGraphics.html index 3bbca34..23cedae 100644 --- a/doc/nucleus/functions/interface/showExtraGraphics.html +++ b/doc/nucleus/functions/interface/showExtraGraphics.html @@ -114,267 +114,282 @@

    SOURCE CODE ^if foundINV 0044 -0045 % find the first INVdata set -0046 for id = 1:size(INVdata,1) -0047 if isstruct(INVdata{id}) -0048 break; -0049 end -0050 end -0051 -0052 Ninv = size(INVdata,1); -0053 % allocate memory -0054 xval = zeros(Ninv,1); -0055 E0 = zeros(Ninv,1); -0056 E0er = zeros(Ninv,1); -0057 SNR = zeros(Ninv,1); -0058 switch data.invstd.invtype -0059 case 'mono' -0060 T = zeros(Ninv,1); -0061 Ter = zeros(Ninv,1); -0062 case 'free' -0063 T = zeros(Ninv,data.invstd.freeDT); -0064 otherwise -0065 T = zeros(Ninv,1); -0066 Tspec = zeros(Ninv,length(INVdata{id}.results.invstd.T1T2f)); -0067 end -0068 -0069 % collect data for amplitude, relaxation time, SNR etc. -0070 c = 0; -0071 for id = 1:size(INVdata,1) -0072 if isstruct(INVdata{id}) -0073 c = c + 1; -0074 if c == 1 -0075 timescale = INVdata{id}.process.timescale; -0076 end -0077 xval(id,1) = data.import.NMR.data{id}.datenum; -0078 E0(id,1) = sum(INVdata{id}.results.invstd.E0) * INVdata{id}.results.nmrproc.normfac; -0079 SNR(id,1) = sum(INVdata{id}.results.invstd.E0) / INVdata{id}.results.nmrproc.noise; -0080 switch data.invstd.invtype -0081 case {'mono','free'} -0082 E0er(id,1) = sum(INVdata{id}.results.invstd.ci(1:2:end)) *... -0083 INVdata{id}.results.nmrproc.normfac; -0084 -0085 switch INVdata{id}.results.nmrproc.T1T2 -0086 case 'T1' -0087 ll = length(INVdata{id}.results.invstd.T1); -0088 T(id,1:ll) = INVdata{id}.results.invstd.T1; -0089 case 'T2' -0090 ll = length(INVdata{id}.results.invstd.T2); -0091 T(id,1:ll) = INVdata{id}.results.invstd.T2; -0092 end -0093 -0094 otherwise -0095 T(id,1) = INVdata{id}.results.invstd.Tlgm; -0096 Tspec(id,:) = INVdata{id}.results.invstd.T1T2f'; -0097 if c == 1 -0098 Tt = INVdata{id}.results.invstd.T1T2me; -0099 end -0100 end -0101 -0102 switch data.invstd.invtype -0103 case {'mono'} -0104 Ter(id,1) = INVdata{id}.results.invstd.ci(2); -0105 otherwise -0106 % nothing to do -0107 end -0108 else -0109 E0(id,:) = NaN; -0110 switch data.invstd.invtype -0111 case {'mono','free'} -0112 E0er(id,:) = NaN; -0113 otherwise -0114 T(id,:) = NaN; -0115 Tspec(id,:) = NaN; -0116 end -0117 switch data.invstd.invtype -0118 case {'mono'} -0119 Ter(id,:) = NaN; -0120 end -0121 SNR(id,1) = NaN; -0122 end -0123 end -0124 -0125 if isfield(data.import,'BAM') -0126 if data.import.BAM.use_z -0127 xval = data.import.BAM.zslice; -0128 xlabelstr = 'position [m]'; -0129 else -0130 xlabelstr = 'date' ; -0131 end -0132 else -0133 xlabelstr = 'date' ; -0134 end -0135 -0136 % plot it -0137 switch method -0138 case 'amp' -0139 f = figure; -0140 ax1 = subplot(311,'Parent',f); -0141 ax2 = subplot(312,'Parent',f); -0142 ax3 = subplot(313,'Parent',f); -0143 -0144 hold(ax1,'on'); -0145 switch data.invstd.invtype -0146 case {'mono','free'} -0147 errorbar(xval,E0,E0er,'o','Parent',ax1); -0148 otherwise -0149 plot(xval,E0,'o','Parent',ax1); -0150 end -0151 grid(ax1,'on'); -0152 set(get(ax1,'YLabel'),'String','E0'); -0153 -0154 hold(ax2,'on'); -0155 switch data.invstd.invtype -0156 case 'mono' -0157 errorbar(xval,T,Ter,'ko','Parent',ax2); -0158 set(get(ax2,'YLabel'),'String',['T [',timescale,']']); -0159 case 'free' -0160 for i = 1:size(T,2) -0161 semilogy(xval,T(:,i),'ko','Parent',ax2); -0162 end -0163 set(get(ax2,'YLabel'),'String',['T_x [',timescale,']']); -0164 set(ax2,'YScale','log'); -0165 otherwise -0166 for i = 1:size(T,2) -0167 semilogy(xval,T(:,i),'ko','Parent',ax2); -0168 end -0169 set(get(ax2,'YLabel'),'String',['TLGM [',timescale,']']); -0170 end -0171 grid(ax2,'on'); -0172 -0173 hold(ax3,'on'); -0174 plot(xval,SNR,'o','Parent',ax3); -0175 grid on; -0176 xlabel(xlabelstr); -0177 set(get(ax3,'YLabel'),'String','signal-to-noise ratio'); -0178 -0179 linkaxes([ax1 ax2 ax3], 'x'); +0045 try +0046 +0047 % find the first INVdata set +0048 for id = 1:size(INVdata,1) +0049 if isstruct(INVdata{id}) +0050 break; +0051 end +0052 end +0053 +0054 Ninv = size(INVdata,1); +0055 % allocate memory +0056 xval = zeros(Ninv,1); +0057 E0 = zeros(Ninv,1); +0058 E0er = zeros(Ninv,1); +0059 SNR = zeros(Ninv,1); +0060 switch data.invstd.invtype +0061 case 'mono' +0062 T = zeros(Ninv,1); +0063 Ter = zeros(Ninv,1); +0064 case 'free' +0065 T = zeros(Ninv,data.invstd.freeDT); +0066 otherwise +0067 T = zeros(Ninv,1); +0068 Tspec = zeros(Ninv,length(INVdata{id}.results.invstd.T1T2f)); +0069 end +0070 +0071 % collect data for amplitude, relaxation time, SNR etc. +0072 c = 0; +0073 for id = 1:size(INVdata,1) +0074 if isstruct(INVdata{id}) +0075 c = c + 1; +0076 if c == 1 +0077 timescale = INVdata{id}.process.timescale; +0078 end +0079 xval(id,1) = data.import.NMR.data{id}.datenum; +0080 E0(id,1) = sum(INVdata{id}.results.invstd.E0) * INVdata{id}.results.nmrproc.normfac; +0081 SNR(id,1) = sum(INVdata{id}.results.invstd.E0) / INVdata{id}.results.nmrproc.noise; +0082 switch data.invstd.invtype +0083 case {'mono','free'} +0084 E0er(id,1) = sum(INVdata{id}.results.invstd.ci(1:2:end)) *... +0085 INVdata{id}.results.nmrproc.normfac; +0086 +0087 switch INVdata{id}.results.nmrproc.T1T2 +0088 case 'T1' +0089 ll = length(INVdata{id}.results.invstd.T1); +0090 T(id,1:ll) = INVdata{id}.results.invstd.T1; +0091 case 'T2' +0092 ll = length(INVdata{id}.results.invstd.T2); +0093 T(id,1:ll) = INVdata{id}.results.invstd.T2; +0094 end +0095 +0096 otherwise +0097 T(id,1) = INVdata{id}.results.invstd.Tlgm; +0098 Tspec(id,:) = INVdata{id}.results.invstd.T1T2f'; +0099 if c == 1 +0100 Tt = INVdata{id}.results.invstd.T1T2me; +0101 end +0102 end +0103 +0104 switch data.invstd.invtype +0105 case {'mono'} +0106 Ter(id,1) = INVdata{id}.results.invstd.ci(2); +0107 otherwise +0108 % nothing to do +0109 end +0110 else +0111 E0(id,:) = NaN; +0112 switch data.invstd.invtype +0113 case {'mono','free'} +0114 E0er(id,:) = NaN; +0115 otherwise +0116 T(id,:) = NaN; +0117 Tspec(id,:) = NaN; +0118 end +0119 switch data.invstd.invtype +0120 case {'mono'} +0121 Ter(id,:) = NaN; +0122 end +0123 SNR(id,1) = NaN; +0124 end +0125 end +0126 +0127 if isfield(data.import,'BAM') +0128 if data.import.BAM.use_z +0129 xval = data.import.BAM.zslice; +0130 xlabelstr = 'position [m]'; +0131 else +0132 xlabelstr = 'date' ; +0133 end +0134 else +0135 xlabelstr = 'date' ; +0136 end +0137 +0138 % plot it +0139 switch method +0140 case 'amp' +0141 f = figure; +0142 ax1 = subplot(311,'Parent',f); +0143 ax2 = subplot(312,'Parent',f); +0144 ax3 = subplot(313,'Parent',f); +0145 +0146 hold(ax1,'on'); +0147 switch data.invstd.invtype +0148 case {'mono','free'} +0149 errorbar(xval,E0,E0er,'o','Parent',ax1); +0150 otherwise +0151 plot(xval,E0,'o','Parent',ax1); +0152 end +0153 grid(ax1,'on'); +0154 set(get(ax1,'YLabel'),'String','E0'); +0155 +0156 hold(ax2,'on'); +0157 switch data.invstd.invtype +0158 case 'mono' +0159 errorbar(xval,T,Ter,'ko','Parent',ax2); +0160 set(get(ax2,'YLabel'),'String',['T [',timescale,']']); +0161 case 'free' +0162 for i = 1:size(T,2) +0163 semilogy(xval,T(:,i),'ko','Parent',ax2); +0164 end +0165 set(get(ax2,'YLabel'),'String',['T_x [',timescale,']']); +0166 set(ax2,'YScale','log'); +0167 otherwise +0168 for i = 1:size(T,2) +0169 semilogy(xval,T(:,i),'ko','Parent',ax2); +0170 end +0171 set(get(ax2,'YLabel'),'String',['TLGM [',timescale,']']); +0172 end +0173 grid(ax2,'on'); +0174 +0175 hold(ax3,'on'); +0176 plot(xval,SNR,'o','Parent',ax3); +0177 grid on; +0178 xlabel(xlabelstr); +0179 set(get(ax3,'YLabel'),'String','signal-to-noise ratio'); 0180 -0181 if strcmp(xlabelstr,'date') -0182 isfile = which('dynamicDateTicks'); -0183 if ~isempty(isfile) -0184 dynamicDateTicks([ax1 ax2 ax3],'link','dd.mm. HH:MM'); -0185 else -0186 datetick(ax1,'x','dd.mm. HH:MM','keepticks'); -0187 datetick(ax2,'x','dd.mm. HH:MM','keepticks'); -0188 datetick(ax3,'x','dd.mm. HH:MM','keepticks'); -0189 end -0190 end -0191 -0192 case 'ampvst' -0193 f = figure; -0194 ax1 = axes('Parent',f); -0195 -0196 plot(E0,T,'ko','Parent',ax1), -0197 set(get(ax1,'XLabel'),'String','E0'); -0198 set(get(ax1,'YLabel'),'String',['T [',timescale,']']); -0199 -0200 case 'rtd' -0201 switch data.invstd.invtype -0202 case {'ILA','NNLS'} -0203 if strcmp(xlabelstr,'date') -0204 mycol = jet(size(Tspec,1)); -0205 [time,ix] = sort(xval); -0206 Tspec = Tspec(ix,:); -0207 f = figure; -0208 ax = axes('Parent',f); -0209 hold(ax,'on') -0210 for i = 1:size(Tspec,1) -0211 plot3(time(i)*ones(size(Tt)),Tt,Tspec(i,:),... -0212 'Color',mycol(i,:),'Parent',ax); -0213 end -0214 grid on; box on; -0215 xlabel('date'); -0216 ylabel(['relaxation time [',timescale,']']); -0217 zlabel('amplitude [-]'); -0218 -0219 set(ax,'YScale','log'); -0220 isfile = which('dynamicDateTicks'); -0221 if ~isempty(isfile) -0222 dynamicDateTicks(ax,'dd.mm. HH:MM'); -0223 else -0224 datetick(ax,'x','dd.mm. HH:MM','keepticks'); -0225 end -0226 view([90 0]); -0227 else -0228 dx = xval(2)-xval(1); -0229 [xx,yy] = meshgrid(Tt',[xval; xval(end)+dx]); -0230 f = figure; -0231 ax = axes('Parent',f); -0232 hold(ax,'on') -0233 surf(xx,yy,zeros(size(xx)),Tspec./max(Tspec(:)),'Parent',ax); -0234 shading(ax,'flat'); -0235 xticks = log10(min(Tt)):1:log10(max(Tt)); -0236 set(ax,'XScale','log','XLim',[10^xticks(1) 10^xticks(end)],... -0237 'XTick',10.^xticks,'Layer','top','Box','on'); -0238 set(ax,'YLim',[min(yy(:)) max(yy(:))],'YDir','normal') -0239 cmap = jet; cmap = flipud(cmap); -0240 colormap(ax,cmap); -0241 xlabel(['relaxation time [',timescale,']']); -0242 ylabel('position [m]'); -0243 cb = colorbar; -0244 set(get(cb,'YLabel'),'String','norm. amplitude'); -0245 -0246 % context menu to flip y-axis direction -0247 axes_cm = uicontextmenu(f); -0248 gui.cm_handles.axes_proc_xaxis = uimenu(axes_cm,... -0249 'Label','flip y-axis','Tag','flip','Enable','on',... -0250 'Callback',@onContextFlip); -0251 set(ax,'UIContextMenu',axes_cm); -0252 -0253 end -0254 otherwise -0255 helpdlg({'function: showExtraGraphics',... -0256 'Cannot plot RTDs because the inversion was not multi exponential'},... -0257 'Invert NMR data first.'); -0258 end -0259 end -0260 else -0261 helpdlg({'function: showExtraGraphics',... -0262 'Cannot continue because there need to be at least two NMR measurements.'},... -0263 'Not enough data to show'); -0264 end -0265 -0266 end -0267 -0268 function onContextFlip(src,~) -0269 f = ancestor(src,'Figure','toplevel'); -0270 ax = findobj(f,'Type','Axes'); -0271 -0272 direction = get(ax,'Ydir'); -0273 switch direction -0274 case 'normal' -0275 set(ax,'Ydir','reverse') -0276 case 'reverse' -0277 set(ax,'Ydir','normal') -0278 end -0279 -0280 end -0281 -0282 %------------- END OF CODE -------------- -0283 -0284 %% License: -0285 % MIT License -0286 % -0287 % Copyright (c) 2018 Thomas Hiller -0288 % -0289 % Permission is hereby granted, free of charge, to any person obtaining a copy -0290 % of this software and associated documentation files (the "Software"), to deal -0291 % in the Software without restriction, including without limitation the rights -0292 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -0293 % copies of the Software, and to permit persons to whom the Software is -0294 % furnished to do so, subject to the following conditions: -0295 % -0296 % The above copyright notice and this permission notice shall be included in all -0297 % copies or substantial portions of the Software. -0298 % -0299 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -0300 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -0301 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -0302 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -0303 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -0304 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -0305 % SOFTWARE. +0181 linkaxes([ax1 ax2 ax3], 'x'); +0182 +0183 if strcmp(xlabelstr,'date') +0184 isfile = which('dynamicDateTicks'); +0185 if ~isempty(isfile) +0186 dynamicDateTicks([ax1 ax2 ax3],'link','dd.mm. HH:MM'); +0187 else +0188 datetick(ax1,'x','dd.mm. HH:MM','keepticks'); +0189 datetick(ax2,'x','dd.mm. HH:MM','keepticks'); +0190 datetick(ax3,'x','dd.mm. HH:MM','keepticks'); +0191 end +0192 end +0193 +0194 case 'ampvst' +0195 f = figure; +0196 ax1 = axes('Parent',f); +0197 +0198 plot(E0,T,'ko','Parent',ax1), +0199 set(get(ax1,'XLabel'),'String','E0'); +0200 set(get(ax1,'YLabel'),'String',['T [',timescale,']']); +0201 +0202 case 'rtd' +0203 switch data.invstd.invtype +0204 case {'ILA','NNLS'} +0205 if strcmp(xlabelstr,'date') +0206 mycol = jet(size(Tspec,1)); +0207 [time,ix] = sort(xval); +0208 Tspec = Tspec(ix,:); +0209 f = figure; +0210 ax = axes('Parent',f); +0211 hold(ax,'on') +0212 for i = 1:size(Tspec,1) +0213 plot3(time(i)*ones(size(Tt)),Tt,Tspec(i,:),... +0214 'Color',mycol(i,:),'Parent',ax); +0215 end +0216 grid on; box on; +0217 xlabel('date'); +0218 ylabel(['relaxation time [',timescale,']']); +0219 zlabel('amplitude [-]'); +0220 +0221 set(ax,'YScale','log'); +0222 isfile = which('dynamicDateTicks'); +0223 if ~isempty(isfile) +0224 dynamicDateTicks(ax,'dd.mm. HH:MM'); +0225 else +0226 datetick(ax,'x','dd.mm. HH:MM','keepticks'); +0227 end +0228 view([90 0]); +0229 else +0230 dx = xval(2)-xval(1); +0231 [xx,yy] = meshgrid(Tt',[xval; xval(end)+dx]); +0232 f = figure; +0233 ax = axes('Parent',f); +0234 hold(ax,'on') +0235 +0236 % remove the backgound file +0237 Tspec(isnan(Tspec)) = []; +0238 xi = numel(Tspec)/numel(Tt); +0239 Tspec = reshape(Tspec,[xi numel(Tt)]); +0240 +0241 surf(xx,yy,zeros(size(xx)),Tspec./max(Tspec(:)),'Parent',ax); +0242 shading(ax,'flat'); +0243 xticks = log10(min(Tt)):1:log10(max(Tt)); +0244 set(ax,'XScale','log','XLim',[10^xticks(1) 10^xticks(end)],... +0245 'XTick',10.^xticks,'Layer','top','Box','on'); +0246 set(ax,'YLim',[min(yy(:)) max(yy(:))],'YDir','normal') +0247 cmap = jet; cmap = flipud(cmap); +0248 colormap(ax,cmap); +0249 xlabel(['relaxation time [',timescale,']']); +0250 ylabel('position [m]'); +0251 cb = colorbar; +0252 set(get(cb,'YLabel'),'String','norm. amplitude'); +0253 +0254 % context menu to flip y-axis direction +0255 axes_cm = uicontextmenu(f); +0256 gui.cm_handles.axes_proc_xaxis = uimenu(axes_cm,... +0257 'Label','flip y-axis','Tag','flip','Enable','on',... +0258 'Callback',@onContextFlip); +0259 set(ax,'UIContextMenu',axes_cm); +0260 +0261 end +0262 otherwise +0263 helpdlg({'function: showExtraGraphics',... +0264 'Cannot plot RTDs because the inversion was not multi exponential'},... +0265 'Invert NMR data first.'); +0266 end +0267 end +0268 +0269 catch ME +0270 % show error message in case import fails +0271 errmsg = {ME.message;[ME.stack(1).name,' Line: ',num2str(ME.stack(1).line)];... +0272 'Cannot show figure.'}; +0273 errordlg(errmsg,'showExtraGraphics: Error!'); +0274 end +0275 else +0276 helpdlg({'function: showExtraGraphics',... +0277 'Cannot continue because there need to be at least two NMR measurements.'},... +0278 'Not enough data to show'); +0279 end +0280 +0281 end +0282 +0283 function onContextFlip(src,~) +0284 f = ancestor(src,'Figure','toplevel'); +0285 ax = findobj(f,'Type','Axes'); +0286 +0287 direction = get(ax,'Ydir'); +0288 switch direction +0289 case 'normal' +0290 set(ax,'Ydir','reverse') +0291 case 'reverse' +0292 set(ax,'Ydir','normal') +0293 end +0294 +0295 end +0296 +0297 %------------- END OF CODE -------------- +0298 +0299 %% License: +0300 % MIT License +0301 % +0302 % Copyright (c) 2018 Thomas Hiller +0303 % +0304 % Permission is hereby granted, free of charge, to any person obtaining a copy +0305 % of this software and associated documentation files (the "Software"), to deal +0306 % in the Software without restriction, including without limitation the rights +0307 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0308 % copies of the Software, and to permit persons to whom the Software is +0309 % furnished to do so, subject to the following conditions: +0310 % +0311 % The above copyright notice and this permission notice shall be included in all +0312 % copies or substantial portions of the Software. +0313 % +0314 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0315 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0316 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0317 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0318 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0319 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0320 % SOFTWARE.
    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/functions/interface/showFitStatistics.html b/doc/nucleus/functions/interface/showFitStatistics.html index 7160cb8..a9d40fa 100644 --- a/doc/nucleus/functions/interface/showFitStatistics.html +++ b/doc/nucleus/functions/interface/showFitStatistics.html @@ -103,281 +103,309 @@

    SOURCE CODE ^'Tag'); 0035 data = getappdata(fig,'data'); 0036 maingui = getappdata(fig,'gui'); -0037 -0038 %% proceed if there is data -0039 if isfield(data,'results') -0040 if isfield(data.results,'nmrraw') && isfield(data.results,'nmrproc') -0041 -0042 % check if the figure is already open -0043 fig_stat = findobj('Tag','FITSTATS'); -0044 % if not, create it -0045 if isempty(fig_stat) -0046 % draw the figure on top of NUCLEUSinv -0047 fig_stat = figure('Name','NUCLEUSinv - Fit Statistics',... -0048 'NumberTitle','off','ToolBar','none','Tag','FITSTATS'); -0049 pos0 = get(fig,'Position'); -0050 pos1 = get(fig_stat,'Position'); -0051 cent(1) = (pos0(1)+pos0(3)/2); -0052 cent(2) = (pos0(2)+pos0(4)/2); -0053 set(fig_stat,'Position',[cent(1)-pos0(3)/3 pos0(2) pos0(3)/1.5 pos0(4)]); -0054 -0055 % create the layout -0056 gui.main = uix.VBox('Parent',fig_stat,'Spacing',10,'Padding',10); -0057 gui.row1 = uicontainer('Parent',gui.main); % axes Im -0058 gui.row2 = uicontainer('Parent',gui.main); % axes res -0059 gui.row3 = uix.HBox('Parent',gui.main); % histogram + text -0060 set(gui.main,'Heights',[-1 -1 -1.5]); -0061 -0062 % Im and res axes -0063 gui.axes_handles.imag = axes('Parent',gui.row1); -0064 gui.axes_handles.err = axes('Parent',gui.row2); -0065 -0066 uix.Empty('Parent',gui.row3); -0067 gui.box1 = uicontainer('Parent',gui.row3); % histogram axes -0068 gui.box2 = uix.VBox('Parent',gui.row3,'Padding',10,'Spacing',5); % text -0069 uix.Empty('Parent',gui.row3); -0070 set(gui.row3,'Widths',[40 -1 300 60]); -0071 -0072 % histogram axes -0073 gui.axes_handles.hist = axes('Parent',gui.box1); -0074 -0075 % all text boxes -0076 uix.Empty('Parent',gui.box2); -0077 gui.row31 = uix.HBox('Parent',gui.box2,'Spacing',10); -0078 gui.row32 = uix.HBox('Parent',gui.box2,'Spacing',10); -0079 gui.row33 = uix.HBox('Parent',gui.box2,'Spacing',10); -0080 gui.row34 = uix.HBox('Parent',gui.box2,'Spacing',10); -0081 gui.row35 = uix.HBox('Parent',gui.box2,'Spacing',10); -0082 gui.row36 = uix.HBox('Parent',gui.box2,'Spacing',10); -0083 uix.Empty('Parent',gui.box2); -0084 set(gui.box2,'Heights',[50 -1 -1 -1 -1 -1 -1 50]); -0085 -0086 gui.text11 = uicontrol('Parent',gui.row31,'Style','text',... -0087 'String',[char(hex2dec('03BC')),'(',char(hex2dec('2111')),'mag)'],... -0088 'FontSize',maingui.myui.fontsize+4,'HorizontalAlignment','right'); -0089 gui.text12 = uicontrol('Parent',gui.row31,'Style','edit','String','',... -0090 'FontSize',maingui.myui.fontsize); -0091 -0092 gui.text21 = uicontrol('Parent',gui.row32,'Style','text',... -0093 'String',[char(hex2dec('03BC')),'(',char(hex2dec('03B5')),')'],... -0094 'FontSize',maingui.myui.fontsize+4,'HorizontalAlignment','right'); -0095 gui.text22 = uicontrol('Parent',gui.row32,'Style','edit','String','',... -0096 'FontSize',maingui.myui.fontsize); -0097 -0098 gui.text31 = uicontrol('Parent',gui.row33,'Style','text',... -0099 'String',[char(hex2dec('03C3')),'(',char(hex2dec('2111')),'mag)'],... -0100 'FontSize',maingui.myui.fontsize+4,'HorizontalAlignment','right'); -0101 gui.text32 = uicontrol('Parent',gui.row33,'Style','edit','String','',... -0102 'FontSize',maingui.myui.fontsize); -0103 -0104 gui.text41 = uicontrol('Parent',gui.row34,'Style','text',... -0105 'String',[char(hex2dec('03C3')),'(',char(hex2dec('03B5')),')'],... -0106 'FontSize',maingui.myui.fontsize+4,'HorizontalAlignment','right'); -0107 gui.text42 = uicontrol('Parent',gui.row34,'Style','edit','String','',... -0108 'FontSize',maingui.myui.fontsize); -0109 -0110 gui.text51 = uicontrol('Parent',gui.row35,'Style','text',... -0111 'String',[char(hex2dec('03A7')),char(hex2dec('0B2'))],... -0112 'FontSize',maingui.myui.fontsize+4,'HorizontalAlignment','right'); -0113 gui.text52 = uicontrol('Parent',gui.row35,'Style','edit','String','',... -0114 'FontSize',maingui.myui.fontsize); -0115 -0116 gui.text61 = uicontrol('Parent',gui.row36,'Style','text','String','RMS',... -0117 'FontSize',maingui.myui.fontsize+4,'HorizontalAlignment','right'); -0118 gui.text62 = uicontrol('Parent',gui.row36,'Style','edit','String','',... -0119 'FontSize',maingui.myui.fontsize); -0120 -0121 % Java Hack to adjust vertical alignment of text fields -0122 jh = findjobj(gui.text11); jh.setVerticalAlignment(javax.swing.JLabel.CENTER); -0123 jh = findjobj(gui.text21); jh.setVerticalAlignment(javax.swing.JLabel.CENTER); -0124 jh = findjobj(gui.text31); jh.setVerticalAlignment(javax.swing.JLabel.CENTER); -0125 jh = findjobj(gui.text41); jh.setVerticalAlignment(javax.swing.JLabel.CENTER); -0126 jh = findjobj(gui.text51); jh.setVerticalAlignment(javax.swing.JLabel.CENTER); -0127 jh = findjobj(gui.text61); jh.setVerticalAlignment(javax.swing.JLabel.CENTER); -0128 -0129 % save to GUI -0130 setappdata(fig_stat,'gui',gui); -0131 end -0132 % if the figure is already open load the GUI data -0133 gui = getappdata(fig_stat,'gui'); -0134 -0135 % get axes handles -0136 ax1 = gui.axes_handles.imag; -0137 ax2 = gui.axes_handles.err; -0138 ax3 = gui.axes_handles.hist; -0139 % clear all axes -0140 clearAllAxes(fig_stat); -0141 -0142 %% gather the fit statistics for the current inversion -0143 text = cell(1,1); -0144 nmrraw = data.results.nmrraw; -0145 nmrproc = data.results.nmrproc; -0146 if isfield(data.results,'invstd') -0147 invstd = data.results.invstd; -0148 end -0149 loglinx = get(maingui.cm_handles.axes_proc_xaxis,'Label'); -0150 lgdstr = cell(1,1); -0151 lgdc = 0; -0152 % plot imaginary part -0153 if ~isreal(nmrraw.s) -0154 plot(nmrraw.t,imag(nmrraw.s),'Color',maingui.myui.colors.IM,'Parent',ax1); -0155 xlims = get(maingui.axes_handles.raw,'XLim'); -0156 line(xlims,[0 0],'LineStyle','--','LineWidth',1,'Color','k','Parent',ax1); -0157 % get statistics -0158 imag_mean = mean(imag(nmrraw.s)); -0159 imag_std = std(imag(nmrraw.s)); -0160 set(ax1,'XTickLabel',get(maingui.axes_handles.raw,'XTickLabel')); -0161 switch loglinx -0162 case 'x-axis -> lin' % log axes -0163 set(ax1,'XScale','log','XLim',xlims); -0164 case 'x-axis -> log' % lin axes -0165 set(ax1,'XScale','lin','XLim',xlims); -0166 end -0167 set(get(ax1,'YLabel'),'String','\Immag'); -0168 grid(ax1,'on'); -0169 -0170 % draw first histogram -0171 min1 = mean(imag(nmrraw.s))-5*std(imag(nmrraw.s)); -0172 max1 = mean(imag(nmrraw.s))+5*std(imag(nmrraw.s)); -0173 bins1 = linspace(min1,max1,100); -0174 n1 = hist(imag(nmrraw.s),bins1); -0175 n1 = n1./trapz(bins1,n1); -0176 stairs(bins1,n1,'Color',maingui.myui.colors.IM,'LineWidth',1.5,'Parent',ax3); -0177 hold(ax3,'on'); -0178 line([mean(imag(nmrraw.s)) mean(imag(nmrraw.s))],[0 max(n1)],... -0179 'color','g','LineStyle','--','Parent',ax3); -0180 -0181 lgdc = lgdc + 1; -0182 lgdstr{lgdc} = '\Immag'; -0183 lgdc = lgdc + 1; -0184 lgdstr{lgdc} = '\mu(\Immag)'; -0185 -0186 % update the text fields -0187 set(gui.text12,'String',sprintf('%5.4e',imag_mean)); -0188 set(gui.text32,'String',sprintf('%5.4e',imag_std)); -0189 end -0190 -0191 if isfield(data.results,'invstd') -0192 % plot residuals -0193 if nmrproc.noise > 0 -0194 plot(nmrproc.t,invstd.residual./nmrproc.e,'Parent',ax2); -0195 % get statistics -0196 err_mean = mean(invstd.residual./nmrproc.e); -0197 err_std = std(invstd.residual./nmrproc.e); -0198 else -0199 plot(nmrproc.t,invstd.residual,'Parent',ax2); -0200 % get statistics -0201 err_mean = mean(invstd.residual); -0202 err_std = std(invstd.residual); -0203 end -0204 xlims = get(maingui.axes_handles.proc,'XLim'); -0205 line(xlims,[0 0],'LineStyle','--','LineWidth',1,'Color','k','Parent',ax2); -0206 -0207 if nmrproc.noise > 0 -0208 line(xlims,[-1 -1],'LineStyle','-.','LineWidth',1,'Color','k','Parent',ax2); -0209 line(xlims,[1 1],'LineStyle','-.','LineWidth',1,'Color','k','Parent',ax2); -0210 line(xlims,[err_mean-err_std err_mean-err_std],... -0211 'LineStyle','--','LineWidth',1,'Color','r','Parent',ax2); -0212 line(xlims,[err_mean+err_std err_mean+err_std],... -0213 'LineStyle','--','LineWidth',1,'Color','r','Parent',ax2); -0214 else -0215 line(xlims,[err_mean-err_std err_mean-err_std],... -0216 'LineStyle','-.','LineWidth',1,'Color','k','Parent',ax2); -0217 line(xlims,[err_mean+err_std err_mean+err_std],... -0218 'LineStyle','-.','LineWidth',1,'Color','k','Parent',ax2); -0219 end -0220 -0221 set(ax2,'XTickLabel',get(maingui.axes_handles.proc,'XTickLabel')); -0222 set(ax2,'YLim',[err_mean-3*err_std err_mean+3*err_std]); -0223 switch loglinx -0224 case 'x-axis -> lin' % log axes -0225 set(ax2,'XScale','log','XLim',xlims); -0226 case 'x-axis -> log' % lin axes -0227 set(ax2,'XScale','lin','XLim',xlims); -0228 end -0229 set(get(ax2,'XLabel'),'String','time [s]') -0230 set(get(ax2,'YLabel'),'String','\epsilon'); -0231 grid(ax2,'on'); -0232 -0233 % update the text fields -0234 set(gui.text22,'String',sprintf('%5.4e',err_mean)); -0235 set(gui.text42,'String',sprintf('%5.4e',err_std)); -0236 if nmrproc.noise > 0 -0237 if isfield(invstd,'chi2') -0238 set(gui.text52,'String',sprintf('%5.3f',invstd.chi2)); -0239 else -0240 set(gui.text52,'String',sprintf('%5.3f',err_std)); -0241 end +0037 colors = maingui.myui.colors; +0038 +0039 %% proceed if there is data +0040 if isfield(data,'results') +0041 if isfield(data.results,'nmrraw') && isfield(data.results,'nmrproc') +0042 +0043 % check if the figure is already open +0044 fig_stat = findobj('Tag','FITSTATS'); +0045 % if not, create it +0046 if isempty(fig_stat) +0047 % draw the figure on top of NUCLEUSinv +0048 fig_stat = figure('Name','NUCLEUSinv - Fit Statistics',... +0049 'NumberTitle','off','ToolBar','none','Tag','FITSTATS'); +0050 pos0 = get(fig,'Position'); +0051 pos1 = get(fig_stat,'Position'); +0052 cent(1) = (pos0(1)+pos0(3)/2); +0053 cent(2) = (pos0(2)+pos0(4)/2); +0054 set(fig_stat,'Position',[cent(1)-pos0(3)/3 pos0(2) pos0(3)/1.5 pos0(4)]); +0055 +0056 % create the layout +0057 gui.main = uix.VBox('Parent',fig_stat,'BackGroundColor',colors.panelBG,'Spacing',10,'Padding',10); +0058 gui.row1 = uicontainer('Parent',gui.main,'BackGroundColor',colors.panelBG); % axes Im +0059 gui.row2 = uicontainer('Parent',gui.main,'BackGroundColor',colors.panelBG); % axes res +0060 gui.row3 = uix.HBox('Parent',gui.main,'BackGroundColor',colors.panelBG); % histogram + text +0061 set(gui.main,'Heights',[-1 -1 -1.5]); +0062 +0063 % Im and res axes +0064 gui.axes_handles.imag = axes('Parent',gui.row1,... +0065 'Color',colors.axisBG,'XColor',colors.axisFG,... +0066 'YColor',colors.axisFG); +0067 gui.axes_handles.err = axes('Parent',gui.row2,... +0068 'Color',colors.axisBG,'XColor',colors.axisFG,... +0069 'YColor',colors.axisFG); +0070 +0071 uix.Empty('Parent',gui.row3); +0072 gui.box1 = uicontainer('Parent',gui.row3,... +0073 'BackGroundColor',colors.panelBG); % histogram axes +0074 gui.box2 = uix.VBox('Parent',gui.row3,... +0075 'BackGroundColor',colors.panelBG,'Padding',10,'Spacing',5); % text +0076 uix.Empty('Parent',gui.row3); +0077 set(gui.row3,'Widths',[40 -1 300 60]); +0078 +0079 % histogram axes +0080 gui.axes_handles.hist = axes('Parent',gui.box1,... +0081 'Color',colors.axisBG,'XColor',colors.axisFG,... +0082 'YColor',colors.axisFG); +0083 +0084 % all text boxes +0085 uix.Empty('Parent',gui.box2); +0086 gui.row31 = uix.HBox('Parent',gui.box2,'BackGroundColor',colors.panelBG,'Spacing',10); +0087 gui.row32 = uix.HBox('Parent',gui.box2,'BackGroundColor',colors.panelBG,'Spacing',10); +0088 gui.row33 = uix.HBox('Parent',gui.box2,'BackGroundColor',colors.panelBG,'Spacing',10); +0089 gui.row34 = uix.HBox('Parent',gui.box2,'BackGroundColor',colors.panelBG,'Spacing',10); +0090 gui.row35 = uix.HBox('Parent',gui.box2,'BackGroundColor',colors.panelBG,'Spacing',10); +0091 gui.row36 = uix.HBox('Parent',gui.box2,'BackGroundColor',colors.panelBG,'Spacing',10); +0092 uix.Empty('Parent',gui.box2); +0093 set(gui.box2,'Heights',[-1 -1 -1 -1 -1 -1 -1 -1]); +0094 +0095 gui.text11 = uicontrol('Parent',gui.row31,'Style','text',... +0096 'String',[char(hex2dec('03BC')),'(',char(hex2dec('2111')),'mag)'],... +0097 'FontSize',maingui.myui.fontsize+4,'HorizontalAlignment','right',... +0098 'BackGroundColor',colors.panelBG,'ForeGroundColor',colors.panelFG); +0099 gui.text12 = uicontrol('Parent',gui.row31,'Style','edit','String','',... +0100 'FontSize',maingui.myui.fontsize,'BackGroundColor',colors.editBG,... +0101 'ForeGroundColor',colors.panelFG); +0102 +0103 gui.text21 = uicontrol('Parent',gui.row32,'Style','text',... +0104 'String',[char(hex2dec('03BC')),'(',char(hex2dec('03B5')),')'],... +0105 'FontSize',maingui.myui.fontsize+4,'HorizontalAlignment','right',... +0106 'BackGroundColor',colors.panelBG,'ForeGroundColor',colors.panelFG); +0107 gui.text22 = uicontrol('Parent',gui.row32,'Style','edit','String','',... +0108 'FontSize',maingui.myui.fontsize,'BackGroundColor',colors.editBG,... +0109 'ForeGroundColor',colors.panelFG); +0110 +0111 gui.text31 = uicontrol('Parent',gui.row33,'Style','text',... +0112 'String',[char(hex2dec('03C3')),'(',char(hex2dec('2111')),'mag)'],... +0113 'FontSize',maingui.myui.fontsize+4,'HorizontalAlignment','right',... +0114 'BackGroundColor',colors.panelBG,'ForeGroundColor',colors.panelFG); +0115 gui.text32 = uicontrol('Parent',gui.row33,'Style','edit','String','',... +0116 'FontSize',maingui.myui.fontsize,'BackGroundColor',colors.editBG,... +0117 'ForeGroundColor',colors.panelFG); +0118 +0119 gui.text41 = uicontrol('Parent',gui.row34,'Style','text',... +0120 'String',[char(hex2dec('03C3')),'(',char(hex2dec('03B5')),')'],... +0121 'FontSize',maingui.myui.fontsize+4,'HorizontalAlignment','right',... +0122 'BackGroundColor',colors.panelBG,'ForeGroundColor',colors.panelFG); +0123 gui.text42 = uicontrol('Parent',gui.row34,'Style','edit','String','',... +0124 'FontSize',maingui.myui.fontsize,'BackGroundColor',colors.editBG,... +0125 'ForeGroundColor',colors.panelFG); +0126 +0127 gui.text51 = uicontrol('Parent',gui.row35,'Style','text',... +0128 'String',[char(hex2dec('03A7')),char(hex2dec('0B2'))],... +0129 'FontSize',maingui.myui.fontsize+4,'HorizontalAlignment','right',... +0130 'BackGroundColor',colors.panelBG,'ForeGroundColor',colors.panelFG); +0131 gui.text52 = uicontrol('Parent',gui.row35,'Style','edit','String','',... +0132 'FontSize',maingui.myui.fontsize,'BackGroundColor',colors.editBG,... +0133 'ForeGroundColor',colors.panelFG); +0134 +0135 gui.text61 = uicontrol('Parent',gui.row36,'Style','text','String','RMS',... +0136 'FontSize',maingui.myui.fontsize+4,'HorizontalAlignment','right',... +0137 'BackGroundColor',colors.panelBG,'ForeGroundColor',colors.panelFG); +0138 gui.text62 = uicontrol('Parent',gui.row36,'Style','edit','String','',... +0139 'FontSize',maingui.myui.fontsize,'BackGroundColor',colors.editBG,... +0140 'ForeGroundColor',colors.panelFG); +0141 +0142 % Java Hack to adjust vertical alignment of text fields +0143 jh = findjobj(gui.text11); jh.setVerticalAlignment(javax.swing.JLabel.CENTER); +0144 jh = findjobj(gui.text21); jh.setVerticalAlignment(javax.swing.JLabel.CENTER); +0145 jh = findjobj(gui.text31); jh.setVerticalAlignment(javax.swing.JLabel.CENTER); +0146 jh = findjobj(gui.text41); jh.setVerticalAlignment(javax.swing.JLabel.CENTER); +0147 jh = findjobj(gui.text51); jh.setVerticalAlignment(javax.swing.JLabel.CENTER); +0148 jh = findjobj(gui.text61); jh.setVerticalAlignment(javax.swing.JLabel.CENTER); +0149 +0150 % save to GUI +0151 setappdata(fig_stat,'gui',gui); +0152 end +0153 % if the figure is already open load the GUI data +0154 gui = getappdata(fig_stat,'gui'); +0155 +0156 % get axes handles +0157 ax1 = gui.axes_handles.imag; +0158 ax2 = gui.axes_handles.err; +0159 ax3 = gui.axes_handles.hist; +0160 % clear all axes +0161 clearAllAxes(fig_stat); +0162 hold(ax1,'on'); +0163 hold(ax2,'on'); +0164 hold(ax3,'on'); +0165 +0166 %% gather the fit statistics for the current inversion +0167 text = cell(1,1); +0168 nmrraw = data.results.nmrraw; +0169 nmrproc = data.results.nmrproc; +0170 if isfield(data.results,'invstd') +0171 invstd = data.results.invstd; +0172 end +0173 loglinx = get(maingui.cm_handles.axes_proc_xaxis,'Label'); +0174 lgdstr = cell(1,1); +0175 lgdc = 0; +0176 % plot imaginary part +0177 if ~isreal(nmrraw.s) +0178 plot(nmrraw.t,imag(nmrraw.s),'Color',colors.IM,'Parent',ax1); +0179 xlims = get(maingui.axes_handles.raw,'XLim'); +0180 line(xlims,[0 0],'LineStyle','--','Color',colors.axisL,'Parent',ax1); +0181 % get statistics +0182 imag_mean = mean(imag(nmrraw.s)); +0183 imag_std = std(imag(nmrraw.s)); +0184 set(ax1,'XTickLabel',get(maingui.axes_handles.raw,'XTickLabel')); +0185 switch loglinx +0186 case 'x-axis -> lin' % log axes +0187 set(ax1,'XScale','log','XLim',xlims); +0188 case 'x-axis -> log' % lin axes +0189 set(ax1,'XScale','lin','XLim',xlims); +0190 end +0191 set(get(ax1,'YLabel'),'String','\Immag'); +0192 grid(ax1,'on'); +0193 +0194 % draw first histogram +0195 min1 = mean(imag(nmrraw.s))-5*std(imag(nmrraw.s)); +0196 max1 = mean(imag(nmrraw.s))+5*std(imag(nmrraw.s)); +0197 bins1 = linspace(min1,max1,100); +0198 n1 = hist(imag(nmrraw.s),bins1); +0199 n1 = n1./trapz(bins1,n1); +0200 stairs(bins1,n1,'Color',maingui.myui.colors.IM,'LineWidth',1.5,'Parent',ax3); +0201 hold(ax3,'on'); +0202 line(xlims,[imag_mean imag_mean],'LineStyle','--','Color','g','Parent',ax1); +0203 line([imag_mean imag_mean],[0 max(n1)],... +0204 'color','g','LineStyle','--','Parent',ax3); +0205 +0206 lgdc = lgdc + 1; +0207 lgdstr{lgdc} = '\Immag'; +0208 lgdc = lgdc + 1; +0209 lgdstr{lgdc} = '\mu(\Immag)'; +0210 +0211 % update the text fields +0212 set(gui.text12,'String',sprintf('%5.4e',imag_mean)); +0213 set(gui.text32,'String',sprintf('%5.4e',imag_std)); +0214 end +0215 +0216 if isfield(data.results,'invstd') +0217 % plot residuals +0218 if nmrproc.noise > 0 +0219 plot(nmrproc.t,invstd.residual./nmrproc.e,'Parent',ax2); +0220 % get statistics +0221 residual = invstd.residual./nmrproc.e; +0222 err_mean = mean(residual); +0223 err_std = std(residual); +0224 else +0225 plot(nmrproc.t,invstd.residual,'Parent',ax2); +0226 % get statistics +0227 residual = invstd.residual; +0228 err_mean = mean(residual); +0229 err_std = std(residual); +0230 end +0231 xlims = get(maingui.axes_handles.proc,'XLim'); +0232 line(xlims,[0 0],'LineStyle','--','Color',colors.axisL,'Parent',ax2); +0233 line(xlims,[err_mean err_mean],'LineStyle','--','Color','b','Parent',ax2); +0234 +0235 if nmrproc.noise > 0 +0236 line(xlims,[-1 -1],'LineStyle','-.','LineWidth',1,'Color',colors.axisL,'Parent',ax2); +0237 line(xlims,[1 1],'LineStyle','-.','LineWidth',1,'Color',colors.axisL,'Parent',ax2); +0238 line(xlims,[err_mean-err_std err_mean-err_std],... +0239 'LineStyle','--','LineWidth',1,'Color','r','Parent',ax2); +0240 line(xlims,[err_mean+err_std err_mean+err_std],... +0241 'LineStyle','--','LineWidth',1,'Color','r','Parent',ax2); 0242 else -0243 set(gui.text52,'String',''); -0244 end -0245 set(gui.text62,'String',sprintf('%5.4e',invstd.rms)); -0246 -0247 % draw second histogram -0248 min2 = mean(invstd.residual)-5*std(invstd.residual); -0249 max2 = mean(invstd.residual)+5*std(invstd.residual); -0250 bins2 = linspace(min2,max2,100); -0251 n2 = hist(invstd.residual,bins2); -0252 n2 = n2./trapz(bins2,n2); -0253 stairs(bins2,n2,'Parent',ax3); -0254 line([mean(invstd.residual) mean(invstd.residual)],[0 max(n2)],... -0255 'color','b','LineStyle','--','Parent',ax3); -0256 set(get(ax3,'XLabel'),'String','\Immag | \epsilon'); -0257 set(get(ax3,'YLabel'),'String','count'); -0258 grid(ax3,'on'); -0259 -0260 lgdc = lgdc + 1; -0261 lgdstr{lgdc} = '\epsilon'; -0262 lgdc = lgdc + 1; -0263 lgdstr{lgdc} = '\mu(\epsilon)'; -0264 end -0265 lgh = legend(ax3,lgdstr); -0266 set(lgh,'FontSize',12); -0267 -0268 set(ax1,'FontSize',maingui.myui.fontsize); -0269 set(ax2,'FontSize',maingui.myui.fontsize); -0270 set(ax3,'FontSize',maingui.myui.fontsize); -0271 -0272 set(get(ax1,'YLabel'),'FontSize',16); -0273 set(get(ax2,'YLabel'),'FontSize',16); -0274 -0275 else -0276 helpdlg({'function: showFitStatistics',... -0277 'Cannot continue because no data is loaded!'},... -0278 'Load NMR data first.'); -0279 end -0280 else -0281 helpdlg({'function: showFitStatistics',... -0282 'Cannot continue because no data is loaded!'},... -0283 'Load NMR data first.'); -0284 end -0285 -0286 end -0287 -0288 %------------- END OF CODE -------------- -0289 -0290 %% License: -0291 % MIT License -0292 % -0293 % Copyright (c) 2018 Thomas Hiller -0294 % -0295 % Permission is hereby granted, free of charge, to any person obtaining a copy -0296 % of this software and associated documentation files (the "Software"), to deal -0297 % in the Software without restriction, including without limitation the rights -0298 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -0299 % copies of the Software, and to permit persons to whom the Software is -0300 % furnished to do so, subject to the following conditions: -0301 % -0302 % The above copyright notice and this permission notice shall be included in all -0303 % copies or substantial portions of the Software. -0304 % -0305 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -0306 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -0307 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -0308 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -0309 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -0310 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -0311 % SOFTWARE. +0243 line(xlims,[err_mean-err_std err_mean-err_std],... +0244 'LineStyle','-.','LineWidth',1,'Color','k','Parent',ax2); +0245 line(xlims,[err_mean+err_std err_mean+err_std],... +0246 'LineStyle','-.','LineWidth',1,'Color','k','Parent',ax2); +0247 end +0248 +0249 set(ax2,'XTickLabel',get(maingui.axes_handles.proc,'XTickLabel')); +0250 set(ax2,'YLim',[err_mean-3*err_std err_mean+3*err_std]); +0251 switch loglinx +0252 case 'x-axis -> lin' % log axes +0253 set(ax2,'XScale','log','XLim',xlims); +0254 case 'x-axis -> log' % lin axes +0255 set(ax2,'XScale','lin','XLim',xlims); +0256 end +0257 set(get(ax2,'XLabel'),'String','time [s]') +0258 set(get(ax2,'YLabel'),'String','\epsilon'); +0259 grid(ax2,'on'); +0260 +0261 % update the text fields +0262 set(gui.text22,'String',sprintf('%5.4e',err_mean)); +0263 set(gui.text42,'String',sprintf('%5.4e',err_std)); +0264 if nmrproc.noise > 0 +0265 if isfield(invstd,'chi2') +0266 set(gui.text52,'String',sprintf('%5.3f',invstd.chi2)); +0267 else +0268 set(gui.text52,'String',sprintf('%5.3f',err_std)); +0269 end +0270 else +0271 set(gui.text52,'String',''); +0272 end +0273 set(gui.text62,'String',sprintf('%5.4e',invstd.rms)); +0274 +0275 % draw second histogram +0276 min2 = mean(invstd.residual)-5*std(invstd.residual); +0277 max2 = mean(invstd.residual)+5*std(invstd.residual); +0278 bins2 = linspace(min2,max2,100); +0279 n2 = hist(invstd.residual,bins2); +0280 n2 = n2./trapz(bins2,n2); +0281 stairs(bins2,n2,'LineWidth',1.5,'Parent',ax3); +0282 line([mean(invstd.residual) mean(invstd.residual)],[0 max(n2)],... +0283 'color','b','LineStyle','--','Parent',ax3); +0284 set(get(ax3,'XLabel'),'String','\Immag & \epsilon'); +0285 set(get(ax3,'YLabel'),'String','count'); +0286 grid(ax3,'on'); +0287 +0288 lgdc = lgdc + 1; +0289 lgdstr{lgdc} = '\epsilon'; +0290 lgdc = lgdc + 1; +0291 lgdstr{lgdc} = '\mu(\epsilon)'; +0292 end +0293 lgh = legend(ax3,lgdstr); +0294 set(lgh,'FontSize',12,'TextColor',colors.panelFG); +0295 +0296 set(ax1,'FontSize',maingui.myui.fontsize); +0297 set(ax2,'FontSize',maingui.myui.fontsize); +0298 set(ax3,'FontSize',maingui.myui.fontsize); +0299 +0300 set(get(ax1,'YLabel'),'FontSize',16); +0301 set(get(ax2,'YLabel'),'FontSize',16); +0302 +0303 else +0304 helpdlg({'function: showFitStatistics',... +0305 'Cannot continue because no data is loaded!'},... +0306 'Load NMR data first.'); +0307 end +0308 else +0309 helpdlg({'function: showFitStatistics',... +0310 'Cannot continue because no data is loaded!'},... +0311 'Load NMR data first.'); +0312 end +0313 +0314 end +0315 +0316 %------------- END OF CODE -------------- +0317 +0318 % License: +0319 % MIT License +0320 % +0321 % Copyright (c) 2018 Thomas Hiller +0322 % +0323 % Permission is hereby granted, free of charge, to any person obtaining a copy +0324 % of this software and associated documentation files (the "Software"), to deal +0325 % in the Software without restriction, including without limitation the rights +0326 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0327 % copies of the Software, and to permit persons to whom the Software is +0328 % furnished to do so, subject to the following conditions: +0329 % +0330 % The above copyright notice and this permission notice shall be included in all +0331 % copies or substantial portions of the Software. +0332 % +0333 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0334 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0335 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0336 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0337 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0338 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0339 % SOFTWARE.
    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/functions/interface/showParameterInfo.html b/doc/nucleus/functions/interface/showParameterInfo.html index d1a28b7..ac617eb 100644 --- a/doc/nucleus/functions/interface/showParameterInfo.html +++ b/doc/nucleus/functions/interface/showParameterInfo.html @@ -125,7 +125,7 @@

    SOURCE CODE ^end 0056 end 0057 f1 = figure('Name',[fname,' Parameter Info'],'NumberTitle','off',... -0058 'ToolBar','none','MenuBar','none'); +0058 'ToolBar','none','MenuBar','none','Color',gui.myui.colors.panelBG); 0059 pos0 = get(fig,'Position'); 0060 pos1 = get(f1,'Position'); 0061 cent(1) = (pos0(1)+pos0(3)/2); @@ -137,44 +137,46 @@

    SOURCE CODE ^'Position'); 0068 w = (pos(3)-80)/2; 0069 set(th,'Position',[20 20 pos(3)-40 pos(4)-40],'ColumnWidth',{w w}); -0070 end -0071 else -0072 helpdlg({'function: showParameterInfo',... -0073 'Cannot continue because no data is selected!'},... -0074 'Select NMR data first.'); -0075 end -0076 else -0077 helpdlg({'function: showParameterInfo',... -0078 'Cannot continue because no data is loaded!'},... -0079 'Load NMR data first.'); -0080 end -0081 +0070 set(th,'BackGroundColor',gui.myui.colors.tableBG,... +0071 'ForeGroundColor',gui.myui.colors.tableFG) +0072 end +0073 else +0074 helpdlg({'function: showParameterInfo',... +0075 'Cannot continue because no data is selected!'},... +0076 'Select NMR data first.'); +0077 end +0078 else +0079 helpdlg({'function: showParameterInfo',... +0080 'Cannot continue because no data is loaded!'},... +0081 'Load NMR data first.'); 0082 end 0083 -0084 %------------- END OF CODE -------------- +0084 end 0085 -0086 %% License: -0087 % MIT License -0088 % -0089 % Copyright (c) 2018 Thomas Hiller +0086 %------------- END OF CODE -------------- +0087 +0088 %% License: +0089 % MIT License 0090 % -0091 % Permission is hereby granted, free of charge, to any person obtaining a copy -0092 % of this software and associated documentation files (the "Software"), to deal -0093 % in the Software without restriction, including without limitation the rights -0094 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -0095 % copies of the Software, and to permit persons to whom the Software is -0096 % furnished to do so, subject to the following conditions: -0097 % -0098 % The above copyright notice and this permission notice shall be included in all -0099 % copies or substantial portions of the Software. -0100 % -0101 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -0102 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -0103 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -0104 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -0105 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -0106 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -0107 % SOFTWARE. +0091 % Copyright (c) 2018 Thomas Hiller +0092 % +0093 % Permission is hereby granted, free of charge, to any person obtaining a copy +0094 % of this software and associated documentation files (the "Software"), to deal +0095 % in the Software without restriction, including without limitation the rights +0096 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0097 % copies of the Software, and to permit persons to whom the Software is +0098 % furnished to do so, subject to the following conditions: +0099 % +0100 % The above copyright notice and this permission notice shall be included in all +0101 % copies or substantial portions of the Software. +0102 % +0103 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0104 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0105 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0106 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0107 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0108 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0109 % SOFTWARE.
    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/functions/interface/switchToolTips.html b/doc/nucleus/functions/interface/switchToolTips.html index 6653da4..efb2486 100644 --- a/doc/nucleus/functions/interface/switchToolTips.html +++ b/doc/nucleus/functions/interface/switchToolTips.html @@ -29,17 +29,17 @@

    DESCRIPTION ^
    switchToolTips switches GUI tool tips either "on" or "off"
     
      Syntax:
    -       gui = switchToolTips(gui,onoff)
    +       switchToolTips(gui,onoff)
     
      Inputs:
            gui - figure gui elements structure
            onoff - 'on' or 'off'
     
      Outputs:
    -       gui
    +       none
     
      Example:
    -       gui = switchToolTips(gui,'on')
    +       switchToolTips(gui,'on')
     
      Other m-files required:
            none
    @@ -72,17 +72,17 @@ 

    SOURCE CODE ^%switchToolTips switches GUI tool tips either "on" or "off" 0003 % 0004 % Syntax: -0005 % gui = switchToolTips(gui,onoff) +0005 % switchToolTips(gui,onoff) 0006 % 0007 % Inputs: 0008 % gui - figure gui elements structure 0009 % onoff - 'on' or 'off' 0010 % 0011 % Outputs: -0012 % gui +0012 % none 0013 % 0014 % Example: -0015 % gui = switchToolTips(gui,'on') +0015 % switchToolTips(gui,'on') 0016 % 0017 % Other m-files required: 0018 % none diff --git a/doc/nucleus/functions/interface/updatePlotsCPS.html b/doc/nucleus/functions/interface/updatePlotsCPS.html index 474a2ae..abb38c1 100644 --- a/doc/nucleus/functions/interface/updatePlotsCPS.html +++ b/doc/nucleus/functions/interface/updatePlotsCPS.html @@ -61,7 +61,7 @@

    CROSS-REFERENCE INFORMATION ^
 <li><a href=getColorIndex exports graphics from both GUIs into various formats This function is called by: +
  • onContextTableSelect selects or deselects whole drainage and imbibition
  • onEditCPSTable updates entries made in the CPS table of NUCLEUSinv
  • onPopupPressureUnits select pressure unit ("Pa", "kPa", "MPa" or "bar")
  • caluclatePressureSaturation calculates the geometry dependent pressure
  • changeColorTheme changes the color theme of the calling figure
  • importMOD2MOD imports previously saved NUCLEUSmod data back into the GUI
  • SUBFUNCTIONS ^

    @@ -104,112 +104,115 @@

    SOURCE CODE ^'Tag','MOD'); 0034 gui = getappdata(fig,'gui'); 0035 data = getappdata(fig,'data'); -0036 -0037 % only proceed if there is cps data -0038 if isfield(data.results,'SAT') -0039 % get the cps axis handle -0040 ax = gui.axes_handles.cps; -0041 % clear previously plotted data -0042 ph = findall(ax,'Tag','SatPoints'); -0043 if ~isempty(ph) -0044 set(ph,'HandleVisibility','on') -0045 end -0046 cla(ax); -0047 -0048 % get pressure -0049 SAT = data.results.SAT; -0050 plotpress = SAT.pressure .* data.pressure.unitfac; -0051 xlstring = ['pressure [',data.pressure.unit,']']; -0052 -0053 % plot the cps data -0054 hold(ax,'on'); -0055 plot(plotpress,SAT.Sdfull,'k-','LineWidth',2,'Parent',ax); -0056 plot(plotpress,SAT.Sifull,'k--','LineWidth',2,'Parent',ax); -0057 -0058 % depending on the pressure spacing adjust the x-axis -0059 switch data.pressure.loglin -0060 case 0 % lin -0061 set(ax,'XScale','lin','XTickMode','auto'); -0062 set(ax,'XLim',[plotpress(1) plotpress(end)]); -0063 case 1 % log -0064 set(ax,'XScale','log'); -0065 xticks = log10(plotpress(1)):1:log10(plotpress(end)); -0066 set(ax,'XLim',[plotpress(1) plotpress(end)],'XTick',10.^xticks); -0067 end -0068 -0069 % y-axis -0070 set(ax,'YLim',[-0.1 1.1],'YTick',0:0.25:1); -0071 grid(ax,'on'); -0072 % labels and legend -0073 set(get(ax,'XLabel'),'String',xlstring); -0074 set(get(ax,'YLabel'),'String','saturation [-]'); -0075 legend(ax,'drain','imb','Location','best') -0076 % update GUI data -0077 setappdata(fig,'gui',gui); -0078 % now add the saturation level points on the curves -0079 plotSaturationLevelsCPS(data,ax); -0080 end -0081 -0082 end -0083 -0084 %% -0085 function plotSaturationLevelsCPS(data,ax) +0036 colors = gui.myui.colors; +0037 +0038 % only proceed if there is cps data +0039 if isfield(data.results,'SAT') +0040 % get the cps axis handle +0041 ax = gui.axes_handles.cps; +0042 % clear previously plotted data +0043 ph = findall(ax,'Tag','SatPoints'); +0044 if ~isempty(ph) +0045 set(ph,'HandleVisibility','on') +0046 end +0047 cla(ax); +0048 hold(ax,'on'); +0049 +0050 % get pressure +0051 SAT = data.results.SAT; +0052 plotpress = SAT.pressure .* data.pressure.unitfac; +0053 xlstring = ['pressure [',data.pressure.unit,']']; +0054 +0055 % plot the cps data +0056 hold(ax,'on'); +0057 plot(plotpress,SAT.Sdfull,'-','Color',colors.axisL,'LineWidth',2,'Parent',ax); +0058 plot(plotpress,SAT.Sifull,'--','Color',colors.axisL,'LineWidth',2,'Parent',ax); +0059 +0060 % depending on the pressure spacing adjust the x-axis +0061 switch data.pressure.loglin +0062 case 0 % lin +0063 set(ax,'XScale','lin','XTickMode','auto'); +0064 set(ax,'XLim',[plotpress(1) plotpress(end)]); +0065 case 1 % log +0066 set(ax,'XScale','log'); +0067 xticks = log10(plotpress(1)):1:log10(plotpress(end)); +0068 set(ax,'XLim',[plotpress(1) plotpress(end)],'XTick',10.^xticks); +0069 end +0070 +0071 % y-axis +0072 set(ax,'YLim',[-0.1 1.1],'YTick',0:0.25:1); +0073 grid(ax,'on'); +0074 % labels and legend +0075 set(get(ax,'XLabel'),'String',xlstring); +0076 set(get(ax,'YLabel'),'String','saturation [-]'); +0077 lgh = legend(ax,'drain','imb','Location','best'); +0078 set(lgh,'TextColor',colors.panelFG,'Color',colors.axisBG); +0079 % update GUI data +0080 setappdata(fig,'gui',gui); +0081 % now add the saturation level points on the curves +0082 plotSaturationLevelsCPS(data,ax); +0083 end +0084 +0085 end 0086 -0087 % get saturation and pressure -0088 SAT = data.results.SAT; -0089 plotpress = SAT.pressure .* data.pressure.unitfac; -0090 -0091 % clear previously plotted points -0092 ph = findall(ax,'Tag','SatPoints'); -0093 if ~isempty(ph) -0094 set(ph,'HandleVisibility','on') -0095 delete(ph); -0096 end -0097 -0098 % get the different levels -0099 indd = data.pressure.DrainLevels; -0100 indi = data.pressure.ImbLevels; -0101 -0102 % get the index on the colormap -0103 mycol = flipud(parula(128)); -0104 colindd = getColorIndex(SAT.Sdfull(indd),128); -0105 colindi = getColorIndex(SAT.Sifull(indi),128); -0106 % and plot the points on the CPS curve -0107 for i = 1:numel(indd) -0108 plot(plotpress(indd(i)),SAT.Sdfull(indd(i)),'s','Color',mycol(colindd(i),:),... -0109 'MarkerSize',8,'Parent',ax,'HandleVisibility','off','Tag','SatPoints'); -0110 end -0111 for i = 1:numel(indi) -0112 plot(plotpress(indi(i)),SAT.Sifull(indi(i)),'o','Color',mycol(colindi(i),:),... -0113 'MarkerSize',8,'Parent',ax,'HandleVisibility','off','Tag','SatPoints'); -0114 end -0115 -0116 end -0117 -0118 %------------- END OF CODE -------------- -0119 -0120 %% License: -0121 % MIT License -0122 % -0123 % Copyright (c) 2018 Thomas Hiller -0124 % -0125 % Permission is hereby granted, free of charge, to any person obtaining a copy -0126 % of this software and associated documentation files (the "Software"), to deal -0127 % in the Software without restriction, including without limitation the rights -0128 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -0129 % copies of the Software, and to permit persons to whom the Software is -0130 % furnished to do so, subject to the following conditions: -0131 % -0132 % The above copyright notice and this permission notice shall be included in all -0133 % copies or substantial portions of the Software. +0087 %% +0088 function plotSaturationLevelsCPS(data,ax) +0089 +0090 % get saturation and pressure +0091 SAT = data.results.SAT; +0092 plotpress = SAT.pressure .* data.pressure.unitfac; +0093 +0094 % clear previously plotted points +0095 ph = findall(ax,'Tag','SatPoints'); +0096 if ~isempty(ph) +0097 set(ph,'HandleVisibility','on') +0098 delete(ph); +0099 end +0100 +0101 % get the different levels +0102 indd = data.pressure.DrainLevels; +0103 indi = data.pressure.ImbLevels; +0104 +0105 % get the index on the colormap +0106 mycol = flipud(parula(128)); +0107 colindd = getColorIndex(SAT.Sdfull(indd),128); +0108 colindi = getColorIndex(SAT.Sifull(indi),128); +0109 % and plot the points on the CPS curve +0110 for i = 1:numel(indd) +0111 plot(plotpress(indd(i)),SAT.Sdfull(indd(i)),'s','Color',mycol(colindd(i),:),... +0112 'MarkerSize',8,'Parent',ax,'HandleVisibility','off','Tag','SatPoints'); +0113 end +0114 for i = 1:numel(indi) +0115 plot(plotpress(indi(i)),SAT.Sifull(indi(i)),'o','Color',mycol(colindi(i),:),... +0116 'MarkerSize',8,'Parent',ax,'HandleVisibility','off','Tag','SatPoints'); +0117 end +0118 +0119 end +0120 +0121 %------------- END OF CODE -------------- +0122 +0123 %% License: +0124 % MIT License +0125 % +0126 % Copyright (c) 2018 Thomas Hiller +0127 % +0128 % Permission is hereby granted, free of charge, to any person obtaining a copy +0129 % of this software and associated documentation files (the "Software"), to deal +0130 % in the Software without restriction, including without limitation the rights +0131 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0132 % copies of the Software, and to permit persons to whom the Software is +0133 % furnished to do so, subject to the following conditions: 0134 % -0135 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -0136 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -0137 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -0138 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -0139 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -0140 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -0141 % SOFTWARE.

    +0135 % The above copyright notice and this permission notice shall be included in all +0136 % copies or substantial portions of the Software. +0137 % +0138 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0139 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0140 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0141 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0142 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0143 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0144 % SOFTWARE.
    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/functions/interface/updatePlotsDistribution.html b/doc/nucleus/functions/interface/updatePlotsDistribution.html index 2bbd983..a19e1d3 100644 --- a/doc/nucleus/functions/interface/updatePlotsDistribution.html +++ b/doc/nucleus/functions/interface/updatePlotsDistribution.html @@ -190,7 +190,7 @@

    SOURCE CODE ^'LineWidth',2,'Parent',ax); 0120 % find approx. TLGM amplitude 0121 amp = findApproxTlgmAmplitude(invstd.T1T2me,F,invstd.Tlgm); -0122 stem(invstd.Tlgm,amp,'x-','Color',[0.3 0.3 0.3],... +0122 stem(invstd.Tlgm,amp,'x-','Color',col.axisL,... 0123 'LineWidth',2,'Tag','TLGM','Parent',ax); 0124 0125 % y-limits @@ -203,7 +203,7 @@

    SOURCE CODE ^'LineWidth',2,'Parent',ax); 0133 % find approx. TLGM amplitude 0134 amp = findApproxTlgmAmplitude(invstd.T1T2me,cumsum(F),invstd.Tlgm); -0135 stem(invstd.Tlgm,amp,'x-','Color',[0.3 0.3 0.3],... +0135 stem(invstd.Tlgm,amp,'x-','Color',col.axisL,... 0136 'LineWidth',2,'Tag','TLGM','Parent',ax); 0137 0138 % y-limits diff --git a/doc/nucleus/functions/interface/updatePlotsDistributionInfo.html b/doc/nucleus/functions/interface/updatePlotsDistributionInfo.html index 6aa0c75..d420e2f 100644 --- a/doc/nucleus/functions/interface/updatePlotsDistributionInfo.html +++ b/doc/nucleus/functions/interface/updatePlotsDistributionInfo.html @@ -105,8 +105,8 @@

    SOURCE CODE ^'gui'); 0036 data = getappdata(fig,'data'); 0037 -0038 % default color is grey -0039 col = [0.5 0.5 0.5]; +0038 % default color +0039 col = gui.myui.colors.axisL; 0040 0041 %% CUT OFF info 0042 % RTD axis diff --git a/doc/nucleus/functions/interface/updatePlotsGeometryType.html b/doc/nucleus/functions/interface/updatePlotsGeometryType.html index 26f2bdb..03d66ec 100644 --- a/doc/nucleus/functions/interface/updatePlotsGeometryType.html +++ b/doc/nucleus/functions/interface/updatePlotsGeometryType.html @@ -102,60 +102,62 @@

    SOURCE CODE ^'Tag','MOD'); 0034 gui = getappdata(fig,'gui'); 0035 data = getappdata(fig,'data'); -0036 -0037 % clear the current axis -0038 cla(ax); -0039 -0040 % check the geometry type and plot the cross-sectional shape -0041 if strcmp(data.geometry.type,'cyl') == 1 % cylindrical -0042 r = data.geometry.modes(1,1); -0043 phi = linspace(0,2*pi,360); -0044 x = r.*cos(phi); -0045 y = r.*sin(phi); -0046 plot(x,y,'k-','LineWidth',2,'Parent',ax); -0047 else % right angular & % polygonal -0048 if numel(data.results.psddata.psd) == 1 -0049 P = data.results.GEOM.Points; -0050 else -0051 P = squeeze(data.results.GEOM.Points(1,:,:)); -0052 end -0053 patch('Vertices',P,'Faces',1:1:size(P,1),'FaceColor','none',... -0054 'FaceAlpha',0,'EdgeColor','k','LineWidth',2,'Parent',ax); -0055 end -0056 -0057 % axis settings -0058 axis(ax,'equal'); -0059 axis(ax,'tight'); -0060 set(ax,'XScale','lin','XLim',get(ax,'XLim').*[1.3 1.3],'XTick',[]); -0061 set(ax,'XTickLabel','','YTickLabel','','Color','none',... -0062 'XColor','none','YColor','none'); -0063 -0064 end +0036 colors = gui.myui.colors; +0037 +0038 % clear the current axis +0039 cla(ax); +0040 hold(ax,'on'); +0041 +0042 % check the geometry type and plot the cross-sectional shape +0043 if strcmp(data.geometry.type,'cyl') == 1 % cylindrical +0044 r = data.geometry.modes(1,1); +0045 phi = linspace(0,2*pi,360); +0046 x = r.*cos(phi); +0047 y = r.*sin(phi); +0048 plot(x,y,'-','Color',colors.axisL,'LineWidth',2,'Parent',ax); +0049 else % right angular & % polygonal +0050 if numel(data.results.psddata.psd) == 1 +0051 P = data.results.GEOM.Points; +0052 else +0053 P = squeeze(data.results.GEOM.Points(1,:,:)); +0054 end +0055 patch('Vertices',P,'Faces',1:1:size(P,1),'FaceColor','none',... +0056 'FaceAlpha',0,'EdgeColor',colors.axisL,'LineWidth',2,'Parent',ax); +0057 end +0058 +0059 % axis settings +0060 axis(ax,'equal'); +0061 axis(ax,'tight'); +0062 set(ax,'XScale','lin','XLim',get(ax,'XLim').*[1.3 1.3],'XTick',[]); +0063 set(ax,'XTickLabel','','YTickLabel','','Color','none',... +0064 'XColor','none','YColor','none'); 0065 -0066 %------------- END OF CODE -------------- +0066 end 0067 -0068 %% License: -0069 % MIT License -0070 % -0071 % Copyright (c) 2018 Thomas Hiller +0068 %------------- END OF CODE -------------- +0069 +0070 %% License: +0071 % MIT License 0072 % -0073 % Permission is hereby granted, free of charge, to any person obtaining a copy -0074 % of this software and associated documentation files (the "Software"), to deal -0075 % in the Software without restriction, including without limitation the rights -0076 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -0077 % copies of the Software, and to permit persons to whom the Software is -0078 % furnished to do so, subject to the following conditions: -0079 % -0080 % The above copyright notice and this permission notice shall be included in all -0081 % copies or substantial portions of the Software. -0082 % -0083 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -0084 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -0085 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -0086 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -0087 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -0088 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -0089 % SOFTWARE. +0073 % Copyright (c) 2018 Thomas Hiller +0074 % +0075 % Permission is hereby granted, free of charge, to any person obtaining a copy +0076 % of this software and associated documentation files (the "Software"), to deal +0077 % in the Software without restriction, including without limitation the rights +0078 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0079 % copies of the Software, and to permit persons to whom the Software is +0080 % furnished to do so, subject to the following conditions: +0081 % +0082 % The above copyright notice and this permission notice shall be included in all +0083 % copies or substantial portions of the Software. +0084 % +0085 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0086 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0087 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0088 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0089 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0090 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0091 % SOFTWARE.
    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/functions/interface/updatePlotsJointInversion.html b/doc/nucleus/functions/interface/updatePlotsJointInversion.html index 0bf04f1..b679f41 100644 --- a/doc/nucleus/functions/interface/updatePlotsJointInversion.html +++ b/doc/nucleus/functions/interface/updatePlotsJointInversion.html @@ -244,234 +244,237 @@

    SOURCE CODE ^'YLabel'),'String','amplitude [a.u.]'); 0174 0175 % legend -0176 legend(ax,lgdstr,'Location','NorthEast','Tag','alllegend','FontSize',10); -0177 % grid -0178 grid(ax,'on'); -0179 -0180 %% residual plot -0181 xlims = get(ax,'XLim'); -0182 line(xlims,[0 0],'LineStyle','--','LineWidth',1,'Color','k','Parent',axE); -0183 if nmr{levels(1)}.noise > 0 -0184 line(xlims,[-1 -1],'LineStyle','-.','LineWidth',1,... -0185 'Color','k','Parent',axE); -0186 line(xlims,[1 1],'LineStyle','-.','LineWidth',1,... -0187 'Color','k','Parent',axE); -0188 set(axE,'XTickLabel',''); -0189 set(axE,'YLim',[-max(abs(ylimsE)) max(abs(ylimsE))]); -0190 set(axE,'YTickMode','auto','YTickLabelMode','auto'); -0191 set(get(axE,'YLabel'),'String',{'noise';'weighted';'residuals'},... -0192 'FontWeight','normal'); -0193 else -0194 set(axE,'XTickLabel',''); -0195 set(axE,'YLim',[-max(abs(ylimsE)) max(abs(ylimsE))]); -0196 set(axE,'YTickMode','auto','YTickLabelMode','auto') -0197 set(get(axE,'YLabel'),'String','residuals',... -0198 'FontWeight','normal'); -0199 end -0200 switch loglinx -0201 case 'x-axis -> lin' % log axes -0202 set(axE,'XScale','log','XLim',xlims); -0203 case 'x-axis -> log' % lin axes -0204 set(axE,'XScale','lin','XLim',xlims); -0205 end -0206 -0207 %% PSD data plot -0208 ax = gui.axes_handles.psdj; -0209 clearSingleAxis(ax); -0210 hold(ax,'on'); -0211 -0212 % x-axis label -0213 switch data.process.timescale -0214 case 's' -0215 xlstring = 'equiv. pore size [m]'; -0216 case 'ms' -0217 xlstring = 'equiv. pore size [mm]'; -0218 end -0219 -0220 % inverted PSD amplitudes -0221 F = invjoint.iF; -0222 -0223 switch data.info.PSDJflag -0224 case 'freq' -0225 F = (data.invstd.porosity*100).*F./sum(F); -0226 maxF1 = max(F); -0227 if isfield(data.import,'NMRMOD') -0228 F = F./trapz(iGEOM.radius,F); -0229 maxF2 = max(F); -0230 fac1 = (maxF1/maxF2); -0231 else -0232 fac1 = 1; -0233 end -0234 plot(iGEOM.radius,F.*fac1,'o-','Color',col.FIT,'LineWidth',2,'Parent',ax); -0235 ylim = max(F.*fac1); -0236 -0237 if isfield(data.import,'NMRMOD') -0238 modr = data.import.NMRMOD.psddata.r; -0239 modf = data.import.NMRMOD.psddata.psd; -0240 modf = (data.invstd.porosity*100).*modf./sum(modf); -0241 modf = modf./trapz(modr,modf); -0242 fac2 = ylim/maxF2; -0243 plot(modr,modf.*fac2,'k--','LineWidth',1,'Parent',ax); -0244 ylim = max([ylim max(modf.*fac2)]); -0245 lgdstr = {'fit','model'}; -0246 else -0247 lgdstr = {'fit'}; -0248 end -0249 -0250 % y-limits -0251 set(ax,'YScale','lin','YLim',[0 ylim*1.05]); -0252 % y-label -0253 if isfield(data.import,'NMRMOD') -0254 set(get(ax,'YLabel'),'String','water content [vol. %]'); -0255 else -0256 set(get(ax,'YLabel'),'String','water content [vol. %]'); -0257 end -0258 -0259 case 'cum' -0260 F = (data.invstd.porosity*100).*F./sum(F); -0261 plot(iGEOM.radius,cumsum(F),'o-','Color',col.FIT,'LineWidth',2,'Parent',ax); -0262 ylim = sum(F); -0263 -0264 if isfield(data.import,'NMRMOD') -0265 modr = data.import.NMRMOD.psddata.r; -0266 modf = data.import.NMRMOD.psddata.psd; -0267 modf = (data.invstd.porosity*100).*modf./sum(modf); -0268 plot(modr,cumsum(modf),'k--','LineWidth',1,'Parent',ax); -0269 ylim = max([ylim sum(modf)]); -0270 lgdstr = {'fit','model'}; -0271 else -0272 lgdstr = {'fit'}; -0273 end -0274 -0275 % y-limits -0276 set(ax,'YScale','lin','YLim',[0 ylim*1.05]); -0277 % y-label -0278 set(get(ax,'YLabel'),'String','cumulative water content [vol. %]'); -0279 end -0280 -0281 % x-limits -0282 ticks = round(log10(min(iGEOM.radius)) :1: log10(max(iGEOM.radius))); -0283 set(ax,'XScale','log','XLim',[10^(ticks(1)) 10^(ticks(end))],'XTick',10.^ticks); -0284 % x-label -0285 set(get(ax,'XLabel'),'String',xlstring); -0286 -0287 % legend -0288 legend(ax,lgdstr,'Location','NorthEast','Tag','psdjlegend','FontSize',10); -0289 % grid -0290 grid(ax,'on'); -0291 -0292 %% CPS data plot -0293 ax = gui.axes_handles.cps; -0294 ph = findall(ax,'Tag','SatPoints'); -0295 if ~isempty(ph) -0296 set(ph,'HandleVisibility','on') -0297 delete(ph); -0298 end -0299 clearSingleAxis(ax); -0300 hold(ax,'on'); -0301 -0302 plotpress = pSAT.pressure .* data.pressure.unitfac; -0303 xlstring = ['pressure [',data.pressure.unit,']']; -0304 -0305 if data.invstd.porosity < 1 -0306 WRCfac = data.invstd.porosity*100; -0307 else -0308 WRCfac = 1; -0309 end -0310 -0311 plot(plotpress,WRCfac.*pSAT.Sdfull,'-','Color',col.FIT,'LineWidth',2,'Parent',ax); -0312 plot(plotpress,WRCfac.*pSAT.Sifull,'--','Color',col.FIT,'LineWidth',2,'Parent',ax); -0313 -0314 % special treatment if there is NUCLEUSmod data -0315 if isfield(data.import,'NMRMOD') -0316 modp = data.import.NMRMOD.p .* data.pressure.unitfac; -0317 modSd = data.import.NMRMOD.Sd; -0318 modSi = data.import.NMRMOD.Si; -0319 plot(modp,WRCfac.*modSd,'k-','LineWidth',1,'Parent',ax); -0320 plot(modp,WRCfac.*modSi,'k--','LineWidth',1,'Parent',ax); -0321 lgdstr = {'fit_{drain}','fit_{imb}','model_{drain}','model_{imb}'}; -0322 else -0323 lgdstr = {'fit_{drain}','fit_{imb}'}; -0324 end -0325 -0326 % plot the individual levels -0327 for i = 1:numel(levels) -0328 p = invjoint.p0(levels(i)).*data.pressure.unitfac; -0329 S = WRCfac.*invjoint.S0(levels(i)); -0330 switch SatImbDrain(i) -0331 case 'D' -0332 plot(p,S,'s','Color',mycol(colindd(i),:),'MarkerSize',8,'Parent',ax,... -0333 'HandleVisibility','off','Tag','SatPoints'); -0334 case 'I' -0335 plot(p,S,'o','Color',mycol(colindi(i),:),'MarkerSize',8,'Parent',ax,... -0336 'HandleVisibility','off','Tag','SatPoints'); -0337 end -0338 end -0339 -0340 % x-limits -0341 set(ax,'XScale','log'); -0342 xticks = log10(plotpress(1)):1:log10(plotpress(end)); -0343 set(ax,'XLim',[plotpress(1) plotpress(end)],'XTick',10.^xticks); -0344 % y-limits -0345 if data.invstd.porosity < 1 -0346 set(ax,'YLim',[-WRCfac/10 WRCfac.*1.1],'YTickMode','auto'); -0347 else -0348 set(ax,'YLim',[-0.1 1.1],'YTick',linspace(0,1,5)); -0349 end -0350 % labels -0351 set(get(ax,'XLabel'),'String',xlstring); -0352 if data.invstd.porosity < 1 -0353 set(get(ax,'YLabel'),'String','water content [vol. %]'); -0354 else -0355 set(get(ax,'YLabel'),'String','saturation [-]'); -0356 end -0357 % legend -0358 legend(ax,lgdstr,'Location','NorthEast','Tag','cpslegend','FontSize',10); -0359 % grid -0360 grid(ax,'on'); -0361 -0362 %% finalize -0363 beautifyAxes(fig); -0364 % update GUI data -0365 setappdata(fig,'data',data); -0366 setappdata(fig,'gui',gui); -0367 else -0368 % if not, clear old data in the joint PSD and CPS axes -0369 clearSingleAxis(gui.axes_handles.psdj); -0370 ph = findall(gui.axes_handles.cps,'Tag','SatPoints'); -0371 if ~isempty(ph) -0372 set(ph,'HandleVisibility','on') -0373 delete(ph); -0374 end -0375 clearSingleAxis(gui.axes_handles.cps); -0376 end -0377 -0378 end -0379 -0380 %------------- END OF CODE -------------- -0381 -0382 %% License: -0383 % MIT License -0384 % -0385 % Copyright (c) 2018 Thomas Hiller -0386 % -0387 % Permission is hereby granted, free of charge, to any person obtaining a copy -0388 % of this software and associated documentation files (the "Software"), to deal -0389 % in the Software without restriction, including without limitation the rights -0390 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -0391 % copies of the Software, and to permit persons to whom the Software is -0392 % furnished to do so, subject to the following conditions: -0393 % -0394 % The above copyright notice and this permission notice shall be included in all -0395 % copies or substantial portions of the Software. +0176 lgh = legend(ax,lgdstr,'Location','NorthEast','Tag','alllegend'); +0177 set(lgh,'FontSize',10,'TextColor',col.panelFG); +0178 % grid +0179 grid(ax,'on'); +0180 +0181 %% residual plot +0182 xlims = get(ax,'XLim'); +0183 line(xlims,[0 0],'LineStyle','--','LineWidth',1,'Color',col.axisL,'Parent',axE); +0184 if nmr{levels(1)}.noise > 0 +0185 line(xlims,[-1 -1],'LineStyle','-.','LineWidth',1,... +0186 'Color',col.axisL,'Parent',axE); +0187 line(xlims,[1 1],'LineStyle','-.','LineWidth',1,... +0188 'Color',col.axisL,'Parent',axE); +0189 set(axE,'XTickLabel',''); +0190 set(axE,'YLim',[-max(abs(ylimsE)) max(abs(ylimsE))]); +0191 set(axE,'YTickMode','auto','YTickLabelMode','auto'); +0192 set(get(axE,'YLabel'),'String',{'noise';'weighted';'residuals'},... +0193 'FontWeight','normal'); +0194 else +0195 set(axE,'XTickLabel',''); +0196 set(axE,'YLim',[-max(abs(ylimsE)) max(abs(ylimsE))]); +0197 set(axE,'YTickMode','auto','YTickLabelMode','auto') +0198 set(get(axE,'YLabel'),'String','residuals',... +0199 'FontWeight','normal'); +0200 end +0201 switch loglinx +0202 case 'x-axis -> lin' % log axes +0203 set(axE,'XScale','log','XLim',xlims); +0204 case 'x-axis -> log' % lin axes +0205 set(axE,'XScale','lin','XLim',xlims); +0206 end +0207 +0208 %% PSD data plot +0209 ax = gui.axes_handles.psdj; +0210 clearSingleAxis(ax); +0211 hold(ax,'on'); +0212 +0213 % x-axis label +0214 switch data.process.timescale +0215 case 's' +0216 xlstring = 'equiv. pore size [m]'; +0217 case 'ms' +0218 xlstring = 'equiv. pore size [mm]'; +0219 end +0220 +0221 % inverted PSD amplitudes +0222 F = invjoint.iF; +0223 +0224 switch data.info.PSDJflag +0225 case 'freq' +0226 F = (data.invstd.porosity*100).*F./sum(F); +0227 maxF1 = max(F); +0228 if isfield(data.import,'NMRMOD') +0229 F = F./trapz(iGEOM.radius,F); +0230 maxF2 = max(F); +0231 fac1 = (maxF1/maxF2); +0232 else +0233 fac1 = 1; +0234 end +0235 plot(iGEOM.radius,F.*fac1,'o-','Color',col.FIT,'LineWidth',2,'Parent',ax); +0236 ylim = max(F.*fac1); +0237 +0238 if isfield(data.import,'NMRMOD') +0239 modr = data.import.NMRMOD.psddata.r; +0240 modf = data.import.NMRMOD.psddata.psd; +0241 modf = (data.invstd.porosity*100).*modf./sum(modf); +0242 modf = modf./trapz(modr,modf); +0243 fac2 = ylim/maxF2; +0244 plot(modr,modf.*fac2,'k--','LineWidth',1,'Parent',ax); +0245 ylim = max([ylim max(modf.*fac2)]); +0246 lgdstr = {'fit','model'}; +0247 else +0248 lgdstr = {'fit'}; +0249 end +0250 +0251 % y-limits +0252 set(ax,'YScale','lin','YLim',[0 ylim*1.05]); +0253 % y-label +0254 if isfield(data.import,'NMRMOD') +0255 set(get(ax,'YLabel'),'String','water content [vol. %]'); +0256 else +0257 set(get(ax,'YLabel'),'String','water content [vol. %]'); +0258 end +0259 +0260 case 'cum' +0261 F = (data.invstd.porosity*100).*F./sum(F); +0262 plot(iGEOM.radius,cumsum(F),'o-','Color',col.FIT,'LineWidth',2,'Parent',ax); +0263 ylim = sum(F); +0264 +0265 if isfield(data.import,'NMRMOD') +0266 modr = data.import.NMRMOD.psddata.r; +0267 modf = data.import.NMRMOD.psddata.psd; +0268 modf = (data.invstd.porosity*100).*modf./sum(modf); +0269 plot(modr,cumsum(modf),'k--','LineWidth',1,'Parent',ax); +0270 ylim = max([ylim sum(modf)]); +0271 lgdstr = {'fit','model'}; +0272 else +0273 lgdstr = {'fit'}; +0274 end +0275 +0276 % y-limits +0277 set(ax,'YScale','lin','YLim',[0 ylim*1.05]); +0278 % y-label +0279 set(get(ax,'YLabel'),'String','cumulative water content [vol. %]'); +0280 end +0281 +0282 % x-limits +0283 ticks = round(log10(min(iGEOM.radius)) :1: log10(max(iGEOM.radius))); +0284 set(ax,'XScale','log','XLim',[10^(ticks(1)) 10^(ticks(end))],'XTick',10.^ticks); +0285 % x-label +0286 set(get(ax,'XLabel'),'String',xlstring); +0287 +0288 % legend +0289 lgh = legend(ax,lgdstr,'Location','NorthEast','Tag','psdjlegend'); +0290 set(lgh,'FontSize',10,'TextColor',col.panelFG); +0291 % grid +0292 grid(ax,'on'); +0293 +0294 %% CPS data plot +0295 ax = gui.axes_handles.cps; +0296 ph = findall(ax,'Tag','SatPoints'); +0297 if ~isempty(ph) +0298 set(ph,'HandleVisibility','on') +0299 delete(ph); +0300 end +0301 clearSingleAxis(ax); +0302 hold(ax,'on'); +0303 +0304 plotpress = pSAT.pressure .* data.pressure.unitfac; +0305 xlstring = ['pressure [',data.pressure.unit,']']; +0306 +0307 if data.invstd.porosity < 1 +0308 WRCfac = data.invstd.porosity*100; +0309 else +0310 WRCfac = 1; +0311 end +0312 +0313 plot(plotpress,WRCfac.*pSAT.Sdfull,'-','Color',col.FIT,'LineWidth',2,'Parent',ax); +0314 plot(plotpress,WRCfac.*pSAT.Sifull,'--','Color',col.FIT,'LineWidth',2,'Parent',ax); +0315 +0316 % special treatment if there is NUCLEUSmod data +0317 if isfield(data.import,'NMRMOD') +0318 modp = data.import.NMRMOD.p .* data.pressure.unitfac; +0319 modSd = data.import.NMRMOD.Sd; +0320 modSi = data.import.NMRMOD.Si; +0321 plot(modp,WRCfac.*modSd,'k-','LineWidth',1,'Parent',ax); +0322 plot(modp,WRCfac.*modSi,'k--','LineWidth',1,'Parent',ax); +0323 lgdstr = {'fit_{drain}','fit_{imb}','model_{drain}','model_{imb}'}; +0324 else +0325 lgdstr = {'fit_{drain}','fit_{imb}'}; +0326 end +0327 +0328 % plot the individual levels +0329 for i = 1:numel(levels) +0330 p = invjoint.p0(levels(i)).*data.pressure.unitfac; +0331 S = WRCfac.*invjoint.S0(levels(i)); +0332 switch SatImbDrain(i) +0333 case 'D' +0334 plot(p,S,'s','Color',mycol(colindd(i),:),'MarkerSize',8,'Parent',ax,... +0335 'HandleVisibility','off','Tag','SatPoints'); +0336 case 'I' +0337 plot(p,S,'o','Color',mycol(colindi(i),:),'MarkerSize',8,'Parent',ax,... +0338 'HandleVisibility','off','Tag','SatPoints'); +0339 end +0340 end +0341 +0342 % x-limits +0343 set(ax,'XScale','log'); +0344 xticks = log10(plotpress(1)):1:log10(plotpress(end)); +0345 set(ax,'XLim',[plotpress(1) plotpress(end)],'XTick',10.^xticks); +0346 % y-limits +0347 if data.invstd.porosity < 1 +0348 set(ax,'YLim',[-WRCfac/10 WRCfac.*1.1],'YTickMode','auto'); +0349 else +0350 set(ax,'YLim',[-0.1 1.1],'YTick',linspace(0,1,5)); +0351 end +0352 % labels +0353 set(get(ax,'XLabel'),'String',xlstring); +0354 if data.invstd.porosity < 1 +0355 set(get(ax,'YLabel'),'String','water content [vol. %]'); +0356 else +0357 set(get(ax,'YLabel'),'String','saturation [-]'); +0358 end +0359 % legend +0360 lgh = legend(ax,lgdstr,'Location','NorthEast','Tag','cpslegend'); +0361 set(lgh,'FontSize',10,'TextColor',col.panelFG); +0362 % grid +0363 grid(ax,'on'); +0364 +0365 %% finalize +0366 beautifyAxes(fig); +0367 % update GUI data +0368 setappdata(fig,'data',data); +0369 setappdata(fig,'gui',gui); +0370 else +0371 % if not, clear old data in the joint PSD and CPS axes +0372 clearSingleAxis(gui.axes_handles.psdj); +0373 ph = findall(gui.axes_handles.cps,'Tag','SatPoints'); +0374 if ~isempty(ph) +0375 set(ph,'HandleVisibility','on') +0376 delete(ph); +0377 end +0378 clearSingleAxis(gui.axes_handles.cps); +0379 end +0380 +0381 end +0382 +0383 %------------- END OF CODE -------------- +0384 +0385 %% License: +0386 % MIT License +0387 % +0388 % Copyright (c) 2018 Thomas Hiller +0389 % +0390 % Permission is hereby granted, free of charge, to any person obtaining a copy +0391 % of this software and associated documentation files (the "Software"), to deal +0392 % in the Software without restriction, including without limitation the rights +0393 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0394 % copies of the Software, and to permit persons to whom the Software is +0395 % furnished to do so, subject to the following conditions: 0396 % -0397 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -0398 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -0399 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -0400 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -0401 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -0402 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -0403 % SOFTWARE. +0397 % The above copyright notice and this permission notice shall be included in all +0398 % copies or substantial portions of the Software. +0399 % +0400 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0401 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0402 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0403 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0404 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0405 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0406 % SOFTWARE.
    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/functions/interface/updatePlotsNMR.html b/doc/nucleus/functions/interface/updatePlotsNMR.html index 46319aa..5e600ea 100644 --- a/doc/nucleus/functions/interface/updatePlotsNMR.html +++ b/doc/nucleus/functions/interface/updatePlotsNMR.html @@ -61,7 +61,7 @@

    CROSS-REFERENCE INFORMATION ^
 <li><a href=beautifyAxes can be used to globally change the general appearance of axes
  • clearSingleAxis clears an individual axis
  • getColorIndex exports graphics from both GUIs into various formats
  • This function is called by: +
  • onContextAxisLogLin changes the label of an axis context menu which allows to
  • onContextAxisT1T2 checks the axis context menu for plotting either T1 or
  • onContextTableSelect selects or deselects whole drainage and imbibition
  • onEditCPSTable updates entries made in the CPS table of NUCLEUSinv
  • onEditValue updates all edit field values, checks for wrong inputs and
  • calculateNMR calculates the NMR signals for the full and partially saturated
  • changeColorTheme changes the color theme of the calling figure
  • importMOD2MOD imports previously saved NUCLEUSmod data back into the GUI
  • @@ -102,105 +102,107 @@

    SOURCE CODE ^'Tag','MOD'); 0034 gui = getappdata(fig,'gui'); 0035 data = getappdata(fig,'data'); -0036 -0037 % axis handle -0038 ax = gui.axes_handles.nmr; -0039 clearSingleAxis(ax); -0040 -0041 if isfield(data.results,'NMR') -0042 % drainage and imbibition levels -0043 indd = data.pressure.DrainLevels; -0044 indi = data.pressure.ImbLevels; -0045 -0046 % NMR data to plot -0047 NMR = data.results.NMR; -0048 -0049 mycol = flipud(parula(128)); -0050 % color for the individual NMR signals -0051 colindd = getColorIndex(data.results.SAT.Sdfull(indd),128); -0052 colindi = getColorIndex(data.results.SAT.Sifull(indi),128); -0053 -0054 hold(ax,'on'); -0055 switch data.nmr.toplot -0056 case 'T1' -0057 for i = 1:numel(indd) -0058 plot(NMR.t,NMR.EdT1(indd(i),:),'-','Color',mycol(colindd(i),:),... -0059 'MarkerSize',5,'Parent',ax); -0060 end -0061 for i = 1:numel(indi) -0062 plot(NMR.t,NMR.EiT1(indi(i),:),'--','Color',mycol(colindi(i),:),... -0063 'MarkerSize',10,'Parent',ax); -0064 end -0065 -0066 case 'T2' -0067 for i = 1:numel(indd) -0068 plot(NMR.t,NMR.EdT2(indd(i),:),'-','Color',mycol(colindd(i),:),... -0069 'MarkerSize',5,'Parent',ax); -0070 end -0071 for i = 1:numel(indi) -0072 plot(NMR.t,NMR.EiT2(indi(i),:),'--','Color',mycol(colindi(i),:),... -0073 'MarkerSize',10,'Parent',ax); -0074 end -0075 end -0076 -0077 % x-limits -0078 loglinx = get(gui.cm_handles.nmr_cm_xaxis,'Label'); -0079 switch loglinx -0080 case 'x-axis -> lin' % log axes -0081 set(ax,'XScale','log','XLim',[NMR.t(2) max(NMR.t)],'XTickMode','auto'); -0082 case 'x-axis -> log' % lin axes -0083 set(ax,'XScale','lin','XLim',[0 max(NMR.t)],'XTickMode','auto'); -0084 end -0085 -0086 % y-limits -0087 logliny = get(gui.cm_handles.nmr_cm_yaxis,'Label'); -0088 switch logliny -0089 case 'y-axis -> lin' % log axes -0090 set(ax,'YScale','log','YLim',[1e-4 1.01*data.nmr.porosity],'YTick',[1e-4 1e-3 1e-2 1e-1 1]); -0091 case 'y-axis -> log' % lin axes -0092 set(ax,'YScale','lin','YLim',[0 1.1*data.nmr.porosity],'YTick',linspace(0,data.nmr.porosity,6)); -0093 end -0094 -0095 hold(ax,'off'); -0096 grid(ax,'on'); -0097 -0098 % axis labels -0099 set(get(ax,'XLabel'),'String','time [s]'); -0100 if data.nmr.porosity < 1 -0101 set(get(ax,'YLabel'),'String','water content [-]'); -0102 else -0103 set(get(ax,'YLabel'),'String','amplitude [-]'); -0104 end -0105 end -0106 -0107 beautifyAxes(gui.figh); +0036 colors = gui.myui.colors; +0037 +0038 % axis handle +0039 ax = gui.axes_handles.nmr; +0040 clearSingleAxis(ax); +0041 hold(ax,'on'); +0042 +0043 if isfield(data.results,'NMR') +0044 % drainage and imbibition levels +0045 indd = data.pressure.DrainLevels; +0046 indi = data.pressure.ImbLevels; +0047 +0048 % NMR data to plot +0049 NMR = data.results.NMR; +0050 +0051 mycol = flipud(parula(128)); +0052 % color for the individual NMR signals +0053 colindd = getColorIndex(data.results.SAT.Sdfull(indd),128); +0054 colindi = getColorIndex(data.results.SAT.Sifull(indi),128); +0055 +0056 hold(ax,'on'); +0057 switch data.nmr.toplot +0058 case 'T1' +0059 for i = 1:numel(indd) +0060 plot(NMR.t,NMR.EdT1(indd(i),:),'-','Color',mycol(colindd(i),:),... +0061 'MarkerSize',5,'Parent',ax); +0062 end +0063 for i = 1:numel(indi) +0064 plot(NMR.t,NMR.EiT1(indi(i),:),'--','Color',mycol(colindi(i),:),... +0065 'MarkerSize',10,'Parent',ax); +0066 end +0067 +0068 case 'T2' +0069 for i = 1:numel(indd) +0070 plot(NMR.t,NMR.EdT2(indd(i),:),'-','Color',mycol(colindd(i),:),... +0071 'MarkerSize',5,'Parent',ax); +0072 end +0073 for i = 1:numel(indi) +0074 plot(NMR.t,NMR.EiT2(indi(i),:),'--','Color',mycol(colindi(i),:),... +0075 'MarkerSize',10,'Parent',ax); +0076 end +0077 end +0078 +0079 % x-limits +0080 loglinx = get(gui.cm_handles.nmr_cm_xaxis,'Label'); +0081 switch loglinx +0082 case 'x-axis -> lin' % log axes +0083 set(ax,'XScale','log','XLim',[NMR.t(2) max(NMR.t)],'XTickMode','auto'); +0084 case 'x-axis -> log' % lin axes +0085 set(ax,'XScale','lin','XLim',[0 max(NMR.t)],'XTickMode','auto'); +0086 end +0087 +0088 % y-limits +0089 logliny = get(gui.cm_handles.nmr_cm_yaxis,'Label'); +0090 switch logliny +0091 case 'y-axis -> lin' % log axes +0092 set(ax,'YScale','log','YLim',[1e-4 1.01*data.nmr.porosity],'YTick',[1e-4 1e-3 1e-2 1e-1 1]); +0093 case 'y-axis -> log' % lin axes +0094 set(ax,'YScale','lin','YLim',[0 1.1*data.nmr.porosity],'YTick',linspace(0,data.nmr.porosity,6)); +0095 end +0096 +0097 hold(ax,'off'); +0098 grid(ax,'on'); +0099 +0100 % axis labels +0101 set(get(ax,'XLabel'),'String','time [s]'); +0102 if data.nmr.porosity < 1 +0103 set(get(ax,'YLabel'),'String','water content [-]'); +0104 else +0105 set(get(ax,'YLabel'),'String','amplitude [-]'); +0106 end +0107 end 0108 -0109 end +0109 beautifyAxes(gui.figh); 0110 -0111 %------------- END OF CODE -------------- +0111 end 0112 -0113 %% License: -0114 % MIT License -0115 % -0116 % Copyright (c) 2018 Thomas Hiller +0113 %------------- END OF CODE -------------- +0114 +0115 %% License: +0116 % MIT License 0117 % -0118 % Permission is hereby granted, free of charge, to any person obtaining a copy -0119 % of this software and associated documentation files (the "Software"), to deal -0120 % in the Software without restriction, including without limitation the rights -0121 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -0122 % copies of the Software, and to permit persons to whom the Software is -0123 % furnished to do so, subject to the following conditions: -0124 % -0125 % The above copyright notice and this permission notice shall be included in all -0126 % copies or substantial portions of the Software. -0127 % -0128 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -0129 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -0130 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -0131 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -0132 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -0133 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -0134 % SOFTWARE. +0118 % Copyright (c) 2018 Thomas Hiller +0119 % +0120 % Permission is hereby granted, free of charge, to any person obtaining a copy +0121 % of this software and associated documentation files (the "Software"), to deal +0122 % in the Software without restriction, including without limitation the rights +0123 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0124 % copies of the Software, and to permit persons to whom the Software is +0125 % furnished to do so, subject to the following conditions: +0126 % +0127 % The above copyright notice and this permission notice shall be included in all +0128 % copies or substantial portions of the Software. +0129 % +0130 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0131 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0132 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0133 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0134 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0135 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0136 % SOFTWARE.
    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/functions/interface/updatePlotsPSD.html b/doc/nucleus/functions/interface/updatePlotsPSD.html index 8c08a48..54e2311 100644 --- a/doc/nucleus/functions/interface/updatePlotsPSD.html +++ b/doc/nucleus/functions/interface/updatePlotsPSD.html @@ -63,7 +63,7 @@

    CROSS-REFERENCE INFORMATION ^
 <li><a href=beautifyAxes can be used to globally change the general appearance of axes
  • clearSingleAxis clears an individual axis
  • updatePlotsGeometryType plots the cross-sectional shape as a reference
  • This function is called by: +
  • onContextPlotsPSD checks the label of the distribution axis context menu
  • calculateGeometry calculates the shape dependent geometry parameters
  • changeColorTheme changes the color theme of the calling figure
  • importMOD2MOD imports previously saved NUCLEUSmod data back into the GUI
  • @@ -106,77 +106,79 @@

    SOURCE CODE ^'Tag','MOD'); 0036 gui = getappdata(fig,'gui'); 0037 data = getappdata(fig,'data'); -0038 -0039 % get the results -0040 results = data.results; -0041 -0042 % clear the PSD axes -0043 ax = gui.axes_handles.geo; -0044 clearSingleAxis(ax); -0045 -0046 % check if it is a single pore or a pore size distribution (PSD) -0047 % the radius is plotted in [µm] hence the factor 1e6 -0048 switch data.geometry.ispsd -0049 case 0 -0050 stem(results.GEOM.radius,1,'ko-','LineWidth',2,'Parent',ax); -0051 set(ax,'XScale','log','XLim',data.geometry.range); -0052 set(ax,'YLim',[0 1.1],'YTick',0:0.2:1); -0053 -0054 case 1 -0055 isfreqchecked = get(gui.cm_handles.geo_cm_viewfreq,'Checked'); -0056 switch isfreqchecked -0057 case 'on' -0058 plot(results.psddata.r,results.psddata.psd,'k-','LineWidth',2,'Parent',ax); -0059 xticks = log10(min(results.psddata.r)):1:log10(max(results.psddata.r)); -0060 set(ax,'XScale','log','XLim',[min(results.psddata.r) max(results.psddata.r)],'XTick',10.^xticks); -0061 set(ax,'YLim',[0 max(results.psddata.psd)*1.1]); -0062 set(get(ax,'YLabel'),'String','frequency [-]'); -0063 -0064 case 'off' -0065 plot(results.psddata.r,cumsum(results.psddata.psd),'k-','LineWidth',2,'Parent',ax); -0066 xticks = log10(min(results.psddata.r)):1:log10(max(results.psddata.r)); -0067 set(ax,'XScale','log','XLim',[min(results.psddata.r) max(results.psddata.r)],'XTick',10.^xticks); -0068 set(ax,'YLim',[0 1.1]); -0069 set(get(ax,'YLabel'),'String','cumulative [-]'); -0070 -0071 otherwise -0072 warndlg({'updatePlotsPSD:','Something is utterly wrong.'}); -0073 end -0074 end -0075 -0076 % axis settings -0077 grid(ax,'on'); -0078 set(get(ax,'XLabel'),'String','equiv. pore size [m]'); -0079 -0080 beautifyAxes(gui.figh); -0081 updatePlotsGeometryType(gui.axes_handles.type); -0082 -0083 end +0038 colors = gui.myui.colors; +0039 +0040 % get the results +0041 results = data.results; +0042 +0043 % clear the PSD axes +0044 ax = gui.axes_handles.geo; +0045 clearSingleAxis(ax); +0046 hold(ax,'on') +0047 +0048 % check if it is a single pore or a pore size distribution (PSD) +0049 % the radius is plotted in [µm] hence the factor 1e6 +0050 switch data.geometry.ispsd +0051 case 0 +0052 stem(results.GEOM.radius,1,'o-','Color',colors.axisL,'LineWidth',2,'Parent',ax); +0053 set(ax,'XScale','log','XLim',data.geometry.range); +0054 set(ax,'YLim',[0 1.1],'YTick',0:0.2:1); +0055 +0056 case 1 +0057 isfreqchecked = get(gui.cm_handles.geo_cm_viewfreq,'Checked'); +0058 switch isfreqchecked +0059 case 'on' +0060 plot(results.psddata.r,results.psddata.psd,'-','Color',colors.axisL,'LineWidth',2,'Parent',ax); +0061 xticks = log10(min(results.psddata.r)):1:log10(max(results.psddata.r)); +0062 set(ax,'XScale','log','XLim',[min(results.psddata.r) max(results.psddata.r)],'XTick',10.^xticks); +0063 set(ax,'YLim',[0 max(results.psddata.psd)*1.1],'YTickMode','auto'); +0064 set(get(ax,'YLabel'),'String','frequency [-]'); +0065 +0066 case 'off' +0067 plot(results.psddata.r,cumsum(results.psddata.psd),'-','Color',colors.axisL,'LineWidth',2,'Parent',ax); +0068 xticks = log10(min(results.psddata.r)):1:log10(max(results.psddata.r)); +0069 set(ax,'XScale','log','XLim',[min(results.psddata.r) max(results.psddata.r)],'XTick',10.^xticks); +0070 set(ax,'YLim',[0 1.1],'YTickMode','auto'); +0071 set(get(ax,'YLabel'),'String','cumulative [-]'); +0072 +0073 otherwise +0074 warndlg({'updatePlotsPSD:','Something is utterly wrong.'}); +0075 end +0076 end +0077 +0078 % axis settings +0079 grid(ax,'on'); +0080 set(get(ax,'XLabel'),'String','equiv. pore size [m]'); +0081 +0082 beautifyAxes(gui.figh); +0083 updatePlotsGeometryType(gui.axes_handles.type); 0084 -0085 %------------- END OF CODE -------------- +0085 end 0086 -0087 %% License: -0088 % MIT License -0089 % -0090 % Copyright (c) 2018 Thomas Hiller +0087 %------------- END OF CODE -------------- +0088 +0089 %% License: +0090 % MIT License 0091 % -0092 % Permission is hereby granted, free of charge, to any person obtaining a copy -0093 % of this software and associated documentation files (the "Software"), to deal -0094 % in the Software without restriction, including without limitation the rights -0095 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -0096 % copies of the Software, and to permit persons to whom the Software is -0097 % furnished to do so, subject to the following conditions: -0098 % -0099 % The above copyright notice and this permission notice shall be included in all -0100 % copies or substantial portions of the Software. -0101 % -0102 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -0103 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -0104 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -0105 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -0106 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -0107 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -0108 % SOFTWARE. +0092 % Copyright (c) 2018 Thomas Hiller +0093 % +0094 % Permission is hereby granted, free of charge, to any person obtaining a copy +0095 % of this software and associated documentation files (the "Software"), to deal +0096 % in the Software without restriction, including without limitation the rights +0097 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0098 % copies of the Software, and to permit persons to whom the Software is +0099 % furnished to do so, subject to the following conditions: +0100 % +0101 % The above copyright notice and this permission notice shall be included in all +0102 % copies or substantial portions of the Software. +0103 % +0104 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0105 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0106 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0107 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0108 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0109 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0110 % SOFTWARE.
    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/functions/interface/updatePlotsSignal.html b/doc/nucleus/functions/interface/updatePlotsSignal.html index 0e93048..f242a04 100644 --- a/doc/nucleus/functions/interface/updatePlotsSignal.html +++ b/doc/nucleus/functions/interface/updatePlotsSignal.html @@ -123,348 +123,352 @@

    SOURCE CODE ^clearSingleAxis(ax); 0054 clearSingleAxis(axI); 0055 hold(ax,'on'); -0056 -0057 % data -0058 if isreal(nmrraw.s) -0059 plot(nmrraw.t,real(nmrraw.s),'Color',col.RE,'Parent',ax); -0060 else -0061 plot(nmrraw.t,real(nmrraw.s),'Color',col.RE,'Parent',ax); -0062 plot(nmrraw.t,imag(nmrraw.s),'Color',col.IM,'LineWidth',1,'Parent',axI); -0063 end -0064 -0065 % limits & ticks -0066 loglinx = get(gui.cm_handles.axes_raw_xaxis,'Label'); -0067 switch loglinx -0068 case 'x-axis -> lin' % log axes -0069 ticks = floor(min(log10(nmrraw.t(nmrraw.t>0)))):1:ceil(log10(nmrraw.t(end))); -0070 set(ax,'XScale','log','XLim',[10^(ticks(1)) nmrraw.t(end)],... -0071 'XTick',10.^ticks); -0072 case 'x-axis -> log' % lin axes -0073 set(ax,'XScale','lin','XLim',[nmrproc.echotime nmrraw.t(end)],... -0074 'XTickMode','auto'); -0075 end -0076 logliny = get(gui.cm_handles.axes_raw_yaxis,'Label'); -0077 switch nmrproc.T1T2 -0078 case 'T1' -0079 switch logliny -0080 case 'y-axis -> lin' % log axes -0081 ticks = floor(min(log10(nmrraw.s(nmrraw.s>0))))-1:1:ceil(log10(nmrraw.s(end))); -0082 set(ax,'YScale','log','YLim',[10^(ticks(1)) 10^(ticks(end))],.... -0083 'YTick',10.^ticks); -0084 case 'y-axis -> log' % lin axes -0085 set(ax,'YScale','lin','YLim',[-0.05 max(real(nmrraw.s))*1.05],... -0086 'YTickMode','auto'); -0087 end -0088 case 'T2' -0089 ymin = min([min(real(nmrraw.s)) min(imag(nmrraw.s))]); -0090 ymax = max(real(nmrraw.s)); -0091 if isfield(data.results,'invstd') -0092 ymax = max([ymax max(data.results.invstd.fit_s)]); -0093 end -0094 switch logliny -0095 case 'y-axis -> lin' % log axes -0096 ticks = floor(log10(ymin))-1 :1: ceil(log10(ymax)); -0097 set(ax,'YScale','log','YLim',[10^(ticks(1)) ymax*1.05],... -0098 'YTick',10.^ticks); -0099 case 'y-axis -> log' % lin axes -0100 set(ax,'YScale','lin','YLim',[ymin ymax*1.05],... -0101 'YTickMode','auto'); -0102 end -0103 end -0104 -0105 % labels -0106 if strcmp(data.process.timescale,'s') -0107 set(get(ax,'XLabel'),'String','time [s]'); -0108 else -0109 set(get(ax,'XLabel'),'String','time [ms]'); -0110 end -0111 if strcmp(nmrproc.T1T2,'T2') && ~isreal(nmrraw.s) -0112 set(get(ax,'YLabel'),'String','\Re'); -0113 else -0114 set(get(ax,'YLabel'),'String','amplitude [a.u.]'); -0115 end -0116 -0117 % imag part -0118 if ~isreal(nmrraw.s) -0119 xlims = get(ax,'XLim'); -0120 line(xlims,[0 0],'LineStyle','--','LineWidth',1,'Color','k','Parent',axI); -0121 imag_mean = mean(imag(nmrraw.s)); -0122 imag_std = std(imag(nmrraw.s)); -0123 set(axI,'XTickLabel',''); -0124 switch loglinx -0125 case 'x-axis -> lin' % log axes -0126 set(axI,'XScale','log','XLim',xlims); -0127 case 'x-axis -> log' % lin axes -0128 set(axI,'XScale','lin','XLim',xlims); -0129 end -0130 set(get(axI,'YLabel'),'String','\Im'); -0131 end -0132 -0133 % grid -0134 grid(ax,'on'); -0135 -0136 %% PROC data axis -0137 ax = gui.axes_handles.proc; -0138 axE = gui.axes_handles.err; -0139 clearSingleAxis(ax); -0140 clearSingleAxis(axE); -0141 hold(ax,'on'); -0142 hold(axE,'on'); -0143 -0144 % data -0145 plot(nmrproc.t,nmrproc.s,'o','Color',col.RE,'LineWidth',1,'Parent',ax); -0146 if isfield(data.results,'invstd') -0147 plot(invstd.fit_t,invstd.fit_s,'Color',col.FIT,'LineWidth',2,'Parent',ax); -0148 if nmrproc.noise > 0 -0149 plot(nmrproc.t,invstd.residual./nmrproc.e,'Color',col.IM,... -0150 'LineWidth',1,'Parent',axE); -0151 else -0152 plot(nmrproc.t,invstd.residual,'Color',col.IM,... -0153 'LineWidth',1,'Parent',axE); -0154 end -0155 end -0156 -0157 % limits & ticks -0158 xlimraw = get(gui.axes_handles.raw,'XLim'); -0159 loglinx = get(gui.cm_handles.axes_proc_xaxis,'Label'); -0160 switch loglinx -0161 case 'x-axis -> lin' % log axes -0162 ticks = floor(min(log10(nmrproc.t(nmrproc.t>0)))):1:ceil(log10(nmrproc.t(end))); -0163 set(ax,'XScale','log','XLim',xlimraw,'XTick',10.^ticks); -0164 case 'x-axis -> log' % lin axes -0165 set(ax,'XScale','lin','XLim',xlimraw,'XTickMode','auto'); -0166 end -0167 logliny = get(gui.cm_handles.axes_proc_yaxis,'Label'); -0168 switch nmrproc.T1T2 -0169 case 'T1' -0170 ymin = min(real(nmrproc.s)); -0171 ymax = max(real(nmrproc.s)); -0172 if isfield(data.results,'invstd') -0173 ymin = min([ymin min(invstd.residual)]); -0174 ymax = max([ymax max(data.results.invstd.fit_s)]); -0175 end -0176 if ymin>0 -0177 ymin = ymin*0.8; -0178 else -0179 ymin = ymin*1.2; -0180 end -0181 switch logliny -0182 case 'y-axis -> lin' % log axes -0183 ticks = floor(min(log10(nmrproc.s(nmrproc.s>0))))-1:1:ceil(log10(nmrproc.s(end))); -0184 set(ax,'YScale','log','YLim',[10^(ticks(1)) 10^(ticks(end))],... -0185 'YTick',10.^ticks); -0186 case 'y-axis -> log' % lin axes -0187 set(ax,'YScale','lin','YLim',[ymin ymax*1.05],... -0188 'YTickMode','auto'); -0189 end -0190 case 'T2' -0191 ymin = min([min(real(nmrraw.s)) min(imag(nmrraw.s))]); -0192 ymax = max(real(nmrraw.s)); -0193 if isfield(data.results,'invstd') -0194 ymin = min([ymin min(invstd.residual)]); -0195 ymax = max([ymax max(data.results.invstd.fit_s)]); -0196 end -0197 switch logliny -0198 case 'y-axis -> lin' % log axes -0199 ticks = floor(log10(ymin))-1 :1: ceil(log10(ymax)); -0200 set(ax,'YScale','log','YLim',[10^(ticks(1)) ymax*1.05],... -0201 'YTick',10.^ticks); -0202 case 'y-axis -> log' % lin axes -0203 set(ax,'YScale','lin','YLim',[ymin ymax*1.05],... -0204 'YTickMode','auto'); -0205 end -0206 end -0207 if isfield(data.results,'invstd') -0208 ylims = get(ax,'YLim'); -0209 set(gui.axes_handles.raw,'YLim',ylims); -0210 end -0211 -0212 % labels -0213 if strcmp(data.process.timescale,'s') -0214 set(get(ax,'XLabel'),'String','time [s]'); -0215 else -0216 set(get(ax,'XLabel'),'String','time [ms]'); -0217 end -0218 set(get(ax,'YLabel'),'String','amplitude [a.u.]'); -0219 -0220 % legend -0221 if isfield(data.results,'invstd') -0222 lgdstr = {'signal','fit'}; -0223 switch nmrproc.T1T2 -0224 case 'T1' -0225 legend(ax,lgdstr,'Location','NorthWest',... -0226 'Tag','fitlegend','FontSize',10); -0227 case 'T2' -0228 legend(ax,lgdstr,'Location','NorthEast',... -0229 'Tag','fitlegend','FontSize',10); -0230 end -0231 end -0232 -0233 % grid -0234 grid(ax,'on'); +0056 hold(axI,'on'); +0057 +0058 % data +0059 if isreal(nmrraw.s) +0060 plot(nmrraw.t,real(nmrraw.s),'Color',col.RE,'Parent',ax); +0061 else +0062 plot(nmrraw.t,real(nmrraw.s),'Color',col.RE,'Parent',ax); +0063 plot(nmrraw.t,imag(nmrraw.s),'Color',col.IM,'LineWidth',1,'Parent',axI); +0064 end +0065 +0066 % limits & ticks +0067 loglinx = get(gui.cm_handles.axes_raw_xaxis,'Label'); +0068 switch loglinx +0069 case 'x-axis -> lin' % log axes +0070 ticks = floor(min(log10(nmrraw.t(nmrraw.t>0)))):1:ceil(log10(nmrraw.t(end))); +0071 set(ax,'XScale','log','XLim',[10^(ticks(1)) nmrraw.t(end)],... +0072 'XTick',10.^ticks); +0073 case 'x-axis -> log' % lin axes +0074 set(ax,'XScale','lin','XLim',[nmrproc.echotime nmrraw.t(end)],... +0075 'XTickMode','auto'); +0076 end +0077 logliny = get(gui.cm_handles.axes_raw_yaxis,'Label'); +0078 switch nmrproc.T1T2 +0079 case 'T1' +0080 switch logliny +0081 case 'y-axis -> lin' % log axes +0082 ticks = floor(min(log10(nmrraw.s(nmrraw.s>0))))-1:1:ceil(log10(nmrraw.s(end))); +0083 set(ax,'YScale','log','YLim',[10^(ticks(1)) 10^(ticks(end))],.... +0084 'YTick',10.^ticks); +0085 case 'y-axis -> log' % lin axes +0086 set(ax,'YScale','lin','YLim',[-0.05 max(real(nmrraw.s))*1.05],... +0087 'YTickMode','auto'); +0088 end +0089 case 'T2' +0090 ymin = min([min(real(nmrraw.s)) min(imag(nmrraw.s))]); +0091 ymax = max(real(nmrraw.s)); +0092 if isfield(data.results,'invstd') +0093 ymax = max([ymax max(data.results.invstd.fit_s)]); +0094 end +0095 switch logliny +0096 case 'y-axis -> lin' % log axes +0097 ticks = floor(log10(ymin))-1 :1: ceil(log10(ymax)); +0098 set(ax,'YScale','log','YLim',[10^(ticks(1)) ymax*1.05],... +0099 'YTick',10.^ticks); +0100 case 'y-axis -> log' % lin axes +0101 set(ax,'YScale','lin','YLim',[ymin ymax*1.05],... +0102 'YTickMode','auto'); +0103 end +0104 end +0105 +0106 % labels +0107 if strcmp(data.process.timescale,'s') +0108 set(get(ax,'XLabel'),'String','time [s]'); +0109 else +0110 set(get(ax,'XLabel'),'String','time [ms]'); +0111 end +0112 if strcmp(nmrproc.T1T2,'T2') && ~isreal(nmrraw.s) +0113 set(get(ax,'YLabel'),'String','\Reeal'); +0114 else +0115 set(get(ax,'YLabel'),'String','amplitude [a.u.]'); +0116 end +0117 +0118 % imag part +0119 if ~isreal(nmrraw.s) +0120 xlims = get(ax,'XLim'); +0121 line(xlims,[0 0],'LineStyle','--','LineWidth',1,'Color','k','Parent',axI); +0122 imag_mean = mean(imag(nmrraw.s)); +0123 imag_std = std(imag(nmrraw.s)); +0124 yticks = linspace(min(imag(nmrraw.s)),max(imag(nmrraw.s)),3); +0125 set(axI,'XTickLabel','','YTick',yticks,'YTickLabelMode','auto'); +0126 switch loglinx +0127 case 'x-axis -> lin' % log axes +0128 set(axI,'XScale','log','XLim',xlims); +0129 case 'x-axis -> log' % lin axes +0130 set(axI,'XScale','lin','XLim',xlims); +0131 end +0132 set(get(axI,'YLabel'),'String','\Immag'); +0133 end +0134 +0135 % grid +0136 grid(ax,'on'); +0137 +0138 %% PROC data axis +0139 ax = gui.axes_handles.proc; +0140 axE = gui.axes_handles.err; +0141 clearSingleAxis(ax); +0142 clearSingleAxis(axE); +0143 hold(ax,'on'); +0144 hold(axE,'on'); +0145 +0146 % data +0147 plot(nmrproc.t,nmrproc.s,'o','Color',col.RE,'LineWidth',1,'Parent',ax); +0148 if isfield(data.results,'invstd') +0149 plot(invstd.fit_t,invstd.fit_s,'Color',col.FIT,'LineWidth',2,'Parent',ax); +0150 if nmrproc.noise > 0 +0151 plot(nmrproc.t,invstd.residual./nmrproc.e,'Color',col.IM,... +0152 'LineWidth',1,'Parent',axE); +0153 else +0154 plot(nmrproc.t,invstd.residual,'Color',col.IM,... +0155 'LineWidth',1,'Parent',axE); +0156 end +0157 end +0158 +0159 % limits & ticks +0160 xlimraw = get(gui.axes_handles.raw,'XLim'); +0161 loglinx = get(gui.cm_handles.axes_proc_xaxis,'Label'); +0162 switch loglinx +0163 case 'x-axis -> lin' % log axes +0164 ticks = floor(min(log10(nmrproc.t(nmrproc.t>0)))):1:ceil(log10(nmrproc.t(end))); +0165 set(ax,'XScale','log','XLim',xlimraw,'XTick',10.^ticks); +0166 case 'x-axis -> log' % lin axes +0167 set(ax,'XScale','lin','XLim',xlimraw,'XTickMode','auto'); +0168 end +0169 logliny = get(gui.cm_handles.axes_proc_yaxis,'Label'); +0170 switch nmrproc.T1T2 +0171 case 'T1' +0172 ymin = min(real(nmrproc.s)); +0173 ymax = max(real(nmrproc.s)); +0174 if isfield(data.results,'invstd') +0175 ymin = min([ymin min(invstd.residual)]); +0176 ymax = max([ymax max(data.results.invstd.fit_s)]); +0177 end +0178 if ymin>0 +0179 ymin = ymin*0.8; +0180 else +0181 ymin = ymin*1.2; +0182 end +0183 switch logliny +0184 case 'y-axis -> lin' % log axes +0185 ticks = floor(min(log10(nmrproc.s(nmrproc.s>0))))-1:1:ceil(log10(nmrproc.s(end))); +0186 set(ax,'YScale','log','YLim',[10^(ticks(1)) 10^(ticks(end))],... +0187 'YTick',10.^ticks); +0188 case 'y-axis -> log' % lin axes +0189 set(ax,'YScale','lin','YLim',[ymin ymax*1.05],... +0190 'YTickMode','auto'); +0191 end +0192 case 'T2' +0193 ymin = min([min(real(nmrraw.s)) min(imag(nmrraw.s))]); +0194 ymax = max(real(nmrraw.s)); +0195 if isfield(data.results,'invstd') +0196 ymin = min([ymin min(invstd.residual)]); +0197 ymax = max([ymax max(data.results.invstd.fit_s)]); +0198 end +0199 switch logliny +0200 case 'y-axis -> lin' % log axes +0201 ticks = floor(log10(ymin))-1 :1: ceil(log10(ymax)); +0202 set(ax,'YScale','log','YLim',[10^(ticks(1)) ymax*1.05],... +0203 'YTick',10.^ticks); +0204 case 'y-axis -> log' % lin axes +0205 set(ax,'YScale','lin','YLim',[ymin ymax*1.05],... +0206 'YTickMode','auto'); +0207 end +0208 end +0209 if isfield(data.results,'invstd') +0210 ylims = get(ax,'YLim'); +0211 set(gui.axes_handles.raw,'YLim',ylims); +0212 end +0213 +0214 % labels +0215 if strcmp(data.process.timescale,'s') +0216 set(get(ax,'XLabel'),'String','time [s]'); +0217 else +0218 set(get(ax,'XLabel'),'String','time [ms]'); +0219 end +0220 set(get(ax,'YLabel'),'String','amplitude [a.u.]'); +0221 +0222 % legend +0223 if isfield(data.results,'invstd') +0224 lgdstr = {'signal','fit'}; +0225 switch nmrproc.T1T2 +0226 case 'T1' +0227 lgh = legend(ax,lgdstr,'Location','NorthWest',... +0228 'Tag','fitlegend','FontSize',10); +0229 case 'T2' +0230 lgh = legend(ax,lgdstr,'Location','NorthEast',... +0231 'Tag','fitlegend','FontSize',10); +0232 end +0233 set(lgh,'TextColor',gui.myui.colors.panelFG); +0234 end 0235 -0236 %% residual plot -0237 if isfield(data.results,'invstd') -0238 xlims = get(ax,'XLim'); -0239 line(xlims,[0 0],'LineStyle','--','LineWidth',1,'Color','k','Parent',axE); -0240 if nmrproc.noise > 0 -0241 err_mean = mean(invstd.residual./nmrproc.e); -0242 err_std = std(invstd.residual./nmrproc.e); -0243 line(xlims,[err_mean-err_std err_mean-err_std],... -0244 'LineStyle','--','LineWidth',1,'Color','r','Parent',axE); -0245 line(xlims,[err_mean+err_std err_mean+err_std],... -0246 'LineStyle','--','LineWidth',1,'Color','r','Parent',axE); -0247 line(xlims,[-1 -1],'LineStyle','-.','LineWidth',1,... -0248 'Color','k','Parent',axE); -0249 line(xlims,[1 1],'LineStyle','-.','LineWidth',1,... -0250 'Color','k','Parent',axE); -0251 set(axE,'XTickLabel',''); -0252 set(axE,'YLim',[-2 2]); -0253 set(axE,'YTick',[-1 0 1],'YTickLabelMode','auto'); -0254 set(get(axE,'YLabel'),'String',{'noise';'weighted';'residuals'},... -0255 'FontWeight','normal'); -0256 else -0257 err_mean = mean(invstd.residual); -0258 err_std = std(invstd.residual); -0259 line(xlims,[err_mean-1*err_std err_mean-1*err_std],... -0260 'LineStyle','-.','LineWidth',1,'Color','k','Parent',axE); -0261 line(xlims,[err_mean+1*err_std err_mean+1*err_std],... -0262 'LineStyle','-.','LineWidth',1,'Color','k','Parent',axE); -0263 set(axE,'XTickLabel',''); -0264 set(axE,'YLim',[err_mean-3*err_std err_mean+3*err_std]); -0265 set(axE,'YTick',[err_mean-3*err_std 0 err_mean+3*err_std],... -0266 'YTickLabelMode','auto') -0267 set(get(axE,'YLabel'),'String','residuals',... -0268 'FontWeight','normal'); -0269 end -0270 -0271 switch loglinx -0272 case 'x-axis -> lin' % log axes -0273 set(axE,'XScale','log','XLim',xlims); -0274 case 'x-axis -> log' % lin axes -0275 set(axE,'XScale','lin','XLim',xlims); -0276 end -0277 end -0278 % finalize -0279 beautifyAxes(fig); -0280 end -0281 -0282 %% if joint inversion is activated all NMR signals are plotted into the -0283 % "ALL (joint)" panel - this is just a rough overview if no joint inversion -0284 % result is yet availabe -0285 if isjoint && ~isfield(data.results,'invjoint') && ... -0286 ~strcmp(data.invstd.regtype,'lcurve') && ... -0287 ~strcmp(data.invstd.regtype,'iterchi2') -0288 -0289 ax = gui.axes_handles.all; -0290 clearSingleAxis(ax); -0291 -0292 INVdata = getappdata(fig,'INVdata'); -0293 -0294 nINV = size(INVdata,1); -0295 E0 = zeros(nINV,1); -0296 c = 0; -0297 invlevels = 0; -0298 for i = 1:nINV -0299 if isstruct(INVdata{i}) -0300 c = c + 1; -0301 invlevels(c) = i; %#ok<AGROW> -0302 E0(i,1) = sum(INVdata{i}.results.invstd.E0); -0303 end -0304 end -0305 -0306 % the pressure / saturation data -0307 table = data.pressure.table; -0308 -0309 if size(table,1) == 1 & invlevels ~= 0 %#ok<AND2> -0310 % apparently no CPS data was loaded but joint inversion is -0311 % activated ... so just plot the data -0312 if invlevels == 0 -0313 levels = []; -0314 else -0315 levels = invlevels; -0316 S = E0(invlevels)./max(E0(invlevels)); -0317 end -0318 else -0319 uselevel = cell2mat(table(:,1)); -0320 tablelevels = 1:size(table,1); -0321 tablelevels = tablelevels(uselevel); -0322 S = cell2mat(table(:,3)); -0323 % if numel(S)~=nINV -0324 % % S() -0325 % end -0326 [isin,levels] = ismember(invlevels,tablelevels); -0327 levels = tablelevels(levels(isin)); -0328 end -0329 -0330 if ~isempty(levels) && levels(1) > 0 && c > 0 -0331 hold(ax,'on'); -0332 -0333 mycol = flipud(parula(128)); -0334 for i = 1:numel(levels) -0335 t = INVdata{levels(i)}.results.invstd.fit_t; -0336 s = INVdata{levels(i)}.results.invstd.fit_s; -0337 s = S(levels(i)).*(s./sum(INVdata{levels(i)}.results.invstd.E0)); -0338 if i == 1 -0339 xlims = [min(t) max(t)]; -0340 ylims = [min(s) max(s)]; -0341 else -0342 xlims = [min([xlims(1) min(t)]) max([xlims(2) max(t)])]; -0343 ylims = [min([ylims(1) min(s)]) max([ylims(2) max(s)])]; -0344 end -0345 colind = getColorIndex(S(levels(i)),128); -0346 plot(t,s,'LineStyle','-','Color',mycol(colind,:),'Parent',ax); -0347 end -0348 set(ax,'YLim',ylims); -0349 -0350 loglinx = get(gui.cm_handles.axes_all_xaxis,'Label'); -0351 switch loglinx -0352 case 'x-axis -> lin' % log axes -0353 ticks = floor(min(log10(nmrproc.t(nmrproc.t>0)))):1:ceil(log10(nmrproc.t(end))); -0354 set(ax,'XScale','log','XLim',xlims,'XTick',10.^ticks); -0355 case 'x-axis -> log' % lin axes -0356 set(ax,'XScale','lin','XLim',xlims,'XTickMode','auto'); -0357 end -0358 logliny = get(gui.cm_handles.axes_all_yaxis,'Label'); -0359 switch logliny -0360 case 'y-axis -> lin' % log axes -0361 set(ax,'YScale','log'); -0362 case 'y-axis -> log' % lin axes -0363 set(ax,'YScale','lin'); -0364 end -0365 end -0366 end -0367 -0368 % update GUI data -0369 setappdata(fig,'data',data); -0370 setappdata(fig,'gui',gui); +0236 % grid +0237 grid(ax,'on'); +0238 +0239 %% residual plot +0240 if isfield(data.results,'invstd') +0241 col = gui.myui.colors.axisL; +0242 xlims = get(ax,'XLim'); +0243 line(xlims,[0 0],'LineStyle','--','LineWidth',1,'Color',col,'Parent',axE); +0244 if nmrproc.noise > 0 +0245 err_mean = mean(invstd.residual./nmrproc.e); +0246 err_std = std(invstd.residual./nmrproc.e); +0247 line(xlims,[err_mean-err_std err_mean-err_std],... +0248 'LineStyle','--','LineWidth',1,'Color','r','Parent',axE); +0249 line(xlims,[err_mean+err_std err_mean+err_std],... +0250 'LineStyle','--','LineWidth',1,'Color','r','Parent',axE); +0251 line(xlims,[-1 -1],'LineStyle','-.','LineWidth',1,... +0252 'Color',col,'Parent',axE); +0253 line(xlims,[1 1],'LineStyle','-.','LineWidth',1,... +0254 'Color',col,'Parent',axE); +0255 set(axE,'XTickLabel',''); +0256 set(axE,'YLim',[-2 2]); +0257 set(axE,'YTick',[-1 0 1],'YTickLabelMode','auto'); +0258 set(get(axE,'YLabel'),'String',{'noise';'weighted';'residuals'},... +0259 'FontWeight','normal'); +0260 else +0261 err_mean = mean(invstd.residual); +0262 err_std = std(invstd.residual); +0263 line(xlims,[err_mean-1*err_std err_mean-1*err_std],... +0264 'LineStyle','-.','LineWidth',1,'Color',col,'Parent',axE); +0265 line(xlims,[err_mean+1*err_std err_mean+1*err_std],... +0266 'LineStyle','-.','LineWidth',1,'Color',col,'Parent',axE); +0267 set(axE,'XTickLabel',''); +0268 set(axE,'YLim',[err_mean-3*err_std err_mean+3*err_std]); +0269 set(axE,'YTick',[err_mean-3*err_std 0 err_mean+3*err_std],... +0270 'YTickLabelMode','auto') +0271 set(get(axE,'YLabel'),'String','residuals',... +0272 'FontWeight','normal'); +0273 end +0274 +0275 switch loglinx +0276 case 'x-axis -> lin' % log axes +0277 set(axE,'XScale','log','XLim',xlims); +0278 case 'x-axis -> log' % lin axes +0279 set(axE,'XScale','lin','XLim',xlims); +0280 end +0281 end +0282 % finalize +0283 beautifyAxes(fig); +0284 end +0285 +0286 %% if joint inversion is activated all NMR signals are plotted into the +0287 % "ALL (joint)" panel - this is just a rough overview if no joint inversion +0288 % result is yet availabe +0289 if isjoint && ~isfield(data.results,'invjoint') && ... +0290 ~strcmp(data.invstd.regtype,'lcurve') && ... +0291 ~strcmp(data.invstd.regtype,'iterchi2') +0292 +0293 ax = gui.axes_handles.all; +0294 clearSingleAxis(ax); +0295 +0296 INVdata = getappdata(fig,'INVdata'); +0297 +0298 nINV = size(INVdata,1); +0299 E0 = zeros(nINV,1); +0300 c = 0; +0301 invlevels = 0; +0302 for i = 1:nINV +0303 if isstruct(INVdata{i}) +0304 c = c + 1; +0305 invlevels(c) = i; %#ok<AGROW> +0306 E0(i,1) = sum(INVdata{i}.results.invstd.E0); +0307 end +0308 end +0309 +0310 % the pressure / saturation data +0311 table = data.pressure.table; +0312 +0313 if size(table,1) == 1 & invlevels ~= 0 %#ok<AND2> +0314 % apparently no CPS data was loaded but joint inversion is +0315 % activated ... so just plot the data +0316 if invlevels == 0 +0317 levels = []; +0318 else +0319 levels = invlevels; +0320 S = E0(invlevels)./max(E0(invlevels)); +0321 end +0322 else +0323 uselevel = cell2mat(table(:,1)); +0324 tablelevels = 1:size(table,1); +0325 tablelevels = tablelevels(uselevel); +0326 S = cell2mat(table(:,3)); +0327 % if numel(S)~=nINV +0328 % % S() +0329 % end +0330 [isin,levels] = ismember(invlevels,tablelevels); +0331 levels = tablelevels(levels(isin)); +0332 end +0333 +0334 if ~isempty(levels) && levels(1) > 0 && c > 0 +0335 hold(ax,'on'); +0336 +0337 mycol = flipud(parula(128)); +0338 for i = 1:numel(levels) +0339 t = INVdata{levels(i)}.results.invstd.fit_t; +0340 s = INVdata{levels(i)}.results.invstd.fit_s; +0341 s = S(levels(i)).*(s./sum(INVdata{levels(i)}.results.invstd.E0)); +0342 if i == 1 +0343 xlims = [min(t) max(t)]; +0344 ylims = [min(s) max(s)]; +0345 else +0346 xlims = [min([xlims(1) min(t)]) max([xlims(2) max(t)])]; +0347 ylims = [min([ylims(1) min(s)]) max([ylims(2) max(s)])]; +0348 end +0349 colind = getColorIndex(S(levels(i)),128); +0350 plot(t,s,'LineStyle','-','Color',mycol(colind,:),'Parent',ax); +0351 end +0352 set(ax,'YLim',ylims); +0353 +0354 loglinx = get(gui.cm_handles.axes_all_xaxis,'Label'); +0355 switch loglinx +0356 case 'x-axis -> lin' % log axes +0357 ticks = floor(min(log10(nmrproc.t(nmrproc.t>0)))):1:ceil(log10(nmrproc.t(end))); +0358 set(ax,'XScale','log','XLim',xlims,'XTick',10.^ticks); +0359 case 'x-axis -> log' % lin axes +0360 set(ax,'XScale','lin','XLim',xlims,'XTickMode','auto'); +0361 end +0362 logliny = get(gui.cm_handles.axes_all_yaxis,'Label'); +0363 switch logliny +0364 case 'y-axis -> lin' % log axes +0365 set(ax,'YScale','log'); +0366 case 'y-axis -> log' % lin axes +0367 set(ax,'YScale','lin'); +0368 end +0369 end +0370 end 0371 -0372 end -0373 -0374 %------------- END OF CODE -------------- +0372 % update GUI data +0373 setappdata(fig,'data',data); +0374 setappdata(fig,'gui',gui); 0375 -0376 %% License: -0377 % MIT License -0378 % -0379 % Copyright (c) 2018 Thomas Hiller -0380 % -0381 % Permission is hereby granted, free of charge, to any person obtaining a copy -0382 % of this software and associated documentation files (the "Software"), to deal -0383 % in the Software without restriction, including without limitation the rights -0384 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -0385 % copies of the Software, and to permit persons to whom the Software is -0386 % furnished to do so, subject to the following conditions: -0387 % -0388 % The above copyright notice and this permission notice shall be included in all -0389 % copies or substantial portions of the Software. -0390 % -0391 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -0392 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -0393 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -0394 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -0395 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -0396 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -0397 % SOFTWARE. +0376 end +0377 +0378 %------------- END OF CODE -------------- +0379 +0380 %% License: +0381 % MIT License +0382 % +0383 % Copyright (c) 2018 Thomas Hiller +0384 % +0385 % Permission is hereby granted, free of charge, to any person obtaining a copy +0386 % of this software and associated documentation files (the "Software"), to deal +0387 % in the Software without restriction, including without limitation the rights +0388 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0389 % copies of the Software, and to permit persons to whom the Software is +0390 % furnished to do so, subject to the following conditions: +0391 % +0392 % The above copyright notice and this permission notice shall be included in all +0393 % copies or substantial portions of the Software. +0394 % +0395 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0396 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0397 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0398 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0399 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0400 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0401 % SOFTWARE.
    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/functions/interface/updateStatusInformation.html b/doc/nucleus/functions/interface/updateStatusInformation.html index 05d139c..b225554 100644 --- a/doc/nucleus/functions/interface/updateStatusInformation.html +++ b/doc/nucleus/functions/interface/updateStatusInformation.html @@ -61,7 +61,7 @@

    CROSS-REFERENCE INFORMATION ^
 </ul>
 This function is called by:
 <ul style= -
  • NUCLEUSinv_createGUI controls the creation of all GUI elements
  • onMenuExpert handles the call from the menu that activates / deactivates
  • onMenuExtraShow handles the extra menu entries to show additional
  • onMenuJointInversion handles the call from the menu that activates / deactivates
  • +
  • NUCLEUSinv_createGUI controls the creation of all GUI elements
  • onMenuExpert handles the call from the menu that activates / deactivates
  • onMenuExtraShow handles the extra menu entries to show additional
  • onMenuJointInversion handles the call from the menu that activates / deactivates
  • onMenuSolver handles the call from the menu that allows to choose the LSQ
  • @@ -110,70 +110,77 @@

    SOURCE CODE ^'String','Expert Mode: OFF'); 0042 end 0043 -0044 switch data.info.optim +0044 switch data.info.has_optim 0045 case 'on' 0046 set(gui.textOptim,'String','Optim. Toolbox: ON'); 0047 case 'off' 0048 set(gui.textOptim,'String','Optim. Toolbox: OFF'); 0049 end 0050 -0051 switch data.info.stat -0052 case 'on' -0053 set(gui.textStats,'String','Stat. Toolbox: ON'); -0054 case 'off' -0055 set(gui.textStats,'String','Stat. Toolbox: OFF'); +0051 switch data.info.solver +0052 case 'lsqnonneg' +0053 set(gui.textSolver,'String','LSQNONNEG'); +0054 case 'lsqlin' +0055 set(gui.textSolver,'String','LSQLIN'); 0056 end 0057 -0058 switch data.info.JointInv +0058 switch data.info.stat 0059 case 'on' -0060 set(gui.textJoint,'String','Inv. Type: JOINT'); +0060 set(gui.textStats,'String','Stat. Toolbox: ON'); 0061 case 'off' -0062 set(gui.textJoint,'String','Inv. Type: STD'); +0062 set(gui.textStats,'String','Stat. Toolbox: OFF'); 0063 end 0064 -0065 switch data.info.InvInfo +0065 switch data.info.JointInv 0066 case 'on' -0067 set(gui.textInvinfo,'String','Inv. Info: ON'); +0067 set(gui.textJoint,'String','Inv. Type: JOINT'); 0068 case 'off' -0069 set(gui.textInvinfo,'String','Inv. Info: OFF'); +0069 set(gui.textJoint,'String','Inv. Type: STD'); 0070 end 0071 -0072 switch data.info.ToolTips +0072 switch data.info.InvInfo 0073 case 'on' -0074 set(gui.textTooltips,'String','Tooltips: ON'); +0074 set(gui.textInvinfo,'String','Inv. Info: ON'); 0075 case 'off' -0076 set(gui.textTooltips,'String','Tooltips: OFF'); +0076 set(gui.textInvinfo,'String','Inv. Info: OFF'); 0077 end 0078 -0079 % Matlab takes some time -0080 pause(0.001); -0081 -0082 end -0083 -0084 %------------- END OF CODE -------------- +0079 switch data.info.ToolTips +0080 case 'on' +0081 set(gui.textTooltips,'String','Tooltips: ON'); +0082 case 'off' +0083 set(gui.textTooltips,'String','Tooltips: OFF'); +0084 end 0085 -0086 %% License: -0087 % MIT License -0088 % -0089 % Copyright (c) 2018 Thomas Hiller -0090 % -0091 % Permission is hereby granted, free of charge, to any person obtaining a copy -0092 % of this software and associated documentation files (the "Software"), to deal -0093 % in the Software without restriction, including without limitation the rights -0094 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -0095 % copies of the Software, and to permit persons to whom the Software is -0096 % furnished to do so, subject to the following conditions: +0086 % Matlab takes some time +0087 pause(0.001); +0088 +0089 end +0090 +0091 %------------- END OF CODE -------------- +0092 +0093 %% License: +0094 % MIT License +0095 % +0096 % Copyright (c) 2018 Thomas Hiller 0097 % -0098 % The above copyright notice and this permission notice shall be included in all -0099 % copies or substantial portions of the Software. -0100 % -0101 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -0102 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -0103 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -0104 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -0105 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -0106 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -0107 % SOFTWARE. +0098 % Permission is hereby granted, free of charge, to any person obtaining a copy +0099 % of this software and associated documentation files (the "Software"), to deal +0100 % in the Software without restriction, including without limitation the rights +0101 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0102 % copies of the Software, and to permit persons to whom the Software is +0103 % furnished to do so, subject to the following conditions: +0104 % +0105 % The above copyright notice and this permission notice shall be included in all +0106 % copies or substantial portions of the Software. +0107 % +0108 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0109 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0110 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0111 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0112 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0113 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0114 % SOFTWARE.
    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/functions/interface/updateToolTips.html b/doc/nucleus/functions/interface/updateToolTips.html new file mode 100644 index 0000000..78e88eb --- /dev/null +++ b/doc/nucleus/functions/interface/updateToolTips.html @@ -0,0 +1,236 @@ + + + + Description of updateToolTips + + + + + + + + + + + +

    updateToolTips +

    + +

    PURPOSE ^

    +
    updates tool tip entries dependent on the chosen settings
    + +

    SYNOPSIS ^

    +
    function updateToolTips
    + +

    DESCRIPTION ^

    +
    updateToolTips updates tool tip entries dependent on the chosen settings
    +(ExpertMode, LSQ-solver, ...)
    +
    + Syntax:
    +       updateToolTips
    +
    + Inputs:
    +       none
    +
    + Outputs:
    +       none
    +
    + Example:
    +       updateToolTips
    +
    + Other m-files required:
    +       none
    +
    + Subfunctions:
    +       none
    +
    + MAT-files required:
    +       none
    +
    + See also: NUCLEUSinv
    + Author: Thomas Hiller
    + email: thomas.hiller[at]leibniz-liag.de
    + License: MIT License (at end)
    + + +

    CROSS-REFERENCE INFORMATION ^

    +This function calls: + +This function is called by: + + + + + +

    SOURCE CODE ^

    +
    0001 function updateToolTips
    +0002 %updateToolTips updates tool tip entries dependent on the chosen settings
    +0003 %(ExpertMode, LSQ-solver, ...)
    +0004 %
    +0005 % Syntax:
    +0006 %       updateToolTips
    +0007 %
    +0008 % Inputs:
    +0009 %       none
    +0010 %
    +0011 % Outputs:
    +0012 %       none
    +0013 %
    +0014 % Example:
    +0015 %       updateToolTips
    +0016 %
    +0017 % Other m-files required:
    +0018 %       none
    +0019 %
    +0020 % Subfunctions:
    +0021 %       none
    +0022 %
    +0023 % MAT-files required:
    +0024 %       none
    +0025 %
    +0026 % See also: NUCLEUSinv
    +0027 % Author: Thomas Hiller
    +0028 % email: thomas.hiller[at]leibniz-liag.de
    +0029 % License: MIT License (at end)
    +0030 
    +0031 %------------- BEGIN CODE --------------
    +0032 
    +0033 %% get GUI handle and data
    +0034 fig = findobj('Tag','INV');
    +0035 gui = getappdata(fig,'gui');
    +0036 data = getappdata(fig,'data');
    +0037 
    +0038 %% process tool tips
    +0039 switch data.info.ExpertMode
    +0040     case 'on'
    +0041         switch data.info.solver
    +0042             case 'lsqlin'
    +0043                 inv_tstr = ['<HTML>Choose between different inversion (fitting) methods.<br><br>',...
    +0044                     '<u>Available options:</u><br>',...
    +0045                     '<b>Mono exp.</b> Mono-exponential fitting.<br>',...
    +0046                     '<b>Several free exp. (2-5)</b> Multi-exponential fitting with up to 5 free relaxation times.<br>',...
    +0047                     '<b>Multi exp. (LSQ)</b> Multi-exponential fitting with Optimization Toolbox.<br>',...
    +0048                     '<b>Multi exp. (ILA)</b> Multi-exponential fitting using an Inverse Laplace transform.<br><br>',...
    +0049                     'Depending on the chosen method there are additional options available.<br><br>',...
    +0050                     '<u>Default value:</u><br>',...
    +0051                     '<b>Multi exp. (LSQ)</b><br>'];
    +0052                 reg_tstr = ['<HTML>Choose additional options depending on the chosen inversion (fitting) method.<br><br>',...
    +0053                     '<u>Available options:</u><br>',...
    +0054                     '<font color="red">Mono exp.:<br>',...
    +0055                     '<font color="black"><b>none</b><br>',...
    +0056                     '<font color="red">Several free exp. (2-5):<br>',...
    +0057                     '<font color="black"><b>1-5</b> choose how many free relaxation times to use.<br>',...
    +0058                     '<font color="red">Multi exp. (LSQ):<br>',...
    +0059                     '<font color="black"><b>Manual</b> Manual regularization.<br>',...
    +0060                     '<font color="black"><b>IterChi2</b> Find Chi2=1 iteratively.<br>',...
    +0061                     '<font color="black"><b>Tikhonov (GCV)</b> Tikhonov regularization (SVD-Toolbox).<br>',...
    +0062                     '<font color="black"><b>TSVD (GCV)</b> Regularization via Truncated SVD (SVD-Toolbox).<br>',...
    +0063                     '<font color="black"><b>DSVD (GCV)</b> Regularization via Damped SVD (SVD-Toolbox).<br>',...
    +0064                     '<font color="black"><b>Discrep.</b> Regularization according to discrepancy principle (SVD-Toolbox).<br>',...
    +0065                     '<font color="black"><b>L-curve</b> Perform the L-curve test to find optimal regularization parameter lambda.<br>',...
    +0066                     '<font color="red">Multi exp. (ILA):<br>',...
    +0067                     '<font color="black"><b>Manual</b> Manual regularization.<br>',...
    +0068                     '<font color="black"><b>Automatic</b> Automatic regularization.<br><br>',...
    +0069                     '<u>Default value:</u><br>',...
    +0070                     '<b>Manual</b><br>'];
    +0071             case 'lsqnonneg'
    +0072                 inv_tstr = ['<HTML>Choose between different inversion (fitting) methods.<br><br>',...
    +0073                     '<u>Available options:</u><br>',...
    +0074                     '<b>Mono exp.</b> Mono-exponential fitting.<br>',...
    +0075                     '<b>Several free exp. (2-5)</b> Multi-exponential fitting with up to 5 free relaxation times.<br>',...
    +0076                     '<b>Multi exp. (LSQ)</b> Multi-exponential fitting with Non Negative Least Squares (LSQNONNEG).<br>',...
    +0077                     '<b>Multi exp. (ILA)</b> Multi-exponential fitting using an Inverse Laplace transform.<br><br>',...
    +0078                     'Depending on the chosen method there are additional options available.<br><br>',...
    +0079                     '<u>Default value:</u><br>',...
    +0080                     '<b>Multi exp. (LSQ)</b><br>'];
    +0081                 reg_tstr = ['<HTML>Choose additional options depending on the chosen inversion (fitting) method.<br><br>',...
    +0082                     '<u>Available options:</u><br>',...
    +0083                     '<font color="red">Mono exp.:<br>',...
    +0084                     '<font color="black"><b>none</b><br>',...
    +0085                     '<font color="red">Several free exp. (2-5):<br>',...
    +0086                     '<font color="black"><b>1-5</b> choose how many free relaxation times to use.<br>',...
    +0087                     '<font color="red">Multi exp. (LSQ):<br>',...
    +0088                     '<font color="black"><b>Manual</b> Manual regularization.<br>',...
    +0089                     '<font color="black"><b>IterChi2</b> Find Chi2=1 iteratively.<br>',...
    +0090                     '<font color="black"><b>Tikhonov (GCV)</b> Tikhonov regularization (SVD-Toolbox).<br>',...
    +0091                     '<font color="black"><b>TSVD (GCV)</b> Regularization via Truncated SVD (SVD-Toolbox).<br>',...
    +0092                     '<font color="black"><b>DSVD (GCV)</b> Regularization via Damped SVD (SVD-Toolbox).<br>',...
    +0093                     '<font color="black"><b>Discrep.</b> Regularization according to discrepancy principle (SVD-Toolbox).<br>',...
    +0094                     '<font color="black"><b>L-curve</b> Perform the L-curve test to find optimal regularization parameter lambda.<br>',...
    +0095                     '<font color="red">Multi exp. (ILA):<br>',...
    +0096                     '<font color="black"><b>Manual</b> Manual regularization.<br>',...
    +0097                     '<font color="black"><b>Automatic</b> Automatic regularization.<br><br>',...
    +0098                     '<u>Default value:</u><br>',...
    +0099                     '<b>Manual</b><br>'];
    +0100         end        
    +0101     case 'off'
    +0102         inv_tstr = ['<HTML>Choose between different inversion (fitting) methods.<br><br>',...
    +0103             '<u>Available options:</u><br>',...
    +0104             '<b>Mono exp.</b> Mono-exponential fitting.<br>',...
    +0105             '<b>Several free exp. (2-5).</b> Multi-exponential fitting with up to 5 free relaxation times.<br>',...
    +0106             '<b>Multi exp. (LSQ)</b> Multi-exponential fitting with Non Negative Least Squares (LSQNONNEG).<br><br>',...
    +0107             'Depending on the chosen method there are additional options available.<br><br>',...
    +0108             '<u>Default value:</u><br>',...
    +0109             '<b>Multi exp. (LSQ)</b><br>'];
    +0110         reg_tstr = ['<HTML>Choose additional options depending on the chosen inversion (fitting) method.<br><br>',...
    +0111             '<u>Available options:</u><br>',...
    +0112             '<font color="red">Mono exp.:<br>',...
    +0113             '<font color="black"><b>none</b><br>',...
    +0114             '<font color="red">Several free exp. (2-5):<br>',...
    +0115             '<font color="black"><b>1-5</b> choose how many free relaxation times to use.<br>',...
    +0116             '<font color="red">Multi exp. (LSQ):<br>',...
    +0117             '<font color="black"><b>Manual</b> Manual regularization.<br>',...
    +0118             '<font color="black"><b>IterChi2</b> Find Chi2=1 iteratively.<br>',...
    +0119             '<font color="black"><b>L-curve</b> Perform the L-curve test to find optimal regularization parameter lambda.<br><br>',...
    +0120             '<u>Default value:</u><br>',...
    +0121             '<b>Manual</b><br>'];
    +0122 end
    +0123 % update the tool tips
    +0124 set(gui.popup_handles.invstd_InvType,'UserData',struct('Tooltipstr',inv_tstr));
    +0125 set(gui.popup_handles.invstd_InvTypeOpt,'UserData',struct('Tooltipstr',reg_tstr));
    +0126 
    +0127 % update GUI data
    +0128 setappdata(fig,'gui',gui);
    +0129 setappdata(fig,'data',data);
    +0130 % if tool tips are activated they need to be updated on-the-fly
    +0131 switch data.info.ToolTips
    +0132     case 'on'
    +0133         onMenuExtraShow(gui.menu.extra_settings_tooltips_on);
    +0134     otherwise
    +0135         % nothing to do
    +0136 end
    +0137 
    +0138 end
    +0139 
    +0140 %------------- END OF CODE --------------
    +0141 
    +0142 %% License:
    +0143 % MIT License
    +0144 %
    +0145 % Copyright (c) 2019 Thomas Hiller
    +0146 %
    +0147 % Permission is hereby granted, free of charge, to any person obtaining a copy
    +0148 % of this software and associated documentation files (the "Software"), to deal
    +0149 % in the Software without restriction, including without limitation the rights
    +0150 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    +0151 % copies of the Software, and to permit persons to whom the Software is
    +0152 % furnished to do so, subject to the following conditions:
    +0153 %
    +0154 % The above copyright notice and this permission notice shall be included in all
    +0155 % copies or substantial portions of the Software.
    +0156 %
    +0157 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    +0158 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    +0159 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    +0160 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    +0161 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    +0162 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    +0163 % SOFTWARE.
    +
    Generated by m2html © 2005
    + + \ No newline at end of file diff --git a/doc/nucleus/functions/inversion/applyRegularization.html b/doc/nucleus/functions/inversion/applyRegularization.html index 69bb2e0..8867204 100644 --- a/doc/nucleus/functions/inversion/applyRegularization.html +++ b/doc/nucleus/functions/inversion/applyRegularization.html @@ -39,7 +39,7 @@

    DESCRIPTION ^CROSS-REFERENCE INFORMATION ^
 </ul>
 This function is called by:
 <ul style= -
  • fitDataNNLS is a control routine that uses the 'Regularization Toolbox'
  • +
  • fitDataLSQ is a control routine that fits NMR data multi-exponentially;
  • fitDataNNLS is a control routine that uses the 'Regularization Toolbox'
  • @@ -126,7 +126,7 @@

    SOURCE CODE ^%------------- BEGIN CODE -------------- 0045 -0046 switch flag +0046 switch flag 0047 case 'manual' 0048 Kreg = [K;lambda_in*L]; 0049 lambda = lambda_in; @@ -137,7 +137,7 @@

    SOURCE CODE ^'tikh',0); 0055 else 0056 [U,s,~,~,~] = cgsvd(K,L); -0057 [lambda,~,~] = gcv(U,s,g,'tikh',0); +0057 [lambda,~,~] = gcv(U,s,g,'tikh',0); 0058 end 0059 Kreg = [K;lambda*L]; 0060 @@ -163,42 +163,51 @@

    SOURCE CODE ^case 'discrep' 0082 delta = sqrt(length(g))*noise_level; -0083 if order == 0 -0084 [U,s,V] = csvd(K); -0085 [~,lambda] = discrep(U,s,V,g,delta); -0086 else -0087 [U,s,X,~,~] = cgsvd(K,L); -0088 [~,lambda] = discrep(U,s,X,g,delta); -0089 end -0090 Kreg = [K;lambda*L]; -0091 end -0092 -0093 return -0094 -0095 %------------- END OF CODE -------------- -0096 -0097 %% License: -0098 % MIT License -0099 % -0100 % Copyright (c) 2018 Thomas Hiller -0101 % -0102 % Permission is hereby granted, free of charge, to any person obtaining a copy -0103 % of this software and associated documentation files (the "Software"), to deal -0104 % in the Software without restriction, including without limitation the rights -0105 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -0106 % copies of the Software, and to permit persons to whom the Software is -0107 % furnished to do so, subject to the following conditions: +0083 try +0084 if order == 0 +0085 [U,s,V] = csvd(K); +0086 [~,lambda] = discrep(U,s,V,g,delta); +0087 else +0088 [U,s,X,~,~] = cgsvd(K,L); +0089 [~,lambda] = discrep(U,s,X,g,delta); +0090 end +0091 Kreg = [K;lambda*L]; +0092 catch ME +0093 % show error message in case discrep fails +0094 errmsg = {ME.message;[ME.stack(1).name,' Line: ',num2str(ME.stack(1).line)];... +0095 'Regul. Box: discrep.m failed!';'Using Lambda=1 as fall back.'}; +0096 errordlg(errmsg,'applyRegularization: Error!'); +0097 lambda = 1; +0098 Kreg = [K;lambda*L]; +0099 end +0100 end +0101 +0102 return +0103 +0104 %------------- END OF CODE -------------- +0105 +0106 %% License: +0107 % MIT License 0108 % -0109 % The above copyright notice and this permission notice shall be included in all -0110 % copies or substantial portions of the Software. -0111 % -0112 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -0113 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -0114 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -0115 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -0116 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -0117 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -0118 % SOFTWARE. +0109 % Copyright (c) 2018 Thomas Hiller +0110 % +0111 % Permission is hereby granted, free of charge, to any person obtaining a copy +0112 % of this software and associated documentation files (the "Software"), to deal +0113 % in the Software without restriction, including without limitation the rights +0114 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0115 % copies of the Software, and to permit persons to whom the Software is +0116 % furnished to do so, subject to the following conditions: +0117 % +0118 % The above copyright notice and this permission notice shall be included in all +0119 % copies or substantial portions of the Software. +0120 % +0121 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0122 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0123 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0124 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0125 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0126 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0127 % SOFTWARE.
    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/functions/inversion/createKernelMatrix.html b/doc/nucleus/functions/inversion/createKernelMatrix.html index 468410f..eb80224 100644 --- a/doc/nucleus/functions/inversion/createKernelMatrix.html +++ b/doc/nucleus/functions/inversion/createKernelMatrix.html @@ -66,7 +66,7 @@

    CROSS-REFERENCE INFORMATION ^
 </ul>
 This function is called by:
 <ul style= -
  • fitDataInvLaplace is a control routine that uses an Inverse Laplace
  • fitDataNNLS is a control routine that uses the 'Regularization Toolbox'
  • +
  • fitDataInvLaplace is a control routine that uses an Inverse Laplace
  • fitDataLSQ is a control routine that fits NMR data multi-exponentially;
  • fitDataNNLS is a control routine that uses the 'Regularization Toolbox'
  • diff --git a/doc/nucleus/functions/inversion/fitDataFree.html b/doc/nucleus/functions/inversion/fitDataFree.html index 4b378d2..55ec552 100644 --- a/doc/nucleus/functions/inversion/fitDataFree.html +++ b/doc/nucleus/functions/inversion/fitDataFree.html @@ -194,121 +194,129 @@

    SOURCE CODE ^switch flag 0095 case 'T1' 0096 % solver options -0097 options = optimset('Display',parameter.info,'MaxFunEvals',10^6,... -0098 'LargeScale','on','MaxIter',5000,'TolFun',1e-12,'TolX',1e-12); -0099 [x,~,~,~,output,~,jacobian] = lsqcurvefit(@(x,t)fcn_fitFreeT1(x,t,IRfac),... -0100 x0,t,s,zeros(size(x0)),[],options); -0101 case 'T2' -0102 % solver options -0103 options = optimset('Display',parameter.info,'MaxFunEvals',10^6,... -0104 'Jacobian','on','Algorithm','levenberg-marquardt','MaxIter',5000,'TolFun',1e-12,'TolX',1e-12); -0105 iparam.t = t; -0106 iparam.s = s; -0107 [x,~,~,~,output,~,jacobian] = lsqnonlin(@(x)fcn_fitFreeT2w(x,iparam),... -0108 x0,zeros(size(x0)),[],options); -0109 % [x,~,~,~,output,~,jacobian] = lsqcurvefit(@fcn_fitFreeT2,... -0110 % x0,t,s,zeros(size(x0)),[],options); -0111 end -0112 case 'off' -0113 % solver options -0114 options = optimset('Display',parameter.info,'MaxFunEvals',10^6,... -0115 'MaxIter',5000,'TolFun',1e-12,'TolX',1e-12); -0116 switch flag -0117 case 'T1' -0118 [x,~,~,output] = fminsearchbnd(@(x) fcn_fitFreeT1_fmin(x,t,s,IRfac),... -0119 x0,zeros(size(x0)),[],options); -0120 case 'T2' -0121 [x,~,~,output] = fminsearchbnd(@(x) fcn_fitFreeT2_fmin(x,t,s,e),... -0122 x0,zeros(size(x0)),[],options); -0123 end -0124 end -0125 -0126 % get the fit -0127 fit_t = t; -0128 switch flag -0129 case 'T1' -0130 fit_s = fcn_fitFreeT1(x,fit_t,IRfac); -0131 case 'T2' -0132 fit_s = fcn_fitFreeT2(x,fit_t); -0133 end -0134 -0135 % get residuals and error measures -0136 if isfield(parameter,'W') -0137 % when signal gating was used the error estimates need to be adjusted -0138 out = getFitErrors(signal,fit_s,parameter.noise,parameter.W); -0139 else -0140 out = getFitErrors(signal,fit_s,parameter.noise); +0097 options = optimoptions('lsqcurvefit'); +0098 options.Display = parameter.info; +0099 options.OptimalityTolerance = 1e-18; +0100 options.StepTolerance = 1e-18; +0101 % options.MaxIterations = 1e3; +0102 [x,~,~,~,output,~,jacobian] = lsqcurvefit(@(x,t)fcn_fitFreeT1(x,t,IRfac),... +0103 x0,t,s,zeros(size(x0)),[],options); +0104 case 'T2' +0105 % solver options +0106 options = optimoptions('lsqnonlin'); +0107 options.Algorithm = 'levenberg-marquardt'; +0108 options.Display = parameter.info; +0109 options.OptimalityTolerance = 1e-18; +0110 options.StepTolerance = 1e-18; +0111 % options.MaxIterations = 1e3; +0112 +0113 iparam.t = t; +0114 iparam.s = s; +0115 [x,~,~,~,output,~,jacobian] = lsqnonlin(@(x)fcn_fitFreeT2w(x,iparam),... +0116 x0,zeros(size(x0)),[],options); +0117 % [x,~,~,~,output,~,jacobian] = lsqcurvefit(@fcn_fitFreeT2,... +0118 % x0,t,s,zeros(size(x0)),[],options); +0119 end +0120 case 'off' +0121 % solver options +0122 options = optimset('Display',parameter.info,'MaxFunEvals',10^6,... +0123 'MaxIter',5000,'TolFun',1e-12,'TolX',1e-12); +0124 switch flag +0125 case 'T1' +0126 [x,~,~,output] = fminsearchbnd(@(x) fcn_fitFreeT1_fmin(x,t,s,IRfac),... +0127 x0,zeros(size(x0)),[],options); +0128 case 'T2' +0129 [x,~,~,output] = fminsearchbnd(@(x) fcn_fitFreeT2_fmin(x,t,s,e),... +0130 x0,zeros(size(x0)),[],options); +0131 end +0132 end +0133 +0134 % get the fit +0135 fit_t = t; +0136 switch flag +0137 case 'T1' +0138 fit_s = fcn_fitFreeT1(x,fit_t,IRfac); +0139 case 'T2' +0140 fit_s = fcn_fitFreeT2(x,fit_t); 0141 end 0142 -0143 % get Jacobian -0144 switch parameter.optim -0145 case 'on' -0146 % nothing to do because the Optim. Toolbox gives the jacobian as -0147 % output -0148 case 'off' -0149 jacobian = getFitFreeJacobian(x,t,flag,IRfac); -0150 end -0151 -0152 % confidence interval -0153 ci = getConfInterval(out.resnorm,jacobian,0.05); -0154 -0155 % sort the relaxation times in ascending order -0156 E0 = x(1:2:end); -0157 T = x(2:2:end); -0158 [T,idx] = sort(T); -0159 E0 = E0(idx); -0160 ciT = ci(2:2:end); -0161 ciE = ci(1:2:end); -0162 ciT = ciT(idx); -0163 ciE = ciE(idx); -0164 ci(2:2:end) = ciT; -0165 ci(1:2:end) = ciE; -0166 -0167 % output struct -0168 fitdata.E0 = E0; -0169 switch flag -0170 case 'T1' -0171 fitdata.T1 = T; -0172 case 'T2' -0173 fitdata.T2 = T; -0174 end -0175 fitdata.fit_t = fit_t; -0176 fitdata.fit_s = fit_s; -0177 fitdata.resnorm = out.resnorm; -0178 fitdata.residual = out.residual; -0179 fitdata.errornorm = out.errnorm1; -0180 fitdata.rms = out.rms; -0181 fitdata.chi2 = out.chi2; -0182 fitdata.ci = ci; -0183 fitdata.x = x; -0184 fitdata.output = output; -0185 -0186 return -0187 -0188 %------------- END OF CODE -------------- -0189 -0190 %% License: -0191 % MIT License -0192 % -0193 % Copyright (c) 2018 Thomas Hiller -0194 % -0195 % Permission is hereby granted, free of charge, to any person obtaining a copy -0196 % of this software and associated documentation files (the "Software"), to deal -0197 % in the Software without restriction, including without limitation the rights -0198 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -0199 % copies of the Software, and to permit persons to whom the Software is -0200 % furnished to do so, subject to the following conditions: -0201 % -0202 % The above copyright notice and this permission notice shall be included in all -0203 % copies or substantial portions of the Software. -0204 % -0205 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -0206 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -0207 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -0208 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -0209 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -0210 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -0211 % SOFTWARE. +0143 % get residuals and error measures +0144 if isfield(parameter,'W') +0145 % when signal gating was used the error estimates need to be adjusted +0146 out = getFitErrors(signal,fit_s,parameter.noise,parameter.W); +0147 else +0148 out = getFitErrors(signal,fit_s,parameter.noise); +0149 end +0150 +0151 % get Jacobian +0152 switch parameter.optim +0153 case 'on' +0154 % nothing to do because the Optim. Toolbox gives the jacobian as +0155 % output +0156 case 'off' +0157 jacobian = getFitFreeJacobian(x,t,flag,IRfac); +0158 end +0159 +0160 % confidence interval +0161 ci = getConfInterval(out.resnorm,jacobian,0.05); +0162 +0163 % sort the relaxation times in ascending order +0164 E0 = x(1:2:end); +0165 T = x(2:2:end); +0166 [T,idx] = sort(T); +0167 E0 = E0(idx); +0168 ciT = ci(2:2:end); +0169 ciE = ci(1:2:end); +0170 ciT = ciT(idx); +0171 ciE = ciE(idx); +0172 ci(2:2:end) = ciT; +0173 ci(1:2:end) = ciE; +0174 +0175 % output struct +0176 fitdata.E0 = E0; +0177 switch flag +0178 case 'T1' +0179 fitdata.T1 = T; +0180 case 'T2' +0181 fitdata.T2 = T; +0182 end +0183 fitdata.fit_t = fit_t; +0184 fitdata.fit_s = fit_s; +0185 fitdata.resnorm = out.resnorm; +0186 fitdata.residual = out.residual; +0187 fitdata.errornorm = out.errnorm1; +0188 fitdata.rms = out.rms; +0189 fitdata.chi2 = out.chi2; +0190 fitdata.ci = ci; +0191 fitdata.x = x; +0192 fitdata.output = output; +0193 +0194 return +0195 +0196 %------------- END OF CODE -------------- +0197 +0198 %% License: +0199 % MIT License +0200 % +0201 % Copyright (c) 2018 Thomas Hiller +0202 % +0203 % Permission is hereby granted, free of charge, to any person obtaining a copy +0204 % of this software and associated documentation files (the "Software"), to deal +0205 % in the Software without restriction, including without limitation the rights +0206 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +0207 % copies of the Software, and to permit persons to whom the Software is +0208 % furnished to do so, subject to the following conditions: +0209 % +0210 % The above copyright notice and this permission notice shall be included in all +0211 % copies or substantial portions of the Software. +0212 % +0213 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +0214 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +0215 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +0216 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +0217 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +0218 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +0219 % SOFTWARE.
    Generated by m2html © 2005
    \ No newline at end of file diff --git a/doc/nucleus/functions/inversion/fitDataLSQ.html b/doc/nucleus/functions/inversion/fitDataLSQ.html new file mode 100644 index 0000000..8fbca76 --- /dev/null +++ b/doc/nucleus/functions/inversion/fitDataLSQ.html @@ -0,0 +1,343 @@ + + + + Description of fitDataLSQ + + + + + + + + + + + +

    fitDataLSQ +

    + +

    PURPOSE ^

    +
    is a control routine that fits NMR data multi-exponentially;
    + +

    SYNOPSIS ^

    +
    function fitdata = fitDataLSQ(time,signal,parameter)
    + +

    DESCRIPTION ^

    +
    fitDataLSQ is a control routine that fits NMR data multi-exponentially;
    +if the Optimization Toolbox is available the user can select LSQLIN,
    +otherwise the default built-in LSQNONNEG is used; the 'Regularization Toolbox'
    +from P. Hansen can be used for automatic regularization based on the SVD
    +
    + Syntax:
    +       fitDataLSQ(time,signal,parameter)
    +
    + Inputs:
    +       time - time vector
    +       signal - NMR signal vector (no complex data allowed!)
    +       parameter - struct that holds additional settings:
    +                   T1T2     : flag between 'T1' or 'T2' inversion
    +                   T1IRfac  : either '1' or '2' depending on T1 method
    +                   Tb       : bulk relaxation time
    +                   Tint     : relaxation times [log10(tmin) log10(tmax) Ndec]
    +                   regMethod: 'manual', 'gcv_tikh', 'gcv_trunc',
    +                              'gcv_damp', 'discrep'
    +                   Lorder   : smoothness constraint (derivative matrix)
    +                   lambda   : regularization parameter (for 'manual')
    +                   noise    : noise level needed for 'discrep' discrepancy
    +                              principle
    +                   W        : error weighting matrix (optional)
    +                   solver   : LSQ solver ('lsqlin' or 'lsqnonneg')
    +
    + Outputs:
    +       fitdata - struct that holds the inversion results:
    +                   fit_t      : time vector for plotting
    +                   fit_s      : signal vector for plotting
    +                   T1T2me     : relaxation time values
    +                   T1T2f      : relaxation time spectrum
    +                   Tlgm       : T logmean
    +                   E0         : initial amplitude at t=0 (T2) or t=inf (T1)
    +                   resnorm    : residual norm
    +                   residual   : vector of residuals
    +                   chi2       : chi square error
    +                   rms        : RMS error
    +                   lambda_out : regularization parameter lambda determined
    +                                by the different options from the 'regu'
    +                                toolbox
    +                   KK         : Kernel matrix
    +                   L          : derivative matrix
    +                   xn         : model norm |L*x|_2
    +                   rn         : residual norm |A*x-b|_2
    +
    + Example:
    +       [fitdata] = fitDataLSQ(t,s,parameter)
    +
    + Other m-files required:
    +       Optimization Toolbox from Mathworks (optional)
    +       Regularization Toolbox
    +       applyRegularization
    +       createKernelMatrix
    +       getFitErrors
    +       getTLogMean
    +       lsqnonneg
    +       lsqlin (optional)
    +
    + Subfunctions:
    +       none
    +
    + MAT-files required:
    +       none
    +
    + See also:
    + Author: Thomas Hiller
    + email: thomas.hiller[at]leibniz-liag.de
    + License: MIT License (at end)
    + + +

    CROSS-REFERENCE INFORMATION ^

    +This function calls: + +This function is called by: + + + + + +

    SOURCE CODE ^

    +
    0001 function fitdata = fitDataLSQ(time,signal,parameter)
    +0002 %fitDataLSQ is a control routine that fits NMR data multi-exponentially;
    +0003 %if the Optimization Toolbox is available the user can select LSQLIN,
    +0004 %otherwise the default built-in LSQNONNEG is used; the 'Regularization Toolbox'
    +0005 %from P. Hansen can be used for automatic regularization based on the SVD
    +0006 %
    +0007 % Syntax:
    +0008 %       fitDataLSQ(time,signal,parameter)
    +0009 %
    +0010 % Inputs:
    +0011 %       time - time vector
    +0012 %       signal - NMR signal vector (no complex data allowed!)
    +0013 %       parameter - struct that holds additional settings:
    +0014 %                   T1T2     : flag between 'T1' or 'T2' inversion
    +0015 %                   T1IRfac  : either '1' or '2' depending on T1 method
    +0016 %                   Tb       : bulk relaxation time
    +0017 %                   Tint     : relaxation times [log10(tmin) log10(tmax) Ndec]
    +0018 %                   regMethod: 'manual', 'gcv_tikh', 'gcv_trunc',
    +0019 %                              'gcv_damp', 'discrep'
    +0020 %                   Lorder   : smoothness constraint (derivative matrix)
    +0021 %                   lambda   : regularization parameter (for 'manual')
    +0022 %                   noise    : noise level needed for 'discrep' discrepancy
    +0023 %                              principle
    +0024 %                   W        : error weighting matrix (optional)
    +0025 %                   solver   : LSQ solver ('lsqlin' or 'lsqnonneg')
    +0026 %
    +0027 % Outputs:
    +0028 %       fitdata - struct that holds the inversion results:
    +0029 %                   fit_t      : time vector for plotting
    +0030 %                   fit_s      : signal vector for plotting
    +0031 %                   T1T2me     : relaxation time values
    +0032 %                   T1T2f      : relaxation time spectrum
    +0033 %                   Tlgm       : T logmean
    +0034 %                   E0         : initial amplitude at t=0 (T2) or t=inf (T1)
    +0035 %                   resnorm    : residual norm
    +0036 %                   residual   : vector of residuals
    +0037 %                   chi2       : chi square error
    +0038 %                   rms        : RMS error
    +0039 %                   lambda_out : regularization parameter lambda determined
    +0040 %                                by the different options from the 'regu'
    +0041 %                                toolbox
    +0042 %                   KK         : Kernel matrix
    +0043 %                   L          : derivative matrix
    +0044 %                   xn         : model norm |L*x|_2
    +0045 %                   rn         : residual norm |A*x-b|_2
    +0046 %
    +0047 % Example:
    +0048 %       [fitdata] = fitDataLSQ(t,s,parameter)
    +0049 %
    +0050 % Other m-files required:
    +0051 %       Optimization Toolbox from Mathworks (optional)
    +0052 %       Regularization Toolbox
    +0053 %       applyRegularization
    +0054 %       createKernelMatrix
    +0055 %       getFitErrors
    +0056 %       getTLogMean
    +0057 %       lsqnonneg
    +0058 %       lsqlin (optional)
    +0059 %
    +0060 % Subfunctions:
    +0061 %       none
    +0062 %
    +0063 % MAT-files required:
    +0064 %       none
    +0065 %
    +0066 % See also:
    +0067 % Author: Thomas Hiller
    +0068 % email: thomas.hiller[at]leibniz-liag.de
    +0069 % License: MIT License (at end)
    +0070 
    +0071 %------------- BEGIN CODE --------------
    +0072 
    +0073 % make input column vectors
    +0074 time = time(:);
    +0075 signal = signal(:);
    +0076 
    +0077 % get the maximum value of the signal to scale the signal for the inversion
    +0078 % to 1
    +0079 maxS = max(signal);
    +0080 
    +0081 % temporary variables
    +0082 t = time;
    +0083 g = signal./maxS;
    +0084 
    +0085 % get the input parameters
    +0086 flag = parameter.T1T2;           % T1/T2 switch
    +0087 T1IRfac = parameter.T1IRfac;     % T1 Sat/Inv Recovery factor
    +0088 Tb = parameter.Tb;               % bulk relaxation time
    +0089 tstart = parameter.Tint(1);      % log10 value
    +0090 tend = parameter.Tint(2);        % log10 value
    +0091 N = parameter.Tint(3);           % N per decade
    +0092 regMethod = parameter.regMethod; % regularization method
    +0093 order = parameter.Lorder;        % smoothness constraint
    +0094 lambda = parameter.lambda;       % regularization parameter
    +0095 noise = parameter.noise;         % noise
    +0096 
    +0097 % create the relaxation time vector
    +0098 T1T2me = logspace(tstart,tend,(tend-tstart)*N);
    +0099 
    +0100 % create the Kernel matrix for inversion
    +0101 K = createKernelMatrix(t,T1T2me,Tb,flag,T1IRfac);
    +0102 
    +0103 if strcmp(parameter.solver,'lsqlin')
    +0104     % initial T2 amplitudes
    +0105     f0 = zeros(size(T1T2me));
    +0106     f0_lb = f0;
    +0107     f0_ub = 1.5*max(g)*ones(size(T1T2me));
    +0108 end
    +0109 
    +0110 % derivative matrix
    +0111 L = get_l(length(T1T2me),order);
    +0112 
    +0113 % scale the noise and error matrix W accordingly
    +0114 noise = noise./maxS;
    +0115 if isfield(parameter,'W')
    +0116     e = diag(parameter.W);
    +0117     e = e./maxS;
    +0118     W = diag(e);
    +0119 end
    +0120 
    +0121 % apply error weight matrix
    +0122 if isfield(parameter,'W')
    +0123     g = W*g;
    +0124     K = W*K;
    +0125 end
    +0126 
    +0127 % extend K and apply regularization
    +0128 % 'manual' | 'gcv_tikh' | 'gcv_trunc' | 'gcv_damp' | 'discrep'
    +0129 [KK,lambda_out] = applyRegularization(K,g,L,lambda,regMethod,order,noise);
    +0130 
    +0131 % extend g accordingly
    +0132 gg = g;
    +0133 gg(length(g)+1:length(g)+size(L,1),1) = 0;
    +0134 
    +0135 switch parameter.solver
    +0136     case 'lsqlin'
    +0137         options = optimoptions('lsqlin');
    +0138         options.Display = parameter.info;
    +0139         options.OptimalityTolerance = 1e-18;
    +0140         options.StepTolerance = 1e-18;
    +0141         [f,~,~,~,~,~] = lsqlin(KK,gg,[],[],[],[],...
    +0142             f0_lb,f0_ub,[],options);
    +0143     case 'lsqnonneg'
    +0144         options = optimset('Display',parameter.info,'TolX',1e-12);
    +0145         [f,~,~,~,~,~] = lsqnonneg(KK,gg,options);
    +0146 end
    +0147 
    +0148 % rescale f so that the sum(f)= unscaled E0
    +0149 f = (f.*maxS);
    +0150 
    +0151 % the 'inverted' signal
    +0152 gg_fit = KK*f;
    +0153 % cut off the end which was needed for regularization
    +0154 s_fit = gg_fit(1:length(t),1);
    +0155 
    +0156 % get residuals and error measures
    +0157 if isfield(parameter,'W')
    +0158     % normalize the fit because the signal was error weighted for the
    +0159     % inversion
    +0160     e = diag(W);
    +0161     einv = 1./e;
    +0162     Winv = diag(einv);
    +0163     s_fit = Winv * s_fit;
    +0164     
    +0165     % because signal and s_fit are unscaled the initial values for noise
    +0166     % and W are used to get the error estimates
    +0167     out = getFitErrors(signal,s_fit,parameter.noise,parameter.W);
    +0168 else
    +0169     out = getFitErrors(signal,s_fit,parameter.noise);
    +0170 end
    +0171 
    +0172 % L-curve parameter
    +0173 % model norm |L*x|_2
    +0174 xn = norm(L*f,2);
    +0175 % residual norm |A*x-b|_2
    +0176 rn = norm(out.residual,2);
    +0177 
    +0178 % get "initial" value E0
    +0179 if strcmp(flag,'T1')
    +0180     t2 = 10*time(end);
    +0181     K2 = createKernelMatrix(t2,T1T2me,Tb,flag,T1IRfac);
    +0182 elseif strcmp(flag,'T2')
    +0183     t2 = 0;
    +0184     K2 = createKernelMatrix(t2,T1T2me,Tb,flag,T1IRfac);
    +0185 end
    +0186 E0 = K2*f;
    +0187 
    +0188 % output struct
    +0189 fitdata.fit_t = time(:);
    +0190 fitdata.fit_s = s_fit(:);
    +0191 fitdata.T1T2me = T1T2me(:);
    +0192 fitdata.T1T2f = f(:);
    +0193 fitdata.Tlgm = getTLogMean(T1T2me,f);
    +0194 fitdata.E0 = E0;
    +0195 fitdata.resnorm = out.resnorm;
    +0196 fitdata.residual = out.residual;
    +0197 fitdata.chi2 = out.chi2;
    +0198 fitdata.rms = out.rms;
    +0199 fitdata.lambda_out = lambda_out;
    +0200 fitdata.KK = KK;
    +0201 fitdata.L = L;
    +0202 fitdata.xn = xn;
    +0203 fitdata.rn = rn;
    +0204 
    +0205 return
    +0206 
    +0207 %------------- END OF CODE --------------
    +0208 
    +0209 %% License:
    +0210 % MIT License
    +0211 %
    +0212 % Copyright (c) 2018 Thomas Hiller
    +0213 %
    +0214 % Permission is hereby granted, free of charge, to any person obtaining a copy
    +0215 % of this software and associated documentation files (the "Software"), to deal
    +0216 % in the Software without restriction, including without limitation the rights
    +0217 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    +0218 % copies of the Software, and to permit persons to whom the Software is
    +0219 % furnished to do so, subject to the following conditions:
    +0220 %
    +0221 % The above copyright notice and this permission notice shall be included in all
    +0222 % copies or substantial portions of the Software.
    +0223 %
    +0224 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    +0225 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    +0226 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    +0227 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    +0228 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    +0229 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    +0230 % SOFTWARE.
    +
    Generated by m2html © 2005
    + + \ No newline at end of file diff --git a/doc/nucleus/functions/inversion/fitDataNNLS.html b/doc/nucleus/functions/inversion/fitDataNNLS.html deleted file mode 100644 index 3137e04..0000000 --- a/doc/nucleus/functions/inversion/fitDataNNLS.html +++ /dev/null @@ -1,339 +0,0 @@ - - - - Description of fitDataNNLS - - - - - - - - - - - -

    fitDataNNLS -

    - -

    PURPOSE ^

    -
    is a control routine that uses the 'Regularization Toolbox'
    - -

    SYNOPSIS ^

    -
    function fitdata = fitDataNNLS(time,signal,parameter)
    - -

    DESCRIPTION ^

    -
    fitDataNNLS is a control routine that uses the 'Regularization Toolbox'
    -from P. Hansen and 'lsqlin' to fit NMR data multi-exponentially
    -
    - Syntax:
    -       fitDataNNLS(time,signal,parameter)
    -
    - Inputs:
    -       time - time vector
    -       signal - NMR signal vector (no complex data allowed!)
    -       parameter - struct that holds additional settings:
    -                   T1T2     : flag between 'T1' or 'T2' inversion
    -                   T1IRfac  : either '1' or '2' depending on T1 method
    -                   Tb       : bulk relaxation time
    -                   Tint     : relaxation times [log10(tmin) log10(tmax) Ndec]
    -                   regMethod: 'manual', 'gcv_tikh', 'gcv_trunc',
    -                              'gcv_damp', 'discrep'
    -                   Lorder   : smoothness constraint (derivative matrix)
    -                   lambda   : regularization parameter (for 'manual')
    -                   noise    : noise level needed for 'discrep' discrepancy
    -                              principle
    -                   W        : error weighting matrix (optional)
    -                   optim    : switch for Optimization Toolbox
    -
    - Outputs:
    -       fitdata - struct that holds the inversion results:
    -                   fit_t      : time vector for plotting
    -                   fit_s      : signal vector for plotting
    -                   T1T2me     : relaxation time values
    -                   T1T2f      : relaxation time spectrum
    -                   Tlgm       : T logmean
    -                   E0         : initial amplitude at t=0 (T2) or t=inf (T1)
    -                   resnorm    : residual norm
    -                   residual   : vector of residuals
    -                   chi2       : chi square error
    -                   rms        : RMS error
    -                   lambda_out : regularization parameter lambda determined
    -                                by the different options from the 'regu'
    -                                toolbox
    -                   KK         : Kernel matrix
    -                   L          : derivative matrix
    -                   xn         : model norm |L*x|_2
    -                   rn         : residual norm |A*x-b|_2
    -
    - Example:
    -       [fitdata] = fitDataNNLS(t,s,parameter)
    -
    - Other m-files required:
    -       Optimization Toolbox from Mathworks (optional)
    -       Regularization Toolbox
    -       applyRegularization
    -       createKernelMatrix
    -       getFitErrors
    -       getTLogMean
    -       lsqnonneg
    -       lsqlin (optional)
    -
    - Subfunctions:
    -       none
    -
    - MAT-files required:
    -       none
    -
    - See also:
    - Author: Thomas Hiller
    - email: thomas.hiller[at]leibniz-liag.de
    - License: MIT License (at end)
    - - -

    CROSS-REFERENCE INFORMATION ^

    -This function calls: - -This function is called by: - - - - - -

    SOURCE CODE ^

    -
    0001 function fitdata = fitDataNNLS(time,signal,parameter)
    -0002 %fitDataNNLS is a control routine that uses the 'Regularization Toolbox'
    -0003 %from P. Hansen and 'lsqlin' to fit NMR data multi-exponentially
    -0004 %
    -0005 % Syntax:
    -0006 %       fitDataNNLS(time,signal,parameter)
    -0007 %
    -0008 % Inputs:
    -0009 %       time - time vector
    -0010 %       signal - NMR signal vector (no complex data allowed!)
    -0011 %       parameter - struct that holds additional settings:
    -0012 %                   T1T2     : flag between 'T1' or 'T2' inversion
    -0013 %                   T1IRfac  : either '1' or '2' depending on T1 method
    -0014 %                   Tb       : bulk relaxation time
    -0015 %                   Tint     : relaxation times [log10(tmin) log10(tmax) Ndec]
    -0016 %                   regMethod: 'manual', 'gcv_tikh', 'gcv_trunc',
    -0017 %                              'gcv_damp', 'discrep'
    -0018 %                   Lorder   : smoothness constraint (derivative matrix)
    -0019 %                   lambda   : regularization parameter (for 'manual')
    -0020 %                   noise    : noise level needed for 'discrep' discrepancy
    -0021 %                              principle
    -0022 %                   W        : error weighting matrix (optional)
    -0023 %                   optim    : switch for Optimization Toolbox
    -0024 %
    -0025 % Outputs:
    -0026 %       fitdata - struct that holds the inversion results:
    -0027 %                   fit_t      : time vector for plotting
    -0028 %                   fit_s      : signal vector for plotting
    -0029 %                   T1T2me     : relaxation time values
    -0030 %                   T1T2f      : relaxation time spectrum
    -0031 %                   Tlgm       : T logmean
    -0032 %                   E0         : initial amplitude at t=0 (T2) or t=inf (T1)
    -0033 %                   resnorm    : residual norm
    -0034 %                   residual   : vector of residuals
    -0035 %                   chi2       : chi square error
    -0036 %                   rms        : RMS error
    -0037 %                   lambda_out : regularization parameter lambda determined
    -0038 %                                by the different options from the 'regu'
    -0039 %                                toolbox
    -0040 %                   KK         : Kernel matrix
    -0041 %                   L          : derivative matrix
    -0042 %                   xn         : model norm |L*x|_2
    -0043 %                   rn         : residual norm |A*x-b|_2
    -0044 %
    -0045 % Example:
    -0046 %       [fitdata] = fitDataNNLS(t,s,parameter)
    -0047 %
    -0048 % Other m-files required:
    -0049 %       Optimization Toolbox from Mathworks (optional)
    -0050 %       Regularization Toolbox
    -0051 %       applyRegularization
    -0052 %       createKernelMatrix
    -0053 %       getFitErrors
    -0054 %       getTLogMean
    -0055 %       lsqnonneg
    -0056 %       lsqlin (optional)
    -0057 %
    -0058 % Subfunctions:
    -0059 %       none
    -0060 %
    -0061 % MAT-files required:
    -0062 %       none
    -0063 %
    -0064 % See also:
    -0065 % Author: Thomas Hiller
    -0066 % email: thomas.hiller[at]leibniz-liag.de
    -0067 % License: MIT License (at end)
    -0068 
    -0069 %------------- BEGIN CODE --------------
    -0070 
    -0071 % make input column vectors
    -0072 time = time(:);
    -0073 signal = signal(:);
    -0074 
    -0075 % get the maximum value of the signal to scale the signal for the inversion
    -0076 % to 1
    -0077 maxS = max(signal);
    -0078 
    -0079 % temporary variables
    -0080 t = time;
    -0081 g = signal./maxS;
    -0082 
    -0083 % get the input parameters
    -0084 flag = parameter.T1T2;           % T1/T2 switch
    -0085 T1IRfac = parameter.T1IRfac;     % T1 Sat/Inv Recovery factor
    -0086 Tb = parameter.Tb;               % bulk relaxation time
    -0087 tstart = parameter.Tint(1);      % log10 value
    -0088 tend = parameter.Tint(2);        % log10 value
    -0089 N = parameter.Tint(3);           % N per decade
    -0090 regMethod = parameter.regMethod; % regularization method
    -0091 order = parameter.Lorder;        % smoothness constraint
    -0092 lambda = parameter.lambda;       % regularization parameter
    -0093 noise = parameter.noise;         % noise
    -0094 
    -0095 % create the relaxation time vector
    -0096 T1T2me = logspace(tstart,tend,(tend-tstart)*N);
    -0097 
    -0098 % create the Kernel matrix for inversion
    -0099 K = createKernelMatrix(t,T1T2me,Tb,flag,T1IRfac);
    -0100 
    -0101 if strcmp(parameter.optim,'on')
    -0102     % initial T2 amplitudes
    -0103     f0 = zeros(size(T1T2me));
    -0104     f0_lb = f0;
    -0105     f0_ub = 1.5*max(g)*ones(size(T1T2me));
    -0106 end
    -0107 
    -0108 % derivative matrix
    -0109 L = get_l(length(T1T2me),order);
    -0110 
    -0111 % scale the noise and error matrix W accordingly
    -0112 noise = noise./maxS;
    -0113 if isfield(parameter,'W')
    -0114     e = diag(parameter.W);
    -0115     e = e./maxS;
    -0116     W = diag(e);
    -0117 end
    -0118 
    -0119 % apply error weight matrix
    -0120 if isfield(parameter,'W')
    -0121     g = W*g;
    -0122     K = W*K;
    -0123 end
    -0124 
    -0125 % extend K and apply regularization
    -0126 % 'manual' | 'gcv_tikh' | 'gcv_trunc' | 'gcv_damp' | 'discrep'
    -0127 [KK,lambda_out] = applyRegularization(K,g,L,lambda,regMethod,order,noise);
    -0128 
    -0129 % extend g accordingly
    -0130 gg = g;
    -0131 gg(length(g)+1:length(g)+size(L,1),1) = 0;
    -0132 
    -0133 switch parameter.optim
    -0134     case 'on'
    -0135         options = optimset('Display',parameter.info,'TolFun',1e-12,...
    -0136             'TolX',1e-12,'Jacobian','off',...
    -0137             'LargeScale','on','MaxFunEvals',1000000,...
    -0138             'MaxIter',200);
    -0139         [f,~,~,~,~,~] = lsqlin(KK,gg,[],[],[],[],...
    -0140             f0_lb,f0_ub,f0,options);
    -0141     case 'off'
    -0142         options = optimset('Display',parameter.info,'TolX',1e-12);
    -0143         [f,~,~,~,~,~] = lsqnonneg(KK,gg,options);
    -0144 end
    -0145 
    -0146 % rescale f so that the sum(f)= unscaled E0
    -0147 f = (f.*maxS);
    -0148 
    -0149 % the 'inverted' signal
    -0150 gg_fit = KK*f;
    -0151 % cut off the end which was needed for regularization
    -0152 s_fit = gg_fit(1:length(t),1);
    -0153 
    -0154 % get residuals and error measures
    -0155 if isfield(parameter,'W')
    -0156     % normalize the fit because the signal was error weighted for the
    -0157     % inversion
    -0158     e = diag(W);
    -0159     einv = 1./e;
    -0160     Winv = diag(einv);
    -0161     s_fit = Winv * s_fit;
    -0162     
    -0163     % because signal and s_fit are unscaled the initial values for noise
    -0164     % and W are used to get the error estimates
    -0165     out = getFitErrors(signal,s_fit,parameter.noise,parameter.W);
    -0166 else
    -0167     out = getFitErrors(signal,s_fit,parameter.noise);
    -0168 end
    -0169 
    -0170 % L-curve parameter
    -0171 % model norm |L*x|_2
    -0172 xn = norm(L*f,2);
    -0173 % residual norm |A*x-b|_2
    -0174 rn = norm(out.residual,2);
    -0175 
    -0176 % get "initial" value E0
    -0177 if strcmp(flag,'T1')
    -0178     t2 = 10*time(end);
    -0179     K2 = createKernelMatrix(t2,T1T2me,Tb,flag,T1IRfac);
    -0180 elseif strcmp(flag,'T2')
    -0181     t2 = 0;
    -0182     K2 = createKernelMatrix(t2,T1T2me,Tb,flag,T1IRfac);
    -0183 end
    -0184 E0 = K2*f;
    -0185 
    -0186 % output struct
    -0187 fitdata.fit_t = time(:);
    -0188 fitdata.fit_s = s_fit(:);
    -0189 fitdata.T1T2me = T1T2me(:);
    -0190 fitdata.T1T2f = f(:);
    -0191 fitdata.Tlgm = getTLogMean(T1T2me,f);
    -0192 fitdata.E0 = E0;
    -0193 fitdata.resnorm = out.resnorm;
    -0194 fitdata.residual = out.residual;
    -0195 fitdata.chi2 = out.chi2;
    -0196 fitdata.rms = out.rms;
    -0197 fitdata.lambda_out = lambda_out;
    -0198 fitdata.KK = KK;
    -0199 fitdata.L = L;
    -0200 fitdata.xn = xn;
    -0201 fitdata.rn = rn;
    -0202 
    -0203 return
    -0204 
    -0205 %------------- END OF CODE --------------
    -0206 
    -0207 %% License:
    -0208 % MIT License
    -0209 %
    -0210 % Copyright (c) 2018 Thomas Hiller
    -0211 %
    -0212 % Permission is hereby granted, free of charge, to any person obtaining a copy
    -0213 % of this software and associated documentation files (the "Software"), to deal
    -0214 % in the Software without restriction, including without limitation the rights
    -0215 % to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    -0216 % copies of the Software, and to permit persons to whom the Software is
    -0217 % furnished to do so, subject to the following conditions:
    -0218 %
    -0219 % The above copyright notice and this permission notice shall be included in all
    -0220 % copies or substantial portions of the Software.
    -0221 %
    -0222 % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    -0223 % IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    -0224 % FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    -0225 % AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    -0226 % LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    -0227 % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    -0228 % SOFTWARE.
    -
    Generated by m2html © 2005
    - - \ No newline at end of file diff --git a/doc/nucleus/functions/inversion/getFitErrors.html b/doc/nucleus/functions/inversion/getFitErrors.html index 4f95d3e..78ad122 100644 --- a/doc/nucleus/functions/inversion/getFitErrors.html +++ b/doc/nucleus/functions/inversion/getFitErrors.html @@ -72,7 +72,7 @@

    CROSS-REFERENCE INFORMATION ^
 <li><a href=getChi2 the chi2 of a NMR fit (noise weighted error quality) This function is called by:
      -
    • fitDataFree is a control routine that uses 'lsqcurvefit' to fit NMR data
    • fitDataInvLaplace is a control routine that uses an Inverse Laplace
    • fitDataNNLS is a control routine that uses the 'Regularization Toolbox'
    +
  • fitDataFree is a control routine that uses 'lsqcurvefit' to fit NMR data
  • fitDataInvLaplace is a control routine that uses an Inverse Laplace
  • fitDataLSQ is a control routine that fits NMR data multi-exponentially;
  • fitDataNNLS is a control routine that uses the 'Regularization Toolbox'
  • diff --git a/doc/nucleus/functions/inversion/getTLogMean.html b/doc/nucleus/functions/inversion/getTLogMean.html index 25b7a08..7f0b98d 100644 --- a/doc/nucleus/functions/inversion/getTLogMean.html +++ b/doc/nucleus/functions/inversion/getTLogMean.html @@ -64,7 +64,7 @@

    CROSS-REFERENCE INFORMATION ^
 </ul>
 This function is called by:
 <ul style= -
  • fitDataInvLaplace is a control routine that uses an Inverse Laplace
  • fitDataNNLS is a control routine that uses the 'Regularization Toolbox'
  • +
  • fitDataInvLaplace is a control routine that uses an Inverse Laplace
  • fitDataLSQ is a control routine that fits NMR data multi-exponentially;
  • fitDataNNLS is a control routine that uses the 'Regularization Toolbox'
  • diff --git a/doc/nucleus/functions/inversion/menu.html b/doc/nucleus/functions/inversion/menu.html index cfd6e65..3d5ee5e 100644 --- a/doc/nucleus/functions/inversion/menu.html +++ b/doc/nucleus/functions/inversion/menu.html @@ -18,7 +18,7 @@

    Index for nucleus\functions\inversion

    Matlab files in this directory:

    +
  • applyGatesToSignal
  • applyRegularization
  • createKernelMatrix
  • fcn_JointInvfixed
  • fcn_JointInvfree
  • fcn_JointInvshape
  • fcn_fitFreeT1
  • fcn_fitFreeT1_fmin
  • fcn_fitFreeT2
  • fcn_fitFreeT2_fmin
  • fcn_fitFreeT2w
  • fitDataFree
  • fitDataInvLaplace
  • fitDataLSQ
  • fitDataNNLS
  • getChi2
  • getConfInterval
  • getFitErrors
  • getFitFreeJacobian
  • getLambdaFromLCurve
  • getLambdaFromRMS
  • getStudentInvCDF
  • getTLogMean
  • diff --git a/functions/import/LoadNMRData_bamtom.m b/functions/import/LoadNMRData_bamtom.m index b61cbad..35cb5fa 100644 --- a/functions/import/LoadNMRData_bamtom.m +++ b/functions/import/LoadNMRData_bamtom.m @@ -19,6 +19,7 @@ % % Other m-files required: % fixParameterString +% rotateT2phase % % Subfunctions: % LoadDataFile @@ -51,64 +52,32 @@ helpdlg({'function: LoadNMRData_bamtom',... 'T1 data import not yet implemented'},'not yet implemented'); - case 'T2' - - % read all 'nslices' measurements - nslices = parData.nSlices; - ncsvfiles = numel(dir(fullfile(in.path,'*.csv'))); - if nslices == ncsvfiles - - nmrData = cell(1,nslices); - for i = 1:nslices - % find data file - file = dir(fullfile(in.path,['*',sprintf('%03d',i),'.csv'])); - - % read the data file - data = LoadDataFile(in.path,file.name,T1T2flag); - - % save the NMR data - nmrData{i}.flag = data.flag; - nmrData{i}.T1IRfac = 1; - nmrData{i}.time = data.time; - nmrData{i}.signal = data.signal; - nmrData{i}.raw = data.raw; - nmrData{i}.phase = data.phase; - nmrData{i}.phase_bam = data.phase_bam; - clear data - - % get file statistics - nmrData{i}.datfile = file.name; - nmrData{i}.date = file.date; - nmrData{i}.datenum = file.datenum; - nmrData{i}.bytes = file.bytes; - end + case 'T2' + % find all csv files + files = dir(fullfile(in.path,'*.csv')); + nfiles = numel(files); + nmrData = cell(1,nfiles); + for i = 1:nfiles + % read the data file + data = LoadDataFile(in.path,files(i).name,T1T2flag); - else + % save the NMR data + nmrData{i}.flag = data.flag; + nmrData{i}.T1IRfac = 1; + nmrData{i}.time = data.time; + nmrData{i}.signal = data.signal; + nmrData{i}.raw = data.raw; + nmrData{i}.phase = data.phase; + nmrData{i}.phase_bam = data.phase_bam; + clear data - files = dir(fullfile(in.path,'*.csv')); - nmrData = cell(1,ncsvfiles); - for i = 1:ncsvfiles - % read the data file - data = LoadDataFile(in.path,files(i).name,T1T2flag); - - % save the NMR data - nmrData{i}.flag = data.flag; - nmrData{i}.T1IRfac = 1; - nmrData{i}.time = data.time; - nmrData{i}.signal = data.signal; - nmrData{i}.raw = data.raw; - nmrData{i}.phase = data.phase; - nmrData{i}.phase_bam = data.phase_bam; - clear data - - % get file statistics - nmrData{i}.datfile = files(i).name; - nmrData{i}.date = files(i).date; - nmrData{i}.datenum = files(i).datenum; - nmrData{i}.bytes = files(i).bytes; - end - end + % get file statistics + nmrData{i}.datfile = files(i).name; + nmrData{i}.date = files(i).date; + nmrData{i}.datenum = files(i).datenum; + nmrData{i}.bytes = files(i).bytes; + end end % save data to output struct diff --git a/functions/interface/PhaseView.m b/functions/interface/PhaseView.m index 46243d3..371d116 100644 --- a/functions/interface/PhaseView.m +++ b/functions/interface/PhaseView.m @@ -38,6 +38,7 @@ function PhaseView(src,~) fig = ancestor(src,'figure','toplevel'); nucleus.data = getappdata(fig,'data'); nucleus.gui = getappdata(fig,'gui'); +colors = nucleus.gui.myui.colors; %% proceed if there is data if isfield(nucleus.data,'results') @@ -57,51 +58,60 @@ function PhaseView(src,~) set(fig_phase,'Position',[cent(1)-pos0(3)/3 pos0(2) pos0(3)/1.5 pos0(4)]); % create the layout - gui.main = uix.VBox('Parent',fig_phase,'Spacing',5,'Padding',5); - gui.row1 = uicontainer('Parent',gui.main); % axes real - gui.row2 = uicontainer('Parent',gui.main); % axes imag - gui.row3 = uicontainer('Parent',gui.main); % axes SSE - gui.row4 = uix.HBox('Parent',gui.main,'Spacing',5); % control elements + gui.main = uix.VBox('Parent',fig_phase,'BackGroundColor',colors.panelBG,'Spacing',5,'Padding',5); + gui.row1 = uicontainer('Parent',gui.main,'BackGroundColor',colors.panelBG); % axes real + gui.row2 = uicontainer('Parent',gui.main,'BackGroundColor',colors.panelBG); % axes imag + gui.row3 = uicontainer('Parent',gui.main,'BackGroundColor',colors.panelBG); % axes SSE + gui.row4 = uix.HBox('Parent',gui.main,'BackGroundColor',colors.panelBG,'Spacing',5); % control elements set(gui.main,'Heights',[-1 -1 -1 90]); % all axes - gui.axes_handles.real = axes('Parent',gui.row1); - gui.axes_handles.imag = axes('Parent',gui.row2); - gui.axes_handles.sse = axes('Parent',gui.row3); + gui.axes_handles.real = axes('Parent',gui.row1,... + 'Color',colors.axisBG,'XColor',colors.axisFG,... + 'YColor',colors.axisFG); + gui.axes_handles.imag = axes('Parent',gui.row2,... + 'Color',colors.axisBG,'XColor',colors.axisFG,... + 'YColor',colors.axisFG); + gui.axes_handles.sse = axes('Parent',gui.row3,... + 'Color',colors.axisBG,'XColor',colors.axisFG,... + 'YColor',colors.axisFG); % 3 horizontal boxes uix.Empty('Parent',gui.row4); - gui.vbox1 = uix.VBox('Parent',gui.row4,'Spacing',5,'Padding',5); % control elements + gui.vbox1 = uix.VBox('Parent',gui.row4,'BackGroundColor',colors.panelBG,'Spacing',5,'Padding',5); % control elements uix.Empty('Parent',gui.row4); set(gui.row4,'Widths',[-1 -2 -1]); % edit field - gui.hbox11 = uix.HBox('Parent',gui.vbox1,'Spacing',5); + gui.hbox11 = uix.HBox('Parent',gui.vbox1,'BackGroundColor',colors.panelBG,'Spacing',5); uix.Empty('Parent',gui.hbox11); gui.edit_phase = uicontrol('Parent',gui.hbox11,... 'Style','edit','FontSize',nucleus.gui.myui.fontsize,'Tag','phase',... - 'String',num2str(0),... + 'String',num2str(0),'BackGroundColor',colors.editBG,... + 'ForeGroundColor',colors.panelFG,... 'Callback',@pv_updatePhase); uix.Empty('Parent',gui.hbox11); set(gui.hbox11,'Widths',[-1 -1 -1]); % slider - gui.hbox12 = uix.HBox('Parent',gui.vbox1,'Spacing',5); - gui.hbox121 = uix.HBox('Parent',gui.hbox12,'Spacing',5); + gui.hbox12 = uix.HBox('Parent',gui.vbox1,'BackGroundColor',colors.panelBG,'Spacing',5); + gui.hbox121 = uix.HBox('Parent',gui.hbox12,'BackGroundColor',colors.panelBG,'Spacing',5); gui.text_down = uicontrol('Parent',gui.hbox121,'Style','text',... 'String','down','FontSize',nucleus.gui.myui.fontsize,... + 'BackGroundColor',colors.panelBG,'ForeGroundColor',colors.panelFG,... 'HorizontalAlignment','right'); gui.slider = uicontrol('Parent',gui.hbox12,'Style','slider',... 'Min',-180,'Max',180,'Value',0,'SliderStep',[0.1/360 5/360],... 'Callback',@pv_updateSlider); - gui.hbox122 = uix.HBox('Parent',gui.hbox12,'Spacing',5); + gui.hbox122 = uix.HBox('Parent',gui.hbox12,'BackGroundColor',colors.panelBG,'Spacing',5); gui.text_up = uicontrol('Parent',gui.hbox122,'Style','text',... 'String','up','FontSize',nucleus.gui.myui.fontsize,... + 'BackGroundColor',colors.panelBG,'ForeGroundColor',colors.panelFG,... 'HorizontalAlignment','left'); set(gui.hbox12,'Widths',[-1 -9 -1]); % buttons - gui.hbox13 = uix.HBox('Parent',gui.vbox1,'Spacing',5); + gui.hbox13 = uix.HBox('Parent',gui.vbox1,'BackGroundColor',colors.panelBG,'Spacing',5); uix.Empty('Parent',gui.hbox13); gui.push_default = uicontrol('Parent',gui.hbox13,... 'Style','pushbutton','FontSize',nucleus.gui.myui.fontsize,'Tag','default',... @@ -241,6 +251,9 @@ function pv_showSignal(fig_phase) ax3 = gui.axes_handles.sse; % clear all axes clearAllAxes(fig_phase); +hold(ax1,'on'); +hold(ax2,'on'); +hold(ax3,'on'); plot(data.time,real(data.signal_rot),'Color',gui.myui.colors.RE,'Parent',ax1); plot(data.time,imag(data.signal_rot),'Color',gui.myui.colors.IM,'Parent',ax2); @@ -257,8 +270,7 @@ function pv_showSignal(fig_phase) grid(ax1,'on'); grid(ax2,'on'); -hold(ax2,'on'); -line(get(ax2,'XLim'),[0 0],'LineStyle','--','Color','k','LineWidth',1,'Parent',ax2); +line(get(ax2,'XLim'),[0 0],'LineStyle','--','Color',gui.myui.colors.axisL,'LineWidth',1,'Parent',ax2); hold(ax2,'off'); %residual of current phase angle @@ -270,22 +282,23 @@ function pv_showSignal(fig_phase) set(get(ax1,'XLabel'),'String','time'); set(get(ax1,'YLabel'),'String','\Reeal'); text(0.975,0.8,['\Sigma \epsilon^2 = ',sprintf('%6.5e',sse_r)],... - 'HorizontalAlignment','right','BackgroundColor','w','Units','normalized',... + 'HorizontalAlignment','right','BackgroundColor',gui.myui.colors.axisBG,... + 'Color',gui.myui.colors.panelFG,'Units','normalized',... 'FontSize',12,'Parent',ax1); set(get(ax2,'XLabel'),'String','time'); set(get(ax2,'YLabel'),'String','\Immag'); text(0.975,0.8,['\Sigma \epsilon^2 = ',sprintf('%6.5e',sse_i)],... - 'HorizontalAlignment','right','BackgroundColor','w','Units','normalized',... + 'HorizontalAlignment','right','BackgroundColor',gui.myui.colors.axisBG,... + 'Color',gui.myui.colors.panelFG,'Units','normalized',... 'FontSize',12,'Parent',ax2); -hold(ax3,'on'); ymin = min([-1.*data.sse_r data.sse_i]); ymax = max([-1.*data.sse_r data.sse_i]); plot(data.beta_range-180,-1.*data.sse_r,'Color',gui.myui.colors.RE,'Parent',ax3); plot(data.beta_range-180,data.sse_i,'Color',gui.myui.colors.IM,'Parent',ax3); -line([data.phase data.phase],[ymin ymax],'Color','k','LineStyle','--','Parent',ax3) +line([data.phase data.phase],[ymin ymax],'Color',gui.myui.colors.axisL,'LineStyle','--','Parent',ax3) lgh = legend(ax3,'\Reeal','\Immag','\phi'); -set(lgh,'FontSize',12); +set(lgh,'FontSize',12,'TextColor',gui.myui.colors.panelFG); set(ax3,'XLim',[-180 180],'XTick',-180:30:180); set(ax3,'YLim',[ymin ymax]); diff --git a/functions/interface/calculateGuiOnMonitorPosition.m b/functions/interface/calculateGuiOnMonitorPosition.m index 066f646..c06a830 100644 --- a/functions/interface/calculateGuiOnMonitorPosition.m +++ b/functions/interface/calculateGuiOnMonitorPosition.m @@ -45,7 +45,7 @@ if numel(scr) > 4 % dual screen mode % GUI on second screen - gh = 720; % reference height + gh = 728; % reference height gw = ceil(gh*aspect_ratio); % reference width (1152) if any(scr(:,1)<0) pos = [-sw+(sw-gw)/2 (sh-gh)/3 gw gh]; @@ -61,7 +61,7 @@ if any(scr(:,4)<800) gh = 600; % reference height for small screens else - gh = 720; % reference height + gh = 728; % reference height end gw = ceil(gh*aspect_ratio); % reference width (960) pos = [(sw-gw)/2 (sh-gh)/2 gw gh]; diff --git a/functions/interface/changeColorTheme.m b/functions/interface/changeColorTheme.m index d7103c2..1661a55 100644 --- a/functions/interface/changeColorTheme.m +++ b/functions/interface/changeColorTheme.m @@ -15,7 +15,14 @@ function changeColorTheme(fig_tag,th) % changeColorTheme('INV','basic') % % Other m-files required: -% none +% getColorTheme.m +% makeINIfile.m +% updatePlotsSignal.m +% updatePlotsDistribution.m +% updatePlotsJointInversion.m +% updatePlotsPSD.m +% updatePlotsCPS.m +% updatePlotsNMR.m % % Subfunctions: % none @@ -34,7 +41,6 @@ function changeColorTheme(fig_tag,th) fig = findobj('Tag',fig_tag); gui = getappdata(fig,'gui'); data = getappdata(fig,'data'); -INVdata = getappdata(fig,'INVdata'); myui = gui.myui; % update the colors @@ -43,12 +49,45 @@ function changeColorTheme(fig_tag,th) % switch depending on the calling figure switch fig_tag case 'INV' + INVdata = getappdata(fig,'INVdata'); % update ini-file myui.inidata.colortheme = th; gui.myui = myui; gui = makeINIfile(gui,'update'); + % set the background color for all uicontainer (HBox, VBox, etc.) + h = findall(fig,'-depth',inf,'Type','uicontainer'); + set(h,'BackGroundColor',myui.colors.panelBG); + + % edit field (axes labels) + h = findall(fig,'Type','uicontrol','-and','Style','edit'); + set(h,'BackGroundColor',myui.colors.editBG,'ForeGroundColor',myui.colors.panelFG); + + % axes + h = findall(fig,'Type','Axes'); + set(h,'Color',myui.colors.axisBG,'XColor',myui.colors.axisFG,'YColor',myui.colors.axisFG); + + % text field + h = findobj(fig,'Type','uicontrol','-and','Style','text'); + set(h,'BackGroundColor',myui.colors.panelBG,'ForeGroundColor',myui.colors.panelFG); + + % radio controls + h = findobj(fig,'Type','uicontrol','-and','Style','radiobutton'); + set(h,'BackGroundColor',myui.colors.panelBG,'ForeGroundColor',myui.colors.panelFG); + + % popup controls + h = findobj(fig,'Type','uicontrol','-and','Style','popup'); + set(h,'BackGroundColor',myui.colors.editBG,'ForeGroundColor',myui.colors.panelFG); + + % listbox controls + h = findobj(fig,'Type','uicontrol','-and','Style','listbox'); + set(h,'BackGroundColor',myui.colors.editBG,'ForeGroundColor',myui.colors.panelFG); + + % uitable + h = findobj(fig,'Type','uitable'); + set(h,'BackGroundColor',myui.colors.tableBG,'ForeGroundColor',myui.colors.tableFG); + % update the GUI elements set(gui.panels.data.main,'TitleColor',myui.colors.BoxDAT,... 'ForegroundColor',myui.colors.BoxTitle); @@ -59,38 +98,73 @@ function changeColorTheme(fig_tag,th) set(gui.panels.invstd.main,'TitleColor',myui.colors.BoxINV,... 'ForegroundColor',myui.colors.BoxTitle); set(gui.panels.invjoint.main,'TitleColor',myui.colors.BoxCPS,... - 'ForegroundColor',myui.colors.BoxTitle); - set(gui.plots.SignalPanel,'BackgroundColor',myui.colors.TabSIG); - set(gui.plots.DistPanel,'BackgroundColor',myui.colors.TabDIST); + 'ForegroundColor',myui.colors.BoxTitle,'BackgroundColor',myui.colors.panelBG); + set(gui.panels.invjoint.Tabs,'BackgroundColor',myui.colors.panelBG,... + 'ForeGroundColor',myui.colors.panelFG) + set(gui.plots.SignalPanel,'BackgroundColor',myui.colors.TabSIG,... + 'ForeGroundColor',myui.colors.BoxTitle); + set(gui.plots.DistPanel,'BackgroundColor',myui.colors.TabDIST,... + 'ForeGroundColor',myui.colors.BoxTitle); set(gui.plots.CPSPanel,'TitleColor',myui.colors.BoxCPS,... 'ForegroundColor',myui.colors.BoxTitle); - - % check if there is data and change the colors accordingly + set(gui.panels.info.signal,'BackgroundColor',myui.colors.panelBG,... + 'ForeGroundColor',myui.colors.panelFG); + set(gui.panels.info.dist,'BackgroundColor',myui.colors.panelBG,... + 'ForeGroundColor',myui.colors.panelFG); + set(gui.panels.info.cps,'BackgroundColor',myui.colors.panelBG,... + 'ForeGroundColor',myui.colors.panelFG); + + % update axes gui.myui = myui; setappdata(fig,'gui',gui); if isfield(data,'results') updatePlotsSignal; if isfield(data.results,'invstd') - updatePlotsDistribution; - for i = 1:size(INVdata,1) - if isstruct(INVdata{i}) - % color the background - strL = get(gui.listbox_handles.signal,'String'); - str1 = data.import.NMR.filesShort{i}; - str2 = ['',str1,'']; - strL{i} = str2; - set(gui.listbox_handles.signal,'String',strL); - end - end + updatePlotsDistribution; end if isfield(data.results,'invjoint') updatePlotsJointInversion; end end + % update listbox entries + for i = 1:size(INVdata,1) + if isstruct(INVdata{i}) + % color the background + strL = get(gui.listbox_handles.signal,'String'); + str1 = data.import.NMR.filesShort{i}; + str2 = ['',str1,'']; + strL{i} = str2; + set(gui.listbox_handles.signal,'String',strL); + end + end + + case 'MOD' + % set the background color for all uicontainer (HBox, VBox, etc.) + h = findall(fig,'-depth',inf,'Type','uicontainer'); + set(h,'BackGroundColor',myui.colors.panelBG); + + % edit field (axes labels) + h = findall(fig,'Type','uicontrol','-and','Style','edit'); + set(h,'BackGroundColor',myui.colors.editBG,'ForeGroundColor',myui.colors.panelFG); + + % axes + h = findall(fig,'Type','Axes'); + set(h,'Color',myui.colors.axisBG,'XColor',myui.colors.axisFG,'YColor',myui.colors.axisFG); + + % text field + h = findobj(fig,'Type','uicontrol','-and','Style','text'); + set(h,'BackGroundColor',myui.colors.panelBG,'ForeGroundColor',myui.colors.panelFG); + + % popup controls + h = findobj(fig,'Type','uicontrol','-and','Style','popup'); + set(h,'BackGroundColor',myui.colors.editBG,'ForeGroundColor',myui.colors.panelFG); + + % uitable + h = findobj(fig,'Type','uitable'); + set(h,'BackGroundColor',myui.colors.tableBG,'ForeGroundColor',myui.colors.tableFG); - case 'MOD' % update the GUI elements set(gui.panels.geometry.main,'TitleColor',myui.colors.GEO,... 'ForegroundColor',myui.colors.BoxTitle); @@ -106,6 +180,11 @@ function changeColorTheme(fig_tag,th) 'ForegroundColor',myui.colors.BoxTitle); gui.myui = myui; setappdata(fig,'gui',gui); + + % update the axes + updatePlotsPSD; + updatePlotsCPS; + updatePlotsNMR; end end diff --git a/functions/interface/exportGraphics.m b/functions/interface/exportGraphics.m index 44e2c81..13b195e 100644 --- a/functions/interface/exportGraphics.m +++ b/functions/interface/exportGraphics.m @@ -38,7 +38,7 @@ % get GUI position posf = get(fig,'Position'); % opening the figure -expfig = figure; +expfig = figure('Color',gui.myui.colors.panelBG); % check which layout switch get(gui.menu.file_export_graphics_layout_vert,'Checked') @@ -148,12 +148,15 @@ % add the legend(s) and remove the info lines (CBW etc) from the % distribution plots if isjoint - legend(ax1,'show'); - legend(ax3,'show'); + lgh1 = legend(ax1,'show'); + lgh2 = legend(ax3,'show'); + set(lgh1,'TextColor',gui.myui.colors.panelFG); + set(lgh2,'TextColor',gui.myui.colors.panelFG); h1 = findobj([ax1 ax2 ax3],'Tag','infolines'); h2 = findobj([ax1 ax2 ax3],'Tag','TLGM'); else - legend(ax1,'show'); + lgh = legend(ax1,'show'); + set(lgh,'TextColor',gui.myui.colors.panelFG); h1 = findobj([ax1 ax2],'Tag','infolines'); h2 = findobj([ax1 ax2],'Tag','TLGM'); end @@ -236,7 +239,7 @@ set(ax2,'Position',pos2); set(ax3,'Position',pos3); lh2 = legend(ax2,'show','Location','NorthEast'); - set(lh2,'FontSize',10); + set(lh2,'FontSize',10,'TextColor',gui.myui.colors.panelFG); % adjust the export figure height and axes size switch horzvert diff --git a/functions/interface/getColorTheme.m b/functions/interface/getColorTheme.m index efa03b7..c9630a1 100644 --- a/functions/interface/getColorTheme.m +++ b/functions/interface/getColorTheme.m @@ -49,6 +49,15 @@ colors.RE = [0 114 189]./255; % blue colors.IM = [119 172 48]./255; % green colors.FIT = [217 83 25]./255; % red + colors.editBG = [1 1 1]; % white + colors.panelBG = [0.94 0.94 0.94]; % default grey + colors.panelFG = [0 0 0]; % black + colors.axisBG = [1 1 1]; % white + colors.axisFG = [0.15 0.15 0.15]; % dark grey + colors.axisL = [0.5 0.5 0.5]; % medium grey + colors.tableBG = [1 1 1; 0.94 0.94 0.94]; % default white & grey + colors.tableFG = [0 0 0]; % black + case 'basic' colors.BoxTitle = [1 1 1]; % white colors.BoxDAT = [0.05 0.25 0.5]; % dark blue @@ -56,28 +65,68 @@ colors.BoxPRC = [0.05 0.25 0.5]; % dark blue colors.BoxCPS = [0.05 0.25 0.5]; % dark blue colors.BoxCBW = [0.05 0.25 0.5]; % dark blue - colors.TabSIG = [0.94 0.94 0.94]; % grey - colors.TabDIST = [0.94 0.94 0.94]; % grey + colors.TabSIG = [0.05 0.25 0.5]; % dark blue + colors.TabDIST = [0.05 0.25 0.5]; % dark blue colors.listINV = [0 164 0]./255; % green colors.RE = [0 0 255./255]; % blue colors.IM = [0 164 0]./255; % green colors.FIT = [255 0 0]./255; % red + colors.editBG = [1 1 1]; % white + colors.panelBG = [0.94 0.94 0.94]; % default grey + colors.panelFG = [0 0 0]; % black + colors.axisBG = [1 1 1]; % white + colors.axisFG = [0.15 0.15 0.15]; % dark grey + colors.axisL = [0.5 0.5 0.5]; % medium grey + colors.tableBG = [1 1 1; 0.94 0.94 0.94]; % default white & grey + colors.tableFG = [0 0 0]; % black + case 'dark' + colors.BoxTitle = [0 0 0]; % black + colors.BoxDAT = [222 184 135]./255; % burlywood + colors.BoxINV = [189 183 107]./255; % darkkhaki + colors.BoxPRC = [143 188 143]./255; % darkseagreen + colors.BoxCPS = [100 149 237]./255; % cornflowerblue + colors.BoxCBW = [216 112 147]./255; % palevioletred + colors.TabSIG = [143 188 143]./255; % darkseagreen + colors.TabDIST = [189 183 107]./255; % darkkhaki + colors.listINV = [189 183 107]./255; % darkkhaki + colors.RE = [0 114 189]./255; % blue + colors.IM = [119 172 48]./255; % green + colors.FIT = [217 83 25]./255; % red + colors.editBG = [0.1 0.1 0.1]; % very dark grey + colors.panelBG = [0.2 0.2 0.2]; % black + colors.panelFG = [1 1 1]; % white + colors.axisBG = [0.1 0.1 0.1]; % very dark grey + colors.axisFG = [1 1 1]; % white + colors.axisL = [0.8 0.8 0.8]; % very light grey + colors.tableBG = [0.1 0.1 0.1; 0.2 0.2 0.2]; % default white & grey + colors.tableFG = [1 1 1]; % white + + case 'black' colors.BoxTitle = [1 1 1]; % white colors.BoxDAT = [0.35 0.35 0.35]; % grey colors.BoxINV = [0.35 0.35 0.35]; % grey colors.BoxPRC = [0.35 0.35 0.35]; % grey colors.BoxCPS = [0.35 0.35 0.35]; % grey colors.BoxCBW = [0.35 0.35 0.35]; % grey - colors.TabSIG = [0.94 0.94 0.94]; % grey - colors.TabDIST = [0.94 0.94 0.94]; % grey - colors.listINV = [0 164 0]./255; % green - colors.IM = [0 148 0]./255; % green - colors.RE = [0 0 148]./255; % blue - colors.FIT = [148 0 0]./255; % red - end + colors.TabSIG = [0.35 0.35 0.35]; % grey + colors.TabDIST = [0.35 0.35 0.35]; % grey + colors.listINV = [189 183 107]./255; % darkkhaki + colors.RE = [0 114 189]./255; % blue + colors.IM = [119 172 48]./255; % green + colors.FIT = [217 83 25]./255; % red + colors.editBG = [0 0 0]; % very dark grey + colors.panelBG = [0 0 0]; % black + colors.panelFG = [1 1 1]; % white + colors.axisBG = [0 0 0]; % very dark grey + colors.axisFG = [1 1 1]; % white + colors.axisL = [0.9 0.9 0.9]; % very light grey + colors.tableBG = [0 0 0 ; 0.1 0.1 0.1]; % default white & grey + colors.tableFG = [1 1 1]; % white + + end - case 'MOD' + case 'MOD' % chose selected theme switch th case 'standard' @@ -85,17 +134,61 @@ colors.GEO = [189 183 107]./255; % darkkhaki colors.NMR = [143 188 143]./255; % darkseagreen colors.CPS = [100 149 237]./255; % cornflowerblue + + colors.editBG = [1 1 1]; % white + colors.panelBG = [0.94 0.94 0.94]; % default grey + colors.panelFG = [0 0 0]; % black + colors.axisBG = [1 1 1]; % white + colors.axisFG = [0.15 0.15 0.15]; % dark grey + colors.axisL = [0.3 0.3 0.3]; % medium grey + colors.tableBG = [1 1 1; 0.94 0.94 0.94]; % default white & grey + colors.tableFG = [0 0 0]; % black + case 'basic' colors.BoxTitle = [1 1 1]; % white colors.GEO = [0.05 0.25 0.5]; % dark blue colors.NMR = [0.05 0.25 0.5]; % dark blue colors.CPS = [0.05 0.25 0.5]; % dark blue + + colors.editBG = [1 1 1]; % white + colors.panelBG = [0.94 0.94 0.94]; % default grey + colors.panelFG = [0 0 0]; % black + colors.axisBG = [1 1 1]; % white + colors.axisFG = [0.15 0.15 0.15]; % dark grey + colors.axisL = [0.3 0.3 0.3]; % medium grey + colors.tableBG = [1 1 1; 0.94 0.94 0.94]; % default white & grey + colors.tableFG = [0 0 0]; % black + case 'dark' + colors.BoxTitle = [0 0 0]; % black + colors.GEO = [189 183 107]./255; % darkkhaki + colors.NMR = [143 188 143]./255; % darkseagreen + colors.CPS = [100 149 237]./255; % cornflowerblue + + colors.editBG = [0.1 0.1 0.1]; % very dark grey + colors.panelBG = [0.2 0.2 0.2]; % black + colors.panelFG = [1 1 1]; % white + colors.axisBG = [0.15 0.15 0.15]; % dark grey + colors.axisFG = [1 1 1]; % white + colors.axisL = [0.9 0.9 0.9]; % very light grey + colors.tableBG = [0.1 0.1 0.1; 0.2 0.2 0.2]; % default white & grey + colors.tableFG = [1 1 1]; % white + + case 'black' colors.BoxTitle = [1 1 1]; % white colors.GEO = [0.35 0.35 0.35]; % grey colors.NMR = [0.35 0.35 0.35]; % grey colors.CPS = [0.35 0.35 0.35]; % grey - end + + colors.editBG = [0 0 0]; % very dark grey + colors.panelBG = [0 0 0]; % black + colors.panelFG = [1 1 1]; % white + colors.axisBG = [0 0 0]; % dark grey + colors.axisFG = [1 1 1]; % white + colors.axisL = [0.9 0.9 0.9]; % very light grey + colors.tableBG = [0 0 0; 0.1 0.1 0.1]; % default white & grey + colors.tableFG = [1 1 1]; % white + end end end diff --git a/functions/interface/importCalibrationData.m b/functions/interface/importCalibrationData.m new file mode 100644 index 0000000..11a8700 --- /dev/null +++ b/functions/interface/importCalibrationData.m @@ -0,0 +1,97 @@ +function importCalibrationData +%importCalibrationdata imports previously saved calibration data for +%porosity determination +% +% Syntax: +% importCalibrationdata +% +% Inputs: +% none +% +% Outputs: +% none +% +% Example: +% importCalibrationdata +% +% Other m-files required: +% displayStatusText +% NUCLEUSinv_updateInterface +% +% Subfunctions: +% none +% +% MAT-files required: +% none +% +% See also: NUCLEUSinv +% Author: Thomas Hiller +% email: thomas.hiller[at]leibniz-liag.de +% License: MIT License (at end) + +%------------- BEGIN CODE -------------- + +%% get GUI handle and data +fig = findobj('Tag','INV'); +gui = getappdata(fig,'gui'); +data = getappdata(fig,'data'); + +% get file name +CALIBpath = -1; +CALIBfile = -1; +if isfield(data.import,'path') + [CALIBfile,CALIBpath] = uigetfile(fullfile(data.import.path,'*.mat'),... + 'Choose Calibration file'); +else + [CALIBfile,CALIBpath] = uigetfile(fullfile(pwd,'*.mat'),... + 'Choose Calibration file'); +end + +% only continue if user didn't cancel +if sum([CALIBpath CALIBfile]) > 0 + + indata = load(fullfile(CALIBpath,CALIBfile),'calib'); + if isfield(indata,'calib') + % update the GUI data fields + data.calib = indata.calib; + data.param.calibV = data.calib.vol; + data.param.useporosity = 1; + + % update the GUI data + setappdata(fig,'data',data); + NUCLEUSinv_updateInterface; + + % show info message + displayStatusText(gui,'Calibration data successfully imported'); + else + helpdlg({'function: importCalibrationdata',... + 'No calibration data in this file.'},'No calibration data'); + end +end + +end + +%------------- END OF CODE -------------- + +%% License: +% MIT License +% +% Copyright (c) 2018 Thomas Hiller +% +% Permission is hereby granted, free of charge, to any person obtaining a copy +% of this software and associated documentation files (the "Software"), to deal +% in the Software without restriction, including without limitation the rights +% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +% copies of the Software, and to permit persons to whom the Software is +% furnished to do so, subject to the following conditions: +% +% The above copyright notice and this permission notice shall be included in all +% copies or substantial portions of the Software. +% +% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +% SOFTWARE. \ No newline at end of file diff --git a/functions/interface/importNMRdata.m b/functions/interface/importNMRdata.m index d777d99..e8dbe72 100644 --- a/functions/interface/importNMRdata.m +++ b/functions/interface/importNMRdata.m @@ -495,22 +495,73 @@ function importNMRdata(src) nslices = out.parData.nSlices; ncsvfiles = numel(fnames); - if nslices == ncsvfiles - % create z-vector - p = out.parData; - zslice = linspace(p.startPos,p.endPos,p.nSlices)'; - data.import.BAM.use_z = true; - data.import.BAM.zslice = zslice; - if numel(zslice) > 1 - for i = 1:numel(zslice) - tmp = shownames{i}; - shownames{i} = [tmp,' z:',sprintf('%5.4f',zslice(i))]; + % check for background file ("Leermessung") + has_bg = false; + for i = 1:numel(fnames) + if ~isempty(strfind(fnames(i).datafile,'000')) + has_bg = true; + index_bg = i; + break; + end + end + + if has_bg + % background data set + bg = data.import.NMR.data{index_bg}; + + % vector of indices of the files that get corrected + ind_files = 1:1:ncsvfiles; + ind_files(ind_files==index_bg) = []; + + for i = ind_files + % subtract the background signal + s = data.import.NMR.data{i}.signal; + s_bg = bg.signal; + s(1:numel(s_bg)) = complex( real(s(1:numel(s_bg)))-... + real(s_bg),imag(s(1:numel(s_bg)))-imag(s_bg) ); + % update original data set + data.import.NMR.data{i}.signal = s; + end + + % check if the number of slices is equal to the number of files + % (excluding the background file) + if nslices == numel(ind_files) + % create z-vector + p = out.parData; + zslice = linspace(p.startPos,p.endPos,p.nSlices)'; + data.import.BAM.use_z = true; + data.import.BAM.zslice = zslice; + if numel(zslice) > 1 + c = 0; + for i = ind_files + c = c + 1; + tmp = shownames{i}; + shownames{i} = [tmp,' z:',sprintf('%5.4f',zslice(c))]; + end end + else + data.import.BAM.use_z = false; + data.import.BAM.zslice = 1:1:max([numel(ind_files) 1]); end + else - data.import.BAM.use_z = false; - data.import.BAM.zslice = 1:1:ncsvfiles; - end + if nslices == ncsvfiles + % create z-vector + p = out.parData; + zslice = linspace(p.startPos,p.endPos,p.nSlices)'; + data.import.BAM.use_z = true; + data.import.BAM.zslice = zslice; + if numel(zslice) > 1 + for i = 1:numel(zslice) + tmp = shownames{i}; + shownames{i} = [tmp,' z:',sprintf('%5.4f',zslice(i))]; + end + end + else + data.import.BAM.use_z = false; + data.import.BAM.zslice = 1:1:ncsvfiles; + end + end end % update the global data structure diff --git a/functions/interface/onFigureSizeChange.m b/functions/interface/onFigureSizeChange.m index 81f85a3..8f7d6a6 100644 --- a/functions/interface/onFigureSizeChange.m +++ b/functions/interface/onFigureSizeChange.m @@ -69,6 +69,9 @@ function onFigureSizeChange(fig,~) end end +% check that the GUI is not smaller than the minimum size +set(fig, 'position', max([0 0 610 358], fig.Position)); + end %------------- END OF CODE -------------- diff --git a/functions/interface/runInversionBatch.m b/functions/interface/runInversionBatch.m index a976f0f..956743d 100644 --- a/functions/interface/runInversionBatch.m +++ b/functions/interface/runInversionBatch.m @@ -19,7 +19,7 @@ % fitDataFree % fitDataFree_fmin % fitDataInvLaplace -% fitDataNNLS +% fitDataLSQ % onPushRun % onPushStop % processNMRDataControl @@ -107,7 +107,7 @@ flag = data.results.nmrproc.T1T2; param.T1IRfac = data.results.nmrproc.T1IRfac; param.noise = data.results.nmrproc.noise; - param.optim = data.info.optim; + param.optim = data.info.has_optim; if isfield(data.results.nmrproc,'W') param.W = data.results.nmrproc.W; end @@ -119,7 +119,7 @@ flag = data.results.nmrproc.T1T2; param.T1IRfac = data.results.nmrproc.T1IRfac; param.noise = data.results.nmrproc.noise; - param.optim = data.info.optim; + param.optim = data.info.has_optim; if isfield(data.results.nmrproc,'W') param.W = data.results.nmrproc.W; end @@ -136,12 +136,12 @@ param.Lorder = data.invstd.Lorder; param.lambda = data.invstd.lambda; param.noise = data.results.nmrproc.noise; - param.optim = data.info.optim; + param.solver = data.info.solver; if isfield(data.results.nmrproc,'W') param.W = data.results.nmrproc.W; end - invstd = fitDataNNLS(data.results.nmrproc.t,... + invstd = fitDataLSQ(data.results.nmrproc.t,... data.results.nmrproc.s,param); case 'ILA' diff --git a/functions/interface/runInversionStd.m b/functions/interface/runInversionStd.m index 69f76fb..a137d83 100644 --- a/functions/interface/runInversionStd.m +++ b/functions/interface/runInversionStd.m @@ -21,7 +21,7 @@ % fitDataFree % fitDataFree_fmin % fitDataInvLaplace -% fitDataNNLS +% fitDataLSQ % getLambdaFromLCurve % NUCLEUSinv_updateInterface % onPushRun @@ -110,7 +110,7 @@ if isfield(data.results.nmrproc,'W') param.W = data.results.nmrproc.W; end - param.optim = data.info.optim; + param.solver = data.info.solver; % status bar information infostring = 'L-curve calculation ... '; @@ -138,7 +138,7 @@ % if "UserData" is 1 STOP was not pressed -> continue if get(gui.push_handles.invstd_run,'UserData') == 1 param.lambda = lambda_range(i); - invdata = fitDataNNLS(data.results.nmrproc.t,data.results.nmrproc.s,param); + invdata = fitDataLSQ(data.results.nmrproc.t,data.results.nmrproc.s,param); % output data RMS(i) = invdata.rms; RN(i) = invdata.rn; @@ -200,7 +200,7 @@ if isfield(data.results.nmrproc,'W') param.W = data.results.nmrproc.W; end - param.optim = data.info.optim; + param.solver = data.info.solver; % status bar information infostring = 'Chi2 iteration ... '; @@ -214,7 +214,7 @@ chi2 = [0 0]; for i = 1:length(lambda_range) param.lambda = lambda_range(i); - invdata = fitDataNNLS(data.results.nmrproc.t,data.results.nmrproc.s,param); + invdata = fitDataLSQ(data.results.nmrproc.t,data.results.nmrproc.s,param); % output data chi2(i) = invdata.chi2; end @@ -234,7 +234,7 @@ iter = iter + 1; param.lambda = lam; - invdata = fitDataNNLS(data.results.nmrproc.t,data.results.nmrproc.s,param); + invdata = fitDataLSQ(data.results.nmrproc.t,data.results.nmrproc.s,param); % output data c = invdata.chi2; @@ -321,12 +321,12 @@ flag = data.results.nmrproc.T1T2; param.T1IRfac = data.results.nmrproc.T1IRfac; param.noise = data.results.nmrproc.noise; - param.optim = data.info.optim; + param.optim = data.info.has_optim; if isfield(data.results.nmrproc,'W') param.W = data.results.nmrproc.W; end % status bar information - switch data.info.optim + switch data.info.has_optim case 'on' infostring = 'Inversion using ''Optimization Toolbox'' ... '; case 'off' @@ -340,12 +340,12 @@ flag = data.results.nmrproc.T1T2; param.T1IRfac = data.results.nmrproc.T1IRfac; param.noise = data.results.nmrproc.noise; - param.optim = data.info.optim; + param.optim = data.info.has_optim; if isfield(data.results.nmrproc,'W') param.W = data.results.nmrproc.W; end % status bar information - switch data.info.optim + switch data.info.has_optim case 'on' infostring = 'Inversion using ''Optimization Toolbox'' ... '; case 'off' @@ -383,20 +383,20 @@ param.Lorder = data.invstd.Lorder; param.lambda = data.invstd.lambda; param.noise = data.results.nmrproc.noise; - param.optim = data.info.optim; + param.solver = data.info.solver; if isfield(data.results.nmrproc,'W') param.W = data.results.nmrproc.W; end % status bar information - switch data.info.optim - case 'on' + switch data.info.solver + case 'lsqlin' infostring = 'Inversion using ''Optimization Toolbox'' ... '; - case 'off' + case 'lsqnonneg' infostring = 'Inversion using ''lsqnonneg'' ... '; end displayStatusText(gui,infostring); - invstd = fitDataNNLS(data.results.nmrproc.t,... + invstd = fitDataLSQ(data.results.nmrproc.t,... data.results.nmrproc.s,param); end % normalize to 1 diff --git a/functions/interface/showExtraGraphics.m b/functions/interface/showExtraGraphics.m index e61e044..8aa5f73 100644 --- a/functions/interface/showExtraGraphics.m +++ b/functions/interface/showExtraGraphics.m @@ -42,6 +42,8 @@ function showExtraGraphics(method) if foundINV + try + % find the first INVdata set for id = 1:size(INVdata,1) if isstruct(INVdata{id}) @@ -230,6 +232,12 @@ function showExtraGraphics(method) f = figure; ax = axes('Parent',f); hold(ax,'on') + + % remove the backgound file + Tspec(isnan(Tspec)) = []; + xi = numel(Tspec)/numel(Tt); + Tspec = reshape(Tspec,[xi numel(Tt)]); + surf(xx,yy,zeros(size(xx)),Tspec./max(Tspec(:)),'Parent',ax); shading(ax,'flat'); xticks = log10(min(Tt)):1:log10(max(Tt)); @@ -257,6 +265,13 @@ function showExtraGraphics(method) 'Invert NMR data first.'); end end + + catch ME + % show error message in case import fails + errmsg = {ME.message;[ME.stack(1).name,' Line: ',num2str(ME.stack(1).line)];... + 'Cannot show figure.'}; + errordlg(errmsg,'showExtraGraphics: Error!'); + end else helpdlg({'function: showExtraGraphics',... 'Cannot continue because there need to be at least two NMR measurements.'},... diff --git a/functions/interface/showFitStatistics.m b/functions/interface/showFitStatistics.m index 172e433..91151f5 100644 --- a/functions/interface/showFitStatistics.m +++ b/functions/interface/showFitStatistics.m @@ -34,6 +34,7 @@ fig_tag = get(fig,'Tag'); data = getappdata(fig,'data'); maingui = getappdata(fig,'gui'); +colors = maingui.myui.colors; %% proceed if there is data if isfield(data,'results') @@ -53,70 +54,90 @@ set(fig_stat,'Position',[cent(1)-pos0(3)/3 pos0(2) pos0(3)/1.5 pos0(4)]); % create the layout - gui.main = uix.VBox('Parent',fig_stat,'Spacing',10,'Padding',10); - gui.row1 = uicontainer('Parent',gui.main); % axes Im - gui.row2 = uicontainer('Parent',gui.main); % axes res - gui.row3 = uix.HBox('Parent',gui.main); % histogram + text + gui.main = uix.VBox('Parent',fig_stat,'BackGroundColor',colors.panelBG,'Spacing',10,'Padding',10); + gui.row1 = uicontainer('Parent',gui.main,'BackGroundColor',colors.panelBG); % axes Im + gui.row2 = uicontainer('Parent',gui.main,'BackGroundColor',colors.panelBG); % axes res + gui.row3 = uix.HBox('Parent',gui.main,'BackGroundColor',colors.panelBG); % histogram + text set(gui.main,'Heights',[-1 -1 -1.5]); % Im and res axes - gui.axes_handles.imag = axes('Parent',gui.row1); - gui.axes_handles.err = axes('Parent',gui.row2); + gui.axes_handles.imag = axes('Parent',gui.row1,... + 'Color',colors.axisBG,'XColor',colors.axisFG,... + 'YColor',colors.axisFG); + gui.axes_handles.err = axes('Parent',gui.row2,... + 'Color',colors.axisBG,'XColor',colors.axisFG,... + 'YColor',colors.axisFG); uix.Empty('Parent',gui.row3); - gui.box1 = uicontainer('Parent',gui.row3); % histogram axes - gui.box2 = uix.VBox('Parent',gui.row3,'Padding',10,'Spacing',5); % text + gui.box1 = uicontainer('Parent',gui.row3,... + 'BackGroundColor',colors.panelBG); % histogram axes + gui.box2 = uix.VBox('Parent',gui.row3,... + 'BackGroundColor',colors.panelBG,'Padding',10,'Spacing',5); % text uix.Empty('Parent',gui.row3); set(gui.row3,'Widths',[40 -1 300 60]); % histogram axes - gui.axes_handles.hist = axes('Parent',gui.box1); + gui.axes_handles.hist = axes('Parent',gui.box1,... + 'Color',colors.axisBG,'XColor',colors.axisFG,... + 'YColor',colors.axisFG); % all text boxes uix.Empty('Parent',gui.box2); - gui.row31 = uix.HBox('Parent',gui.box2,'Spacing',10); - gui.row32 = uix.HBox('Parent',gui.box2,'Spacing',10); - gui.row33 = uix.HBox('Parent',gui.box2,'Spacing',10); - gui.row34 = uix.HBox('Parent',gui.box2,'Spacing',10); - gui.row35 = uix.HBox('Parent',gui.box2,'Spacing',10); - gui.row36 = uix.HBox('Parent',gui.box2,'Spacing',10); + gui.row31 = uix.HBox('Parent',gui.box2,'BackGroundColor',colors.panelBG,'Spacing',10); + gui.row32 = uix.HBox('Parent',gui.box2,'BackGroundColor',colors.panelBG,'Spacing',10); + gui.row33 = uix.HBox('Parent',gui.box2,'BackGroundColor',colors.panelBG,'Spacing',10); + gui.row34 = uix.HBox('Parent',gui.box2,'BackGroundColor',colors.panelBG,'Spacing',10); + gui.row35 = uix.HBox('Parent',gui.box2,'BackGroundColor',colors.panelBG,'Spacing',10); + gui.row36 = uix.HBox('Parent',gui.box2,'BackGroundColor',colors.panelBG,'Spacing',10); uix.Empty('Parent',gui.box2); - set(gui.box2,'Heights',[50 -1 -1 -1 -1 -1 -1 50]); + set(gui.box2,'Heights',[-1 -1 -1 -1 -1 -1 -1 -1]); gui.text11 = uicontrol('Parent',gui.row31,'Style','text',... 'String',[char(hex2dec('03BC')),'(',char(hex2dec('2111')),'mag)'],... - 'FontSize',maingui.myui.fontsize+4,'HorizontalAlignment','right'); + 'FontSize',maingui.myui.fontsize+4,'HorizontalAlignment','right',... + 'BackGroundColor',colors.panelBG,'ForeGroundColor',colors.panelFG); gui.text12 = uicontrol('Parent',gui.row31,'Style','edit','String','',... - 'FontSize',maingui.myui.fontsize); + 'FontSize',maingui.myui.fontsize,'BackGroundColor',colors.editBG,... + 'ForeGroundColor',colors.panelFG); gui.text21 = uicontrol('Parent',gui.row32,'Style','text',... 'String',[char(hex2dec('03BC')),'(',char(hex2dec('03B5')),')'],... - 'FontSize',maingui.myui.fontsize+4,'HorizontalAlignment','right'); + 'FontSize',maingui.myui.fontsize+4,'HorizontalAlignment','right',... + 'BackGroundColor',colors.panelBG,'ForeGroundColor',colors.panelFG); gui.text22 = uicontrol('Parent',gui.row32,'Style','edit','String','',... - 'FontSize',maingui.myui.fontsize); + 'FontSize',maingui.myui.fontsize,'BackGroundColor',colors.editBG,... + 'ForeGroundColor',colors.panelFG); gui.text31 = uicontrol('Parent',gui.row33,'Style','text',... 'String',[char(hex2dec('03C3')),'(',char(hex2dec('2111')),'mag)'],... - 'FontSize',maingui.myui.fontsize+4,'HorizontalAlignment','right'); + 'FontSize',maingui.myui.fontsize+4,'HorizontalAlignment','right',... + 'BackGroundColor',colors.panelBG,'ForeGroundColor',colors.panelFG); gui.text32 = uicontrol('Parent',gui.row33,'Style','edit','String','',... - 'FontSize',maingui.myui.fontsize); + 'FontSize',maingui.myui.fontsize,'BackGroundColor',colors.editBG,... + 'ForeGroundColor',colors.panelFG); gui.text41 = uicontrol('Parent',gui.row34,'Style','text',... 'String',[char(hex2dec('03C3')),'(',char(hex2dec('03B5')),')'],... - 'FontSize',maingui.myui.fontsize+4,'HorizontalAlignment','right'); + 'FontSize',maingui.myui.fontsize+4,'HorizontalAlignment','right',... + 'BackGroundColor',colors.panelBG,'ForeGroundColor',colors.panelFG); gui.text42 = uicontrol('Parent',gui.row34,'Style','edit','String','',... - 'FontSize',maingui.myui.fontsize); + 'FontSize',maingui.myui.fontsize,'BackGroundColor',colors.editBG,... + 'ForeGroundColor',colors.panelFG); gui.text51 = uicontrol('Parent',gui.row35,'Style','text',... 'String',[char(hex2dec('03A7')),char(hex2dec('0B2'))],... - 'FontSize',maingui.myui.fontsize+4,'HorizontalAlignment','right'); + 'FontSize',maingui.myui.fontsize+4,'HorizontalAlignment','right',... + 'BackGroundColor',colors.panelBG,'ForeGroundColor',colors.panelFG); gui.text52 = uicontrol('Parent',gui.row35,'Style','edit','String','',... - 'FontSize',maingui.myui.fontsize); + 'FontSize',maingui.myui.fontsize,'BackGroundColor',colors.editBG,... + 'ForeGroundColor',colors.panelFG); gui.text61 = uicontrol('Parent',gui.row36,'Style','text','String','RMS',... - 'FontSize',maingui.myui.fontsize+4,'HorizontalAlignment','right'); + 'FontSize',maingui.myui.fontsize+4,'HorizontalAlignment','right',... + 'BackGroundColor',colors.panelBG,'ForeGroundColor',colors.panelFG); gui.text62 = uicontrol('Parent',gui.row36,'Style','edit','String','',... - 'FontSize',maingui.myui.fontsize); + 'FontSize',maingui.myui.fontsize,'BackGroundColor',colors.editBG,... + 'ForeGroundColor',colors.panelFG); % Java Hack to adjust vertical alignment of text fields jh = findjobj(gui.text11); jh.setVerticalAlignment(javax.swing.JLabel.CENTER); @@ -138,6 +159,9 @@ ax3 = gui.axes_handles.hist; % clear all axes clearAllAxes(fig_stat); + hold(ax1,'on'); + hold(ax2,'on'); + hold(ax3,'on'); %% gather the fit statistics for the current inversion text = cell(1,1); @@ -151,9 +175,9 @@ lgdc = 0; % plot imaginary part if ~isreal(nmrraw.s) - plot(nmrraw.t,imag(nmrraw.s),'Color',maingui.myui.colors.IM,'Parent',ax1); + plot(nmrraw.t,imag(nmrraw.s),'Color',colors.IM,'Parent',ax1); xlims = get(maingui.axes_handles.raw,'XLim'); - line(xlims,[0 0],'LineStyle','--','LineWidth',1,'Color','k','Parent',ax1); + line(xlims,[0 0],'LineStyle','--','Color',colors.axisL,'Parent',ax1); % get statistics imag_mean = mean(imag(nmrraw.s)); imag_std = std(imag(nmrraw.s)); @@ -175,7 +199,8 @@ n1 = n1./trapz(bins1,n1); stairs(bins1,n1,'Color',maingui.myui.colors.IM,'LineWidth',1.5,'Parent',ax3); hold(ax3,'on'); - line([mean(imag(nmrraw.s)) mean(imag(nmrraw.s))],[0 max(n1)],... + line(xlims,[imag_mean imag_mean],'LineStyle','--','Color','g','Parent',ax1); + line([imag_mean imag_mean],[0 max(n1)],... 'color','g','LineStyle','--','Parent',ax3); lgdc = lgdc + 1; @@ -193,20 +218,23 @@ if nmrproc.noise > 0 plot(nmrproc.t,invstd.residual./nmrproc.e,'Parent',ax2); % get statistics - err_mean = mean(invstd.residual./nmrproc.e); - err_std = std(invstd.residual./nmrproc.e); + residual = invstd.residual./nmrproc.e; + err_mean = mean(residual); + err_std = std(residual); else plot(nmrproc.t,invstd.residual,'Parent',ax2); % get statistics - err_mean = mean(invstd.residual); - err_std = std(invstd.residual); + residual = invstd.residual; + err_mean = mean(residual); + err_std = std(residual); end xlims = get(maingui.axes_handles.proc,'XLim'); - line(xlims,[0 0],'LineStyle','--','LineWidth',1,'Color','k','Parent',ax2); + line(xlims,[0 0],'LineStyle','--','Color',colors.axisL,'Parent',ax2); + line(xlims,[err_mean err_mean],'LineStyle','--','Color','b','Parent',ax2); if nmrproc.noise > 0 - line(xlims,[-1 -1],'LineStyle','-.','LineWidth',1,'Color','k','Parent',ax2); - line(xlims,[1 1],'LineStyle','-.','LineWidth',1,'Color','k','Parent',ax2); + line(xlims,[-1 -1],'LineStyle','-.','LineWidth',1,'Color',colors.axisL,'Parent',ax2); + line(xlims,[1 1],'LineStyle','-.','LineWidth',1,'Color',colors.axisL,'Parent',ax2); line(xlims,[err_mean-err_std err_mean-err_std],... 'LineStyle','--','LineWidth',1,'Color','r','Parent',ax2); line(xlims,[err_mean+err_std err_mean+err_std],... @@ -250,10 +278,10 @@ bins2 = linspace(min2,max2,100); n2 = hist(invstd.residual,bins2); n2 = n2./trapz(bins2,n2); - stairs(bins2,n2,'Parent',ax3); + stairs(bins2,n2,'LineWidth',1.5,'Parent',ax3); line([mean(invstd.residual) mean(invstd.residual)],[0 max(n2)],... 'color','b','LineStyle','--','Parent',ax3); - set(get(ax3,'XLabel'),'String','\Immag | \epsilon'); + set(get(ax3,'XLabel'),'String','\Immag & \epsilon'); set(get(ax3,'YLabel'),'String','count'); grid(ax3,'on'); @@ -263,7 +291,7 @@ lgdstr{lgdc} = '\mu(\epsilon)'; end lgh = legend(ax3,lgdstr); - set(lgh,'FontSize',12); + set(lgh,'FontSize',12,'TextColor',colors.panelFG); set(ax1,'FontSize',maingui.myui.fontsize); set(ax2,'FontSize',maingui.myui.fontsize); @@ -287,7 +315,7 @@ %------------- END OF CODE -------------- -%% License: +% License: % MIT License % % Copyright (c) 2018 Thomas Hiller diff --git a/functions/interface/showParameterInfo.m b/functions/interface/showParameterInfo.m index 86c4872..285810b 100644 --- a/functions/interface/showParameterInfo.m +++ b/functions/interface/showParameterInfo.m @@ -55,7 +55,7 @@ end end f1 = figure('Name',[fname,' Parameter Info'],'NumberTitle','off',... - 'ToolBar','none','MenuBar','none'); + 'ToolBar','none','MenuBar','none','Color',gui.myui.colors.panelBG); pos0 = get(fig,'Position'); pos1 = get(f1,'Position'); cent(1) = (pos0(1)+pos0(3)/2); @@ -67,6 +67,8 @@ pos = get(f1,'Position'); w = (pos(3)-80)/2; set(th,'Position',[20 20 pos(3)-40 pos(4)-40],'ColumnWidth',{w w}); + set(th,'BackGroundColor',gui.myui.colors.tableBG,... + 'ForeGroundColor',gui.myui.colors.tableFG) end else helpdlg({'function: showParameterInfo',... diff --git a/functions/interface/switchToolTips.m b/functions/interface/switchToolTips.m index b2b8e8c..86aea19 100644 --- a/functions/interface/switchToolTips.m +++ b/functions/interface/switchToolTips.m @@ -2,17 +2,17 @@ function switchToolTips(gui,onoff) %#ok %switchToolTips switches GUI tool tips either "on" or "off" % % Syntax: -% gui = switchToolTips(gui,onoff) +% switchToolTips(gui,onoff) % % Inputs: % gui - figure gui elements structure % onoff - 'on' or 'off' % % Outputs: -% gui +% none % % Example: -% gui = switchToolTips(gui,'on') +% switchToolTips(gui,'on') % % Other m-files required: % none diff --git a/functions/interface/updatePlotsCPS.m b/functions/interface/updatePlotsCPS.m index 5627ecc..e855dca 100644 --- a/functions/interface/updatePlotsCPS.m +++ b/functions/interface/updatePlotsCPS.m @@ -33,6 +33,7 @@ fig = findobj('Tag','MOD'); gui = getappdata(fig,'gui'); data = getappdata(fig,'data'); +colors = gui.myui.colors; % only proceed if there is cps data if isfield(data.results,'SAT') @@ -44,6 +45,7 @@ set(ph,'HandleVisibility','on') end cla(ax); + hold(ax,'on'); % get pressure SAT = data.results.SAT; @@ -52,8 +54,8 @@ % plot the cps data hold(ax,'on'); - plot(plotpress,SAT.Sdfull,'k-','LineWidth',2,'Parent',ax); - plot(plotpress,SAT.Sifull,'k--','LineWidth',2,'Parent',ax); + plot(plotpress,SAT.Sdfull,'-','Color',colors.axisL,'LineWidth',2,'Parent',ax); + plot(plotpress,SAT.Sifull,'--','Color',colors.axisL,'LineWidth',2,'Parent',ax); % depending on the pressure spacing adjust the x-axis switch data.pressure.loglin @@ -72,7 +74,8 @@ % labels and legend set(get(ax,'XLabel'),'String',xlstring); set(get(ax,'YLabel'),'String','saturation [-]'); - legend(ax,'drain','imb','Location','best') + lgh = legend(ax,'drain','imb','Location','best'); + set(lgh,'TextColor',colors.panelFG,'Color',colors.axisBG); % update GUI data setappdata(fig,'gui',gui); % now add the saturation level points on the curves diff --git a/functions/interface/updatePlotsDistribution.m b/functions/interface/updatePlotsDistribution.m index b01ad39..50496ee 100644 --- a/functions/interface/updatePlotsDistribution.m +++ b/functions/interface/updatePlotsDistribution.m @@ -119,7 +119,7 @@ 'LineWidth',2,'Parent',ax); % find approx. TLGM amplitude amp = findApproxTlgmAmplitude(invstd.T1T2me,F,invstd.Tlgm); - stem(invstd.Tlgm,amp,'x-','Color',[0.3 0.3 0.3],... + stem(invstd.Tlgm,amp,'x-','Color',col.axisL,... 'LineWidth',2,'Tag','TLGM','Parent',ax); % y-limits @@ -132,7 +132,7 @@ 'LineWidth',2,'Parent',ax); % find approx. TLGM amplitude amp = findApproxTlgmAmplitude(invstd.T1T2me,cumsum(F),invstd.Tlgm); - stem(invstd.Tlgm,amp,'x-','Color',[0.3 0.3 0.3],... + stem(invstd.Tlgm,amp,'x-','Color',col.axisL,... 'LineWidth',2,'Tag','TLGM','Parent',ax); % y-limits diff --git a/functions/interface/updatePlotsDistributionInfo.m b/functions/interface/updatePlotsDistributionInfo.m index 976ae24..199f4e8 100644 --- a/functions/interface/updatePlotsDistributionInfo.m +++ b/functions/interface/updatePlotsDistributionInfo.m @@ -35,8 +35,8 @@ gui = getappdata(fig,'gui'); data = getappdata(fig,'data'); -% default color is grey -col = [0.5 0.5 0.5]; +% default color +col = gui.myui.colors.axisL; %% CUT OFF info % RTD axis diff --git a/functions/interface/updatePlotsGeometryType.m b/functions/interface/updatePlotsGeometryType.m index 09fb46e..3782325 100644 --- a/functions/interface/updatePlotsGeometryType.m +++ b/functions/interface/updatePlotsGeometryType.m @@ -33,9 +33,11 @@ function updatePlotsGeometryType(ax) fig = findobj('Tag','MOD'); gui = getappdata(fig,'gui'); data = getappdata(fig,'data'); +colors = gui.myui.colors; % clear the current axis cla(ax); +hold(ax,'on'); % check the geometry type and plot the cross-sectional shape if strcmp(data.geometry.type,'cyl') == 1 % cylindrical @@ -43,7 +45,7 @@ function updatePlotsGeometryType(ax) phi = linspace(0,2*pi,360); x = r.*cos(phi); y = r.*sin(phi); - plot(x,y,'k-','LineWidth',2,'Parent',ax); + plot(x,y,'-','Color',colors.axisL,'LineWidth',2,'Parent',ax); else % right angular & % polygonal if numel(data.results.psddata.psd) == 1 P = data.results.GEOM.Points; @@ -51,7 +53,7 @@ function updatePlotsGeometryType(ax) P = squeeze(data.results.GEOM.Points(1,:,:)); end patch('Vertices',P,'Faces',1:1:size(P,1),'FaceColor','none',... - 'FaceAlpha',0,'EdgeColor','k','LineWidth',2,'Parent',ax); + 'FaceAlpha',0,'EdgeColor',colors.axisL,'LineWidth',2,'Parent',ax); end % axis settings diff --git a/functions/interface/updatePlotsJointInversion.m b/functions/interface/updatePlotsJointInversion.m index 6869368..d1ef415 100644 --- a/functions/interface/updatePlotsJointInversion.m +++ b/functions/interface/updatePlotsJointInversion.m @@ -173,18 +173,19 @@ set(get(ax,'YLabel'),'String','amplitude [a.u.]'); % legend - legend(ax,lgdstr,'Location','NorthEast','Tag','alllegend','FontSize',10); + lgh = legend(ax,lgdstr,'Location','NorthEast','Tag','alllegend'); + set(lgh,'FontSize',10,'TextColor',col.panelFG); % grid grid(ax,'on'); %% residual plot xlims = get(ax,'XLim'); - line(xlims,[0 0],'LineStyle','--','LineWidth',1,'Color','k','Parent',axE); + line(xlims,[0 0],'LineStyle','--','LineWidth',1,'Color',col.axisL,'Parent',axE); if nmr{levels(1)}.noise > 0 line(xlims,[-1 -1],'LineStyle','-.','LineWidth',1,... - 'Color','k','Parent',axE); + 'Color',col.axisL,'Parent',axE); line(xlims,[1 1],'LineStyle','-.','LineWidth',1,... - 'Color','k','Parent',axE); + 'Color',col.axisL,'Parent',axE); set(axE,'XTickLabel',''); set(axE,'YLim',[-max(abs(ylimsE)) max(abs(ylimsE))]); set(axE,'YTickMode','auto','YTickLabelMode','auto'); @@ -285,7 +286,8 @@ set(get(ax,'XLabel'),'String',xlstring); % legend - legend(ax,lgdstr,'Location','NorthEast','Tag','psdjlegend','FontSize',10); + lgh = legend(ax,lgdstr,'Location','NorthEast','Tag','psdjlegend'); + set(lgh,'FontSize',10,'TextColor',col.panelFG); % grid grid(ax,'on'); @@ -355,7 +357,8 @@ set(get(ax,'YLabel'),'String','saturation [-]'); end % legend - legend(ax,lgdstr,'Location','NorthEast','Tag','cpslegend','FontSize',10); + lgh = legend(ax,lgdstr,'Location','NorthEast','Tag','cpslegend'); + set(lgh,'FontSize',10,'TextColor',col.panelFG); % grid grid(ax,'on'); diff --git a/functions/interface/updatePlotsNMR.m b/functions/interface/updatePlotsNMR.m index 65e1057..89ebbe9 100644 --- a/functions/interface/updatePlotsNMR.m +++ b/functions/interface/updatePlotsNMR.m @@ -33,10 +33,12 @@ fig = findobj('Tag','MOD'); gui = getappdata(fig,'gui'); data = getappdata(fig,'data'); +colors = gui.myui.colors; % axis handle ax = gui.axes_handles.nmr; clearSingleAxis(ax); +hold(ax,'on'); if isfield(data.results,'NMR') % drainage and imbibition levels diff --git a/functions/interface/updatePlotsPSD.m b/functions/interface/updatePlotsPSD.m index 379ce3f..acb4eec 100644 --- a/functions/interface/updatePlotsPSD.m +++ b/functions/interface/updatePlotsPSD.m @@ -35,6 +35,7 @@ fig = findobj('Tag','MOD'); gui = getappdata(fig,'gui'); data = getappdata(fig,'data'); +colors = gui.myui.colors; % get the results results = data.results; @@ -42,12 +43,13 @@ % clear the PSD axes ax = gui.axes_handles.geo; clearSingleAxis(ax); +hold(ax,'on') % check if it is a single pore or a pore size distribution (PSD) % the radius is plotted in [µm] hence the factor 1e6 switch data.geometry.ispsd case 0 - stem(results.GEOM.radius,1,'ko-','LineWidth',2,'Parent',ax); + stem(results.GEOM.radius,1,'o-','Color',colors.axisL,'LineWidth',2,'Parent',ax); set(ax,'XScale','log','XLim',data.geometry.range); set(ax,'YLim',[0 1.1],'YTick',0:0.2:1); @@ -55,17 +57,17 @@ isfreqchecked = get(gui.cm_handles.geo_cm_viewfreq,'Checked'); switch isfreqchecked case 'on' - plot(results.psddata.r,results.psddata.psd,'k-','LineWidth',2,'Parent',ax); + plot(results.psddata.r,results.psddata.psd,'-','Color',colors.axisL,'LineWidth',2,'Parent',ax); xticks = log10(min(results.psddata.r)):1:log10(max(results.psddata.r)); set(ax,'XScale','log','XLim',[min(results.psddata.r) max(results.psddata.r)],'XTick',10.^xticks); - set(ax,'YLim',[0 max(results.psddata.psd)*1.1]); + set(ax,'YLim',[0 max(results.psddata.psd)*1.1],'YTickMode','auto'); set(get(ax,'YLabel'),'String','frequency [-]'); case 'off' - plot(results.psddata.r,cumsum(results.psddata.psd),'k-','LineWidth',2,'Parent',ax); + plot(results.psddata.r,cumsum(results.psddata.psd),'-','Color',colors.axisL,'LineWidth',2,'Parent',ax); xticks = log10(min(results.psddata.r)):1:log10(max(results.psddata.r)); set(ax,'XScale','log','XLim',[min(results.psddata.r) max(results.psddata.r)],'XTick',10.^xticks); - set(ax,'YLim',[0 1.1]); + set(ax,'YLim',[0 1.1],'YTickMode','auto'); set(get(ax,'YLabel'),'String','cumulative [-]'); otherwise diff --git a/functions/interface/updatePlotsSignal.m b/functions/interface/updatePlotsSignal.m index 729a620..3233ddd 100644 --- a/functions/interface/updatePlotsSignal.m +++ b/functions/interface/updatePlotsSignal.m @@ -53,6 +53,7 @@ clearSingleAxis(ax); clearSingleAxis(axI); hold(ax,'on'); + hold(axI,'on'); % data if isreal(nmrraw.s) @@ -109,7 +110,7 @@ set(get(ax,'XLabel'),'String','time [ms]'); end if strcmp(nmrproc.T1T2,'T2') && ~isreal(nmrraw.s) - set(get(ax,'YLabel'),'String','\Re'); + set(get(ax,'YLabel'),'String','\Reeal'); else set(get(ax,'YLabel'),'String','amplitude [a.u.]'); end @@ -120,14 +121,15 @@ line(xlims,[0 0],'LineStyle','--','LineWidth',1,'Color','k','Parent',axI); imag_mean = mean(imag(nmrraw.s)); imag_std = std(imag(nmrraw.s)); - set(axI,'XTickLabel',''); + yticks = linspace(min(imag(nmrraw.s)),max(imag(nmrraw.s)),3); + set(axI,'XTickLabel','','YTick',yticks,'YTickLabelMode','auto'); switch loglinx case 'x-axis -> lin' % log axes set(axI,'XScale','log','XLim',xlims); case 'x-axis -> log' % lin axes set(axI,'XScale','lin','XLim',xlims); end - set(get(axI,'YLabel'),'String','\Im'); + set(get(axI,'YLabel'),'String','\Immag'); end % grid @@ -222,12 +224,13 @@ lgdstr = {'signal','fit'}; switch nmrproc.T1T2 case 'T1' - legend(ax,lgdstr,'Location','NorthWest',... + lgh = legend(ax,lgdstr,'Location','NorthWest',... 'Tag','fitlegend','FontSize',10); case 'T2' - legend(ax,lgdstr,'Location','NorthEast',... + lgh = legend(ax,lgdstr,'Location','NorthEast',... 'Tag','fitlegend','FontSize',10); end + set(lgh,'TextColor',gui.myui.colors.panelFG); end % grid @@ -235,8 +238,9 @@ %% residual plot if isfield(data.results,'invstd') + col = gui.myui.colors.axisL; xlims = get(ax,'XLim'); - line(xlims,[0 0],'LineStyle','--','LineWidth',1,'Color','k','Parent',axE); + line(xlims,[0 0],'LineStyle','--','LineWidth',1,'Color',col,'Parent',axE); if nmrproc.noise > 0 err_mean = mean(invstd.residual./nmrproc.e); err_std = std(invstd.residual./nmrproc.e); @@ -245,9 +249,9 @@ line(xlims,[err_mean+err_std err_mean+err_std],... 'LineStyle','--','LineWidth',1,'Color','r','Parent',axE); line(xlims,[-1 -1],'LineStyle','-.','LineWidth',1,... - 'Color','k','Parent',axE); + 'Color',col,'Parent',axE); line(xlims,[1 1],'LineStyle','-.','LineWidth',1,... - 'Color','k','Parent',axE); + 'Color',col,'Parent',axE); set(axE,'XTickLabel',''); set(axE,'YLim',[-2 2]); set(axE,'YTick',[-1 0 1],'YTickLabelMode','auto'); @@ -257,9 +261,9 @@ err_mean = mean(invstd.residual); err_std = std(invstd.residual); line(xlims,[err_mean-1*err_std err_mean-1*err_std],... - 'LineStyle','-.','LineWidth',1,'Color','k','Parent',axE); + 'LineStyle','-.','LineWidth',1,'Color',col,'Parent',axE); line(xlims,[err_mean+1*err_std err_mean+1*err_std],... - 'LineStyle','-.','LineWidth',1,'Color','k','Parent',axE); + 'LineStyle','-.','LineWidth',1,'Color',col,'Parent',axE); set(axE,'XTickLabel',''); set(axE,'YLim',[err_mean-3*err_std err_mean+3*err_std]); set(axE,'YTick',[err_mean-3*err_std 0 err_mean+3*err_std],... diff --git a/functions/interface/updateStatusInformation.m b/functions/interface/updateStatusInformation.m index e776673..6158cdf 100644 --- a/functions/interface/updateStatusInformation.m +++ b/functions/interface/updateStatusInformation.m @@ -41,13 +41,20 @@ set(gui.textMode,'String','Expert Mode: OFF'); end -switch data.info.optim +switch data.info.has_optim case 'on' set(gui.textOptim,'String','Optim. Toolbox: ON'); case 'off' set(gui.textOptim,'String','Optim. Toolbox: OFF'); end +switch data.info.solver + case 'lsqnonneg' + set(gui.textSolver,'String','LSQNONNEG'); + case 'lsqlin' + set(gui.textSolver,'String','LSQLIN'); +end + switch data.info.stat case 'on' set(gui.textStats,'String','Stat. Toolbox: ON'); diff --git a/functions/interface/updateToolTips.m b/functions/interface/updateToolTips.m new file mode 100644 index 0000000..b3d6d9c --- /dev/null +++ b/functions/interface/updateToolTips.m @@ -0,0 +1,163 @@ +function updateToolTips +%updateToolTips updates tool tip entries dependent on the chosen settings +%(ExpertMode, LSQ-solver, ...) +% +% Syntax: +% updateToolTips +% +% Inputs: +% none +% +% Outputs: +% none +% +% Example: +% updateToolTips +% +% Other m-files required: +% none +% +% Subfunctions: +% none +% +% MAT-files required: +% none +% +% See also: NUCLEUSinv +% Author: Thomas Hiller +% email: thomas.hiller[at]leibniz-liag.de +% License: MIT License (at end) + +%------------- BEGIN CODE -------------- + +%% get GUI handle and data +fig = findobj('Tag','INV'); +gui = getappdata(fig,'gui'); +data = getappdata(fig,'data'); + +%% process tool tips +switch data.info.ExpertMode + case 'on' + switch data.info.solver + case 'lsqlin' + inv_tstr = ['Choose between different inversion (fitting) methods.

    ',... + 'Available options:
    ',... + 'Mono exp. Mono-exponential fitting.
    ',... + 'Several free exp. (2-5) Multi-exponential fitting with up to 5 free relaxation times.
    ',... + 'Multi exp. (LSQ) Multi-exponential fitting with Optimization Toolbox.
    ',... + 'Multi exp. (ILA) Multi-exponential fitting using an Inverse Laplace transform.

    ',... + 'Depending on the chosen method there are additional options available.

    ',... + 'Default value:
    ',... + 'Multi exp. (LSQ)
    ']; + reg_tstr = ['Choose additional options depending on the chosen inversion (fitting) method.

    ',... + 'Available options:
    ',... + 'Mono exp.:
    ',... + 'none
    ',... + 'Several free exp. (2-5):
    ',... + '1-5 choose how many free relaxation times to use.
    ',... + 'Multi exp. (LSQ):
    ',... + 'Manual Manual regularization.
    ',... + 'IterChi2 Find Chi2=1 iteratively.
    ',... + 'Tikhonov (GCV) Tikhonov regularization (SVD-Toolbox).
    ',... + 'TSVD (GCV) Regularization via Truncated SVD (SVD-Toolbox).
    ',... + 'DSVD (GCV) Regularization via Damped SVD (SVD-Toolbox).
    ',... + 'Discrep. Regularization according to discrepancy principle (SVD-Toolbox).
    ',... + 'L-curve Perform the L-curve test to find optimal regularization parameter lambda.
    ',... + 'Multi exp. (ILA):
    ',... + 'Manual Manual regularization.
    ',... + 'Automatic Automatic regularization.

    ',... + 'Default value:
    ',... + 'Manual
    ']; + case 'lsqnonneg' + inv_tstr = ['Choose between different inversion (fitting) methods.

    ',... + 'Available options:
    ',... + 'Mono exp. Mono-exponential fitting.
    ',... + 'Several free exp. (2-5) Multi-exponential fitting with up to 5 free relaxation times.
    ',... + 'Multi exp. (LSQ) Multi-exponential fitting with Non Negative Least Squares (LSQNONNEG).
    ',... + 'Multi exp. (ILA) Multi-exponential fitting using an Inverse Laplace transform.

    ',... + 'Depending on the chosen method there are additional options available.

    ',... + 'Default value:
    ',... + 'Multi exp. (LSQ)
    ']; + reg_tstr = ['Choose additional options depending on the chosen inversion (fitting) method.

    ',... + 'Available options:
    ',... + 'Mono exp.:
    ',... + 'none
    ',... + 'Several free exp. (2-5):
    ',... + '1-5 choose how many free relaxation times to use.
    ',... + 'Multi exp. (LSQ):
    ',... + 'Manual Manual regularization.
    ',... + 'IterChi2 Find Chi2=1 iteratively.
    ',... + 'Tikhonov (GCV) Tikhonov regularization (SVD-Toolbox).
    ',... + 'TSVD (GCV) Regularization via Truncated SVD (SVD-Toolbox).
    ',... + 'DSVD (GCV) Regularization via Damped SVD (SVD-Toolbox).
    ',... + 'Discrep. Regularization according to discrepancy principle (SVD-Toolbox).
    ',... + 'L-curve Perform the L-curve test to find optimal regularization parameter lambda.
    ',... + 'Multi exp. (ILA):
    ',... + 'Manual Manual regularization.
    ',... + 'Automatic Automatic regularization.

    ',... + 'Default value:
    ',... + 'Manual
    ']; + end + case 'off' + inv_tstr = ['Choose between different inversion (fitting) methods.

    ',... + 'Available options:
    ',... + 'Mono exp. Mono-exponential fitting.
    ',... + 'Several free exp. (2-5). Multi-exponential fitting with up to 5 free relaxation times.
    ',... + 'Multi exp. (LSQ) Multi-exponential fitting with Non Negative Least Squares (LSQNONNEG).

    ',... + 'Depending on the chosen method there are additional options available.

    ',... + 'Default value:
    ',... + 'Multi exp. (LSQ)
    ']; + reg_tstr = ['Choose additional options depending on the chosen inversion (fitting) method.

    ',... + 'Available options:
    ',... + 'Mono exp.:
    ',... + 'none
    ',... + 'Several free exp. (2-5):
    ',... + '1-5 choose how many free relaxation times to use.
    ',... + 'Multi exp. (LSQ):
    ',... + 'Manual Manual regularization.
    ',... + 'IterChi2 Find Chi2=1 iteratively.
    ',... + 'L-curve Perform the L-curve test to find optimal regularization parameter lambda.

    ',... + 'Default value:
    ',... + 'Manual
    ']; +end +% update the tool tips +set(gui.popup_handles.invstd_InvType,'UserData',struct('Tooltipstr',inv_tstr)); +set(gui.popup_handles.invstd_InvTypeOpt,'UserData',struct('Tooltipstr',reg_tstr)); + +% update GUI data +setappdata(fig,'gui',gui); +setappdata(fig,'data',data); +% if tool tips are activated they need to be updated on-the-fly +switch data.info.ToolTips + case 'on' + onMenuExtraShow(gui.menu.extra_settings_tooltips_on); + otherwise + % nothing to do +end + +end + +%------------- END OF CODE -------------- + +%% License: +% MIT License +% +% Copyright (c) 2019 Thomas Hiller +% +% Permission is hereby granted, free of charge, to any person obtaining a copy +% of this software and associated documentation files (the "Software"), to deal +% in the Software without restriction, including without limitation the rights +% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +% copies of the Software, and to permit persons to whom the Software is +% furnished to do so, subject to the following conditions: +% +% The above copyright notice and this permission notice shall be included in all +% copies or substantial portions of the Software. +% +% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +% SOFTWARE. \ No newline at end of file diff --git a/functions/inversion/applyRegularization.m b/functions/inversion/applyRegularization.m index 682125b..8a52989 100644 --- a/functions/inversion/applyRegularization.m +++ b/functions/inversion/applyRegularization.m @@ -12,7 +12,7 @@ % g - signal % lambda_in - regularization parameter % flag - flag for regularization method: -% 'manual', 'gcv_tikh', 'gcv_trunc', 'gcv_damp', 'discrep', +% 'manual', 'gcv_tikh', 'gcv_trunc', 'gcv_damp', 'discrep', % order - smoothness constraint: '0', '1' or '2' % noise_level - noise level for 'discrep' method (discrepancy principle) % @@ -43,7 +43,7 @@ %------------- BEGIN CODE -------------- -switch flag +switch flag case 'manual' Kreg = [K;lambda_in*L]; lambda = lambda_in; @@ -54,7 +54,7 @@ [lambda,~,~] = gcv(U,s,g,'tikh',0); else [U,s,~,~,~] = cgsvd(K,L); - [lambda,~,~] = gcv(U,s,g,'tikh',0); + [lambda,~,~] = gcv(U,s,g,'tikh',0); end Kreg = [K;lambda*L]; @@ -80,14 +80,23 @@ case 'discrep' delta = sqrt(length(g))*noise_level; - if order == 0 - [U,s,V] = csvd(K); - [~,lambda] = discrep(U,s,V,g,delta); - else - [U,s,X,~,~] = cgsvd(K,L); - [~,lambda] = discrep(U,s,X,g,delta); + try + if order == 0 + [U,s,V] = csvd(K); + [~,lambda] = discrep(U,s,V,g,delta); + else + [U,s,X,~,~] = cgsvd(K,L); + [~,lambda] = discrep(U,s,X,g,delta); + end + Kreg = [K;lambda*L]; + catch ME + % show error message in case discrep fails + errmsg = {ME.message;[ME.stack(1).name,' Line: ',num2str(ME.stack(1).line)];... + 'Regul. Box: discrep.m failed!';'Using Lambda=1 as fall back.'}; + errordlg(errmsg,'applyRegularization: Error!'); + lambda = 1; + Kreg = [K;lambda*L]; end - Kreg = [K;lambda*L]; end return diff --git a/functions/inversion/fitDataFree.m b/functions/inversion/fitDataFree.m index 9ba1ced..257e310 100644 --- a/functions/inversion/fitDataFree.m +++ b/functions/inversion/fitDataFree.m @@ -94,14 +94,22 @@ switch flag case 'T1' % solver options - options = optimset('Display',parameter.info,'MaxFunEvals',10^6,... - 'LargeScale','on','MaxIter',5000,'TolFun',1e-12,'TolX',1e-12); + options = optimoptions('lsqcurvefit'); + options.Display = parameter.info; + options.OptimalityTolerance = 1e-18; + options.StepTolerance = 1e-18; +% options.MaxIterations = 1e3; [x,~,~,~,output,~,jacobian] = lsqcurvefit(@(x,t)fcn_fitFreeT1(x,t,IRfac),... x0,t,s,zeros(size(x0)),[],options); case 'T2' % solver options - options = optimset('Display',parameter.info,'MaxFunEvals',10^6,... - 'Jacobian','on','Algorithm','levenberg-marquardt','MaxIter',5000,'TolFun',1e-12,'TolX',1e-12); + options = optimoptions('lsqnonlin'); + options.Algorithm = 'levenberg-marquardt'; + options.Display = parameter.info; + options.OptimalityTolerance = 1e-18; + options.StepTolerance = 1e-18; +% options.MaxIterations = 1e3; + iparam.t = t; iparam.s = s; [x,~,~,~,output,~,jacobian] = lsqnonlin(@(x)fcn_fitFreeT2w(x,iparam),... diff --git a/functions/inversion/fitDataNNLS.m b/functions/inversion/fitDataLSQ.m similarity index 89% rename from functions/inversion/fitDataNNLS.m rename to functions/inversion/fitDataLSQ.m index 50acae2..373a62c 100644 --- a/functions/inversion/fitDataNNLS.m +++ b/functions/inversion/fitDataLSQ.m @@ -1,9 +1,11 @@ -function fitdata = fitDataNNLS(time,signal,parameter) -%fitDataNNLS is a control routine that uses the 'Regularization Toolbox' -%from P. Hansen and 'lsqlin' to fit NMR data multi-exponentially +function fitdata = fitDataLSQ(time,signal,parameter) +%fitDataLSQ is a control routine that fits NMR data multi-exponentially; +%if the Optimization Toolbox is available the user can select LSQLIN, +%otherwise the default built-in LSQNONNEG is used; the 'Regularization Toolbox' +%from P. Hansen can be used for automatic regularization based on the SVD % % Syntax: -% fitDataNNLS(time,signal,parameter) +% fitDataLSQ(time,signal,parameter) % % Inputs: % time - time vector @@ -20,7 +22,7 @@ % noise : noise level needed for 'discrep' discrepancy % principle % W : error weighting matrix (optional) -% optim : switch for Optimization Toolbox +% solver : LSQ solver ('lsqlin' or 'lsqnonneg') % % Outputs: % fitdata - struct that holds the inversion results: @@ -43,7 +45,7 @@ % rn : residual norm |A*x-b|_2 % % Example: -% [fitdata] = fitDataNNLS(t,s,parameter) +% [fitdata] = fitDataLSQ(t,s,parameter) % % Other m-files required: % Optimization Toolbox from Mathworks (optional) @@ -98,7 +100,7 @@ % create the Kernel matrix for inversion K = createKernelMatrix(t,T1T2me,Tb,flag,T1IRfac); -if strcmp(parameter.optim,'on') +if strcmp(parameter.solver,'lsqlin') % initial T2 amplitudes f0 = zeros(size(T1T2me)); f0_lb = f0; @@ -130,15 +132,15 @@ gg = g; gg(length(g)+1:length(g)+size(L,1),1) = 0; -switch parameter.optim - case 'on' - options = optimset('Display',parameter.info,'TolFun',1e-12,... - 'TolX',1e-12,'Jacobian','off',... - 'LargeScale','on','MaxFunEvals',1000000,... - 'MaxIter',200); +switch parameter.solver + case 'lsqlin' + options = optimoptions('lsqlin'); + options.Display = parameter.info; + options.OptimalityTolerance = 1e-18; + options.StepTolerance = 1e-18; [f,~,~,~,~,~] = lsqlin(KK,gg,[],[],[],[],... - f0_lb,f0_ub,f0,options); - case 'off' + f0_lb,f0_ub,[],options); + case 'lsqnonneg' options = optimset('Display',parameter.info,'TolX',1e-12); [f,~,~,~,~,~] = lsqnonneg(KK,gg,options); end