get_props¶
get_props returns the settings AnyWave defined for the plugin: the current data file, the files that go with it,
the folders, the options of the command line...
import sys
import anywave as aw
aw.init(sys.argv)
props = aw.get_props() # a dict, one key per setting
print(props['data_path'])
What is in the dict¶
The most useful keys:
| key | content |
|---|---|
data_path |
full path of the data file |
data_dir, data_file, data_file_no_ext |
folder, file name, file name without extension |
file_duration, total_duration |
duration of the data in seconds |
samples, max_sr |
number of samples per channel, highest sampling rate of the file (Hz) |
marker_file |
path of the marker file (.mrk) of the data file |
montage_file |
path of the montage file (.mtg) |
bad_file, bad_labels |
path of the bad channels file (.bad), labels of the channels marked as bad |
flt_file, disp_file, sel_file |
paths of the filters, display and selection files |
ica_file |
path of the ICA file currently in use (empty if none) |
iso_date, recording_date, recording_time |
date and time of the acquisition |
first_name, last_name, birth_date |
subject information (n/a when unknown) |
bids |
True when the file belongs to a BIDS dataset |
name, description, category, version, input_flags |
what desc.txt says about the plugin |
gui_active |
True when AnyWave runs with its window, False from the command line |
work_dir, home_dir, log_dir, plugins_dir, plugin_dir |
AnyWave folders |
The list depends on the context and on the version of AnyWave. To see exactly what you get, print it:
print(sorted(props.keys()))
When the plugin runs from the command line¶
If the plugin is launched with anywave --run MyPlugin ..., the dict also contains the options of the command line
(for instance props['input_file']), see Write a Python plugin.