MATLAB Answers

Johan
0

Problem with loading a fig file containing IMROI's (and ancestor handles?)

Asked by Johan
on 6 May 2014
Hello Everyone,
I created a GUI that which saves its setting by saving as a .fig file (hgsave or savefig). However Im noticing a weird error where if the figure in the GUI contains any IMROI objects (such as imellipse) then after reloading the figure (hgload or loadfig) then I can no longer use any Imroi functions in that figure (I cant create/delete imroi objects or use their functions). The error that I get is 'Error using hittest Invalid object handle'. I have done some digging around and found that there is a crucial line in ellipseSymbol: h_fig = iptancestor(h_axes,'figure'); Where (Im guessing)it gets an invalid handle of the 'original' figure that created it (before reloading). If I change this line to h_fig = gcf; then it works just fine.
I cannot find any documentation on this iptancestor property and therefore am at a loss how to fix this.
Can anybody help me along with this? Is there maybe a way to 'reset' this ancestor property? Any help is appreciated

  0 Comments

Sign in to comment.

0 Answers