Changeset 1046 for trunk/src/transform_field
- Timestamp:
- May 30, 2018, 7:30:21 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/transform_field/phys_polar.m
r1027 r1046 95 95 %parameters for polar coordinates (taken from the calibration data of the first field) 96 96 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 97 XmlData.PolarReferenceRadius= 450;98 XmlData.PolarReferenceAngle= 450*pi/2;97 XmlData.PolarReferenceRadius=0;%450; 98 XmlData.PolarReferenceAngle=0;%450*pi/2; 99 99 origin_xy=[0 0];%center for the polar coordinates in the original x,y coordinates 100 100 radius_offset=0;%reference radius used to offset the radial coordinate r 101 101 angle_offset=0; %reference angle used as new origin of the polar angle (= axis Ox by default) 102 angle_scale=180/pi; 102 103 if isfield(XmlData,'TransformInput') 103 104 if isfield(XmlData.TransformInput,'PolarCentre') && isnumeric(XmlData.TransformInput.PolarCentre) … … 249 250 npx=[]; 250 251 npy=[]; 252 NbPoints=20; % nbre of points used to determine the image edge 251 253 for icell=1:length(A) 252 254 siz=size(A{icell}); … … 255 257 zphys=0; %default 256 258 if isfield(CalibIn{icell},'SliceCoord') %.Z= index of plane 259 if ZIndex==0 260 ZIndex=1; 261 end 257 262 SliceCoord=CalibIn{icell}.SliceCoord(ZIndex,:); 258 263 zphys=SliceCoord(3); %to generalize for non-parallel planes 259 264 end 260 xima=[0.5 siz(2)-0.5 0.5 siz(2)-0.5];%image coordiantes of corners 261 yima=[0.5 0.5 siz(1)-0.5 siz(1)-0.5]; 265 % xima=[0.5 siz(2)-0.5 0.5 siz(2)-0.5];%image coordinates of corners 266 % yima=[0.5 0.5 siz(1)-0.5 siz(1)-0.5]; 267 edge_x=linspace(0.5,siz(1)-0.5,NbPoints); 268 edge_y=linspace(0.5,siz(2)-0.5,NbPoints); 269 xima=[edge_y (siz(2)-0.5)*ones(1,NbPoints) edge_y 0.5*ones(1,NbPoints)];%image coordinates of corners 270 yima=[0.5*ones(1,NbPoints) edge_x (siz(1)-0.5)*ones(1,NbPoints) edge_x];%image coordinates of corners 262 271 [xcorner_new,ycorner_new]=phys_XYZ(CalibIn{icell},xima,yima,ZIndex);%corresponding physical coordinates 263 272 %transform the corner coordinates into polar ones
Note: See TracChangeset
for help on using the changeset viewer.