source: trunk/src/series/lumin_calib.m @ 691

Last change on this file since 691 was 647, checked in by sommeria, 11 years ago

bug corrected in time_series, LIF functions introduced (but not in operation)

File size: 3.0 KB
Line 
1% 'lumin_cali': check the luminosity of the camera lens versus distance to image center
2%----------------------------------------------------------------------
3
4function input_list=lumin_calib (num_i1,num_i2,num_j1,num_j2,Series)
5
6%display  request  of input parameters in the series interface (activated directly by the selection in the menu ACTION)
7input_list={'NbSlice';...%nbre of slices
8    'RootPath';... %path to the input root file
9    'RootFile';... %root input file name
10    'FileExt';... %input file extension
11    'NomType';...%type of file indexing
12    'SubDir';...% subdirectory of derived files (PIV fields)
13    };
14
15if ~exist('num_i1','var')
16    return %  used to display the right input data from input_list when the function is selected
17end
18for ilist=1:length(input_list)
19    eval([input_list{ilist} '= Series.' input_list{ilist} ';'])
20end
21
22%-----------------------------------------------------------------
23
24hRUN=findobj(Series.hseries,'Tag','RUN');
25hwaitbar=findobj(Series.hseries,'Tag','waitbar');
26waitbarpos(1)=Series.WaitbarPos(1);%x position of the waitbar
27waitbarpos(3)=Series.WaitbarPos(3);% width of the waitbar
28siz=size(num_i1);
29
30
31xpos(1:10)=[297 297 297 314 316 310 310 310 312 325];
32ypos(1:10)=[818 818 818 817 822 820 820 820 813 799];
33xpos(11:30)=[364 403 448 479 522 586 613 630 626 581 514 470 380 328 292 292 292 292 292 299];
34ypos(11:30)=[733 673 604 558 504 405 357 339 337 409 509 570 701 789 845 845 845 845 845 836];
35xpos(31:49)=[353 273 269 269 269 269 269 270 270 270 270 270 270 270 270 268 268 264 216 ];
36ypos(31:49)=[748 875 883 883 883 883 883 888 888 888 888 888 888 888 888 888 888 885 959];
37radius=50;
38Abackground=58.6;
39
40filebase=fullfile(Series.RootPath{1},Series.RootFile{1});
41dir_images=Series.RootPath{1};
42nom_type=Series.NomType{1};
43% filebad=zeros(size(num_i1));
44indbad=[21 22 30];%bad image
45file_index= 1:length(num_i1);
46ifile=0;
47for ifile= 1:length(num_i1)
48               [filename,idetect]=...
49                       name_generator(filebase,num_i1(ifile),num_j1(ifile),Series.FileExt{1},Series.NomType{1});
50                 
51               A=imread(filename);
52               A=flipdim(A,1);
53               ind_x=[xpos(ifile)-radius:xpos(ifile)+radius];
54               ind_y=[ypos(ifile)-radius:ypos(ifile)+radius];
55               A=double(A(ind_y,ind_x))-Abackground;
56               [Xi,Yi]=meshgrid([-radius:+radius],[-radius:+radius]);
57%                distX=(Xi+radius+1);
58%                distY=(Yi+radius+1);
59               testin=(Xi.*Xi+Yi.*Yi)<=radius*radius;
60               testin=double(testin);
61               A=(A>0).*A.*double(testin);
62               Amean(ifile)=sum(sum(A))/sum(sum(testin));
63               
64end
65dist=((xpos-512).*(xpos-512))+((ypos-512).*(ypos-512));
66dist=dist/(512*512);
67file_index(indbad)=[];
68Amean(indbad)=[];
69dist(indbad)=[];
70figure(1)   
71plot(file_index,Amean,'+')   
72figure(2)
73haxes=axes;
74h=plot(dist,Amean,'+')
75xlabel('distance to image center (pixels)')
76ylabel('luminosity of reference  input dye solution')
77set(haxes,'YLim',[0 2850])
Note: See TracBrowser for help on using the repository browser.