GithubHelp home page GithubHelp logo

s5000f_message_reader's Introduction

S5000FmessageReader

     Python class for reading S5000F® message XML files. Returns a header with most of the file configurations and the lead's data is available as a Numpy array or a Pandas data frame.

Dependencies

     This reader needs the following libraries to parse the XML files:

  • xmltodict (To read and create a dictionary from the XML file)
  • numpy (To save the data from the leads into an array)
  • pandas (To save the data from the leads into a structured data frame)
  • xlwt (To save the lead data in a Excel file)

Usage

     The GEMuseXMLReader can be used in two different approaches:

  • as a converter
  • as a python class for accessing the data

     Converting XML file

     The S5000FmessageReader can be called in the command line to convert the XML into a CSV, JSON, Excel, Numpy object, or all. Paired with the converted file is a JSON with the header information.

python3 S5000FmessageReader.py 'filename.XML' [arguments]

               Arguments

  • [-csv [CSV]] - Convert the XML to a CSV. Output filename is optional.
  • [-pcsv [PCSV]] - Convert the XML to a CSV (Pandas formated). Output filename is optional.
  • [-ops [OPS]] - Convert the XML to a txt compatible with PLUX's opensignals. Output filename is optional.
  • [-x [EXCEL]] - Convert the XML to a Excel. Output filename is optional.
  • [-np [NUMPY]] - Convert the XML to a Numpy. Output filename is optional.
  • [-json [JSON]] - Convert the XML to a JSON. Output filename is optional.
  • [-all [ALL]] - Convert the XML to a CSV, Excel, Numpy and JSON. Output filename is optional.

     Python class

     The S5000FmessageReader can be also be imported by another python script and used to converted the XML files, providing the data in either a Numpy array or a Panda data frame.

import S5000FmessageReader

GEMuseData = GEMuseXMLReader('filename.XML')

GEMuseData.header ## Header containing the patient, device and acquisition session parameters

GEMuseData.dataObject ## Dictionary containing the data separated by lead

GEMuseData.dataFrame ## Panda's data frame containg the acquisition data

GEMuseData.dataArray ## Numpy matrix containing the acquisition data

S5000F message

     The S5000F message is structured as follows:

  • Message

    • Header

      • message identifier
      • message date
      • message time
      • message status
      • message type
    • Content

      • to be completed
    • Trailer

      • Message sender
      • Message receiver
      • Message context
      • Message remarks
      • Message classification
  • Could be more than one.

s5000f_message_reader's People

Contributors

bernardraust avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.