Skip to content

Conversation

zm711
Copy link
Contributor

@zm711 zm711 commented Aug 2, 2024

Fixes #1517

Howdy @RobertoDF,

I think this should fix your problem :)

As I expected with neuropixels you can have different channel/chip ratios then we expected with the intan based chip. I think your colleague's data just happened to line up with the intan expectations. So in this case, I check if the headstage fits our expectations and if it doesn't I revert back to the old way of parsing the data. Note that I don't see your gain problem. Looking at a few random channels I see this:

  ('trode1252chan341', '341', 30000., 'int16', 'uV', 0.01831111, 0., 'trodes'),
        ('trode1251chan340', '340', 30000., 'int16', 'uV', 0.01831111, 0., 'trodes'),
        ('trode1250chan277', '277', 30000., 'int16', 'uV', 0.01831111, 0., 'trodes'),
        ('trode1249chan276', '276', 30000., 'int16', 'uV', 0.01831111, 0., 'trodes'),
        ('trode1248chan213', '213', 30000., 'int16', 'uV', 0.01831111, 0., 'trodes'),
        ('trode1247chan212', '212', 30000., 'int16', 'uV', 0.01831111, 0., 'trodes'),
        ('trode1246chan149', '149', 30000., 'int16', 'uV', 0.01831111, 0., 'trodes'),
        ('trode1245chan148', '148', 30000., 'int16', 'uV', 0.01831111, 0., 'trodes'),
        ('trode1244chan85', '85', 30000., 'int16', 'uV', 0.01831111, 0., 'trodes'),
        ('trode1243chan84', '84', 30000., 'int16', 'uV', 0.01831111, 0., 'trodes'),
        ('trode1242chan21', '21', 30000., 'int16', 'uV', 0.01831111, 0., 'trodes'),
        ('trode1241chan20', '20', 30000., 'int16', 'uV', 0.01831111, 0., 'trodes'),
        ('trode1240chan723', '723', 30000., 'int16', 'uV', 0.01831111, 0., 'trodes'),
        ('trode1239chan722', '722', 30000., 'int16', 'uV', 0.01831111, 0., 'trodes'),
        ('trode1238chan659', '659', 30000., 'int16', 'uV', 0.01831111, 0., 'trodes'),
        ('trode1237chan658', '658', 30000., 'int16', 'uV', 0.01831111, 0., 'trodes'),
        ('trode1236chan595', '595', 30000., 'int16', 'uV', 0.01831111, 0., 'trodes'),

The gain is correct.

@zm711
Copy link
Contributor Author

zm711 commented Aug 2, 2024

This parsed the file you shared with me on my computer and seemed correct based on my summary look at the data. I'll likely push a couple more commits to add some comments to the code etc, but I should only be making cosmetic changes at this point.

@RobertoDF
Copy link

Just tested it and it works. Amazing! Thanks for fixing it so quickly.

@zm711
Copy link
Contributor Author

zm711 commented Aug 2, 2024

That's awesome. I'll ping @alejoe91 for a review. But let's wait until end of next week before we merge at minimum so we can hopefully get a test file from you :)

@zm711 zm711 added this to the 0.14.0 milestone Aug 3, 2024
@zm711
Copy link
Contributor Author

zm711 commented Aug 27, 2024

@samuelgarcia, now that you're back you could also look over this. Basically, it spikegadgets doesn't always use an intan chip. i couldn't see any way in the metadata to tell which headstage is used, so if you have a better idea feel free to push, but this prevents the reader from breaking when using neuropixel style data instead of intan headstage style data.

@samuelgarcia samuelgarcia merged commit 499db96 into NeuralEnsemble:master Sep 27, 2024
3 checks passed
@zm711 zm711 modified the milestones: 0.14.0, 0.13.4 Oct 12, 2024
@zm711 zm711 deleted the fix-spikegadgets branch April 25, 2025 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

read_spikegadgets broken for neuropixel recordings

4 participants