Index: trunk/src/uvmat.m
===================================================================
--- trunk/src/uvmat.m	(revision 1041)
+++ trunk/src/uvmat.m	(revision 1045)
@@ -1748,5 +1748,5 @@
 set(handles.uvmat,'Pointer','watch') % set the mouse pointer to 'watch'
 drawnow
-% read the current input file name:
+% get the current input file name:
 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles);
 % detect the file type, get the movie object if relevant, and look for the corresponding file series:
@@ -2002,5 +2002,5 @@
 UvData.NewSeries=1; %flag for REFRESH: begin a new series
 UvData.FileName_1='';% name of the current second field (used to detect a  constant field during file scanning)
-UvData.FileType{index}=FileInfo.FileType;
+%UvData.FileType{index}=FileInfo.FileType;
 UvData.FileInfo{index}=FileInfo;
 UvData.MovieObject{index}=VideoObject;
@@ -2196,4 +2196,5 @@
 UvData.XmlData{index}=XmlData;
 UvData.NewSeries=1;
+set(handles.uvmat,'UserData',UvData)
 
 %display warning message
@@ -2233,5 +2234,5 @@
     set(handles.Coord_y,'String','Coord_y');
 end
-set(handles.uvmat,'UserData',UvData)
+
 
 %% set index navigation options
@@ -3157,10 +3158,6 @@
 if isempty(i2), set(handles.i2,'String',''); end % suppress the second i index display if not used
 if isempty(j2), set(handles.j2,'String',''); end % suppress the second j index display if not used
-% if strcmp(get(handles.NomType,'String'),'level')
-%     jindex=str2num(get(handles.j1,'String'));
-%     filename=[fullfile(RootPath,SubDir,['level' num2str(jindex)],RootFile) FileIndex FileExt];% build the input file name (first line)
-% else
 if isempty(regexp(RootPath,'^http://'))
-filename=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];% build the input file name (first line)
+    filename=[fullfile(RootPath,SubDir,RootFile) FileIndex FileExt];% build the input file name (first line)
 else
     filename=[RootPath '/' SubDir '/' RootFile FileIndex FileExt];%
@@ -3250,5 +3247,5 @@
     for iobj=1:numel(UvData.ProjObject)
         if isfield(UvData.ProjObject{iobj},'ProjMode')&& strcmp(UvData.ProjObject{iobj}.ProjMode,'interp_tps')
-            check_proj_tps=1;
+            check_proj_tps=1;% tps projection proposed
             break
         end
@@ -3285,6 +3282,6 @@
     end
 end
-switch UvData.FileInfo{1}.FileType
-    case {'civx','civdata','netcdf','pivdata_fluidimage'};
+switch UvData.FileInfo{1}.FieldType
+    case {'civdata','netcdf'};
         list_fields=get(handles.FieldName,'String');% list menu fields
         FieldName= list_fields{get(handles.FieldName,'Value')}; % selected field
@@ -3775,10 +3772,11 @@
         set(handles.ListObject_1,'String',{'plane'})
         if UvData.Field.NbDim==3 %3D case
-%             ZBounds(1)=UvData.Field.ZMin; %minimum for the Z slider
-%             ZBounds(2)=UvData.Field.ZMax;%maximum for the Z slider
             UvData.ProjObject{1}.NbDim=3;%test for 3D objects
             UvData.ProjObject{1}.RangeZ=UvData.Field.CoordMesh;%main plotting plane
             UvData.ProjObject{1}.Coord(1,3)=(UvData.Field.ZMin+UvData.Field.ZMax)/2;%section at a middle plane chosen
             UvData.ProjObject{1}.Angle=[0 0];
+            if isfield(UvData.Field,'CoordUnit')
+                UvData.ProjObject{1}.CoordUnit=CoordUnit;
+            end
         elseif isfield(UvData,'Z')
             %multilevel case (single menuplane in a 3D space)
@@ -3846,8 +3844,8 @@
             UvData.ProjObject{iobj}.NbDim=3;%test for 3D objects
             if ~isfield(UvData.ProjObject{iobj},'RangeZ')
-            UvData.ProjObject{iobj}.RangeZ=UvData.Field.CoordMesh;%main plotting plane
+                UvData.ProjObject{iobj}.RangeZ=UvData.Field.CoordMesh;%main plotting plane
             end
             if iobj==1 && ~(isfield(UvData.ProjObject{iobj},'Coord') && size(UvData.ProjObject{iobj}.Coord,2)>=3 && UvData.ProjObject{iobj}.Coord(1,3)<UvData.Field.ZMax && UvData.ProjObject{iobj}.Coord(1,3)>UvData.Field.ZMin)
-                 UvData.ProjObject{iobj}.Coord(1,3)=(UvData.Field.ZMin+UvData.Field.ZMax)/2;%section at a middle plane chosen
+                UvData.ProjObject{iobj}.Coord(1,3)=(UvData.Field.ZMin+UvData.Field.ZMax)/2;%section at a middle plane chosen
             end
         end
@@ -3979,19 +3977,20 @@
     % display menus and plot histograms
     test_v=0;
