diff --git a/treadmill_gait_analysis/function/gait_analysis.py b/treadmill_gait_analysis/function/gait_analysis.py index 2dc542f..6f5f1d4 100644 --- a/treadmill_gait_analysis/function/gait_analysis.py +++ b/treadmill_gait_analysis/function/gait_analysis.py @@ -74,8 +74,8 @@ def __init__(self, session_dir, trial_name, leg='auto', self.markerDict['markers'][marker] = self.markerDict['markers'][marker][:self.idx_trim_end,:] self.coordinateValues = self.coordinateValues.iloc[:self.idx_trim_end] - # Rotate marker data so x is forward (not using for now, but could be useful for some analyses). - # self.rotation_about_y, self.markerDictRotated = self.rotate_x_forward() + # Rotate marker data so x is forward + self.rotation_about_y, self.markerDictRotated = self.rotate_x_forward() # Segment gait cycles. self.gaitEvents = self.segment_walking(n_gait_cycles=n_gait_cycles,leg=leg) @@ -257,14 +257,14 @@ def compute_step_length(self,return_all=False): step_lengths = {} step_lengths[contLeg.lower()] = ( - - self.markerDictRotatedPerGaitCycle['markers'][leg + '_calc_study'][self.gaitEvents['ipsilateralIdx'][:,:1],0] + - self.markerDictRotatedPerGaitCycle['markers'][contLeg + '_calc_study'][self.gaitEvents['contralateralIdx'][:,1:2],0] + + - self.markerDictRotated['markers'][leg + '_calc_study'][self.gaitEvents['ipsilateralIdx'][:,:1],0] + + self.markerDictRotated['markers'][contLeg + '_calc_study'][self.gaitEvents['contralateralIdx'][:,1:2],0] + self.treadmillSpeed * (self.gaitEvents['contralateralTime'][:,1:2] - self.gaitEvents['ipsilateralTime'][:,:1])) step_lengths[leg.lower()] = ( - self.markerDictRotatedPerGaitCycle['markers'][leg + '_calc_study'][self.gaitEvents['ipsilateralIdx'][:,2:],0] - - self.markerDictRotatedPerGaitCycle['markers'][contLeg + '_calc_study'][self.gaitEvents['contralateralIdx'][:,1:2],0] + + self.markerDictRotated['markers'][leg + '_calc_study'][self.gaitEvents['ipsilateralIdx'][:,2:],0] - + self.markerDictRotated['markers'][contLeg + '_calc_study'][self.gaitEvents['contralateralIdx'][:,1:2],0] + self.treadmillSpeed * (-self.gaitEvents['contralateralTime'][:,1:2] + self.gaitEvents['ipsilateralTime'][:,2:]))