Imports NetGen .vol files
USAGE
function [mesh regions region_names boundaries boundary_names] = importNetGenMesh(filename_vol, preserve_boundary)
INPUT
filename: filename ('.vol', file must be in ASCII format)
OPTIONAL INPUT
preserve_boundary: Set to false to build a new boundary (BH) for the
mesh.
This ignores the boundary definition in the file.
The new boundary is build so that there no boundary
elements between elements. If a region of the
boundary cannot be found from the new boundary, the
corresponding entry in 'boundaries' contains indices
to nodes instead.
OUTPUT
mesh: a structure that contains coordinates (r),
elements (H, indices to r) and
boundary elements (BH, indices to r)
regions: the regions (indices to H) in the vol file as cell
array
region_names: names of the regions as a cell array. Indexing is
the same as in 'regions'.
boundaries: same as regions, but for boundaries (indices to BH)
boundary_names: same as region_names, but for boundaries
EXAMPLE:
[vmcmesh regions region_names boundaries boundary_names] = importNetGenMesh('square_with_two_circles.vol', false);
background = cell2mat(regions(find(strcmp(region_names,'background'))));
circles = cell2mat(regions(find(strcmp(region_names,'circles'))));
lightsource1 = cell2mat(boundaries(find(strcmp(boundary_names,'lightsource'))));
vmcboundary.lightsource(lightsource1) = {'cosinic'};
vmcboundary.absorption_coefficient(background) = 0.01;
vmcboundary.absorption_coefficient(circles) = 0.02;
This function is provided with ValoMC