I have created a small GUI to enable editing of ROIs in MR datasets with multiple frames and slices. Inside the GUI I use impoly, imrect or imellipse to draw ROIs.
I would like to be able to return a drawn ROI to the commandline e.g.: roi=guifunction(image);
inside the GUI I have uncommented uiwait(handles.figure1); and execution stops while my GUI is running untill I draw the first ROI. It seems as if impoly and other im... functions resumes the commandline and returns the ROIs to early.
Is there some way of avoiding this?
I also tried h=impoly(handles.axes); pos=wait(h); but this only makes it possible to edit the ROI. As soon as I doubleclick the ROI to "close" it the gui returns the outputs I have selected.