How to delete a ROI after having drawn a new one
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello all.
In my program I create a square roi using imrect and impoly, the user has to position, resize and roate it on the image as he sees fit, but when the user resizes and rotate the roi a new one is created... Im having problems erasing the old one from the image. Does anybody has an idea how could I do that?
I already tried a function from Image Analyst -
function ClearLinesFromAxes()
axesHandlesToChildObjects = findobj(gca, 'Type', 'line');
if ~isempty(axesHandlesToChildObjects)
delete(axesHandlesToChildObjects);
end
return; % from ClearLinesFromAxes
but it clears all the image and I already have some other plots on it that shouldn't be erased...
and tried also - set(ROI_Q,'Visible','off')
Thanks
0 commentaires
Réponse acceptée
Matt Kindig
le 25 Fév 2013
Probably the most robust way is to save the handles to imrect/impoly and then delete just that object. Something like this:
hrect = imrect(IMG) % your imrect code here
hpoly = impoly(IMG) % your impoly code here
%and then later when you want to delete it:
delete(hrect);
delete(hpoly);
Plus de réponses (0)
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!