Register Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
amwhit

Junior Member
Registered:
Posts: 2
Reply with quote  #1 
I have been trying to figure out how ML will communicate with our MR Scanner (Brooker BioSpin running ParaVision 6). I understand the scanner can send out and use TTL pulses to timestamp slices and trigger runs. On the ML side of things, I see I can use GOODMONKEY to trigger a TTL but I am unsure how to get ML to register the TTL pulses coming from the scanner as a timestamp, I think it would be an EVENTMARKER? Am I on the right path or is there some obvious documentation I'm missing.

Thanks! 
0
Jaewon

Administrator
Registered:
Posts: 646
Reply with quote  #2 
goodmonkey() and eventmarker() use TTLs, but they are outbound pulses to trigger reward devices or synchronize timing with external devices, so you don't want to use them.

To register inbound TTLs, you can use eyejoytrack() with a button. Hook up the TR signal of the scanner to one of the buttons and call eyejoytrack() with 'acquiretouch' or 'holdtouch'.

----- example 1 -----
ontarget = eyejoytrack('acquiretouch',1,[],60000);  % Wait for a TR pulse for 60 sec. 1 is the button #.
if ~ontarget
    error('No TR pulse is detected!!!');
end
----- end of example 1 -----

'acquiretouch' looks for a rising edge (LO->HI), so, if your scanner sends an inverted pulse (HI->LO), you can use 'holdtouch' instead.

----- example 2 -----
ontarget = eyejoytrack('holdtouch',1,[],60000);  % Wait for a TR pulse for 60 sec. 1 is the button #.
if ontarget
    error('No TR pulse is detected!!!');         % The ontarget status is opposite.
end
----- end of example 2 -----


The button input is not saved to the data file in the runtime v1, so, if you need to record the entire TR signal, split the signal and hook one to the button and the other to a general input.
0
amwhit

Junior Member
Registered:
Posts: 2
Reply with quote  #3 
Okay, I don't think I need the whole signal, I just need to log (and timestamp) the onset of the TTL signal to indicate when a slice has started during the video stimulus for our experiment. 


Just to be clear I am trying to make an experiment to test everything where I have 5 20 sec videos playing each with an event marker at the beginning and end of each movie. I also want to know when the slice starts for each sagittal scan as well as trigger the start of the run with ML

I have some of the code below to give you a better idea of what I have.... Will this work?

movA = 1
TTL = 6

movDur = 2000
appropriateDur = Duration the MR scanner needs to acquire the TTL pulse 

% task 

%receive slice time
ontarget = eyejoytrack('acquiretouch',6,[],1);  
if ontarget
       eventmarker(33)
  else
      error('No TR pulse is detected!!!');
end

% Trigger scanner is goodmonkey() a better function to use here?
toggleobject(TTL,'eventmarker',21)
idle(appropriateDur)
toggleobject(TTL,'eventmarker',20)


%play MovA
toggleobject(MovA,'eventmarker',11);
idle(MovDur);
toggleobject(MovA,'eventmarker',10);

.
.
.

Also final thing. For some reason the program doesn't stop after the 5th movie has been presented. do I need to specify that it ends after the 5th movie? where do I do that?

Thanks! 

0
Jaewon

Administrator
Registered:
Posts: 646
Reply with quote  #4 
Do you wan to know the start time of one slice or every slice? If what you need to know is the time of every slice scanned during video, you may as well record the entire pulse signal and retrieve the time by offline analysis. You can't check the signal changes continuously this way, while presenting movies.

If you want to know the time of only one slice, do you just need to know when it occurred or do you want to start a trial when a slice begins? In either way your code won't work. Your eyejoytrack checks the pulse only for 1 msec (if you connected the pulse input to Button 6 correctly) and make an error if there is no HI pulse at that moment. Most likely your code will make the 'No TR pulse ...' error all the time.

Again goodmonkey is for reward devices. Stay with TTL if this is to send a trigger to the scanner.
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.