我需要在matlab中对3d矩阵“image”使用bwareafilt函数,但是有一个问题,因为它返回错误,说它的输入应该是2d矩阵,我该如何克服?
我正在研究CT肺部图像,在2d版本中我使用了bwareafilt没有任何问题,但在3D体积CT中我不能
y = ~bwareafilt(out > 1,1); % out is the segmented lung image, I need to remain the largest area in the image, which will be the lungs
z = imfill(~y,'holes');
mask = y.*z;
se2=strel('disk',10);
mask=imopen(mask,se2);
mask=imclose(mask,se2);