Ignore:
Timestamp:
Jun 25, 2012, 12:12:24 AM (12 years ago)
Author:
sommeria
Message:

many bugs repaired. series set to work in mode background

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/find_file_series.m

    r469 r472  
    1515%       = 'netcdf' other netcdf files
    1616%       = 'video': movie recognised by VideoReader (e;g. avi)
    17 % Object: video object (=[] otherwise)
     17% MovieObject: video object (=[] otherwise)
    1818%
    1919%INPUT
     
    3737%AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    3838
    39 function [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,Object,i1_input,i2_input,j1_input,j2_input]=find_file_series(FilePath,fileinput)
     39function [RootPath,SubDir,RootFile,i1_series,i2_series,j1_series,j2_series,NomType,FileType,MovieObject,i1_input,i2_input,j1_input,j2_input]=find_file_series(FilePath,fileinput)
    4040%------------------------------------------------------------------------
    4141
     
    5050j1_series=zeros(1,1,1);
    5151j2_series=zeros(1,1,1);
    52 % ifile_min=1;%default
    53 [FileType,FileInfo,Object]=get_file_type(fullfileinput);
    54 NbFrame=1;
    55 
    56 switch FileType
    57     case 'multimage'
    58     NbFrame=FileInfo.NumberOfFrames;
    59     case {'video','mmreader'}
    60     NomType='*';
    61     NbFrame=FileInfo.NumberOfFrames;
    62 end
    63 
    64 RootFile_i='';
     52[FileType,FileInfo,MovieObject]=get_file_type(fullfileinput);
     53if ~exist(FilePath,'dir')
     54    return % don't go further if the dir path does not exist
     55end
     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='';
    6566NomTypePref='';
    6667if strcmp(NomType,'')||strcmp(NomType,'*')
     
    7071        RootFile='';
    7172    end
    72     i1_input=1;% the index now refer to the frame in the movie, choose 1 at opening
    73     i2_input=[];
    74     j1_input=[];
    75     j2_input=[];
     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=[];
    7677else
    7778    %% possibly include the first index in the root name, if there exists a corresponding xml file
     
    101102    i1_str='(?<i1>)';%will set i1=[];
    102103    i1_star='';
    103     %     r.sep2='';
    104104    i2_str='(?<i2>)';%will set i2=[];
    105105    i2_star='';
    106     %     sep3='';
    107106    j1_str='(?<j1>)';%will set j1=[];
    108107    j1_star='';
    109     %     sep4='';
    110108    j2_str='(?<j2>)';%will set j2=[];
    111109    j2_star='';
    112     %   NomTypeStr=NomType;
    113110    %Look for cases with letter indexing for the second index
    114111    r=regexp(NomType,'^(?<sep1>_?)(?<i1>\d+)(?<j1>[a|A])(?<j2>[b|B]?)$','names');
     
    240237    %% update the file type if the input file does not exist (pb of 0001)
    241238    if isempty(FileType)
    242         [FileType,tild,Object]=get_file_type(dirpair(ifile_min).name);
     239        [FileType,tild,MovieObject]=get_file_type(fullfile(FilePath,dirpair(ifile_min).name));
    243240    end
    244241end
     
    251248
    252249%% introduce the frame index in case of movies or multimage type
    253 if NbFrame>1
     250if isfield(FileInfo,'NumberOfFrames')>1 && FileInfo.NumberOfFrames >1
    254251    if isempty(i1_series)
    255         i1_series=(1:NbFrame)';
     252        i1_series=(1:FileInfo.NumberOfFrames)';
    256253        i1_input=1;
    257254    else
    258        j1_series=(1:NbFrame)';
     255       j1_series=(1:FileInfo.NumberOfFrames)';
    259256       j1_input=1;
    260257    end
     
    289286end
    290287
    291 % %% deals with frame index in movies
    292 % switch FileType
    293 %     case 'multimage'
    294 %    NomType='*';
    295 %    i1_series=(1:FileInfo.NbFrame)';
    296 %     case {'video','mmreader'}
    297 %     NomType='*';
    298 %     i1_series=(1:FileInfo.NumberOfFrames)';
    299 % end
    300 
     288
Note: See TracChangeset for help on using the changeset viewer.