NSF Postdoctoral Research
A set of C++ code developed by Andrew E. Slaughter
|
#include "vol2mesh/include.h"
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. |
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.
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:
argc | The command-line argument count |
argv | An 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. |
UserOptions v2m_command_line_options | ( | int | argc, |
char ** | argv | ||
) |
A subfunction for defining and gathering command-line options.
argc | Number of commandline parameters |
argv | Character 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.
opt | UserOptions 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.
v2m | Vol2mesh class initilized with the image file |
opt | UserOptions class containing the user specified values from the command-line |
void v2m_set_dimensions | ( | Vol2mesh & | v2m, |
UserOptions & | opt | ||
) |
Function for setting the image dimensions.
v2m | Vol2mesh class initilized with the image file |
opt | UserOptions 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.
v2m | Vol2mesh class initilized with the image file |
opt | UserOptions class containing the user specified values from the command-line |