Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • D Documentation
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • anywave
  • Documentation
  • Wiki
  • MATLAB_BIDS

MATLAB_BIDS · Changes

Page history
transferring wiki from anywave to documentation authored Jun 06, 2024 by Bruno Colombet's avatar Bruno Colombet
Hide whitespace changes
Inline Side-by-side
Showing with 51 additions and 0 deletions
+51 -0
  • MATLAB_BIDS.md MATLAB_BIDS.md +51 -0
  • No files found.
MATLAB_BIDS.md 0 → 100644
View page @ 2d1e05f5
# Modify the dest.txt
Inform AnyWave your plugin will handle command line options.
Add the line:
````
flags = CanRunFromCommandLine
````
Note that you can set several flags separating them by '**:**'
# Specify the command line parameters your plugin will handle
The plugin will receive all the default command line options handled by AnyWave but if you need to handle your own options then you must provide a file called **args.json** and put it along with desc.txt file in the plugin's folder.
Example of a plugin that will handle the options **eeg_file** (path to a EEG data file) and **meg_file** (path to a MEG data file):
````json
{
"Parameters" : [ "eeg_file", "meg_file"]
}
````
# Folder contents
Example of plugin folder contents compatible with BIDS pipeline (or command line execution more generally)
![image](uploads/b7ab2969759d292e3a89bfc596f71489/image.png)
# Handle options in your code
````matlab
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
% open Dialog box to get the file
eeg_file = uigetfile('...');
end
end
````
# Avoid figure and guis
If you want the plugin to be run as a BIDS pipeline you must not stop the execution asking for a confirmation of by displaying a Dialog Box showing errors.
# 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:
````bash
anywave --run my_plugin --eeg_file <path to eeg> --meg_file <path to meg>
````
Clone repository
  • Build_AnyWave
  • CLI
  • CLI_List
  • Changes
  • ExportData
  • MATLAB_API
  • MATLAB_BIDS
  • MATLAB_debug
  • MATLAB_functions
  • MATLAB_get_data
  • MATLAB_get_data_ex
  • MATLAB_get_markers
  • MATLAB_get_props
  • MATLAB_init
  • MATLAB_run
View All Pages