Ignore:
Timestamp:
Mar 23, 2010, 2:52:49 PM (14 years ago)
Author:
sommeria
Message:

-plot projections on a new specific GUI view_field, to avoid the multiplication of active figures
-introduce a ruler in uvmat (in menu/Tools), to measure distances and angles
-insert automatic detection of points for geometric calibration: tool 'detect_grid'. Four points, deliminating the grid to determine, must be marked with the mouse, as well as the physical grid. Then the points inside are automatically detected.
-reading plane positions in ImaDoc? improved to deal with volume scans

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/mouse_motion.m

    r11 r60  
    2727    return
    2828end
    29 if ~isfield(handles, 'mouse_coord')
    30     return
    31 end
    32 if ~ishandle(handles.mouse_coord)
    33     return
    34 end
    35 proj_coord=get(handles.mouse_coord,'String');
    36 choice=get(handles.mouse_coord,'Value');
    37 if ~isempty(proj_coord); proj_coord=proj_coord{choice};else;proj_coord=[];end;
     29% if ~isfield(handles, 'mouse_coord')
     30%     'TEST'
     31%     return
     32% end
     33% if ~ishandle(handles.mouse_coord)
     34%     return
     35% end
     36% proj_coord=get(handles.mouse_coord,'String');
     37% choice=get(handles.mouse_coord,'Value');
     38% if ~isempty(proj_coord); proj_coord=proj_coord{choice};else;proj_coord=[];end;
    3839test_create=0;%default
    3940test_edit=0;%default
     
    148149            if isfield(AxeData,'CoordUnit')
    149150                  mouse.CoordUnit=AxeData.CoordUnit;
    150             end
    151             if isfield(mouse,'CoordType') &~isequal(mouse.CoordType,proj_coord)
    152                 huvmat=findobj(allchild(0),'Tag','uvmat');%find the uvmat interface handle
    153                 UvData=get(huvmat,'UserData'); %coord transformed stored in the uvmat interface, updated by file input
    154                 if isfield(AxeData,'CoordType')
    155                     mouse.CoordType=AxeData.CoordType;
    156                 end
    157                 if isfield(AxeData,'dt')
    158                     mouse.dt=AxeData.dt;
    159                 end
    160 %                 if ~isempty(z_mouse)
    161 %                     mouse.Z=z_mouse;
    162 %                 end
    163                 if length(ivec)>0 %& isfield(AxeData,'dt')                   
    164                       mouse.U=u_mouse;
    165                       mouse.V=v_mouse;
    166                 end
    167                 mouse=feval(proj_coord,mouse,UvData);%apply transform proj_coord to the position
    168                 if length(ivec)>0%& isfield(AxeData,'dt')
    169                      u_mouse=mouse.U;
    170                      v_mouse=mouse.V;
    171                 end
    172             end 
     151            end
    173152            if isfield(mouse,'CoordType')
    174153                if isequal(mouse.CoordType,'px')
     
    203182                text_displ_2=['A=' num2str(double(A_mouse)) ',i='  num2str(indx0) ',j=' num2str(indy0)];
    204183            end
    205         elseif isequal(get(hchild(ichild),'Visible'),'on')& ~isequal(get(hchild(ichild),'Style'),'frame')
     184        elseif isequal(htype,'uicontrol') && isequal(get(hchild(ichild),'Visible'),'on')&& ~isequal(get(hchild(ichild),'Style'),'frame')
    206185            text_displ_1=get(hchild(ichild),'Tag');
    207186        end
     
    287266    pointershape='arrow';
    288267end
     268
     269%draw ruler
     270UvData=get(handles.uvmat,'UserData');
     271if isfield(UvData,'MouseAction') && isequal(UvData.MouseAction,'ruler')
     272       if isfield(UvData,'RulerHandle')
     273            RulerCoord=[UvData.RulerCoord ;xy(1,1:2)];
     274            set(UvData.RulerHandle,'XData',RulerCoord(:,1));
     275            set(UvData.RulerHandle,'YData',RulerCoord(:,2));
     276       end
     277end
    289278set(currentfig,'Pointer',pointershape);
Note: See TracChangeset for help on using the changeset viewer.