Python scripts for two-dimensional feedback generation in Semantic fMRI neurofeedback.
This method has been used to guide participants towards a target mental state through real-time Representational Similarity Analysis (rtRSA) of brain activity patterns. It provides visual 2D feedback representing the current mental state of the participant as a movable point among semantic anchors obtained from previous acquisitions. The 2D map, called representational space (RS), is generated by applying a multi-dimensional scaling (MDS) procedure to the representational structure of the anchor patterns. The RS encodes the dissimilarity among neural patterns as distances between points of a 2D space, thus providing semantic information through the evaluation of the distances from a set of base patterns.
The code implements a constrained optimisaztion procedure aimed at minimising the difference between the input pattern dissimilarities and their respective Euclidean distances in the 2D space.
| Package | Tested Version |
|---|---|
| python | 3.6 |
| numpy | 1.19.2 |
| scipy | 1.5.2 |
| scikit-learn | 0.24.1 |
Thanks to @andreagrusso for providing some basic rtRSA functions