tstenner / libxdf

C++ library for loading XDF files

Home Page:https://yida-lin.github.io/libxdf/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Libxdf - a 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 used in the biosignal viewing application SigViewer. It can also be integrated into other C++ applications.

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

Download

Quick-Start Guide

Building libxdf

Libxdf can be conveniently built either using qmake or cmake. Configuration files for both build tools are included with the source.

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. 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. Build libxdf from source or use a pre-built binary release
  2. Instantiate an object of the Xdf class and call the load_xdf method.

Example:

#include "xdf.h"

Xdf XDFdata;
XDFdata.load_xdf("C:/example.xdf");

To resample the signals to e.g. 100Hz:

XDFdata.resample(100);

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

The recommended order is shown here. Only load_xdf is mandatory.

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.

SigViewer Online Repo

SigViewer Online Repository is here.

Support

Email author or report a new issue.

About

C++ library for loading XDF files

https://yida-lin.github.io/libxdf/

License:GNU General Public License v3.0


Languages

Language:C++ 86.1%Language:C 13.2%Language:HTML 0.5%Language:CMake 0.2%Language:QMake 0.1%