feat: Redesign orientation API with perpendicular vector and vector-from-to#853
Open
mujju-212 wants to merge 2 commits intoneuroinformatics-unit:mainfrom
Open
feat: Redesign orientation API with perpendicular vector and vector-from-to#853mujju-212 wants to merge 2 commits intoneuroinformatics-unit:mainfrom
mujju-212 wants to merge 2 commits intoneuroinformatics-unit:mainfrom
Conversation
…rom-to (neuroinformatics-unit#616) - Add compute_perpendicular_vector() - renamed from compute_forward_vector with clearer semantics (cross-product of left-right with up axis) - Add compute_vector_from_to() - new function for direction vectors between any two keypoints (e.g. neck-to-nose) - Add compute_vector_angle() - new function to compute signed angles of pre-computed vectors against a reference direction - Deprecate compute_forward_vector() and compute_forward_vector_angle() with backward-compatible wrappers that emit DeprecationWarning - Update kinematics __init__.py exports - Rewrite orientation test suite with full coverage (26 tests) Closes neuroinformatics-unit#616
a3a626d to
2958fd3
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Closes #616
This PR redesigns the orientation API as discussed in the issue and community call, adding composable vector computation and angle functions.
Changes
New Functions
compute_perpendicular_vector(data, left_keypoint, right_keypoint, camera_view)compute_forward_vector— same cross-product logic, clearer name reflecting that it produces a vector perpendicular to the left–right axiscompute_vector_from_to(data, from_keypoint, to_keypoint)compute_vector_angle(vector, reference_vector, in_degrees)Deprecated Functions
compute_forward_vectorcompute_perpendicular_vectorDeprecationWarningcompute_forward_vector_anglecompute_perpendicular_vector+compute_vector_angleDeprecationWarningDesign Decisions
compute_forward_vector/compute_forward_vector_anglecontinues to work with deprecation warningsExample Usage
Tests
test_orientation.pywith 26 tests covering all new and deprecated functionsTestVectorFromTo,TestVectorAngle,TestForwardVectorAngletest_roi/test_angles.pyFiles Changed
movement/kinematics/orientation.pymovement/kinematics/__init__.pytests/test_unit/test_kinematics/test_orientation.py