Index: /trunk/src/browse_data.m
===================================================================
--- /trunk/src/browse_data.m	(revision 588)
+++ /trunk/src/browse_data.m	(revision 589)
@@ -169,12 +169,12 @@
 
 
-%------------------------------------------------------------------------
-function MirrorDir_Callback(hObject, eventdata, handles)
-%------------------------------------------------------------------------   
-MirrorDir=get(handles.MirrorDir,'String');
-[tild,MirrorName]=fileparts(MirrorDir);
-s=xml2struct(fullfile(MirrorDir,[MirrorName '.xml']));
-set(handles.SourceDir,'String',s.SourceDir)
-SourceDir_Callback([],[], handles)
+% %------------------------------------------------------------------------
+% function MirrorDir_Callback(hObject, eventdata, handles)
+% %------------------------------------------------------------------------   
+% MirrorDir=get(handles.MirrorDir,'String');
+% [tild,MirrorName]=fileparts(MirrorDir);
+% s=xml2struct(fullfile(MirrorDir,[MirrorName '.xml']));
+% set(handles.SourceDir,'String',s.SourceDir)
+% SourceDir_Callback([],[], handles)
 
 
@@ -212,8 +212,11 @@
  function ListExperiments_Callback(hObject, eventdata, handles)
 %------------------------------------------------------------------------
+MirrorPath='';
+CampaignPath=get(handles.SourceDir,'String');
 if strcmp(get(handles.MirrorDir,'Visible'),'on')
-    CampaignPath=get(handles.MirrorDir,'String');
-else
-    CampaignPath=get(handles.SourceDir,'String');
+%     CampaignPath=get(handles.MirrorDir,'String');
+    MirrorPath=get(handles.MirrorDir,'String');
+else
+%     CampaignPath=get(handles.SourceDir,'String');
 end
 % MirrorPath=get(handles.MirrorDir,'String');
@@ -228,5 +231,5 @@
     testList=0;
 end
-scan_experiments(handles,ListExperiments,CampaignPath)
+scan_experiments(handles,ListExperiments,CampaignPath,MirrorPath)
 
 
@@ -242,8 +245,8 @@
         if ~isequal(hdir(ilist).name(1),'.')
             DataSeries=fullfile(CampaignPath,ListExperiments{iexp},hdir(ilist).name);
-            if exist('MirrorPath','var')
+            if ~isempty(MirrorPath)
                 mirror=fullfile(MirrorPath,ListExperiments{iexp},hdir(ilist).name);
                 if ~exist(mirror)% create mirror if needed
-                    system(['ln -s ' source ' ' mirror])
+                    system(['ln -s ' DataSeries ' ' mirror])
                 end
             end
