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 a DataFrame.

Returns:
resultTPSData or list of TPSData or pd.DataFrame

If as_frame=False, returns a TPSData for a single specimen or a list of TPSData for multiple specimens. Landmark coordinates are accessible via TPSData.to_numpy(), and semilandmark curves via the TPSData.curves attribute.

If as_frame=True, returns a concatenated DataFrame. When the file contains CURVES data, returns a tuple (landmarks, semilandmarks) of DataFrames.