%  @Copyright Reserved 
%  For non-commercial use, please cite the following papers:
%  LQ Wan, K Ronaldson, M Park, G Taylor, Y Zhang, JM Gimble, and G Vunjak-Novakovic, 2011. Micropatterned Mammalian Cells Exhibit Phenotype-Specific Left-Right Asymmetry, Proceedings of National Academy of Sciences, 108(30), pp. 12295-300.
%  H Zhang, K Ronaldson-Bouchard, G Vunjak-Novakovic, and LQ Wan, A Micropatterning Assay For Measuring Cell Chirality.
%  For any questions, please contact Dr. Leo Wan at wanq@rpi.edu. Thank you!

close all;
clear all;

dirx='/Users/SECTION_VI/Desktop/LAB/Data/1';
x=dir([dirx '/*.tif'])

for i=1:1:length(x)
    
        disp(i);
        filename=[dirx '/' x(i).name];
        filename_out=[filename(1:(findstr(filename, '.')-1)), '.mat'];  
        image=imread(filename);
        figure, imshow(image);
        h = imrect(gca, [160 160 800 800]);  %%%% change here if necessary image size changes
        position=wait(h);
        save(filename_out, 'position'); 
        close all;
      
       
end
 fprintf('done!/n');
