Butter filter for mean intensity values #107
Open
+426
−34
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.
Correction for fluctuations of the brightness of the entire field of view
I think its pretty straightforward and can be easily merged. The filter is not absolutely necessary but would make the calcium traces hopefully a bit noisy (need to test this better)
calculate the mean pixel intensity for every frame
apply a butter low pass filter to mean intensity over time
creates a figure using start_frame to end_frame config settings, showing raw data and butter filtered data to visually assess if the filter resembles the data
after pressing 'Esc' script continues running
this filter is applied to the already spatial mask-filtered data (if enabled)
similar method used in Daniels notebook from v4 Miniscope
ipynb notebook
he used it to: 'correct the other source of V4 Miniscope noise. This is a fast, ~+3Hz fluctuation of the brightness'
I also saw some higher frequency noise on the calcium traces of the wireless miniscope
📚 Documentation preview 📚: https://miniscope-io--107.org.readthedocs.build/en/107/