NeuroNetMem / PythonPlugin

A plugin for open-ephys enabling the insertion of Cython into the open-ephys signal chain.
11 stars 17 forks source link

retrieve timestamps in bufferfunction #27

Open samuelgarcia opened 4 years ago

samuelgarcia commented 4 years ago

Is there a simple way to get timestamp info in the callback "bufferfunction" ?

Claybarn commented 4 years ago

No, but that is functionality that should exist. Could help you with that, but just to be sure:

1) You want timestamps for the buffer and not other events?

2) You can't use spike events for your application? They are created whenever OE detects a spike (as long as spike detector/viewer are in the signal chain) with a fixed buffer size of 18 centered around the spike?

Let me know.

samuelgarcia commented 4 years ago

I would like to have :

        def bufferfunction(self, n_arr, timestamp):
                """Access to voltage data buffer. Returns events""" 
                events = []
                return events

instead of

        def bufferfunction(self, n_arr):
                """Access to voltage data buffer. Returns events""" 
                events = []
                return events

I think it is quite easy todo but it will break existing pluing.

samuelgarcia commented 4 years ago

I need to timestmap spike from a given buffer to align then with other events.

My goal is to implement a new spike detector with my tridesclous realtime engine.

samuelgarcia commented 4 years ago

parralel question : do you plan to merge cmake_buuild into master ? I could make some proposal so.

Claybarn commented 4 years ago

It might not work with your setup, but I would at least think about using spike events as it would be the easiest to do at this point. The spike detector in OE doesn't sort the spikes, it just detects if one occurs or not and passes it to the other processors with the voltage trace of the spike and the timestamp.

Claybarn commented 4 years ago

As for merging the cmake build branch, I would rather start with the open-ephys-plugins one and get it up to speed as they have the more dedicated resources to maintain it. Although their version didn't work for me on Mac.

samuelgarcia commented 4 years ago

The open-ephys-plugin:

I think the offcial one should be here.

I am planing to ask to openephys team to add another spike stream type with (timestamp, label). This would be lighter and would allow to make spike sorting in real time.

If you prefer not to merge cmake_build (last commit 16 Nov 2019) into your master (last commit 11 june 2019) where do you advice me to make a PR ? Directly into cmake_build ?