CSC-UW / csc-eeg-tools

Set of matlab functions for EEG io, preprocessing, analysis from the Center for Sleep and Consciousness, University of Wisconsin (csc)
19 stars 7 forks source link

multifile event handling in csc_convert_from_raw is problematic #3

Open riedner opened 9 years ago

riedner commented 9 years ago

Head is created for every file input in a loop (line 22)

Head is used for the eventcodes (line 65) but it is re-created for every file loop (line 22). This will crash if the last file doesn't have the correct eventcodes (e.g. if it doesn't have any events and any other file does)

Mensen commented 9 years ago

Yes, I spotted this problem when I tried to use it for my own data recently. In fact this function essentially ignores any events in the data as we used the function for sleep data conversion before.

I have just reverted to the basic EEG = pop_readegi for all the work I need and then EEG = pop_mergeset(...) if I need to concatenate. This way I can import a segment, downsample it and then concatenate which avoids loading a lot of data into RAM at once.

This script is based on eeglab's own pop_readsegegi so if the function is useful we can take more ideas about the event processing from there.