Changeset 1202 for trunk/src/series
- Timestamp:
- Mar 24, 2026, 3:46:06 PM (2 days ago)
- Location:
- trunk/src/series
- Files:
-
- 2 edited
-
civ2vel_3C.m (modified) (3 diffs)
-
civ_series.m (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/civ2vel_3C.m
r1201 r1202 1 %'civ2vel_3C': combine velocity fields from two cameras to get three velocity components1 %'civ2vel_3C': combine the civ velocity fields from two cameras to get three velocity components 2 2 %------------------------------------------------------------------------ 3 % function ParamOut=civ2vel_3C(Param)3 % function GUIParam=civ2vel_3C(Param) 4 4 % 5 5 %OUTPUT 6 % ParamOut: sets options in the GUI series.fig needed for the function6 % GUIParam: sets options in the GUI series.fig needed for the function 7 7 % 8 8 %INPUT: … … 51 51 %======================================================================= 52 52 53 function ParamOut=civ2vel_3C(Param)53 function GUIParam=civ2vel_3C(Param) 54 54 55 55 %% set the input elements needed on the GUI series when the function is selected in the menu ActionName or InputTable refreshed 56 56 if isstruct(Param) && isequal(Param.Action.RUN,0) 57 ParamOut.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default) 58 ParamOut.WholeIndexRange='off';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default) 59 ParamOut.NbSlice='off'; %nbre of slices ('off' by default) 60 ParamOut.VelType='off';% menu for selecting the velocity type (options 'off'/'one'/'two', 'off' by default) 61 ParamOut.FieldName='off';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default) 62 ParamOut.FieldTransform = 'off';%use the phys transform function without choice 63 %ParamOut.TransformPath=fullfile(fileparts(which('uvmat')),'transform_field');% path to transform functions (needed for compilation only) 64 ParamOut.ProjObject='on';%can use projection object(option 'off'/'on', 65 ParamOut.Mask='off';%can use mask option (option 'off'/'on', 'off' by default) 66 ParamOut.OutputDirExt='.vel3C';%set the output dir extension 67 ParamOut.OutputSubDirMode='two'; % the two first input lines are used to define the output subfolder 68 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 57 GUIParam.NbSlice='off'; %nbre of slices ('off' by default) !!VERIFIER 58 GUIParam.VelType='off';% menu for selecting the velocity type (options 'off'/'one'/'two', 'off' by default)!!VERIFIER 59 GUIParam.FieldName='off';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default) 60 GUIParam.ProjObject='on';%can use projection object(option 'off'/'on', 61 GUIParam.Mask='off';%can use mask option (option 'off'/'on', 'off' by default)!!VERIFIER 62 GUIParam.OutputDirExt='.vel3C';%set the output dir extension 63 GUIParam.OutputSubDirMode='two'; % the two first input lines are used to define the output subfolder 64 GUIParam.OutputFileMode='NbInput';% '=NbInput': 1 output file per input file index, '=NbInput_i': 1 file per input file index i, '=NbSlice': 1 file per slice 69 65 %check the input files 70 ParamOut.CheckOverwriteVisible='on'; % manage the overwrite of existing files (default=1)66 GUIParam.CheckOverwriteVisible='on'; % manage the overwrite of existing files (default=1) 71 67 first_j=[]; 72 68 if size(Param.InputTable,1)<2 73 msgbox_uvmat('WARNING',['two or three input file series are needed']) 69 msgbox_uvmat('ERROR','two or three input file series are needed') 70 return 71 end 72 if ~isfield(Param,'ProjObject') 73 msgbox_uvmat('ERROR','You need a projection object of type plane') 74 return 74 75 end 75 76 if isfield(Param.IndexRange,'first_j'); first_j=Param.IndexRange.first_j; end … … 79 80 FirstFileName=fullfile_uvmat(Param.InputTable{1,1},Param.InputTable{1,2},Param.InputTable{1,3},... 80 81 Param.InputTable{1,5},Param.InputTable{1,4},i1,i2,j1,j2); 81 if ~exist(FirstFileName,'file') 82 msgbox_uvmat('WARNING',['the first input file ' FirstFileName ' does not exist']) 83 elseif isequal(size(Param.InputTable,1),1) && ~isfield(Param,'ProjObject') 84 msgbox_uvmat('WARNING','You may need a projection object of type plane for merge_proj') 85 end 86 return 82 if exist(FirstFileName,'file') 83 FileInfo=get_file_info(FirstFileName); 84 if ~strcmp(FileInfo.FileType,'civdata') 85 msgbox_uvmat('ERROR','civ data are needed as input') 86 return 87 end 88 else 89 msgbox_uvmat('ERROR',['the first input file ' FirstFileName ' does not exist']) 90 return 91 end 87 92 end 88 93 89 94 %%%%%%%%%%%% STANDARD PART (DO NOT EDIT) %%%%%%%%%%%% 90 ParamOut=[]; %default output95 GUIParam=[]; %default output 91 96 %% read input parameters from an xml file if input is a file name (batch mode) 92 97 checkrun=1; -
trunk/src/series/civ_series.m
r1201 r1202 1 1 %'civ_series': PIV function activated by the general GUI series 2 2 % --- call the sub-functions: 3 % civ: PIV function itself 4 % detect_false: put a flag to false vectors after detection by various criteria 5 % filter_tps: make interpolation-smoothing 3 % 'parciv.m' PIV function itself, adpated to parallel processing (loop 4 % parfor instead of for) 5 % 'civ.m': same as parciv, but with usual loop 'for', suitable for cluster 6 % dispatch (no parallel processing inside functions) 7 % filter_tps: make interpolation-smoothing by thin plate spline method 6 8 %------------------------------------------------------------------------ 7 % function [ Data,errormsg,result_conv]= civ_series(Param)9 % function [GUIParam,errormsg]= civ_series(Param) 8 10 % 9 11 %OUTPUT 10 % Data=structure containing the PIV results and information on the processing parameters 11 % errormsg=error message char string, decd ..fault='' 12 % resul_conv: image inter-correlation function for the last grid point (used for tests) 13 % 12 % GUIParam=structure containing the input parameters sent to the GUI series in the interactive selection phase 14 13 %INPUT: 15 14 % Param: Matlab structure of input parameters … … 46 45 %======================================================================= 47 46 48 function [ Data,errormsg]= civ_series(Param)47 function [GUIParam,errormsg]= civ_series(Param) 49 48 errormsg=''; 50 49 GUIParam=[]; 51 50 %% set the input elements needed on the GUI series when the action is selected in the menu ActionName or InputTable refreshed 52 51 if isstruct(Param) && isequal(Param.Action.RUN,0)% function activated from the GUI series but not RUN 53 if 0==1 %never satisfied but trigger compilation with the appropriate transform functions ('eval' inactive for compilation)54 ima_rescale55 end56 52 path_series=fileparts(which('series')); 57 53 addpath(fullfile(path_series,'series')) 58 Data=civ_input(Param);% introduce the civ parameters using the GUI civ_input54 GUIParam=civ_input(Param);% introduce the civ parameters using the GUI civ_input 59 55 % TODO: change from guide to App: modify the input procedure, adapt read_GUI function 60 56 %App=civ_input_App 61 57 %Data=civ_input_App(Param);% introduce the civ parameters using the GUI civ_input 62 58 % if isempty(App) 63 % Data=Param;% if civ_input has been cancelled, keep previous parameters59 % GUIParam=Param;% if civ_input has been cancelled, keep previous parameters 64 60 % end 65 Data.Program=mfilename;%gives the name of the current function66 Data.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)67 Data.WholeIndexRange='off';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)68 Data.NbSlice='off'; %nbre of slices ('off' by default)69 Data.VelType='off';% menu for selecting the velocity type (options 'off'/'one'/'two', 'off' by default)70 Data.FieldName='on';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default)71 Data.FieldTransform = 'off';%can use a transform function72 Data.ProjObject='off';%can use projection object(option 'off'/'on',73 Data.Mask='off';%can use mask option (option 'off'/'on', 'off' by default)74 Data.OutputDirExt='.civ';%set the output dir extension75 Data.OutputSubDirMode='last'; %select the last subDir in the input table as root of the output subdir name (option 'all'/'first'/'last', 'all' by default)76 Data.OutputFileMode='NbInput_i';% one output file expected per value of i index (used for waitbar)77 Data.CheckOverwriteVisible='on'; % manage the overwrite of existing files (default=1)78 if isfield( Data,'ActionInput') && isfield(Data.ActionInput,'PairIndices') && isequal(Data.ActionInput.PairIndices.ListPairMode,'pair j1-j2')79 Data.IndexRange_j='off';%no j index display in series61 GUIParam.Program=mfilename;%gives the name of the current function 62 GUIParam.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default) 63 GUIParam.WholeIndexRange='off';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default) 64 GUIParam.NbSlice='off'; %nbre of slices ('off' by default) 65 GUIParam.VelType='off';% menu for selecting the velocity type (options 'off'/'one'/'two', 'off' by default) 66 GUIParam.FieldName='on';% menu for selecting the field (s) in the input file(options 'off'/'one'/'two', 'off' by default) 67 GUIParam.FieldTransform = 'off';%can use a transform function 68 GUIParam.ProjObject='off';%can use projection object(option 'off'/'on', 69 GUIParam.Mask='off';%can use mask option (option 'off'/'on', 'off' by default) 70 GUIParam.OutputDirExt='.civ';%set the output dir extension 71 GUIParam.OutputSubDirMode='last'; %select the last subDir in the input table as root of the output subdir name (option 'all'/'first'/'last', 'all' by default) 72 GUIParam.OutputFileMode='NbInput_i';% one output file expected per value of i index (used for waitbar) 73 GUIParam.CheckOverwriteVisible='on'; % manage the overwrite of existing files (default=1) 74 if isfield(GUIParam,'ActionInput') && isfield(GUIParam.ActionInput,'PairIndices') && isequal(GUIParam.ActionInput.PairIndices.ListPairMode,'pair j1-j2') 75 GUIParam.IndexRange_j='off';%no j index display in series 80 76 else 81 Data.IndexRange_j='on';% j index display in series if relevant77 GUIParam.IndexRange_j='on';% j index display in series if relevant 82 78 end 83 79 return … … 316 312 end 317 313 end 318 if ~CheckOverwrite && exist(ncfile_out,'file') 314 if ~CheckOverwrite 315 [Data,~,~,errormsg]=nc2struct(ncfile_out,'ListGlobalAttribute','CivStage'); 316 if isempty(errormsg) 319 317 disp(['existing output file ' ncfile_out ' already exists, skip to next field']) 320 318 continue% skip iteration if the mode overwrite is desactivated and the result file already exists 321 end322 %end319 end 320 end 323 321 ImageName_A='';ImageName_B='';%default 324 322 VideoObject_A=[];VideoObject_B=[]; … … 533 531 [Civ_X,Civ_Y,Civ_U,Civ_V,Civ_C,Civ_FF,~, errormsg] = civ (par_civ1);% single processor used in cluster 534 532 else 535 [Civ_X,Civ_Y,Civ_U,Civ_V,Civ_C,Civ_FF, errormsg] = parciv (par_civ1);%use parfor loop533 [Civ_X,Civ_Y,Civ_U,Civ_V,Civ_C,Civ_FF,~,errormsg] = parciv (par_civ1);%use parfor loop 536 534 end 537 535 Civ_X_shifted=Civ_X-0.5+Civ_U/2;% get the exact positions … … 862 860 [Civ_X,Civ_Y,Civ_U,Civ_V,Civ_C,Civ_FF,~, errormsg] = civ (par_civ2);% single processor used in cluster 863 861 else 864 [Civ_X,Civ_Y,Civ_U,Civ_V,Civ_C,Civ_FF, errormsg] = parciv (par_civ2);%use parfor loop862 [Civ_X,Civ_Y,Civ_U,Civ_V,Civ_C,Civ_FF,~, errormsg] = parciv (par_civ2);%use parfor loop 865 863 end 866 864 Civ_X_shifted=Civ_X-0.5+Civ_U/2;% get the exact positions
Note: See TracChangeset
for help on using the changeset viewer.
