Changeset 837


Ignore:
Timestamp:
Dec 8, 2014, 1:04:22 AM (6 years ago)
Author:
sommeria
Message:

bugs corrected in uvmat: object deletion.
set_slices improved.

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/browse_data.m

    r827 r837  
    7373set(hObject, 'Position', FigPos);
    7474set(hObject, 'Units', OldUnits);
     75if exist('EnableMirror','var') && strcmp(EnableMirror,'on')
     76    set(handles.CreateMirror,'Visible','on')
     77    set(handles.mirror_txt,'Visible','on')
     78else
     79    set(handles.CreateMirror,'Visible','off')
     80    set(handles.mirror_txt,'Visible','off')
     81end
    7582if exist('Campaign','var')
    7683    [tild,CampaignName]=fileparts(Campaign);
    7784    RootXml=fullfile(Campaign,[CampaignName '.xml']);
    7885    s=[];
    79     if exist(RootXml,'file')
     86    if exist(RootXml,'file') 
    8087        [s,Heading]=xml2struct(RootXml);%read the xml file
    8188        if isfield(s,'SourceDir')
     
    104111    uiwait(handles.browse_data);
    105112end
    106 if exist('EnableMirror','var') && strcmp(EnableMirror,'on')
    107     set(handles.CreateMirror,'Visible','on')
    108 end
     113
    109114
    110115%------------------------------------------------------------------------
  • trunk/src/geometry_calib.m

    r827 r837  
    5252% Edit the above text to modify the response to help geometry_calib
    5353
    54 % Last Modified by GUIDE v2.5 11-Apr-2014 23:10:57
     54% Last Modified by GUIDE v2.5 07-Dec-2014 15:50:44
    5555
    5656% Begin initialization code - DO NOT edit
     
    112112set(handles.Extrinsic,'Position',[1 Height-40-4-92-75 418 75])%  rank 3
    113113set(handles.PointLists,'Position',[1 Height-40-6-92-75-117 418 117]) %  rank 4
    114 set(handles.CheckEnableMouse,'Position',[3 Height-40-8-92-75-117-30 180 30])%  rank 5
     114set(handles.CheckEnableMouse,'Position',[3 Height-362 208 30])%  rank 5
    115115set(handles.PLOT,'Position',[3 Height-394 120 30])%  rank 6
    116116set(handles.Copy,'Position',[151 Height-394 120 30])%  rank 6
    117 set(handles.CLEAR_PTS,'Position',[297 Height-394 120 30])%  rank 6
    118 set(handles.ClearLine,'Position',[297 Height-364 120 30])%  rank 6
    119 set(handles.CoordLine,'Position',[177 Height-364 120 30])%  rank 6
     117set(handles.ClearAll,'Position',[297 Height-394 120 30])%  rank 6
     118set(handles.ClearPoint,'Position',[297 Height-362 120 30])%  rank 6
     119set(handles.CoordLine,'Position',[211 Height-362 86 30])%  rank 6
    120120set(handles.phys_title,'Position',[38 Height-426 125 20])%  rank 7
    121121set(handles.CoordUnit,'Position',[151 Height-426 120 30])%  rank 7
     
    772772
    773773% --------------------------------------------------------------------
    774 % --- Executes on button press in CLEAR_PTS: clear the list of calibration points
    775 function CLEAR_PTS_Callback(hObject, eventdata, handles)
     774% --- Executes on button press in ClearAll: clear the list of calibration points
     775function ClearAll_Callback(hObject, eventdata, handles)
    776776% --------------------------------------------------------------------
    777777set(handles.ListCoord,'Data',[])
     
    13991399
    14001400%------------------------------------------------------------------------
    1401 % --- Executes on button press in ClearLine: remove the selected line in the table Coord
    1402 %------------------------------------------------------------------------
    1403 function ClearLine_Callback(hObject, eventdata, handles)
     1401% --- Executes on button press in ClearPoint: remove the selected line in the table Coord
     1402%------------------------------------------------------------------------
     1403function ClearPoint_Callback(hObject, eventdata, handles)
    14041404
    14051405Coord=get(handles.ListCoord,'Data');
     
    14181418    end
    14191419end
    1420 
  • trunk/src/mouse_motion.m

    r809 r837  
    441441                        set(hhh,'Position',[XCoord(index_point)-ind_range/2 YCoord(index_point)-ind_range/2 ind_range ind_range])
    442442                    else
     443                        axes(hchild)
    443444                        rectangle('Curvature',[1 1],...
    444445                            'Position',[XCoord(index_point)-ind_range/2 YCoord(index_point)-ind_range/2 ind_range ind_range],'EdgeColor','m',...
  • trunk/src/uvmat.m

    r831 r837  
    11201120    'String','last','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','center');%title
    11211121uicontrol('Style','text','Units','normalized', 'Position', [4*ii+3*ww 0.95-ii-0.25*hh ww hh/2],'BackgroundColor',BackgroundColor,...
    1122     'String','surface','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','center');%title
     1122    'String','surface','Visible','off','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','center');%title
    11231123%  raw 2 of the GUI
    11241124uicontrol('Style','text','Units','normalized', 'Position', [ii 0.95-2*ii-0.75*hh ww hh/2],'BackgroundColor',BackgroundColor,...
     
    11291129    'String',num2str(SliceCoord(end,3)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_Z_2'': z position of last slice');%edit box
    11301130uicontrol('Style','edit','Units','normalized', 'Position', [4*ii+3*ww 0.95-2*ii-hh ww hh],'tag','num_H','BackgroundColor',[1 1 1],...
    1131     'String',num2str(InterfaceCoord),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_H'': z position of the water surface (=Z_1 in air)');%edit box
     1131    '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
    11321132%  raw 3 of the GUI
    1133 uicontrol('Style','text','Units','normalized', 'Position', [2*ii+ww 0.95-3*ii-1.75*hh 2*ww hh/2],'BackgroundColor',BackgroundColor,'Tag','Refraction_title',...
    1134     'String','refraction index','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','right');%title
     1133uicontrol('Style','checkbox','Units','normalized', 'Position', [2*ii+ww 0.95-3*ii-2*hh 2*ww hh],'tag','CheckRefraction','BackgroundColor',BackgroundColor,...
     1134    'Callback',@(hObject,eventdata)set_slice_CheckRefraction_Callback(hObject,eventdata),...
     1135    'String','refraction','Value',0,'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''CheckRefraction'':=1 to provide refraction correction');
     1136uicontrol('Style','text','Units','normalized', 'Position', [2*ii+2*ww 0.95-3*ii-1.75*hh ww hh/2],'BackgroundColor',BackgroundColor,'Tag','Refraction_title',...
     1137    'String','index','Visible','off','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','right');%title
    11351138uicontrol('Style','edit','Units','normalized', 'Position', [4*ii+3*ww 0.95-3*ii-2*hh ww hh],'tag','num_RefractionIndex','BackgroundColor',[1 1 1],...
    1136     'String',num2str(RefractionIndex),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_RefractionIndex'': refraction index of water');
     1139    'String',num2str(RefractionIndex),'Visible','off','FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_RefractionIndex'': refraction index of water');
    11371140%  raw 4 of the GUI
    11381141uicontrol('Style','text','Units','normalized', 'Position', [ii 0.95-4*ii-3.25*hh ww hh],'BackgroundColor',BackgroundColor,'Tag','NbSlice_title',...
     
    11431146    'String','volume scan','Value',CheckVolumeScan,'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''CheckVolumeScan'':=1 for volume scan (z varies with j index)');
    11441147%  raw 5 of the GUI
    1145 uicontrol('Style','text','Units','normalized', 'Position', [2*ii+2*ww 0.95-5*ii-4.2*hh ww hh/2],'BackgroundColor',BackgroundColor,'Tag','Angle_title_1',...
    1146     'String','x axis','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','center');%title
    1147 uicontrol('Style','text','Units','normalized', 'Position', [3*ii+3*ww 0.95-5*ii-4.2*hh ww hh/2],'BackgroundColor',BackgroundColor,'Tag','Angle_title_2',...
    1148     'String','y axis','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','center');%title
     1148uicontrol('Style','text','Units','normalized', 'Position', [2*ii+2*ww 0.95-3*ii-3.5*hh ww hh/2],'BackgroundColor',BackgroundColor,...
     1149    'String','first','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','center');%title
     1150uicontrol('Style','text','Units','normalized', 'Position', [3*ii+3*ww 0.95-3*ii-3.5*hh ww hh/2],'BackgroundColor',BackgroundColor,...
     1151    'String','last','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','center');%title
     1152uicontrol('Style','text','Units','normalized', 'Position', [ii 0.95-5*ii-4*hh 2*ww hh/2],'BackgroundColor',BackgroundColor,'Tag','Angle_title_1',...
     1153    'String','tild angle x axis','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','center');%title
     1154uicontrol('Style','text','Units','normalized', 'Position', [ii 0.95-6*ii-5*hh 2*ww hh/2],'BackgroundColor',BackgroundColor,'Tag','Angle_title_2',...
     1155    'String','tild angle y axis','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','center');%title
    11491156%  raw 6 of the GUI
    1150 uicontrol('Style','text','Units','normalized', 'Position', [ii 0.95-5*ii-4.75*hh 2*ww hh/2],'BackgroundColor',BackgroundColor,'Tag','NbSlice_title',...
    1151     'String','tilt angle','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','right');%title
    1152 uicontrol('Style','edit','Units','normalized', 'Position', [3*ii+2*ww 0.95-5*ii-5*hh ww hh],'tag','num_SliceAngle_1','BackgroundColor',[1 1 1],...
    1153     'String',num2str(SliceAngle(1)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_SliceAngle_1'':slice angle of inclination around the x axis');%edit box
    1154 uicontrol('Style','edit','Units','normalized', 'Position', [4*ii+3*ww 0.95-5*ii-5*hh ww hh],'tag','num_SliceAngle_2','BackgroundColor',[1 1 1],...
    1155     'String',num2str(SliceAngle(2)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_SliceAngle_1'':slice angle of inclination around the y axis');%edit box
     1157% uicontrol('Style','text','Units','normalized', 'Position', [ii 0.95-5*ii-4.75*hh 2*ww hh/2],'BackgroundColor',BackgroundColor,'Tag','NbSlice_title',...
     1158%     'String','tilt angle','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','right');%title
     1159uicontrol('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],...
     1160    '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
     1161uicontrol('Style','edit','Units','normalized', 'Position', [4*ii+3*ww 0.95-5*ii-4.2*hh ww hh],'tag','num_SliceAngle_1_2','BackgroundColor',[1 1 1],...
     1162    'String',num2str(SliceAngle(2)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_SliceAngle_1_2'':last slice angle of inclination around the x axis');%edit box
     1163uicontrol('Style','edit','Units','normalized', 'Position', [3*ii+2*ww 0.95-6*ii-5.2*hh ww hh],'tag','num_SliceAngle_2_1','BackgroundColor',[1 1 1],...
     1164    'String',num2str(SliceAngle(1)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_SliceAngle_2_1'':first slice angle of inclination around the y axis');%edit box
     1165uicontrol('Style','edit','Units','normalized', 'Position', [4*ii+3*ww 0.95-6*ii-5.2*hh ww hh],'tag','num_SliceAngle_2_2','BackgroundColor',[1 1 1],...
     1166    'String',num2str(SliceAngle(2)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_SliceAngle_2_2'':last slice angle of inclination around the y axis');%edit box
     1167
    11561168%  raw 7 of the GUI: pushbuttons
    11571169wwp=(1-4*ii)/3; %width of the push buttons
     
    11651177
    11661178%------------------------------------------------------------------------
     1179% function called by selecting CheckRefraction in the GUI set_slices
     1180function set_slice_CheckRefraction_Callback(hObject,eventdata)
     1181%------------------------------------------------------------------------   
     1182hset_slice=get(hObject,'parent');
     1183h_refraction(1)=findobj(hset_slice,'String','surface');
     1184h_refraction(2)=findobj(hset_slice,'Tag','num_H');
     1185h_refraction(3)=findobj(hset_slice,'String','index');
     1186h_refraction(4)=findobj(hset_slice,'Tag','num_RefractionIndex');
     1187if isequal(get(hObject,'Value'),1)
     1188    set(h_refraction,'Visible','on')
     1189else
     1190    set(h_refraction,'Visible','off')
     1191end
     1192
     1193%------------------------------------------------------------------------
    11671194% function called by pressing APPLY in the GUI  set_slices
    11681195function set_slice_APPLY_Callback(hObject,eventdata)
     
    11731200hhuvmat=guidata(huvmat);
    11741201[RootPath,SubDir,RootFile,FileIndex,FileExt]=read_file_boxes(hhuvmat);
    1175 FileName=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];%name of the xml file for calibration
     1202FileName=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];%name of the current input file
    11761203[RootPath,SubDir,RootFile,tild,tild,tild,tild,FileExt]=fileparts_uvmat(FileName);
    1177 XmlFile=find_imadoc(RootPath,SubDir,RootFile,FileExt);
    1178 [s,errormsg]=imadoc2struct(XmlFile,'GeometryCalib');
     1204XmlFile=find_imadoc(RootPath,SubDir,RootFile,FileExt);%find name of the relevant xml file
     1205[s,errormsg]=imadoc2struct(XmlFile,'GeometryCalib');%read the xml file
    11791206if~isempty(errormsg)
    11801207    msgbox_uvmat('ERROR',errormsg)
    11811208    return
    11821209end
    1183 GeometryCalib=s.GeometryCalib;
     1210GeometryCalib=s.GeometryCalib;% get thegeometric calibration data
    11841211
    11851212%% read the content of the GUI set_slice
     
    11931220GeometryCalib.SliceAngle(:,2)=SliceData.SliceAngle(2)*ones(GeometryCalib.NbSlice,1);%rotation around y axis (to generalise)
    11941221GeometryCalib.SliceAngle(:,3)=0;
    1195 GeometryCalib.InterfaceCoord=[0 0 SliceData.H];
    1196 GeometryCalib.RefractionIndex=SliceData.RefractionIndex;
     1222if SliceData.CheckRefraction
     1223    GeometryCalib.InterfaceCoord=[0 0 SliceData.H];
     1224    GeometryCalib.RefractionIndex=SliceData.RefractionIndex;
     1225end
    11971226
    11981227%% store the result in the xml file used for calibration
     
    12221251
    12231252%% open the GUI browse_data
    1224 answer=msgbox_uvmat('INPUT_TXT','Campaign to calibrate with slice position?',fileparts(RootPath));
    1225 if strcmp(answer,'Cancel')
    1226     return
    1227 end
    1228 OutPut=browse_data(answer);
     1253% answer=msgbox_uvmat('INPUT_TXT','Campaign to calibrate with slice position?',fileparts(RootPath));
     1254% if strcmp(answer,'Cancel')
     1255%     return
     1256% end
     1257OutPutDir=uigetfile_uvmat('Campaign to calibrate with slice position?',fileparts(RootPath),'uigetdir');
     1258OutPut=browse_data(OutPutDir);
    12291259nbcalib=0;
    12301260for ilist=1:numel(OutPut.Experiment)
     
    12471277    GeometryCalib.SliceAngle(:,2)=SliceData.SliceAngle(2)*ones(GeometryCalib.NbSlice,1);%rotation around y axis (to generalise)
    12481278    GeometryCalib.SliceAngle(:,3)=0;
    1249     GeometryCalib.InterfaceCoord=[0 0 SliceData.H];
    1250     GeometryCalib.RefractionIndex=SliceData.RefractionIndex;
     1279    if SliceData.CheckRefraction
     1280        GeometryCalib.InterfaceCoord=[0 0 SliceData.H];
     1281        GeometryCalib.RefractionIndex=SliceData.RefractionIndex;
     1282    end
    12511283   
    12521284    % update the current xml file
     
    48724904
    48734905%% delete drawn objects if the output CooordUnit is different from the previous one
    4874 if  ~isempty(CoordUnit) && ~isempty(CoordUnitPrev) && ~strcmp(CoordUnit,CoordUnitPrev)
     4906if  ~strcmp(CoordUnit,CoordUnitPrev)
     4907%     for iobj=1:numel(UvData.ProjObject)
     4908%         delete_object(iobj)
     4909%     end
    48754910    set(handles.CheckFixLimits,'Value',0)
    48764911    hother=findobj('Tag','proj_object');%find all the proj objects
    48774912    for iobj=1:length(hother)
    4878         delete_object(hother(iobj))
     4913        delete(hother(iobj))
    48794914    end
    48804915    hother=findobj('Tag','DeformPoint');%find all the proj objects
    48814916    for iobj=1:length(hother)
    4882         delete_object(hother(iobj))
     4917        delete(hother(iobj))
    48834918    end
    48844919    hh=findobj('Tag','calib_points');
Note: See TracChangeset for help on using the changeset viewer.