Ignore:
Timestamp:
Jun 8, 2012, 4:30:52 PM (12 years ago)
Author:
sommeria
Message:

possibility of dealing with series of multiple images eg tiff- introduced
bugs corrected in object creation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/find_file_series.m

    r441 r445  
    5252% ifile_min=1;%default
    5353[FileType,FileInfo,Object]=get_file_type(fullfileinput);
     54NbFrame=1;
     55
    5456switch FileType
    5557    case 'multimage'
    56     NomType='*';
    57     i1_series=(1:FileInfo.NbFrame)';
     58%    NomType='*';
     59%    i1_series=(1:FileInfo.NbFrame)';
     60    NbFrame=FileInfo.NbFrame;
    5861    case {'video','mmreader'}
    5962    NomType='*';
    60     i1_series=(1:FileInfo.NumberOfFrames)';
     63    NbFrame=FileInfo.NumberOfFrames;
     64%     i1_series=(1:FileInfo.NumberOfFrames)';
    6165end
    6266% if strcmp( FileType,'multimage')||strcmp( FileType,'video')||strcmp( FileType,'mmreader')
     
    6468%     i1_series=(1:FileInfo.NumberOfFrames)';
    6569% end
    66 
     70RootFile_i='';
     71NomTypePref='';
    6772if strcmp(NomType,'')||strcmp(NomType,'*')
    6873    if exist(fullfileinput,'file')
     
    7782else
    7883    %% possibly include the first index in the root name, if there exists a corresponding xml file
    79     NomTypePref='';
    8084    r=regexp(NomType,'^(?<tiretnum>_?\d+)','names');%look for a number or _1 at the beginning of NomType
    8185    if ~isempty(r)
     
    8791        end
    8892        if ~isempty(rr)
    89             RootFileNew=[RootFile rr.i1];
    90             checkpair=~isempty(regexp(NomType,'-','once'))||~isempty(regexp(NomType,'ab$','once'))||~isempty(regexp(NomType,'AB$','once'));%case of PIV results
    91             if exist(fullfile(RootPath,SubDir,[RootFileNew '.xml']),'file') %|| (checkpair && exist(fullfile(fileparts(RootPath),[RootFileNew '.xml']),'file'))
    92                 RootFile=RootFileNew;
     93            RootFile_i=[RootFile rr.i1];
     94           % checkpair=~isempty(regexp(NomType,'-','once'))||~isempty(regexp(NomType,'ab$','once'))||~isempty(regexp(NomType,'AB$','once'));%case of PIV results
     95            if exist(fullfile(RootPath,SubDir,[RootFile_i '.xml']),'file') %|| (checkpair && exist(fullfile(fileparts(RootPath),[RootFile_i '.xml']),'file'))
     96                RootFile=RootFile_i;
    9397                NomTypePref=r.tiretnum;
    9498                NomType=regexprep(NomType,['^'  NomTypePref],'');
     
    252256if isequal(j2_series,0), j2_series=[]; end
    253257
     258%% introduce the frame index in case of movies or multimage type
     259if NbFrame>1
     260    if isempty(i1_series)
     261        i1_series=(1:NbFrame)';
     262        i1_input=1;
     263    else
     264       j1_series=(1:NbFrame)';
     265       j1_input=1;
     266    end
     267end
     268
    254269%% sort pairs by decreasing index differences in case of multiple pairs at the same reference index
    255270if size(i2_series,3)>1 %pairs i1 -i2
     
    280295end
    281296
     297% %% deals with frame index in movies
     298% switch FileType
     299%     case 'multimage'
     300%    NomType='*';
     301%    i1_series=(1:FileInfo.NbFrame)';
     302%     case {'video','mmreader'}
     303%     NomType='*';
     304%     i1_series=(1:FileInfo.NumberOfFrames)';
     305% end
     306
Note: See TracChangeset for help on using the changeset viewer.