... | ... | @@ -61,6 +61,8 @@ In the next step we will make the configuration for these jobs which will requir |
|
|
|
|
|
Amica is a binary program that can be run from the command line. Batch_context is capable of incorporating these into our pipeline as well. You use the .htb file to form the command line that is submitted to the scheduler.
|
|
|
|
|
|
Amica does ICA on the eegdata. We do this twice since Amica is stochastic and will have different results after every run.
|
|
|
|
|
|
Normally Amica is run from the command line like so
|
|
|
|
|
|
`./amica15 amica-default.param`
|
... | ... | @@ -80,7 +82,40 @@ Similarly, make `scripts/s03_amica.htb` contain this |
|
|
|
|
|
Then in our configuration file we provide the `dep_path`,`amica_ver`, `in_path` variables. We will do this in the next step.
|
|
|
|
|
|
For now we wont explain `S04_fin` as it will similar enough to `s01_bandpass` in nature.
|
|
|
## Fin
|
|
|
|
|
|
In Fin we load the output of s02_amica and we pass the data from s01_bandpass through the ICA Matrix. We then save it as dfn_fin.set.
|
|
|
|
|
|
```matlab
|
|
|
disp('Loading set file: [batch_dfn,_,-1]_sa.set...');
|
|
|
EEG = pop_loadset('filename', '[batch_dfn,_,-1]_bandpass.set', ...
|
|
|
'filepath', '[in_path]');
|
|
|
EEG = eeg_checkset( EEG );
|
|
|
|
|
|
disp('Using amicaout_1');
|
|
|
EEG.amica(1).models = ...
|
|
|
loadmodout15('[out_path]/[batch_dfn,_,-1]_amicaout_1');
|
|
|
EEG.icaweights = EEG.amica(1).models.W;
|
|
|
EEG.icasphere = EEG.amica(1).models.S;
|
|
|
EEG = eeg_checkset(EEG);
|
|
|
|
|
|
disp('Passing EEG data through ICA Matrix');
|
|
|
|
|
|
tmpdata = EEG.data;
|
|
|
tmpindices = find(~sum(isnan(tmpdata)));
|
|
|
EEG.icaact = NaN(size(EEG.icaweights,1), size(tmpdata,2));
|
|
|
EEG.icaact(:, tmpindices) = (EEG.icaweights * EEG.icasphere) * ...
|
|
|
tmpdata(:, tmpindices);
|
|
|
clear tmpdata;
|
|
|
|
|
|
EEG = pop_saveset( EEG, 'filename', '[batch_dfn,_,-1]_fin.set', ...
|
|
|
'filepath', '[out_path]');
|
|
|
```
|
|
|
This requires Amica to have loadmodout15 in the Matlab path, this will happen if you use our Amica version or downloaded the loadmodout15.m file from [Jason Palmer's site](https://sccn.ucsd.edu/~jason/amica_web.html)
|
|
|
|
|
|
Save this as `scripts/s04_fin.htb`
|
|
|
|
|
|
In the next step we will make the configuration files for each of the pipeline scripts(.htb files).
|
|
|
|
|
|
*Updated/Verified by Brad Kennedy on 2017-08-11*
|
|
|
|
... | ... | |