region of interest mouse click response and if statements using psychtoolbox-3
2 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
Srimouli Rukmabhatla
2020 年 3 月 26 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image display and manipulation についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!