Changeset 856 for trunk/src/series/civ_input.m
- Timestamp:
- Jan 26, 2015, 12:37:56 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/civ_input.m
r855 r856 165 165 set(handles.ref_j,'String',num2str(Param.IndexRange.first_j)) 166 166 end 167 set(handles.ConfigSource,'String','\default') 167 168 168 169 %% set the menus of image pairs and default selection for civ_input %%%%%%%%%%%%%%%%%%% … … 340 341 set(handles.civ_input,'WindowStyle','modal')% Make the GUI modal 341 342 drawnow 342 uiwait(handles.civ_input); 343 uiwait(handles.civ_input);% wait for OK action to end the function 343 344 344 345 … … 368 369 %------------------------------------------------------------------------ 369 370 function SetDefaultParam_Callback(hObject, eventdata, handles) 370 371 hseries=findobj(allchild(0),'Name','series');% look for the GUI series 372 hhseries=guidata(hseries);%handles of elements in the GUI series 373 SeriesData=get(hseries,'UserData');%read parameters on the GUI series 374 if isfield (SeriesData,'ActionInput') 375 SeriesData=rmfield(SeriesData,'ActionInput');% remove recorded civ parameters 376 end 377 set(hseries,'UserData',SeriesData) 378 series('ActionName_Callback',hObject,eventdata,hhseries); % 371 372 Param.ConfigSource='\default'; 373 374 %% Civ1 parameters 375 Param.Civ1.CorrBoxSize=[25 25]; 376 Param.Civ1.SearchBoxSize=[55 55]; 377 Param.Civ1.SearchBoxShift=[0 0]; 378 Param.Civ1.CorrSmooth=1; 379 Param.Civ1.Dx=20; 380 Param.Civ1.Dy=20; 381 Param.Civ1.CheckGrid=0; 382 Param.Civ1.CheckMask=0; 383 Param.Civ1.CheckThreshold=0; 384 Param.Civ1.TestCiv1=0; 385 386 %% Fix1 parameters 387 Param.Fix1.CheckFmin2=1; 388 Param.Fix1.CheckF3=1; 389 Param.Fix1.MinCorr=0.2000; 390 391 %% Patch1 parameters 392 Param.Patch1.FieldSmooth=10; 393 Param.Patch1.MaxDiff=1.5000; 394 Param.Patch1.SubDomainSize=1000; 395 Param.Patch1.TestPatch1=0; 396 397 %% Civ2 parameters 398 Param.Civ2.CorrBoxSize=[21 21]; 399 Param.Civ2.SearchBoxSize=[31 31]; 400 Param.Civ2.CorrSmooth=1; 401 Param.Civ2.Dx=10; 402 Param.Civ2.Dy=10; 403 Param.Civ2.CheckGrid=0; 404 Param.Civ2.CheckMask=0; 405 Param.Civ2.CheckThreshold=0; 406 Param.Civ2.TestCiv2=0; 407 408 %% Fix2 parameters 409 Param.Fix2.CheckFmin2=1; 410 Param.Fix2.CheckF4=1; 411 Param.Fix2.CheckF3=1; 412 Param.Fix2.MinCorr=0.2000; 413 414 %% Patch2 parameters 415 Param.Patch2.FieldSmooth=2; 416 Param.Patch2.MaxDiff=1.5000; 417 Param.Patch2.SubDomainSize=1000; 418 Param.Patch2.TestPatch2=0; 419 420 fill_GUI(Param,handles.civ_input)% fill the elements of the GUI series with the input parameters 421 422 %update_CivOptions(handles,0) 423 %set(handles.ConfigSource,'String','\default') 424 425 % %Param=read_GUI(handles.civ_input) 426 % hseries=findobj(allchild(0),'Name','series');% look for the GUI series 427 % hhseries=guidata(hseries);%handles of elements in the GUI series 428 % SeriesData=get(hseries,'UserData');%read parameters on the GUI series 429 % if isfield (SeriesData,'ActionInput') 430 % SeriesData=rmfield(SeriesData,'ActionInput');% remove recorded civ parameters 431 % end 432 % set(hseries,'UserData',SeriesData) 433 % %% exit the GUI and close it 434 % %handles.output.ActionInput=rmfield(ActionInput; 435 % guidata(hObject, handles);% Update handles structure 436 % uiresume(handles.civ_input); 437 % set(hhseries.ActionName,'BusyAction','cancel') 438 % series('ActionName_Callback',hObject,eventdata,hhseries); % 439 379 440 380 441 % ----------------------------------------------------------------------- … … 771 832 if isempty(errormsg) 772 833 set(handles.ref_i,'BackgroundColor',[1 1 1]) 834 set(handles.ref_j,'BackgroundColor',[1 1 1]) 773 835 else 774 836 msgbox_uvmat('ERROR',errormsg) … … 827 889 828 890 %% determine nom_type_nc, nomenclature type of the .nc files: 829 [nom_type_nc]=nomtype2pair(nom_type_ima,mode);891 %[nom_type_nc]=nomtype2pair(nom_type_ima,mode); 830 892 831 893 %% reads .nc subdirectoy and image numbers from the interface … … 920 982 921 983 %% determine the default selection in the pair menu for Civ1 922 ichoice=find(select,1);% index of selected pair984 ichoice=find(select,1);% index of first selected pair 923 985 if (isempty(ichoice) || ichoice < 1); ichoice=1; end; 924 986 initial=get(handles.ListPairCiv1,'Value');%initial choice of pair … … 1081 1143 1082 1144 %------------------------------------------------------------------------ 1083 % --- Executes on button press in CheckMask.1145 % --- Executes on selection in menu CorrSmooth. 1084 1146 function num_CorrSmooth_Callback(hObject, eventdata, handles) 1085 1147 set(handles.configSource,'String','NEW') 1086 set(handles. configSource,'BackgroundColor',[1 0 1])1148 set(handles.OK,'BackgroundColor',[1 0 1]) 1087 1149 %------------------------------------------------------------------------ 1088 1150 … … 1423 1485 set(hObject,'BackgroundColor',[1 0 1]) 1424 1486 set(handles.configSource,'String','NEW') 1425 set(handles. configSource,'BackgroundColor',[1 0 1])1487 set(handles.OK,'BackgroundColor',[1 0 1]) 1426 1488 %------------------------------------------------------------------------ 1427 1489 % --- Executes on button press in CheckMask: common to all panels (civ1, Civ2..) … … 1685 1747 end 1686 1748 set(handles.configSource,'String','NEW') 1687 set(handles. configSource,'BackgroundColor',[1 0 1])1749 set(handles.OK,'BackgroundColor',[1 0 1]) 1688 1750 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1689 1751 %%%%%%%%%%%%%% TEST functions … … 1820 1882 if get(handles.TestCiv2,'Value') 1821 1883 set(handles.TestCiv2,'BackgroundColor',[1 1 0])% paint TestCiv1 button to yellow to confirm civ launch 1822 % TO UPDATE TO UPDATE TO UPDATE TO UPDATE 1823 [Data,Param.Civ2]=get_param_civ2(handles); 1824 Grid=civ_matlab(Param);% get the grid of x, y positions set for PIV 1825 hview_field=view_field(Data); %view the image in the GUI view_field 1884 hseries=findobj(allchild(0),'Tag','series'); 1885 Param=read_GUI(hseries); 1886 Param.Action.RUN=1; 1887 Param.ActionInput=read_GUI(handles.civ_input); 1888 Param=rmfield(Param,'OutputSubDir'); %remove output file option from civ_series 1889 Param.ActionInput.Civ2.SmoothParam=0;% launch Civ2 with no data point (to get the image names for A and B) 1890 [Data,errormsg]=civ_series(Param);% get the civ1+fix1 results 1891 1892 %% create image data ImageData for display 1893 ImageData.ListVarName={'ny','nx','A'}; 1894 ImageData.VarDimName= {'ny','nx',{'ny','nx'}}; 1895 ImageData.A=imread(Data.Civ2_ImageA); % read the first image 1896 if ndims(ImageData.A)==3 %case of color image 1897 ImageData.VarDimName= {'ny','nx',{'ny','nx','rgb'}}; 1898 end 1899 ImageData.ny=[size(ImageData.A,1) 1]; 1900 ImageData.nx=[1 size(ImageData.A,2)]; 1901 ImageData.CoordUnit='pixel';% used to set equal scaling for x and y in image dispa=ly 1902 1903 %% create the figure view_field for image visualization 1904 hview_field=view_field(ImageData); %view the image in the GUI view_field 1826 1905 set(0,'CurrentFigure',hview_field) 1906 RectCentre=squeeze(mean(Data.Civ1_SubRange,2)); 1907 for isub=1:size(Data.Civ1_SubRange,3); 1908 pos_x=Data.Civ1_SubRange(1,1,isub); 1909 pos_y=Data.Civ1_SubRange(2,1,isub); 1910 width=Data.Civ1_SubRange(1,2,isub)-Data.Civ1_SubRange(1,1,isub); 1911 height=Data.Civ1_SubRange(2,2,isub)-Data.Civ1_SubRange(2,1,isub); 1912 rectangle('Position',[pos_x pos_y width height],'EdgeColor',[0 0 1]) 1913 end 1827 1914 hhview_field=guihandles(hview_field); 1828 1915 set(hview_field,'CurrentAxes',hhview_field.PlotAxes) 1829 1916 ViewData=get(hview_field,'UserData'); 1830 1917 ViewData.CivHandle=handles.civ_input;% indicate the handle of the civ GUI in view_field 1831 ViewData.PlotAxes.B=imread(Param.Civ1.ImageName_B);%store the second image in the UserData of the GUI view_field 1832 ViewData.PlotAxes.X=Grid.Civ1_X; %keep the set of points in memeory 1833 ViewData.PlotAxes.Y=Grid.Civ1_Y; 1834 set(hview_field,'UserData',ViewData) 1835 corrfig=findobj(allchild(0),'tag','corrfig');% look for a current figure for image correlation display 1918 ViewData.PlotAxes.B=imread(Data.Civ2_ImageB);%store the second image in the UserData of the GUI view_field 1919 ViewData.PlotAxes.X=Data.Civ2_X'; 1920 ViewData.PlotAxes.Y=Data.Civ2_Y'; 1921 ViewData.PlotAxes.ShiftX=Data.Civ2_U'; 1922 ViewData.PlotAxes.ShiftY=Data.Civ2_V'; 1923 ViewData.PlotAxes.Civ1_SubRange=Data.Civ1_SubRange; 1924 ViewData.PlotAxes.Civ1_NbCentres=Data.Civ1_NbCentres; 1925 ViewData.PlotAxes.Civ1_Coord_tps=Data.Civ1_Coord_tps; 1926 ViewData.PlotAxes.Civ1_U_tps=Data.Civ1_U_tps; 1927 ViewData.PlotAxes.Civ1_V_tps=Data.Civ1_V_tps; 1928 ViewData.PlotAxes.Civ1_Dt=Data.Civ1_Dt; 1929 set(hview_field,'UserData',ViewData)% store the info in the UserData of image view_field 1930 1931 %% look for a current figure for image correlation display 1932 corrfig=findobj(allchild(0),'tag','corrfig'); 1836 1933 if isempty(corrfig) 1837 1934 corrfig=figure; … … 1839 1936 set(corrfig,'name','image correlation') 1840 1937 set(corrfig,'DeleteFcn',{@closeview_field})% 1841 % end1842 1938 set(handles.TestCiv1,'BackgroundColor',[1 0 0]) 1843 1939 else … … 1851 1947 delete(hview_field) 1852 1948 end 1853 end 1949 end 1854 1950 else 1855 1951 hview_field=findobj(allchild(0),'Tag','view_field'); %view the image in the GUI view_field … … 2084 2180 2085 2181 %------------------------------------------------------------------------ 2086 % --- Executes on button press in I nportParam.2087 %------------------------------------------------------------------------ 2088 function I nportParam_Callback(hObject, eventdata, handles)2182 % --- Executes on button press in ImportParam. 2183 %------------------------------------------------------------------------ 2184 function ImportParam_Callback(hObject, eventdata, handles) 2089 2185 hseries=findobj(allchild(0),'Tag','series'); 2090 2186 hhseries=guidata(hseries); … … 2116 2212 if isfield(Param.ActionInput,'Program')&& strcmp(Param.ActionInput.Program,'civ_series') 2117 2213 fill_GUI(Param.ActionInput,handles.civ_input)% fill the elements of the GUI series with the input parameters 2214 set(handles.ConfigSource,'String',filexml) 2118 2215 check_input=1; 2119 update_CivOptions(handles,0) 2120 2216 update_CivOptions(handles,0) 2121 2217 end 2122 2218 end … … 2138 2234 if isempty(find(strcmp(get(gco,'Tag'),ListExclude),1))% if the selected uicontrol is not in the Exclude list 2139 2235 set(handles.ConfigSource,'String','NEW')% indicate that the configuration is new 2140 set(handles.ConfigSource,'BackgroundColor',[1 0 1])% 2141 end 2236 set(handles.OK,'BackgroundColor',[1 0 1])% 2237 drawnow 2238 end 2239 2240 2241 % --- Executes on button press in TestPatch2. 2242 function TestPatch2_Callback(hObject, eventdata, handles)
Note: See TracChangeset
for help on using the changeset viewer.