- Timestamp:
- May 9, 2010, 10:40:18 AM (15 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/create_grid.m
r60 r88 34 34 %------------------------------------------------------------------------ 35 35 % --- Executes just before create_grid is made visible. 36 function create_grid_OpeningFcn(hObject, eventdata, handles,input_grid )36 function create_grid_OpeningFcn(hObject, eventdata, handles,input_grid,name) 37 37 %------------------------------------------------------------------------ 38 38 % This function has no output args, see OutputFcn. … … 41 41 handles.output = 'Cancel'; 42 42 43 if exist('name','var') && ischar(name) 44 set(hObject,'name',name) 45 end 43 46 % Update handles structure 44 47 guidata(hObject, handles); -
trunk/src/geometry_calib.m
r84 r88 954 954 grid_input=CalibData.grid;%retrieve the previously used grid 955 955 end 956 [T,CalibData.grid]=create_grid(grid_input );%display the GUI create_grid956 [T,CalibData.grid]=create_grid(grid_input,'detect grid');%display the GUI create_grid 957 957 set(handles.geometry_calib,'UserData',CalibData)%store the phys grid for later use 958 958 … … 1012 1012 %Amax=max(max(Amod)) 1013 1013 %image(Rangx,Rangy,uint8(255*Amod/Amax)) 1014 ind_range=10;% range of search of image ma around each point obtained by linear interpolation from the marked points 1014 Dx=(Rangx(2)-Rangx(1))/(npxy(2)-1); %x mesh in real space 1015 Dy=(Rangy(2)-Rangy(1))/(npxy(1)-1); %y mesh in real space 1016 ind_range_x=ceil(GeometryCalib.R(1,1)*CalibData.grid.Dx/3)% range of search of image ma around each point obtained by linear interpolation from the marked points 1017 ind_range_y=ceil(GeometryCalib.R(2,2)*CalibData.grid.Dy/3)% range of search of image ma around each point obtained by linear interpolation from the marked points 1015 1018 nbpoints=size(T,1); 1016 1019 for ipoint=1:nbpoints 1017 Dx=(Rangx(2)-Rangx(1))/(npxy(2)-1); %x mesh in real space1018 Dy=(Rangy(2)-Rangy(1))/(npxy(1)-1); %y mesh in real space1019 1020 i0=1+round((T(ipoint,1)-Rangx(1))/Dx);%round(Xpx(ipoint)); 1020 1021 j0=1+round((T(ipoint,2)-Rangy(1))/Dy);%round(Xpx(ipoint)); 1021 Asub=Amod(j0-ind_range :j0+ind_range,i0-ind_range:i0+ind_range);1022 Asub=Amod(j0-ind_range_y:j0+ind_range_y,i0-ind_range_x:i0+ind_range_x); 1022 1023 x_profile=sum(Asub,1); 1023 1024 y_profile=sum(Asub,2); … … 1027 1028 x_shift=0; 1028 1029 y_shift=0; 1029 if ind_x_max+2<=2*ind_range +1 && ind_x_max-2>=11030 if ind_x_max+2<=2*ind_range_x+1 && ind_x_max-2>=1 1030 1031 Atop=x_profile(ind_x_max-2:ind_x_max+2); 1031 1032 x_shift=sum(Atop.*[-2 -1 0 1 2])/sum(Atop); 1032 1033 end 1033 if ind_y_max+2<=2*ind_range +1 && ind_y_max-2>=11034 if ind_y_max+2<=2*ind_range_y+1 && ind_y_max-2>=1 1034 1035 Atop=y_profile(ind_y_max-2:ind_y_max+2); 1035 1036 y_shift=sum(Atop.*[-2 -1 0 1 2]')/sum(Atop); 1036 1037 end 1037 Delta(ipoint,1)=(x_shift+ind_x_max-ind_range -1)*Dx;%shift from the initial guess1038 Delta(ipoint,2)=(y_shift+ind_y_max-ind_range -1)*Dy;1038 Delta(ipoint,1)=(x_shift+ind_x_max-ind_range_x-1)*Dx;%shift from the initial guess 1039 Delta(ipoint,2)=(y_shift+ind_y_max-ind_range_y-1)*Dy; 1039 1040 end 1040 1041 Tmod=T(:,(1:2))+Delta; … … 1078 1079 end 1079 1080 Tabchar=cell2tab(Coord,' | '); 1080 Tabchar=[Tabchar {'.....'}];1081 Tabchar=[Tabchar; {'.....'}]; 1081 1082 %set(handles.ListCoord,'Value',1) 1082 1083 set(handles.ListCoord,'String',Tabchar) -
trunk/src/plot_field.m
r85 r88 698 698 % distinguish B/W and color images 699 699 np=size(A);%size of image 700 siz=size(np); 700 siz=numel(np); 701 if siz>3 702 msgbox_uvmat('ERROR','unrecognized scalar type ') 703 return 704 end 705 if siz==3 706 if np(3)==1 707 siz=2;%B W image 708 elseif np(3)==3 709 siz=3;%color image 710 else 711 msgbox_uvmat('ERROR',['unrecognized scalar type: ' num2str(np(3)) ' color components']) 712 return 713 end 714 end 701 715 %set the color map 702 if siz (2)==2 %for black and white images716 if siz==2 %for black and white images 703 717 if ~isfield(PlotParam.Scalar,'AutoScal') 704 718 PlotParam.Scalar.AutoScal=0;%default … … 781 795 end 782 796 end 783 else if siz(2)==3%color images797 else %color images 784 798 axes(haxes) 785 799 B=uint8(A); … … 832 846 test_ima=1; 833 847 %display the colorbar code for B/W images if Poscolorbar not empty 834 if siz (2)==2 & exist('PosColorbar','var')& ~isempty(PosColorbar)848 if siz==2 & exist('PosColorbar','var')& ~isempty(PosColorbar) 835 849 if isempty(hcol)|~ishandle(hcol) 836 850 hcol=colorbar;%create new colorbar -
trunk/src/uvmat.m
r87 r88 2239 2239 if isequal(FieldName,'get_field...')% read the field names on the interface get_field. 2240 2240 %VelType=get(handles.Fields,'UserData'); 2241 hget_field=findobj(allchild(0),'Name','get_field') ;%find the get_field... GUI2241 hget_field=findobj(allchild(0),'Name','get_field')%find the get_field... GUI 2242 2242 if isempty(hget_field) 2243 2243 hget_field= get_field(filename);%open the get_field GUI 2244 end 2245 if numel(hget_field)>1%case of several get_field GUI 2246 hget_field=hget_field(1); 2244 2247 end 2245 2248 hhget_field=guidata(hget_field);
Note: See TracChangeset
for help on using the changeset viewer.