Changeset 993 for trunk/src/series
- Timestamp:
- Feb 6, 2017, 11:29:01 AM (8 years ago)
- Location:
- trunk/src/series
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/civ2vel_3C.m
r990 r993 358 358 end 359 359 end 360 %remove wrong vector 361 temp=find(Data{1}.FF==0); 362 X1=Data{1}.X(temp); 363 Y1=Data{1}.Y(temp); 364 U1=Data{1}.U(temp); 365 V1=Data{1}.V(temp); 366 360 %remove wrong vector 361 if isfield(Data{1},'FF') 362 temp=find(Data{1}.FF==0); 363 X1=Data{1}.X(temp); 364 Y1=Data{1}.Y(temp); 365 U1=Data{1}.U(temp); 366 V1=Data{1}.V(temp); 367 else 368 X1=Data{1}.X; 369 Y1=Data{1}.Y; 370 U1=Data{1}.U; 371 V1=Data{1}.V; 372 end 367 373 Ua=griddata(X1,Y1,U1,Xa,Ya); 368 374 Va=griddata(X1,Y1,V1,Xa,Ya); 369 370 [Ua,Va,Xa,Ya]=Ud2U(XmlData{1}.GeometryCalib,Xa,Ya,Ua,Va); % convert Xd data to X 375 [Ua,Va,Xa,Ya]=Ud2U(XmlData{1}.GeometryCalib,Xa,Ya,Ua,Va); % convert Xd data to X 371 376 [A]=get_coeff(XmlData{1}.GeometryCalib,Xa,Ya,XI,YI,ZI); %get coef A~ 372 377 373 %remove wrong vector 374 temp=find(Data{2}.FF==0); 375 X2=Data{2}.X(temp); 376 Y2=Data{2}.Y(temp); 377 U2=Data{2}.U(temp); 378 V2=Data{2}.V(temp); 378 %remove wrong vector 379 if isfield(Data{1},'FF') 380 temp=find(Data{2}.FF==0); 381 X2=Data{2}.X(temp); 382 Y2=Data{2}.Y(temp); 383 U2=Data{2}.U(temp); 384 V2=Data{2}.V(temp); 385 else 386 X2=Data{2}.X; 387 Y2=Data{2}.Y; 388 U2=Data{2}.U; 389 V2=Data{2}.V; 390 end 379 391 Ub=griddata(X2,Y2,U2,Xb,Yb); 380 392 Vb=griddata(X2,Y2,V2,Xb,Yb); 381 382 [Ub,Vb,Xb,Yb]=Ud2U(XmlData{2}.GeometryCalib,Xb,Yb,Ub,Vb); % convert Xd data to X393 [Ub,Vb,Xb,Yb]=Ud2U(XmlData{2}.GeometryCalib,Xb,Yb,Ub,Vb); % convert Xd data to X 394 383 395 [B]=get_coeff(XmlData{2}.GeometryCalib,Xb,Yb,XI,YI,ZI); %get coef B~ 384 396 385 397 386 398 % System to solve -
trunk/src/series/civ_series.m
r981 r993 60 60 Data.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default) 61 61 Data.WholeIndexRange='off';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default) 62 if isfield(Data,'ActionInput') && isfield(Data.ActionInput,'PairIndices')&& strcmp(Data.ActionInput.PairIndices.ListPairMode,'pair j1-j2')63 Data.Desable_j_index='on';% hide the j index in series (set by the pair choice in civ_input)64 end62 % if isfield(Data,'ActionInput') && isfield(Data.ActionInput,'PairIndices')&& strcmp(Data.ActionInput.PairIndices.ListPairMode,'pair j1-j2') 63 % Data.Desable_j_index='on';% hide the j index in series (set by the pair choice in civ_input) 64 % end 65 65 Data.NbSlice='off'; %nbre of slices ('off' by default) 66 66 Data.VelType='off';% menu for selecting the velocity type (options 'off'/'one'/'two', 'off' by default) … … 73 73 Data.OutputFileMode='NbInput_i';% one output file expected per value of i index (used for waitbar) 74 74 Data.CheckOverwriteVisible='on'; % manage the overwrite of existing files (default=1) 75 if isequal(Data.ActionInput.PairIndices.ListPairMode,'pair j1-j2') 76 if isfield(Data.ActionInput.PairIndices,'ListPairCiv2') 77 str_civ=Data.ActionInput.PairIndices.ListPairCiv2; 78 else 79 str_civ=Data.ActionInput.PairIndices.ListPairCiv1; 80 end 81 r=regexp(str_civ,'^j= (?<num1>[a-z])-(?<num2>[a-z])','names'); 82 if isempty(r) 83 r=regexp(str_civ,'^j= (?<num1>[A-Z])-(?<num2>[A-Z])','names'); 84 if isempty(r) 85 r=regexp(str_civ,'^j= (?<num1>\d+)-(?<num2>\d+)','names'); 86 end 87 end 88 if ~isempty(r) 89 Data.j_index_1=stra2num(r.num1); 90 Data.j_index_2=stra2num(r.num2); 91 end 92 end 75 93 return 76 94 end … … 200 218 end 201 219 if isempty(i1_series_Civ1)||(~isempty(PairCiv2) && isempty(i1_series_Civ2)) 202 disp_uvmat('ERROR','no image pair fo civ in the input file index range',checkrun)220 disp_uvmat('ERROR','no image pair for civ in the input file index range',checkrun) 203 221 return 204 222 end … … 208 226 try 209 227 if Param.ActionInput.CheckCiv1% Civ1 is performed 228 first_ima=1; 210 229 ImageName_A=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i1_series_Civ1(1),[],j1_series_Civ1(1)); 211 if ~exist(ImageName_A,'file') 230 if checkrun 231 if ~exist(ImageName_A,'file') 212 232 disp_uvmat('ERROR',['first input image ' ImageName_A ' does not exist'],checkrun) 213 233 return 234 end 235 else 236 % for ifile=1:numel(i1_series_Civ1) 237 % if 214 238 end 215 239 [FileInfo_A,VideoObject_A]=get_file_info(ImageName_A); … … 412 436 if ~isempty(ME.message) 413 437 disp_uvmat('ERROR', ['error reading input image: ' ME.message],checkrun) 414 return438 continue 415 439 end 416 440 end … … 1155 1179 [npy,npx]=size(result_conv); 1156 1180 result_conv(result_conv<1)=1; %set to 1 correlation values smaller than 1 (=0 by discretisation, to avoid divergence in the log) 1157 %the following 8 lines are copyright (c) 1998, Uri Shavit, Roi Gurka, Alex Liberzon, Technion ï¿œIsrael Institute of Technology1181 %the following 8 lines are copyright (c) 1998, Uri Shavit, Roi Gurka, Alex Liberzon, Technion ??? Israel Institute of Technology 1158 1182 %http://urapiv.wordpress.com 1159 1183 peaky = y; … … 1192 1216 for j=-1:1 1193 1217 %following 15 lines based on 1194 %H. Nobach ï¿œM. Honkanen (2005)1218 %H. Nobach ??? M. Honkanen (2005) 1195 1219 %Two-dimensional Gaussian regression for sub-pixel displacement 1196 1220 %estimation in particle image velocimetry or particle position 1197 1221 %estimation in particle tracking velocimetry 1198 %Experiments in Fluids (2005) 38: 511 ï¿œ5151222 %Experiments in Fluids (2005) 38: 511???515 1199 1223 c10(j+2,i+2)=i*log(result_conv(y+j, x+i)); 1200 1224 c01(j+2,i+2)=j*log(result_conv(y+j, x+i)); -
trunk/src/series/extract_multitif_parallel.m
r991 r993 95 95 return 96 96 end 97 xmlinput=uigetfile_uvmat('pick xml file for timing',fileparts(fileparts(FirstFileName)),'.xml'); 98 [tild,ParamOut.ActionInput.XmlFile]=fileparts(xmlinput); 99 ParamOut.ActionInput.XmlFile 100 97 ParamOut.ActionInput.XmlFile=uigetfile_uvmat('pick xml file for timing',fileparts(fileparts(FirstFileName)),'.xml'); 101 98 return 102 99 end … … 140 137 141 138 %% Timing 142 XmlInputFile=fullfile(Param.InputTable{1,1},[Param.ActionInput.XmlFile '.xml']) 143 XmlInput=imadoc2struct(XmlInputFile,'Camera'); 144 145 %% create the xml file of PCO camera 139 XmlInputFile=Param.ActionInput.XmlFile; 140 [XmlInput,errormsg]=imadoc2struct(XmlInputFile,'Camera'); 141 if ~isempty(errormsg) 142 disp(['bad xml input file: ' errormsg]) 143 return 144 end 145 ImagesPerLevel=size(XmlInput.Time,2)-1;%100;%use the xmlinformation to get the nbre of j indices 146 147 %% create the xml file of PCO camera if it does not exist 148 Newxml=fullfile(Param.InputTable{1,1},[Param.InputTable{1,2} '.xml']); 149 if ~exist(Newxml,'file') 146 150 XmlInput.Camera.CameraName='PCO'; 147 t=struct2xml(XmlInput.Camera); 151 XmlInput=rmfield(XmlInput,'Time'); 152 XmlInput=rmfield(XmlInput,'TimeUnit'); 153 t=struct2xml(XmlInput); 148 154 t=set(t,1,'name','ImaDoc'); 149 save(t,fullfile(Param.InputTable{1,1},[Param.InputTable{1,2} '.xml'])) 155 save(t,Newxml); 156 end 150 157 151 158 %% Main loop 152 159 153 ImagesPerLevel=size(XmlInput.Time,2)-1;%100; 160 154 161 % count=0; 155 162 %count=316;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CORRECTION EXP08: 4684 images -> start at 316 start 67->_11_1 156 163 %count=1934%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CORRECTION EXP07: 3066 images 157 164 %% loop on the files 158 %for ifile=1:numel(ListFile) 159 % update_waitbar(WaitbarHandle,ifile/numel(ListFile)) 160 % if ~isempty(RUNHandle)&& ~strcmp(get(RUNHandle,'BusyAction'),'queue') 161 % disp('program stopped by user') 162 % break 163 % end 164 % ImageName=fullfile(DirImages,ListFile{ifile}); 165 % NbFrames=numel(imfinfo(ImageName)); 166 % loop on the frames within the tiff file 165 % include the first tiff file with no index in the first iteration 167 166 if Param.IndexRange.first_i==1% first slice of processing 168 167 firstindex=0; 169 168 count=0; 170 % count=3;171 169 else 172 170 firstindex=Param.IndexRange.first_i; … … 174 172 NbFrames=numel(imfinfo(ImageName)); 175 173 count=Param.IndexRange.first_i*NbFrames; 176 % count=Param.IndexRange.first_i*NbFrames+3;177 174 end 178 175 for ifile=firstindex:Param.IndexRange.last_i 179 176 if firstindex==0 && ifile==0% first slice of processing 180 177 ImageName=fullfile(Param.InputTable{1,1},Param.InputTable{1,2},'im.tif') 181 178 else 182 179 ImageName=fullfile(Param.InputTable{1,1},Param.InputTable{1,2},['im@' num2str(ifile,'%04d') '.tif']) … … 202 199 end 203 200 end 204 %end 205 206 % for ifile=1:numel(ListFile) 207 % update_waitbar(WaitbarHandle,ifile/numel(ListFile)) 208 % if ~isempty(RUNHandle)&& ~strcmp(get(RUNHandle,'BusyAction'),'queue') 209 % disp('program stopped by user') 210 % break 211 % end 212 % ImageName=fullfile(DirImages,ListFile{ifile}); 213 % NbFrames=numel(imfinfo(ImageName)); 214 % % loop on the frames within the tiff file 215 % for iframe=1:NbFrames 216 % A=imread(ImageName,iframe); 217 % 218 % if isequal(ImagesPerLevel,1)% mode series 219 % i_index=count+1; 220 % OutputFile=fullfile(OutputDir,['img_' num2str(count+1) '.png']); 221 % else % indices i and j 222 % i_index=fix(count/ImagesPerLevel)+1; 223 % j_index=mod(count,ImagesPerLevel)+1; 224 % OutputFile=fullfile(OutputDir,['img_' num2str(i_index) '_' num2str(j_index) '.png']); 225 % end 226 % imwrite(A,OutputFile,'BitDepth',16) 227 % count=count+1; 228 % end 229 % end 230 231 %% create the xml file of PCO camera 232 % XmlInput.Camera.CameraName='PCO'; 233 % t=struct2xml(XmlInput.Camera); 234 % t=set(t,1,'name','ImaDoc'); 235 % save(t,fullfile(Param.InputTable{1,1},'PCO.xml')) 236 237 %% remove initial files if transfer OK 238 % if i_index== (size(XmlInput.Time,1)-1) 239 % 240 % [SUCCESS,MESSAGE]=rmdir(DirImages,'s') 241 % 242 % end 201 202 203
Note: See TracChangeset
for help on using the changeset viewer.