WIP: Allow Dredge AP to use online motion resolution method - #4746
Open
chrishalcrow wants to merge 4 commits into
Open
WIP: Allow Dredge AP to use online motion resolution method#4746chrishalcrow wants to merge 4 commits into
chrishalcrow wants to merge 4 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The motion correction algorithms in SpikeInterface have two steps. You first compute many histograms-in-depth (using e.g. peak detection or LFP) over time. Second, you compare the histograms at different times to extract a time vector.
In the current implementation, if you use peak detection the comparison part of the algorithm compares ALL histograms against all others. This is fine if you have a standard recording, but fills up RAM quickly if you get towards one day long recordings. If you use LFP there is an "online" method to compare the histograms. This only compares histograms which are nearby in time, meaning that you don't need to load them all into memory. Hence, this can be used for very long recordings.
This PR refactors the "all at once" and "online" methods to extract motion vectors from histograms, allowing either method to be used regardless of histogram-construction method. Most of the pain is in how parameters are dealt with - they were packaged a bit differently for the two algorithms. We attempt to unify the arguments in the two methods as much as possible, and abstract some language.
Docs, tests, etc incoming.