libxdf  0.92
A static C++ library for loading XDF files
libxdf

*A static C++ library for loading XDF files*

Introduction

Libxdf is a cross-platform C++ library for loading multimodal, multi-rate signals stored in XDF files. Libxdf is a core component of bio-signal viewing application SigViewer. It can also be integrated into other C++ applications.

Libxdf is open-source, free, and actively maintained.

Download

Source code (zip)

Source code (tar.gz)

Pre-built package

Quick-Start Guide

Use in conjunction with SigViewer:

Libxdf is a built-in component of SigViewer. If you wish to build SigViewer from source, follow these steps:

  1. Download xdf.h and libxdf.a from the release page.
  2. Copy xdf.h into sigviewer/external/include
  3. Copy libxdf.a into sigviewer/external/lib
  4. Choose Qt 5.8 MinGW 5.3 as the toolkit to configure SigViewer.
  5. Build and run Sigviewer!
SigViewer using _libxdf_ to display signals in XDF files

Example: SigViewer using libxdf to display signals in an XDF file.

Use in other C++ applications:

  1. Clone the repo and build with Qt 5.8 MinGW 5.3, or use the pre-built binary release.
  2. Instantiate an object of Xdf class and call the load_xdf() method.

Example:

{C++}
#include "xdf.h"
Xdf XDFdata; //the object to store XDF data
XDFdata.load_xdf("C:/example.xdf"); //parameter is the path to the target XDF file

If you would like to resample the signals, call:

{C++}
XDFdata.resample(100); //resample to 100Hz

The functions in libxdf must be called following certain order. For instance, if you call the subtractMean() function before you load any data into the object, it will cause undefined behavior.

The recommended order is shown as following. Only load_xdf() is mandatory.

{C++}
XDFdata.load_xdf(std::string filepath);
XDFdata.subtractMean();
XDFdata.createLabels();
XDFdata.resample(int sampleRate);
XDFdata.freeUpTimeStamps();

Libxdf depends on third party libraries Pugixml v1.8 for XML parsing and Smarc for resampling.

Documentation

Detailed documentation was generated via Doxygen and is available here.

Support

Email author