Filling up the outer surface holes/gaps

조회 수: 2 (최근 30일)
banikr
banikr 2020년 5월 21일
댓글: darova 2020년 5월 28일
Hello Matlab experts,
I want to fill up the gaps or open spaces in the the brown layer(skin). What would be the best way to do so?
Morophological operations like dilation is not feasible as it takes spaces from other voxels like yellow layer(bones).
I have shared the file in nifti format here: google drive link which can be read as
lab = niftiread('lab_superior.nii.gz');
Thanks.

답변 (1개)

darova
darova 2020년 5월 21일
HEre is a start:
h = strel('disk',5);
I1 = imdilate(yellow,h); % imdilate yellow part (bone)
I2 = I1 & ~yellow; % select outside region/area only
I = I2 & skin;
  댓글 수: 8
banikr
banikr 2020년 5월 28일
Hi,
bwlabeln works for images having no connected regions. For example, the 3D binary label has connected components(yellow marked in the image).
So it doesn't work.
darova
darova 2020년 5월 28일
What about this?
I0 = imread('im.png');
I1 = ~im2bw(I0);
I2 = I1*0;
for j = 1:size(I1,2)
i = find(I1(:,j),1,'first');
if ~isempty(i)
I2(i,j) = true;
end
end
imshowpair(I1,I2,'montage')

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

Community Treasure Hunt

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

Start Hunting!

Translated by