Calculate the mean of region with nonzero pixels
Ältere Kommentare anzeigen
I have a mask with regions labeled with 1, 2 and 3. I have a 3D volume that I would like to calculate the mean of the pixels correspond to those regions.
I want to calculate the mean of the regions with number 1, number 2 and number 3 separately.
Is the following correct?
m = mean(volume(mask==1));
m = mean(volume(mask==2));
m = mean(volume(mask==3));
1 Kommentar
Walter Roberson
am 4 Mär. 2020
Bearbeitet: Walter Roberson
am 4 Mär. 2020
Looks fine to me, other than needing three different output variables
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Region and Image Properties finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!