Changeset 645 for trunk/src/series
- Timestamp:
- May 28, 2013, 11:30:28 PM (12 years ago)
- Location:
- trunk/src/series
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/civ_input.m
r642 r645 25 25 26 26 27 % Last Modified by GUIDE v2.5 2 0-May-2013 09:55:3027 % Last Modified by GUIDE v2.5 25-May-2013 12:37:21 28 28 % Begin initialization code - DO NOT EDIT 29 29 gui_Singleton = 1; … … 288 288 %% list the possible index pairs, depending on the option set in ListPairMode 289 289 ListPairMode_Callback([], [], handles) 290 290 ListPairCiv1_Callback(hObject, eventdata, handles) 291 291 % for movies don't modify except if the current ref is outside index bounds 292 292 %if strcmp(ExtInput,'.nc')|| ~(strcmp(FileType,'mmreader')||strcmp(FileType,'VideoReader') && num_ref_i<=MaxIndex_i && num_ref_j<=MaxIndex_j) … … 426 426 %% update i and j index range if a nc file has been opened or pb withmin max image indices: 427 427 % then set first and last to the inputfile index by default 428 first_i=str2num(get(handles. first_i,'String'));428 first_i=str2num(get(handles.MinIndex_i,'String')); 429 429 last_i=str2num(get(handles.last_i,'String')); 430 430 if isempty(first_i) || isempty(last_i)||isempty(MinIndex_i)||isempty(MaxIndex_i)||ind_opening~=0 || isempty(first_i) || isempty(last_i)|| first_i<MinIndex_i || last_i>MaxIndex_i 431 431 first_i=num_ref_i; 432 432 last_i=num_ref_i; 433 set(handles. first_i,'String',num2str(first_i));433 set(handles.MinIndex_i,'String',num2str(first_i)); 434 434 set(handles.last_i,'String',num2str(last_i));% 435 435 end 436 436 437 437 %j index range 438 first_j=str2num(get(handles. first_j,'String'));438 first_j=str2num(get(handles.MinIndex_j,'String')); 439 439 last_j=str2num(get(handles.last_j,'String')); 440 440 if isempty(first_j) || isempty(last_j)||isempty(MinIndex_j)||isempty(MaxIndex_j)||ind_opening~=0 || first_j<MinIndex_j || last_j>MaxIndex_j 441 441 first_j=num_ref_j; 442 442 last_j=num_ref_j; 443 set(handles. first_j,'String',num2str(first_j));443 set(handles.MinIndex_j,'String',num2str(first_j)); 444 444 set(handles.last_j,'String',num2str(last_j));% 445 445 end … … 618 618 guidata(hObject, handles);% Update handles structure 619 619 uiresume(handles.civ_input); 620 drawnow 621 622 return 623 624 625 set(handles.OK, 'Enable','Off') 626 set(handles.OK,'BackgroundColor',[0.831 0.816 0.784]) 627 set(handles.OK,'UserData',now)% record the time of launch 628 629 errormsg=launch_jobs(hObject, eventdata, handles); 630 set(handles.OK, 'Enable','On') 631 set(handles.OK,'BackgroundColor',[1 0 0]) 632 633 % display errors or start status callback to visualise results 634 if ~isempty(errormsg) 635 display(errormsg) 636 msgbox_uvmat('ERROR',errormsg) 637 elseif isfield(handles,'status') %&& ~isequal(get(handles.ListPairMode,'Value'),3) 638 set(handles.status,'Value',1);%suppress status display 639 status_Callback(hObject, eventdata, handles) 640 end 641 642 643 644 %------------------------------------------------------------------------ 645 % --- determine the list of index pairs of processing file 646 function [i1_civ1,i2_civ1,j1_civ1,j2_civ1,i1_civ2,i2_civ2,j1_civ2,j2_civ2]=... 647 find_pair_indices(handles,ref_i,ref_j,mode) 648 %------------------------------------------------------------------------ 649 650 list_civ1=get(handles.ListPairCiv1,'String'); 651 index_civ1=get(handles.ListPairCiv1,'Value'); 652 str_civ1=list_civ1{index_civ1};%string defining the image pairs for civ1 653 if isempty(str_civ1)||isequal(str_civ1,'') 654 msgbox_uvmat('ERROR','no image pair selected for civ1') 655 return 656 end 657 list_civ2=get(handles.ListPairCiv2,'String'); 658 index_civ2=get(handles.ListPairCiv2,'Value'); 659 if index_civ2>length(list_civ2) 660 list_civ2=list_civ1; 661 index_civ2=index_civ1; 662 end 663 str_civ2=list_civ2{index_civ2};%string defining the image pairs for civ2 664 665 if isequal (mode,'series(Di)') 666 lastfield=str2double(get(handles.nb_field,'String')); 667 i1_civ1=ref_i-floor(index_civ1/2)*ones(size(ref_i));% set of first image numbers 668 i2_civ1=ref_i+ceil(index_civ1/2)*ones(size(ref_i)); 669 j1_civ1=ref_j; 670 j2_civ1=ref_j; 671 i1_civ2=ref_i-floor(index_civ2/2)*ones(size(ref_i)); 672 i2_civ2=ref_i+ceil(index_civ2/2)*ones(size(ref_i)); 673 j1_civ2=ref_j; 674 j2_civ2=ref_j; 675 676 % adjust the first and last field number 677 lastfield=str2double(get(handles.nb_field,'String')); 678 if isnan(lastfield) 679 indsel=find((i1_civ1 >= 1)&(i1_civ2 >= 1)); 680 else 681 indsel=find((i2_civ1 <= lastfield)&(i2_civ2 <= lastfield)&(i1_civ1 >= 1)&(i1_civ2 >= 1)); 682 end 683 if length(indsel)>=1 684 firstind=indsel(1); 685 lastind=indsel(end); 686 set(handles.first_i,'String',num2str(ref_i(firstind)))%update the display of first and last fields 687 set(handles.last_i,'String',num2str(ref_i(lastind))) 688 ref_i=ref_i(indsel); 689 i1_civ1=i1_civ1(indsel); 690 i1_civ2=i1_civ2(indsel); 691 i2_civ1=i2_civ1(indsel); 692 i2_civ2=i2_civ2(indsel); 693 end 694 elseif isequal (mode,'series(Dj)') 695 lastfield_j=str2double(get(handles.nb_field2,'String')); 696 i1_civ1=ref_i;% set of first image numbers 697 i2_civ1=ref_i; 698 j1_civ1=ref_j-floor(index_civ1/2)*ones(size(ref_j)); 699 j2_civ1=ref_j+ceil(index_civ1/2)*ones(size(ref_j)); 700 i1_civ2=ref_i; 701 i2_civ2=ref_i; 702 j1_civ2=ref_j-floor(index_civ2/2)*ones(size(ref_j)); 703 j2_civ2=ref_j+ceil(index_civ2/2)*ones(size(ref_j)); 704 % adjust the first and last field number 705 if isnan(lastfield_j) 706 indsel=find((j1_civ1 >= 1)&(j1_civ2 >= 1)); 707 else 708 indsel=find((j2_civ1 <= lastfield_j)&(j2_civ2 <= lastfield_j)&(j1_civ1 >= 1)&(j1_civ2 >= 1)); 709 end 710 if length(indsel)>=1 711 firstind=indsel(1); 712 lastind=indsel(end); 713 set(handles.first_j,'String',num2str(ref_j(firstind)))%update the display of first and last fields 714 set(handles.last_j,'String',num2str(ref_j(lastind))) 715 ref_j=ref_j(indsel); 716 j1_civ1=j1_civ1(indsel); 717 j2_civ1=j2_civ1(indsel); 718 j1_civ2=j1_civ2(indsel); 719 j2_civ2=j2_civ2(indsel); 720 end 721 elseif isequal(mode,'pair j1-j2') %case of bursts (png_old or png_2D) 722 displ_num=get(handles.ListPairCiv1,'UserData'); 723 i1_civ1=ref_i; 724 i2_civ1=ref_i; 725 j1_civ1=displ_num(1,index_civ1); 726 j2_civ1=displ_num(2,index_civ1); 727 i1_civ2=ref_i; 728 i2_civ2=ref_i; 729 j1_civ2=displ_num(1,index_civ2); 730 j2_civ2=displ_num(2,index_civ2); 731 elseif isequal(mode,'displacement') 732 i1_civ1=ref_i; 733 i2_civ1=ref_i; 734 j1_civ1=ref_j; 735 j2_civ1=ref_j; 736 i1_civ2=ref_i; 737 i2_civ2=ref_i; 738 j1_civ2=ref_j; 739 j2_civ2=ref_j; 740 end 620 621 % %------------------------------------------------------------------------ 622 % % --- determine the list of index pairs of processing file 623 % function [i1_civ1,i2_civ1,j1_civ1,j2_civ1,i1_civ2,i2_civ2,j1_civ2,j2_civ2]=... 624 % find_pair_indices(handles,ref_i,ref_j,mode) 625 % %------------------------------------------------------------------------ 626 % 627 % list_civ1=get(handles.ListPairCiv1,'String'); 628 % index_civ1=get(handles.ListPairCiv1,'Value'); 629 % str_civ1=list_civ1{index_civ1};%string defining the image pairs for civ1 630 % if isempty(str_civ1)||isequal(str_civ1,'') 631 % msgbox_uvmat('ERROR','no image pair selected for civ1') 632 % return 633 % end 634 % list_civ2=get(handles.ListPairCiv2,'String'); 635 % index_civ2=get(handles.ListPairCiv2,'Value'); 636 % if index_civ2>length(list_civ2) 637 % list_civ2=list_civ1; 638 % index_civ2=index_civ1; 639 % end 640 % str_civ2=list_civ2{index_civ2};%string defining the image pairs for civ2 641 % 642 % if isequal (mode,'series(Di)') 643 % lastfield=str2double(get(handles.MaxIndex_i,'String')); 644 % i1_civ1=ref_i-floor(index_civ1/2)*ones(size(ref_i));% set of first image numbers 645 % i2_civ1=ref_i+ceil(index_civ1/2)*ones(size(ref_i)); 646 % j1_civ1=ref_j; 647 % j2_civ1=ref_j; 648 % i1_civ2=ref_i-floor(index_civ2/2)*ones(size(ref_i)); 649 % i2_civ2=ref_i+ceil(index_civ2/2)*ones(size(ref_i)); 650 % j1_civ2=ref_j; 651 % j2_civ2=ref_j; 652 % 653 % % adjust the first and last field number 654 % lastfield=str2double(get(handles.MaxIndex_i,'String')); 655 % if isnan(lastfield) 656 % indsel=find((i1_civ1 >= 1)&(i1_civ2 >= 1)); 657 % else 658 % indsel=find((i2_civ1 <= lastfield)&(i2_civ2 <= lastfield)&(i1_civ1 >= 1)&(i1_civ2 >= 1)); 659 % end 660 % if length(indsel)>=1 661 % firstind=indsel(1); 662 % lastind=indsel(end); 663 % set(handles.MinIndex_i,'String',num2str(ref_i(firstind)))%update the display of first and last fields 664 % set(handles.last_i,'String',num2str(ref_i(lastind))) 665 % ref_i=ref_i(indsel); 666 % i1_civ1=i1_civ1(indsel); 667 % i1_civ2=i1_civ2(indsel); 668 % i2_civ1=i2_civ1(indsel); 669 % i2_civ2=i2_civ2(indsel); 670 % end 671 % elseif isequal (mode,'series(Dj)') 672 % lastfield_j=str2double(get(handles.MaxIndex_j,'String')); 673 % i1_civ1=ref_i;% set of first image numbers 674 % i2_civ1=ref_i; 675 % j1_civ1=ref_j-floor(index_civ1/2)*ones(size(ref_j)); 676 % j2_civ1=ref_j+ceil(index_civ1/2)*ones(size(ref_j)); 677 % i1_civ2=ref_i; 678 % i2_civ2=ref_i; 679 % j1_civ2=ref_j-floor(index_civ2/2)*ones(size(ref_j)); 680 % j2_civ2=ref_j+ceil(index_civ2/2)*ones(size(ref_j)); 681 % % adjust the first and last field number 682 % if isnan(lastfield_j) 683 % indsel=find((j1_civ1 >= 1)&(j1_civ2 >= 1)); 684 % else 685 % indsel=find((j2_civ1 <= lastfield_j)&(j2_civ2 <= lastfield_j)&(j1_civ1 >= 1)&(j1_civ2 >= 1)); 686 % end 687 % if length(indsel)>=1 688 % firstind=indsel(1); 689 % lastind=indsel(end); 690 % set(handles.MinIndex_j,'String',num2str(ref_j(firstind)))%update the display of first and last fields 691 % set(handles.last_j,'String',num2str(ref_j(lastind))) 692 % ref_j=ref_j(indsel); 693 % j1_civ1=j1_civ1(indsel); 694 % j2_civ1=j2_civ1(indsel); 695 % j1_civ2=j1_civ2(indsel); 696 % j2_civ2=j2_civ2(indsel); 697 % end 698 % elseif isequal(mode,'pair j1-j2') %case of bursts (png_old or png_2D) 699 % displ_num=get(handles.ListPairCiv1,'UserData'); 700 % i1_civ1=ref_i; 701 % i2_civ1=ref_i; 702 % j1_civ1=displ_num(1,index_civ1); 703 % j2_civ1=displ_num(2,index_civ1); 704 % i1_civ2=ref_i; 705 % i2_civ2=ref_i; 706 % j1_civ2=displ_num(1,index_civ2); 707 % j2_civ2=displ_num(2,index_civ2); 708 % elseif isequal(mode,'displacement') 709 % i1_civ1=ref_i; 710 % i2_civ1=ref_i; 711 % j1_civ1=ref_j; 712 % j2_civ1=ref_j; 713 % i1_civ2=ref_i; 714 % i2_civ2=ref_i; 715 % j1_civ2=ref_j; 716 % j2_civ2=ref_j; 717 % end 741 718 742 719 %------------------------------------------------------------------------ … … 746 723 ListCompareMode=get(handles.ListCompareMode,'String'); 747 724 option=ListCompareMode{get(handles.ListCompareMode,'Value')}; 725 hseries=findobj(allchild(0),'Tag','series'); 726 SeriesData=get(hseries,'UserData'); 727 check_nc=strcmp(SeriesData.FileType{1},'.nc'); 728 ImageType=SeriesData.FileType(2:end); 729 if check_nc 730 ImageType=SeriesData.FileType(2:end); 731 else 732 ImageType=SeriesData.FileType; 733 end 734 hhseries=guidata(hseries); 735 InputTable=get(hhseries.InputTable,'Data'); 736 OriginIndex='off'; 737 PairIndices='off'; 738 DoubleInputSeries='off'; 748 739 switch option 749 740 case 'PIV' 750 set(handles.RootFile_1,'Visible','Off'); 751 set(handles.sub_txt,'Visible','off') 752 set(handles.RootFile_1,'String',[]); 753 mode_store=get(handles.ListCompareMode,'UserData'); 754 set(handles.ListPairMode,'Visible','on') 755 set(handles.ListPairMode,'Value',1) 756 set(handles.ListPairMode,'String',mode_store) 757 set(handles.CheckStereo,'Value',0) 758 case 'PIV volume' 759 set(handles.RootFile_1,'Visible','Off'); 760 set(handles.sub_txt,'Visible','off') 761 set(handles.RootFile_1,'String',[]); 762 mode_store=get(handles.ListCompareMode,'UserData'); 763 set(handles.ListPairMode,'Visible','on') 741 PairIndices='on';% needs to define index pairs for PIV 742 743 case 'PIV volume' 744 PairIndices='on';% needs to define index pairs for PIV 764 745 set(handles.ListPairMode,'Value',1) 765 746 set(handles.ListPairMode,'String',{'series(Di)'}) 766 set(handles.CheckStereo,'Value',0) 767 set(handles.last_j,'String',get(handles.nb_field2,'String'))% select the whole volume scan by default 768 set(handles.incr_i,'String',num2str(2))% 769 otherwise 770 filebase=get(handles.RootPath,'String'); 771 set(handles.sub_txt,'Visible','on') 772 set(handles.RootFile_1,'Visible','On');%mkes the second file input window visible 773 mode_store=get(handles.ListPairMode,'String');%get the present 'mode' 774 set(handles.ListCompareMode,'UserData',mode_store);%store the mode display 775 set(handles.ListPairMode,'Visible','off') 747 ListPairMode_Callback(hObject, eventdata, handles) 748 % set(handles.RootFile_1,'Visible','Off'); 749 % set(handles.sub_txt,'Visible','off') 750 % set(handles.RootFile_1,'String',[]); 751 % mode_store=get(handles.ListCompareMode,'UserData'); 752 % set(handles.ListPairMode,'Visible','on') 753 % set(handles.ListPairMode,'Value',1) 754 % set(handles.ListPairMode,'String',{'series(Di)'}) 755 % set(handles.CheckStereo,'Value',0) 756 % set(handles.last_j,'String',get(handles.MaxIndex_j,'String'))% select the whole volume scan by default 757 % set(handles.incr_i,'String',num2str(2))% 758 case 'displacement' 759 OriginIndex='on';%define a frame origin for displacement 760 case 'shift' 761 if numel(ImageType)==1 762 fileinput=uigetfile_uvmat('pick a second file series for synchronous shift',InputTable{check_nc+1}); 763 if ~isempty(fileinput) 764 series( 'display_file_name',hhseries,fileinput,'append') 765 end 766 767 768 end 769 end 770 set(handles.num_OriginIndex,'Visible',OriginIndex) 771 set(handles.OriginIndex_title,'Visible',OriginIndex) 772 set(handles.PairIndices,'Visible',PairIndices) 773 ListPairMode_Callback(hObject, eventdata, handles) 776 774 777 %% open an image file with the browser778 ind_opening=1;%default779 browse.incr_pair=[0 0]; %default780 oldfile=get(handles.RootPath,'String');781 menu={'*.png;*.jpg;*.tif;*.avi;*.AVI;', ' (*.png,*.jpg ,.tif, *.avi,*.AVI)';782 '*.png','.png image files'; ...783 '*.jpg',' jpeg image files'; ...784 '*.tif','.tif image files'; ...785 '*.avi;*.AVI','.avi movie files'; ...786 '*.*', 'All Files (*.*)'};787 if strcmp(option,'displacement')788 comment='Pick the reference file for displacements';789 else790 comment='Pick a file of the second series';791 end792 [FileName, PathName] = uigetfile( menu, comment,oldfile);793 fileinput=[PathName FileName];%complete file name794 sizf=size(fileinput);795 if (~ischar(fileinput)||~isequal(sizf(1),1)),return;end %stop if fileinput not a character string796 [path,name,ext]=fileparts(fileinput);797 [path1]=fileparts(filebase);798 if isunix799 [status,path]=system(['readlink ' path]);800 [status,path1]=system(['readlink ' path1]);% look for the true path in case of symbolic paths801 end802 if ~strcmp(path1,path)803 msgbox_uvmat('ERROR','The second image or series must be in the same directory as the first one')804 return805 end806 if strcmp(option,'displacement')807 [tild,RootFile_1]=fileparts(name);808 else809 [FilePath,FileName,Ext]=fileparts(fileinput);810 % detect the file type, get the movie object if relevant, and look for the corresponding file series:811 % the root name and indices may be corrected by including the first index i1 if a corresponding xml file exists812 [RootPath,SubDir,RootFile_1,i1_series,i2_series,j1_series,j2_series,nom_type_1,FileType,FileInfo,Object,i1,i2,j1,j2]=find_file_series(FilePath,[FileName Ext]);813 814 %check image nom type815 if ~strcmp(nom_type_1,get(handles.NomType,'String'))816 msgbox_uvmat('ERROR','The second image series must have the same indexing type as the first one, or use the option displacement for a fixed image')817 return818 end819 end820 %check image extension821 if ~strcmp(ext,get(handles.ImaExt,'String'))822 msgbox_uvmat('ERROR','The second image series must have the same extension name as the first one')823 return824 end825 set(handles.RootFile_1,'String',RootFile_1);826 827 end828 ListPairMode_Callback(hObject, eventdata, handles)829 775 830 776 … … 935 881 function enable_i(handles, state) 936 882 set(handles.itext,'Visible',state) 937 % set(handles. first_i,'Visible',state)883 % set(handles.MinIndex_i,'Visible',state) 938 884 % set(handles.last_i,'Visible',state) 939 885 % set(handles.incr_i,'Visible',state) 940 set(handles. nb_field,'Visible',state)886 set(handles.MaxIndex_i,'Visible',state) 941 887 set(handles.ref_i,'Visible',state) 942 888 943 889 function enable_j(handles, state) 944 890 set(handles.jtext,'Visible',state) 945 % set(handles. first_j,'Visible',state)891 % set(handles.MinIndex_j,'Visible',state) 946 892 % set(handles.last_j,'Visible',state) 947 893 % set(handles.incr_j,'Visible',state) 948 set(handles.nb_field2,'Visible',state) 894 set(handles.MinIndex_j,'Visible',state) 895 set(handles.MaxIndex_j,'Visible',state) 949 896 set(handles.ref_j,'Visible',state) 897 %hseries=findobj(allchild(0),'Tag','series'); 898 %hhseries=guidata(hseries); 899 %series('enable_j',hhseries,state); %file input with xml reading in uvmat, show the image in phys coordinates 900 950 901 951 902 … … 956 907 %reproduce by default the chosen pair in the checkciv2 menu 957 908 list_pair=get(handles.ListPairCiv1,'String');%get the menu of image pairs 958 index_pair=get(handles.ListPairCiv1,'Value'); 959 displ_num=get(handles.ListPairCiv1,'UserData'); 960 list_pair2=get(handles.ListPairCiv2,'String');%get the menu of image pairs 961 if index_pair<=length(list_pair2) 962 set(handles.ListPairCiv2,'Value',index_pair); 963 end 964 965 %update first_i and last_i according to the chosen image pairs 909 PairString=list_pair{get(handles.ListPairCiv1,'Value')}; 910 911 [ind1,ind2]=... 912 find_pair_indices(PairString); 913 hseries=findobj(allchild(0),'Tag','series'); 914 %SeriesData=get(hseries,'UserData'); 915 hhseries=guidata(hseries); 916 set(hhseries.num_first_j,'String',num2str(ind1)); 917 set(hhseries.num_last_j,'String',num2str(ind2)); 918 set(hhseries.num_incr_j,'String',num2str(ind2-ind1)); 919 920 % displ_num=get(handles.ListPairCiv1,'UserData'); 921 % list_pair2=get(handles.ListPairCiv2,'String');%get the menu of image pairs 922 % if index_pair<=length(list_pair2) 923 % set(handles.ListPairCiv2,'Value',index_pair); 924 % end 925 926 927 %update MinIndex_i and last_i according to the chosen image pairs 966 928 % mode_list=get(handles.ListPairMode,'String'); 967 929 % mode_value=get(handles.ListPairMode,'Value'); 968 930 % mode=mode_list{mode_value}; 969 931 % if isequal(mode,'series(Di)') 970 % first_i=str2double(get(handles.first_i,'String'));932 % MinIndex_i=str2double(get(handles.MinIndex_i,'String')); 971 933 % last_i=str2double(get(handles.last_i,'String')); 972 934 % incr_i=str2double(get(handles.incr_i,'String')); 973 % num_i= first_i:incr_i:last_i;974 % lastfield=str2double(get(handles. nb_field,'String'));935 % num_i=MinIndex_i:incr_i:last_i; 936 % lastfield=str2double(get(handles.MaxIndex_i,'String')); 975 937 % if ~isnan(lastfield) 976 938 % test_find=(num_i-floor(index_pair/2)*ones(size(num_i))>0)& ... … … 978 940 % num_i=num_i(test_find); 979 941 % end 980 % set(handles. first_i,'String',num2str(num_i(1)));942 % set(handles.MinIndex_i,'String',num2str(num_i(1))); 981 943 % set(handles.last_i,'String',num2str(num_i(end))); 982 944 % elseif isequal(mode,'series(Dj)') 983 % first_j=str2double(get(handles.first_j,'String'));945 % MinIndex_j=str2double(get(handles.MinIndex_j,'String')); 984 946 % last_j=str2double(get(handles.last_j,'String')); 985 947 % incr_j=str2double(get(handles.incr_j,'String')); 986 % num_j= first_j:incr_j:last_j;987 % lastfield2=str2double(get(handles. nb_field2,'String'));948 % num_j=MinIndex_j:incr_j:last_j; 949 % lastfield2=str2double(get(handles.MaxIndex_j,'String')); 988 950 % if ~isnan(lastfield2) 989 951 % test_find=(num_j-floor(index_pair/2)*ones(size(num_j))>0)& ... … … 991 953 % num_j=num_j(test_find); 992 954 % end 993 % set(handles. first_j,'String',num2str(num_j(1)));955 % set(handles.MinIndex_j,'String',num2str(num_j(1))); 994 956 % set(handles.last_j,'String',num2str(num_j(end))); 995 957 % end … … 1001 963 index_pair=get(handles.ListPairCiv2,'Value');%get the selected position index in the menu 1002 964 1003 %update first_i and last_i according to the chosen image pairs965 %update MinIndex_i and last_i according to the chosen image pairs 1004 966 mode_list=get(handles.ListPairMode,'String'); 1005 967 mode_value=get(handles.ListPairMode,'Value'); 1006 968 mode=mode_list{mode_value}; 1007 969 if isequal(mode,'series(Di)') 1008 first_i=str2double(get(handles. first_i,'String'));970 first_i=str2double(get(handles.MinIndex_i,'String')); 1009 971 last_i=str2double(get(handles.last_i,'String')); 1010 972 incr_i=str2double(get(handles.incr_i,'String')); 1011 973 num_i=first_i:incr_i:last_i; 1012 lastfield=str2double(get(handles. nb_field,'String'));974 lastfield=str2double(get(handles.MaxIndex_i,'String')); 1013 975 if ~isnan(lastfield) 1014 976 test_find=(num_i-floor(index_pair/2)*ones(size(num_i))>0)& ... … … 1016 978 num_i=num_i(test_find); 1017 979 end 1018 set(handles. first_i,'String',num2str(num_i(1)));980 set(handles.MinIndex_i,'String',num2str(num_i(1))); 1019 981 set(handles.last_i,'String',num2str(num_i(end))); 1020 982 elseif isequal(mode,'series(Dj)') 1021 first_j=str2double(get(handles. first_j,'String'));983 first_j=str2double(get(handles.MinIndex_j,'String')); 1022 984 last_j=str2double(get(handles.last_j,'String')); 1023 985 incr_j=str2double(get(handles.incr_j,'String')); 1024 986 num_j=first_j:incr_j:last_j; 1025 lastfield2=str2double(get(handles. nb_field2,'String'));987 lastfield2=str2double(get(handles.MaxIndex_j,'String')); 1026 988 if ~isnan(lastfield2) 1027 989 test_find=(num_j-floor(index_pair/2)*ones(size(num_j))>0)& ... … … 1029 991 num_j=num_j(test_find); 1030 992 end 1031 set(handles. first_j,'String',num2str(num_j(1)));993 set(handles.MinIndex_j,'String',num2str(num_j(1))); 1032 994 set(handles.last_j,'String',num2str(num_j(end))); 1033 995 end … … 1067 1029 %------------------------------------------------------------------------ 1068 1030 % determine the menu for checkciv1 pairs depending on existing netcdf file at the middle of 1069 % the field series set by first_i, incr, last_i1031 % the field series set by MinIndex_i, incr, last_i 1070 1032 % index=1: look for pairs for civ1 1071 1033 % index=2: look for pairs for civ2 … … 1305 1267 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1306 1268 %------------------------------------------------------------------------ 1307 function first_i_Callback(hObject, eventdata, handles)1308 %------------------------------------------------------------------------ 1309 first_i=str2double(get(handles. first_i,'String'));1269 function MinIndex_i_Callback(hObject, eventdata, handles) 1270 %------------------------------------------------------------------------ 1271 first_i=str2double(get(handles.MinIndex_i,'String')); 1310 1272 set(handles.ref_i,'String', num2str(first_i))% reference index for pair dt = first index 1311 1273 ref_i_Callback(hObject, eventdata, handles)%refresh dispaly of dt for pairs (in case of non constant dt) 1312 1274 1313 1275 %------------------------------------------------------------------------ 1314 function first_j_Callback(hObject, eventdata, handles)1315 %------------------------------------------------------------------------ 1316 first_j=str2num(get(handles. first_j,'String'));1276 function MinIndex_j_Callback(hObject, eventdata, handles) 1277 %------------------------------------------------------------------------ 1278 first_j=str2num(get(handles.MinIndex_j,'String')); 1317 1279 set(handles.ref_j,'String', num2str(first_j))% reference index for pair dt = first index 1318 1280 ref_j_Callback(hObject, eventdata, handles)%refresh dispaly of dt for pairs (in case of non constant dt) … … 2140 2102 Data.Civ1_U_Diff=Data.Civ1_U_Diff(Data.Civ1_FF==0); 2141 2103 Data.Civ1_V_Diff=Data.Civ1_V_Diff(Data.Civ1_FF==0); 2142 DiffVel(irho)=sqrt(mean(Data.Civ1_U_Diff.*Data.Civ1_U_Diff+Data.Civ1_V_Diff.*Data.Civ1_V_Diff)) 2104 DiffVel(irho)=sqrt(mean(Data.Civ1_U_Diff.*Data.Civ1_U_Diff+Data.Civ1_V_Diff.*Data.Civ1_V_Diff)); 2143 2105 NbSites(irho,:)=Data.Civ1_NbSites*numel(Data.Civ1_NbSites)/numel(Data.Civ1_U_Diff); 2144 2106 Param.Patch1.SmoothingParam=2*Param.Patch1.FieldSmooth; … … 2161 2123 % --- Executes on button press in TestCiv2. 2162 2124 function TestCiv2_Callback(hObject, eventdata, handles) 2125 2126 2127 2128 function num_OriginIndex_Callback(hObject, eventdata, handles) 2129 % hObject handle to num_OriginIndex (see GCBO) 2130 % eventdata reserved - to be defined in a future version of MATLAB 2131 % handles structure with handles and user data (see GUIDATA) 2132 2133 % Hints: get(hObject,'String') returns contents of num_OriginIndex as text 2134 % str2double(get(hObject,'String')) returns contents of num_OriginIndex as a double 2135 2136 2137 % --- Executes during object creation, after setting all properties. 2138 function num_OriginIndex_CreateFcn(hObject, eventdata, handles) 2139 % hObject handle to num_OriginIndex (see GCBO) 2140 % eventdata reserved - to be defined in a future version of MATLAB 2141 % handles empty - handles not created until after all CreateFcns called 2142 2143 % Hint: edit controls usually have a white background on Windows. 2144 % See ISPC and COMPUTER. 2145 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) 2146 set(hObject,'BackgroundColor','white'); 2147 end 2148 2149 %------------------------------------------------------------------------ 2150 % --- determine the list of index pairs of processing file 2151 function [ind1,ind2]=... 2152 find_pair_indices(str_civ,i_series,j_series,MinIndex_i,MaxIndex_i,MinIndex_j,MaxIndex_j) 2153 %------------------------------------------------------------------------ 2154 % i1_series=i_series;% set of first image indexes 2155 % i2_series=i_series; 2156 % j1_series=ones(size(i_series));% set of first image numbers 2157 % j2_series=ones(size(i_series)); 2158 % check_bounds=false(size(i_series)); 2159 ind1=''; 2160 ind2=''; 2161 r=regexp(str_civ,'^\D(?<ind>[i|j])=( -| )(?<num1>\d+)\|(?<num2>\d+)','names'); 2162 if ~isempty(r) 2163 mode=['D' r.ind]; 2164 ind1=stra2num(r.num1); 2165 ind2=stra2num(r.num2); 2166 else 2167 mode='burst'; 2168 r=regexp(str_civ,'^j= (?<num1>[a-z])-(?<num2>[a-z])','names'); 2169 if ~isempty(r) 2170 NomTypeNc='_1ab'; 2171 else 2172 r=regexp(str_civ,'^j= (?<num1>[A-Z])-(?<num2>[A-Z])','names'); 2173 if ~isempty(r) 2174 NomTypeNc='_1AB'; 2175 else 2176 r=regexp(str_civ,'^j= (?<num1>\d+)-(?<num2>\d+)','names'); 2177 if ~isempty(r) 2178 NomTypeNc='_1_1-2'; 2179 end 2180 end 2181 end 2182 if isempty(r) 2183 display('wrong pair mode input option') 2184 else 2185 ind1=stra2num(r.num1); 2186 ind2=stra2num(r.num2); 2187 end 2188 end 2189 % if strcmp (mode,'Di') 2190 % i1_series=i_series-ind1;% set of first image numbers 2191 % i2_series=i_series+ind2; 2192 % check_bounds=i1_series<MinIndex_i | i2_series>MaxIndex_i; 2193 % if isempty(j_series) 2194 % NomTypeNc='_1-2'; 2195 % else 2196 % j1_series=j_series; 2197 % j2_series=j_series; 2198 % NomTypeNc='_1-2_1'; 2199 % end 2200 % elseif strcmp (mode,'Dj') 2201 % j1_series=j_series-ind1; 2202 % j2_series=j_series+ind2; 2203 % check_bounds=j1_series<MinIndex_j | j2_series>MaxIndex_j; 2204 % NomTypeNc='_1_1-2'; 2205 % else %bursts 2206 % j1_series=ind1*ones(size(i_series)); 2207 % j2_series=ind2*ones(size(i_series)); 2208 % end -
trunk/src/series/civ_series.m
r637 r645 55 55 Data.Mask='off';%can use mask option (option 'off'/'on', 'off' by default) 56 56 Data.OutputDirExt='.civ';%set the output dir extension 57 Data.OutputFileMode='NbInput_i';% one output file expected per value of i index (used for waitbar) 57 58 filecell=get_file_series(Param);%check existence of the first input file 58 59 if ~exist(filecell{1,1},'file') … … 89 90 [filecell,i_series,tild,j_series]=get_file_series(Param); 90 91 if ~exist(filecell{1,1},'file') 91 displ ('ERROR:the first input file does not exist')92 displ_uvmat('ERROR',' the first input file does not exist') 92 93 return 93 94 else … … 1003 1004 end 1004 1005 1005 % if length(indsel)>=1 1006 % firstind=indsel(1); 1007 % lastind=indsel(end); 1008 % set(handles.first_j,'String',num2str(ref_j(firstind)))%update the display of first and last fields 1009 % set(handles.last_j,'String',num2str(ref_j(lastind))) 1010 % ref_j=ref_j(indsel); 1011 % j1_civ1=j1_civ1(indsel); 1012 % j2_civ1=j2_civ1(indsel); 1013 % j1_civ2=j1_civ2(indsel); 1014 % j2_civ2=j2_civ2(indsel); 1015 % end 1016 % elseif isequal(mode,'pair j1-j2') %case of bursts (png_old or png_2D) 1017 % displ_num=get(handles.ListPairCiv1,'UserData'); 1018 % i1_civ1=ref_i; 1019 % i2_civ1=ref_i; 1020 % j1_civ1=displ_num(1,index_civ1); 1021 % j2_civ1=displ_num(2,index_civ1); 1022 % i1_civ2=ref_i; 1023 % i2_civ2=ref_i; 1024 % j1_civ2=displ_num(1,index_civ2); 1025 % j2_civ2=displ_num(2,index_civ2); 1026 % elseif isequal(mode,'displacement') 1027 % i1_civ1=ref_i; 1028 % i2_civ1=ref_i; 1029 % j1_civ1=ref_j; 1030 % j2_civ1=ref_j; 1031 % i1_civ2=ref_i; 1032 % i2_civ2=ref_i; 1033 % j1_civ2=ref_j; 1034 % j2_civ2=ref_j; 1035 % end 1036 1037 1038 1039 1006 1007 1008 -
trunk/src/series/time_series.m
r635 r645 350 350 VarInit=DataOut.(VarName); 351 351 if isempty(errormsg) && ~isequal(VarVal,VarInit) 352 displ_uvmat('ERROR',['time series requires constant coordinates ' VarName ],checkrun)352 displ_uvmat('ERROR',['time series requires constant coordinates ' VarName ': use projection mode interp'],checkrun) 353 353 return 354 354 end … … 414 414 test_time=diff(DataOut.Time)>0;% test that the readed time is increasing (not constant) 415 415 if ~test_time 416 DataOut.Time=1: filecounter;416 DataOut.Time=1:nbfield; 417 417 end 418 418
Note: See TracChangeset
for help on using the changeset viewer.