Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify help #735

Merged
merged 57 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
5d95c8f
new function to generate help texts and some examples'
Jun 19, 2024
1eb7390
further updates
Jun 20, 2024
bef6421
pspm_scr_pp help
Jun 20, 2024
c353c36
new help text formatting function
Jun 22, 2024
ad085b3
further help formatting
Jun 24, 2024
72fc5a3
stylise pspm_extract_segments
Jun 24, 2024
6c85d51
stylise help for various functions
Jun 25, 2024
90b6676
update location of button "Batch"
teddychao Jul 4, 2024
b5b386f
Revert "update location of button "Batch""
teddychao Jul 4, 2024
f8550b9
Merge branch 'develop' into unify-help
dominikbach Jul 15, 2024
eabfdd6
Merge branch 'develop' into unify-help
dominikbach Jul 16, 2024
fe3edee
further changes
Jul 16, 2024
7cc5f04
merge base branch
Jul 16, 2024
2cb191e
Merge branch 'develop' into unify-help
dominikbach Jul 16, 2024
101fbb6
Merge branch 'develop' into unify-help
dominikbach Jul 29, 2024
73fe0a0
minor changes to init and help-2
Jul 29, 2024
502f14b
fix merge conflicts in help texts
Jul 29, 2024
fa5a693
Merge branch 'develop' into unify-help
teddychao Jul 29, 2024
5f15a0a
Merge branch 'develop' into unify-help
teddychao Jul 30, 2024
82a8020
updates
Jul 31, 2024
04ad069
merge
Jul 31, 2024
6c3aa5b
updates
Jul 31, 2024
156a3a4
futher updates and fixes
Aug 1, 2024
ca15ab7
Merge branch 'develop' into unify-help
teddychao Aug 5, 2024
10a366d
Merge branch 'develop' into unify-help
dominikbach Aug 5, 2024
fda7f20
update pspm_combine_markerchannels GUI
Aug 5, 2024
443840b
fix pspm_find_valid_fixations afte r merge conflict
Aug 5, 2024
9779760
Update help for pspm_export, and reove some glitches
Aug 5, 2024
cb65679
modify pspm_merge GUI
Aug 6, 2024
3f28670
modify pspm_merge GUI
Aug 6, 2024
9aa2a88
modify pspm_rename GUI
Aug 6, 2024
14ba0dc
modify GUI for pspm_trim and fix bug in pspm_trim
Aug 6, 2024
3c03989
modify GUI for pspm_get_markerinfo and fix bug in pspm_get_markerinfo
Aug 6, 2024
dfaee62
modify GUI for pspm_split_sessions
Aug 6, 2024
4a50853
modify GUI for pspm_pp
Aug 6, 2024
e8997a4
modify GUI for pspm_convert_gaze
Aug 6, 2024
005f35d
modify GUI for pspm_interpolate
Aug 6, 2024
0d286c7
modify GUI for pspm_extract_segments
Aug 6, 2024
2042211
modify GUI for pspm_find_valid_fixations
Aug 6, 2024
0c9de89
modify glm GUI
Aug 7, 2024
6df5e92
modify GUI for pspm_emg_pp
Aug 7, 2024
089552b
modify GUI for heart preprocessing
Aug 7, 2024
9a2ceea
modify pspm_quit
Aug 7, 2024
7d8176b
modify pspm_scr_pp gui and fix helptext in pspm_load_channel
Aug 7, 2024
6355767
update scr_pp help text
Aug 7, 2024
a23986f
update GUI for pspm_pupil_correct_eyelink
Aug 7, 2024
9cfe798
Merge branch 'develop' into unify-help
dominikbach Aug 7, 2024
3512842
modify GUI for pupil_preprocess, pupil_size_convert and resp_pp
Aug 8, 2024
aa7321a
delete unused pspm_cfg_segment_mean
Aug 8, 2024
248477b
modify SF GUI
Aug 8, 2024
51083b6
modify data_editor GUI
Aug 8, 2024
87f432c
modify dcm GUI
Aug 8, 2024
e832e2e
modify ecg_editor GUI and delete unused cfg item
Aug 8, 2024
1c69d0e
modify import GUI
Aug 8, 2024
d0d369c
merge develop into this branch
Aug 12, 2024
e1141bf
fix minor issues found during code review.
Aug 12, 2024
e582d19
Merge branch 'develop' into unify-help
dominikbach Aug 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/pspm_cfg/pspm_cfg_combine_markerchannels.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
combine_markerchannels.val = {datafile, channel_action, marker_chan};
combine_markerchannels.prog = @pspm_cfg_run_combine_markerchannels;
combine_markerchannels.vout = @pspm_cfg_vout_outchannel;
combine_markerchannels.help = {['The feature combine marker channels ',...
'can combine all the marker channels of a data file and add the ',...
'result to the original data file, specified by channel action.']};
combine_markerchannels.help = pspm_cfg_help_format('pspm_combine_markerchannels');



