C++ library for loading XDF files
C++ C Other
Clone or download
Permalink
Failed to load latest commit information.
_layouts add docs Feb 12, 2017
docs v0.92 Mar 7, 2017
pugixml Relocated third party libraries Dec 22, 2016
repository Test SigViewer Repository Aug 17, 2017
smarc Fix CXXFLAGS and missing include to get rid of warnings Feb 16, 2017
.gitignore Simplify cmake build script Jul 27, 2017
CMakeLists.txt Add minimum macOS deployment target (#14) Aug 1, 2017
LICENSE.txt Added GPL v3.0 Feb 13, 2017
README.md
_config.yml Modified header line Feb 2, 2018
xdf.cpp Updated email address in license Jul 12, 2018
xdf.h Updated email address in license Jul 12, 2018
xdf.pro Build shared and static lib with qmake Aug 2, 2017

README.md

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.