- Timestamp:
- Jul 8, 2024, 11:03:33 PM (6 months ago)
- Location:
- trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/find_imadoc.m
r1152 r1156 30 30 31 31 function XmlFileName=find_imadoc(RootPath,SubDir) 32 33 dotchar=regexp(SubDir,'\.');%detect the dots in the folder name 34 if isempty(dotchar) 35 XmlFileName=fullfile(RootPath,[SubDir '.xml']);36 else %go upward to the root name, stop if an xml file already exists 37 for idot=1:numel(dotchar)38 SubDir=SubDir(1:dotchar(end-idot+1)-1);39 XmlFileName=fullfile(RootPath,[SubDir '.xml']);40 if exist(XmlFileName,'file')41 break32 XmlFileName=fullfile(RootPath,[SubDir '.xml']); 33 if ~exist(XmlFileName,'file') 34 dotchar=regexp(SubDir,'\.');%detect the dots in the folder name 35 if ~isempty(dotchar) 36 for idot=1:numel(dotchar) 37 SubDir=SubDir(1:dotchar(end-idot+1)-1); 38 XmlFileName=fullfile(RootPath,[SubDir '.xml']); 39 if exist(XmlFileName,'file') 40 break 41 end 42 42 end 43 43 end 44 end 45 if ~exist(XmlFileName,'file') 46 XmlFileName='';44 if ~exist(XmlFileName,'file') 45 XmlFileName=''; 46 end 47 47 end 48 48 49 49 50 50 51 -
trunk/src/series.m
r1154 r1156 540 540 function check_input_file_series(handles) 541 541 %------------------------------------------------------------------------ 542 InputTable=get(handles.InputTable,'Data'); 542 InputTable=get(handles.InputTable,'Data');%read the table of input file series 543 543 set(handles.series,'Pointer','watch') % set the mouse pointer to 'watch' 544 544 set(handles.REFRESH,'BackgroundColor',[1 1 0])% set REFRESH button to yellow color (indicate activation) … … 548 548 empty_line(iline)= isempty(cell2mat(InputTable(iline,1:3)));%check the empty lines in the input table 549 549 end 550 if ~isempty(find(empty_line,1)) 550 if ~isempty(find(empty_line,1))%removes the empty lines in the table 551 551 InputTable(empty_line,:)=[]; % remove empty lines 552 552 set(handles.InputTable,'Data',InputTable) … … 579 579 end 580 580 InputFile=fullfile_uvmat('','',InputTable{iview,3},InputTable{iview,5},InputTable{iview,4},i1,[],j1,j2); 581 [RootPath,~,RootFile,i1_series,i2_series,j1_series,j2_series, tild,FileInfo,MovieObject]=...581 [RootPath,~,RootFile,i1_series,i2_series,j1_series,j2_series,~,FileInfo,MovieObject]=... 582 582 find_file_series(fullfile(InputTable{iview,1},InputTable{iview,2}),InputFile); 583 583 end … … 589 589 return 590 590 else 591 display_file_name(handles,fileinput,iview) 591 display_file_name(handles,fileinput,iview)% update the table of input file series, then call update_rootinfo 592 592 end 593 593 else … … 771 771 end 772 772 for ifile=1:min(length(MenuFile),5) 773 eval(['set(handles.MenuFile_' num2str(ifile) ',''Label'',MenuFile{ifile});']) 773 ffname=['MenuFile_' num2str(ifile)]; 774 set(handles.(ffname),'Label',MenuFile{ifile}); 774 775 end 775 776 dir_perso=prefdir; … … 792 793 set(handles.Device,'String',[Device DeviceExt]) 793 794 set(handles.Experiment,'String',[Experiment ExperimentExt]) 794 if ~isempty(regexp(InputTable{1,1},'(^http://)|(^https://)' ))795 if ~isempty(regexp(InputTable{1,1},'(^http://)|(^https://)', 'once')) 795 796 set(handles.OutputPathBrowse,'Value',1)% an output folder needs to be specified for OpenDAP data 796 797 end … … 814 815 %% initiate input file series and refresh the current field view: 815 816 update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileInfo,MovieObject,iview); 817 816 818 %% enable field and veltype menus, in accordance with the current action 817 819 ActionName_Callback([],[], handles) … … 828 830 %------------------------------------------------------------------------ 829 831 InputTable=get(handles.InputTable,'Data'); 832 833 %% make the j indices visible if relevant 834 if (isempty(j1_series)|| ~isempty(j2_series))% no j series or j1-j2 pair 835 enable_j(handles,'off'); 836 else 837 enable_j(handles,'on')%%%%remark: put series with j index at the end in the case of a list 838 end 830 839 831 840 %% display the min and max indices for the whole file series … … 838 847 ref_i=squeeze(max(i1_series(1,:,:),[],2)); % select ref_j index for each ref_i 839 848 ref_j=squeeze(max(j1_series(1,:,:),[],3)); % select ref_i index for each ref_j 840 MinIndex_i= min(find(ref_i))-1;841 MaxIndex_i= max(find(ref_i))-1;842 MaxIndex_j= max(find(ref_j))-1;843 MinIndex_j= min(find(ref_j))-1;849 MinIndex_i=find(ref_i, 1 )-1; 850 MaxIndex_i=find(ref_i, 1, 'last' )-1; 851 MaxIndex_j=find(ref_j, 1, 'last' )-1; 852 MinIndex_j=find(ref_j, 1 )-1; 844 853 diff_j_max=diff(ref_j); 845 854 diff_i_max=diff(ref_i); … … 873 882 set(handles.MaxIndex_i,'Data',MaxIndex_i_table)%display the min indices in the table MinIndex 874 883 set(handles.MaxIndex_j,'Data',MaxIndex_j_table)%display the max indices in the table MaxIndex 884 885 875 886 SeriesData=get(handles.series,'UserData'); 876 887 … … 1063 1074 1064 1075 1065 %% display the set of existing files as an image 1076 %% display the set of existing files as an image with black bands for gaps showing gaps in the series 1066 1077 set(handles.FileStatus,'Units','pixels') 1067 1078 Position=get(handles.FileStatus,'Position'); … … 1316 1327 end 1317 1328 1318 %-------------------------------------1319 function enable_i(handles,state)1320 set(handles.i_txt,'Visible',state)1321 set(handles.num_first_i,'Visible',state)1322 set(handles.num_last_i,'Visible',state)1323 set(handles.num_incr_i,'Visible',state)1324 1329 1325 1330 %----------------------------------- … … 2579 2584 ParamOut.WholeIndexRange='off'; 2580 2585 end 2581 if ~isfield(ParamOut,'WholeIndexRange_j') 2582 ParamOut.WholeIndexRange_j='off'; 2583 end 2584 2586 if ~isfield(ParamOut,'IndexRange_j') 2587 ParamOut.IndexRange_j='on';% accept Index_j as input by default 2588 end 2585 2589 if strcmp(ParamOut.WholeIndexRange,'on') 2586 2590 MinIndex_i=get(handles.MinIndex_i,'Data'); … … 2596 2600 end 2597 2601 end 2598 if strcmp(ParamOut.WholeIndexRange,'on')||strcmp(ParamOut. WholeIndexRange_j,'on')2602 if strcmp(ParamOut.WholeIndexRange,'on')||strcmp(ParamOut.IndexRange_j,'whole') 2599 2603 MinIndex_j=get(handles.MinIndex_j,'Data'); 2600 2604 MaxIndex_j=get(handles.MaxIndex_j,'Data'); … … 2613 2617 2614 2618 %% enable or desable j index visibility 2615 status_j='on'; % default 2616 if isfield(SeriesData,'j1_series') && isempty(find(~cellfun(@isempty,SeriesData.j1_series), 1)) % case of empty j indices 2617 status_j='off'; % no j index needed 2618 elseif strcmp(get(handles.PairString,'Visible'),'on') 2619 check_burst=cellfun(@isempty,regexp(get(handles.PairString,'Data'),'^j')); % =0 for burst case, 1 otherwise 2620 if isempty(find(check_burst, 1))% if all pair string begins by j (burst) 2621 status_j='off'; % no j index needed for bust case 2622 end 2623 end 2624 enable_j(handles,status_j) % no j index needed 2625 if isfield(ParamOut,'j_index_1')&& isfield(ParamOut,'j_index_2')%strcmp(ParamOut.Desable_j_index,'on') 2626 %status_j='off'; 2627 set(handles.num_first_j,'String',num2str(ParamOut.j_index_1)) 2628 set(handles.num_last_j,'String',num2str(ParamOut.j_index_2)) 2629 % set(handles.num_first_j,'enable','off') 2630 % set(handles.num_last_j,'enable','off') 2631 set(handles.num_first_j,'visible','off') 2632 set(handles.num_last_j,'visible','off') 2633 set(handles.num_incr_j,'visible','off') 2634 else 2635 set(handles.num_first_j,'visible','on') 2636 set(handles.num_last_j,'visible','on') 2637 set(handles.num_incr_j,'visible',status_j) 2638 end 2619 if strcmp(ParamOut.IndexRange_j,'off')%do not show the j index 2620 enable_j(handles,'off') 2621 else% show j index if relevant in the input series 2622 j1_series=SeriesData.j1_series; 2623 for iview=1:size(j1_series,1) 2624 if ~isempty(j1_series{iview}) 2625 enable_j(handles,'on') 2626 break 2627 end 2628 end 2629 end 2630 2631 % status_j='on'; % default 2632 % if isfield(SeriesData,'j1_series') && isempty(find(~cellfun(@isempty,SeriesData.j1_series), 1)) % case of empty j indices 2633 % status_j='off'; % no j index needed 2634 % elseif strcmp(get(handles.PairString,'Visible'),'on') 2635 % check_burst=cellfun(@isempty,regexp(get(handles.PairString,'Data'),'^j')); % =0 for burst case, 1 otherwise 2636 % if isempty(find(check_burst, 1))% if all pair string begins by j (burst) 2637 % status_j='off'; % no j index needed for bust case 2638 % end 2639 % end 2640 % enable_j(handles,status_j) % no j index needed 2641 % if isfield(ParamOut,'j_index_1')&& isfield(ParamOut,'j_index_2')%strcmp(ParamOut.Desable_j_index,'on') 2642 % %status_j='off'; 2643 % set(handles.num_first_j,'String',num2str(ParamOut.j_index_1)) 2644 % set(handles.num_last_j,'String',num2str(ParamOut.j_index_2)) 2645 % % set(handles.num_first_j,'enable','off') 2646 % % set(handles.num_last_j,'enable','off') 2647 % set(handles.num_first_j,'visible','off') 2648 % set(handles.num_last_j,'visible','off') 2649 % set(handles.num_incr_j,'visible','off') 2650 % else 2651 % set(handles.num_first_j,'visible','on') 2652 % set(handles.num_last_j,'visible','on') 2653 % set(handles.num_incr_j,'visible',status_j) 2654 % end 2639 2655 2640 2656 %% NbSlice visibility -
trunk/src/series/civ_3D.m
r1152 r1156 55 55 Data.Program=mfilename;%gives the name of the current function 56 56 Data.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default) 57 Data. WholeIndexRange_j='on';% prescribes the file index ranges j from min to max (options 'off'/'on', 'off' by default)57 Data.IndexRange_j='whole';% prescribes the file index ranges j from min to max (options 'off'/'on'/'whole', 'on' by default) 58 58 Data.NbSlice='off'; %nbre of slices ('off' by default) 59 59 Data.VelType='off';% menu for selecting the velocity type (options 'off'/'one'/'two', 'off' by default) -
trunk/src/series/civ_input.m
r1155 r1156 343 343 end 344 344 if strcmp(Param.Action.ActionName,'civ_3D') 345 PairIndex=1 345 PairIndex=1; 346 346 else 347 347 if isempty(PairIndex) … … 789 789 %------------------------------------------------------------------------ 790 790 %reproduce by default the chosen pair in the checkciv2 menu 791 list_pair=get(handles.ListPairCiv1,'String');%get the menu of image pairs 792 PairString=list_pair{get(handles.ListPairCiv1,'Value')}; 793 794 [ind1,ind2]=... 795 find_pair_indices(PairString); 796 hseries=findobj(allchild(0),'Tag','series'); 797 hhseries=guidata(hseries); 798 set(hhseries.num_first_j,'String',num2str(ind1)); 799 set(hhseries.num_last_j,'String',num2str(ind2)); 800 set(hhseries.num_incr_j,'String',num2str(ind2-ind1)); 801 set(handles.ListPairCiv2,'Value',get(handles.ListPairCiv1,'Value'))%civ2 selection the same as civ& by default 802 791 set(handles.ListPairCiv2,'Value',get(handles.ListPairCiv1,'Value'))%civ2 selection the same as civ1 by default 792 ListPairCiv2_Callback(hObject, eventdata, handles) 803 793 804 794 %------------------------------------------------------------------------ … … 806 796 function ListPairCiv2_Callback(hObject, eventdata, handles) 807 797 %------------------------------------------------------------------------ 808 809 798 810 799 %------------------------------------------------------------------------ -
trunk/src/series/civ_series.m
r1155 r1156 53 53 path_series=fileparts(which('series')); 54 54 addpath(fullfile(path_series,'series')) 55 56 57 55 Data=civ_input(Param);% introduce the civ parameters using the GUI civ_input 58 56 % TODO: change from guide to App: modify the input procedure, adapt read_GUI function … … 76 74 Data.CheckOverwriteVisible='on'; % manage the overwrite of existing files (default=1) 77 75 if isfield(Data,'ActionInput') && isfield(Data.ActionInput,'PairIndices') && strcmp(Data.ActionInput.PairIndices.ListPairMode,'pair j1-j2') 78 if isfield(Data.ActionInput.PairIndices,'ListPairCiv2') 79 str_civ=Data.ActionInput.PairIndices.ListPairCiv2; 80 else 81 str_civ=Data.ActionInput.PairIndices.ListPairCiv1; 82 end 83 r=regexp(str_civ,'^j= (?<num1>[a-z])-(?<num2>[a-z])','names'); 84 if isempty(r) 85 r=regexp(str_civ,'^j= (?<num1>[A-Z])-(?<num2>[A-Z])','names'); 86 if isempty(r) 87 r=regexp(str_civ,'^j= (?<num1>\d+)-(?<num2>\d+)','names'); 88 end 89 end 90 if ~isempty(r) 91 Data.j_index_1=stra2num(r.num1); 92 Data.j_index_2=stra2num(r.num2); 93 end 76 Data.IndexRange_j='off';%no j index display in series 77 % if isfield(Data.ActionInput.PairIndices,'ListPairCiv2') 78 % str_civ=Data.ActionInput.PairIndices.ListPairCiv2; 79 % else 80 % str_civ=Data.ActionInput.PairIndices.ListPairCiv1; 81 % end 82 % r=regexp(str_civ,'^j= (?<num1>[a-z])-(?<num2>[a-z])','names'); 83 % if isempty(r) 84 % r=regexp(str_civ,'^j= (?<num1>[A-Z])-(?<num2>[A-Z])','names'); 85 % if isempty(r) 86 % r=regexp(str_civ,'^j= (?<num1>\d+)-(?<num2>\d+)','names'); 87 % end 88 % end 89 % if ~isempty(r) 90 % Data.j_index_1=stra2num(r.num1); 91 % Data.j_index_2=stra2num(r.num2); 92 % end 93 else 94 Data.IndexRange_j='on';% j index display in series if relevant 94 95 end 95 96 return -
trunk/src/series/test_filter_tps.m
r1155 r1156 59 59 if isstruct(Param) && isequal(Param.Action.RUN,0) 60 60 ParamOut.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default) 61 ParamOut.WholeIndexRange='o ff';% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)61 ParamOut.WholeIndexRange='one';% prescribes the file index ranges from min to max (options 'off'/'on'/'one' (single input index), 'off' by default) 62 62 ParamOut.NbSlice='off'; % edit box nbre of slices made active 63 63 ParamOut.VelType='one';% menu for selecting the velocity type (options 'off'/'one'/'two', 'off' by default) … … 214 214 DataOut.ListGlobalAttribute={'Conventions','Program','CivStage','SubDomainSize','MaxDiff','CoordUnit','FieldSmooth'}; 215 215 DataOut.Conventions='uvmat/civdata';% states the conventions used for the description of field variables and attributes 216 if isfield(Param,'UvmatRevision') 216 217 DataOut.Program=['test_patch_tps, uvmat r' Param.UvmatRevision]; 218 else 219 DataOut.Program='test_patch_tps'; 220 end 217 221 DataOut.CivStage=CivStage;%update the current civStage after smoothing 218 222 DataOut.SubDomainSize=SubDomainSize; … … 287 291 time=toc 288 292 289 293 %plot rms difference and proportion of excluded vectors 290 294 figure(2) 291 295 cla 292 296 if CivStage==3% civ1 293 ref=0.2; %recommanded value for diff rms 297 ref=0.2; %recommanded value for diff rms 298 txt='civ1'; 294 299 else 295 300 ref=0.1; 301 txt='civ2'; 296 302 end 297 303 semilogx(FieldSmooth,DataOut.Diff_rms,'b+-',FieldSmooth,DataOut.NbExclude,'m+-',FieldSmooth,ref*ones(size(FieldSmooth)),'b--') 298 304 grid on 299 title( [filecell{1,1} ':' Param.InputFields.VelType])300 legend({'rms vel. diff. ' ;' ratio excluded vectors'; 'recommended diff'},'Location','northwest')305 title( [filecell{1,1} ':' txt]) 306 legend({'rms vel. diff. ' ;' ratio excluded vectors';['recommended diff for' txt]},'Location','northwest') 301 307 xlabel('smoothing parameter') 302 ylabel('rms (pixels) and exclusion ratio')303 OutputFig=fullfile(OutputPath,OutputDir,'plot_rms_diff.png') 308 ylabel('rms (pixels) and proportion of excluded vectors') 309 OutputFig=fullfile(OutputPath,OutputDir,'plot_rms_diff.png'); 304 310 saveas(2,OutputFig) 305 311 -
trunk/src/xmlburst2time.m
r1150 r1156 12 12 Frequency=BurstTiming{k}.FrameFrequency; 13 13 end 14 if isfield(BurstTiming{k},'Time')14 if ~isfield(BurstTiming{k},'Time') 15 15 BurstTiming{k}.Time=0;%time origin set to zero by default 16 16 end
Note: See TracChangeset
for help on using the changeset viewer.