-    if ~isempty(menu_histo)
-        set(handles.HistoMenu,'Value',1)
-        set(handles.HistoMenu,'String',menu_histo)
-        set(handles.Histogram,'Visible','on')
-        set(handles.HistoMenu,'Visible','on')
-        set(handles.HistoAxes,'Visible','on')
-        HistoMenu_Callback(handles.HistoMenu, [], handles)% plot first histogram
-    end
-end
-
+    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% A REMETTRE
+%     if ~isempty(menu_histo)
+%         set(handles.HistoMenu,'Value',1)
+%         set(handles.HistoMenu,'String',menu_histo)
+%         set(handles.Histogram,'Visible','on')
+%         set(handles.HistoMenu,'Visible','on')
+%         set(handles.HistoAxes,'Visible','on')
+%         HistoMenu_Callback(handles.HistoMenu, [], handles)% plot first histogram
+%     end
+end
+% open the set_object for interactive plane projection in 3D case
 if UvData.Field.NbDim==3
     set(handles.CheckEditObject,'Value',1)
     CheckEditObject_Callback(handles.uvmat, [], handles)
 end
-%ResizeFcn(handles.uvmat,[],handles)
+
 set(handles.uvmat,'Pointer',pointer)
 
@@ -4359,5 +4358,5 @@
 [RootPath,SubDir,RootFile,FileIndices,FileExt]=read_file_boxes(handles);
 if isempty(regexp(RootPath,'^http://'))
-FileName=[fullfile(RootPath,SubDir,RootFile) FileIndices FileExt];
+    FileName=[fullfile(RootPath,SubDir,RootFile) FileIndices FileExt];
 else
     FileName=[RootPath '/' SubDir '/' RootFile FileIndices FileExt];
@@ -4452,5 +4451,5 @@
                 set(handles.Coord_y,'Max',2)
                 %set(huvmat,
-            case 'civdata...'%reinitiate input, return to automatic civ data reading
+            case 'civdata...'%reinitiate input, return to automatic civ data readingget_field
                 display_file_name(handles,FileName,1)
         end
@@ -4459,7 +4458,4 @@
             if isfield(GetFieldData,'Coordinates')
                 XName=GetFieldData.Coordinates.Coord_x;
-%                set(handles.SwitchCoordIndex,'String','var'); % variable used as coordinate
-%             else
-%                 set(handles.SwitchCoordIndex,'String','dim'); % matrix index used a coordinate
             end
             TimeNameStr=GetFieldData.Time.SwitchVarIndexTime;
@@ -4477,5 +4473,4 @@
                     MaxIndex_i{1}=num2str(GetFieldData.Time.TimeDimension);
                     set(handles.MaxIndex_i,'String',MaxIndex_i)%TODO: record time unit
-                    UvData=get(handles.uvmat,'UserData');
                     UvData.TimeUnit=GetFieldData.Time.TimeUnit;
                     set(handles.uvmat,'UserData',UvData);
@@ -4490,5 +4485,4 @@
                     MaxIndex_i{1}=num2str(GetFieldData.Time.TimeDimension);
                     set(handles.MaxIndex_i,'String',MaxIndex_i)%TODO: record time unit
-                    UvData=get(handles.uvmat,'UserData');
                     UvData.TimeUnit=GetFieldData.Time.TimeUnit;
                     set(handles.uvmat,'UserData',UvData);
@@ -4497,7 +4491,4 @@
             end
             set(handles.Coord_x,'String',XName)
-%             if ischar(YName)
-%                 YName={YName};
-%             end
             set(handles.Coord_y,'String',YName)
             set(handles.Coord_z,'String',ZName)
@@ -4506,5 +4497,5 @@
             set(handles.ColorScalar,'Value',1)
             set(handles.ColorScalar,'String',VecColorList);
-            UvData.FileInfo{1}.FileType='netcdf';
+           % UvData.FileInfo{1}.FileType='netcdf';
             set(handles.uvmat,'UserData',UvData)
             REFRESH_Callback(hObject, eventdata, handles)
@@ -4672,5 +4663,5 @@
             set(handles.FieldName_1,'String',[FieldList; {'get_field...'}]);
            
-            UvData.FileType{2}='netcdf';
+            UvData.FileInfo{2}.FileType='netcdf';
             set(handles.uvmat,'UserData',UvData)
             REFRESH_Callback(hObject, eventdata, handles)
@@ -4804,5 +4795,5 @@
 else% we introduce the same file (with a different field) for the second series
      FileName_1=FileName;% we compare two fields in the same file
-     UvData.FileType{2}=UvData.FileInfo{1}.FileType;
+     UvData.FileInfo{2}.FileType=UvData.FileInfo{1}.FileType;
      UvData.XmlData{2}= UvData.XmlData{1};
      set(handles.SubField,'Value',1)
@@ -5721,8 +5712,8 @@
 %------------------------------------------------------------------------
 check_view=get(handles.CheckViewObject,'Value');
-    hset_object=findobj(allchild(0),'tag','set_object');
-    if ~isempty(hset_object)
-        delete(hset_object)% delete existing version of set_object
-    end
+hset_object=findobj(allchild(0),'tag','set_object');
+if ~isempty(hset_object)
+    delete(hset_object)% delete existing version of set_object
+end
 if check_view %activate set_object
     IndexObj=get(handles.ListObject,'Value');
@@ -5747,5 +5738,5 @@
         data.Type='plane';
     end
-
+    
     %% initiate the new projection object
     hset_object=set_object(data,[],ZBounds);
@@ -5758,9 +5749,4 @@
         set(hhset_object.SAVE,'Enable','on')
     end
-else
-%     hset_object=findobj(allchild(0),'tag','set_object');
-%     if ~isempty(hset_object)
-%         delete(hset_object)% delete existing version of set_object
-%     end
 end
 
