bachlab / PsPM

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

Fix Issue 484 --- `pspm_sf` #483

Closed teddychao closed 1 year ago

teddychao commented 1 year ago

Fixes #484.

Introduction

Missing epochs often appear in the imported data. It is expected to let users know the imported data contain missing epochs since they impact the results of processing. Specifically for this issue, the source data contains missing epochs at the beginning. Since some processing requires the initial values for determine its parameters, such missing epochs finally lead to errors. At the same time, the missing epochs cannot be ignored in VBA processing, and therefore there are further issues inside VBA functions. This pull request aims at resolving such initial missing epochs that disallow following analysis.

Methods

Results

teddychao commented 1 year ago

Hi @dominikbach @uzaygokay many thanks for approving this. I will send this updated package to Carlos for him to test. I will merge it when he feels comfortable with the updated code. Thank you

dominikbach commented 1 year ago

I realise now there is a more fundamental problem.

pspm_sf takes one or multiple data files as data inputs, and an epoch definition file as event input. It will then pass the data to pspm_sf_dcm for each identified epoch.

This means that the missing epoch definition needs to be retrieved in pspm_sf (if method is "dcm"), and a missing index needs to be passed on to pspm_sf_dcm.

teddychao commented 1 year ago

I realise now there is a more fundamental problem.

pspm_sf takes one or multiple data files as data inputs, and an epoch definition file as event input. It will then pass the data to pspm_sf_dcm for each identified epoch.

This means that the missing epoch definition needs to be retrieved in pspm_sf (if method is "dcm"), and a missing index needs to be passed on to pspm_sf_dcm.

This is indeed different from the design in pspm_dcm and pspm_dcm_inv... Can we open another pull request for this problem after agreeing the changes in this pull request that introduces SF's usage of missing epochs?

teddychao commented 1 year ago

I realise now there is a more fundamental problem.

pspm_sf takes one or multiple data files as data inputs, and an epoch definition file as event input. It will then pass the data to pspm_sf_dcm for each identified epoch.

This means that the missing epoch definition needs to be retrieved in pspm_sf (if method is "dcm"), and a missing index needs to be passed on to pspm_sf_dcm.

I think this issue has been resolved through the recent pull request #502 . I have merged #502 into this pull request.