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

Fix issue 559 #562

Conversation

teddychao
Copy link
Contributor

@teddychao teddychao commented Dec 18, 2023

Summary

This pull request aims at

  1. Solving the issue pspm_convert_ppg2hb supports both options.replace and options.channel_action #559.
  2. Review all the cfg_run functions for preparing the next release.
  3. Make sure all the cfg_run functions initialise options before using it and check fields are available in job before transferring data to options.

New functions

There is now a new function pspm_update_struct. The function can assess the struct fields and transfer the information to the new struct when the field is available.

New test function

There is now a new text function pspm_update_struct_test. The function tests whether pspm_update_struct can transfer field values correctly.

Function-specific updates

Function Updates
pspm_cfg_run_artefact_rm Use pspm_update_struct (lines 4, 19--24)
pspm_cfg_run_contrast1 Use pspm_update_struct (lines 18)
pspm_cfg_run_contrast2 Use pspm_update_struct (lines 37)
pspm_cfg_run_data_convert Use pspm_update_struct (lines 18--19)
pspm_cfg_run_dcm Initialise options (line 12). Use pspm_update_struct (lines 82, 90--102)
pspm_cfg_run_downsample Initialise options (line 3). Use pspm_update_struct (line 9)
pspm_cfg_run_ecg_editor Use pspm_update_struct (line 20--22)
pspm_cfg_run_export Use pspm_update_struct (line 15)
pspm_cfg_run_extract_segments Use pspm_update_struct (line 45)
pspm_cfg_run_find_sounds Initialise options (line 5). Use pspm_update_struct (line 18, 24)
pspm_cfg_run_find_valid_fixations Use pspm_update_struct (line 23, 33, 46)
pspm_cfg_run_gaze_convert Initialise options (line 4). Use pspm_update_struct (line 5, 8)
pspm_cfg_run_get_markerinfo Use pspm_update_struct (line 9)
pspm_cfg_run_glm Initialise options (line 5). Use pspm_update_struct (line 72, 107)
pspm_cfg_run_glm_sps The [] at line 22 and 25 (were 35 and 38) for soa was removed because it does not seem to be necessary.
pspm_cfg_run_import Initialise options (line 86). Use pspm_update_struct (line 51--53, 78--83, 87)
pspm_cfg_run_interpolate Use pspm_update_struct (line 6, 18)
pspm_cfg_run_merge Initialise options (line 8). Use pspm_update_struct (line 10--13)
pspm_cfg_run_pp_emg_data Use pspm_update_struct (line 4)
pspm_cfg_run_pp_heart_data Use pspm_update_struct (line 37, 40, 46, 53, 59--66, 72, 80)
pspm_cfg_run_proc_illuminance Use pspm_update_struct (line 11--12)
pspm_cfg_run_pupil_correct Use pspm_update_struct (line 10--19, 21--25)
pspm_cfg_run_pupil_preprocess Use pspm_update_struct (line 14, 20)
pspm_cfg_run_pupil_size_convert Use pspm_update_struct (line 6)
pspm_cfg_run_segment_mean Use pspm_update_struct (line 6)
pspm_cfg_run_sf Use pspm_update_struct (line 65--68)
pspm_cfg_run_trim Use pspm_update_struct (line 4)

@teddychao teddychao added the In Progress Currently being worked on label Dec 18, 2023
@teddychao teddychao added this to the v6.1.1 milestone Dec 18, 2023
@teddychao
Copy link
Contributor Author

Hi @dominikbach
I am using this pull request to review and polish the cfg_run functions. I think some of them are outdated and should be fixed in line with the new pspm_options. I will mark it to be "ready for review" when I finish.
Best wishes
Teddy

@teddychao teddychao self-assigned this Jan 8, 2024
This was referenced Jan 17, 2024
@dominikbach
Copy link
Contributor

The first step (import) of the GLM tutorial yields the following error:

------------------------------------------------------------------------
24-Jan-2024 16:35:59 - Running job #1
------------------------------------------------------------------------
24-Jan-2024 16:36:00 - Running 'Import'
24-Jan-2024 16:36:00 - Failed  'Import'
Brace indexing is not supported for variables of this type.
In file "/Users/dominik/Documents/PublicData/PsPM/src/pspm_cfg/pspm_update_struct.m" (???), function "pspm_update_struct" at line 13.
In file "/Users/dominik/Documents/PublicData/PsPM/src/pspm_cfg/pspm_cfg_run_import.m" (???), function "pspm_cfg_run_import" at line 87.

The following modules did not run:
Failed: Import
If the problem can be fixed without modifying the job, the computation can be resumed by running
   cfg_util('cont',1)
from the MATLAB command line.

@dominikbach dominikbach modified the milestones: v6.1.2, v6.2 Jan 24, 2024
@dominikbach dominikbach mentioned this pull request Jan 26, 2024
@teddychao teddychao removed the In Progress Currently being worked on label Jan 26, 2024
…d-optionschannel_action' of https://github.com/bachlab/PsPM into 559-pspm_convert_ppg2hb-supports-both-optionsreplace-and-optionschannel_action
@teddychao teddychao added the In Progress Currently being worked on label Feb 4, 2024
@teddychao
Copy link
Contributor Author

The first step (import) of the GLM tutorial yields the following error:

------------------------------------------------------------------------
24-Jan-2024 16:35:59 - Running job #1
------------------------------------------------------------------------
24-Jan-2024 16:36:00 - Running 'Import'
24-Jan-2024 16:36:00 - Failed  'Import'
Brace indexing is not supported for variables of this type.
In file "/Users/dominik/Documents/PublicData/PsPM/src/pspm_cfg/pspm_update_struct.m" (???), function "pspm_update_struct" at line 13.
In file "/Users/dominik/Documents/PublicData/PsPM/src/pspm_cfg/pspm_cfg_run_import.m" (???), function "pspm_cfg_run_import" at line 87.

The following modules did not run:
Failed: Import
If the problem can be fixed without modifying the job, the computation can be resumed by running
   cfg_util('cont',1)
from the MATLAB command line.

I apologise for this stupid error. I have fixed this bug systemically now. Please allow me to do some more tests...

@teddychao
Copy link
Contributor Author

teddychao commented Feb 5, 2024

Tested the new version and found it working now

Test GUI: Import

Not to overwrite

image

Overwrite

image

Test GUI: Trim

Not to overwrite

image

Overwrite

image

Test GUI: SCR for GLM

Not to overwrite

image

Overwrite

image

@teddychao teddychao marked this pull request as ready for review February 5, 2024 15:13
@teddychao teddychao added Completed & Waiting for Review Completed and waiting for review and removed In Progress Currently being worked on labels Feb 5, 2024
@dominikbach dominikbach merged commit d671bde into develop Feb 5, 2024
1 check passed
@dominikbach dominikbach deleted the 559-pspm_convert_ppg2hb-supports-both-optionsreplace-and-optionschannel_action branch February 5, 2024 18:30
@teddychao teddychao removed the Completed & Waiting for Review Completed and waiting for review label Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pspm_convert_ppg2hb supports both options.replace and options.channel_action
2 participants