Expand Down
2 changes: 1 addition & 1 deletion src/pspm_cfg/pspm_cfg_data_editor.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@
data_editor.tag = 'data_editor';
data_editor.val = {datafile, epochfile, outputfile};
data_editor.prog = @pspm_cfg_run_data_editor;
data_editor.help = {['']};
data_editor.help = pspm_cfg_help_format('pspm_data_editor');
47 changes: 7 additions & 40 deletions src/pspm_cfg/pspm_cfg_dcm.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,21 @@
timingfile.tag = 'timingfile';
timingfile.num = [1 1];
%timingfile.filter = '.*\.(mat|MAT)$';
timingfile.help = {['The timing file has to be a .mat file containing a cell array called "epochs". ' ...
'For a design with n trials and m events per trial (n x m events in total), the cell array has to be ' ...
'structured in the following way:'], '', ['Create m cells in the cell array (one per event ' ...
'type that occurs in each trial). Each cell defines either a fixed or a flexible event type.', ...
'A cell that defines a fixed event type has to contain a vector with n entries, i.e. one time point per ' ...
'trial, in seconds, samples or markers.'], ['A cell that defines a flexible type has to contain an ' ...
'array with n rows and two columns. The first column specifies the onsets of the time windows for each trial, ' ...
'while the second column specifies the offsets of the time windows.'] ,'', ['It is assumed that ' ...
'all trials have the same structure, i.e. the same number of fixed and flexible event types. For individual ' ...
'trials with a different structure you can enter negative values as time information to omit estimation of a ' ...
'response.'], '', ['For later comparison between trials of different conditions, it is absolutely mandatory ' ...
'that they contain the same types of events, to avoid bias. Hence, if one condition omits an event (e. g. ' ...
'unreinforced trials in conditioning experiments), the omitted event needs to be modelled as well.']};
timingfile.help = {settings.help.pspm_dcm.Arguments.model.timing};

name = cfg_entry;
name.name = 'Name';
name.tag = 'name';
name.strtype = 's';
name.val = {''};
name.help = {'Optional: Enter a name of the event. This name can later be used for display and export.'};
name.help = {settings.help.pspm_dcm.Arguments.options.trlnames};

onsets = cfg_entry;
onsets.name = 'Onsets';
onsets.tag = 'onsets';
onsets.strtype = 'r';
onsets.num = [Inf Inf];
onsets.help = {['For events with a fixed response, specify a vector of onsets. The length of the ' ...
'vector corresponds to the number of trials (n).'], '', ['For events with a flexible response, ' ...
'specify a two column array. The first column defines the onset of the time window in which the ' ...
'response occurs. The second column defines the offset. The number of rows of the array corresponds ' ...
'to the number of trials (n).'], '', ['All timings have to be indicated in seconds.']};

onsets.help = {settings.help.pspm_dcm.Arguments.model.timing};

