Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
suri

Junior Member
Registered:
Posts: 4
Reply with quote  #1 
Hello,

I am trying to set up a task with runtime v2. I want the animal to keep a button pressed for at least the duration of the sample viewing and then either keep pressing or releasing it based on the type of sample he has seen, for example get a reward for releasing seeing image A and a reward for releasing in image B. I am using an AI. What adapter should I use? At first sight there are several. 
0
Jaewon

Administrator
Registered:
Posts: 727
Reply with quote  #2 
I don't see any benefit of using adapters in the task you describe. You may as well use toggleobject and eyejoytrack.

If you have to use adapters, you can make 3 scenes:

Scene 1: show sample and wait for button press
Scene 2: wait for button release
Scene 3: check button hold

Then run Scene 1 & 2 for image A. Or Scene 1 & 3 for image B.

Regarding to how to compose each scene with adapters, you should read the manual. For Scene 1, you can use ButtonTracker, SingleButton and WaitThenHold.

ftp://helix.nih.gov/lsn/monkeylogic/ML2_doc/runtimefunctions.html

Also there are many example tasks under the "task\runtime v2" directory.
0
suri

Junior Member
Registered:
Posts: 4
Reply with quote  #3 
Thank you Jaewon, 

I guess I still have a few questions because my original question was too general. I will try to do better here. At this very prelim stage, my task includes: A) show fix point, wait for both fix acquired and button press, then hold both fix and button for 400 msec B) show the sample, hold both fix and button press for the duration of the stimulus 500msec.

Currently I have this done as:

A) scene one with SingleTarget and SingleButton combined with AndAdapter, wth1=WaitThenHold(and1), create_scene(wth1, fix point) ~~~~ Q1. I am reading that WaitThenHold needs One SingleTarget adapter, does this mean I cannot use WaitThenHold with And? 

B) I am now building scene 2 in the same way, with a wth(and2). However, I have realized that by doing so I cannot distinguish failure in pressing the button from fixation breaks. Can I associate different wth to different trackers, and create a scene  create_scene(wth2, wth2, sample)?


The tension it's between wanting two trackers in the same scene (at the same time) and not temporally sequential while at the same time tracking errors from both trackers.

I am building up from the DMS example, I see your point regarding the lack of need to use runtime2

Thanks in advance
0
Jaewon

Administrator
Registered:
Posts: 727
Reply with quote  #4 
A1. Please download the new package. WaitThenHold will work with the aggregated input.

A2. You can read the success status of SingleTarget and SingleButton, to see which input failed. See the example below. And create_scene does not take 2 adapters.

----- beginning of the example -----
fix = SingleTarget(eye_);
fix.Target = [0 0];
fix.Threshold = 3;
btn = SingleButton(button_);
btn.Button = 1;
and = AndAdapter(fix);
and.add(btn);
wth = WaitThenHold(and);
wth.WaitTime = 5000;
wth.HoldTime = 500;
scene = create_scene(wth);
run_scene(scene);

if wth.Success
    dashboard(1,'Success!!!');
else
    if fix.Success && ~btn.Success
        dashboard(1,'Button is not pressed!');
    elseif ~fix.Success && btn.Success
        dashboard(1,'Eye fixation is not acquired!');
    else
        dashboard(1,'No eye fixation & no button press!');
    end
end
----- end of the example -----
0
suri

Junior Member
Registered:
Posts: 4
Reply with quote  #5 
Thank you!it works just great
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.