roipoly causing image to disappear

1 view (last 30 days)
mike
mike on 9 Feb 2012
I've got a GUIDE gui with a number of panels in it. Each panel contains a few axes, which are loaded with images. I'm trying to call roipoly to select a group of pixels from one of these images, but when I call roipoly, the image disappears. I can then select a polygon as expected, but I'm selecting on a blank area where the image used to be.
I haven't gotten into what's going to happen next, but eventually I will want to accumulate the pixels that have been selected from multiple images over multiple selection processes, and run them through some equations (if that's relevant).
Here's the meat of the code, taken out of context:
The image loading function, which loads the images at the start, then reloads them when a scrollbar is manipulated, and also sets the click callback function:
global panels;
global images;
ax = get(panels(arrayIndex), 'children');
imageHandle = imshow(images{arrayIndex}, 'parent', ax(length(ax)));
set(imageHandle, 'buttondownfcn', @imageClick);
The click callback function which calls roipoly:
function imageClick(hObject, eventdata, handles)
BW = roipoly(hObject);

Answers (0)

Categories

Find more on Visual Exploration in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!