Ignore:
Timestamp:
Apr 25, 2013, 10:25:20 PM (8 years ago)
Author:
sommeria
Message:

bugs repaired in series + cleaning.
Introducing of a demo program (test stage)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/read_multimadoc.m

    r617 r620  
    1 %'read_multimadoc': read a set of Imadoc files and compare their timing of different file series
     1%'read_multimadoc': read a set of Imadoc files for different file series and compare their timing
    22%------------------------------------------------------------------------
    3 % [XmlData,NbSlice_calib,time,errormsg]=read_multimadoc(RootPath,SubDir,RootFile,FileExt,i1_series,i2_series,j1_series,j2_series)
     3% [XmlData,NbSlice_calib,time,warnmsg]=read_multimadoc(RootPath,SubDir,RootFile,FileExt,i1_series,i2_series,j1_series,j2_series)
    44%
    55% OUTPUT:
    6 % XmlData: cell array of structure representing the contents of the xml files
     6% XmlData(iview): cell array of structures representing the contents of the xml files, iview =index of the input file series
    77% NbSlice_calib: nbre of slices detected in the geometric calibration data
    8 % mtrix of times
    9 % errormsg: error message, ='' if reading OK
     8% Time(iview,i,j): matrix of times, iview =index of the series, i,j=file indices within the series
     9% warnmsg: warning message, ='' if OK
    1010%
    1111% INPUT:
    1212% RootPath,SubDir,RootFile,FileExt: cell arrays characterizing the input file series
    13 % i1_series,i2_series,j1_series,j2_series: cell arrays of file index
    14 % arrays, as given by the fct uvmat/get_file_series
     13% i1_series,i2_series,j1_series,j2_series: cell arrays of file index arrays, as given by the fct uvmat/get_file_series
    1514%
    16 function [XmlData,NbSlice_calib,time,errormsg]=read_multimadoc(RootPath,SubDir,RootFile,FileExt,i1_series,i2_series,j1_series,j2_series)
    17 errormsg='';
     15function [XmlData,NbSlice_calib,Time,warnmsg]=read_multimadoc(RootPath,SubDir,RootFile,FileExt,i1_series,i2_series,j1_series,j2_series)
     16warnmsg='';
    1817if ischar(RootPath)
    1918    RootPath={RootPath};SubDir={SubDir};RootFile={RootFile};FileExt={FileExt};
     
    2625    XmlFileName=find_imadoc(RootPath{iview},SubDir{iview},RootFile{iview},FileExt{iview});
    2726    if ~isempty(XmlFileName)
    28         [XmlData{iview},errormsg]=imadoc2struct(XmlFileName);% read the ImaDoc xml file
    29         if ~isempty(errormsg)
    30             return
    31         end
     27        [XmlData{iview},warnmsg]=imadoc2struct(XmlFileName);% read the ImaDoc xml file
    3228    end
    3329    if isfield(XmlData{iview},'Time')
     
    3733        NbSlice_calib{iview}=size(XmlData{iview}.GeometryCalib.SliceCoord,1);%nbre of slices for Zindex in phys transform
    3834        if ~isequal(NbSlice_calib{iview},NbSlice_calib{1})
    39             msgbox_uvmat('WARNING','inconsistent number of Z indices for the two field series');
     35            warnmsg='inconsistent number of Z indices in field series';
    4036        end
    4137    end
     
    4440%% check coincidence in time for several input file series
    4541if isempty(timecell)
    46     time=[];
     42    Time=[];
    4743else
    48     time=get_time(timecell{1},i1_series{1},i2_series{1},j1_series{1},j2_series{1});
     44    Time=get_time(timecell{1},i1_series{1},i2_series{1},j1_series{1},j2_series{1});
    4945end
    5046if nbview>1
    51     time=shiftdim(time,-1); % add a singleton dimension for nbview
     47    Time=shiftdim(Time,-1); % add a singleton dimension for nbview
    5248    for icell=2:nbview
    5349        if isequal(size(timecell{icell}),size(timecell{1}))
    5450            time_line=get_time(timecell{icell},i1_series{icell},i2_series{icell},j1_series{icell},j2_series{icell});
    55             time=cat(1,time,shiftdim(time_line,-1));
     51            Time=cat(1,Time,shiftdim(time_line,-1));
    5652        else
    5753            msgbox_uvmat('WARNING','inconsistent time array dimensions in ImaDoc fields, the time for the first series is used')
    58             time=cat(1,time,time(icell-1,:,:));
     54            Time=cat(1,Time,Time(1,:,:));% copy times of the first line
    5955            break
    6056        end
Note: See TracChangeset for help on using the changeset viewer.