Jump to content

GuiltTask: Difference between revisions

From BCI2000 Wiki
Lingling (talk | contribs)
No edit summary
Lingling (talk | contribs)
 
(17 intermediate revisions by the same user not shown)
Line 5: Line 5:


==Timeline==
==Timeline==
<gallery mode="packed" widths=1000px heights=500px>
<gallery mode="packed" widths=1500px heights=1200px>
File:Guilty_task_time_line.png|Figure 1: Single Trial Timeline.
File:Guilty_task_time_line.png|Figure 1: Single Trial Timeline.
</gallery>
</gallery>


== Visual Representation ==
== Visual Representation ==
<gallery mode="packed" widths=750px heights=421px>
<gallery mode="packed" widths=800px heights=450px>
File:xx.gif|Figure 2: Visual Representation
File:GuiltTaskVideo.gif|Figure 2: Visual Representation
</gallery>
</gallery>


Line 64: Line 64:
==Parameters==
==Parameters==
There are two kinds of parameters: shared and local. The shared parameter is the one you want to synchronize between two clients, like the stimulus sequence, the sequence of break trials you wish to take a break after this trial, etc. It should be saved on the server as a parameter file and passed to the clients through messages as a parameter. The local parameter is that you want to customize the parameter locally, like GUI. The local parameter is the regular BCI2000 parameter file saved under the local BCI2000 project folder.
There are two kinds of parameters: shared and local. The shared parameter is the one you want to synchronize between two clients, like the stimulus sequence, the sequence of break trials you wish to take a break after this trial, etc. It should be saved on the server as a parameter file and passed to the clients through messages as a parameter. The local parameter is that you want to customize the parameter locally, like GUI. The local parameter is the regular BCI2000 parameter file saved under the local BCI2000 project folder.


===Shared Parameters===
===Shared Parameters===
Line 73: Line 72:
1. ImagePath(the path of dots images).
1. ImagePath(the path of dots images).


====StimuliSequece====
====MyStimuliSequence====
The sequence of dots images.
The sequence of dots images.


====TrialSequece====
====StimuliSequencePractice====
Practice trial stimuli sequence
 
====InstructionPathTrans====
Transgressor instruction image path
 
====InstructionPathVicT====
Victim instruction image path
 
====FeedbackPathList====
Feedback icon path list
 
====TrialSequece1, TrialSequece2====
There are two sequences of trial types, for each experiment, we can run them alternatively, we can specify the sequence through the Parameter "TrialTypeSequenceID".<br>
Sequence of trial type.<br>
Sequence of trial type.<br>
1: both correct<br>
1: both correct<br>
Line 83: Line 95:
4: both incorrect
4: both incorrect


====FixationDurationMax, FixationDurationMin====
====InstructionImagesSequence====
Maximum and minimum Duration of Fixation(ITI).
The sequence of instruction images path.
 
====FixationDurationList====
Duration of Fixation(ITI) list.


====DotsDuration====
====DotsDuration====
Line 95: Line 110:
The duration to display the outcome.
The duration to display the outcome.


====CompensationDuration====
The duration to display the compensation.
====EnablePractice====
Enable the practice trial or not
====StartPoints====
The initial total points of the game
====GuessDots====
INstruction of the guessing the number of the dots
====DotsNumber====
Guess the number of dots is greater or less than the "DotsNumber", "DotsNumber" is the number to be compared with.
====optionOne, optionTwo====
guess option one/two, for example "Greater" and "Less"
====CompensationQuestion====
Instruction of compensation phase
====CompensationOne, CompensationTwo, CompensationThree, CompensationFour====
Compensation options
====ForgivenessQuestion====
Instruction of forgiveness phase


====ForgivenessOne, ForgivenessTwo, ForgivenessThree, ForgivenessFour====
Forgiveness options


Unlike the parameters described above, they are saved on the server rather than on local computers.
Unlike the parameters described above, they are saved on the server rather than on local computers.


===Local Parameters===
===Local Parameters===
====InstructionImagesSeque====
The sequence of instruction images path.


