Contributions:ForagingTask

Synopsis
This task presents the participant with a matrix of dots to forage. The colors of the dots have different value, and the only way the participant knows the difference is by listening to the feedback given after harvesting the dot. Over time, the participant will learn which type will give them the highest reward, and will optimize each trial. After each trial, the participant is also shown their previous trial's score to help with their learning as well.
This task can easily be used in BCI2000, and has many adjustable settings to allow for the perfectly designed experiment.
Versioning
Authors
Max Marcus
Will Engelhardt (engelhardt@neurotechcenter.org)
Task Behavior
Audio Stimuli
The audio currently must have a specific format. It must be a .wav file. It must be in the format of <mean>-<number (0-9)>.wav. There must be 10 types of each mean, which is the 0-9 number. The mean corresponds to the amount of sound/reward in the audio file, and the files will be chosen based on the parameter ForagingStimuliDistribution, where you give the mean and standard deviation.
The stimuli are presented in a pseudo-random fashion. A normal distribution for each stimuli is created at the beginning of the run, with a size of the maximum possible number of presented stimuli. This is then shuffled and presented in order according to the new shuffled order. So if every possible dot is foraged for a given stimuli, by the end of the run you will have listened to the entire normal distribution of sounds with the given mean and standard deviation specified in ForagingStimuliDistribution.
Dot/Dwell radii
If EyetrackerCursor is enabled, the eye-tracker will stream the real-time eye-to-screen distance. This measurement is needed for calculating the pixel size from the given visual angle parameters. Without the eye-tracker, an estimation is made with the parameter ViewingDistanceInCm. But if the eye-tracker is enabled, we will make the most of it and use it to create an average eye-to-screen distance.
The radii are initially created based on the parameter ViewingDistanceInCm. Each trial, the radii of the fixation dot and the foraging dots are updated according to the new average viewing distance. The average distance is continually updated throughout the task.
Subset of colors
If ColorsInATrial is less than the number of colors in ForagingStimuliColors, a subset of colors will be presented in each trial. The subsets are chosen randomly for each trial at a time.
Cursor Control
This experiment is most easily run with an eyetracker. If this is not available, it can also be controlled with anything else, such as a mouse or joystick. To configure the cursor position, go the the Filtering tab, and then the Expressions parameter. The first row will control the X position, while the second row will control the Y position of the cursor. An example parameter for using the mouse is to specify (State(MousePosX) - 32768) / 2560 for the first row. 2560 is the screen width, and MousePosX is a BCI2000 state that tracks the position of the mouse. This expression can be modified to best fit your needs.
Parameters
Foraging
| ForagingColumns | Number of columns of dots |
| ForagingRows | Number of rows of dots |
| Trials | Number of trials in a run |
CursorControl
| EyetrackerCursor | Enable to use the eyetracker. Otherwise, the expression filter will be used, where any Expression or State can control the cursor. |
| ShowCursor | Enable to show the participant the cursor on their screen |
| CursorColor | Color of the cursor (if shown) |
| CursorSize | CursorSize (if shown) |
| UseVelocity | Enable to control the cursor by adding a velocity to it. Otherwise, the cursor is set with position. |
Foraging Dot Size
| MinDotAngle | Normal pixel size of the radius of each dot |
| MaxDotAngle | Maximum pixel size of the dot when increasing upon dwelling |
| DwellVisualAngle | Degrees of visual angle that triggers dwell. Uses Eye-tracker's state of distance to screen to create pixel size |
| FixationDotAngle | Radius of fixation dot |
| FixationDwellVisualAngle | Degrees of visual angle for fixation dot to be held |
| ViewingDistanceInCm | Distance of participant from screen (cm). To be used for calculating pixel size of dots. If eyetracker is enabled, this will not be used, and the distance will instead be measured with the eyetracker. |
| WindowDiagonalInCm | Length of the application window's diagonal. This helps calculate the conversion from centimeters to pixel size. |
Foraging Stimuli
| ForagingStimuliDirectory | Folder that contains the audio stimuli. Must be in format specified in Audio Stimuli |
| ForagingStimuliDistribution | Mean and standard deviation of audio files for each type of stimulus. The value is associated with the column, so make sure to have the mean in increasing order!. |
| ForagingStimuliColors | List of colors to be used. The first column must be the names of the colors, then the second column is the hex values of the colors. |
| ColorsInATrial | Number of colors to show per trial. Cannot be greater than the size of the given color list |
| MaximumColorCanMiss | Maximum number of trials that a color can miss in a row |
Foraging Timing
| ForagingTrialTime | Length of time that subject gets to forage |
| DwellTime | Duration that subject has to dwell on a dot to receive reward |
| InterTrialTime | Length of time between trials |
| ScoreFeedbackTime | Length of time to show user previous round's score |
| FixationTime | Time to fixate |
| FixationHoldTime | Time to hold fixation before starting trial (once dots have appeared) |
ProgressBar
The progress bar lets the experimenter know how much time has passed and how much is left. These parameters allow for customization of the bar.
PhotoDiodePatch
A photodiode patch is for use with a photodiode, which measures if the light input is below or above a threshold. Used for measuring the exact time ofthe screen presentation. These parameters allow for customization of the location of the patch, the shape, and the (in)active colors.
States
All states are integers.
| CursorPosX | The X position of the cursor, between 0 (left) and 1000 (right) |
| CursorPosY | The Y position of the cursor, between 0 (top) and 1000 (bottom) |
| TargetX | Column of the target that the cursor is in |
| TargetY | Row of the target that the cursor is in |
| TargetType | Each color is a type. Type of the target that the cursor is closest to |
| Score | Each round's score |
| TrialPhase | Phase of trial we are currently in
|
| Trial | Trial number (1 - number of trials) |
| Dwelling | Number of blocks that have occurred when the participant has been dwelling on the dot. Once it gets above the time set by #DwellTime, the reward is given and it goes back to 0 |
| DotExists | Describes which dots exist in a trial. Each target is stored in a bit. The order starts top left, goes through the row, then goes to the next row. For example, in a trial with 3 rows and 4 columns, the starting value will be 2^12 = 4096. If the top left target gets acquired, it no longer exists so the first bit will be flipped: 4096 - 2^0 = 4095. If the bottom right one gets chosen next, the 12th bit will be flipped: 4095 - 2^11 = 2047. This way, when decoded, you can be certain about the dot matrix after the experiment. |
| AudioType | The prefix of the audio stimuli that was played. The value corresponds to the number of blips in the audio file. |
| AudioVariation | The suffix of the audio stimuli that was played. The value corresponds to the variation that was played (0-10). |
| BoardLayout | The layout of the targets for each trial. At the beginning of the InterTrial phase (as soon as the randomized board is created for the feedback trial), the BoardLayout state will update with the TargetType for each target, moving from left to right. Once the end of the board is reached, it's value will be one more than the maximum target type value. |