Changeset 1068 for trunk/src/series
- Timestamp:
- Jul 9, 2019, 10:10:18 AM (6 years ago)
- Location:
- trunk/src/series
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/civ_series.m
r1065 r1068 89 89 end 90 90 % estimated CPUTime 91 Data.CPUTime=1; % 1 minute per field pair 91 CPUtime_unit=0.01;%estimated time for a multiplication (in microsecond) 92 if isfield(Param.SeriesData,'FileInfo')&&isfield(Param.SeriesData.FileInfo{1},'Height')&&isfield(Param.SeriesData.FileInfo{1},'Width') 93 pixnbre=Param.SeriesData.FileInfo{1}.Height*Param.SeriesData.FileInfo{1}.Width; % total number of pxels for input images 94 CPUtime=0; 95 if isfield(Data.ActionInput,'Civ1') 96 %BoxSize=Data.ActionInput.Civ1.CorrBoxSize(1)*Data.ActionInput.Civ1.CorrBoxSize(2); 97 tic 98 testboxa=rand(Data.ActionInput.Civ1.CorrBoxSize(1),Data.ActionInput.Civ1.CorrBoxSize(2)); 99 testboxb=rand(Data.ActionInput.Civ1.SearchBoxSize(1),Data.ActionInput.Civ1.SearchBoxSize(2)); 100 anss=conv2(testboxa,testboxb); 101 CPUtime_unit=toc; 102 nb_box=pixnbre/(Data.ActionInput.Civ1.Dx*Data.ActionInput.Civ1.Dy); 103 %nbpos=Data.ActionInput.Civ1.SearchBoxSize-Data.ActionInput.Civ1.CorrBoxSize; 104 CPUtime=2*CPUtime_unit*nb_box%*BoxSize*nbpos(1)*nbpos(2);% adjustement factor 2 used 105 end 106 if isfield(Data.ActionInput,'Patch1') 107 CPUtime=2*CPUtime; 108 end 109 if isfield(Data.ActionInput,'Civ2') 110 tic 111 testboxa=rand(Data.ActionInput.Civ2.CorrBoxSize(1),Data.ActionInput.Civ2.CorrBoxSize(2)); 112 testboxb=rand(Data.ActionInput.Civ2.SearchBoxSize(1),Data.ActionInput.Civ2.SearchBoxSize(2)); 113 anss=conv2(testboxa,testboxb); 114 CPUtime_unit=toc; 115 nb_box=pixnbre/(Data.ActionInput.Civ2.Dx*Data.ActionInput.Civ2.Dy); 116 %BoxSize=Data.ActionInput.Civ2.CorrBoxSize(1)*Data.ActionInput.Civ2.CorrBoxSize(2); 117 %nbpos=Data.ActionInput.Civ2.SearchBoxSize-Data.ActionInput.Civ2.CorrBoxSize; 118 CPUtime=CPUtime+2*CPUtime_unit*nb_box;%*BoxSize*nbpos(1)*nbpos(2); 119 end 120 if isfield(Data.ActionInput,'Patch2') 121 CPUtime=(4/3)*CPUtime; 122 end 123 Data.CPUTime=ceil(CPUtime/6); % estimated CPU time per field pair in minute 124 Data.CPUTime=Data.CPUTime/10; % displqy CPU time with 1 digit beyond dot 125 end 92 126 return 93 127 end -
trunk/src/series/extract_multitif.m
r1061 r1068 73 73 ParamOut.OutputDirExt='.png';%set the output dir extension 74 74 ParamOut.OutputFileMode='NbSlice';% '=NbInput': 1 output file per input file index, '=NbInput_i': 1 file per input file index i, '=NbSlice': 1 file per slice 75 ParamOut.CheckOverwriteVisible='on'; % manage the overwrite of existing files (default=1) 75 ParamOut.CheckOverwriteVisible='on'; % manage the overwrite of existing files (default=1) 76 ParamOut.CPUTime=7;% expected time for writting one image ( in minute) 76 77 %% root input file(s) and type 77 78 % check the existence of the first file in the series … … 113 114 end 114 115 115 %% list of input images116 % DirImages=fullfile(Param.InputTable{1,1},Param.InputTable{1,2});117 % ListStruct=dir(DirImages);118 % ListCells=struct2cell(ListStruct);% transform dir struct to a cell arrray119 % check_bad=strcmp('.',ListCells(1,:))|strcmp('..',ListCells(1,:));%detect the dir '.' to exclude it120 % check_dir=cell2mat(ListCells(4,:));% =1 for directories, =0 for files121 % ListFile=ListCells(1,find(~check_dir & ~check_bad));122 123 %% check file names124 % RootName=regexprep(ListFile{1},'.tif$','')125 % rank(1)=1;126 % for ilist=2:numel(ListFile)127 % rank_str=regexprep(ListFile{ilist},'.tif$','');128 % rank(ilist)=regexprep(rank_str,['^' RootName '@'],'');129 % % if ~isequal(str2num(rank),ilist-1)130 % % disp(['error in the list of input file # ' num2str(ilist-1)])131 % % return132 % % end133 % end134 135 116 %% output directory 136 117 OutputDir=fullfile(Param.InputTable{1,1},[Param.OutputSubDir Param.OutputDirExt]); … … 156 137 end 157 138 158 %% Main loop159 160 161 % count=0;162 %count=316;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CORRECTION EXP08: 4684 images -> start at 316 start 67->_11_1163 %count=1934%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CORRECTION EXP07: 3066 images164 139 %% loop on the files 165 140 % include the first tiff file with no index in the first iteration … … 174 149 end 175 150 for ifile=firstindex:Param.IndexRange.last_i 151 tic 176 152 if firstindex==0 && ifile==0% first slice of processing 177 153 ImageName=fullfile(Param.InputTable{1,1},Param.InputTable{1,2},'im.tif') … … 181 157 NbFrames=numel(imfinfo(ImageName)); 182 158 for iframe=1:NbFrames 183 iframe184 159 if isequal(ImagesPerLevel,1)% mode series 185 160 OutputFile=fullfile(OutputDir,['img_' num2str(count+1) '.png']); … … 198 173 count=count+1; 199 174 end 175 tt=toc; 176 disp(['elapsed time (in min.) for the file im@' num2str(ifile,'%04d')]) 177 disp(num2str(tt/60)) 200 178 end 201 179 -
trunk/src/series/extract_rdvision.m
r1066 r1068 489 489 490 490 %% correct NbDtj and NbDti (error from RDvision) 491 if NbDtj==numel(Dtj)% case of bursts492 NbDtj=1;493 uid_motor_nbslice=find(t,'ImaDoc/TranslationMotor/Nbslice');494 if ~isempty(uid_motor_nbslice)&& ~isempty(uid_Dtk)% case of multilevel495 NbSlice=str2num(get(t,get(t,uid_motor_nbslice,'contents'),'value'));496 NbDti=NbSlice-1;497 end498 end491 % if NbDtj==numel(Dtj)% case of bursts 492 % NbDtj=1; 493 % uid_motor_nbslice=find(t,'ImaDoc/TranslationMotor/Nbslice'); 494 % if ~isempty(uid_motor_nbslice)&& ~isempty(uid_Dtk)% case of multilevel 495 % NbSlice=str2num(get(t,get(t,uid_motor_nbslice,'contents'),'value')); 496 % NbDti=NbSlice-1; 497 % end 498 % end 499 499 500 500 if isempty(Dtj)% case of simple series … … 509 509 nbfield2=NbDtj*numel(Dtj)+1; 510 510 NbFrames_xml=nbfield1*nbfield2; 511 if NbFrames_xml<numel(timestamp)512 disp(['ERROR: size from xml ' num2str(NbFrame_xml) ' smaller than timestamp size ' num2str(numel(timestamp))])513 return514 end515 if NbFrames_xml>numel(timestamp)516 nbfield1=floor(numel(timestamp)/nbfield2);517 nbfieldk=floor(nbfield1/nbfieldi);518 nbfield1=nbfieldi*nbfieldk;519 NbDtk=nbfieldk-1;520 t=set(t,uid_content_NbDtk,'value',num2str(NbDtk));% correct NbDtk in the xml file (in practice numel(Dtk)=1;521 timestamp=timestamp(1:nbfield1*nbfield2);522 disp(['image record stopped before end: max index i= ' num2str(nbfield1)]);523 timestamp=reshape(timestamp,nbfield2,nbfield1);524 end525 % check Dtj with respect to timestamp526 timestamp=(reshape(timestamp,nbfield2,[]))';527 diff_Dtj=diff(timestamp(1,:))-Dtj;528 if max(abs(diff_Dtj))>min(Dtj)/1000529 disp(['Dtj from xml file differs from time stamp by ' num2str(max(abs(diff_Dtj))) ', '])%'530 else531 disp('Dtj OK');532 end511 % if NbFrames_xml<numel(timestamp) 512 % disp(['ERROR: size from xml ' num2str(NbFrame_xml) ' smaller than timestamp size ' num2str(numel(timestamp))]) 513 % return 514 % end 515 % if NbFrames_xml>numel(timestamp) 516 % nbfield1=floor(numel(timestamp)/nbfield2); 517 % nbfieldk=floor(nbfield1/nbfieldi); 518 % nbfield1=nbfieldi*nbfieldk; 519 % NbDtk=nbfieldk-1; 520 % t=set(t,uid_content_NbDtk,'value',num2str(NbDtk));% correct NbDtk in the xml file (in practice numel(Dtk)=1; 521 % timestamp=timestamp(1:nbfield1*nbfield2); 522 % disp(['image record stopped before end: max index i= ' num2str(nbfield1)]); 523 % timestamp=reshape(timestamp,nbfield2,nbfield1); 524 % end 525 % % check Dtj with respect to timestamp 526 % timestamp=(reshape(timestamp,nbfield2,[]))'; 527 % diff_Dtj=diff(timestamp(1,:))-Dtj; 528 % if max(abs(diff_Dtj))>min(Dtj)/1000 529 % disp(['Dtj from xml file differs from time stamp by ' num2str(max(abs(diff_Dtj))) ', '])%' 530 % else 531 % disp('Dtj OK'); 532 % end 533 533 end 534 534 535 535 %% adjust Dti 536 if NbDti+1>size(timestamp,1)537 NbDti=size(timestamp,1)-1;538 end539 Dti_stamp=(timestamp(1+NbDti,1)-timestamp(1,1))/NbDti;540 Dti_stamp=(timestamp(1+NbDti,1)-timestamp(2,1))/(NbDti-1);541 t=set(t,uid_content_Dti,'value',num2str(Dti_stamp));%corret Dti542 if abs(Dti_stamp-Dti)>Dti/1000543 disp([msg 'Dti from xml file corrected by ' num2str(Dti_stamp-Dti) ', ']);%'544 else545 disp('Dti OK')546 end536 % if NbDti+1>size(timestamp,1) 537 % NbDti=size(timestamp,1)-1; 538 % end 539 % Dti_stamp=(timestamp(1+NbDti,1)-timestamp(1,1))/NbDti; 540 % Dti_stamp=(timestamp(1+NbDti,1)-timestamp(2,1))/(NbDti-1); 541 % t=set(t,uid_content_Dti,'value',num2str(Dti_stamp));%corret Dti 542 % if abs(Dti_stamp-Dti)>Dti/1000 543 % disp([msg 'Dti from xml file corrected by ' num2str(Dti_stamp-Dti) ', ']);%' 544 % else 545 % disp('Dti OK') 546 % end 547 547 548 548 %% adjust Dtk -
trunk/src/series/merge_proj_polar.m
r1061 r1068 63 63 ParamOut.AllowInputSort='on';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default) 64 64 ParamOut.WholeIndexRange='off';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default) 65 ParamOut.NbSlice='o n'; %nbre of slices ('off' by default)65 ParamOut.NbSlice='off'; %nbre of slices ('off' by default) 66 66 ParamOut.VelType='one';% menu for selecting the velocity type (options 'off'/'one'/'two', 'off' by default) 67 67 ParamOut.FieldName='off';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default) … … 268 268 CheckOverwrite=Param.CheckOverwrite; 269 269 end 270 270 NbField 271 271 for index=1:NbField 272 disp(['index=' num2str(index)])273 disp(['ellapsed time ' num2str(toc(tstart)/60,4) ' minutes'])274 272 update_waitbar(WaitbarHandle,index/NbField) 275 273 if ~isempty(RUNHandle) && ~strcmp(get(RUNHandle,'BusyAction'),'queue') … … 352 350 %% calculate tps coefficients 353 351 Data{iview}=tps_coeff_field(Data{iview},1); 354 352 'tps_coeff done' 355 353 %% projection on the polar grid 356 354 [DataOut,VarAttribute,errormsg]=calc_field_tps(Data{iview}.Coord_tps,Data{iview}.NbCentre,Data{iview}.SubRange,... 357 355 cat(3,Data{iview}.U_tps,Data{iview}.V_tps),FieldNames,cat(3,XI,YI)); 356 if ~isempty(errormsg) 357 disp(errormsg) 358 end 359 358 360 % set to NaN interpolation points which are too far from any initial data (more than 2 CoordMesh) 359 361 Coord=permute(Data{iview}.Coord_tps,[1 3 2]); … … 366 368 G=TriScatteredInterp(Coord,Coord(:,2),'nearest'); 367 369 end 370 'Interp done' 368 371 Distx=F(XI,YI)-XI;% diff of x coordinates with the nearest measurement point 369 372 Disty=G(XI,YI)-YI;% diff of y coordinates with the nearest measurement point … … 390 393 391 394 %% merge the NbView fields 395 ProjData 392 396 [MergeData,errormsg]=merge_field(ProjData); 393 397 if ~isempty(errormsg) … … 446 450 TimeData.div=MergeData.div; 447 451 448 [error,ncid]=struct2nc(OutputFile,TimeData);%save result file452 error=struct2nc(OutputFile,TimeData);%save result file 449 453 if isempty(error) 450 454 disp(['output file ' OutputFile ' written']) … … 453 457 end 454 458 ellapsed_time=toc(tstart); 455 disp(['total ellapsed time ' num2str(ellapsed_time/60,2) ' minutes']) 456 end 457 458 ellapsed_time=toc(tstart); 459 disp(['total ellapsed time ' num2str(ellapsed_time/60,2) ' minutes']) 459 disp(['ellapsed time since start ' num2str(ellapsed_time/60,2) ' minutes']) 460 end 461 460 462 disp([ num2str(ellapsed_time/(60*NbField),3) ' minutes per iteration']) 461 463
Note: See TracChangeset
for help on using the changeset viewer.