digitMesh.character: Digitizes several Meshes

Description Usage Arguments Details Value See Also Examples

View source: R/digit_fixed_landmarks.R

Description

Interactive digitization of a mesh or a set of meshes from mesh files (either ply or stl).

Usage

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, ...)

Arguments

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 subdirectoryM with the mesh files to decimate.

fixed

Number of landmarks to digitize.

idxFixed

Numeric vector with fixed integers specifing the landmark labelling in which the landmarks will be digitized.

GrOpt

List defining options for graphic rendering. See setGraphicOptions for details.

FiOpt

List defining options for file opening and saving. See setFileOptions for details.

DeOpt

List defining options for mesh decimation. See setDecimOptions for details.

TeOpt

List defining options for template definition and use. See setTemplOptions for details.

verbose

Possible settings are:
- a logical value: in this case this value should be recycled in a 2 length vector indicating for 2 levels of verbose if comments should be printed or not on screen as the computations are processed. The firs level corresponds to comments specific to the functions from the digit3DLand library, and the second one to comments specific to the functions from the Rvcg library.
- a 2-length logical vector standing for the 2 possible levels of verbose.

...

Optional arguments used for mesh decimation. See vcgQEdecim for details.

Details

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.

Value

An array with fixed lines, 3 columns and n slices (one for each treated mesh) containing the 3D coordinates of the digitized landmarks.

See Also

digitMesh.mesh3d.

Examples

 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)

morphOptics/digit3DLand documentation built on July 17, 2021, 8:27 p.m.