Calculate the mean of nonzero pixels and set a threshold

1 visualización (últimos 30 días)
Gina Carts
Gina Carts el 4 de Nov. de 2019
Respondida: Ilian el 8 de Abr. de 2020
I previously asked how to calculate the mean of nonzero pixels using my binary mask.
The way I did that was m = mean(volume(mask)).
Now, I would also like to exclude the pixels within the mask with values <0.001.
Can someone help with that?

Respuestas (1)

Ilian
Ilian el 8 de Abr. de 2020
If you just have a threshold, you don't even need to ceate an explicit mask:
m = mean(volume(volume>=0.001)); % average of all values (0.001 or above) in volume

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by