bachlab / PsPM

A matlab suite for Psycho-Physiological Modelling
GNU General Public License v3.0
43 stars 11 forks source link

Update channel loading logic in GUI #666

Closed dominikbach closed 7 months ago

dominikbach commented 8 months ago

Fixes #609 .

Changes proposed in this pull request:

Single channel selection:

pspm_cfg_dcm
pspm_cfg_find_sounds
pspm_cfg_get_markerinfo
pspm_cfg_glm
pspm_cfg_pp_emg_data
pspm_cfg_pp_heart_data
pspm_cfg_pp_scr
pspm_cfg_sf
pspm_cfg_trim
pspm_cfg_resp_pp
pspm_cfg_split_sessions
pspm_cfg_sf
pspm_cfg_interpolate

Modality-agnostic channel selection

pspm_cfg_artefact_rm
pspm_cfg_extract_segments

Eyetracker channel selection

pspm_cfg_pupil_correct
pspm_cfg_pupil_preprocess
pspm_cfg_find_valid_fixations
pspm_cfg_gaze_convert
pspm_cfg_pupil_size_convert

multiple channels

pspm_cfg_combine_markerchannels

teddychao commented 8 months ago

Questions that are mentioned on the PsPM meeting

teddychao commented 7 months ago

Process of GUI checking

Function Process
pspm_cfg_dcm 🕒
pspm_cfg_find_sounds ⚠️
pspm_cfg_get_markerinfo
pspm_cfg_glm 🕒
pspm_cfg_pp_emg_data
pspm_cfg_pp_heart_data
pspm_cfg_pp_scr
pspm_cfg_sf ⚠️
pspm_cfg_trim
pspm_cfg_resp_pp
pspm_cfg_split_sessions
pspm_cfg_sf ⚠️
pspm_cfg_interpolate ⚠️
pspm_cfg_artefact_rm
pspm_cfg_extract_segments ⚠️
pspm_cfg_pupil_correct
pspm_cfg_pupil_preprocess
pspm_cfg_find_valid_fixations ⚠️
pspm_cfg_gaze_convert
pspm_cfg_pupil_size_convert
teddychao commented 7 months ago

Results

Data Preparation

Import

Data type Parameters Result
CED Spike (.smr) channel type = SCR, channel number = search, transfer function = none
CED Spike (.smr) channel type = SCR, channel number = 1, transfer function = none
CED Spike (.smrx) channel type = SCR, channel number = search, transfer function = none
CED Spike (.smrx) channel type = SCR, channel number = 1, transfer function = none
MATLAB channel type = SCR, channel number = 1, transfer function = none

Trim

Reference Variable Result
File /
first/last marker channel = channel number
any marker channel = default channel
marker according to values or names channel = default channel

Combine marker channels

Settings Result
channel action = add, channel number = 1
image

Data Preprocessing

Preprocessing SCR

✅ after correction.

Preprocessing heart rate

Feature Result
ECG to Heart Beat (Pan & Tompkins) ⚠️ Options such as .semi, .minHR, .maxHR are not available in the GUI
ECG to Heart Beat (AMRI)
Heart beat to heart period
PPG to heart beat
ECG to heart period ⚠️ Options such as .semi, .minHR, .maxHR are not available in the GUI

Find sounds

⚠️ Some Parameters, such as max delay, min delay, plot, are unavailable in the GUI. It could be an issue originally there and not targeted in this pull request.

Find valid fixations

⚠️ options.add_invalid does not seem to be available in GUI.

Pupil resize

The option mode has only the option area to diameter. It does not affect functionality but it would be better to put it in function description for UI and remove this option, because users are not expected to do anything with this option.

Tools

Artefact removal

Filter type Result
Median filter
Butterworth filter ✅ after correction
SCR preprocessing ⚠️ Currently unavailable from GUI

Interpolate missing data

⚠️ Some parameters, such as method, are not available in the GUI.

Split sessions

Tested all the possible variables, namely channel (channel number or default), split behaviour, and missing epoch. ✅

teddychao commented 7 months ago

Corrections

  1. src/ext/matlabbatch/cfg_util.m is converted into LF to make it in line with remaining functions.
  2. src/pspm_cfg/pspm_cfg_artefact_rm.m variable names changed to be lowercases to make it in line with other functions.
  3. In src/pspm/cfg/pspm_cfg_extract_segments.m, at line 187, timeunits should be timeunit.
teddychao commented 7 months ago

List of issues that I am unsure how to resolve

SF

image

The settings above leads to undefined mrk_chan in pspm_cfg_run_sf.

Extract segments

In the file pspm_cfg_run_extract_segments, at line 51--55, there is a switch loop where mode can be either auto or manual. mode is the first variable of pspm_extract_segments. However, in the function itself, the first variable is method. In the help text of pspm_extract_segments, method is not described In arguments, and I assume it is actually mode there. Yet, mode can be either file, data or model, so auto or manual is not included here. I do not know what is expected here.