Skip to main content

pyc3dtools

This is python package that you can use it to read your c3d file. Actually, this is an C3Dtools.com API. The C3Dtools.com is a free web-based biomechanical toolbox. On C3Dtools.com you can :

    - Lower Body Inverse Kinematic - Plug-in Gait Model NEW
    - Convert C3D file to ASCII and create .TRC and .MOT that is compatible with the Opensim
    - Convert Xsens IMU sensors data to .sto to use in Opensim(Opensens)
    - Detect Gait events based on kinematic data
    - Calculate spatiotemporal gait parameters based on kinematic data
    - Apply Butterworth low-pass and high-pass digital filtering
    - Free C3D files repository
    - Trim C3D file   

Install

pip install pyc3dtools

Usage

First of all, create an account (Register) and then log in to your account, you can find the API token on the home page

and then import pyc3dtools package

import pyc3dtools

Finally pass the API token and your file path to the readC3D function as an input,

c3d =  pyc3dtools.readC3D(TOKEN,'TYPE-2.C3D')

Get data

1.Header section

Number_of_Markers = c3d['Header']['Number_of_Points']
First_Frame = c3d['Header']['first_frame']
Last_Frame = c3d['Header']['last_frame']
Video_Sampling_Rate = c3d['Header']['Video_Frame_Rate']
Number_of_Analog_Channels = c3d['Header']['Analog_number_channel']
Analog_Sample_Rate = c3d['Header']['Analog_Frame_Rate']
Analog_sample_per_video_frame = c3d['Header']['Analog_sample_per_Frame']

2.Marker & Analog Labels

Markers_Label = c3d['Markers Label']
Analog_Label = c3d['Analog Label']

3. Markers

### c3d['Markers'][frame][marker][:3]

p1 = c3d['Markers'][0][0][:3] # Get the position of the first marker (x,y,z) in the first frame 
p2 = c3d['Markers'][100][0][:3] # Get the position of the first marker (x,y,z) in the 100th frame
p3 = c3d['Markers'][100][1][:3] # Get the position of the second marker (x,y,z) in the 100th frame

5. Units and Coordinate System

Units = c3d['Units']
coordinate_System = c3d['Coordinate system'] #[X_SCREEN, Y_SCREEN]

6. ForcePlate Type 2,3,4,5

### c3d['ForcePlate'][Plate Number]['FZ'][Frame][Analog Frame per Video Frame]

Number_Of_Forceplates = len(result['ForcePlate'])
Force = c3d['ForcePlate'][0]['FX'][100] ,c3d['ForcePlate'][0]['FY'][100],c3d['ForcePlate'][0]['FZ'][100] 
Force = c3d['ForcePlate'][0]['FX'][100][10] ,c3d['ForcePlate'][0]['FY'][100][10],c3d['ForcePlate'][0]['FZ'][100][10] 
Corners c3d['ForcePlate'][0]['corners']
Origin = c3d['ForcePlate'][0]['Origin']

### c3d['ForcePlate'][Plate Number]['COP'][Frame][X|Y|Z][Frame][Analog Frame per Video Frame]
Xcop_frame_50_1 = c3d['ForcePlate'][0]['COP'][50][0][1]
Ycop_frame_50_1 = c3d['ForcePlate'][0]['COP'][50][1][1]
Zcop_frame_50_1 = c3d['ForcePlate'][0]['COP'][50][2][1]

Release files for pyc3dtools 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyc3dtools 0.1.1
File Size Uploaded
pyc3dtools-0.1.1.win-amd64.zip 8.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyc3dtools 0.1.1
File Interpreter ABI Platform
pyc3dtools-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.7 kB

Release files / pyc3dtools-0.1.1.win-amd64.zip

Download URL pyc3dtools-0.1.1.win-amd64.zip
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
faf648e7cb09572ae5a855e630da5df84457579fd73f1c989926783858df9d45
BLAKE2b-256 checksum
How to use checksums
c80156c44ffe96d4ba56491d5bebe97e0cea4e07f2923ae38e620c43c38bdc68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Release files / pyc3dtools-0.1.1-py3-none-any.whl

Download URL pyc3dtools-0.1.1-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
483979a94e6c15fa3f5712fbc446236a778d49de0ee0031638d055ff4e668053
BLAKE2b-256 checksum
How to use checksums
24411c6d8d6ff436e91a69f9646520034bd386918b2af01291f0c8167fb77a10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Release history Release notifications | RSS feed

0.3.2

1 release file

0.3.1

1 release file

0.2.8

1 release file

0.2.7

1 release file

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.1.2

2 release files

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page