Skip to content

Yuwood/edfplus

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

中文说明请点击这里 (README.zh-CN.md)

EDF+ Library for Rust

A pure Rust implementation of the EDF+ (European Data Format Plus) file read/write library, focused on providing a safe and efficient API.

Crates.io Documentation

📖 Full Documentation

👉 Click to view the complete API documentation and tutorials

The documentation includes:

  • 🚀 Quick Start Guide
  • 📚 Detailed API Reference
  • 💡 Best Practices and Common Pitfalls
  • 🧪 Compilable Code Examples
  • 🔧 Advanced Usage and Performance Optimization

Quick Preview

use edfplus::{EdfReader, EdfWriter, SignalParam};

// Read an EDF+ file
let mut reader = EdfReader::open("data.edf")?;
let samples = reader.read_physical_samples(0, 1000)?;

// Create an EDF+ file
let mut writer = EdfWriter::create("output.edf")?;
writer.add_signal(SignalParam::new_eeg("EEG Fp1", 256))?;
writer.write_samples(&[samples])?;
writer.finalize()?;

Installation

[dependencies]
edfplus = "0.1.0"

Features

  • ✅ Full EDF+ read/write support
  • ✅ Type-safe API design
  • ✅ Memory-efficient streaming
  • ✅ Rich metadata support
  • ✅ Time-accurate annotation system

Examples

See the examples/ directory:

# Generate a test file
cargo run --example generate_test_file

# Basic reading example
cargo run --example basic_example

# Best practices for annotations
cargo run --example annotation_best_practices

⚠️ Important Notes

  • Annotation Limitations: Descriptions are limited to 40 characters and must be within the data time range. For details, see add_annotation
  • Write Limitations: Backtracking to modify already written data is not supported. For details, see write_samples

License

This project is licensed under BSD-3-Clause.

Contributing

Issues and pull requests are welcome!

Acknowledgements

This library is inspired by the original EDFlib C library, but reimplemented with modern Rust best practices.


💡 Tip: This README provides only a quick overview. For the complete usage guide, API documentation, and best practices, please visit the online documentation

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Rust 100.0%