Crates.io | bvreader |
lib.rs | bvreader |
version | 0.1.5 |
source | src |
created_at | 2023-12-26 18:09:19.796964 |
updated_at | 2024-02-27 00:39:56.289914 |
description | Reader for the BrainVision data format |
homepage | |
repository | https://github.com/J-Bockhofer/bvreader |
max_upload_size | |
id | 1081092 |
size | 122,485 |
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
.
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();
.ini based parser instead of regex?
more options from specification / shortend version
Please report any issues you may encounter.
Suggestions and contributions are also welcome!