ktch.io#

The ktch.io module implements I/O interface for morphometrics file formats.

I/O Functions#

io.read_tps(file_path[, as_frame])

Read landmark data from a TPS file.

io.write_tps(file_path, landmarks[, ...])

Write landmark data to a TPS file.

io.read_chc(file_path[, as_frame])

Read chain code (.chc) file.

io.write_chc(file_path, chain_codes[, ...])

Write chain code to .chc file.

io.read_nef(file_path[, as_frame])

Read normalized EFD (.nef) file.

io.write_nef(file_path, coeffs[, ...])

Write normalized EFD coefficients to a .nef file.

io.read_spharmpdm_coef(path)

Read .coef file of SPHARM-PDM.

Data Containers#

io.NefData(specimen_name, coeffs[, const_flags])

Normalized elliptic Fourier descriptor data.

io.ChainCodeData(specimen_name, x, y, ...[, ...])

Chain code data class.

io.TPSData(specimen_name, landmarks, ...)

Data for a single specimen in TPS format.

io.SpharmPdmData(specimen_name, coeffs)

SPHARM-PDM coefficient data for a single specimen.

Protocols#

io.MorphoData(*args, **kwargs)

Interface for morphometric data containers.

io.MorphoDataMixin()

Shared implementation for morphometric data containers.

Conversion Functions#

io.nef_to_efa_coeffs(nef_data[, dc_offset])

Convert NefData to EFA-compatible flat coefficient vectors.

io.efa_coeffs_to_nef(coeffs[, ...])

Convert EFA flat coefficient vectors to NefData objects.

io.convert_coords_df_to_list(df_coords)

Convert a coordinate DataFrame to a list of per-specimen arrays.

io.convert_coords_df_to_df_sklearn_transform(...)

Convert a coordinate DataFrame to sklearn-compatible wide format.