NSF Postdoctoral Research
A set of C++ code developed by Andrew E. Slaughter
v2m.cpp File Reference
#include "vol2mesh/include.h"
Include dependency graph for v2m.cpp:

Functions

UserOptions v2m_command_line_options (int argc, char **argv)
 A subfunction for defining and gathering command-line options.
string v2m_get_output_file (UserOptions &opt)
 Function for getting the output file.
void v2m_initialize_image (Vol2mesh &v2m, UserOptions &opt)
 Function for setting up the image based on the user input.
void v2m_set_dimensions (Vol2mesh &v2m, UserOptions &opt)
 Function for setting the image dimensions.
void v2m_set_mesh_criteria (Vol2mesh &v2m, UserOptions &opt)
 Function for setting the mesh criteria from command line options.
int main (int argc, char *argv[])
 Main program for generating meshes from 3D image data.

Detailed Description

Source code for a program, v2m, to create a mesh from 2D images slices. The program is utilzes the Vol2mesh library. The basis for the development comes from the CGAL example: Section 50.3.3 Domains From Segmented 3D Images.

This file includes the main function and uses the Vol2mesh class, the class handles most of the behavior a majority of this code is for handling the command-line inputs.

This use of executable associated with this source code is detailed here: Image Mesh Generation: v2m.


Function Documentation

int main ( int  argc,
char *  argv[] 
)

Main program for generating meshes from 3D image data.

This function is the main program executed when using the v2m executable, details are provided here: Image Mesh Generation: v2m.

The command-line arguments are parsed into the two input variables of this program:

Parameters:
argcThe command-line argument count
argvAn array of characters that contain the command-line text, this text is parsed with the UserOptions class in the v2m_command_line_options sub-function.
Examples:
fem/examples/example1.cpp, fem/examples/example2.cpp, fem/examples/example3.cpp, fem/examples/example4.cpp, fem/examples/example5.cpp, test_file_parts.cpp, test_libmesh.cpp, test_mymesh.cpp, and test_user_options.cpp.
UserOptions v2m_command_line_options ( int  argc,
char **  argv 
)

A subfunction for defining and gathering command-line options.

Parameters:
argcNumber of commandline parameters
argvCharacter array containing the command line text

This function implements the UserOptions class for defining command line inputs, see Using the UserOptions Class for details on using this class.

string v2m_get_output_file ( UserOptions opt)

Function for getting the output file.

The v2m program will automatically generate a file for outputting the mesh using the --input-file and --output-format by simply changing the extension of the input file to that specified by the format.

Parameters:
optUserOptions class containing the user specified
void v2m_initialize_image ( Vol2mesh v2m,
UserOptions opt 
)

Function for setting up the image based on the user input.

The meshing behavior may be defined by the user from the command line, this functions uses the supplied (or default) values and inserts the values into the Vol2mesh object.

Parameters:
v2mVol2mesh class initilized with the image file
optUserOptions class containing the user specified values from the command-line
void v2m_set_dimensions ( Vol2mesh v2m,
UserOptions opt 
)

Function for setting the image dimensions.

Parameters:
v2mVol2mesh class initilized with the image file
optUserOptions class containing the user specified values from the command-line
void v2m_set_mesh_criteria ( Vol2mesh v2m,
UserOptions opt 
)

Function for setting the mesh criteria from command line options.

Parameters:
v2mVol2mesh class initilized with the image file
optUserOptions class containing the user specified values from the command-line
 All Classes Namespaces Files Functions Variables Typedefs