Welcome! Log In Create A New Profile

Advanced

Overlapping Problem and Summary Figure

Posted by Song_Moore 
Overlapping Problem and Summary Figure
August 29, 2019 03:05AM
Hi, I have two questions want to ask about:

1. As shown in the attached figure file, the cursor is green and two targets are blue. When green cursor gets into the blue circle in the center, a holding time starts, and when green cursor leaves target region during the holding time, the target become red and the trial is aborted. Since the cursor I used was large, when the cursor left the central target, part of the cursor still remained inside the target. I want cursor and target to separate completely when mk breaks the holding period.

First solution I thought was to give a little bit delay, like using idle(50) before termination of the program when "if ~ontarget" command became true, but this was not very feasible because the timing is hard to control and the cursor may be different in different cases.

I also thought to update hold_radius for eyejoytrack() to be hold_radius + cursor_radius, but I could not find a way to access the information of the cursor to get its radius.

2. For the summary figure occurs when all trials are finished, is there a way to update summary figure after each trial and display it all the time while proceeding each trials?

Any suggestions?
Attachments:
open | download - Image_1 2019-08-29_01-35-06.jpg (177.3 KB)
Re: Overlapping Problem and Summary Figure
August 29, 2019 09:39AM
1. You set the size of joystick cursors on the main menu. Since its unit is pixels, you can divide it by pixels per degree to convert it to visual degrees. Both cursor size and pixels per degree are shown on the main menu, so you can copy them from there. Or you can retrieve them from MLConfig, like the following.
cursor_size_in_degrees = MLConfig.JoystickCursorSize(1) / Screen.PixelsPerDegree;

2. See the manual of the user plot function.
https://monkeylogic.nimh.nih.gov/docs_MainMenu.html#Task
Re: Overlapping Problem and Summary Figure
August 29, 2019 10:37AM
Hi Jaewon,

Thank you so much for your help! The first question was solved perfectly!

I am having some trouble using "user plot function" feature. Can you give an example about how to use it?
Re: Overlapping Problem and Summary Figure
August 29, 2019 01:44PM
Please explain what trouble you are having.
Re: Overlapping Problem and Summary Figure
August 29, 2019 02:48PM
I tried to use a function file test.m like:

function test
plot( TrialRecord.CurrentTrialNumber, TrialRecord.ReactionTimes)
end

But when I ran the program it gave an error after I selected this file as user plot function.
Re: Overlapping Problem and Summary Figure
August 29, 2019 03:40PM
Type 'doc function' on the MATLAB command window and see how to write a function. You didn't provide input to the function.

function userplot(TrialRecord)

end
Re: Overlapping Problem and Summary Figure
September 03, 2019 10:00AM
Hi Jaewon,

Thank you for the correction, and I am sorry for the confusion.

It seems that what the user plot function modifies is the figure at the bottom-right corner in the window of MGL control screen, but I am trying to display the summary separately from this window just like when the task ends, the behaviorsummary shows. I am trying to display behaviorsummary window all the time since the task begins so I can monitor it in the progress. Is it possible? I tried behaviorsummary('data_file_name'), and although this works for the command line it does not work when I put it into the timing script or user plot function.

Or if it cannot be separated, how can I plot the behaviorsummary figure along with the task information it shows into the control window?
Re: Overlapping Problem and Summary Figure
September 03, 2019 12:04PM
Anything is possible, if you program it right, but I am not teaching how to do MATLAB programming here. You are supposed to learn it yourself.

During the experiment, you are still creating the data file and should not try to read it. Write your own performance evaluation script with the information available from TrialRecord.
https://monkeylogic.nimh.nih.gov/docs_TrialRecordStructure.html
Re: Overlapping Problem and Summary Figure
September 03, 2019 12:33PM
Thanks, while I was trying to use a second monitor to show the subject screen if I move the control panel in my main screen, the program crashed for a few minutes and then worked again. I assume it was some problem because of DirectX, but is there a way to fix that?
Re: Overlapping Problem and Summary Figure
September 03, 2019 02:26PM
What do you mean by "crashed"? Did the MATLAB window shut down? Please describe the symptom in detail with exact words.

You might think it was crashed, but maybe it wasn't. NIMH ML does not move the control screen in the middle of a trial, to avoid task interruption and geometry change. If you drag the figure frame during a trial, the "replica" window moves to the new location after the current trial is finished. If that was the issue, there is nothing to fix.

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.