Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
BTK tool in Python
#1
Hello everyone,

I'm working on a project in biomechanics and i need to use BTK tools in order to play with some C3D files. But i have a problem :
i followed the steps listed in the tutorial here :
http://biomechanical-toolkit.github.io/d...arted.html

and i wrote these lines :
import sys
import btk
import numpy
reader = btk.btkAcquisitionFileReader()
reader.SetFilename('ScapulaLocatorCalib_1_v1.c3d')
reader.Update()
acq = reader.GetOutput()
acq.GetPointFrequency()
acq.GetPointFrameNumber()
But i don't know where i have to put my C3D file so i have this error :

Error:
Traceback (most recent call last): File "D:/badrou/Desktop/test.py", line 6, in <module> reader.Update() File "C:\Python27\lib\site-packages\btk\__init__.py", line 4942, in Update return _btk.btkAcquisitionFileReader_Update(self) RuntimeError: File doesn't exist Filename: ScapulaLocatorCalib_1_v1.c3d
Thank you so much for your help,
Best regards,

Arif
Reply
#2
Unless you use an absolute path, all file paths are relative to wherever you're running the script, which is normally wherever the script itself is.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020