-
Notifications
You must be signed in to change notification settings - Fork 33
Using SierraEcgSharp
Christopher edited this page Aug 16, 2014
·
1 revision
Using the Sierra Ecg C# Library requires little effort on the part of the programmer. Currently two main strategies for working with Sierra ECG XML files are provided:
- Preprocessing the file to remove XLI compression
- Extracting the data for each of the leads stored
You can preprocess a Sierra ECG XML file to remove XLI compression in three ways:
-
Preprocess a
Stream
of XML into a resultingXDocument
var xdoc = SierraEcgFile.Preprocess(File.Open("input.xml"), disableVersionCheck: false);
-
Preprocess an
XDocument
of the XMLvar xdoc = XDocument.Load("input.xml"); // or XDocument.Parse(...) xdoc = SierraEcgFile.Preprocess(xdoc, disableVersionCheck: false);
-
Preprocess an
XElement
representing the<restingecgdata>
elementvar xelt = ...; // XDocument.Load(...).Root xelt = SierraEcgFile.Preprocess(xelt, disableVersionCheck: false);
You can extract the lead data from any valid Sierra ECG XML stored in an XDocument
:
var xdoc = XDocument.Load("input.xml");
var leads = SierraEcgFile.ExtractLeads(xdoc);
foreach (var lead in leads)
{
Console.WriteLine("{0} ({1} samples)", lead.Name, lead.Count);
// use lead like:
// foreach (var sample in lead) { ...
}