The core of a Python plugin is the main module __main__.py located in the plugin folder.
AnyWave will run the python interpreter on that module AnyWave once the plugin context is initialized.
list of anywave package functions
command | description | Documentation |
---|---|---|
init() | must be called first! | How to use init |
get_data() | Request data. | Go to the get_data documentation |
get_markers() | Request markers | Go to the get_markers documentation |
send_markers() | Send new markers | Go to the send_markers documentation |
send_message() | Send a string message (for logging purpose) | Go to the send_message documentation |
get_props() | Get global settings related to the current file | Go to get_props documentation |
debug_connect() | Activate debug/developer mode | How to debug my plugin |
Global settings for the plugin
Once you called anywave.init(sys.argv), the anywave module will get a variable called properties:
print(anywave.properties) # output the content of a dict containing the global settings set by AnyWave for your plugin
'bad_file' : full path to the .bad file,
'data_dir' : full path to the data dir,
'data_file' : data file name,
'data_path' : full path to the data file (concatenation of data dir and data_file),
'disp_file' : path to .disp file (not useful in the MATLAB context),
'lvl_file' : path to the .level file (not useful in the MATLAB context),
'sel_file' : path to the .sel file (not useful in the MATLAB context),
'flt_file' : path to the .flt file (not useful in the MATLAB context),
'marker_file' : path to the .mrk file,
'montage_file' : path to the .mtg file,
'iso_date' : date of data acquisition in ISO format,
'first_name' : first name of subject,
'last_name' : last name of subject,
'date' : date of acquistion,
'time' : time of acquisition,
'file_duration' : total length of data in seconds,
'max_sr' : maximum sampling rate of data,
'samples' : total number of samples