Download this file

13 lines (10 with data), 300 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
function t_yLV_clean=clean_segs(t_yLVh)
%%
for k=1:size(t_yLVh,3)
BW=t_yLVh(:,:,k);
cc = bwconncomp(BW,4);
stats = regionprops(cc, 'Area');
[area_max,idx] = max([stats.Area]);
ylvc_ch = ismember(labelmatrix(cc), idx);
t_yLV_clean(:,:,k)=bwconvhull(ylvc_ch);
end