Changeset 772
- Timestamp:
- May 9, 2014, 8:33:53 PM (11 years ago)
- Location:
- trunk/src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ_matlab.m
r651 r772 60 60 if isfield (Param,'Civ1') 61 61 par_civ1=Param.Civ1; 62 if isfield(par_civ1,'reverse_pair')% A REVOIR 63 if par_civ1.reverse_pair 64 if ischar(par_civ1.ImageB) 65 temp=par_civ1.ImageA; 66 par_civ1.ImageA=imread(par_civ1.ImageB); 67 end 68 if ischar(temp) 69 par_civ1.ImageB=imread(temp); 70 end 71 end 72 else 73 if isfield(Param.Civ1,'ImageA') && ischar(Param.Civ1.ImageA) 74 Param.Civ1.ImageA=regexprep(Param.Civ1.ImageA,'''','\'); 75 [par_civ1.ImageA,VideoObject] = read_image(Param.Civ1.ImageA,par_civ1.FileTypeA,[],par_civ1.FrameIndexA); 76 end 77 if isfield(Param.Civ1,'ImageB')&& ischar(Param.Civ1.ImageB) 78 Param.Civ1.ImageB=regexprep(Param.Civ1.ImageB,'''','\'); 79 if strcmp(Param.Civ1.ImageA,Param.Civ1.ImageB)% use the same movie object 80 [par_civ1.ImageB,VideoObject] = read_image(Param.Civ1.ImageB,par_civ1.FileTypeB,VideoObject,par_civ1.FrameIndexB); 81 else 62 if isfield(Param.Civ1,'ImageA') && ischar(Param.Civ1.ImageA)% the input is a char string, read the corresponding image name (else Param.Civ1.ImageA is already an image) 63 Param.Civ1.ImageA=regexprep(Param.Civ1.ImageA,'''','\'); 64 [par_civ1.ImageA,VideoObject] = read_image(Param.Civ1.ImageA,par_civ1.FileTypeA,[],par_civ1.FrameIndexA); 65 end 66 if isfield(Param.Civ1,'ImageB')&& ischar(Param.Civ1.ImageB)% the input is a char string, read the corresponding image name (else Param.Civ1.ImageB is already an image) 67 Param.Civ1.ImageB=regexprep(Param.Civ1.ImageB,'''','\'); 68 if strcmp(Param.Civ1.ImageA,Param.Civ1.ImageB)% use the same movie object 69 [par_civ1.ImageB,VideoObject] = read_image(Param.Civ1.ImageB,par_civ1.FileTypeB,VideoObject,par_civ1.FrameIndexB); 70 else 82 71 [par_civ1.ImageB,VideoObject] = read_image(Param.Civ1.ImageB,par_civ1.FileTypeB,par_civ1.ImageB,par_civ1.FrameIndexB); 83 end 84 end 85 end 86 72 end 73 end 87 74 list_param=(fieldnames(Param.Civ1))'; 88 75 Civ1_param=list_param;%default … … 142 129 CivFile=Param.Patch1.CivFile; 143 130 end 144 Data=nc2struct(CivFile,'ListGlobalAttribute','absolut_time_T0'); %look for the constant 'absolut_time_T0' to detect old civx data format 145 if isfield(Data,'Txt') 146 errormsg=Data.Txt; 131 [Data,tild,tild,erromsg]=nc2struct(CivFile,'ListGlobalAttribute','absolut_time_T0'); %look for the constant 'absolut_time_T0' to detect old civx data format 132 if ~isempty(errormsg) 147 133 return 148 134 end -
trunk/src/fill_GUI.m
r747 r772 25 25 end 26 26 end 27 UserData=get(GUI_handle,'UserData');% additional information stored in 'UserData' of the GUI28 27 fields=fieldnames(Param);%list of fields in Param 29 28 -
trunk/src/filter_tps.m
r651 r772 82 82 NormDiff=UDiff.*UDiff+VDiff.*VDiff; 83 83 ind_ind_sel=1:numel(ind_sel);%default 84 if exist('Threshold','var') 84 if exist('Threshold','var')&&~isempty(Threshold) 85 85 FF(ind_sel)=20*(NormDiff>Threshold);%put FF value to 20 to identify the criterium of elimmination 86 86 ind_ind_sel=find(FF(ind_sel)==0); % select the indices of ind_sel corresponding to the remaining vectors -
trunk/src/geometry_calib.m
r757 r772 125 125 set(handles.calib_type,'String',{'rescale';'linear';'3D_linear';'3D_quadr';'3D_extrinsic'}) 126 126 if exist('inputfile','var')&& ~isempty(inputfile) 127 % struct.XmlInputFile=inputfile;128 127 [RootPath,SubDir,RootFile,tild,tild,tild,tild,FileExt]=fileparts_uvmat(inputfile); 129 128 struct.XmlInputFile=find_imadoc(RootPath,SubDir,RootFile,FileExt); 130 % if ~strcmp(FileExt,'.xml')131 % inputfile=fullfile(RootPath,[SubDir '.xml']);%xml file corresponding to the input file132 % if ~exist(inputfile,'file')% case of civ files , removes the extension for subdir133 % inputfile=fullfile(RootPath,[regexprep(SubDir,'\..+$','') '.xml']);134 % if ~exist(inputfile,'file')135 % inputfile=[fullfile(RootPath,SubDir,RootFile) '.xml'];%old convention136 % if ~exist(inputfile,'file')137 % inputfile='';138 % end139 % end140 % end141 % end142 129 set(handles.ListCoord,'Data',[]) 143 130 if exist(struct.XmlInputFile,'file') -
trunk/src/series.m
r771 r772 122 122 series_ResizeFcn(hObject, eventdata, handles)%resize table according to series GUI size 123 123 set(hObject,'WindowButtonDownFcn',{'mouse_down'})%allows mouse action with right button (zoom for uicontrol display) 124 set(handles.InputTable,'KeyPressFcn',{@key_press_fcn,handles})%set keyboard action function (allow action on uvmat when set_object is in front)125 124 set(hObject,'DeleteFcn',{@closefcn})% 126 125 … … 236 235 if isfield(Param,'Coord_x_str') && ischar(Param.Coord_x_str) 237 236 set(handles.Coord_x,'String',Param.Coord_x_str);% list menu fields 238 % set(handles.Coord_x,'Value',Param.Coord_x_val);% selected string index239 237 end 240 238 if isfield(Param,'Coord_y_str')&& ischar(Param.Coord_y_str) 241 239 set(handles.Coord_y,'String',Param.Coord_y_str);% list menu fields 242 % set(handles.Coord_y,'Value',Param.Coord_y_val);% selected string index243 240 end 244 241 … … 483 480 484 481 485 486 %------------------------------------------------------------------------ 487 % --- Executes when entered data in editable cell(s) in InputTable. 488 function InputTable_CellEditCallback(hObject, eventdata, handles) 489 %------------------------------------------------------------------------ 482 % --- Executes when selected cell(s) is changed in InputTable. 483 function InputTable_CellSelectionCallback(hObject, eventdata, handles) 484 iline=[]; 485 if ~isempty(eventdata.Indices) 486 iline=eventdata.Indices(1); 487 end 488 set(handles.InputTable,'UserData',iline); 489 490 %------------------------------------------------------------------------ 491 % --- 'key_press_fcn:' function activated when a key is pressed on the keyboard 492 %------------------------------------------------------------------------ 493 function InputTable_KeyPressFcn(hObject, eventdata, handles) 490 494 set(handles.REFRESH,'BackgroundColor',[1 0 1])% set REFRESH button to magenta color to indicate that input refresh is needed 491 % set(handles.REFRESH_title,'Visible','on')492 iview=eventdata.Indices(1);493 view_set=get(handles.REFRESH,'UserData');494 if isempty(find(view_set==iview))495 set(handles.REFRESH,'UserData',[view_set iview])496 end497 %% enable other menus and uicontrols498 set(handles.MenuOpenCampaign,'Enable','on')499 set(handles.MenuCampaign_1,'Enable','on')500 set(handles.MenuCampaign_2,'Enable','on')501 set(handles.MenuCampaign_3,'Enable','on')502 set(handles.MenuCampaign_4,'Enable','on')503 set(handles.MenuCampaign_5,'Enable','on')504 set(handles.RUN, 'Enable','On')505 set(handles.RUN,'BackgroundColor',[1 0 0])% set RUN button to red506 507 %------------------------------------------------------------------------508 % --- 'key_press_fcn:' function activated when a key is pressed on the keyboard509 %------------------------------------------------------------------------510 function key_press_fcn(hObject,eventdata,handles)511 512 495 xx=double(get(handles.series,'CurrentCharacter')); %get the keyboard character 513 if ismember(xx,[8 127 31])%backspace or delete, or downward 514 InputTable=get(handles.InputTable,'Data'); 515 iline=get(handles.InputTable,'UserData'); 516 if isequal(xx, 31) 517 if isequal(iline,size(InputTable,1))% arrow downward 518 InputTable=[InputTable;cell(1,size(InputTable,2))]; 519 end 520 else 521 InputTable(iline,:)=[];% suppress the current line 522 end 523 set(handles.InputTable,'Data',InputTable); 496 switch xx 497 case 31 %downward arrow 498 InputTable=get(handles.InputTable,'Data'); 499 iline=get(handles.InputTable,'UserData'); 500 if isequal(iline,size(InputTable,1))% arrow downward 501 InputTable=[InputTable;InputTable(iline,:)];% create a new line as a copy of the last one 502 set(handles.InputTable,'Data',InputTable); 503 end 504 case 127 %key 'Suppress' 505 InputTable=get(handles.InputTable,'Data'); 506 iline=get(handles.InputTable,'UserData'); 507 if iline>1 508 InputTable(iline,:)=[];% suppress the current line if not the first 509 set(handles.InputTable,'Data',InputTable); 510 end 524 511 end 525 512 … … 537 524 empty_line(iline)= isempty(cell2mat(InputTable(iline,1:3))); 538 525 end 539 InputTable(empty_line,:)=[];%remove empty lines 540 set(handles.InputTable,'Data',InputTable) 526 if ~isempty(find(empty_line)); 527 InputTable(empty_line,:)=[];%remove empty lines 528 set(handles.InputTable,'Data',InputTable) 529 ListTable={'MinIndex_i','MaxIndex_i','MinIndex_j','MaxIndex_j','PairString','TimeTable'}; 530 for ilist=1:numel(ListTable) 531 Table=get(handles.(ListTable{ilist}),'Data'); 532 Table(empty_line,:)=[];%remove empty lines 533 set(handles.(ListTable{ilist}),'Data',Table); 534 end 535 set(handles.series,'UserData',[])%refresh the stored info 536 end 541 537 for iview=1:size(InputTable,1) 542 538 RootPath=fullfile(InputTable{iview,1},InputTable{iview,2}); … … 558 554 end 559 555 else 560 update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,File Type,FileInfo,MovieObject,iview)556 update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileInfo,MovieObject,iview) 561 557 end 562 558 end … … 571 567 % INPUT: 572 568 % handles: handles of elements in the GUI 573 % fileinput: input file name, includingpath569 % Param: structure of input parameters, including input file name and path 574 570 % iview: line index in the input table 575 571 % or 'one': refresh the list … … 639 635 iview=size(InputTable,1)+1;% the next line in InputTable becomes the current line 640 636 InputTable(iview,:)=[{RootPath},{SubDir},{RootFile},{NomType},{FileExt}]; 637 % SeriesData.ListViewMenu(iview)=zeros(1,nbview) 641 638 elseif strcmp(iview,'one') % refresh the list of input file series 642 639 iview=1; %the first line in InputTable becomes the current line … … 648 645 set(handles.MinIndex_j,'Data',[]) 649 646 set(handles.MaxIndex_j,'Data',[]) 650 set(handles.ListView,'Value',1)651 set(handles.ListView,'String',{'1'})652 647 set(handles.PairString,'Data',{''}) 648 SeriesData.CheckPair=0;%reset the list of input lines with pairs 653 649 SeriesData.i1_series={}; 654 650 SeriesData.i2_series={}; … … 659 655 SeriesData.Time={}; 660 656 end 661 nbview=size(InputTable,1);662 set(handles.ListView,'String',mat2cell((1:nbview)',ones(nbview,1)))663 set(handles.ListView,'Value',iview)664 SeriesData.ListViewValue=iview;665 SeriesData.ListViewMenu=mat2cell((1:nbview)',ones(nbview,1));666 657 set(handles.InputTable,'Data',InputTable) 667 658 … … 682 673 end 683 674 ref_j=floor((j1+j2)/2);% reference image number corresponding to the file 684 % set(handles.num_ref_j,'String',num2str(ref_j));685 675 SeriesData.ref_i=ref_i; 686 676 SeriesData.ref_j=ref_j; … … 737 727 738 728 %% initiate input file series and refresh the current field view: 739 update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,File Type,FileInfo,MovieObject,iview);729 update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileInfo,MovieObject,iview); 740 730 set(handles.REFRESH,'BackgroundColor',[1 0 0])% set REFRESH button to red color (end of activation) 741 731 … … 743 733 % --- Update information about a new field series (indices to scan, timing, 744 734 % calibration from an xml file 745 function update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,File Type,FileInfo,VideoObject,iview)735 function update_rootinfo(handles,i1_series,i2_series,j1_series,j2_series,FileInfo,VideoObject,iview) 746 736 %------------------------------------------------------------------------ 747 737 InputTable=get(handles.InputTable,'Data'); … … 780 770 MaxIndex_j_table=get(handles.MaxIndex_j,'Data');%retrieve the min indices in the table MinIndex 781 771 if ~isempty(MinIndex_i)&&~isempty(MaxIndex_i) 782 MinIndex_i_table(iview,1)=MinIndex_i;783 MaxIndex_i_table(iview,1)=MaxIndex_i;772 MinIndex_i_table(iview,1)=MinIndex_i; 773 MaxIndex_i_table(iview,1)=MaxIndex_i; 784 774 end 785 775 if ~isempty(MinIndex_j)&&~isempty(MaxIndex_j) 786 MinIndex_j_table(iview,1)=MinIndex_j;787 MaxIndex_j_table(iview,1)=MaxIndex_j;776 MinIndex_j_table(iview,1)=MinIndex_j; 777 MaxIndex_j_table(iview,1)=MaxIndex_j; 788 778 end 789 779 set(handles.MinIndex_i,'Data',MinIndex_i_table)%display the min indices in the table MinIndex … … 791 781 set(handles.MaxIndex_i,'Data',MaxIndex_i_table)%display the min indices in the table MinIndex 792 782 set(handles.MaxIndex_j,'Data',MaxIndex_j_table)%display the max indices in the table MaxIndex 783 SeriesData=get(handles.series,'UserData'); 793 784 794 785 %% adjust the first and last indices for the selected series, only if requested by the bounds 795 786 % i index, compare input to min index i 796 787 first_i=str2num(get(handles.num_first_i,'String'));%retrieve previous first i 797 ref_i=str2num(get(handles.num_ref_i,'String'));%index i given by the input field 788 % ref_i=str2num(get(handles.num_ref_i,'String'));%index i given by the input field 789 ref_i=1; 790 if isfield(SeriesData,'ref_i') 791 ref_i=SeriesData.ref_i; 792 end 798 793 if isempty(first_i) 799 794 first_i=ref_i;% first_i updated by the input value … … 805 800 % j index, compare input to min index j 806 801 first_j=str2num(get(handles.num_first_j,'String')); 807 ref_j=str2num(get(handles.num_ref_j,'String'));%index j given by the input field 802 ref_j=1; 803 if isfield(SeriesData,'ref_j') 804 ref_j=SeriesData.ref_j; 805 end 808 806 if isempty(first_j) 809 807 first_j=ref_j;% first_j updated by the input value … … 838 836 %% number of slices set by default 839 837 NbSlice=1;%default 840 % read value set by the first series for the checkappend mode (iwiew >1)838 % read value set by the first series for the append mode (iwiew >1) 841 839 if iview>1 && strcmp(get(handles.num_NbSlice,'Visible'),'on') 842 840 NbSlice=str2num(get(handles.num_NbSlice,'String')); … … 845 843 %% default time unit 846 844 TimeUnit=''; 847 % read value set by the first series for the checkappend mode (iwiew >1)845 % read value set by the first series for the append mode (iwiew >1) 848 846 if iview>1 849 847 TimeUnit=get(handles.TimeUnit,'String'); … … 930 928 931 929 %% update the series info in 'UserData' 932 SeriesData=get(handles.series,'UserData');933 930 SeriesData.i1_series{iview}=i1_series; 934 931 SeriesData.i2_series{iview}=i2_series; 935 932 SeriesData.j1_series{iview}=j1_series; 936 933 SeriesData.j2_series{iview}=j2_series; 937 SeriesData.FileType{iview}=File Type;934 SeriesData.FileType{iview}=FileInfo.FileType; 938 935 SeriesData.FileInfo{iview}=FileInfo; 939 936 SeriesData.Time{iview}=Time; … … 941 938 SeriesData.TimeSource=TimeSource; 942 939 end 943 % if ~isempty(TimeUnit)944 % SeriesData.TimeUnit=TimeUnit;945 % end946 940 if check_calib 947 941 SeriesData.GeometryCalib{iview}=XmlData.GeometryCalib; … … 950 944 951 945 %% update pair menus 952 ListView=get(handles.ListView,'String'); 953 ListView{iview}=num2str(iview); 954 set(handles.ListView,'String',ListView); 955 set(handles.ListView,'Value',iview) 956 update_mode(handles,i1_series,i2_series,j1_series,j2_series,Time) 957 958 %% enable j index visibility 959 status_j='on';%default 960 if isempty(find(~cellfun(@isempty,SeriesData.j1_series), 1)); % case of empty j indices 961 status_j='off'; % no j index needed 962 elseif strcmp(get(handles.PairString,'Visible'),'on') 963 PairString=get(handles.PairString,'Data'); 964 check_burst=cellfun(@isempty,regexp(PairString,'^j'));%=0 for burst case, 1 otherwise 965 if isempty(find(check_burst, 1))% if all pair string begins by j (burst) 966 status_j='off'; % no j index needed for bust case 967 end 968 end 969 enable_j(handles,status_j) % no j index needed 946 hset_pair=findobj(allchild(0),'Tag','set_pairs'); 947 if ~isempty(hset_pair), delete(hset_pair); end % delete the GUI set_pair if opened 948 CheckPair= ~isempty(i2_series)||~isempty(j2_series); % check whether index pairs need to be defined 949 PairString=get(handles.PairString,'Data'); 950 if CheckPair% if pairs need to be display for line iview 951 [ModeMenu,ModeValue]=update_mode(i1_series,i2_series,j2_series); 952 Menu=update_listpair(i1_series,i2_series,j1_series,j2_series,ModeMenu{ModeValue},Time,TimeUnit,ref_i,ref_j); 953 PairString{iview,1}=Menu{1}; 954 else 955 PairString{iview,1}='';%no pair for #iview 956 end 957 set(handles.PairString,'Data',PairString) 958 if isempty(find(cellfun('isempty',get(handles.PairString,'Data'))==0, 1))% if all lines of pairs are empty 959 set(handles.PairString,'Visible','off') 960 set(handles.SetPairs,'Visible','off') 961 else 962 set(handles.PairString,'Visible','on') 963 set(handles.SetPairs,'Visible','on') 964 end 965 970 966 971 967 %% display the set of existing files as an image … … 978 974 MaxIndex_i=ones(1,nbview);%default 979 975 MinIndex_i=ones(1,nbview);%default 980 for i view=1:nbview981 pair_max=squeeze(max(SeriesData.i1_series{i view},[],1)); %max on pair index982 j_max{i view}=max(pair_max,[],1);%max on j index983 if ~isempty(j_max{i view})984 MaxIndex_i(i view)=max(find(j_max{iview}))-1;% max ref index i985 MinIndex_i(i view)=min(find(j_max{iview}))-1;% min ref index i976 for iline=1:nbview 977 pair_max=squeeze(max(SeriesData.i1_series{iline},[],1)); %max on pair index 978 j_max{iline}=max(pair_max,[],1);%max on j index 979 if ~isempty(j_max{iline}) 980 MaxIndex_i(iline)=max(find(j_max{iline}))-1;% max ref index i 981 MinIndex_i(iline)=min(find(j_max{iline}))-1;% min ref index i 986 982 end 987 983 end … … 993 989 file_indices=MinIndex_i+floor(((0.5:npx-0.5)/npx)*range_index)+1; 994 990 CData=zeros(nbview*range_y,npx);% initiate the image representing the existing files 995 for i view=1:nbview996 ind_y=1+(i view-1)*range_y:iview*range_y;991 for iline=1:nbview 992 ind_y=1+(iline-1)*range_y:iline*range_y; 997 993 LineData=zeros(size(file_indices)); 998 file_select=file_indices(file_indices<=numel(j_max{i view}));999 ind_select=find(file_indices<=numel(j_max{i view}));1000 LineData(ind_select)=j_max{i view}(file_select)~=0;994 file_select=file_indices(file_indices<=numel(j_max{iline})); 995 ind_select=find(file_indices<=numel(j_max{iline})); 996 LineData(ind_select)=j_max{iline}(file_select)~=0; 1001 997 CData(ind_y,:)=ones(size(ind_y'))*LineData; 1002 998 end … … 1004 1000 set(handles.FileStatus,'CData',CData); 1005 1001 1006 %% check for pair display1007 check_pairs=0;1008 for iview=1:numel(SeriesData.i2_series)1009 if ~isempty(SeriesData.i2_series{iview})||~isempty(SeriesData.j2_series{iview})1010 check_pairs=1;1011 end1012 end1013 if check_pairs1014 % set(handles.Pairs,'Visible','on')1015 set(handles.PairString,'Visible','on')1016 set(handles.SetPairs,'Visible','on')1017 else1018 % set(handles.Pairs,'Visible','off')1019 set(handles.PairString,'Visible','off')1020 set(handles.SetPairs,'Visible','off')1021 end1022 1023 1024 1002 %% enable field and veltype menus, in accordance with the current action 1025 1003 ActionName_Callback([],[], handles) … … 1028 1006 displ_time(handles) 1029 1007 1030 %% set default options in menu 'Fields' 1031 switch FileType 1032 case {'civx','civdata'} 1033 FieldList=[set_field_list('U','V');{'C'}];%standard menu for civx data 1034 % set(handles.Coord_x,'Value',1); 1035 set(handles.Coord_x,'String','X'); 1036 % set(handles.Coord_y,'Value',1); 1037 set(handles.Coord_y,'String','Y'); 1038 case 'netcdf' 1039 ind_x=find(strcmp(get(handles.Coord_x,'String'),FileInfo.ListVarName)); 1040 if isempty(ind_x) 1041 FieldList={};% new kind of file opened, we need to pick variables with get_field... 1042 set(handles.Coord_x,'String','') 1043 set(handles.Coord_y,'String','') 1008 1009 % look for netcdf data as input 1010 % switch FileType 1011 % case {'civx','civdata'} 1012 % FieldList=[set_field_list('U','V');{'C'}];%standard menu for civx data 1013 % set(handles.Coord_x,'String','X'); 1014 % set(handles.Coord_y,'String','Y'); 1015 % case 'netcdf' 1016 % ind_x=find(strcmp(get(handles.Coord_x,'String'),FileInfo.ListVarName)); 1017 % if isempty(ind_x) 1018 % FieldList={};% new kind of file opened, we need to pick variables with get_field... 1019 % set(handles.Coord_x,'String','') 1020 % set(handles.Coord_y,'String','') 1021 % else 1022 % FileInfo.ListVarName(ind_x)=[];%remove coord-x from the list of variables to display 1023 % ind_y=find(strcmp(get(handles.Coord_y,'String'),FileInfo.ListVarName)); 1024 % if isempty(ind_y) 1025 % FieldList={};% new kind of file opened, we need to pick variables with get_field... 1026 % set(handles.Coord_x,'String','') 1027 % set(handles.Coord_y,'String','') 1028 % else 1029 % FileInfo.ListVarName(ind_y)=[];%remove coord-y from the list of variables to display 1030 % FieldList=(FileInfo.ListVarName)'; 1031 % end 1032 % end 1033 % otherwise 1034 % set(handles.FieldName,'Value',1) % set menu to 'image' 1035 % set(handles.FieldName,'String',{'image'}) 1036 % set(handles.Coord_x,'String','AX'); 1037 % set(handles.Coord_y,'String','AY'); 1038 % end 1039 % if ismember(FileType,{'civx','civdata','netcdf'}) 1040 % PrevMenu=get(handles.FieldName,'String'); 1041 % PrevValue=get(handles.FieldName,'Value'); 1042 % PrevMenu=PrevMenu(PrevValue(PrevValue<=numel(PrevMenu))); 1043 % FieldValue=[]; 1044 % for ilist=1:numel(PrevMenu) 1045 % index_menu=find(strcmp(PrevMenu{ilist},FieldList)); 1046 % if ~isempty(index_menu) 1047 % FieldValue=[FieldValue index_menu]; 1048 % end 1049 % end 1050 % if isempty(FieldValue) 1051 % FieldValue=1; 1052 % end 1053 % set(handles.FieldName,'Value',FieldValue) 1054 % set(handles.FieldName,'String',[FieldList;{'get_field...'}]) 1055 % end 1056 1057 1058 %-----------------------------------------------------------guide ------------- 1059 %------------------------------------------------------------------------ 1060 % III - FUNCTIONS ASSOCIATED TO THE FRAME IndexRange 1061 %------------------------------------------------------------------------ 1062 1063 1064 % ---- determine the menu to put in mode and advice a default choice 1065 %------------------------------------------------------------------------ 1066 function [ModeMenu,ModeValue]=update_mode(i1_series,i2_series,j2_series) 1067 %------------------------------------------------------------------------ 1068 ModeMenu={''}; 1069 if isempty(j2_series)% no j pair 1070 ModeValue=1; 1071 if ~isempty(i2_series) 1072 ModeMenu={'series(Di)'}; % pair menu with only option Di 1073 end 1074 else %existence of j pairs 1075 pair_max=squeeze(max(i1_series,[],1)); %max on pair index 1076 j_max=max(pair_max,[],1); 1077 MaxIndex_i=find(j_max, 1, 'last' )-1;% max ref index i 1078 MinIndex_i=find(j_max, 1 )-1;% min ref index i 1079 i_max=max(pair_max,[],2); 1080 MaxIndex_j=find(i_max, 1, 'last' )-1;% max ref index i 1081 MinIndex_j=find(i_max, 1 )-1;% min ref index i 1082 if MaxIndex_j==MinIndex_j 1083 ModeValue=1; 1084 ModeMenu={'bursts'}; 1085 elseif MaxIndex_i==MinIndex_i 1086 ModeValue=1; 1087 ModeMenu={'series(Dj)'}; 1088 else 1089 ModeMenu={'bursts';'series(Dj)'}; 1090 if (MaxIndex_j-MinIndex_j)>10 1091 ModeValue=2;%set mode to series(Dj) if more than 10 j values 1044 1092 else 1045 FileInfo.ListVarName(ind_x)=[];%remove coord-x from the list of variables to display 1046 ind_y=find(strcmp(get(handles.Coord_y,'String'),FileInfo.ListVarName)); 1047 if isempty(ind_y) 1048 FieldList={};% new kind of file opened, we need to pick variables with get_field... 1049 set(handles.Coord_x,'String','') 1050 set(handles.Coord_y,'String','') 1051 else 1052 FileInfo.ListVarName(ind_y)=[];%remove coord-y from the list of variables to display 1053 FieldList=(FileInfo.ListVarName)'; 1093 ModeValue=1; 1094 end 1095 end 1096 end 1097 1098 1099 %------------------------------------------------------------------------ 1100 function displ_pair=update_listpair(i1_series,i2_series,j1_series,j2_series,mode,time,TimeUnit,ref_i,ref_j) 1101 %------------------------------------------------------------------------ 1102 displ_pair={}; 1103 if isempty(TimeUnit) 1104 dtunit='e-03'; 1105 else 1106 dtunit=['m' TimeUnit]; 1107 end 1108 switch mode 1109 case 'series(Di)' 1110 diff_i=i2_series-i1_series; 1111 min_diff=min(diff_i(diff_i>0)); 1112 max_diff=max(diff_i(diff_i>0)); 1113 for ipair=min_diff:max_diff 1114 if numel(diff_i(diff_i==ipair))>0 1115 pair_string=['Di= ' num2str(-floor(ipair/2)) '|' num2str(ceil(ipair/2)) ]; 1116 if ~isempty(time) 1117 if ref_i<=floor(ipair/2) 1118 ref_i=floor(ipair/2)+1;% shift ref_i to get the first pair 1119 end 1120 Dt=time(ref_i+ceil(ipair/2),ref_j)-time(ref_i-floor(ipair/2),ref_j); 1121 pair_string=[pair_string ', Dt=' num2str(Dt) ' ' dtunit]; 1122 end 1123 displ_pair=[displ_pair;{pair_string}]; 1054 1124 end 1055 end 1056 otherwise 1057 set(handles.FieldName,'Value',1) % set menu to 'image' 1058 set(handles.FieldName,'String',{'image'}) 1059 set(handles.Coord_x,'String','AX'); 1060 set(handles.Coord_y,'String','AY'); 1061 end 1062 if ismember(FileType,{'civx','civdata','netcdf'}) 1063 PrevMenu=get(handles.FieldName,'String'); 1064 PrevMenu=PrevMenu(get(handles.FieldName,'Value')); 1065 FieldValue=[]; 1066 for ilist=1:numel(PrevMenu) 1067 index_menu=find(strcmp(PrevMenu{ilist},FieldList)); 1068 if ~isempty(index_menu) 1069 FieldValue=[FieldValue index_menu]; 1070 end 1071 end 1072 if isempty(FieldValue) 1073 FieldValue=1; 1074 end 1075 set(handles.FieldName,'Value',FieldValue) 1076 set(handles.FieldName,'String',[FieldList;{'get_field...'}]) 1077 end 1078 1079 1125 end 1126 if ~isempty(displ_pair) 1127 displ_pair=[displ_pair;{'Di=*|*'}]; 1128 end 1129 case 'series(Dj)' 1130 if isempty(j2_series) 1131 msgbox_uvmat('ERROR','no j1-j2 pair available') 1132 return 1133 end 1134 diff_j=j2_series-j1_series; 1135 min_diff=min(diff_j(diff_j>0)); 1136 max_diff=max(diff_j(diff_j>0)); 1137 for ipair=min_diff:max_diff 1138 if numel(diff_j(diff_j==ipair))>0 1139 pair_string=['Dj= ' num2str(-floor(ipair/2)) '|' num2str(ceil(ipair/2)) ]; 1140 if ~isempty(time) 1141 if ref_j<=floor(ipair/2) 1142 ref_j=floor(ipair/2)+1;% shift ref_i to get the first pair 1143 end 1144 Dt=time(ref_i,ref_j+ceil(ipair/2))-time(ref_i,ref_j-floor(ipair/2)); 1145 pair_string=[pair_string ', Dt=' num2str(Dt) ' ' dtunit]; 1146 end 1147 displ_pair=[displ_pair;{pair_string}]; 1148 end 1149 end 1150 if ~isempty(displ_pair) 1151 displ_pair=[displ_pair;{'Dj=*|*'}]; 1152 end 1153 case 'bursts' 1154 if isempty(j2_series) 1155 msgbox_uvmat('ERROR','no j1-j2 pair available') 1156 return 1157 end 1158 %diff_j=j2_series-j1_series; 1159 min_j1=min(j1_series(j1_series>0)); 1160 max_j1=max(j1_series(j1_series>0)); 1161 min_j2=min(j2_series(j2_series>0)); 1162 max_j2=max(j2_series(j2_series>0)); 1163 for pair1=min_j1:min(max_j1,min_j1+20) 1164 for pair2=min_j2:min(max_j2,min_j2+20) 1165 if numel(j1_series(j1_series==pair1))>0 && numel(j2_series(j2_series==pair2))>0 1166 pair_string=['j= ' num2str(pair1) '-' num2str(pair2)]; 1167 Dt=time(ref_i,pair2+1)-time(ref_i,pair1+1); 1168 pair_string=[pair_string ', Dt=' num2str(Dt) ' ' dtunit]; 1169 displ_pair=[displ_pair;{pair_string}]; 1170 end 1171 end 1172 end 1173 if ~isempty(displ_pair) 1174 displ_pair=[displ_pair;{'j=*-*'}]; 1175 end 1176 end 1177 1080 1178 %------------------------------------------------------------------------ 1081 1179 function num_first_i_Callback(hObject, eventdata, handles) … … 1110 1208 end 1111 1209 displ_time(handles); 1112 1113 1210 1114 1211 %------------------------------------------------------------------------ … … 1172 1269 %------------------------------------------------------------------------ 1173 1270 if numel(eventdata.Indices)>=1 1174 set(handles.ListView,'Value',eventdata.Indices(1))% detect the selected raw index 1175 ListView_Callback ([],[],handles) % update the list of available pairs 1176 end 1177 1178 %------------------------------------------------------------------------ 1179 %------------------------------------------------------------------------ 1180 % III - FUNCTIONS ASSOCIATED TO THE FRAME SET PAIRS 1181 %------------------------------------------------------------------------ 1182 %------------------------------------------------------------------------ 1183 % --- Executes on selection change in ListView. 1184 function ListView_Callback(hObject, eventdata, handles) 1185 %------------------------------------------------------------------------ 1186 SeriesData=get(handles.series,'UserData'); 1187 i2_series=[]; 1188 j2_series=[]; 1189 iview=get(handles.ListView,'Value'); 1190 if ~isempty(SeriesData.i2_series{iview}) 1191 i2_series=SeriesData.i2_series{iview}; 1192 end 1193 if ~isempty(SeriesData.j2_series{iview}) 1194 j2_series=SeriesData.j2_series{iview}; 1195 end 1196 update_mode(handles,SeriesData.i1_series{iview},SeriesData.i2_series{iview},... 1197 SeriesData.j1_series{iview},SeriesData.j2_series{iview},SeriesData.Time{iview}) 1198 1199 %------------------------------------------------------------------------ 1200 % --- Executes on button press in mode. 1201 function mode_Callback(hObject, eventdata, handles) 1202 %------------------------------------------------------------------------ 1203 SeriesData=get(handles.series,'UserData'); 1204 iview=get(handles.ListView,'Value'); 1205 mode_list=get(handles.mode,'String'); 1206 mode=mode_list{get(handles.mode,'Value')}; 1207 if isequal(mode,'bursts') 1208 enable_i(handles,'On') 1209 enable_j(handles,'Off') %do not display j index scanning in burst mode (j is fixed by the burst choice) 1210 else 1211 enable_i(handles,'On') 1212 enable_j(handles,'Off') 1213 end 1214 fill_ListPair(handles,SeriesData.i1_series{iview},SeriesData.i2_series{iview},... 1215 SeriesData.j1_series{iview},SeriesData.j2_series{iview},SeriesData.Time{iview}) 1216 ListPairs_Callback([],[],handles) 1217 1218 %------------------------------------------------------------- 1219 % --- Executes on selection in ListPairs. 1220 function ListPairs_Callback(hObject,eventdata,handles) 1221 %------------------------------------------------------------ 1222 list_pair=get(handles.ListPairs,'String');%get the menu of image pairs 1223 if isempty(list_pair) 1224 string=''; 1225 else 1226 string=list_pair{get(handles.ListPairs,'Value')}; 1227 string=regexprep(string,',.*','');%removes time indication (after ',') 1228 end 1229 PairString=get(handles.PairString,'Data'); 1230 iview=get(handles.ListView,'Value'); 1231 PairString{iview,1}=string; 1232 % report the selected pair string to the table PairString 1233 set(handles.PairString,'Data',PairString) 1234 1235 1236 %------------------------------------------------------------------------ 1237 function update_mode(handles,i1_series,i2_series,j1_series,j2_series,time) 1238 %------------------------------------------------------------------------ 1239 % check_burst=0; 1240 ModeMenu={''}; 1241 if isempty(j2_series)% no j pair 1242 ModeValue=1; 1243 if isempty(i2_series) 1244 set(handles.mode,'String',{''})% no pair menu to display 1245 else 1246 set(handles.mode,'Value',1) 1247 ModeMenu={'series(Di)'}; % pair menu with only option Di 1248 end 1249 else %existence of j pairs 1250 pair_max=squeeze(max(i1_series,[],1)); %max on pair index 1251 j_max=max(pair_max,[],1); 1252 MaxIndex_i=max(find(j_max))-1;% max ref index i 1253 MinIndex_i=min(find(j_max))-1;% min ref index i 1254 i_max=max(pair_max,[],2); 1255 MaxIndex_j=max(find(i_max))-1;% max ref index i 1256 MinIndex_j=min(find(i_max))-1;% min ref index i 1257 if MaxIndex_j==MinIndex_j 1258 ModeValue=1; 1259 ModeMenu={'bursts'}; 1260 elseif MaxIndex_i==MinIndex_i 1261 ModeValue=1; 1262 ModeMenu={'series(Dj)'}; 1263 else 1264 ModeMenu={'bursts';'series(Dj)'}; 1265 if (MaxIndex_j-MinIndex_j)>10 1266 ModeValue=2;%set mode to series(Dj) if more than 10 j values 1267 else 1268 ModeValue=1; 1269 end 1270 end 1271 end 1272 1273 set(handles.mode,'String',ModeMenu) 1274 set(handles.mode,'Value',ModeValue) 1275 SeriesData=get(handles.series,'UserData'); 1276 SeriesData.ModeMenu=ModeMenu; 1277 SeriesData.ModeValue=ModeValue; 1278 set(handles.series,'UserData',SeriesData) 1279 fill_ListPair(handles,i1_series,i2_series,j1_series,j2_series,time) 1280 ListPairs_Callback([],[],handles) 1281 1282 %-------------------------------------------------------------- 1283 % determine the menu for pairstring depending on existing netcdf files 1284 % with the reference indices num_ref_i and num_ref_j 1285 %---------------------------------------------------------------- 1286 function fill_ListPair(handles,i1_series,i2_series,j1_series,j2_series,time) 1287 1288 mode_list=get(handles.mode,'String'); 1289 mode=mode_list{get(handles.mode,'Value')}; 1290 ref_i=str2num(get(handles.num_ref_i,'String')); 1291 if isempty(ref_i) 1292 ref_i=1; 1293 end 1294 if strcmp(get(handles.num_ref_j,'Visible'),'on') 1295 ref_j=str2num(get(handles.num_ref_j,'String')); 1296 if isempty(ref_j) 1297 ref_j=1; 1298 end 1299 else 1300 ref_j=1; 1301 end 1302 TimeUnit=get(handles.TimeUnit,'String'); 1303 if length(TimeUnit)>=1 1304 dtunit=['m' TimeUnit]; 1305 else 1306 dtunit='e-03'; 1307 end 1308 1309 displ_pair={}; 1310 if strcmp(mode,'series(Di)') 1311 if isempty(i2_series) 1312 msgbox_uvmat('ERROR','no i1-i2 pair available') 1313 return 1314 end 1315 diff_i=i2_series-i1_series; 1316 min_diff=min(diff_i(diff_i>0)); 1317 max_diff=max(diff_i(diff_i>0)); 1318 for ipair=min_diff:max_diff 1319 if numel(diff_i(diff_i==ipair))>0 1320 pair_string=['Di= ' num2str(-floor(ipair/2)) '|' num2str(ceil(ipair/2)) ]; 1321 if ~isempty(time) 1322 if ref_i<=floor(ipair/2) 1323 ref_i=floor(ipair/2)+1;% shift ref_i to get the first pair 1324 end 1325 Dt=time(ref_i+ceil(ipair/2),ref_j)-time(ref_i-floor(ipair/2),ref_j); 1326 pair_string=[pair_string ', Dt=' num2str(Dt) ' ' dtunit]; 1327 end 1328 displ_pair=[displ_pair;{pair_string}]; 1329 end 1330 end 1331 if ~isempty(displ_pair) 1332 displ_pair=[displ_pair;{'Di=*|*'}]; 1333 end 1334 elseif strcmp(mode,'series(Dj)') 1335 if isempty(j2_series) 1336 msgbox_uvmat('ERROR','no j1-j2 pair available') 1337 return 1338 end 1339 diff_j=j2_series-j1_series; 1340 min_diff=min(diff_j(diff_j>0)); 1341 max_diff=max(diff_j(diff_j>0)); 1342 for ipair=min_diff:max_diff 1343 if numel(diff_j(diff_j==ipair))>0 1344 pair_string=['Dj= ' num2str(-floor(ipair/2)) '|' num2str(ceil(ipair/2)) ]; 1345 if ~isempty(time) 1346 if ref_j<=floor(ipair/2) 1347 ref_j=floor(ipair/2)+1;% shift ref_i to get the first pair 1348 end 1349 Dt=time(ref_i,ref_j+ceil(ipair/2))-time(ref_i,ref_j-floor(ipair/2)); 1350 pair_string=[pair_string ', Dt=' num2str(Dt) ' ' dtunit]; 1351 end 1352 displ_pair=[displ_pair;{pair_string}]; 1353 end 1354 end 1355 if ~isempty(displ_pair) 1356 displ_pair=[displ_pair;{'Dj=*|*'}]; 1357 end 1358 elseif strcmp(mode,'bursts') 1359 if isempty(j2_series) 1360 msgbox_uvmat('ERROR','no j1-j2 pair available') 1361 return 1362 end 1363 diff_j=j2_series-j1_series; 1364 min_j1=min(j1_series(j1_series>0)); 1365 max_j1=max(j1_series(j1_series>0)); 1366 min_j2=min(j2_series(j2_series>0)); 1367 max_j2=max(j2_series(j2_series>0)); 1368 for pair1=min_j1:min(max_j1,min_j1+20) 1369 for pair2=min_j2:min(max_j2,min_j2+20) 1370 if numel(j1_series(j1_series==pair1))>0 && numel(j2_series(j2_series==pair2))>0 1371 displ_pair=[displ_pair;{['j= ' num2str(pair1) '-' num2str(pair2)]}]; 1372 end 1373 end 1374 end 1375 if ~isempty(displ_pair) 1376 displ_pair=[displ_pair;{'j=*-*'}]; 1377 end 1378 end 1379 set(handles.num_ref_i,'String',num2str(ref_i)) % update ref_i and ref_j 1380 set(handles.num_ref_j,'String',num2str(ref_j)) 1381 1382 %% display list of pairstring 1383 SeriesData=get(handles.series,'UserData'); 1384 displ_pair_list=get(handles.ListPairs,'String'); 1385 NewVal=[]; 1386 if ~isempty(displ_pair_list) 1387 Val=get(handles.ListPairs,'Value'); 1388 NewVal=find(strcmp(displ_pair_list{Val},displ_pair),1);% look at the previous display in the new menu displ_pï¿œir 1389 end 1390 if ~isempty(NewVal) 1391 set(handles.ListPairs,'Value',NewVal) 1392 SeriesData.ListPairsValue=NewVal; 1393 else 1394 set(handles.ListPairs,'Value',1) 1395 SeriesData.ListPairsValue=1; 1396 end 1397 set(handles.ListPairs,'String',displ_pair) 1398 SeriesData.ListPairsMenu=displ_pair; 1399 set(handles.series,'UserData',SeriesData); 1271 PairString=get(hObject,'Data'); 1272 if ~isempty(PairString{eventdata.Indices(1)}) 1273 SetPairs_Callback(hObject, eventdata.Indices(1), handles) 1274 end 1275 end 1400 1276 1401 1277 %------------------------------------- … … 1405 1281 set(handles.num_last_i,'Visible',state) 1406 1282 set(handles.num_incr_i,'Visible',state) 1407 set(handles.num_ref_i,'Visible',state)1408 set(handles.ref_i_text,'Visible',state)1409 1283 1410 1284 %----------------------------------- … … 1414 1288 set(handles.num_last_j,'Visible',state) 1415 1289 set(handles.num_incr_j,'Visible',state) 1416 set(handles.num_ref_j,'Visible',state)1417 set(handles.ref_j_text,'Visible',state)1418 1290 set(handles.MinIndex_j,'Visible',state) 1419 1291 set(handles.MaxIndex_j,'Visible',state) … … 2069 1941 end 2070 1942 2071 %% Detect the types of input files 1943 1944 %% Visibility of VelType and VelType_1 menus asked by ActionName 1945 VelTypeRequest=1;%VelType requested by default 1946 VelTypeRequest_1=1;%VelType requested by default 1947 if isfield(ParamOut,'VelType') 1948 VelTypeRequest=ismember(ParamOut.VelType,{'on','one','two'}); 1949 VelTypeRequest_1=strcmp( ParamOut.VelType,'two'); 1950 end 1951 FieldNameRequest=0; %hidden by default 1952 FieldNameRequest_1=0; %hidden by default 1953 if isfield(ParamOut,'FieldName') 1954 FieldNameRequest=ismember(ParamOut.FieldName,{'on','one','two'}); 1955 FieldNameRequest_1=strcmp( ParamOut.FieldName,'two'); 1956 end 1957 1958 %% Detect the types of input files and set menus and default options in 'VelType' 2072 1959 SeriesData=get(handles.series,'UserData');% info on the input file series 2073 iview_civ=[];nb_netcdf=0; 2074 if ~isempty(SeriesData)&&isfield(SeriesData,'FileType') 2075 iview_civ=find(strcmp('civx',SeriesData.FileType)|strcmp('civdata',SeriesData.FileType)); 2076 nb_netcdf=numel(find(strcmp('netcdf',SeriesData.FileType))); 2077 end 2078 if numel(iview_civ)>=1 && ~isempty(iview_civ(1)) 1960 iview_civ=find(strcmp('civx',SeriesData.FileType)|strcmp('civdata',SeriesData.FileType)); 1961 iview_netcdf=find(strcmp('netcdf',SeriesData.FileType)|strcmp('civx',SeriesData.FileType)|strcmp('civdata',SeriesData.FileType));% all nc files, icluding civ 1962 FieldList=get(handles.FieldName,'String');% previous list as default 1963 FieldList_1=get(handles.FieldName_1,'String');% previous list as default 1964 CheckList=0;% indicate whether FieldName has been updated 1965 CheckList_1=1;% indicate whether FieldName_1 has been updated 1966 handles_coord=[handles.Coord_x handles.Coord_y handles.Coord_z handles.Coord_x_title handles.Coord_y_title handles.Coord_z_title]; 1967 if VelTypeRequest && numel(iview_civ)>=1 2079 1968 menu=set_veltype_display(SeriesData.FileInfo{iview_civ(1)}.CivStage,SeriesData.FileType{iview_civ(1)}); 2080 1969 set(handles.VelType,'Value',1)% set first choice by default 2081 1970 set(handles.VelType,'String',[{'*'};menu]) 2082 if numel(iview_civ)>=2 1971 set(handles.VelType,'Visible','on') 1972 set(handles.VelType_title,'Visible','on') 1973 FieldList=[set_field_list('U','V');{'C'};{'get_field...'}];%standard menu for civx data 1974 CheckList=1; 1975 set(handles.FieldName,'Value',1); %velocity vector choice by default 1976 if VelTypeRequest_1 && numel(iview_civ)>=2 2083 1977 menu=set_veltype_display(SeriesData.FileInfo{iview_civ(2)}.CivStage,SeriesData.FileType{iview_civ(2)}); 2084 1978 set(handles.VelType_1,'Value',1)% set first choice by default 2085 1979 set(handles.VelType_1,'String',[{'*'};menu]) 2086 end 2087 end 1980 set(handles.VelType_1,'Visible','on') 1981 set(handles.VelType_title_1,'Visible','on') 1982 FieldList_1=[set_field_list('U','V');{'C'};{'get_field...'}];%standard menu for civx data 1983 CheckList_1=1; 1984 set(handles.FieldName_1,'Value',1); %velocity vector choice by default 1985 else 1986 set(handles.VelType_1,'Visible','off') 1987 set(handles.VelType_title_1,'Visible','off') 1988 end 1989 else 1990 set(handles.VelType,'Visible','off') 1991 set(handles.VelType_title,'Visible','off') 1992 end 1993 1994 %% Detect the types of input files and set menus and default options in 'FieldName' 1995 if FieldNameRequest && numel(iview_netcdf)>=1 1996 set(handles.InputFields,'Visible','on') 1997 % set(handles.FieldName,'Visible','on') 1998 if CheckList==0 % not civ input made 1999 ListVarName=SeriesData.FileInfo{iview_netcdf(1)}.ListVarName; 2000 ind_var=get(handles.FieldName,'Value');%indices of previously selected variables 2001 for ilist=1:numel(ind_var) 2002 if isempty(find(strcmp(FieldList{ind_var(ilist)},ListVarName))) 2003 FieldList={};% previous choice not consistent with new input field 2004 set(handles.FieldName,'Value',1) 2005 break 2006 end 2007 end 2008 if ~isempty(FieldList) 2009 if isempty(find(strcmp(get(handles.Coord_x,'String'),ListVarName)))||... 2010 isempty(find(strcmp(get(handles.Coord_y,'String'),ListVarName))) 2011 FieldList={}; 2012 set(handles.Coord_x,'String','') 2013 set(handles.Coord_y,'String','') 2014 end 2015 Coord_z=get(handles.Coord_z,'String'); 2016 if ~isempty(Coord_z) && isempty(find(strcmp(Coord_z,ListVarName))) 2017 FieldList={}; 2018 set(handles.Coord_z,'String','') 2019 end 2020 end 2021 set(handles_coord,'Visible','on') 2022 FieldList=[FieldList;{'get_field...'}]; 2023 if FieldNameRequest_1 && numel(iview_netcdf)>=2 2024 set(handles.FieldName_1,'Visible','on') 2025 if CheckList_1==0 % not civ input made 2026 ListVarName=SeriesData.FileInfo{iview_netcdf(2)}.ListVarName; 2027 ind_var=get(handles.FieldName,'Value');%indices of previously selected variables 2028 for ilist=1:numel(ind_var) 2029 if isempty(find(strcmp(FieldList{ind_var(ilist)},ListVarName))) 2030 FieldList_1={};% previous choice not consistent with new input field 2031 set(handles.FieldName_1,'Value',1) 2032 break 2033 end 2034 end 2035 warn_coord=0; 2036 if isempty(find(strcmp(get(handles.Coord_x,'String'),ListVarName)))||... 2037 isempty(find(strcmp(get(handles.Coord_y,'String'),ListVarName))) 2038 warn_coord=1; 2039 end 2040 if ~isempty(Coord_z) && isempty(find(strcmp(Coord_z,ListVarName))) 2041 FieldList_1={}; 2042 warn_coord=1; 2043 end 2044 if warn_coord 2045 msgbox_uvmat('WARNING','coordiante names do not exist in the second netcdf input file') 2046 end 2047 set(handles.FieldName,'String',[FieldList;{'get_field...'}]) 2048 set(handles.FieldName_1,'Visible','on') 2049 set(handles.FieldName_1,'Value',1) 2050 set(handles.FieldName_1,'String',FieldList_1) 2051 end 2052 else 2053 set(handles.FieldName_1,'Visible','off') 2054 end 2055 else 2056 set(handles_coord,'Visible','off')% no coord display for civ data 2057 end 2058 set(handles.FieldName,'String',FieldList) 2059 else 2060 set(handles.InputFields,'Visible','off') 2061 end 2062 2088 2063 2089 2064 %% Check whether alphabetical sorting of input Subdir is allowed by the Action fct (for multiples series entries) … … 2121 2096 if isfield(Param.IndexRange,'first_i') 2122 2097 first_i=Param.IndexRange.first_i; 2123 % incr_i=Param.IndexRange.incr_i;2124 2098 last_i=Param.IndexRange.last_i; 2125 2099 end 2126 2100 if isfield(Param.IndexRange,'first_j') 2127 2101 first_j=Param.IndexRange.first_j; 2128 % incr_j=Param.IndexRange.incr_j;2129 2102 last_j=Param.IndexRange.last_j; 2130 2103 end … … 2133 2106 end 2134 2107 2135 %% desable j index if if set by the civ_input GUI 2108 %% enable or desable j index visibility 2109 status_j='on';%default 2136 2110 if isfield(ParamOut,'Desable_j_index')&&isequal(ParamOut.Desable_j_index,'on') 2137 set(handles.num_first_j,'Enable','off') 2138 set(handles.num_last_j,'Enable','off') 2139 set(handles.num_incr_j,'Enable','off') 2140 set(handles.num_incr_j,'String','') 2141 else 2142 set(handles.num_first_j,'Enable','on') 2143 set(handles.num_last_j,'Enable','on') 2144 set(handles.num_incr_j,'Enable','on') 2145 end 2111 status_j='off'; 2112 end 2113 if isempty(find(~cellfun(@isempty,SeriesData.j1_series), 1)); % case of empty j indices 2114 status_j='off'; % no j index needed 2115 elseif strcmp(get(handles.PairString,'Visible'),'on') 2116 check_burst=cellfun(@isempty,regexp(get(handles.PairString,'Data'),'^j'));%=0 for burst case, 1 otherwise 2117 if isempty(find(check_burst, 1))% if all pair string begins by j (burst) 2118 status_j='off'; % no j index needed for bust case 2119 end 2120 end 2121 enable_j(handles,status_j) % no j index needed 2122 2146 2123 2147 2124 %% NbSlice visibility … … 2156 2133 set(handles.NbSlice_title,'Visible',NbSliceVisible) 2157 2134 2158 %% Visibility of VelType and VelType_1 menus 2159 VelTypeVisible='off'; %hidden by default 2160 VelType_1Visible='off'; 2161 InputFieldsVisible='off';%visibility of the frame Fields 2162 if isfield(ParamOut,'VelType') 2163 if strcmp( ParamOut.VelType,'on')||strcmp(ParamOut.VelType,'one')||strcmp( ParamOut.VelType,'two') 2164 if numel(iview_civ)>=1 2165 VelTypeVisible='on'; 2166 InputFieldsVisible='on'; 2167 end 2168 end 2169 if strcmp( ParamOut.VelType,'two') 2170 if numel(iview_civ)>=2 2171 VelType_1Visible='on'; 2172 end 2173 end 2174 end 2175 set(handles.VelType,'Visible',VelTypeVisible) 2176 set(handles.VelType_text,'Visible',VelTypeVisible); 2177 set(handles.VelType_1,'Visible',VelType_1Visible) 2178 set(handles.VelType_text_1,'Visible',VelType_1Visible); 2179 2180 %% Visibility of FieldName and FieldName_1 menus 2181 FieldNameVisible='off'; %hidden by default 2182 FieldName_1Visible='off'; %hidden by default 2183 if isfield(ParamOut,'FieldName') 2184 if strcmp( ParamOut.FieldName,'on') || strcmp(ParamOut.FieldName,'one')||strcmp( ParamOut.FieldName,'two') 2185 if (numel(iview_civ)+nb_netcdf)>=1 2186 InputFieldsVisible='on'; 2187 FieldNameVisible='on'; 2188 end 2189 end 2190 if strcmp( ParamOut.FieldName,'two') 2191 if (numel(iview_civ)+nb_netcdf)>=1 2192 FieldName_1Visible='on'; 2193 end 2194 end 2195 end 2196 set(handles.InputFields,'Visible',InputFieldsVisible) 2197 set(handles.FieldName,'Visible',FieldNameVisible) % test for MenuBorser 2198 set(handles.FieldName_1,'Visible',FieldName_1Visible) 2135 2199 2136 2200 2137 %% Visibility of FieldTransform menu … … 2230 2167 MaskVisible=ParamOut.Mask; 2231 2168 end 2232 %set(handles.Mask,'Visible',MaskVisible)2233 2169 set(handles.CheckMask,'Visible',MaskVisible); 2234 2170 … … 2272 2208 %% definition of an additional parameter set, determined by an ancillary GUI 2273 2209 if isfield(ParamOut,'ActionInput') 2274 % set(handles.ActionInput,'Visible','on')2275 % set(handles.ActionInput_title,'Visible','on')2276 2210 set(handles.ActionInput,'Visible','on') 2277 % set(handles.ActionInput,'Value',0)2278 % set(handles.ActionInput,'String',ActionName)2279 2211 ParamOut.ActionInput.Program=ActionName; % record the program in ActionInput 2280 2212 SeriesData.ActionInput=ParamOut.ActionInput; 2281 2213 else 2282 % set(handles.ActionInput,'Visible','off')2283 % set(handles.ActionInput_title,'Visible','off')2284 2214 set(handles.ActionInput,'Visible','off') 2285 2215 if isfield(SeriesData,'ActionInput') 2286 SeriesData=rmfield(SeriesData,'ActionInput');2287 end 2288 end 2216 SeriesData=rmfield(SeriesData,'ActionInput'); 2217 end 2218 end 2289 2219 set(handles.series,'UserData',SeriesData) 2290 2220 set(handles.ActionName,'BackgroundColor',[1 1 1]) … … 2347 2277 YName='y'; 2348 2278 set(handles.VelType,'visible','on') 2279 set(handles.VelType_title,'visible','on') 2349 2280 end 2350 2281 set(handles.FieldName,'Value',1) … … 2353 2284 set(handles.FieldName,'Value',1:numel(FieldList))%select all input fields by default 2354 2285 set(handles.VelType,'visible','off') 2286 set(handles.VelType_title,'visible','off') 2355 2287 XName=GetFieldData.Coordinates.Coord_x; 2356 2288 YName=GetFieldData.Coordinates.Coord_y; … … 2714 2646 function MenuHelp_Callback(hObject, eventdata, handles) 2715 2647 %------------------------------------------------------------------- 2716 path_to_uvmat=which ('uvmat');% check the path of uvmat 2717 pathelp=fileparts(path_to_uvmat); 2718 helpfile=fullfile(pathelp,'uvmat_doc','uvmat_doc.html'); 2719 if isempty(dir(helpfile)), msgbox_uvmat('ERROR','Please put the help file uvmat_doc.html in the sub-directory /uvmat_doc of the UVMAT package') 2720 else 2721 addpath (fullfile(pathelp,'uvmat_doc')) 2722 web([helpfile '#series']) 2723 end 2648 web('http://servforge.legi.grenoble-inp.fr/projects/soft-uvmat/wiki/UvmatHelp#series') 2649 % path_to_uvmat=which ('uvmat');% check the path of uvmat 2650 % pathelp=fileparts(path_to_uvmat); 2651 % helpfile=fullfile(pathelp,'uvmat_doc','uvmat_doc.html'); 2652 % if isempty(dir(helpfile)), msgbox_uvmat('ERROR','Please put the help file uvmat_doc.html in the sub-directory /uvmat_doc of the UVMAT package') 2653 % else 2654 % addpath (fullfile(pathelp,'uvmat_doc')) 2655 % web([helpfile '#series']) 2656 % end 2724 2657 2725 2658 %------------------------------------------------------------------- … … 2774 2707 % --- fct activated by the upper bar menu ExportConfig 2775 2708 %------------------------------------------------------------------------ 2776 function Menu ExportConfig_Callback(hObject, eventdata, handles)2709 function MenuDisplayConfig_Callback(hObject, eventdata, handles) 2777 2710 2778 2711 global Param … … 2788 2721 %------------------------------------------------------------------------ 2789 2722 function MenuImportConfig_Callback(hObject, eventdata, handles) 2790 % SeriesData=get(handles.series,'UserData'); 2791 % if isfield(SeriesData,'RefFile') 2792 % oldfile=SeriesData.RefFile{1}; 2793 % end 2794 %% use a strating file name for browserr 2723 2724 %% use a starting file name for browserr 2795 2725 InputTable=get(handles.InputTable,'Data'); 2796 2726 oldfile=InputTable{1,1}; … … 2830 2760 set(handles.ActionInput,'Visible','on') 2831 2761 set(handles.ActionInput,'Value',0) 2762 Param.ActionInput.ConfigSource=filexml;% record the source of config for future info 2832 2763 SeriesData.ActionInput=Param.ActionInput; 2833 2764 end … … 3136 3067 3137 3068 % --- Executes on button press in SetPairs. 3138 function SetPairs_Callback(hObject, eventdata, handles) 3069 function SetPairs_Callback(hObject, iview, handles) 3070 3071 %% delete previous occurrence of 'set_pairs' 3072 hfig=findobj(allchild(0),'Tag','set_pairs'); 3073 if ~isempty(hfig) 3074 delete(hfig) 3075 end 3139 3076 3140 3077 %% create the GUI set_pairs … … 3149 3086 hfig=figure('name','set_pairs','tag','set_pairs','MenuBar','none','NumberTitle','off','Unit','points','Position',[Left,Bottom,Width,Height]); 3150 3087 BackgroundColor=get(hfig,'Color'); 3151 hh=0.14; % box height (relative)3152 ii=0.01; % gap between uicontrols3153 3154 ww=0.9; % box width (relative)3155 3088 SeriesData=get(handles.series,'UserData'); 3089 TimeUnit=get(handles.TimeUnit,'String'); 3090 PairString=get(handles.PairString,'Data'); 3091 ListViewLines=find(cellfun('isempty',PairString)==0);%find list of non empty pairs 3092 ListViewMenu=cell(numel(ListViewLines),1); 3093 for ilist=1:numel(ListViewLines) 3094 ListViewMenu{ilist}=num2str(ListViewLines(ilist)); 3095 end 3096 if isempty(iview) 3097 ListViewValue=numel(ListViewLines);% we work by default on the pair option for the last line which requires pairs 3098 iview=ListViewLines(end); 3099 else 3100 ListViewValue=find(ListViewLines==iview); 3101 end 3102 [ModeMenu,ModeValue]=update_mode(SeriesData.i1_series{iview},SeriesData.i2_series{iview},SeriesData.j2_series{iview}); 3103 displ_pair=update_listpair(SeriesData.i1_series{iview},SeriesData.i2_series{iview},SeriesData.j1_series{iview},SeriesData.j2_series{iview},ModeMenu{ModeValue},... 3104 SeriesData.Time{iview},TimeUnit,SeriesData.ref_i,SeriesData.ref_j); 3156 3105 % first raw of the GUI 3157 3106 uicontrol('Style','text','Units','normalized', 'Position', [0.05 0.88 0.5 0.1],'BackgroundColor',BackgroundColor,... 3158 3107 'String','row to edit #','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','right');%title 3159 uicontrol('Style','popupmenu','Units','normalized', 'Position', [0.54 0.8 0.3 0.2],'tag','ListView','BackgroundColor',[1 1 1],... 3160 'String',SeriesData.ListViewMenu,'Value',SeriesData.ListViewValue,'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''ListView'':choice of the file series w for pair display'); 3108 uicontrol('Style','popupmenu','Units','normalized', 'Position', [0.54 0.8 0.3 0.2],'BackgroundColor',[1 1 1],... 3109 'Callback',@(hObject,eventdata)ListView_Callback(hObject,eventdata),'String',ListViewMenu,'Value',ListViewValue,'FontUnits','points','FontSize',12,'FontWeight','bold',... 3110 'Tag','ListView','TooltipString','''ListView'':choice of the file series w for pair display'); 3161 3111 % second raw of the GUI 3162 3112 uicontrol('Style','text','Units','normalized', 'Position', [0.05 0.79 0.7 0.1],'BackgroundColor',BackgroundColor,... 3163 3113 'String','mode of index pairing:','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','left');%title 3164 uicontrol('Style','popupmenu','Units','normalized', 'Position', [0.05 0.62 ww 0.2],'tag','Mode','BackgroundColor',[1 1 1],'Callback',@(hObject,eventdata)ModeMenu_Callback(hObject,eventdata),... 3165 'String',SeriesData.ModeMenu,'Value',SeriesData.ModeValue,'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''Mode'': choice of the image pair mode'); 3114 uicontrol('Style','popupmenu','Units','normalized', 'Position', [0.05 0.62 0.9 0.2],'BackgroundColor',[1 1 1],... 3115 'Callback',@(hObject,eventdata)Mode_Callback(hObject,eventdata),'String',ModeMenu,'Value',ModeValue,'FontUnits','points','FontSize',12,'FontWeight','bold',... 3116 'Tag','Mode','TooltipString','''Mode'': choice of the image pair mode'); 3166 3117 % third raw 3167 3118 uicontrol('Style','text','Units','normalized', 'Position', [0.05 0.6 0.7 0.1],'BackgroundColor',BackgroundColor,... 3168 3119 'String','pair choice:','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','left');%title 3169 uicontrol('Style','listbox','Units','normalized', 'Position', [0.05 0.42 ww 0.2],'tag','ListPairs','BackgroundColor',[1 1 1],'Callback',@(hObject,eventdata)ListPairsMenu_Callback(hObject,eventdata),... 3170 'String',SeriesData.ListPairsMenu,'Value',SeriesData.ListPairsValue,'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''ListPairs'': menu for selecting the image pair'); 3120 uicontrol('Style','listbox','Units','normalized', 'Position', [0.05 0.42 0.9 0.2],'BackgroundColor',[1 1 1],... 3121 'Callback',@(hObject,eventdata)ListPair_Callback(hObject,eventdata),'String',displ_pair,'Value',1,'FontUnits','points','FontSize',12,'FontWeight','bold',... 3122 'Tag','ListPair','TooltipString','''ListPair'': menu for selecting the image pair'); 3171 3123 uicontrol('Style','text','Units','normalized', 'Position', [0.1 0.22 0.8 0.1],'BackgroundColor',BackgroundColor,... 3172 3124 'String','ref_i ref_j','FontUnits','points','FontSize',12,'FontWeight','bold','ForegroundColor','blue','HorizontalAlignment','center');%title 3173 uicontrol('Style','edit','Units','normalized', 'Position', [0.15 0.17 0.3 0.08],'tag','num_ref_i','BackgroundColor',[1 1 1],'Callback',@(hObject,eventdata)num_ref_i_Callback(hObject,eventdata),... 3174 'String',num2str(SeriesData.ref_i),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_ref_i'': reference field index i used to display dt in ''list_pair_civ'''); 3175 uicontrol('Style','edit','Units','normalized', 'Position', [0.55 0.17 0.3 0.08],'tag','num_ref_j','BackgroundColor',[1 1 1],'Callback',@(hObject,eventdata)num_ref_j_Callback(hObject,eventdata),... 3176 'String',num2str(SeriesData.ref_j),'FontUnits','points','FontSize',12,'FontWeight','bold','TooltipString','''num_ref_j'': reference field index i used to display dt in ''list_pair_civ'''); 3125 uicontrol('Style','edit','Units','normalized', 'Position', [0.15 0.17 0.3 0.08],'BackgroundColor',[1 1 1],... 3126 'Callback',@(hObject,eventdata)num_ref_i_Callback(hObject,eventdata),'String',num2str(SeriesData.ref_i),'FontUnits','points','FontSize',12,'FontWeight','bold',... 3127 'Tag','num_ref_i','TooltipString','''num_ref_i'': reference field index i used to display dt in ''list_pair_civ'''); 3128 uicontrol('Style','edit','Units','normalized', 'Position', [0.55 0.17 0.3 0.08],'BackgroundColor',[1 1 1],... 3129 'Callback',@(hObject,eventdata)num_ref_j_Callback(hObject,eventdata),'String',num2str(SeriesData.ref_j),'FontUnits','points','FontSize',12,'FontWeight','bold',... 3130 'Tag','num_ref_j','TooltipString','''num_ref_j'': reference field index i used to display dt in ''list_pair_civ'''); 3177 3131 % last raw of the GUI: pushbuttons 3178 uicontrol('Style','pushbutton','Units','normalized', 'Position', [0.35 0.01 0.3 0.15],'BackgroundColor',[0 1 0],'String','OK','Callback',@(hObject,eventdata)OK_Callback(hObject,eventdata),...3179 'FontWeight','bold','FontUnits','points','FontSize',12,'TooltipString','''OK'': apply the output to the current field series in uvmat');3132 % uicontrol('Style','pushbutton','Units','normalized', 'Position', [0.35 0.01 0.3 0.15],'BackgroundColor',[0 1 0],'String','OK','Callback',@(hObject,eventdata)OK_Callback(hObject,eventdata),... 3133 % 'FontWeight','bold','FontUnits','points','FontSize',12,'TooltipString','''OK'': apply the output to the current field series in uvmat'); 3180 3134 drawnow 3181 3135 3182 function ModeMenu_Callback(hObject,eventdata) 3183 hseries=findobj(allchild(0),'tag','series'); 3184 hhseries=guidata(hseries); 3136 %------------------------------------------------------------------------ 3137 function ListView_Callback(hObject,eventdata) 3138 Mode_Callback(hObject,eventdata) 3139 3140 %------------------------------------------------------------------------ 3141 function Mode_Callback(hObject,eventdata) 3142 %% get input info 3143 hseries=findobj(allchild(0),'tag','series');%handles of the GUI series 3144 hhseries=guidata(hseries);%handles of the elements in the GUI series 3145 TimeUnit=get(hhseries.TimeUnit,'String'); 3185 3146 SeriesData=get(hseries,'UserData'); 3147 mode_list=get(hObject,'String'); 3148 mode=mode_list{get(hObject,'Value')}; 3186 3149 hListView=findobj(get(hObject,'parent'),'Tag','ListView'); 3187 3150 iview=get(hListView,'Value'); 3188 hMode=findobj(get(hObject,'parent'),'Tag','Mode'); 3189 mode_list=get(hMode,'String'); 3190 mode=mode_list{get(hMode,'Value')}; 3191 if isequal(mode,'bursts') 3192 enable_i(hhseries,'On') 3193 enable_j(hhseries,'Off') %do not display j index scanning in burst mode (j is fixed by the burst choice) 3194 else 3195 enable_i(hhseries,'On') 3196 enable_j(hhseries,'Off') 3197 end 3198 fill_ListPair(hhseries,SeriesData.i1_series{iview},SeriesData.i2_series{iview},... 3199 SeriesData.j1_series{iview},SeriesData.j2_series{iview},SeriesData.Time{iview}) 3200 ListPairs_Callback([],[],hhseries) 3151 i1_series=SeriesData.i1_series{iview}; 3152 i2_series=SeriesData.i2_series{iview}; 3153 j1_series=SeriesData.j1_series{iview}; 3154 j2_series=SeriesData.j2_series{iview}; 3155 3156 %% enable j index visibility after the new choice 3157 status_j='on';%default 3158 if isempty(find(~cellfun(@isempty,SeriesData.j1_series), 1)); % case of empty j indices 3159 status_j='off'; % no j index needed 3160 elseif strcmp(get(handles.PairString,'Visible'),'on') 3161 check_burst=cellfun(@isempty,regexp(PairString,'^j'));%=0 for burst case, 1 otherwise 3162 if isempty(find(check_burst, 1))% if all pair string begins by j (burst) 3163 status_j='off'; % no j index needed for bust case 3164 end 3165 end 3166 enable_j(handles,status_j) % no j index needed 3167 3168 %% get the reference indices for the time interval Dt 3169 href_i=findobj(get(hObject,'parent'),'Tag','ref_i'); 3170 ref_i=[];ref_j=[]; 3171 if strcmp(get(href_i,'Visible'),'on') 3172 ref_i=str2num(get(href_i,'String')); 3173 end 3174 if isempty(ref_i) 3175 ref_i=1; 3176 end 3177 if isempty(ref_j) 3178 ref_j=1; 3179 end 3180 3181 %% update the menu ListPair 3182 Menu=update_listpair(i1_series,i2_series,j1_series,j2_series,mode,SeriesData.Time{iview},TimeUnit,ref_i,ref_j); 3183 hlist_pairs=findobj(get(hObject,'parent'),'Tag','ListPair'); 3184 set(hlist_pairs,'Value',1)% set the first choice by default in ListPair 3185 set(hlist_pairs,'String',Menu)% set the menu in ListPair 3186 ListPair_Callback(hlist_pairs,[])% apply the default choice in ListPair 3201 3187 3202 3188 %------------------------------------------------------------- 3203 % --- Executes on selection in ListPair s.3204 function ListPair sMenu_Callback(hObject,eventdata)3189 % --- Executes on selection in ListPair. 3190 function ListPair_Callback(hObject,eventdata) 3205 3191 %------------------------------------------------------------ 3206 3192 list_pair=get(hObject,'String');%get the menu of image pairs … … 3209 3195 else 3210 3196 string=list_pair{get(hObject,'Value')}; 3211 string=regexprep(string,',.*','');%removes time indication (after ',')3197 % string=regexprep(string,',.*','');%removes time indication (after ',') 3212 3198 end 3213 3199 hseries=findobj(allchild(0),'tag','series'); … … 3220 3206 set(hPairString,'Data',PairString) 3221 3207 3208 3222 3209 %------------------------------------------------------------------------ 3223 3210 function num_ref_i_Callback(hObject, eventdata) 3224 3211 %------------------------------------------------------------------------ 3225 hMode=findobj(get(hObject,'parent'),'Tag','Mode'); 3226 mode_list=get(hMode,'String'); 3227 mode=mode_list{get(hMode,'Value')}; 3228 hseries=findobj(allchild(0),'tag','series'); 3229 hhseries=guidata(hseries); 3230 SeriesData=get(hseries,'UserData'); 3231 hListView=findobj(get(hObject,'parent'),'Tag','ListView'); 3232 iview=get(hListView,'Value'); 3233 fill_ListPair(hhseries,SeriesData.i1_series{iview},SeriesData.i2_series{iview},... 3234 SeriesData.j1_series{iview},SeriesData.j2_series{iview},SeriesData.Time{iview});% update the menu of pairs depending on the available netcdf files 3235 3236 hListPairs=findobj(get(hObject,'parent'),'Tag','ListPairs'); 3237 ListPairsMenu_Callback(hListPairs,eventdata) 3212 Mode_Callback([],[]) 3238 3213 3239 3214 %------------------------------------------------------------------------ 3240 3215 function num_ref_j_Callback(hObject, eventdata) 3241 3216 %------------------------------------------------------------------------ 3242 num_ref_i_Callback(hObject, eventdata) 3243 3244 %------------------------------------------------------------- 3245 % --- Executes on selection in ListPairs. 3246 function OK_Callback(hObject,eventdata) 3247 %------------------------------------------------------------ 3248 delete(get(hObject,'parent')) 3217 Mode_Callback([],[]) 3218 3219 3220 3221 function Coord_z_Callback(hObject, eventdata, handles) 3222 % hObject handle to Coord_z (see GCBO) 3223 % eventdata reserved - to be defined in a future version of MATLAB 3224 % handles structure with handles and user data (see GUIDATA) 3225 3226 % Hints: get(hObject,'String') returns contents of Coord_z as text 3227 % str2double(get(hObject,'String')) returns contents of Coord_z as a double 3228 3229 3230 3231 % % --- Executes on key press with focus on InputTable and none of its controls. 3232 % function InputTable_KeyPressFcn(hObject, eventdata, handles) 3233 % set(handles.REFRESH,'BackgroundColor',[1 0 1])% set REFRESH button to magenta color to indicate that input refresh is needed 3234 % % set(handles.REFRESH_title,'Visible','on') 3235 % iview=eventdata.Indices(1); 3236 % view_set=get(handles.REFRESH,'UserData'); 3237 % if isempty(find(view_set==iview)) 3238 % set(handles.REFRESH,'UserData',[view_set iview]) 3239 % end 3240 % %% enable other menus and uicontrols 3241 % set(handles.MenuOpenCampaign,'Enable','on') 3242 % set(handles.MenuCampaign_1,'Enable','on') 3243 % set(handles.MenuCampaign_2,'Enable','on') 3244 % set(handles.MenuCampaign_3,'Enable','on') 3245 % set(handles.MenuCampaign_4,'Enable','on') 3246 % set(handles.MenuCampaign_5,'Enable','on') 3247 % set(handles.RUN, 'Enable','On') 3248 % set(handles.RUN,'BackgroundColor',[1 0 0])% set RUN button to red 3249 3250 3251 % hObject handle to InputTable (see GCBO) 3252 % eventdata structure with the following fields (see UITABLE) 3253 % Indices: row and column indices of the cell(s) currently selecteds 3254 % handles structure with handles and user data (see GUIDATA) -
trunk/src/set_object.m
r747 r772 36 36 function varargout = set_object(varargin) 37 37 38 % Last Modified by GUIDE v2.5 13-Apr-2014 19:31:5838 % Last Modified by GUIDE v2.5 08-May-2014 23:03:29 39 39 40 40 % Begin initialization code - DO NOT REFRESH … … 594 594 set(handles.num_RangeY_2,'BackgroundColor',[1 1 1]) 595 595 596 % --- Executes on button press in ExportCoord.597 function ExportCoord_Callback(hObject, eventdata, handles)596 % --- Executes on button press in DisplayCoord. 597 function DisplayCoord_Callback(hObject, eventdata, handles) 598 598 global Coord 599 599 Coord=get(handles.Coord,'Data'); … … 793 793 set(handles.Coord,'Data',Coord); 794 794 end 795 796 797 798 -
trunk/src/uvmat.m
r771 r772 193 193 AxeData.LimEditBox=1; %initialise AxeData 194 194 set(handles.PlotAxes,'UserData',AxeData) 195 % position of table Coord_y196 %set(handles.Coord_y,'Unit','pixel')197 % Pos=get(handles.Coord_y,'Position');198 % set(handles.Coord_y,'Unit','normalized')199 % set(handles.Coord_y,'ColumnWidth',{Pos(3)})200 % set(handles.Coord_y,'ColumnFormat',{'char'})201 % set(handles.Coord_y,'ColumnEditable',false)202 % set(handles.Coord_y,'ColumnName',{''})203 195 204 196 %% set functions for the mouse and keyboard … … 209 201 set(hObject,'DeleteFcn',{@closefcn})% 210 202 set(hObject,'ResizeFcn',{@ResizeFcn,handles})% 211 % set(handles.RootPath,'ButtonDownFcn',{'@mouse_down_control'})%set mouse click action function212 203 213 204 %% initialisation … … 5518 5509 %------------------------------------------------------------------------ 5519 5510 Param=read_param(handles); 5511 Param.HiddenData=get(handles.uvmat,'UserData'); 5520 5512 series(Param); %run the series interface 5521 5513 … … 5523 5515 function MenuPIV_Callback(hObject, eventdata, handles) 5524 5516 Param=read_param(handles); 5525 % Param.ActionName='civ_series';5517 Param.HiddenData=get(handles.uvmat,'UserData'); 5526 5518 hseries=series(Param); 5527 5519 hhseries=guidata(hseries); -
trunk/src/view_field.m
r752 r772 190 190 hhuvmat=guidata(huvmat); 191 191 set(hhuvmat.CheckViewField,'Value',0) 192 %set(hhuvmat.edit_object,'BackgroundColor',[0.7 0.7 0.7])%put unactivated buttons to gree193 192 % deselect the object in ListObject when view_field is closed 194 193 if isempty(findobj(allchild(0),'Tag','set_object')) … … 215 214 end 216 215 end 217 hciv=findobj(allchild(0),'Tag','civ ');%find the current civ GUI216 hciv=findobj(allchild(0),'Tag','civ_input');%find the current civ GUI 218 217 if ~isempty(hciv) 219 218 hhciv=guidata(hciv); 220 219 set(hhciv.TestCiv1,'Value',0)% desactivate TestCiv1 if on 221 set(hhciv.TestCiv1,'BackgroundColor',[ 1 00])%220 set(hhciv.TestCiv1,'BackgroundColor',[0 1 0])% 222 221 end 223 222 corrfig=findobj(allchild(0),'tag','corrfig');% look for a civ correlation window used with TesCiv1 -
trunk/src/xml2struct.m
r697 r772 17 17 errormsg=''; 18 18 try 19 t=xmltree(filename); 19 t=xmltree(filename);% read the file as an xmltree object t 20 20 catch ME 21 21 errormsg=ME.message; … … 45 45 end 46 46 else 47 ss=convert(t); 47 ss=convert(t);%transform the xmltree object into a Matlab structure. 48 48 s=convert_string(ss); 49 49 end … … 61 61 case 'char' 62 62 % try to convert to number if the char does not correspond to a function (otherwise str2num calls this function as it uses 'eval') 63 if ~isempty(regexp(ss,'^(-*\d+\.*\d*\ *)+$')) || ~isempty(regexp(ss,'\d+e(-|+)\d+')) % if the string corresponds to a set of numbers (with possible sign and decimal, or scientific notation) separated by blanks64 out=s tr2num(ss);63 if exist(ss,'builtin')||exist(ss,'file')% ss corresponds to the name of a builtin Matlab function or a file 64 out=ss; %reproduce the input string 65 65 else 66 sep_ind=regexp(ss,'\s&\s');% check for separator ' & ' which indicates column separation in tables 67 if ~isempty(sep_ind) 68 sep_ind=[-2 sep_ind length(ss)+1]; 69 out={}; 70 for icolumn=1:length(sep_ind)-1 71 out{1,icolumn}=ss(sep_ind(icolumn)+3:sep_ind(icolumn+1)-1);% get info between separators as a cell array 66 out=str2num(ss);% convert to number or vector (str2num applied to a fct name executes this fct by 'eval', thus this possibility had to be ruled out above 67 if isempty(out) 68 sep_ind=regexp(ss,'\s&\s');% check for separator ' & ' which indicates column separation in tables 69 if ~isempty(sep_ind) 70 sep_ind=[-2 sep_ind length(ss)+1]; 71 out={}; 72 for icolumn=1:length(sep_ind)-1 73 out{1,icolumn}=ss(sep_ind(icolumn)+3:sep_ind(icolumn+1)-1);% get info between separators as a cell array 74 end 75 else 76 out=ss; %reproduce the input string 72 77 end 73 else74 out=ss; %reproduce the input string75 78 end 76 79 end
Note: See TracChangeset
for help on using the changeset viewer.