timing_man = cfg_branch;
timing_man.name = 'Event';
Expand Down Expand Up @@ -109,29 +92,22 @@
condition_rep.values = {condition};
condition_rep.num = [0 Inf];
condition_rep.check = @pspm_cfg_dcm_check_conditions;
condition_rep.help = {['Optional: Specify the conditions that the individual trials belong to.'], ['This information ' ...
'is not used for the parameter estimation of the DCM routine, but it allows you to later access the ' ...
'conditions in the contrast manager.']};
condition_rep.help = {settings.help.pspm_dcm.Arguments.options.trlnames};

% Missing epochs
no_epochs = cfg_const;
no_epochs.name = 'No Missing Epochs';
no_epochs.tag = 'no_epochs';
no_epochs.val = {0};
no_epochs.help = {['Missing epochs are detected automatically ', ...
'according to the data option ''Subsession threshold''.']};
no_epochs.help = {};


epochentry = cfg_entry;
epochentry.name = 'Enter Missing Epochs Manually (discouraged)';
epochentry.tag = 'epochentry';
epochentry.strtype = 'i';
epochentry.num = [Inf 2];
epochentry.help = {['Enter the start and end points of missing epochs ', ...
'(m) manually.'], ['Specify an m x 2 array, where m is the number ', ...
'of missing epochs. The first column marks the ' ...
'start points of the epochs that are excluded from the analysis ', ...
'and the second column the end points.']};
epochentry.help = {settings.help.pspm_dcm.Arguments.model.missing};

epochs = cfg_choice;
epochs.name = 'Define Missing Epochs';
Expand Down Expand Up @@ -407,16 +383,7 @@
dcm.val = {modelfile, chan, session_rep, data_options, resp_options, inv_options, disp_options};
dcm.prog = @pspm_cfg_run_dcm;
dcm.vout = @pspm_cfg_vout_modelfile;
dcm.help = {['Non-linear models for SCR are powerful if response timing is not precisely known and has to be ' ...
'estimated. A typical example are anticipatory SCR in fear conditioning � they must occur at some point ' ...
'within a time-window of several seconds duration, but that time point may vary over trials. Dynamic ' ...
'causal modelling (DCM) is the framework for parameter estimation. PsPM implements an iterative ' ...
'trial-by-trial algorithm. Different from GLM, response parameters are estimated per trial, not per ' ...
'condition, and the algorithm must not be informed about the condition. Trial-by-trial response parameters ' ...
'can later be summarized across trials, and compared between conditions, using the contrast manager.'], '', ...
'References:', '', ...
'Bach, Daunizeau et al. (2010) Biological Psychology (Model development)', '', ...
'Staib et al. (2015) Journal of Neuroscience Methods (Optimising a model-based approach)'};
dcm.help = pspm_cfg_help_format('pspm_dcm');


function [sts, val] = pspm_cfg_dcm_check_conditions(val)
Expand Down
7 changes: 1 addition & 6 deletions src/pspm_cfg/pspm_cfg_display.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,5 @@
display.tag = 'display';
display.val = {datafile};
display.prog = @pspm_cfg_run_display;
display.help = {'Display PsPM data file in a new figure.'};
display.help = pspm_cfg_help_format('pspm_display');


function pspm_cfg_run_display(job)
pspm_display(job.datafile{1});
end
end
26 changes: 8 additions & 18 deletions src/pspm_cfg/pspm_cfg_export.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
function export = pspm_cfg_export

%% Initialise
global settings

%% Standard items
outfile = pspm_cfg_selector_outputfile();
modelfile = pspm_cfg_selector_datafile('model', inf);
Expand All @@ -26,29 +29,17 @@
datatype.val = {'param'};
datatype.labels = {'All parameters','One parameter per condition','Reconstructed amplitude estimate'};
datatype.values = {'param','cond','recon'};
datatype.help = {['Normally, all parameter estimates are exported. For GLM, you can choose to ' ...
'only export the first basis function per condition, or the reconstructed response per condition. ' ...
'For DCM, you can specify contrasts based on conditions as well. This will average within conditions. ', ...
'This argument cannot be used for other first-level models.'], ...
'', ...
'- All parameters: Export all parameter estimates.', '', ...
['- One parameter per condition: Export conditions in a GLM, automatically detects number ' ...
'of basis functions and uses only the first one (i.e. without derivatives), ', ...
'or export condition averages in DCM.'], '', ...
['- Reconstructed amplitude estimate: Export all conditions in a GLM, reconstructs estimated response ' ...
'from all basis functions and export the peak amplitude of the estimated response.'], ''};
datatype.help = pspm_cfg_help_format('pspm_export', 'options.statstype');

