- Requirements
- Handle options in your code
- Avoid figure and GUIs
- Tips about logging errors
- Call your plugin using the command line
Requirements
The plugin must be able to handle command line launch mode. See this section
Handle options in your code
function main(varargin)
% init function will give you back a struct filled with all you need:
args = anywave('init', varargin);
% test if command line option are set (if not we are running in normal GUI mode)
eeg_file = '';
if isfield(args, 'eeg_file')
% we are running in command line mode/bids pipeline
eeg_file = args.eeg_file;
else
% raise error
error('need eeg_file parameter/option');
end
end
Avoid figure and GUIs
If you want the plugin to be run as a BIDS pipeline you must not stop the execution by using blocking dialog boxes.
Tips about logging errors
The command line option output_dir will always be set by AnyWave either by the pipeline itself or by default.
Write a log.txt file for example in that location and report all logs for your plugin in that file.
Call your plugin using the command line
If you want to run your plugin outside of BIDS Pipeline context:
anywave --run my_plugin --eeg_file <path to eeg> --meg_file <path to meg>