Skip to main content

Python interface of C3Dserver software for reading and editing C3D motion capture files.

Project description

PyC3Dserver

Python interface of C3Dserver software for reading and editing C3D motion capture files.

Description

PyC3Dserver is a python inteface of C3Dserver using PyWin32.

Installation

PyC3Dserver can be installed from PyPI using pip on Python>=3.7.

pip install pyc3dserver

Prerequisites

C3Dserver x64 edition (for Windows x64 platforms) installation: https://www.c3dserver.com/

Usage

Most of numerical inputs and outputs for PyC3Dserver will be in the form of NumPy arrays. So let's import NumPy module.

import numpy as np

After the installation of PyC3Dserver, you can import it as follows:

import pyc3dserver as c3d

You can get the COM object of C3Dserver like this. You need to use this COM object while you are working with PyC3Dserver module.

# Get the COM object of C3Dserver
itf = c3d.c3dserver()

Then, you can open a C3D file.

# Open a C3D file
ret = c3d.open_c3d(itf, "sample_file.c3d")

Following functions are the most useful ones to extract the information from a C3D file. All the outputs are python dictionary types.

# For the information of header
dict_header = c3d.get_dict_header(itf)
# For the information of all groups
dict_groups = c3d.get_dict_groups(itf)
# For the information of all markers(points)
dict_markers = c3d.get_dict_markers(itf)
# For the information of all forces/moments
dict_forces = c3d.get_dict_forces(itf)
# For the information of all analogs(excluding or including forces/moments)
dict_analogs = c3d.get_dict_analogs(itf)

If you made any modification in the C3Dserver and want to save it, you need to use the following function explicitly.

# Save the C3D file from C3Dserver
ret = c3d.save_c3d(itf, "new_file.c3d")

After all your processes, it is recommended to close the C3D file from C3Dserver.

# Close the C3D file from C3Dserver
ret = c3d.close_c3d(itf)

Examples

There are more functions to get the information of individual markers and analogs. Also there are other functions for editing C3D files. You can find some examples here.

Limitations

PyC3Dserver tries to implement some useful functions using C3Dserver internally, but it does not cover full potential features of C3Dserver. You can develop your own functions using the COM object of C3Dserver in Python.

And PyC3Dserver is under heavy development so that many things may change during this period.

Dependencies

References

Python IDE recommendation

Acknowledgement

This work was funded by the European Union's Horizon 2020 research and innovation programme (Project EXTEND - Bidirectional Hyper-Connected Neural System) under grant agreement No 779982.

How to cite this work

DOI

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyc3dserver-0.1.1.tar.gz (27.2 kB view details)

Uploaded Source

Built Distribution

pyc3dserver-0.1.1-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

File details

Details for the file pyc3dserver-0.1.1.tar.gz.

File metadata

  • Download URL: pyc3dserver-0.1.1.tar.gz
  • Upload date:
  • Size: 27.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for pyc3dserver-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6edd1c492c39689fd38710b0c06eed475741cbda97926b98d51f84ddd1afbfbd
MD5 31a6c39166acd54391c5cec893909514
BLAKE2b-256 a24a514674c52f7a9796d733894b4d0f7774288896ccbf8a0c59a7626c9d7a9b

See more details on using hashes here.

File details

Details for the file pyc3dserver-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pyc3dserver-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 26.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for pyc3dserver-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 216716f2da35ae1830acce5bd90ea8fbad59a6e854866ecddbf6e1add29ed04a
MD5 8b251b6c71923f6b631d91548b2d9012
BLAKE2b-256 fcf3798e0c56a5f5ded681adaeb48549b900525a3d5d54368f9924b17d0206c0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page