====FontSize, FixationSize====
====FontSize, FixationSize====
Line 110: Line 150:
Color of the font/fixation.
Color of the font/fixation.


===ScreenWidth, ScreenHeight===
====FontActiveColor====
Width/height of the monitor screen in cm.
Color of the active font(be selected)


===EyeToSreenDistance===
====GUIScale====
Distance from the subject's eyes to the screen in cm.
Scale the GUI, 1 is maximum, 0 is minimium


===VisualAngle===
====TrialTypeSequenceID====
The degrees of visual angle.
Specify the trial type sequence, see Parameter "TrialSequece1 and TrialSequece2"


===ProgressBar===
====ProgressBar====
Display progress bar.
Display progress bar.


===ProgressBarHeight, ProgressBarWidth===
====ProgressBarHeight, ProgressBarWidth====
Progress bar height/width in pixels.
Progress bar height/width in pixels.


===ProgressBarBackgroundColor, ProgressBarForegroundColor===
====ProgressBarBackgroundColor, ProgressBarForegroundColor====
Color of progress bar background/foreground.
Color of progress bar background/foreground.


Line 149: Line 189:
Shared states are converted to BCI2000 states asynchronously through events using the HyperscanningApplicationBase class. We declared shared states in the batch file as "--SharedStates=state1_name,state1_size&state2_name,state2_size&...", which is appended to the end of the application module.
Shared states are converted to BCI2000 states asynchronously through events using the HyperscanningApplicationBase class. We declared shared states in the batch file as "--SharedStates=state1_name,state1_size&state2_name,state2_size&...", which is appended to the end of the application module.


===Shared State===
====isReadyStart0, isReadyStart1====
Check if client0/client1 is ready to move to the next phase or trial.
====ClientNumber====
The client’s ID, is assigned by the server. Either 0 or 1. (8 bits)<br>
0: Transgressor.    1: Victim
====Compensation====
The compensation that the transgressor gives in each trial
====Forgiveness====
The forgiveness that the victim gives in each trial
===Local State===
====PhaseNumber====
====PhaseNumber====
The index of phase in each trial. (8 bits) <br>   
The index of phase in each trial. (8 bits) <br>   
[0] indicates the instruction at the beginning of the experiment. (When the slides instruction images are present on the screen)<br>  
[0] indicates the instruction at the beginning of the experiment. (When the slides instruction images are present on the screen)<br>  
[1] present the fixation on the screen.<br>  
[1] present the instruction showing the end of the practice trial<br>
[2] present the dots on the screen.<br>  
[2] present the fixation on the screen.<br>  
[3] The subject estimates the number of dots.<br>  
[3] present the dots on the screen.<br>  
[4] Display the outcome.<br>  
[4] The subject estimates the number of dots.<br>  
[5]End: (Well done! You have finished all the trials.)
[5] Display the outcome.<br>  
[6] reset the states and GUI<br>
[7] Choose the compensation/forgiveness level.<br>
[8] display the compensation/forgiveness that another player selects<br>
[9] The end of the game, shows the total score, compensation and average forgiveness.<br>
[10] End: (Well done! You have finished all the trials.)<br>
[11] none, the initial value of the state.<br>


====TrialNumber====
====TrialNumber====
Index of trials. (8 bits)
Index of trials. (8 bits)


====TrialType===
====TrialType====
1: both correct<br>
1: both correct<br>
2: victim incorrect<br>
2: victim incorrect<br>
Line 167: Line 229:
4: both incorrect
4: both incorrect


====Response====
====StimulusCode====
The id of the stimulus in each trial
 
====ResponseValue====
1: greater.    2: smaller. (8 bits)
1: greater.    2: smaller. (8 bits)
====ClientNumber====
The client’s ID, is assigned by the server. Either 0 or 1. (8 bits)<br>
0: Transgressor.    1: Victim


====FixationDuration====
====FixationDuration====
The duration of fixation.
The duration of the fixation phase in each trial.


====Photodiode====
====Photodiode====
1: active;
1: active;
2: non-active
2: non-active

