Changeset 1180 for trunk/src/series/sub_background.m
- Timestamp:
- Mar 27, 2025, 5:59:21 PM (3 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.