How to display smooth 3D surface from 3D binary matrix from 2D slices ?
6 次查看(过去 30 天)
显示 更早的评论
Hello,
I extracted a contour of a vessel on successive 2D images acquired along z-axis.
I get a 202x194x1494 binary matrix of the contour of the vessel and would like to display it (see attached).
I tried this based on isosurface function.
[lmax,cmax,nbframe] = size(maskcontour);
xb = linspace(xstart,xend,cmax);yb = linspace(ystart,yend,lmax);
v= smoothdata(maskcontour,3);
fv = isosurface(xb,yb,vz*(1:nbframe),maskcontour,0);
p = patch(fv,'FaceColor','red','Linestyle','none');
view(3);
axis equal
camlight
lighting gouraud
Resulting in this image.
I would like a smooth surface with no holes on it. Can you help me ?
0 个评论
回答(1 个)
KALYAN ACHARJYA
2020-1-7
Try with increasing cmax & lmax?
xb = linspace(xstart,xend,cmax);
yb = linspace(ystart,yend,lmax);
5 个评论
darova
2020-1-8
Maybe griddata is not the better way
n = 50;
r = rand(1,n)+5;
t = linspace(0,2*pi,n);
[x,y] = pol2cart(t,r);
z = rand(1,n)*20;
zz = linspace(min(z),max(z),20);
tt = linspace(0,2*pi,50);
[Z,T] = meshgrid(zz,tt);
R = griddata(t,z,r,T,Z);
[X,Y] = pol2cart(T,R);
plot3(x,y,z,'.r')
hold on
surf(X,Y,Z)
hold off
axis equal
What about alphaShape?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 3-D Volumetric Image Processing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!