%Exclude conditions with too many NaN
exclude_missing = cfg_menu;
exclude_missing.name = 'Exclude condtitions with too many NaN';
exclude_missing.name = 'Exclude conditions with too many NaN';
exclude_missing.tag = 'exclude_missing';
exclude_missing.val = {false};
exclude_missing.labels = {'No', 'Yes'};
exclude_missing.values = {false, true};
exclude_missing.help ={['Exclude parameters from conditions with too many NaN ',...
'values. This option can only be used for GLM file for ',...
'which the corresponding option was used during model ',...
'setup. Otherwise this argument is ignored.']};
exclude_missing.help = pspm_cfg_help_format('pspm_export', 'options.exclude_missing');

% Delimiter
tab = cfg_const;
tab.name = 'Tab';
Expand Down Expand Up @@ -88,12 +79,11 @@
delim.help = {''};



%% Executable Branch
export = cfg_exbranch;
export.name = 'Export Statistics';
export.tag = 'export';
export.val = {modelfile, datatype, exclude_missing, target, delim};
export.prog = @pspm_cfg_run_export;
export.vout = @pspm_cfg_vout_outfile;
export.help = {'Export statistics to a file for further analysis in statistical software, or to the screen.'};
export.help = pspm_cfg_help_format('pspm_export');
29 changes: 11 additions & 18 deletions src/pspm_cfg/pspm_cfg_extract_segments.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,23 @@
mode_manual.tag = 'mode_manual';

mode_manual.val = {channel, timeunits, design};
mode_manual.help = {['Specify all the settings manually.']};
mode_manual.help = {};


%% Automatic mode
mode_automatic = cfg_branch;
mode_automatic.name = 'Automatically read from model file (GLM, or non-linear SCR model)';
mode_automatic.tag = 'mode_automatic';
mode_automatic.val = {modelfile};
mode_automatic.help = {['Extracts all relevant information from a GLM or']...
['non-linear SCR model file. To distinguish between conditions in a']...
['non-linear model, trialnames must be specified in the model definition ']...
['(before running it)']};
mode_automatic.help = {};

%% Mode
extract_mode = cfg_choice;
extract_mode.name = 'Mode';
extract_mode.tag = 'mode';
extract_mode.val = {mode_automatic};
extract_mode.values = {mode_automatic, mode_manual};
extract_mode.help = {['Either extract all information from a ', ...
'model file or define the relevant information manually. ']};
extract_mode.help = {['Extract from model, or define onsets explicitly.']};


%% Segment length
Expand All @@ -53,8 +49,7 @@
segment_length.strtype = 'r';
segment_length.num = [1 1];
segment_length.val = {10};
segment_length.help = {['Length of segments in seconds. Default: 10 s.']};

segment_length.help = pspm_cfg_help_format('pspm_extract_segments', 'options.length');

%% Outputfile for nan-percentage
nan_none = cfg_const;
Expand All @@ -67,22 +62,22 @@
nan_screen.name = 'Screen';
nan_screen.tag = 'nan_screen';
nan_screen.val = {'screen'};
nan_screen.help = {'Output to screen.'};
nan_screen.help = {};

%% NaN output
nan_output = cfg_choice;
nan_output.name = 'NaN-output';
nan_output.name = 'NaN output';
nan_output.tag = 'nan_output';
nan_output.val = {nan_none};
nan_output.values = {nan_none, nan_screen, nan_outputfile};
nan_output.help = {'Option to output the percentages of NaN values of each trial and over all trials per condition'};
nan_output.help = pspm_cfg_help_format('pspm_extract_segments', 'options.nan_output');

