CereLink icon indicating copy to clipboard operation
CereLink copied to clipboard

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

Open zeeMonkeez opened this issue 8 years ago • 3 comments
trafficstars

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.

zeeMonkeez avatar Mar 11 '17 02:03 zeeMonkeez

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

dashesy avatar Mar 11 '17 07:03 dashesy

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.

zeeMonkeez avatar Mar 22 '17 15:03 zeeMonkeez

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.

dashesy avatar Apr 18 '17 00:04 dashesy