Changeset 1180 for trunk/src/series
- Timestamp:
- Mar 27, 2025, 5:59:21 PM (3 weeks ago)
- Location:
- trunk/src/series
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/civ_3D.m
r1165 r1180 1152 1152 end 1153 1153 if isempty(r) 1154 disp lay('wrong pair mode input option')1154 disp('wrong pair mode input option') 1155 1155 else 1156 1156 ind1=stra2num(r.num1); -
trunk/src/series/civ_input.m
r1177 r1180 1378 1378 [Path,ref.subdir,File,ref.num1,ref.num2,ref.num_a,ref.num_b,ref.ext,ref.nom_type]=fileparts_uvmat(fileinput); 1379 1379 ref.filebase=fullfile(Path,File); 1380 % ref.num_a=stra2num(str_a); 1381 % ref.num_b=stra2num(str_b); 1382 % ref.num1=str2double(field_count); 1383 % ref.num2=str2double(str2); 1384 browse=[];%initialisation 1380 1381 %browse=[];%initialisation 1385 1382 if ~isequal(ref.ext,'.nc') 1386 1383 msgbox_uvmat('ERROR','the reference file must be in netcdf format (*.nc)') -
trunk/src/series/civ_series.m
r1178 r1180 254 254 end 255 255 end 256 257 %% File relabeling documented by the xml file (e.g. PCO) 256 258 CheckRelabel=isfield(Param,'FileSeries' );%=true for index relabeling (PCO) 257 259 … … 340 342 ImageName_A=Param.ActionInput.RefFile; 341 343 elseif CheckRelabel 342 [RootFile,F ileIndexString,FrameIndex_A]=index2filename(Param.FileSeries,i1_series_Civ1(ifield),j1_series_Civ1(ifield),MaxIndex_j);343 ImageName_A=fullfile(RootPath_A,SubDir_A, [RootFile FileIndexString FileExt_A]);344 [RootFile,FrameIndex_A]=index2filename(Param.FileSeries,i1_series_Civ1(ifield),j1_series_Civ1(ifield),MaxIndex_j); 345 ImageName_A=fullfile(RootPath_A,SubDir_A,RootFile); 344 346 else 345 347 ImageName_A=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i1_series_Civ1(ifield),[],j1_series_Civ1(ifield)); … … 355 357 FileType_A=FileInfo_A.FileType; 356 358 if isempty(Time) && ~isempty(find(strcmp(FileType_A,{'mmreader','video','cine_phantom','telopsIR'}), 1))% case of video input 357 Time=zeros(FileInfo_A.NumberOfFrames+1,2); 359 Time=zeros(FileInfo_A.NumberOfFrames+1,2); 358 360 Time(:,2)=(0:1/FileInfo_A.FrameRate:(FileInfo_A.NumberOfFrames)/FileInfo_A.FrameRate)'; 359 360 361 361 if ~isempty(j1_series_Civ1) && j1_series_Civ1~=1 362 Time=Time'; 363 end 362 364 end 363 365 if ~isempty(FileType_A) && isempty(Time)% Time = index i +0.001 index j by default … … 378 380 time_input=toc(tsart_input); 379 381 end 380 if CheckRelabel381 [RootFile,FileIndexString,FrameIndex_B]=index2filename(Param.FileSeries,i1_series_Civ1(ifield),j1_series_Civ1(ifield),MaxIndex_j);382 ImageName_B=fullfile(RootPath_B,SubDir_B,[RootFile FileIndexString FileExt_B]);383 else384 ImageName_B=fullfile_uvmat(RootPath_B,SubDir_B,RootFile_B,FileExt_B,NomType_B,i2_series_Civ1(ifield),[],j2_series_Civ1(ifield));385 FrameIndex_B=FrameIndex_B_Civ1(ifield);386 end382 if CheckRelabel 383 [RootFile,FrameIndex_B]=index2filename(Param.FileSeries,i2_series_Civ1(ifield),j2_series_Civ1(ifield),MaxIndex_j); 384 ImageName_B=fullfile(RootPath_B,SubDir_B,RootFile); 385 else 386 ImageName_B=fullfile_uvmat(RootPath_B,SubDir_B,RootFile_B,FileExt_B,NomType_B,i2_series_Civ1(ifield),[],j2_series_Civ1(ifield)); 387 FrameIndex_B=FrameIndex_B_Civ1(ifield); 388 end 387 389 if isempty(FileType_B)% determine the image type for the first field 388 390 [FileInfo_B,VideoObject_B]=get_file_info(ImageName_B); … … 394 396 end 395 397 [par_civ1.ImageB,VideoObject_B] = read_image(ImageName_B,FileType_B,VideoObject_B,FrameIndex_B); 396 398 397 399 catch ME % display errors in reading input images 398 400 if ~isempty(ME.message) … … 627 629 ImageName_A_Civ2=Param.ActionInput.RefFile; 628 630 elseif CheckRelabel 629 [RootFile,FileIndexString,FrameIndex_A_2]=index2filename(Param.FileSeries,i1_series_Civ2(ifield),j1_series_Civ2(ifield),MaxIndex_j);630 ImageName_A_Civ2=fullfile(RootPath_A,SubDir_A, [RootFile FileIndexString FileExt_A]);631 631 [RootFile,FrameIndex_A_2]=index2filename(Param.FileSeries,i1_series_Civ2(ifield),j1_series_Civ2(ifield),MaxIndex_j); 632 ImageName_A_Civ2=fullfile(RootPath_A,SubDir_A,RootFile); 633 else 632 634 ImageName_A_Civ2=fullfile_uvmat(RootPath_A,SubDir_A,RootFile_A,FileExt_A,NomType_A,i1_civ2,[],j1_civ2); 633 635 FrameIndex_A_2=FrameIndex_A_Civ2(ifield); … … 639 641 end 640 642 if CheckRelabel 641 [RootFile,FileIndexString,FrameIndex_B_2]=index2filename(Param.FileSeries,i2_civ2,j2_civ2,MaxIndex_j); 642 ImageName_B_Civ2=fullfile(RootPath_B,SubDir_B,[RootFile FileIndexString FileExt_B]); 643 else 644 645 646 ImageName_B_Civ2=fullfile_uvmat(RootPath_B,SubDir_B,RootFile_B,FileExt_B,NomType_B,i2_civ2,[],j2_civ2); 647 FrameIndex_B_2=FrameIndex_B_Civ2(ifield); 643 [RootFile,FrameIndex_B_2]=index2filename(Param.FileSeries,i2_civ2,j2_civ2,MaxIndex_j); 644 ImageName_B_Civ2=fullfile(RootPath_B,SubDir_B,RootFile); 645 else 646 ImageName_B_Civ2=fullfile_uvmat(RootPath_B,SubDir_B,RootFile_B,FileExt_B,NomType_B,i2_civ2,[],j2_civ2); 647 FrameIndex_B_2=FrameIndex_B_Civ2(ifield); 648 648 end 649 649 if strcmp(ImageName_B_Civ2,ImageName_B) && isequal(FrameIndex_B_2,FrameIndex_B) -
trunk/src/series/sub_background.m
r1179 r1180 78 78 ParamOut.VelType='off';% menu for selecting the velocity type (options 'off'/'one'/'two', 'off' by default) 79 79 ParamOut.FieldName='off';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default) 80 ParamOut.FieldTransform = 'off';%can use a transform function 81 ParamOut.ProjObject='off';%cannot use projection object(option 'off'/'on', 82 ParamOut.Mask='o n';%canuse mask option (option 'off'/'on', 'off' by default)80 ParamOut.FieldTransform = 'off';%can use a transform function (option 'off'/'on','off' by default) 81 ParamOut.ProjObject='off';%cannot use projection object(option 'off'/'on','off' by default) 82 ParamOut.Mask='off';%cannot use mask option (option 'off'/'on', 'off' by default) 83 83 ParamOut.OutputDirExt='.sback';%set the output dir extension 84 84 ParamOut.OutputFileMode='NbInput';% '=NbInput': 1 output file per input file index, '=NbInput_i': 1 file per input file index i, '=NbSlice': 1 file per slice … … 250 250 %% Input file info 251 251 if CheckRelabel 252 [RootFileOut,FileIndexString]=index2filename(Param.FileSeries,Param.IndexRange.first_i,j_indices(1),NbField_j);253 FirstFileName=fullfile(RootPath,SubDir,[RootFileOut FileIndexString FileExt]);254 else 255 FirstFileName=fullfile_uvmat(RootPath,SubDir,RootFile,FileExt,NomType,Param.IndexRange.first_i,[],j_indices(1));%get first file name256 RootFileOut=RootFile;252 [RootFileOut,frame_index]=index2filename(Param.FileSeries,Param.IndexRange.first_i,j_indices(1),NbField_j); 253 FirstFileName=fullfile(RootPath,SubDir,RootFileOut); 254 else 255 FirstFileName=fullfile_uvmat(RootPath,SubDir,RootFile,FileExt,NomType,Param.IndexRange.first_i,[],j_indices(1));%get first file name 256 RootFileOut=RootFile; 257 257 end 258 258 [FileInfo,MovieObject]=get_file_info(FirstFileName); 259 259 FileType=FileInfo.FileType; 260 if isfield(FileInfo,'NumberOfFrames') && FileInfo.NumberOfFrames >1 261 if isempty(regexp(NomType,'1$', 'once'))% no file indexing 262 frame_index=i_indices;% the index i denotes the frame number in a movie, no index j 260 if ~CheckRelabel 261 if isfield(FileInfo,'NumberOfFrames') && FileInfo.NumberOfFrames >1 262 if isempty(regexp(NomType,'1$', 'once'))% no file indexing 263 frame_index=i_indices;% the index i denotes the frame number in a movie, no index j 264 else 265 frame_index=j_indices;% the index j denotes the frame number in a movie 266 MovieObject=[]; %not a single video object 267 end 263 268 else 264 frame_index=j_indices;% the index j denotes the frame number in a movie 265 MovieObject=[]; %not a single video object 266 end 267 else 268 frame_index=ones(1,nbfield); 269 frame_index=ones(1,nbfield); 270 end 269 271 end 270 272 … … 288 290 289 291 %% prealocate memory for the sliding background 290 Ak=zeros(FileInfo.Height,FileInfo.Width,nbaver_ima,['uint' num2str(FileInfo.BitDepth)]); %prealocate memory 292 Ak=zeros(FileInfo.Height,FileInfo.Width,nbaver_ima,['uint' num2str(FileInfo.BitDepth)]); %prealocate memory 291 293 292 294 %% selection of frame indices 293 if Param.ActionInput.CheckVolume 295 if Param.ActionInput.CheckVolume 294 296 nbfield=floor(nbfield/NbSlice_j)*NbSlice_j;% truncate the total number of frames in case of incomplete series 295 297 indselect=1:nbfield; 296 297 298 else 299 298 indselect=reshape(indselect,NbSlice_j,[]); 299 NbSlice=NbSlice_j; 300 else 301 NbSlice=NbSlice_i; 300 302 nbfield=floor(nbfield/NbSlice)*NbSlice;% truncate the total number of frames in case of incomplete series 301 303 indselect=reshape(1:nbfield,NbSlice,[]); 302 304 for j_slice=1:NbSlice 303 indselect(j_slice,:)=j_slice:NbSlice:nbfield;% select file indices of the slice305 indselect(j_slice,:)=j_slice:NbSlice:nbfield;% select file indices of the slice 304 306 end 305 307 end … … 313 315 %filename=filecell{1,ifile}; 314 316 if CheckRelabel 315 [ RootFile,FileIndexString,FrameIndex]=index2filename(Param.FileSeries,i_indices(ifile),j_indices(ifile),NbField_j);316 filename=fullfile(RootPath,SubDir,[RootFile FileIndexString FileExt]);317 [filename,FrameIndex]=index2filename(Param.FileSeries,i_indices(ifile),j_indices(ifile),NbField_j); 318 filename=fullfile(RootPath,SubDir,filename); 317 319 else 318 320 filename=fullfile_uvmat(RootPath,SubDir,RootFile,FileExt,NomType,i_indices(ifile),[],j_indices(ifile)); … … 368 370 ifile=indselect(j_slice,ifield+iburst+step*halfnbaver); 369 371 if CheckRelabel 370 [ RootFile,FileIndexString,FrameIndex]=index2filename(Param.FileSeries,i_indices(ifile),j_indices(ifile),NbField_j);371 filename=fullfile(RootPath,SubDir, [RootFile FileIndexString FileExt]);372 [filename,FrameIndex]=index2filename(Param.FileSeries,i_indices(ifile),j_indices(ifile),NbField_j); 373 filename=fullfile(RootPath,SubDir,filename); 372 374 else 373 375 filename=fullfile_uvmat(RootPath,SubDir,RootFile,FileExt,NomType,i_indices(ifile),[],j_indices(ifile));
Note: See TracChangeset
for help on using the changeset viewer.