obj2vtk | R Documentation |
Batch-converts OBJ mesh files into VTK mesh files
obj2vtk(files = NULL, ID = NULL, vtk_path = NULL, print.progress = TRUE)
files |
Optional parameter indicating where to save the VTK files. The default is the current directory. |
ID |
optional vector with IDs used for saving the VTK meshes. Default is the same name as the OBJ meshes |
print.progress |
optional parameter indicating whether to print the progress |
Takes a a list of OBJ meshes and transforms those files into VTK. For more information check the R package _freesurferformats_ (Schäfer, 2020)
This function returns a table with the meshes information (name, number of faces and vertices) and the volume for each surface mesh.
Marta Vidal-Garcia
Schlager S (2017). “Morpho and Rvcg - Shape Analysis in R.” In Zheng G, Li S, Szekely G (eds.), _Statistical Shape and Deformation Analysis_, 217-256. Academic Press. ISBN 9780128104934. Tim Schäfer (2020). freesurferformats: Read and Write 'FreeSurfer' Neuroimaging File Formats. R package version 0.1.10. https://CRAN.R-project.org/package=freesurferformats
# Convert all OBJ meshes to VTK meshes setwd("./data") dir(pattern = "*.obj") obj2vtk(files = NULL, ID = NULL, vtk_path = NULL, print.progress = TRUE) setwd("../") # Convert a subset OBJ meshes to VTK meshes, and change ID setwd("./data") files_obj <- dir(pattern = "*.obj")[1:2] ID_vtk <- c("specimen1", "specimen2") obj2vtk(files = files, ID = NULL, vtk_path = NULL, print.progress = TRUE) setwd("../")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.