read_tps#

ktch.io.read_tps(file_path, as_frame=False)[source]#

Read landmark data from a TPS file.

Parameters:
file_pathstr or path-like

Path to the TPS file.

as_framebool, default=False

If True, return pandas DataFrame(s). Otherwise, return ndarray(s).

Returns:
landmarksndarray of shape (n_specimens, n_landmarks, n_dim) or DataFrame

Landmark coordinates. For a single specimen without semilandmarks, the shape is (n_landmarks, n_dim).

semilandmarkslist, optional

Returned only when the file contains CURVES data. When as_frame=False, a list of per-specimen curve lists (each curve is an ndarray of shape (n_points, n_dim)). When as_frame=True, a list of per-specimen DataFrame lists.