Changeset 883
- Timestamp:
- Mar 13, 2015, 8:19:39 PM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series.m
r882 r883 639 639 set(handles.series,'UserData',[])%refresh the stored info 640 640 end 641 for iview=1:size(InputTable,1) 641 nbview=size(InputTable,1); 642 for iview=1:nbview 642 643 RootPath=fullfile(InputTable{iview,1},InputTable{iview,2}); 643 644 if ~exist(RootPath,'dir') 644 645 i1_series=[]; 645 %RootPath=fileparts(RootPath); %will try the upper folder646 646 RootFile=''; 647 647 else %scan the input folder … … 662 662 end 663 663 end 664 665 %% update MinIndex_i and MaxIndex_i if the input table content has been reduced in line nbre 666 MinIndex_i_table=get(handles.MinIndex_i,'Data');%retrieve the min indices in the table MinIndex 667 set(handles.MinIndex_i,'Data',MinIndex_i_table(1:nbview,:)); 668 MinIndex_j_table=get(handles.MinIndex_j,'Data');%retrieve the min indices in the table MinIndex 669 set(handles.MinIndex_j,'Data',MinIndex_j_table(1:nbview,:)); 670 MaxIndex_i_table=get(handles.MaxIndex_i,'Data');%retrieve the min indices in the table MinIndex 671 set(handles.MaxIndex_i,'Data',MaxIndex_i_table(1:nbview,:)); 672 MaxIndex_j_table=get(handles.MaxIndex_j,'Data');%retrieve the min indices in the table MinIndex 673 set(handles.MaxIndex_j,'Data',MaxIndex_j_table(1:nbview,:)); 674 PairString=get(handles.PairString,'Data');%retrieve the min indices in the table MinIndex 675 set(handles.PairString,'Data',PairString(1:nbview,:)); 676 TimeTable=get(handles.TimeTable,'Data');%retrieve the min indices in the table MinIndex 677 set(handles.TimeTable,'Data',TimeTable(1:nbview,:)); 678 664 679 %% enable field and veltype menus, in accordance with the current action 665 680 ActionName_Callback([],[], handles) … … 766 781 SeriesData.Time={}; 767 782 end 768 SeriesData.i1_series(iview+1:end)=[]; 783 if isfield(SeriesData,'i1_series') 784 SeriesData.i1_series(iview+1:end)=[]; 769 785 SeriesData.i2_series(iview+1:end)=[]; 770 786 SeriesData.j1_series(iview+1:end)=[]; … … 773 789 SeriesData.FileInfo(iview+1:end)=[]; 774 790 SeriesData.Time(iview+1:end)=[]; 775 InputTable(iview,:)=[{RootPath},{SubDir},{RootFile},{NomType},{FileExt}]; 791 end 792 InputTable(iview,:)=[{RootPath},{SubDir},{RootFile},{NomType},{FileExt}]; 776 793 if iview >1 777 794 set(handles.InputLine,'String',num2str(iview)) … … 1411 1428 Param=read_GUI_series(handles);%displayed parameters 1412 1429 SeriesData=get(handles.series,'UserData');%hidden parameters 1430 if isfield(SeriesData,'TransformInput') 1431 Param.TransformInput=SeriesData.TransformInput; 1432 end 1413 1433 if ~isfield(SeriesData,'i1_series') 1414 1434 errormsg='The input field series needs to be refreshed: press REFRESH'; … … 2403 2423 end 2404 2424 set(handles.OutputSubDir,'String',SubDirOut) 2425 set(handles.OutputSubDir,'BackgroundColor',[1 1 1])% set edit box to white color to indicate refreshment 2405 2426 set(handles.OutputDirExt,'Visible',OutputDirVisible) 2406 2427 set(handles.OutputSubDir,'Visible',OutputDirVisible) … … 2971 2992 set(handles.TransformName,'UserData',TransformPathList); 2972 2993 2994 %% create the function handle of the selected fct 2995 if ~isempty(TransformName) 2996 current_dir=pwd;%current working dir 2997 cd(TransformPathList{TransformIndex}) 2998 transform_handle=str2func(TransformName); 2999 cd(current_dir) 3000 Field.Action.RUN=0;% indicate that the transform fct is called only to get input param 3001 DataOut=feval(transform_handle,Field,[]);% execute the transform fct to get the required conditions 3002 if isfield(DataOut,'TransformInput')% used to add transform parameters at selection of the transform fct 3003 SeriesData=get(handles.series,'UserData'); 3004 SeriesData.TransformInput=DataOut.TransformInput; 3005 set(handles.series,'UserData',SeriesData) 3006 end 3007 end 3008 2973 3009 %------------------------------------------------------------------------ 2974 3010 % --- fct activated by the upper bar menu ExportConfig … … 3034 3070 Param.ActionInput.ConfigSource=filexml;% record the source of config for future info 3035 3071 SeriesData.ActionInput=Param.ActionInput; 3072 end 3073 if isfield(Param,'TransformInput')% introduce parameters specific to a transform fct 3074 SeriesData.TransformInput=Param.TransformInput; 3036 3075 end 3037 3076 if isfield(Param,'ProjObject') %introduce projection object if relevant … … 3471 3510 set(handles.InputTable,'Data',InputTable); 3472 3511 end 3512 set(handles.REFRESH,'BackgroundColor',[1 0 1])% set REFRESH button to magenta color to indicate that input refr 3473 3513 3474 3514 -
trunk/src/series/aver_stat.m
r881 r883 185 185 transform_fct=str2func(Param.FieldTransform.TransformName); 186 186 rmpath(Param.FieldTransform.TransformPath) 187 if isfield(Param,'TransformInput') 188 XmlData{1}.TransformInput=Param.TransformInput; 189 end 187 190 end 188 191 -
trunk/src/series/civ_input.m
r881 r883 688 688 nbfield=siztime(1)-1; 689 689 nbfield2=siztime(2)-1; 690 indchosen=1; %%first pair selected by default690 %indchosen=1; %%first pair selected by default 691 691 %displ_num used to define the indices of the civ_input pairs 692 692 % in mode 'pair j1-j2', j1 and j2 are the file indices, else the indices … … 907 907 nbpair=200;%default 908 908 select=ones(size(1:nbpair));%flag for displayed pairs =1 for display 909 nbpair=200; %default909 %nbpair=200; %default 910 910 911 911 %% determine the menu display in .ListPairCiv1 … … 915 915 if select(ipair) 916 916 displ_pair{ipair}=['Di= ' num2str(-floor(ipair/2)) '|' num2str(ceil(ipair/2))]; 917 displ_pair_dt{ipair}=displ_pair{ipair}; 917 918 if ~checkframe 918 919 if size(Time,1)>=ref_i+1+ceil(ipair/2) && size(Time,2)>=ref_j+1&& ref_i-floor(ipair/2)>=0 && ref_j>=0 919 920 dt=Time(ref_i+1+ceil(ipair/2),ref_j+1)-Time(ref_i+1-floor(ipair/2),ref_j+1);%Time interval dtref_j+1 920 displ_pair {ipair}=[displ_pair{ipair} ' :dt= ' num2str(dt*1000)];921 displ_pair_dt{ipair}=[displ_pair_dt{ipair} ' :dt= ' num2str(dt*1000)]; 921 922 end 922 923 else 923 924 dt=ipair/1000; 924 displ_pair {ipair}=[displ_pair{ipair} ' :dt= ' num2str(ipair)];925 displ_pair_dt{ipair}=[displ_pair_dt{ipair} ' :dt= ' num2str(ipair)]; 925 926 end 926 927 else 927 displ_pair{ipair}='...'; %pair not displayed in the menu 928 displ_pair{ipair}='...'; 929 displ_pair_dt{ipair}='...'; %pair not displayed in the menu 928 930 end 929 931 end … … 932 934 if select(ipair) 933 935 displ_pair{ipair}=['Dj= ' num2str(-floor(ipair/2)) '|' num2str(ceil(ipair/2))]; 936 displ_pair_dt{ipair}=displ_pair{ipair}; 934 937 if ~checkframe 935 938 if size(Time,2)>=ref_j+1+ceil(ipair/2) && size(Time,1)>=ref_i+1 && ref_j-floor(ipair/2)>=0 && ref_i>=0 936 939 dt=Time(ref_i+1,ref_j+1+ceil(ipair/2))-Time(ref_i+1,ref_j+1-floor(ipair/2));%Time interval dtref_j+1 937 displ_pair {ipair}=[displ_pair{ipair} ' :dt= ' num2str(dt*1000)];940 displ_pair_dt{ipair}=[displ_pair_dt{ipair} ' :dt= ' num2str(dt*1000)]; 938 941 end 939 942 else 940 943 dt=ipair/1000; 941 displ_pair {ipair}=[displ_pair{ipair} ' :dt= ' num2str(dt*1000)];944 displ_pair_dt{ipair}=[displ_pair_dt{ipair} ' :dt= ' num2str(dt*1000)]; 942 945 end 943 946 else 944 947 displ_pair{ipair}='...'; %pair not displayed in the menu 948 displ_pair_dt{ipair}='...'; %pair not displayed in the menu 945 949 end 946 950 end … … 956 960 index_pair=index_pair+1; 957 961 displ_pair{index_pair}=['j= ' num2stra(numod_a,nom_type_ima) '-' num2stra(numod_b,nom_type_ima)]; 962 displ_pair_dt{ipair}=displ_pair{ipair}; 958 963 dt(index_pair)=numod_b-numod_a;%default dt 959 964 if size(Time,1)>ref_i && size(Time,2)>numod_b % && ~checkframe 960 965 dt(index_pair)=Time(ref_i+1,numod_b+1)-Time(ref_i+1,numod_a+1);% Time interval dt 961 displ_pair {index_pair}=[displ_pair{index_pair} ' :dt= ' num2str(dt(index_pair)*1000)];966 displ_pair_dt{index_pair}=[displ_pair_dt{index_pair} ' :dt= ' num2str(dt(index_pair)*1000)]; 962 967 end 963 968 end … … 966 971 [tild,indsort]=sort(dt); 967 972 displ_pair=displ_pair(indsort); 973 displ_pair_dt=displ_pair_dt(indsort); 968 974 case 'displacement' 969 975 displ_pair={'Di=Dj=0'}; 976 displ_pair_dt={'Di=Dj=0'}; 970 977 end 971 978 if index==1 972 set(handles.ListPairCiv1,'String',displ_pair ');979 set(handles.ListPairCiv1,'String',displ_pair_dt'); 973 980 end 974 981 … … 976 983 %ichoice=find(select,1);% index of first selected pair 977 984 %if (isempty(ichoice) || ichoice < 1); ichoice=1; end; 985 end_pair=regexp(PairCiv1Init,' :dt='); 986 if ~isempty(end_pair) 987 PairCiv1Init=PairCiv1Init(1:end_pair-1); 988 end 978 989 ichoice=find(strcmp(PairCiv1Init,displ_pair'),1); 979 990 if ~isempty(ichoice) … … 988 999 %% determine the default selection in the pair menu for Civ2 989 1000 if strcmp(get(handles.ListPairCiv2,'Visible'),'on') 1001 end_pair=regexp(PairCiv2Init,' :dt='); 1002 if ~isempty(end_pair) 1003 PairCiv2Init=PairCiv2Init(1:end_pair-1); 1004 end 990 1005 ichoice=find(strcmp(PairCiv2Init,displ_pair'),1); 991 1006 if ~isempty(ichoice) … … 994 1009 set(handles.ListPairCiv2,'Value',1) 995 1010 end 996 997 %998 % initial=get(handles.ListPairCiv2,'Value');999 %1000 %1001 % if initial>length(displ_pair')%|~isequal(select(initial),1)1002 % if ichoice <= length(displ_pair')1003 % set(handles.ListPairCiv2,'Value',ichoice);% same pair proposed by default for civ21004 % else1005 % set(handles.ListPairCiv2,'Value',1);% same pair proposed by default for civ21006 % end1007 % end1008 1011 else 1009 1012 set(handles.ListPairCiv2,'Value',get(handles.ListPairCiv1,'Value'))% initiate the choice of Civ2 as a reproduction of if civ1 1010 1013 end 1011 set(handles.ListPairCiv2,'String',displ_pair ');1014 set(handles.ListPairCiv2,'String',displ_pair_dt'); 1012 1015 set(gcf,'Pointer','arrow')% Indicate that the process is finished 1013 1014 1015 1016 % %------------------------------------------------------------------------1017 % % call 'view_field.fig' to display the field selected in the list of 'status'1018 % function open_view_field(hObject, eventdata)1019 % %------------------------------------------------------------------------1020 % list=get(hObject,'String');1021 % index=get(hObject,'Value');1022 % rootroot=get(hObject,'UserData');1023 % filename=list{index};1024 % ind_dot=strfind(filename,'...');1025 % filename=filename(1:ind_dot-1);1026 % filename=fullfile(rootroot,filename);1027 % delete(get(hObject,'parent'))%delete the display figure to stop the check process1028 % if exist(filename,'file')%visualise the vel field if it exists1029 % uvmat(filename)1030 % set(gcbo,'Value',1)1031 % end1032 1016 1033 1017 … … 1160 1144 set(handles.ConfigSource,'String','NEW') 1161 1145 set(handles.OK,'BackgroundColor',[1 0 1]) 1146 if get(handles.CheckDeformation,'Value') 1147 set(handles.num_CorrSmooth,'Visible','off') 1148 else 1149 set(handles.num_CorrSmooth,'Visible','on') 1150 end 1162 1151 1163 1152 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -
trunk/src/series/civ_series.m
r880 r883 1036 1036 yi=(1:mesh:size(image1_crop,1))'; 1037 1037 [XI,YI]=meshgrid(xi-ceil(size(image1_crop,2)/2),yi-ceil(size(image1_crop,1)/2)); 1038 XIant=XI-par_civ.DUDX(ivec)*XI -par_civ.DUDY(ivec)*YI+ceil(size(image1_crop,2)/2);1039 YIant=YI -par_civ.DVDX(ivec)*XI-par_civ.DVDY(ivec)*YI+ceil(size(image1_crop,1)/2);1038 XIant=XI-par_civ.DUDX(ivec)*XI+par_civ.DUDY(ivec)*YI+ceil(size(image1_crop,2)/2); 1039 YIant=YI+par_civ.DVDX(ivec)*XI-par_civ.DVDY(ivec)*YI+ceil(size(image1_crop,1)/2); 1040 1040 image1_crop=interp2(image1_crop,XIant,YIant); 1041 1041 image1_crop(isnan(image1_crop))=0; … … 1044 1044 image2_crop=interp2(image2_crop,xi,yi,'*spline'); 1045 1045 image2_crop(isnan(image2_crop))=0; 1046 %par_civ.CorrSmooth=3;%%%%%%%%%%%%%%%%%%% 1047 %% 1046 par_civ.CorrSmooth=2;% use SUBPIX2DGAUSS (take into account more points near the max) 1048 1047 end 1049 1048 sum_square=sum(sum(image1_crop.*image1_crop)); -
trunk/src/series/merge_proj.m
r880 r883 179 179 transform_fct=str2func(Param.FieldTransform.TransformName); 180 180 cd (currentdir) 181 if isfield(Param,'TransformInput') 182 for iview=1:NbView 183 XmlData{iview}.TransformInput=Param.TransformInput; 184 end 185 end 181 186 end 182 187 %%%%%%%%%%%% END STANDARD PART %%%%%%%%%%%% -
trunk/src/series/time_series.m
r881 r883 220 220 transform_fct=str2func(Param.FieldTransform.TransformName); 221 221 rmpath(Param.FieldTransform.TransformPath) 222 if isfield(Param,'TransformInput') 223 XmlData{1}.TransformInput=Param.TransformInput; 224 end 222 225 end 223 226 -
trunk/src/transform_field/diff_vel.m
r876 r883 35 35 %======================================================================= 36 36 37 function SubData=diff_vel(Field,XmlData,Field_1)37 function Field=diff_vel(Field,XmlData,Field_1) 38 38 39 SubData=Field; 39 %% request input parameters 40 if isfield(Field,'Action') && isfield(Field.Action,'RUN') && isequal(Field.Action.RUN,0) 41 42 %default input: 43 def={'1'};% multiplicative factor for the second velocity field 44 45 if isfield(XmlData,'TransformInput')% if parameters have been memorised 46 if isfield(XmlData.TransformInput,'Factor') 47 def{1}=num2str(XmlData.TransformInput.Factor); 48 end 49 end 50 num_lines= 1;%numel(prompt); 51 % open the dialog fig 52 prompt='enter scale factor for the second field'; 53 answer = inputdlg(prompt,'',num_lines,def); 54 Field.TransformInput.Factor=str2num(answer{1}); 55 return 56 end 57 Factor=1; 58 if isfield(XmlData,'TransformInput') && isfield(XmlData.TransformInput,'Factor') 59 Factor=XmlData.TransformInput.Factor; 60 end 40 61 if exist('Field_1','var') 41 62 F.U=scatteredInterpolant(Field_1.X,Field_1.Y,Field_1.U,'linear'); 42 SubData.U=Field.U-F.U(Field.X,Field.Y);%substract the interpolated ref to U63 Field.U=Field.U-Factor*F.U(Field.X,Field.Y);%substract the interpolated ref to U 43 64 F.V=scatteredInterpolant(Field_1.X,Field_1.Y,Field_1.V,'linear'); 44 SubData.V=Field.V-F.V(Field.X,Field.Y);%substract the interpolated ref to V65 Field.V=Field.V-Factor*F.V(Field.X,Field.Y);%substract the interpolated ref to V 45 66 end 46 67
Note: See TracChangeset
for help on using the changeset viewer.