Skip to content

Commit f8eb067

Browse files
authored
Improve/simplify README.md (#52)
* Improve/simplify README.md * More tweaks * More tweaks * Fix Markdown * Shorten * Final tweaks
1 parent b7a5d0a commit f8eb067

1 file changed

Lines changed: 43 additions & 100 deletions

File tree

README.md

Lines changed: 43 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,58 @@
1-
# Libxdf – a C++ library for loading [XDF](https://github.com/sccn/xdf/wiki/Specifications "Extensible Data Format") files
1+
# LibXDF – a C++ library for loading XDF files
22

3-
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)
4-
[![License](https://img.shields.io/github/license/xdf-modules/libxdf)](https://opensource.org/licenses/BSD-2-Clause)
3+
LibXDF is a cross-platform C++ library for loading multimodal signals stored in [XDF](https://github.com/sccn/xdf/wiki/Specifications "Extensible Data Format") files.
4+
It is used in the biosignal viewing application [SigViewer](https://github.com/cbrnr/sigviewer) and the LSL application [XDFStreamer](https://github.com/labstreaminglayer/App-XDFStreamer/) and can also be integrated into other C++ applications.
55

6-
* [Introduction](#intro)
7-
* [Quick-Start Guide](#quick)
8-
* [Download](#download)
9-
* [Documentation](#doc)
10-
* [Reference](#reference)
11-
* [Support](#support)
126

7+
## Quick start
138

14-
## <a name="intro"></a>Introduction
9+
The source code and prebuilt binaries are available as [releases](https://github.com/Yida-Lin/libxdf/releases) (you may need to expand the list of assets to find the downloads).
1510

16-
Libxdf is a cross-platform C++ library for loading multimodal, multi-rate signals stored in [XDF](https://github.com/sccn/xdf/wiki/Specifications "Extensible Data Format") files.
17-
Libxdf is used in the biosignal viewing application [SigViewer](https://github.com/cbrnr/sigviewer) and the LSL application [XDFStreamer](https://github.com/labstreaminglayer/App-XDFStreamer/). It can also be integrated into other C++ applications.
18-
19-
Libxdf is open-source, free, and actively maintained.
20-
21-
## <a name="quick"></a>Quick-Start Guide
22-
23-
### <a name="download"></a>Download
24-
25-
* Find Source and Prebuilt Binaries on the [releases page](https://github.com/Yida-Lin/libxdf/releases).
26-
* You may need to expand the list of Assets to find the downloads.
27-
* For Linux Debian (Ubuntu) users: `sudo dpkg -i libxdf-{version}-Linux.deb`
28-
* For Windows and Mac users: simply extract the archive somewhere convenient.
29-
30-
### Building libxdf
31-
32-
If the release does not have assets for your platform or they do not work for you for some other reason, then
33-
Libxdf can be conveniently built either using `qmake` or `cmake`. Configuration files for both build tools are included with the source.
34-
35-
To build with cmake from command prompt / terminal:
11+
If a particular release does not have assets for your platform or they do not work for you for some other reason, then
12+
libXDF can be built with [CMake](https://cmake.org) using the following two commands:
3613

3714
```sh
38-
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=${PWD}/build/install
39-
cmake --build build --config Release -j --target install
15+
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=${PWD}/build/install -DCMAKE_BUILD_TYPE=Release
16+
cmake --build build -j --target install
4017
```
4118

42-
`cmake` builds a static library by default, but you can build a shared library
43-
by setting the
44-
[`BUILD_SHARED_LIBS`](https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html)
45-
variable (e.g. add `-DBUILD_SHARED_LIBS=ON` to the first cmake command above).
19+
This builds and installs a static library in `./build/install`, but you can build a shared library by adding `-DBUILD_SHARED_LIBS=ON` to the first CMake command.
4620

47-
### Use in conjunction with [SigViewer](https://github.com/cbrnr/sigviewer)
4821

49-
Libxdf is a built-in component of [SigViewer](https://github.com/cbrnr/sigviewer). If you wish to build SigViewer from source, follow these steps:
22+
## Integrating into C++ applications
5023

51-
1. Download `xdf.h` and `libxdf.a` from the [release](https://github.com/Yida-Lin/libxdf/releases) page.
52-
2. Copy `xdf.h` into `sigviewer/external/include`
53-
3. Copy `libxdf.a` into `sigviewer/external/lib`
54-
4. Build and run Sigviewer
24+
If you want to use libXDF in C++ applications, follow these steps:
5525

26+
1. Install a prebuilt binary release or build libXDF from source as described above.
27+
2. If you use CMake, add the following lines to your `CMakeLists.txt` to find and link against libXDF:
5628

57-
![SigViewer using _libxdf_ to display signals in XDF files](docs/Example.png)
29+
```CMake
30+
find_package(libxdf REQUIRED
31+
HINTS ${XDF_INSTALL_ROOT}
32+
PATH_SUFFIXES share
33+
)
34+
target_link_libraries(${PROJECT_NAME}
35+
PRIVATE
36+
# ... other dependencies
37+
XDF::xdf
38+
)
39+
```
5840
59-
Example: SigViewer using _libxdf_ to display signals in an XDF file.
41+
If `libxdf` is not in a standard system library location, pass `-DXDF_INSTALL_ROOT=path/to/libxdf` to specify its path.
42+
3. In your source code, `#include "xdf.h"`, instantiate an object of the `Xdf` class, and call the `load_xdf` method.
6043
61-
### Use in other C++ applications
44+
For example:
6245
63-
1. Install a prebuilt binary release or build from source as above.
64-
2. For CMake users:
65-
* In your project's CMakeLists.txt, use the following snippet:
66-
```CMake
67-
find_package(libxdf REQUIRED
68-
HINTS ${XDF_INSTALL_ROOT}
69-
PATH_SUFFIXES share
70-
)
71-
target_link_libraries(${PROJECT_NAME}
72-
PRIVATE
73-
# ... other dependencies
74-
XDF::xdf
75-
)
76-
```
77-
* If the libxdf package was installed or extracted into a folder other than a standard system library folder, you will have to pass a cmake command line argument to indicate where to find it: `-DXDF_INSTALL_ROOT=path/to/libxdf`
78-
3. In your source code, `#include "xdf.h"`, instantiate an object of the `Xdf` class and call the `load_xdf` method.
46+
```C++
47+
#include "xdf.h"
7948
80-
Example:
49+
Xdf XDFdata;
50+
XDFdata.load_xdf("example.xdf");
51+
```
8152
82-
```C++
83-
#include "xdf.h"
53+
Functions must be called in a specific order. For example, calling `subtractMean` before loading data leads to undefined behavior.
8454
85-
Xdf XDFdata;
86-
XDFdata.load_xdf("C:/example.xdf");
87-
```
88-
89-
To resample the signals to e.g. 100Hz:
90-
91-
```C++
92-
XDFdata.resample(100);
93-
```
94-
95-
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.
96-
97-
The recommended order is shown here. Only `load_xdf` is mandatory.
55+
The recommended order is shown below:
9856
9957
```C++
10058
XDFdata.load_xdf(std::string filepath);
@@ -104,31 +62,16 @@ XDFdata.resample(int sampleRate);
10462
XDFdata.freeUpTimeStamps();
10563
```
10664

107-
Libxdf depends on third party libraries [Pugixml v1.8](http://pugixml.org/) for XML parsing and [Smarc](http://audio-smarc.sourceforge.net/) for resampling.
10865

109-
## <a name="doc"></a> Documentation
110-
Detailed documentation was generated via [Doxygen](http://www.stack.nl/~dimitri/doxygen/index.html) and is available [here](docs/html/class_xdf.html).
66+
## Documentation
11167

112-
## <a name="SigViewer"></a> SigViewer Online Repo
113-
SigViewer Online Repository is [here](repository/Updates.xml).
68+
Detailed documentation is available [here](docs/html/class_xdf.html).
11469

115-
## <a name="reference"></a> Reference
116-
If you use this code in your project, please cite:
117-
```
118-
Yida Lin, Clemens Brunner, Paul Sajda and Josef Faller. SigViewer: Visualizing Multimodal Signals Stored in XDF (Extensible Data Format) Files. The 39th Annual International Conference of the IEEE Engineering in Medicine and Biology Society.
119-
```
120-
Direct link: https://arxiv.org/abs/1708.06333
12170

122-
Bibtex format:
123-
```
124-
@article{lin2017sigviewer,
125-
title={SigViewer: visualizing multimodal signals stored in XDF (Extensible Data Format) files},
126-
author={Lin, Yida and Brunner, Clemens and Sajda, Paul and Faller, Josef},
127-
journal={arXiv},
128-
pages={arXiv--1708},
129-
year={2017}
130-
}
131-
```
71+
## References
72+
73+
If you use libXDF in your project, please consider citing the following [conference paper](https://arxiv.org/abs/1708.06333):
74+
75+
> Yida Lin, Clemens Brunner, Paul Sajda and Josef Faller. *SigViewer: Visualizing Multimodal Signals Stored in XDF (Extensible Data Format) Files.* The 39th Annual International Conference of the IEEE Engineering in Medicine and Biology Society.
13276
133-
## <a name="support"></a>Support
134-
[Email author](mailto:yida.lin@outlook.com) or report a new [issue](https://github.com/Yida-Lin/libxdf/issues).
77+
LibXDF depends on third party libraries [pugixml](http://pugixml.org/) for XML parsing and [Smarc](http://audio-smarc.sourceforge.net/) for resampling.

0 commit comments

Comments
 (0)