Ignore:
Timestamp:
Jun 22, 2012, 3:45:50 PM (12 years ago)
Author:
sommeria
Message:

functions upadated in series

File:
1 edited

Legend:

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

    r464 r470  
    130130
    131131%% calibration data and timing: read the ImaDoc files
    132 mode=''; %default
    133 timecell={};
    134 itime=0;
    135 NbSlice_calib={};
    136 XmlData=cell(1,nbview);%initiate the structures containing the data from the xml file (calibration and timing)
    137 for iview=1:nbview%Loop on views
    138     SubDirBase=regexprep(SubDir{iview},'\..*','');%take the root part of SubDir, before the first dot '.'
    139     filexml=[fullfile(RootPath{iview},SubDirBase) '.xml'];%new convention: xml at the level of the image folder
    140     if ~exist(filexml,'file')
    141         filexml=[fullfile(RootPath{iview},SubDir{iview},RootFile{iview}) '.xml']; % old convention: xml inside the image folder
    142         if ~exist(filexml,'file')
    143             filexml=[fullfile(RootPath{iview},SubDir{iview},RootFile{iview}) '.civ']; % very old convention: .civ file
    144             if ~exist(filexml,'file')
    145                 filexml='';
    146             end
    147         end
    148     end
    149     if ~isempty(filexml)
    150         [XmlData{iview},error]=imadoc2struct(filexml);
    151     end
    152     if isfield(XmlData{iview},'Time')
    153         itime=itime+1;
    154         timecell{itime}=XmlData{iview}.Time;
    155     end
    156     if isfield(XmlData{iview},'GeometryCalib') && isfield(XmlData{iview}.GeometryCalib,'SliceCoord')
    157         NbSlice_calib{iview}=size(XmlData{iview}.GeometryCalib.SliceCoord,1);%nbre of slices for Zindex in phys transform
    158         if ~isequal(NbSlice_calib{iview},NbSlice_calib{1})
    159             msgbox_uvmat('WARNING','inconsistent number of Z indices for the two field series');
    160         end
    161     end
    162 end
    163 
    164 %% check coincidence in time for several input file series
    165 multitime=0;
    166 if isempty(timecell)
    167     time=[];
    168 elseif length(timecell)==1
    169     time=timecell{1};
    170 elseif length(timecell)>1
    171     multitime=1;
    172     for icell=1:length(timecell)
    173         if ~isequal(size(timecell{icell}),size(timecell{1}))
    174             msgbox_uvmat('WARNING','inconsistent time array dimensions in ImaDoc fields, the time for the first series is used')
    175             time=timecell{1};
    176             multitime=0;
    177             break
    178         end
    179     end
    180 end
    181 if multitime
    182     for icell=1:length(timecell)
    183         time(icell,:,:)=timecell{icell};
    184     end
     132[XmlData,NbSlice_calib,time,errormsg]=read_multimadoc(RootPath,SubDir,RootFile,FileExt,i1_series,i2_series,j1_series,j2_series);
     133if size(time,1)>1
    185134    diff_time=max(max(diff(time)));
    186135    if diff_time>0
    187136        msgbox_uvmat('WARNING',['times of series differ by (max) ' num2str(diff_time)])
    188137    end   
    189 end
    190 if size(time,2) < i2_series{1}(end) ||( ~isempty(j2_series{1}) && size(time,3) < j2_series{1}(end))% time array absent or too short in ImaDoc xml file'
    191     time=[];
    192138end
    193139
Note: See TracChangeset for help on using the changeset viewer.