Changeset 620 for trunk/src/read_multimadoc.m
- Timestamp:
- Apr 25, 2013, 10:25:20 PM (12 years ago)
- 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 series1 %'read_multimadoc': read a set of Imadoc files for different file series and compare their timing 2 2 %------------------------------------------------------------------------ 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) 4 4 % 5 5 % OUTPUT: 6 % XmlData : cell array of structure representing the contents of the xml files6 % XmlData(iview): cell array of structures representing the contents of the xml files, iview =index of the input file series 7 7 % NbSlice_calib: nbre of slices detected in the geometric calibration data 8 % mtrix of times9 % errormsg: error message, ='' if readingOK8 % 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 10 10 % 11 11 % INPUT: 12 12 % 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 15 14 % 16 function [XmlData,NbSlice_calib, time,errormsg]=read_multimadoc(RootPath,SubDir,RootFile,FileExt,i1_series,i2_series,j1_series,j2_series)17 errormsg='';15 function [XmlData,NbSlice_calib,Time,warnmsg]=read_multimadoc(RootPath,SubDir,RootFile,FileExt,i1_series,i2_series,j1_series,j2_series) 16 warnmsg=''; 18 17 if ischar(RootPath) 19 18 RootPath={RootPath};SubDir={SubDir};RootFile={RootFile};FileExt={FileExt}; … … 26 25 XmlFileName=find_imadoc(RootPath{iview},SubDir{iview},RootFile{iview},FileExt{iview}); 27 26 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 32 28 end 33 29 if isfield(XmlData{iview},'Time') … … 37 33 NbSlice_calib{iview}=size(XmlData{iview}.GeometryCalib.SliceCoord,1);%nbre of slices for Zindex in phys transform 38 34 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'; 40 36 end 41 37 end … … 44 40 %% check coincidence in time for several input file series 45 41 if isempty(timecell) 46 time=[];42 Time=[]; 47 43 else 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}); 49 45 end 50 46 if nbview>1 51 time=shiftdim(time,-1); % add a singleton dimension for nbview47 Time=shiftdim(Time,-1); % add a singleton dimension for nbview 52 48 for icell=2:nbview 53 49 if isequal(size(timecell{icell}),size(timecell{1})) 54 50 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)); 56 52 else 57 53 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 59 55 break 60 56 end
Note: See TracChangeset
for help on using the changeset viewer.