-
Notifications
You must be signed in to change notification settings - Fork 1
Automatically search for calibration files for Neuropixels probes #136
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
Conversation
- Added for Neuropixels 1.0 and 2.0 probes
- This solves the issue of a Neuropixels 2.0 probe causing up to four saves of the data into the same file, causing redundant writes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left my review in an extended comment in this PR
Good point, I will modify the language so that it only says the extra files are in the logs if there are more than 1 found.
That is correct, whatever files are listed in the ADC/Gain calibration text boxes are the currently selected ones, and if no files are found automatically then the previously selected files are not removed. @jonnew What should we do in this instance? A side note, acquisition cannot start if the probe serial number found on the hardware does not match the serial number embedded in the calibration file, so there is a check already in place if the files are expected to change but do not, say for example if a different headstage was plugged in with a different probe.
This was an error on my part, the method got called twice when the device was toggled.
I agree, this is a good change to make it more general.
I also agree with this, the check box grays out the folder if it is not checked, so the inverse should be true for manual selection. Regarding the other part of this comment, where it searches recursively, this is the behavior of the other Neuropixels plugins. I believe it makes sense to have a single parent folder selected that contains all calibration files so that the user only has to hit Connect and it will automatically find the correct file even if multiple probes are connected throughout the day. Of course, the user has the ability to select whichever folder they want.
I think it would be more appropriate to only search if the device is enabled; this would apply to all other triggers, so if a probe is connected but it is disabled then no search occurs, or if a new folder is selected then nothing would happen. Then, if the correct folder is selected, and the user toggles the device On, then it will immediately search for the correct calibration file(s). @jonnew Do you agree with this implementation? |
- Updated tooltips and error messages - Only update the info string once per toggle - If the automated search checkbox is checked, gray out the individual calibration file buttons - Only search for calibration files when the device is enabled and any other trigger is hit - Limit recursive search for calibration files to two folders from the root - Change some log statements to console instead of debug so users can get real-time feedback
Instead of requiring the user to manually select the calibration files for each new probe, this PR adds a UI element to both Neuropixels 1.0 and 2.0 probe settings tabs that can automatically scan a folder for probe calibration files. The file has to be chosen by the user, but it can exist at an arbitrary location.
Any time one of the following conditions is true, the automatic scan will occur, and will attempt to find one and only one calibration file matching the given serial number:
Folder paths and toggle state are saved in the XML. All UI elements are disabled during acquisition.
This PR also adds a couple small commits related to optimizing the loading of the XML file (1307ab1) and only calling an alert window asynchronously to avoid conflicts with the message thread (615f6d8) that came up during testing.