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

Questions on the threshold determination for region mask #10

Closed
zynxxnn opened this issue Jan 11, 2022 · 2 comments
Closed

Questions on the threshold determination for region mask #10

zynxxnn opened this issue Jan 11, 2022 · 2 comments

Comments

@zynxxnn
Copy link

zynxxnn commented Jan 11, 2022

Hi,

Thank you for sharing this useful toolbox :)
In the "Mask builder" function, when pressing "self" button to generate a region mask, how is the threshold automatically determined? Since the "intensity threshold" can only be ajusted by a scroll bar, I cannot set exactly the same threshold value for videos recorded from different exprimental days. It's also impossible to use only one region mask for all the videos as their FOVs could be slightly different (very similar though). But if I do not use any region mask, the extraction time would be too long. So I just want to make sure if using the automatically determined threshold is appropriate for unified analysis on data captured from long-term imaging. Thanks!

@XuelongMi
Copy link
Collaborator

Hi,

The threshold is determined by applying Otsu's method to the average projection of the data. In MATLAB, we use the function "graythresh", you can check it here: https://www.mathworks.com/help/images/ref/graythresh.html. This method chooses a threshold that minimizes the intraclass variance of the thresholded black and white pixels.

@zynxxnn
Copy link
Author

zynxxnn commented Jan 13, 2022

Hi,

The threshold is determined by applying Otsu's method to the average projection of the data. In MATLAB, we use the function "graythresh", you can check it here: https://www.mathworks.com/help/images/ref/graythresh.html. This method chooses a threshold that minimizes the intraclass variance of the thresholded black and white pixels.

Thank you very much for your answer!

@zynxxnn zynxxnn closed this as completed Jan 13, 2022
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

No branches or pull requests

2 participants