ElliShape (Morphology Analysis tools)

介绍

物种的形态变异普遍存在于地球上的所有生命之中。准确捕捉并全面解析生物形态及其变异,对于理解形态与发育及环境驱动力之间的内在联系至关重要。几何形态测量学为高维生物形态的定量分析提供了数学工具,被誉为形态测量学领域的一场革命。椭圆傅里叶分析是几何形态测量学中常用的方法,但椭圆傅里叶描述子的归一化问题长期存在,导致研究者难以获得唯一且可比较的结果,尤其是对于基于轮廓线法的几何形态测量应用。这限制了该方法对高通量、高变异、高维度的生物形态进行自动化分析的能力。

我们提出了一种椭圆傅里叶描述子完全归一化方法,理论推导证明,该方法在所有基本轮廓变换下均能得到一致的归一化的结果。在此基础上,我们引入了最小欧式距离方法,开展基于归一化描述子重构形态的定量比较,该方法在数学上保证了结果的唯一性和可比性。基于这些改进,开发ElliShape软件,三个版本适应多种应用场景:命令行版本支持自定义参数的批量处理;图形用户界面版本集成了Segment Anything模型,可实现器官的自动分割;Web版本则提供免安装的便捷访问方式。

我们使用基准数据集对椭圆傅里叶描述子完全归一化方法进行了逐一验证。同时,我们对86个物种的1338个叶片形状进行了定量形态分析,构建的形态树显示聚类模式与叶片椭圆度和裂叶程度的变化密切相关。

完全归一化的椭圆傅里叶描述子及其对应的轮廓可进一步用于深度学习的训练以实现精确的物种识别。此外,几何形态测量学与机器学习的结合在整合分类学、生物多样性保护、物种分类及生态系统功能评估等方面具有重要价值,从而推动形态大数据驱动的跨尺度生物学研究。

下载与编译

您可以下载图形用户界面(GUI)应用程序和便于批量处理的命令行(CLI)脚本应用程序

有关使用说明,请参阅中文英文使用手册。

文章使用的相关ElliShape训练数据集可在此下载:https://www.plantplus.cn/ellishape/file/ElliShape_training_Dataset.zip

在线演示

我们已成功推出在线试用版本,旨在鼓励全球公众积极参与到标本数据的探索和挖掘。

Introduction

Morphological variations, both within and between species, occur pervasively throughout life on Earth. Accurately capturing and comprehensively analyzing biological morphology and its variations are crucial for understanding their interconnections with developmental and environmental forces. Geometric morphometric (GM) offers mathematical tools for quantitative analysis of multi-dimensional biological forms, which was thought to be a revolution in morphometrics.Elliptic Fourier analysis (EFA) is often employed in geometric morphometrics (GM), but the normalization of elliptic Fourier descriptor (EFD) has persistently posed challenges for obtaining unique and comparable results, especially in the application of outline-based GM methods, which limits the implementation in automated analysis of numerous, highly variable, and multi-dimensional biological forms.

We introduce an approach for complete elliptic Fourier descriptor (EFD) normalization, which remains constant under all basic contour transformations with theoretical derivations. Accordingly, we propose to use minimum Euclidean distance between two shapes reconstructed by completely normalized EFDs for quantitative morphological comparisons, which is mathematically guaranteed to obtain unique and comparable results. Based on these improvements, we developed ElliShape software in a command line version, a graphical user interface (GUI) version, and a web version, which are suitable for batch processing with customizable parameters, automatic organ segmentation with segment anything model (SAM), and convenient access with zero installation, respectively.

The proposed complete EFD normalization procedure is validated using a benchmark dataset. Using the proposed quantitative morphological analysis, we compared 1,338 leaf shapes from 86 species and constructed a morphological tree. The resulting tree shows clustering patterns linked to variations in leaf ellipticity and lobation.

The completely normalized EFDs and corresponding contours can be further utilized in deep learning-based data training for accurate shape identification. Moreover, the integration of geometric morphometrics and machine learning is very useful for integrative taxonomy, biodiversity conservation, species classification, and ecosystem function assessment, thereby promoting cross-scale biological research driven by morphological big data.

