Ignore:
Timestamp:
Feb 24, 2014, 10:51:40 PM (11 years ago)
Author:
sommeria
Message:

fct improved by reducing the input file check when selected.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series/aver_stat.m

    r673 r716  
    4242
    4343%% set the input elements needed on the GUI series when the action is selected in the menu ActionName
    44 if isstruct(Param) && isequal(Param.Action.RUN,0)
     44if isstruct(Param) && isequal(Param.Action.RUN,0)% function activated from the GUI series but not RUN
    4545    ParamOut.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
    4646    ParamOut.WholeIndexRange='off';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
     
    5353    ParamOut.OutputDirExt='.stat';%set the output dir extension
    5454    ParamOut.OutputFileMode='NbSlice';% '=NbInput': 1 output file per input file index, '=NbInput_i': 1 file per input file index i, '=NbSlice': 1 file per slice
    55     filecell=get_file_series(Param);%check existence of the first input file
    56     if ~exist(filecell{1,1},'file')
    57         msgbox_uvmat('WARNING','the first input file does not exist')
     55    % check the existence of the first file in the series
     56    first_j=[];
     57    if isfield(Param.IndexRange,'first_j'); first_j=Param.IndexRange.first_j; end
     58    last_j=[];
     59    if isfield(Param.IndexRange,'last_j'); last_j=Param.IndexRange.last_j; end
     60    PairString='';
     61    if isfield(Param.IndexRange,'PairString'); PairString=Param.IndexRange.PairString; end
     62    [i1,i2,j1,j2] = get_file_index(Param.IndexRange.first_i,first_j,PairString);
     63    FirstFileName=fullfile_uvmat(Param.InputTable{1,1},Param.InputTable{1,2},Param.InputTable{1,3},...
     64        Param.InputTable{1,5},Param.InputTable{1,4},i1,i2,j1,j2);
     65    if ~exist(FirstFileName,'file')
     66        msgbox_uvmat('WARNING',['the first input file ' FirstFileName ' does not exist'])
     67    else
     68        [i1,i2,j1,j2] = get_file_index(Param.IndexRange.last_i,last_j,PairString);
     69        LastFileName=fullfile_uvmat(Param.InputTable{1,1},Param.InputTable{1,2},Param.InputTable{1,3},...
     70        Param.InputTable{1,5},Param.InputTable{1,4},i1,i2,j1,j2);
     71        if ~exist(FirstFileName,'file')
     72             msgbox_uvmat('WARNING',['the last input file ' LastFileName ' does not exist'])
     73        end
    5874    end
    5975    return
Note: See TracChangeset for help on using the changeset viewer.