Latest revision as of 20:38, 3 March 2025

Synopsis

In the interpersonal task, you will team up with another participant in a different room (referred to as “partner”). You do not know each other before, and you will not see each other after the task. During this task, the two of you will complete multiple rounds of “dot-estimation” together. Specifically, both you and the partner will see an array of white dots scattered on the screen. Your task is to estimate the total number of these dots. After the dots disappear, you will see a number on the screen. Now you need to guess whether the number of dots you just saw is greater or smaller than the number on the screen. If you think the number of dots is smaller than the number on the screen, then press the left arrow button to select “Smaller”; if you think the number of dots is larger than the number on the screen, then press the right arrow button to select “Greater”. You will need to make the choice within 3 seconds, otherwise your responses will be recorded as “incomplete” will be reminded to respond faster next round.

Timeline

Visual Representation

Versioning

Authors

Hongbo Yu <hongbo.yu@psych.ucsb.edu> and Shuo Wang <wangshuo45@gmail.com> conceived this paradigm.
Huiling Huang (huiling@neurotechcenter.org) implemented the paradigm into BCI2000.

Set up

Deploy the Server

You will need a Linux or macOS computer to run the server. Currently, the Windows OS is not supported. The following steps are for deploying the server on the local network. If you want to deploy the server on AWS, please refer to https://www.bci2000.org/mediawiki/index.php/BCI2000_Hyperscanning#Important_Notes_2.
First, please ensure all the computers are connected to the same local network. Then open the terminal(Mac OS or Linux) and run the command below to clone the server code from GitHub.

git clone https://github.com/MaxwellMarcus/hyperscanning-backend

Go the hyperscanning directory

cd hyperscanning

Compile the project by

make -B

Run the server with

./application

The application will only run as long as the experiment and will have to be restarted.

Batch File

The batch file is located in ./batch/CommunicationTask.bat.

Unlike the normal bci2000 task, we define the shared states in the batch file(line 35) by beginning with"--SharedStates=". The form is:

--SharedStates=<state-1>,<state-1-size>&<state-2>,<state-2-size>&<state-3>,<state-3-size>...

IPAddress and Port indicate the server computer.

Run the experiment on the client computer

Go to the./batch, find the "CommunicationTask.bat", and double click it. After pushing "Set Config," the BCI2000 will try to connect the server. If it successfully connects to the server, the System Log will print "Connected to server." If only one client connects to the server, the "Start" button in the operator will turn gray until another client connects.

Troubleshooting

After you quit the server from the terminal and restart it again, you might see this error message. That means the server is still running. You need to kill the "application" process.

Parameters

There are two kinds of parameters: shared and local. The shared parameter is the one you want to synchronize between two clients, like the stimulus sequence, the sequence of break trials you wish to take a break after this trial, etc. It should be saved on the server as a parameter file and passed to the clients through messages as a parameter. The local parameter is that you want to customize the parameter locally, like GUI. The local parameter is the regular BCI2000 parameter file saved under the local BCI2000 project folder.

Shared Parameters

You must upload the parameters below to the server as a parameter file. When the client connects to the server, it will automatically download the parameter file from the server and save it locally. You can indicate the download path in the Application tab, ParamterPath. Please do not modify the parameter file. Otherwise, the synchronization between two clients can't be guaranteed.

Stimuli

Shared parameter, stimulus information, including:
1. ImagePath(the path of dots images).

MyStimuliSequence

The sequence of dots images.

StimuliSequencePractice

Practice trial stimuli sequence

InstructionPathTrans

Transgressor instruction image path

InstructionPathVicT

Victim instruction image path

FeedbackPathList

Feedback icon path list

TrialSequece1, TrialSequece2

There are two sequences of trial types, for each experiment, we can run them alternatively, we can specify the sequence through the Parameter "TrialTypeSequenceID".
Sequence of trial type.
1: both correct
2: victim incorrect
3: transgressor incorrect
4: both incorrect

InstructionImagesSequence

The sequence of instruction images path.

FixationDurationList

