will2hew / ECGXMLReader

Python class for reading ECG XML files.
14 stars 5 forks source link

list indices must be integers or slices, not str #1

Open rybad80 opened 3 years ago

rybad80 commented 3 years ago

Really awesome work here....I'm trying to get this to work on a GE MUSE ECG XML file but getting this error returned when passing ecg = ECGXMLReader(data, augmentLeads=True) where data is my file path+name

will2hew commented 3 years ago

Are you able to share the ECG file?

rybad80 commented 3 years ago

So unfortunately it has patient information, but I did notice that the following works, so I wonder if addressing the specific index (or looking through somehow) is required?

rawRhythmWaveformLeadI = ECG['RestingECG']['Waveform'][1]['LeadData'][0]['WaveFormData']

rawRhythmWaveformLeadII   = ECG['RestingECG']['Waveform'][1]['LeadData'][1]['WaveFormData']

rawRhythmWaveformLeadV1   = ECG['RestingECG']['Waveform'][1]['LeadData'][2]['WaveFormData']

rawRhythmWaveformLeadV2   = ECG['RestingECG']['Waveform'][1]['LeadData'][3]['WaveFormData']

rawRhythmWaveformLeadV3   = ECG['RestingECG']['Waveform'][1]['LeadData'][4]['WaveFormData']

rawRhythmWaveformLeadV4   = ECG['RestingECG']['Waveform'][1]['LeadData'][5]['WaveFormData']

rawRhythmWaveformLeadV5   = ECG['RestingECG']['Waveform'][1]['LeadData'][6]['WaveFormData']

rawRhythmWaveformLeadV6   = ECG['RestingECG']['Waveform'][1]['LeadData'][7]['WaveFormData']

rawRhythmWaveformLeadV3R  = ECG['RestingECG']['Waveform'][1]['LeadData'][8]['WaveFormData']

rawRhythmWaveformLeadV4R  = ECG['RestingECG']['Waveform'][1]['LeadData'][9]['WaveFormData']

rawRhythmWaveformLeadV7   = ECG['RestingECG']['Waveform'][1]['LeadData'][10]['WaveFormData']