Skip to content

majidkhalili/HybridBCI

Repository files navigation

HybridBCI

A framework for EEG-NIRS HCI comunication.

HCI - BCI - EEG - NIRS

Table of Contents


Documentation

Detailed documentation on the software design, implementation and usage of the code are published at SoftwareX and can be found here .


System Design

HybridBCI's Block Diagram


Prerequisites

The main GUI interface of the HybridBCI is designed in App Designer, which is still under development in Matlab, so try to use latest version of the Matlab for maximum compatibility. Minimum requirment would be Matlab R2018a.

Depending on which part of the code you are using different libraries are required.

Main functionality

EEG

Speller


Installation

HybridBCI needs administrative privileges to creat folders for saving log files and storing recorded data and created models. Run Matlab as administrator and navigate to the root folder of the HybridBCI and:

  HybridBCI

For testing, you can use the sampleSubject data and set feedback as Simulation.


FAQ

Q: How do I add a new EEG feature?

A: User implemented EEG feature can be added to the pipeline by placing the .m file in ‘..\lib\EEG\Features\’. File's name is optional but is recommended to be the same as the function name. Prototype of the function is as below:

function [features] = NewEEGFeatureFunction(Data, fs,   passbandInterval)
% NEWEEGFEATUREFUNCTION Calculates the correspondant feature.
% INPUTS:
%   Data              : Channels X Timepoints X Trials; Separated for eeg, emg, eog
%   fs                : Sampling rate in Hz
%   passbandInterval  : Boundaries for the bandpass filters (Delta, Theta, Alpha, ...)
% OUTPUTS:
%   features  : Value of the correspondant feature.

  % extract features

end

Q: How do I add a new NIRS feature?

A: In order to add new NIRS feature to the HybridBCI, related .m file should be placed in ‘..\Lib\NIRS\Features\’. File's name is optional but is recommended to be the same as the function name. Prototype of the function is as below:

function feature = NewNIRSFeatureFunction(Data)
% NEWNIRSFEATUREFUNCTION Calculates the correspondant feature.
%   Data              : Channels X Timepoints X Trials; Seprated for HbO, HbR, and HbT 
% OUTPUTS:
%   features  : Value of the correspondant feature.

  % extract features

end

Q: How do I implement a new recording device?

A: New recording devices can be added by placing their .m file in the “..\lib\DataAcquision\EEG|NIRSDevices\”. Implementation of the recording devices is completely optional and based on the recording device. However any recording device should implement two basic functionalities:

  1. Save the last trial in the root folder as a mat file, and named 'lastTrialEEG.mat' for EEG recordings and 'lastTrialNIRS.mat' for NIRS recordings.
  1. Save the whole blocks (accumulation of the last trials) at the end of the block in the subject's folder. The path to this folder can be found in the temp.mat in the root folder, generated by the HybridBCI at the begining of each block.

Q: How do I implement a new trigger device?

A: Any triggering system is a class derived from 'Device' and should be placed in '..\Devices\TriggerDevices\Hardwar|Software' depending on its' functionality. Once the new class is derived from the 'Device', it should implement all its' anstract functions for triggering. A prototupe of a trigerring device would be as below:

 classdef NewTriggerDevice < Device

     properties (Access = private)
     % Private properties
     end
     
     properties (Access = public)
     % Public properties
     end
     
     methods
         function obj = NewTriggerDevice()
         % Class constructor for initial functionalities.     
         end
         
                 
         function sendTrigger(obj,trigger)
         % Implementation of the abstract function.
         % Here 'trigger' should be set, depending on the devices\'s protocol
         end
         
         function err = exit(obj)
         % Implementation of the abstract function.
         % Closing ports and returning possible errors.
         end
     end
 end

Q: What are triggers?

A: The table below represents the 14 different triggers used by the HybridBCI for managing the different events. These values are sent to the acquisition systems during the experiment and used to keep track of the timing of the different events.

Event Trigger Values
Yes Question No Question Open Question
Block Start 9
Baseline 10 11 12
Question 5 6 7
Thinking 4 8 13
Feedback 1 2 3
Block End 15

Q: How do I cite the paper?

A: Please cite the HybridBCI reference paper when you have used HybridBCI for BCI experiments as below:

  • In text citation:

    Khalili-Ardali et al. (2020)

  • APA 7:

    Khalili-Ardali, M., Martínez-Cerveró, J., Tonin, A., Jaramillo- Gonzalez, A., Wu, S., Zanella, G., Corniani, G., Montoya-Soderberg, A., Birbaumer, N., Chaudhary, U. (2020). A General-Purpose Framework for a Hybrid EEG-NIRS-BCI. SoftwareX [In Revision].

  • APA 6:

    Khalili-Ardali1, M., Martínez-Cerveró, J., Tonin, A., Jaramillo- Gonzalez, A., Wu, S., Zanella, G., Corniani, G., ... Chaudhary, U. (2020). A General-Purpose Framework for a Hybrid EEG-NIRS-BCI. SoftwareX [In Revision].


License

License

Copyright (c) 2020 Khalili-Ardali, M., Martínez-Cerveró, J., Tonin, A., Jaramillo- Gonzalez, A., Wu, S., Zanella, G., Corniani, G., Montoya-Soderberg, A., Birbaumer, N., Chaudhary, U. from CLISLAB
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


About

HybridBCI is a HCI toolbox

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages