Index: /trunk/src/check_files.m
===================================================================
--- /trunk/src/check_files.m	(revision 496)
+++ /trunk/src/check_files.m	(revision 497)
@@ -3,8 +3,8 @@
 %  uvmat path to the Matlab path if needed.
 %----------------------------------------------------------------------
-% function [errormsg,date_str,ver]=check_files
+% function [checkmsg,date_str,ver]=check_files
 %
 % OUTPUT:
-% errormsg: error message listing functions whose paths are not in the directory of uvmat.m
+% checkmsg: error message listing functions whose paths are not in the directory of uvmat.m
 % date_str: date of the most recent modification of a file in the toolbox
 % ver : svn version in case this is a  svn repository
@@ -26,7 +26,6 @@
 %AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 
-function [errormsg,date_str,svn_info]=check_files
-errormsg={};%default
-date_str='';
+function [checkmsg,date_str,svn_info]=check_files
+checkmsg={};%default
 svn_info.rep_rev=[];
 svn_info.cur_rev=[];
@@ -53,5 +52,5 @@
     'editxml.fig';...%interface for editxml
     'fileparts_uvmat';...% extracts the root name,field indexes and nomenclature type from an input filename
-    'fill_GUI';...% fill a GUI with handles 'handles' from input data Param 
+    'fill_GUI';...%  fill a GUI with a set of parameters from a Matlab structure 
     'filter_tps';...% find the thin plate spline coefficients for interpolation-smoothing
     'find_field_indices';...% group the variables of a nc-formated Matlab structure into 'fields' with common dimensions
@@ -87,5 +86,5 @@
     'read_image';... read images or video objects
     'read_get_field';... read the list of selected variables from the GUI get_field (TODO: use read_GUI)
-    'read_GUI';... %read all parameters set by a GUI as a Matlab structure
+    'read_GUI';... %read a GUI and provide the data as a Matlab structure
     'read_image';...%read .civ files (obsolete, but can be adapted to other text documentation files) 
     'read_multimadoc';... %read a set of Imadoc files and compare their timing of different file series
@@ -121,5 +120,5 @@
     };
 dir_fct=which('uvmat');% path to uvmat
-[pathuvmat,name,ext]=fileparts(dir_fct);
+pathuvmat=fileparts(dir_fct);
 
 %% add the uvmat path to matlab if needed
@@ -136,10 +135,10 @@
     if isempty(dir_fct)
         icount=icount+1;
-        errormsg{icount}=[list_fct{i} ' not found'];% test for function not found
+        checkmsg{icount}=[list_fct{i} ' not found'];% test for function not found
     else
-        [pth,name,ext]=fileparts(dir_fct);
-        if ~isequal(pathuvmat,pth)&~isequal(fullfile(pathuvmat,'private'),pth)
+        pth=fileparts(dir_fct);
+        if ~isequal(pathuvmat,pth) && ~isequal(fullfile(pathuvmat,'private'),pth)
             icount=icount+1;
-            errormsg{icount}=[dir_fct ' overrides the package UVMAT'];% bad path for the function
+            checkmsg{icount}=[dir_fct ' overrides the package UVMAT'];% bad path for the function
         end
         datfile=dir(dir_fct);
@@ -150,4 +149,6 @@
 end
 date_str=datestr(max(datnum));
+
+%% check svn status
 [status,result]=system('svn --help');
 if status==0
@@ -158,23 +159,26 @@
         svn_info.cur_rev=str2double(t.rev);
     end
-    [tild,result]=system(['svn info -r ''HEAD'' '  dir_fct]);
+    [tild,result]=system(['svn info -r ''HEAD'' '  pathuvmat]);
     t=regexp(result,'R.vision\s*:\s*(?<rev>\d+)','names');
     if ~isempty(t)
-    svn_info.rep_rev=str2double(t.rev);
+        svn_info.rep_rev=str2double(t.rev);
     end
-    [tild,result]=system(['svn status'  dir_fct]);
+    [tild,result]=system(['svn status '  pathuvmat]);
     svn_info.status=result;
-    errormsg =[errormsg {['SVN revision : ' num2str(svn_info.cur_rev)]}];
+    checkmsg =[checkmsg {['SVN revision : ' num2str(svn_info.cur_rev)]}];
     if svn_info.rep_rev>svn_info.cur_rev
-        errormsg =[errormsg ...
+        checkmsg =[checkmsg ...
             {['Repository now at revision ' num2str(svn_info.rep_rev) '. Please type svn update in uvmat folder']}];
     end
     modifications=regexp(svn_info.status,'M\s[^(\n|\>)]+','match');
     if ~isempty(modifications)
-        errormsg=[errormsg modifications];
+        for ilist=1:numel(modifications)
+            [tild,FileName,FileExt]=fileparts(modifications{ilist});
+            checkmsg=[checkmsg {[FileName FileExt ' modified']}];
+        end
     end
 else
-    errormsg=[errormsg {'SVN not available'}];
+    checkmsg=[checkmsg {'SVN not available'}];
 end
-errormsg=errormsg';
+checkmsg=checkmsg';
 
Index: /trunk/src/civ_matlab.m
===================================================================
--- /trunk/src/civ_matlab.m	(revision 496)
+++ /trunk/src/civ_matlab.m	(revision 497)
@@ -228,6 +228,4 @@
     [Data.Civ1_SubRange,Data.Civ1_NbSites,Data.Civ1_Coord_tps,Data.Civ1_U_tps,Data.Civ1_V_tps,tild,Ures, Vres,tild,FFres]=...
         filter_tps([Data.Civ1_X(ind_good) Data.Civ1_Y(ind_good)],Data.Civ1_U(ind_good),Data.Civ1_V(ind_good),[],Data.Patch1_SubDomain,Data.Patch1_Rho,Data.Patch1_Threshold);
-%     fill=zeros(3,2,size(Data.Civ1_SubRange,3)); %matrix of zeros to complement the matrix Data.Civ1_Coord_tps (conveninent for file storage)
-%     Data.Civ1_Coord_tps=cat(1,Data.Civ1_Coord_tps,fill);
     Data.Civ1_U_smooth(ind_good)=Ures;
     Data.Civ1_V_smooth(ind_good)=Vres;
@@ -424,6 +422,4 @@
     [Data.Civ2_SubRange,Data.Civ2_NbSites,Data.Civ2_Coord_tps,Data.Civ2_U_tps,Data.Civ2_V_tps,tild,Ures, Vres,tild,FFres]=...
         filter_tps([Data.Civ2_X(ind_good) Data.Civ2_Y(ind_good)],Data.Civ2_U(ind_good),Data.Civ2_V(ind_good),[],Data.Patch2_SubDomain,Data.Patch2_Rho,Data.Patch2_Threshold);
-%     fill=zeros(3,2,size(Data.Civ2_SubRange,3)); %matrix of zeros to complement the matrix Data.Civ1_Coord_tps (conveninent for file storage)
-%     Data.Civ2_Coord_tps=cat(1,Data.Civ2_Coord_tps,fill);
     Data.Civ2_U_smooth(ind_good)=Ures;
     Data.Civ2_V_smooth(ind_good)=Vres;
Index: /trunk/src/fill_GUI.m
===================================================================
--- /trunk/src/fill_GUI.m	(revision 496)
+++ /trunk/src/fill_GUI.m	(revision 497)
@@ -1,4 +1,14 @@
-%'fill_GUI': fill a GUI with handles 'handles' from input data Param 
+%'fill_GUI': fill a GUI with a set of parameters from a Matlab structure 
 % -----------------------------------------------------------------------
+% function errormsg=fill_GUI(Param,handles)
+% OUPUT:
+% errormsg: error message, ='' by default
+%
+% INPUT:
+% Param: matlab structure containing the information to display in the GUI
+% handles: Matlab structure containing the handles of the GUI elements
+%
+% see also the reverse function read_GUI.m
+%
 function errormsg=fill_GUI(Param,handles)
 %------------------------------------------------------------------------
@@ -18,8 +28,8 @@
     else
         hh=[];
-        input_data=Param.(fields{ifield})
+        input_data=Param.(fields{ifield});
         check_done=0;
         if isfield(handles,fields{ifield})
-            hh=handles.(fields{ifield})
+            hh=handles.(fields{ifield});
             if strcmp(get(hh,'Type'),'uitable')
                 set(hh,'Visible','on')
Index: /trunk/src/find_file_series.m
===================================================================
--- /trunk/src/find_file_series.m	(revision 496)
+++ /trunk/src/find_file_series.m	(revision 497)
@@ -218,8 +218,8 @@
         [tild,tild,tild,tild,tild,tild,tild,tild,NomType]=fileparts_uvmat(dirpair(ind_select(ifile_min)).name);% update the representation of indices (number of 0 before the number)
         NomType=regexprep(NomType,['^' NomTypePref],'');
-    end
-    %% update the file type if the input file does not exist (pb of 0001)
-    if isempty(FileType)
-        [FileType,tild,MovieObject]=get_file_type(fullfile(FilePath,dirpair(ifile_min).name));
+        %% update the file type if the input file does not exist (pb of 0001)
+        if isempty(FileType)
+            [FileType,tild,MovieObject]=get_file_type(fullfile(FilePath,dirpair(ifile_min).name));
+        end
     end
 end
Index: /trunk/src/mouse_down.m
===================================================================
--- /trunk/src/mouse_down.m	(revision 496)
+++ /trunk/src/mouse_down.m	(revision 497)
@@ -129,10 +129,12 @@
                 end
                 break
-            case 'uicontrol'  %if the mouse is over a uicontrol, duplicate the display  in an editable  zoom window
+            %if the mouse is over a uicontrol, duplicate the display  in an editable  zoom window
+            case 'uicontrol' 
                 if isequal(get(hObject,'SelectionType'),'alt')  && isequal(get(hchild,'Visible'),'on') && ~isequal(get(hchild,'tag'),'frame_object')&&...
                         ~isequal(get(hchild,'tag'),'ListObject') 
                     if ~strcmp(get(hchild,'Style'),'frame')%do not visualisaze frames
                         msg_pos(1:2)=GUI_pos(1:2)+obj_pos(1:2).*GUI_pos(3:4);
-                        output_str=msgbox_uvmat(['uicontrol: ' get(hchild,'Tag')],'',get(hchild,'String'),msg_pos);
+                        display_str=get(hchild,'TooltipString');
+                        output_str=msgbox_uvmat(['uicontrol: ' get(hchild,'Tag')],display_str,get(hchild,'String'),msg_pos);
                         break
                     end
@@ -152,5 +154,6 @@
                         if strcmp(htype,'uicontrol') && strcmp(get(hchild,'Visible'),'on')
                             msg_pos(1:2)=GUI_pos(1:2)+obj_pos(1:2).*GUI_pos(3:4);
-                            output_str=msgbox_uvmat(['uicontrol: ' get(hchild,'Tag')],'',get(hchild,'String'),msg_pos);
+                            display_str=get(hchild,'TooltipString');
+                            output_str=msgbox_uvmat(['uicontrol: ' get(hchild,'Tag')],display_str,get(hchild,'String'),msg_pos);
                             break
                         end
@@ -165,5 +168,7 @@
 if ~isempty(output_str)               
     set(hObject,'Units','pixels')
+    if strcmp(get(hchild,'enable'),'on')
     set(hchild,'String',output_str)
+    end
 end
     
Index: /trunk/src/msgbox_uvmat.m
===================================================================
--- /trunk/src/msgbox_uvmat.m	(revision 496)
+++ /trunk/src/msgbox_uvmat.m	(revision 497)
@@ -112,12 +112,12 @@
     if exist('Position','var')
     if iscell(default_answer)
-        widthstring=max(cellfun('length',default_answer));
+        widthstring=max(cellfun('length',default_answer),length(display_str));
         heightstring=size(default_answer,1);
         set(handles.edit_box,'Max',2);
     else
-        widthstring=length(default_answer);
+        widthstring=max(length(default_answer),length(display_str));
         heightstring=1;
     end
-    widthstring=max(widthstring,length(title));
+    widthstring=max(widthstring,length(title)+20);
     boxsize=[10*widthstring 20*heightstring];%size of the display edit box 
     set(handles.edit_box,'Units','pixels')
@@ -126,5 +126,5 @@
    set(handles.edit_box,'Position',[5,34,boxsize(1),boxsize(2)])
    FigPos(3)=10+boxsize(1);
-   FigPos(4)=36+boxsize(2);
+   FigPos(4)=56+boxsize(2);
    FigPos(2)=Position(2)-FigPos(4)-25;
    set(handles.figure1,'Position',FigPos)
Index: /trunk/src/read_GUI.m
===================================================================
--- /trunk/src/read_GUI.m	(revision 496)
+++ /trunk/src/read_GUI.m	(revision 497)
@@ -1,15 +1,16 @@
-% -----------------------------------------------------------------------
-% --- read a GUI with handle 'handle' producing a structure 'struct'
+% 'read_GUI':read a GUI and provide the data as a Matlab structure
+%----------------------------------------------------------------------
+% function struct=read_GUI(handle)
 %
-% The output Matlab structure 'struct' contains the information displayed on
-% the GUI or a panel with handle 'handle'
+% OUTPUT:
+% struct: matlab structure containing the information displayed in the GUI
 % The content of a panel with tag 'tag' is displayed as a substructure struct.(tag) (recursive use of read_GUI)
-% Output of an element with tag 'tag':
-%     'checkbox','radiobutton','togglebutton': struct.(tag)=value
-%     'edit': struct.(tag)=string,  
+% Output of a GUI element with tag 'tag':
+%     -case 'checkbox','radiobutton','togglebutton': struct.(tag)=value
+%     -case'edit': struct.(tag)=string,  
 %         or, if the tag is in the form by 'num_tag',
 %         struct.(tag)=str2double(string). If the result is empty the  'UserData' is taken as the default input.
-%     'listbox','popupmenu': struct.(tag)=selected string, or, if the tag is in the form by 'num_tag', struct.(tag)=str2double(string)
-%     'table': struct.(tag)=data of the table
+%     -case 'listbox','popupmenu': struct.(tag)=selected string, or, if the tag is in the form by 'num_tag', struct.(tag)=str2double(string)
+%     -case 'table': struct.(tag)=data of the table
 % 
 function struct=read_GUI(handle)
Index: /trunk/src/read_civdata.m
===================================================================
--- /trunk/src/read_civdata.m	(revision 496)
+++ /trunk/src/read_civdata.m	(revision 497)
@@ -176,6 +176,6 @@
             'Civ1_X','Civ1_Y','Civ1_Z','Civ1_U_smooth','Civ1_V_smooth','Civ1_W','Civ1_C','Civ1_F','Civ1_FF',...
             'Civ1_Coord_tps','Civ1_U_tps','Civ1_V_tps','Civ1_W_tps','Civ1_SubRange','Civ1_NbSites'};
