|
|
[[_TOC_]]
|
|
|
# Introduction
|
|
|
|
|
|
There are different ways to get data from AnyWave depending on what you want to do in the plugin.
|
|
|
|
|
|
# Selecting channels
|
|
|
|
|
|
Depending on the context (AnyWave is running in GUI mode or in Command Line mode) you can tune your request to get data from the channels you want.
|
|
|
|
|
|
## Scenario 1 (do not specify any options)
|
... | ... | @@ -20,6 +15,7 @@ Depending on the context (AnyWave is running in GUI mode or in Command Line mode |
|
|
| ------ | ------ | ------ |
|
|
|
| acceptchannelselection | get data from selected channels (if there are) otherwise use the current montage | not applicable |
|
|
|
|
|
|
### no flags in desct.txt
|
|
|
if there are no input_flags neither modifier_flags in desc.txt the default behavior is to provide data from the current montage by default.
|
|
|
|
|
|
## Scenario 2 (fine tune the channels you want to get data from)
|
... | ... | @@ -102,17 +98,17 @@ output = anywave('get_data', cfg); |
|
|
````
|
|
|
````python
|
|
|
cfg = {'start': 1, 'duration' : 10}
|
|
|
output = anywave.get_data_ex(cfg)
|
|
|
output = anywave.get_data(cfg)
|
|
|
````
|
|
|
## I want several data chunks appended
|
|
|
````matlab
|
|
|
cfg = [];
|
|
|
cfg.data_chunks = [ 1 10 2 4 ]; % specify several time selections at once
|
|
|
output = anywave('get_data_ex', cfg); % data will be appended to the same output structure.
|
|
|
output = anywave('get_data', cfg); % data will be appended to the same output structure.
|
|
|
````
|
|
|
````python
|
|
|
cfg = {'data_chunks' : [0, 10, 2, 4] }
|
|
|
output = anywave.get_data_ex(cfg)
|
|
|
output = anywave.get_data(cfg)
|
|
|
````
|
|
|
## I want several data chunks splitted
|
|
|
Sometimes you want to get data chunks and apply processing on each ones.
|
... | ... | @@ -129,7 +125,7 @@ output = anywave('get_data', cfg); |
|
|
````
|
|
|
````python
|
|
|
cfg = {'data_chunks' : [0, 10, 2, 4], 'split_data' : True }
|
|
|
output = anywave.get_data_ex(cfg)
|
|
|
output = anywave.get_data(cfg)
|
|
|
###
|
|
|
### output is a list of dict containing the data and information of each data chunks requested.
|
|
|
````
|
... | ... | @@ -138,20 +134,20 @@ output = anywave.get_data_ex(cfg) |
|
|
cfg = [];
|
|
|
cfg.use_markers = { 'section2', 'h2' ]; % the labels of markers
|
|
|
% the markers section2 and h2 must exist in the data file otherwise AnyWave will send back the whole data file...
|
|
|
output = anywave('get_data_ex', cfg); % the different data chunks marked are appended in one data matrix.
|
|
|
output = anywave('get_data', cfg); % the different data chunks marked are appended in one data matrix.
|
|
|
% use split_data to separate data chunks
|
|
|
cfg.split_data = true;
|
|
|
output = anywave('get_data', cfg);
|
|
|
%%
|
|
|
% output is a struct array. The number of elements is the number of data chunks requested.
|
|
|
% As there are splitted each element contains the data and information of one data chunk.
|
|
|
% As there are split, each element contains the data and information of one data chunk.
|
|
|
%%
|
|
|
````
|
|
|
````python
|
|
|
cfg = {'use_markers' : ['section2', 'h2'], 'split_data' : True }
|
|
|
output = anywave.get_data_ex(cfg) # data chunks will be splitted here
|
|
|
output = anywave.get_data(cfg) # data chunks will be split here
|
|
|
````
|
|
|
## I want all data BUT artefacted/unused data chunks
|
|
|
## I want all data BUT artifacted/unused data chunks
|
|
|
Getting all the data except chunks marked as bad is easy:
|
|
|
````matlab
|
|
|
cfg = [];
|
... | ... | @@ -160,7 +156,7 @@ output = anywave('get_data', cfg); % data chunks appended |
|
|
````
|
|
|
````python
|
|
|
cfg = {'skip_markers' : ['artefact', 'bad'], 'split_data' : True }
|
|
|
output = anywave.get_data_ex(cfg) # data chunks will be splitted here
|
|
|
output = anywave.get_data(cfg) # data chunks will be split here
|
|
|
````
|
|
|
## I want marked data chunks AND avoid bad ones
|
|
|
This can happen when you marked data chunk of interest but some samples are also marked as bad afterwards by other processing.
|
... | ... | @@ -172,7 +168,7 @@ output = anywave('get_data', cfg); % data chunks appended |
|
|
````
|
|
|
````python
|
|
|
cfg = {'skip_markers' : ['artefact', 'bad'], 'use_markers' : ['section2', 'h2'], 'split_data' : True }
|
|
|
output = anywave.get_data_ex(cfg) # data chunks will be splitted here
|
|
|
output = anywave.get_data(cfg) # data chunks will be split here
|
|
|
````
|
|
|
|
|
|
# Filtering data
|
... | ... | |