PROCRUSTES
收藏Zenodo2026-06-16 更新2026-06-17 收录
下载链接:
https://zenodo.org/doi/10.5281/zenodo.20722854
下载链接
链接失效反馈官方服务:
资源简介:
This code is preceded by:1) DETECT_LEAVES found at: https://doi.org/10.5281/zenodo.200903332) 10 CLASS PREDICTION AND ALIGNMENT found at: https://doi.org/10.5281/zenodo.20241355
Using aligned, corresponding image features of the segmented RGB leaf mask (ALIGNED_LEAF_MASKS/), predicted features (ALIGNED_LEAF_LOBES/), and radial ECT of the segmented blade outline (ALIGNED_LEAF_ECT/), this analysis 1) extracts landmarks for the blade and the vein outlines (0_find_landmarks.py), performs a Generalized Procrustes Analysis (GPA) to calculate an overall mean leaf and align leaf coordinates to that mean (1_generalized_procrustes_analysis.py), and then visualizes a morphospace, average leaves for each class, records for each class the number of leaves that did not pass the quality check and why, and saves coordinates of only those leaves that pass quality check thresholds (2_morphospace_and_final_coords.py). The final set of Procrustean-aligned leaf coordinates to use for subsequent analysis are found in FINAL_PROCRUSTES_COORDS/. There are several quality checks, including missing features, overlapping features that interfere with landmark placement, and a final quality cut-off that eliminates any leaf more than two standard deviations from the mean.
PROCRUSTES/ # Derive procrustean aligned landmarks from predicted leaf masks├── 0_find_landmarks.py # From predicted masks, find pseudo-landmarks├── 1_generalized_procrustes_analysis.py # Generalized Procrustes Alignment of landmarks to GPA mean├── 2_morphospace_and_final_coords.py # Create figures, tables, and final Procrustean coordinate files├── outputs/ ├── figures/ # Figures and table for morphospace, average leaves, included leaves └── generalized_procrustes_analysis/ # GPA mean, list of leaves that pass quality check └── landmarks/ # landmarks, landmark key, coordinates, check
ALIGNED_LEAF_MASKS/ # https://zenodo.org/records/20242260ALIGNED_LEAF_LOBES/ # https://zenodo.org/records/20241355ALIGNED_LEAF_ECT/ # https://zenodo.org/records/20241355
FINAL_PROCRUSTES_COORDS/ # folder containing Procrustes coordinates for each leaf for further analysis
0_find_landmarks.py — Landmark Extraction from Predicted Anatomical Features
Using anatomically aligned predictions of lobes, veins, and the petiolar junction, this script derives a dense set of homologous pseudo-landmarks describing both the vascular architecture and outer blade margin of each leaf. Predicted vein classes are used to identify the petiolar junction, primary vein tips, and intervening sinuses, which define a common landmark framework across leaves. Vein outlines are reconstructed and sampled at equal intervals to generate vascular landmarks, while the blade outline is partitioned into biologically corresponding segments and sampled to generate blade landmarks. Together these landmarks produce a standardized coordinate representation consisting of 440 points per leaf. Diagnostic images are generated to verify landmark placement, and leaves failing quality-control criteria, such as missing primary veins or overlapping landmark positions, are recorded and excluded from downstream analyses.
1_generalized_procrustes_analysis.py — Generalized Procrustes Alignment and Consensus Shape Estimation
This script performs a Generalized Procrustes Analysis (GPA) on the landmark configurations generated from individual leaves. Landmark coordinates are centered, scaled to unit size, and iteratively rotated to maximize agreement with a consensus configuration, producing a population-wide mean leaf shape. The resulting GPA mean is saved as a reference template and visualized for verification. Following alignment, each leaf is represented as a high-dimensional Procrustean shape vector, and nearest-neighbor distances are calculated in morphospace using a k-d tree. These distances provide an objective measure of how closely each leaf resembles other leaves in the dataset and are subsequently used as a quality-control metric to identify morphological outliers for exclusion.
2_morphospace_and_final_coords.py — Morphospace Visualization, Quality Control, and Final Coordinate Export
Using Procrustes-aligned landmark coordinates and associated metadata, this script constructs a morphospace through principal component analysis (PCA) and generates publication-quality visualizations of leaf shape variation. Morphospaces are rendered with reconstructed leaf shapes projected onto principal component axes, while class-specific average leaves are calculated from the aligned coordinates to illustrate characteristic morphologies of each biological group. Quality-control filtering is then applied by identifying leaves whose nearest-neighbor Procrustes distances exceed a specified threshold, removing specimens that are unusually distant from the population mean. Summary tables report the number of leaves excluded due to missing features, overlapping landmarks, or excessive Procrustes distance. Finally, only those leaves passing all quality-control criteria are exported to the FINAL_PROCRUSTES_COORDS directory for downstream morphometric analyses.
提供机构:
Zenodo创建时间:
2026-06-16



