0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 load rat_head.mat
0014
0015
0016
0017
0018
0019 [node,face]=v2s(volimage,0.5,2,'cgalmesh');
0020
0021 face=face(:,1:3);
0022
0023 p0=min(node);
0024 p1=max(node);
0025
0026 rownum=3;
0027 colnum=4;
0028 figure;
0029 subplot(rownum,colnum,1);
0030
0031 plotmesh(node,face(:,1:3));
0032 if(~isoctavemesh)
0033 title({'Laplacian+HC Smoothing Test','no smoothing'});
0034 else
0035 title('Laplacian+HC - no smoothing');
0036 end
0037 axis equal;
0038 set(gca,'xlim',[p0(1),p1(1)],'ylim',[p0(2),p1(2)],'zlim',[p0(3),p1(3)])
0039
0040
0041
0042
0043
0044 n1=node;
0045 for i=1:rownum*colnum-1
0046 n1=sms(n1,face(:,1:3),1,0.5);
0047 subplot(rownum,colnum,i+1);
0048 plotmesh(n1,face(:,1:3));
0049 title(['iter=' num2str(i)]);
0050 axis equal;
0051 set(gca,'xlim',[p0(1),p1(1)],'ylim',[p0(2),p1(2)],'zlim',[p0(3),p1(3)])
0052 end
0053
0054
0055
0056
0057
0058 figure;
0059 subplot(rownum,colnum,1);
0060
0061 plotmesh(node,face(:,1:3));
0062 if(~isoctavemesh)
0063 title({'Laplacian Smoothing Test','no smoothing'});
0064 else
0065 title('Laplacian - no smoothing');
0066 end
0067 axis equal;
0068 set(gca,'xlim',[p0(1),p1(1)],'ylim',[p0(2),p1(2)],'zlim',[p0(3),p1(3)])
0069
0070 conn=meshconn(face(:,1:3),size(node,1));
0071
0072 n1=node;
0073 for i=1:rownum*colnum-1
0074 n1=smoothsurf(n1,[],conn,1,0.5,'laplacian');
0075 subplot(rownum,colnum,i+1);
0076 plotmesh(n1,face(:,1:3));
0077 title(['iter=' num2str(i)]);
0078 axis equal;
0079 set(gca,'xlim',[p0(1),p1(1)],'ylim',[p0(2),p1(2)],'zlim',[p0(3),p1(3)])
0080 end
0081
0082
0083
0084
0085
0086
0087 figure;
0088 subplot(rownum,colnum,1);
0089
0090 plotmesh(node,face(:,1:3));
0091 if(~isoctavemesh)
0092 title({'Low-pass Smoothing Test','no smoothing'});
0093 else
0094 title('Low-pass - no smoothing');
0095 end
0096 axis equal;
0097 set(gca,'xlim',[p0(1),p1(1)],'ylim',[p0(2),p1(2)],'zlim',[p0(3),p1(3)])
0098
0099 conn=meshconn(face(:,1:3),size(node,1));
0100
0101 n1=node;
0102 for i=1:rownum*colnum-1
0103 n1=smoothsurf(n1,[],conn,1,0.5,'lowpass');
0104 subplot(rownum,colnum,i+1);
0105 plotmesh(n1,face(:,1:3));
0106 title(['iter=' num2str(i)]);
0107 axis equal;
0108 set(gca,'xlim',[p0(1),p1(1)],'ylim',[p0(2),p1(2)],'zlim',[p0(3),p1(3)])
0109 end
0110