Skip to content

Commit

Permalink
Merge pull request #833 from bachlab/821_helptext_standardization
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikbach authored Feb 20, 2025
2 parents 61e2da4 + b8aab2c commit 83eea93
Show file tree
Hide file tree
Showing 93 changed files with 184 additions and 171 deletions.
4 changes: 2 additions & 2 deletions src/f_SCR.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
% ● Format
% [fx, dfdx, dfdP] = f_SCR(Xt,Theta,ut,in)
% ● Arguments
% Theta: 4 ER constants (3 ODE params + time)
% * Theta: 4 ER constants (3 ODE params + time)
% 3 SF constants (3 ODE params)
% 3 values per aSCR (invsigma(peaktime), invsigma(std),
% log(amplitude))
% 1 value per eSCR (log(amplitude))
% 2 values per SF (invsigma(peaktime), log(amplitude))
% 2 values per SCL change (invsigma(time), amplitude)
% ut: row 1 - time (after cue onset)
% * ut: row 1 - time (after cue onset)
% row 2 - number of aSCR
% row 3 - number of eSCR
% row 4 - number of SF
Expand Down
8 changes: 4 additions & 4 deletions src/f_SF.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
% ● Format
% [fx, dfdx] = f_SF(Xt,Theta,ut,in)
% ● Arguments
% Theta: 3 general constants
% 2 value per SF (time, log(amplitude))
% ut: row 1 - time (after cue onset)
% row 2 - number of SF
% * Theta: 3 general constants
% 2 value per SF (time, log(amplitude))
% * ut: row 1 - time (after cue onset)
% row 2 - number of SF
% ● History
% Introduced in PsPM 3.0
% Written in 2008-2015 by Dominik R Bach (Wellcome Trust Centre for Neuroimaging)
Expand Down
4 changes: 3 additions & 1 deletion src/g_SCR.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
function [gx,dgdx,dgdPhi] = g_SCR(Xt,Phi,ut,inG)
% ● Description
% ● Description
% This is the SCR observation function required by the VBA toolbox. It
% adds the three generative processes (phasic SCR, SF, SCL) modelled in
% f_SCR.
% ● Format
% [gx,dgdx,dgdPhi] = g_SCR(Xt,Phi,ut,inG)
% ● Arguments
% Xt: a 7-element vector
% Phi: input required by VBA, ignored
Expand Down
2 changes: 1 addition & 1 deletion src/pspm.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function pspm(varargin)
% ● Description
% pspm.m handles the main GUI for PsPM
% ● Developer's notes
% ● Developer
% PsPM will no longer support GUIDE and only use App Designer for UI.
% App Designer is available for MATLAB that is later than version R2016a (9.0).
% ● History
Expand Down
2 changes: 1 addition & 1 deletion src/pspm_align_channels.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
% ● Arguments
% * data : [struct] the input data to be processed, in PsPM data format.
% * induration : [double] the duration of the input data.
%Copyright
%History
% Introduced in PsPM 3.1
% Written in 2008-2016 by Dominik R Bach (Wellcome Trust Centre for Neuroimaging)
% Maintained in 2022 by Teddy
Expand Down
14 changes: 7 additions & 7 deletions src/pspm_bf_FIR.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,29 @@
%% Check input arguments
if nargin==0
errmsg='No sampling interval stated'; warning('ID:invalid_input', errmsg); return;
end;
end
n = 30;
d = 1;
td = varargin{1}(1);
if nargin == 1 && numel(varargin{1}) > 1
n = varargin{1}(2);
if numel(varargin{1}) >= 3
d = varargin{1}(3);
end;
end

