Changeset 892 for trunk/src


Ignore:
Timestamp:
Apr 25, 2015, 6:17:19 PM (10 years ago)
Author:
sommeria
Message:

bug in refraction index fixed

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/phys_ima.m

    r849 r892  
     1
    12% phys_ima: transform several images in phys coordinates on a common pixel grid
    23%------------------------------------------------------------------------
     
    6162           SliceCoord=Calib.SliceCoord(ZIndex,:);
    6263           zphys=SliceCoord(3); %to generalize for non-parallel planes
    63            if isfield(Calib,'InterfaceCoord') && isfield(Calib,'RefractionIndex')
    64                 H=Calib.InterfaceCoord(3);
    65                 if H>zphys
    66                     zphys=H-(H-zphys)/Calib.RefractionIndex; %corrected z (virtual object)
    67                 end
    68            end
     64%            if isfield(Calib,'InterfaceCoord') && isfield(Calib,'RefractionIndex')
     65%                 H=Calib.InterfaceCoord(3);
     66%                 if H>zphys
     67%                     zphys=H-(H-zphys)/Calib.RefractionIndex; %corrected z (virtual object)
     68%                 end
     69%            end
    6970        end
    7071        xima=0.5:npx-0.5;%image coordinates of corners
  • trunk/src/px_XYZ.m

    r809 r892  
    4848        if H>Zphys
    4949            Zphys=H-(H-Zphys)/Calib.RefractionIndex; %corrected z (virtual object)
    50             test_refraction=1;
     50          %  test_refraction=1;
    5151        end
    5252    end
  • trunk/src/uvmat.m

    r890 r892  
    10831083
    10841084UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface
    1085 check=0;
     1085% check=0;
    10861086if isfield(UvData,'XmlData')&&isfield(UvData.XmlData{1},'GeometryCalib')&& isfield(UvData.XmlData{1}.GeometryCalib,'SliceCoord')
    10871087    GeometryCalib=UvData.XmlData{1}.GeometryCalib;
     
    11011101end     
    11021102RefractionIndex=1.33;
     1103CheckRefraction=0;% default value of the check box refraction
    11031104if isfield(GeometryCalib,'RefractionIndex')
    11041105    RefractionIndex=GeometryCalib.RefractionIndex;
     1106    CheckRefraction=1;
    11051107end     
    11061108SliceAngle=[0 0 0];
     
    11411143    'String',num2str(InterfaceCoord),'Visible','off','FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_H'': z position of the water surface (=Z_1 in air)');%edit box
    11421144%  raw 3 of the GUI
    1143 uicontrol('Style','checkbox','Units','normalized', 'Position', [2*ii+ww 0.95-3*ii-2*hh 2*ww hh],'tag','CheckRefraction','BackgroundColor',BackgroundColor,...
     1145hcheckrefraction=uicontrol('Style','checkbox','Units','normalized', 'Position', [2*ii+ww 0.95-3*ii-2*hh 2*ww hh],'tag','CheckRefraction','BackgroundColor',BackgroundColor,...
    11441146    'Callback',@(hObject,eventdata)set_slice_CheckRefraction_Callback(hObject,eventdata),...
    1145     'String','refraction','Value',0,'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''CheckRefraction'':=1 to provide refraction correction');
     1147    'String','refraction','Value',CheckRefraction,'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''CheckRefraction'':=1 to provide refraction correction');
    11461148uicontrol('Style','text','Units','normalized', 'Position', [2*ii+2*ww 0.95-3*ii-1.75*hh ww hh/2],'BackgroundColor',BackgroundColor,'Tag','Refraction_title',...
    11471149    'String','index','Visible','off','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','right');%title
     
    11651167    'String','tild angle y axis','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','center');%title
    11661168%  raw 6 of the GUI
    1167 % uicontrol('Style','text','Units','normalized', 'Position', [ii 0.95-5*ii-4.75*hh 2*ww hh/2],'BackgroundColor',BackgroundColor,'Tag','NbSlice_title',...
    1168 %     'String','tilt angle','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','right');%title
    11691169uicontrol('Style','edit','Units','normalized', 'Position', [3*ii+2*ww 0.95-5*ii-4.2*hh ww hh],'tag','num_SliceAngle_1_1','BackgroundColor',[1 1 1],...
    11701170    'String',num2str(SliceAngle(1)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_SliceAngle_1_1'':first slice angle of inclination around the x axis');%edit box
     
    11851185    'String','Cancel','FontWeight','bold','FontUnits','points','FontSize',12,'TooltipString','''Cancel'': quit GUI without action');
    11861186drawnow
     1187set_slice_CheckRefraction_Callback(hcheckrefraction,[])
    11871188
    11881189%------------------------------------------------------------------------
     
    12351236    GeometryCalib.InterfaceCoord=[0 0 SliceData.H];
    12361237    GeometryCalib.RefractionIndex=SliceData.RefractionIndex;
     1238elseif isfield(GeometryCalib,'RefractionIndex')
     1239    GeometryCalib=rmfield(GeometryCalib,'RefractionIndex');
     1240    GeometryCalib=rmfield(GeometryCalib,'InterfaceCoord'); 
    12371241end
    12381242
Note: See TracChangeset for help on using the changeset viewer.