필터 지우기
필터 지우기

Counting Voxels in a Binary Mask

조회 수: 5 (최근 30일)
Jamuna Jayashri Mahalingam
Jamuna Jayashri Mahalingam 2013년 8월 7일
I have a mask, which is binary and 3-D. I want to count the number of white voxels. How can I do it?

채택된 답변

Iain
Iain 2013년 8월 7일
if white is true:
count_of_white_voxels = sum(mask(:)) ;
  댓글 수: 2
Jamuna Jayashri Mahalingam
Jamuna Jayashri Mahalingam 2013년 8월 8일
I am using masks in NIFTI format. Here is my code:
clc; nii= load_nii('Seg.nii');%% loading NIFTI files view_nii(nii); %Count voxels count_of_white_voxels = sum(mask(:));
I keep getting this error: Undefined function 'sum' for input arguments of type 'struct'
Jamuna Jayashri Mahalingam
Jamuna Jayashri Mahalingam 2013년 8월 8일
I think i figured what the error is..
I used
count_of_white_voxels = sum(nii.img(:)) ;
Now there is no error

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

제품

Community Treasure Hunt

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

Start Hunting!

Translated by