Ignore:
Timestamp:
Sep 29, 2017, 4:31:36 PM (7 years ago)
Author:
sommeria
Message:

series REFRESH improved

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/find_file_series.m

    r1009 r1011  
    5353
    5454%% check for particular file types: images, movies, civ data
    55 if isfield(FileInfo,'FileIndexing') && strcmp(FileInfo.FileIndexing,'on')
     55%if isfield(FileInfo,'FileIndexing') && strcmp(FileInfo.FileIndexing,'on')
    5656    [RootPath,SubDir,RootFile,i1_input,i2_input,j1_input,j2_input,FileExt,NomType]=fileparts_uvmat(fullfileinput);
    5757    %     if ~isempty(regexp(SubDir,'^level\d+$')) && exist([RootPath '.xml'],'file')
     
    6363    j2_series=zeros(1,1,1);
    6464    checkfileindexing=1;
    65 else % no file indexing
    66     [PathDir,RootFile]=fileparts(fullfileinput);
    67     [RootPath,SubDir,DirExt]=fileparts(PathDir);
    68     SubDir=[SubDir DirExt];% include part after . in the name (considered as a file extension)
    69     NomType='*';
    70     i1_series=[];i2_series=[];j1_series=[];j2_series=[];
    71     i1_input=1;i2_input=[];j1_input=[];j2_input=[];
    72     if exist(fullfileinput,'file')~=2
    73         RootFile='';
    74         return
    75     end
    76     checkfileindexing=0;
    77 end
     65%else % no file indexing
     66%     [PathDir,RootFile]=fileparts(fullfileinput);
     67%     [RootPath,SubDir,DirExt]=fileparts(PathDir);
     68%     SubDir=[SubDir DirExt];% include part after . in the name (considered as a file extension)
     69%     NomType='*';
     70%     i1_series=[];i2_series=[];j1_series=[];j2_series=[];
     71%     i1_input=1;i2_input=[];j1_input=[];j2_input=[];
     72%     if exist(fullfileinput,'file')~=2
     73%         RootFile='';
     74%         return
     75%     end
     76%     checkfileindexing=0;
     77%end
    7878if ~exist(FilePath,'dir')
    7979    return % don't go further if the dir path does not exist
     
    173173            end
    174174        end
    175         %         if strcmp(NomType,'level')
    176         %             star_string=[RootFile '*' FileExt];
    177         %             detect_string=['^' RootFile '(?<i1>\d+)' FileExt '$'];%string used in regexp to detect file indices
    178         %             wd=pwd;%current working directory
    179         %             cd (FilePath)% move to the local dir to save time in the operation dir.
    180         %             dirpair=dir(star_string);% look for relevant files in the file directory
    181         %             cd(wd)% back to the working directory
    182         %             nbpair=numel(dirpair);
    183         %             i1_series=zeros(1,nbpair);
    184         %             if nbpair==0% no detected file
    185         %                 RootFile='';
    186         %             end
    187         %             % scan the list of relevant files, extract the indices
    188         %             for ifile=1:nbpair
    189         %                 rr=regexp(dirpair(ifile).name,detect_string,'names');
    190         %                 if ~isempty(rr)
    191         %                     i1_series(ifile)=str2num(rr.i1);
    192         %                 end
    193         %             end
    194         %             % look for the list of subfolders level#
    195         %             cd (RootPath)% move to the local dir to save time in the operation dir.
    196         %             dirpair=dir('level*');% look for relevant subfolders named with leve#
    197         %             cd(wd)
    198         %             [RootPath,SubDir]=fileparts(RootPath);
    199         %             nbpair=numel(dirpair);
    200         %             jfile=0;
    201         %             for ifile=1:nbpair
    202         %                 rr=regexp(dirpair(ifile).name,'^level(?<i1>\d+)$','names');
    203         %                 if ~isempty(rr)
    204         %                     jfile=jfile+1;
    205         %                     j1_series(jfile)=str2num(rr.i1);
    206         %                 end
    207         %             end
    208         %             [j1_series,i1_series]=meshgrid(j1_series,i1_series);
    209         %         else
     175 
    210176        detect_string=['^' RootFile sep1 i1_str i2_str sep2 j1_str j2_str FileExt '$'];%string used in regexp to detect file indices
    211177        %find the string used to extract the relevant files with the command dir
Note: See TracChangeset for help on using the changeset viewer.