This function will read a landmark matrix from one or more files and use the row names in each matrix to match corresponding landmarks into list elements, ordered first by the landmark name and then numbered by the index of the file (in file
) from which the landmark was read. Landmark lists are the required input format for dltMatchCurvePoints
. Landmark lists are also one of three possible input formats for dltReconstruct
and allow for curve points to be easily pulled out of a landmark set for curve fitting.
semilandmark.pattern
is a regular expression passed to sub()
to identify semilandmarks (curve points). By default, the regular expression "[0-9]+$"
identifies row names that end in more than one digit (e.g. 'tomium_R004') as curve points. sub()
removes the part of the string identified by semilandmark.pattern
in order to group all curve points under one curve name (e.g. 'tomium_R004' would be grouped under 'tomium_R'). Curve grouping can be turned off by setting semilandmark.pattern
to ""
. Once grouped, curve points are sorted only by the numeric portion of their row name (identified by semilandmark.pattern
using regexpr
). Preceding zeros are not necessary. For example, after sorting, the order of the following curve points would be: tomium_R1, tomium_R02, tomium_R9, tomium_R10. Note that if these were sorted simply by row name, the order would be: tomium_R02, tomium_R1, tomium_R10, tomium_R9. Landmarks missing from one or more files are given the value NULL
.
The landmark files are read by read.file()
and should thus conform to all requirements of read.file()
. Arguments for read.file()
can be passed through readLandmarksToList()
(e.g. header
, row.names
, etc.).