setTemplOptions: Sets Template Options

Description Usage Arguments Details Value Examples

View source: R/utils.R

Description

Set options for template during the digitizing process through the call of digitMesh.character.

Usage

1
2
setTemplOptions(fixed, template = TRUE,
                idxTemplate = 1:4, full.files = FALSE)

Arguments

fixed

A numerical value (positive integer) indicating the number of landmarks to digitize.

template

Possible settings:
- a logical value (TRUE: the 1st mesh in the directory will serve as template, FALSE: no template will be used);
- a character value indicating the filename (with extension) of the mesh to use for template;
- a numerical fixed*3 matrix containing the template coordinates.
Default: TRUE.

idxTemplate

Numeric vector with positive integers indicating the numbers of landmarks of the template used to fit it on the mesh, sorted in the order with which they will be digitized on the mesh. For example, if the landmarks used are the landmarks numbered 10, 12, 17 and 23, and digitized in the following order on the mesh: 12, 10, 23, 17, idxTemplate should be set to: c(12, 10, 23, 17).
Default: 1:4 => the first four landmarks will serve as reference landmarks.

full.files

Either a character vector containing the full mesh filenames to treat (in this case the template filename given in the template argument will be ckecked against the filenames provided in full.files), or FALSE (if template isn't a filename).
Default: FALSE.

Details

This function allows user to set several parameters for the use of a template possibly needed during the call of digitMesh.character. With no arguments, this function returns the default settings for the template options. Any of those options can be modified by setting new values for the corresponding arguments. Non-filled arguments will be set to default. Ill-filled arguments will return errors or warnings.

Value

A list with template, idxTemplate plus a logical value makeTempl indicating if a template should be created during the digitization process.

Examples

1
2
3
4
5
6
7
8
# returning default settings for 30 landmarks:
TeOpt<-setTemplOptions(30)

# setting for using a 30*3 coordinate matrix as a template, and for digitizing landmarks {8,14,29,3}
# (in this order) to fit th template
# 1. generates first a 30*3 random matrix, just for illustration purpose:
M <- matrix(rnorm(90), 30, 3)
TeOpt<-setTemplOptions(30, template = M, idxTemplate = c(8, 14, 29, 3))

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