Ignore:
Timestamp:
Apr 9, 2013, 8:20:00 PM (12 years ago)
Author:
sommeria
Message:

various bugs corrected after tests with Windows OS.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series/civ_series.m

    r606 r609  
    5858    if ~exist(filecell{1,1},'file')
    5959        msgbox_uvmat('WARNING','the first input file does not exist')
     60    else
     61        FileType=get_file_type(filecell{1,1});
     62        if isempty(find(strcmp(FileType,{'civdata','image','multimage','mmreader','video'})));% =1 for images
     63            msgbox_uvmat('ERROR',['bad input file type for ' mfilename ': an image or civdata file is needed'])
     64        end
    6065    end
    6166    return
     
    8590    MinIndex=cell2mat(Param.IndexRange.MinIndex);
    8691    [filecell,i_series,tild,j_series]=get_file_series(Param);
     92    [FileType_A,FileInfo,MovieObject_A]=get_file_type(filecell{1,1});
     93    if strcmp(FileType_A,'civdata')% a civdata file has been introduced as input.
     94         [FileType_A,FileInfo,MovieObject_A]=get_file_type(filecell{2,1});
     95    end
    8796    [i1_series_Civ1,i2_series_Civ1,j1_series_Civ1,j2_series_Civ1,check_bounds,NomTypeNc]=...
    8897        find_pair_indices(PairCiv1,i_series{1},j_series{1},MinIndex,MaxIndex);
     
    118127   
    119128    NbField=numel(i1_series_Civ1);
    120     [FileType_A,FileInfo,MovieObject_A]=get_file_type(filecell{1,1});
     129
    121130    FileType_B=FileType_A;
    122131    MovieObject_B=MovieObject_A;
     
    143152
    144153%% get timing from the ImaDoc file or input video
    145 [XmlData,NbSlice_calib,time,errormsg]=read_multimadoc(RootPath,SubDir,RootFile,FileExt,i1_series,i2_series,j1_series,j2_series);
     154XmlFileName=find_imadoc(RootPath,SubDir,RootFile,FileExt);
     155time=[];
     156if ~isempty(XmlFileName)
     157    XmlData=imadoc2struct(XmlFileName);
     158        if isfield(XmlData,'Time')
     159            time=XmlData.Time;
     160            TimeSource='xml';
     161        end
     162        if isfield(XmlData,'Camera')
     163            if isfield(XmlData.Camera,'NbSlice')&& ~isempty(XmlData.Camera.NbSlice)
     164                NbSlice_calib{iview}=XmlData.Camera.NbSlice;% Nbre of slices for Zindex in phys transform
     165                if ~isequal(NbSlice_calib{iview},NbSlice_calib{1})
     166                    msgbox_uvmat('WARNING','inconsistent number of Z indices for the two field series');
     167                end
     168            end
     169            if isfield(XmlData.Camera,'TimeUnit')&& ~isempty(XmlData.Camera.TimeUnit)
     170                TimeUnit=XmlData.Camera.TimeUnit;
     171            end
     172        end
     173end
     174if strcmp(InputTable{iview,4},'*')
     175    if ~isempty(VideoObject)
     176        imainfo=get(VideoObject);
     177        time=zeros(imainfo.NumberOfFrames+1,2);
     178        time(:,2)=(0:1/imainfo.FrameRate:(imainfo.NumberOfFrames)/imainfo.FrameRate)';
     179        TimeSource='video';
     180       % set(han:dles.Dt_txt,'String',['Dt=' num2str(1000/imainfo.FrameRate) 'ms']);%display the elementary time interval in millisec
     181        ColorType='truecolor';
     182    elseif ~isempty(imformats(regexprep(InputTable{iview,5},'^.',''))) || isequal(InputTable{iview,5},'.vol')%&& isequal(NomType,'*')% multi-frame image
     183        if ~isempty(InputTable{iview,2})
     184            imainfo=imfinfo(fullfile(InputTable{iview,1},InputTable{iview,2},[InputTable{iview,3} InputTable{iview,5}]));
     185        else
     186            imainfo=imfinfo([FileBase InputTable{iview,5}]);
     187        end
     188        ColorType=imainfo.ColorType;%='truecolor' for color images
     189        if length(imainfo) >1 %case of image with multiple frames
     190            nbfield=length(imainfo);
     191            nbfield_j=1;
     192        end
     193    end
     194end
     195
    146196%TODO: get time_A and time_B
    147 % case of movies TODO TODO TODO
     197
    148198if isempty(time) && (strcmp(FileType,'video') || strcmp(FileType,'mmreader'))
    149199    set(handles.ListPairMode,'Value',1);
     
    161211    end
    162212    TimeUnit='s';
     213end
    163214%%%%% MAIN LOOP %%%%%%
    164215
Note: See TracChangeset for help on using the changeset viewer.