%% add path to functions %addpath \\Munin\Data\Programs\User_Scripts\petty\matlab\ addpath ~/net/munin/data/Programs/User_Scripts/petty/matlab/ %% full path to your text file, which contains images ( also full path ) fileList = textread('file_names.txt','%s'); %read in list XML.rois = {}; %create empty XML outName = 'my_output.xml'; %name of output .xml with all ROIs ( file will overwrite on each save ) %screen resolution of task display xRes = 1024; yRes = 768; scrSize = [ xRes yRes ]; imgIDX = 0; %leave 0 to start at first image figUD = struct('imgIDX',imgIDX,'XML',XML); %loop that finds images imgs = {}; for file=1:length(fileList) [path name ext] = fileparts(fileList{file}); imgs{file} = struct('fname',[name ext],'fpath',fileList{file}); end %% this opens the drawing window and runs functions: do not edit %% fscreen = repmat(uint8(0),[scrSize(2),scrSize(1),3]); axes_h = axes; imshow(fscreen,'Parent',axes_h,'InitialMagnification',100,'Border','tight'); text(10,60,{'i - image','e - ellipse','r - rectangle','s - save','q - quit' },'HorizontalAlignment','left','BackgroundColor',[.5 .5 .5],'Color',[1 1 1]); figH = gcf; set(figH,'Toolbar','none','Resize','off'); set(figH,'UserData',figUD); hold on; % calls the functions set(figH,'KeyPressFcn','imgROI_keyfcn(gcbo,axes_h,imgs,scrSize,outName)');