This is a Rust project that provides a fast and memory-efficient way to read ABF (Axon Binary Format) files commonly used in electrophysiology.
Add this library to your Cargo.toml
:
toml
[dependencies]
rust-abf-reader = "0.1.1"
In your Rust code:
```rust use rust_abf::AbfBuilder;
fn main() { let abf = AbfBuilder::fromfile("path/to/your/file.abf"); match abf { Ok(abf) => { let channelscount = abf.getchannelscount(); let sweepscount = abf.getsweepscount(); println!("There are {:?} channels and {:?} sweeps", channelscount, sweepscount); (0..channelscount).foreach(|ch| { (0..sweepscount).foreach(|s|{ let data = abf.getsweepinchannel( s, ch).unwrap(); println!("First 10 elements from ch {:?} and sweep {:?}: {:?}", ch, s, &data[0..10]); }); }); }, _ => println!("File not found"), } } ```
Contributions are welcome! If you encounter issues or have suggestions, please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.