Index: trunk/src/proj_field.m
===================================================================
--- trunk/src/proj_field.m	(revision 576)
+++ trunk/src/proj_field.m	(revision 581)
@@ -142,5 +142,5 @@
         return
     end
-elseif  ~isequal(ObjectData.ProjMode,'interp')
+elseif  ~isequal(ObjectData.ProjMode,'interp_lin')
     errormsg=(['ProjMode option ' ObjectData.ProjMode ' not available in proj_field']);
         return
@@ -223,5 +223,5 @@
                     Var=FieldData.(VarName)(indsel);
                     ProjData.(VarName)(ipoint,1)=mean(Var);
-                    if isequal(ObjectData.ProjMode,'interp')
+                    if isequal(ObjectData.ProjMode,'interp_lin')
                          ProjData.(VarName)(ipoint,1)=griddata_uvmat(coord_x(indsel),coord_y(indsel),Var,Xpoint(1),Xpoint(2));
                     end
@@ -524,7 +524,7 @@
 theta=angle(dlinx+1i*dliny);%angle of each segment
 theta(siz_line(1))=theta(siz_line(1)-1);
-% determine a rectangles at +-width from the line (only used for the ProjMode='projection or 'filter')
+% determine a rectangles at +-width from the line (only used for the ProjMode='projection or 'interp_tps')
 xsup=zeros(1,siz_line(1)); xinf=zeros(1,siz_line(1)); ysup=zeros(1,siz_line(1)); yinf=zeros(1,siz_line(1));
-if isequal(ProjMode,'projection') || isequal(ProjMode,'filter')
+if isequal(ProjMode,'projection') || isequal(ProjMode,'interp_tps')
     xsup(1)=ObjectData.Coord(1,1)-width*sin(theta(1));
     xinf(1)=ObjectData.Coord(1,1)+width*sin(theta(1));
@@ -580,10 +580,10 @@
     % check needed object properties for unstructured positions (position given by the variables with role coord_x, coord_y
     if strcmp(CellInfo{icell}.CoordType,'scattered')
-        if  ~isequal(ProjMode,'interp')
+        if  ~isequal(ProjMode,'interp_lin')
             if width==0
                 errormsg='range of the projection object is missing';
                 return      
             else
-                lambda=2/(width*width); %smoothing factor used for filter: weight exp(-2) at distance width from the line
+                lambda=2/(width*width); %smoothing factor used for interp_tps: weight exp(-2) at distance width from the line
             end
         end
@@ -621,5 +621,5 @@
                 flagsel=ones(size(coord_x));
             end
-            if isequal(ProjMode,'projection') | isequal(ProjMode,'filter')
+            if isequal(ProjMode,'projection') || isequal(ProjMode,'interp_tps')
                 flagsel=flagsel & ((coord_y -yinf(ip))*(xinf(ip+1)-xinf(ip))>(coord_x-xinf(ip))*(yinf(ip+1)-yinf(ip))) ...
                 & ((coord_y -ysup(ip))*(xsup(ip+1)-xsup(ip))<(coord_x-xsup(ip))*(ysup(ip+1)-ysup(ip))) ...
@@ -649,5 +649,5 @@
                      end
                 end
-            elseif isequal(ProjMode,'interp') %linear interpolation:
+            elseif isequal(ProjMode,'interp_lin') %linear interpolation:
                 npoint=floor(linelength/DX)+1;% nbre of points in the profile (interval DX)
                 Xproj=linelength/(2*npoint):linelength/npoint:linelength-linelength/(2*npoint);
@@ -659,5 +659,5 @@
                      end
                 end
-            elseif isequal(ProjMode,'filter') %filtering
+            elseif isequal(ProjMode,'interp_tps') %filtering
                 npoint=floor(linelength/DX)+1;% nbre of points in the profile (interval DX)
                 Xproj=linelength/(2*npoint):linelength/npoint:linelength-linelength/(2*npoint);
@@ -983,13 +983,13 @@
 for icell=1:numel(CellInfo)% TODO: recalculate coordinates here to get the bounds in the rotated coordinates
     ProjMode{icell}=ObjectData.ProjMode;
-    if isfield(CellInfo{icell},'FieldRequest')
-        switch CellInfo{icell}.FieldRequest
+    if isfield(CellInfo{icell},'ProjModeRequest')
+        switch CellInfo{icell}.ProjModeRequest
             case 'interp_lin'
-                ProjMode{icell}='interp';
+                ProjMode{icell}='interp_lin';
             case 'interp_tps'
-                ProjMode{icell}='filter';
-        end
-    end
-    if strcmp(ProjMode{icell},'interp')||strcmp(ProjMode{icell},'filter')
+                ProjMode{icell}='interp_tps';
+        end
+    end
+    if strcmp(ProjMode{icell},'interp_lin')||strcmp(ProjMode{icell},'interp_tps')
         check_grid=1;
     end
@@ -1043,6 +1043,6 @@
         %% case of input fields with unstructured coordinates
         case 'scattered'
-            if strcmp(ProjMode{icell},'filter')
-                continue %skip for filter (needs tps field cell)
+            if strcmp(ProjMode{icell},'interp_tps')
+                continue %skip for interp_tps (needs tps field cell)
             end
             coord_x=FieldData.(FieldData.ListVarName{CellInfo{icell}.CoordIndex(end)});% initial x coordinates 
@@ -1148,5 +1148,5 @@
                         end
                     end
-                case 'interp'%interpolate data on a regular grid
+                case 'interp_lin'%interpolate data on a regular grid
                     coord_x_proj=XMin:DX:XMax;
                     coord_y_proj=YMin:DY:YMax;
@@ -1205,9 +1205,9 @@
             end
 
-            %% case of tps interpolation (applies only in filter mode and for spatial derivatives)
+            %% case of tps interpolation (applies only in interp_tps mode and for spatial derivatives)
         case 'tps'
-            if strcmp(ProjMode{icell},'filter')
+            if strcmp(ProjMode{icell},'interp_tps')
                 Coord=FieldData.(FieldData.ListVarName{CellInfo{icell}.CoordIndex});
-                NbSites=FieldData.(FieldData.ListVarName{CellInfo{icell}.NbSite_tps});
+                NbCentres=FieldData.(FieldData.ListVarName{CellInfo{icell}.NbCentres_tps});
                 SubRange=FieldData.(FieldData.ListVarName{CellInfo{icell}.SubRange_tps});
                 if isfield(CellInfo{icell},'VarIndex_vector_x_tps')&&isfield(CellInfo{icell},'VarIndex_vector_y_tps')
@@ -1221,5 +1221,5 @@
                 XI=XI+ObjectData.Coord(1,1);
                 YI=YI+ObjectData.Coord(1,2);
-                [DataOut,VarAttribute,errormsg]=calc_field_tps(Coord,NbSites,SubRange,FieldVar,CellInfo{icell}.FieldName,cat(3,XI,YI));   
+                [DataOut,VarAttribute,errormsg]=calc_field_tps(Coord,NbCentres,SubRange,FieldVar,CellInfo{icell}.FieldName,cat(3,XI,YI));   
                 ListFieldProj=(fieldnames(DataOut))';
                 VarDimName=cell(size(ListFieldProj));
@@ -1461,11 +1461,11 @@
                     YIMA=reshape(round(YIMA),1,npX*npY);
                     flagin=XIMA>=1 & XIMA<=DimValue(2) & YIMA >=1 & YIMA<=DimValue(1);%flagin=1 inside the original image
-                    if isequal(ProjMode{icell},'filter')
-                        npx_filter=ceil(abs(DX/DAX));
-                        npy_filter=ceil(abs(DY/DAY));
-                        Mfilter=ones(npy_filter,npx_filter)/(npx_filter*npy_filter);
-                        test_filter=1;
+                    if isequal(ProjMode{icell},'interp_tps')
+                        npx_interp_tps=ceil(abs(DX/DAX));
+                        npy_interp_tps=ceil(abs(DY/DAY));
+                        Minterp_tps=ones(npy_interp_tps,npx_interp_tps)/(npx_interp_tps*npy_interp_tps);
+                        test_interp_tps=1;
                     else
-                        test_filter=0;
+                        test_interp_tps=0;
                     end
                     eval(['ProjData.' AYName '=[coord_y_proj(1) coord_y_proj(end)];']) %record the new (projected ) y coordinates
@@ -1476,12 +1476,4 @@
                             eval(['ProjData.' VarName '=interp2(Coord{2},Coord{1},FieldData.' VarName ',Coord_x,Coord_y'');']) %TO TEST
                         end
-                        %filter the field (image) if option 'filter' is used
-%                         if test_filter
-%                             Aclass=class(FieldData.A);
-%                             eval(['ProjData.' VarName '=filter2(Mfilter,FieldData.' VarName ',''valid'');'])
-%                             if ~isequal(Aclass,'double')
-%                                 eval(['ProjData.' VarName '=' Aclass '(FieldData.' VarName ');'])%revert to integer values
-%                             end
-%                         end
                         eval(['vec_A=reshape(FieldData.' VarName ',[],nbcolor);'])%put the original image in line
                         %ind_in=find(flagin);
@@ -1525,5 +1517,5 @@
                 else
                     errormsg='projection of structured coordinates on oblique plane not yet implemented';
-                    %TODO: use interp3
+                    %TODO: use interp_lin3
                     return
                 end
@@ -1801,5 +1793,5 @@
                 end
             end  
-        elseif isequal(ObjectData.ProjMode,'interp')||isequal(ObjectData.ProjMode,'filter')%interpolate data on a regular grid
+        elseif isequal(ObjectData.ProjMode,'interp_lin')||isequal(ObjectData.ProjMode,'interp_tps')%interpolate data on a regular grid
             coord_x_proj=XMin:DX:XMax;
             coord_y_proj=YMin:DY:YMax;
@@ -2074,11 +2066,11 @@
                 YIMA=reshape(round(YIMA),1,npX*npY);
                 flagin=XIMA>=1 & XIMA<=DimValue(2) & YIMA >=1 & YIMA<=DimValue(1);%flagin=1 inside the original image 
-                if isequal(ObjectData.ProjMode,'filter')
-                    npx_filter=ceil(abs(DX/DAX));
-                    npy_filter=ceil(abs(DY/DAY));
-                    Mfilter=ones(npy_filter,npx_filter)/(npx_filter*npy_filter);
-                    test_filter=1;
+                if isequal(ObjectData.ProjMode,'interp_tps')
+                    npx_interp_tps=ceil(abs(DX/DAX));
+                    npy_interp_tps=ceil(abs(DY/DAY));
+                    Minterp_tps=ones(npy_interp_tps,npx_interp_tps)/(npx_interp_tps*npy_interp_tps);
+                    test_interp_tps=1;
                 else
-                    test_filter=0;
+                    test_interp_tps=0;
                 end
                 eval(['ProjData.' AYName '=[coord_y_proj(1) coord_y_proj(end)];']) %record the new (projected ) y coordinates
@@ -2089,8 +2081,8 @@
                           eval(['ProjData.' VarName '=interp2(Coord{2},Coord{1},FieldData.' VarName ',Coord_x,Coord_y'');']) %TO TEST
                     end
-                    %filter the field (image) if option 'filter' is used
-                    if test_filter  
+                    %filter the field (image) if option 'interp_tps' is used
+                    if test_interp_tps  
                          Aclass=class(FieldData.A);
-                         ProjData.(VarName)=filter2(Mfilter,FieldData.(VarName),'valid');
+                         ProjData.(VarName)=interp_tps2(Minterp_tps,FieldData.(VarName),'valid');
                          if ~isequal(Aclass,'double')
                              ProjData.(VarName)=Aclass(FieldData.(VarName));%revert to integer values
