API Documentation

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.Signals are mapped as channels to Onda.Signals 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_edfFunction.
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_names are exported.

The ordering of EDF.Signals in the output will match the order of the given signal_names (and within each channel grouping, the order of the signal's channels).