Skip to content

Commit f5ccf2b

Browse files
fix: correct contraction index formula by removing the squared area term and updating associated tests and documentation
1 parent d6c70cd commit f5ccf2b

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

docs/user_guide/theoretical_framework/low_level/contraction_expansion.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ These shape metrics are used to track structural changes relative to a movement
1717
- **Robustness**: Relies on Convex Hull computation which gracefully handles outlier limbs but can fail mathematically if all points form a flat plane (degeneracy).
1818

1919
### Algorithm Details & Mathematics
20-
The index is the ratio of the squared surface area of the enclosed convex hull to the surface area of the axis-aligned bounding box (AABB).
20+
The index is the ratio of the surface area of the enclosed convex hull to the surface area of the axis-aligned bounding box (AABB).
2121

2222
$$
23-
Index = \frac{Area_{hull}^2}{Area_{bbox}}
23+
Index = \frac{Area_{hull}}{Area_{bbox}}
2424
$$
2525

2626
where $Area_{hull}$ is the internal surface area derived purely from the outermost perimeter of points, and $Area_{bbox}$ is the theoretical bounding rectangle/prism containing all movement.

pyeyesweb/low_level/contraction_expansion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class BoundingBoxFilledArea(StaticFeature):
4545
Mathematical formulation involves computing the ratio:
4646
4747
$$
48-
Index = \frac{Area_{hull}^2}{Area_{bbox}}
48+
Index = \frac{Area_{hull}}{Area_{bbox}}
4949
$$
5050
5151
where $Area_{hull}$ is the surface area of the 3D convex hull enclosing the points,

tests/unit_tests/test_low_level_features.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def test_bounding_box_filled_area():
4242

4343
assert result.is_valid is True
4444
assert hasattr(result, "contraction_index")
45-
assert np.isclose(result.contraction_index, 6.0)
45+
assert np.isclose(result.contraction_index, 1.0)
4646

4747

4848
def test_ellipsoid_sphericity():

0 commit comments

Comments
 (0)