- Timestamp:
- Dec 1, 2010, 4:49:57 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/geometry_calib.m
r148 r149 871 871 function update_list(hObject, eventdata, handles) 872 872 %------------------------------------------------------------------------ 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]; 873 newval(4)=str2double(get(handles.XImage,'String')); 874 newval(5)=str2double(get(handles.YImage,'String')); 875 newval(1)=str2double(get(handles.XObject,'String')); 876 newval(2)=str2double(get(handles.YObject,'String')); 877 newval(3)=str2double(get(handles.ZObject,'String')); 878 if isnan(newval(3)) 879 newval(3)=0;%put z to 0 by default 880 end 883 881 Coord=get(handles.ListCoord,'String'); 882 Coord(end)=[]; %remove last string '.....' 884 883 val=get(handles.ListCoord,'Value'); 885 Coord{val}=strline; 886 set(handles.ListCoord,'String',Coord) 884 data=read_geometry_calib(Coord); 885 data.Coord(val,:)=newval; 886 for 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 890 end 891 892 Tabchar=cell2tab(Coord_cell,' | '); 893 Tabchar=[Tabchar ;{'......'}]; 894 set(handles.ListCoord,'String',Tabchar) 895 887 896 %update the plot 888 897 ListCoord_Callback(hObject, eventdata, handles) … … 910 919 end 911 920 %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))921 set(handles.XObject,'String',coord_str(1:k(1)-1)) 922 set(handles.YObject,'String',coord_str(k(1)+3:k(2)-1)) 923 set(handles.ZObject,'String',coord_str(k(2)+3:k(3)-1)) 924 set(handles.XImage,'String',coord_str(k(3)+3:k(4)-1)) 925 set(handles.YImage,'String',coord_str(k(4)+3:end)) 917 926 h_menu_coord=findobj(huvmat,'Tag','transform_fct'); 918 927 menu=get(h_menu_coord,'String'); … … 924 933 end 925 934 if isequal(option,'phys') 926 XCoord=str2 num(coord_str(1:k(1)-5));927 YCoord=str2 num(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)); 928 937 elseif isequal(option,'px')|| isequal(option,'') 929 XCoord=str2 num(coord_str(k(3)+5:k(4)-5));930 YCoord=str2 num(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)); 931 940 else 932 941 msgbox_uvmat('ERROR','the choice in menu_coord of uvmat must be px or phys ') … … 942 951 ind_range=max(abs(xlim(2)-xlim(1)),abs(ylim(end)-ylim(1)))/20;%defines the size of the circle marker 943 952 if isempty(hhh) 944 axes(hplot) 953 set(0,'CurrentFig',huvmat) 954 set(huvmat,'CurrentAxes',hplot) 945 955 rectangle('Curvature',[1 1],... 946 956 '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.