Skip to content

Add C3D file loader#928

Open
Aadit-Khurana wants to merge 5 commits intoneuroinformatics-unit:mainfrom
Aadit-Khurana:add-c3d-loader
Open

Add C3D file loader#928
Aadit-Khurana wants to merge 5 commits intoneuroinformatics-unit:mainfrom
Aadit-Khurana:add-c3d-loader

Conversation

@Aadit-Khurana
Copy link
Copy Markdown

Description

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed?

Closes #299.
There is currently no native way to load .c3d files into movement.

What does this PR do?

Adds a new C3D loader using ezc3d.
Bypasses header errors by extracting the core point matrix directly.
Shuffles the raw axes and successfully packages the data into the required movement xarray.Dataset format with dimensions ["time", "space", "keypoints", "individuals"].

References

Closes #299

How has this PR been tested?

Tested locally to extract and format a 3D dataset.
Added unit tests in tests/test_unit/test_io/test_load_c3d.py to ensure it gracefully handles missing files (FileNotFoundError) and invalid/corrupted files (ValueError).

Is this a breaking change?

No.

Does this PR require an update to the documentation?

Yes
The supported formats table in the user guide will need to be updated to include .c3d. (Will add this once the core loader logic is reviewed).

Checklist:

  • The code has been tested locally
  • Tests have been added to cover all new functionality
  • The documentation has been updated to reflect any changes
  • The code has been formatted with pre-commit

@Aadit-Khurana Aadit-Khurana marked this pull request as ready for review March 27, 2026 03:26
@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.

Add support for optical marker-based motion capture data

1 participant