- Timestamp:
- Jan 7, 2011, 1:53:05 AM (14 years ago)
- Location:
- trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r174 r177 22 22 function varargout = civ(varargin) 23 23 24 % Last Modified by GUIDE v2.5 0 1-Dec-2010 23:19:1524 % Last Modified by GUIDE v2.5 05-Jan-2011 16:19:30 25 25 % Begin initialization code - DO NOT EDIT 26 26 gui_Singleton = 1; … … 335 335 browse.num_j2=num_j2; 336 336 if length(ext)>1 && (~isempty(imformats(ext(2:end)))||strcmpi(ext,'.avi'));%if an image file has been opened by uvmat 337 % set(handles.ImaExt,'String',ext)338 337 browse.nom_type_ima=nom_type; 339 338 browse.ext_ima=ext; 339 set(handles.ImaExt,'String',ext) 340 340 end 341 341 set(handles.ImaDoc,'String',ext); … … 593 593 end 594 594 end 595 % if ~isempty(ext_ima_read) && ~isempty(nom_type_read)596 % % if isempty(ext_ima)597 % % ext_ima=ext_ima_read;% define image extension from the xml file if an image has not been opened previously598 % % else %keep the image extension599 % % if ~strcmp(ext_ima_read,ext_ima)600 % % msgbox_uvmat('WARNING',['FirtsImage extension ' ext_ima_read ' announced in the xml file inconsistent with the selected image'])601 % % end602 % % end603 % nom_type_ima=nom_type_read;604 % end605 595 elseif strcmp(ext_imadoc,'.civ')% case of .civ image documentation file 606 596 [error,time,TimeUnit,mode,npx,npy]=read_imatext([filebase '.civ']); … … 612 602 nom_type_ima='*'; 613 603 ext_ima=ext_imadoc; 604 set(handles.mode,'Value',1); 614 605 set(handles.mode,'String',{'series(Di)'}) 615 606 dt=0.04;%default … … 620 611 end 621 612 time=(dt*(0:nbfield-1))';%list of image times 622 %set(handles.dt,'String',num2str(dt*1000));%store the time interval between successive images623 613 end 624 614 if isempty(time) … … 698 688 field_i=browse.num_i1; 699 689 field_j=browse.num_j2; 690 imagename=name_generator(filebase,field_i,field_j,ext_search,nom_type_search); 700 691 imagename_plus=''; 701 692 jdetect=1; … … 716 707 time=(0:nbfield-1)';% time=file index -1 by default 717 708 if numel(regexp(nom_type_search,'\D'))>=1%two indices i and j 718 % switch nom_type_search719 % case {'_i_j','%01dA','%02dA','%03dA','%04dA'}720 % time=[0:nb_field-1]'*ones(1,nb_field_j);% time=file index -1 by default721 709 [x,y]=meshgrid(0:nbfield2-1,0:nbfield-1); 722 710 time=x+y; 723 % time=[0:nb_field-1]'*[0:nb_field_j-1];% time=file index -1 by default 724 end 725 % set(handles.mode,'String',{'series(Di)'}) 711 end 726 712 end 727 713 … … 750 736 751 737 %%%%%%%%%%% set the menus of image pairs and default selection for civ %%%%%%%%%%%%%%%%%%% 752 test_ima_i=numel(nom_type_ima)>1 && isempty(regexp(nom_type_ima(2:end),'\D' ));%images with single indexing738 test_ima_i=numel(nom_type_ima)>1 && isempty(regexp(nom_type_ima(2:end),'\D','once'));%images with single indexing 753 739 if test_ima_i || isequal(nom_type_nc,'_i1-i2')||~(exist('nbfield2','var')&&(nbfield2~=1)) 754 set(handles.mode,'String',{'series(Di)'})755 740 set(handles.mode,'Value',1) 741 set(handles.mode,'String',{'series(Di)'}) 756 742 elseif (nbfield==1)% simple series in j 743 set(handles.mode,'Value',1) 757 744 set(handles.mode,'String',{'series(Dj)'}) 758 set(handles.mode,'Value',1)759 745 else 760 746 set(handles.mode,'String',{'pair j1-j2';'series(Dj)';'series(Di)'})%multiple choice … … 788 774 mode_Callback(hObject, eventdata, handles) 789 775 790 %% %%%% initialize waitbars and RUN button776 %% desable status and RUN button 791 777 % set(handles.waitbar_1,'Position',[0.946 0.876 0.03 0.001]) 792 778 % set(handles.waitbar_patch1,'Position',[0.946 0.439 0.03 0.001]) … … 797 783 set(handles.BATCH,'Enable','On') 798 784 set(handles.BATCH,'BackgroundColor',[1 0 0]) 799 800 %%%%% store the root input filename for future opening 785 set(handles.status,'Value',0);%suppress status display 786 status_Callback(hObject, eventdata, handles) 787 788 %% store the root input filename for future opening 801 789 dir_perso=prefdir; 802 790 profil_perso=fullfile(prefdir,'uvmat_perso.mat'); … … 814 802 end 815 803 end 816 % save(profil_perso, 'filebase'); %store the root name for future opening of uvmat817 set(gcf,'Pointer','arrow')818 804 819 805 %------------------------------------------------------------------------ … … 1565 1551 end 1566 1552 1553 %------------------------------------------------------------------------ 1554 % --- Executes on button press in RUN: processing on local computer 1567 1555 function RUN_Callback(hObject, eventdata, handles) 1568 1556 %------------------------------------------------------------------------ 1569 % global civ1_exe civ2_exe patch_exe patch_new_exe sge1570 1557 set(handles.RUN, 'Enable','Off') 1571 1558 set(handles.RUN,'BackgroundColor',[0.831 0.816 0.784]) … … 1575 1562 set(handles.RUN,'BackgroundColor',[1 0 0]) 1576 1563 1564 % start status callback to visualise results 1565 set(handles.status,'Value',1);%suppress status display 1566 status_Callback(hObject, eventdata, handles) 1567 1577 1568 %------------------------------------------------------------------------ 1578 1569 % --- Executes on button press in BATCH: remote processing 1579 1570 function BATCH_Callback(hObject, eventdata, handles) 1580 %% ----------------------------------------------------------------------- 1581 %global civ1_exe civ2_exe patch_exe patch_new_exe fix_exe todo_path sge Civ_exe % probabely to remove 1571 % ----------------------------------------------------------------------- 1582 1572 set(handles.BATCH, 'Enable','Off') 1583 1573 set(handles.BATCH,'BackgroundColor',[0.831 0.816 0.784]) … … 1587 1577 set(handles.BATCH,'BackgroundColor',[1 0 0]) 1588 1578 1579 % start status callback to visualise results 1580 set(handles.status,'Value',1);%suppress status display 1581 status_Callback(hObject, eventdata, handles) 1589 1582 %------------------------------------------------------------------------ 1590 1583 % --- Lauch command called by RUN and BATCH: remote processing … … 1613 1606 end 1614 1607 1615 % check mask if selecetd1608 %% check mask if selecetd 1616 1609 if isequal(get(handles.get_mask_civ1,'Value'),1) 1617 1610 maskname=get(handles.mask_civ1,'String'); … … 1639 1632 end 1640 1633 1641 %% initialize the waitbars: TO suppress, waitbar not used 1642 % set(handles.waitbar_1,'Position',[0.946 0.876 0.03 0.001]) 1643 % set(handles.waitbar_patch1,'Position',[0.946 0.439 0.03 0.001]) 1644 % set(handles.waitbar_civ2,'Position',[0.946 0.219 0.03 0.001]) 1645 % set(handles.waitbar_patch2,'Position',[0.946 0.0 0.03 0.001]) 1646 % drawnow 1634 %% reinitialise status callback 1635 set(handles.status,'Value',0);%suppress status display 1636 status_Callback(hObject, eventdata, handles) 1647 1637 1648 1638 %% set the list of files and check them … … 1651 1641 [filecell,num1_civ1,num2_civ1,num_a_civ1,num_b_civ1,num1_civ2,num2_civ2,num_a_civ2,num_b_civ2,nom_type_nc]=... 1652 1642 set_civ_filenames(handles,box_test); 1643 set(handles.civ,'UserData',filecell);%store for futur use of status callback 1653 1644 if isempty(filecell)% (error message displayed in fct set_civ_filenames) 1654 1645 return … … 1879 1870 %filename_cur=filecell.nc.civ1{ifile,j};%output netcdf file 1880 1871 [Rootbat,Filebat]=fileparts(filecell.nc.civ1{ifile,j});%output netcdf file (without extention) 1872 flname=fullfile(Rootbat,Filebat); 1881 1873 %filename_cmx(end-1:end+6)='civ1.cmx';%name of cmx file 1882 1874 if batch … … 1884 1876 filename_bat=fullfile(Rootbat,['job_' Filebat]); 1885 1877 else 1886 filename_bat=f ullfile(Rootbat,Filebat);1878 filename_bat=flname; 1887 1879 end 1888 1880 filename_bat=[filename_bat '.bat']; … … 1892 1884 par_civ1.filename_ima_a=filecell.ima1.civ1{ifile,j}; 1893 1885 par_civ1.filename_ima_b=filecell.ima2.civ1{ifile,j}; 1894 namelog=[fullfile(Rootbat,Filebat) '.civ1.log'];1886 %namelog=[fullfile(Rootbat,Filebat) '.civ1.log']; 1895 1887 par_civ1.Dt=num2str(time(num2_civ1(ifile),num_b_civ1(j))-time(num1_civ1(ifile),num_a_civ1(j))); 1896 1888 par_civ1.T0=num2str((time(num2_civ1(ifile),num_b_civ1(j))+time(num1_civ1(ifile),num_a_civ1(j)))/2); … … 2065 2057 %par_civ2.filename_ima_b([end-3:end])=[];%remove .png extension 2066 2058 [Rootbat,Filebat]=fileparts(filecell.nc.civ2{ifile,j});%output netcdf file (without extention) 2067 namelog=[fullfile(Rootbat,Filebat) '.civ2.log'];2059 %namelog=[fullfile(Rootbat,Filebat) '.civ2.log']; 2068 2060 par_civ2.Dt=num2str(time(num2_civ2(ifile),num_b_civ2(j))-time(num1_civ2(ifile),num_a_civ2(j))); 2069 2061 par_civ2.T0=num2str((time(num2_civ1(ifile),num_b_civ2(j))+time(num1_civ2(ifile),num_a_civ2(j)))/2); … … 2119 2111 %endTESTgrid 2120 2112 i_cmd=i_cmd+1; 2121 cmd_CIV2=CIV2_CMD(fullfile(Rootbat,Filebat),[],par_civ2,sparam);%creates the cmx file [fullfile(Rootbat,Filebat) '.civ2.cmx] 2113 flname=fullfile(Rootbat,Filebat); 2114 cmd_CIV2=CIV2_CMD(flname,[],par_civ2,sparam);%creates the cmx file [fullfile(Rootbat,Filebat) '.civ2.cmx] 2122 2115 if isequal(civAll,0) 2123 flname=fullfile(Rootbat,Filebat);2124 2116 if(isunix) 2125 2117 cmd=[cmd 'cp -f ' flname '.civ2.cmx ' flname '.cmx\n' cmd_CIV2 '\n']; … … 2253 2245 pvalue=num2str((1-ind_answer)*500); 2254 2246 %namelog=[filename_bat '.patch.log']; 2255 display(['!qsub -p ' pvalue ' -q civ.q -e ' f ilename_cmx(1:end-4) '.errors -o ' filename_cmx(1:end-4)'.log' ' ' filename_bat]);2256 eval( ['!qsub -p ' pvalue ' -q civ.q -e ' f ilename_cmx(1:end-4) '.errors -o ' filename_cmx(1:end-4)'.log' ' ' filename_bat]);2247 display(['!qsub -p ' pvalue ' -q civ.q -e ' flname '.errors -o ' flname '.log' ' ' filename_bat]); 2248 eval( ['!qsub -p ' pvalue ' -q civ.q -e ' flname '.errors -o ' flname '.log' ' ' filename_bat]); 2257 2249 end 2258 2250 else … … 2305 2297 end 2306 2298 saveas(gcbf,namefigfull);%save the interface with name namefigfull (A CHANGER EN FICHIER .xml) 2299 2307 2300 2308 2301 … … 4417 4410 set(handles.RootName_1,'String',[]); 4418 4411 mode_store=get(handles.compare,'UserData'); 4412 set(handles.mode,'Value',1) 4419 4413 set(handles.mode,'String',mode_store) 4420 4414 set(handles.test_stereo1,'Value',0) … … 4603 4597 end 4604 4598 4605 4606 4607 4608 4609 4599 %------------------------------------------------------------------- 4600 % --- Executes on button press in status. 4601 function status_Callback(hObject, eventdata, handles) 4602 %------------------------------------------------------------------- 4603 val=get(handles.status,'Value'); 4604 if val==0 4605 hfig=findobj(allchild(0),'name','civ_status'); 4606 if ~isempty(hfig) 4607 delete(hfig) 4608 end 4609 return 4610 end 4611 listtype={'civ1','fix1','patch1','civ2','fix2','patch2'}; 4612 box_test(1)=get(handles.CIV1,'Value'); 4613 box_test(2)=get(handles.FIX1,'Value'); 4614 box_test(3)=get(handles.PATCH1,'Value'); 4615 box_test(4)=get(handles.CIV2,'Value'); 4616 box_test(5)=get(handles.FIX2,'Value'); 4617 box_test(6)=get(handles.PATCH2,'Value'); 4618 option=listtype{max(box_test(find(box_test)))}; 4619 filecell=get(handles.civ,'UserData'); 4620 if ~isfield(filecell,'nc') 4621 filecell=set_civ_filenames(handles,box_test);%determine the list of output files expected from the GUI status 4622 end 4623 4624 if ~isequal(box_test(4:6),[0 0 0]) 4625 civ_files=filecell.nc.civ2; 4626 else 4627 civ_files=filecell.nc.civ1; 4628 end 4629 [root,filename,ext]=fileparts(civ_files{1}); 4630 [rootroot,subdir,extdir]=fileparts(root); 4631 hfig=findobj(allchild(0),'name','civ_status'); 4632 if isempty(hfig) 4633 hfig=figure; 4634 set(hfig,'name','civ_status') 4635 hlist=uicontrol('Style','listbox','Units','normalized', 'Position',[0.05 0.05 0.9 0.75], 'Callback', @open_view_field,'tag','list'); 4636 uicontrol('Style','listbox','Units','normalized', 'Position', [0.05 0.87 0.9 0.1],'tag','msgbox'); 4637 uicontrol('Style','frame','Units','normalized', 'Position', [0.05 0.81 0.9 0.05]); 4638 BarPosition=[0.05 0.81 0.01 0.05]; 4639 hwaitbar=uicontrol('Style','frame','Units','normalized', 'Position',BarPosition ,'BackgroundColor',[1 0 0],'tag','waitbar'); 4640 end 4641 datnum=[]; 4642 Tabchar={}; 4643 nbfiles=numel(civ_files); 4644 count=0; 4645 while count<nbfiles 4646 count=0; 4647 for ifile=1:nbfiles 4648 detect=exist(civ_files{ifile},'file'); % check the existence of the file 4649 if detect==0 4650 lastfield='not created'; 4651 else 4652 datfile=dir(civ_files{ifile}); 4653 datnum(ifile)=datenum(datfile.date); 4654 filefound(ifile)={datfile.name}; 4655 lastfield=''; 4656 % check the content netcdf file 4657 Data=nc2struct(civ_files{ifile},'ListGlobalAttribute','patch2','fix2','civ2','patch','fix'); 4658 if ~isempty(Data.patch2) && isequal(Data.patch2,1) 4659 lastfield='patch2'; 4660 elseif ~isempty(Data.fix2) && isequal(Data.fix2,1) 4661 lastfield='fix2'; 4662 elseif ~isempty(Data.civ2) && isequal(Data.civ2,1); 4663 lastfield='civ2'; 4664 elseif ~isempty(Data.patch) && isequal(Data.patch,1); 4665 lastfield='patch1'; 4666 elseif ~isempty(Data.fix) && isequal(Data.fix,1); 4667 lastfield='fix1'; 4668 else 4669 lastfield='civ1'; 4670 end 4671 end 4672 if strcmp(lastfield,option) 4673 count=count+1; 4674 end 4675 [rr,filename,ext]=fileparts(civ_files{ifile}); 4676 Tabchar{ifile,1}=[fullfile([subdir extdir],filename) ext '...' lastfield]; 4677 end 4678 if isempty(datnum) 4679 message='no civ result created yet'; 4680 else 4681 datnum=datnum(find(datnum));%keep the non zero values corresponding to existing files 4682 [first,ind]=min(datnum); 4683 [last,indlast]=max(datnum); 4684 message={[num2str(count) ' file(s) done over ' num2str(nbfiles)] ;['oldest modification: ' cell2mat(filefound(ind)) ' : ' datestr(first)];... 4685 ['latest modification: ' cell2mat(filefound(indlast)) ' : ' datestr(last)]}; 4686 end 4687 hfig=findobj(allchild(0),'name','civ_status'); 4688 if isempty(hfig) 4689 set(handles.status,'Value',0)%stop program if the figure has been suppressed 4690 return 4691 else 4692 hlist=findobj(hfig,'tag','list'); 4693 hmsgbox=findobj(hfig,'tag','msgbox'); 4694 hwaitbar=findobj(hfig,'tag','waitbar'); 4695 set(hlist,'String',Tabchar) 4696 set(hmsgbox,'String', message) 4697 if count>0 4698 BarPosition(3)=0.9*count/nbfiles; 4699 set(hwaitbar,'Position',BarPosition) 4700 end 4701 end 4702 set(hlist,'UserData',rootroot) 4703 pause(5)% wait 5 seconds for next check 4704 end 4705 4706 4707 %------------------------------------------------------------------- 4708 % call 'view_field.fig' to display the selected field 4709 function open_view_field(hObject, eventdata) 4710 %------------------------------------------------------------------- 4711 list=get(gcbo,'String'); 4712 index=get(gcbo,'Value'); 4713 rootroot=get(gcbo,'UserData'); 4714 filename=list{index}; 4715 ind_dot=findstr(filename,'...'); 4716 filename=filename(1:ind_dot-1); 4717 filename=fullfile(rootroot,filename); 4718 if exist(filename,'file')%visualise the vel field if it exists 4719 [Field,VelTypeOut]=read_civxdata(filename); 4720 view_field(Field) 4721 end 4722 4723 -
trunk/src/geometry_calib.m
r168 r177 974 974 if choice 975 975 set(handles.edit_append,'BackgroundColor',[1 1 0]) 976 huvmat=findobj(allchild(0),'tag','uvmat'); 977 if ishandle(huvmat) 978 hhuvmat=guidata(huvmat); 979 set(hhuvmat.edit_object,'Value',0) 980 set(hhuvmat.edit_object,'BackgroundColor',[0.7 0.7 0.7]) 981 end 976 982 else 977 983 set(handles.edit_append,'BackgroundColor',[0.7 0.7 0.7]) -
trunk/src/mouse_down.m
r156 r177 24 24 function xy=mouse_down(hObject,eventdata) 25 25 26 %MouseAction='none'; %default27 26 huvmat=findobj(allchild(0),'tag','uvmat');%find the uvmat interface handle which controls theoption of mouse action 28 27 if isempty(huvmat) … … 31 30 hhuvmat=guidata(huvmat);%handles of elements in uvmat 32 31 UvData=get(huvmat,'UserData'); 33 %MouseAction='none'; %default34 32 currentfig=hObject; 35 33 hhcurrentfig=guidata(currentfig); 36 34 test_zoom=get(hhcurrentfig.zoom,'Value');%test for zoom action, first priority 37 % if isfield(UvData,'MouseAction') 38 % MouseAction=UvData.MouseAction;% get the mouse action from the uvmat GUI: options: 39 % end 40 41 %test_cal=get(handles.cal,'Value'); 42 % test_cal=strcmp(MouseAction,'calib'); 43 test_ruler=isequal(get(hhuvmat.MenuRuler,'checked'),'on');%test for ruler action, second priority 44 %test_ruler=strcmp(MouseAction,'ruler'); 45 %test_edit=strcmp(MouseAction,'edit_object'); 35 test_ruler=isequal(get(hhuvmat.MenuRuler,'checked'),'on');%test for ruler action, second priority; 46 36 test_edit=get(hhuvmat.edit_object,'Value');%test for object editing, third priority 47 %test_edit_vect=strcmp(MouseAction,'edit_vect');%test for vector editing, priority 448 37 test_edit_vect=get(hhuvmat.edit_vect,'Value');%test for vector editing, priority 4 49 38 test_create=isequal(get(hhuvmat.MenuObject,'checked'),'on');% test for object creation, priority 5 … … 63 52 end 64 53 end 65 %test_create=~test_zoom && strcmp(MouseAction,'create_object')&&~test_edit && ~test_edit_vect ;% || isequal(MouseAction,'create_mask'));66 54 xdisplay=[];%default 67 55 ydisplay=[];%default 68 56 AxeData=[];%default 69 57 70 %% edit an existing point or line if found58 %% determine the currently selected items 71 59 hcurrentobject=gco;% current object handle (selected by the mouse) 72 60 hcurrentfig=hObject;% current figure handle 73 61 fig_tag=get(hcurrentfig,'Tag'); 74 tag_obj=get(gco,'Tag'); 62 tag_obj=get(gco,'Tag');%tag of the currently selected object 75 63 xy=[];%default 76 64 xy_fig=get(hcurrentfig,'CurrentPoint');% current point of the current figure (gcbo) … … 367 355 end 368 356 if isequal(Field.FF(ivec),0) 369 Field.FF(ivec)=100 %mark vector #ivec as false357 Field.FF(ivec)=100; %mark vector #ivec as false 370 358 else 371 359 Field.FF(ivec)=0; -
trunk/src/plot_object.m
r156 r177 92 92 93 93 %% default input parameters 94 if ~isfield(ObjectData,'ProjMode')| isempty(ObjectData.ProjMode)94 if ~isfield(ObjectData,'ProjMode')||isempty(ObjectData.ProjMode) 95 95 ObjectData.ProjMode='projection';%default 96 96 end 97 if ~isfield(ObjectData,'Coord')| isempty(ObjectData.Coord)97 if ~isfield(ObjectData,'Coord')||isempty(ObjectData.Coord) 98 98 ObjectData.Coord=[0 0 0];%default 99 99 end 100 if ~isfield(ObjectData,'Phi')| isempty(ObjectData.Phi)100 if ~isfield(ObjectData,'Phi')||isempty(ObjectData.Phi) 101 101 ObjectData.Phi=0;%default 102 102 end … … 131 131 YMax=max(XMax,YMax); 132 132 YMax=max(YMax,ZMax); 133 elseif isequal(ObjectData.Style,'rectangle')| isequal(ObjectData.Style,'ellipse')|isequal(ObjectData.Style,'volume')133 elseif isequal(ObjectData.Style,'rectangle')||isequal(ObjectData.Style,'ellipse')||isequal(ObjectData.Style,'volume') 134 134 if isequal(YMax,0) 135 135 ylim=get(haxes,'YLim'); … … 159 159 xline=ObjectData.Coord(:,1); 160 160 yline=ObjectData.Coord(:,2); 161 nbpoints=numel(xline); 161 162 if isequal(ObjectData.Style,'polygon') 162 163 xline=[xline; ObjectData.Coord(1,1)];%closing the line 163 164 yline=[yline; ObjectData.Coord(1,2)]; 164 elseif isequal(ObjectData.Style,'plane')| isequal(ObjectData.Style,'volume')165 elseif isequal(ObjectData.Style,'plane')|| isequal(ObjectData.Style,'volume') 165 166 phi=ObjectData.Phi*pi/180;%angle in radians 166 167 Xend_x=xline(1)+XMax*cos(phi); … … 180 181 SubLineStyle='--'; %range of projection marked by dash 181 182 if isfield (ObjectData,'DX') 182 rmfield(ObjectData,'DX');183 ObjectData=rmfield(ObjectData,'DX'); 183 184 end 184 185 if isfield (ObjectData,'DY') 185 rmfield(ObjectData,'DY');186 ObjectData=rmfield(ObjectData,'DY'); 186 187 end 187 188 elseif isequal(ObjectData.ProjMode,'filter') … … 189 190 end 190 191 end 191 if isequal(ObjectData.Style,'line')| isequal(ObjectData.Style,'polyline')|isequal(ObjectData.Style,'polygon')192 if isequal(ObjectData.Style,'line')||isequal(ObjectData.Style,'polyline')||isequal(ObjectData.Style,'polygon') 192 193 if length(xline)<2 193 194 theta=0; … … 223 224 scale_x=2*1.4*XMax/npMx; 224 225 scale_y=2*1.4*YMax/npMy; 225 xi= [0.5:npMx-0.5]*scale_x+xlim(1);226 yi= [0.5:npMy-0.5]*scale_y+ylim(1);226 xi=(0.5:npMx-0.5)*scale_x+xlim(1); 227 yi=(0.5:npMy-0.5)*scale_y+ylim(1); 227 228 [Xi,Yi]=meshgrid(xi,yi); 228 229 X2Max=XMax*XMax; … … 231 232 distY=(Yi-ObjectData.Coord(1,2)); 232 233 flag=(distX.*distX/X2Max+distY.*distY/Y2Max)<1; 233 elseif isequal(ObjectData.Style,'rectangle')| isequal(ObjectData.Style,'volume')234 elseif isequal(ObjectData.Style,'rectangle')||isequal(ObjectData.Style,'volume') 234 235 XimaMin=ObjectData.Coord(1,1)-XMax; 235 236 XimaMax=ObjectData.Coord(1,1)+XMax; … … 240 241 scale_x=2*1.4*XMax/npMx; 241 242 scale_y=2*1.4*YMax/npMy; 242 xi= [0.5:npMx-0.5]*scale_x+xlim(1);243 yi= [0.5:npMy-0.5]*scale_y+ylim(1);243 xi=(0.5:npMx-0.5)*scale_x+xlim(1); 244 yi=(0.5:npMy-0.5)*scale_y+ylim(1); 244 245 [Xi,Yi]=meshgrid(xi,yi); 245 246 distX=abs(Xi-ObjectData.Coord(1,1)); … … 270 271 271 272 PlotData=[];%default 273 272 274 %% MODIFY AN EXISTING OBJECT PLOT 273 275 if test_newobj==0; … … 301 303 for ipt=1:length(PlotData.DeformPoint) 302 304 if ishandle(PlotData.DeformPoint(ipt)) 303 if length(xline)>=ipt & length(yline)>=ipt305 if nbpoints>=ipt 304 306 set(PlotData.DeformPoint(ipt),'XData',xline(ipt),'YData',yline(ipt)); 305 307 end 306 308 end 307 309 end 308 if length(xline)>length(PlotData.DeformPoint)309 for ipt=length(PlotData.DeformPoint)+1: length(xline)310 if nbpoints>length(PlotData.DeformPoint) 311 for ipt=length(PlotData.DeformPoint)+1:nbpoints 310 312 PlotData.DeformPoint(ipt)=line(xline(ipt),yline(ipt),'Color',col,'LineStyle','.','Tag','DeformPoint',... 311 313 'SelectionHighlight','off','UserData',hplot); … … 314 316 end 315 317 end 316 elseif isequal(ObjectData.Style,'rectangle')| isequal(ObjectData.Style,'ellipse')318 elseif isequal(ObjectData.Style,'rectangle')||isequal(ObjectData.Style,'ellipse') 317 319 set(hplot,'Position',[ObjectData.Coord(1,1)-XMax ObjectData.Coord(1,2)-YMax 2*XMax 2*YMax]) 318 320 end … … 334 336 hother=findobj('Tag','proj_object');%find all the proj objects 335 337 for iobj=1:length(hother) 336 if isequal(get(hother(iobj),'Type'),'rectangle')|isequal(get(hother(iobj),'Type'),'patch')338 if strcmp(get(hother(iobj),'Type'),'rectangle')|| strcmp(get(hother(iobj),'Type'),'patch') 337 339 set(hother(iobj),'EdgeColor','b') 338 340 if isequal(get(hother(iobj),'FaceColor'),'m') … … 363 365 end 364 366 end 365 elseif isequal(ObjectData.Style,'line')|isequal(ObjectData.Style,'polyline')|...366 isequal(ObjectData.Style,'polygon') |isequal(ObjectData.Style,'plane')|isequal(ObjectData.Style,'volume')% (isequal(ObjectData.Style,'polygon') & ~test_patch) |isequal(ObjectData.Style,'plane')367 elseif strcmp(ObjectData.Style,'line')||strcmp(ObjectData.Style,'polyline')||... 368 strcmp(ObjectData.Style,'polygon') ||strcmp(ObjectData.Style,'plane')||strcmp(ObjectData.Style,'volume')% (isequal(ObjectData.Style,'polygon') & ~test_patch) |isequal(ObjectData.Style,'plane') 367 369 hh=line(xline,yline,'Color',col); 368 if ~isequal(ObjectData.Style,'plane')& ~isequal(ObjectData.Style,'volume') 370 if ~strcmp(ObjectData.Style,'plane') && ~strcmp(ObjectData.Style,'volume') 371 PlotData.SubObject(1)=line(xinf,yinf,'Color',col,'LineStyle',SubLineStyle,'Tag','proj_object');%draw sub-lines 372 PlotData.SubObject(2)=line(xsup,ysup,'Color',col,'LineStyle',SubLineStyle,'Tag','proj_object'); 369 373 for ipt=1:sizcoord(1) 370 374 PlotData.DeformPoint(ipt)=line(ObjectData.Coord(ipt,1),ObjectData.Coord(ipt,2),'Color',... 371 375 col,'LineStyle','none','Marker','.','Tag','DeformPoint','SelectionHighlight','off','UserData',hh); 372 376 end 373 PlotData.SubObject(1)=line(xinf,yinf,'Color',col,'LineStyle',SubLineStyle,'Tag','proj_object');%draw sub-lines374 PlotData.SubObject(2)=line(xsup,ysup,'Color',col,'LineStyle',SubLineStyle,'Tag','proj_object');375 377 end 376 378 377 elseif isequal(ObjectData.Style,'rectangle')379 elseif strcmp(ObjectData.Style,'rectangle') 378 380 hh=rectangle('Position',[ObjectData.Coord(1,1)-XMax ObjectData.Coord(1,2)-YMax 2*XMax 2*YMax],'EdgeColor',col); 379 elseif isequal(ObjectData.Style,'ellipse')381 elseif strcmp(ObjectData.Style,'ellipse') 380 382 hh=rectangle('Curvature',[1 1],'Position',[ObjectData.Coord(1,1)-XMax ObjectData.Coord(1,2)-YMax 2*XMax 2*YMax],'EdgeColor',col); 381 383 else … … 387 389 hold on 388 390 hhh=image([xlim(1)+dx/2 xlim(2)-dx/2],[ylim(1)+dy/2 ylim(2)-dy/2],imflag,'Tag','proj_object','HitTest','off'); 389 set(hhh,'AlphaData',(flag)*0.2) 391 set(hhh,'AlphaData',(flag)*0.2)% set partial transparency to the filling color 390 392 PlotData.SubObject=hhh; 391 393 end -
trunk/src/uvmat.m
r174 r177 264 264 set(handles.MenuFile_1_1,'Label',h.MenuFile_1); 265 265 end 266 if isfield(h,'MenuFile_ 1')266 if isfield(h,'MenuFile_2') 267 267 set(handles.MenuFile_2,'Label',h.MenuFile_2); 268 268 set(handles.MenuFile_2_1,'Label',h.MenuFile_2); 269 269 end 270 if isfield(h,'MenuFile_ 1')270 if isfield(h,'MenuFile_3') 271 271 set(handles.MenuFile_3,'Label',h.MenuFile_3); 272 272 set(handles.MenuFile_3_1,'Label',h.MenuFile_3); 273 273 end 274 if isfield(h,'MenuFile_ 1')274 if isfield(h,'MenuFile_4') 275 275 set(handles.MenuFile_4,'Label',h.MenuFile_4); 276 276 set(handles.MenuFile_4_1,'Label',h.MenuFile_4); 277 277 end 278 if isfield(h,'MenuFile_ 1')278 if isfield(h,'MenuFile_5') 279 279 set(handles.MenuFile_5,'Label',h.MenuFile_5); 280 280 set(handles.MenuFile_5_1,'Label',h.MenuFile_5); … … 282 282 if isfield(h,'transform_fct') && iscell(h.transform_fct) 283 283 for ilist=1:length(h.transform_fct); 284 [path,file]=fileparts(h.transform_fct{ilist}); 285 addpath(path) 286 if exist(file,'file') 284 if exist(h.transform_fct{ilist},'file') 285 [path,file]=fileparts(h.transform_fct{ilist}); 286 addpath(path) 287 % if exist(file,'file') 287 288 h_func=str2func(file); 289 rmpath(path) 288 290 testexist=[testexist 1]; 289 291 else 292 file=''; 290 293 h_func=[]; 291 294 testexist=[testexist 0]; 292 295 end 293 296 fct_handle=[fct_handle; {h_func}]; %concatene the list of paths 294 rmpath(path)295 297 menu_str=[menu_str; {file}]; 296 298 end … … 4413 4415 set(handles.zoom,'Value',0) 4414 4416 zoom_Callback(hObject, eventdata, handles) 4417 hgeometry_calib=findobj(allchild(0),'tag','geometry_calib'); 4418 if ishandle(hgeometry_calib) 4419 hhgeometry_calib=guidata(hgeometry_calib); 4420 set(hhgeometry_calib.edit_append,'Value',0)% desactivate mouse action in geometry_calib 4421 set(hhgeometry_calib.edit_append,'BackgroundColor',[0.7 0.7 0.7]) 4422 end 4415 4423 else 4416 4424 UvData.MouseAction='none'; … … 5075 5083 delete(hset_object)% delete existing version of set_object 5076 5084 end 5085 hgeometry_calib=findobj(allchild(0),'tag','geometry_calib'); 5086 if ishandle(hgeometry_calib) 5087 hhgeometry_calib=guidata(hgeometry_calib); 5088 set(hhgeometry_calib.edit_append,'Value',0)% desactivate mouse action in geometry_calib 5089 set(hhgeometry_calib.edit_append,'BackgroundColor',[0.7 0.7 0.7]) 5090 end 5077 5091 UvData=get(handles.uvmat,'UserData'); 5078 5092 set(handles.edit_object,'Value',0); %suppress the object edit mode
Note: See TracChangeset
for help on using the changeset viewer.