save.tps: Saves 3D Coordinates into a TPS File

Description Usage Arguments Details Value See Also Examples

View source: R/utils.R

Description

Saves landmark coordinates as generated by digitMesh.mesh3d into a TPS file.
Note: this is not a generic function to create TPS file, it's only designed for 3D landmark data.

Usage

1
2
save.tps(A, ID, file.name, LMheader = "LM3", IDheader = "ID",
         sdir = getwd(), app = FALSE, over.write = FALSE)

Arguments

A

A 2D numerical matrix of landmark coordinates.

ID

A character value containing the individual identifier.

file.name

A character value containing the TPS file name (with extension).

LMheader

A character value specifying the keyword to use in the TPS file to indicate the number of landmarks.
Default: "LM3", for 3D landmarks.

IDheader

A character value specifying the keyword to use in the TPS file to indicate the individual identifier.
Default: "ID".

sdir

A character value indicating the path to the saving directory.
Default: getwd().

app

A logical value indicating if the written data should be appended in the TPS file (if this file already exists).
Default: FALSE.

over.write

A logical value indicating if the file to save should overwrite the previous TPS file with the same name (if it exists).
Default: FALSE.

Details

Given a matrix of landmark coordinates A, this function saves it into a TPS file whose filename is contained into file.name.

Value

Nothing.

See Also

read.tps.

Examples

1
2
3
4
5
# Generates first a 10*3 random matrix, just for illustration purpose,
# but such as it could be obtained after a mesh digitization:
M <- matrix(rnorm(30), 10, 3)
# Then, saves it as a TPS file:
save.tps(M, ID = "randomMatrix", file.name = "TPSfile4randomMatrix.tps")

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