Skip to content

Butter filter for mean intensity values #107

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

Open
wants to merge 9 commits into
base: feat-preprocess
Choose a base branch
from

Conversation

MarcelMB
Copy link
Contributor

@MarcelMB MarcelMB commented Feb 21, 2025

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

invivo-20241203-1-003_trim9min_butter_filter_intensity_plot


📚 Documentation preview 📚: https://miniscope-io--107.org.readthedocs.build/en/107/

@MarcelMB MarcelMB requested a review from t-sasatani February 21, 2025 23:24
@MarcelMB
Copy link
Contributor Author

closed an earlier pull request of this since the code was so far behind the feature_process changes and main pipeline organization changes that it was easier to just re-implement them into the current framework

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.

1 participant