API Documentation

Detectors

mne_hfo:

MNE software for computing HFOs from iEEG data.

LineLengthDetector([threshold, win_size, …])

Line-length detection algorithm.

RMSDetector([threshold, win_size, overlap, …])

Root mean square (RMS) detection algorithm (Staba Detector).

HilbertDetector([threshold, filter_band, …])

2D HFO hilbert detection used in Kucewicz et al. 2014.

BIDS-IO functions

mne_hfo.io:

create_events_df(input[, sfreq, event_name])

Create a BIDS events dataframe for HFO events.

create_annotations_df(onset, duration, ch_name)

Create a BIDS-derivative annotations dataframe for HFO events.

events_to_annotations(events_df)

Backwards-compatible function to convert events to annotations.

read_annotations(fname[, root])

Read annotations.tsv Derivative file.

write_annotations(annot_df, fname, …[, …])

Write annotations dataframe to disc.

Post-processing HFO Detections

match_detected_annotations(ytrue_annot_df, …)

Given two annotations.tsv DataFrames, match HFO detection overlaps.

find_coincident_events(hfo_dict1, hfo_dict2)

Get a dictionary of hfo events that overlap between two sets.

compute_chs_hfo_rates(annot_df, rate[, …])

Compute channel HFO rates from annotations DataFrame.

merge_overlapping_events(df)

Merge overlapping events detected.

Help transform data to be scikit-learn compatible (for SearchCV)

make_Xy_sklearn(raw, df)

Make X/y for HFO detector compliant with scikit-learn.

DisabledCV()

Dummy CV class for SearchCV scikit-learn functions.

Metrics

mne_hfo.utils:

Utility and helper functions for MNE-HFO.

compute_rms(signal[, win_size])

Calculate the Root Mean Square (RMS) energy.

compute_line_length(signal[, win_size])

Calculate line length.

compute_hilbert(signal, freq_cutoffs, …)

Compute the Hilbert envelope for a single channel.

apply_std(metric, threshold_dict, kwargs)

Calculate and apply the threshold based on number of standard deviations.

apply_hilbert(metric, threshold_dict, kwargs)

Apply the Hilbert z-score thresholding scheme.

threshold_tukey(signal, threshold)

Calculate threshold by Tukey method.

Simulation

mne_hfo.simulate:

Some parts of code are recoded from package Anderson Brito da Silva’s pyhfo.

Reference: (https://github.com/britodasilva/pyhfo)

simulate_pink_noise(N)

Create a pink noise (1/f) with N points.

simulate_brown_noise(N)

Create a brown noise (1/f²) with N points.

simulate_line_noise([fs, freq, numcycles])

Line noise artifact.

simulate_delta([fs, decay_dur])

Delta function with exponential decay.

simulate_artifact_spike([fs, dur])

Artifact like spike (sharp, not gaussian).

simulate_spike([fs, dur])

Create a simple gaussian spike.

simulate_hfo([fs, freq, numcycles])

Create a simulated HFO signal.