Skip to content

Commit 6e1bbfd

Browse files
committed
Initial commit.
0 parents  commit 6e1bbfd

20 files changed

Lines changed: 440 additions & 0 deletions
604 KB
Binary file not shown.
2.57 MB
Binary file not shown.
485 KB
Binary file not shown.
2.14 MB
Binary file not shown.
419 KB
Binary file not shown.
2 MB
Binary file not shown.
857 KB
Binary file not shown.
2.73 MB
Binary file not shown.
20 KB
Binary file not shown.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
3+
import btk
4+
from lxml import etree
5+
import cPickle as pickle
6+
7+
templateDirectory = "C:\\Users\\nbr\\Documents\\iDrive\\AppTeam\\Projects\\Open PAF Framework\\Python Example\\Templates\\"
8+
workingDirectory = "C:\\Users\\nbr\\Documents\\iDrive\\AppTeam\\Projects\\Open PAF Framework\\Python Example\\Data\\John Doe_0001\\2017-12-05_0010\\"
9+
10+
c3dFile = "Dynamic 1.c3d"
11+
xmlc3dFile = c3dFile.replace(' ','_')
12+
13+
reader = btk.btkAcquisitionFileReader() # build a btk reader object
14+
reader.SetFilename(workingDirectory + c3dFile) # set a filename to the reader
15+
reader.Update()
16+
acq = reader.GetOutput() # acq is the btk aquisition object
17+
18+
captureFq = acq.GetPointFrequency() # give the point frequency
19+
frames = acq.GetPointFrameNumber() # give the number of frames
20+
21+
page = etree.Element('xml')
22+
doc = etree.ElementTree(page)
23+
filename = etree.SubElement(page, xmlc3dFile)
24+
headElt = etree.SubElement(filename, 'Metrics')
25+
out = etree.SubElement(headElt, 'Capture_Frequency')
26+
out.text = str(captureFq)
27+
out = etree.SubElement(headElt, 'Frames')
28+
out.text = str(frames)
29+
30+
with open(workingDirectory + 'output.xml', 'w') as f:
31+
f.write(etree.tostring(doc, pretty_print=True))
32+
33+

0 commit comments

Comments
 (0)