Skip to content

Add compute_sinuosity kinematics metric#940

Open
mujju-212 wants to merge 3 commits intoneuroinformatics-unit:mainfrom
mujju-212:feat/904-compute-sinuosity
Open

Add compute_sinuosity kinematics metric#940
mujju-212 wants to merge 3 commits intoneuroinformatics-unit:mainfrom
mujju-212:feat/904-compute-sinuosity

Conversation

@mujju-212
Copy link
Copy Markdown

Summary

  • add compute_sinuosity to movement.kinematics.kinematics
  • export compute_sinuosity from the public movement.kinematics API
  • add focused unit tests for straight, curved, stationary, and too-short trajectories

Details

Sinuosity is implemented as:

  • path length over selected time range (compute_path_length)
  • divided by straight-line start-end distance (compute_norm(end - start))

Behavior:

  • supports the same
    an_policy options as compute_path_length ( fill, scale)
  • supports start / stop slicing in time units
  • returns NaN when straight-line distance is zero (undefined ratio)

Testing

  • pytest -q -k sinuosity tests/test_unit/test_kinematics/test_kinematics.py

Closes #904

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Metrics] Add function for computing sinuosity (Benhamou 2004)

1 participant