Index: /trunk/src/check_files.m
===================================================================
--- /trunk/src/check_files.m	(revision 588)
+++ /trunk/src/check_files.m	(revision 589)
@@ -32,5 +32,4 @@
 svn_info.status=[];
 list_fct={...
-    'xmltree';...%function for editing xml files (toolbox outside uvmat)
     'browse_data';...% function for scanning directories in a project/campaign
     'browse_data.fig';...% GUI corresponding to dataview
@@ -85,5 +84,4 @@
     'read_civdata';... reads new civ data from netcdf files
     'read_field';...% read the fields from files in different formats (netcdf files, images, video)
-%     'read_get_field';... read the list of selected variables from the GUI get_field (TODO: use read_GUI)
     'read_GUI';... %read a GUI and provide the data as a Matlab structure
     'read_image';...%read images or video objects
@@ -133,4 +131,8 @@
 %% loop on the list of functions in the uvmat package
 icount=0;
+if ~exist('@xmltree','dir')
+    icount=icount+1;
+    checkmsg{icount}='ERROR installation: toolbox xmltree missing';
+end
 datnum=zeros(1,length(list_fct));
 for i=1:length(list_fct)
Index: /trunk/src/civ.m
===================================================================
--- /trunk/src/civ.m	(revision 588)
+++ /trunk/src/civ.m	(revision 589)
@@ -527,4 +527,9 @@
 %show the reference image edit box if relevant (not needed for movies or in the absence of time information
 if numel(time)>=2 % if there are at least two time values to define dt
+    if size(time,1)<MaxIndex_i;
+        msgbox_uvmat('WARNING','maximum i index restricted by the timing of the xml file');
+    elseif size(time,2)<MaxIndex_j
+        msgbox_uvmat('WARNING','maximum j index restricted by the timing of the xml file');
+    end
     MaxIndex_i=min(size(time,1),MaxIndex_i);%possibly adjust the max index according to time data
     MaxIndex_j=min(size(time,2),MaxIndex_j);
Index: /trunk/src/compile_functions.m
===================================================================
--- /trunk/src/compile_functions.m	(revision 588)
+++ /trunk/src/compile_functions.m	(revision 589)
@@ -6,4 +6,10 @@
 display('compiling civ_matlab...')
 % commands to compile civ_matlab and eventually other functions
+if ~exist('bin','dir')
+    [success,errormsg]=mkdir('bin');
+    if success~=1
+        display(errormsg)
+    end
+end
 mcc -m -R -nojvm -R -nodisplay civ_matlab.m
 system('mv -f civ_matlab bin/');
Index: /trunk/src/fullfile_uvmat.m
===================================================================
--- /trunk/src/fullfile_uvmat.m	(revision 588)
+++ /trunk/src/fullfile_uvmat.m	(revision 589)
@@ -120,6 +120,6 @@
 %     filename=fullfile(RootPath,RootFile);
 % end
-filename=[filename sep1 i1_str sep2 i2_str sep3 j1_str sep4 j2_str FileExt];
-
+filename=[filename sep1 i1_str sep2 i2_str sep3 j1_str sep4 j2_str];
+filename=[regexprep(filename,'_$','') FileExt];%suppress possible '_' at the end of the string and add the extension
 
 
Index: /trunk/src/proj_field.m
===================================================================
--- /trunk/src/proj_field.m	(revision 588)
+++ /trunk/src/proj_field.m	(revision 589)
@@ -621,5 +621,5 @@
                 flagsel=ones(size(coord_x));
             end
-            if isequal(ProjMode,'projection') || isequal(ProjMode,'interp_tps')
+            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))) ...
@@ -633,5 +633,5 @@
             for iselect=1:numel(VarIndex)-2*testU
                 VarName=FieldData.ListVarName{VarIndex(iselect)};
-                eval(['ProjVar{iselect}=FieldData.' VarName '(indsel);']);%scalar value
+                ProjVar{iselect}=FieldData.(VarName)(indsel);%scalar value
             end   
             if testU
@@ -1185,5 +1185,7 @@
                         FieldData=rmfield(FieldData,FieldData.ListVarName{CellInfo{icell}.VarIndex_warnflag});
                     end
+                    % interpolate and calculate field on the grid
                     [VarVal,ListFieldProj,VarAttribute,errormsg]=calc_field_interp([coord_X coord_Y],FieldData,CellInfo{icell}.FieldName,XI,YI);
+                    
                     if isfield(CellInfo{icell},'CheckSub') && CellInfo{icell}.CheckSub && ~isempty(vector_x_proj)
                         ProjData.(ProjData.ListVarName{vector_x_proj})=ProjData.(ProjData.ListVarName{vector_x_proj})-VarVal{1};
@@ -1833,6 +1835,7 @@
                         eval(['FieldData.' VarName '=FieldData.' VarName '(indsel);'])
                     end
-                    eval(['InterpFct=TriScatteredInterp(double(coord_X),double(coord_Y),double(coord_Z),double(FieldData.' VarName '))'])
-                    eval(['ProjData.' VarName '=InterpFct(X,Y,Z);'])
+                    % linear interpolation
+                    InterpFct=TriScatteredInterp(double(coord_X),double(coord_Y),double(coord_Z),double(FieldData.(VarName)));
+                    ProjData.(VarName)=InterpFct(X,Y,Z);
 %                     eval(['varline=reshape(ProjData.' VarName ',1,length(coord_y_proj)*length(coord_x_proj));'])
 %                     FFlag= isnan(varline); %detect undefined values NaN
