Index: /trunk/src/transform_field/phys.m
===================================================================
--- /trunk/src/transform_field/phys.m	(revision 201)
+++ /trunk/src/transform_field/phys.m	(revision 202)
@@ -194,4 +194,10 @@
            SliceCoord=Calib.SliceCoord(ZIndex,:);
            zphys=SliceCoord(3); %to generalize for non-parallel planes
+           if isfield(Calib,'InterfaceCoord') && isfield(Calib,'RefractionIndex') 
+                H=Calib.InterfaceCoord(3);
+                if H>zphys
+                    zphys=H-(H-zphys)/Calib.RefractionIndex; %corrected z (virtual object)
+                end
+           end
         end
         [XIMA,YIMA]=px_XYZ(CalibIn{icell},X,Y,zphys);% image coordinates for each point in the real space grid
@@ -250,4 +256,10 @@
     Zindex=Z;
     Zphys=Calib.SliceCoord(Zindex,3);%GENERALISER AUX CAS AVEC ANGLE
+    if isfield(Calib,'InterfaceCoord') && isfield(Calib,'RefractionIndex') 
+        H=Calib.InterfaceCoord(3);
+        if H>Zphys
+            Zphys=H-(H-Zphys)/Calib.RefractionIndex; %corrected z (virtual object)
+        end
+    end   
 else
     Zphys=0;