Duration of Fixation(ITI) list.

DotsDuration

Duration of displaying the dots

ResponseDuration

The maximum time allows the subject to make a response.

OutcomeDuration

The duration to display the outcome.

CompensationDuration

The duration to display the compensation.

EnablePractice

Enable the practice trial or not

StartPoints

The initial total points of the game

GuessDots

INstruction of the guessing the number of the dots

DotsNumber

Guess the number of dots is greater or less than the "DotsNumber", "DotsNumber" is the number to be compared with.

optionOne, optionTwo

guess option one/two, for example "Greater" and "Less"

CompensationQuestion

Instruction of compensation phase

CompensationOne, CompensationTwo, CompensationThree, CompensationFour

Compensation options

ForgivenessQuestion

Instruction of forgiveness phase

ForgivenessOne, ForgivenessTwo, ForgivenessThree, ForgivenessFour

Forgiveness options

Unlike the parameters described above, they are saved on the server rather than on local computers.

Local Parameters

FontSize, FixationSize

Font/Fixation size.

FontColor, FixationColor

Color of the font/fixation.

FontActiveColor

Color of the active font(be selected)

GUIScale

Scale the GUI, 1 is maximum, 0 is minimium

TrialTypeSequenceID

Specify the trial type sequence, see Parameter "TrialSequece1 and TrialSequece2"

ProgressBar

Display progress bar.

ProgressBarHeight, ProgressBarWidth

Progress bar height/width in pixels.

ProgressBarBackgroundColor, ProgressBarForegroundColor

Color of progress bar background/foreground.

PhotoDiodePatch

Display a photodiode patch on the stimulus window. Recording from a photodiode located on that patch will allow triggering on actual stimulus delivery (see User_Reference: P3TemporalFilter#OnsetExpression).

PhotoDiodePatchHeight, PhotoDiodePatchWidth

Photodiode patch height/width in relative coordinates (between 0 and 1).

PhotoDiodePatchLeft, PhotoDiodePatchTop

Photodiode patch left/top position in relative coordinates (between 0 and 1).

PhotoDiodePatchShape

Photodiode patch shape: 0 rectangle, 1 ellipse.

PhotoDiodePatchActiveColor

Photodiode patch color when active (RGB color in format 0xrrggbb).

PhotoDiodePatchInactiveColor

Photodiode patch color when inactive, (RGB color in format 0xrrggbb, use 0xff000000 for transparent).

States

Shared states are converted to BCI2000 states asynchronously through events using the HyperscanningApplicationBase class. We declared shared states in the batch file as "--SharedStates=state1_name,state1_size&state2_name,state2_size&...", which is appended to the end of the application module.

Shared State

isReadyStart0, isReadyStart1

Check if client0/client1 is ready to move to the next phase or trial.

ClientNumber

The client’s ID, is assigned by the server. Either 0 or 1. (8 bits)
0: Transgressor. 1: Victim

Compensation

The compensation that the transgressor gives in each trial

Forgiveness

The forgiveness that the victim gives in each trial

Local State

PhaseNumber

The index of phase in each trial. (8 bits)
[0] indicates the instruction at the beginning of the experiment. (When the slides instruction images are present on the screen)
[1] present the instruction showing the end of the practice trial
[2] present the fixation on the screen.
[3] present the dots on the screen.
[4] The subject estimates the number of dots.
[5] Display the outcome.
[6] reset the states and GUI
[7] Choose the compensation/forgiveness level.
[8] display the compensation/forgiveness that another player selects
[9] The end of the game, shows the total score, compensation and average forgiveness.
[10] End: (Well done! You have finished all the trials.)
[11] none, the initial value of the state.

TrialNumber

Index of trials. (8 bits)

TrialType

1: both correct
2: victim incorrect
3: transgressor incorrect
4: both incorrect

StimulusCode

The id of the stimulus in each trial

ResponseValue

1: greater. 2: smaller. (8 bits)

FixationDuration

The duration of the fixation phase in each trial.

Photodiode

1: active; 2: non-active