Biomechanical-ToolKit / BTKCore

Core of the project to represent biomechanical data, file formats and data processing
Other
78 stars 55 forks source link

fails to open sample c3d trial (via Python wrapper) #13

Open jjnurminen opened 8 years ago

jjnurminen commented 8 years ago

Hi,

I have used the btk Python wrapper successfully in the past. Now I downloaded some sample c3d data from: https://www.c3d.org/data/sample03.zip

I extracted the trials and tried the following code:

import btk c3dfile = "gait-pig.c3d" reader = btk.btkAcquisitionFileReader() reader.SetFilename(c3dfile) reader.Update()

However this causes the Python interpreter to crash. I get the following print at the console:

[BTK WARNING] gait-pig.c3d - The number of blocks to be read in the parameter section is different than the number of blocks read. The value kept is the number of blocks read. [BTK ERROR] Impossible to set a scaling factor to 0. [BTK ERROR] Impossible to set a scaling factor to 0. [BTK ERROR] Impossible to set a scaling factor to 0. [BTK ERROR] Impossible to set a scaling factor to 0. [BTK ERROR] Impossible to set a scaling factor to 0. [BTK ERROR] Impossible to set a scaling factor to 0.

I'd also note that the file opens just fine in Mokka, which uses btk. So maybe the problem is with the Python wrapper?

kaufManu commented 6 years ago

I have the same problem, were you able to find a solution?

aaa34169 commented 6 years ago

I also get this error message with this c3d. notice you can get all markers though.

I don t know how was built this c3d. i remember we found out an error related to the "subject" prefix if you work with multiple subjects. It s not my pratice. i would be happy to test a c3d construct from Nexus 2.6.

notice i test with openMA and no warning come up.

cheers

On 9 November 2017 at 14:03, kaufManu notifications@github.com wrote:

I have the same problem, were you able to find a solution?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Biomechanical-ToolKit/BTKCore/issues/13#issuecomment-343163242, or mute the thread https://github.com/notifications/unsubscribe-auth/AC9GBbpTbgjJFON1IRFwSkSsT3H1B_Y8ks5s0wYMgaJpZM4HdDwv .

--

Fabien Leboeuf

Research fellow ( University of salford)

kaufManu commented 6 years ago

@aaa34169 How can you get the markers? I tried to do this with the Python wrapper, but could not find the function. I could only make this work with the Matlab wrapper.

aaa34169 commented 6 years ago

yes !

just with acq.GetPoint("A22:RKNE").GetValues()

kaufManu commented 6 years ago

@aaa34169 this is what is throwing the error mentioned in the original post in my code. The Matlab function markers = btkGetMarkers(acq); also throws that error, but it still gives an output that I can use. However I could not find the equivalent of that function in the python wrapper.

jjnurminen commented 6 years ago

It crashes already when you do call Update(). See first postof thread.

I was never able to load that particular file, but Vicon Nexus produced files have worked OK so far.

aaa34169 commented 6 years ago

when you wrote "crash".do You mean your python shell crashed ?

On 9 November 2017 at 15:18, Jussi Nurminen notifications@github.com wrote:

It crashes already when you do call Update(). See first postof thread.

I was never able to load that particular file, but Vicon Nexus produced files have worked OK so far.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Biomechanical-ToolKit/BTKCore/issues/13#issuecomment-343186512, or mute the thread https://github.com/notifications/unsubscribe-auth/AC9GBQ46hHXlIv5rTP81yv7_3IzAhodfks5s0xfIgaJpZM4HdDwv .

--

Fabien Leboeuf

Research fellow ( University of salford)

jjnurminen commented 6 years ago

Yep, the Python interpreter throws a segmentation fault.