Core Types
Data structures and type definitions in EegFun.jl.
Abstract Types
EegFun.EegFunData Type
EegFunDataAbstract supertype for all primary EegFun data and result structures.
sourceEegFun.EegData Type
EegDataAbstract supertype for all EEG data structures.
This type represents the base interface for EEG data objects, providing a common interface for different data formats including continuous data, event-related potentials, and epoch-based data.
sourceEegFun.SingleDataFrameEeg Type
SingleDataFrameEegAbstract type for EEG data stored in a single DataFrame.
This type represents EEG data where all samples are stored in a single DataFrame, typically used for continuous data or event-related potentials that have been averaged into a single time series.
sourceEegFun.MultiDataFrameEeg Type
MultiDataFrameEegAbstract type for EEG data stored across multiple DataFrames.
This type represents EEG data where samples are distributed across multiple DataFrames, typically used for epoch-based data where each epoch is stored separately.
sourceData Container Types
EegFun.AnalysisInfo Type
AnalysisInfoStores metadata about data preprocessing and analysis parameters.
This type contains information about how the EEG data has been processed, including filtering parameters, reference information, and other analysis settings that affect the interpretation of the data.
Fields
reference::Symbol: Reference type used (e.g., :avg, :mastoid, :none)hp_filter::Float64: High-pass filter cutoff in Hz (0.0 if none)lp_filter::Float64: Low-pass filter cutoff in Hz (0.0 if none)
EegFun.ContinuousData Type
ContinuousDataStores continuous EEG data with associated layout and analysis information.
This type represents continuous EEG recordings where all time points are stored in a single DataFrame. The data typically includes time series for each electrode channel along with metadata columns.
Fields
file::String: Source filenamedata::DataFrame: DataFrame containing continuous data (without file column)layout::Layout: Layout object containing electrode positioning informationsample_rate::Int64: Sample rate of the data in Hzanalysis_info::AnalysisInfo: Analysis information and preprocessing metadata
EegFun.ErpData Type
ErpDataStores event-related potential data with associated layout and analysis information.
This type represents averaged event-related potentials where multiple epochs have been averaged together into a single time series. The data includes the averaged ERP waveform for each electrode channel.
Fields
file::String: Source filenamecondition::Int64: Condition numbercondition_name::String: Name of the conditiondata::DataFrame: DataFrame containing averaged ERP data (without condition/condition_name/n_epochs columns)layout::Layout: Layout object containing electrode positioning informationsample_rate::Int64: Sample rate of the data in Hzanalysis_info::AnalysisInfo: Analysis information and preprocessing metadatan_epochs::Int64: Number of epochs that were averaged together
EegFun.EpochData Type
EpochDataStores epoch-based EEG data with associated layout and analysis information.
This type represents EEG data organized into individual epochs, where each epoch is stored as a separate DataFrame. This format is useful for event-related potential analysis and other epoch-based processing.
Fields
file::String: Source filename (constant across all epochs)condition::Int64: Condition number (constant across all epochs)condition_name::String: Name of the condition (constant across all epochs)data::Vector{DataFrame}: Vector of DataFrames, one for each epoch (without condition/condition_name/file columns; epoch column remains for original numbering)layout::Layout: Layout object containing electrode positioning informationsample_rate::Int64: Sample rate of the data in Hzanalysis_info::AnalysisInfo: Analysis information and preprocessing metadata
EegFun.TimeFreqData Type
TimeFreqDataStores time-frequency analysis results for a single condition/average.
This type represents time-frequency power and phase data where all time-frequency points are stored in DataFrames with columns for time, frequency, and each electrode channel. Suitable for averaged TF representations.
Fields
file::String: Source filenamecondition::Int64: Condition numbercondition_name::String: Name of the conditiondata_power::DataFrame: DataFrame with columns: time, freq, [electrode channels...] containing power valuesdata_phase::DataFrame: DataFrame with columns: time, freq, [electrode channels...] containing phase values (radians)layout::Layout: Layout object containing electrode positioning informationsample_rate::Int64: Sample rate of the original data in Hzmethod::Symbol: Analysis method (:wavelet,:superlet,:multitaper,:spectrum,:hanning_fixed,:hanning_adaptive)baseline::Union{BaselineInfo,Nothing}: Baseline correction information (if applied)analysis_info::AnalysisInfo: Analysis information and preprocessing metadata
Note
Accessing .data returns data_power via a getproperty override for backward compatibility.
EegFun.TimeFreqEpochData Type
TimeFreqEpochDataStores time-frequency analysis results with individual trials preserved.
This type represents time-frequency power and phase data organized into individual trials, where each trial is stored as a separate DataFrame. Each DataFrame contains columns for time, frequency, and each electrode channel.
Fields
file::String: Source filename (constant across all trials)condition::Int64: Condition number (constant across all trials)condition_name::String: Name of the condition (constant across all trials)data_power::Vector{DataFrame}: Vector of DataFrames, one per trial (columns: time, freq, [electrodes...]) containing power valuesdata_phase::Vector{DataFrame}: Vector of DataFrames, one per trial (columns: time, freq, [electrodes...]) containing phase values (radians)layout::Layout: Layout object containing electrode positioning informationsample_rate::Int64: Sample rate of the original data in Hzmethod::Symbol: Analysis method (:wavelet,:superlet,:multitaper,:spectrum,:hanning_fixed,:hanning_adaptive)baseline::Union{BaselineInfo,Nothing}: Baseline correction information (if applied)analysis_info::AnalysisInfo: Analysis information and preprocessing metadata
Note
Accessing .data returns data_power via a getproperty override for backward compatibility.
EegFun.SpectrumData Type
SpectrumDataStores power spectrum analysis results (frequency domain, no time dimension).
This type represents power spectral density data computed using Welch's method or other spectral estimation techniques. The data is stored in a DataFrame with frequency values and power for each electrode channel.
Fields
file::String: Source filenamecondition::Int64: Condition numbercondition_name::String: Name of the conditiondata::DataFrame: DataFrame with columns: freq, [electrode channels...] containing power spectral density (μV²/Hz)layout::Layout: Layout object containing electrode positioning informationsample_rate::Int64: Sample rate of the original data in Hzmethod::Symbol: Analysis method (:welch,:multitaper, etc.)analysis_info::AnalysisInfo: Analysis information and preprocessing metadata
Layout Types
EegFun.Layout Type
LayoutStores electrode layout information and spatial relationships.
This type contains the complete electrode layout information including electrode positions in various coordinate systems (polar, 2D Cartesian, 3D Cartesian) and neighbor relationships for spatial operations.
Fields
data::DataFrame: DataFrame containing layout information with metadata groupsneighbours::Union{Nothing, OrderedDict{Symbol, Neighbours}}: Dictionary of neighbours for each electrodecriterion::Union{Nothing, Float64}: Distance criterion for neighbour calculation in normalized coordinate unitscriterion_type::Union{Nothing, Symbol}: Type of neighbour calculation (:xyor:xyz)
EegFun.Neighbours Type
NeighboursStores spatial neighbor information for an electrode in layout-based operations.
This type contains information about neighboring electrodes for spatial interpolation, artifact detection, and other layout-dependent operations. The distances and weights are typically calculated based on electrode positions in 2D or 3D space.
Fields
channels::Vector{Symbol}: List of neighboring channel labelsdistances::Vector{Float64}: Distances to each neighbor in normalized coordinate unitsweights::Vector{Float64}: Interpolation weights for each neighbor
Epoch Configuration
EegFun.EpochCondition Type
EpochConditionDefines parameters for extracting epochs for a specific experimental condition.
This type specifies the criteria for identifying and extracting epochs from continuous EEG data based on trigger sequences and timing constraints. It supports complex trigger patterns and timing relationships between events.
Fields
name::String: Descriptive condition name for identificationtrigger_sequences::Vector{Vector{Union{Int,Symbol,UnitRange{Int}}}}: Trigger sequences to match (e.g., [[1, 2, 3]], [[1, :any, 3]], [[1:5], [10:15]])reference_index::Int: Which trigger position is t=0 (1-based, default: 1)timing_pairs::Union{Nothing,Vector{Tuple{Int,Int}}}: Which trigger pairs to apply min/max intervals to (optional, default: nothing)min_interval::Union{Nothing,Float64}: Minimum time between specified trigger pairs in seconds (optional, default: nothing)max_interval::Union{Nothing,Float64}: Maximum time between specified trigger pairs in seconds (optional, default: nothing)after::Union{Nothing,Int}: Only search for sequences after this trigger value (optional, default: nothing)before::Union{Nothing,Int}: Only search for sequences before this trigger value (optional, default: nothing)
ICA Types
EegFun.IcaPrms Type
IcaPrmsParameters for Independent Component Analysis (ICA) decomposition.
This type contains all the parameters needed to configure ICA decomposition of EEG data, including learning rates, convergence criteria, and algorithm specific settings.
Fields
l_rate::Float64: Learning rate for the ICA algorithmmax_iter::Int: Maximum number of iterations for convergencew_change::Float64: Weight change threshold for convergenceanneal_deg::Float64: Annealing degree for temperature schedulinganneal_step::Float64: Annealing step size for temperature updatesblowup::Float64: Blowup factor for numerical stabilityblowup_fac::Float64: Blowup factor for algorithm stabilitymax_weight::Float64: Maximum allowed weight valuerestart_factor::Float64: Factor for restarting stuck algorithmsdegconst::Float64: Degree constant for spherical coordinatesdefault_stop::Float64: Default stopping criterion threshold
EegFun.InfoIca Type
InfoIcaStores ICA analysis results and decomposition information.
This type contains the complete results of ICA decomposition including the unmixing and mixing matrices, component statistics, and metadata about the decomposition process.
Fields
filename::String: Filename of the input data file used to generate this ICA resultunmixing::Matrix{Float64}: Unmixing matrix (sources = unmixing × data)mixing::Matrix{Float64}: Mixing matrix (data = mixing × sources)sphere::Matrix{Float64}: Sphering matrix for data preprocessingvariance::Vector{Float64}: Variance explained by each componentscale::Float64: Scaling factor applied to the datamean::Vector{Float64}: Mean vector subtracted from the dataica_label::Vector{Symbol}: Component labels (e.g., [:IC1, :IC2, ...])removed_activations::OrderedDict{Int, Matrix{Float64}}: Removed component activations by epochlayout::Layout: Layout information for the ICA components (contains channel labels)is_sub_gaussian::Vector{Bool}: Boolean vector indicating if each component is sub-Gaussian (true = sub-Gaussian, false = super-Gaussian). For regular Infomax, all components are super-Gaussian (all false).
Statistics Types
EegFun.StatsResult Type
StatsResultAbstract type for statistical test results. All statistical test results share common fields:
test_info::TestInfo: Test configuration and parametersdata::Vector{ErpData}: Grand average ERPs for conditions 1 and 2stat_matrix::StatMatrix: T-statistics and optionally p-valuesmasks::Masks: Significance masks for positive and negative effectselectrodes::Vector{Symbol}: Electrode labelstime_points::Vector{Float64}: Time points in secondscritical_t: Critical t-values (type varies by test method)se::Array{Float64, 2}: Standard error of the mean difference [electrodes × time]
EegFun.PermutationResult Type
PermutationResultStores complete results from a cluster-based permutation test.
Fields
test_info::TestInfo: Test configuration and parameters (includes ClusterInfo)data::Vector{ErpData}: Grand average ERPs for conditions 1 and 2 (for visualization)stat_matrix::StatMatrix: T-statistics matrix. Note: p isnothingfor cluster permutationmasks::Masks: Significance masks for positive and negative effectsclusters::Clusters: Positive and negative clusterspermutation_distribution::PermutationDistribution: Null distribution of max cluster statselectrodes::Vector{Symbol}: Electrode labelstime_points::Vector{Float64}: Time points in secondscritical_t::Union{Array{Float64, 2}, Tuple{Float64, Float64}, Tuple{Array{Float64, 2}, Array{Float64, 2}}}: Critical t-values usedse::Array{Float64, 2}: Standard error of the mean difference [electrodes × time] (analysis interval)se_cond1::Array{Float64, 2}: Standard error for condition 1 [electrodes × time] (full display interval)se_cond2::Array{Float64, 2}: Standard error for condition 2 [electrodes × time] (full display interval)se_diff::Array{Float64, 2}: Standard error of the mean difference [electrodes × time] (full display interval)
EegFun.AnalyticResult Type
AnalyticResultStores results from an analytic (parametric) t-test without permutation.
Fields
test_info::TestInfo: Test configuration (type, df, alpha, tail, correction_method, cluster_info=nothing)data::Vector{ErpData}: Grand average ERPs for conditions 1 and 2 (for visualization/storage)stat_matrix::StatMatrix: Statistical results containingt(t-statistics) andp(p-values) [electrodes × time]masks::Masks: Significance masks containingpositiveandnegativesignificant points [electrodes × time]electrodes::Vector{Symbol}: Electrode labelstime_points::Vector{Float64}: Time points in secondscritical_t::Float64: Critical t-value for significance (uniform across all points)se::Array{Float64, 2}: Standard error of the mean difference [electrodes × time] (analysis interval)se_cond1::Array{Float64, 2}: Standard error for condition 1 [electrodes × time] (full display interval)se_cond2::Array{Float64, 2}: Standard error for condition 2 [electrodes × time] (full display interval)se_diff::Array{Float64, 2}: Standard error of the mean difference [electrodes × time] (full display interval)
Decoding Types
EegFun.DecodingParameters Type
DecodingParametersStores parameters used for decoding analysis.
Fields
chance_level::Float64: Expected chance-level performance (e.g., 0.5 for binary, 1/n_classes for n-class)n_iterations::Int64: Number of iterations/permutations performedn_folds::Int64: Number of cross-validation foldsclass_coding::Symbol: Multi-class coding scheme (:one_vs_one,:one_vs_all,:binary)n_classes::Int64: Number of classes/conditions being decoded
EegFun.DecodedData Type
DecodedDataStores MVPA/decoding analysis results for a single participant.
This type represents the results of multivariate pattern classification analysis, including classification accuracy over time, confusion matrices, and metadata about the analysis parameters.
Fields
file::String: Source filenamecondition_names::Vector{String}: Names of conditions/bins being decodedtimes::Vector{Float64}: Time points in seconds where decoding was performedaverage_score::Vector{Float64}: Average classification accuracy at each time pointchannels::Vector{Symbol}: Channel names used in the analysisparameters::DecodingParameters: Decoding analysis parameters (chance_level, n_iterations, n_folds, class_coding, n_classes)stderror::Union{Vector{Float64}, Nothing}: Standard error of accuracy, ornothingconfusion_matrix::Union{Array{Float64, 3}, Nothing}: Confusion matrices [time × true_class × predicted_class], ornothingraw_predictions::Union{Array{Float64, 4}, Nothing}: Raw predictions [iteration × fold × time × class], ornothing
RSA Types
EegFun.NoiseCeiling Type
NoiseCeilingStores noise ceiling estimates for RSA analysis.
The noise ceiling quantifies the maximum correlation that an ideal model could achieve with the observed neural data, given the noise and variability in the measurements. This is computed using leave-one-out cross-validation across participants (Nili et al., 2014).
Fields
lower_bound::Vector{Float64}: Lower bound of noise ceiling at each time point [time]Computed as correlation between each left-out participant and the average of remaining participants
Conservative estimate (underestimates true ceiling)
upper_bound::Vector{Float64}: Upper bound of noise ceiling at each time point [time]Computed as correlation between each left-out participant and the average of all participants
Liberal estimate (overestimates true ceiling)
n_participants::Int: Number of participants used in computation
References
Nili, H., Wingfield, C., Walther, A., Su, L., Marslen-Wilson, W., & Kriegeskorte, N. (2014). A toolbox for representational similarity analysis. PLoS computational biology, 10(4), e1003553.
sourceEegFun.RsaData Type
RsaDataStores RSA analysis results for a single participant.
This type represents the results of Representational Similarity Analysis, including Representational Dissimilarity Matrices (RDMs) computed at each time point, correlations with model RDMs, and metadata about the analysis.
Fields
file::String: Source filenamecondition_names::Vector{String}: Names of conditions/bins analyzedtimes::Vector{Float64}: Time points in seconds where RDMs were computedrdm::Array{Float64, 3}: Representational Dissimilarity Matrices [time × condition × condition]dissimilarity_measure::Symbol: Measure used (:correlation, :euclidean, :mahalanobis, etc.)channels::Vector{Symbol}: Channel names used in the analysislayout::Layout: Layout object containing electrode positioning informationsample_rate::Int64: Sample rate of the original data in Hzmodel_correlations::Union{Array{Float64, 2}, Nothing}: Correlations with model RDMs [time × model]model_names::Union{Vector{String}, Nothing}: Names of models compared (if any)p_values::Union{Array{Float64, 2}, Nothing}: P-values for model correlations [time × model]noise_ceiling::Union{NoiseCeiling, Nothing}: Noise ceiling estimates, ornothinganalysis_info::AnalysisInfo: Analysis information and preprocessing metadata
ERP Measurement Types
EegFun.ErpMeasurementsResult Type
ErpMeasurementsResultStores ERP measurement results with metadata about the analysis.
This type contains the measurement results DataFrame along with metadata about the analysis type and interval used, allowing the plotting function to automatically use the correct parameters.
Fields
data::DataFrame: DataFrame containing measurement resultsanalysis_type::String: Type of measurement (e.g., "mean_amplitude", "max_peak_latency")analysis_interval::Union{Interval,Nothing}: Analysis interval usedbaseline_interval::Union{Interval,Nothing}: Baseline interval used (if any)
EegFun.ValidationResult Type
ValidationResultResult of parameter validation.
Fields
success::Bool: Whether validation succeedederror::Union{Nothing,String}: Error message if validation failed, nothing if validation succeeded (default: nothing)key_path::Union{Nothing,String}: Path of TOML keys to the parameter that failed validation, nothing if validation succeeded (default: nothing)
Artifact & Rejection Types
EegFun.ArtifactInfo Type
ArtifactInfoFlexible container for storing all artifact-related information from preprocessing. Can hold multiple continuous repair infos and epoch rejection infos.
Fields
continuous_repairs::Vector{ContinuousRepairInfo}: Vector of continuous repair info objectsepoch_rejections::Vector{EpochRejectionInfo}: Vector of epoch rejection info objectsica_components::Union{ArtifactComponents, Nothing}: ICA artifact components (Nothing if ICA was not applied)
EegFun.EpochRejectionInfo Type
EpochRejectionInfoStores information about which epochs were rejected and why, and optionally tracks channel repairs.
Fields
name::String: Name/identifier for this rejection info (e.g., "rejection_step1", "rejection_step2")info::EpochInfo: Condition metadata (number, name, n_epochs)n_artifacts::Int: Total number of artifact detections (channel-epoch pairs)abs_criterion::Real: Absolute voltage threshold (μV) used for rejectionabs_rejections::Union{Vector{Rejection}, Nothing}: Rejections due to absolute voltage threshold (Nothing if abs_criterion = 0)z_criterion::Real: Z-score criterion used for rejectionz_rejections::Union{ZScoreRejectionInfo, Nothing}: Z-score based rejection info (Nothing if z_criterion = 0)rejected::Vector{Rejection}: All rejected epochsrepaired::Union{OrderedDict{Int, Vector{Symbol}}, Nothing}: Channels repaired per epoch, ordered by epoch number (populated during repair, Nothing if no repairs)skipped::Union{OrderedDict{Int, Vector{Symbol}}, Nothing}: Channels skipped per epoch, ordered by epoch number (populated during repair, Nothing if no repairs)
EegFun.ContinuousRepairInfo Type
ContinuousRepairInfoStores information about channels repaired at the continuous data level (before epoching). These repairs apply to all epochs.
Fields
name::String: Name/identifier for this repair info (e.g., "continuous_repair_pre_ica")method::Symbol: Repair method used (:neighbor_interpolation or :spherical_spline)repaired::Vector{Symbol}: Channels that were successfully repaired (populated during repair)skipped::Vector{Symbol}: Channels that were identified as bad but couldn't be repaired (populated during repair)
EegFun.ZScoreRejectionInfo Type
ZScoreRejectionInfoStores z-score based rejection information.
Fields
z_measures::Vector{Symbol}: Which z-score measures were evaluatedz_variance::Vector{Rejection}: Rejections due to high variancez_max::Vector{Rejection}: Rejections due to high maximum valuesz_min::Vector{Rejection}: Rejections due to low minimum valuesz_abs::Vector{Rejection}: Rejections due to high absolute valuesz_range::Vector{Rejection}: Rejections due to large rangez_kurtosis::Vector{Rejection}: Rejections due to high kurtosis
EegFun.EpochRepairInfo Type
EpochRepairInfoStores information about channels repaired at the epoch level for a specific condition.
Fields
condition::Int64: Condition numbercondition_name::String: Condition namerepaired::OrderedDict{Int, Vector{Symbol}}: Maps epoch index to channels repaired in that epoch (ordered by epoch number)method::Symbol: Repair method used (:neighbor_interpolation or :spherical_spline)neighbors::Union{Dict{Symbol, Vector{Symbol}}, Nothing}: For neighbor interpolation, maps each repaired channel to its neighbor channels (may be the same across epochs)skipped::OrderedDict{Int, Vector{Symbol}}: Maps epoch index to channels that were identified as bad but couldn't be repaired (bad neighbors or too few neighbors) (ordered by epoch number)
EegFun.ChannelRepairInfo Type
ChannelRepairInfoComprehensive tracking of all channel repairs during preprocessing.
Fields
continuous::Union{ContinuousRepairInfo, Nothing}: Repairs at continuous level (Nothing if none)epochs::Vector{EpochRepairInfo}: Repairs at epoch level, one per condition
Batch & Pipeline Types
EegFun.AnalysisSettings Type
AnalysisSettingsStores the final analysis settings applied by the user in the databrowser.
Fields
hp_filter::Float64: High-pass filter frequency (0.0 if not applied)lp_filter::Float64: Low-pass filter frequency (0.0 if not applied)reference::Symbol: Reference type used (:avg, :mastoid, :none, or channel name)repaired_channels::Vector{Symbol}: List of channels that were repairedrepair_method::Symbol: Repair method used for all repaired channelsselected_regions::Vector{Tuple{Float64,Float64}}: Time regions selected by userremoved_ica_components::Vector{Int}: ICA components that were removed
EegFun.PipelineTemplateOptions Type
PipelineTemplateOptionsConfiguration options for generating pipeline templates.
Fields
num_steps::Int: Number of processing steps to generate (default: 5)subsections_per_step::Int: Number of subsections per step (default: 2)include_usage_example::Bool: Whether to include usage example comments (default: true)include_setup::Bool: Whether to include setup section (default: true)include_summary::Bool: Whether to include summary section (default: true)
Decoding & Statistics Result Types
EegFun.DecodingStatisticsResult Type
DecodingStatisticsResultStores results from statistical tests on decoding data.
Fields
times::Vector{Float64}: Time points in secondst_statistics::Vector{Float64}: T-statistics at each time pointp_values::Vector{Float64}: P-values at each time pointsignificant_mask::BitVector: Boolean mask indicating significant time pointsdf::Float64: Degrees of freedomalpha::Float64: Significance threshold usedcorrection_method::Symbol: Multiple comparison correction method usedclusters::Union{Vector{TemporalCluster}, Nothing}: Temporal clusters (if cluster-based test was performed)
Constants
EegFun.MEASUREMENT_TYPE_LABELS Constant
Human-readable labels paired with measurement type strings, for use in GUI menus.
source