Ignore:
Timestamp:
Mar 31, 2011, 1:42:51 PM (13 years ago)
Author:
sommeria
Message:

add function sub_field_series to apply the sub_field operation to a series of fileds (for instance subtracting a background to an image series)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/geometry_calib.m

    r213 r227  
    441441%------------------------------------------------------------------------
    442442% determine the parameters for a calibration by a linear transform matrix (rescale and rotation)
    443 function GeometryCalib=calib_linear(Coord,handles) %TO UPDATE
     443function GeometryCalib=calib_linear(Coord,handles)
    444444%------------------------------------------------------------------------
    445445X=Coord(:,1);
     
    461461GeometryCalib.fx_fy(2)=(a_Y1(3)/a_X1(2))*GeometryCalib.fx_fy(1);
    462462GeometryCalib.CoordUnit=[];% default value, to be updated by the calling function
    463 GeometryCalib.Tx_Ty_Tz=[a_X1(1) a_Y1(1) 1];
     463%GeometryCalib.Tx_Ty_Tz=[a_X1(1) a_Y1(1) 1];
     464GeometryCalib.Tx_Ty_Tz=[a_X1(1)/GeometryCalib.fx_fy(1) a_Y1(1)/GeometryCalib.fx_fy(2) 1];
    464465R(1,:)=R(1,:)/GeometryCalib.fx_fy(1);
    465466R(2,:)=R(2,:)/GeometryCalib.fx_fy(2);
     
    10301031ind_sub_x=round(XLim);
    10311032ind_sub_y=np(1)-round(YLim);
    1032 Mfiltre=AxeData.A([ind_sub_y(2):ind_sub_y(1)] ,ind_sub_x,:);
     1033Mfiltre=AxeData.A(ind_sub_y(2):ind_sub_y(1) ,ind_sub_x,:);
    10331034Mfiltre_norm=double(Mfiltre);
    10341035Mfiltre_norm=Mfiltre_norm/sum(sum(Mfiltre_norm));
     
    10641065if ~isempty(ObjectData.Coord)
    10651066    if isequal(option,'phys')
    1066         ObjectData.Coord=ObjectData.Coord(:,[1:3]);
     1067        ObjectData.Coord=ObjectData.Coord(:,1:3);
    10671068    elseif isequal(option,'px')||isequal(option,'')
    1068         ObjectData.Coord=ObjectData.Coord(:,[4:5]);
     1069        ObjectData.Coord=ObjectData.Coord(:,4:5);
    10691070    else
    10701071        msgbox_uvmat('ERROR','the choice in menu_coord of uvmat must be '''', px or phys ')
     
    11351136function MenuDetectGrid_Callback(hObject, eventdata, handles)
    11361137%------------------------------------------------------------------------
    1137 %% initiate the grid
    1138 CalibData=get(handles.geometry_calib,'UserData');%get information stored on the GUI geometry_calib
    1139 grid_input=[];%default
    1140 if isfield(CalibData,'grid')
    1141     grid_input=CalibData.grid;%retrieve the previously used grid
    1142 end
    1143 [T,CalibData.grid,white_test]=create_grid(grid_input,'detect_grid');%display the GUI create_grid, read the set of phys coordinates T
    1144 set(handles.geometry_calib,'UserData',CalibData)%store the phys grid parameters for later use
    1145 
    11461138%% read the four last point coordinates in pixels
    11471139Coord_cell=get(handles.ListCoord,'String');%read list of coordinates on geometry_calib
     
    11491141nbpoints=size(data.Coord,1); %nbre of calibration points
    11501142if nbpoints~=4
    1151     msgbox_uvmat('ERROR','four points must have be selected by the mouse, beginning by the new x axis, to delimitate the phys grid area')
     1143    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')
    11521144    return
    11531145end
     
    11651157      corners_Y(3)=Y_end;
    11661158end
     1159
     1160%% initiate the grid
     1161CalibData=get(handles.geometry_calib,'UserData');%get information stored on the GUI geometry_calib
     1162grid_input=[];%default
     1163if isfield(CalibData,'grid')
     1164    grid_input=CalibData.grid;%retrieve the previously used grid
     1165end
     1166[T,CalibData.grid,white_test]=create_grid(grid_input,'detect_grid');%display the GUI create_grid, read the set of phys coordinates T
     1167set(handles.geometry_calib,'UserData',CalibData)%store the phys grid parameters for later use
     1168
     1169
    11671170
    11681171%% read the current image, displayed in the GUI uvmat
Note: See TracChangeset for help on using the changeset viewer.