Difference between revisions of "AnyWave::CLI"

From WikiMEG
Jump to: navigation, search
(Convert a file)
(run a process)
 
(7 intermediate revisions by one user not shown)
Line 11: Line 11:
 
|-
 
|-
 
| --output_dir  || folder || The output folder where to place files created by the command.
 
| --output_dir  || folder || The output folder where to place files created by the command.
|-
 
| --output_format || string || The file format to use for output data file (vhdr, EDF, MATLAB, ADES).
 
|-
 
| --skip_marker || string || A specific marker to skip when reading data. (rejecting artefacted data).
 
 
|-
 
|-
 
| --hp || value || The High Pass filter (in Hz) to apply when reading data.
 
| --hp || value || The High Pass filter (in Hz) to apply when reading data.
Line 23: Line 19:
 
|}
 
|}
  
== Convert a file ==
+
== run a process ==
--convert  This option will convert a file to another format.<br/>
+
Some of the plugins in AnyWave can be executed from the command line.<br/>
Example: convert a Micromed EEG file to BrainVision format using a high pass of 1Hz and a low pass of 100Hz<br/>
+
This is the case for example, for the ICA plugin: <br/>
 +
To run a process plugin, you have to create a json file or string and pass it as an option:<br/>
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
anywave --convert --input_file d:\eeg1.trc --output_file eeg1 --output_dir d:\data\vhdr --output_format vhdr --hp 1 --lp 100
+
anywave --run myprocess.json
 
</syntaxhighlight>
 
</syntaxhighlight>
--output_dir --hp --lp are optional<br/>
+
Example for the ica:<br/>
 
+
<syntaxhighlight lang="javascript">
== Compute ICA ==
+
{
--ica This option will compute ICA on a specific file.<br/>
+
"plugin" : "ica",
When using this option you must also specify the following options:<br/>
+
"input_file" : "/path/to/datafile.dat",
--modality <EEG, SEEG, MEG>  The type of channels involved in the computation.<br/>
+
"comp" : 50,
Optional options:<br/>
+
"modality" : "MEG"
--comp <value> : the number of components (default is all possible components).<br/>
+
}
 
+
</syntaxhighlight>
Example: compute ICA on a MEG data file and get 50 components, skipping artefacted data.<br/>
+
Note: the input_file is specified in the json but can also be specified from the command line : <br/>
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
anywave --ica --input_file d:\c,rfDC  --modality MEG --comp 50 --hp 1 --lp 100 --skip_marker artefact
+
anywave --run myprocess.json --input_file /path/to/datafile.dat
 
</syntaxhighlight>
 
</syntaxhighlight>
 
+
=== JSON contents ===
Note: The example above assumes that a marker file is present along with the data file and contains markers labeled "artefact".
+
at least one key needs to be present:<br/>
 +
* plugin : name of the process to execute.

Latest revision as of 16:34, 12 June 2019

Command Line Options

AnyWave can execute some operation without any user interactions. This is also useful to batch some operations.

Common options

Option Value Description
--input_file file the file to open.
--output_file file The file to create.
--output_dir folder The output folder where to place files created by the command.
--hp value The High Pass filter (in Hz) to apply when reading data.
--lp value The Low Pass filter (in Hz) to apply when reading data.
--notch value The notch (in Hz) to apply when reading data.

run a process

Some of the plugins in AnyWave can be executed from the command line.
This is the case for example, for the ICA plugin:
To run a process plugin, you have to create a json file or string and pass it as an option:

anywave --run myprocess.json

Example for the ica:

{
"plugin" : "ica",
"input_file" : "/path/to/datafile.dat",
"comp" : 50,
"modality" : "MEG"
}

Note: the input_file is specified in the json but can also be specified from the command line :

anywave --run myprocess.json --input_file /path/to/datafile.dat

JSON contents

at least one key needs to be present:

  • plugin : name of the process to execute.