Borrar filtros
Borrar filtros

How to handle imroi in gui?

1 visualización (últimos 30 días)
Seombeom Kim
Seombeom Kim el 29 de Mayo de 2013
Hello guys, I've been trying to make image processing gui tool.
In the gui there's image display window and functioning button's.
By the way, I planted a button that functioning imline, imrect and imfreehand in the gui.
So far I had no problem. But after I've made several line or rectangle, I needed to erase some of them.
At this very point, I have no Idea about how to handle these figure I've already made.
I just want to certain selected one to be erased by 'delete' button.
How can I break through this problem? :(

Respuestas (1)

David Sanchez
David Sanchez el 31 de Mayo de 2013
You can use the following function to undo the last n plotting operations:
function undo_plot(h, n)
% UNDO_PLOT Undo last 'n' plotting operations.
if nargin == 1
n = 1;
end
if n < 1
error('Can''t undo < 1 plotting operation!');
end
figure(h);
children = get(gca, 'children');
for i = 1 : n
delete(children(i));
end
  2 comentarios
David Sanchez
David Sanchez el 31 de Mayo de 2013
example of use:
plot([1,1],[2,3]) % plot vertical line hold on plot([0,2],[2,5]) % plot another line undo_plot(1,1) % delete last line and plot returns to its first layout
Seombeom Kim
Seombeom Kim el 8 de Jun. de 2013
Thank you for your opinion. But I'm afraid, my intention is not to erase lastly created IMROI. I want erase arbitrary one out of several IMROIs. Anyway, I appreciate your kind proposal. Thanks.

Iniciar sesión para comentar.

Categorías

Más información sobre Interactive Control and Callbacks 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!

Translated by