Changeset 837 for trunk/src/uvmat.m
- Timestamp:
- Dec 8, 2014, 1:04:22 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/uvmat.m
r831 r837 1120 1120 'String','last','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','center');%title 1121 1121 uicontrol('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');%title1122 'String','surface','Visible','off','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','center');%title 1123 1123 % raw 2 of the GUI 1124 1124 uicontrol('Style','text','Units','normalized', 'Position', [ii 0.95-2*ii-0.75*hh ww hh/2],'BackgroundColor',BackgroundColor,... … … 1129 1129 'String',num2str(SliceCoord(end,3)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_Z_2'': z position of last slice');%edit box 1130 1130 uicontrol('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 box1131 '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 1132 1132 % 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 1133 uicontrol('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'); 1136 uicontrol('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 1135 1138 uicontrol('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'); 1137 1140 % raw 4 of the GUI 1138 1141 uicontrol('Style','text','Units','normalized', 'Position', [ii 0.95-4*ii-3.25*hh ww hh],'BackgroundColor',BackgroundColor,'Tag','NbSlice_title',... … … 1143 1146 'String','volume scan','Value',CheckVolumeScan,'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''CheckVolumeScan'':=1 for volume scan (z varies with j index)'); 1144 1147 % 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 1148 uicontrol('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 1150 uicontrol('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 1152 uicontrol('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 1154 uicontrol('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 1149 1156 % 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 1159 uicontrol('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 1161 uicontrol('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 1163 uicontrol('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 1165 uicontrol('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 1156 1168 % raw 7 of the GUI: pushbuttons 1157 1169 wwp=(1-4*ii)/3; %width of the push buttons … … 1165 1177 1166 1178 %------------------------------------------------------------------------ 1179 % function called by selecting CheckRefraction in the GUI set_slices 1180 function set_slice_CheckRefraction_Callback(hObject,eventdata) 1181 %------------------------------------------------------------------------ 1182 hset_slice=get(hObject,'parent'); 1183 h_refraction(1)=findobj(hset_slice,'String','surface'); 1184 h_refraction(2)=findobj(hset_slice,'Tag','num_H'); 1185 h_refraction(3)=findobj(hset_slice,'String','index'); 1186 h_refraction(4)=findobj(hset_slice,'Tag','num_RefractionIndex'); 1187 if isequal(get(hObject,'Value'),1) 1188 set(h_refraction,'Visible','on') 1189 else 1190 set(h_refraction,'Visible','off') 1191 end 1192 1193 %------------------------------------------------------------------------ 1167 1194 % function called by pressing APPLY in the GUI set_slices 1168 1195 function set_slice_APPLY_Callback(hObject,eventdata) … … 1173 1200 hhuvmat=guidata(huvmat); 1174 1201 [RootPath,SubDir,RootFile,FileIndex,FileExt]=read_file_boxes(hhuvmat); 1175 FileName=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];%name of the xml file for calibration1202 FileName=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];%name of the current input file 1176 1203 [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'); 1204 XmlFile=find_imadoc(RootPath,SubDir,RootFile,FileExt);%find name of the relevant xml file 1205 [s,errormsg]=imadoc2struct(XmlFile,'GeometryCalib');%read the xml file 1179 1206 if~isempty(errormsg) 1180 1207 msgbox_uvmat('ERROR',errormsg) 1181 1208 return 1182 1209 end 1183 GeometryCalib=s.GeometryCalib; 1210 GeometryCalib=s.GeometryCalib;% get thegeometric calibration data 1184 1211 1185 1212 %% read the content of the GUI set_slice … … 1193 1220 GeometryCalib.SliceAngle(:,2)=SliceData.SliceAngle(2)*ones(GeometryCalib.NbSlice,1);%rotation around y axis (to generalise) 1194 1221 GeometryCalib.SliceAngle(:,3)=0; 1195 GeometryCalib.InterfaceCoord=[0 0 SliceData.H]; 1196 GeometryCalib.RefractionIndex=SliceData.RefractionIndex; 1222 if SliceData.CheckRefraction 1223 GeometryCalib.InterfaceCoord=[0 0 SliceData.H]; 1224 GeometryCalib.RefractionIndex=SliceData.RefractionIndex; 1225 end 1197 1226 1198 1227 %% store the result in the xml file used for calibration … … 1222 1251 1223 1252 %% 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 1257 OutPutDir=uigetfile_uvmat('Campaign to calibrate with slice position?',fileparts(RootPath),'uigetdir'); 1258 OutPut=browse_data(OutPutDir); 1229 1259 nbcalib=0; 1230 1260 for ilist=1:numel(OutPut.Experiment) … … 1247 1277 GeometryCalib.SliceAngle(:,2)=SliceData.SliceAngle(2)*ones(GeometryCalib.NbSlice,1);%rotation around y axis (to generalise) 1248 1278 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 1251 1283 1252 1284 % update the current xml file … … 4872 4904 4873 4905 %% delete drawn objects if the output CooordUnit is different from the previous one 4874 if ~isempty(CoordUnit) && ~isempty(CoordUnitPrev) && ~strcmp(CoordUnit,CoordUnitPrev) 4906 if ~strcmp(CoordUnit,CoordUnitPrev) 4907 % for iobj=1:numel(UvData.ProjObject) 4908 % delete_object(iobj) 4909 % end 4875 4910 set(handles.CheckFixLimits,'Value',0) 4876 4911 hother=findobj('Tag','proj_object');%find all the proj objects 4877 4912 for iobj=1:length(hother) 4878 delete _object(hother(iobj))4913 delete(hother(iobj)) 4879 4914 end 4880 4915 hother=findobj('Tag','DeformPoint');%find all the proj objects 4881 4916 for iobj=1:length(hother) 4882 delete _object(hother(iobj))4917 delete(hother(iobj)) 4883 4918 end 4884 4919 hh=findobj('Tag','calib_points');
Note: See TracChangeset
for help on using the changeset viewer.