MATLAB: Imshow inhibits gui from running minimized

imshow minimized refresh foreground

I have an question concerning the imshow command for GUI. I am processing a lot images and wanted to display the current image using the axes feature. It works fine, only that the whole window gets refreshed everytime a new image is processed. Thats why i can't minimize the window which stays always in the foreground.
What could i do to avoid this?
Code looks like this: It reads some images, does the processing and safes them afterwards.
function execute_Callback(hObject, eventdata, handles)
global filenames
global path
for i=1:length(filenames)
nfilename2=[path,filenames{i}];
pic = imread(nfilename2);
axes(handles.axes1);
imshow(pic);
end
Thank you!

Best Answer

Specify the parent for imshow to plot to inside of imshow, rather than as axes(handles.axes1)
ax = gca;
imshow('cameraman.tif')
Hide figure
imshow('peppers.png','parent',ax)
Related Question