Changeset 88


Ignore:
Timestamp:
May 9, 2010, 10:40:18 AM (11 years ago)
Author:
sommeria
Message:

plot_field: test for multicomponent image (-> errormsg)
creat_grid: possibility of changing the figure name (for detect_grid)
geometry_calib: detect_grid improved (range of search adjusted from grid mesh)

bug repaired in translate points

uvmat: bug repair: dela with the case with several get_field GUI opened

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/create_grid.m

    r60 r88  
    3434%------------------------------------------------------------------------
    3535% --- Executes just before create_grid is made visible.
    36 function create_grid_OpeningFcn(hObject, eventdata, handles,input_grid)
     36function create_grid_OpeningFcn(hObject, eventdata, handles,input_grid,name)
    3737%------------------------------------------------------------------------
    3838% This function has no output args, see OutputFcn.
     
    4141handles.output = 'Cancel';
    4242
     43if exist('name','var') && ischar(name)
     44    set(hObject,'name',name)
     45end
    4346% Update handles structure
    4447guidata(hObject, handles);
  • trunk/src/geometry_calib.m

    r84 r88  
    954954    grid_input=CalibData.grid;%retrieve the previously used grid
    955955end
    956 [T,CalibData.grid]=create_grid(grid_input);%display the GUI create_grid
     956[T,CalibData.grid]=create_grid(grid_input,'detect grid');%display the GUI create_grid
    957957set(handles.geometry_calib,'UserData',CalibData)%store the phys grid for later use
    958958
     
    10121012%Amax=max(max(Amod))
    10131013%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
     1014Dx=(Rangx(2)-Rangx(1))/(npxy(2)-1); %x mesh in real space
     1015Dy=(Rangy(2)-Rangy(1))/(npxy(1)-1); %y mesh in real space
     1016ind_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
     1017ind_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
    10151018nbpoints=size(T,1);
    10161019for ipoint=1:nbpoints
    1017     Dx=(Rangx(2)-Rangx(1))/(npxy(2)-1); %x mesh in real space
    1018     Dy=(Rangy(2)-Rangy(1))/(npxy(1)-1); %y mesh in real space
    10191020    i0=1+round((T(ipoint,1)-Rangx(1))/Dx);%round(Xpx(ipoint));
    10201021    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);
    10221023    x_profile=sum(Asub,1);
    10231024    y_profile=sum(Asub,2);
     
    10271028    x_shift=0;
    10281029    y_shift=0;
    1029     if ind_x_max+2<=2*ind_range+1 && ind_x_max-2>=1
     1030    if ind_x_max+2<=2*ind_range_x+1 && ind_x_max-2>=1
    10301031        Atop=x_profile(ind_x_max-2:ind_x_max+2);
    10311032        x_shift=sum(Atop.*[-2 -1 0 1 2])/sum(Atop);
    10321033    end
    1033     if ind_y_max+2<=2*ind_range+1 && ind_y_max-2>=1
     1034    if ind_y_max+2<=2*ind_range_y+1 && ind_y_max-2>=1
    10341035        Atop=y_profile(ind_y_max-2:ind_y_max+2);
    10351036        y_shift=sum(Atop.*[-2 -1 0 1 2]')/sum(Atop);
    10361037    end
    1037     Delta(ipoint,1)=(x_shift+ind_x_max-ind_range-1)*Dx;%shift from the initial guess
    1038     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;
    10391040end
    10401041Tmod=T(:,(1:2))+Delta;
     
    10781079end
    10791080Tabchar=cell2tab(Coord,'    |    ');
    1080 Tabchar=[Tabchar {'.....'}];
     1081Tabchar=[Tabchar; {'.....'}];
    10811082%set(handles.ListCoord,'Value',1)
    10821083set(handles.ListCoord,'String',Tabchar)
  • trunk/src/plot_field.m

    r85 r88  
    698698    % distinguish B/W and color images
    699699    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
    701715    %set the color map
    702     if siz(2)==2 %for black and white images
     716    if siz==2 %for black and white images
    703717        if ~isfield(PlotParam.Scalar,'AutoScal')
    704718            PlotParam.Scalar.AutoScal=0;%default
     
    781795            end
    782796        end
    783     elseif siz(2)==3 %color images
     797    else %color images
    784798        axes(haxes)
    785799        B=uint8(A);
     
    832846    test_ima=1;
    833847    %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)
    835849        if isempty(hcol)|~ishandle(hcol)
    836850             hcol=colorbar;%create new colorbar
  • trunk/src/uvmat.m

    r87 r88  
    22392239        if isequal(FieldName,'get_field...')% read the field names on the interface get_field.
    22402240            %VelType=get(handles.Fields,'UserData');
    2241             hget_field=findobj(allchild(0),'Name','get_field');%find the get_field... GUI
     2241            hget_field=findobj(allchild(0),'Name','get_field')%find the get_field... GUI
    22422242            if isempty(hget_field)
    22432243                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);
    22442247            end
    22452248            hhget_field=guidata(hget_field);
Note: See TracChangeset for help on using the changeset viewer.