handles.ch = round(get(handles.Channel_slider, 'Value'));set(handles.Channel_slider, 'Value', handles.ch);
handles.z = round(get(handles.Z_slider, 'Value'));set(handles.Z_slider, 'Value', handles.z);

set(handles.Channel_disp, 'String', [num2str(handles.ch), '/', num2str(handles.data.NumberOfChannel)]);
set(handles.Z_disp, 'String', [num2str(handles.z), '/', num2str(size(handles.data.Image{handles.channel}, 3))]);

Ylim = get(handles.axes1, 'Ylim'); Xlim = get(handles.axes1, 'Xlim');

axes(handles.axes1); imagesc(handles.data.Image{handles.ch}(:, :, handles.z));
if handles.surface_flag,
    hold on; plot(handles.axes1, handles.x_surface, handles.y_surface, 'r-*','linewidth', 3);
    if handles.mesoderm_id(1) ~= -1,
        id1 = min(handles.mesoderm_id);id2 = max(handles.mesoderm_id);
        plot(handles.axes1, handles.x_surface(id1:id2), handles.y_surface(id1:id2), 'g-*', 'linewidth', 4);
    else
        plot(handles.axes1, handles.x_surface, handles.y_surface, 'r-*', 'linewidth', 3);
    end
    hold off;
else
    hold on; plot(handles.axes1, [1,1], [1,1024], 'r-*','linewidth', 3);
    plot(handles.axes1, [1,1], [1,1024], 'r-*', 'linewidth', 3);
    hold off;
end
axis([Xlim, Ylim]);axis off;
handles.x_surface = [1,1];
    handles.y_surface = [1,1024];