-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://repo.ml.tu-berlin.de/git/bbci/public
- Loading branch information
Showing
24 changed files
with
649 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
function out= applyClassifier(fv, model, C, idx) | ||
%out= applyClassifier(fv, classy, C, <idx>) | ||
|
||
|
||
fv= proc_flaten(fv); | ||
|
||
if ~exist('idx','var'), | ||
out= C.applyFcn(C, fv.x); | ||
else | ||
out= C.applyFcn(C, fv.x(:,idx)); | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
function applyFcn= misc_getApplyFunc(model) | ||
%applyFcn= misc_getApplyFunc(model) | ||
|
||
|
||
if isstruct(model), | ||
func= misc_getFuncParam(model.classy); | ||
else | ||
func= misc_getFuncParam(model); | ||
end | ||
|
||
applyFcnName= ['apply_' func2str(func)]; | ||
if exist(applyFcnName, 'file'), | ||
applyFcn= str2func(applyFcnName); | ||
else | ||
applyFcn= @apply_separatingHyperplane; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
function [C,params]= trainClassifier(fv, classy, idx) | ||
%C= trainClassifier(fv, classy, <idx>) | ||
|
||
fv= proc_flaten(fv); | ||
if exist('idx', 'var'), | ||
fv.x= fv.x(:,idx); | ||
fv.y= fv.y(:,idx); | ||
end | ||
|
||
if isstruct(classy), | ||
%% classifier is given as model with free model parameters | ||
model= classy; | ||
classy= select_model(fv, model); | ||
end | ||
|
||
[func, params]= misc_getFuncParam(classy); | ||
if isfield(fv,'classifier_param') | ||
C= func(fv.x, fv.y, fv.classifier_param{:}, params{:}); | ||
else | ||
C= func(fv.x, fv.y, params{:}); | ||
end | ||
C.applyFcn= misc_getApplyFunc(classy); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
% BBCI Toolbox | ||
% Copyright (c) 2001- 2012 Benjamin Blankertz et al. | ||
%% add other authors?/which ones? | ||
% Berlin Institute of Technology, Neurotechnology Group and Berlin Brain Computer Interface | ||
%% add also Machine Learning group? | ||
% | ||
% This program is free software; you can redistribute it and/or modify | ||
% it under the terms of the GNU General Public License as published by | ||
% the Free Software Foundation; either version 2 of the License, or | ||
% (at your option) any later version. | ||
% | ||
% This program is distributed in the hope that it will be useful, | ||
% but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
% GNU General Public License for more details. | ||
% | ||
% You should have received a copy of the GNU General Public License along | ||
% with this program; if not, write to the Free Software Foundation, Inc., | ||
% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
% | ||
% Published reports of research using this code (or a modified version, maintaining a significant | ||
% portion of the original code) should cite an article dedicated on this toolbox (to be published soon) | ||
% or the following article: | ||
% | ||
% Blankertz B, Tangermann M, Vidaurre C, Fazli S, Sannelli C, Haufe S, Maeder C, Ramsey LE, Sturm I, | ||
% Curio G, M�ller KR, The Berlin Brain-Computer Interface: Non-Medical Uses of BCI Technology, | ||
% Open Access Front Neuroscience, 4:198, 2010 | ||
% http://www.frontiersin.org/neuroprosthetics/10.3389/fnins.2010.00198/abstract | ||
%% As soon as the an article especially devoted to the explanation of the toolbox is published, | ||
%% this remark should be replaced by this other article | ||
% | ||
% Comments and bug reports are welcome. Please email to: [email protected]. | ||
% We would also appreciate hearing about how you used this code, | ||
% | ||
|
||
|
||
Requirements: | ||
- Matlab Version 2007 or later and | ||
- for data acquisition: BrainVision recorder + a BCI system | ||
|
||
Download the most recent version of the code from | ||
%% insert download link here | ||
and data from | ||
%% insert data download link here | ||
and the PYFF toolbox from | ||
%% insert PYFF download link here | ||
%% will PYFF be packaged into this toolbox? | ||
|
||
open matlab and to the BBCI Toolbox head directory | ||
define the following path variables | ||
> DATA_DIR='YOUR_FULL_DATA_DIR' | ||
% here are the files from the recording are dumped in raw format: | ||
> BBCI_RAW_DIR = 'YOUR_FULL_RAW_DIR' | ||
% here are the files from the recording are dumped in .mat matlab format: | ||
> BBCI_MAT_DIR ='YOUR_FULL_MAT_DIR' | ||
|
||
% to intialize the toolbox type: | ||
|
||
> startup_bbci_toolbox | ||
|
||
% run the (off-line) demos in the 'demos' directory | ||
> demo_analysis_ERD | ||
% ERP Analysis: | ||
> demo_analysis_ERPs | ||
> demo_analysis_Spectra | ||
|
||
%% the following examples to be included: | ||
%% https://wiki.ml.tu-berlin.de/wiki/IDA/BerlinBCI/ToolBox/ToolboxPracticalExamples | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.