GaitAnalysisToolKit
GaitAnalysisToolKit copied to clipboard
The mocap_column_labels attribute isn't modified when the analog channel mapping occurs
This is a DFlowData object after clean_data
is run from the test suite. It seems like the mocap column labels still have Anlg columns whereas the data frame has the replacement names for the accelerometers and EMG signals.
data.mocap_column_labels data.mocap_data data.mocap_tsv_path
ipdb> data.mocap_column_labels
['TimeStamp', 'FrameNumber', 'ROT_REF.PosX', 'ROT_REF.PosY', 'ROT_REF.PosZ', 'ROT_C1.PosX', 'ROT_C1.PosY', 'ROT_C1.PosZ', 'ROT_C2.PosX', 'ROT_C2.PosY', 'ROT_C2.PosZ', 'ROT_C3.PosX', 'ROT_C3.PosY', 'ROT_C3.PosZ', 'ROT_C4.PosX', 'ROT_C4.PosY', 'ROT_C4.PosZ', 'T10.PosX', 'T10.PosY', 'T10.PosZ', 'FP1.ForX', 'FP1.ForY', 'FP1.ForZ', 'FP1.MomX', 'FP1.MomY', 'FP1.MomZ', 'FP2.ForX', 'FP2.ForY', 'FP2.ForZ', 'FP2.MomX', 'FP2.MomY', 'FP2.MomZ', 'Channel1.Anlg', 'Channel2.Anlg', 'Channel13.Anlg', 'Channel14.Anlg', 'Channel15.Anlg', 'Channel16.Anlg', 'Channel17.Anlg', 'Channel18.Anlg', 'Channel19.Anlg', 'Channel20.Anlg', 'Channel21.Anlg', 'Channel22.Anlg', 'Channel23.Anlg', 'Channel24.Anlg', 'Channel25.Anlg', 'Channel26.Anlg', 'Channel27.Anlg', 'Channel28.Anlg', 'RKneeFlexion.Ang', 'RKneeFlexion.Mom', 'RKneeFlexion.Pow', 'R_PectoralisMajorTH1', 'L_RectusFemoris']
ipdb> data.data.columns
Index([u'TimeStamp', u'FrameNumber', u'ROT_REF.PosX', u'ROT_REF.PosY', u'ROT_REF.PosZ', u'ROT_C1.PosX', u'ROT_C1.PosY', u'ROT_C1.PosZ', u'ROT_C2.PosX', u'ROT_C2.PosY', u'ROT_C2.PosZ', u'ROT_C3.PosX', u'ROT_C3.PosY', u'ROT_C3.PosZ', u'ROT_C4.PosX', u'ROT_C4.PosY', u'ROT_C4.PosZ', u'T10.PosX', u'T10.PosY', u'T10.PosZ', u'FP1.ForX', u'FP1.ForY', u'FP1.ForZ', u'FP1.MomX', u'FP1.MomY', u'FP1.MomZ', u'FP2.ForX', u'FP2.ForY', u'FP2.ForZ', u'FP2.MomX', u'FP2.MomY', u'FP2.MomZ', u'F1Y1', u'F1Y2', u'Front_Left_EMG', u'Front_Left_AccX', u'Front_Left_AccY', u'Front_Left_AccZ', u'Back_Left_EMG', u'Back_Left_AccX', u'Back_Left_AccY', u'Back_Left_AccZ', u'Front_Right_EMG', u'Front_Right_AccX', u'Front_Right_AccY', u'Front_Right_AccZ', u'Back_Right_EMG', u'Back_Right_AccX', u'Back_Right_AccY', u'Back_Right_AccZ', u'RKneeFlexion.Ang', u'RKneeFlexion.Mom', u'RKneeFlexion.Pow', u'R_PectoralisMajorTH1', u'L_RectusFemoris', u'Cortex Time', u'D-Flow Time', u'LeftBeltSpeed', u'RightBeltSpeed', u'Time'], dtype='object')
@campanawanna
Shouldn't your analog relabeling relabel the output of DFlowData.mocap_column_labels
?
I suspect this will having bearing on getting the write_tsv
method and similar methods to work.
My thinking was to use that attribute to keep the original column labels saved. It didn't seem like any other method was using it at the time.
I see. I think we will need both though. Because I hit this "bug" when I was trying to use the mocap column labels to access data in the data frame created from clean_data()
, but it couldn't find the columns because they'd been renamed. Hmm. Not sure, but we need to have either the original or new labels available plus a mapping between the two. Maybe a dictionary should be created on initialization that stores the original labels and as things get modified in the class, the values (or keys) of the dictionary update to reflect the new names.