I have developed a Gui using Guide for medical image data analysis. When I put breakpoints to check each line of the code, I get some wired problems.
In Brief,
There is a pushbutton and whenever the user clicks it, a ROI is drawn on the image. there is a counter that counts the number of ROIs drawn and differentiates between them by assigning a unique tag to each plot object. I have assigned windows button motion and UIcontext menu to each plot object. So that the user can drag the ROI using the mouse and place it in the location of interest and also the user can rename or delete an already drawn ROI. The number of the ROIs present depends on the number of the time the user clicks the pushbutton.
I put some break points in the rename callback function (uicontext menu) to check the functionality of the code and this is where the handles structure gets updated in a strange manner. Let's say, there are 5 ROIs in the image (each ROI object has a unique tag specified by a counter), when the user selects for example the 2nd ROI, the handles structure only shows the first 2 plot objects, if the user selects the 4th ROI, the handles structure only shows the first 4 plot objects and so on.
This results in the handles structure to get updated strangely and not properly.
I have hard time understanding what is going on.
I hope I have explained my problem clearly.
Here is the code I have written. Sorry in advance it is a long code:
Best Answer