Index: /trunk/src/set_object.m
===================================================================
--- /trunk/src/set_object.m	(revision 588)
+++ /trunk/src/set_object.m	(revision 589)
@@ -288,5 +288,5 @@
 set(handles.num_RangeX_2,'Visible','off')
 set(handles.num_RangeY_1,'Visible','off')
-if isequal(ProjMode,'interp_lin')
+if isequal(ProjMode,'interp_lin')|| isequal(ProjMode,'interp_tps')
     set(handles.num_RangeY_2,'Visible','off')
 else
Index: /trunk/src/uvmat.m
===================================================================
--- /trunk/src/uvmat.m	(revision 588)
+++ /trunk/src/uvmat.m	(revision 589)
@@ -917,5 +917,5 @@
         if isfield(XmlData, 'GeometryCalib') && ~isempty(XmlData.GeometryCalib)
             if isfield(XmlData.GeometryCalib,'VolumeScan') && isequal(XmlData.GeometryCalib.VolumeScan,'y')
-                set (handles.num_NbSlice,'String','volume')
+                set (handles.slices,'String','volume')
             end
             hgeometry_calib=findobj('tag','geometry_calib');
@@ -996,6 +996,7 @@
            end
            if isfield(GeometryCalib,'VolumeScan') && isequal(GeometryCalib.VolumeScan,'y')
-               set(handles.num_NbSlice,'String','volume')
+               set(handles.num_NbSlice,'Visible','off')
            else
+               set(handles.num_NbSlice,'Visible','on')
                set(handles.num_NbSlice,'String',num2str(NbSlice))
            end
@@ -1126,8 +1127,8 @@
 %------------------------------------------------------------------------
 if get(handles.scan_i,'Value')==1
-    set(handles.scan_i,'BackgroundColor',[1 1 0])
+%     set(handles.scan_i,'BackgroundColor',[1 1 0])
     set(handles.scan_j,'Value',0)
 else
-    set(handles.scan_i,'BackgroundColor',[0.831 0.816 0.784])
+%     set(handles.scan_i,'BackgroundColor',[0.831 0.816 0.784])
     set(handles.scan_j,'Value',1)
 end
@@ -1139,7 +1140,7 @@
 %------------------------------------------------------------------------
 if get(handles.scan_j,'Value')==1
-    set(handles.scan_j,'BackgroundColor',[1 1 0])
+%     set(handles.scan_j,'BackgroundColor',[1 1 0])
     set(handles.scan_i,'Value',0)
-    set(handles.scan_i,'BackgroundColor',[0.831 0.816 0.784])
+%     set(handles.scan_i,'BackgroundColor',[0.831 0.816 0.784])
 %     NomType=get(handles.NomType,'String');
 %     switch NomType
@@ -1150,7 +1151,7 @@
 %     end 
 else
-    set(handles.scan_j,'BackgroundColor',[0.831 0.816 0.784])
+%     set(handles.scan_j,'BackgroundColor',[0.831 0.816 0.784])
     set(handles.scan_i,'Value',1)
-    set(handles.scan_i,'BackgroundColor',[1 1 0])
+%     set(handles.scan_i,'BackgroundColor',[1 1 0])
     set(handles.CheckFixPair,'Visible','off')
 end
@@ -1222,17 +1223,17 @@
 function slices_Callback(hObject, eventdata, handles)
 %------------------------------------------------------------------------
-if get(handles.slices,'Value')==1
-    set(handles.slices,'BackgroundColor',[1 1 0])
-    set(handles.num_NbSlice,'Visible','on')
-    set(handles.z_text,'Visible','on')
-    set(handles.z_index,'Visible','on')
-    num_NbSlice_Callback(hObject, eventdata, handles)
-else
-    set(handles.num_NbSlice,'Visible','off')
-    set(handles.slices,'BackgroundColor',[0.7 0.7 0.7])
-    set(handles.z_text,'Visible','off')
-    set(handles.z_index,'Visible','off') 
-    set(handles.masklevel,'Value',1)
-    set(handles.masklevel,'String',{'1'})
+if strcmp(get(handles.slices,'String'),'slices')
+    if get(handles.slices,'Value')==1
+        set(handles.num_NbSlice,'Visible','on')
+        set(handles.z_text,'Visible','on')
+        set(handles.z_index,'Visible','on')
+        num_NbSlice_Callback(hObject, eventdata, handles)
+    else
+        set(handles.num_NbSlice,'Visible','off')
+        set(handles.z_text,'Visible','off')
+        set(handles.z_index,'Visible','off')
+        set(handles.masklevel,'Value',1)
+        set(handles.masklevel,'String',{'1'})
+    end
 end
 
