Ignore:
Timestamp:
Apr 2, 2010, 9:01:21 PM (14 years ago)
Author:
sommeria
Message:

debugging of geometry_calib and mouse operations
merge_proj: call to read_image replaced. Still problems to solve to merge images

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mouse_motion.m

    r71 r78  
    2424
    2525function mouse_motion(hObject,eventdata,handles)
     26
    2627if ~exist('handles','var')
    2728    return
     
    3435test_ruler=0;
    3536huvmat=findobj(allchild(0),'Name','uvmat');%find the uvmat interface handle
     37hhuvmat=guidata(huvmat);
     38test_zoom=get(hhuvmat.zoom,'Value');
    3639if ~isempty(huvmat)
    3740    UvData=get(huvmat,'UserData');
     
    207210set(handles.text_display_3,'String',text_displ_3);
    208211set(handles.text_display_4,'String',text_displ_4);
    209 if ~test_draw
    210     return
    211 end
     212% if ~test_draw
     213%     return
     214% end
    212215% At this stage  if no drawing  operation is done
    213216
     
    289292% detect calibration points if the GUI geometry_calib is opened
    290293h_geometry_calib=findobj(allchild(0),'Name','geometry_calib'); %find the geomterty_calib GUI
    291 if ~test_zoom_draw && ~isempty(h_geometry_calib)
     294if ~test_zoom && ~isempty(h_geometry_calib)
    292295    pointershape='crosshair';%default for geometry_calib: ready to create new points
    293296    hh_geometry_calib=guidata(h_geometry_calib);
    294     if get(hh_geometry_calib.edit_append,'Value')  && ~isempty(xy)
     297    if ~isempty(xy)
    295298        h_ListCoord=hh_geometry_calib.ListCoord; %findobj(h_geometry_calib,'Tag','ListCoord');
    296299        Coord=get(h_ListCoord,'String');
     
    301304            xy=get(haxes,'CurrentPoint');%xy(1,1),xy(1,2): current x,y positions in axes coordinates
    302305            if ~isempty(xy)
    303                 ind_range=10;
     306                xlim=get(haxes,'XLim');
     307                ind_range_x=abs((xlim(2)-xlim(1))/50);
     308                ylim=get(haxes,'YLim');
     309                ind_range_y=abs((ylim(2)-ylim(1))/50);
     310                ind_range=sqrt(ind_range_x*ind_range_y);
    304311                index_point=find((XCoord<xy(1,1)+ind_range) & (XCoord>xy(1,1)-ind_range) & ...%flagx=1 for the vectors with x position selected by the mouse
    305312                              (YCoord<xy(1,2)+ind_range) & (YCoord>xy(1,2)-ind_range),1);%find the first calibration point in the neighborhood of the mouse
    306313                if ~isempty(index_point)
    307314                    pointershape='arrow';% default pointer is an arrow
    308                     set(h_ListCoord,'Value',index_point)%mrk the point on the GUI geometry_calib
    309                     hh=findobj('Tag','calib_points');%look for handle of calibration points
    310                     if ~isempty(hh) && strcmp(get(hh,'UserData'),'edit_mode')
    311                         XCoord(index_point)=xy(1,1);
    312                         YCoord(index_point)=xy(1,2);
    313                         set(hh,'XData',XCoord)
    314                         set(hh,'YData',YCoord)
    315                     end
     315                end
     316                hh=findobj('Tag','calib_points');%look for handle of calibration points
     317               if ~isempty(hh) && ~isempty(get(hh,'UserData')) && get(hh_geometry_calib.edit_append,'Value')
     318                    index_point=get(hh,'UserData');
     319                    XCoord(index_point)=xy(1,1);
     320                    YCoord(index_point)=xy(1,2);
     321                    set(hh,'XData',XCoord)
     322                    set(hh,'YData',YCoord)
     323               end
     324                if ~isempty(index_point)
     325                    set(h_ListCoord,'Value',index_point)%mrk the point on the GUI geometry_calib
    316326                    hhh=findobj('Tag','calib_marker');%look for handle of point marker (circle)
    317327                    if ~isempty(hhh)
    318328                        set(hhh,'Position',[XCoord(index_point)-ind_range/2 YCoord(index_point)-ind_range/2 ind_range ind_range])
    319 %                         set(hhh,'XData',XCoord(index_point))
    320 %                         set(hhh,'YData',YCoord(index_point))
    321                     end
    322                 end         
     329                    end
     330                end
    323331            end
    324332        end
Note: See TracChangeset for help on using the changeset viewer.