This manual is for day-to-day PyHFO use. It is written as an operator guide rather than a developer note. The goal is to answer four practical questions:
- How do I open data and start working?
- Which controls matter in the main window?
- How do I run HFO or spindle workflows safely?
- What files does PyHFO save and export?
If you are using this manual during real work, the most useful sections are:
- Section 5 if you are new to the application and want a basic screen tour.
- Section 10 if you want the normal HFO workflow.
- Section 11 if you are doing spindle review.
- Section 13 if you want the Quick Detection workflow.
- Section 14 if you are annotating events.
- Section 15 if you are saving or restoring a case.
- Section 16 if you are exporting reports and workbooks.
- Section 17 if you are working with more than one run in the same case.
- Section 20 if something is not working as expected.
For a routine case, PyHFO is safest when you follow this order:
- Open the EEG file.
- Confirm sampling frequency, channel count, and duration.
- Confirm the biomarker mode.
- Save a session after the first meaningful processing step.
- Export only after you know which run is the accepted run.
If you are training someone new, teach them these habits first:
- never annotate before checking the biomarker mode
- never move a
.pybrainfile without its.pybrain.datafolder - never send a report HTML file without its
*_report_filesfolder - never assume the active run and accepted run are the same
All screenshots in this manual were regenerated on April 8, 2026 from the current v3.0.2 code line for PyHFO 3.0.2.
Use this as the trust rule for the figures:
- the screenshots in this manual are current UI captures, not scans from the legacy PDF manual
- the HFO, Quick Detection, annotation, and run-comparison figures use a real EDF-derived excerpt from
SM_B_ave.edf - the capture workflow uses fixed documentation window sizes so each figure reflects the current control layout rather than a default OS window size
- the figures are meant to show the current control layout and workflow state, not to provide clinical interpretation
PyHFO is a desktop EEG review application for:
- HFO detection and review
- spindle detection and review
- related event classification workflows
- session persistence
- report and workbook export
The current 3.0.2 release centers around one unified workspace instead of the older single-purpose EDF detector layout.
PyHFO can open:
EDFEEG files:.edf- BrainVision EEG files:
.vhdr,.eeg,.vmrk FIFEEG files:.fif- compressed FIF EEG files:
.fif.gz
Use these rules when choosing files:
- For
EDF, pick the.edffile directly. - For BrainVision, open the
.vhdrfile. PyHFO expects the matching.eegand.vmrkfiles to be present beside it. - For
FIF, open the.fiffile directly. - For compressed FIF, open the
.fif.gzfile directly.
If a BrainVision case fails to load, check these first:
- the
.vhdr,.eeg, and.vmrkfiles all exist - the filenames still match each other
- they were not separated into different folders
PyHFO can save and load:
.pybrain.npz
Important detail:
- A
.pybrainsession is not a single file. - PyHFO writes the main
.pybrainfile plus a companion folder named<session>.pybrain.data. - Keep them together when moving, copying, archiving, or sharing a session.
PyHFO can export:
- Excel workbook:
.xlsx - event table:
.csv - HTML report:
.html - waveform snapshot:
.png - report asset folder:
*_report_files/
Typical saved session:
case01.pybrain
case01.pybrain.data/
Typical report export:
case01_report.html
case01_report_files/
Typical workbook export:
case01_clinical_summary.xlsx
PyHFO supports three biomarker modes from the biomarker selector in the main window.
Use HFO for the full HFO workflow:
- filtering
- detector configuration
- HFO detection with STE, MNI, HIL, RMS, or LineLength paths
- artifact / spkHFO / eHFO classification
- annotation
- workbook and report export
Use Spindle for spindle workflows based on YASA, the Python Kramer LSM detector, A7-style thresholds, or Molle-style RMS thresholds.
This mode supports:
- spindle filter settings
- YASA detector settings
- Kramer LSM detector settings with bundled presets, external
.mat/.jsonfiles, or manual model parameters - A7-style and Molle-style local threshold detector settings
- artifact and spike review support
- annotation
- session save and export
Use Spike when you want RMS/LL spike candidate detection plus review-oriented workflows for spike-related events.
Current expectation for Spike mode:
- RMS/LL automated spike candidate detection is available
- accepted/artifact review labels are available
- session save and export workflows are available
- Download the release from GitHub Releases.
- Unzip the downloaded archive if needed.
- If macOS warns about the app or the DMG, clear quarantine:
xattr -cr PyHFO-3.0.2-macos-arm64.dmg- Open the DMG.
- Drag
PyHFO.appintoApplications. - Open
PyHFO.appfromApplications.
If macOS still blocks the app:
- Right-click the app.
- Choose
Open. - Confirm the security prompt.
PyHFO is currently developed around Python 3.9.
git clone https://github.com/roychowdhuryresearch/pyHFO.git
cd pyHFO
python3.9 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
python main.pyThe main window gives you three immediate entry points:
Open FileLoad DetectionQuick Detection
These mean:
Open File: open a new EEG file from disk.Load Detection: load an existing saved PyHFO session from.pybrainor.npz.Quick Detection: open the smaller single-EEG-file workflow for a one-pass HFO, spindle, or spike run.
After loading an EEG file, the main workspace exposes:
- waveform controls
- channel controls
- filter controls
- detector controls
- classifier controls
- run statistics
- annotation
- export actions
Current main workspace in a completed HFO review state:
This figure shows the current 3.0.2 main workspace after HFO detection and accepted-run selection on a five-channel HFO review window derived from SM_B_ave.edf, captured at the fixed manual layout size.
There are three normal ways to begin.
Use this when you have a new EEG file and no prior PyHFO session.
- Click
Open File. - Load the EEG file.
- Confirm the metadata panel is correct.
- Choose the biomarker mode.
- Continue with filtering and detection.
Use this when you already saved a PyHFO session.
- Click
Load Detection. - Choose the
.pybrainfile or legacy.npz. - Wait for waveform initialization to finish.
- Confirm the correct biomarker mode and run state were restored.
Use this when you only want a single detector run and exports, not the full multi-run workspace.
- Click
Quick Detection. - Load the EEG file inside the Quick Detection dialog.
- Select
HFO,Spindle, orSpike. - Select a detector.
- Run and export.
This section is intentionally explicit. It describes the operator path through the UI and the reaction you should expect from PyHFO after each action.
Operator path:
- Top toolbar ->
Open File - File chooser -> select
.edf,.vhdr,.fif, or.fif.gz - Confirm the dialog
Expected reaction:
- the EEG file name appears in the information panel
- sampling frequency, channel count, and signal length populate
- the waveform area is no longer empty
- navigation controls become active
- filter and detector controls become available for supported biomarker modes
- the message/log panel reports that the EEG file loaded
If this does not happen:
- the file may not have loaded
- the file format may be unsupported or incomplete
- the log panel usually contains the first useful error message
Operator path:
- Top toolbar ->
Load Detection - Select
.pybrainor legacy.npz - Confirm the dialog
Expected reaction:
- waveform state is rebuilt
- biomarker mode switches to the saved mode
- saved runs reappear
- accepted run state is restored if one existed
- annotation becomes available again if the saved run contains events
If this does not happen:
- check whether the
.pybrain.datafolder still exists beside the.pybrainfile - check whether the session points to an EEG file path that still exists
Operator path:
- Find the biomarker selector near the top of the workspace
- Choose
HFO,Spindle, orSpike
Expected reaction:
- detector choices change to match that biomarker mode
- classifier controls may change
- existing visible run context may change
- the workflow message updates to reflect the selected mode
Important reaction to understand:
Spikemode is review-oriented, so some automated detection controls may stay disabledSpindlemode offers YASA and Kramer LSM detector paths; only the YASA path depends on the optionalyasapackage
This section explains the main workspace by screen area.
The main toolbar contains:
Open FileLoad DetectionQuick DetectionShortcuts
Typical use:
- Start with
Open Filefor a new case. - Use
Load Detectionto continue prior work. - Use
Quick Detectionwhen you want a compact one-pass HFO, spindle, or spike run instead of the full workspace. - Use
Shortcutswhen you want the in-app shortcut reference.
At the top of the workspace there is a biomarker selector:
HFOSpindleSpike
Use this before configuring detector or classifier settings because available controls depend on the selected biomarker type.
The EEG signal info panel shows:
- file name
- sampling frequency
- number of channels
- signal length
Use this immediately after loading an EEG file to confirm that the file opened correctly.
Above the waveform display, PyHFO provides direct controls for visual navigation:
Win: exact visible time spanStep: navigation jump size as a percentage of the current windowAmp: display-only waveform amplitude scalingVis: current visible channel count, plus nearby8 ch,16 ch,32 ch, andMaxpresets
Use them to control how much EEG is visible at once and how aggressively the view moves.
Practical interpretation:
- fewer visible channels makes navigation easier
- a smaller
Wingives more temporal detail Stepcontrols how far the waveform advances during navigationAmponly changes display scaling, not the underlying signal values
Near the waveform area you will also see:
ChannelsMontageCursorMeasureOverlap- snapshot export button
What these do:
Channels: restrict the visible channel set.Montage: configure derived channel layouts or bipolar pairs.Cursor: enable single-point inspection on the waveform.Measure: enable interval and amplitude measurements on the waveform.Overlap: open overlap or agreement views when that workflow is available.- snapshot export button: save the current waveform view as an image.
Depending on the workspace state and the current build, PyHFO can also expose:
Go to time- snapshot export buttons
Open Review- next-pending-event buttons
- run-statistics shortcuts
- accepted-run status badges
These are context-sensitive. If they are disabled, it usually means:
- no EEG file is loaded yet
- no events exist yet
- no active run exists yet
The Overview tab is where most normal operation happens.
It contains:
Filter Parameters- detector parameter controls
- classifier summary or quick classifier controls
Statistics
The Statistics box is the main action area after detection.
It contains:
Save As npzSave As ExcelAnnotationAccept Runor related run-accept controls in run-management areas
Important historical note:
- The button label still says
Save As npz. - In the current main workspace the default save format is actually
.pybrain, with.npzstill available as a legacy option in the save dialog. - Workbook export may auto-mark the active run as accepted if no accepted run exists yet.
The Detector tab exposes detector-specific parameter pages. Use this tab when you want to focus on detector settings instead of the compact overview panel.
The Classifier tab contains:
- device setting
- batch size
- default CPU model button
- default GPU model button
- local checkpoint selectors
- Hugging Face model card inputs
Use spk-HFOUse eHFOSave
This is the detailed place to configure classification sources.
The text output area in the main window reports workflow progress and errors. Use it as the first place to look when:
- a run fails
- a detector appears disabled
- loading takes longer than expected
Good operator habit:
- read the log before retrying a failed run
- if a feature is grayed out, the log usually explains whether the issue is missing data, missing dependencies, or missing run state
The right-side panel is one of the most important places to watch during operation.
Typical reaction pattern:
- Before loading an EEG file:
- run actions are mostly idle
- detector and classifier actions are limited
- After loading an EEG file:
- detector controls become meaningful
- filter fields and run buttons become relevant
- After detection:
- run information updates
- review and annotation actions become useful
- export actions become meaningful
- After classification:
- prediction-aware review becomes more useful
- event labeling and accepted-run decisions become easier
If you are unsure whether PyHFO accepted your last action, watch the right-side panel and the message log together.
These are the compact badges and tool-state indicators that tell you what scope or mode you are currently in.
Source Ref: the waveform is showing the source referential channel view rather than a derived montage view.Scope All: all channels in the current source scope are shown.Tool Browse: normal browse mode is active. Cursor, measure, or other inspect modes are not currently taking over the waveform.Reset View: clear temporary focus modes and return toward the normal browse state. Use this when you are unsure which scope or tool mode is still active.No events: no event-navigation target is currently available in the active run.Vis: status badge showing how many channels are currently visible.
Practical rule:
- if the waveform looks different from what you expected, first read the active scope badge, then use
Reset View
These tools change how the EEG signal is displayed, not which run is accepted.
Raw: show the raw source waveform.Filt: show the filtered waveform. Use this when you want to inspect the processed signal rather than the raw trace.60 Hz: toggle the 60 Hz cleanup view.Norm: normalize the visible channels so their amplitudes are easier to compare visually.Win: numeric window field with stepper arrows. This is the exact visible time span.Step: numeric advance field. This controls how far the waveform jumps when you move forward or backward.Amp: numeric amplitude field with stepper arrows. This scales the waveform display only.Go: jump to the typed time in seconds.- zoom out button: show a longer waveform window.
- zoom in button: show a shorter waveform window.
8 ch,16 ch,32 ch,Max: preset visible channel counts.
Expected reaction:
RawandFiltchange the signal viewWinand zoom change the time spanAmpchanges the display scale without changing exported values8 chand related buttons change how many traces are visible at onceGochanges the current time position
These tools change which channels you are looking at or how the channel view is derived.
Channels: open the channel-selection workspace.Montage: open the montage or bipolar tool.Ref: return to the referential source-channel view.Avg Ref: show average-reference derived channels.Auto Bp: automatically build conventional EEG bipolar chains or adjacent-contact iEEG bipolar channels.Highlight: highlight the selected channel without hiding the other visible channels.Neighbors: focus the highlighted channel together with adjacent channels.Clean: hide explicitly bad or flat source channels that PyHFO knows should be excluded from routine review.Events: only show channels with detected events in the active run.All: return to the full referential source-channel list.
How to think about these tools:
Ref,Avg Ref, andAuto Bpanswer: what channel representation am I using?Highlight,Neighbors,Clean,Events, andAllanswer: which subset am I focusing on?Montageanswers: how do I build or inspect a derived channel layout?
Exit rule:
- if you are lost, click
AllorRef, thenReset View
These tools help you move through detected events and inspect them efficiently.
- previous-event button: jump to the previous detected event.
Center: center the waveform on the current event.- next-event button: jump to the next detected event.
Pending: jump to the next unreviewed detected event.Open Review: open the detailed review or annotation workspace for the active run.Cursor: show a live crosshair cursor over the waveform.Measure: click two waveform points to measure interval and amplitude difference.Hotspot: focus the most active review channels in the active or accepted run.Overlap: review cross-channel overlaps for HFO events and keep the first event while tagging or hiding later duplicates.- snapshot button: save the current waveform view as an image.
When to use them:
- use event navigation when a run already exists and events were detected
- use
Pendingduring unfinished review work - use
Hotspotwhen you want the channels with the strongest review priority first - use
Overlaponly for HFO overlap cleanup, not for general browsing
These tools control run state, review, saving, and export.
Active: the run currently selected for viewing and detailed inspection.Accept: mark the selected run as the preferred downstream export target.Run Stats: open run statistics and run-overlap comparison.Next: choose the next workflow mode for a new run.New: create a new run entry using the currently selected workflow path.Open Review: open the review or annotation workspace for the active run.Save Session: save the current case state.Export Workbook: export the clinical summary workbook.Filter: apply the current filter settings.- detector run button such as
Run STEorRun MNI: launch a detector with the currently visible settings. Classify: run classifier inference on the active run.
Important distinction:
Activechanges what you are looking at nowAcceptchanges what export prefers later
The waveform toolbar supports many direct keyboard shortcuts.
The time-window preset shortcuts still work in the current layout even though the dedicated 2 s, 5 s, 10 s, and 20 s buttons are no longer shown in the toolbar.
1: set waveform window to2 s2: set waveform window to5 s3: set waveform window to10 s4: set waveform window to20 sShift+1: show8channelsShift+2: show16channelsShift+3: show32channelsShift+4: show the full current channel subset[: zoom out]: zoom inF: toggle raw versus filtered viewE: toggle event channels versus all channelsC: toggle cursorR: toggle measure modeA: toggle auto bipolar viewV: return to referential viewM: toggle average-reference viewG: highlight the selected channelT: focus the highlighted channel and neighborsD: toggle clean viewB: open montage / bipolar toolH: focus hotspot channelsSpace: center the current eventN: jump to the next unreviewed eventEsc: clear inspect mode
Shortcut rule:
- use shortcuts only after you know which tool state you are already in
- if a shortcut seems to do the wrong thing, read the scope badge and use
Reset View
The standard filter section exposes four important values:
FpFsrprs
In PyHFO these mean:
Fp: pass band frequencyFs: stop band frequencyrp: pass band ripplers: stop band attenuation
Typical defaults in HFO mode are based on:
Fp = 80Fs = 500
Typical defaults in spindle mode are based on:
Fp = 1Fs = 30
If you are following a lab protocol, use the protocol values. If not, start from the PyHFO defaults rather than inventing new values.
Before you click filter or detect, check:
Fpis belowFs- the values are compatible with the EEG signal sampling frequency
- you are using HFO-oriented defaults in
HFOmode and spindle-oriented defaults inSpindlemode - you did not accidentally carry spindle settings into HFO mode, or vice versa
PyHFO currently supports STE, MNI, HIL, RMS, LineLength, YASA, LSM, A7, MOLLE, and spike RMS/LL depending on the biomarker mode.
STE exposes the following key fields:
sample_freqpass_bandstop_bandrms_windowmin_windowmin_gapepoch_lenmin_oscrms_threspeak_thres
Practical reading:
rms_window: RMS calculation windowmin_window: minimum event durationmin_gap: minimum separation between eventsmin_osc: minimum oscillation countrms_thres: RMS thresholdpeak_thres: peak threshold
Use STE when you want a standard threshold-based HFO detector with explicit RMS and oscillation controls.
MNI exposes:
sample_freqpass_bandstop_bandepoch_timeepo_CHFper_CHFmin_winmin_gapthrd_percbase_segbase_shiftbase_thrdbase_min
Practical reading:
epoch_time: analysis epoch durationmin_win: minimum event windowmin_gap: minimum event separationthrd_perc: percentile-style detection thresholdbase_*: baseline estimation controls
If you are not already following a validated MNI parameter set, keep the defaults and only change one field at a time.
If you are exploring detector behavior:
- Duplicate the case logic by running a second detector or a second parameter set.
- Change only one parameter group at a time.
- Compare the resulting runs before deciding which run to accept.
Do not change five parameters at once and then try to reason backward from the output.
Operator path:
- Select the biomarker mode
- Pick the detector from the detector selector
- Review detector parameters
- Click the detector run button
Expected reaction:
- the log shows that detection started
- the run button may temporarily appear busy or disabled
- after completion, a run appears in statistics and run management
- event count and related review controls update
- the annotation button becomes useful if events were found
If the reaction is weaker than expected:
- zero events can mean the detector completed successfully but found nothing
- a disabled run button usually means PyHFO still lacks required input state
- if fields look editable but results do not change, confirm you actually ran a new detector pass after editing the parameters
HIL exposes:
sample_freqpass_bandstop_bandepoch_timesd_thresholdmin_window
Practical reading:
sd_threshold: standard deviation threshold for the Hilbert-envelope style detectormin_window: minimum accepted event duration
In HFO mode, RMS and LineLength are local Python threshold detectors intended as lightweight alternatives to the external detector package paths.
Both expose:
- metric window: RMS or line-length calculation window
- minimum and maximum event duration
- minimum merge gap
- metric threshold
- peak threshold
Use these when you want transparent, dependency-free HFO candidates for comparison runs. RMS is amplitude-envelope oriented; LineLength is more sensitive to fast waveform complexity.
In spindle mode, YASA exposes:
sample_freqfreq_spfreq_broaddurationmin_distancecorrrel_powrms
Practical reading:
freq_sp: spindle bandfreq_broad: broader reference bandduration: allowed spindle duration rangemin_distance: separation between spindle eventscorr,rel_pow,rms: YASA threshold terms
In spindle mode, LSM exposes:
parameter_file: compatible Kramer spindle detector.matparameter file- bundled preset:
Original,AllAges,ESES, orInfant prob_threshold: probability cutoff for turning latent-state probabilities into detectionsmin_spindle_duration: minimum retained spindle duration in secondsspindle_separation_threshold: merge gap for nearby detections in secondsmin_peak_prominence: prominence used for the inter-peak interval/Fano feature- optional
start_frequencyandstop_frequencyfor narrowband gating - expandable
Model Parameters: window/step duration, feature indexes, state means, state standard deviations, and transition matrix values
The implementation is a Python rewrite of the Kramer latent-state-model workflow. PyHFO bundles authorized expanded JSON presets derived from the Kramer parameter files so users do not need to handle MATLAB .mat files for standard use.
In spindle mode, A7 exposes:
- spindle band
- broad reference band
- duration range
- minimum event distance
- smoothing window
- RMS threshold
- relative-power threshold
- correlation threshold
MOLLE exposes the same spindle band, duration, distance, smoothing, and RMS threshold controls without the A7 relative-power and correlation gates.
Use A7 when you want a Lacourse-style multi-criterion spindle threshold run. Use MOLLE when you want a simpler sigma-band RMS threshold run for comparison.
PyHFO supports two ways to define classification models.
Use Select Model from Your Computer when you want:
- fully local inference
- fixed model files
- no online dependency at runtime
You can provide:
- artifact model
- spk-HFO model
- eHFO model
Use Select Model from Hugging Face Hub when you want:
- built-in hosted model references
- easier preset-based setup
Default hosted presets are configured around:
roychowdhuryresearch/HFO-artifactroychowdhuryresearch/HFO-spkHFOroychowdhuryresearch/HFO-eHFO
The classifier tab also includes:
DeviceBatch SizeUse Default CPU ModelUse Default GPU Model
Use:
cpuwhen you want the safest defaultcuda:0only when CUDA is actually available
If GPU inference is unavailable, stay on CPU.
The classifier workflow includes:
Use spk-HFOUse eHFO
Artifact classification is the base requirement when classifier mode is enabled. spkHFO and eHFO are optional add-ons.
Before running classifiers, confirm:
- artifact model is configured
- spkHFO is configured if
Use spk-HFOis enabled - eHFO is configured if
Use eHFOis enabled - the device entry is valid
- batch size is sensible for the machine you are on
If you are unsure:
- use CPU
- use the default hosted model buttons
- keep batch size moderate
This is the recommended full-workspace workflow.
- Click
Open File. - Select the EEG file.
- Confirm file name, sampling frequency, channel count, and length in the EEG signal info panel.
- Use the biomarker selector.
- Confirm it is set to
HFO.
Recommended first adjustments:
- reduce
Visor use8 ch,16 ch,32 ch, orMaxif the view is crowded - choose a manageable
Win - click
Channelsif you only want a subset
- Open the filter controls in the
Overviewtab. - Review
Fp,Fs,rp, andrs. - Click the filter
OKbutton.
- Choose the detector you want.
- Review the detector-specific controls.
- Start detection.
Recommendation:
- for a fresh case, start with one detector first
- only add comparison runs after you have confirmed the case loaded correctly
What to watch after a first run:
- whether event counts are obviously zero when you expected many events
- whether the event channels make neurophysiologic sense
- whether the waveform overlay looks too dense or too sparse
- whether you accidentally ran the wrong biomarker mode
After detection:
- the statistics panel updates
- the event counts and summary fields update
- the
Annotationbutton becomes available when events exist
At this point, verify that:
- events were actually found
- the waveform overlays look reasonable
- the EEG signal channels and event channels make sense
If you need classifier output:
- Open the classifier tab or classifier controls.
- Choose local or Hugging Face model sources.
- Set
DeviceandBatch Size. - Enable
Use spk-HFOand/orUse eHFOif needed. - Save classifier settings.
- Run classification on the active run.
After classification, check:
- whether the run summary changed as expected
- whether artifact-heavy channels now look cleaner in review
- whether the annotation button is still available
- whether the model source you intended is the one that actually ran
- Click
Annotation. - Review events one by one.
- Save labels as you move through the case.
If multiple runs exist, choose the one you want to treat as the accepted export run. PyHFO uses the accepted run as the preferred downstream export target.
Do not skip this step in multi-run cases. If you compare STE, MNI, and HIL, the accepted run is the one you are declaring as the preferred export candidate.
Recommended final sequence:
- save the session
- export the workbook
- export the report
- export any waveform snapshots you need
This section restates the HFO workflow in operator language.
Operator path:
Open File- choose EEG file
- confirm the dialog
Expected reaction:
- metadata appears
- waveform appears
- channel and time controls become usable
Operator path:
- set
Fp,Fs,rp,rs - apply or run the filter action
- turn on the filtered view if needed
Expected reaction:
- filtered waveform becomes available
- the visible traces can look cleaner or narrower in band
- the log shows filtering completion
Operator path:
- choose
STE,MNI, orHIL - review parameters
- run the detector
Expected reaction:
- a run is created
- event counts update
- run comparison becomes meaningful if more than one run exists
- event navigation and annotation become available if events exist
Operator path:
- choose model source
- confirm device and batch size
- enable optional
spk-HFOandeHFOoutputs if needed - run classification
Expected reaction:
- the log reports classifier progress
- event review becomes more informative
- prediction-aware navigation in annotation becomes more useful
Operator path:
- review one or more runs
- choose the preferred run
- mark it as accepted
Expected reaction:
- accepted-run indicators update
- later workbook and report export target that accepted run
Operator path:
- export workbook
- export report
- optionally save a waveform snapshot
Expected reaction:
- files appear on disk
- the workbook summarizes the chosen run
- the report HTML is accompanied by a
*_report_filesfolder
Use this workflow when the case is a spindle review case.
- Open the EEG file.
- Switch biomarker mode to
Spindle. - Confirm the spindle filter settings.
- Review
YASA,LSM,A7, orMOLLEparameters. ForLSM, select a bundled preset or edit the advanced model parameters. - Run spindle detection.
- Open annotation if event review is needed.
- Save the session.
- Export workbook or report.
Important:
- if
YASAis unavailable, only the YASA path is disabled - if
LSMis selected, detection can use a bundled preset, a compatible local.mat/.jsonparameter file, or manually entered model parameters A7andMOLLEare local Python detectors and do not depend onyasa
Recommended spindle review pattern:
- detect
- inspect the event count
- review the top channels first
- annotate a small sample before committing to a full export
Use Spike mode for RMS/LL spike candidate detection and review-oriented work.
What to expect:
- waveform review is available
- session loading and saving are available
- export pipeline is available
- RMS/LL automated spike candidate detection is available
- accepted/artifact labels drive spike overlay review
Quick Detection is a compact single-pass dialog for HFO, spindle, or spike runs.
It is useful when you want:
- one EEG file
- one biomarker and one detector
- optional HFO classifier
- immediate export
Current Quick Detection dialog with a real EDF-derived HFO excerpt loaded:
This figure shows the compact workflow after a completed MNI run with workbook and session export enabled.
Quick Detection includes:
Load EEG File- biomarker selector
- detector selector
N Jobs- filter section
- detector-specific sections for
MNI,STE,HIL,RMS,LineLength,A7,MOLLE, andRMS/LL - HFO classifier section
- export section
Run Detection
- Open
Quick Detection. - Click
Load EEG File. - Pick
HFO,Spindle, orSpikefrom the biomarker dropdown. - Pick one detector from the detector dropdown.
- Set filter parameters.
- Adjust detector-specific parameters if needed.
- For HFO only, decide whether classifier mode should run.
- Choose export formats.
- Click
Run Detection.
When Quick Detection is the right choice:
- you do not need multi-run comparison
- you do not need the full case workspace
- you want outputs next to the source file quickly
When Quick Detection is the wrong choice:
- you plan to compare more than one detector in the same session
- you expect detailed event curation before export
- you want the richer main-workspace session format
Quick Detection can export:
Workbook (.xlsx)Session (.npz)
Important difference from the main workspace:
- Quick Detection currently writes session output as
.npz. - The main full workspace defaults to
.pybrainfor session saving.
Quick Detection writes files next to the source EEG file.
Output names follow this pattern:
<eeg_file_name>_<detector>.xlsx
<eeg_file_name>_<detector>.npz
Examples:
case01_ste.xlsx
case01_ste.npz
case01_mni.xlsx
If a file already exists, PyHFO appends a numeric suffix instead of overwriting it.
Examples with collisions:
case01_ste.xlsx
case01_ste_2.xlsx
case01_ste_3.xlsx
Quick Detection is easiest to use when you think of it as a small linear pipeline.
Path:
Load EEG File- choose detector
- review filter and detector fields
- decide whether classifier should run
- choose workbook and/or session export
- click
Run Detection
Expected reaction:
- the status card changes from waiting to ready
- during execution, the dialog reports that work is running
- after completion, the status card changes to complete
- exported files are listed in the status summary
- outputs appear beside the source EEG file
If the reaction is not what you expected:
- if the run never starts, review whether at least one export format is selected
- if the run starts but no files appear, read the status summary and the log first
- if the detector completes with zero events, that is still a valid completion state
The annotation window is the main detailed review tool.
You typically open it after detection or classification results are available.
Current annotation window on a real EDF-derived HFO event:
This figure shows the current tracing, filtered tracing, time-frequency panel, and right-side review controls in the 3.0.2 annotation workflow, captured at the fixed manual layout size.
The annotation window includes:
PreviousNextSave and NextPrev PendingNext PendingClear LabelPrev MatchNext MatchPrediction ScopeUnannotated only- frequency range controls
- waveform and FFT panels
- snapshot export
You can think of the annotation window as three jobs combined in one place:
- inspect the waveform
- decide the label
- move efficiently through a queue of events
In HFO mode, the keyboard labels are:
1: Pathological2: Physiological3: Artifact
In Spindle mode, the keyboard labels are:
1: Real2: Spike3: Artifact
The annotation window supports:
Right ArroworD: next eventLeft ArroworA: previous eventEnter: save and move forwardBackspace: clear the current annotationEsc: clear the FFT ROI
Use:
Prev Pending/Next Pendingto jump between unreviewed eventsPrediction Scopeto jump among events matching the selected prediction groupUnannotated onlyto focus the match navigation on unlabeled events
Recommended annotation strategy for large cases:
- Use
Next Pendingto move quickly through unreviewed events. - If one prediction bucket needs verification, use
Prediction Scope. - Turn on
Unannotated onlywhen you want to avoid revisiting already-reviewed events. - Use
Clear Labelonly when you intentionally want to remove a review decision.
The annotation status bar exposes interaction hints:
Shift-drag: box zoomAlt-drag: FFT ROI- mouse wheel: zoom
- drag: pan
Esc: clear FFT ROI
Open annotation when:
- you need event-by-event decisions
- you want to confirm classifier output
- you want to move from automatic detection to final curated labels
For high-value cases:
- Review the first 20 to 50 events from the active run.
- Check whether the label mix is plausible.
- If the run looks poor, go back and change detector or classifier settings.
- If the run looks good, continue annotation.
- Save the session before closing the review window.
Path:
- open annotation from the main workspace
- inspect the current event in the tracing, filtered tracing, and time-frequency views
- assign a label
- click
Save and Nextor use the keyboard shortcut
Expected reaction:
- the current event gets a saved label
- the remaining count decreases
- the next event loads
- prediction navigation becomes easier once labels accumulate
Path for pending-only review:
- enable
Unannotated only - use
Next Pending
Expected reaction:
- PyHFO skips already-labeled events
- the review queue becomes shorter and easier to finish
Path for prediction-focused review:
- choose a
Prediction Scope - use
Prev Match/Next Match
Expected reaction:
- navigation jumps within the selected prediction bucket instead of the full event list
If the annotation window does not react:
- confirm that an active run exists
- confirm that the active run actually contains events
- confirm that the run belongs to the currently selected biomarker mode
Use the Save As npz button in the statistics area.
Despite the button name, the save dialog now defaults to:
.pybrain
The save dialog still allows:
.pybrain- legacy
.npz
PyHFO sessions can preserve:
- biomarker mode
- EEG file reference
- filter settings
- detector settings
- classifier settings
- active run
- accepted run
- event features
- predictions
- manual annotations
Use Load Detection from the toolbar or startup view.
PyHFO restores:
- biomarker mode
- waveform display state
- filter and detector configuration
- classification state when available
- event review readiness
After loading a saved session, always confirm:
- the restored biomarker mode is correct
- the correct EEG file path was restored
- the waveform view is initialized
- the expected run is active
- the accepted run status still makes sense
For real work, save a session:
- after detection
- after classification
- after a major annotation pass
This makes it easy to resume without recomputing everything.
Operator path:
- click
Save As npz - choose a path
- keep the default
.pybrainformat unless you specifically need legacy.npz - confirm save
Expected reaction:
- a
.pybrainfile is created - a companion
.pybrain.datadirectory is created - the log reports that the session was saved
Operator path:
- click
Load Detection - select the saved session
- confirm the dialog
Expected reaction:
- waveform state is restored
- run state is restored
- biomarker mode is restored
- accepted-run state returns if it existed in the saved session
If session reaction is incomplete:
- verify the companion folder still exists
- verify the underlying EEG file path still resolves
The main export workbook usually defaults to:
<eeg_file_name>_clinical_summary.xlsx
It can include sheets such as:
RunsChannel RankingRun ComparisonDecisionActive Run Events
The report export usually defaults to:
<eeg_file_name>_report.html
PyHFO also creates a companion asset folder:
<eeg_file_name>_report_files/
That folder may contain:
clinical_summary.xlsxevents.csvwaveform_snapshot.pngmetadata.json
Do not separate the HTML file from its *_report_files folder.
When data is available, the report bundle may contain:
clinical_summary.xlsx: workbook version of the exported run summaryevents.csv: event-level CSVwaveform_snapshot.png: captured waveform imagemetadata.json: machine-readable export metadata
This means the report export is not just a webpage. It is a small export package.
The event CSV is generated inside the report asset folder when event-level data exists.
PyHFO can export a PNG image of the current waveform view. This is useful for:
- documentation
- methods supplements
- slide decks
- review notes
Operator path:
- confirm the accepted run
- click workbook export
- choose save location if prompted
Expected reaction:
- an
.xlsxfile appears - run summary sheets become available
- the exported workbook reflects the accepted run whenever one exists
Operator path:
- confirm the accepted run
- click report export
- choose a destination
Expected reaction:
- an HTML file appears
- a matching asset folder appears
- report metadata, event CSV, and snapshot assets may appear together
Operator path:
- set the waveform view you want to communicate
- click the snapshot action
Expected reaction:
- a PNG image is written
- the image reflects the current visible view, not the entire file
PyHFO distinguishes between:
- the active run
- the accepted run
Practical meaning:
- the active run is the run you are currently viewing or working on
- the accepted run is the run you are choosing as the preferred export target
If you compare multiple detector runs, make sure the accepted run is the one you truly want in the final workbook and report.
Current run comparison view for two HFO runs on the same EDF-derived case:
This figure shows how PyHFO displays active versus accepted runs, channel ranking, and pairwise run overlap before export.
This is the safest way to compare detectors in the same case.
Run one detector with your baseline settings.
Do not annotate the whole case yet. First check:
- event count
- top channels
- whether the waveform view matches expectations
Run another detector or a modified parameter set.
Use the run statistics or run management views to compare:
- run counts
- pairwise overlap
- top channels
- active versus accepted run state
Select the run you want to inspect closely.
Use the accept-run action once you know which run should drive export.
This is important because downstream exports prefer the accepted run.
When run statistics are available, use them for:
- seeing which runs exist in the case
- checking overlap between runs
- checking which run is active
- checking which run is accepted
If two runs are similar:
- annotate a sample from each before deciding
If one run is clearly better:
- accept it and proceed to export
Path:
- create run A
- create run B
- open run statistics
- switch active run
- accept the preferred run
Expected reaction:
- both runs appear in the run table
- one run is marked active
- one run can be marked accepted
- overlap and channel ranking update in run statistics
Important reaction to understand:
- switching the active run changes what you are currently inspecting
- accepting a run changes what export prefers
- these are related but not identical actions
If you want one conservative workflow to follow every time, use this:
- Open the EEG file.
- Check EEG signal metadata.
- Set the correct biomarker mode.
- Adjust waveform display to a manageable view.
- Configure filter parameters.
- Run one detector first.
- Check whether event output looks plausible.
- Add classification if needed.
- Open annotation and review events.
- Mark the run you want to keep.
- Save the session.
- Export workbook and report.
For a new case:
- begin with one detector
- keep default classifier settings unless you have a reason to change them
- save a session before trying alternative runs
If the Go to time field is visible in your current build:
- use it to jump directly to a time point in seconds
- use it when the EEG signal span is long and scrolling is inefficient
Annotation work is the most manual part of the workflow. Save after meaningful progress.
If you need to discuss a suspicious event with someone else:
- export a waveform snapshot
- save the session
- export the report bundle if a shareable summary is useful
When sharing a report:
- keep the
.htmlfile - keep the matching
*_report_filesfolder - send both together
Some labels still use the historical PyBrain naming. In practice:
.pybrainis the current session format- some UI elements still say
npzorPyBrainfor historical compatibility
Cause:
yasais missing or not available in the current environment
Fix:
- install the optional dependency in the source environment, or
- use the packaged release that already bundles spindle support
Check:
- the
.pybrainfile exists - the
.pybrain.datafolder exists - both were kept together
Common causes:
- no EEG file loaded
- no detector selected
- no export format selected
- classifier enabled without required model path
- invalid filter or detector field values
Possible causes:
- no internet access
- blocked Hugging Face access
- interrupted first download
Fix:
- retry with network access, or
- switch to local checkpoint files
Cause:
- the HTML file was moved without its companion asset folder
Fix:
- keep the report HTML and
*_report_filesdirectory together
Suggestions:
- reduce the visible channel count
- shorten the displayed time window
- avoid running too many comparison runs at once
- close other memory-heavy applications
Check:
- the source EEG file folder for Quick Detection outputs
- the original EEG file directory for default workbook and report paths
- the chosen path from the save dialog if you changed it manually
This is the shortest debugging checklist for normal users.
Check in this order:
- Is an EEG file loaded?
- Is the correct biomarker mode selected?
- Does an active run exist?
- Does the log show an error or warning?
- Is the control disabled because PyHFO is waiting for a prerequisite state?
Possible meanings:
- detection genuinely found no events
- filter or detector settings are too restrictive
- you are in the wrong biomarker mode
- you loaded the wrong file or wrong channel scope
Usually this means one of three things:
- no run exists yet
- the active run has zero events
- the restored session did not load the expected run state
Check:
- which run is active
- which run is accepted
- whether workbook export auto-accepted the active run because no accepted run existed
patient001.edf
patient001.pybrain
patient001.pybrain.data/
patient001_clinical_summary.xlsx
patient001_report.html
patient001_report_files/
patient001.edf
patient001_ste.xlsx
patient001_ste.npz
patient001_report.html
patient001_report_files/
clinical_summary.xlsx
events.csv
metadata.json
waveform_snapshot.png
If you are teaching PyHFO to someone else, have them practice in this order:
- open an EEG file
- change the biomarker mode
- change the number of displayed channels
- run one detector
- open annotation
- label ten events
- save a session
- export a workbook
- export a report
That sequence covers almost everything that matters in routine use.
This manual matches:
PyHFO 3.0.2
This release includes:
- the unified main workspace on the main release line
- validated macOS standalone packaging
- bundled
HFODetectorHIL support - bundled
YASAspindle support



