Index: trunk/src/transform_field/phys_polar.m
===================================================================
--- trunk/src/transform_field/phys_polar.m	(revision 1033)
+++ trunk/src/transform_field/phys_polar.m	(revision 1046)
@@ -95,9 +95,10 @@
 %parameters for polar coordinates (taken from the calibration data of the first field)
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-XmlData.PolarReferenceRadius=450;
-XmlData.PolarReferenceAngle=450*pi/2;
+XmlData.PolarReferenceRadius=0;%450;
+XmlData.PolarReferenceAngle=0;%450*pi/2;
 origin_xy=[0 0];%center for the polar coordinates in the original x,y coordinates
 radius_offset=0;%reference radius used to offset the radial coordinate r
 angle_offset=0; %reference angle used as new origin of the polar angle (= axis Ox by default)
+angle_scale=180/pi; 
 if isfield(XmlData,'TransformInput')
     if isfield(XmlData.TransformInput,'PolarCentre') && isnumeric(XmlData.TransformInput.PolarCentre)
@@ -249,4 +250,5 @@
 npx=[];
 npy=[];
+NbPoints=20; % nbre of points used to determine the image edge
 for icell=1:length(A)
     siz=size(A{icell});
@@ -255,9 +257,16 @@
     zphys=0; %default
     if isfield(CalibIn{icell},'SliceCoord') %.Z= index of plane
+        if ZIndex==0
+            ZIndex=1;
+        end
        SliceCoord=CalibIn{icell}.SliceCoord(ZIndex,:);
        zphys=SliceCoord(3); %to generalize for non-parallel planes
     end
-    xima=[0.5 siz(2)-0.5 0.5 siz(2)-0.5];%image coordiantes of corners
-    yima=[0.5 0.5 siz(1)-0.5 siz(1)-0.5];
+%     xima=[0.5 siz(2)-0.5 0.5 siz(2)-0.5];%image coordinates of corners
+%     yima=[0.5 0.5 siz(1)-0.5 siz(1)-0.5];
+      edge_x=linspace(0.5,siz(1)-0.5,NbPoints);      
+      edge_y=linspace(0.5,siz(2)-0.5,NbPoints);
+      xima=[edge_y (siz(2)-0.5)*ones(1,NbPoints) edge_y 0.5*ones(1,NbPoints)];%image coordinates of corners
+      yima=[0.5*ones(1,NbPoints) edge_x (siz(1)-0.5)*ones(1,NbPoints) edge_x];%image coordinates of corners
     [xcorner_new,ycorner_new]=phys_XYZ(CalibIn{icell},xima,yima,ZIndex);%corresponding physical coordinates
     %transform the corner coordinates into polar ones    
