function contactsheetmaker
%converts .b16 images from camera into a 'contact sheet' of images

movie_trials=[119:128]%[119:128]
frames_per_trial=3

figure
for i=1:length(movie_trials)
    for j=1:frames_per_trial
       subplot('position',[(j-1)/frames_per_trial,((i-1)/length(movie_trials)),1/frames_per_trial,1/length(movie_trials)])
       lastframethistrial=movie_trials(i)*frames_per_trial;
       frametoshow=lastframethistrial-(frames_per_trial-j);
       if frametoshow<10, frame_num=strcat('000',num2str(frametoshow));
       elseif frametoshow<100,frame_num=strcat('00',num2str(frametoshow));
       elseif frametoshow<1000,frame_num=strcat('0',num2str(frametoshow));
       else error('Too many frames')
       end
       eval([    '[imm,mx,mn]=b16_reader(''movieforpatch20070212T201626_' frame_num '.b16'');'      ])
   end 
end    