Changeset 224 for trunk/src/civ.m
- Timestamp:
- Mar 18, 2011, 10:41:48 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r220 r224 182 182 elseif isequal(ind_opening,4) 183 183 set(handles.CIV2,'Value',1) 184 enable_civ2(handles, 1)184 enable_civ2(handles,'on') 185 185 elseif isequal(ind_opening,5) 186 186 set(handles.FIX2,'Value',1) … … 424 424 elseif isequal(ind_opening,4) 425 425 set(handles.CIV2,'Value',1) 426 enable_civ2(handles, 1)426 enable_civ2(handles,'on') 427 427 elseif isequal(ind_opening,5) 428 428 enable_pair1(handles,'off') … … 1710 1710 end 1711 1711 if isfield(sparam,'CivBin') 1712 if ~exist(sparam.CivBin,'file') 1712 if ~exist(sparam.CivBin,'file')||~isequal(which(sparam.CivBin),sparam.CivBin)% if path defined as relative to uvmat 1713 1713 CivBin=sparam.CivBin; 1714 1714 sparam.CivBin=fullfile(path_UVMAT,sparam.CivBin); … … 1720 1720 end 1721 1721 if isfield(sparam,'Civ1Bin') 1722 if ~exist(sparam.Civ1Bin,'file') 1723 CivBin=sparam.Civ1Bin;1722 if ~exist(sparam.Civ1Bin,'file')||~isequal(which(sparam.Civ1Bin),sparam.Civ1Bin)% if path defined as relative to uvmat 1723 % CivBin=sparam.Civ1Bin; 1724 1724 sparam.Civ1Bin=fullfile(path_UVMAT,sparam.Civ1Bin); 1725 if ~exist(sparam.Civ Bin,'file')1726 msgbox_uvmat('ERROR',['civ1 binary ' CivBin ' defined in PARAM.xm does not exist'])1725 if ~exist(sparam.Civ1Bin,'file') 1726 msgbox_uvmat('ERROR',['civ1 binary ' sparam.Civ1Bin ' defined in PARAM.xm does not exist']) 1727 1727 return 1728 1728 end … … 1730 1730 end 1731 1731 if isfield(sparam,'Civ2Bin') 1732 CivBin=sparam.Civ2Bin;1733 if ~exist(sparam.Civ2Bin,'file') 1732 % CivBin=sparam.Civ2Bin; 1733 if ~exist(sparam.Civ2Bin,'file')||~isequal(which(sparam.Civ2Bin),sparam.Civ2Bin)% if path defined as relative to uvmat 1734 1734 sparam.Civ2Bin=fullfile(path_UVMAT,sparam.Civ2Bin); 1735 1735 if ~exist(sparam.Civ2Bin,'file') 1736 msgbox_uvmat('ERROR',['civ2 binary ' CivBin ' defined in PARAM.xm does not exist'])1736 msgbox_uvmat('ERROR',['civ2 binary ' sparam.Civ2Bin ' defined in PARAM.xm does not exist']) 1737 1737 return 1738 1738 end … … 1740 1740 end 1741 1741 if isfield(sparam,'PatchBin') 1742 if ~exist(sparam.PatchBin,'file') 1742 if ~exist(sparam.PatchBin,'file')||~isequal(which(sparam.PatchBin),sparam.PatchBin)% if path defined as relative to uvmat 1743 1743 sparam.PatchBin=fullfile(path_UVMAT,sparam.PatchBin); 1744 1744 end 1745 1745 end 1746 1746 if isfield(sparam,'FixBin') 1747 if ~exist(sparam.FixBin,'file') 1747 if ~exist(sparam.FixBin,'file')||~isequal(which(sparam.FixBin),sparam.FixBin)% if path defined as relative to uvmat 1748 1748 sparam.FixBin=fullfile(path_UVMAT,sparam.FixBin); 1749 1749 end … … 2980 2980 % npx=npxy(2); 2981 2981 if box_test(1)==1 %if civ1 is performed 2982 h = waitbar(0, ['copy images to the .png format for civ1']);% display a wait bar2982 h = waitbar(0,'copy images to the .png format for civ1');% display a wait bar 2983 2983 for ifile=1:nbfield 2984 2984 waitbar(ifile/nbfield); … … 3027 3027 function cmd_PATCH=PATCH_CMD(filename_nc,nx_patch,ny_patch,rho_patch,subdomain_patch,thresh_value,test_interp,PatchBin) 3028 3028 %------------------------------------------------------------------------ 3029 namelog=[filename_nc( [1:end-3]) '_patch.log'];3029 namelog=[filename_nc(1:end-3) '_patch.log']; 3030 3030 if test_interp==0 3031 3031 if isunix … … 3045 3045 function cmd=RUN_STINTERP(stinterpBin,filename_A_nc,filename_B_nc,filename_nc,nx_patch,ny_patch,rho_patch,subdomain_patch,thresh_value,xmlA,xmlB) 3046 3046 %------------------------------------------------------------------------ 3047 namelog=[filename_nc( [1:end-3]) '_stinterp.log'];3047 namelog=[filename_nc(1:end-3) '_stinterp.log']; 3048 3048 cmd=[stinterpBin ' -f1 ' filename_A_nc ' -f2 ' filename_B_nc ' -f ' filename_nc ... 3049 3049 ' -m ' nx_patch ' -n ' ny_patch ' -ro ' rho_patch ' -nopt ' subdomain_patch ' -c1 ' xmlA ' -c2 ' xmlB ' -xy x -Nfy 1024 > ' namelog ' 2>&1']; % redirect standard output to the log file … … 3644 3644 function enable_civ1(handles,state) 3645 3645 %------------------------------------------------------------------------ 3646 if isequal(state,0)3647 state='off';3648 end3649 if isequal(state,1)3650 state='on';3651 end3652 3646 if isequal(state,'on') 3653 3647 set(handles.frame_civ1,'BackgroundColor',[1 1 0]) … … 3698 3692 set(handles.shift_title,'Visible',state) 3699 3693 set(handles.rho_title,'Visible',state) 3694 set(handles.TestCiv1,'Visible',state) 3695 %set(handles.CivAll,'Visible',state) 3700 3696 3701 3697 %------------------------------------------------------------------------ … … 3731 3727 function enable_patch1(handles) 3732 3728 %------------------------------------------------------------------------ 3733 global patch_newBin3734 3729 set(handles.frame_patch1,'BackgroundColor',[1 1 0]) 3735 3730 set(handles.rho_patch1,'Visible','on') 3736 3731 set(handles.rho_text1,'Visible','on') 3737 set(handles.thresh_patch1,'Visible','on') 3738 set(handles.thresh_text1,'Visible','on') 3732 if get(handles.CivAll,'Value') 3733 set(handles.thresh_patch1,'Visible','on') 3734 set(handles.thresh_text1,'Visible','on') 3735 end 3739 3736 set(handles.subdomain_patch1,'Visible','on') 3740 3737 set(handles.subdomain_text1,'Visible','on') … … 3744 3741 set(handles.ny_patch1_title,'Visible','on') 3745 3742 % if ~isempty(patch_newBin) 3746 % set(handles.test_interp,'Visible','on');3743 set(handles.test_interp,'Visible','off'); 3747 3744 % end 3748 3745 set(handles.get_gridpatch1,'Visible','on') … … 4583 4580 end 4584 4581 4585 4582 %------------------------------------------------------------------------ 4586 4583 % --- Executes on button press in TestCiv1. 4587 4584 function TestCiv1_Callback(hObject, eventdata, handles) 4585 %------------------------------------------------------------------------ 4588 4586 test_civ1=get(handles.TestCiv1,'Value'); 4589 4587 if test_civ1 4590 [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]=... 4591 set_civ_filenames(handles,[1 0 0 0 0 0]); 4592 Data.ListVarName={'ny','nx','A'}; 4593 Data.VarDimName={'ny','nx',{'ny','nx'}}; 4594 Data.A=imread(filecell.ima1.civ1{1}); 4595 Data.ny=[size(Data.A,1) 1]; 4596 Data.nx=[1 size(Data.A,2)]; 4597 hh=view_field(Data); 4598 ViewData=get(hh,'UserData'); 4599 ViewData.axes3.B=imread(filecell.ima2.civ1{1}); 4600 set(hh,'UserData',ViewData) 4601 end 4602 4588 [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]=... 4589 set_civ_filenames(handles,[1 0 0 0 0 0]); 4590 Data.ListVarName={'ny','nx','A'}; 4591 Data.VarDimName={'ny','nx',{'ny','nx'}}; 4592 Data.A=imread(filecell.ima1.civ1{1}); 4593 Data.ny=[size(Data.A,1) 1]; 4594 Data.nx=[1 size(Data.A,2)]; 4595 hh=view_field(Data); 4596 ViewData=get(hh,'UserData'); 4597 ViewData.axes3.B=imread(filecell.ima2.civ1{1});%store the second image in the UserData of the GUI view_field 4598 corrfig=findobj(allchild(0),'tag','corrfig');% look for a current figure for image correlation display 4599 if isempty(corrfig) 4600 corrfig=figure; 4601 set(corrfig,'tag','corrfig') 4602 set(corrfig,'name','image correlation') 4603 set(corrfig,'DeleteFcn',{@closeview_field})% 4604 end 4605 set(hh,'UserData',ViewData) 4606 else 4607 corrfig=findobj(allchild(0),'tag','corrfig');% look for a current figure for image correlation display 4608 if ~isempty(corrfig) 4609 delete(corrfig) 4610 end 4611 hview_field=findobj(allchild(0),'tag','view_field');% look for view_field 4612 if ~isempty(hview_field) 4613 delete(hview_field) 4614 end 4615 end 4616 4617 function closeview_field(gcbo,eventdata) 4618 hview_field=findobj(allchild(0),'tag','view_field');% look for view_field 4619 if ~isempty(hview_field) 4620 delete(hview_field) 4621 end 4603 4622 %------------------------------------------------------------------- 4604 4623 % --- Executes on button press in status. … … 4754 4773 % --- Executes on button press in CivAll. 4755 4774 function CivAll_Callback(hObject, eventdata, handles) 4756 % hObject handle to CivAll (see GCBO) 4757 % eventdata reserved - to be defined in a future version of MATLAB 4758 % handles structure with handles and user data (see GUIDATA) 4759 4760 % Hint: get(hObject,'Value') returns toggle state of CivAll 4761 4762 4775 if get(handles.CivAll,'Value') 4776 if get(handles.PATCH1,'Value') 4777 set(handles.thresh_patch1,'Visible','on') 4778 set(handles.thresh_text1,'Visible','on') 4779 end 4780 else 4781 set(handles.thresh_patch1,'Visible','off') 4782 set(handles.thresh_text1,'Visible','off') 4783 end 4784
Note: See TracChangeset
for help on using the changeset viewer.