Changeset 149 for trunk


Ignore:
Timestamp:
Dec 1, 2010, 4:49:57 PM (14 years ago)
Author:
sommeria
Message:

correction of bugs in geometry_calib , point editing and display

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/geometry_calib.m

    r148 r149  
    871871function update_list(hObject, eventdata, handles)
    872872%------------------------------------------------------------------------
    873 str4=get(handles.XImage,'String');
    874 str5=get(handles.YImage,'String');
    875 str1=get(handles.XObject,'String');
    876 tt=double(str1);
    877 str2=get(handles.YObject,'String');
    878 str3=get(handles.ZObject,'String');
    879 if ~isempty(str1) && ~isequal(double(str1),32) && (isempty(str3)||isequal(double(str3),32))
    880     str3='0';%put z to 0 by default
    881 end
    882 strline=[str1 '    |    ' str2 '    |    ' str3 '    |    ' str4 '    |    ' str5];
     873newval(4)=str2double(get(handles.XImage,'String'));
     874newval(5)=str2double(get(handles.YImage,'String'));
     875newval(1)=str2double(get(handles.XObject,'String'));
     876newval(2)=str2double(get(handles.YObject,'String'));
     877newval(3)=str2double(get(handles.ZObject,'String'));
     878if isnan(newval(3))
     879    newval(3)=0;%put z to 0 by default
     880end
    883881Coord=get(handles.ListCoord,'String');
     882Coord(end)=[]; %remove last string '.....'
    884883val=get(handles.ListCoord,'Value');
    885 Coord{val}=strline;
    886 set(handles.ListCoord,'String',Coord)
     884data=read_geometry_calib(Coord);
     885data.Coord(val,:)=newval;
     886for i=1:size(data.Coord,1)
     887    for j=1:5
     888          Coord_cell{i,j}=num2str(data.Coord(i,j),4);%display coordiantes with 4 digits
     889    end
     890end
     891
     892Tabchar=cell2tab(Coord_cell,' | ');
     893Tabchar=[Tabchar ;{'......'}];
     894set(handles.ListCoord,'String',Tabchar)
     895
    887896%update the plot
    888897ListCoord_Callback(hObject, eventdata, handles)
     
    910919end
    911920%fill the edit boxex
    912 set(handles.XObject,'String',coord_str(1:k(1)-5))
    913 set(handles.YObject,'String',coord_str(k(1)+5:k(2)-5))
    914 set(handles.ZObject,'String',coord_str(k(2)+5:k(3)-5))
    915 set(handles.XImage,'String',coord_str(k(3)+5:k(4)-5))
    916 set(handles.YImage,'String',coord_str(k(4)+5:end))
     921set(handles.XObject,'String',coord_str(1:k(1)-1))
     922set(handles.YObject,'String',coord_str(k(1)+3:k(2)-1))
     923set(handles.ZObject,'String',coord_str(k(2)+3:k(3)-1))
     924set(handles.XImage,'String',coord_str(k(3)+3:k(4)-1))
     925set(handles.YImage,'String',coord_str(k(4)+3:end))
    917926h_menu_coord=findobj(huvmat,'Tag','transform_fct');
    918927menu=get(h_menu_coord,'String');
     
    924933end
    925934if isequal(option,'phys')
    926     XCoord=str2num(coord_str(1:k(1)-5));
    927     YCoord=str2num(coord_str(k(1)+5:k(2)-5));
     935    XCoord=str2double(coord_str(1:k(1)-1));
     936    YCoord=str2double(coord_str(k(1)+3:k(2)-1));
    928937elseif isequal(option,'px')|| isequal(option,'')
    929     XCoord=str2num(coord_str(k(3)+5:k(4)-5));
    930     YCoord=str2num(coord_str(k(4)+5:end));
     938    XCoord=str2double(coord_str(k(3)+3:k(4)-1));
     939    YCoord=str2double(coord_str(k(4)+3:end));
    931940else
    932941    msgbox_uvmat('ERROR','the choice in menu_coord of uvmat must be px or phys ')
     
    942951ind_range=max(abs(xlim(2)-xlim(1)),abs(ylim(end)-ylim(1)))/20;%defines the size of the circle marker
    943952if isempty(hhh)
    944     axes(hplot)
     953    set(0,'CurrentFig',huvmat)
     954    set(huvmat,'CurrentAxes',hplot)
    945955    rectangle('Curvature',[1 1],...
    946956              'Position',[XCoord-ind_range/2 YCoord-ind_range/2 ind_range ind_range],'EdgeColor','m',...
Note: See TracChangeset for help on using the changeset viewer.