Skip to content

Conversation

bparks13
Copy link
Member

@bparks13 bparks13 commented Apr 4, 2025

This PR adds the Neuropixels 2.0e Headstage to the plugin. This includes the addition of a PolledBno as a device. Currently all values are streamed for the PolledBno, which does limit the amount of data that can be streamed to be 25 Hz. This is based on empirical testing of the amount of time each ReadBytes() call takes to read all data. Future updates will allow only the desired values to be read, which should substantially increase the throughput.

This PR also simplifies the tabs, and no longer shows the device index in the tab name.

To calculate the offset for each Neuropixels V2 channel, the time to settle seems to be longer than the 1.0f variant (~15 seconds compared to <5). This could be due to the fact that the probe is floating, so if this is too long we can very easily decrease the time to settle. More empirical testing may be required.

Fixes #33
Fixes #38

Also discovered that there is a way to default the FileChooser to the last opened directory automatically.

Fixes #28

During testing, an "Unknown error" could be thrown by the PolledBno. This turned out to be a threading issue that was fixed by directly returning the results of context operations.

Fixes #50

Added a label to the editor that displays the version of liboni that is running.

@bparks13 bparks13 added this to the Neuropixels 1.0f milestone Apr 4, 2025
@bparks13 bparks13 self-assigned this Apr 4, 2025
@bparks13 bparks13 marked this pull request as ready for review April 4, 2025 20:28
@bparks13 bparks13 requested a review from jonnew April 4, 2025 20:28
@bparks13
Copy link
Member Author

bparks13 commented Apr 7, 2025

For the PolledBno:

  • For all registers: we can stream at 32 Hz, so we say it is only a 30 Hz stream.
  • For subsets of registers: determine the appropriate rate of polling, and set it at that rate
    • Determine how long each byte read is, and determine the sampling rate based on how many bytes need to be read, not necessarily based on which combinations of data are being read.

Double check what the timer the Juce highResolutionTimer class uses, see what the minimum resolution is.

Copy link
Contributor

@jonnew jonnew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved after addressing comments during live review.

bparks13 added 20 commits April 15, 2025 13:12
- Mainly adding hub enums
- Create common Neuropixels interface to make it easier to generate UI elements
- Add support for passthrough device indices
- Set I2C rate to 400 kHz
- Read the correct polled BNO data type, and then convert to useful values
- Remove calls to the gate run register of the OutputClock
- Currently capped at 25 Hz when streaming all values
- This is to avoid thread conflicts where a register needs to be written to while the Bno is still trying to read data
- Add a check for the device name that ignores the -X at the end, in the case where multiple headstages are connected
- All streams follow the format "Hub/Device/DataType", except for BNO devices which contain multiple data types in one stream. Those are left as "Hub/Device"
- The headstage label is now removed from the canvas, since it was redundant information
- Instead of storing the result in a variable, and then calling a method to get that result, which could result in threading issues, the result of an operation is returned immediately
- Remove the option to invert ephys data, all ephys data is now inverted to match the pxi plugin
- Remove the offset correction for 2.0 probes. Not needed
- createStreamName now uses std::vector to concatenate arbitrary length names together
- Add the headstage name to the OnixDevice class
- Update headstage names to be more consumer friendly
@bparks13 bparks13 merged commit 6cdb627 into main Apr 15, 2025
@bparks13 bparks13 deleted the issue-33 branch April 15, 2025 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants