| Literature DB >> 25688193 |
Rodrigo Basilio1, Griselda J Garrido1, João R Sato2, Sebastian Hoefle1, Bruno R P Melo1, Fabricio A Pamplona1, Roland Zahn3, Jorge Moll1.
Abstract
In this methods article, we present a new implementation of a recently reported FSL-integrated neurofeedback tool, the standalone version of "Functional Real-time Interactive Endogenous Neuromodulation and Decoding" (FRIEND). We will refer to this new implementation as the FRIEND Engine Framework. The framework comprises a client-server cross-platform solution for real time fMRI and fMRI/EEG neurofeedback studies, enabling flexible customization or integration of graphical interfaces, devices, and data processing. This implementation allows a fast setup of novel plug-ins and frontends, which can be shared with the user community at large. The FRIEND Engine Framework is freely distributed for non-commercial, research purposes.Entities:
Keywords: EEG; FSL; brain computer interface (BCI); neurofeedback; real-time fMRI
Year: 2015 PMID: 25688193 PMCID: PMC4311636 DOI: 10.3389/fnbeh.2015.00003
Source DB: PubMed Journal: Front Behav Neurosci ISSN: 1662-5153 Impact factor: 3.558
Figure 1Flowchart of three FRIEND processing neurofeedback pipelines. (1) Support Vector Machine-based neurofeedback, using projected values onto a discriminative hyperplane; (2) BOLD level real-time display from a set of pre-specified ROIs; (3) Real-time functional connectivity neurofeedback based on the correlation between the signals from different ROIs (Sato et al., 2013).
Figure 2The FRIEND Engine framework comprises three major components. The FRIEND Engine core and plug-ins, written in C++ and operating on the same platform, and the frontend that can be written in any language with sockets support. The TCP/IP communication protocol allows the frontend to be executed on a different computer platform from the FRIEND Engine. Users may customize or write their own frontends. Advanced users can also write their own plug-ins and processing pipelines.
List of commands expected by FRIEND Engine during the TCP/IP communication protocol with the frontend.
| PREPROC/NBPREPROC | Performs the initial preprocessing (co-registration, skull stripping, MNI registration, etc.) steps of FRIEND |
| PIPELINE/NBPIPELINE/NBFEEDBACK | Starts the processing of each volume in the acquisition run as soon as it becomes available in the input directory. The difference between the PIPELINE/NBPIPELINE and NBFEEDBACK commands, is that NBFEEDBACK automatically calculates the feedback values and stores them in a session workspace after the processing of each volume |
| GLM/NBGLM | Performs the General Linear Model (fsl_glm) calculation using the FSL toolbox |
| FEATURESELECTION/NBFEATURESELECTION | Performs feature selection (see Sato et al., |
| PLUG-IN | Defines the library and the associated plug-in functions to be used in further calls |
| TRAIN/NBTRAIN | Calls the train function plug-in |
| TEST | Calls the plug-in feedback function |
| NEWSESSION | Creates a new session (workspace) in the engine memory |
| ENDSESSION | Indicates that the engine can terminate an opened session and closes the related thread |
| SESSION/GRAPHPARS | Queries for the motion parameters of a given volume |
| SESSION/TEST | Returns the feedback information of a volume, previously stored in the session workspace |
| SESSION/PREPROC, SESSION/FEEDBACK | Queries if a command, e.g. PREPROC or FEEDBACK has ended |
| READCONFIG | Sends an entire configuration file associated with the frontend neurofeedback study to set the parameters of the experiment |
Figure 3TCP/IP network communication protocol between the frontend and the FRIEND Engine (avatar finger tapping virtual scenario). The steps marked with asterisk (*) are called as many times as needed. The first message sent is “NEWSESSION,” which indicates that the engine should create a new session to work with the frontend. That message is only needed in asynchronous communications as explained in Section TCP/IP Communication Protocol.
List of parameters used within plug-in functions.
| studyParams | Object that stores information from the study_params.txt file, which encloses all the information used by the processing pipeline to correctly identify the files, directories and expected number of data volumes |
| userData | Pointer referencing an area of memory created by the engine to be used by the plug-in for temporary calculations. The reason behind this approach is that subsequent calls to the same plug-in from different frontends would overwrite internal data structures if they were created within the plug-in library |
| classNum | Number of the class, i.e., the condition attributed to the scan during classification |
| volumeIndex | Number of the current processed scan |
| volumeFileName | The filename of the volume in the file system |
| Projection | Feedback value calculated |
| Index | Number of current scan |
List of functions a plug-in can define.
| Train | Executed when the frontend issues the TRAIN command (Table | studyParams userData |
| Test | Executed when the engine needs to calculate the feedback value for a given volume. There are two predefined values that the engine returns to the frontend: information about the condition of the processed image volume indicating, for example, a specific type of image volume classification in a MVPA study, and the feedback information value. The interpretation of these two variables is left to the frontend, which must implement how this information will be conveyed to the participant (e.g., a thermometer level, changes in a visual or auditory feedback) | studyParams userData classnum projection index |
| Initialization | Called after the engine reads information from the study configuration file (see Sato et al., | studyParams userData |
| Finalization | Called right before ending the processing of a session. All the memory data structures allocated in the Initialization function must be destroyed here | studyParams userData |
| Volume | Called before the processing of a volume | studyParams volumeIndex volumeFilename userData |
| PostProc | Called after the pre-processing of each volume | studyParams volumeIndex volumeFilename userData |
Functions implemented in the libROI plug-in.
| initializeROIProcessing | Initialization function that creates the data structures necessary for processing ROIs. It also transforms the user-defined MNI ROI mask into subject space |
| processROI | Feedback function that calculates the percent signal change of a ROI in the current volume compared to the mean activation of a baseline block |
| finalizeROIProcessing | Finalization function that destroys all data structures created in the initialization function |
Functions implemented in the libBrainDecoding plug-in.
| trainSVM | Function that uses the libSVM library to train the SVM model |
| testSVM | Function that calculates the feedback value of a scan based on its projected values on an SVM hyperplane |
| initSVM | Initialization function that creates the data structures required for SVM training and testing |
| finalSVM | Finalization function that deletes all temporary data structures created by initSVM |
Functions implemented in the libConnectivity plug-in.
| buildROIs | Training function responsible for building a mask containing two ROIs used to calculate the associated correlations |
| calculateFeedback | Feedback function that calculates the sliding window correlations based on the two ROIs calculated in buildROIs function |
| initializeFunctionalConnectivity | Initialization function that creates the necessary data structures |
| finalizeFunctionalConnectivity | Finalization function that destroys all data structures created by initializeFunctionalConnectivity function |
Figure 4Snapshot of a frontend designed with the Matlab® GUIDE tool, showing motion parameters (rotation, translation and root mean square error) and a thermometer indicating BOLD signal change as a feedback.
Figure 5Snapshots of the game like frontend designed in Unity, showing the path that the participant travels during the experiment. (A) Shows the situation where the rock is blocking the way; (B) shows the rock being “levitated,” unblocking the way.
Figure 6Two situations of the avatar finger tapping scenario. (A) During a rest block and (B) during a finger tapping block.