Unable to display cropped image in the image axes properly
Show older comments
Hi,
I have a Matlab GUI where I load two sets of images in 2 separate image axes. I use a Slider to browse through the images simultaneously. Images displayed in image axes 1 are the original images. Images displayed in image axes 2 are the segmented images. I use a CROP button which would crop the image in image axes1 and display the resultant image in image axes 2 thus overriding the previously saved segmented image in image axes2. However, when I click the CROP button, the resultant image is displayed in Image axes 1 instead of being shown in image axes2. Please note that the CROP button uses the drawfreehand() function which crops the image displayed in image axes 1 manually. Any suggestions would be appreciated.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
handles = guidata(hObject);
seg=handles.seg;
value=handles.value;
corr_image = handles.InputImage;
hr=corr_image{value};
MM=drawfreehand(handles.axes1);
M = MM.createMask();
imshow(imcrop(M),'parent',handles.axes2);
handles.seg{value}=seg;
guidata(hObject, handles);
h1 = msgbox('Finished correction images');
uiwait(h1,1)
close (h1)
end
Accepted Answer
More Answers (0)
Categories
Find more on Interactive Control and Callbacks 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!