stl2vtk | R Documentation |
Batch-converts STL mesh files into VTK mesh files
stlvtk(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 STL meshes |
print.progress |
optional parameter indicating whether to print the progress |
Takes a a list of STL 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 STL meshes to VTK meshes setwd("./data") dir(pattern = "*.stl") stl2vtk(files = NULL, ID = NULL, vtk_path = NULL, print.progress = TRUE) setwd("../") # Convert a subset STL meshes to VTK meshes, and change ID setwd("./data") files_stl <- dir(pattern = "*.stl")[1:2] ID_vtk <- c("specimen1", "specimen2") stl2vtk(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.