6 releases

0.1.5 Feb 27, 2024
0.1.4 Feb 13, 2024
0.1.3 Jan 5, 2024
0.1.1 Dec 26, 2023

#270 in Biology

31 downloads per month

MIT license

78KB
2K SLoC

bvreader

Documentation

This crate provides a basic reader for BrainVision Recorder Files (.vhdr/.vmrk/.eeg)

ONLY FOR HEADER VERSION 1.0

Does not include full list of options but is extendable.

In order to keep it simple all types (FLOAT32, INT16, UINT16) convert to f32.

Only implements processing for Timedomain Data.

Usage


use crate::bvreader::bv_reader::BVFile;

let headerfile = "src/bv_reader/data/testfiles/01_header.vhdr";
let mut metafile = BVFile::from_header(headerfile).unwrap();

// metafile.bv_header       contains the struct with header information
// metafile.bv_data         contains the data and some extra information
// metafile.bv_marker       contains the marker events

// metafile.bv_data.data    contains the sample values in a vec of channels, that each contain a vec of sample values as f32.

// Optionally validate the BVFile struct (checks if number of channels is consistent across all entries)
metafile.validate().unwrap();

// scale data according to the resolution
metafile.bv_data.scale_channels(&metafile.bv_header.channel_info).unwrap();

Future ideas

  1. .ini based parser instead of regex?

  2. more options from specification / shortend version

Please report any issues you may encounter.

Suggestions and contributions are also welcome!

Dependencies

~8–20MB
~264K SLoC