Description Usage Arguments Details Value See Also Examples
View source: R/digit_fixed_landmarks.R
Interactive digitization of a mesh or a set of meshes from mesh files (either ply or stl).
1 2 3 4 | ## S3 method for class 'character'
digitMesh(sdir, fixed, idxFixed = 1:fixed, GrOpt=setGraphicOptions(),
FiOpt=setFileOptions(sdir), DeOpt=setDecimOptions(), TeOpt=setTemplOptions(fixed),
verbose = TRUE, ...)
|
sdir |
A character value indicating either a mesh filename to decimate stored within the working directory,
or a directory name within the working directory containing the subdirectory |
fixed |
Number of landmarks to digitize. |
idxFixed |
Numeric vector with |
GrOpt |
List defining options for graphic rendering. See |
FiOpt |
List defining options for file opening and saving. See |
DeOpt |
List defining options for mesh decimation. See |
TeOpt |
List defining options for template definition and use. See |
verbose |
Possible settings are: |
... |
Optional arguments used for mesh decimation. See |
This function is a wrapper for digitMesh.mesh3d
, calling it to treat a list of mesh files,
which will be digitized one after the other. Options for mesh file opening and landmark coordinate saving
are settable with the FiOpt
argument. A preliminary decimation step can be processed to create the
decimated version of the meshes if needed. The settings for this decimation step are set through the
DeOpt
argument. Moreover, to fasten the digitizing process, the use of a template configuration
is possible whose options can be set through the TeOpt
argument. Basically, with default arguments,
the function will sequentially open the mesh files in a given directory, decimate them, allow user to
digitize landmark (see digitMesh.mesh3d
for details), store landmark coordinates in an
array, and export them into a tps file. The first digitized mesh will serve as template for the
digitization of the following meshes. After each mesh digitization a message displayed in the console asks
the user to digitize or not the next mesh file.
An array with fixed
lines, 3 columns and n slices (one for each treated mesh) containing the
3D coordinates of the digitized landmarks.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | ## Not run:
# Below some possible uses of the digitMesh.character() function (examples are not exhausive, see in
# particular the helps of setGraphicOptions(), setFileOptions(), setDecimOptions() and setFileOptions() for details).
# 1st example: digitizing a mesh file
# A basic call consists in giving the filename of the mesh to digitize (contained in the working directory):
A <- digitMesh("mesh2digitize.ply", 10)
# 2nd example: digitizing mesh files in a given directory
# If the working directory contains a subdirectory named "fold" with the full resolution mesh files to digitize, a basic call of the function is:
A <- digitMesh("fold", 10)
# 3rd example: pursuing a previous digitiztion session
# If during a first digitization session, not all the mesh files were processed, and that landmark
# coordinates were saved into a tps file, it is possible to follow the mesh digitization with untreated
# mesh by specifying the already treated mesh files with the tps file (named "TPS_FileName.tps"):
sdir <- "fold"
FiOpt <- setFileOptions(sdir, saveTPS="TPS_FileName.tps", append=TRUE)
A <- digitMesh(sdir, 10, FiOpt=FiOpt)
# 4th example: digitizing mesh files already decimated, contained in the subfolder "DM" itself within the
# folder full resolution meshes (decimated mesh filemanes distinguish also from full mesh filenames by the suffix "_D"):
sdir <- "fold"
deci.dir<- "DM"
FiOpt <- setFileOptions(sdir, deci.suffix="_D", deci.dir="DM")
DeOpt <- setDecimOptions(makeDecimation=FALSE)
A <- digitMesh(sdir, 10, FiOpt=FiOpt, DeOpt=DeOpt)
# 5th example: using "percent" (percentage of face number reduction, see Rvg:::vcgQEdeci) in place of
# "tarface" (targetted number of faces) for decimation:
A <- digitMesh("fold", 10, percent=0.2)
# 6th example: processing all mesh decimation before mesh digitization
DeOpt <- setDecimOptions(sequential=FALSE)
A <- digitMesh("fold", 10, DeOpt=DeOpt)
# 7th example: defining a given individual for the template configuration
TeOpt<-setTemplOptions(10, template="mesh4tempalte.ply")
A <- digitMesh("fold", 10, TeOpt=TeOpt)
# 8th example: using a coordinate matrix M (from an already digitized mesh) as template
TeOpt<-setTemplOptions(10, template=M)
A <- digitMesh("fold", 10, TeOpt=TeOpt)
# 9th example: processing stl files (contained in the sudirectory "fold4stl")
FiOpt <- setFileOptions("stl", patt=".stl")
A <- digitMesh("fold4stl", 10, FiOpt=FiOpt)
# 10th example: adjusting and drawing 1st major plane before mesh digitization
GrOpt <- setGraphicOptions(PCplanesDraw="pc1-pc2")
A <- digitMesh("fold4stl", 10, GrOpt=GrOpt)
Numerous graphical options are settable: see the help of setGraphicOptions() for details.
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.