function changeScale(linRequest) % function changeScale(linRequest) % % changes the scale of the image pixels depending on user request, and displays new image % % Input % linRequest: the requested change (1 = linear, 0 = logarithmic) global im linScale orig_axis cont marks mark_handles select_status; if (linScale & (~linRequest)) % requested linear to logarithmic im = log(im); axes(orig_axis); imagesc(im); axis xy; axis image; if (cont) cont = 0; changeLines(1); end [numMarks, foo] = size(marks); mark_handles = []; for i = 1 : numMarks r = rectangle('Curvature', [1, 1], 'Position', [marks(i,1), marks(i,2), 1, 1], 'FaceColor', 'g', 'LineWidth', 1); mark_handles = [mark_handles; r]; end linScale = 0; end if ((~linScale) & linRequest) % requested logarithmic to linear im = exp(im); axes(orig_axis); imagesc(im); axis xy; axis image; if (cont) cont = 0; changeLines(1); end [numMarks, foo] = size(marks); mark_handles = []; for i = 1 : numMarks r = rectangle('Curvature', [1, 1], 'Position', [marks(i,1), marks(i,2), 1, 1], 'FaceColor', 'g', 'LineWidth', 1); mark_handles = [mark_handles; r]; end linScale = 1; end if (select_status == 1) title('Choose points on first boundary by left-clicking, then hit enter'); elseif (select_status == 2) title('Choose points on second boundary by left-clicking, then hit enter'); else title('Choose points on third boundary by left-clicking, then hit enter'); end