Changeset 472 for trunk/src/series.m


Ignore:
Timestamp:
Jun 25, 2012, 12:12:24 AM (9 years ago)
Author:
sommeria
Message:

many bugs repaired. series set to work in mode background

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series.m

    r471 r472  
    8181          for ifile=1:min(length(h.MenuFile),5)
    8282              eval(['set(handles.MenuFile_' num2str(ifile) ',''Label'',h.MenuFile{ifile});'])
    83 %               eval(['set(handles.MenuFile_' num2str(ifile) '_1,''Label'',h.MenuFile{ifile});'])
    8483          end
    8584     end
    86 %      if isfield(h,'MenuFile')
    87 %           for ifile=1:min(length(h.MenuFile),5)
    88 %               eval(['set(handles.MenuFile_' num2str(ifile) ',''Label'',h.MenuFile{ifile});'])
    89 %                eval(['set(handles.MenuFile_' num2str(ifile) '_1,''Label'',h.MenuFile{ifile});'])
    90 %           end
    91 %       end
    92      
    9385     test_profil_perso=1;
    94 %      if isfield(h,'MenuFile_1') && exist(h.MenuFile_1,'file')
    95 %           set(handles.MenuFile_1,'Label',h.MenuFile_1);
    96 %           set(handles.MenuFile_insert_1,'Label',h.MenuFile_1);
    97 %      end
    98 %      if isfield(h,'MenuFile_2')&& exist(h.MenuFile_2,'file')
    99 %           set(handles.MenuFile_2,'Label',h.MenuFile_2);
    100 %           set(handles.MenuFile_insert_2,'Label',h.MenuFile_2);
    101 %      end
    102 %      if isfield(h,'MenuFile_3')&& exist(h.MenuFile_3,'file')
    103 %           set(handles.MenuFile_3,'Label',h.MenuFile_3);
    104 %           set(handles.MenuFile_insert_3,'Label',h.MenuFile_3);
    105 %      end
    106 %      if isfield(h,'MenuFile_4')&& exist(h.MenuFile_4,'file')
    107 %           set(handles.MenuFile_4,'Label',h.MenuFile_4);
    108 %           set(handles.MenuFile_insert_4,'Label',h.MenuFile_4);
    109 %      end
    110 %      if isfield(h,'MenuFile_5')&& exist(h.MenuFile_5,'file')
    111 %           set(handles.MenuFile_5,'Label',h.MenuFile_5);
    112 %           set(handles.MenuFile_insert_5,'Label',h.MenuFile_5);
    113 %      end
    11486end
    11587
     
    135107        display_file_name(handles,param.FileName,0)
    136108    end
     109    InputTable={'','','','',''};
     110    set(handles.InputTable,'Data',InputTable)
    137111end 
    138112
     
    141115    set(handles.FieldName,'String',param.list_fields);% list menu fields
    142116    set(handles.FieldName,'Value',param.index_fields);% selected string index
    143     FieldCell{1}=param.list_fields{param.index_fields};
     117%     FieldCell{1}=param.list_fields{param.index_fields};
    144118end
    145119
     
    209183set(handles.TransformName,'UserData',fct_handle)% store the list of path in UserData of ACTION
    210184
     185%% Adjust the GUI according to the binaries available in PARAM.xml
     186path_uvmat=fileparts(which('uvmat')); %path to civ
     187addpath (path_uvmat) ; %add the path to civ, (useful in case of change of working directory after civ has been s opened in the working directory)
     188errormsg=[];%default error message
     189xmlfile='PARAM.xml';
     190if exist(xmlfile,'file')
     191    try
     192        t=xmltree(xmlfile);
     193        sparam=convert(t);
     194    catch ME
     195        errormsg={' Unable to read the file PARAM.xml defining the civx binaries:';ME.message};
     196    end
     197else
     198    errormsg=[xmlfile ' not found: path to civx binaries undefined'];
     199end
     200if ~isempty(errormsg)
     201    msgbox_uvmat('WARNING',errormsg);
     202end
     203test_batch=0;%default: ,no batch mode available
     204if isfield(sparam,'BatchParam') && isfield(sparam.BatchParam,'BatchMode')
     205    test_batch=strcmp(sparam.BatchParam.BatchMode,'sge'); %sge is currently the only implemented batch mod
     206end
     207RUNVal=get(handles.RunMode,'Value');
     208if test_batch==0
     209   if RUNVal>2
     210       set(handles.RunMode,'Value',1)
     211   end
     212   set(handles.RunMode,'String',{'local';'background'})
     213else
     214    set(handles.RunMode,'String',{'local';'background';'cluster'})
     215end
     216% if isfield(sparam.RunParam,'CivBin')
     217%     if ~exist(sparam.RunParam.CivBin,'file')
     218%         sparam.RunParam.CivBin=fullfile(path_uvmat,sparam.RunParam.CivBin);
     219%     end
     220% else
     221%     sparam.RunParam.CivBin='';
     222% end
    211223% display the GUI for the default actionname 'check_data_files'
    212 ActionName_Callback(hObject, eventdata, handles)
     224% ActionName_Callback(hObject, eventdata, handles)
    213225
    214226%------------------------------------------------------------------------
     
    235247%------------------------------------------------------------------------   
    236248InputTable=get(handles.InputTable,'Data');
    237 RootPathCell=InputTable(:,1);
    238 SubDirCell=InputTable(:,2);
    239 RootFileCell=InputTable(:,3);
     249if isempty(InputTable)
     250    RootPathCell={};
     251else
     252    RootPathCell=InputTable(:,1);
     253end
    240254oldfile=''; %default
    241255if isempty(RootPathCell)||isequal(RootPathCell,{''})%loads the previously stored file name and set it as default in the file_input box
     
    251265         end
    252266     end
    253  else
     267else
     268     SubDirCell=InputTable(:,2);
     269    RootFileCell=InputTable(:,3);
    254270     oldfile=fullfile(RootPathCell{1},SubDirCell{1},RootFileCell{1});
    255271 end
     
    265281        'Pick a file',oldfile);
    266282fileinput=[PathName FileName];%complete file name
    267 sizf=size(fileinput);
    268 if (~ischar(fileinput)|~isequal(sizf(1),1)),return;end
     283if isempty(fileinput),return;end %abandon if no file is introduced by the browser
    269284[path,name,ext]=fileparts(fileinput);
    270 SeriesData=[];%dfault
    271285if isequal(ext,'.xml')
    272      Param=xml2struct(fileinput);
    273     fill_GUI(Param,handles);%fill the GUI with the parameters retrieved from the xml file
    274     if isfield(Param,'CheckObject')&& Param.CheckObject
    275         set_object(Param.ProjObject)
    276     end
    277     return
     286    [Param,Heading]=xml2struct(fileinput);
     287    if ~strcmp(Heading,'Series')
     288        msg_box_uvmat('ERROR','xml file heading is not <Series>')
     289    else
     290        fill_GUI(Param,handles);%fill the GUI with the parameters retrieved from the xml file
     291        if isfield(Param,'CheckObject')&& Param.CheckObject
     292            set_object(Param.ProjObject)
     293        end
     294        set(handles.REFRESH,'UserData',[1:size(Param.InputTable,1)])
     295        REFRESH_Callback([],[], handles)
     296        return
     297    end
    278298elseif isequal(ext,'.xls')
    279299    msg_box_uvmat('ERROR','input file type not implemented')%A Faire: ouvrir le fichier pour naviguer
    280300else
    281301    display_file_name(handles,fileinput,0)
    282      %update list of recent files in the menubar
    283 %     MenuFile_1=fileinput;
    284 %     MenuFile_2=get(handles.MenuFile_1,'Label');
    285 %     MenuFile_3=get(handles.MenuFile_2,'Label');
    286 %     MenuFile_4=get(handles.MenuFile_3,'Label');
    287 %     MenuFile_5=get(handles.MenuFile_4,'Label');
    288 %     set(handles.MenuFile_1,'Label',MenuFile_1)
    289 %     set(handles.MenuFile_2,'Label',MenuFile_2)
    290 %     set(handles.MenuFile_3,'Label',MenuFile_3)
    291 %     set(handles.MenuFile_4,'Label',MenuFile_4)
    292 %     set(handles.MenuFile_5,'Label',MenuFile_5)
    293 %     set(handles.MenuFile_insert_1,'Label',MenuFile_1)
    294 %     set(handles.MenuFile_insert_2,'Label',MenuFile_2)
    295 %     set(handles.MenuFile_insert_3,'Label',MenuFile_3)
    296 %     set(handles.MenuFile_insert_4,'Label',MenuFile_4)
    297 %     set(handles.MenuFile_insert_5,'Label',MenuFile_5)
    298 %     dir_perso=prefdir;
    299 %     profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
    300 %     if exist(profil_perso,'file')
    301 %         save (profil_perso,'MenuFile_1','MenuFile_2','MenuFile_3','MenuFile_4', 'MenuFile_5','-append'); %store the file names for future opening of uvmat
    302 %     else
    303 %     txt=ver('MATLAB');
    304 %     Release=txt.Release;
    305 %         relnumb=str2num(Release(3:4));
    306 %         if relnumb >= 14
    307 %             save (profil_perso,'MenuFile_1','MenuFile_2','MenuFile_3','MenuFile_4', 'MenuFile_5','-V6'); %store the file names for future opening of uvmat
    308 %         else
    309 %             save (profil_perso,'MenuFile_1','MenuFile_2','MenuFile_3','MenuFile_4', 'MenuFile_5'); %store the file names for future opening of uvmat
    310 %         end
    311 %     end
    312302end
    313303
     
    377367    msgbox_uvmat('ERROR','input file type not implemented')%A Faire: ouvrir le fichier pour naviguer
    378368else
    379     display_file_name(handles,fileinput,1)
     369    display_file_name(handles,fileinput,'append')
    380370end
    381371
     
    384374% --------------------------------------------------------------------   
    385375fileinput=get(handles.MenuFile_insert_1,'Label');
    386 display_file_name(handles,fileinput,1)
     376display_file_name(handles,fileinput,'append')
    387377
    388378% --------------------------------------------------------------------
     
    390380% --------------------------------------------------------------------   
    391381fileinput=get(handles.MenuFile_insert_2,'Label');
    392 display_file_name(handles,fileinput,1)
     382display_file_name(handles,fileinput,'append')
    393383
    394384% --------------------------------------------------------------------
     
    396386% --------------------------------------------------------------------   
    397387fileinput=get(handles.MenuFile_insert_3,'Label');
    398 display_file_name( handles,fileinput,1)
     388display_file_name( handles,fileinput,'append')
    399389
    400390% --------------------------------------------------------------------
     
    402392% --------------------------------------------------------------------   
    403393fileinput=get(handles.MenuFile_insert_4,'Label');
    404 display_file_name( handles,fileinput,1)
     394display_file_name( handles,fileinput,'append')
    405395
    406396% --------------------------------------------------------------------
     
    408398% --------------------------------------------------------------------   
    409399fileinput=get(handles.MenuFile_insert_5,'Label');
    410 display_file_name(handles,fileinput,1)
     400display_file_name(handles,fileinput,'append')
    411401
    412402%------------------------------------------------------------------------
     
    414404function InputTable_CellEditCallback(hObject, eventdata, handles)
    415405%------------------------------------------------------------------------
     406set(handles.REFRESH,'Visible','on')
    416407iview=eventdata.Indices(1);
     408view_set=get(handles.REFRESH,'UserData');
     409if isempty(find(view_set==iview))
     410    set(handles.REFRESH,'UserData',[view_set iview])
     411end
     412%% enable other menus and uicontrols
     413set(handles.MenuOpen_insert,'Enable','on')
     414set(handles.MenuFile_insert_1,'Enable','on')
     415set(handles.MenuFile_insert_2,'Enable','on')
     416set(handles.MenuFile_insert_3,'Enable','on')
     417set(handles.MenuFile_insert_4,'Enable','on')
     418set(handles.MenuFile_insert_5,'Enable','on')
     419set(handles.RUN, 'Enable','On')
     420set(handles.RUN,'BackgroundColor',[1 0 0])% set RUN button to red
     421
     422%update the output dir
     423% SubDir=sort(InputTable(:,2)); %set of subdirectories sorted in alphabetical order
     424% SubDirOut=SubDir{1};
     425% if numel(SubDir)>1
     426%     for ilist=2:numel(SubDir)
     427%         SubDirOut=[SubDirOut '-' SubDir{ilist}];
     428%     end
     429% end
     430% set(handles.OutputSubDir,'String',SubDirOut)
     431
     432%------------------------------------------------------------------------
     433% --- Executes on button press in REFRESH.
     434function REFRESH_Callback(hObject, eventdata, handles)
     435%------------------------------------------------------------------------
    417436InputTable=get(handles.InputTable,'Data');
    418 fileinput=fullfile(InputTable{iview,1},InputTable{iview,2},[InputTable{iview,3} InputTable{iview,4} InputTable{iview,5}]);
    419 display_file_name(handles,fileinput,0)
    420 %update the output dir
    421 SubDir=sort(InputTable(:,2)); %set of subdirectories sorted in alphabetical order
    422 SubDirOut=SubDir{1};
    423 if numel(SubDir)>1
    424     for ilist=2:numel(SubDir)
    425         SubDirOut=[SubDirOut '-' SubDir{ilist}];
    426     end
    427 end
    428 set(handles.OutputSubDir,'String',SubDirOut)
    429 
    430 %------------------------------------------------------------------------
    431 % ---  refresh the GUI data after introduction of a new file
     437view_set=get(handles.REFRESH,'UserData');
     438set(handles.REFRESH,'BackgroundColor',[0.7 0.7 0.7])% set REFRESH  button to grey color
     439drawnow
     440for iview=view_set
     441    RootPath=fullfile(InputTable{iview,1},InputTable{iview,2});
     442    if ~exist(RootPath,'dir')
     443        i1_series=[];
     444        RootPath=fileparts(RootPath); %will try the upped forldr
     445    else
     446        [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,tild,FileType,MovieObject]=...
     447            find_file_series(fullfile(InputTable{iview,1},InputTable{iview,2}),[InputTable{iview,3} InputTable{iview,4} InputTable{iview,5}]);
     448    end
     449    if isempty(i1_series)
     450        [FileName, PathName, filterindex] = uigetfile( ...
     451            {'*.xml;*.xls;*.png;*.tif;*.avi;*.AVI;*.nc', ' (*.xml,*.xls, *.png,*.tif, *.avi,*.nc)';
     452            '*.xml',  '.xml files '; ...
     453            '*.xls',  '.xls files '; ...
     454            '*.png','.png image files'; ...
     455            '*.tif','.tif image files'; ...
     456            '*.avi;*.AVI','.avi movie files'; ...
     457            '*.nc','.netcdf files'; ...
     458            '*.*',  'All Files (*.*)'}, ...
     459            ['unvalid entry at line ' num2str(iview) ', pick a file'],RootPath);
     460        fileinput=[PathName FileName];%complete file name
     461        if isempty(fileinput),return;end %abandon if the operation has been cancelled: no input from browser
     462        [path,name,ext]=fileparts(fileinput);
     463        display_file_name(handles,fileinput,iview)
     464    else
     465        update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,MovieObject,iview)
     466    end
     467end
     468set(handles.REFRESH,'BackgroundColor',[1 0 0])% set REFRESH  button to grey color
     469set(handles.REFRESH,'Visible','off')
     470set(handles.REFRESH,'UserData',[])
     471
     472%------------------------------------------------------------------------
     473% --- Function called when a new file is opened, either by series_OpeningFcn or by the browser
     474function display_file_name(handles,fileinput,iview)
     475%------------------------------------------------------------------------ 
     476%
    432477% INPUT:
    433 % handles: handles of the elements in the GUI series
    434 % fileinput: name of the input file
    435 % append: =0 to refresh the list of file series, =1 to append a new series to the list (from the menu bar option 'Open_insert')
    436 function display_file_name(handles,fileinput,append)
    437 %------------------------------------------------------------------------ 
     478% handles: handles of elements in the GUI
     479% fielinput: input file name, including path
     480% append =0 (refresh the Input table with the new file), ='append' append a new line in the table
    438481
    439482%% get the input root name, indices, file extension and nomenclature NomType
     
    467510%% fill the list of file series
    468511InputTable=get(handles.InputTable,'Data');
    469 if append % display the input data as a new line in the table
    470      lastview=size(InputTable,1)+1;
    471      InputTable(lastview,:)=[{RootPath},{SubDir},{RootFile},{NomType},{FileExt}];
    472     set(handles.ListView,'String',[get(handles.ListView,'String');{num2str(lastview)}])
    473     set(handles.ListView,'Value',lastview)
    474 
    475 else % or re-initialise the list of  input  file series
    476     lastview=1;
    477     InputTable=[{RootPath},{SubDir},{RootFile},{NomType},{FileExt}];
     512if strcmp(iview,'append') % display the input data as a new line in the table
     513     iview=size(InputTable,1);
     514     InputTable(iview+1,:)={'','','','',''};
     515     InputTable(iview,:)=[{RootPath},{SubDir},{RootFile},{NomType},{FileExt}];
     516elseif iview==0 % or re-initialise the list of  input  file series
     517    iview=1;
     518    InputTable=[{'','','','',''};{'','','','',''}];
     519     InputTable(iview,:)=[{RootPath},{SubDir},{RootFile},{NomType},{FileExt}];
    478520    set(handles.TimeTable,'Data',[{[]},{[]},{[]},{[]}])
    479521    set(handles.MinIndex,'Data',[{[]},{[]}])
     
    482524    set(handles.ListView,'String',{'1'})
    483525end
     526nbview=size(InputTable,1);
     527set(handles.ListView,'String',mat2cell((1:nbview)',ones(nbview,1)))
     528set(handles.ListView,'Value',iview)
    484529set(handles.InputTable,'Data',InputTable)
     530
     531%% determine the selected reference field indices for pair display
     532ref_i=1; %default ref_i is a reference frame index used to find existing pairs from PIV
     533if ~isempty(i1)
     534    ref_i=i1;
     535    if ~isempty(i2)
     536        ref_i=floor((ref_i+i2)/2);% reference image number corresponding to the file
     537    end
     538end
     539set(handles.num_ref_i,'String',num2str(ref_i));
     540ref_j=1; %default  ref_j is a reference frame index used to find existing pairs from PIV
     541if ~isempty(j1)
     542    ref_j=j1;
     543    if ~isempty(j2)
     544        ref_j=floor((j1+j2)/2);
     545    end         
     546end
     547set(handles.num_ref_j,'String',num2str(ref_j));
     548
     549%% update the list of recent files in the menubar and save it for future opening
     550MenuFile=[{get(handles.MenuFile_1,'Label')};{get(handles.MenuFile_2,'Label')};...
     551    {get(handles.MenuFile_3,'Label')};{get(handles.MenuFile_4,'Label')};{get(handles.MenuFile_5,'Label')}];
     552str_find=strcmp(fileinput,MenuFile);
     553if isempty(find(str_find,1))
     554    MenuFile=[{fileinput};MenuFile];%insert the current file if not already in the list
     555end
     556for ifile=1:min(length(MenuFile),5)
     557    eval(['set(handles.MenuFile_' num2str(ifile) ',''Label'',MenuFile{ifile});'])
     558    eval(['set(handles.MenuFile_insert_' num2str(ifile) ',''Label'',MenuFile{ifile});'])
     559end
     560dir_perso=prefdir;
     561profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
     562if exist(profil_perso,'file')
     563    save (profil_perso,'MenuFile','-append'); %store the file names for future opening of uvmat
     564else
     565    save (profil_perso,'MenuFile','-V6'); %store the file names for future opening of uvmat
     566end
     567
     568set(handles.InputTable,'BackgroundColor',[1 1 1])
     569
     570%% initiate input file series and refresh the current field view:     
     571update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,MovieObject,iview);
     572
     573%------------------------------------------------------------------------
     574% --- Update information about a new field series (indices to scan, timing,
     575%     calibration from an xml file
     576function update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,VideoObject,iview)
     577%------------------------------------------------------------------------
     578%% update the output dir
     579InputTable=get(handles.InputTable,'Data');
     580SubDir=sort(InputTable(1:end-1,2)); %set of subdirectories sorted in alphabetical order
     581SubDirOut=SubDir{1};
     582if numel(SubDir)>1
     583    for ilist=2:numel(SubDir)
     584        SubDirOut=[SubDirOut '-' SubDir{ilist}];
     585    end
     586end
     587set(handles.OutputSubDir,'String',SubDirOut)
    485588
    486589%% display the min and max indices for all the file series
    487590i_sum=sum(sum(i1_series,2),3);%sum of i1_series on the last index
    488 MaxIndex_i=max(find(i_sum>0))-1;
    489 MinIndex_i=min(find(i_sum>0))-1;
     591MaxIndex_i=max(find(i_sum>0))-1;% max ref index i
     592MinIndex_i=min(find(i_sum>0))-1;% min ref index i
    490593i2_min=[];
    491594if ~isempty(i2_series)
     
    500603    j2_min=j2_series(1,2);
    501604end
    502 if isequal(MinIndex_i,1) && exist (fullfile_uvmat(RootPath,SubDir,RootFile,FileExt,NomType,0,i2_min, j1_min,j2_min),'file')
     605if isequal(MinIndex_i,1) &&...
     606        exist (fullfile_uvmat(InputTable{iview,1},InputTable{iview,2},InputTable{iview,3},InputTable{iview,5},InputTable{iview,4},0,i2_min, j1_min,j2_min),'file')
    503607    MinIndex_i=0;
    504608end
     
    508612MinIndex=get(handles.MinIndex,'Data');%retrieve the min indices in the table MinIndex
    509613MaxIndex=get(handles.MaxIndex,'Data');%retrieve the max indices in the table MaxIndex
    510 MinIndex{lastview,1}=MinIndex_i;
    511 MinIndex{lastview,2}=MinIndex_j;
    512 MaxIndex{lastview,1}=MaxIndex_i;
    513 MaxIndex{lastview,2}=MaxIndex_j;
     614MinIndex{iview,1}=MinIndex_i;
     615MinIndex{iview,2}=MinIndex_j;
     616MaxIndex{iview,1}=MaxIndex_i;
     617MaxIndex{iview,2}=MaxIndex_j;
    514618
    515619set(handles.MinIndex,'Data',MinIndex)%display the min indices in the table MinIndex
     
    547651set(handles.num_last_i,'String',num2str(last_i));
    548652set(handles.num_last_j,'String',num2str(last_j));
    549 
    550 
    551 %% update the output dir
    552 SubDir=sort(InputTable(:,2)); %set of subdirectories sorted in alphabetical order
    553 SubDirOut=SubDir{1};
    554 if numel(SubDir)>1
    555     for ilist=2:numel(SubDir)
    556         SubDirOut=[SubDirOut '-' SubDir{ilist}];
    557     end
    558 end
    559 set(handles.OutputSubDir,'String',SubDirOut)
    560 
    561 %% determine the selected reference field indices for pair display
    562 ref_i=1; %default ref_i is a reference frame index used to find existing pairs from PIV
    563 if ~isempty(i1)
    564     ref_i=i1;
    565     if ~isempty(i2)
    566         ref_i=floor((ref_i+i2)/2);% reference image number corresponding to the file
    567     end
    568 end
    569 set(handles.num_ref_i,'String',num2str(ref_i));
    570 ref_j=1; %default  ref_j is a reference frame index used to find existing pairs from PIV
    571 if ~isempty(j1)
    572     ref_j=j1;
    573     if ~isempty(j2)
    574         ref_j=floor((j1+j2)/2);
    575     end         
    576 end
    577 set(handles.num_ref_j,'String',num2str(ref_j));
    578 
    579 %% update the list of recent files in the menubar and save it for future opening
    580 MenuFile=[{get(handles.MenuFile_1,'Label')};{get(handles.MenuFile_2,'Label')};...
    581     {get(handles.MenuFile_3,'Label')};{get(handles.MenuFile_4,'Label')};{get(handles.MenuFile_5,'Label')}];
    582 str_find=strcmp(fileinput,MenuFile);
    583 if isempty(find(str_find,1))
    584     MenuFile=[{fileinput};MenuFile];%insert the current file if not already in the list
    585 end
    586 for ifile=1:min(length(MenuFile),5)
    587     eval(['set(handles.MenuFile_' num2str(ifile) ',''Label'',MenuFile{ifile});'])
    588     eval(['set(handles.MenuFile_insert_' num2str(ifile) ',''Label'',MenuFile{ifile});'])
    589 end
    590 dir_perso=prefdir;
    591 profil_perso=fullfile(dir_perso,'uvmat_perso.mat');
    592 if exist(profil_perso,'file')
    593     save (profil_perso,'MenuFile','-append'); %store the file names for future opening of uvmat
    594 else
    595     save (profil_perso,'MenuFile','-V6'); %store the file names for future opening of uvmat
    596 end
    597 
    598 set(handles.InputTable,'BackgroundColor',[1 1 1])
    599 
    600 %% initiate input file series and refresh the current field view:     
    601 update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,MovieObject,lastview);
    602 
    603 %------------------------------------------------------------------------
    604 % --- Update information about a new field series (indices to scan, timing,
    605 %     calibration from an xml file, then refresh current plots
    606 function update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileType,VideoObject,iview)
    607 %------------------------------------------------------------------------
    608 
    609 %% enable j index visibility
    610 if isempty(j1_series)
    611     state='off';
    612 else
    613     state='on';
    614 end
    615 enable_j(handles,state)
    616653
    617654%% read timing and total frame number from the current file (movie files) !! may be overrid by xml file
     
    726763ListView=get(handles.ListView,'String');
    727764ListView{iview}=num2str(iview);
    728 set(handles.ListView,'String');
     765set(handles.ListView,'String',ListView);
    729766set(handles.ListView,'Value',iview)
    730767update_mode(handles,i1_series,i2_series,j1_series,j2_series,time)
     
    755792set(handles.waitbar_frame,'Units','normalized')
    756793
    757 %% enable field and veltype menus
     794
     795%% update the series info in 'UserData'
    758796SeriesData=get(handles.series,'UserData');
    759 SeriesData.FileType{iview}=FileType;
    760 check_civ=0;
    761 check_netcdf=0;
    762 for iview=1:length(SeriesData.FileType)
    763     switch SeriesData.FileType{iview}
    764         case {'civx','civdata'}
    765             check_civ=check_civ+1;
    766         case 'netcdf'
    767             check_netcdf=check_netcdf+1;
    768     end
    769 end
    770 if check_civ
    771     enable='on';
    772 else
    773     enable='off';
    774 end
    775 set(handles.VelType,'Visible',enable)
    776 set(handles.VelType_text,'Visible',enable)
    777 if check_civ>=2
    778     enable='on';
    779 else
    780     enable='off';
    781 end
    782 set(handles.VelType_1,'Visible',enable)
    783 set(handles.VelType_text_1,'Visible',enable)
    784 if check_civ || check_netcdf
    785     enable='on';
    786 else
    787     enable='off';
    788 end
    789 set(handles.FieldName,'Visible',enable)
    790 set(handles.Field_text,'Visible',enable)
    791 if check_civ+ check_netcdf>=2
    792     enable='on';
    793 else
    794     enable='off';
    795 end
    796 set(handles.FieldName_1,'Visible',enable)
    797 set(handles.Field_text_1,'Visible',enable)
    798 FieldString={''};
    799 if check_civ
    800     FieldString=[calc_field;{'get_field...'}];
    801 elseif check_netcdf
    802     FieldString={'get_field...'};
    803 end
    804 set(handles.FieldName,'String',FieldString)
    805 FieldString={''};
    806 if check_civ>=2
    807     FieldString=[calc_field;{'get_field...'}];
    808 elseif check_civ+check_netcdf>=2
    809     FieldString={'get_field...'};
    810 end
    811 set(handles.FieldName_1,'String',{'get_field...'})
    812 
    813 
    814 %% store the series info in 'UserData'
    815797SeriesData.i1_series{iview}=i1_series;
    816798SeriesData.i2_series{iview}=i2_series;
     
    820802SeriesData.Time{iview}=time;
    821803set(handles.series,'UserData',SeriesData)
     804
     805%% enable j index visibility
     806state='off';
     807check_jindex=~cellfun(@isempty,SeriesData.j1_series); %look for non empty j indices
     808if isempty(find(check_jindex))
     809    enable_j(handles,'off') % no j index needed
     810else
     811    enable_j(handles,'on')
     812end
     813
     814%% enable field and veltype menus, in accordance with the current action
     815ActionName_Callback([],[], handles)
    822816
    823817%% check for pair display
     
    902896% mode_Callback(hObject, eventdata, handles)
    903897%
    904 % set(handles.REFRESH_INDICES,'BackgroundColor',[0.7 0.7 0.7])
     898% set(handles.REFRESH,'BackgroundColor',[0.7 0.7 0.7])
    905899% InputTable=get(handles.InputTable,'Data');
    906 % check_lines=get(handles.REFRESH_INDICES,'UserData');
     900% check_lines=get(handles.REFRESH,'UserData');
    907901%
    908902% %% check the indices and FileTypes for each series (limited to the new ones to save time)
     
    11711165mode=mode_list{get(handles.mode,'Value')};
    11721166ref_i=str2num(get(handles.num_ref_i,'String'));
    1173 ref_j=str2num(get(handles.num_ref_j,'String'));
    11741167if isempty(ref_i)
    11751168    ref_i=1;
    11761169end
    1177 if isempty(ref_j)
     1170if strcmp(get(handles.num_ref_j,'Visible'),'on')
     1171    ref_j=str2num(get(handles.num_ref_j,'String'));
     1172    if isempty(ref_j)
     1173        ref_j=1;
     1174    end
     1175else
    11781176    ref_j=1;
    11791177end
     
    11981196            pair_string=['Di= ' num2str(-floor(ipair/2)) '|' num2str(ceil(ipair/2)) ];
    11991197            if ~isempty(time)
     1198                if ref_i<=floor(ipair/2)
     1199                    ref_i=floor(ipair/2)+1;% shift ref_i to get the first pair
     1200                end
    12001201                Dt=time(ref_i+ceil(ipair/2),ref_j)-time(ref_i-floor(ipair/2),ref_j);
    12011202                pair_string=[pair_string ', Dt=' num2str(Dt) ' ' dtunit];
     
    12191220            pair_string=['Dj= ' num2str(-floor(ipair/2)) '|' num2str(ceil(ipair/2)) ];
    12201221            if ~isempty(time)
     1222                if ref_j<=floor(ipair/2)
     1223                    ref_j=floor(ipair/2)+1;% shift ref_i to get the first pair
     1224                end
    12211225                Dt=time(ref_i,ref_j+ceil(ipair/2))-time(ref_i,ref_j-floor(ipair/2));
    12221226                pair_string=[pair_string ', Dt=' num2str(Dt) ' ' dtunit];
     
    12491253    end
    12501254end
     1255set(handles.num_ref_i,'String',num2str(ref_i)) % update ref_i and ref_j
     1256set(handles.num_ref_j,'String',num2str(ref_j))
    12511257
    12521258%% display list of pairstring
     
    12861292
    12871293%-----------------------------------
    1288 function view_FieldMenu(handles,state)
    1289 % set(handles.FieldName,'Visible',state)
    1290 % set(handles.Field_text,'Visible',state)
    1291 set(handles.InputFields,'Visible',state)
    1292 
    1293 %-----------------------------------
    1294 function view_FieldMenu_1(handles,state)
    1295 set(handles.FieldName_1,'Visible',state)
    1296 set(handles.Field_text_1,'Visible',state)
     1294% function view_FieldMenu(handles,state)
     1295% % set(handles.FieldName,'Visible',state)
     1296% % set(handles.Field_text,'Visible',state)
     1297% set(handles.InputFields,'Visible',state)
     1298
     1299% %-----------------------------------
     1300% function view_FieldMenu_1(handles,state)
     1301% set(handles.FieldName_1,'Visible',state)
     1302% set(handles.Field_text_1,'Visible',state)
    12971303
    12981304
     
    13121318if ~isempty(errormsg)
    13131319    msgbox_uvmat('ERROR',errormsg)
    1314 else
    1315   %Series.Specific=h_fun(Series);   
    1316    Series=h_fun(Series); 
    1317    if ~isempty(filexml)
    1318    t=struct2xml(Series);
    1319     t=set(t,1,'name','Series');
    1320     save(t,filexml);
    1321    end
    1322 %     h_fun(Series);
    1323 end
     1320    return
     1321end
     1322RunModeList=get(handles.RunMode,'String');
     1323RunMode=RunModeList{get(handles.RunMode,'Value')};
     1324
     1325switch RunMode
     1326    case 'local'
     1327        Series=h_fun(Series);
     1328        if ~isempty(filexml)
     1329            t=struct2xml(Series);
     1330            t=set(t,1,'name','Series');
     1331            save(t,filexml);
     1332        end
     1333    case 'background'
     1334        if isempty(filexml)
     1335            Series=h_fun(Series);% no background in the absence of output file
     1336        else
     1337        % update the xml file after interactive input with the function
     1338        Series.Specific='?';
     1339        Series=h_fun(Series);
     1340        t=struct2xml(Series);
     1341        t=set(t,1,'name','Series');
     1342        save(t,filexml);
     1343        path_uvmat=fileparts(which('uvmat'));
     1344       
     1345        filename_bat=regexprep(filexml,'.xml$','.bat');
     1346        [fid,message]=fopen(filename_bat,'w');
     1347        if isequal(fid,-1)
     1348            msgbox_uvmat('ERROR', ['creation of .bat file: ' message]);
     1349            return
     1350        end
     1351        path_fct=get(handles.ActionPath,'String');
     1352        filelog=regexprep(filexml,'.xml$','.log');
     1353        text_matlabscript=[...
     1354            '#!/bin/bash \n'...
     1355            '. /etc/sysprofile \n'...
     1356            'matlab -nodisplay -nosplash -nojvm -logfile ''' filelog ''' <<END_MATLAB \n'...
     1357            'addpath(''' path_uvmat '''); \n'...
     1358            'addpath(''' Series.Action.ActionPath '''); \n'...
     1359            '' Series.Action.ActionName  '( ''' filexml '''); \n'...
     1360            'exit \n'...
     1361            'END_MATLAB \n'];
     1362        fprintf(fid,text_matlabscript);
     1363        fclose(fid);
     1364        if isunix
     1365            system(['chmod +x ' filename_bat]);% set the file to executable
     1366            system(['. ' filename_bat ' &']);%execute fct
     1367        else
     1368            system(filename_bat);
     1369        end
     1370        end
     1371end
     1372
    13241373set(handles.RUN, 'Enable','On')
    13251374set(handles.RUN,'BackgroundColor',[1 0 0])
     
    13311380set(handles.RUN,'BackgroundColor',[1 0 0])
    13321381set(handles.RUN,'enable','on')
    1333 set(handles.BATCH,'BackgroundColor',[1 0 0])
    1334 set(handles.BATCH,'enable','on')
     1382% set(handles.BATCH,'BackgroundColor',[1 0 0])
     1383% set(handles.BATCH,'enable','on')
    13351384
    13361385%------------------------------------------------------------------------
     
    13381387function BATCH_Callback(hObject, eventdata, handles)
    13391388%------------------------------------------------------------------------   
    1340 set(handles.BATCH, 'Enable','Off')
    1341 set(handles.BATCH,'BackgroundColor',[0.831 0.816 0.784])
    1342 [h_fun,Series,filexml,errormsg]=prepare_jobs(handles);
    1343 if ~isempty(errormsg)
    1344     msgbox_uvmat('ERROR',errormsg)
    1345     return
    1346 end
    1347 % update the xml file after interactive input with the function
    1348 Series.Specific='?';
    1349 Series=h_fun(Series);   
    1350 t=struct2xml(Series);
    1351 t=set(t,1,'name','Series');
    1352 save(t,filexml);
    1353 path_series=fileparts(which('series'));
    1354 filename_xml=fullfile(Series.OutputDir,[Series.OutputRootFile '.xml']);
    1355 filename_bat=fullfile(Series.OutputDir,[Series.OutputRootFile '.bat']);
    1356 [fid,message]=fopen(filename_bat,'w');
    1357 if isequal(fid,-1)
    1358     msgbox_uvmat('ERROR', ['creation of .bat file: ' message]);
    1359     return
    1360 end
    1361 path_fct=get(handles.ActionPath,'String');
    1362 text_matlabscript=[...
    1363     '#!/bin/bash \n'...
    1364     '. /etc/sysprofile \n'...
    1365     'matlab -nodisplay -nosplash -nojvm <<END_MATLAB \n'...
    1366     'cd(''' path_series '''); \n'...
    1367     'addpath(''' path_fct '''); \n'...
    1368     '' Series.Action  '( ''' filename_xml '''); \n'...
    1369     'exit \n'...
    1370     'END_MATLAB \n'];
    1371 fprintf(fid,text_matlabscript);
    1372 fclose(fid);
    1373 if isunix
    1374     system(['chmod +x ' filename_bat]);% set the file to executable
    1375     system(['. ' filename_bat ' &']);%execute fct
    1376 else
    1377     system(filename_bat);
    1378 end
    1379 set(handles.BATCH, 'Enable','On')
    1380 set(handles.BATCH,'BackgroundColor',[1 0 0])
    1381 
    1382 %------------------------------------------------------------------------
    1383 % --- Executes on button press in BIN.
    1384 function BIN_Callback(hObject, eventdata, handles)
    1385 %------------------------------------------------------------------------
    1386     cmd=['#!/bin/bash \n '...
    1387         '#$ -cwd \n '...
    1388         'hostname && date \n '...
    1389         'umask 002 \n'...
    1390         Param.xml.CivmBin ' ' Param.xml.RunTime ' ' filename_xml ' ' OutputFile '.nc'];
    1391    
     1389
     1390
     1391% %------------------------------------------------------------------------
     1392% % --- Executes on button press in BIN.
     1393% function BIN_Callback(hObject, eventdata, handles)
     1394% %------------------------------------------------------------------------
     1395%     cmd=['#!/bin/bash \n '...
     1396%         '#$ -cwd \n '...
     1397%         'hostname && date \n '...
     1398%         'umask 002 \n'...
     1399%         Param.xml.CivmBin ' ' Param.xml.RunTime ' ' filename_xml ' ' OutputFile '.nc'];
     1400%     
    13921401%------------------------------------------------------------------------
    13931402% --- Main launch command, called by RUN and BATCH
    13941403function [h_fun,Series,filexml,errormsg]=prepare_jobs(handles,run)
     1404%INPUT:
     1405% handles: handles of graphic objects on the GUI series
     1406% run=0, just to display parameters for MenuExport/GUI config
     1407% run=1 (default) prepare the computation
     1408
    13951409%------------------------------------------------------------------------
    13961410h_fun=[];
     
    15121526    end
    15131527    Series.OutputDirExt=regexprep(SubDirOutNew,Series.OutputSubDir,'');
    1514     Series.OutputSubDir=SubDirOutNew;
    1515     Series.OutputDir=fullfile(Series.InputTable{1,1},Series.OutputSubDir);%directory set for output results
     1528 %   Series.OutputSubDir=SubDirOutNew;
     1529 %   Series.OutputDir=fullfile(Series.InputTable{1,1},Series.OutputSubDir);%directory set for output results
    15161530    Series.OutputRootFile=Series.InputTable{1,3};% the first sorted RootFile taken for output
    15171531    set(handles.OutputDirExt,'String',Series.OutputDirExt)
    1518     %removes redondant information
    1519     Series=rmfield(Series,'OutputDirExt');
    1520     Series.IndexRange=rmfield(Series.IndexRange,'TimeTable');
    1521     Series.IndexRange=rmfield(Series.IndexRange,'MinIndex');
    1522     Series.IndexRange=rmfield(Series.IndexRange,'MaxIndex');
    15231532    % create output directory
     1533    OutputDir=fullfile(Series.InputTable{1,1},[Series.OutputSubDir Series.OutputDirExt]);
    15241534    if check_create
    1525         [tild,msg1]=mkdir(Series.OutputDir);
     1535        [tild,msg1]=mkdir(OutputDir);
    15261536        if ~strcmp(msg1,'')
    1527             errormsg=['cannot create ' Series.OutputDir ': ' msg1];%error message for directory creation
     1537            errormsg=['cannot create ' OutputDir ': ' msg1];%error message for directory creation
    15281538            return
    15291539        end
    15301540    end
    1531     filexml=fullfile(Series.OutputDir,[Series.InputTable{1,3} '.xml']);% name of the parameter xml file set in this directory
    1532 %     t=struct2xml(Series);
    1533 %     t=set(t,1,'name','Series');
    1534 %     save(t,filexml);
    1535 end
     1541    filexml=fullfile(OutputDir,[Series.InputTable{1,3} '.xml']);% name of the parameter xml file set in this directory
     1542end
     1543%removes redondant information
     1544Series.IndexRange=rmfield(Series.IndexRange,'TimeTable');
     1545Series.IndexRange=rmfield(Series.IndexRange,'MinIndex');
     1546Series.IndexRange=rmfield(Series.IndexRange,'MaxIndex');
     1547%removes empty lines of InputTable
     1548empty_line=zeros(size(Series.InputTable,1),1);
     1549for iline=1:size(Series.InputTable,1)
     1550    empty_line(iline)=isequal(Series.InputTable(iline,1:3),{'','',''});
     1551end
     1552Series.InputTable(find(empty_line),:)=[];
    15361553
    15371554%------------------------------------------------------------------------
     
    16121629set(handles.VelType_1,'Visible','off');
    16131630set(handles.VelType_text_1,'Visible','off');
    1614 view_FieldMenu(handles,'off')
    1615 view_FieldMenu_1(handles,'off')
     1631set(handles.InputFields,'Visible','off')
     1632set(handles.FieldName_1,'Visible','off')
     1633%view_FieldMenu_1(handles,'off')
    16161634set(handles.FieldTransform,'Visible','off')
    16171635set(handles.CheckObject,'Visible','off');
     
    16191637set(handles.CheckMask,'Visible','off')
    16201638set(handles.Mask,'Visible','off')
    1621 % set(handles.OutputDirExt,'Visible','off');
    1622 % set(handles.ParamKey,'Visible','off')
    1623 % set(handles.ParamVal,'Visible','off')
    1624 ParamKey={};
    1625 set(handles.FieldName,'Enable','off')
    1626 set(handles.VelType,'Enable','off')
    1627 set(handles.FieldName_1,'Enable','off')
    1628 set(handles.VelType_1,'Enable','off')
    1629 set(handles.TransformName,'Enable','off')
    16301639set(handles.OutputDirExt,'Visible','off')
    16311640set(handles.OutputSubDir,'Visible','off')
     
    16491658
    16501659InputTable=get(handles.InputTable,'Data');
    1651 nb_series=size(InputTable,1);
    1652 testima_series=1; %test for a list of images only
    1653 testima=1;
    1654 testima_1=1;
    1655 testciv_series=1;
    1656 for iview=1:nb_series
    1657      ext=InputTable{iview,5};
    1658     if length(ext)<2
    1659         ext='.none';
    1660     end
    1661     testimaview=~isempty(imformats(ext(2:end))) || isequal(lower(ext),'.avi');
    1662     if ~testimaview
    1663         if iview==1
    1664             testima=0;
    1665         end
    1666         if iview==2
    1667             testima_1=0;
    1668         end
    1669         testima_series=0;
    1670     end
    1671 end
     1660nbview=size(InputTable,1);
     1661SeriesData=get(handles.series,'UserData');
     1662nb_civ=numel(find(strcmp('civx',SeriesData.FileType)|strcmp('civdata',SeriesData.FileType)));
     1663nb_netcdf=numel(find(strcmp('netcdf',SeriesData.FileType)));
    16721664for ilist=1:length(varargout)-1
    16731665    switch varargout{ilist}
    1674         case 'NbViewMax'
    1675             if ~isempty (varargout{ilist+1})
    1676                 if size(InputTable,1)>varargout{ilist+1}
    1677                 InputTable=InputTable(1:varargout{ilist+1},:);
    1678                 set(handles.InputTable,'Data',InputTable)
    1679                 end
    1680             end
    16811666        case 'AllowInputSort'
    16821667            if isequal(lower(varargout{ilist+1}),'on')% sort the input table by alphabetical order of the SubDir
    1683                 SeriesData=get(handles.series,'UserData');
    16841668                SeriesData.AllowInputSort=1;
    16851669                set(handles.series,'UserData',SeriesData)
    16861670            end                     
    16871671        case 'WholeIndexRange'
    1688             if isequal(lower(varargout{ilist+1}),'on')% sort the input table by alphabetical order of the SubDir
     1672            if isequal(lower(varargout{ilist+1}),'on')% set by default the input index range from min to max
    16891673                MinIndex=get(handles.MinIndex,'Data');
    16901674                MaxIndex=get(handles.MaxIndex,'Data');
     
    17071691        case 'VelType'   %hidden by default
    17081692             if isequal(lower(varargout{ilist+1}),'one') || isequal(lower(varargout{ilist+1}),'two')
    1709                 set(handles.VelType,'Enable','on')
    1710                 if nb_series >=1 && ~testima_series
     1693                if nb_civ>=1
    17111694                    set(handles.VelType,'Visible','on')
    17121695                    set(handles.VelType_text,'Visible','on');
     
    17141697             end
    17151698            if isequal(lower(varargout{ilist+1}),'two')
    1716                 set(handles.VelType_1,'Enable','on')
    1717                 if nb_series >=2 && ~testima_series
     1699                if nb_civ>=2
    17181700                    set(handles.VelType_1,'Visible','on')
    17191701                    set(handles.VelType_text_1,'Visible','on');
     
    17221704        case 'FieldName'   %hidden by default
    17231705            if isequal(lower(varargout{ilist+1}),'one')||isequal(lower(varargout{ilist+1}),'two')
    1724                 set(handles.FieldName,'Enable','on') % test for MenuBorser
    1725                 if nb_series >=1 && ~testima_series
    1726                     view_FieldMenu(handles,'on')
     1706                if (nb_civ+nb_netcdf)>=1
     1707                 set(handles.FieldName,'Visible','on') % test for MenuBorser
     1708                 set(handles.InputFields,'Visible','on')
    17271709                end
    17281710            end
    17291711            if isequal(lower(varargout{ilist+1}),'two')
    1730                 set(handles.FieldName_1,'Enable','on')
    1731                 if nb_series >=2 && ~testima_1
    1732                     view_FieldMenu_1(handles,'on')
     1712                if (nb_civ+nb_netcdf)>=1
     1713                set(handles.FieldName_1,'Visible','on')
    17331714                end
    17341715            end
     
    17471728                set(handles.Mask,'Visible','on')
    17481729                 set(handles.CheckMask,'Visible','on');
    1749             end
    1750         case 'PARAMETER'  % NOT USED
    1751             set(handles.PARAMETERS_frame,'Visible','on')
    1752             set(handles.PARAMETERS_title,'Visible','on')
    1753             set(handles.ParamKey,'Visible','on')
    1754             %set(handles.ParamVal,'Visible','on')
    1755             Param_str=varargout{ilist+1};
    1756             Param_list=[Param_list; {Param_str}];   
     1730            end 
    17571731        case 'OutputDirExt'
    17581732            if ~isempty(varargout{ilist+1})
     
    20231997
    20241998% %------------------------------------------------------------------------
    2025 % % --- Executes on button press in REFRESH_INDICES.
     1999% % --- Executes on button press in REFRESH.
    20262000%     function REFRESH_INDICES_Callback(hObject, eventdata, handles)
    20272001% %------------------------------------------------------------------------       
    2028 % % hObject    handle to REFRESH_INDICES (see GCBO)
     2002% % hObject    handle to REFRESH (see GCBO)
    20292003% % eventdata  reserved - to be defined in a future version of MATLAB
    20302004% % handles    structure with handles and user data (see GUIDATA)
    2031 % set(handles.REFRESH_INDICES,'BackgroundColor',[0.7 0.7 0.7])
     2005% set(handles.REFRESH,'BackgroundColor',[0.7 0.7 0.7])
    20322006% InputTable=get(handles.InputTable,'Data');
    2033 % check_lines=get(handles.REFRESH_INDICES,'UserData');
     2007% check_lines=get(handles.REFRESH,'UserData');
    20342008%
    20352009% %% check the indices and FileTypes for each series (limited to the new ones to save time)
     
    20862060% set(handles.PairString,'Visible',state_Pairs)
    20872061% enable_j(handles,state_j)
    2088 % set(handles.REFRESH_INDICES,'BackgroundColor',[1 0 0])
    2089 % set(handles.REFRESH_INDICES,'visible','off')
     2062% set(handles.REFRESH,'BackgroundColor',[1 0 0])
     2063% set(handles.REFRESH,'visible','off')
    20902064
    20912065% -----------------------------------------------------------------------
     
    21622136
    21632137%% enable field and veltype menus
    2164 testfield=isequal(get(handles.FieldName,'enable'),'on');
    2165 testfield_1=isequal(get(handles.FieldName_1,'enable'),'on');
    2166 testveltype=isequal(get(handles.VelType,'enable'),'on');
    2167 testveltype_1=isequal(get(handles.VelType_1,'enable'),'on');
    2168 testtransform=isequal(get(handles.TransformName,'Enable'),'on');
     2138% testfield=isequal(get(handles.FieldName,'enable'),'on');
     2139% testfield_1=isequal(get(handles.FieldName_1,'enable'),'on');
     2140% testveltype=isequal(get(handles.VelType,'enable'),'on');
     2141% testveltype_1=isequal(get(handles.VelType_1,'enable'),'on');
     2142% testtransform=isequal(get(handles.TransformName,'Enable'),'on');
    21692143% testnc=0;
    21702144% testnc_1=0;
     
    21972171switch FileType
    21982172    case {'civx','civdata'}
    2199     view_FieldMenu(handles,'on')
     2173    %view_FieldMenu(handles,'on')
    22002174    menustr=get(handles.FieldName,'String');
    22012175    if isequal(menustr,{'get_field...'})
     
    22202194    %     view_FieldMenu_1(handles,'off')
    22212195    case 'netcdf'
    2222     view_FieldMenu(handles,'on')
     2196  %  view_FieldMenu(handles,'on')
    22232197    set(handles.FieldName,'Value',1)
    22242198    set(handles.FieldName,'String',{'get_field...'})
     
    22262200    %     view_TRANSFORM(handles,'off')
    22272201    case {'image','multimage','video'}
    2228     view_FieldMenu(handles,'off')
    2229     view_FieldMenu_1(handles,'off')
     2202%    view_FieldMenu(handles,'off')
     2203 %   view_FieldMenu_1(handles,'off')
    22302204    set(handles.VelType,'Visible','off')
    22312205    set(handles.VelType_text,'Visible','off');
     
    23272301evalin('base','Series') %display CurData in the workspace
    23282302commandwindow; %brings the Matlab command window to the front
     2303
     2304
     2305% --- Executes on selection change in RunMode.
     2306function RunMode_Callback(hObject, eventdata, handles)
Note: See TracChangeset for help on using the changeset viewer.