Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation and support for editing .c3d files. #33

Open
wants to merge 125 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
e849fb1
Minor PEP8 cleanup
MattiasFredriksson Jun 14, 2021
33539ec
check_metadata() -> _check_metadata()
MattiasFredriksson Jun 27, 2021
23e9f76
Reader.dtype -> Reader._dtype
MattiasFredriksson Jun 27, 2021
1cf5b50
Manager.header -> Manager._header
MattiasFredriksson Jun 27, 2021
35a1b1a
Header property descriptor
MattiasFredriksson Jun 27, 2021
5f43a05
Manager.group -> Manager._group
MattiasFredriksson Jun 27, 2021
437de96
Replaced Reader.processor to use DataTypes.proc_type instead.
MattiasFredriksson Jun 27, 2021
1831566
Header.interpret_events() -> Header._parse_events()
MattiasFredriksson Jun 27, 2021
ca79729
Added Param properties for:
MattiasFredriksson Jun 27, 2021
1c41d8b
Tailing %
MattiasFredriksson Jun 27, 2021
73ef1c6
- Manager.group(), Manager.get() should be used.
MattiasFredriksson Jun 27, 2021
dbd962c
Changes
MattiasFredriksson Jun 27, 2021
67ea346
Decode when setting descriptor.
MattiasFredriksson Jun 27, 2021
f33c720
Assert numeric group id replacement doesnt exist
MattiasFredriksson Jun 27, 2021
1639815
+ is_integer()
MattiasFredriksson Jun 28, 2021
2a46ef6
Tests for managing Group functions
MattiasFredriksson Jun 28, 2021
3fcc9e4
Type + added test to verify renaming string key throws if it exists.
MattiasFredriksson Jun 28, 2021
36d2448
Added tests:
MattiasFredriksson Jun 28, 2021
538506d
test_group_functionality -> test_manager_group_functions
MattiasFredriksson Jun 28, 2021
c351882
+ Removed property tag from Manager._groups accessors
MattiasFredriksson Jun 28, 2021
f286bca
Rename of parameter test file
MattiasFredriksson Jun 28, 2021
9e0dcb9
Added
MattiasFredriksson Jun 28, 2021
b0e25ea
Moved custom writer properties to the header where possible
MattiasFredriksson Jun 29, 2021
0d60753
DataTypes.proc_type -> DataTypes._proc_type
MattiasFredriksson Jun 29, 2021
e4a5e00
Correction for existing tests, updated readme, comments
MattiasFredriksson Jun 29, 2021
8696a9a
Working WriteRead
MattiasFredriksson Jul 1, 2021
1a8f678
Added nan-check, cleaned up + corrected read_frames, added big-endian…
MattiasFredriksson Jul 1, 2021
09d2657
Cleaned up verify
MattiasFredriksson Jul 1, 2021
813a3bf
Event encodings in header, Support for Writer.from_reader('shallow_co…
MattiasFredriksson Jul 2, 2021
3925edf
set_screen_axis
MattiasFredriksson Jul 2, 2021
36067de
set_screen_axis, default values + actual set
MattiasFredriksson Jul 2, 2021
187e0fe
assert input values
MattiasFredriksson Jul 2, 2021
235920a
Missing bracket
MattiasFredriksson Jul 2, 2021
42d3977
Added insert option to Writer.add_frames
MattiasFredriksson Jul 2, 2021
8b0ab99
Comments
MattiasFredriksson Jul 2, 2021
649cd68
get_screen_axis()
MattiasFredriksson Jul 2, 2021
2b8abd7
default proc_type
MattiasFredriksson Jul 2, 2021
02e4490
Moved trailing functions
MattiasFredriksson Jul 2, 2021
6eece59
group.py, parameter.py
MattiasFredriksson Jul 2, 2021
b748272
header.py
MattiasFredriksson Jul 2, 2021
a862229
manager.py + working tests
MattiasFredriksson Jul 2, 2021
2f34fc1
Step in the 'right' direction
MattiasFredriksson Jul 2, 2021
89ad991
Restructure + unittests working
MattiasFredriksson Jul 2, 2021
3bcf57b
GroupWritable -> Group
MattiasFredriksson Jul 3, 2021
c2779f4
Parameter.uint_value, Parameter.int_value
MattiasFredriksson Jul 3, 2021
64c1947
.py
MattiasFredriksson Jul 3, 2021
3839ad6
Looped viewer
MattiasFredriksson Jul 3, 2021
2ce5afa
Script readme
MattiasFredriksson Jul 3, 2021
1426b6f
readme
MattiasFredriksson Jul 3, 2021
7be54d3
Update README.rst
MattiasFredriksson Jul 3, 2021
dbacfff
Update README.rst
MattiasFredriksson Jul 3, 2021
0043b42
Package re-organization for setup.py
MattiasFredriksson Jul 3, 2021
d0db798
Merge branch 'master' of https://github.com/MattiasFredriksson/py-c3d
MattiasFredriksson Jul 3, 2021
5ccf0b8
Update README.rst
MattiasFredriksson Jul 3, 2021
8c07bf7
New version number
MattiasFredriksson Jul 3, 2021
e429d3e
Merge branch 'master' of https://github.com/MattiasFredriksson/py-c3d
MattiasFredriksson Jul 3, 2021
bdbbe04
Improved modúle, class, and function documentation
MattiasFredriksson Jul 3, 2021
b7867b3
Module documentation edit
MattiasFredriksson Jul 3, 2021
c0ec8d6
Removed the sphinx-better-theme documentation
MattiasFredriksson Jul 3, 2021
9f2728d
examples.md
MattiasFredriksson Jul 3, 2021
eb875c2
Moved pack_labels() -> utils
MattiasFredriksson Jul 4, 2021
c3c6345
Changed metadata warning for existence of POINT/ANALOG data to not co…
MattiasFredriksson Jul 4, 2021
1f9860a
Allow None to be passed to set_xxx_labels
MattiasFredriksson Jul 4, 2021
cebf825
Examples
MattiasFredriksson Jul 4, 2021
146ab40
Writing example
MattiasFredriksson Jul 4, 2021
aeaebd0
Reading example
MattiasFredriksson Jul 4, 2021
0a99ed6
Example documentation
MattiasFredriksson Jul 4, 2021
9bef841
Documentation
MattiasFredriksson Jul 4, 2021
56a5d8f
Edit example
MattiasFredriksson Jul 4, 2021
914fb56
Exclude looped motion
MattiasFredriksson Jul 4, 2021
3bbc73f
Added reference to example/ dir
MattiasFredriksson Jul 4, 2021
a9e1771
Docs
MattiasFredriksson Jul 4, 2021
7350a83
Set theme jekyll-theme-cayman
MattiasFredriksson Jul 4, 2021
0651746
Links
MattiasFredriksson Jul 4, 2021
277ecd3
index.md
MattiasFredriksson Jul 4, 2021
9567309
Test readme
MattiasFredriksson Jul 4, 2021
3df5e62
rst
MattiasFredriksson Jul 4, 2021
7817533
Links
MattiasFredriksson Jul 4, 2021
c02fd08
doc main page update
MattiasFredriksson Jul 4, 2021
c101962
Docs
MattiasFredriksson Jul 4, 2021
1c6fbce
Update README.rst
MattiasFredriksson Jul 4, 2021
d76722a
Updated docs
MattiasFredriksson Jul 4, 2021
58fe542
corrected main page link
MattiasFredriksson Jul 4, 2021
647e06a
Update README.rst
MattiasFredriksson Jul 4, 2021
ec48831
Scripts listing
MattiasFredriksson Jul 4, 2021
77048d5
Version 0.6.0
MattiasFredriksson Jul 4, 2021
35e25cb
Updated docs
MattiasFredriksson Jul 4, 2021
bcba725
Updated docs
MattiasFredriksson Jul 4, 2021
0a56a75
pycodestyle ./c3d --max-line-length 120
MattiasFredriksson Jul 4, 2021
a74a906
Code style
MattiasFredriksson Jul 4, 2021
9afe8d5
pip command
MattiasFredriksson Jul 4, 2021
d0ed984
Update README.rst
MattiasFredriksson Jul 4, 2021
7a6d36a
Pycodestyles doc update
MattiasFredriksson Jul 4, 2021
6759843
Update README.rst
MattiasFredriksson Jul 4, 2021
dd5a627
Update README.rst
MattiasFredriksson Jul 4, 2021
c697676
Docstrings
MattiasFredriksson Jul 4, 2021
fd78aee
Merge branch 'master' of https://github.com/MattiasFredriksson/py-c3d
MattiasFredriksson Jul 4, 2021
ebb119a
Test readme.md
MattiasFredriksson Jul 4, 2021
24f5005
.md worked
MattiasFredriksson Jul 4, 2021
5f7120a
Updated docs
MattiasFredriksson Jul 4, 2021
4faef08
documentation -> manual
MattiasFredriksson Jul 4, 2021
08b8269
Update example documentation
MattiasFredriksson Jul 4, 2021
4001e93
Update README.md
MattiasFredriksson Jul 4, 2021
15411e2
Test
MattiasFredriksson Jul 4, 2021
08f15f3
Update README.rst
MattiasFredriksson Jul 4, 2021
56c99da
Manager.get_screen_xy_strings
MattiasFredriksson Jul 5, 2021
4ddaa30
Returns array of single element if dimensions is empty.
MattiasFredriksson Jul 5, 2021
fb5ed86
&= -> |= !!!!!!!!!!!!!!
MattiasFredriksson Jul 5, 2021
51a5f79
License doc
MattiasFredriksson Jul 5, 2021
fd74ca7
pycodestyles, updated docs
MattiasFredriksson Jul 5, 2021
cb800a8
README
MattiasFredriksson Jul 5, 2021
509944d
Updated Manager.last_frame to comply better with documentation, remov…
MattiasFredriksson Jul 6, 2021
9587aac
Updated docs
MattiasFredriksson Jul 6, 2021
673b2e2
consume -> convert in Writer.from_reader()
MattiasFredriksson Jul 11, 2021
c278744
Update README.rst
MattiasFredriksson Jul 11, 2021
fbc0005
Update README.rst
MattiasFredriksson Jul 11, 2021
f4479c0
Update README.rst
MattiasFredriksson Jul 11, 2021
f0f5c50
Update README.rst
MattiasFredriksson Jul 11, 2021
1003843
pycodestyle comments
MattiasFredriksson Jul 15, 2021
37a21e4
pycodestyles
MattiasFredriksson Jul 15, 2021
e103f4f
pycodestyles
MattiasFredriksson Jul 15, 2021
6e28f9b
Merge pull request #1 from MattiasFredriksson/pycodestyle_for_tests
MattiasFredriksson Jul 15, 2021
4b4715d
missing sys in c3d2npz and added info print to c3d-viewer.py
MattiasFredriksson Jul 15, 2021
5047542
Merge branch 'master' of https://github.com/MattiasFredriksson/py-c3d
MattiasFredriksson Jul 15, 2021
36c3777
removed the added info msg
MattiasFredriksson Jul 15, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# C extensions
*.so
*.c3d

# Packages
*.egg
Expand Down Expand Up @@ -41,4 +42,4 @@ docs/_build
.vscode/

# mypy
.mypy_cache/
.mypy_cache/
55 changes: 27 additions & 28 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ data recorded by a 3D motion tracking apparatus.
Installing
----------

Install with pip::
Install with pip (currently outdated, download package from github instead)::

pip install c3d

Expand All @@ -22,53 +22,52 @@ repository and build and install using the normal Python setup process::
Usage
-----

Documentation and examples are available in the `package documentation`_.

Tools
~~~~~

This package includes a script for converting C3D motion data to CSV format
This package includes scripts_ for converting C3D motion data to CSV format
(``c3d2csv``) and an OpenGL-based visualization tool for observing the motion
described by a C3D file (``c3d-viewer``).

.. _scripts: ./scripts

Library
~~~~~~~

To use the C3D library, just import the package and create a ``Reader`` or
To use the C3D library, just import the package and create a ``Reader`` and/or
``Writer`` depending on your intended usage

.. code-block:: python

import c3d

with open('data.c3d', 'rb') as handle:
reader = c3d.Reader(handle)
for i, (points, analog) in enumerate(reader.read_frames()):
print('Frame {}: {}'.format(i, points.round(2)))

You can also get and set metadata fields using the library; see the `package
documentation`_ for more details.

.. _package documentation: http://c3d.readthedocs.org
with open('my-motion.c3d', 'rb') as file:
reader = c3d.Reader(file)
for i, points, analog in reader.read_frames():
print('frame {}: point {}, analog {}'.format(
i, points.shape, analog.shape))

Tests
~~~~~

To run tests available in the test folder, following command can be run from the root of the package directory::

python -m unittest discover .
The library also provide functionality for editing both frame and metadata fields;
see the `package documentation`_ for more details.

.. _package documentation: https://mattiasfredriksson.github.io/py-c3d/c3d/

Caveats
-------

This library is minimally effective, in the sense that the only motion tracking
system I have access to (for testing) is a Phasespace system. If you try out the
library and find that it doesn't work with your motion tracking system, let me
know. Pull requests are also welcome!
The package is tested against the available `software examples`_ but may still not support
every possible format. For example, parameters serialized in multiple parameters
are not handled automatically (such as a LABELS field stored in both POINT:LABELS and
POINT:LABELS2). Reading and writing files from a big-endian system is also not supported.

Tests are currently only run on Windows, which means that Linux and Mac users may
experience some issues. If you experience issues with a file or feature, feel free
to post an issue (preferably by including example file/code/python exception)
or make a pull request!

Also, if you're looking for more functionality than just reading and writing C3D
files, there are a lot of better toolkits out there that support a lot more file
formats and provide more functionality, perhaps at the cost of increased
complexity. The `biomechanical toolkit`_ is a good package for analyzing motion
data.
The package is Python only, support for other languages is available in other packages, for example see `ezc3d`_.

.. _biomechanical toolkit: http://code.google.com/p/b-tk/
.. _software examples: https://www.c3d.org/sampledata.html
.. _ezc3d: https://github.com/pyomeca/ezc3d
Empty file removed __init__.py
Empty file.
Loading