Ignore:
Timestamp:
Mar 27, 2025, 5:59:21 PM (3 weeks ago)
Author:
sommeria
Message:

various bugs repaired,Relabeling frames installed for multitif

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/find_file_series.m

    r1164 r1180  
    6363j2_series=zeros(1,1,1);
    6464checkfileindexing=1;
    65 if isempty(regexp(FilePath,'^http://')) && ~exist(FilePath,'dir')
     65if isempty(regexp(FilePath,'^http://', 'once')) && ~exist(FilePath,'dir')
    6666    return % don't go further if the dir path does not exist
    6767end
     
    7070    if isempty(NomType)||strcmp(NomType,'*')
    7171        if exist(fullfileinput,'file')
    72             [tild,RootFile]=fileparts(fileinput);% case of constant name (no indexing), get the filename without its extension
     72            [~,RootFile]=fileparts(fileinput);% case of constant name (no indexing), get the filename without its extension
    7373        else
    7474            RootFile='';
     
    159159            %             rr=regexp(dirpair(ifile).name,detect_string,'names');
    160160            if ~isempty(rr{ifile})
    161                 i1=str2num(rr{ifile}.i1);
    162                 i2=str2num(regexprep(rr{ifile}.i2,'^-',''));
     161                i1=str2double(rr{ifile}.i1);
     162                i2=str2double(regexprep(rr{ifile}.i2,'^-',''));
    163163                j1=stra2num(regexprep(rr{ifile}.j1,'^_',''));
    164164                j2=stra2num(regexprep(rr{ifile}.j2,'^-',''));
    165165                ref_i=i1;
    166166                if isempty(i2_input)
    167                     if ~isempty(i2)% invalid file name if i2 does not exist in the input file
     167                    if ~isnan(i2)% invalid file name if i2 does not exist in the input file
    168168                        break
    169169                    end
     
    173173                ref_j=1;
    174174                if isempty(j1_input)
    175                     if  ~isempty(j1)% invalid file name if j1 does not exist in the input file
     175                    if  ~isnan(j1)% invalid file name if j1 does not exist in the input file
    176176                        break
    177177                    end
    178178                else %j1_input is not empty
    179                     if isempty(j1)% the detected name does not fit with the input
     179                    if isnan(j1)% the detected name does not fit with the input
    180180                        break
    181181                    else
    182182                        ref_j=j1;
    183183                        if isempty(j2_input)
    184                             if  ~isempty(j2)% invalid file name if j2 does not exist in the input file
     184                            if  ~isnan(j2)% invalid file name if j2 does not exist in the input file
    185185                                break
    186186                            end
     
    191191                end
    192192                % update the detected index series
    193                 if ~isempty(ref_i)&&~isempty(ref_j)
     193                if ~isnan(ref_i)&&~isnan(ref_j)
     194                    if ref_i*ref_j>100000
     195                        disp('warning: inapropriate file name indexing: too large indices for scanning')
     196                        ref_i_list(ifile)=i1_input;
     197                        if isempty(j1_input)
     198                            ref_j_list(ifile)=1;
     199                        else
     200                        ref_j_list(ifile)=j1_input;
     201                        end
     202                        break
     203                    end
    194204                    ref_i_list(ifile)=ref_i;
    195205                    ref_j_list(ifile)=ref_j;
Note: See TracChangeset for help on using the changeset viewer.