Changeset 41
- Timestamp:
- Mar 10, 2010, 11:03:36 AM (15 years ago)
- Location:
- trunk/src
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r39 r41 721 721 722 722 %%%%%%%%%%% set the menus of image pairs and default selection for civ %%%%%%%%%%%%%%%%%%% 723 if isequal(nom_type_ima,'_i')| isequal(nom_type_nc,'_i1-i2')|~exist('nbfield2','var')|(nbfield2==1)723 if isequal(nom_type_ima,'_i')|| isequal(nom_type_nc,'_i1-i2')||~(exist('nbfield2','var')&&(nbfield2~=1)) 724 724 set(handles.mode,'String',{'series(Di)'}) 725 725 set(handles.mode,'Value',1) 726 elseif isequal(nom_type_ima,'png_old')| isequal(nom_type_nc,'netc_old')726 elseif isequal(nom_type_ima,'png_old')||isequal(nom_type_nc,'netc_old') 727 727 set(handles.mode,'String',{'pair j1-j2'}) 728 728 set(handles.mode,'Value',1) … … 732 732 else 733 733 set(handles.mode,'String',{'pair j1-j2';'series(Dj)';'series(Di)'})%multiple choice 734 if isequal(mode,'volume') 735 set(handles.mode,'Value',3) 736 elseif nbfield2 <= 5 737 set(handles.mode,'Value',1)% advice 'pair j1-j2' for small bursts 738 else 739 set(handles.mode,'Value',2)% advice series Dj for long bursts, not volume 740 end 734 if nbfield2 <= 5 735 set(handles.mode,'Value',1)% advice 'pair j1-j2' for small burst 736 end 737 % else 738 % if isequal(mode,'volume') 739 % set(handles.mode,'Value',3) 740 % elseif nbfield2 <= 5 741 % set(handles.mode,'Value',1)% advice 'pair j1-j2' for small bursts 742 % else 743 % set(handles.mode,'Value',2)% advice series Dj for long bursts, not volume 744 % end 741 745 end 742 746 … … 1331 1335 list_civ1=get(handles.list_pair_civ1,'String'); 1332 1336 index_civ1=get(handles.list_pair_civ1,'Value'); 1333 [num_i,num_j]=meshgrid(num_i,num_j);1334 1337 str_civ1=list_civ1{index_civ1};%string defining the image pairs for civ1 1335 1338 if isempty(str_civ1)||isequal(str_civ1,'') … … 1457 1460 end 1458 1461 1462 1459 1463 %------------------------------------------------------------------------ 1460 1464 % --- Executes on selection change in list_pair_civ1. … … 1660 1664 [filecell,num1_civ1,num2_civ1,num_a_civ1,num_b_civ1,num1_civ2,num2_civ2,num_a_civ2,num_b_civ2,nom_type_nc,file_ref_fix1,file_ref_fix2]=... 1661 1665 set_civ_filenames(handles,compare,box_test); 1662 nbfield= size(num1_civ1,2);1663 nbslice=size(num 1_civ1,1);1666 nbfield=numel(num1_civ1); 1667 nbslice=size(num_a_civ1); 1664 1668 1665 1669 if isempty(filecell) … … 2179 2183 [filecell,num1_civ1,num2_civ1,num_a_civ1,num_b_civ1,num1_civ2,num2_civ2,num_a_civ2,num_b_civ2,nom_type_nc,file_ref_fix1,file_ref_fix2]=... 2180 2184 set_civ_filenames(handles,compare,box_test); 2185 2181 2186 display('files OK, processing...') 2182 nbfield= size(num1_civ1,2);2183 nbslice= size(num1_civ1,1);2187 nbfield=numel(num1_civ1); 2188 nbslice=numel(num_a_civ1); 2184 2189 2185 2190 %GET PARAMETERS: … … 2314 2319 time=get(handles.displ_filebase,'UserData'); %get the set of times 2315 2320 civAll=get(handles.Experimental,'Value'); % Boolean for new civ excution method 2321 'TESTbatch' 2322 size(filecell.nc.civ1) 2323 nbslice 2324 nbfield 2316 2325 for ifile=1:nbfield 2317 2326 for j=1:nbslice … … 2330 2339 end 2331 2340 % filecell.nc.civ1 2332 filename_cmx= cell2mat(filecell.nc.civ1(ifile,j));%output netcdf file2333 filename_cmx( [end-1:end])='cm';%name of cmx file2341 filename_cmx=filecell.nc.civ1{ifile,j}%output netcdf file 2342 filename_cmx(end-1:end)='cm';%name of cmx file 2334 2343 filename_cmx=[filename_cmx 'x']; 2335 2344 2336 2345 %CIV1 2337 2346 if box_test(1)==1 2338 par_civ1.filename_ima_a= cell2mat(filecell.ima1.civ1(ifile,j));2347 par_civ1.filename_ima_a=filecell.ima1.civ1{ifile,j}; 2339 2348 % par_civ1.filename_ima_a([end-3:end])=[];%remove .png extension 2340 par_civ1.filename_ima_b= cell2mat(filecell.ima2.civ1(ifile,j));2349 par_civ1.filename_ima_b=filecell.ima2.civ1{ifile,j}; 2341 2350 % par_civ1.filename_ima_b([end-3:end])=[];%remove .png extension 2342 2351 … … 2741 2750 % .ncA.civ1{i,j}, .ncA.civ2{i,j}; set of nc files for PIV results with camA (then .nc corresponds to camB) 2742 2751 % .st{i,j}; set of nc files for the combined stereo fields 2752 % num1_civ1(i),num2_civ1(i): lists of first and last i indices for civ1 2753 % num_a_civ1(j),num_b_civ1(j): lists of first and last j indices for civ1 2754 % num1_civ2(i),num2_civ2(i): lists of first and last i indices for civ2 2755 % num_a_civ2(j),num_b_civ2(j): lists of first and last j indices for civ2 2756 % nom_type_nc: nomenclature type for velocity files 2757 % file_ref_fix1,file_ref_fix2: reference files possibly used by Fix1 and 2 2743 2758 function [filecell,num1_civ1,num2_civ1,num_a_civ1,num_b_civ1,num1_civ2,num2_civ2,num_a_civ2,num_b_civ2,nom_type_nc,file_ref_fix1,file_ref_fix2]=... 2744 2759 set_civ_filenames(handles,compare,box_test) -
trunk/src/series.m
r39 r41 1295 1295 end 1296 1296 end 1297 %--------------------------------------------------- 1297 1298 %------------------------------------------------------------------------ 1298 1299 % --- Executes on button press in RUN. 1299 %------------------------------------------------------1300 1300 function RUN_Callback(hObject, eventdata, handles) 1301 1301 %------------------------------------------------------------------------ 1302 1302 %read root name and field type 1303 1303 set(handles.RUN,'BusyAction','queue'); … … 1311 1311 end 1312 1312 SeriesData=get(handles.figure1,'UserData'); 1313 if isfield(SeriesData,'sethandles')1314 if iscell(SeriesData.sethandles)1315 Series.sethandles=SeriesData.sethandles{1};1316 else1317 Series.sethandles=SeriesData.sethandles;%retrieve the handles of the set_object interface (to define projection objects)1318 end1319 end1313 % if isfield(SeriesData,'sethandles') 1314 % if iscell(SeriesData.sethandles) 1315 % Series.sethandles=SeriesData.sethandles{1}; 1316 % else 1317 % Series.sethandles=SeriesData.sethandles;%retrieve the handles of the set_object interface (to define projection objects) 1318 % end 1319 % end 1320 1320 1321 1321 %reinitiate waitbar position … … 1358 1358 Series.CoordType='';%default 1359 1359 if isequal(menu_coord_state,'on') 1360 menu_coord=get(handles.transform_fct,'String');1360 % menu_coord=get(handles.transform_fct,'String'); 1361 1361 menu_index=get(handles.transform_fct,'Value'); 1362 Series.CoordType=menu_coord{menu_index}; 1363 end 1364 Series.hseries=get(hObject,'Parent'); 1365 if isequal(get(handles.ParamVal,'Visible'),'on') 1366 ParamKey=get(handles.ParamKey,'String'); 1367 if ischar(ParamKey) 1368 ParamKey{1}=ParamKey; 1369 end 1370 ParamString=get(handles.ParamVal,'String'); 1371 if ischar(ParamString) 1372 for ilist=1:size(ParamString,1) 1373 ParamVal{ilist}=ParamString(ilist,:); 1374 end 1375 else 1376 ParamVal=ParamString; 1377 end 1378 end 1362 transform_list=get(handles.transform_fct,'UserData'); 1363 Series.transform_fct=transform_list{menu_index};% transform function handles 1364 end 1365 Series.hseries=handles.figure1; % handles to the series GUI 1366 % if isequal(get(handles.ParamVal,'Visible'),'on') 1367 % ParamKey=get(handles.ParamKey,'String'); 1368 % if ischar(ParamKey) 1369 % ParamKey{1}=ParamKey; 1370 % end 1371 % ParamString=get(handles.ParamVal,'String'); 1372 % if ischar(ParamString) 1373 % for ilist=1:size(ParamString,1) 1374 % ParamVal{ilist}=ParamString(ilist,:); 1375 % end 1376 % else 1377 % ParamVal=ParamString; 1378 % end 1379 % end 1379 1380 1380 1381 %read the set of field numbers … … 1482 1483 end 1483 1484 1484 % RUN RUN'1485 % defining the ACTION function handle 1485 1486 path_series=which('series'); 1486 1487 list_path=get(handles.ACTION,'UserData'); … … 1489 1490 if ~isequal(fct_path,path_series) 1490 1491 eval(['spath=which(''' action ''');']) %spath = current path of the selected function ACTION 1491 if ~isequal(spath,fct_path)& exist(fct_path,'dir') 1492 if ~exist(fct_path,'dir') 1493 msgbox_uvmat('ERROR',['The prescibed function path ' fct_path ' does not exist']) 1494 return 1495 end 1496 if ~isequal(spath,fct_path) 1492 1497 addpath(fct_path)% add the prescribed path if not the current one 1493 1498 end 1494 1499 end 1495 % fct_path 1496 eval(['h_fun=@' action ';']) 1500 eval(['h_fun=@' action ';'])%create a function handle for ACTION 1497 1501 if ~isequal(fct_path,path_series) 1498 1502 rmpath(fct_path)% add the prescribed path if not the current one 1499 1503 end 1500 1504 1505 % RUN ACTION 1501 1506 Series.Action=action;%name of the processing programme 1502 1507 set(handles.RUN,'BackgroundColor',[0.831 0.816 0.784]) 1503 1508 drawnow 1504 1509 if length(RootPath)>1 1505 % feval(action,num_i1_cell,num_i2_cell,num_j1_cell,num_j2_cell,Series);1506 1510 h_fun(num_i1_cell,num_i2_cell,num_j1_cell,num_j2_cell,Series); 1507 1511 else 1508 1512 h_fun(num_i1,num_i2,num_j1,num_j2,Series); 1509 % feval(action,num_i1,num_i2,num_j1,num_j2,Series);1510 1513 end 1511 1514 set(handles.RUN,'BackgroundColor',[1 0 0]) … … 1525 1528 % saveas(gcbf,namefigfull);%save the interface with name namefigfull (A CHANGER EN FICHIER .xml) 1526 1529 1527 %---------------------------------------------------- 1530 %------------------------------------------------------------------------ 1528 1531 function STOP_Callback(hObject, eventdata, handles) 1532 %------------------------------------------------------------------------ 1529 1533 set(handles.RUN, 'BusyAction','cancel') 1530 1534 set(handles.RUN,'BackgroundColor',[1 0 0]) 1531 1535 1532 %---------------------------------------------- 1533 1534 %---------------------------------------------------- 1536 1537 %------------------------------------------------------------------------ 1535 1538 function first_i_Callback(hObject, eventdata, handles) 1539 %------------------------------------------------------------------------ 1536 1540 last_i_Callback(hObject, eventdata, handles) 1537 1541 1538 %---------------------------------------------- 1542 %------------------------------------------------------------------------ 1539 1543 function last_i_Callback(hObject, eventdata, handles) 1544 %------------------------------------------------------------------------ 1540 1545 % hseries=get(handles.last_i,'parent'); 1541 1546 first_i=str2num(get(handles.first_i,'String')); … … 1550 1555 displ_time(handles,SeriesData.Time{1}); 1551 1556 1552 %------------------------------------------------------- 1557 %------------------------------------------------------------------------ 1553 1558 function first_j_Callback(hObject, eventdata, handles) 1559 %------------------------------------------------------------------------ 1554 1560 last_j_Callback(hObject, eventdata, handles) 1555 1561 1556 %------------------------------------------------------- 1562 %------------------------------------------------------------------------ 1557 1563 function last_j_Callback(hObject, eventdata, handles) 1558 % hseries=get(handles.last_i,'parent'); 1564 %------------------------------------------------------------------------ 1559 1565 first_j=str2num(get(handles.first_j,'String')); 1560 1566 last_j=str2num(get(handles.last_j,'String')); 1561 1567 ref_j=ceil((first_j+last_j)/2); 1562 1568 set(handles.ref_j,'String', num2str(ref_j)) 1563 1564 1569 ref_j_Callback(hObject, eventdata, handles) 1565 1570 SeriesData=get(handles.figure1,'UserData'); … … 1570 1575 1571 1576 1572 1573 1574 %------------------------------------------------------- 1577 %------------------------------------------------------------------------ 1575 1578 function ref_i_Callback(hObject, eventdata, handles) 1579 %------------------------------------------------------------------------ 1576 1580 mode_list=get(handles.mode,'String'); 1577 1581 mode_value=get(handles.mode,'Value'); … … 1593 1597 end 1594 1598 1595 %---------------------------------------------------- 1599 %------------------------------------------------------------------------ 1596 1600 function ref_j_Callback(hObject, eventdata, handles) 1601 %------------------------------------------------------------------------ 1597 1602 mode_list=get(handles.mode,'String'); 1598 1603 mode_value=get(handles.mode,'Value'); … … 1611 1616 end 1612 1617 1613 %---------------------------------------------------- 1618 %------------------------------------------------------------------------ 1614 1619 % --- Executes on selection change in ACTION. 1615 1620 function ACTION_Callback(hObject, eventdata, handles) 1621 %------------------------------------------------------------------------ 1616 1622 global nb_builtin 1617 1623 list_ACTION=get(handles.ACTION,'String');% list menu fields … … 1710 1716 set(handles.transform_fct,'Enable','off') 1711 1717 %set the displayed GUI item needed for input parameters 1712 %list_input=feval(ACTION);% input list asked by the selected function1713 1718 if ~isequal(path_series,PathName) 1714 1719 addpath(PathName) … … 1720 1725 1721 1726 varargout=h_function(); 1722 %varargout=feval(ACTION);% input list asked by the selected function1723 1727 Param_list={}; 1724 % RootPath=get(handles.RootPath,'String');1725 % RootFile=get(handles.RootFile,'String');1726 1728 1727 1729 %nb_series=length(RootFile); … … 1839 1841 end 1840 1842 1841 %------------------------------------------------------------------- 1843 %------------------------------------------------------------------------ 1842 1844 % --- Executes on selection change in FieldMenu. 1843 %-------------------------------------------------------------------1844 1845 function FieldMenu_Callback(hObject, eventdata, handles) 1845 1846 %------------------------------------------------------------------------ 1846 1847 field_str=get(handles.FieldMenu,'String'); 1847 1848 field_index=get(handles.FieldMenu,'Value'); … … 1868 1869 end 1869 1870 1870 %------------------------------------------------------ 1871 %------------------------------------------------------------------------ 1871 1872 % --- Executes on selection change in FieldMenu_1. 1872 %-----------------------------------------------------1873 1873 function FieldMenu_1_Callback(hObject, eventdata, handles) 1874 %------------------------------------------------------------------------ 1874 1875 field_str=get(handles.FieldMenu_1,'String'); 1875 1876 field_index=get(handles.FieldMenu_1,'Value'); … … 1896 1897 update_menu(handles.FieldMenu_1,scalar) 1897 1898 end 1898 1899 1900 % %group the variables (fields of 'FieldData') in cells of variables with the same dimensions1901 % %%%%%%%%%%%%%%%%%%%%%%% Function independante maintenant1902 % %-----------------------------------------------------------------1903 % [CellVarIndex,NbDim,VarTypeCell]=find_field_indices(Data{1});1904 % %LOOP ON GROUPS OF VARIABLES SHARING THE SAME DIMENSIONS1905 % % CellVarIndex=cells of variable index arrays1906 % ivar_new=0; % index of the current variable in the projected field1907 % icoord=0;1908 % for icell=1:length(CellVarIndex)1909 % if NbDim(icell)==11910 % continue1911 % end1912 % VarIndex=CellVarIndex{icell};% indices of the selected variables in the list FieldData.ListVarName1913 % VarType=VarTypeCell{icell};1914 % ivar_X=VarType.coord_x;1915 % ivar_Y=VarType.coord_y;1916 % ivar_FF=VarType.errorflag;1917 % if isempty(ivar_X)1918 % test_grid=1;%test for input data on regular grid (e.g. image)coordinates1919 % else1920 % if length(ivar_Y)~=11921 % warndlg_uvmat('y coordinate missing in proj_field.m','ERROR')1922 % return1923 % end1924 % test_grid=0;1925 % end1926 % % DimIndices=Data{1}.VarDimIndex{VarIndex(1)};%indices of the dimensions of the first variable (common to all variables in the cell)1927 % %case of input fields with unstructured coordinates1928 % if ~test_grid1929 % for ivar=VarIndex1930 % VarName=MergeData.ListVarName{ivar};1931 % for iview=1:nbview1932 % eval(['MergeData.' VarName '=[MergeData.' VarName '; Data{iview}.' VarName ';'])1933 % end1934 % end1935 % %case of fields defined on a structured grid1936 % else1937 % % DimValue=MergeData.DimValue(DimIndices);%set of dimension values1938 % testFF=0;1939 % for iview=2:nbview1940 % % if ~isequal(DimValue,Data{iview}.DimValue(DimIndices))1941 % % MergeData.Txt='ERROR: attempt at merging structured fields with different sizes';1942 % % return1943 % % end1944 % for ivar=VarIndex1945 % VarName=MergeData.ListVarName{ivar};1946 % if isfield(MergeData,'VarAttribute')1947 % if length(MergeData.VarAttribute)>=ivar && isfield(MergeData.VarAttribute{ivar},'Role') && isequal(MergeData.VarAttribute{ivar}.Role,'errorflag')1948 % testFF=1;1949 % end1950 % end1951 % eval(['MergeData.' VarName '=MergeData.' VarName '+ Data{iview}.' VarName ';'])1952 % end1953 % end1954 % if testFF1955 % nbaver=nbview-MergeData.FF;1956 % indgood=find(nbaver>0);1957 % for ivar=VarIndex1958 % VarName=MergeData.ListVarName{ivar};1959 % eval(['MergeData.' VarName '(indgood)=double(MergeData.' VarName '(indgood))./nbaver(indgood);'])1960 % end1961 % else1962 % for ivar=VarIndex1963 % VarName=MergeData.ListVarName{ivar};1964 % eval(['MergeData.' VarName '=double(MergeData.' VarName ')./nbview;'])1965 % end1966 % end1967 % end1968 % end1969 %1970 1899 1971 1900 %----------------------------- … … 2045 1974 end 2046 1975 2047 2048 %----------------------------------------------------------- 2049 % find the times corresponding to the first and last indices of a series 2050 % 1976 %------------------------------------------------------------------------ 1977 % ---- find the times corresponding to the first and last indices of a series 2051 1978 function displ_time(handles,times) 1979 %------------------------------------------------------------------------ 2052 1980 hseries=get(handles.last_i,'parent'); 2053 1981 SeriesData=get(hseries,'UserData');% … … 2146 2074 set(handles.time_last,'String',time_last_cell); 2147 2075 2148 %-------------------------------------------------------------------- 2149 % --- Executes on selection change in VelTypeMenu. 2150 function VelTypeMenu_Callback(hObject, eventdata, handles) 2151 % VelTypeList=get(handles.VelTypeMenu,'String'); 2152 % VelTypeIndex=get(handles.VelTypeMenu,'Value'); 2153 % VelTypeCell=get(handles.VelType,'String'); 2154 % VelTypeCell{1}=VelTypeList{VelTypeIndex}; 2155 % set(handles.VelType,'String',VelTypeCell) 2156 2157 2158 %-------------------------------------------------------------------- 2076 %------------------------------------------------------------------------ 2159 2077 % --- Executes on button press in GetObject. 2160 2078 function GetObject_Callback(hObject, eventdata, handles) 2079 %------------------------------------------------------------------------ 2161 2080 hseries=get(handles.GetObject,'parent'); 2162 2081 SeriesData=get(hseries,'UserData'); … … 2169 2088 [SeriesData.hset_object,SeriesData.sethandles]=set_object(DataInit); %open the set_object interface 2170 2089 else 2171 DataInit.TITLE='POINTS';%default option 2172 [SeriesData.hset_object,SeriesData.sethandles]=set_object(DataInit); %open the set_object interface 2090 %get the object file 2091 defaultname=get(handles.RootPath,'String'); 2092 [FileName, PathName, filterindex] = uigetfile( ... 2093 {'*.xml;*.mat', ' (*.xml,*.mat)'; 2094 '*.xml', '.xml files '; ... 2095 '*.mat', '.mat matlab files '}, ... 2096 'Pick a file',defaultname{1}); 2097 fileinput=[PathName FileName];%complete file name 2098 testblank=findstr(fileinput,' ');%look for blanks 2099 if ~isempty(testblank) 2100 msgbox_uvmat('ERROR','forbidden input file name: contain blanks') 2101 return 2102 end 2103 sizf=size(fileinput); 2104 if (~ischar(fileinput)||~isequal(sizf(1),1)),return;end 2105 %read the file 2106 t=xmltree(fileinput); 2107 data=convert(t); 2108 if ~isfield(data,'Style') 2109 data.Style='points'; 2110 end 2111 if ~isfield(data,'ProjMode') 2112 data.ProjMode='projection'; 2113 end 2114 transform_menu=get(handles.transform_fct,'String'); 2115 ichoice=get(handles.transform_fct,'Value'); 2116 if isequal(transform_menu{ichoice},'px'); 2117 data.CoordType='px'; 2118 else 2119 data.CoordType='phys'; 2120 end 2121 data.desable_plot=1; 2122 [SeriesData.hset_object,SeriesData.sethandles]=set_object(data);% call the set_object interface 2173 2123 end 2174 2124 else 2175 2125 set(handles.GetObject,'BackgroundColor',[0 1 0])%put activated buttons to green 2176 if isfield(SeriesData,'hset_object')&& ishandle(SeriesData.hset_object)2177 close(SeriesData.hset_object)2178 end2126 % if isfield(SeriesData,'hset_object')&& ishandle(SeriesData.hset_object) 2127 % close(SeriesData.hset_object) 2128 % end 2179 2129 end 2180 2130 set(hseries,'UserData',SeriesData) … … 2184 2134 value=get(handles.GetMask,'Value'); 2185 2135 if value 2186 errordlg('not implemented yet')2136 msgbox_uvmat('ERROR','not implemented yet') 2187 2137 end 2188 2138 %-------------------------------------------------------------- 2189 2139 2190 %------------------------------------------------------------------- -------2140 %------------------------------------------------------------------- 2191 2141 %'uv_ncbrowser': interactively calls the netcdf file browser 'get_field.m' 2192 2142 function ncbrowser_uvmat(hObject, eventdata) 2143 %------------------------------------------------------------------- 2193 2144 bla=get(gcbo,'String'); 2194 2145 ind=get(gcbo,'Value'); … … 2198 2149 get_field(filename) 2199 2150 2200 % ------------------------------------------------------------------ --2151 % ------------------------------------------------------------------ 2201 2152 function MenuHelp_Callback(hObject, eventdata, handles) 2202 2153 %------------------------------------------------------------------- 2203 2154 path_to_uvmat=which ('uvmat');% check the path of uvmat 2204 2155 pathelp=fileparts(path_to_uvmat); … … 2210 2161 end 2211 2162 2212 2163 %------------------------------------------------------------------- 2213 2164 % --- Executes on selection change in transform_fct. 2214 2165 function transform_fct_Callback(hObject, eventdata, handles) 2215 2166 %------------------------------------------------------------------- 2216 2167 global nb_transform 2217 2168 -
trunk/src/series/aver_stat.m
r38 r41 32 32 WaitbarPos=get(hseries.waitbar_frame,'Position'); 33 33 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 34 35 %projection object 36 test_object=get(hseries.GetObject,'Value'); 37 if test_object%isfield(Series,'sethandles') 38 hset_object=findobj(allchild(0),'Name','set_object'); 39 ProjObject=read_set_object(guidata(hset_object)); 40 %answeryes=questdlg({['field series projected on ' Series.ProjObject.Style]}); 41 answeryes=msgbox_uvmat('INPUT_Y-N',['field series projected on ' ProjObject.Style ' before averaging']); 42 if ~isequal(answeryes,'Yes') 43 return 44 end 45 end 46 34 47 %root input file and type 35 48 if ~iscell(Series.RootPath)% case of a single input field series … … 145 158 end 146 159 if ~isequal(FieldName,{'get_field...'}) 160 if isequal(FieldName,{''}) && ~testima 161 msgbox_uvmat('ERROR','an input field needs to be selected') 162 return 163 end 147 164 testcivx=testnc; 148 165 end … … 235 252 % Root name of output files (TO GENERALISE FOR TWO INPUT SERIES) 236 253 subdir_result='aver_stat'; 237 % filebasesub=fullfile(RootPath{1},subdir_result,RootFile{1});238 % if isempty(SubDir{1}) % create a subdirectory '/aver_stat'239 % subdir_result='aver_stat';240 % filebasemean=fullfile(RootPath{1},subdir_result);241 254 if ~exist(fullfile(RootPath{1},subdir_result),'dir') 242 255 dircur=pwd; %record current working directory … … 249 262 end 250 263 filebase_out=filebase{1}; 251 % else252 % subdir_result=SubDir{1};253 % filebase_out=[filebase{1} '_mean'];% output root name obtained by adding the suffix _mean to the input254 % end255 %output nomtype (to generalise)256 264 NomTypeOut=nomtype2pair(NomType{1},num_i2{end}(end)-num_i1{1}(1),num_j2{end}(end)-num_j1{1}(1)); 257 258 % if NbSlice==1259 % filebase_out=[filebasesub '_mean'];260 % else261 % filebase_out=[filebasesub '_' NbSlice_name 'mean'];262 % answeryes=questdlg({['will make average in ' num2str(NbSlice) ' slices'];['results stored as files ' filebase_out ' ...']});263 % if ~isequal(answeryes,'Yes')264 % return265 % end266 % end267 265 268 266 % coordinate transform or other user defined transform 269 Coord_menu=get(hseries.CoordType,'String'); 270 menu_val=get(hseries.CoordType,'Value'); 271 usrfct=Coord_menu{menu_val};272 testfct=~isequal(usrfct,''); 267 transform_fct=[];%default 268 if isfield(Series,'transform_fct') 269 transform_fct=Series.transform_fct; 270 end 273 271 274 272 %slice loop … … 312 310 end 313 311 % coordinate transform (or other user defined transform) 314 if ~ise qual(Series.CoordType,'')312 if ~isempty(transform_fct) 315 313 % z index 316 314 if ~isempty(NbSlice_calib) … … 318 316 end 319 317 if nbview==2 320 [Data{1},Data{2}]= feval(Series.CoordType,Data{1},XmlData{1},Data{2},XmlData{2});318 [Data{1},Data{2}]=transform_fct(Data{1},XmlData{1},Data{2},XmlData{2}); 321 319 if isempty(Data{2}) 322 320 Data(2)=[]; 323 321 end 324 322 else 325 Data{1}= feval(Series.CoordType,Data{1},XmlData);323 Data{1}=transform_fct(Data{1},XmlData); 326 324 end 327 325 end … … 338 336 Field=Data{1}; 339 337 end 340 if isfield(Series,'ProjObject')341 [Field,errormsg]=proj_field(Field, Series.ProjObject);338 if test_object 339 [Field,errormsg]=proj_field(Field,ProjObject); 342 340 if ~isempty(errormsg) 343 341 msgbox_uvmat('ERROR',['error in aver_stat/proj_field:' errormsg]) -
trunk/src/series/merge_proj.m
r29 r41 23 23 WaitbarPos=get(hseries.waitbar_frame,'Position'); %positiopn of waitbar frame 24 24 %------------------------------------------------- 25 26 %projection object 27 test_object=get(hseries.GetObject,'Value'); 28 if test_object 29 hset_object=findobj(allchild(0),'Name','set_object'); 30 ProjObject=read_set_object(guidata(hset_object)); 31 if ~isfield(ProjObject,'Style') 32 msgbox_uvmat('ERROR','Undefined projection object style') 33 return 34 end 35 if ~isequal(ProjObject.Style,'plane') 36 msgbox_uvmat('ERROR','The projection object must be a plane') 37 return 38 end 39 %answeryes=questdlg({['field series projected on ' Series.ProjObject.Style]}); 40 answeryes=msgbox_uvmat('INPUT_Y-N',['field series projected on ' ProjObject.Style]); 41 if ~isequal(answeryes,'Yes') 42 return 43 end 44 end 25 45 26 46 %numbers of view fields (nbre of inputs in RootPath) … … 125 145 end 126 146 147 % coordinate transform or other user defined transform 148 transform_fct=[];%default 149 if isfield(Series,'transform_fct') 150 transform_fct=Series.transform_fct; 151 end 152 127 153 % Field and velocity type (the same for all views) 128 154 Field_str=get(hseries.FieldMenu,'String'); … … 170 196 testcivx=testnc; 171 197 end 198 172 199 %name of output files and directory: 173 200 % res_subdir=fullfile(Series.RootPath{1},[Series.SubDir{1} '_STAT']); … … 178 205 if isequal(length(RootPath),1) 179 206 fulldir=RootPath{1}; 180 subdir=' GRID';207 subdir='merge_proj'; 181 208 res_subdir=fullfile(fulldir,subdir); 182 209 else … … 209 236 filebasesub=fullfile(res_subdir,Series.RootFile{1}); 210 237 filebase_merge=fullfile(res_subdir,'merged');%root name for the merged files 211 212 %projection object213 if isfield(Series,'sethandles')214 if ishandle(Series.sethandles.set_object)215 Series.ProjObject=read_set_object(Series.sethandles);216 if ~isfield(Series.ProjObject,'Style')217 msgbox_uvmat('ERROR','Undefined projection object style')218 return219 end220 if ~isequal(Series.ProjObject.Style,'plane')221 msgbox_uvmat('ERROR','The projection object must be a plane')222 return223 end224 end225 end226 238 227 239 %MAIN LOOP … … 271 283 Field{iview}.ZIndex=mod(num_i1{iview}(ifile)-1,NbSlice_calib{1})+1; 272 284 end 273 if ~ise qual(transform,'')274 Field{iview}= feval(Series.CoordType,Field{iview},XmlData{iview});%transform to phys if requested285 if ~isempty(transform_fct) 286 Field{iview}=transform_fct(Field{iview},XmlData{iview});%transform to phys if requested 275 287 end 276 288 if testcivx … … 279 291 280 292 %projection on object (gridded plane) 281 if isfield(Series,'ProjObject')282 Field{iview}=proj_field(Field{iview}, Series.ProjObject);293 if test_object 294 Field{iview}=proj_field(Field{iview},ProjObject); 283 295 end 284 296 end -
trunk/src/series/relabel_i_j.m
r40 r41 29 29 nbfield2=size(XmlData.Time,2) 30 30 31 answer=msgbox_uvmat(' CONFIRMATION','apply image rescaling function levels.m')31 answer=msgbox_uvmat('INPUT_Y-N','apply image rescaling function levels.m') 32 32 test_level=isequal(answer,'Yes') 33 33 -
trunk/src/series/time_series.m
r38 r41 34 34 %projection object 35 35 test_object=get(hseries.GetObject,'Value'); 36 if test_object%isfield(Series,'sethandles') 37 Series.ProjObject=read_set_object(Series.sethandles); 36 if test_object 37 hset_object=findobj(allchild(0),'Name','set_object'); 38 ProjObject=read_set_object(guidata(hset_object)); 38 39 %answeryes=questdlg({['field series projected on ' Series.ProjObject.Style]}); 39 answeryes=msgbox_uvmat('INPUT_Y-N',['field series projected on ' Series.ProjObject.Style]);40 answeryes=msgbox_uvmat('INPUT_Y-N',['field series projected on ' ProjObject.Style]); 40 41 if ~isequal(answeryes,'Yes') 41 42 return … … 170 171 171 172 % Root name of output files (TO GENERALISE FOR TWO INPUT SERIES) 172 filebasesub=fullfile(RootPath{1},RootFile{1});173 if NbSlice==1174 filebase_out=[filebasesub '_time'];175 else176 filebase_out=[filebasesub '_' NbSlice_name 'mtim'];177 increment=num_i1{1}(2)-num_i1{1}(1);178 if ~isequal(increment,1) % if an increment is set179 answeryes=msgbox_uvmat('INPUT_Y-N',['will take time series in ' num2str(NbSlice) 'slices with increment = ' num2str(increment) '!']);180 else181 answeryes=msgbox_uvmat('INPUT_Y-N',{['will take time series in ' num2str(NbSlice) ' slices'];['results stored as files ' filebase_out ' ...']});182 end183 if ~isequal(answeryes,'Yes')184 return185 end186 end173 % filebasesub=fullfile(RootPath{1},RootFile{1}); 174 % if NbSlice==1 175 % filebase_out=[filebasesub '_time']; 176 % else 177 % filebase_out=[filebasesub '_' NbSlice_name 'mtim']; 178 % increment=num_i1{1}(2)-num_i1{1}(1); 179 % if ~isequal(increment,1) % if an increment is set 180 % answeryes=msgbox_uvmat('INPUT_Y-N',['will take time series in ' num2str(NbSlice) 'slices with increment = ' num2str(increment) '!']); 181 % else 182 % answeryes=msgbox_uvmat('INPUT_Y-N',{['will take time series in ' num2str(NbSlice) ' slices'];['results stored as files ' filebase_out ' ...']}); 183 % end 184 % if ~isequal(answeryes,'Yes') 185 % return 186 % end 187 % end 187 188 VelType_str=get(hseries.VelTypeMenu,'String'); 188 189 VelType_val=get(hseries.VelTypeMenu,'Value'); … … 269 270 end 270 271 271 % image or scalar processing programme set by user 272 Coord_menu=get(hseries.CoordType,'String'); 273 menu_val=get(hseries.CoordType,'Value'); 274 usrfct=Coord_menu{menu_val}; 275 testfct=~isequal(usrfct,''); 272 % Root name of output files (TO GENERALISE FOR TWO INPUT SERIES) 273 subdir_result='time_series'; 274 % filebasesub=fullfile(RootPath{1},subdir_result,RootFile{1}); 275 % if isempty(SubDir{1}) % create a subdirectory '/aver_stat' 276 % subdir_result='aver_stat'; 277 % filebasemean=fullfile(RootPath{1},subdir_result); 278 if ~exist(fullfile(RootPath{1},subdir_result),'dir') 279 dircur=pwd; %record current working directory 280 cd(RootPath{1})% goes to the iamge directory 281 [m1,m2,m3]=mkdir(subdir_result); 282 if ~isequal(m2,'') 283 msgbox_uvmat('CONFIRMATION',m2);%error message for directory creation 284 end 285 cd(dircur) %back to the initial working directory 286 end 287 filebase_out=filebase{1}; 288 NomTypeOut=nomtype2pair(NomType{1},num_i2{end}(end)-num_i1{1}(1),num_j2{end}(end)-num_j1{1}(1)); 289 290 % coordinate transform or other user defined transform 291 transform_fct=[];%default 292 if isfield(Series,'transform_fct') 293 transform_fct=Series.transform_fct; 294 end 276 295 277 296 % to update: … … 331 350 end 332 351 end 333 % geometry transform or other user defined transform 334 if ~isequal(Series.CoordType,'') 352 353 % coordinate transform (or other user defined transform) 354 if ~isempty(transform_fct) 355 % z index 356 if ~isempty(NbSlice_calib) 357 Data{iview}.ZIndex=mod(num_i1{iview}(ifile)-1,NbSlice_calib{1})+1;%Zindex for phys transform 358 end 335 359 if nbview==2 336 [Data{1},Data{2}]= feval(Series.CoordType,Data{1},XmlData{1},Data{2},XmlData{2});360 [Data{1},Data{2}]=transform_fct(Data{1},XmlData{1},Data{2},XmlData{2}); 337 361 if isempty(Data{2}) 338 362 Data(2)=[]; 339 363 end 340 364 else 341 Data{1}= feval(Series.CoordType,Data{1},XmlData{1});342 end 343 end 365 Data{1}=transform_fct(Data{1},XmlData); 366 end 367 end 344 368 if testcivx 345 369 Data{iview}=calc_field(FieldName,Data{iview});%calculate field (vort..) … … 354 378 Field=Data{1}; 355 379 end 356 if isfield(Series,'ProjObject') 357 Series.ProjObject 358 [Field,errormsg]=proj_field(Field,Series.ProjObject); 380 if test_object 381 [Field,errormsg]=proj_field(Field,ProjObject); 359 382 if ~isempty(errormsg) 360 383 msgbox_uvmat('ERROR',['error in time_series/proj_field:' errormsg]) … … 393 416 end 394 417 % check whether the variable ivar is a dimension variable 395 %index=Field.VarDimIndex{ivar};%dimension indices of the variable #ivar396 418 DimCell=Field.VarDimName{ivar}; 397 419 if ischar(DimCell) … … 416 438 if testsum(ivar)==2% test for recorded variable 417 439 eval(['VarVal=Field.' VarName ';']); 418 if isequal( Series.ProjObject.ProjMode,'inside')% take the average in the domain for 'inside' mode440 if isequal(ProjObject.ProjMode,'inside')% take the average in the domain for 'inside' mode 419 441 if isempty(VarVal) 420 442 msgbox_uvmat('ERROR',['empty result at frame index ' num2str(num_i1{iview}(ifile))]) -
trunk/src/set_object.m
r40 r41 67 67 % parameters on the uvmat interface (obtained by 'get_plot_handle.m') 68 68 function set_object_OpeningFcn(hObject, eventdata, handles, data, PlotHandles,ZBounds) 69 69 %------------------------------------------------------------------- 70 70 % Choose default command line output for set_object 71 71 handles.output = hObject; … … 94 94 % fill the interface as set in the input data: 95 95 if exist('data','var') 96 if isfield(data,'desable_open')97 desable_open=data.desable_open;%test to desable button OPEN (edit or display mode)98 end96 % if isfield(data,'desable_open') 97 % desable_open=data.desable_open;%test to desable button OPEN (edit or display mode) 98 % end 99 99 if isfield(data,'desable_plot') 100 100 desable_plot=data.desable_plot;%test to desable button PLOT (display mode) … … 110 110 end 111 111 end 112 if isfield(data,'ProjMode') && isfield(data,'Style')113 data.TITLE=set_title(data.Style,data.ProjMode);% define TITLE in set_object (POINTS, LINE, PATCH,...)114 end115 if isfield(data,'TITLE')116 menutitle=get(handles.TITLE,'String');117 for iline=1:length(menutitle)118 strmenu=menutitle{iline};119 if isequal(data.TITLE,strmenu)120 set(handles.TITLE,'Value',iline)121 break122 end123 end124 TITLE_Callback(hObject, eventdata, handles)% enable edit boxes depending on TITLE125 end126 if isfield(data,'fixedtitle')&isequal(data.fixedtitle,1)127 set(handles.TITLE,'enable','off')128 end112 % if isfield(data,'ProjMode') && isfield(data,'Style') 113 % data.TITLE=set_title(data.Style,data.ProjMode);% define TITLE in set_object (POINTS, LINE, PATCH,...) 114 % end 115 % if isfield(data,'TITLE') 116 % menutitle=get(handles.TITLE,'String'); 117 % for iline=1:length(menutitle) 118 % strmenu=menutitle{iline}; 119 % if isequal(data.TITLE,strmenu) 120 % set(handles.TITLE,'Value',iline) 121 % break 122 % end 123 % end 124 % TITLE_Callback(hObject, eventdata, handles)% enable edit boxes depending on TITLE 125 % end 126 % if isfield(data,'fixedtitle')&isequal(data.fixedtitle,1) 127 % set(handles.TITLE,'enable','off') 128 % end 129 129 if isfield(data,'Style') 130 130 menu=get(handles.ObjectStyle,'String'); … … 136 136 end 137 137 end 138 ObjectStyle_Callback(hObject, eventdata, handles) 138 139 if isfield(data,'ProjMode') 139 140 menu=get(handles.ProjMode,'String'); … … 145 146 end 146 147 end 148 ProjMode_Callback(hObject, eventdata, handles) 147 149 if isfield(data,'Coord') & size(data.Coord,2)>=2 148 150 sizcoord=size(data.Coord); … … 226 228 end 227 229 end 228 if desable_open229 set(handles.OPEN,'Visible','off')230 else231 set(handles.OPEN,'Visible','on')232 end230 % if desable_open 231 % set(handles.OPEN,'Visible','off') 232 % else 233 % set(handles.OPEN,'Visible','on') 234 % end 233 235 if desable_plot 234 236 set(handles.PLOT,'Visible','off') … … 252 254 % --- Executes on selection change in ObjectStyle. 253 255 function ObjectStyle_Callback(hObject, eventdata, handles) 254 style_prev=get(handles.ObjectStyle,'UserData'); 256 style_prev=get(handles.ObjectStyle,'UserData');%previous object style 255 257 str=get(handles.ObjectStyle,'String'); 256 258 val=get(handles.ObjectStyle,'Value'); 259 style=str{val}; 257 260 % make correspondance between different object styles 258 261 % if ~isequal(str{val},style_prev) … … 287 290 z_new{1}=Zcolumn{1}; 288 291 end 289 if isequal(st r{val},'line')292 if isequal(style,'line') 290 293 if isequal(style_prev,'rectangle')|isequal(style_prev,'ellipse') 291 294 XMax=get(handles.XMax,'String'); … … 297 300 set(handles.ZObject,'String',z_new) 298 301 end 299 elseif isequal(st r{val},'polyline')300 elseif isequal(st r{val},'rectangle')| isequal(str{val},'ellipse')302 elseif isequal(style,'polyline') 303 elseif isequal(style,'rectangle')| isequal(style,'ellipse') 301 304 set(handles.XObject,'String',x_new) 302 305 set(handles.YObject,'String',y_new) … … 304 307 end 305 308 % end 306 307 308 309 switch style 310 case {'points','line','polyline','plane'} 311 menu_proj={'projection';'interp';'filter';'none'}; 312 case {'polygon','rectangle','ellipse'} 313 menu_proj={'inside';'outside';'mask_inside';'mask_outside'}; 314 case 'volume' 315 menu_proj={'none'}; 316 end 317 proj_index=get(handles.ProjMode,'Value'); 318 if proj_index<numel(menu_proj) 319 set(handles.ProjMode,'Value',1);% value index must not exceed the menu length 320 end 321 set(handles.ProjMode,'String',menu_proj) 309 322 ProjMode_Callback(hObject, eventdata, handles) 310 323 %store the current option 311 324 str=get(handles.ObjectStyle,'String'); 312 325 val=get(handles.ObjectStyle,'Value'); 313 set(handles.ObjectStyle,'UserData',st r{val})326 set(handles.ObjectStyle,'UserData',style) 314 327 315 328 %---------------------------------------------- … … 334 347 ObjectStyle=menu{value}; 335 348 test3D=isequal(get(handles.ZObject,'Visible'),'on');%3D case 336 if isequal(ObjectStyle,'plane')|isequal(ObjectStyle,'volume') 337 set(handles.Phi,'Visible','on') 338 if test3D%3D case 339 set(handles.Theta,'Visible','on') 340 set(handles.Psi,'Visible','on') 341 end 342 set(handles.XMin,'Visible','on') 349 350 %default setting 351 set(handles.Phi,'Visible','off') 352 set(handles.Theta,'Visible','off') 353 set(handles.Psi,'Visible','off') 354 set(handles.XMin,'Visible','off') 355 set(handles.XMax,'Visible','off') 356 set(handles.YMin,'Visible','off') 357 if isequal(ProjMode,'interp') 358 set(handles.YMax,'Visible','off') 359 else 360 set(handles.YMax,'Visible','on') 361 end 362 if isequal(ObjectStyle,'rectangle')|isequal(ObjectStyle,'ellipse') 343 363 set(handles.XMax,'Visible','on') 344 set(handles.YMin,'Visible','on')345 set(handles.YMax,'Visible','on')346 if test3D347 set(handles.Theta,'Visible','on')348 set(handles.Psi,'Visible','on')349 set(handles.ZMin,'Visible','on')350 set(handles.ZMax,'Visible','on')351 end352 364 else 353 set(handles.Phi,'Visible','off') 354 set(handles.Theta,'Visible','off') 355 set(handles.Psi,'Visible','off') 356 set(handles.XMin,'Visible','off') 357 set(handles.XMax,'Visible','off') 358 set(handles.YMin,'Visible','off') 359 if isequal(ProjMode,'interp') 360 set(handles.YMax,'Visible','off') 361 else 362 set(handles.YMax,'Visible','on') 363 end 364 if isequal(ObjectStyle,'rectangle')|isequal(ObjectStyle,'ellipse') 365 set(handles.XMax,'Visible','on') 366 else 367 set(handles.XMax,'Visible','off') 368 end 369 set(handles.ZMin,'Visible','off') 370 set(handles.ZMax,'Visible','off') 371 end 372 TITLE_list=get(handles.TITLE,'String'); 373 val=get(handles.TITLE,'Value'); 374 TITLE=TITLE_list{val}; 375 switch TITLE 376 case {'POINTS','PATCH','MASK'} 377 set(handles.DX,'Visible','off') 378 set(handles.DY,'Visible','off') 379 set(handles.DZ,'Visible','off') 380 case {'LINE'} 365 set(handles.XMax,'Visible','off') 366 end 367 set(handles.ZMin,'Visible','off') 368 set(handles.ZMax,'Visible','off') 369 set(handles.DX,'Visible','off') 370 set(handles.DY,'Visible','off') 371 set(handles.DZ,'Visible','off') 372 373 switch ObjectStyle 374 case 'points' 375 set(handles.YMax,'TooltipString','YMax: range of averaging around each point') 376 set(handles.XObject,'TooltipString','XObject: set of x coordinates of the points') 377 set(handles.YObject,'TooltipString','YObject: set of y coordinates of the points') 378 set(handles.ZObject,'TooltipString','ZObject: set of z coordinates of the points') 379 case {'line','polyline','polygon'} 380 set(handles.YMax,'TooltipString','YMax: range of averaging around the line') 381 set(handles.XObject,'TooltipString','XObject: set of x coordinates defining the line') 382 set(handles.YObject,'TooltipString','YObject: set of y coordinates defining the line') 383 set(handles.ZObject,'TooltipString','ZObject: set of z coordinates defining the line') 381 384 if isequal(ProjMode,'interp')|| isequal(ProjMode,'filter') 382 385 set(handles.DX,'Visible','on') 383 else 384 set(handles.DX,'Visible','off') 385 end 386 case {'PLANE'} 386 set(handles.DX,'TooltipString','DX: mesh for the interpolated field along the line') 387 end 388 case {'rectangle','ellipse'} 389 set(handles.XMax,'TooltipString',['XMax: half length of the ' ObjectStyle]) 390 set(handles.YMax,'TooltipString',['YMax: half width of the ' ObjectStyle]) 391 set(handles.XObject,'TooltipString',['XObject: x coordinate of the ' ObjectStyle ' centre']) 392 set(handles.YObject,'TooltipString',['YObject: y coordinate of the ' ObjectStyle ' centre']) 393 case {'plane','volume'} 394 set(handles.Phi,'Visible','on') 395 set(handles.XMin,'Visible','on') 396 set(handles.XMax,'Visible','on') 397 set(handles.YMin,'Visible','on') 398 set(handles.YMax,'Visible','on') 399 set(handles.XObject,'TooltipString',['XObject: x coordinate of the axis origin for the ' ObjectStyle]) 400 set(handles.YObject,'TooltipString',['YObject: y coordinate of the axis origin for the ' ObjectStyle]) 401 if test3D 402 set(handles.Theta,'Visible','on') 403 set(handles.Psi,'Visible','on') 404 set(handles.ZMin,'Visible','on') 405 set(handles.ZMax,'Visible','on') 406 end 387 407 if isequal(ProjMode,'interp')|| isequal(ProjMode,'filter') 388 408 set(handles.DX,'Visible','on') … … 392 412 set(handles.DY,'Visible','off') 393 413 end 394 case {'VOLUME'} 395 if isequal(ProjMode,'interp') 396 set(handles.DX,'Visible','on') 397 set(handles.DY,'Visible','on') 398 set(handles.DZ,'Visible','on') 399 else 400 set(handles.DX,'Visible','off') 401 set(handles.DY,'Visible','off') 402 set(handles.DZ,'Visible','off') 403 end 404 end 405 406 %--------------------------------------------- 407 % --- Executes on selection change in TITLE. 408 function TITLE_Callback(hObject, eventdata, handles) 409 %--------------------------------------------- 410 hsetobject=get(handles.TITLE,'parent'); 411 SetData=get(hsetobject,'UserData');%get the hidden interface data 412 % function named CALLBACK in UNTITLED.M with the given input arguments. 413 menu=get(handles.TITLE,'String'); 414 value=get(handles.TITLE,'Value'); 415 titl=menu{value}; 416 if isequal(titl,'POINTS'); 417 menu_style={'points'}; 418 menu_proj={'projection';'interp';'filter';'none'}; 419 elseif isequal(titl,'LINE') 420 menu_style={'line';'polyline';'rectangle';'polygon';'ellipse'};%'line' =default 421 menu_proj={'projection';'interp';'filter';'none'}; 422 elseif isequal(titl,'PATCH') 423 menu_style={'rectangle';'polygon';'ellipse'};%'line' =default 424 menu_proj={'inside';'outside'}; 425 elseif isequal(titl,'MASK') 426 menu_style={'polygon'};%'line' =default 427 menu_proj={'mask_inside';'mask_outside'}; 428 elseif isequal(titl,'PLANE') 429 menu_style={'plane'}; 430 menu_proj={'projection';'interp';'filter';'none'}; 431 elseif isequal(titl,'VOLUME') 432 menu_style={'volume'}; 433 menu_proj={'none'}; 434 435 end 436 old_menu=get(handles.ObjectStyle,'String'); 437 value=get(handles.ObjectStyle,'Value'); 438 old_style=old_menu{value}; 439 teststyle=0; 440 for iline=1:length(menu_style) 441 if isequal(menu_style{iline},old_style) 442 styleval=iline; 443 teststyle=1; 444 break 445 end 446 end 447 if ~teststyle 448 new_style=[];%default 449 switch old_style 450 case 'polyline' 451 new_style='polygon'; 452 case 'polygon' 453 new_style='polyline'; 454 end 455 if ~isempty(new_style) 456 for iline=1:length(menu_style) 457 if isequal(menu_style{iline},new_style) 458 styleval=iline; 459 teststyle=1; 460 break 461 end 462 end 463 end 464 end 465 if ~teststyle 466 styleval=1; 467 end 468 set(handles.ObjectStyle,'String',menu_style) 469 set(handles.ObjectStyle,'Value',styleval) 470 set(handles.ProjMode,'String',menu_proj) 471 set(handles.ProjMode,'Value',1) 472 ObjectStyle_Callback(hObject, eventdata, handles) 414 if isequal(ObjectStyle,'volume') && isequal(ProjMode,'interp') 415 set(handles.DZ,'Visible','on') 416 end 417 end 418 % 419 % %--------------------------------------------- 420 % % --- Executes on selection change in TITLE. 421 % function TITLE_Callback(style, handles) 422 % %--------------------------------------------- 423 % switch style 424 % case {'points','line','polyline','plane'} 425 % menu_proj={'projection';'interp';'filter';'none'}; 426 % case {'polygon','rectangle','ellipse'} 427 % menu_proj={'inside';'outside';'mask_inside';'mask_outside'}; 428 % case 'volume' 429 % menu_proj={'none'}; 430 % end 431 % 432 % 433 % old_menu=get(handles.ObjectStyle,'String'); 434 % value=get(handles.ObjectStyle,'Value'); 435 % old_style=old_menu{value}; 436 % teststyle=0; 437 % for iline=1:length(menu_style) 438 % if isequal(menu_style{iline},old_style) 439 % styleval=iline; 440 % teststyle=1; 441 % break 442 % end 443 % end 444 % if ~teststyle 445 % new_style=[];%default 446 % switch old_style 447 % case 'polyline' 448 % new_style='polygon'; 449 % case 'polygon' 450 % new_style='polyline'; 451 % end 452 % if ~isempty(new_style) 453 % for iline=1:length(menu_style) 454 % if isequal(menu_style{iline},new_style) 455 % styleval=iline; 456 % teststyle=1; 457 % break 458 % end 459 % end 460 % end 461 % end 462 % if ~teststyle 463 % styleval=1; 464 % end 465 % set(handles.ObjectStyle,'String',menu_style) 466 % set(handles.ObjectStyle,'Value',styleval) 467 % set(handles.ProjMode,'String',menu_proj) 468 % set(handles.ProjMode,'Value',1) 469 % ObjectStyle_Callback(hObject, eventdata, handles) 473 470 474 471 %--------------------------------------------- … … 546 543 end 547 544 %Display title 548 title=set_title(s.Style,s.ProjMode);%update the title549 if ~isempty(huvmat)550 hhuvmat=guidata(huvmat);551 end552 menu=get(handles.TITLE,'String');553 for iline=1:length(menu)554 if isequal(menu{iline},title)555 set(handles.TITLE,'Value',iline)556 break557 end558 end559 TITLE_Callback(hObject, eventdata, handles)545 % title=set_title(s.Style,s.ProjMode);%update the title 546 % if ~isempty(huvmat) 547 % hhuvmat=guidata(huvmat); 548 % end 549 % menu=get(handles.TITLE,'String'); 550 % for iline=1:length(menu) 551 % if isequal(menu{iline},title) 552 % set(handles.TITLE,'Value',iline) 553 % break 554 % end 555 % end 556 %TITLE_Callback(hObject, eventdata, handles) 560 557 teststyle=0; 561 % if isfield(s,'Style') 558 559 switch s.Style 560 case {'points','line','polyline','plane'} 561 menu_proj={'projection';'interp';'filter';'none'}; 562 case {'polygon','rectangle','ellipse'} 563 menu_proj={'inside';'outside';'mask_inside';'mask_outside'}; 564 case 'volume' 565 menu_proj={'none'}; 566 end 567 set(handles.ObjectStyle,'String',menu_proj) 562 568 menu=get(handles.ObjectStyle,'String'); 563 569 for iline=1:length(menu) … … 569 575 end 570 576 testmode=0; 571 menu=get(handles.ProjMode,'String');572 for iline=1:length(menu )573 if isequal(menu {iline},s.ProjMode)577 %menu=get(handles.ProjMode,'String'); 578 for iline=1:length(menu_proj) 579 if isequal(menu_proj{iline},s.ProjMode) 574 580 set(handles.ProjMode,'Value',iline) 575 581 testmode=1; … … 754 760 set(huvmat,'UserData',UvData)%update the data in the uvmat interface 755 761 list_str=get(hlist_object,'String'); 756 TITLE=set_title(ObjectData.Style,ObjectData.ProjMode); 757 list_str{IndexObj}=[num2str(IndexObj) '-' TITLE]; 762 % TITLE=set_title(ObjectData.Style,ObjectData.ProjMode); 763 % list_str{IndexObj}=[num2str(IndexObj) '-' TITLE]; 764 list_str{IndexObj}=[num2str(IndexObj) '-' ObjectData.Style]; 758 765 if isequal(length(list_str),IndexObj) 759 766 list_str{IndexObj+1}='more...'; … … 849 856 end 850 857 msgbox_uvmat('CONFIRMATION',[answer{1} ' saved']) 858 851 859 %--------------------------------------------------------- 852 860 % --- Executes on slider movement. … … 872 880 873 881 874 875 function XObject_Callback(hObject, eventdata, handles)876 877 878 function YObject_Callback(hObject, eventdata, handles)879 880 881 882 883 function ZObject_Callback(hObject, eventdata, handles)884 885 886 882 % --- Executes on button press in HELP. 887 883 function HELP_Callback(hObject, eventdata, handles) 888 884 path_to_uvmat=which ('uvmat');% check the path of uvmat 889 885 pathelp=fileparts(path_to_uvmat); 890 helpfile=fullfile(pathelp,' UVMAT_DOC','uvmat_doc.html');891 if isempty(dir(helpfile)), errordlg('Please put the help file uvmat_doc.html in the directory UVMAT/UVMAT_DOC')886 helpfile=fullfile(pathelp,'uvmat_doc','uvmat_doc.html'); 887 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') 892 888 else 893 web([helpfile '#set_object'])894 end 895 896 897 898 889 addpath (fullfile(pathelp,'uvmat_doc')) 890 web([helpfile '#set_object']) 891 end 892 893 894 -
trunk/src/uvmat.m
r40 r41 202 202 guidata(hObject, handles); 203 203 204 dircur=pwd %current working directory204 dircur=pwd; %current working directory 205 205 dir_opening=dircur; 206 206
Note: See TracChangeset
for help on using the changeset viewer.