-        role={'coord_x','coord_y','coord_z','vector_x','vector_y','vector_z','ancillary','warnflag','errorflag','coord_tps','vector_x',...
-            'vector_y','vector_z','ancillary','ancillary'};
+        role={'coord_x','coord_y','coord_z','vector_x','vector_y','vector_z','ancillary','warnflag','errorflag','coord_tps','vector_x_tps',...
+            'vector_y_tps','vector_z_tps','ancillary','ancillary'};
         units={'pixel','pixel','pixel','pixel','pixel','pixel','','','','pixel','pixel','pixel','pixel','pixel',''};
     case 'civ2'
@@ -188,6 +188,6 @@
             'Civ2_X','Civ2_Y','Civ2_Z','Civ2_U_smooth','Civ2_V_smooth','Civ2_W','Civ2_C','Civ2_F','Civ2_FF',...
             'Civ2_Coord_tps','Civ2_U_tps','Civ2_V_tps','','Civ2_SubRange','Civ2_NbSites'};
-        role={'coord_x','coord_y','coord_z','vector_x','vector_y','vector_z','ancillary','warnflag','errorflag','coord_tps','vector_x',...
-            'vector_y','vector_z','ancillary','ancillary'};
+        role={'coord_x','coord_y','coord_z','vector_x','vector_y','vector_z','ancillary','warnflag','errorflag','coord_tps','vector_x_tps',...
+            'vector_y_tps','vector_z_tps','ancillary','ancillary'};
         units={'pixel','pixel','pixel','pixel','pixel','pixel','','','','pixel','pixel','pixel','pixel','pixel',''};
 end
