Reading MRI trigger with DataPixx

Hi all!
I am new to PsychToolbox (I migrated from Cogent). Could someone please tell me how to wait for the MRI trigger to synchronise visual presentation using DataPixx and ResponsePixx in Matlab?

Whether here or by email [v.rodriguez@aston.ac.cuk] I will be very grateful.

Warm regards, Valia

Hello Valia,

VPixx has a couple of VOCAL (VPixx Online Classroom and Library) guides to get you started on using TTL triggers in your code.

You can take a look at https://vpixx.com/vocal/rt_responsepixx/ and https://vpixx.com/vocal/introduction-to-registers-and-schedules/

Both of these guides will describe how to use digital inputs and how to read their values and monitor them.

Feel free to email us directly too!

Danny M
VPixx Technologies

This also depends on what type of trigger the MRI is sending out. Several scanners I’ve worked with use a keyboard signal and so you need to use e.g. KbCheck in a loop to wait for the character before starting:

PsychDefaultSetup(2);
KbCheck(-1); %make sure KbCheck is loaded into memory
trigger = KbName('s'); %MRI sends the 's' key
while true
	WaitSecs(0.001); % wait 1ms between checks
	[pressed, ~, key] = KbCheck(-1);
	if pressed && key(trigger); break; end
end
% your draw code here...