open-ephys / analysis-tools

Archived code for reading data saved by the Open Ephys GUI
59 stars 176 forks source link

How to convert .continuous format to flat binary for using in Klusta #85

Open saman-abbaspoor opened 4 years ago

saman-abbaspoor commented 4 years ago

Hello everyone,

We are using a 64 channel probe for recording and the data is stored in .continuous format. Each channel has a separate file. For spike sorting, I would like to convert the .continuous files to flat binary .dat for use in Klusta. Is there any script for such a purpose?

I would appreciate if you can give me instruction on how to proceed.

jsiegle commented 4 years ago

Hi! This is straightforward to do using the Python 3 OpenEphys.py module:

from OpenEphys import loadFolderToArray
import numpy as np
import os

directory = '<path_to_continuous_files>'
data = loadFolderToArray(directory, dtype=np.int16)
data.tofile(os.path.join(directory, 'continuous.dat'))