Index: /trunk/src/read_field.m
===================================================================
--- /trunk/src/read_field.m	(revision 496)
+++ /trunk/src/read_field.m	(revision 497)
@@ -1,4 +1,3 @@
-
-%'read_field': read input fields in different formats
+%'read_field': read the fields from files in different formats (netcdf files, images, video)
 %--------------------------------------------------------------------------
 %  function [Field,ParamOut,errormsg] = read_field(FileName,FileType,ParamIn,num)
@@ -16,11 +15,5 @@
 %INPUT
 % FileName: name of the input file
-% FileType: type of file
-%     = netcdf : netcdf file 
-%     = image : usual image as recognised by Matlab
-%     = multimage: image series stored in a single file
-%     = mmreader: movie read with mmreader
-%     = video: movie read with VideoReader (recent versions of Matlab)
-%     = vol: images representing scanned volume (images concatened in the y direction)
+% FileType: type of file, as determined by the function get_file_type.m
 % ParamIn: movie object or Matlab structure of input parameters
 %     .FieldName: name (char string) of the input field (for Civx data)
@@ -29,4 +22,6 @@
 %     .Npx, .Npy: nbre of pixels along x and y (used for .vol input files)
 % num: frame number for movies
+%
+% see also read_image.m,read_civxdata.m,read_civdata.m,
 
 function [Field,ParamOut,errormsg] = read_field(FileName,FileType,ParamIn,num)
