API Documentation
OndaEDF.import_edf!
— Function.import_edf!(dataset::Dataset, edf::EDF.File, uuid::UUID=uuid4();
custom_extractors=(), import_annotations::Bool=true)
Create, store, and return a uuid::UUID => recording::Onda.Recording
where all the signals in recording
are converted from the provided edf
. Collections of EDF.Signal
s are mapped as channels to Onda.Signal
s via simple "extractor" callbacks of the form:
edf::EDF.File -> (onda_signal_name::Symbol,
onda_signal::Onda.Signal,
edf_signals::Vector{EDF.Signal})
import_edf!
automatically uses a variety of default extractors derived from the EDF standard texts; see src/standards.jl
for details. The caller can also provide additional extractors via the custom_extractors
keyword argument.
EDF.Signal
labels that are converted into Onda channel names undergo the following transformations:
- the label is whitespace-stripped, parens-stripped, and lowercased
- trailing generic EDF references (e.g. "ref", "ref2", etc.) are dropped
- any instance of
+
is replaced with_plus_
and/
with_over_
- all component names are converted to their "canonical names" when possible (e.g. "m1" in an EEG-matched channel name will be converted to "a1").
If import_annotations
is true
, any EDF+ annotations in edf
will be written out as Onda annotations to recording
.
See the OndaEDF README for additional details regarding EDF formatting expectations.
OndaEDF.export_edf
— Function.export_edf(dataset::Dataset, uuid::UUID; signal_names=keys(dataset.recordings[uuid].signals))
Return an EDF.File
containing signal data converted from dataset.recordings[uuid]
.
Each EDF.Signal
in the returned EDF.File
corresponds to a channel of an Onda.Signal
; only signals whose names are given in signal_name
s are exported.
The ordering of EDF.Signal
s in the output will match the order of the given signal_names
(and within each channel grouping, the order of the signal's channels).