Skip to content
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

Contrast enhancement and registration #11

Open
lauraporta opened this issue Jul 19, 2024 · 3 comments · May be fixed by #23
Open

Contrast enhancement and registration #11

lauraporta opened this issue Jul 19, 2024 · 3 comments · May be fixed by #23

Comments

@lauraporta
Copy link
Member

Is your feature request related to a problem? Please describe.
Contrast enhancement was applied to the derotated video to improve registration performance. It worked when the optimal thresholds for the contrast were calculated on a frame-by-frame basis. However this introduces a lot of noise and artefacts.

Screenshot 2024-07-19 at 13 36 27

You can see that the background gets more noisy at certain angles, and this is due to the changes in the overall ranges of pixels intensities from frames that are derotated, likely due to un-sampling of certain pixels.

Describe the solution you'd like
I would like to take optimal rigid registration shifts using the contrast enhancement derotated video and apply them to the original one. I could create a custom registration script leveraging suite2p tools.

Describe alternatives you've considered
No contrast enhancement: poor registration with suite2p.
Contrast enhancement with the same thresholds for all the video: poor registration with suite2p.

This was referenced Jul 19, 2024
@lauraporta
Copy link
Member Author

A good starting point seems to be run_s2p.py.

@lauraporta lauraporta linked a pull request Jul 26, 2024 that will close this issue
7 tasks
@lauraporta
Copy link
Member Author

The methods I've implemented are actually doing an operation called "clipping".
It's a simple form of contrast enhancement, and there are many others (histogram equalisation, gamma correction, local contrast ehancement, ...).
It would be worth to explore their impact on registration and neuropil subtraction.
Also, it is worth to explore the literature more.

@lauraporta
Copy link
Member Author

Suite2p registration already uses clipping to improve performance. Options file already contains a bool called norm_frames to use this feature. However, as for the current suite2p version, the clipping percentile is hardcoded. See suite2p register_frames method. I can edit it with my preferred percentile.

Thanks @carsen-stringer for the suggestion.

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 a pull request may close this issue.

1 participant