-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filter-dependant voltage shift in BioCAM recordings #1347
Comments
Thanks for writing this up @BptGrm ! The problem is gone after filtering because the filtering removes the offset. Is this information about the offset clear in the brw format documentation? I think I ported Matthias' code a while back so not sure where the wrong scaling came from! |
For reference, the NEO code was ported from here: https://github.com/SpikeInterface/spikeextractors/blob/master/spikeextractors/extractors/biocamrecordingextractor/biocamrecordingextractor.py |
Makes sense !
Couldn't find any explicit mention of it the docs for both BRW v3.x and v4.x. The only code example provided deals with event-base data. 3Brain shared some code with me a while ago, but all of the IO is done by their own DLLs.
Will do, still not sure about the "mask" I can wait for the previous PR #1326 to merge so that I can do a single one myself.
Maybe there's a clue in here ?
|
See #1348 |
Describe the bug
Raw traces from BioCAM recording have an unexpected + 2048 applied to the voltage measurements, i.e. traces are all shifted 2048 µV higher than they actually are. This issue disappears when the recording is filtered through SpikeInterface.
To Reproduce
Using either version of BRW recordings available on GIN :
Expected behaviour
Raw baseline should be around zero.
Environment:
Additional context
I first reported the problem in a SpikeInterface issue a while ago, and detailed it a bit more in this recent PR.
Briefly, looking through @mhhennig 's read function in HerdingSpikes, signal is either read as
data - 2048
or2048 - data
depending on file version and signal inversion.There also seem to be some kind of mask to filter out certain values ? Not sure about that :
d[np.abs(d) > 1500] = 0
.On the other hand, neo reads signal as either
data
or4096 - data
, depending on signal inversion.Furthermore, signal inversion itself isn't actually taken into account :
By quickly running through random data point in the HDF5 file, it looks to me that the
- 2048
is necessary :On
biocam_hw3.0_fw1.6.brw
:On
biocam_hw3.0_fw1.7.0.12_raw.brw
:The text was updated successfully, but these errors were encountered: