python中的几何形态测量操作
morphops的Python项目详细描述
欢迎来到Morphops!
morphops实现常见的几何运算和算法 形态计量学,在python 3中。
当前版本中的一些高级操作是
- 居中,重新缩放数据
- 刚性旋转,普通和广义Procrustes对齐
- 薄板花键翘曲
- 读取和写入*.dta文件
依赖性
- 努比
安装
pip install morphops
用法示例
importmorphopsasmops# Create 3 landmark sets, each having 5 landmarks in 2 dimensions.A=[[0,0],[2,0],[2,2],[1,3],[0,2]]B=[[0.1,-0.1],[2,0],[2.3,1.8],[1,3],[0.4,2]]C=[[-0.1,-0.1],[2.1,0],[2,1.8],[0.9,3.1],[-0.4,2.1]]# Perform Generalized Procrustes alignment to align A, B, C.# :func:`gpa` is in the procrustes module.res=mops.gpa([A,B,C])# res['aligned'] contains the aligned A, B, C.# res['mean'] contains the mean of the aligned A, B, C.# Create a Thin-plate Spline warp from A to B and warp C.warped_C=mops.tps_warp(A,B,C)# warped_C contains the image of the pts in C under the TPS warp.