How to count the number of voxels of another color

5 次查看(过去 30 天)
Hi,
I was wondering how to count the number of voxels of one color in a three dimensional space
Thank you!
  3 个评论
Matthew Lee
Matthew Lee 2019-9-12
I was segmenting a section out of a three dimensional shape, but I wanted to find volume of the segmented portion, so I thought that I could approach it by highlighting the segmentation using a different color and counting the number of voxels of that certain color and then arrange a conversion into cm^3 to find a measure of volume. Is there a way to do this, or is there a better way of going about this volume calculation?
Rik
Rik 2019-9-12
You can use my answer to achieve this. When you have a logical array you can use sum to count the number of voxels.

请先登录,再进行评论。

采纳的回答

Rik
Rik 2019-9-11
Similar to how you would do that for 2D:
IM=randi(255,[512 512 400]);
count=sum(IM==200,'all');
%if your release doesn't have the 'all' option:
%count=sum(IM(:)==200);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by