-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Included in this repository is MATLAB code and example files for running a simple vibrotactile experiment using Dancer Designs piezo stimulators.
Dependencies for using this code:
- MATLAB Data Acquisition Toolbox
- ToolboxToolbox (toolboxes for this code can be added using: tbUse bairstimuli)
- NIdaq drivers
The code is heavily inspired by, and uses parts of the BAIR visual code. As such, functions beginning with 'bair' should not be changed or this may break other code that uses these functions. In addition, the functions that are based on bair functions are named according to the code that it is based on (for cross comparison/ future compatibility reasons).
Running the code will prompt the user for various text inputs (site, subjectID, session name) so that the appropriate site parameters are used (currently setup to only work with NYU3T) and for BIDS naming purposes. Additional input files are also expected (explained below) for initializing a NIdaq session and stimulus creation. The stimulus is in the form of a matrix containing a column for every stimulator used and rows according to the desired experiment time based on the NIdaq rate provided. One matrix is used for the duration of the experiment to limit potential delays within the experimental design.
Three types of files are required for the experiment to run:
- Stimulus Order file: A .txt file (in ~/StimOrders)containing experiment orders (ascending, descending, blocked, etc).
- VTS session Opts: A .json file (in ~/SessionOpts) containing session specific information used to set up the NIdaq device (device name, # stimulators, NIdaq rate).
- Experiment Opts: A .json file (in ~/ExperimentOpts) containing experiment specific parameters for creating the stimulus (# blanks, # cycles, vibrational frequency, etc.). Every experiment type should have it's own Opts file.
Note: The code is designed to ask you if you would like to make the Opts files on the spot if you do not provide them via the GUI, but the StimOrder must be provided separately.
Successfully running the code will yield 3 output files with appropriate BIDS names:
- Images of the design matrices written to ~/StimImages.
- TSV files detailing the stimulus onsets, duration, stimulator numbers, stimFile and trialType written to ~/Stimuli.
- A .mat file containing the Opts used, design matrix, and matrix containing the vibrotactile stimulus and experiment parameters written to ~/Stimuli.