CerebusOSS/CereLink

Example for how to generate NEV and NSx files from data stream

Opened this issue · 3 comments

Is there example code for how to save NEV and NSx files using cbsdk?

Background: the auto-split feature of Central (to roll over files after fixed intervals of say 3600s) has a few problems: it confuses analog and digital signal generation for ~50ms, loses >4ms of data, and often does not get the file date (in the header) right, so that files have incorrect offset relative to each other.

Nothing to save and NEV or NSx but n2h5 has a conversion to hdf5. The file format should be obvious here.

Sorry to open this again... Can you weigh in on best ways to capture the data? Essentially what I would do is to add a CBSDKCALLBACK_ALL, which extracts appropriate data and turns it into NEV/NSx packets, queues those in some thread-safe queues and have separate file save threads consume packets from these queues.
Does that sound stupid? Obviously, there'd have to be sanity checks in case the channel configuration changes.

I suggest recording to hdf file, but yes you should be able to listen to CBSDKCALLBACK_ALL and record analog and digital events. The problem is that then you have to go an update the headers, also you cannot change the channel settings in between.