@@ -1240,14 +1241,13 @@
 function num_NbSlice_Callback(hObject, eventdata, handles)
 %------------------------------------------------------------------------
+mode=get(handles.slices,'String');
 nb_slice_str=get(handles.num_NbSlice,'String');
-if isequal(nb_slice_str,'volume')
-    num=stra2num(get(handles.j1,'String'));
-    last_j=get(handles.last_j,'String');
-    nbslice=str2double(last_j{1});
+if strcmp(mode,'volume')
+    z=stra2num(get(handles.j1,'String'));
 else
     num=str2double(get(handles.i1,'String'));
     nbslice=str2double(get(handles.num_NbSlice,'String'));
-end
-z=mod(num-1,nbslice)+1;
+    z=mod(num-1,nbslice)+1;
+end
 set(handles.z_index,'String',num2str(z))
 for ilist=1:nbslice
@@ -1322,5 +1322,5 @@
             if mdetect
                 set(handles.num_NbSlice,'String',Name(i+1:ind_mask-1));
-                set(handles.num_NbSlice,'BackgroundColor',[1 1 0])
+                 set(handles.num_NbSlice,'BackgroundColor',[1 1 0])
                 set(handles.CheckMask,'UserData',Mask);
                 set(handles.CheckMask,'BackgroundColor',[1 1 0])
@@ -2043,10 +2043,10 @@
 end
 %update the z position index
-nbslice_str=get(handles.num_NbSlice,'String');
-if isequal(nbslice_str,'volume')%NOT USED
+mode_slice=get(handles.slices,'String');
+if strcmp(mode_slice,'volume')
     z_index=num_j1;
     set(handles.z_index,'String',num2str(z_index))
 else
-    nbslice=str2num(nbslice_str);
+    nbslice=str2num(get(handles.num_NbSlice,'String'));
     z_index=mod(num_i1-1,nbslice)+1;
     set(handles.z_index,'String',num2str(z_index))
@@ -2884,8 +2884,8 @@
 %-------------------------------------------------------------------
 if get(handles.CheckFixAspectRatio,'Value')
-    set(handles.CheckFixAspectRatio,'BackgroundColor',[1 1 0])
+%     set(handles.CheckFixAspectRatio,'BackgroundColor',[1 1 0])
     update_plot(handles);
 else
-    set(handles.CheckFixAspectRatio,'BackgroundColor',[0.7 0.7 0.7])
+%     set(handles.CheckFixAspectRatio,'BackgroundColor',[0.7 0.7 0.7])
     update_plot(handles);
 end
@@ -2895,5 +2895,5 @@
 %-------------------------------------------------------------------
 set(handles.CheckFixAspectRatio,'Value',1)% select the fixed aspect ratio button
-set(handles.CheckFixAspectRatio,'BackgroundColor',[1 1 0])% mark in yellow
+% set(handles.CheckFixAspectRatio,'BackgroundColor',[1 1 0])% mark in yellow
 update_plot(handles);
 %-------------------------------------------------------------------
@@ -5165,3 +5165,2 @@
 % --- Executes on button press in CheckColorBar.
 function CheckColorBar_Callback(hObject, eventdata, handles)
-
Index: /trunk/src/write_plot_param.m
===================================================================
--- /trunk/src/write_plot_param.m	(revision 588)
+++ /trunk/src/write_plot_param.m	(revision 589)
@@ -18,8 +18,7 @@
         if Coordinates.CheckFixAspectRatio
             set(handles.CheckFixAspectRatio,'Value',1)
-            set(handles.CheckFixAspectRatio,'BackgroundColor',[1 1 0])
         else
             set(handles.CheckFixAspectRatio,'Value',0)
-            set(handles.CheckFixAspectRatio,'BackgroundColor',[0.7 0.7 0.7])
+ 
         end
     end
