From 1db2b476f5f469dcef4efcc5f96ccace538968d4 Mon Sep 17 00:00:00 2001 From: sakul-45 <81963567+sakul-45@users.noreply.github.com> Date: Sat, 10 Jul 2021 13:37:11 +0200 Subject: [PATCH] Added appending applied parameters to params struct --- correct_magnetic_basline.m | 9 ++++++--- correct_time_baseline.m | 9 ++++++--- normalize_data.m | 11 +++++++---- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/correct_magnetic_basline.m b/correct_magnetic_basline.m index 880073f..0f7ff58 100644 --- a/correct_magnetic_basline.m +++ b/correct_magnetic_basline.m @@ -1,12 +1,13 @@ -function [dataOUT] = correct_magnetic_basline(dataIN) +function [dataOUT,params] = correct_magnetic_basline(dataIN,params) %CORRECT_MAGNETIC_BASLINE UI for basline correction along field axis % -% Usage: [dataOUT] = CORRECT_MAGNETIC_BASLINE(dataIN), where dataIN is a -% dataset loaded via the LOAD_MATLAB or LOAD_BRUKER function. +% Usage: [dataOUT,params] = CORRECT_MAGNETIC_BASLINE(dataIN,params), where +% dataIN is a dataset loaded via the LOAD_MATLAB or LOAD_BRUKER function. % % The function will show the input data and offer an input field, where % the number of field basline points should be set. By pressing "Apply" the % correction will be executed and the graph changes to the corrected data. +% The number of field baseline points will also be appended to the params struct. % By pressing "Reset" the graph will return to show the original data. % Exit the function by pressing "Done". @@ -86,6 +87,8 @@ uiwait(fig) dataOUT_transp = dataOUT.'; plot(ax,dataOUT_transp) axis tight + %writing parameter + params.No_field_basline_pts = field_baseline; end function FieldResetButtonPushed(src,event) diff --git a/correct_time_baseline.m b/correct_time_baseline.m index 5758558..7447512 100644 --- a/correct_time_baseline.m +++ b/correct_time_baseline.m @@ -1,12 +1,13 @@ -function [dataOUT] = correct_time_baseline(dataIN) +function [dataOUT,params] = correct_time_baseline(dataIN,params) %CORRECT_TIME_BASELINE UI for basline correction along time axis % -% Usage: [dataOUT] = CORRECT_TIME_BASELINE(dataIN), where dataIN is a -% dataset loaded via the LOAD_MATLAB or LOAD_BRUKER function. +% Usage: [dataOUT,params] = CORRECT_TIME_BASELINE(dataIN,params), where +% dataIN is a dataset loaded via the LOAD_MATLAB or LOAD_BRUKER function. % % The function will show the input data and offer an input field, where % the number of pretrigger points should be set. By pressing "Apply" the % correction will be executed and the graph changes to the corrected data. +% The number of pretigger points will also be appended to the params struct. % By pressing "Reset" the graph will return to show the original data. % Exit the function by pressing "Done". @@ -82,6 +83,8 @@ uiwait(fig) %plotting result plot(ax,dataOUT) axis tight + %writing parameter + params.pretrigger = pretrigger; end function TimeResetButtonPushed(src,event) diff --git a/normalize_data.m b/normalize_data.m index 8d1f4dc..3d56a43 100644 --- a/normalize_data.m +++ b/normalize_data.m @@ -1,13 +1,14 @@ -function [dataOUT] = normalize_data(dataIN) +function [dataOUT,params] = normalize_data(dataIN,params) %NORMALISE_DATA normalizes data by max of region % -% Usage: [dataOUT] = NORMALISE_DATA(dataIN), where dataIN is a dataset -% loaded via the LOAD_MATLAB or LOAD_BRUKER function. +% Usage: [dataOUT,params] = NORMALISE_DATA(dataIN,params), where dataIN +% is a dataset loaded via the LOAD_MATLAB or LOAD_BRUKER function. % % The function will show the input data and offer two input fields, where % the left and right borders of the maximum's region should be set. % By pressing "Apply" the normalization will be executed and the graph -% changes to the normalized data. +% changes to the normalized data. The borders of the maximum region will +% also be appended to the params struct. % By pressing "Reset" the graph will return to show the original data. % Exit the function by pressing "Done". @@ -91,6 +92,8 @@ uiwait(fig) %plotting result with time as x axis plot(ax,dataOUT) axis tight + %writing parameter + params.region_of_max = [left_point right_point]; end function NormResetButtonPushed(src,event)