I have a 3d binary volume, and I want to close holes in the mask only if there is a true element above and below the given pixel.
This is what I tried, but it didn't work…
mask = zeros(3,3,3);mask(2,2,1) = 1;mask(2,2,3) = 1;locations = reshape(ones(1,3),1,1,3);heights = locations;heights(1) = -1;heights(2) = 0;SE = strel('arbitrary',locations,heights);newMask = imclose(mask,e)
I was expecting that newMask(2,2,2) == 1
Best Answer