Functions
Misc
- HRB_validatePipeline(pipelineFile, opt)
HRB_VALIDATEPIPELINE - Validate a pipeline by checking that all the required fields are filled and that the overall structure is compatible with HRB.
Examples
>>> :func:`HRB_validatePipeline`(pipelineFile) >>> :func:`HRB_validatePipeline`(pipelineFile, 'key', 'val')
- Parameters:
pipelineFile (
string) – A file with the pipeline. Allowed formats are json or yaml.OutputFolder (
string) – The output folder where to save the logs
- Returns:
The validated pipeline converted to matlab string
- Return type:
pipeline (string)
See also
JSONDECODEAuthors: Alessandro Tonin, IRCCS San Camillo Hospital, 2024
- HRB_loadPipeline(pipelineFile, opt)
HRB_LOADPIPELINE - Load a pipeline from one or multiple files. Allowed formats are json and yaml.
Examples
>>> :func:`HRB_loadPipeline`(pipelineFile) >>> :func:`HRB_loadPipeline`(pipelineFile1, pipelineFile2, pipelineFile3) >>> :func:`HRB_loadPipeline`(pipelineFile, 'key', 'val')
- Parameters:
pipelineFile (
string) – A file with the pipeline. Allowed formats aretimes. (
json or yaml. This parameter can be repeated multiple)OutputFolder (
string) – The output folder where to save the logs
- Returns:
The pipeline converted to matlab struct
- Return type:
pipeline (struct)
See also
JSONDECODEAuthors: Alessandro Tonin, IRCCS San Camillo Hospital, 2024
- HRB_saveData(data, opt)
HRB_SAVEDATA - Save a data object. The saved data can be in different format depending on the module where it is saved.
Example
>>> :func:`HRB_saveData`(data) >>> :func:`HRB_saveData`(data, opt.Name) >>> :func:`HRB_saveData`(data, opt.Name, opt.Folder)
- Parameters:
data (
any) – A set of dataName (
string) – The name of the saved file (default: the name of the calling function)Folder (
string) – The folder where to save the file (default: the name of the module of the calling function)OutputFolder (
string) – The main folder for all output files. (default: ‘output/date’)
See also
SAVE,POP_SAVESET
- HRB_createPipeline(pipelineHandlers, opt)
HRB_CREATEPIPELINE - Create a pipeline from a cellarray of function handlers
Examples
>>> :func:`HRB_createPipeline`(pipelineHandlers) >>> :func:`HRB_createPipeline`(pipelineHandlers, 'key', 'val')
- Parameters:
pipelineHandlers (
cell) – A cell array of function handlersOutputFolder (
string) – The output folder where to save the logs
- Returns:
The pipeline converted to matlab struct
- Return type:
pipeline (struct)
See also
JSONDECODEAuthors: Alessandro Tonin, IRCCS San Camillo Hospital, 2024
Preprocessing
- HRB_resample(EEG, opt)
HRB_RESAMPLE - Resample an EEG dataset. Based on EEGLAB functions.
Examples
>>> [EEG] = :func:`HRB_resample`(EEG) >>> [EEG] = :func:`HRB_resample`(EEG, 'key', val) >>> [EEG] = :func:`HRB_resample`(EEG, key=val)
- Parameters:
EEG (
struct) – EEG struct using EEGLAB structure systemFrequency (
double) – The new resampled frequencySave (
logical) – Whether to save or not the resampled EEG.
- Returns:
resampled EEG struct using EEGLAB structure system
- Return type:
EEG (struct)
See also
EEGLAB,POP_RESAMPLE
- HRB_subcomp(EEG, opt)
HRB_subcompremoves independent components from EEG data.- Usage:
>>> EEG = :func:`HRB_subcomp`(EEG) %Removes flagged components >>> EEG = :func:`HRB_subcomp`(EEG, 'Components', [8 13 21]) %Removes specific components
- Parameters:
EEG (
struct) – EEG struct using EEGLAB struct system.Components (
1xN vector) – Vector listing the components to be removed.empty (
If)(EEG.reject.gcompreject).
Keep (
logical) – If true, it keeps the listed components.Default isfalse.
Save (
logical) – Whether to save the pruned datase
See also:
EEGLAB,pop_subcompAuthors: Ettore Napoli, University of Bologna, 2026
- HRB_rejepochs(EEG, opt)
HRB_rejepochsreject epochs based on amplitudes threshold- Usage:
>>> EEG = :func:`HRB_rejepochs`(EEG, 'Threshold', 100, 'Channels', [1:32]) %Rejects >+100 and <-100 uV >>> EEG = :func:`HRB_rejepochs`(EEG, 'Threshold', [min max], 'Channels', [1:32])
- Parameters:
EEG (
struct) – EEG struct using EEGLAB struct system.Epochs must haveextracted. (
been)Threshold (
double) – Amplitude limit in uV. - If scalar (e.g., 100): Limits are set to [-100 100] - If vector (e.g. [-50 150]): Limits are specificChannels (
vector) – List of channel indices to check. Default is [] = ALLTimeLimits (
1x2 double) – Time window to check in seconds [min max].Default is [] = whole epochSave (
logical) – Save the cleaned dataset
See also:
EEGLAB,pop_eegthresh,pop_rejepochAuthors: Ettore Napoli, University of Bologna, 2026
- HRB_filter(EEG, opt)
HRB_FILTER - Filter an EEG dataset. Based on EEGLAB functions.
Examples
>>> [EEG] = :func:`HRB_filter`(EEG); >>> [EEG] = :func:`HRB_filter`(EEG, 'key', val); >>> [EEG] = :func:`HRB_filter`(EEG, key=val);
- Parameters:
EEG (
struct) – EEG struct using EEGLAB structure systemType (
string) – Type of the filter. Allowed values are: bandpass, lowpass, highpass, bandstopLowCutoff (
double) – The low cutoff frequencyHighCutoff (
double) – The high cutoff frequency
- Returns:
filtered EEG struct using EEGLAB structure system
- Return type:
EEG (struct)
See also
EEGLAB,POP_EEGFILTNEW
- HRB_iclabel(EEG, opt)
HRB_iclabellabels independnt components using ICLabelExamples
>>> EEG = :func:`HRB_iclabel`(EEG) >>> EEG = :func:`HRB_iclabel`(EEG, 'key', val) >>> EEG = :func:`HRB_iclabel`(EEG, key = val)
- Parameters:
EEG (
struct) – EEG struct using EEGLAB struct system. ICs weights mustcomputed (
have been)Version (
string) – ‘default’, ‘lite’, ‘beta’Save (
logical) – whether to save or not the dataset with labeledcomponents
See also:
EEGLAB,pop_iclabelAuthors: Ettore Napoli, University of Bologna, 2026
- HRB_removeChannels(EEG, opt)
HRB_REMOVECHANNELS - Remove a list of channels from an EEG dataset.
Examples
>>> [EEG] = :func:`HRB_removeChannels`(EEG) >>> [EEG] = :func:`HRB_removeChannels`(EEG, 'key', val) >>> [EEG] = :func:`HRB_removeChannels`(EEG, key=val)
- Parameters:
EEG (
struct) – EEG struct using EEGLAB structure systemChannels (
{str}) – Cell array with channel names
- Returns:
EEG struct using EEGLAB structure system
- Return type:
EEG (struct)
See also
EEGLAB,POP_SELECT
- HRB_runica(EEG, opt)
HRB_RUNICA - Perform ICA decomposition with Infomax ICA algorithm.
Examples
>>> [EEG] = :func:`HRB_runica`(EEG) >>> [EEG] = :func:`HRB_runica`(EEG, 'key', val) >>> [EEG] = :func:`HRB_runica`(EEG, key=val)
- Parameters:
EEG (
struct) – EEG struct using EEGLAB structure systemExtended (
integer) – perform TANH “extended-ICA” with sign estimation N training blocksInterrupt (
logical) – draw interrupt figureSaveBefore (
logical) – save data before running ICASaveBeforeName (
string) – name of saved data before running ICA
- Returns:
EEG struct using EEGLAB structure system
- Return type:
EEG (struct)
See also
EEGLAB,POP_RUNICA,RUNICA
- HRB_selectTime(EEG, opt)
HRB_SELECTTIME - Select a time window from an EEG dataset.
Examples
>>> [EEG] = :func:`HRB_selectTime`(EEG) >>> [EEG] = :func:`HRB_selectTime`(EEG, 'key', val) >>> [EEG] = :func:`HRB_selectTime`(EEG, key=val)
- Parameters:
EEG (
struct) – EEG struct using EEGLAB structure systemAfterStart (
double) – Seconds to select after the start of the recordingBeforeEnd (
double) – Seconds to select before the end of the recording
- Returns:
EEG struct using EEGLAB structure system
- Return type:
EEG (struct)
See also
EEGLAB,POP_SELECT
- HRB_selectChannels(EEG, opt)
HRB_SELECTCHANNELS - Select a list of channels from an EEG dataset.
Examples
>>> [EEG] = :func:`HRB_selectChannels`(EEG) >>> [EEG] = :func:`HRB_selectChannels`(EEG, 'key', val) >>> [EEG] = :func:`HRB_selectChannels`(EEG, key=val)
- Parameters:
EEG (
struct) – EEG struct using EEGLAB structure systemChannels (
{str}) – Cell array with channel names
- Returns:
EEG struct using EEGLAB structure system
- Return type:
EEG (struct)
See also
EEGLAB,POP_SELECT
- HRB_icflag(EEG, opt)
HRB_icflagflags artifactual components based on ICLabel- Usage:
>>> EEG = :func:`HRB_icflag`(EEG, 'Muscle', [0.9, 1], 'Eye', [0.9, 1])
- Parameters:
EEG (
struct) – EEG struct using EEGLAB struct system. ICs weights must
:param have been computed and labeled through
HRB_iclabel:- Parameters:
parameters (
Threshold) – Each parameter accept a [min max]vector (
1x2 double)NaN]. (
will be flagged. Default is [NaN)follow (
The parameters are as) – Brain, Muscle, Eye, Heart,LineNoise
ChannelNoise
Other.
Save (
logical) – Whether to save the dataset with the flaggedcomponents.
See also:
EEGLAB,pop_iclabel,pop_icflagAuthors: Ettore Napoli, University of Bologna, 2026
- HRB_chanedit(EEG, opt)
HRB_CHANEDIT - edit channel file
- Usage:
>> [EEG] = :func:`HRB_chanedit`(chan_file) >> [EEG] = :func:`HRB_chanedit`(chan_file, ‘key’, val) >> [EEG] = :func:`HRB_chanedit`(chan_file, key=val)
- Inputs:
EEG = [struct] EEG struct using EEGLAB structure system chan_file = [string] channel file path OR template filetype =
- Outputs:
EEG = [struct] EEG struct using EEGLAB structure system
Authors: Sara Lago, IRCCS San Camillo Hospital, 2024
See also:
EEGLAB,POP_CHANEDIT
- HRB_cleanData(EEG, opt)
HRB_CLEANDATA - Automatic data cleaning removing bad channels.
Examples
>>> [EEG] = :func:`HRB_cleanData`(EEG) >>> [EEG] = :func:`HRB_cleanData`(EEG, 'key', val) >>> [EEG] = :func:`HRB_cleanData`(EEG, key=val)
- Parameters:
EEG (
struct) – EEG struct using EEGLAB structure systemSeverity (
string) – Severity of the paraemters to clean data. Available values are “loose” or “strict”.SaveExcludedChannels (
logical) – Whether to save or not the list of excluded channels.
- Returns:
EEG struct using EEGLAB structure system
- Return type:
EEG (struct)
See also
EEGLAB,POP_SELECT
- HRB_epoch(EEG, opt)
HRB_epochperforms epoching and baseline correctionon either task-based or resting state EEG data
- Usage:
>>> EEG = :func:`HRB_epoch`(EEG, 'Mode', 'Event', 'Events', {'S1'}, 'Limits',[-1 2]) >>> EEG = :func:`HRB_epoch`(EEG, 'Mode', 'Time', 'Recurrence', 2, 'Limits', [0 2])- Parameters:
EEG (struct): EEG struct using EEGLAB struct system.
- Other Parameters:
- Mode (string): ‘Event’ (default) or ‘Time’
‘Event’: Extracts epochs locked to a specific Event (task)
‘Time’: Cuts data into regular intervals (Resting state)
- — Mode ‘Event’ specific parameters —
Events (string / cell): Event types to time-lock to. If [] uses all Events
- — Mode ‘Time’ specific parameters —
Recurrence (double): Interval in seconds between epochs (default 1)
- — Common parameters —
- Limits (1x2 double): Epoch lantecy limits [start end] in seconds
For “Event”: relative to a marker (e.g. [-1 2])
For “Time”: duration of the chunk (e.g. [0 2])
Baseline (1x2 double): Baseline correction [start end] in seconds. If empty (e.g. []), no baseline correction is applied
Save (logical): Save the epoched dataset
See also:
EEGLAB,pop_epoch,eeg_regepochs,pop_rmbaseAuthors: Ettore Napoli, University of Bologna, 2026
Head Model
Source Estimation
Connectivity
Network
Utils
- logger
- cprintf()
The type of the None singleton.
- catStruct()
The type of the None singleton.
- RenameField()
The type of the None singleton.