how can I use imellipse or other ROIs in a gui axes created by appdesigner?
1 回表示 (過去 30 日間)
古いコメントを表示
I am trying to make a gui with appdesigner having three UIaxes. on one of the axes I intend to make a ROI with imellipse such that later on use its coordinate and size (which will be modified by the user) in order to do some processes on the images shown in other two axes but I am not able to show my ellipse on the axes that I want. My question: are the imrect/imellipse supported in appdesigner gui? and if they are, how can I show the ROI on one of the multiple axes in a UIfigure?
0 件のコメント
回答 (3 件)
Prashant Arora
2017 年 3 月 8 日
Hi Ayyoub,
I don't believe imrect/imellipse are currently supported for Appdesigner.
The following document lists all supported functions.
0 件のコメント
Tim Jackman
2018 年 9 月 24 日
Beginning in 18b, you can parent an axes into a uifigure. This means that it is possible to draw the new ellipse ROI in App Designer as follows:
ax = axes(app.UIFigure); drawellipse(ax);
This page has some more info on current axes support in uifigures:
https://www.mathworks.com/help/matlab/creating_guis/graphics-support-in-app-designer.html
Specific to the new ROIs, context menus and mouse pointers are not currently supported, but the basic interactions should work.
0 件のコメント
Michael Mutersbaugh
2018 年 10 月 5 日
編集済み: Michael Mutersbaugh
2018 年 10 月 5 日
Hi, I ran into this problem as well. A loophole that worked for me was to create a new figure, read the image data into it, and offer the user an ROI prompt on THOSE axes instead. Here's an example from my GUI:
fig = figure;
imshow(app.current_frame,[]); % Image data stored in property, no axes called
set(fig, 'Position', get(0, 'Screensize')); % Fullscreen image
set(fig,'CloseRequestFcn','') % Prevent pop-up from closing
set(fig, 'MenuBar', 'none');
set(fig, 'ToolBar', 'none');
% Need this while loop because mouse events will prematurely exit
% the ROI functions, even with the CloseRequestFcn turned off
roi = [];
while isempty(roi)
switch app.roi_type
case 'Circular'; roi = imellipse();
case 'Rectangle'; roi = imrect();
case 'Freehand'; roi = imfreehand();
end
end
app.masks{end+1} = roi.createMask(); % Binary matrices stored in cell array
delete(fig)
Once you save the masks, you can use them to manipulate your image data before offering it to the uiaxes.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!