V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
qile1
V2EX  ›  程序员

python 的 ecg 心电图的图形怎么画出来的, base64 编码解码后,无图片,大家有研究的没有仪器是 MAC5000

  •  
  •   qile1 · 2016-12-07 15:27:10 +08:00 · 4272 次点击
    这是一个创建于 2913 天前的主题,其中的信息可能已经有所发展或是发生改变。

    如题 原始文件如下

    <?xml version="1.0" encoding="Windows-1252"?>
    <!DOCTYPE RestingECG SYSTEM "restecg.dtd">
    <RestingECG>
       <PatientDemographics>
          <PatientID></PatientID>
       </PatientDemographics>
       <TestDemographics>
          <DataType>Resting</DataType>
          <Site>1</Site>
          <AcquisitionDevice>MAC55</AcquisitionDevice>
          <Status>Unconfirmed</Status>
          <Priority>Normal</Priority>
          <AcquisitionTime>15:23:28</AcquisitionTime>
          <AcquisitionDate>09-26-2016</AcquisitionDate>
          <CartNumber>1</CartNumber>
          <AcquisitionSoftwareVersion>009D</AcquisitionSoftwareVersion>
          <XMLSourceVersion>MAC5000 v1.0</XMLSourceVersion>
       </TestDemographics>
       <RestingECGMeasurements>
          <VentricularRate>89</VentricularRate>
          <AtrialRate>89</AtrialRate>
          <PRInterval>150</PRInterval>
          <QRSDuration>80</QRSDuration>
          <QTInterval>340</QTInterval>
          <QTCorrected>413</QTCorrected>
          <PAxis>65</PAxis>
          <RAxis>44</RAxis>
          <TAxis>47</TAxis>
          <QRSCount>15</QRSCount>
          <QOnset>222</QOnset>
          <QOffset>262</QOffset>
          <POnset>147</POnset>
          <POffset>203</POffset>
          <TOffset>392</TOffset>
          <ECGSampleBase>500</ECGSampleBase>
          <ECGSampleExponent>0</ECGSampleExponent>
       </RestingECGMeasurements>
       <Diagnosis>
          <Modality>Resting</Modality>
             <StatementCount>3</StatementCount>
             <LabelText>12SL 诊断陈述</LabelText>
          <DiagnosisStatement>
             <StmtFlag>ENDSLINE</StmtFlag>
             <StmtText>窦性心律</StmtText>
          </DiagnosisStatement>
          <DiagnosisStatement>
             <StmtFlag>ENDSLINE</StmtFlag>
             <StmtText>QRS 低电压</StmtText>
          </DiagnosisStatement>
          <DiagnosisStatement>
             <StmtFlag>ENDSLINE</StmtFlag>
             <StmtText>临界 ECG</StmtText>
          </DiagnosisStatement>
       </Diagnosis>
       <Waveform>
          <WaveformType>Rhythm</WaveformType>
          <WaveformStartTime>0</WaveformStartTime>
          <NumberofLeads>8</NumberofLeads>
          <SampleType>CONTINUOUS_SAMPLES</SampleType>
          <SampleBase>500</SampleBase>
          <SampleExponent>0</SampleExponent>
          <HighPassFilter>16</HighPassFilter>
          <LowPassFilter>150</LowPassFilter>
          <ACFilter>50</ACFilter>
          <LeadData>
             <LeadByteCountTotal>10000</LeadByteCountTotal>
             <LeadTimeOffset>0</LeadTimeOffset>
             <LeadSampleCountTotal>5000</LeadSampleCountTotal>
             <LeadAmplitudeUnitsPerBit>4.88</LeadAmplitudeUnitsPerBit>
             <LeadAmplitudeUnits>μV</LeadAmplitudeUnits>
             <LeadHighLimit>2147483647</LeadHighLimit>
             <LeadLowLimit>268435456</LeadLowLimit>
             <LeadID>I</LeadID>
             <LeadOffsetFirstSample>0</LeadOffsetFirstSample>
             <FirstSampleBaseline>0</FirstSampleBaseline>
             <LeadSampleSize>2</LeadSampleSize>
             <LeadOff>FALSE</LeadOff>
             <BaselineSway>FALSE</BaselineSway>
             <ExcessiveACNoise>FALSE</ExcessiveACNoise>
             <MuscleNoise>TRUE</MuscleNoise>
             <LeadDataCRC32>2111414534</LeadDataCRC32>
             <WaveFormData>
    RgBGAEYARgBIAEgASABIAEsATABNAE4ATgBOAE4ATgBQAFAAUABQAE0ATABLAEoARgBE
    /6L/nv+f/5//mP+V/5f/nf+j/63/uv/D/8v/0v/b/+v//v8HAAIA+P/o/9T/u/+h/4v/
    hP+D/4P/gf+B/4T/iv+K/4z/jP+P/5D/jv+R/5b/mP+a/57/n/+c/5n/mP+X/5b/l/+Y
    /5n/mv+a/5v/nP+c/5v/m/+a/5j/mf+Y/5n/mv+a/5v/nf+d/53/nf+e/57/nv+e/57/
    nf+d/w==
             </WaveFormData>
          </LeadData>
       </Waveform>
    </RestingECG>
    

    另外问下如何上传附件,有个 MAC5000 心电图仪器 XML 的说明书上传,我准备用 python 解码后画图试试,原始文件 xml 里面有好几个 WaveFormData 节点,是代表各个导联的图像吗?

    我把原始数据和xml说明书放百度网盘了 http://pan.baidu.com/s/1skWSkXJ

    4 条回复    2016-12-07 23:27:51 +08:00
    warcraft1236
        1
    warcraft1236  
       2016-12-07 16:52:21 +08:00
    竟然看到了医疗行业的朋友
    whitehamster
        2
    whitehamster  
       2016-12-07 20:48:16 +08:00 via Android
    大体看了一下文档,
    whitehamster
        3
    whitehamster  
       2016-12-07 20:50:41 +08:00 via Android
    WaveFormData 中的数据应该是 ad 采集的原始数值,需要根据其他参数还原成电压数据,然后在坐标上画出
    qile1
        4
    qile1  
    OP
       2016-12-07 23:27:51 +08:00 via Android
    我以为是直接波形图,没那技术,还是放弃把,用现成的 ecg 程序可以分析和保存图像,太难
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3207 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 13:00 · PVG 21:00 · LAX 05:00 · JFK 08:00
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.