ply2vtk: ply2vtk

View source: R/ply2vtk.R

ply2vtkR Documentation

ply2vtk

Description

Batch-converts PLY mesh files into VTK mesh files

Usage

plyvtk(files = NULL, ID = NULL, vtk_path = NULL, print.progress = TRUE)

Arguments

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 PLY meshes

print.progress

optional parameter indicating whether to print the progress

Details

Takes a a list of PLY meshes and transforms those files into VTK. For more information check the R package _freesurferformats_ (Schäfer, 2020)

Value

This function returns a table with the meshes information (name, number of faces and vertices) and the volume for each surface mesh.

Author(s)

Marta Vidal-Garcia

References

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

Examples

# Convert all PLY meshes to VTK meshes
setwd("./data")
dir(pattern = "*.ply")
ply2vtk(files = NULL, ID = NULL, vtk_path = NULL, print.progress = TRUE)
setwd("../")

# Convert a subset PLY meshes to VTK meshes, and change ID
setwd("./data")
files_ply <- dir(pattern = "*.ply")[1:2]
ID_vtk <- c("specimen1", "specimen2")
ply2vtk(files = files, ID = NULL, vtk_path = NULL, print.progress = TRUE)
setwd("../")


marta-vidalgarcia/mesh_process documentation built on May 7, 2022, 12:08 a.m.