Skip to content

Commit

Permalink
NUCLEUSinv update:
Browse files Browse the repository at this point in the history
1. new menu entry added to export options - *last export* that shows the last chosen export routine (speeds up exporting when handling a lot of data)
2. in the context menu of the signal list renamed *all* to *batch* which indicates batch processing
3. renamed the *InvLaplace* inversion option to *LU* (LU-decomposition) to resolve the confusion with a real inverse Laplace transform
4. enabled importing session files saved with an older *NUCLEUSinv* version (starting from v.0.1.8)
5. several minor improvements and typo fixes
  • Loading branch information
ThoHiller committed Oct 30, 2019
1 parent 39117cc commit 52a3d56
Show file tree
Hide file tree
Showing 73 changed files with 3,223 additions and 3,257 deletions.
4 changes: 2 additions & 2 deletions NUCLEUSinv/NUCLEUSinv.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
if ~isempty(h0); close(h0); end

%% GUI 'header' info and defaults
myui.version = '0.1.8';
myui.date = '08.07.2019';
myui.version = '0.1.9';
myui.date = '30.10.2019';
myui.author = 'Thomas Hiller';
myui.email = 'thomas.hiller[at]leibniz-liag.de';
myui.fontsize = 10;
Expand Down
6 changes: 5 additions & 1 deletion NUCLEUSinv/NUCLEUSinv_createMenus.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
% 1.1 Import
gui.menu.file_import = uimenu(gui.menu.file,...
'Label','Import');
%
% 1.1.0 Last import
lastimport = gui.myui.inidata.lastimport;
ind = strfind(lastimport,'_');
tag = lastimport(1:ind-1);
Expand Down Expand Up @@ -133,6 +133,10 @@
% 1.2 Export
gui.menu.file_export = uimenu(gui.menu.file,...
'Label','Export');
% 1.2.0 Last export
lastexport = gui.myui.inidata.lastexport;
gui.menu.file_export_lastexport = uimenu(gui.menu.file_export,...
'Label',lastexport,'Callback',@onMenuExportData);
% 1.2.1 Data
gui.menu.file_export_data = uimenu(gui.menu.file_export,...
'Label','Data');
Expand Down
4 changes: 2 additions & 2 deletions NUCLEUSinv/NUCLEUSinv_createPanelData.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
gui.cm_handles.data_list_single = uimenu(gui.cm_handles.data_list,...
'Label','single','Separator','on');
gui.cm_handles.data_list_all = uimenu(gui.cm_handles.data_list,...
'Label','all');
'Label','batch');
% 'sort' sub menu
uimenu(gui.cm_handles.data_list_sort,...
'Label','by name','Tag','sort','Callback',@onContextSignalList);
Expand All @@ -83,7 +83,7 @@
uimenu(gui.cm_handles.data_list_single,...
'Label','use as calib.','Tag','single','Separator','on',...
'Callback',@onContextSignalList);
% 'all' sub menu
% 'batch' sub menu
uimenu(gui.cm_handles.data_list_all,...
'Label','run','Tag','all','Callback',@onContextSignalList);
uimenu(gui.cm_handles.data_list_all,...
Expand Down
8 changes: 4 additions & 4 deletions NUCLEUSinv/NUCLEUSinv_createPanelInversionStd.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
switch data.info.ExpertMode
case 'on'
tstr = ' ';
istring = {'Mono exp.','Several free exp. (2-5)','Multi exp. (LSQ)','Multi exp. (InvLaplace)'};
istring = {'Mono exp.','Several free exp. (2-5)','Multi exp. (LSQ)','Multi exp. (LU decomp.)'};
case 'off'
tstr = ' ';
istring = {'Mono exp.','Several free exp. (2-5)','Multi exp. (LSQ)'};
Expand Down Expand Up @@ -99,11 +99,11 @@
switch data.info.ExpertMode
case 'on'
tstr = ' ';
rstring = {'Manual','Iterative Chi2','Tikhonov (SVD)','TSVD (SVD)',...
rstring = {'Manual','Tikhonov (SVD)','TSVD (SVD)',...
'DSVD (SVD)','Discrep. (SVD)','L-curve'};
case 'off'
tstr = ' ';
rstring = {'Manual','Iterative Chi2','L-curve'};
rstring = {'Manual','L-curve'};
end
gui.popup_handles.invstd_InvTypeOpt = uicontrol('Parent',gui.panels.invstd.HBox3,...
'Style','popup','String',rstring,'FontSize',myui.fontsize,'Enable','off','Value',1,...
Expand All @@ -118,7 +118,7 @@
'<u>Available options:</u><br>',...
'<font color="red">Mono exp. | Several free exp. (2-5):<br>',...
'<font color="black"><b>none</b><br>',...
'<font color="red">Multi exp. (LSQ) | Multi exp. (ILA):<br>',...
'<font color="red">Multi exp. (LSQ) | Multi exp. (LU decomp.):<br>',...
'<font color="black">',...
'<b>0</b> Zeroth-order smoothness constraint.<br>',...
'<b>1</b> First-order smoothness constraint.<br>',...
Expand Down
8 changes: 4 additions & 4 deletions NUCLEUSinv/NUCLEUSinv_loadDefaults.m
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,18 @@

%% standard inversion panel defaults
% inversion methods to choose from
% 'mono' | 'free' | 'NNLS' | 'ILA'
% 'mono' | 'free' | 'NNLS' | 'LU'
out.invstd.invtype = 'NNLS';
% when inversion method is 'free' choose No. of free relaxation times
out.invstd.freeDT = 2;
% regularization options for multi-exponential fitting routines
% 'NNLS' and 'ILA'
% 'NNLS' and 'LU'
out.invstd.regtype = 'manual';
% smoothness constraint (order) for multi-exponential fitting routines
% 'NNLS' and 'ILA'
% 'NNLS' and 'LU'
out.invstd.Lorder = 1;
% regularization parameter for multi-exponential fitting routines
% 'NNLS' and 'ILA'
% 'NNLS' and 'LU'
out.invstd.lambda = 1;
% L-curve range (lambda) for multi-exponential fitting routine 'NNLS'
out.invstd.lambdaR = [1e-3 1e2];
Expand Down
40 changes: 15 additions & 25 deletions NUCLEUSinv/NUCLEUSinv_updateInterface.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
%% update standard inversion panel
% inversion method popup
istring = {'Mono exp.','Several free exp. (2-5)',...
'Multi exp. (LSQ)','Multi exp. (InvLaplace)'};
'Multi exp. (LSQ)','Multi exp. (LU decomp.)'};
set(gui.popup_handles.invstd_InvType,'String',istring);
switch data.invstd.invtype
case 'mono'
Expand Down Expand Up @@ -117,27 +117,25 @@

% additional inversion settings
set(gui.popup_handles.invstd_InvTypeOpt,'Enable','on',...
'String',{'Manual','Iterative Chi2','Tikhonov (SVD)','TSVD (SVD)',...
'String',{'Manual','Tikhonov (SVD)','TSVD (SVD)',...
'DSVD (SVD)','Discrep. (SVD)','L-curve'});
set(gui.text_handles.invstd_InvTypeOpt,...
'String','regularization options');

% regularization options
switch data.invstd.regtype
case 'manual'
set(gui.popup_handles.invstd_InvTypeOpt,'Value',1);
case 'iterchi2'
set(gui.popup_handles.invstd_InvTypeOpt,'Value',2);
set(gui.popup_handles.invstd_InvTypeOpt,'Value',1);
case 'gcv_tikh'
set(gui.popup_handles.invstd_InvTypeOpt,'Value',3);
set(gui.popup_handles.invstd_InvTypeOpt,'Value',2);
case 'gcv_trunc'
set(gui.popup_handles.invstd_InvTypeOpt,'Value',4);
set(gui.popup_handles.invstd_InvTypeOpt,'Value',3);
case 'gcv_damp'
set(gui.popup_handles.invstd_InvTypeOpt,'Value',5);
set(gui.popup_handles.invstd_InvTypeOpt,'Value',4);
case 'discrep'
set(gui.popup_handles.invstd_InvTypeOpt,'Value',6);
set(gui.popup_handles.invstd_InvTypeOpt,'Value',5);
case 'lcurve'
set(gui.popup_handles.invstd_InvTypeOpt,'Value',7);
set(gui.popup_handles.invstd_InvTypeOpt,'Value',6);
end

% lambda, smoothness constraint and RTD limits
Expand All @@ -151,7 +149,7 @@
set(gui.edit_handles.invstd_Tbulk,'Enable','on',...
'String',num2str(data.invstd.Tbulk));

case 'ILA'
case 'LU'
% inversion method popup
set(gui.popup_handles.invstd_InvType,'Value',4,'Enable','on');

Expand Down Expand Up @@ -567,18 +565,16 @@

% additional inversion settings
set(gui.popup_handles.invstd_InvTypeOpt,'Enable','on',...
'String',{'Manual','Iterative Chi2','L-curve'});
'String',{'Manual','L-curve'});
set(gui.text_handles.invstd_InvTypeOpt,...
'String','regularization options');

% regularization options
switch data.invstd.regtype
case 'manual'
set(gui.popup_handles.invstd_InvTypeOpt,'Value',1);
case 'iterchi2'
set(gui.popup_handles.invstd_InvTypeOpt,'Value',2);
set(gui.popup_handles.invstd_InvTypeOpt,'Value',1);
case 'lcurve'
set(gui.popup_handles.invstd_InvTypeOpt,'Value',3);
set(gui.popup_handles.invstd_InvTypeOpt,'Value',2);
end

% lambda, smoothness constraint and RTD limits
Expand Down Expand Up @@ -708,7 +704,7 @@
set(gui.edit_handles.invstd_time_max,'Enable','off');
set(gui.edit_handles.invstd_Ntime,'Enable','off');

case {'ILA','NNLS'}
case {'LU','NNLS'}
set(gui.edit_handles.invstd_time_min,'Enable','on','String',num2str(time(1)));
set(gui.edit_handles.invstd_time_max,'Enable','on','String',num2str(time(2)));
set(gui.edit_handles.invstd_Ntime,'Enable','on','String',num2str(Ntime));
Expand Down Expand Up @@ -759,12 +755,6 @@
set(gui.edit_handles.invstd_NlambdaR,'Enable','on','String',num2str(NlambdaR));
gui.plots.DistPanel.TabTitles = {'L-CURVE','RMS','PSD (joint)'};

case 'iterchi2'
set(gui.edit_handles.invstd_lambda_min,'Enable','on','String',num2str(lambdaR(1)));
set(gui.edit_handles.invstd_lambda_max,'Enable','on','String',num2str(lambdaR(2)));
set(gui.edit_handles.invstd_NlambdaR,'Enable','off','String',num2str(NlambdaR));
gui.plots.DistPanel.TabTitles = {'CHI2','RMS','PSD (joint)'};

case {'gcv_tikh','gcv_trunc','gcv_damp','discrep'}
set(gui.edit_handles.invstd_lambda_min,'Enable','off','String',num2str(lambda));
set(gui.edit_handles.invstd_lambda_max,'Enable','off');
Expand Down Expand Up @@ -830,7 +820,7 @@
set(gui.radio_handles.invstd_Lorder1,'Enable','off');
set(gui.radio_handles.invstd_Lorder2,'Enable','off');

case {'ILA','NNLS'}
case {'LU','NNLS'}
set(gui.radio_handles.invstd_Lorder0,'Enable','on');
set(gui.radio_handles.invstd_Lorder1,'Enable','on');
set(gui.radio_handles.invstd_Lorder2,'Enable','on');
Expand Down Expand Up @@ -897,7 +887,7 @@
set(gui.edit_handles.param_rho,'Enable','on','String',num2str(p.rho));
set(gui.edit_handles.param_geom,'Enable','on','String',num2str(p.a));

case {'ILA','NNLS'}
case {'LU','NNLS'}
set(gui.edit_handles.param_CBW,'Enable','on','String',num2str(p.CBWcutoff));
set(gui.edit_handles.param_BVI,'Enable','on','String',num2str(p.BVIcutoff));
set(gui.edit_handles.param_rho,'Enable','on','String',num2str(p.rho));
Expand Down
4 changes: 2 additions & 2 deletions NUCLEUSmod/NUCLEUSmod.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
if ~isempty(h0); close(h0); end

%% GUI 'header' info and defaults
myui.version = '0.1.8';
myui.date = '08.07.2019';
myui.version = '0.1.9';
myui.date = '30.10.2019';
myui.author = 'Thomas Hiller';
myui.email = 'thomas.hiller[at]leibniz-liag.de';
myui.fontsize = 10;
Expand Down
8 changes: 4 additions & 4 deletions callbacks/edits/onEditValue.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,12 @@ function onEditValue(src,~)
data = getappdata(fig,'data');
INVdata = getappdata(fig,'INVdata');

%% the generic part thw works for both GUIS
%% the generic part works for both GUIS
% get the value of the field
value = str2double(get(src,'String'));
% get the user data of the field
userdata = get(src,'UserData');

% id of the chosen NMR signal
id = get(gui.listbox_handles.signal,'Value');

% check if the value is numeric
% if not reset to defaults stored in user data
defaults = userdata.defaults;
Expand All @@ -80,6 +77,9 @@ function onEditValue(src,~)
% switch depending on what figure called
switch fig_tag
case 'INV'
% id of the chosen NMR signal
id = get(gui.listbox_handles.signal,'Value');

% switch depending on the parent panel
switch out.panel
case 'process'
Expand Down
7 changes: 2 additions & 5 deletions callbacks/listboxes/onListboxData.m
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ function onListboxData(src,~)
if isfield(data.results,'lcurve')
updatePlotsLcurve;
end
if isfield(data.results,'iterchi2')
updatePlotsIterChi;
end
end
else
% remove temporary data fields
Expand Down Expand Up @@ -175,8 +172,8 @@ function onListboxData(src,~)
end

% set focus on data
% set(gui.plots.SignalPanel,'Selection',1);
% set(gui.plots.DistPanel,'Selection',1);
% set(gui.plots.SignalPanel,'Selection',1);
% set(gui.plots.DistPanel,'Selection',1);

% reset all RUN buttons
set(gui.push_handles.invstd_run,'String','<HTML><u>R</u>UN',...
Expand Down
9 changes: 9 additions & 0 deletions callbacks/menus/onMenuExportData.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ function onMenuExportData(src,~)
case 'LIAG CSV T2'
exportData(fig_tag,'LIAGcsvT2');
end
% update the "last export" value within the ini-file
gui = getappdata(fig,'gui');
gui.myui.inidata.lastexport = label;
setappdata(fig,'gui',gui);
gui = makeINIfile(gui,'update');
% and the menu entry itself
set(gui.menu.file_export_lastexport,'Label',label,...
'Callback',@onMenuExportData);
setappdata(fig,'gui',gui);

case 'MOD'
switch label
Expand Down
2 changes: 1 addition & 1 deletion callbacks/menus/onMenuImport.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function onMenuImport(src,~)
helpdlg({'function: onMenuImport','Menu tag no known.'},...
'menu not known')
end
% update the last import data within the ini-file
% update the "last import" value within the ini-file
gui = getappdata(fig,'gui');
gui.myui.inidata.lastimport = [menu_tag,'_',label];
setappdata(fig,'gui',gui);
Expand Down
6 changes: 3 additions & 3 deletions callbacks/popup/onPopupInvstdType.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function onPopupInvstdType(src,~)
data.invstd.lambda = 1;

case 4
data.invstd.invtype = 'ILA';
data.invstd.invtype = 'LU';
data.invstd.regtype = 'auto';
data.invstd.lambda = -1;
end
Expand All @@ -80,9 +80,9 @@ function onPopupInvstdType(src,~)
data.invstd.invtype = 'NNLS';
% set LIAG defaults
if isfield(data.import,'LIAG')
data.invstd.regtype = 'iterchi2';
data.invstd.regtype = 'lcurve';
data.invstd.lambda = 1;
data.invstd.lambdaR = [1e-5 100];
data.invstd.lambdaR = [1e-5 1];
else
data.invstd.regtype = 'manual';
data.invstd.lambda = 1;
Expand Down
Loading

0 comments on commit 52a3d56

Please sign in to comment.