region of interest mouse click response and if statements using psychtoolbox-3
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi All,
I'm wondering how I can specify a region of interest on an image using Psychtoolbox-3. I need the ROI to be invisible to the user. I would like the user to make a left mouse click and then use an if statement (that depends on whether they clicked inside or outside of the ROI) to determine what happens next. PLEASE HELP!!
I currently have this, but it's not working (i'm not even sure if the load function is calling the roi back):
%I used drawrectangle to make an roi on an image and then saved it to roi.mat
load('roi.mat')
[clicks,x,y,WhichButton] = GetClicks;
if inROI(roi,x,y)
texture = Screen('MakeTexture', windowPtr, YouWon);
Screen('DrawTexture', windowPtr, texture);
Screen('Flip', windowPtr);
WaitSecs(1);
else
texture = Screen('MakeTexture', windowPtr, TryAgain);
Screen('DrawTexture', windowPtr, texture);
Screen('Flip', windowPtr);
WaitSecs(1);
end
0 comentarios
Respuestas (1)
Srimouli Rukmabhatla
el 26 de Mzo. de 2020
Hi Rubina,
Please do ensure that the required variables are loaded in ‘roi.mat’ file . inROI function is to check the given co-ordinates are within the Region Of Interest, If co-ordinates are within the ROI it return 1 else it return 0 .Please do refer the inROI doucumentaion link https://www.mathworks.com/help/images/ref/inroi.html.
0 comentarios
Ver también
Categorías
Más información sobre Image display and manipulation en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!