Changeset 1062
- Timestamp:
- Mar 21, 2019, 6:35:43 PM (6 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/geometry_calib.m
r1061 r1062 3 3 % function hgeometry_calib = geometry_calib(inputfile,pos) 4 4 % 5 %OUTPUT: 5 %OUTPUT: 6 6 % hgeometry_calib=current handles of the GUI geometry_calib.fig 7 7 % 8 8 %INPUT: 9 9 % inputfile: (optional) name of an xml file containing coordinates of reference points 10 % pos: (optional) 4 element vector setting the 'Position' of the GUI 10 % pos: (optional) 4 element vector setting the 'Position' of the GUI 11 11 12 12 %======================================================================= … … 57 57 gui_Singleton = 1; 58 58 gui_State = struct('gui_Name', mfilename, ... 59 60 61 62 63 59 'gui_Singleton', gui_Singleton, ... 60 'gui_OpeningFcn', @geometry_calib_OpeningFcn, ... 61 'gui_OutputFcn', @geometry_calib_OutputFcn, ... 62 'gui_LayoutFcn', [] , ... 63 'gui_Callback', []); 64 64 if nargin 65 [pp,ff]=fileparts(which(varargin{1})); % name of the input file66 if strcmp(ff,mfilename)% if we are activating a sub-function of geometry_calib67 % ~isempty(regexp(varargin{1},'_Callback','once'))68 gui_State.gui_Callback = str2func(varargin{1});69 end65 [pp,ff]=fileparts(which(varargin{1})); % name of the input file 66 if strcmp(ff,mfilename)% if we are activating a sub-function of geometry_calib 67 % ~isempty(regexp(varargin{1},'_Callback','once')) 68 gui_State.gui_Callback = str2func(varargin{1}); 69 end 70 70 end 71 71 … … 79 79 80 80 % --- Executes just before geometry_calib is made visible. 81 %INPUT: 81 %INPUT: 82 82 %handles: handles of the geometry_calib interface elements 83 83 % PlotHandles: set of handles of the elements contolling the plotting … … 86 86 function geometry_calib_OpeningFcn(hObject, eventdata, handles,inputfile) 87 87 %------------------------------------------------------------------------ 88 % Choose default command line output for geometry_calib89 88 90 89 handles.output = hObject; 91 92 90 % Update handles structure 93 91 guidata(hObject, handles); 94 92 set(hObject,'DeleteFcn',{@closefcn})% 95 %set(hObject,'WindowButtonDownFcn',{'mouse_alt_gui',handles}) % allows mouse action with right button (zoom for uicontrol display)96 93 97 94 %% position … … 124 121 set(handles.geometry_calib,'Position',[Left Bottom 420 Height]) 125 122 126 % set menu of calibration options123 %% set menu of calibration options 127 124 set(handles.calib_type,'String',{'rescale';'linear';'3D_linear';'3D_quadr';'3D_extrinsic'}) 128 125 if exist('inputfile','var')&& ~isempty(inputfile) … … 135 132 struct.Campaign=Heading.Campaign; 136 133 end 137 end 134 end 138 135 set(hObject,'UserData',struct) 139 136 end … … 146 143 varargout{1} = handles.output; 147 144 varargout{2}=handles; 148 %145 149 146 %------------------------------------------------------------------------ 150 147 % executed when closing: set the parent interface button to value 0 … … 162 159 if ~isempty(hobject) 163 160 delete(hobject) 164 end 165 end 166 161 end 162 end 163 167 164 %------------------------------------------------------------------------ 168 165 % --- Executes on button press APPLY (used to launch the calibration). 169 function APPLY_Callback(hObject, eventdata, handles) 170 set(handles.CheckEnableMouse,'Value',0)% desactivate mouse (to avoid spurious creation of new points) 171 172 %------------------------------------------------------------------------ 173 %% look for the GUI uvmat and check for an image as input 174 set(handles.APPLY,'BackgroundColor',[1 1 0])% paint APPLY button in yellow to show activation 175 huvmat=findobj(allchild(0),'Name','uvmat');% look for the GUI uvmat 176 hhuvmat=guidata(huvmat);%handles of elements in the GUI uvmat 177 if ~strcmp(get(hhuvmat.Scalar,'Visible'),'on') 178 msgbox_uvmat('ERROR','An image needs to be opened in uvmat for calibration') 179 return 180 end 181 182 RootPath=''; 183 if ~isempty(hhuvmat.RootPath)&& ~isempty(hhuvmat.RootFile) 184 RootPath=get(hhuvmat.RootPath,'String');% path to the currently displayed image 185 SubDirBase=regexprep(get(hhuvmat.SubDir,'String'),'\..+$',''); 186 outputfile=[fullfile(RootPath,SubDirBase) '.xml'];%xml file associated with the currently displayed image 187 else 188 question={'save the calibration data and point coordinates in'}; 189 def={fullfile(RootPath,'ObjectCalib.xml')}; 190 options.Resize='on'; 191 answer=inputdlg(question,'',1,def,options); 192 outputfile=answer{1}; 193 end 194 195 %% read coordinates of the calibration poinnts: Coord(:,1-3) in phys, Coord(:,4-5) image 196 Coord=get(handles.ListCoord,'Data'); 197 198 199 %% read the type of calibration 200 calib_cell=get(handles.calib_type,'String'); 201 val=get(handles.calib_type,'Value'); 202 CalibFcn=['calib_' calib_cell{val}]; 203 204 %% read the intrinsic parameters 205 Intrinsic.Npx=str2num(get(hhuvmat.num_Npx,'String')); 206 Intrinsic.Npy=str2num(get(hhuvmat.num_Npy,'String')); 207 Intrinsic.coord_files=get(handles.ListCoordFiles,'String'); 208 Intrinsic.fx=str2num(get(handles.fx,'String')); 209 Intrinsic.fy=str2num(get(handles.fy,'String')); 210 Intrinsic.kc=str2num(get(handles.kc,'String')); 211 Intrinsic.Cx=str2num(get(handles.Cx,'String')); 212 Intrinsic.Cy=str2num(get(handles.Cy,'String')); 213 if isempty(Intrinsic.kc) 214 Intrinsic.kc=0; 215 end 216 if isempty(Intrinsic.Cx)||isempty(Intrinsic.Cy) 217 Intrinsic.Cx=Intrinsic.Npx/2; 218 Intrinsic.Cy=Intrinsic.Npy/2; 219 end 220 221 %% apply to cropped images if requested 222 if get(handles.Replicate,'Value') 223 answer=msgbox_uvmat('INPUT_Y-N','apply to full images (not cropped)?'); 224 if strcmp(answer,'No') 225 prompt = {'npy_lower'}; 226 dlg_title = 'remove image the npy_lower image lines (removal of the upper line does not change calibration)'; 227 num_lines= 1; 228 def = {'0'}; 229 answer = inputdlg(prompt,dlg_title,num_lines,def); 230 npy_crop=str2num(answer{1}); 231 Intrinsic.Npy=Intrinsic.Npy-npy_crop; %size of the filtering window 232 Coord(:,5)=Coord(:,5)-npy_crop;% shift the image ordinates of the calibration points by removing the lower band 233 end 234 end 235 236 %% Apply calibration 237 [GeometryCalib,index,ind_removed,Z_plane]=calibrate(Coord,CalibFcn,Intrinsic);% apply calibration 238 239 %% record the coordinate unit 240 unitlist=get(handles.CoordUnit,'String'); 241 unit=unitlist{get(handles.CoordUnit,'value')}; 242 GeometryCalib.CoordUnit=unit; 243 244 %% record the coordinates of the calibration points 245 GeometryCalib.SourceCalib.PointCoord=Coord; 246 247 %% display calibration results on the GUI geometry_calib 248 display_intrinsic(GeometryCalib,handles)%display calibration intrinsic parameters 249 display_extrinsic(GeometryCalib,handles)%display calibration extrinsic parameters 250 % (rotation and translation of camera with respect to the phys coordinates) 251 252 %% set the defqult plane and display the calibration data errors for validation 253 answer=msgbox_uvmat('INPUT_Y-N',{'store calibration data';... 254 ['Error rms (along x,y)=' num2str(GeometryCalib.ErrorRms) ' pixels'];... 255 ['Error max (along x,y)=' num2str(GeometryCalib.ErrorMax) ' pixels']; 256 [num2str(numel(ind_removed)) ' points removed']}); 257 if strcmp(answer,'Yes') %store the calibration data 258 if strcmp(calib_cell{val}(1:2),'3D')%set the plane position for 3D (projection) calibration 259 answer=msgbox_uvmat('INPUT_Y-N',{['Assume that the current image is in the plane of the calib points z=' num2str(Z_plane) ] ; 'can be later modified by MenuSetSlice in the upper bar menu of uvmat'}); 260 SliceCoord_ref=Z_plane'*[0 0 1]; 261 end 262 else 263 GeometryCalib=[]; 264 index=1; 265 end 266 267 if ~isempty(GeometryCalib) % if calibration is not cancelled 268 if get(handles.Replicate,'Value') 269 %% open the GUI browse_data 270 hbrowse=findobj(allchild(0),'Tag','browse_data'); 271 if ~isempty(hbrowse) 272 BrowseHandles=guidata(hbrowse); 273 SourceDir=get(BrowseHandles.SourceDir,'String'); 274 ListExperiments=get(BrowseHandles.ListExperiments,'String'); 275 ListValues=get(BrowseHandles.ListExperiments,'Value'); 276 ListExperiments=ListExperiments(ListValues); 277 ListDevices=get(BrowseHandles.ListDevices,'String'); 278 Val=get(BrowseHandles.ListDevices,'Value'); 279 DataFolder=ListDevices{Val}; 280 nbcalib=0; 281 for ilist=1:numel(ListExperiments) 282 SubDirBase=regexprep(DataFolder,'+/',''); 283 ListExperiments{ilist}=regexprep(ListExperiments{ilist},'+/',''); 284 XmlName=fullfile(SourceDir,ListExperiments{ilist},[SubDirBase '.xml']); 285 % copy the xml file from the old location if appropriate, then update with the calibration parameters 286 % if ~exist(XmlName,'file') && ~isempty(SubDirBase) 287 % oldxml=fullfile(OutPut.Campaign,OutPut.Experiment{ilist},SubDirBase,[get(hhuvmat.RootFile,'String') '.xml']); 288 GeometryCalib.SliceCoord=SliceCoord_ref;%default input 289 if exist(XmlName,'file') 290 %[success,message]=copyfile(oldxml,XmlName);%copy the old xml file to a new one with the new convention 291 dispmesGeometryCalib=UvData.XmlData{1}.GeometryCalib; 292 else 293 msgbox_uvmat('ERROR','3D geometric calibration needed before defining slices') 294 return 295 end 296 SliceCoord=GeometryCalib.SliceCoord; 297 InterfaceCoord=min(SliceCoord(:,3)); 298 if isfield(GeometryCalib,'InterfaceCoord') 299 InterfaceCoord=GeometryCalib.InterfaceCoord(1,3); 300 end 301 NbSlice=size(SliceCoord,1); 302 CheckVolumeScan=0; 303 if isfield(GeometryCalib,'CheckVolumeScan') 304 CheckVolumeScan=GeometryCalib.CheckVolumeScan; 305 end 306 RefractionIndex=1.33; 307 CheckRefraction=0;% default value of the check box refraction 308 if isfield(GeometryCalib,'RefractionIndex') 309 RefractionIndex=GeometryCalib.RefractionIndex; 310 CheckRefraction=1; 311 end 312 SliceAngle=[0 0 0]; 313 if isfield(GeometryCalib,'SliceAngle') 314 SliceAngle=GeometryCalib.SliceAngle; 315 end 316 dispmessage=' updated with calibration parameters'; 317 % if ~strcmp(answer,'yes') 318 [XmlDataOld,warntext]=imadoc2struct(XmlName); 319 if isfield(XmlDataOld,'GeometryCalib') 320 if isfield(XmlDataOld.GeometryCalib,'SliceAngle') 321 GeometryCalib.SliceAngle=XmlDataOld.GeometryCalib.SliceAngle; 322 end 323 if isfield(XmlDataOld.GeometryCalib,'CheckRefraction') 324 GeometryCalib.SliceAngle=XmlDataOld.GeometryCalib.CheckRefraction; 325 end 326 if isfield(XmlDataOld.GeometryCalib,'RefractionIndex') 327 GeometryCalib.SliceAngle=XmlDataOld.GeometryCalib.RefractionIndex; 328 end 329 if isfield(XmlDataOld.GeometryCalib,'InterfaceCoord') 330 GeometryCalib.SliceAngle=XmlDataOld.GeometryCalib.InterfaceCoord; 331 end 332 end 333 334 end 335 336 else 337 dispmessage=' created with calibration parameters'; 166 function APPLY_Callback(hObject, eventdata, handles) 167 set(handles.CheckEnableMouse,'Value',0)% desactivate mouse (to avoid spurious creation of new points) 168 169 %------------------------------------------------------------------------ 170 %% look for the GUI uvmat and check for an image as input 171 set(handles.APPLY,'BackgroundColor',[1 1 0])% paint APPLY button in yellow to show activation 172 huvmat=findobj(allchild(0),'Name','uvmat');% look for the GUI uvmat 173 hhuvmat=guidata(huvmat);%handles of elements in the GUI uvmat 174 if ~strcmp(get(hhuvmat.Scalar,'Visible'),'on') 175 msgbox_uvmat('ERROR','An image needs to be opened in uvmat for calibration') 176 return 177 end 178 179 RootPath=''; 180 if ~isempty(hhuvmat.RootPath)&& ~isempty(hhuvmat.RootFile) 181 RootPath=get(hhuvmat.RootPath,'String');% path to the currently displayed image 182 SubDirBase=regexprep(get(hhuvmat.SubDir,'String'),'\..+$',''); 183 outputfile=[fullfile(RootPath,SubDirBase) '.xml'];%xml file associated with the currently displayed image 184 else 185 question={'save the calibration data and point coordinates in'}; 186 def={fullfile(RootPath,'ObjectCalib.xml')}; 187 options.Resize='on'; 188 answer=inputdlg(question,'',1,def,options); 189 outputfile=answer{1}; 190 end 191 192 %% read coordinates of the calibration poinnts: Coord(:,1-3) in phys, Coord(:,4-5) image 193 Coord=get(handles.ListCoord,'Data'); 194 195 196 %% read the type of calibration 197 calib_cell=get(handles.calib_type,'String'); 198 val=get(handles.calib_type,'Value'); 199 CalibFcn=['calib_' calib_cell{val}]; 200 201 %% read the intrinsic parameters 202 Intrinsic.Npx=str2num(get(hhuvmat.num_Npx,'String')); 203 Intrinsic.Npy=str2num(get(hhuvmat.num_Npy,'String')); 204 Intrinsic.coord_files=get(handles.ListCoordFiles,'String'); 205 Intrinsic.fx=str2num(get(handles.fx,'String')); 206 Intrinsic.fy=str2num(get(handles.fy,'String')); 207 Intrinsic.kc=str2num(get(handles.kc,'String')); 208 Intrinsic.Cx=str2num(get(handles.Cx,'String')); 209 Intrinsic.Cy=str2num(get(handles.Cy,'String')); 210 if isempty(Intrinsic.kc) 211 Intrinsic.kc=0; 212 end 213 if isempty(Intrinsic.Cx)||isempty(Intrinsic.Cy) 214 Intrinsic.Cx=Intrinsic.Npx/2; 215 Intrinsic.Cy=Intrinsic.Npy/2; 216 end 217 218 %% apply to cropped images if requested 219 if get(handles.Replicate,'Value') 220 answer=msgbox_uvmat('INPUT_Y-N','apply to full images (not cropped)?'); 221 if strcmp(answer,'No') 222 prompt = {'npy_lower'}; 223 dlg_title = 'remove image the npy_lower image lines (removal of the upper line does not change calibration)'; 224 num_lines= 1; 225 def = {'0'}; 226 answer = inputdlg(prompt,dlg_title,num_lines,def); 227 npy_crop=str2num(answer{1}); 228 Intrinsic.Npy=Intrinsic.Npy-npy_crop; %size of the filtering window 229 Coord(:,5)=Coord(:,5)-npy_crop;% shift the image ordinates of the calibration points by removing the lower band 230 end 231 end 232 233 %% Apply calibration 234 [GeometryCalib,index,ind_removed,Z_plane]=calibrate(Coord,CalibFcn,Intrinsic);% apply calibration 235 if isempty(GeometryCalib) 236 return 237 end 238 239 %% record the coordinate unit 240 unitlist=get(handles.CoordUnit,'String'); 241 unit=unitlist{get(handles.CoordUnit,'value')}; 242 GeometryCalib.CoordUnit=unit; 243 244 %% record the coordinates of the calibration points 245 GeometryCalib.SourceCalib.PointCoord=Coord; 246 247 %% display calibration results on the GUI geometry_calib 248 display_intrinsic(GeometryCalib,handles)%display calibration intrinsic parameters 249 display_extrinsic(GeometryCalib,handles)%display calibration extrinsic parameters 250 % (rotation and translation of camera with respect to the phys coordinates) 251 252 %% set the default plane and display the calibration data errors for validation 253 answer=msgbox_uvmat('INPUT_Y-N',{'store calibration data';... 254 ['Error rms (along x,y)=' num2str(GeometryCalib.ErrorRms) ' pixels'];... 255 ['Error max (along x,y)=' num2str(GeometryCalib.ErrorMax) ' pixels']; 256 [num2str(numel(ind_removed)) ' points removed']}); 257 if strcmp(answer,'Yes') %store the calibration data 258 if strcmp(calib_cell{val}(1:2),'3D')%set the plane position for 3D (projection) calibration 259 answer=msgbox_uvmat('INPUT_Y-N',{['Assume that the current image is in the plane of the calib points z=' num2str(Z_plane) ] ; 'can be later modified by MenuSetSlice in the upper bar menu of uvmat'}); 260 SliceCoord_ref=Z_plane'*[0 0 1]; 261 end 262 else 263 GeometryCalib=[]; 264 index=1; 265 end 266 267 if ~isempty(GeometryCalib) % if calibration is not cancelled 268 %%%%% use of the option 'replicate' 269 if get(handles.Replicate,'Value')% if the option replicate is activated 270 %% open the GUI browse_data 271 hbrowse=findobj(allchild(0),'Tag','browse_data'); 272 if ~isempty(hbrowse)% look for the GUI 'replicate' 273 BrowseHandles=guidata(hbrowse); 274 SourceDir=get(BrowseHandles.SourceDir,'String'); 275 ListExperiments=get(BrowseHandles.ListExperiments,'String'); 276 ListValues=get(BrowseHandles.ListExperiments,'Value'); 277 ListExperiments=ListExperiments(ListValues); 278 ListDevices=get(BrowseHandles.ListDevices,'String'); 279 Val=get(BrowseHandles.ListDevices,'Value'); 280 DataFolder=ListDevices{Val}; 281 nbcalib=0; 282 for ilist=1:numel(ListExperiments) 283 SubDirBase=regexprep(DataFolder,'+/',''); 284 ListExperiments{ilist}=regexprep(ListExperiments{ilist},'+/',''); 285 XmlName=fullfile(SourceDir,ListExperiments{ilist},[SubDirBase '.xml']); 286 % copy the xml file from the old location if appropriate, then update with the calibration parameters 287 % if ~exist(XmlName,'file') && ~isempty(SubDirBase) 288 % oldxml=fullfile(OutPut.Campaign,OutPut.Experiment{ilist},SubDirBase,[get(hhuvmat.RootFile,'String') '.xml']); 289 GeometryCalib.SliceCoord=SliceCoord_ref;%default input 290 if exist(XmlName,'file') 291 %[success,message]=copyfile(oldxml,XmlName);%copy the old xml file to a new one with the new convention 292 dispmesGeometryCalib=UvData.XmlData{1}.GeometryCalib; 293 else 294 msgbox_uvmat('ERROR','3D geometric calibration needed before defining slices') 295 return 296 end 297 SliceCoord=GeometryCalib.SliceCoord; 298 InterfaceCoord=min(SliceCoord(:,3)); 299 if isfield(GeometryCalib,'InterfaceCoord') 300 InterfaceCoord=GeometryCalib.InterfaceCoord(1,3); 301 end 302 NbSlice=size(SliceCoord,1); 303 CheckVolumeScan=0; 304 if isfield(GeometryCalib,'CheckVolumeScan') 305 CheckVolumeScan=GeometryCalib.CheckVolumeScan; 306 end 307 RefractionIndex=1.33; 308 CheckRefraction=0;% default value of the check box refraction 309 if isfield(GeometryCalib,'RefractionIndex') 310 RefractionIndex=GeometryCalib.RefractionIndex; 311 CheckRefraction=1; 312 end 313 SliceAngle=[0 0 0]; 314 if isfield(GeometryCalib,'SliceAngle') 315 SliceAngle=GeometryCalib.SliceAngle; 316 end 317 dispmessage=' updated with calibration parameters'; 318 % if ~strcmp(answer,'yes') 319 [XmlDataOld,warntext]=imadoc2struct(XmlName); 320 if isfield(XmlDataOld,'GeometryCalib') 321 if isfield(XmlDataOld.GeometryCalib,'SliceAngle') 322 GeometryCalib.SliceAngle=XmlDataOld.GeometryCalib.SliceAngle; 338 323 end 339 errormsg=update_imadoc(GeometryCalib,XmlName,'GeometryCalib');% introduce the calibration data in the xml file 340 if ~strcmp(errormsg,'') 341 msgbox_uvmat('ERROR',errormsg); 342 else 343 display([XmlName dispmessage]) 344 nbcalib=nbcalib+1; 324 if isfield(XmlDataOld.GeometryCalib,'CheckRefraction') 325 GeometryCalib.SliceAngle=XmlDataOld.GeometryCalib.CheckRefraction; 326 end 327 if isfield(XmlDataOld.GeometryCalib,'RefractionIndex') 328 GeometryCalib.SliceAngle=XmlDataOld.GeometryCalib.RefractionIndex; 329 end 330 if isfield(XmlDataOld.GeometryCalib,'InterfaceCoord') 331 GeometryCalib.SliceAngle=XmlDataOld.GeometryCalib.InterfaceCoord; 345 332 end 346 333 end 347 348 334 end 349 msgbox_uvmat('CONFIMATION',[SubDirBase ' calibrated for ' num2str(nbcalib) ' experiments']); 335 336 else % in case the GUI 'replicate'is not found 337 dispmessage=' created with calibration parameters'; 338 end 339 errormsg=update_imadoc(GeometryCalib,XmlName,'GeometryCalib');% introduce the calibration data in the xml file 340 if ~strcmp(errormsg,'') 341 msgbox_uvmat('ERROR',errormsg); 350 342 else 351 352 %% copy the xml file from the old location if appropriate, then update with the calibration parameters 353 if ~exist(outputfile,'file') && ~isempty(SubDirBase) 354 oldxml=[fullfile(RootPath,SubDirBase,get(hhuvmat.RootFile,'String')) '.xml']; 355 if exist(oldxml,'file') 356 [success,message]=copyfile(oldxml,outputfile);%copy the old xml file to a new one with the new convention 357 end 358 end 359 errormsg=update_imadoc(GeometryCalib,outputfile,'GeometryCalib');% introduce the calibration data in the xml file 360 if ~strcmp(errormsg,'') 361 msgbox_uvmat('ERROR',errormsg); 362 end 363 364 %% display image with new calibration in the currently opened uvmat interface 365 FieldList=get(hhuvmat.FieldName,'String'); 366 val=get(hhuvmat.FieldName,'Value'); 367 if strcmp(FieldList{val},'image') 368 set(hhuvmat.CheckFixLimits,'Value',0)% put FixedLimits option to 'off' to plot the whole image 369 UserData=get(handles.geometry_calib,'UserData'); 370 UserData.XmlInputFile=outputfile;%save the current xml file name 371 set(handles.geometry_calib,'UserData',UserData) 372 uvmat('InputFileREFRESH_Callback',hObject,eventdata,hhuvmat); %file input with xml reading in uvmat, show the image in phys coordinates 373 PLOT_Callback(hObject, eventdata, handles) 374 set(handles.CoordLine,'string',num2str(index)) 375 Coord=get(handles.ListCoord,'Data'); 376 update_calib_marker(Coord(index,:)); %indicate the point with max deviations from phys coord to calibration 377 figure(handles.geometry_calib)% put the GUI geometry_calib in front 378 else 379 msgbox_uvmat('WARNING','open the image to see the effect of the new calibration') 380 end 343 display([XmlName dispmessage]) 344 nbcalib=nbcalib+1; 381 345 end 382 346 end 383 set(handles.APPLY,'BackgroundColor',[1 0 0]) % set APPLY button to red color 384 347 % Use of the option replicate 348 end 349 msgbox_uvmat('CONFIMATION',[SubDirBase ' calibrated for ' num2str(nbcalib) ' experiments']); 350 351 352 %% copy the xml file from the old location if appropriate, then update with the calibration parameters 353 if ~exist(outputfile,'file') && ~isempty(SubDirBase) 354 oldxml=[fullfile(RootPath,SubDirBase,get(hhuvmat.RootFile,'String')) '.xml']; 355 if exist(oldxml,'file') 356 [success,message]=copyfile(oldxml,outputfile);%copy the old xml file to a new one with the new convention 357 end 358 end 359 errormsg=update_imadoc(GeometryCalib,outputfile,'GeometryCalib');% introduce the calibration data in the xml file 360 if ~strcmp(errormsg,'') 361 msgbox_uvmat('ERROR',errormsg); 362 end 363 364 %% display image with new calibration in the currently opened uvmat interface 365 FieldList=get(hhuvmat.FieldName,'String'); 366 val=get(hhuvmat.FieldName,'Value'); 367 if strcmp(FieldList{val},'image') 368 set(hhuvmat.CheckFixLimits,'Value',0)% put FixedLimits option to 'off' to plot the whole image 369 UserData=get(handles.geometry_calib,'UserData'); 370 UserData.XmlInputFile=outputfile;%save the current xml file name 371 set(handles.geometry_calib,'UserData',UserData) 372 uvmat('InputFileREFRESH_Callback',hObject,eventdata,hhuvmat); %file input with xml reading in uvmat, show the image in phys coordinates 373 PLOT_Callback(hObject, eventdata, handles) 374 set(handles.CoordLine,'string',num2str(index)) 375 Coord=get(handles.ListCoord,'Data'); 376 update_calib_marker(Coord(index,:)); %indicate the point with max deviations from phys coord to calibration 377 figure(handles.geometry_calib)% put the GUI geometry_calib in front 378 else 379 msgbox_uvmat('WARNING','open the image to see the effect of the new calibration') 380 end 381 382 set(handles.APPLY,'BackgroundColor',[1 0 0]) % set APPLY button to red color 383 385 384 %------------------------------------------------------------------------ 386 385 % --- Executes on button press in Replicate … … 409 408 index=[]; 410 409 GeometryCalib=[]; 410 ind_max=[];ind_removed=[];Z_plane=[]; 411 411 % apply the calibration, whose type is selected in handles.calib_type 412 412 if ~isempty(Coord) … … 414 414 else 415 415 msgbox_uvmat('ERROR','No calibration points, abort') 416 end 416 end 417 417 if isempty(GeometryCalib) 418 418 return … … 441 441 ind_removed=find(check_x | check_y) 442 442 % repeat calibration without the excluded points: 443 if ~isempty(ind_removed) 443 if ~isempty(ind_removed) 444 444 Coord(ind_removed,:)=[]; 445 445 GeometryCalib=feval(CalibFcn,Coord,Intrinsic); … … 482 482 %------------------------------------------------------------------------ 483 483 % --- determine the parameters for a calibration by a linear transform matrix (rescale and rotation) 484 function GeometryCalib=calib_linear(Coord,Intrinsic) 484 function GeometryCalib=calib_linear(Coord,Intrinsic) 485 485 %------------------------------------------------------------------------ 486 486 X=Coord(:,1); … … 534 534 Calib.Cx=str2num(get(hhuvmat.num_Npx,'String'))/2; 535 535 Calib.Cx=str2num(get(hhuvmat.num_Npy,'String'))/2; 536 end 536 end 537 537 %tsai parameters 538 538 Calib.dpx=0.012;%arbitrary … … 570 570 GeometryCalib.kappa1=calib_param(1); 571 571 GeometryCalib.CoordUnit=[];% default value, to be updated by the calling function 572 GeometryCalib.Tx_Ty_Tz=[calib_param(2) calib_param(3) calib_param(4)]; 572 GeometryCalib.Tx_Ty_Tz=[calib_param(2) calib_param(3) calib_param(4)]; 573 573 alpha=calib_param(5); 574 574 GeometryCalib.R=[cos(alpha) sin(alpha) 0;-sin(alpha) cos(alpha) 0;0 0 -1]; … … 592 592 X_1=Coord(:,1:3)';%phys coordinates of the ref points 593 593 n_ima=numel(coord_files)+1; 594 if ~isempty(coord_files) 594 if ~isempty(coord_files) 595 595 msgbox_uvmat('CONFIRMATION',['The xy coordinates of the calibration points in ' num2str(n_ima) ' planes will be used']) 596 596 for ifile=1:numel(coord_files) 597 t=xmltree(coord_files{ifile});598 s=convert(t);%convert to matlab structure597 t=xmltree(coord_files{ifile}); 598 s=convert(t);%convert to matlab structure 599 599 if isfield(s,'GeometryCalib') 600 600 if isfield(s.GeometryCalib,'SourceCalib') 601 601 if isfield(s.GeometryCalib.SourceCalib,'PointCoord') 602 PointCoord=s.GeometryCalib.SourceCalib.PointCoord;603 Coord_file=zeros(length(PointCoord),5);%default604 for i=1:length(PointCoord)605 line=str2num(PointCoord{i});606 Coord_file(i,4:5)=line(4:5);%px x607 Coord_file(i,1:3)=line(1:3);%phys x608 end609 eval(['x_' num2str(ifile+1) '=Coord_file(:,4:5)'';']);610 eval(['x_' num2str(ifile+1) '(2,:)=ny-x_' num2str(ifile+1) '(2,:);' ]);611 eval(['X_' num2str(ifile+1) '=Coord_file(:,1:3)'';']);602 PointCoord=s.GeometryCalib.SourceCalib.PointCoord; 603 Coord_file=zeros(length(PointCoord),5);%default 604 for i=1:length(PointCoord) 605 line=str2num(PointCoord{i}); 606 Coord_file(i,4:5)=line(4:5);%px x 607 Coord_file(i,1:3)=line(1:3);%phys x 608 end 609 eval(['x_' num2str(ifile+1) '=Coord_file(:,4:5)'';']); 610 eval(['x_' num2str(ifile+1) '(2,:)=ny-x_' num2str(ifile+1) '(2,:);' ]); 611 eval(['X_' num2str(ifile+1) '=Coord_file(:,1:3)'';']); 612 612 end 613 613 end … … 652 652 if ~strcmp(get(hhuvmat.Scalar,'Visible'),'on') 653 653 msgbox_uvmat('ERROR','An image needs to be opened in uvmat for calibration') 654 return654 return 655 655 end 656 656 % check_cond=0; … … 672 672 X_1=Coord(:,1:3)';%phys coordinates of the ref points 673 673 n_ima=numel(coord_files)+1; 674 if ~isempty(coord_files) 674 if ~isempty(coord_files) 675 675 msgbox_uvmat('CONFIRMATION',['The xy coordinates of the calibration points in ' num2str(n_ima) ' planes will be used']) 676 676 for ifile=1:numel(coord_files) 677 t=xmltree(coord_files{ifile});678 s=convert(t);%convert to matlab structure677 t=xmltree(coord_files{ifile}); 678 s=convert(t);%convert to matlab structure 679 679 if isfield(s,'GeometryCalib') 680 680 if isfield(s.GeometryCalib,'SourceCalib') 681 681 if isfield(s.GeometryCalib.SourceCalib,'PointCoord') 682 PointCoord=s.GeometryCalib.SourceCalib.PointCoord;683 Coord_file=zeros(length(PointCoord),5);%default684 for i=1:length(PointCoord)685 line=str2num(PointCoord{i});686 Coord_file(i,4:5)=line(4:5);%px x687 Coord_file(i,1:3)=line(1:3);%phys x688 end689 eval(['x_' num2str(ifile+1) '=Coord_file(:,4:5)'';']);690 eval(['x_' num2str(ifile+1) '(2,:)=ny-x_' num2str(ifile+1) '(2,:);' ]);691 eval(['X_' num2str(ifile+1) '=Coord_file(:,1:3)'';']);682 PointCoord=s.GeometryCalib.SourceCalib.PointCoord; 683 Coord_file=zeros(length(PointCoord),5);%default 684 for i=1:length(PointCoord) 685 line=str2num(PointCoord{i}); 686 Coord_file(i,4:5)=line(4:5);%px x 687 Coord_file(i,1:3)=line(1:3);%phys x 688 end 689 eval(['x_' num2str(ifile+1) '=Coord_file(:,4:5)'';']); 690 eval(['x_' num2str(ifile+1) '(2,:)=ny-x_' num2str(ifile+1) '(2,:);' ]); 691 eval(['X_' num2str(ifile+1) '=Coord_file(:,1:3)'';']); 692 692 end 693 693 end … … 731 731 if ~strcmp(get(hhuvmat.Scalar,'Visible'),'on') 732 732 msgbox_uvmat('ERROR','An image needs to be opened in uvmat for calibration') 733 return733 return 734 734 end 735 735 ny=str2double(get(hhuvmat.num_Npy,'String')); … … 766 766 GeometryCalib.Cx_Cy(2)=ny-GeometryCalib.Cx_Cy(2);%reverse Cx_Cy(2) for calibration (inversion of px ordinate) 767 767 [omc,Tc1,Rc1,H,x,ex,JJ] = compute_extrinsic(x_1,X_1,... 768 (GeometryCalib.fx_fy)',GeometryCalib.Cx_Cy',[GeometryCalib.kc 0 0 0 0]);768 (GeometryCalib.fx_fy)',GeometryCalib.Cx_Cy',[GeometryCalib.kc 0 0 0 0]); 769 769 rmpath(fct_path); 770 770 GeometryCalib.CoordUnit=[];% default value, to be updated by the calling function 771 771 GeometryCalib.Tx_Ty_Tz=Tc1'; 772 %inversion of z axis 772 %inversion of z axis 773 773 GeometryCalib.R=Rc1; 774 774 GeometryCalib.R(2,1:3)=-GeometryCalib.R(2,1:3);%inversion of the y image coordinate … … 817 817 Z=Coord(:,3); 818 818 x_ima=Coord(:,4); 819 y_ima=Coord(:,5); 819 y_ima=Coord(:,5); 820 820 [Xpoints,Ypoints]=px_XYZ(Calib,X,Y,Z); 821 821 ErrorRms(1)=sqrt(mean((Xpoints-x_ima).*(Xpoints-x_ima))); … … 839 839 % RootFile=''; 840 840 if ~isempty(hhuvmat.RootPath)&& ~isempty(hhuvmat.RootFile) 841 % testhandle=1;841 % testhandle=1; 842 842 RootPath=get(hhuvmat.RootPath,'String'); 843 843 RootFile=get(hhuvmat.RootFile,'String'); … … 897 897 898 898 % -------------------------------------------------------------------- 899 function MenuHelp_Callback(hObject, eventdata, handles) 900 web('http://servforge.legi.grenoble-inp.fr/projects/soft-uvmat/wiki/UvmatHelp#GeometryCalib') 901 902 % -------------------------------------------------------------------- 903 function MenuSetScale_Callback(hObject, eventdata, handles) 899 900 % function MenuHelp_Callback(hObject, eventdata, handles) 901 % web('http://servforge.legi.grenoble-inp.fr/projects/soft-uvmat/wiki/UvmatHelp#GeometryCalib') 902 903 % 904 function MenuSetScale_Callback(hObject,eventdata,handles) 904 905 905 906 answer=msgbox_uvmat('INPUT_TXT','scale pixel/cm?',''); … … 942 943 943 944 % ----------------------------------------------------------------------- 944 % --- automatic grid dectection from local maxima of the images 945 % --- automatic grid dectection from local maxima of the images 945 946 function MenuDetectGrid_Callback(hObject, eventdata, handles) 946 947 %------------------------------------------------------------------------ … … 953 954 end 954 955 % corners_X=(Coord(end:-1:end-3,4)); %pixel absissa of the four corners 955 % corners_Y=(Coord(end:-1:end-3,5)); 956 % corners_Y=(Coord(end:-1:end-3,5)); 956 957 corners_X=(Coord(:,4)); %pixel absissa of the four corners 957 958 corners_Y=(Coord(:,5)); … … 964 965 angles=angle((corners_X-corners_X(1))+1i*(corners_Y-corners_Y(1))); 965 966 if abs(angles(4)-angles(2))>abs(angles(3)-angles(2)) 966 967 968 969 970 971 967 X_end=corners_X(4); 968 Y_end=corners_Y(4); 969 corners_X(4)=corners_X(3); 970 corners_Y(4)=corners_Y(3); 971 corners_X(3)=X_end; 972 corners_Y(3)=Y_end; 972 973 end 973 974 … … 992 993 % reference: http://alumni.media.mit.edu/~cwren/interpolator/ by Christopher R. Wren 993 994 B = [ X Y ones(size(X)) zeros(4,3) -X.*corners_X -Y.*corners_X ... 994 995 zeros(4,3) X Y ones(size(X)) -X.*corners_Y -Y.*corners_Y ]; 995 996 B = reshape (B', 8 , 8 )'; 996 997 D = [ corners_X , corners_Y ]; … … 1000 1001 C = [l(7:8)' 1]; 1001 1002 1002 %% transform grid image into 'phys' coordinates 1003 %% transform grid image into 'phys' coordinates 1003 1004 GeometryCalib.CalibrationType='3D_linear'; 1004 1005 GeometryCalib.fx_fy=[1 1]; … … 1022 1023 rmpath(fullfile(path_UVMAT,'transform_field')) 1023 1024 Amod=DataOut.A;% current image expressed in 'phys' coord 1024 Rangx=DataOut.Coord_x;% x coordinates of first and last pixel centres in phys 1025 Rangy=DataOut.Coord_y;% y coordinates of first and last pixel centres in phys 1025 Rangx=DataOut.Coord_x;% x coordinates of first and last pixel centres in phys 1026 Rangy=DataOut.Coord_y;% y coordinates of first and last pixel centres in phys 1026 1027 if CalibData.grid.CheckWhite 1027 1028 Amod=double(Amod);%case of white grid markers: will look for image maxima … … 1072 1073 x_profile=sum(Asub,1);%profile of subimage summed over y 1073 1074 y_profile=sum(Asub,2);%profile of subimage summed over x 1074 1075 1075 1076 [tild,ind_x_max]=max(x_profile);% index of max for the x profile 1076 1077 [tild,ind_y_max]=max(y_profile);% index of max for the y profile … … 1086 1087 y_shift=sum(Atop.*[-2 -1 0 1 2]')/sum(Atop); 1087 1088 end 1088 1089 % if ipoint==91090 % figure(11)1091 % imagesc(Asub)1092 % figure(12)1093 % plot(x_profile,'r')1094 % hold on1095 % plot(y_profile,'b')1096 % grid on1097 % end1089 %%%% 1090 % if ipoint==9 1091 % figure(11) 1092 % imagesc(Asub) 1093 % figure(12) 1094 % plot(x_profile,'r') 1095 % hold on 1096 % plot(y_profile,'b') 1097 % grid on 1098 % end 1098 1099 %%%% 1099 1100 TIndex(ipoint,1)=(i0min+ind_x_max-1+x_shift);% x position of the maximum (in index of Amod) … … 1102 1103 Tmod(:,1)=(TIndex(:,1)-1)*Dx+Rangx(1); 1103 1104 Tmod(:,2)=(TIndex(:,2)-1)*Dy+Rangy(1); 1104 %Tmod=T(:,(1:2))+Delta;% 'phys' coordinates of the detected points 1105 %Tmod=T(:,(1:2))+Delta;% 'phys' coordinates of the detected points 1105 1106 [Xpx,Ypx]=px_XYZ(GeometryCalib,Tmod(:,1),Tmod(:,2));% image coordinates of the detected points 1106 1107 Coord=[T Xpx Ypx zeros(size(T,1),1)]; … … 1120 1121 Tinput=CalibData.translate; 1121 1122 end 1122 T=translate_points(Tinput);%display translate_points GUI and get shift parameters 1123 T=translate_points(Tinput);%display translate_points GUI and get shift parameters 1123 1124 CalibData.translate=T; 1124 1125 set(handles.geometry_calib,'UserData',CalibData) … … 1139 1140 Tinput=CalibData.rotate; 1140 1141 end 1141 T=rotate_points(Tinput);%display rotate_points GUI to introduce rotation parameters 1142 T=rotate_points(Tinput);%display rotate_points GUI to introduce rotation parameters 1142 1143 CalibData.rotate=T; 1143 1144 set(handles.geometry_calib,'UserData',CalibData) … … 1190 1191 GeometryCalib=s.GeometryCalib; 1191 1192 if ~(isfield(GeometryCalib,'SourceCalib')&&isfield(GeometryCalib.SourceCalib,'PointCoord')) 1192 1193 msgbox_uvmat('ERROR','invalid input file: no calibration points') 1193 1194 return 1194 1195 end … … 1244 1245 end 1245 1246 [FileName, PathName, filterindex] = uigetfile( ... 1246 1247 1248 1249 1250 fileinput=[PathName FileName];%complete file name 1247 {'*.xml;*.mat', ' (*.xml,*.mat)'; 1248 '*.xml', '.xml files '; ... 1249 '*.mat', '.mat matlab files '}, ... 1250 'Pick a file',oldfile); 1251 fileinput=[PathName FileName];%complete file name 1251 1252 testblank=findstr(fileinput,' ');%look for blanks 1252 1253 if ~isempty(testblank) … … 1398 1399 figure(handles.geometry_calib) 1399 1400 1400 %------------------------------------------------------------------------ 1401 %------------------------------------------------------------------------ 1401 1402 % --- Executes on button press in Copy: display Coord on the Matlab work space 1402 1403 %------------------------------------------------------------------------ … … 1409 1410 commandwindow; %brings the Matlab command window to the front 1410 1411 1411 %------------------------------------------------------------------------ 1412 %------------------------------------------------------------------------ 1412 1413 % --- Executes when selected cell(s) is changed in ListCoord. 1413 %------------------------------------------------------------------------ 1414 %------------------------------------------------------------------------ 1414 1415 function ListCoord_CellSelectionCallback(hObject, eventdata, handles) 1415 1416 if ~isempty(eventdata.Indices) 1416 1417 iline=eventdata.Indices(1);% selected line number 1417 1418 set(handles.CoordLine,'String',num2str(iline)) 1418 1419 1420 end 1421 1422 %------------------------------------------------------------------------ 1419 Data=get(handles.ListCoord,'Data'); 1420 update_calib_marker(Data(iline,:)) 1421 end 1422 1423 %------------------------------------------------------------------------ 1423 1424 % --- Executes when entered data in editable cell(s) in ListCoord. 1424 %------------------------------------------------------------------------ 1425 %------------------------------------------------------------------------ 1425 1426 function ListCoord_CellEditCallback(hObject, eventdata, handles) 1426 1427 … … 1471 1472 %------------------------------------------------------------------------ 1472 1473 % --- update the plot of calibration points 1473 %------------------------------------------------------------------------ 1474 %------------------------------------------------------------------------ 1474 1475 % draw a circle around the point defined by the input coordinates Coord as given by line in the table Listcoord 1475 1476 function update_calib_marker(Coord) … … 1493 1494 1494 1495 %% read appropriate coordinates (px or phys) in the table ListCoord 1495 if isequal(option,'phys') % use phys coord 1496 if isequal(option,'phys') % use phys coord 1496 1497 XCoord=Coord(1); 1497 1498 YCoord=Coord(2); -
trunk/src/proj_field.m
r1061 r1062 574 574 NbSegment=0; 575 575 case 'rectangle' 576 LineCoord([1 4],1)=ObjectData.Coord(1,1)-ObjectData. RangeX;577 LineCoord([1 2],2)=ObjectData.Coord(1,2)-ObjectData. RangeY;578 LineCoord([2 3],1)=ObjectData.Coord(1,1)+ObjectData .RangeX;579 LineCoord([4 1],2)=ObjectData.Coord(1,2)+ObjectData.RangeY ;576 LineCoord([1 4],1)=ObjectData.Coord(1,1)-ObjectData.num_RangeX_2; 577 LineCoord([1 2],2)=ObjectData.Coord(1,2)-ObjectData.num_RangeX_2; 578 LineCoord([2 3],1)=ObjectData.Coord(1,1)+ObjectData_RangeX_2; 579 LineCoord([4 1],2)=ObjectData.Coord(1,2)+ObjectData.RangeY-Y2; 580 580 case 'polygon' 581 581 LineCoord(NbPoints+1)=LineCoord(1); … … 1610 1610 ProjData.(AXName)=[coord_x_proj(1) coord_x_proj(end)]; %record the new (projected ) x coordinates 1611 1611 [X,YI]=meshgrid(coord_x_proj,coord_y_proj);%grid in the new coordinates 1612 XI=ObjectData.Coord(1,1)+(X)*cos(PlaneAngle( 2))-YI*sin(PlaneAngle(1));%corresponding coordinates in the original system1613 YI=ObjectData.Coord(1,2)+(X)*sin(PlaneAngle( 2))+YI*cos(PlaneAngle(1));1612 XI=ObjectData.Coord(1,1)+(X)*cos(PlaneAngle(1))-YI*sin(PlaneAngle(1));%corresponding coordinates in the original system 1613 YI=ObjectData.Coord(1,2)+(X)*sin(PlaneAngle(1))+YI*cos(PlaneAngle(1)); 1614 1614 1615 1615 if numel(Coord{1})==2% x coordinate defined by its bounds, get the whole set -
trunk/src/series/civ_series.m
r1061 r1062 455 455 par_civ1.Mask=mask; %use mask already opened 456 456 else 457 try 458 par_civ1.Mask=imread(maskname);%update the mask, an store it for future use 459 catch ME 460 if ~isempty(ME.message) 461 errormsg=['error reading input image: ' ME.message]; 462 disp_uvmat('ERROR',errormsg,checkrun) 463 return 457 if exist(maskname,'file') 458 try 459 par_civ1.Mask=imread(maskname);%update the mask, an store it for future use 460 catch ME 461 if ~isempty(ME.message) 462 errormsg=['error reading input image: ' ME.message]; 463 disp_uvmat('ERROR',errormsg,checkrun) 464 return 465 end 464 466 end 467 else 468 par_civ1.Mask=[]; 465 469 end 466 470 mask=par_civ1.Mask; … … 711 715 par_civ2.Mask=mask; %use mask already opened 712 716 else 717 if exist(maskname,'file') 713 718 try 714 719 par_civ2.Mask=imread(maskname);%update the mask, an store it for future use … … 719 724 return 720 725 end 726 end 727 else 728 par_civ2.Mask=[]; 721 729 end 722 730 mask=par_civ2.Mask; -
trunk/src/series/merge_proj.m
r1061 r1062 288 288 %% reading input file(s) 289 289 [Data{iview},tild,errormsg] = read_field(filecell{iview,index},FileType{iview},ParamIn{iview},frame_index{iview}(index)); 290 if ~isempty(errormsg) 290 if isempty(errormsg) 291 disp([filecell{iview,index} ' read']) 292 else 291 293 disp_uvmat('ERROR',['ERROR in merge_proj/read_field/' errormsg],checkrun) 292 294 return -
trunk/src/set_object.m
r1061 r1062 293 293 %set(handles.num_Angle_3,'Visible','off') 294 294 set(handles.num_RangeX_1,'Visible','off') 295 set(handles.num_RangeX_2,'Visible','off')296 295 set(handles.num_RangeY_1,'Visible','off') 297 if isequal(ProjMode,'interp_lin')|| isequal(ProjMode,'interp_tps') 298 set(handles.num_RangeY_2,'Visible','off') 299 else 300 set(handles.num_RangeY_2,'Visible','on') 301 end 302 if strcmp(ObjectStyle,'rectangle')||strcmp(ObjectStyle,'ellipse') 303 set(handles.num_RangeX_2,'Visible','on') 304 else 305 set(handles.num_RangeX_2,'Visible','off') 306 end 296 % if isequal(ProjMode,'interp_lin')|| isequal(ProjMode,'interp_tps') 297 % set(handles.num_RangeY_2,'Visible','off') 298 % else 299 % set(handles.num_RangeY_2,'Visible','on') 300 307 301 set(handles.num_RangeZ_1,'Visible','off') 308 302 set(handles.num_RangeZ_2,'Visible','off') … … 310 304 set(handles.num_DY,'Visible','off') 311 305 set(handles.num_DZ,'Visible','off') 312 set(handles.num_RangeInterp,'Visible','off') 313 306 %default 307 set(handles.num_RangeX_2,'Visible','off') 308 set(handles.num_RangeY_2,'Visible','off') 314 309 switch ObjectStyle 315 310 case 'points' 316 set(handles.num_Range Y_2,'TooltipString','num_RangeY_2: range of projection around each point')311 set(handles.num_RangeInterp,'TooltipString','num_RangeY_2: range of projection around each point') 317 312 % set(handles.XObject,'TooltipString','XObject: set of x coordinates of the points') 318 313 % set(handles.YObject,'TooltipString','YObject: set of y coordinates of the points') 319 314 % set(handles.ZObject,'TooltipString','ZObject: set of z coordinates of the points') 320 315 case {'line','polyline','polygon'} 321 set(handles.num_RangeY_2,'TooltipString','num_RangeY_2: range of projection around the line') 316 set(handles.num_RangeX_2,'Visible','off') 317 set(handles.num_RangeY_2,'Visible','off') 318 %set(handles.num_RangeY_2,'TooltipString','num_RangeY_2: range of projection around the line') 322 319 set(handles.Coord,'TooltipString','Coord: table of x,y, z coordinates defining the line') 323 320 % set(handles.YObject,'TooltipString','YObject: set of y coordinates defining the line') … … 329 326 end 330 327 case {'rectangle','ellipse'} 328 set(handles.num_RangeX_2,'Visible','on') 329 set(handles.num_RangeY_2,'Visible','on') 331 330 set(handles.num_RangeX_2,'TooltipString',['num_RangeX_2: half length of the ' ObjectStyle]) 332 331 set(handles.num_RangeY_2,'TooltipString',['num_RangeY_2: half width of the ' ObjectStyle]) 332 if isequal(ProjMode,'interp_lin')|| isequal(ProjMode,'interp_tps') 333 set(handles.num_DX,'Visible','on') 334 set(handles.num_DX,'TooltipString','num_DX: mesh for the interpolated field along the line') 335 set(handles.num_RangeInterp,'Visible','on') 336 end 333 337 case {'plane','plane_z'} 334 338 set(handles.num_Angle_1,'Visible','on') … … 336 340 set(handles.num_RangeX_2,'Visible','on') 337 341 set(handles.num_RangeY_1,'Visible','on') 338 set(handles.num_RangeY_2,'Visible','on')342 %set(handles.num_RangeY_2,'Visible','on') 339 343 set(handles.num_RangeZ_2,'TooltipString','num_ZMax: range of projection normal to the plane') 340 344 if test3D
Note: See TracChangeset
for help on using the changeset viewer.