Changeset 60 for trunk/src/mouse_down.m


Ignore:
Timestamp:
Mar 23, 2010, 2:52:49 PM (11 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_down.m

    r46 r60  
    2626MouseAction='none'; %default
    2727huvmat=findobj(allchild(0),'Name','uvmat');%find the uvmat interface handle which controls theoption of  mouse action
    28 if ~isempty(huvmat)
    29     hhuvmat=guidata(huvmat);%handles of elements in uvmat
    30     UvData=get(huvmat,'UserData');
    31     testzoom=get(hhuvmat.zoom,'Value');% get the mouse action from the uvmat GUI: options:
    32     if isfield(UvData,'MouseAction')
    33         MouseAction=UvData.MouseAction;% get the mouse action from the uvmat GUI: options:
    34     end
    35 end
     28if isempty(huvmat)
     29    return
     30end
     31hhuvmat=guidata(huvmat);%handles of elements in uvmat
     32UvData=get(huvmat,'UserData');
     33testzoom=get(hhuvmat.zoom,'Value');% get the mouse action from the uvmat GUI: options:
     34if isfield(UvData,'MouseAction')
     35    MouseAction=UvData.MouseAction;% get the mouse action from the uvmat GUI: options:
     36end
     37
    3638test_create=~testzoom && (isequal(MouseAction,'create_object') || isequal(MouseAction,'create_mask'));
    3739%test_cal=get(handles.cal,'Value');
    3840test_cal=isequal(MouseAction,'calib');
     41test_ruler=isequal(MouseAction,'ruler');
    3942menu_coord=get(hhuvmat.transform_fct,'String');
    4043coord_choice=get(hhuvmat.transform_fct,'Value');
     
    8588                end
    8689            end
    87         elseif isequal(get(hchild(ichild),'Visible'),'on')& ~isequal(get(hchild(ichild),'Style'),'frame')
    88            %FAIRE UNE OPTION D'AIDE AVEC BOUTON SOURIS DROIT (ALT)??
     90%         elseif isequal(get(hchild(ichild),'Visible'),'on')& ~isequal(get(hchild(ichild),'Style'),'frame')
     91%            %FAIRE UNE OPTION D'AIDE AVEC BOUTON SOURIS DROIT (ALT)??
    8992        end
    9093    end
     
    222225        h_edit_append=hh_geometry_calib.edit_append;%findobj(h_geometry_calib,'Tag','edit_append');
    223226        if isequal(get(h_edit_append,'Value'),1)
    224             if ~isequal(coord_type,'')
    225                 set(handles_coord,'Value',1)
    226                 coord_type='';
     227            coord_value=get(hhuvmat.transform_fct,'Value');
     228            if ~(isequal(coord_value,1)||isequal(coord_value,3)); %active only with no transform or px (no phys)
     229                set(hhuvmat.transform_fct,'Value',1)
    227230                set(hhuvmat.FixedLimits,'Value',0)% put FixedLimits option to 'off'
    228231                set(hhuvmat.FixedLimits,'BackgroundColor',[0.7 0.7 0.7])
    229232                uvmat('run0_Callback',hObject,eventdata,hhuvmat); %file input with xml reading  in uvmat
     233                return
    230234            end
    231235%             if isequal(coord_type,'px')|isequal(coord_type,'');%px cordinates
     
    286290        [PlotType,ScalOut]= plot_field(AxeData,haxes,PlotParam,1);
    287291    end   
     292   
     293    %create ruler
     294    if test_ruler
     295        UvData.RulerCoord(1,1)=xy(1,1);
     296        UvData.RulerCoord(1,2)=xy(1,2);
     297        UvData.RulerHandle=line([xy(1,1) xy(1,1)],[xy(1,2) xy(1,2)],'Color','m','Tag','proj_object');
     298        set(huvmat,'UserData',UvData)
     299    end
    288300end
    289301set(haxes,'UserData',AxeData);
Note: See TracChangeset for help on using the changeset viewer.