-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
The tool can be used and configured by three means:
- Graphical User Interface (GUI)
- Command-line arguments
- a JSON input configuration file
The python package offers a convenient graphical user interface that allows the user to select a BIDS input folder, easily filter and select the subject and iEEG datasets that require processing, configure pre-processing, detection, epoching and visualization settings (Figure X).
python -m erdetect ~/bids_data_dir ~/output_dir/ --gui
python -m erdetect ~/bids_data ~/output/ [--participant_label PARTICIPANT_LABEL [PARTICIPANT_LABEL ...]]
usage: main_cli.py [-h] [--gui]
[--participant_label PARTICIPANT_LABEL [PARTICIPANT_LABEL ...]]
[--subset_search_pattern SUBSET_SEARCH_PATTERN [SUBSET_SEARCH_PATTERN ...]]
[--format_extension FORMAT_EXTENSION [FORMAT_EXTENSION ...]]
[--config_filepath CONFIG_FILEPATH]
[--apply_bids_validator] [--preproc_prioritize_speed]
[--high_pass] [--early_reref EARLY_REREF]
[--line_noise_removal [LINE_NOISE_REMOVAL]]
[--late_reref LATE_REREF]
[--late_reref_CAR_by_variance [LATE_REREF_CAR_BY_VARIANCE]]
[--include_positive_responses] [--method [METHOD]] [-v]
bids_dir output_dir
-
bids_dir
: The directory with the input dataset formatted according to the BIDS standard. -
output_dir
: The directory where the output files should be stored. If you are running group level analysis this folder should be prepopulated with the results of the participant level analysis.
-
-h
/--help
: Show help message -
-v
/--version
: Print version -
--gui
: Run with the graphical user interface -
--participant_label
: This argument can be used to indicate which specific participant(s) in the BIDS directory should be analyzed. The given label(s) should correspond to the sub-<participant_label> as described in the BIDS specification. Label matching is case-insensitive and 'sub-' prefixes in any of the labels will be ignored.
If this parameter is not provided then all subjects will be analyzed. Multiple participants can be specified with a space separated list. -
--subset_search_pattern
: This argument can be used to ensure that a specific text has to occur in the (data) subset name for it to be analyzed. The pattern could be part of a BID compliant folder name (e.g. 'task-ccep_run-01'). The search is case-insensitive.
If this parameter is not provided then all the data subset(s) that are found will be analyzed. Multiple search patterns can be specified with a space separated list. -
--format_extension
: Can be used to limit the data format(s) to include. The format(s) should be specified by their extension (e.g. '.edf'). If this parameter is not provided, then by default the European Data Format ('.edf'), BrainVision ('.vhdr', '.vmrk', '.eeg') and MEF3 ('.mefd') formats will be included. Multiple formats can be specified with a space separated list. -
--config_filepath
: Configures the app according to the settings in the JSON configuration file -
--apply_bids_validator
: Apply the BIDS data-set validation -
--preproc_prioritize_speed
: Prioritize preprocessing for speed rather than for memory. By default, while preprocessing, priority is given to use as little memory as possible, which can require channel-data to be retrieved twice, taking longer. This flag allows the preprocessing to keep channel-data in memory, requiring much more memory at it's peak, but speeding up the process. -
--high_pass
: Perform high-pass filtering (with a cut-off at 0.50Hz) before detection and visualization.- Note: If a configuration file is provided, then this command-line argument will overrule the high-pass setting in the configuration file
-
--early_reref
: Perform early re-referencing (before line-noise removal) as part of the processing preceding detection and visualization. The options are:-
CAR
= Common Average Re-referencing (e.g.--early_reref CAR
) -
CAR_headbox
= Common Average Re-referencing per headbox (e.g.--early_reref CAR_headbox
). The headbox number should be indicated for each channel in the _channels.tsv file in a column with the heading 'headbox'. - Note: If a configuration file is provided, then this command-line argument will overrule the early re-referencing setting in the configuration file
-
-
--line_noise_removal
: Perform line-noise removal before detection and visualization. Can be either:-
json
orsidecar
: to lookup the line-noise frequency in the BIDS *_ieeg.json file (e.g.--line_noise_removal json
) -
<number>
: set to a specific line-noise frequency (e.g.--line_noise_removal 60
) - Note: If a configuration file is provided, then this command-line argument will overrule the line-noise removal setting in the configuration file
-
-
--late_reref
: Perform late re-referencing (after line-noise removal) as part of the processing preceding detection and visualization. The options are:-
CAR
: Common Average Re-referencing (e.g.--late_reref CAR
) -
CAR_headbox
: Common Average Re-referencing per headbox (e.g.--late_reref CAR_headbox
). The headbox number should be indicated for each channel in the _channels.tsv file in a column with the heading 'headbox'. - Note: If a configuration file is provided, then this command-line argument will overrule the late re-referencing setting in the configuration file
-
-
--late_reref_CAR_by_variance
: Perform late re-referencing by applying a common average for each stim-pair condition (per group) where it's average is based on only the channels with the lowest trial signal variance.- Note: If a configuration file is provided, then this command-line argument will overrule the late re-referencing by variance setting in the configuration file
-
--include_positive_responses
: Detect and visualize positive evoked responses in addition to the negative responses -
--method
: The method that should be used to detect evoked responses. the options are:-
std_base
: The standard deviation of a baseline-epoch is used as a threshold (multiplied by a factor) to determine whether the average evoked deflection is strong enough. (e.g.--method std_base
) -
cross-proj
: Cross-projection of the trials is used to determine the inter-trial similarity. A peak with a strong inter-trial similarity is considered an evoked response. (e.g.--method cross-proj
) -
waveform
: Searches for the typical (20Hz oscillation) shape of the average response to determine whether the peak that was found can be considered an evoked. response (e.g.--method waveform
) - Note: If a configuration file is provided, then this command-line argument will overrule the method setting in the configuration file
-
From the command-line, a JSON file can be passed using the --config_filepath [JSON_FILEPATH]
parameter to adjust the preprocessing, the evoked response detection and the visualization settings. An example JSON containing the standard settings looks as follows:
{
"preprocess": {
"high_pass": false,
"line_noise_removal": "off",
},
"trials": {
"trial_epoch": [-1.0, 2.0],
"out_of_bounds_handling": "first_last_only",
"baseline_epoch": [-0.5, -0.02],
"baseline_norm": "median",
"concat_bidirectional_pairs": true,
"minimum_stimpair_trials": 5
},
"channels": {
"measured_types": ["ECOG", "SEEG", "DBS"],
"stim_types": ["ECOG", "SEEG", "DBS"]
},
"metrics": {
"cross_proj": {
"enabled": true,
"epoch": [ 0.012, 0.09]
},
"waveform": {
"enabled": true,
"epoch": [ 0.012, 0.09],
"bandpass": [ 10, 30]
}
},
"detection": {
"negative": true,
"positive": false,
"peak_search_epoch": [ 0, 0.5],
"response_search_epoch": [ 0.009, 0.09],
"method": "std_base",
"std_base": {
"baseline_epoch": [-1, -0.1],
"baseline_threshold_factor": 3.4,
"baseline_minimum_std": 50
}
},
"visualization": {
"negative": true,
"positive": false,
"x_axis_epoch": [-0.2, 1.0],
"blank_stim_epoch": [-0.015, 0.0025],
"generate_electrode_images": true,
"generate_stimpair_images": true,
"generate_matrix_images": true
}
}