Ignore:
Timestamp:
Feb 24, 2014, 10:51:40 PM (10 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/sub_background.m

    r700 r716  
    6767   
    6868    %% root input file(s) and type
    69     [filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param);
    70     if ~exist(filecell{1,1},'file')
    71         msgbox_uvmat('WARNING','the first input file does not exist')
    72         return
    73     end
    74    
     69    % check the existence of the first file in the series
     70        first_j=[];
     71    if isfield(Param.IndexRange,'first_j'); first_j=Param.IndexRange.first_j; end
     72    last_j=[];
     73    if isfield(Param.IndexRange,'last_j'); last_j=Param.IndexRange.last_j; end
     74    PairString='';
     75    if isfield(Param.IndexRange,'PairString'); PairString=Param.IndexRange.PairString; end
     76    [i1,i2,j1,j2] = get_file_index(Param.IndexRange.first_i,first_j,PairString);
     77    FirstFileName=fullfile_uvmat(Param.InputTable{1,1},Param.InputTable{1,2},Param.InputTable{1,3},...
     78        Param.InputTable{1,5},Param.InputTable{1,4},i1,i2,j1,j2);
     79    if ~exist(FirstFileName,'file')
     80        msgbox_uvmat('WARNING',['the first input file ' FirstFileName ' does not exist'])
     81    else
     82        [i1,i2,j1,j2] = get_file_index(Param.IndexRange.last_i,last_j,PairString);
     83        LastFileName=fullfile_uvmat(Param.InputTable{1,1},Param.InputTable{1,2},Param.InputTable{1,3},...
     84        Param.InputTable{1,5},Param.InputTable{1,4},i1,i2,j1,j2);
     85        if ~exist(FirstFileName,'file')
     86             msgbox_uvmat('WARNING',['the last input file ' LastFileName ' does not exist'])
     87        end
     88    end
     89
    7590    %% check the validity of  input file types
    7691    ImageTypeOptions={'image','multimage','mmreader','video'};%allowed input file types(images)
    77     FileType=get_file_type(filecell{1,1});
     92    FileType=get_file_type(FirstFileName);
    7893    CheckImage=~isempty(find(strcmp(FileType,ImageTypeOptions), 1));% =1 for images
    7994    if ~CheckImage
     
    88103    end
    89104    %nbview=numel(i1_series);%number of input file series (lines in InputTable)
    90     nbfield_j=size(i1_series{1},1); %nb of fields for the j index (bursts or volume slices)
     105    nbfield_j=size(i1_series{1},1); %nb of fields for the j index (bursts or volume slices)%A CORRIGER !!!!!!!
    91106    nbfield_i=size(i1_series{1},2); %nb of fields for the i index
    92107    nbfield=nbfield_j*nbfield_i; %total number of fields
Note: See TracChangeset for help on using the changeset viewer.