function thresh_up

% --------------------------
%
% Helper function to artdetect4.  Grabs the saved global data
% from the main figure and extracts the relevant current
% threshold info from the displayed current threshold, then 
% increases the threshold by a small increment, re-calculates
% the outlier list, and redraws the text list and graphical
% outlier display.  No arguments or output, as befits a good
% callback.
% ------------------------------
% Jeff Cooper, Nov. 2002

% -------------------
% Defaults
% -------------------
incr = 0.1;

% -------------------
% Interrogate GUI
% -------------------

handles = guihandles;
g = guidata(gcf);
curr_thresh = str2num(get(handles.threshnum, 'String'));

% -------------------
% Main action
% -------------------

%keyboard;

new_thresh = curr_thresh + incr;

out_idx = (find(abs(zscore(g)) > new_thresh))';

% Update text
set(handles.threshnum, 'String', num2str(new_thresh));

% Update edit text box
set(handles.indexedit, 'String', int2str(out_idx));

% Update graphics
subplot(5,1,2);
cla;
plot(abs(zscore(g)));
ylabel('std away from mean');

thresh_x = 1:length(g);
thresh_y = new_thresh*ones(1,length(g));
line(thresh_x, thresh_y, 'Color', 'r');

axes_lim = get(gca, 'YLim');
axes_height = axes_lim(1):1:axes_lim(2);
for i = 1:length(out_idx)
    line((out_idx(i)*ones(1, length(axes_height))), axes_height, 'Color', 'r');
end


