open-ephys / plugin-GUI

Software for processing, recording, and visualizing multichannel electrophysiology data
https://open-ephys.org/gui
GNU General Public License v3.0
193 stars 684 forks source link

Appending .continuous files #620

Open lukehshaw opened 3 months ago

lukehshaw commented 3 months ago

Hello there, I would like to combine .continuous files that were mistakenly saved in separate recordings. I would like the outputs of this merger to be saved as .continuous files with the same headers etc. to avoid any unnecessary hacking into my spike sorting scripts. Is there a way to do this in Python or Matlab?

jsiegle commented 3 months ago

Hi Luke – there is not an easy way to write .continuous files directly from Python or Matlab, but here are some things that could solve your problem:

Option 1: Load the data into memory, concatenate multiple recordings together, and save the final array in Binary format (e.g. using numpy.ndarray.tofile). If your spike sorter can read this format, you're good to go. Otherwise, you could read the new Binary file into the GUI using the File Reader and save it in Open Ephys format.

Option 2: Concatenate the segments using SpikeInterface (instructions here). This will create an object that includes multiple recording segments which can be passed into the spike sorter of your choice.

Let me know if either of those would work!