Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r55 r57 1211 1211 ref_j=str2num(get(handles.ref_j,'String')); 1212 1212 end 1213 if isequal(get(handles.dt_text,'String'),'dt(ms)=')%simple series(Di) with equal interval1214 ref_i=ceil((first_i+last_i)/2);1215 ref_j=1;1216 end1213 % if isequal(get(handles.dt_text,'String'),'dt(ms)=')%simple series(Di) with equal interval 1214 % ref_i=ceil((first_i+last_i)/2); 1215 % ref_j=1; 1216 % end 1217 1217 % ref_i=browse.num_ref;%field number initially selected by the browser 1218 1218 time=get(handles.displ_filebase,'UserData'); %get the set of times … … 5029 5029 A=read(movieobject,num); 5030 5030 case 'avi' 5031 mov=aviread(filename,num);5032 5031 mov=aviread(filename,num); 5032 A=frame2im(mov(1)); 5033 5033 case 'multimage' 5034 5034 A=imread(filename,num); -
trunk/src/uvmat.m
r56 r57 1586 1586 set(handles.RunMovie,'BusyAction','queue') 1587 1587 testavi=0; 1588 huvmat=get(handles.RunMovie,'parent'); 1589 UvData=get(huvmat,'UserData'); 1588 UvData=get(handles.uvmat,'UserData'); 1590 1589 1591 1590 while get(handles.speed,'Value')~=0 & isequal(get(handles.RunMovie,'BusyAction'),'queue') % enable STOP command … … 1595 1594 if isfield(UvData,'aviobj') && ~isempty( UvData.aviobj), 1596 1595 UvData.aviobj=close(UvData.aviobj); 1597 set(h uvmat,'UserData',UvData);1596 set(handles.uvmat,'UserData',UvData); 1598 1597 end 1599 1598 set(handles.RunMovie,'BackgroundColor',[1 0 0])%paint the command buttonback to red … … 1602 1601 function STOP_Callback(hObject, eventdata, handles) 1603 1602 %------------------------------------------------------------------- 1604 set(handles.run0,'BusyAction','Cancel') 1603 set(handles.movie_pair,'BusyAction','Cancel') 1604 set(handles.movie_pair,'value',0) 1605 1605 set(handles.RunMovie,'BusyAction','Cancel') 1606 1606 set(handles.MenuExportMovie,'BusyAction','Cancel') … … 1610 1610 function runpm(hObject,eventdata,handles,increment) 1611 1611 %------------------------------------------------------------------ 1612 %check for mùovie pair status 1613 movie_status=get(handles.movie_pair,'Value'); 1614 if isequal(movie_status,1) 1615 STOP_Callback(hObject, eventdata, handles) 1616 end 1612 1617 %read the data on the current input rootfile(s) 1613 1618 … … 1676 1681 end 1677 1682 1683 if isequal(movie_status,1) 1684 set(handles.movie_pair,'Value',1) 1685 movie_pair_Callback(hObject, eventdata, handles); %run 1686 else 1678 1687 % refresh plots 1679 run0_Callback(hObject, eventdata, handles); %run 1688 run0_Callback(hObject, eventdata, handles); %run 1689 end 1680 1690 1681 1691 1682 1692 %------------------------------------------------------- 1683 % --- Executes on button press in movie_pair .1693 % --- Executes on button press in movie_pair: create an alternating movie with two view 1684 1694 %------------------------------------------------------- 1685 1695 function movie_pair_Callback(hObject, eventdata, handles) 1696 status=get(handles.movie_pair,'value'); 1697 if isequal(status,0) 1698 set(handles.movie_pair,'BusyAction','Cancel') 1699 return 1700 else 1701 set(handles.movie_pair,'BusyAction','queue') 1702 end 1686 1703 %initialisation 1687 1704 set(handles.movie_pair,'BackgroundColor',[1 1 0])%paint the command button in yellow … … 1690 1707 index_fields=get(handles.Fields,'Value');% selected string index 1691 1708 FieldName=list_fields{index_fields}; % selected field 1692 %huvmat=get(handles.movie_pair,'parent');1693 1709 if isequal(FieldName,'image') 1694 1710 run0_Callback(hObject, eventdata, handles)%display the first image … … 1700 1716 [ff,rr,filebase,xx,Ext,SubDir]=read_file_boxes(handles); 1701 1717 NomType=get(handles.FileIndex,'UserData'); 1702 num_i 2=str2num(get(handles.i2,'String'));1703 num_j 2=str2num(get(handles.j2,'String'));1704 if ~isempty(num_j2) 1705 num_i1=str2num(get(handles.i1,'String'));1706 [imaname_1,idetect]=name_generator(filebase,num_i1,num_j2,Ext,NomType); 1707 if i detect==01708 msgbox_uvmat('ERROR', ['second input open (-) ' imaname_1 ' not found']);1718 num_i1=stra2num(get(handles.i1,'String')); 1719 num_j1=stra2num(get(handles.j1,'String')); 1720 num_i2=stra2num(get(handles.i2,'String')); 1721 num_j2=stra2num(get(handles.j2,'String')); 1722 if isempty(num_j2) 1723 if isempty(num_i2) 1724 msgbox_uvmat('ERROR', 'a second image index i2 or j2 is needed to show the pair as a movie') 1709 1725 return 1710 end 1711 set(handles.i2,'String',''); % indicates that the second index i2 is not used 1712 elseif ~isempty(num_i2) 1713 num_j1=str2num(get(handles.j1,'String')); 1714 [imaname_1,idetect]=name_generator(filebase,num_i2,num_j1,Ext,NomType); 1715 if idetect==0 1716 msgbox_uvmat('ERROR',['second input open (-) ' imaname_1 ' not found']); 1717 return 1718 end 1719 else 1720 msgbox_uvmat('ERROR', 'a second image index i2 or j2 is needed to show the pair as a movie') 1721 return 1722 end 1726 else 1727 num_j2=num_j1;%repeat the index i1 by default 1728 end 1729 end 1730 if isempty(num_i2) 1731 num_i2=num_i1;%repeat the index i1 by default 1732 end 1733 imaname_1=name_generator(filebase,num_i2,num_j2,Ext,NomType); 1734 if ~exist(imaname_1,'file') 1735 msgbox_uvmat('ERROR',['second input open (-) ' imaname_1 ' not found']); 1736 return 1737 end 1738 % set(handles.i2,'String',''); % indicates that the second index i2 is not used 1739 % set(handles.j2,'String',''); % indicates that the second index i2 is not used 1723 1740 1724 1741 %read the second image … … 1726 1743 Field.AX=UvData.Field.AX; 1727 1744 Field.AY=UvData.Field.AY; 1745 % z index 1746 nbslice=str2double(get(handles.nb_slice,'String')); 1747 if ~isempty(nbslice) 1748 Field.ZIndex=mod(num_i2-1,nbslice)+1; 1749 end 1728 1750 Field.CoordType='px'; 1729 1751 %determine the input file type … … 1775 1797 set(handles.speed,'Visible','on') 1776 1798 set(handles.speed_txt,'Visible','on') 1777 while get(handles.speed,'Value')~=0 && isequal(get(handles. run0,'BusyAction'),'queue'); % enable STOP command1799 while get(handles.speed,'Value')~=0 && isequal(get(handles.movie_pair,'BusyAction'),'queue')%isequal(get(handles.run0,'BusyAction'),'queue'); % enable STOP command 1778 1800 % read and plot the series of images in non erase mode 1779 1801 set(hima,'CData',Field.A); … … 1795 1817 abstime_1=[]; 1796 1818 dt=[]; 1797 % CalibCell={};%default1798 1819 Field={}; 1799 %huvmat=get(handles.run0,'parent');1800 1820 UvData=get(handles.uvmat,'UserData'); 1801 1821 if isfield(UvData,'Txt') 1802 1822 UvData=rmfield(UvData,'Txt');%erase previous error message 1803 1823 end 1804 set(handles.run0,'BusyAction','queue');1824 %set(handles.run0,'BusyAction','queue'); 1805 1825 if ishandle(handles.UVMAT_title) %remove title panel on uvmat 1806 1826 delete(handles.UVMAT_title) … … 1826 1846 NomType=get(handles.FileIndex,'UserData'); 1827 1847 %update the z position index 1828 % if isequal(get(handles.nb_slice,'String'),'vol.')%case of volume1829 % set(handles.z_index,'String',get(handles.j1,'String'));1830 % else1831 1848 nbslice=str2double(get(handles.nb_slice,'String')); 1832 % z_index=mod(num_i1-1,nbslice)+1; 1833 if ~isempty(nbslice) 1849 if ~isnan(nbslice) 1834 1850 z_index=mod(num_i1-1,nbslice)+1; 1835 1851 set(handles.z_index,'String',num2str(z_index)) … … 1885 1901 FieldName_1=[]; 1886 1902 scal_color=[]; 1887 % testvel=0;1888 % testX=0;%default1889 1903 VelType_1=setfield_1(handles); 1890 1904 sub_value=get(handles.SubField,'Value'); … … 1951 1965 1952 1966 %read the input field(s) 1953 % testima_1=isequal(FieldName_1,'image');1954 1967 1955 1968 %read images … … 2007 2020 Rangx=[0.5 npxy(2)-0.5]; % coordinates of the first and last pixel centers 2008 2021 Rangy=[npxy(1)-0.5 0.5]; % 2009 % npx=str2num(get(handles.npx,'String'));2010 % npy=str2num(get(handles.npy,'String'));2011 % if isfield(UvData,'XmlData_1') && isfield(UvData.XmlData_1,'Time')2012 % abs_time=UvData.XmlData_1.Time;2013 % end2014 2022 Field{2}.AName='image'; 2015 2023 Field{2}.ListVarName={'AY','AX','A'}; % … … 2044 2052 if isequal(FileType,'netcdf') %read the first nc field 2045 2053 if isequal(FieldName,'get_field...')% read the field names on the interface get_field. 2046 % test_detect=0;%default2047 2054 VelType=get(handles.Fields,'UserData'); 2048 2055 hget_field=findobj(allchild(0),'Name','get_field');%find the get_field... GUI … … 2050 2057 hget_field= get_field(filename);%open the get_field GUI 2051 2058 end 2052 % test_detect=1;2053 2059 hhget_field=guidata(hget_field); 2054 2060 set(hhget_field.inputfile,'String',filename)% update the list of input fields in get_field … … 2074 2080 if ~isempty(filename_1) && isequal(FileType_1,'netcdf') %read the second file 2075 2081 if isequal(FieldName_1,'get_field...')% read the field names on the interface get_field. 2076 % test_detect=0;%default2077 2082 hget_field=findobj(allchild(0),'Name','get_field_1');%find the get_field... GUI 2078 2083 if isempty(hget_field) … … 2081 2086 % enable_transform(handles,'off')% no field transform (possible transform in the GUI get_field) 2082 2087 end 2083 % test_detect=1;2084 2088 hhget_field=guidata(hget_field);%handles of GUI elements in get_field 2085 2089 SubField=get_field('read_var_names',hObject,eventdata,hhget_field); %read the names of the variables to plot in the get_field GUI 2086 2090 [Field{2},var_detect]=nc2struct(filename_1,SubField.ListVarName); %read the corresponding input data 2087 2091 Field{2}.VarAttribute=SubField.VarAttribute; 2088 % if isequal(get(hhget_field.transform_fct,'Visible'),'on')2089 % list_transform=get(hhget_field.transform_fct,'String');2090 % val_list=get(hhget_field.transform_fct,'Value');2091 % transf=list_transform{val_list};2092 % if ~isempty(transf)2093 % Field{2}=feval(transf,Field{2});2094 % end2095 % end2096 2092 %update the display on get_field 2097 2093 set(hhget_field.inputfile,'String',filename_1) … … 3188 3184 end 3189 3185 3190 3191 % -----------------------------------3192 %set the visibility of relevant velocity type menus: 3193 %----------------------------------- 3186 %------------------------------------------------------------------------ 3187 % --- set the visibility of relevant velocity type menus: 3188 function set_veltype_display(handles,Civ) 3189 %------------------------------------------------------------------------ 3194 3190 %Civ=0; all states 'off' 3195 3191 %Civ=6; all states 'on' 3196 function set_veltype_display(handles,Civ)3197 3192 if isequal(Civ,0) 3198 3193 imax=0; … … 3201 3196 % set(handles(1),'String','civ1') 3202 3197 % end 3203 elseif isequal(Civ,1) 3198 elseif isequal(Civ,1) || isequal(Civ,2) 3204 3199 imax=1; 3205 elseif isequal(Civ, 2) | isequal(Civ,3)3200 elseif isequal(Civ,3) 3206 3201 imax=3; 3207 elseif isequal(Civ,4) | isequal(Civ,5)3202 elseif isequal(Civ,4) || isequal(Civ,5) 3208 3203 imax=4; 3209 elseif isequal(Civ,6) 3204 elseif isequal(Civ,6) %patch2 3210 3205 imax=6; 3211 3206 end
Note: See TracChangeset
for help on using the changeset viewer.