Changeset 1163 for trunk/src/series/civ_3D.m
- Timestamp:
- Jul 25, 2024, 8:36:17 PM (7 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/civ_3D.m
r1161 r1163 190 190 Data.VarAttribute{7}.Role='ancillary'; 191 191 Data.VarAttribute{8}.Role='errorflag'; 192 Data.Coord_z=j1_series_Civ1;192 % Data.Coord_z=j1_series_Civ1; 193 193 % path for output nc file 194 194 OutputPath=fullfile(Param.OutputPath,num2str(Param.Experiment),num2str(Param.Device),[Param.OutputSubDir Param.OutputDirExt]); … … 230 230 par_civ1.ImageHeight=FileInfo.Height;npy=FileInfo.Height; 231 231 par_civ1.ImageWidth=FileInfo.Width;npx=FileInfo.Width; 232 SearchRange_z= floor(Param.ActionInput.Civ1.SearchBoxSize(3)/2);232 SearchRange_z=Param.ActionInput.Civ1.SearchRange(3); 233 233 par_civ1.Dz=Param.ActionInput.Civ1.Dz; 234 234 par_civ1.ImageA=zeros(2*SearchRange_z+1,npy,npx); … … 296 296 par_civ1.ImageA=zeros(2*SearchRange_z+1,npy,npx);%image block initiation 297 297 par_civ1.ImageB=zeros(2*SearchRange_z+1,npy,npx); 298 298 Data.Coord_z=SearchRange_z+1:par_civ1.Dz:NbSlice-1; 299 299 z_index=1;%first vertical block centered at image index z_index=SearchRange_z+1 300 300 for iz=1:2*SearchRange_z+1 … … 315 315 end 316 316 % loop on slices 317 317 318 for z_index=2:floor((NbSlice-SearchRange_z)/par_civ1.Dz)% loop on slices 318 319 par_civ1.ImageA=circshift(par_civ1.ImageA,-par_civ1.Dz,1);%shift the indices in the image block upward by par_civ1.Dz 319 320 par_civ1.ImageB=circshift(par_civ1.ImageB,-par_civ1.Dz,1); 320 321 for iz=1:par_civ1.Dz %read the new images at the end of the image block 322 image_index=z_index*par_civ1.Dz+SearchRange_z-par_civ1.Dz+iz+1; 323 if image_index<=size(j1_series_Civ1,1) 321 324 j_image_index=j1_series_Civ1(z_index*par_civ1.Dz+SearchRange_z-par_civ1.Dz+iz+1,1) 322 ImageName_A=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i1_series_Civ1(1,ifield),[],j_image_index);% 325 ImageName_A=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i1_series_Civ1(1,ifield),[],j_image_index);% 323 326 A= read_image(ImageName_A,FileType_A); 324 327 ImageName_B=fullfile_uvmat(RootPath_B,SubDir_B,RootFile_B,FileExt_B,NomType_B,i2_series_Civ1(1,ifield),[],j_image_index); 325 328 B= read_image(ImageName_B,FileType_B); 329 else 330 A=zeros(1,size(par_civ1.ImageA,2),size(par_civ1.ImageA,3)); 331 B=zeros(1,size(par_civ1.ImageA,2),size(par_civ1.ImageA,3)); 332 end 326 333 par_civ1.ImageA(2*SearchRange_z+1-par_civ1.Dz+iz,:,:) = A; 327 334 par_civ1.ImageB(2*SearchRange_z+1-par_civ1.Dz+iz,:,:) = B; … … 338 345 Data.Civ1_Y=npy-Data.Civ1_Y+1;%reverse y 339 346 [npz,npy,npx]=size(Data.Civ1_X); 340 Data.Coord_z=SearchRange_z+1:par_civ1.Dz:NbSlice-1;347 341 348 % Data.Coord_y=flip(1:npy); 342 349 % Data.Coord_x=1:npx; … … 422 429 % list the variables to record 423 430 nbvar=length(Data.ListVarName); 424 Data.ListVarName=[Data.ListVarName {'Civ1_U_smooth','Civ1_V_smooth','Civ1_SubRange','Civ1_NbCentres','Civ1_Coord_tps','Civ1_U_tps','Civ1_V_tps'}]; 425 Data.VarDimName=[Data.VarDimName {'nb_vec_1','nb_vec_1',{'nb_coord','nb_bounds','nb_subdomain_1'},'nb_subdomain_1',... 426 {'nb_tps_1','nb_coord','nb_subdomain_1'},{'nb_tps_1','nb_subdomain_1'},{'nb_tps_1','nb_subdomain_1'}}]; 431 Data.ListVarName=[Data.ListVarName {'Civ1_U_smooth','Civ1_V_smooth','Civ1_W_smooth'}]; 432 Data.VarDimName=[Data.VarDimName {{'npz','npy','npx'},{'npz','npy','npx'},{'npz','npy','npx'}}]; 427 433 Data.VarAttribute{nbvar+1}.Role='vector_x'; 428 434 Data.VarAttribute{nbvar+2}.Role='vector_y'; 429 Data.VarAttribute{nbvar+5}.Role='coord_tps'; 430 Data.VarAttribute{nbvar+6}.Role='vector_x'; 431 Data.VarAttribute{nbvar+7}.Role='vector_y'; 432 Data.Civ1_U_smooth=Data.Civ1_U; % zeros(size(Data.Civ1_X)); 433 Data.Civ1_V_smooth=Data.Civ1_V; %zeros(size(Data.Civ1_X)); 435 Data.VarAttribute{nbvar+5}.Role='vector_z'; 436 Data.Civ1_U_smooth=Data.Civ1_U; 437 Data.Civ1_V_smooth=Data.Civ1_V; 438 Data.Civ1_W_smooth=Data.Civ1_W; 434 439 if isfield(Data,'Civ1_FF') 435 440 ind_good=find(Data.Civ1_FF==0); 436 441 else 437 ind_good=1:numel(Data.Civ1_X); 442 disp_uvmat('ERROR','detection of error vectors (FIX operation) needed before PATCH' ,checkrun) 443 return 438 444 end 439 445 if isempty(ind_good) … … 443 449 444 450 % perform Patch calculation using the UVMAT fct 'filter_tps' 445 446 [Data.Civ1_SubRange,Data.Civ1_NbCentres,Data.Civ1_Coord_tps,Data.Civ1_U_tps,Data.Civ1_V_tps,~,Ures, Vres,~,FFres]=... 447 filter_tps([Data.Civ1_X(ind_good) Data.Civ1_Y(ind_good)],Data.Civ1_U(ind_good),Data.Civ1_V(ind_good),[],Data.Patch1_SubDomainSize,Data.Patch1_FieldSmooth,Data.Patch1_MaxDiff); 448 Data.Civ1_U_smooth(ind_good)=Ures;% take the interpolated (smoothed) velocity values for good vectors, keep civ1 data for the other 449 Data.Civ1_V_smooth(ind_good)=Vres; 451 Civ1_Z=0.5*Data.Civ1_W(ind_good); 452 for iz=1:numel(Data.Coord_z) 453 Civ1_Z(iz,:,:)=Civ1_Z(iz,:,:)+Data.Coord_z(iz); 454 end 455 [Data.Civ1_SubRange,Data.Civ1_NbCentres,Data.Civ1_Coord_tps,Data.Civ1_U_tps,Data.Civ1_V_tps,Data.Civ1_W_tps,... 456 Data.Civ1_U_smooth(ind_good),Data.Civ1_V_smooth(ind_good),Data.Civ1_V_smooth(ind_good),FFres]=... 457 filter_tps_3D([Data.Civ1_X(ind_good) Data.Civ1_Y(ind_good)],Civ_1_Z,Data.Civ1_U(ind_good),Data.Civ1_V(ind_good),Data.Civ1_W(ind_good),Data.Patch1_SubDomainSize,Data.Patch1_FieldSmooth,Data.Patch1_MaxDiff); 450 458 Data.Civ1_FF(ind_good)=uint8(FFres); 451 459 time_patch1=toc(tstart_patch1); … … 778 786 ibx2=floor(par_civ.CorrBoxSize(1)/2); 779 787 iby2=floor(par_civ.CorrBoxSize(2)/2); 780 isx2= floor(par_civ.SearchBoxSize(1)/2);781 isy2= floor(par_civ.SearchBoxSize(2)/2);782 isz2= floor(par_civ.SearchBoxSize(3)/2);788 isx2=par_civ.SearchRange(1); 789 isy2=par_civ.SearchRange(2); 790 isz2=par_civ.SearchRange(3); 783 791 kref=isz2+1;%middle index of the z slice 784 792 shiftx=round(par_civ.SearchBoxShift(:,1));%use the input shift estimate, rounded to the next integer value … … 891 899 % end 892 900 893 npxycorr= par_civ.SearchBoxSize(1:2)-par_civ.CorrBoxSize(1:2)+1;894 result_conv=zeros([ par_civ.SearchBoxSize(3)npxycorr]);%initialise the conv product895 max_xy=zeros( par_civ.SearchBoxSize(3),1);%initialise the max correlation vs z901 npxycorr=2*par_civ.SearchRange(1:2)+1; 902 result_conv=zeros([2*par_civ.SearchRange(3)+1 npxycorr]);%initialise the conv product 903 max_xy=zeros(2*par_civ.SearchRange(3)+1,1);%initialise the max correlation vs z 896 904 xk=ones(npz,1);%initialise the x displacement corresponding to the max corr 897 905 yk=ones(npz,1);%initialise the y displacement corresponding to the max corr
Note: See TracChangeset
for help on using the changeset viewer.