Millisecond Forums

Mask image in a dot probe task

https://forums.millisecond.com/Topic19282.aspx

By Benne - 6/20/2016

Hey there,

I´m currently working on a dot-probe-task. Therefore I customized the "alcohol dot probe task" (Miller et al. 2010) from the test library.
In the next step, I want to add a mask image between the fixation cross and the target.
Until now, every trial goes as follows: fixation cross (500 ms) --> target and distractor (231ms)  --> probe (1000ms) --> next trial.

I´ve already created the mask image with photoshop and added its duration value in the "values" part of the script:
 
<item mask_image>
/1 = "mask.jpg"
</item>

<picture mask>
/items = mask_image
/position = (50%, 50%)
/size = (values.imageheight, values.imageheight)
</picture>

<values>
maskduration = 66
[other values...]
</values>

By now, I want to add the mask image in every trail just after the fixation cross without destroying my dataset: fixation cross (500 ms) --> mask (66ms) -->  target and distractor (231ms)  --> probe (1000ms) --> next trial

The practice trials look as follows:
<trial Practice>
/ ontrialbegin = [values.category = "Practice"]
/ ontrialbegin = [values.target_position = list.PracticeTarget_positions.nextvalue]
/ ontrialbegin = [values.congruence = list.PracticeTargetprobe_congruence.nextvalue]

/ ontrialbegin = [if (values.target_position == 1) {values.target_x = values.target_left_x; values.comp_x = values.target_right_x}
else {values.target_x = values.target_right_x; values.comp_x = values.target_left_x}]
/ ontrialbegin = [if (values.congruence == 1) {values.probe_x = values.target_x} else {values.probe_x = values.comp_x}]

/ ontrialbegin = [trial.Practice.insertstimulustime(shape.eraser, values.fixationduration)]
/ ontrialbegin = [trial.Practice.insertstimulustime(picture.PracticeTarget, values.fixationduration)]
/ ontrialbegin = [trial.Practice.insertstimulustime(picture.PracticeComp, values.fixationduration)]
/ ontrialbegin = [trial.Practice.insertstimulustime(shape.eraser, (values.fixationduration + values.targetduration))]
/ ontrialbegin = [trial.Practice.insertstimulustime(text.probe, (values.fixationduration + values.targetduration + values.TP_ISI))]
/ ontrialend = [trial.Practice.resetstimulusframes()]
/ stimulusframes = [1 = fixation]
/ beginresponsetime = values.fixationduration + values.targetduration + values.TP_ISI
/ responseinterrupt = immediate
/ isvalidresponse = [trial.Practice.response == values.responsekey_left || trial.Practice.response == values.responsekey_right]
/ iscorrectresponse = [(values.probe_x == values.target_left_x && trial.Practice.response == values.responsekey_left) ||
(values.probe_x == values.target_right_x && trial.Practice.response == values.responsekey_right)]
/ monkeyresponse = (18, 23)
/ ontrialend = [values.target_image = picture.PracticeTarget.currentitem; values.comp_image = picture.PracticeComp.currentitem]

/ timeout = (values.fixationduration + values.targetduration + values.TP_ISI+ values.probeduration)
/ posttrialpause = values.iti
</trial>

My question: How do I implement the mask image? I tried /stimulusframes =  [1= fixation, 500=mask] with different versions of the /ontrialbegin command, but nothing worked ... Either the mask image appears on top of the other stimuli or my dataset gets mixed up.

Thank you!
Benne
By Dave - 6/20/2016

> /stimulusframes =  [1= fixation, 500=mask]

Using /stimulusframes does not make sense. The above would display the "mask" stimulus in the 500th display refresh cycle, not at 500ms. Suppose your display runs at 100Hz, i.e. a 10ms refresh cycle: Then the above would display the mask at ~5000ms into the trial (500 * 10ms). If your display runs at a lower refresh rate (e.g. 60Hz), the mask would be displayed even later.

You should use /stimulustimes instead:

/stimulustimes =  [0= fixation, 500=mask]

You can alternatively insert the mask at the desired point in time using the insertstimulustime() function in an /ontrialbegin attribute, just as is done with various other stimuli in the <trial>.

<trial Practice>
...
/ ontrialbegin = [trial.Practice.insertstimulustime(shape.eraser, values.fixationduration)]
/ ontrialbegin = [trial.Practice.insertstimulustime(picture.PracticeTarget, values.fixationduration)]
/ ontrialbegin = [trial.Practice.insertstimulustime(picture.PracticeComp, values.fixationduration)]
/ ontrialbegin = [trial.Practice.insertstimulustime(shape.eraser, (values.fixationduration + values.targetduration))]
/ ontrialbegin = [trial.Practice.insertstimulustime(text.probe, (values.fixationduration + values.targetduration + values.TP_ISI))]
...
</trial>

You will have to adjust those attributes accordingly to get the timings you want. In particular, note that a stimulus erasing the fixation cross (shape.eraser) and the target & comp pictures are all inserted at the same time. Those would *immediately* overwrite your mask. So, you'll want to push those out by the duration of the mask (66ms).

<trial Practice>
...
/ ontrialbegin = [trial.Practice.insertstimulustime(picture.mask, values.fixationduration)]
/ ontrialbegin = [trial.Practice.insertstimulustime(shape.eraser, (values.fixationduration + values.maskduration))]
/ ontrialbegin = [trial.Practice.insertstimulustime(picture.PracticeTarget, (values.fixationduration + values.maskduration))]
/ ontrialbegin = [trial.Practice.insertstimulustime(picture.PracticeComp, (values.fixationduration+ values.maskduration))]
etc.
...
</trial>
By Benne - 6/21/2016

Works fine now! Thanks a lot!