This pull request simplifies and refactors pspm_extract_segments by
using functionality shared with glm, in particular pspm_multi2index and pspm_check_model
improving pspm_time2index and pspm_multi2index
using and improving pspm_extract_segments_core
removing trial sorting which is nowhere else provided or used in PsPM
durations are not used to define segment length because this makes no sense
instead, segment length is fixed for all trials
Overall, the function is reduced from 680 lines to 350 lines of code, without compromising the functionality
There are several important changes that make the function and its output easier to use:
Input method has changed to the three options file, data, model
The output data format has changed to rows (trials) x data points (columns), which is more intuitive
Fixes #631 . Fixes #608 .
This pull request simplifies and refactors
pspm_extract_segments
bypspm_multi2index
andpspm_check_model
pspm_time2index
andpspm_multi2index
pspm_extract_segments_core
There are several important changes that make the function and its output easier to use:
file
,data
,model