Home > vbmeg > external > iso2mesh > sample > demo_grayscale_ex1.m

demo_grayscale_ex1

PURPOSE ^

this example demonstrates how to mesh a gray-scale volume directly.

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 this example demonstrates how to mesh a gray-scale volume directly.
 the data set is a Jacobian matrix obtained by multiplying two
 Green's functions
 see Appendix in Qianqian Fang, Computational methods for microwave medical imaging. Ph.D.
 Dissertation, Dartmouth College, Hanover, NH, U.S.A., Dec 2004.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % this example demonstrates how to mesh a gray-scale volume directly.
0002 % the data set is a Jacobian matrix obtained by multiplying two
0003 % Green's functions
0004 % see Appendix in Qianqian Fang, Computational methods for microwave medical imaging. Ph.D.
0005 % Dissertation, Dartmouth College, Hanover, NH, U.S.A., Dec 2004.
0006 
0007 [xi,yi,zi]=meshgrid(1:40,1:40,1:80);
0008 r1=[xi(:)-20,yi(:)-20,zi(:)-20];
0009 r2=[xi(:)-20,yi(:)-20,zi(:)-60];
0010 r1=reshape(r1(:,1).^2+r1(:,2).^2+r1(:,3).^2,size(xi));
0011 r2=reshape(r2(:,1).^2+r2(:,2).^2+r2(:,3).^2,size(xi));
0012 
0013 k=10;
0014 
0015 % generate Green's functions
0016 
0017 g1=exp(sqrt(-1)*k*r1)./(4*pi*r1);
0018 g2=exp(sqrt(-1)*k*r2)./(4*pi*r2);
0019 
0020 
0021 %get Jacobian (sensitivity)
0022 g12=g1.*g2;
0023 
0024 % create a mesh based on the level-set at log(J)=-7.5
0025 
0026 [node,elem,face]=v2m(log10(abs(g12))+10,2.5,2,10,'cgalsurf');
0027 
0028 plotmesh(node,face);

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005