Index: /trunk/src/read_image.m
===================================================================
--- /trunk/src/read_image.m	(revision 496)
+++ /trunk/src/read_image.m	(revision 497)
@@ -1,7 +1,25 @@
-%--read images or video objects
-function [A,ParamOut]=read_image(FileName,FileType,VideoObject,num)
-%------------------------------------------------------------------------
-%num is the view number needed for an avi movie
-ParamOut=VideoObject;%default
+%'read_image': read images or video objects
+%----------------------------------------------------------------------
+% function [A,ObjectOut]=read_image(FileName,FileType,VideoObject,num)
+%
+% OUTPUT:
+% A(npy,npx,rgb): matrix of integers (iunt8 or uint16) representing the image, with sizes npy, npx, and possibly color component rgb=1:3
+% ObjectOut: video object (=[] for images)
+%
+% INPUT:
+% FileName: input file name
+% FileType: input file type, as determined by the function get_file_type.m
+% VideoObject: video object (for faster reading if availlable)
+% num: frame index for movies or multimage types
+%
+function [A,ObjectOut]=read_image(FileName,FileType,VideoObject,num)
+%-----------------------------------------------------------------------
+if ~exist('VideoObject','var')
+    VideoObject=[];
+end
+if ~exist('num','var')
+    num=1;
+end
+ObjectOut=VideoObject;%default
 switch FileType
          case 'video'
@@ -9,6 +27,6 @@
                 A=read(VideoObject,num);
             else
-                ParamOut=VideoReader(FileName);
-                A=read(ParamOut,num);
+                ObjectOut=VideoReader(FileName);
+                A=read(ObjectOut,num);
             end
         case 'mmreader'
@@ -16,6 +34,6 @@
                 A=read(VideoObject,num);
             else
-                ParamOut=mmreader(FileName);
-                A=read(ParamOut,num);
+                ObjectOut=mmreader(FileName);
+                A=read(ObjectOut,num);
             end
     case 'multimage'
Index: /trunk/src/uvmat.m
===================================================================
--- /trunk/src/uvmat.m	(revision 496)
+++ /trunk/src/uvmat.m	(revision 497)
@@ -936,5 +936,5 @@
         if isfield(XmlData, 'GeometryCalib') && ~isempty(XmlData.GeometryCalib)
             if isfield(XmlData.GeometryCalib,'VolumeScan') && isequal(XmlData.GeometryCalib.VolumeScan,'y')
-                set (handles.nb_slice,'String','volume')
+                set (handles.num_NbSlice,'String','volume')
             end
             hgeometry_calib=findobj('tag','geometry_calib');
@@ -1016,7 +1016,7 @@
            end
            if isfield(GeometryCalib,'VolumeScan') && isequal(GeometryCalib.VolumeScan,'y')
-               set(handles.nb_slice,'String','volume')
+               set(handles.num_NbSlice,'String','volume')
            else
