Changeset 660 for trunk


Ignore:
Timestamp:
Jul 5, 2013, 11:15:09 AM (11 years ago)
Author:
sommeria
Message:

a few bugs corrected in geometry_calib

Location:
trunk/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/activate.m

    r627 r660  
    7171        pause(0.2)
    7272    end
    73     if strcmp(get(hObject,'Style'),'axes')
     73    if strcmp(get(hObject,'Type'),'axes')
    7474        mouse_down(hFig,[])
     75        pause(2)
    7576        mouse_up(hFig,[])
     77        drawnow
    7678    else
    7779    BackgroundColor=get(hObject,'BackgroundColor');
  • trunk/src/check_files.m

    r659 r660  
    192192
    193193%% check dates of compilation
    194 currentdir=pwd;
    195 cd(pathuvmat)
    196 list_compile=dir('*.sh');
    197 for ilist=1:numel(list_compile)
    198     mfile=regexprep(list_compile(ilist).name,'.sh$','.m');
    199     if exist(mfile,'file')
    200         datfile=dir(mfile);
    201         if ~isempty(datfile) && isfield(datfile,'datenum') && datfile.datenum>list_compile(ilist).datenum
    202             checkmsg=[checkmsg;{[list_compile(ilist).name ' needs to be updated by compile_functions']}];
    203         end
    204     end
    205 end
    206 cd(currentdir)
    207 
     194% currentdir=pwd;
     195% cd(pathuvmat)
     196% list_compile=dir('*.sh');
     197% for ilist=1:numel(list_compile)
     198%     mfile=regexprep(list_compile(ilist).name,'.sh$','.m');
     199%     if exist(mfile,'file')
     200%         datfile=dir(mfile);
     201%         if ~isempty(datfile) && isfield(datfile,'datenum') && datfile.datenum>list_compile(ilist).datenum
     202%             checkmsg=[checkmsg;{[list_compile(ilist).name ' needs to be updated by compile_functions']}];
     203%         end
     204%     end
     205% end
     206% cd(currentdir)
     207
  • trunk/src/demo_uvmat.m

    r627 r660  
    44% brigtness
    55huvmat=findobj(allchild(0),'Tag','uvmat');
    6 figure(huvmat)
     6uistack(huvmat,'top')
    77activate('uvmat','Scalar','num_MaxA',[],100)
    88activate('uvmat','Scalar','CheckFixScalar',[],0)
  • trunk/src/geometry_calib.m

    r657 r660  
    5050% Edit the above text to modify the response to help geometry_calib
    5151
    52 % Last Modified by GUIDE v2.5 03-Jul-2013 09:23:35
     52% Last Modified by GUIDE v2.5 05-Jul-2013 08:29:07
    5353
    5454% Begin initialization code - DO NOT edit
     
    480480huvmat=findobj(allchild(0),'Tag','uvmat');
    481481hhuvmat=guidata(huvmat);
    482 coord_files=get(handles.coord_files,'String');
     482coord_files=get(handles.ListCoordFiles,'String');
    483483if ischar(coord_files)
    484484    coord_files={coord_files};
     
    487487    coord_files={};
    488488end
    489 %retrieve the calibration points stored in the files listed in the popup list coord_files
     489%retrieve the calibration points stored in the files listed in the popup list ListCoordFiles
    490490x_1=Coord(:,4:5)';%px coordinates of the ref points
    491491nx=str2num(get(hhuvmat.num_Npx,'String'));
     
    551551hhuvmat=guidata(huvmat);
    552552% check_cond=0;
    553 coord_files=get(handles.coord_files,'String');
     553coord_files=get(handles.ListCoordFiles,'String');
    554554if ischar(coord_files)
    555555    coord_files={coord_files};
     
    559559end
    560560
    561 %retrieve the calibration points stored in the files listed in the popup list coord_files
     561%retrieve the calibration points stored in the files listed in the popup list ListCoordFiles
    562562x_1=Coord(:,4:5)';%px coordinates of the ref points
    563563nx=str2num(get(hhuvmat.num_Npx,'String'));
     
    737737        msgbox_uvmat('ERROR',errormsg);
    738738    end
    739     listfile=get(handles.coord_files,'string');
     739    listfile=get(handles.ListCoordFiles,'string');
    740740    if isequal(listfile,{''})
    741741        listfile={outputfile};
     
    743743        listfile=[listfile;{outputfile}];%update the list of coord files
    744744    end
    745     set(handles.coord_files,'string',listfile);
     745    set(handles.ListCoordFiles,'string',listfile);
    746746end
    747747% set(handles.ListCoord,'Value',1)% refresh the display of coordinates
     
    762762function CLEAR_Callback(hObject, eventdata, handles)
    763763%------------------------------------------------------------------------
    764 set(handles.coord_files,'Value',1)
    765 set(handles.coord_files,'String',{''})
     764set(handles.ListCoordFiles,'Value',1)
     765set(handles.ListCoordFiles,'String',{''})
    766766
    767767%------------------------------------------------------------------------
     
    811811
    812812%------------------------------------------------------------------------
    813 % --- Executes on selection change in edit_append.
    814 function edit_append_Callback(hObject, eventdata, handles)
    815 %------------------------------------------------------------------------
    816 choice=get(handles.edit_append,'Value');
     813% --- Executes on selection change in CheckEnableMouse.
     814function CheckEnableMouse_Callback(hObject, eventdata, handles)
     815%------------------------------------------------------------------------
     816choice=get(handles.CheckEnableMouse,'Value');
    817817if choice
    818     set(handles.edit_append,'BackgroundColor',[1 1 0])
     818    set(handles.CheckEnableMouse,'BackgroundColor',[1 1 0])
    819819    huvmat=findobj(allchild(0),'tag','uvmat');
    820820    if ishandle(huvmat)
     
    826826    end
    827827else
    828     set(handles.edit_append,'BackgroundColor',[0.7 0.7 0.7])
     828    set(handles.CheckEnableMouse,'BackgroundColor',[0.7 0.7 0.7])
    829829end
    830830   
     
    918918
    919919%grid in phys space
    920 Coord=get(handles.ListCoord,'String');
    921 val=get(handles.ListCoord,'Value');
    922 data=read_geometry_calib(Coord);
    923 %nbpoints=size(data.Coord,1); %nbre of calibration points
    924 data.Coord(val:val+size(T,1)-1,1:3)=T(end:-1:1,:);%update the existing list of phys coordinates from the GUI create_grid
    925 % for i=1:nbpoints
    926 %    for j=1:5
     920Coord=get(handles.ListCoord,'Data');
     921Coord(1:size(T,1),1:3)=T;%update the existing list of phys coordinates from the GUI create_grid
     922
     923% for i=1:size(data.Coord,1)
     924%     for j=1:5
    927925%           Coord{i,j}=num2str(data.Coord(i,j),4);%display coordiantes with 4 digits
    928 %    end
     926%     end
    929927% end
    930 %update the phys coordinates starting from the selected point (down in the
    931 Coord(end,:)=[]; %remove last string '.....'
    932 for i=1:size(data.Coord,1)
    933     for j=1:5
    934           Coord{i,j}=num2str(data.Coord(i,j),4);%display coordiantes with 4 digits
    935     end
    936 end
    937 
    938 %size(data.Coord,1)
    939 Tabchar=cell2tab(Coord,' | ');
    940 Tabchar=[Tabchar ;{'......'}];
    941 set(handles.ListCoord,'String',Tabchar)
     928set(handles.ListCoord,'Data',Coord)
    942929
    943930% -----------------------------------------------------------------------
     
    946933%------------------------------------------------------------------------
    947934%% read the four last point coordinates in pixels
    948 Coord_cell=get(handles.ListCoord,'String');%read list of coordinates on geometry_calib
    949 data=read_geometry_calib(Coord_cell);
    950 nbpoints=size(data.Coord,1); %nbre of calibration points
     935Coord=get(handles.ListCoord,'Data');%read list of coordinates on geometry_calib
     936nbpoints=size(Coord,1); %nbre of calibration points
    951937if nbpoints~=4
    952938    msgbox_uvmat('ERROR','four points must have be selected by the mouse to delimitate the phys grid area; the Ox axis will be defined by the two first points')
    953939    return
    954940end
    955 corners_X=(data.Coord(end:-1:end-3,4)); %pixel absissa of the four corners
    956 corners_Y=(data.Coord(end:-1:end-3,5));
     941corners_X=(Coord(end:-1:end-3,4)); %pixel absissa of the four corners
     942corners_Y=(Coord(end:-1:end-3,5));
    957943
    958944%reorder the last two points (the two first in the list) if needed
     
    10641050Tmod=T(:,(1:2))+Delta;
    10651051[Xpx,Ypx]=px_XYZ(GeometryCalib,Tmod(:,1),Tmod(:,2));
    1066 for ipoint=1:nbpoints
    1067      Coord{ipoint,1}=num2str(T(ipoint,1),4);%display coordiantes with 4 digits
    1068      Coord{ipoint,2}=num2str(T(ipoint,2),4);%display coordiantes with 4 digits
    1069      Coord{ipoint,3}=num2str(T(ipoint,3),4);%display coordiantes with 4 digits;
    1070      Coord{ipoint,4}=num2str(Xpx(ipoint),4);%display coordiantes with 4 digits
    1071      Coord{ipoint,5}=num2str(Ypx(ipoint),4);%display coordiantes with 4 digits
    1072 end
    1073 Tabchar=cell2tab(Coord(end:-1:1,:),' | ');
    1074 Tabchar=[Tabchar ;{'......'}];
    1075 set(handles.ListCoord,'Value',1)
    1076 set(handles.ListCoord,'String',Tabchar)
     1052% for ipoint=1:nbpoints
     1053%      Coord{ipoint,1}=num2str(T(ipoint,1),4);%display coordiantes with 4 digits
     1054%      Coord{ipoint,2}=num2str(T(ipoint,2),4);%display coordiantes with 4 digits
     1055%      Coord{ipoint,3}=num2str(T(ipoint,3),4);%display coordiantes with 4 digits;
     1056%      Coord{ipoint,4}=num2str(Xpx(ipoint),4);%display coordiantes with 4 digits
     1057%      Coord{ipoint,5}=num2str(Ypx(ipoint),4);%display coordiantes with 4 digits
     1058% end
     1059Coord=[T Xpx Ypx zeros(size(T,1),1)];
     1060set(handles.ListCoord,'Data',Coord)
     1061% Tabchar=cell2tab(Coord(end:-1:1,:),' | ');
     1062% Tabchar=[Tabchar ;{'......'}];
     1063% set(handles.ListCoord,'Value',1)
     1064% set(handles.ListCoord,'String',Tabchar)
    10771065PLOT_Callback(hObject, eventdata, handles)
    10781066
     
    11971185% -----------------------------------------------------------------------
    11981186inputfile=browse_xml(hObject, eventdata, handles);
    1199 listfile=get(handles.coord_files,'string');
     1187listfile=get(handles.ListCoordFiles,'string');
    12001188if isequal(listfile,{''})
    12011189    listfile={inputfile};
     
    12031191    listfile=[listfile;{inputfile}];%update the list of coord files
    12041192end
    1205 set(handles.coord_files,'string',listfile);
     1193set(handles.ListCoordFiles,'string',listfile);
    12061194
    12071195%------------------------------------------------------------------------
     
    13081296
    13091297if isempty(CoordCell)% allow mouse action by default in the absence of input points
    1310     set(handles.edit_append,'Value',1)
    1311     set(handles.edit_append,'BackgroundColor',[1 1 0])
     1298    set(handles.CheckEnableMouse,'Value',1)
     1299    set(handles.CheckEnableMouse,'BackgroundColor',[1 1 0])
    13121300else % does not allow mouse action by default in the presence of input points
    1313     set(handles.edit_append,'Value',0)
    1314     set(handles.edit_append,'BackgroundColor',[0.7 0.7 0.7])
     1301    set(handles.CheckEnableMouse,'Value',0)
     1302    set(handles.CheckEnableMouse,'BackgroundColor',[0.7 0.7 0.7])
    13151303end
    13161304
     
    14781466    set(hhh,'Position',[XCoord-ind_range/2 YCoord-ind_range/2 ind_range ind_range])
    14791467end
     1468
     1469
     1470% --- Executes on button press in Copy.
     1471function Copy_Callback(hObject, eventdata, handles)
     1472% hObject    handle to Copy (see GCBO)
     1473% eventdata  reserved - to be defined in a future version of MATLAB
     1474% handles    structure with handles and user data (see GUIDATA)
  • trunk/src/mouse_down.m

    r657 r660  
    7474        else
    7575            hh_calib=guidata(h_calib);
    76             test_cal=get(hh_calib.edit_append,'Value');
     76            test_cal=get(hh_calib.CheckEnableMouse,'Value');
    7777        end
    7878    end
     
    403403    h_geometry_calib=findobj(allchild(0),'Name','geometry_calib'); %find the geomterty_calib GUI
    404404    hh_geometry_calib=guidata(h_geometry_calib);
    405     h_edit_append=hh_geometry_calib.edit_append;%findobj(h_geometry_calib,'Tag','edit_append');
    406     if isequal(get(h_edit_append,'Value'),1) && ~isempty(haxes)
     405    h_CheckEnableMouse=hh_geometry_calib.CheckEnableMouse;
     406    if isequal(get(h_CheckEnableMouse,'Value'),1) && ~isempty(haxes)
    407407        if ~isequal(get(hhuvmat.TransformName,'Value'),1); %active only with no transform (px coordinates)
    408408            set(hhuvmat.TransformName,'Value',1)
  • trunk/src/mouse_motion.m

    r657 r660  
    397397                end
    398398                hh=findobj('Tag','calib_points');%look for handle of calibration points
    399                if ~isempty(hh) && ~isempty(get(hh,'UserData')) && get(hh_geometry_calib.edit_append,'Value')
     399               if ~isempty(hh) && ~isempty(get(hh,'UserData')) && get(hh_geometry_calib.CheckEnableMouse,'Value')
    400400                   %set(hh,'UserData',index_point)
    401401                    index_point=get(hh,'UserData');
  • trunk/src/mouse_up.m

    r657 r660  
    333333    if ~isempty(h_geometry_calib)
    334334        hh_geometry_calib=guidata(h_geometry_calib);
    335         edit_test=get(hh_geometry_calib.edit_append,'Value');
     335        edit_test=get(hh_geometry_calib.CheckEnableMouse,'Value');
    336336        hh=findobj(hcurrentaxes,'tag','calib_points');%look for handle of calibration points
    337337        if ~isempty(hh) && edit_test
  • trunk/src/uvmat.m

    r657 r660  
    43214321    if ishandle(hgeometry_calib)
    43224322        hhgeometry_calib=guidata(hgeometry_calib);
    4323         set(hhgeometry_calib.edit_append,'Value',0)% desactivate mouse action in geometry_calib
     4323        set(hhgeometry_calib.CheckEnableMouse,'Value',0)% desactivate mouse action in geometry_calib
    43244324    end
    43254325    set(handles.CheckViewObject,'value',1)
     
    47814781if ishandle(hgeometry_calib)
    47824782    hhgeometry_calib=guidata(hgeometry_calib);
    4783     set(hhgeometry_calib.edit_append,'Value',0)% desactivate mouse action in geometry_calib
     4783    set(hhgeometry_calib.CheckEnableMouse,'Value',0)% desactivate mouse action in geometry_calib
    47844784end
    47854785set(handles.CheckEditObject,'Value',0)  %desactivate the object edit mode
Note: See TracChangeset for help on using the changeset viewer.