XDF files
Libxdf - a C++ library for loadingIntroduction
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.
SigViewer
Use in conjunction withLibxdf is a built-in component of SigViewer. If you wish to build SigViewer from source, follow these steps:
- Download
xdf.h
andlibxdf.a
from the release page. - Copy
xdf.h
intosigviewer/external/include
- Copy
libxdf.a
intosigviewer/external/lib
- Build and run Sigviewer
Example: SigViewer using libxdf to display signals in an XDF file.
Use in other C++ applications
- Build libxdf from source or use a pre-built binary release
- Instantiate an object of the
Xdf
class and call theload_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.