%% Options
options = cfg_branch;
options.name = 'Options';
options.tag = 'options';
options.val = {segment_length, nan_output};
options.help = {['Change values of optional settings.']};
options.help = {};

%% Plot
plot = cfg_menu;
Expand All @@ -91,14 +86,13 @@
plot.val = {false};
plot.labels = {'No', 'Yes'};
plot.values = {false, true};
plot.help = {['Plot means over conditions with standard error of the mean.']};

plot.help = pspm_cfg_help_format('pspm_extract_segments', 'options.plot');
%% Output
output = cfg_branch;
output.name = 'Output';
output.tag = 'output';
output.val = {outputfile, plot};
output.help = {['Output settings.']};
output.help = {};

%% Executable branch
extract_segments = cfg_exbranch;
Expand All @@ -107,7 +101,6 @@
extract_segments.val = {extract_mode, options, output};
extract_segments.prog = @pspm_cfg_run_extract_segments;
extract_segments.vout = @pspm_cfg_vout_outfile;
extract_segments.help = {['This function extracts data segments ', ...
'(e.g., for visual inspection of mean responses per condition).']};
extract_segments.help = pspm_cfg_help_format('pspm_extract_segments');


23 changes: 6 additions & 17 deletions src/pspm_cfg/pspm_cfg_filtering.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,22 @@
tau.tag = 'tau';
tau.strtype = 'r';
tau.num = [1 1];
tau.help = {'Time constant in seconds.'};
tau.help = pspm_cfg_help_format('pspm_pp', 'tau');

FilterLeaky = cfg_branch;
FilterLeaky.name = 'Leaky Integrator';
FilterLeaky.tag = 'leaky_integrator';
FilterLeaky.val = {tau};
FilterLeaky.help = {''};

%% Medianfilter
nr_time_pt = cfg_entry;
nr_time_pt.name = 'Number of Time Points';
nr_time_pt.tag = 'nr_time_pt';
nr_time_pt.strtype = 'i';
nr_time_pt.num = [1 1];
nr_time_pt.help = {'Number of time points over which the median is taken.'};
nr_time_pt.help = pspm_cfg_help_format('pspm_pp', 'n');

% Medianfilter
FilterMedian = cfg_branch;
FilterMedian.name = 'Median Filter';
Expand All @@ -39,13 +41,7 @@
filtertype.name = 'Filter Type';
filtertype.tag = 'filtertype';
filtertype.values = {FilterMedian,FilterButter,FilterLeaky};
filtertype.help = {['Currently, median and Butterworth ',...
'filters and a leaky integrator are implemented. A median filter is ' ...
'recommended for short spikes, generated ' ...
'for example in MRI scanners by gradient ' ...
'switching. A butterworth filter is already applied ' ...
'in most psychophysiological models; check there to see whether ' ...
'an additional filtering is meaningful. A leaky integrater is often used for EMG or neural data.']};
filtertype.help = {};

%% Executable branch
filtering = cfg_exbranch;
Expand All @@ -55,12 +51,5 @@
filtering.val = {datafile,chan_nr, chan_action, filtertype};
filtering.prog = @pspm_cfg_run_filtering;
filtering.vout = @pspm_cfg_vout_outchannel;
filtering.help = {['This module offers several basic filtering functions. ',...
'Currently, a median filter and a butterworth low pass ' ...
'filter are implemented. The median filter is useful to ' ...
'remove short "spikes" in the data, for example from gradient ' ...
'switching in MRI. The Butterworth filter can be used to get ' ...
'rid of high frequency noise that is not sufficiently ',...
'filtered away by the filters implemented on-the-fly during ',...
'first level modelling.']};
filtering.help = pspm_cfg_help_format('pspm_pp');

Loading
Loading