Advanced Features in iso2mesh
Global variables
- ISO2MESH_TEMP
- control the temporary file output directory
The default output directory is the system's temporary directory, i.e. the output of mwpath(''). However, if one does not have permission to write to this folder, or if this contains outputs from other users who shares the same output folder (for example, /tmp on Linux), one can avoid "write to file" error by setting his own output folder. To do this, he need to define
ISO2MESH_TEMP='/folder/path/you/can/write';
in Matlab/Octave's "base workspace". The iso2mesh commands afterward will output the intermediate files under the specified temp directory.
- ISO2MESH_SESSION
- control the output file name prefix
If two users share a common output directory (for example /tmp for GNU Linux) on a single machine, some of the users may not able to write intermediate output files and encountered errors. If this happens, one can set "ISO2MESH_TEMP" to define a new output folder, alternatively, one can set ISO2MESH_SESSION to label all his output by a unique prefix. For example, if one define
ISO2MESH_SESSION='john_';
this will prepend 'johb_' to all output file names, if this string is unique, users can produce all their output files without conflict with other users.
- ISO2MESH_BIN
- specify the folder where to look for the external binaries
There are several external tools are essential for iso2mesh. These pre-compiled binaries are saved under iso2mesh/bin folder. In our
Installation instructions, we ask the users to add this path to their PATH environment variable. If user for some reason not be able to do this, iso2mesh will do two things to look for these binaries:
- it will first check a global variable ISO2MESH_BIN and see if it is defined in the 'base' workspace, if it is defined and the folder exist, it will execute the binaries from that folder
- if no ISO2MESH_BIN defined, or it has a value which does not exist, iso2mesh will use the relative path "iso2mesh/bin" to load those binaries
- otherwise, it will give an error message, complaining the binary can not be found.
Intermediate outputs
For each step of the mesh generation along the work-flow, iso2mesh will save some intermediate outputs as logs. These outputs are saved under the output of mwpath('') (see the explanations for ISO2MESH_TEMP above).
- pre_extract.inr
- if one use the default 'cgalsurf' method in vol2surf to extract an isosurface from a binary image, this file will save the raw binary image for each level set (only the last levelset stays)
- post_extract.off
- the output surface mesh from 'cgalsurf' method (vol2surf)
- pre_remesh.off
- if one use the 'simplify' option of vol2surf, this file saves the voxel-resolution surface mesh extracted using binsurface subroutine
- post_remesh.off
- this file records the triangular surface after mesh simplifications (meshresample)
- pre_sclean.off
- for 'simplify' approach, this file is the surface mesh before the mesh validation (meshcheckrepair)
- post_sclean.off
- this is the output from 'mechcheckrepair' subroutine.
- post_vmesh.poly
- when generating the 3D tetrahedral mesh, tetgen needs an input file with PLC (piece-wise linear complexes) which is saved in this poly file.
- post_vmesh.off
- if no bounding box needed, this file saves the same info as the poly file, except it is in off format.
- post_vmesh.1.ele
- tetgen output: tetrahedral element file
- post_vmesh.1.face
- tetgen output: boundary surface element file
- post_vmesh.1.node
- tetgen output: node file