- Timestamp:
- Jun 22, 2012, 3:45:50 PM (13 years ago)
- Location:
- trunk/src/series
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/aver_stat.m
r464 r470 130 130 131 131 %% 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); 133 if size(time,1)>1 185 134 diff_time=max(max(diff(time))); 186 135 if diff_time>0 187 136 msgbox_uvmat('WARNING',['times of series differ by (max) ' num2str(diff_time)]) 188 137 end 189 end190 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=[];192 138 end 193 139 -
trunk/src/series/check_data_files.m
r457 r470 106 106 for iview=1:nbview 107 107 if isequal(FileType{iview},'mmreader')||isequal(FileType{iview},'video')||isequal(FileType{iview},'multimage') 108 [tild,FileInfo]=get_file_type(filecell{iview,1}) 109 % info=aviinfo(filecell{iview,1}); 110 message{1}=filecell{iview,1};%info.Filename; 111 message{2}=FileInfo.FileModDate; 112 message{3}=[num2str(FileInfo.FramesPerSecond) ' frames/s ']; 113 message{4}=FileInfo.ImageType; 114 message{5}=[' compression' FileInfo.VideoCompression]; 115 message{6}=[ 'quality ' num2str(FileInfo.Quality)]; 116 Tabchar=message; 108 [tild,FileInfo]=get_file_type(filecell{iview,1}); 109 Tabchar{1}=filecell{iview,1};%info.Filename; 110 Tabchar{2}=FileInfo.FileModDate; 111 Tabchar{3}=[num2str(FileInfo.FramesPerSecond) ' frames/s ']; 112 Tabchar{4}=FileInfo.ImageType; 113 Tabchar{5}=[' compression' FileInfo.VideoCompression]; 114 Tabchar{6}=[ 'quality ' num2str(FileInfo.Quality)]; 117 115 else 118 116 Tabchar={}; … … 130 128 detect=exist(file,'file'); % check the existence of the file 131 129 if detect==0 132 % count=count+1;133 130 lastfield='not found'; 134 131 else … … 139 136 end 140 137 lastfield=''; 141 [FileType ,FileInfo,Object]=get_file_type(file);142 if strcmp(FileType ,'civx')||strcmp(FileType,'civdata')138 [FileType{iview},FileInfo,Object]=get_file_type(file); 139 if strcmp(FileType{iview},'civx')||strcmp(FileType{iview},'civdata') 143 140 if isfield(FileInfo,'CivStage') 144 141 liststage={'civ1','fix1','patch1','civ2','fix2','patch2'}; … … 146 143 end 147 144 end 148 lastfield=[FileType ', ' lastfield];145 lastfield=[FileType{iview} ', ' lastfield]; 149 146 end 150 147 Tabchar(1,i_slice)={['slice #' num2str(i_slice)]}; -
trunk/src/series/merge_proj.m
r464 r470 130 130 end 131 131 132 132 133 %% calibration data and timing: read the ImaDoc files 133 mode=''; %default 134 timecell={}; 135 itime=0; 136 NbSlice_calib={}; 137 XmlData=cell(1,nbview);%initiate the structures containing the data from the xml file (calibration and timing) 138 139 for iview=1:nbview%Loop on views 140 SubDirBase=regexprep(SubDir{iview},'\..*','');%take the root part of SubDir, before the first dot '.' 141 filexml=[fullfile(RootPath{iview},SubDirBase) '.xml'];%new convention: xml at the level of the image folder 142 if ~exist(filexml,'file') 143 filexml=[fullfile(RootPath{iview},SubDir{iview},RootFile{iview}) '.xml']; % old convention: xml inside the image folder 144 if ~exist(filexml,'file') 145 filexml=[fullfile(RootPath{iview},SubDir{iview},RootFile{iview}) '.civ']; % very old convention: .civ file 146 if ~exist(filexml,'file') 147 filexml=''; 148 end 149 end 150 end 151 if ~isempty(filexml) 152 [XmlData{iview},error]=imadoc2struct(filexml); 153 end 154 if isfield(XmlData{iview},'Time') 155 itime=itime+1; 156 timecell{itime}=XmlData{iview}.Time; 157 end 158 if isfield(XmlData{iview},'GeometryCalib') && isfield(XmlData{iview}.GeometryCalib,'SliceCoord') 159 NbSlice_calib{iview}=size(XmlData{iview}.GeometryCalib.SliceCoord,1);%nbre of slices for Zindex in phys transform 160 if ~isequal(NbSlice_calib{iview},NbSlice_calib{1}) 161 msgbox_uvmat('WARNING','inconsistent number of Z indices for the two field series'); 162 end 163 end 164 end 165 166 167 %% check coincidence in time for several input file series 168 multitime=0; 169 if isempty(timecell) 170 time=[]; 171 elseif length(timecell)==1 172 time=timecell{1}; 173 elseif length(timecell)>1 174 multitime=1; 175 for icell=1:length(timecell) 176 if ~isequal(size(timecell{icell}),size(timecell{1})) 177 msgbox_uvmat('WARNING','inconsistent time array dimensions in ImaDoc fields, the time for the first series is used') 178 time=timecell{1}; 179 multitime=0; 180 break 181 end 182 end 183 end 184 if multitime 185 for icell=1:length(timecell) 186 time(icell,:,:)=timecell{icell}; 187 end 134 [XmlData,NbSlice_calib,time,errormsg]=read_multimadoc(RootPath,SubDir,RootFile,FileExt,i1_series,i2_series,j1_series,j2_series); 135 if size(time,1)>1 188 136 diff_time=max(max(diff(time))); 189 137 if diff_time>0 … … 191 139 end 192 140 end 193 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' 194 time=[]; 195 end 141 196 142 197 143 %% coordinate transform or other user defined transform … … 266 212 %%%%%%%%%%%%%%%% loop on field indices %%%%%%%%%%%%%%%% 267 213 for index=index_slice 214 268 215 if checkrun 269 216 update_waitbar(hseries.waitbar_frame,WaitbarPos,index/(nbfield)) … … 285 232 timeread(iview)=0; 286 233 if isfield(Data{iview},'Time') 287 timeread(iview)= Field{iview}.Time;234 timeread(iview)=Data{iview}.Time; 288 235 nbtime=nbtime+1; 289 236 end … … 317 264 return 318 265 end 319 % time of the merged field:320 time_i=0;%default321 if isempty(time)% time from ImaDoc prevails322 time _i=sum(timeread)/nbtime;323 e lse324 time_i=(time(i1,j1)+time(i2,j2))/2; %TODO: upgrade325 end266 267 % time of the merged field: 268 if ~isempty(time)% time defined from ImaDoc 269 timeread=time(:,index); 270 end 271 timeread=mean(timeread); 272 326 273 % generating the name of the merged field 327 274 i1=i1_series{iview}(index); … … 342 289 end 343 290 OutputFile=fullfile_uvmat(RootPath{1},Param.OutputSubDir,RootFile{1},FileExtOut,NomType{1},i1,i2,j1,j2); 344 345 % time of the merged field:346 time_i=0;%default347 if isempty(time)% time from ImaDoc prevails348 time_i=sum(timeread)/nbtime;349 else350 % time_i=i1;351 time_i=(time(i1,j1)+time(i2,j2))/2; %TODO: upgrade352 end353 291 354 292 % recording the merged field … … 405 343 MergeData.dt=dt; 406 344 end 407 MergeData.Time=time _i;345 MergeData.Time=timeread; 408 346 error=struct2nc(OutputFile,MergeData);%save result file 409 347 if isempty(error) -
trunk/src/series/time_series.m
r464 r470 130 130 131 131 %% 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); 133 if size(time,1)>1 185 134 diff_time=max(max(diff(time))); 186 135 if diff_time>0 187 136 msgbox_uvmat('WARNING',['times of series differ by (max) ' num2str(diff_time)]) 188 137 end 189 end190 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=[];192 138 end 193 139
Note: See TracChangeset
for help on using the changeset viewer.