Ignore:
Timestamp:
Jun 26, 2012, 11:50:19 PM (12 years ago)
Author:
sommeria
Message:

civ set to accept automatic input in the absence of PARAM.xml. Still problem with run time address
zoom improved to deal with elongated plots
better link between PIV and images in uvmat.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/find_file_series.m

    r472 r483  
    5454    return % don't go further if the dir path does not exist
    5555end
    56 % NbFrame=1;
    57 % switch FileType
    58 %     case 'multimage'
    59 %     NbFrame=FileInfo.NumberOfFrames;
    60 %     case {'video','mmreader'}
    61 %     NomType='*';
    62 %     NbFrame=FileInfo.NumberOfFrames;
    63 % end
    64 
    65 % RootFile_i='';
    6656NomTypePref='';
    67 if strcmp(NomType,'')||strcmp(NomType,'*')
     57if isempty(NomType)
    6858    if exist(fullfileinput,'file')
    6959        [tild,RootFile]=fileparts(fileinput);% case of constant name (no indexing), get the filename without its extension
     
    7161        RootFile='';
    7262    end
    73 %     i1_input=1;% the index now refer to the frame in the movie, choose 1 at opening
    74 %     i2_input=[];
    75 %     j1_input=[];
    76 %     j2_input=[];
    7763else
    7864    %% possibly include the first index in the root name, if there exists a corresponding xml file
     
    224210        ref_ij=ref_i_list*max_j+ref_j_list; % ordered by index i, then by j for a given i.
    225211    end
    226     %[tild,ifile_min]=min(ref_ij(ref_ij>0));
    227212    ind_select=find(ref_ij>0);
    228213    if isempty(ind_select)
    229         %         RootPath='';
    230214        RootFile='';
    231215        NomType='';
     
    252236        i1_series=(1:FileInfo.NumberOfFrames)';
    253237        i1_input=1;
    254     else
    255        j1_series=(1:FileInfo.NumberOfFrames)';
    256        j1_input=1;
     238        NomType='*';
     239    else
     240        j1_series=(1:FileInfo.NumberOfFrames)';
     241        %  include the first index in the root name
     242        r=regexp(NomType,'^(?<tiretnum>_?\d+)','names');%look for a number or _1 at the beginning of NomType
     243        if ~isempty(r)
     244            fileinput_end=regexprep(fileinput,['^' RootFile],'');%remove RootFile at the beginning of fileinput
     245            if isempty(regexp(r.tiretnum,'^_','once'))% if a separator '_' is not  detected
     246                rr=regexp(fileinput_end,'^(?<i1>\d+)','names');
     247            else% if a separator '_' is  detected
     248                rr=regexp(fileinput_end,'^(?<i1>_\d+)','names');
     249            end
     250            if ~isempty(rr)
     251                RootFile=[RootFile rr.i1];% new root file
     252                NomTypePref=r.tiretnum;
     253                NomType=regexprep(NomType,['^'  NomTypePref],'');
     254                i1_input=j1_input;
     255                i2_input=j2_input;
     256                j1_input=1;
     257                j2_input=[];
     258            end
     259        end
    257260    end
    258261end
Note: See TracChangeset for help on using the changeset viewer.