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

demo_vol2mesh_ex1c

PURPOSE ^

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   demo script for mesh generation from binary volumetric image
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0002 %   demo script for mesh generation from binary volumetric image
0003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0004 
0005 %% preparation
0006 % user must add the path of iso2mesh to matlab path list
0007 % addpath('../');
0008 
0009 % user need to add the full path to .../iso2mesh/bin directory
0010 % to windows/Linux/Unix PATH environment variable
0011 
0012 %% load the sample data
0013 load rat_head.mat
0014 
0015 % volimage is a volumetric image such as an X-ray or MRI image
0016 % A,b are registration matrix and vector, respectively
0017 %% perform mesh generation
0018 
0019 %% use the alternative 'cgalmesh' method. This will call
0020 % cgalmesher to process labled volume to produce surfaces
0021 % and tetrahedral mesh in a single run.
0022 clear opt
0023 opt.radbound=2;
0024 [node,elem,face]=v2m(uint8(volimage),0.5,opt,100,'cgalmesh');
0025 
0026 
0027 %% visualize the resulting mesh
0028 
0029 plotmesh(node,face(:,1:3));
0030 axis equal;

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