0001 function [vertices] = mri_scalp
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 load mri;
0019
0020 D = squeeze(D);
0021
0022 Ds = smooth3(D);
0023 FV = isosurface(Ds,5);
0024
0025 vertices = FV.vertices;
0026
0027
0028
0029
0030
0031 r = 10000;
0032 NFV = reducepatch(FV,r);
0033
0034
0035 Nvertices = size(NFV.vertices,1);
0036
0037 fprintf('\n...Found %d vertices.\n\n',Nvertices);
0038
0039 plot = 1;
0040 if isequal(plot,1),
0041 P = patch(NFV,'FaceColor',[1,.75,.65],'EdgeColor','none');
0042 isonormals(Ds,P);
0043 view(45,30), axis tight, daspect([1,1,.4]), rotate3D;
0044 lightangle(45,30);
0045 set(gcf,'Renderer','zbuffer'); lighting phong
0046 set(P,'SpecularColorReflectance',0,'SpecularExponent',50);
0047 end
0048
0049
0050 return