Download and compile

You can download the application with GUI and the application with command line scripts.

Please refer to the English and Chinese manuals for usage instructions.

The relevant ElliShape training Dataset used in this paper is available here, https://www.plantplus.cn/ellishape/file/ElliShape_training_Dataset.zip.

Online demo

We have successfully developed and launched the online demo, to encourage global public participation in specimen exploration.

视频1 文章两个核心算法(完全归一化、最小距离计算)原理演示视频
Video 1: Demonstration of the Principles behind Two Core Algorithms (Complete Normalization and Minimum Distance Calculation)
图1 获取椭圆傅里叶描述子的方法。 (a) 数字曲线的八方向链码基本线段定义,(b) 链码表示的数字曲线示例,(c) 谐波系数,(d) 不同阶数(N)椭圆傅里叶描述子(EFDs)重构形状(红色虚线)与原始形状(蓝色实线)
Fig. 1 The approach for obtaining the elliptic Fourier descriptors. (a) Basic line segments of digital curve, (b) example of a curve represented by chain code, (c) harmonic coefficients, (d) reconstructed shape of the original curve using different order of EFDs.
图2 椭圆傅里叶描述子的完全归一化流程(以乌龟图形(蓝色轮廓线)为例):第一步,将直流分量置零,完成二维平面平移归一化(a);第二步,基于原始曲线的一阶椭圆曲线(红色虚线),采用右手定则确定轮廓的行进方向,并将其归一化为逆时针方向(b);第三步,利用一阶椭圆曲线的长轴长度进行尺度归一化(c),同时将长轴旋转至与 x 轴重合,完成旋转归一化(d);第四步,将轮廓起点固定在 x 轴正方向单位向量处,实现起始点归一化(e);完成上述步骤后,再根据二阶椭圆傅里叶系数调整符号取值,完成 x 轴对称与 y 轴对称归一化(f)
Fig.2 The procedure of true elliptic Fourier descriptor normalization, using the graphics of a turtle (blue line) as an example: First, we set the direct components to zero for planar translation normalization (a). Second, we determine the heading direction using the right-hand rule and normalize the heading direction to anticlockwise (b), based on the 1st-order elliptic curve (red dotted line) of the original curve. Third, we use the major axis length of the 1st order elliptic curve for scale normalization (c) and rotate the major axis to align simultaneously with the x-axis for rotation normalization (d). Fourth, we fix the starting point at the positive unit vector on the x-axis for starting point normalization (e). After these steps, we adjust the sign values for the x-symmetric and y-symmetric normalization (f) according to the 2nd order elliptic Fourier coefficients.
图3. 椭圆傅里叶归一化方法与原始方法(Kuhl & Giardina, 1982)的比较。(a) 六种代表性图形;(b–e) 典型乌龟图形的分析结果
Fig 3. Comparison of elliptic Fourier analysis methods between the original (Kuhl & Giardina, 1982) and our procedure. (a) Six-representative graphics; (b–e) results for typical turtle.
图4. ElliShape 软件架构,包含轮廓提取与椭圆傅里叶分析两个模块。其中,轮廓提取模块包含五项核心功能:目标提取、图像处理、链码生成、测量与结果保存
Fig 4. ElliShape software architecture, which consists of two main components: contour extraction and elliptic Fourier analysis. The contour extraction component involves five primary functions: object extraction, image processing, chain code, measurement and save.

Reference

Kuhl, F. P., & Giardina, C. R. (1982). Elliptic Fourier features of a closed contour. Computer graphics and image processing, 18(3), 236-258. https://doi.org/10.1016/0146-664X(82)90034-X.
Wu, Hui, Yang, Jiajie, Wu, Ping, Li, Chaoqun, Ran, Jinhua, Peng, Renhua,* & Wang, Xiaoquan.* (2026). Complete elliptic Fourier descriptor normalization and its application in quantitative morphological analysis. Methods in Ecology and Evolution.