- Timestamp:
- Jan 26, 2022, 7:37:21 PM (3 years ago)
- Location:
- trunk/src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/geometry_calib.m
r1111 r1112 256 256 [num2str(numel(ind_removed)) ' points removed']}); 257 257 % SliceCoord_ref=[0 0 0]; %default reference plane 258 checkslice=0; 258 259 if strcmp(answer,'Yes') %store the calibration data 259 260 Z=Coord(:,3); 260 261 if strcmp(calib_cell{val}(1:2),'3D') && isequal(max(Z),min(Z))%set the plane position for 3D (projection) calibration 261 262 %set the Z position of the reference plane used for calibration 262 answer=msgbox_uvmat('INPUT_Y-N',{[' Assume that the illuminated plane is at z=' num2str(Z(1))] ; 'can be later modified by MenuSetSlice in the upper bar menu of uvmat'});263 answer=msgbox_uvmat('INPUT_Y-N',{['Do you assume that the illuminated plane is at z=' num2str(Z(1)) '?' ] ; 'can be later modified by MenuSetSlice in the upper bar menu of uvmat'}); 263 264 if strcmp(answer,'Yes') 264 GeometryCalib.NbSlice=1; 265 GeometryCalib.SliceCoord=[0 0 Z(1)]; 265 Slice.NbSlice=1; 266 Slice.SliceCoord=[0 0 Z(1)]; 267 checkslice=1;% will document the item <Slice> in ImaDoc 266 268 end 267 269 end … … 319 321 end 320 322 errormsg=update_imadoc(GeometryCalib,XmlName,'GeometryCalib');% introduce the calibration data in the xml file 323 dispmessage=''; 324 if checkslice 325 errormsg=update_imadoc(Slice,XmlName,'Slice');% introduce the slice position in the xml file 326 dispmessage=' and slice position'; 327 end 321 328 if ~strcmp(errormsg,'') 322 329 msgbox_uvmat('ERROR',errormsg); 323 330 else 324 331 if check_update 325 display([XmlName ' updated with calibration parameters' ])332 display([XmlName ' updated with calibration parameters' dispmessage]) 326 333 else 327 display([XmlName ' created with calibration parameters' ])334 display([XmlName ' created with calibration parameters' dispmessage]) 328 335 end 329 %nbcalib=nbcalib+1;330 336 end 331 337 end … … 333 339 msgbox_uvmat('CONFIMATION',['calibration replicated for ' num2str(NbExp) ' experiments']); 334 340 else 335 %% copy the xml file from the old location if appropriate, then update with the calibration parameters336 if ~exist(outputfile,'file') && ~isempty(SubDirBase) 341 %% update the calibration parameters in the currently opened uvmat GUI 342 if ~exist(outputfile,'file') && ~isempty(SubDirBase) %copy the xml file from the old location if appropriate 337 343 oldxml=[fullfile(RootPath,SubDirBase,get(hhuvmat.RootFile,'String')) '.xml']; 338 344 if exist(oldxml,'file') … … 341 347 end 342 348 errormsg=update_imadoc(GeometryCalib,outputfile,'GeometryCalib');% introduce the calibration data in the xml file 349 if checkslice 350 errormsg=update_imadoc(Slice,outputfile,'Slice');% introduce the slice position in the xml file 351 end 343 352 if ~strcmp(errormsg,'') 344 353 msgbox_uvmat('ERROR',errormsg); 345 354 end 346 355 347 %% display image with new calibration in the currently opened uvmat interface356 %% display image with new calibration in the currently opened uvmat GUI 348 357 FieldList=get(hhuvmat.FieldName,'String'); 349 358 val=get(hhuvmat.FieldName,'Value'); … … 413 422 x_ima=Coord(:,4); 414 423 y_ima=Coord(:,5); 415 [Xpoints,Ypoints]=px_XYZ(GeometryCalib, Coord(:,1),Coord(:,2),Coord(:,3));% convention of downward z coordinate (facing the camera)424 [Xpoints,Ypoints]=px_XYZ(GeometryCalib,[],Coord(:,1),Coord(:,2),Coord(:,3));% convention of downward z coordinate (facing the camera) 416 425 GeometryCalib.ErrorRms(1)=sqrt(mean((Xpoints-x_ima).*(Xpoints-x_ima))); 417 426 GeometryCalib.ErrorRms(2)=sqrt(mean((Ypoints-y_ima).*(Ypoints-y_ima))); … … 436 445 x_ima=Coord(:,4); 437 446 y_ima=Coord(:,5); 438 [Xpoints,Ypoints]=px_XYZ(GeometryCalib, X,Y,Z);447 [Xpoints,Ypoints]=px_XYZ(GeometryCalib,[],X,Y,Z); 439 448 GeometryCalib.ErrorRms(1)=sqrt(mean((Xpoints-x_ima).*(Xpoints-x_ima))); 440 449 GeometryCalib.ErrorRms(2)=sqrt(mean((Ypoints-y_ima).*(Ypoints-y_ima))); … … 805 814 x_ima=Coord(:,4); 806 815 y_ima=Coord(:,5); 807 [Xpoints,Ypoints]=px_XYZ(Calib, X,Y,Z);816 [Xpoints,Ypoints]=px_XYZ(Calib,[],X,Y,Z); 808 817 ErrorRms(1)=sqrt(mean((Xpoints-x_ima).*(Xpoints-x_ima))); 809 818 ErrorRms(2)=sqrt(mean((Ypoints-y_ima).*(Ypoints-y_ima))); -
trunk/src/mouse_motion.m
r1107 r1112 497 497 %% draw ruler 498 498 if test_ruler && isfield(AxeData,'Drawing') && isequal(AxeData.Drawing,'ruler') 499 if isfield(AxeData,'RulerHandle') 499 if isfield(AxeData,'RulerHandle') && ~isempty(findobj(AxeData.RulerHandle)) && size(xy,2)>=2 500 500 pointershape='crosshair'; %give the mouse pointer a cross shape 501 501 RulerCoord=[AxeData.RulerCoord ;xy(1,1:2)]; %coordinates defining the ruler segment -
trunk/src/mouse_up.m
r1107 r1112 363 363 RulerCoord=[AxeData.RulerCoord ;xy(1,1:2)];% append the recorded ruler origin to the current mouse coordinates 364 364 RulerCoord=diff(RulerCoord,1);% coordiante difference between segment end and beginning 365 RulerCoord=RulerCoord(1)+ i*RulerCoord(2);365 RulerCoord=RulerCoord(1)+1i*RulerCoord(2); 366 366 distance=abs(RulerCoord); 367 367 azimuth=(180/pi)*angle(RulerCoord); 368 368 msgbox_uvmat('RULER','',['length: ' num2str(distance,3) ', angle(degrees): ' num2str(azimuth,3)]) 369 if isfield(AxeData,'RulerHanle')&&~isempty(findobj(AxeData.RulerHandle)) 369 370 delete(AxeData.RulerHandle)%delete the ruler graphic object 370 371 AxeData=rmfield(AxeData,'RulerHandle');%remove the ruler handle in AxeData 372 end 371 373 AxeData.Drawing='off';%exit the ruler drawing mode 372 374 end -
trunk/src/phys_XYZ.m
r1111 r1112 33 33 %======================================================================= 34 34 35 function [Xphys,Yphys,Zphys]=phys_XYZ(Calib, X,Y,Zindex)35 function [Xphys,Yphys,Zphys]=phys_XYZ(Calib,Slice,X,Y,Zindex) 36 36 %------------------------------------------------------------------------ 37 37 testangle=0;% =1 if the illumination plane is tilted with respect to the horizontal plane Xphys Yphys 38 38 test_refraction=0;% =1 if the considered points are viewed through an horizontal interface (located at z=Calib.InterfaceCoord(3)') 39 39 Zphys=0; %default output 40 if exist('Zindex','var')&& isequal(Zindex,round(Zindex))&& Zindex>0 && isfield(Calib,'SliceCoord')&&size(Calib.SliceCoord,1)>=Zindex 41 if isfield(Calib, 'SliceAngle') && size(Calib.SliceAngle,1)>=Zindex && ~isequal(Calib.SliceAngle(Zindex,:),[0 0 0]) 40 if isempty(Slice) 41 Slice=Calib;%old convention < 2022 42 end 43 if exist('Zindex','var')&& isequal(Zindex,round(Zindex))&& Zindex>0 && isfield(Slice,'SliceCoord')&&size(Slice.SliceCoord,1)>=Zindex 44 if isfield(Slice, 'SliceAngle') && size(Slice.SliceAngle,1)>=Zindex && ~isequal(Slice.SliceAngle(Zindex,:),[0 0 0]) 42 45 testangle=1; 43 norm_plane=angle2normal( Calib.SliceAngle(Zindex,:));% coordinates UVMAT-httpsof the unit vector normal to the current illumination plane46 norm_plane=angle2normal(Slice.SliceAngle(Zindex,:));% coordinates UVMAT-httpsof the unit vector normal to the current illumination plane 44 47 end 45 Z0= Calib.SliceCoord(Zindex,3);%horizontal plane z=cte48 Z0=Slice.SliceCoord(Zindex,3);%horizontal plane z=cte 46 49 Z0virt=Z0; 47 if isfield( Calib,'InterfaceCoord') && isfield(Calib,'RefractionIndex')48 H= Calib.InterfaceCoord(3);% z position of the water surface50 if isfield(Slice,'InterfaceCoord') && isfield(Slice,'RefractionIndex') 51 H=Slice.InterfaceCoord(3);% z position of the water surface 49 52 if H>Z0 50 Z0virt=H-(H-Z0)/ Calib.RefractionIndex; %corrected z (virtual object)53 Z0virt=H-(H-Z0)/Slice.RefractionIndex; %corrected z (virtual object) 51 54 test_refraction=1; 52 55 end … … 86 89 b=-norm_plane(2)/norm_plane(3); 87 90 if test_refraction 88 avirt=a/ Calib.RefractionIndex;89 bvirt=b/ Calib.RefractionIndex;91 avirt=a/Slice.RefractionIndex; 92 bvirt=b/Slice.RefractionIndex; 90 93 else 91 94 avirt=a; 92 95 bvirt=b; 93 96 end 94 cvirt=Z0virt-avirt* Calib.SliceCoord(Zindex,1)-bvirt*Calib.SliceCoord(Zindex,2);% Z0 = (virtual) z coordinate on the rotation axis (assumed horizontal)97 cvirt=Z0virt-avirt*Slice.SliceCoord(Zindex,1)-bvirt*Slice.SliceCoord(Zindex,2);% Z0 = (virtual) z coordinate on the rotation axis (assumed horizontal) 95 98 % c=z coordinate at (x,y)=(0,0) 96 c=Z0-a* Calib.SliceCoord(Zindex,1)-b*Calib.SliceCoord(Zindex,2);99 c=Z0-a*Slice.SliceCoord(Zindex,1)-b*Slice.SliceCoord(Zindex,2); 97 100 R(1)=R(1)+avirt*R(3); 98 101 R(2)=R(2)+bvirt*R(3); -
trunk/src/phys_ima.m
r1085 r1112 27 27 npx=[npx siz(2)]; 28 28 npy=[npy siz(1)]; 29 Calib=XmlData{icell}.GeometryCalib; 29 Calib{icell}=XmlData{icell}.GeometryCalib; 30 Slice{icell}=Calib{icell}; 31 if isfield(XmlData{icell},'Slice') 32 Slice{icell}=XmlData{icell}.Slice; 33 end 30 34 coord_x=[0.5 siz(2)-0.5]; 31 35 coord_y=[0.5 siz(1)-0.5]; … … 34 38 y_edge=[coord_y(1)*ones(1,npx(icell)) linspace(coord_y(1),coord_y(end),npy(icell))... 35 39 coord_y(end)*ones(1,npx(icell)) linspace(coord_y(end),coord_y(1),npy(icell))];%y coordinates of the image edge(four sides) 36 [xcorner_new,ycorner_new]=phys_XYZ(Calib ,x_edge,y_edge,ZIndex);%corresponding physical coordinates40 [xcorner_new,ycorner_new]=phys_XYZ(Calib{icell},Slice{icell},x_edge,y_edge,ZIndex);%corresponding physical coordinates 37 41 dx(icell)=(max(xcorner_new)-min(xcorner_new))/(siz(2)-1); 38 42 dy(icell)=(max(ycorner_new)-min(ycorner_new))/(siz(1)-1); … … 54 58 A_out=cell(1,numel(A)); 55 59 56 for icell=1:length(A) 57 Calib=XmlData{icell}.GeometryCalib; 60 for icell=1:numel(A) 58 61 % rescaling of the image coordinates without change of the image array 59 if strcmp(Calib .CalibrationType,'rescale') && isequal(Calib,XmlData{1}.GeometryCalib)62 if strcmp(Calib{icell}.CalibrationType,'rescale') && isequal(Calib,XmlData{1}.GeometryCalib) 60 63 A_out{icell}=A{icell};%no transform 61 64 Rangx=[0.5 npx-0.5];%image coordiantes of corners 62 65 Rangy=[npy-0.5 0.5]; 63 [Rangx]=phys_XYZ(Calib ,Rangx,[0.5 0.5],ZIndex);%case of translations without rotation and quadratic deformation64 [~,Rangy]=phys_XYZ(Calib ,[0.5 0.5],Rangy,ZIndex);66 [Rangx]=phys_XYZ(Calib{icell},[],Rangx,[0.5 0.5],ZIndex);%case of translations without rotation and quadratic deformation 67 [~,Rangy]=phys_XYZ(Calib{icell},[],[0.5 0.5],Rangy,ZIndex); 65 68 else 66 69 % the image needs to be interpolated to the new coordinates 67 70 Z=0; %default 68 if isfield( Calib,'SliceCoord')&& size(Calib.SliceCoord,1)>=ZIndex %.Z= index of plane69 SliceCoord= Calib.SliceCoord(ZIndex,:);71 if isfield(Slice{icell},'SliceCoord')&& size(Slice{icell}.SliceCoord,1)>=ZIndex %.Z= index of plane 72 SliceCoord=Slice{icell}.SliceCoord(ZIndex,:); 70 73 Z=SliceCoord(3); 71 if isfield( Calib, 'SliceAngle') && size(Calib.SliceAngle,1)>=ZIndex && ~isequal(Calib.SliceAngle(ZIndex,:),[0 0 0])72 norm_plane=angle2normal( Calib.SliceAngle(ZIndex,:));74 if isfield(Slice{icell}, 'SliceAngle') && size(Slice{icell}.SliceAngle,1)>=ZIndex && ~isequal(Slice{icell}.SliceAngle(ZIndex,:),[0 0 0]) 75 norm_plane=angle2normal(Slice{icell}.SliceAngle(ZIndex,:)); 73 76 Z=Z-(norm_plane(1)*(X-SliceCoord(1))+norm_plane(2)*(Y-SliceCoord(2)))/norm_plane(3); 74 77 end … … 77 80 yima=npy(icell)-0.5:-1:0.5; 78 81 [XIMA_init,YIMA_init]=meshgrid(xima,yima);%grid of initial image in px coordinates 79 [XIMA,YIMA]=px_XYZ( XmlData{icell}.GeometryCalib,X,Y,Z);% image coordinates for each point in the real82 [XIMA,YIMA]=px_XYZ(Calib{icell},Slice{icell},X,Y,Z);% image coordinates for each point in the real 80 83 testuint8=isa(A{icell},'uint8'); 81 84 testuint16=isa(A{icell},'uint16'); -
trunk/src/px_XYZ.m
r1111 r1112 28 28 %======================================================================= 29 29 30 function [X,Y]=px_XYZ(Calib, Xphys,Yphys,Zphys)30 function [X,Y]=px_XYZ(Calib,Slice,Xphys,Yphys,Zphys) 31 31 if ~exist('Zphys','var') 32 32 Zphys=0; … … 40 40 41 41 %%%%%%%%%%%%% 42 if isempty(Slice) 43 Slice=Calib; 44 end 42 45 % general case 43 46 if isfield(Calib,'R') 44 47 R=(Calib.R)'; 45 48 %correct z for refraction if needed 46 if isfield( Calib,'InterfaceCoord') && isfield(Calib,'RefractionIndex')47 H= Calib.InterfaceCoord(3);49 if isfield(Slice,'InterfaceCoord') && isfield(Slice,'RefractionIndex') 50 H=Slice.InterfaceCoord(3); 48 51 if H>Zphys 49 Zphys=H-(H-Zphys)/ Calib.RefractionIndex; %corrected z (virtual object)Calib52 Zphys=H-(H-Zphys)/Slice.RefractionIndex; %corrected z (virtual object)Calib 50 53 51 54 % test_refraction=1; -
trunk/src/series/extract_rdvision.m
r1110 r1112 1 %'ext ract_rdvision': relabel an image series with two indices, and correct errors from the RDvision transfer program1 %'extunningact_rdvision': relabel an image series with two indices, and correct errors from the RDvision transfer program 2 2 %------------------------------------------------------------------------ 3 3 % function ParamOut=extract_rdvision(Param) -
trunk/src/set_grid.m
r1107 r1112 258 258 end 259 259 tsaiA=[];%default 260 SliceA=[]; 260 261 if exist(fileAxml,'file') 261 262 [XmlDataA,errormsg]=imadoc2struct(fileAxml); … … 266 267 if isfield(XmlDataA,'GeometryCalib') 267 268 tsaiA=XmlDataA.GeometryCalib; 269 SliceA=tsaiA;%default 270 end 271 if isfield(XmlDataA,'Slice') 272 SliceA=XmlDataA.Slice; 268 273 end 269 274 end … … 271 276 msgbox_uvmat('WARNING','no geometric calibration available for image A, phys =pixel') 272 277 else 273 [grid_x_imaA,grid_y_imaA]=px_XYZ(tsaiA, grid_x,grid_y,GUI.Z);278 [grid_x_imaA,grid_y_imaA]=px_XYZ(tsaiA,SliceA,grid_x,grid_y,GUI.Z); 274 279 end 275 280 end … … 293 298 end 294 299 tsaiB=[];%default 300 SliceB=[]; 295 301 if exist(fileBxml,'file') 296 302 [XmlDataB,errormsg]=imadoc2struct(fileBxml); … … 301 307 if isfield(XmlDataB,'GeometryCalib') 302 308 tsaiB=XmlDataB.GeometryCalib; 309 SliceB=tsaiB;%default 310 end 311 if isfield(XmlDataB,'Slice') 312 SliceB=XmlDataB.Slice; 303 313 end 304 314 end … … 308 318 grid_y_imaB=grid_y; 309 319 else 310 [grid_x_imaB,grid_y_imaB]=px_XYZ(tsaiB, grid_x,grid_y,GUI.Z);320 [grid_x_imaB,grid_y_imaB]=px_XYZ(tsaiB,SliceB,grid_x,grid_y,GUI.Z); 311 321 end 312 322 B=imread(GUI.ImageB); -
trunk/src/transform_field/phys.m
r1107 r1112 55 55 DataOut=DataIn;%default first output field 56 56 if nargin>=2 % nargin =nbre of input variables 57 Calib{1}=[]; 57 58 if isfield(XmlData,'GeometryCalib') 58 59 Calib{1}=XmlData.GeometryCalib; 59 else 60 Calib{1}=[]; 60 end 61 Slice{1}=Calib{1}; 62 if isfield(XmlData,'Slice') 63 Slice{1}=XmlData.Slice; 61 64 end 62 65 if nargin>=3 %two input fields 63 66 DataOut_1=DataIn_1;%default second output field 64 if nargin>=4 && isfield(XmlData_1,'GeometryCalib') 65 Calib{2}=XmlData_1.GeometryCalib; 66 else 67 Calib{2}=Calib{1}; 67 Calib{2}=Calib{1}; 68 if nargin>=4 69 if isfield(XmlData_1,'GeometryCalib') 70 Calib{2}=XmlData_1.GeometryCalib; 71 end 72 Slice{2}=Calib{2}; 73 if isfield(XmlData_1,'Slice') 74 Slice{2}=XmlData_1.Slice; 75 end 68 76 end 69 77 end … … 71 79 72 80 %% get the z index defining the section plane 81 ZIndex=1; 73 82 if isfield(DataIn,'ZIndex')&&~isempty(DataIn.ZIndex)&&~isnan(DataIn.ZIndex) 74 83 ZIndex=DataIn.ZIndex; 75 else76 ZIndex=1;77 84 end 78 85 … … 82 89 if ~isempty(Calib{1}) 83 90 if isfield(Calib{1},'CalibrationType')&& isfield(Calib{1},'CoordUnit') && isfield(DataIn,'CoordUnit')&& strcmp(DataIn.CoordUnit,'pixel') 84 DataOut=phys_1(DataIn,Calib{1}, ZIndex);% transform coordinates and velocity components91 DataOut=phys_1(DataIn,Calib{1},Slice{1},ZIndex);% transform coordinates and velocity components 85 92 %case of images or scalar: in case of two input fields, we need to project the transform on the same regular grid 86 93 if isfield(DataIn,'A') && isfield(DataIn,'Coord_x') && ~isempty(DataIn.Coord_x) && isfield(DataIn,'Coord_y')&&... … … 94 101 95 102 %% document the selected plane position and angle if relevant 96 if checktransform && isfield( Calib{1},'SliceCoord')&&size(Calib{1}.SliceCoord,1)>=ZIndex97 DataOut.PlaneCoord= Calib{1}.SliceCoord(ZIndex,:);% transfer the slice position corresponding to index ZIndex98 if isfield( Calib{1},'SliceAngle') % transfer the slice rotation angles99 if isequal(size( Calib{1}.SliceAngle,1),1)% case of a unique angle100 DataOut.PlaneAngle= Calib{1}.SliceAngle;103 if checktransform && isfield(Slice{1},'SliceCoord')&&size(Slice{1}.SliceCoord,1)>=ZIndex 104 DataOut.PlaneCoord=Slice{1}.SliceCoord(ZIndex,:);% transfer the slice position corresponding to index ZIndex 105 if isfield(Slice{1},'SliceAngle') % transfer the slice rotation angles 106 if isequal(size(Slice{1}.SliceAngle,1),1)% case of a unique angle 107 DataOut.PlaneAngle=Slice{1}.SliceAngle; 101 108 else % case of multiple planes with different angles: select the plane with index ZIndex 102 DataOut.PlaneAngle= Calib{1}.SliceAngle(ZIndex,:);109 DataOut.PlaneAngle=Slice{1}.SliceAngle(ZIndex,:); 103 110 end 104 111 end … … 113 120 end 114 121 if isfield(Calib{2},'CalibrationType')&&isfield(Calib{2},'CoordUnit') && isfield(DataIn_1,'CoordUnit')&& strcmp(DataIn_1.CoordUnit,'pixel') 115 DataOut_1=phys_1(DataOut_1,Calib{2}, ZIndex);116 if isfield( Calib{1},'SliceCoord')117 if ~(isfield( Calib{2},'SliceCoord') && isequal(Calib{2}.SliceCoord,Calib{1}.SliceCoord))122 DataOut_1=phys_1(DataOut_1,Calib{2},Slice{2},ZIndex); 123 if isfield(Slice{2},'SliceCoord') 124 if ~(isfield(Slice{2},'SliceCoord') && isequal(Slice{2}.SliceCoord,Slice{1}.SliceCoord)) 118 125 DataOut_1.Txt='different plane positions for the two input fields'; 119 126 return 120 127 end 121 128 DataOut_1.PlaneCoord=DataOut.PlaneCoord;% same plane position for the two input fields 122 if isfield( Calib{1},'SliceAngle')123 if ~(isfield( Calib{2},'SliceAngle') && isequal(Calib{2}.SliceAngle,Calib{1}.SliceAngle))129 if isfield(Slice{1},'SliceAngle') 130 if ~(isfield(Slice{2},'SliceAngle') && isequal(Slice{2}.SliceAngle,Slice{1}.SliceAngle)) 124 131 DataOut_1.Txt='different plane angles for the two input fields'; 125 132 return … … 131 138 ~isempty(DataIn_1.Coord_y)&&length(DataIn_1.A)>1 132 139 iscalar=iscalar+1; 133 Calib{iscalar}=Calib{2};140 % Calib{iscalar}=Calib{2}; 134 141 A{iscalar}=DataIn_1.A; 135 142 end … … 163 170 %------------------------------------------------ 164 171 %--- transform a single field 165 function DataOut=phys_1(Data,Calib, ZIndex)172 function DataOut=phys_1(Data,Calib,Slice,ZIndex) 166 173 %------------------------------------------------ 167 174 %% set default output … … 171 178 %% transform X,Y coordinates for velocity fields (transform of an image or scalar done in phys_ima) 172 179 if isfield(Data,'X') &&isfield(Data,'Y')&&~isempty(Data.X) && ~isempty(Data.Y) 173 [DataOut.X,DataOut.Y]=phys_XYZ(Calib, Data.X,Data.Y,ZIndex);180 [DataOut.X,DataOut.Y]=phys_XYZ(Calib,Slice,Data.X,Data.Y,ZIndex); 174 181 Dt=1; %default 175 182 if isfield(Data,'dt')&&~isempty(Data.dt) … … 180 187 end 181 188 if isfield(Data,'U')&&isfield(Data,'V')&&~isempty(Data.U) && ~isempty(Data.V) 182 [XOut_1,YOut_1]=phys_XYZ(Calib, Data.X-Data.U/2,Data.Y-Data.V/2,ZIndex);183 [XOut_2,YOut_2]=phys_XYZ(Calib, Data.X+Data.U/2,Data.Y+Data.V/2,ZIndex);189 [XOut_1,YOut_1]=phys_XYZ(Calib,Slice,Data.X-Data.U/2,Data.Y-Data.V/2,ZIndex); 190 [XOut_2,YOut_2]=phys_XYZ(Calib,Slice,Data.X+Data.U/2,Data.Y+Data.V/2,ZIndex); 184 191 DataOut.U=(XOut_2-XOut_1)/Dt; 185 192 DataOut.V=(YOut_2-YOut_1)/Dt; … … 213 220 % estimate the Jacobian matrix DXpx/DXphys 214 221 for ip=1:length(Data.X) 215 [Xp1,Yp1]=phys_XYZ(Calib, Data.X(ip)+0.5,Data.Y(ip),ZIndex);216 [Xm1,Ym1]=phys_XYZ(Calib, Data.X(ip)-0.5,Data.Y(ip),ZIndex);217 [Xp2,Yp2]=phys_XYZ(Calib, Data.X(ip),Data.Y(ip)+0.5,ZIndex);218 [Xm2,Ym2]=phys_XYZ(Calib, Data.X(ip),Data.Y(ip)-0.5,ZIndex);222 [Xp1,Yp1]=phys_XYZ(Calib,Slice,Data.X(ip)+0.5,Data.Y(ip),ZIndex); 223 [Xm1,Ym1]=phys_XYZ(Calib,Slice,Data.X(ip)-0.5,Data.Y(ip),ZIndex); 224 [Xp2,Yp2]=phys_XYZ(Calib,Slice,Data.X(ip),Data.Y(ip)+0.5,ZIndex); 225 [Xm2,Ym2]=phys_XYZ(Calib,Slice,Data.X(ip),Data.Y(ip)-0.5,ZIndex); 219 226 %Jacobian matrix DXpphys/DXpx 220 227 DjXi(1,1)=(Xp1-Xm1); -
trunk/src/transform_field/phys_polar.m
r1107 r1112 78 78 Data=DataIn; %default output 79 79 if isfield(Data,'CoordUnit') 80 Data=rmfield(Data,'CoordUnit');80 Data=rmfield(Data,'CoordUnit'); 81 81 end 82 82 Data.ListVarName = {}; … … 85 85 DataCell{1}=DataIn; 86 86 Calib{1}=[]; 87 Slice{1}=[]; 87 88 DataCell{2}=[];%default 88 89 checkpixel(1)=0; 89 if isfield(DataCell{1},'CoordUnit')&& strcmp(DataCell{1}.CoordUnit,'pixel') 90 if isfield(DataCell{1},'CoordUnit')&& strcmp(DataCell{1}.CoordUnit,'pixel') 90 91 checkpixel(1)=1; 91 92 end … … 94 95 Calib{1}=XmlData.GeometryCalib; 95 96 end 97 Slice{1}=Calib{1}; 98 if isfield(XmlData,'Slice') 99 Slice{1}=XmlData.Slice; 100 end 96 101 Calib{2}=Calib{1}; 102 Slice{2}=Slice{1}; 97 103 else 98 104 Data.Txt='wrong input: need two or four structures'; … … 101 107 if nargin==4% case of two input fields 102 108 checkpixel(2)=0; 103 if isfield(DataCell{2},'CoordUnit')&& strcmp(DataCell{2}.CoordUnit,'pixel') 104 checkpixel(2)=1;105 end109 if isfield(DataCell{2},'CoordUnit')&& strcmp(DataCell{2}.CoordUnit,'pixel') 110 checkpixel(2)=1; 111 end 106 112 DataCell{2}=DataIn_1;%default 107 113 if isfield(XmlData_1,'GeometryCalib')&& ~isempty(XmlData_1.GeometryCalib) && checkpixel(2) 108 114 Calib{2}=XmlData_1.GeometryCalib; 115 end 116 if isfield(XmlData_1,'Slice') 117 Slice{2}=XmlData_1.Slice; 109 118 end 110 119 nbinput=2; … … 218 227 if ~isempty(Calib{ifield}) 219 228 [X,Y,Z,DataCell{ifield}.(UName),DataCell{ifield}.(VName)]=... 220 phys_XYUV(DataCell{ifield},Calib{ifield}, ZIndex);229 phys_XYUV(DataCell{ifield},Calib{ifield},Slice{ifield},ZIndex); 221 230 end 222 231 end … … 304 313 ZInd(nbgrid)=ZIndex; 305 314 Calib_new{nbgrid}=Calib{ifield}; 315 Slice_new{nbgrid}=Slice{ifield}; 306 316 end 307 317 if isfield(CellInfo{icell},'VarIndex_vector_x')&& isfield(CellInfo{icell},'VarIndex_vector_y') … … 325 335 Calib_new{nbgrid+1}=Calib{ifield}; 326 336 Calib_new{nbgrid+2}=Calib{ifield}; 337 Slice_new{nbgrid+1}=Calib{ifield}; 338 Slice_new{nbgrid+2}=Calib{ifield}; 327 339 nbgrid=nbgrid+2; 328 340 nbvar=nbvar+2; … … 335 347 %% tranform cartesian to polar coordinates for gridded data 336 348 if nbgrid~=0 337 [A,Data.radius,Data.theta]=phys_Ima_polar(A,coord_x,coord_y,Calib_new, ZInd,origin_xy,radius_offset,angle_offset,angle_scale);349 [A,Data.radius,Data.theta]=phys_Ima_polar(A,coord_x,coord_y,Calib_new,Slice_new,ZInd,origin_xy,radius_offset,angle_offset,angle_scale); 338 350 for icell=1:numel(A) 339 351 if icell<=numel(A)-1 && check_vector(icell)==1 && check_vector(icell+1)==1 %transform u,v into polar coordinates … … 373 385 %------------------------------------------------ 374 386 %--- transform a single field into phys coordiantes 375 function [X,Y,Z,U,V]=phys_XYUV(Data,Calib, ZIndex)387 function [X,Y,Z,U,V]=phys_XYUV(Data,Calib,Slice,ZIndex) 376 388 %------------------------------------------------ 377 389 %% set default output … … 385 397 %% transform X,Y coordinates for velocity fields (transform of an image or scalar done in phys_ima) 386 398 if isfield(Data,'X') &&isfield(Data,'Y')&&~isempty(Data.X) && ~isempty(Data.Y) 387 [X,Y,Z]=phys_XYZ(Calib, Data.X,Data.Y,ZIndex);399 [X,Y,Z]=phys_XYZ(Calib,Slice,Data.X,Data.Y,ZIndex); 388 400 Dt=1; %default 389 401 if isfield(Data,'dt')&&~isempty(Data.dt) … … 394 406 end 395 407 if isfield(Data,'U')&&isfield(Data,'V')&&~isempty(Data.U) && ~isempty(Data.V) 396 [XOut_1,YOut_1]=phys_XYZ(Calib, Data.X-Data.U/2,Data.Y-Data.V/2,ZIndex);397 [XOut_2,YOut_2]=phys_XYZ(Calib, Data.X+Data.U/2,Data.Y+Data.V/2,ZIndex);408 [XOut_1,YOut_1]=phys_XYZ(Calib,Slice,Data.X-Data.U/2,Data.Y-Data.V/2,ZIndex); 409 [XOut_2,YOut_2]=phys_XYZ(Calib,Slice,Data.X+Data.U/2,Data.Y+Data.V/2,ZIndex); 398 410 U=(XOut_2-XOut_1)/Dt; 399 411 V=(YOut_2-YOut_1)/Dt; … … 404 416 % tranform gridded field into polar coordiantes on a regular polar grid, 405 417 % transform to phys coordiantes if requested by calibration input 406 function [A_out,radius,theta]=phys_Ima_polar(A,coord_x,coord_y,CalibIn, ZIndex,origin_xy,radius_offset,angle_offset,angle_scale)418 function [A_out,radius,theta]=phys_Ima_polar(A,coord_x,coord_y,CalibIn,SliceIn,ZIndex,origin_xy,radius_offset,angle_offset,angle_scale) 407 419 rcorner=[]; 408 420 thetacorner=[]; … … 420 432 % transform edges into phys coordinates if requested 421 433 if ~isempty(CalibIn{icell}) 422 [x_edge,y_edge]=phys_XYZ(CalibIn{icell}, x_edge,y_edge,ZIndex(icell));% physical coordinates of the image edge434 [x_edge,y_edge]=phys_XYZ(CalibIn{icell},SliceIn{icell},x_edge,y_edge,ZIndex(icell));% physical coordinates of the image edge 423 435 end 424 436 -
trunk/src/uvmat.m
r1110 r1112 1208 1208 1209 1209 UvData=get(handles.uvmat,'UserData');%read UvData properties stored on the uvmat interface 1210 % check=0; 1211 if isfield(UvData,'XmlData')&&isfield(UvData.XmlData{1},'GeometryCalib')&& isfield(UvData.XmlData{1}.GeometryCalib,'SliceCoord') 1212 GeometryCalib=UvData.XmlData{1}.GeometryCalib; 1213 else 1214 msgbox_uvmat('ERROR','3D geometric calibration needed before defining slices') 1215 return 1216 end 1217 SliceCoord=GeometryCalib.SliceCoord; 1218 InterfaceCoord=min(SliceCoord(:,3)); 1219 if isfield(GeometryCalib,'InterfaceCoord') 1220 InterfaceCoord=GeometryCalib.InterfaceCoord(1,3); 1221 end 1222 NbSlice=size(SliceCoord,1); 1210 Slice=[]; 1211 if isfield(UvData,'XmlData') 1212 if isfield(UvData.XmlData{1},'GeometryCalib')&& isfield(UvData.XmlData{1}.GeometryCalib,'SliceCoord') 1213 Slice=UvData.XmlData{1}.GeometryCalib;%old convention < 2022 1214 elseif isfield(UvData.XmlData{1},'Slice') 1215 Slice=UvData.XmlData{1}.Slice;% new convention ( 2022) 1216 end 1217 end 1218 % default input 1219 if ~(isfield(Slice,'SliceCoord') && size(Slice.SliceCoord,2)==3) 1220 Slice.SliceCoord=[0 0 0]; 1221 end 1222 InterfaceCoord=min(Slice.SliceCoord(:,3)); 1223 if isfield(Slice,'InterfaceCoord') 1224 InterfaceCoord=Slice.InterfaceCoord(1,3); 1225 end 1226 NbSlice=size(Slice.SliceCoord,1); 1223 1227 CheckVolumeScan=0; 1224 if isfield( GeometryCalib,'CheckVolumeScan')1225 CheckVolumeScan= GeometryCalib.CheckVolumeScan;1228 if isfield(Slice,'CheckVolumeScan') 1229 CheckVolumeScan=Slice.CheckVolumeScan; 1226 1230 end 1227 1231 RefractionIndex=1.33; 1228 1232 CheckRefraction=0;% default value of the check box refraction 1229 if isfield( GeometryCalib,'RefractionIndex')1230 RefractionIndex= GeometryCalib.RefractionIndex;1233 if isfield(Slice,'RefractionIndex') 1234 RefractionIndex=Slice.RefractionIndex; 1231 1235 CheckRefraction=1; 1232 1236 end 1233 1237 SliceAngle=[0 0 0]; 1234 if isfield( GeometryCalib,'SliceAngle')1235 SliceAngle= GeometryCalib.SliceAngle;1238 if isfield(Slice,'SliceAngle') 1239 SliceAngle=Slice.SliceAngle; 1236 1240 end 1237 1241 … … 1244 1248 Bottom=ScreenSize(4)-Height-40; %put fig at top right 1245 1249 hfig=findobj(allchild(0),'Tag','set_slice'); 1246 if ~isempty(hfig),delete(hfig), end ;%delete existing version of the GUI1247 hfig=figure('name','set_slices','tag','set_slice','MenuBar','none','NumberTitle','off','Units','pixels','Position',[Left,Bottom,Width,Height],'UserData', GeometryCalib);1250 if ~isempty(hfig),delete(hfig), end %delete existing version of the GUI 1251 hfig=figure('name','set_slices','tag','set_slice','MenuBar','none','NumberTitle','off','Units','pixels','Position',[Left,Bottom,Width,Height],'UserData',Slice); 1248 1252 BackgroundColor=get(hfig,'Color'); 1249 1253 hh=0.14; % box height (relative) … … 1262 1266 'String','Z','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','right');%title 1263 1267 uicontrol('Style','edit','Units','normalized', 'Position', [2*ii+ww 0.95-2*ii-hh ww hh],'tag','num_Z_1','BackgroundColor',[1 1 1],... 1264 'String',num2str(Slice Coord(1,3)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_Z_1'': z position of first slice');%edit box1268 'String',num2str(Slice.SliceCoord(1,3)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_Z_1'': z position of first slice');%edit box 1265 1269 uicontrol('Style','edit','Units','normalized', 'Position', [3*ii+2*ww 0.95-2*ii-hh ww hh],'tag','num_Z_2','BackgroundColor',[1 1 1],... 1266 'String',num2str(Slice Coord(end,3)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_Z_2'': z position of last slice');%edit box1270 'String',num2str(Slice.SliceCoord(end,3)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_Z_2'': z position of last slice');%edit box 1267 1271 uicontrol('Style','edit','Units','normalized', 'Position', [4*ii+3*ww 0.95-2*ii-hh ww hh],'tag','num_H','BackgroundColor',[1 1 1],... 1268 1272 '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 … … 1291 1295 1292 1296 uicontrol('Style','edit','Units','normalized', 'Position', [3*ii+ww 0.95-5*ii-4.2*hh ww hh],'tag','num_SliceCoord_1','BackgroundColor',[1 1 1],... 1293 'String',num2str(Slice Coord(1)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_SliceCoord_1'':x position of the tild origin');%edit box1297 'String',num2str(Slice.SliceCoord(1)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_SliceCoord_1'':x position of the tild origin');%edit box 1294 1298 uicontrol('Style','edit','Units','normalized', 'Position', [3*ii+ww 0.95-6*ii-5.2*hh ww hh],'tag','num_SliceCoord_2','BackgroundColor',[1 1 1],... 1295 'String',num2str(Slice Coord(2)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_SliceCoord_2'':y position of the tild origin');%edit box1299 'String',num2str(Slice.SliceCoord(2)),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_SliceCoord_2'':y position of the tild origin');%edit box 1296 1300 1297 1301 uicontrol('Style','text','Units','normalized', 'Position', [ii 0.95-5*ii-4*hh 1.3*ww hh/2],'BackgroundColor',BackgroundColor,'Tag','Angle_title_1',... … … 1349 1353 [RootPath,SubDir,RootFile,tild,tild,tild,tild,FileExt]=fileparts_uvmat(FileName); 1350 1354 XmlFile=find_imadoc(RootPath,SubDir,RootFile,FileExt);%find name of the relevant xml file 1351 [s,errormsg]=imadoc2struct(XmlFile,'GeometryCalib');%read the xml file1352 if~isempty(errormsg)1353 msgbox_uvmat('ERROR',errormsg)1354 return1355 end1356 GeometryCalib=s.GeometryCalib;% get thegeometric calibration data1355 % [s,errormsg]=imadoc2struct(XmlFile,'Slice');%read the xml file 1356 % if~isempty(errormsg) 1357 % msgbox_uvmat('ERROR',errormsg) 1358 % return 1359 % end 1360 % Slice=s.Slice;% get thegeometric calibration data 1357 1361 1358 1362 %% read the content of the GUI set_slice … … 1361 1365 Z_plane=str2num(get(hZ,'String'));% set of Z positions explicitly entered as a Matlab vector 1362 1366 SliceData=read_GUI(hset_slice); 1363 GeometryCalib.NbSlice=SliceData.NbSlice;1364 GeometryCalib.CheckVolumeScan=SliceData.CheckVolumeScan;1367 Slice.NbSlice=SliceData.NbSlice; 1368 Slice.CheckVolumeScan=SliceData.CheckVolumeScan; 1365 1369 if numel(Z_plane)<=2 1366 1370 Z_plane=linspace(SliceData.Z(1),SliceData.Z(2),SliceData.NbSlice); … … 1368 1372 set(hZ,'String',num2str(Z_plane))% restitute the display qfter reqding by read_GUI 1369 1373 end 1370 GeometryCalib.SliceCoord=Z_plane'*[0 0 1];1371 GeometryCalib.SliceCoord(:,1)=SliceData.SliceCoord(1);1372 GeometryCalib.SliceCoord(:,2)=SliceData.SliceCoord(2);1373 GeometryCalib.SliceAngle=zeros(GeometryCalib.NbSlice,3);1374 Slice.SliceCoord=Z_plane'*[0 0 1]; 1375 Slice.SliceCoord(:,1)=SliceData.SliceCoord(1); 1376 Slice.SliceCoord(:,2)=SliceData.SliceCoord(2); 1377 Slice.SliceAngle=zeros(Slice.NbSlice,3); 1374 1378 Angle_1=linspace(SliceData.SliceAngle_1(1),SliceData.SliceAngle_1(2),SliceData.NbSlice); 1375 1379 Angle_2=linspace(SliceData.SliceAngle_2(1),SliceData.SliceAngle_2(2),SliceData.NbSlice); 1376 GeometryCalib.SliceAngle(:,1)=Angle_1';%rotation angle around x axis1377 GeometryCalib.SliceAngle(:,2)=Angle_2';%rotation angle around y axis1378 GeometryCalib.SliceAngle(:,3)=0;1380 Slice.SliceAngle(:,1)=Angle_1';%rotation angle around x axis 1381 Slice.SliceAngle(:,2)=Angle_2';%rotation angle around y axis 1382 Slice.SliceAngle(:,3)=0; 1379 1383 if SliceData.CheckRefraction 1380 GeometryCalib.InterfaceCoord=[0 0 SliceData.H];1381 GeometryCalib.RefractionIndex=SliceData.RefractionIndex;1382 elseif isfield( GeometryCalib,'RefractionIndex')1383 GeometryCalib=rmfield(GeometryCalib,'RefractionIndex');1384 GeometryCalib=rmfield(GeometryCalib,'InterfaceCoord');1384 Slice.InterfaceCoord=[0 0 SliceData.H]; 1385 Slice.RefractionIndex=SliceData.RefractionIndex; 1386 elseif isfield(Slice,'RefractionIndex') 1387 Slice=rmfield(Slice,'RefractionIndex'); 1388 Slice=rmfield(Slice,'InterfaceCoord'); 1385 1389 end 1386 1390 … … 1430 1434 check_update=0; 1431 1435 end 1432 errormsg=update_imadoc( GeometryCalib,XmlName,'GeometryCalib');% introduce the calibration data in the xml file1436 errormsg=update_imadoc(Slice,XmlName,'Slice');% introduce the calibration data in the xml file 1433 1437 if ~strcmp(errormsg,'') 1434 1438 msgbox_uvmat('ERROR',errormsg); … … 1446 1450 1447 1451 %% store the result in the xml file used for calibration 1448 errormsg=update_imadoc( GeometryCalib,XmlFile,'GeometryCalib');% introduce the calibration data in the xml file1452 errormsg=update_imadoc(Slice,XmlFile,'Slice');% introduce the calibration data in the xml file 1449 1453 if strcmp(errormsg,'') 1450 1454 msgbox_uvmat('CONFIRMATION',['slice positions saved in ' XmlFile]); … … 1925 1929 pos(:,3)=pos(:,3)+Calib.SliceCoord(3); 1926 1930 end 1927 [X,Y]=px_XYZ(Calib, pos(:,1),pos(:,2),pos(:,3));1931 [X,Y]=px_XYZ(Calib,Slice,pos(:,1),pos(:,2),pos(:,3)); 1928 1932 end 1929 1933 flagobj=~inpolygon(Xi,Yi,X',Y');%=0 inside the polygon, 1 outside … … 2479 2483 drawnow 2480 2484 if isfield(XmlDataRead, 'GeometryCalib') && ~isempty(XmlDataRead.GeometryCalib) 2481 XmlData.GeometryCalib=XmlDataRead.GeometryCalib; 2482 if isfield(XmlData.GeometryCalib,'CheckVolumeScan') && isequal(XmlData.GeometryCalib.CheckVolumeScan,1) 2485 XmlData.GeometryCalib=XmlDataRead.GeometryCalib; 2486 end 2487 XmlData.Slice=XmlData.GeometryCalib;%default 2488 if isfield(XmlDataRead, 'Slice') && ~isempty(XmlDataRead.Slice) 2489 XmlData.Slice=XmlDataRead.Slice; 2490 % check whether the GUI geometry_calib is opened 2491 % hgeometry_calib=findobj('tag','geometry_calib'); 2492 % if ~isempty(hgeometry_calib) % check whether the display of the GUI geometry_calib is consistent with the current calib param 2493 % GUserData=get(hgeometry_calib,'UserData'); 2494 % if ~(isfield(GUserData,'XmlInputFile') && strcmp(GUserData.XmlInputFile,XmlFileName)) 2495 % answer=msgbox_uvmat('INPUT_Y-N','refresh the display of the GUI geometry_calib with the new input data?'); 2496 % if strcmp(answer,'Yes') 2497 % geometry_calib(XmlFileName);%diplay the new calibration points and parameters in geometry_calib 2498 % end 2499 % end 2500 % end 2501 end 2502 if isfield(XmlData.Slice,'CheckVolumeScan') && isequal(XmlData.Slice.CheckVolumeScan,1) 2483 2503 set (handles.slices,'String','volume') 2484 2504 end 2485 % check whether the GUI geometry_calib is opened2486 hgeometry_calib=findobj('tag','geometry_calib');2487 if ~isempty(hgeometry_calib) % check whether the display of the GUI geometry_calib is consistent with the current calib param2488 GUserData=get(hgeometry_calib,'UserData');2489 if ~(isfield(GUserData,'XmlInputFile') && strcmp(GUserData.XmlInputFile,XmlFileName))2490 answer=msgbox_uvmat('INPUT_Y-N','refresh the display of the GUI geometry_calib with the new input data?');2491 if strcmp(answer,'Yes')2492 geometry_calib(XmlFileName);%diplay the new calibration points and parameters in geometry_calib2493 end2494 end2495 end2496 end2497 2505 if isfield(XmlDataRead, 'LIFCalib') 2498 2506 XmlData.LIFCalib=XmlDataRead.LIFCalib; … … 2571 2579 set(handles.TransformName,'Value',3); % phys transform by default if fixedLimits is off 2572 2580 end 2573 if isfield( GeometryCalib,'SliceCoord')2574 siz=size( GeometryCalib.SliceCoord);2581 if isfield(XmlData.Slice,'SliceCoord') 2582 siz=size(XmlData.Slice.SliceCoord); 2575 2583 if siz(1)>1 2576 2584 NbSlice=siz(1); … … 2578 2586 set(handles.slices,'Value',1) 2579 2587 end 2580 if isfield( GeometryCalib,'CheckVolumeScan') && isequal(GeometryCalib.CheckVolumeScan,1)2588 if isfield(XmlData.Slice,'CheckVolumeScan') && isequal(XmlData.Slice.CheckVolumeScan,1) 2581 2589 set(handles.num_NbSlice,'Visible','off') 2582 2590 else … … 5183 5191 Y=ObjectData.Coord(:,2); 5184 5192 if testphys 5185 [X,Y]=px_XYZ(Calib, X,Y,0);% to generalise with 3D cases5193 [X,Y]=px_XYZ(Calib,[],X,Y,0);% to generalise with 3D cases 5186 5194 end 5187 5195 flagobj=~inpolygon(Xi,Yi,X',Y');%=0 inside the polygon, 1 outside
Note: See TracChangeset
for help on using the changeset viewer.