BlackrockNeurotech/NPMK

NSxToHL returning garbled data after pauses

ereming opened this issue · 2 comments

I ran NSxToHL on an .ns5 file with one pause. The signal before the pause is identical to the original, but after the pause it's just noise. There doesn't seem to be any structure in the signal, so I don't think it's just a matter of channel misalignment. I'm guessing there is some other type of information (besides the voltage time series, and not an int16) in the data stream after the header that openNSxHL is failing to account for. This would explain why reading the first channel of my (24-channel) .ns5.dat file with

fread(fid,1e10,'int16',23*2);

gives a vector which is 1 element longer than sum(B.MetaTags.DataPoints)

@kianabc It seems like an easy fix for this would be to replace all of the manual file seeking in OpenNSxHL with a call to OpenNSx() followed by concatenating the cell NSx.Data. Is there some reason why that won't work for everyone?

@ereming Can you share a data file so I can take a look?

This is fixed.