NeuroPyxels icon indicating copy to clipboard operation
NeuroPyxels copied to clipboard

Problem with binary file reading

Open BEGINRX opened this issue 6 months ago • 3 comments

I tried to process the spike-sorted data which can be sorted by Phy. The whole folder has all of necessary data. But I got a problem like this:

Image

Image

And I'm sure that the recording.dat file in the folder.

BEGINRX avatar May 30 '25 09:05 BEGINRX

Hi!

Did you use spikeGLX for your recording? We currently expect the raw data to be stored as a .ap.bin file - can you send a screeshot of the contents of your folder here?

m-beau avatar Jun 09 '25 13:06 m-beau

Sorry, I didn’t use SpikeGLX. The data was collected using my own electrodes, and the format is binary. The .ap.meta and .lf.meta files were created by me, based on the standard SpikeGLX format. So, does that mean custom data formats are supported? (The the contents of the Phy folder is following.)

Image

BEGINRX avatar Jun 12 '25 02:06 BEGINRX

We only support out-of-the-box Neuropixels classification at the moment, and we don't have the ressources to adapt the package for every format, sorry!

The easiest way forward would probably be for you to, additionally to your hand-made meta file, recast your .dat file as a .bin file (they shouldn't be too different in theory, it might just be a matter of changing the extension to .ap.bin!)

.ap.bin files are only raw data without any header, with voltage encoded as int16s. It is a string of all voltage values on all channels for each sample, and all samples follow each other. In practice: voltage_channel1_sample1, voltage_channel2_sample1, ..., voltage_channelN_sample1, voltage_channel1_sample2, voltage_channel2_sample2, ... , voltage_channelN_sampleT

m-beau avatar Sep 17 '25 14:09 m-beau