# Path: imusim/capture/marker.py
# class MarkerCapture(object):
#     """
#     Marker trajectory data captured synchronously for one or more markers.
# 
#     @ivar sampleTimes: Sequence of times at which samples were taken.
#     """
# 
#     def __init__(self):
#         """
#         Initialise capture.
#         """
#         self._markers = dict()
# 
#     def _addMarker(self, marker):
#         self._markers[marker.id] = marker
# 
#     @property
#     def markers(self):
#         """
#         List of the markers in this capture.
#         """
#         return self._markers.values()
# 
#     def marker(self, id):
#         """
#         Get a marker by identifier.
# 
#         @return: The L{Marker} with the given identifier.
#         """
#         return self._markers[id]
# 
# class Marker3DOF(SampledPositionTrajectory, Marker):
#     """
#     A capture marker with 3DOF position samples.
#     """
#     def __init__(self, capture, id):
#         Marker.__init__(self, capture, id)
#         SampledPositionTrajectory.__init__(self)
# 
# class Marker6DOF(SampledRotationTrajectory, Marker3DOF):
#     """
#     A capture marker with 6DOF position & orientation samples.
#     """
#     def __init__(self, capture, id):
#         Marker3DOF.__init__(self, capture, id)
#         SampledRotationTrajectory.__init__(self)


from imusim.capture.marker import MarkerCapture, Marker3DOF, Marker6DOF
from imusim.maths.quaternions import Quaternion, QuaternionArray
import numpy as np

    markerIndices = dict()

    while True:

        # Read and count each file header line.
        line = datafile.readline().strip('\r\n')
        headerLines = headerLines + 1

        # Key and values are tab-separated.
        items = line.split('\t')
        key = items[0]
        values = items[1:]

        # Handle relevant fields.
        if key == 'FREQUENCY':
            # Frame rate.
            capture.frameRate = int(values[0])
            capture.framePeriod = 1/capture.frameRate
        elif key == 'DATA_INCLUDED':
            # 3D or 6D data.
            type = values[0]
            if (type == '3D'):
                # 3D data fields are implicitly XYZ co-ordinates.
                fieldNames = ['X', 'Y', 'Z']
        elif key == 'BODY_NAMES' or key == 'MARKER_NAMES':
            # List of markers or 6DOF body names.
            for i in range(len(values)):
                name = values[i]
                if type == '6D':

# Path: imusim/capture/marker.py
# class MarkerCapture(object):
#     """
#     Marker trajectory data captured synchronously for one or more markers.
# 
#     @ivar sampleTimes: Sequence of times at which samples were taken.
#     """
# 
#     def __init__(self):
#         """
#         Initialise capture.
#         """
#         self._markers = dict()
# 
#     def _addMarker(self, marker):
#         self._markers[marker.id] = marker
# 
#     @property
#     def markers(self):
#         """
#         List of the markers in this capture.
#         """
#         return self._markers.values()
# 
#     def marker(self, id):
#         """
#         Get a marker by identifier.
# 
#         @return: The L{Marker} with the given identifier.
#         """
#         return self._markers[id]
# 
# class Marker3DOF(SampledPositionTrajectory, Marker):
#     """
#     A capture marker with 3DOF position samples.
#     """
#     def __init__(self, capture, id):
#         Marker.__init__(self, capture, id)
#         SampledPositionTrajectory.__init__(self)
# 
# class Marker6DOF(SampledRotationTrajectory, Marker3DOF):
#     """
#     A capture marker with 6DOF position & orientation samples.
#     """
#     def __init__(self, capture, id):
#         Marker3DOF.__init__(self, capture, id)
#         SampledRotationTrajectory.__init__(self)


# Path: imusim/io/qualisys_tsv.py
from imusim.capture.marker import MarkerCapture, Marker3DOF, Marker6DOF
from imusim.maths.quaternions import Quaternion, QuaternionArray
import numpy as np


    markerIndices = dict()

    while True:

        # Read and count each file header line.
        line = datafile.readline().strip('\r\n')
        headerLines = headerLines + 1

        # Key and values are tab-separated.
        items = line.split('\t')
        key = items[0]
        values = items[1:]

        # Handle relevant fields.
        if key == 'FREQUENCY':
            # Frame rate.
            capture.frameRate = int(values[0])
            capture.framePeriod = 1/capture.frameRate
        elif key == 'DATA_INCLUDED':
            # 3D or 6D data.
            type = values[0]
            if (type == '3D'):
                # 3D data fields are implicitly XYZ co-ordinates.
                fieldNames = ['X', 'Y', 'Z']
        elif key == 'BODY_NAMES' or key == 'MARKER_NAMES':
            # List of markers or 6DOF body names.
            for i in range(len(values)):
                name = values[i]
                if type == '6D':

                    markerClass = Marker6DOF