elseif nargin > 1
if nargin >= 2
n = varargin{2}(1);
end;
end
if nargin >= 3
d = varargin{3}(1);
end;
end;
end
end
if td > d
warning('ID:invalid_input', 'Time resolution is larger than duration of the function.'); return;
elseif td == 0
warning('ID:invalid_input', 'Time resolution must be larger than 0.'); return;
end;
end
% initialise FIR
FIR = [zeros(1, n); zeros(round((d*n/td)), n);];
% generate timestamps
Expand All @@ -50,5 +50,5 @@
stops=(d*reg)/td;
FIR(starts:stops, reg)=1;
starts=stops+1;
end;
end
return
2 changes: 1 addition & 1 deletion src/pspm_bf_hprf_e.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
% ● Arguments
% * td : time resolution in second.
% * b : number of basis functions. Default as 1:6.
% ● Developer's Notes
% ● Developer
% Basis functions will be orthogonalized using spm_orth by default. Onsets
% pspm_glm must be shifted by 5 s to account for the pre-event epoch.
% Put in values 1:6 for b in order to get following basis functions:
Expand Down
2 changes: 1 addition & 1 deletion src/pspm_bf_hprf_rew.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
% [bs, x] = pspm_bf_hprf_fc(TD)
% ● Arguments
% * td : time resolution in second.
% ● References:
% ● References
% GLM for reward-conditioned bradycardia:
% Xia Y, Liu H, Kälin OK, Gerster S, Bach DR (2024). Measuring
% human Pavlovian appetitive conditioning and memory retention.
Expand Down
2 changes: 1 addition & 1 deletion src/pspm_bf_ldrf_gm.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
% * a : Shape of the function.
% * b : Scale of the function.
% * A : Quantifier or amplitude of the function.
%Reference
%References
% Korn, C. W., & Bach, D. R. (2016). A solid frame for the window on
% cognition: Modeling event-related pupil responses. Journal of Vision,
% 16(3), 28. https://doi.org/10.1167/16.3.28
Expand Down
2 changes: 1 addition & 1 deletion src/pspm_bf_ldrf_gu.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
% * p2 : Scale for Gaussian response function, or b, default as 2.04.
% * p3 : Parameter for Gaussian response function, or x0, default as 1.48.
% * p4 : Quantifier or amplitude for Gaussian response function, or A, default as 0.004.
%Reference
%References
% Korn, C. W., & Bach, D. R. (2016). A solid frame for the window on
% cognition: Modeling event-related pupil responses. Journal of Vision,
% 16(3), 28. https://doi.org/10.1167/16.3.28
Expand Down
2 changes: 1 addition & 1 deletion src/pspm_bf_psrf_erl.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
% * td : Time resolution.
% * n : Number of layers / boxes.
% * tmax : t of the maximum amplitude in seconds.
%Reference
%References
% Hoeks, B., & Levelt, W.J.M. (1993).
% Pupillary Dilation as a Measure of Attention - a Quantitative System-Analysis.
% Behavior Research Methods Instruments & Computers, 25, 16-26.
Expand Down
2 changes: 1 addition & 1 deletion src/pspm_bf_psrf_fc.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
% * cs_d : Derivative of CS-evoked response in the basis set. Acceptable values are 0 and 1. Default as 0.
% * us : US-evoked response in the basis set. Acceptable values are 0 and 1. Default as 0.
% * us_shift : CS-US SOA in seconds. Ignored if us == 0. Default as 3.5.
%Reference
%References
% Christoph W. Korn, Matthias Staib, Athina Tzovara, Giuseppe Castegnetti,
% and Dominik R. Bach (2017) A pupil size response model to assess fear learning.
% Psychophysiology, 54, 330-343, DOI: 10.1111/psyp.12801
Expand Down
2 changes: 1 addition & 1 deletion src/pspm_bf_rarf_e.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
% * td: The time the response function should have.
% * bf_type: Can be either 0 or 1. If 0, returns the response function only.
% If 1, (default) returns the response function and the time derivative.
%Reference
%References
% Dominik R. Bach, Samuel Gerster, Athina Tzovara, Giuseppe Castegnetti,
% A linear model for event-related respiration responses,
% Journal of Neuroscience Methods, Volume 270, 1 September 2016, Pages 147-155,
Expand Down
2 changes: 1 addition & 1 deletion src/pspm_bf_rfrrf_e.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
% * bf_type: Type of the basis function, can be either 0 or 1. Default as 1.
% If 0, returns the response function only.
% If 1, returns the response function and the time derivative.
%Reference
%References
% Dominik R. Bach, Samuel Gerster, Athina Tzovara, Giuseppe Castegnetti,
% A linear model for event-related respiration responses,
% Journal of Neuroscience Methods, Volume 270, 1 September 2016, Pages 147-155,
Expand Down
2 changes: 1 addition & 1 deletion src/pspm_bf_rprf_e.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
% * bf_type: Type of the basis function, can be either 0 or 1. Default as 0.
% If 0, returns the response function only.
% If 1, returns the response function and the time derivative.
%Reference
%References
% Dominik R. Bach, Samuel Gerster, Athina Tzovara, Giuseppe Castegnetti,
% A linear model for event-related respiration responses,
% Journal of Neuroscience Methods, Volume 270, 1 September 2016, Pages 147-155,
Expand Down
2 changes: 1 addition & 1 deletion src/pspm_bf_scrf.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
% ● Arguments
% * td : Time resolution in second.
% * d : Number of derivatives. Default as 0.
%Reference
%References
% Bach DR, Flandin G, Friston KJ, Dolan RJ (2010). Modelling event-related
% skin conductance responses. International Journal of Psychophysiology,
% 75, 349-356.
Expand Down
2 changes: 1 addition & 1 deletion src/pspm_bf_scrf_f.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
% * td : Time resolution in s.
% * p : An array with variables as (1) Time to peak; (2) Variance of rise defining
% gaussian; and (3--4) Decay constants.
%Reference
%References
% Bach DR, Flandin G, Friston KJ, Dolan RJ (2010). Modelling event-related skin
% conductance responses. International Journal of Psychophysiology, 75, 349-356.
% ● History
Expand Down
2 changes: 1 addition & 1 deletion src/pspm_bf_sebrf.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
% * td : Time resolution in s.
% * d : Whether first derivative should be included (1) or not (0). Default as 0.
% * g : Whether gaussian to model the tail should be included (1) or not (0). Default as 0.
%Reference
%References
% Khemka S, Tzovara A, Gerster S, Quednow B and Bach DR (2016)
% Modeling Startle Eyeblink Electromyogram to Assess Fear Learning.
% Psychophysiology. 2017 Feb; 54(2): 204–214.
Expand Down
2 changes: 1 addition & 1 deletion src/pspm_bf_spsrf_gamma.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
% ● Arguments
% * td : time resolution in second.
% * p : An array of A, x0, a, and b (in order).
%Reference
%References
% Xia Y, Melinscak F, Bach DR (2020)
% Saccadic Scanpath Length: An Index for Human Threat Conditioning
% Behavioral Research Methods 53, pages 1426–1439 (2021)
Expand Down
2 changes: 1 addition & 1 deletion src/pspm_butter.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
% ● Arguments
% * order: the order of the Butterworth filter to be designed
% * freqratio: the cut-off frequency of the Butterworth filter to be designed
%Output
%Outputs
% * sts: -1 if non-standard filters are requested
% ● History
% Introduced in PsPM 3.0
Expand Down
2 changes: 1 addition & 1 deletion src/pspm_check_data.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
% conversions.
% ● Format
% [sts, data] = pspm_check_data(data, infos)
% ● Developer's notes
% ● Developer
% This code is taken from pspm_load_data; it could be improved using cellfun.
% ● History
% Introducted in Version 7.0
Expand Down
2 changes: 1 addition & 1 deletion src/pspm_check_model.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function [model, options] = pspm_check_model(model, options, modeltype)
%Definition
%Description
% pspm_check_model automatically determine the fields of the struct model
% for the corresponding function. It also checks the options structure
% and uses it to determine whether overwriting of the model file is
Expand Down
2 changes: 1 addition & 1 deletion src/pspm_convert_area2diameter.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
% └.channel_action : ['add'/'replace', default as 'add']
% Defines whether the new channel should be added or the previous
% outputs of this function should be replaced.
%Output
%Outputs
% * channel_index : index of channel containing the processed data
% ● History
% Introduced in PsPM 3.1
Expand Down
2 changes: 1 addition & 1 deletion src/pspm_convert_au2unit.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
% └.channel_action : ['add'/'replace', default as 'add']
% Defines whether the new channel should be added or the previous
% outputs of this function should be replaced.
%Output
%Outputs
% * channel_index : Index of channel containing the processed data.
% ● History
% Introduced in PsPM 3.1
Expand Down
6 changes: 3 additions & 3 deletions src/pspm_convert_ecg2hb.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
% Defines whether the new channel should be added or
% the previous outputs of this function should be replaced.
%
%Output
%Outputs
% * channel_index: index of channel containing the processed data
% * quality_info: generated if options.debugmode == 1
%Reference
%References
% [1] Adjusted algorithm:
% Paulus PC, Castegnetti G, & Bach DR (2016). Modeling event-related
% heart period responses. Psychophysiology, 53, 837-846.
Expand All @@ -47,7 +47,7 @@
% Written in 2013-2015 Philipp C Paulus & Dominik R Bach
% (Technische Universitaet Dresden, University of Zurich)
% Updated in 2022 Teddy
% ● Developer's Notes
% ● Developer
% ▶︎ Changes from the original Pan & Tompkins algorithm
% filter: P. & T. intend to achieve a pass band from 5-15 Hz with a
% real-time filter. This function uses an offline second
Expand Down
2 changes: 1 addition & 1 deletion src/pspm_convert_gaze.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
% │ Default is 'gaze'.
% └.channel_action: Channel action for sps data, add / replace existing sps
% data (default: add)
%Output
%Outputs
% * channel_index: index of channel containing the processed data
% ● History
% Introduced in PsPM 4.3.1
Expand Down
4 changes: 2 additions & 2 deletions src/pspm_convert_hb2hp.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
% └─────────.lower: [numeric]
% Specifies the lower limit of the
% heart periods in seconds. Default is 0.2.
%Output
%Outputs
% * channel_index: index of channel containing the processed data
%Reference
%References
% [1] Paulus PC, Castegnetti G, & Bach DR (2016). Modeling event-related
% heart period responses. Psychophysiology, 53, 837-846.
% ● History
Expand Down
2 changes: 1 addition & 1 deletion src/pspm_convert_ppg2hb.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
% └───.python_path: [char] for method 'heartpy'
% The path where python can be found. Mandatory if
% python environment is not yet set up
%Output
%Outputs
% * channel_index: index of channel containing the processed data
% ● References
% [1] van Gent, P, Farah, H, van Nes, N, & van Arem, B. (2019) Heartpy:
Expand Down
2 changes: 1 addition & 1 deletion src/pspm_convert_visual_angle_core.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
% * width: screen width in same units as data
% * height: screen height in same units as data
% * distance: screen distance in same units as data
%Output
%Outputs
% * lat: the latitude in degrees (x-direction)
% * lon: the longitude in degrees (y-direction)
% * lat_range: the latitude range
Expand Down
4 changes: 2 additions & 2 deletions src/pspm_dcm.m
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@
% └.eventnames: Cell array of names for individual events,
% in the order they are specified in the model.timing array -
% to be used for display and export only
%Output
%Outputs
% * fn : Name of the model file.
% * dcm : Model struct. Output units: all timeunits are in seconds;
% eSCR and aSCR amplitude are in SN units such that an
% eSCR SN pulse with 1 unit amplitude causes an eSCR with
% 1 mcS amplitude.
% ● Developer's Notes
% ● Developer
% 1. pspm_dcm can handle NaN values in data channels. Either by specifying
% missing epochs manually using model.missing, or by detecting NaN epochs
% in the data. Missing epochs shorter than model.substhresh will be ignored
Expand Down
2 changes: 1 addition & 1 deletion src/pspm_dcm_inv.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
% and aSCR amplitude are in SN units such that an
% eSCR SN pulse with 1 unit amplitude causes an eSCR
% with 1 mcS amplitude (unless model.norm = 1).
% ● Developer Notes
% ● Developer
% There are two event types: flexible and fixed. The terminology is to call
% flexible responses aSCR (anticipatory) and fixed responses eSCR (evoked
% SCR).
Expand Down
2 changes: 1 addition & 1 deletion src/pspm_denoise_spike.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
% * header : header of data
% * kbdata : keyboard channel data
% * cutoff : the cut off value for denoising
%Arguments
%Outputs
% * data: denoised data
% ● History
% Introduced in PsPM 3.0
Expand Down
2 changes: 1 addition & 1 deletion src/pspm_downsample.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
% * sr: original sampling rate of the input data.
% * sr_down: targeted downsampling rate.
%
%Output
%Outputs
% * sts: -1 if the frequency ratio is not an integer
% ● History
% Introduced in PsPM 3.0
Expand Down
4 changes: 2 additions & 2 deletions src/pspm_emg_pp.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
% └.channel_action: ['add'/'replace'] Defines whether the new channel should
% be added or the previous outputs of this function should
% be replaced. (Default: 'replace')
%Output
% channel_index: index of channel containing the processed data
%Outputs
% * channel_index: index of channel containing the processed data
% ● References
% [1] Khemka S, Tzovara A, Gerster S, Quednow BB, Bach DR (2017).
% Modelling startle eye blink electromyogram to assess fear learning.
Expand Down
2 changes: 1 addition & 1 deletion src/pspm_epochs2logical.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
% * datalength : length of the resulting logical index
% * sr : if epochs are specified in seconds: sample rate
% if epochs are specified in terms of data samples: 1
%Output
%Outputs
% * index : [logical] index
% ● History
% Introduced in PsPM 6.1.2
Expand Down
2 changes: 1 addition & 1 deletion src/pspm_expand_epochs.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
% │ is epochs file.)
% └────.channel_action: Channel action, add / replace existing data
% data (default: add)
%Output
%Outputs
% * channel_index: index of channel containing the processed data
% ● History
% Introduced in PsPM 7.0
Expand Down
Loading

0 comments on commit 83eea93

Please sign in to comment.