Skip to main content

Crate biodream

Crate biodream 

Source
Expand description

biodream — zero-copy, streaming-capable toolkit for reading and writing BIOPAC AcqKnowledge (.acq) files across all known format versions (v30–v84+).

§Quick start

// Read a file in one call
let df = biodream::read_file("recording.acq")?.into_value();
println!("{}", df.summary());

// Lazy: parse headers without loading sample data
let lazy = biodream::open_file("recording.acq")?;
println!("{} channels", lazy.channel_count());
let ecg = lazy.load_channel(0)?;

// Filter to specific channels
let df = biodream::ReadOptions::new()
    .channels(&[0, 2])
    .scaled(true)
    .read_file("recording.acq")?
    .into_value();

§Feature flags

FeatureDefaultDescription
stdvia readStandard library support
readyesRead .acq files from disk or streams
writenoWrite .acq files (requires read)
csvyesCSV export
arrownoApache Arrow IPC export
parquetnoParquet export (requires arrow)
hdf5noHDF5 export (requires libhdf5-dev)
serdenoSerde derive for domain types
physionoPhysiological signal processing (R-peaks, PPG feet, PTT, Sync detection)

§no_std

The core library (domain + error modules) is no_std compatible with alloc. I/O adapters and export targets require the std feature (enabled transitively by read).

Re-exports§

pub use domain::ByteOrder;
pub use domain::Channel;
pub use domain::ChannelData;
pub use domain::ChannelMetadata;
pub use domain::Datafile;
pub use domain::FileRevision;
pub use domain::GraphMetadata;
pub use domain::Journal;
pub use domain::Marker;
pub use domain::MarkerStyle;
pub use domain::Timestamp;
pub use error::BiopacError;
pub use error::ParseResult;
pub use error::Warning;
pub use api::LazyDatafile;
pub use api::ReadOptions;
pub use export::csv::to_csv;
pub use export::csv::CsvOptions;
pub use export::csv::TimeFormat;
pub use export::arrow::to_arrow_ipc;
pub use export::parquet::to_parquet;
pub use export::parquet::ParquetOptions;
pub use export::hdf5::to_hdf5;
pub use export::hdf5::Hdf5Options;
pub use api::inspect::inspect_file;
pub use api::inspect::inspect_bytes;
pub use api::inspect::InspectReport;
pub use api::inspect::ChannelInspect;
pub use writer::write_file;
pub use writer::write_stream;
pub use writer::WriteOptions;

Modules§

api
High-level ergonomic API: ReadOptions and LazyDatafile. Ergonomic public API surface.
domain
Pure domain types for biodream.
error
Typed error hierarchy for biodream.
export
Export targets for biodream recordings.
parser
Binary parser for .acq files. Requires the read feature for I/O. Binary parser for BIOPAC AcqKnowledge (.acq) files.
signals
Physiological signal processing: R-peak detection, PPG foot detection, PTT. Physiological signal processing utilities for BIOPAC recordings.
writer
Write support for .acq files (requires write feature).

Functions§

open_file
Open a .acq file for lazy channel access.
read_bytes
Parse a .acq file from an in-memory byte slice.
read_file
Read a .acq file from the filesystem.
read_stream
Read a .acq file from any std::io::Read + std::io::Seek source.