Home > bioelectromagnetism > mri_scalp.m

mri_scalp

PURPOSE ^

mri_scalp - Find the scalp surface of an MRI volume

SYNOPSIS ^

function [vertices] = mri_scalp

DESCRIPTION ^

 mri_scalp - Find the scalp surface of an MRI volume

 A very course isosurface routine, unlikely to produce
 reliable results.
 
 See also mesh_shrinkwrap

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [vertices] = mri_scalp
0002 
0003 % mri_scalp - Find the scalp surface of an MRI volume
0004 %
0005 % A very course isosurface routine, unlikely to produce
0006 % reliable results.
0007 %
0008 % See also mesh_shrinkwrap
0009 %
0010 
0011 % $Revision: 1.1 $ $Date: 2004/11/12 01:32:35 $
0012 
0013 % Licence:  GNU GPL, no express or implied warranties
0014 % History:  03/2002, Darren.Weber_at_radiology.ucsf.edu
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 % delaunayn can be used to tesselate these vertices
0029 % dsearchn can be used to identify nearest neighbours
0030 
0031 r = 10000;
0032 NFV = reducepatch(FV,r); % reduces the faces of struct fv.
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

Generated on Mon 15-Aug-2005 15:36:19 by m2html © 2003