Prohlížeč obrázků funguje tak, že z konzole zavoláte funkci s parametrem adresáře, ve kterém obrázky chcete prohlížet.
function imBrowser(btn,folder) %% Image browser. Shows positions tags. Navigation - click %% mouse - left button for previous image, right button for next image. % % INPUT: % folder ... folder (without end backslash) with files from nanoscope (raw, with tags) to read % OUTPUT: % interactive figure - right mouse click = next image, left mouse click = % previous image % % Example: % imBrowser('', '') - read all image in folder in which script is % % Version: 20130742 1526 v1.1 % global global_file_index; global global_files; global global_folder; global global_file_index_max; global global_figure; if nargin == 2 % init % hide warning about fitting image to screen warning('off', 'Images:initSize:adjustingMag'); clc disp('Init imBrowser.') if (folder(end)=='\') error(['Did you read help? There is "folder (without end backslash)". Do you understand?']) end % set index global_file_index = 1; % set files array if (~exist(folder)) error(['Folder ' folder ' does not exists.']) end global_files = dir([folder '\*.png']); % set global folder global_folder = folder; % set max index global_file_index_max = length(global_files); if (global_file_index_max==0) error(['No images in folder ' folder '.']) end % figure global_figure = figure('Name',['imBrowser: ' global_folder],'NumberTitle','off'); % if we are at the end boundary = 0; else boundary = 0; if nargin == 1 % action after clicking mouse if (strcmp(btn,'alt')) % right mouse click if (global_file_index<global_file_index_max) global_file_index = global_file_index + 1; boundary = 0; else boundary = 1; end end if (strcmp(btn,'normal')) % left mouse click if (global_file_index>2) global_file_index = global_file_index - 1; boundary = 0; else boundary = 1; end end end end if (boundary==1) title('End of files!'); set(global_figure, 'buttondownfcn', 'imBrowser(get(gcf, ''selectiontype''))'); else % show figure file = global_files(global_file_index).name; global_figure = imshow(imread([global_folder '\' file])); % ticks P=get(gca,'position'); Xscale=get(gca,'Xlim'); Yscale=get(gca,'Ylim'); global_figure = axes('Position',P,'Xlim',Xscale,'Ylim',Yscale,'color','none'); % title ttl = sprintf('%s',file); title(ttl); % interactivity set(global_figure, 'buttondownfcn', 'imBrowser(get(gcf, ''selectiontype''))'); axis image; end end % of function
Tento web jsem zakládal na střední, v roce 2008. Je zde hlavně archiv mé tvorby.
Aktuální věci publikuji kvůli úspoře času na Twitter.
Honza
"Náš blahobyt nespočívá v tom, co máme, ale v tom, co nás těší."