-               set(handles.nb_slice,'String',num2str(NbSlice))
+               set(handles.num_NbSlice,'String',num2str(NbSlice))
            end
            slices_Callback([],[], handles)
@@ -1229,10 +1229,10 @@
 if get(handles.slices,'Value')==1
     set(handles.slices,'BackgroundColor',[1 1 0])
-    set(handles.nb_slice,'Visible','on')
+    set(handles.num_NbSlice,'Visible','on')
     set(handles.z_text,'Visible','on')
     set(handles.z_index,'Visible','on')
-    nb_slice_Callback(hObject, eventdata, handles)
+    num_NbSlice_Callback(hObject, eventdata, handles)
 else
-    set(handles.nb_slice,'Visible','off')
+    set(handles.num_NbSlice,'Visible','off')
     set(handles.slices,'BackgroundColor',[0.7 0.7 0.7])
     set(handles.z_text,'Visible','off')
@@ -1243,7 +1243,7 @@
 
 %------------------------------------------------------------------------
-function nb_slice_Callback(hObject, eventdata, handles)
-%------------------------------------------------------------------------
-nb_slice_str=get(handles.nb_slice,'String');
+function num_NbSlice_Callback(hObject, eventdata, handles)
+%------------------------------------------------------------------------
+nb_slice_str=get(handles.num_NbSlice,'String');
 if isequal(nb_slice_str,'volume')
     num=stra2num(get(handles.j1,'String'));
@@ -1252,5 +1252,5 @@
 else
     num=str2double(get(handles.i1,'String'));
-    nbslice=str2double(get(handles.nb_slice,'String'));
+    nbslice=str2double(get(handles.num_NbSlice,'String'));
 end
 z=mod(num-1,nbslice)+1;
@@ -1326,6 +1326,6 @@
             mdetect=exist(maskname,'file');
             if mdetect
-                set(handles.nb_slice,'String',Name(i+1:ind_mask-1));
-                set(handles.nb_slice,'BackgroundColor',[1 1 0])
+                set(handles.num_NbSlice,'String',Name(i+1:ind_mask-1));
+                set(handles.num_NbSlice,'BackgroundColor',[1 1 0])
                 set(handles.CheckMask,'UserData',Mask);
                 set(handles.CheckMask,'BackgroundColor',[1 1 0])
@@ -1412,5 +1412,5 @@
         Mask.CoordUnit='pixel';
         if isequal(get(handles.slices,'Value'),1)
-           NbSlice=str2num(get(handles.nb_slice,'String'));
+           NbSlice=str2num(get(handles.num_NbSlice,'String'));
            num_i1=str2num(get(handles.i1,'String')); 
            Mask.ZIndex=mod(num_i1-1,NbSlice)+1;
@@ -1842,5 +1842,5 @@
 Field_b.AY=Field_a.AY;
 % z index
-nbslice=str2double(get(handles.nb_slice,'String'));
+nbslice=str2double(get(handles.num_NbSlice,'String'));
 if ~isempty(nbslice)
     Field_b.ZIndex=mod(num_i2-1,nbslice)+1;
@@ -1987,5 +1987,5 @@
 % NomType=get(handles.FileIndex,'UserData');
 %update the z position index
-nbslice_str=get(handles.nb_slice,'String');
+nbslice_str=get(handles.num_NbSlice,'String');
 if isequal(nbslice_str,'volume')%NOT USED
     z_index=num_j1;
@@ -2390,6 +2390,6 @@
         {'nb_tps','nb_coord','nb_subdomain'},{'nb_tps','nb_subdomain'},{'nb_tps','nb_subdomain'}}];
     Field{1}.VarAttribute{nbvar+3}.Role='coord_tps';
-    Field{1}.VarAttribute{nbvar+4}.Role='vector_x';
-    Field{1}.VarAttribute{nbvar+5}.Role='vector_y';
+    Field{1}.VarAttribute{nbvar+4}.Role='vector_x_tps';
+    Field{1}.VarAttribute{nbvar+5}.Role='vector_y_tps';
     if isfield(Field{1},'ListDimName')%cleaning 
         Field{1}=rmfield(Field{1},'ListDimName');
@@ -4880,2 +4880,3 @@
     web(helpfile);
 end
+
