Changeset 60 for trunk/src/create_grid.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/create_grid.m

    r38 r60  
    9191   end
    9292   if isfield(input_grid,'y_0')
    93         set(handles.x_0,'String',num2str(input_grid.x_0));
     93        set(handles.y_0,'String',num2str(input_grid.y_0));
    9494   end
    9595   if isfield(input_grid,'y_1')
    96         set(handles.x_1,'String',num2str(input_grid.x_1));
     96        set(handles.y_1,'String',num2str(input_grid.y_1));
    9797   end
    9898   if isfield(input_grid,'Dy')
    99         set(handles.Dx,'String',num2str(input_grid.Dx));
     99        set(handles.Dy,'String',num2str(input_grid.Dy));
    100100   end
    101101   if isfield(input_grid,'z')
     
    115115varargout{1}=[0 0 0];%default
    116116if ~isequal(handles.output,'Cancel')
    117     x_0=str2num(get(handles.x_0,'String'));
    118     Dx=str2num(get(handles.Dx,'String'));
    119     x_1=str2num(get(handles.x_1,'String'));
    120     xarray=[x_0:Dx:x_1];
    121     y_0=str2num(get(handles.y_0,'String'));
    122     Dy=str2num(get(handles.Dy,'String'));
    123     y_1=str2num(get(handles.y_1,'String'));
    124     yarray=[y_0:Dy:y_1];
     117    T.x_0=str2num(get(handles.x_0,'String'));
     118    T.Dx=str2num(get(handles.Dx,'String'));
     119    T.x_1=str2num(get(handles.x_1,'String'));
     120    xarray=[T.x_0:T.Dx:T.x_1];
     121    T.y_0=str2num(get(handles.y_0,'String'));
     122    T.Dy=str2num(get(handles.Dy,'String'));
     123    T.y_1=str2num(get(handles.y_1,'String'));
     124    yarray=[T.y_0:T.Dy:T.y_1];
    125125    [yarray,xarray]=meshgrid(yarray,xarray);
    126126    xarray=reshape(xarray,numel(xarray),1);
    127127    yarray=reshape(yarray,numel(yarray),1);
    128     z_0=str2num(get(handles.z_0,'String'));
    129     if isempty(z_0)
    130         z_0=0;
     128    T.z_0=str2num(get(handles.z_0,'String'));
     129    if isempty(T.z_0)
     130        T.z_0=0;
    131131    end
    132     zarray=z_0*ones(size(yarray));
     132    zarray=T.z_0*ones(size(yarray));
    133133    varargout{1}=[xarray yarray zarray];
    134 %     if ~isempty(x_shift)
    135 %         varargout{1}(1)=x_shift;
    136 %     end
    137 %     if ~isempty(y_shift)
    138 %         varargout{1}(2)=y_shift;
    139 %     end
    140 %     if ~isempty(z_shift)
    141 %         varargout{1}(3)=z_shift;
    142 %     end
    143134end
     135varargout{2}=T;
    144136% The figure can be deleted now
    145137delete(handles.figure1);
Note: See TracChangeset for help on using the changeset viewer.