Changeset 276
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r275 r276 23 23 %TODO: search range 24 24 25 % Last Modified by GUIDE v2.5 1 7-Nov-2011 23:05:5525 % Last Modified by GUIDE v2.5 18-Nov-2011 10:14:23 26 26 % Begin initialization code - DO NOT EDIT 27 27 gui_Singleton = 1; … … 48 48 %------------------------------------------------------------------------ 49 49 % This function has no output args, see OutputFcn. 50 global patch_newBin %=1 if new patch processing available51 50 %filebase: root name 52 51 %nom_type: nomencalture used ('png_old','_i_j'...) … … 65 64 66 65 %% read names of the .exe file to adjust the interface according to available binaries 67 path_uvmat=which('uvmat');% check the path detected for source file uvmat 68 path_UVMAT=fileparts(path_uvmat); %path to UVMAT 66 %path_uvmat=which('uvmat');% check the path detected for source file uvmat 67 path_civ=fileparts(which('civ')); %path to civ 68 addpath (path_civ) ; %add the path to UVMAT, (useful in case of change of working directory after civ has been s opened in the working directory) 69 69 errormsg=[];%default error message 70 70 xmlfile='PARAM.xml'; … … 95 95 if isfield(sparam.RunParam,'CivBin') 96 96 if ~exist(sparam.RunParam.CivBin,'file') 97 sparam.RunParam.CivBin=fullfile(path_ UVMAT,sparam.RunParam.CivBin);97 sparam.RunParam.CivBin=fullfile(path_civ,sparam.RunParam.CivBin); 98 98 end 99 99 else … … 165 165 set(handles.ImaDoc,'String',ext) 166 166 167 % patch_newBin=exist(sparam.RunParam.CivBin,'file');168 % set(handles.subdir_civ1,'String',subdir)%default subdir on which uvmat was working169 % set(handles.subdir_civ2,'String',subdir)%default subdir on which uvmat was working170 171 167 %initiate advised operations 172 % if isemp(ind_opening,[])173 % ind_opening=1; % default174 % end175 % set default operation options176 168 enable_civ1(handles,0) 177 169 enable_civ2(handles,0) … … 1521 1513 %% check mask if selecetd 1522 1514 %could be included in get_mask callback ? 1523 if isequal(get(handles. get_mask_civ1,'Value'),1)1524 maskname=get(handles. mask_civ1,'String');1515 if isequal(get(handles.check_Mask,'Value'),1) 1516 maskname=get(handles.txt_MaskName,'String'); 1525 1517 if ~exist(maskname,'file') 1526 1518 get_mask_civ1_Callback(hObject, eventdata, handles); … … 1533 1525 end 1534 1526 end 1535 if isequal(get(handles. get_mask_civ2,'Value'),1)1536 maskname=get(handles. mask_civ2,'String');1527 if isequal(get(handles.check_Mask,'Value'),1) 1528 maskname=get(handles.txt_Mask,'String'); 1537 1529 if ~exist(maskname,'file') 1538 1530 get_mask_civ2_Callback(hObject, eventdata, handles); … … 1571 1563 1572 1564 %% read the PARAM.xml file to get the binaries (and batch_mode if batch) 1573 path_ UVMAT=fileparts(which('uvmat')); %path to the source directory of uvmat1565 path_civ=fileparts(which('civ')); %path to the source directory of uvmat 1574 1566 xmlfile='PARAM.xml'; 1575 1567 if exist(xmlfile,'file')% search parameter xml file in the whole matlab path … … 1632 1624 if isfield(param.global,bin_name{1}) 1633 1625 if ~exist(param.global.(bin_name{1}),'file')%look for the full path if the file name has been defined with a relative path in PARAM.xml 1634 fullname=fullfile(path_ UVMAT,param.global.(bin_name{1}));1626 fullname=fullfile(path_civ,param.global.(bin_name{1})); 1635 1627 if exist(fullname,'file') 1636 1628 param.global.(bin_name{1})=fullname; … … 1752 1744 1753 1745 % read mask parameters 1754 if get(handles. get_mask_civ1,'Value')1755 maskdispl=get(handles. mask_civ1,'String');1746 if get(handles.check_Mask,'Value') 1747 maskdispl=get(handles.txt_MaskName,'String'); 1756 1748 if exist(maskdispl,'file') 1757 1749 param.civ1.maskname=maskdispl; … … 1775 1767 1776 1768 % read grid parameters 1777 if get(handles. browse_gridciv1,'Value')1769 if get(handles.check_Grid,'Value') 1778 1770 param.civ1.gridflag='y'; 1779 gridname=get(handles. grid_civ1,'String');1771 gridname=get(handles.txt_GridName,'String'); 1780 1772 if isequal(gridname(end-3:end),'grid') 1781 1773 nbslice_grid=str2double(gridname(1:end-4)); % … … 1908 1900 param.civ2.filename_nc1=filecell.nc.civ1{ifile,j}; 1909 1901 param.civ2.filename_nc1(end-2:end)=[]; % remove '.nc' 1910 test_mask=get(handles. get_mask_civ2,'Value');1902 test_mask=get(handles.check_Mask,'Value'); 1911 1903 if test_mask==0 1912 1904 param.civ2.maskname='noFile use default'; 1913 1905 param.civ2.maskflag='n'; 1914 1906 else 1915 maskdispl=get(handles. mask_civ2,'String');1907 maskdispl=get(handles.txt_Mask,'String'); 1916 1908 if exist(maskdispl,'file') 1917 1909 param.civ2.maskname=maskdispl; … … 1930 1922 end 1931 1923 end 1932 gridname=get(handles. grid_civ2,'String');1924 gridname=get(handles.txt_GridName,'String'); 1933 1925 if numel(gridname)>=4 && isequal(gridname(end-3:end),'grid') 1934 1926 nbslice_grid=str2double(gridname(1:end-4)); % … … 3417 3409 end 3418 3410 3419 %------------------------------------------------------------------------ 3420 % --- Executes on button press in get_mask_civ1: select box for mask option 3421 function get_mask_civ1_Callback(hObject, eventdata, handles) 3422 %------------------------------------------------------------------------ 3423 maskval=get(handles.get_mask_civ1,'Value'); 3424 if isequal(maskval,0) 3425 set(handles.mask_civ1,'String','') 3426 else 3427 mask_displ='no mask'; %default 3428 filebase=get(handles.RootName,'String'); 3429 [ nbslice_mask, flag_mask]=get_mask(filebase,handles); 3430 if isequal(flag_mask,1) 3431 mask_displ=[num2str(nbslice_mask) 'mask']; 3432 elseif get(handles.compare,'Value')>1 & ~isequal(mask_displ,'no mask')% look for the second mask series 3433 common_path=fileparts(filebase); 3434 filebase_a=fullfile(common_path,get(handles.RootName_1,'String')); 3435 [nbslice_a, flag_mask_a]=get_mask(filebase_a,handles); 3436 if isequal(flag_mask_a,0) || ~isequal(nbslice_a,nbslice_mask) 3437 mask_displ='no mask'; 3438 end 3439 end 3440 if isequal(mask_displ,'no mask') 3441 [FileName, PathName, filterindex] = uigetfile( ... 3442 {'*.png', ' (*.png)'; 3443 '*.png', '.png files '; ... 3444 '*.*', 'All Files (*.*)'}, ... 3445 'Pick a mask file *.png',filebase); 3446 mask_displ=fullfile(PathName,FileName); 3447 if ~exist(mask_displ,'file') 3448 mask_displ='no mask'; 3449 end 3450 end 3451 if isequal(mask_displ,'no mask') 3452 set(handles.get_mask_civ1,'Value',0) 3453 set(handles.get_mask_fix1,'Value',0) 3454 set(handles.get_mask_civ2,'Value',0) 3455 set(handles.get_mask_fix2,'Value',0) 3456 else 3457 set(handles.get_mask_fix1,'Value',1) 3458 set(handles.get_mask_fix2,'Value',1) 3459 end 3460 set(handles.mask_civ1,'String',mask_displ) 3461 set(handles.mask_fix1,'String',mask_displ) 3462 set(handles.mask_civ2,'String',mask_displ) 3463 set(handles.mask_fix2,'String',mask_displ) 3464 end 3465 set(handles.get_mask_civ2,'Value',maskval)%update the civ2 mask with the same option as civ1 3411 % %------------------------------------------------------------------------ 3412 % % --- Executes on button press in check_Mask: select box for mask option 3413 % function check_Mask_Callback(hObject, eventdata, handles) 3414 % %------------------------------------------------------------------------ 3415 % maskval=get(handles.check_Mask,'Value'); 3416 % if isequal(maskval,0) 3417 % set(handles.txt_MaskName,'Visible','off') 3418 % % set(handles.txt_MaskName,'String','') 3419 % else 3420 % mask_displ='no mask'; %default 3421 % filebase=get(handles.RootName,'String'); 3422 % [ nbslice_mask, flag_mask]=get_mask(filebase,handles); 3423 % if isequal(flag_mask,1) 3424 % mask_displ=[num2str(nbslice_mask) 'mask']; 3425 % elseif get(handles.compare,'Value')>1 & ~isequal(mask_displ,'no mask')% look for the second mask series 3426 % common_path=fileparts(filebase); 3427 % filebase_a=fullfile(common_path,get(handles.RootName_1,'String')); 3428 % [nbslice_a, flag_mask_a]=get_mask(filebase_a,handles); 3429 % if isequal(flag_mask_a,0) || ~isequal(nbslice_a,nbslice_mask) 3430 % mask_displ='no mask'; 3431 % end 3432 % end 3433 % if isequal(mask_displ,'no mask') 3434 % [FileName, PathName, filterindex] = uigetfile( ... 3435 % {'*.png', ' (*.png)'; 3436 % '*.png', '.png files '; ... 3437 % '*.*', 'All Files (*.*)'}, ... 3438 % 'Pick a mask file *.png',filebase); 3439 % mask_displ=fullfile(PathName,FileName); 3440 % if exist(mask_displ,'file') 3441 % set(handles.txt_MaskName,'Visible','on') 3442 % set(handles.txt_MaskName,'String',mask_displ) 3443 % % mask_displ='no mask'; 3444 % end 3445 % end 3446 % if isequal(mask_displ,'no mask') 3447 % set(handles.check_Mask,'Value',0) 3448 % set(handles.get_mask_fix1,'Value',0) 3449 % set(handles.check_Mask,'Value',0) 3450 % set(handles.get_mask_fix2,'Value',0) 3451 % else 3452 % set(handles.get_mask_fix1,'Value',1) 3453 % set(handles.get_mask_fix2,'Value',1) 3454 % end 3455 % set(handles.txt_MaskName,'String',mask_displ) 3456 % set(handles.mask_fix1,'String',mask_displ) 3457 % set(handles.txt_Mask,'String',mask_displ) 3458 % set(handles.mask_fix2,'String',mask_displ) 3459 % end 3460 % set(handles.check_Mask,'Value',maskval)%update the civ2 mask with the same option as civ1 3466 3461 3467 3462 %------------------------------------------------------------------------ … … 3498 3493 if isequal(mask_displ,'no mask') 3499 3494 set(handles.get_mask_fix1,'Value',0) 3500 set(handles. get_mask_civ2,'Value',0)3495 set(handles.check_Mask,'Value',0) 3501 3496 set(handles.get_mask_fix2,'Value',0) 3502 3497 else 3503 %set(handles. get_mask_civ2,'Value',1)3498 %set(handles.check_Mask,'Value',1) 3504 3499 set(handles.get_mask_fix2,'Value',1) 3505 3500 end 3506 3501 set(handles.mask_fix1,'String',mask_displ) 3507 set(handles. mask_civ2,'String',mask_displ)3502 set(handles.txt_Mask,'String',mask_displ) 3508 3503 set(handles.mask_fix2,'String',mask_displ) 3509 3504 end 3510 3505 3511 3506 %------------------------------------------------------------------------ 3512 % --- Executes on button press in get_mask_civ2: select box for mask option3507 % --- Executes on button press in check_Mask: select box for mask option 3513 3508 function get_mask_civ2_Callback(hObject, eventdata, handles) 3514 3509 %------------------------------------------------------------------------ 3515 maskval=get(handles. get_mask_civ2,'Value');3510 maskval=get(handles.check_Mask,'Value'); 3516 3511 if isequal(maskval,0) 3517 set(handles. mask_civ2,'String','')3512 set(handles.txt_Mask,'String','') 3518 3513 else 3519 3514 mask_displ='no mask'; %default … … 3541 3536 end 3542 3537 if isequal(mask_displ,'no mask') 3543 set(handles. get_mask_civ2,'Value',0)3538 set(handles.check_Mask,'Value',0) 3544 3539 set(handles.get_mask_fix2,'Value',0) 3545 3540 else 3546 3541 set(handles.get_mask_fix2,'Value',1) 3547 3542 end 3548 set(handles. mask_civ2,'String',mask_displ)3543 set(handles.txt_Mask,'String',mask_displ) 3549 3544 set(handles.mask_fix2,'String',mask_displ) 3550 3545 end … … 3708 3703 3709 3704 %------------------------------------------------------------------------ 3710 % --- Executes on button press in browse_gridciv1. 3711 function browse_gridciv1_Callback(hObject, eventdata, handles) 3712 %------------------------------------------------------------------------ 3713 value=get(handles.browse_gridciv1,'Value'); 3705 % --- Executes on button press in check_Grid. 3706 function check_Grid_Callback(hObject, eventdata, handles) 3707 %------------------------------------------------------------------------ 3708 value=get(hObject,'Value'); 3709 hparent=get(hObject,'parent'); 3710 hchildren=get(hparent,'children'); 3711 handle_txtbox=findobj(hchildren,'tag','txt_GridName'); 3712 handle_dx=findobj(hchildren,'tag','num_Dx'); 3713 handle_dy=findobj(hchildren,'tag','num_Dy'); 3714 3714 testgrid=0; 3715 filegrid=''; 3715 3716 if value 3716 3717 filebase=get(handles.RootName,'String'); 3717 [nbslice, flag_grid]=get_grid(filebase,handles); 3718 [nbslice, flag_grid]=get_grid(filebase,handles);% look for a grid with appropriate name 3718 3719 if isequal(flag_grid,1) 3719 3720 filegrid=[num2str(nbslice) 'grid']; 3720 3721 testgrid=1; 3721 else 3722 else % browse for a grid 3723 filegrid=get(hObject,'UserData');%look for previous grid name stored as UserData 3724 if exist(filegrid,'file') 3725 filebase=filegrid; 3726 end 3722 3727 [FileName, PathName, filterindex] = uigetfile( ... 3723 3728 {'*.grid', ' (*.grid)'; … … 3726 3731 'Pick a file',filebase); 3727 3732 filegrid=fullfile(PathName,FileName); 3733 set(hObject,'UserData',filegrid);%store for future use 3728 3734 if ~(isempty(FileName)||isempty(PathName)||isequal(FileName,0)||~exist(filegrid,'file')) 3729 3735 testgrid=1; … … 3732 3738 end 3733 3739 if testgrid 3734 set(handles.browse_gridciv2,'Value',1) 3735 set(handles.get_gridpatch1,'Value',1) 3736 set(handles.get_gridpatch2,'Value',1) 3737 set(handles.dx_civ1,'Visible','off'); 3738 set(handles.dy_civ1,'Visible','off'); 3739 set(handles.dx_civ2,'Visible','off'); 3740 set(handles.dy_civ2,'Visible','off'); 3741 set(handles.grid_civ1,'String',filegrid) 3742 set(handles.grid_patch1,'String',filegrid) 3743 set(handles.grid_civ2,'String',filegrid) 3744 set(handles.grid_patch2,'String',filegrid) 3745 else 3746 set(handles.browse_gridciv1,'Value',0); 3747 set(handles.browse_gridciv2,'Value',0); 3748 set(handles.get_gridpatch1,'Value',0) 3749 set(handles.get_gridpatch2,'Value',0) 3750 set(handles.dx_civ1,'Visible','on'); 3751 set(handles.dy_civ1,'Visible','on'); 3752 set(handles.dx_civ2,'Visible','on'); 3753 set(handles.dy_civ2,'Visible','on'); 3754 set(handles.grid_civ1,'String','') 3755 set(handles.grid_patch1,'String','') 3756 set(handles.grid_civ2,'String','') 3757 set(handles.grid_patch2,'String','') 3758 end 3759 3760 %------------------------------------------------------------------------ 3761 % --- Executes on button press in browse_gridciv1. 3740 set(handle_dx,'Visible','off'); 3741 set(handle_dy,'Visible','off'); 3742 set(handle_txtbox,'Visible','on') 3743 set(handle_txtbox,'String',filegrid) 3744 else 3745 set(hObject,'Value',0); 3746 set(handle_dx,'Visible','on'); 3747 set(handle_dy,'Visible','on'); 3748 set(handle_txtbox,'Visible','off') 3749 end 3750 3751 %% if hObject is on the civ1 frame, duplicate action for civ2 frame 3752 PanelName=get(hparent,'tag'); 3753 if strcmp(PanelName,'panel_Civ1') 3754 hchildren=get(handles.panel_Civ2,'children'); 3755 handle_checkbox=findobj(hchildren,'tag','check_Grid'); 3756 handle_txtbox=findobj(hchildren,'tag','txt_GridName'); 3757 handle_dx=findobj(hchildren,'tag','num_Dx'); 3758 handle_dy=findobj(hchildren,'tag','num_Dy'); 3759 set(handle_checkbox,'UserData',filegrid);%store for future use 3760 if testgrid 3761 set(handle_checkbox,'Value',1); 3762 set(handle_dx,'Visible','off'); 3763 set(handle_dy,'Visible','off'); 3764 set(handle_txtbox,'Visible','on') 3765 set(handle_txtbox,'String',filegrid) 3766 else 3767 set(handle_checkbox,'Value',0); 3768 set(handles.check_Grid,'Value',0); 3769 set(handle_dx,'Visible','on'); 3770 set(handle_dy,'Visible','on'); 3771 set(handle_txtbox,'Visible','off') 3772 end 3773 end 3774 %------------------------------------------------------------------------ 3775 % --- Executes on button press in check_Mask. 3776 function check_Mask_Callback(hObject, eventdata, handles) 3777 %------------------------------------------------------------------------ 3778 value=get(hObject,'Value'); 3779 testmask=0; 3780 if value 3781 filebase=get(handles.RootName,'String'); 3782 [nbslice, flag_mask]=get_mask(filebase,handles);% look for a mask with appropriate name 3783 if isequal(flag_mask,1) 3784 filemask=[num2str(nbslice) 'mask']; 3785 testmask=1; 3786 else % browse for a mask 3787 filemask=get(handles.check_Mask,'UserData');%look for previous mask name stored as UserData 3788 if exist(filemask,'file') 3789 filebase=filemask; 3790 end 3791 [FileName, PathName, filterindex] = uigetfile( ... 3792 {'*.png', ' (*.png)'; 3793 '*.png', '.png files '; ... 3794 '*.*', 'All Files (*.*)'}, ... 3795 'Pick a mask file *.png',filebase); 3796 filemask=fullfile(PathName,FileName); 3797 set(handles.check_Mask,'UserData',filemask);%store for future use 3798 if ~(isempty(FileName)||isempty(PathName)||isequal(FileName,0)||~exist(filemask,'file')) 3799 testmask=1; 3800 end 3801 end 3802 end 3803 if testmask 3804 set(handles.num_Dx,'Visible','off'); 3805 set(handles.num_Dy,'Visible','off'); 3806 set(handles.num_Dx,'Visible','off'); 3807 set(handles.num_Dy,'Visible','off'); 3808 set(handles.txt_MaskName,'Visible','on') 3809 set(handles.txt_MaskName,'String',filemask) 3810 else 3811 set(handles.check_Mask,'Value',0); 3812 set(handles.check_Grid,'Value',0); 3813 set(handles.num_Dx,'Visible','on'); 3814 set(handles.num_Dy,'Visible','on'); 3815 set(handles.num_Dx,'Visible','on'); 3816 set(handles.num_Dy,'Visible','on'); 3817 set(handles.txt_MaskName,'Visible','off') 3818 end 3819 3820 %------------------------------------------------------------------------ 3821 % --- Executes on button press in check_Grid. 3762 3822 function browse_gridciv2_Callback(hObject, eventdata, handles) 3763 3823 %------------------------------------------------------------------------ 3764 value=get(handles. browse_gridciv2,'Value');3824 value=get(handles.check_Grid,'Value'); 3765 3825 if value 3766 3826 filebase=get(handles.RootName,'String'); … … 3768 3828 if isequal(flag_grid,1) 3769 3829 mask_displ=[num2str(nbslice) 'grid']; 3770 set(handles. grid_civ2,'String',mask_displ)3771 set(handles. dx_civ2,'Visible','off');3772 set(handles. dy_civ2,'Visible','off');3830 set(handles.txt_GridName,'String',mask_displ) 3831 set(handles.num_Dx,'Visible','off'); 3832 set(handles.num_Dy,'Visible','off'); 3773 3833 else 3774 3834 [FileName, PathName, filterindex] = uigetfile( ... … … 3779 3839 filegrid=fullfile(PathName,FileName); 3780 3840 if isempty(FileName)||isempty(PathName)||isequal(FileName,0)||~exist(filegrid,'file') 3781 set(handles. browse_gridciv2,'Value',0);3782 set(handles. grid_civ2,'string','');3783 set(handles. dx_civ2,'Visible','on');3784 set(handles. dy_civ2,'Visible','on');3785 set(handles. grid_civ2,'string','');3841 set(handles.check_Grid,'Value',0); 3842 set(handles.txt_GridName,'string',''); 3843 set(handles.num_Dx,'Visible','on'); 3844 set(handles.num_Dy,'Visible','on'); 3845 set(handles.txt_GridName,'string',''); 3786 3846 else 3787 set(handles. grid_civ2,'string',filegrid);3788 set(handles. dx_civ2,'Visible','off');3789 set(handles. dy_civ2,'Visible','off');3790 set(handles. grid_civ2,'string',filegrid);3791 end 3792 end 3793 else 3794 set(handles. grid_civ2,'string','');3795 set(handles. dx_civ2,'Visible','on');3796 set(handles. dy_civ2,'Visible','on');3797 set(handles. grid_civ2,'string','');3798 end 3799 3800 % % --- Executes on button press in browse_gridciv2.3847 set(handles.txt_GridName,'string',filegrid); 3848 set(handles.num_Dx,'Visible','off'); 3849 set(handles.num_Dy,'Visible','off'); 3850 set(handles.txt_GridName,'string',filegrid); 3851 end 3852 end 3853 else 3854 set(handles.txt_GridName,'string',''); 3855 set(handles.num_Dx,'Visible','on'); 3856 set(handles.num_Dy,'Visible','on'); 3857 set(handles.txt_GridName,'string',''); 3858 end 3859 3860 % % --- Executes on button press in check_Grid. 3801 3861 % function browse_gridciv2_Callback(hObject, eventdata, handles) 3802 3862 % … … 3808 3868 % 'Pick a file',filebase); 3809 3869 % filegrid=fullfile(PathName,FileName); 3810 % set(handles. grid_civ2,'string',filegrid);3811 % set(handles. dx_civ2,'String',' ');3812 % set(handles. dy_civ2,'String',' ');3870 % set(handles.txt_GridName,'string',filegrid); 3871 % set(handles.num_Dx,'String',' '); 3872 % set(handles.num_Dy,'String',' '); 3813 3873 % % set(handles.grid_patch2,'string',filegrid); 3814 3874 … … 3862 3922 set(handles.shifty,'Visible',state) 3863 3923 set(handles.rho,'Visible',state) 3864 set(handles. dx_civ1,'Visible',state)3865 set(handles. dy_civ1,'Visible',state)3924 set(handles.num_Dx,'Visible',state) 3925 set(handles.num_Dy,'Visible',state) 3866 3926 set(handles.SearchRange,'Visible',state) 3867 3927 set(handles.u_title,'Visible',state) … … 3873 3933 set(handles.vmin,'Visible',state) 3874 3934 set(handles.vmax,'Visible',state) 3875 set(handles. grid_civ1,'Visible',state)3876 set(handles. mask_civ1,'Visible',state)3877 set(handles. browse_gridciv1,'Visible',state)3878 set(handles. get_mask_civ1,'Visible',state)3935 set(handles.txt_GridName,'Visible',state) 3936 set(handles.txt_MaskName,'Visible',state) 3937 set(handles.check_Grid,'Visible',state) 3938 set(handles.check_Mask,'Visible',state) 3879 3939 set(handles.parameters,'Visible',state) 3880 3940 set(handles.grid,'Visible',state) 3881 set(handles. dx_civ1,'Visible',state)3882 set(handles. dy_civ1,'Visible',state)3883 set(handles. ImaThreshold,'Visible',state)3941 set(handles.num_Dx,'Visible',state) 3942 set(handles.num_Dy,'Visible',state) 3943 set(handles.check_Threshold,'Visible',state) 3884 3944 if isequal(state,'off') 3885 3945 set(handles.MinIma,'Visible','off') 3886 3946 set(handles.MaxIma,'Visible','off') 3887 set(handles. ImaThreshold,'Value',0)3947 set(handles.check_Threshold,'Value',0) 3888 3948 end 3889 3949 set(handles.dx_civ1_title,'Visible',state) … … 4012 4072 set(handles.deformation,'Visible',state) 4013 4073 set(handles.rho_civ2,'Visible',state) 4014 set(handles. dx_civ2,'Visible',state)4015 set(handles. dy_civ2,'Visible',state)4016 set(handles. browse_gridciv2,'Visible',state)4017 set(handles. get_mask_civ2,'Visible',state)4074 set(handles.num_Dx,'Visible',state) 4075 set(handles.num_Dy,'Visible',state) 4076 set(handles.check_Grid,'Visible',state) 4077 set(handles.check_Mask,'Visible',state) 4018 4078 set(handles.parameters,'Visible',state) 4019 4079 set(handles.grid,'Visible',state) 4020 4080 set(handles.parameters_text,'Visible',state) 4021 4081 set(handles.grid_text,'Visible',state) 4022 set(handles. grid_civ2,'Visible',state)4023 set(handles. mask_civ2,'Visible',state)4082 set(handles.txt_GridName,'Visible',state) 4083 set(handles.txt_Mask,'Visible',state) 4024 4084 set(handles.dx_civ2_title,'Visible',state) 4025 4085 set(handles.dy_civ2_title,'Visible',state) … … 4228 4288 par.rho=par.rho{index}; 4229 4289 end 4230 par.dx=get(handles. dx_civ1,'String');4231 par.dy=get(handles. dy_civ1,'String');4290 par.dx=get(handles.num_Dx,'String'); 4291 par.dy=get(handles.num_Dy,'String'); 4232 4292 if isnan(str2double(par.dx)) 4233 if isempty(get(handles. grid_civ1,'String'));4293 if isempty(get(handles.txt_GridName,'String')); 4234 4294 par.dx='0'; %just read by civ program, not used 4235 4295 else 4236 4296 par.dx='20';%default 4237 set(handles. dx_civ1,'String','20');4297 set(handles.num_Dx,'String','20'); 4238 4298 end 4239 4299 end 4240 4300 if isnan(str2double(par.dy)) 4241 if isempty(get(handles. grid_civ1,'String'));4301 if isempty(get(handles.txt_GridName,'String')); 4242 4302 par.dy='0';%just read by civ program, not used 4243 4303 else … … 4258 4318 % end 4259 4319 %time=get(handles.RootName,'UserData'); %get the set of times 4260 par.gridname=get(handles. grid_civ1,'String');4320 par.gridname=get(handles.txt_GridName,'String'); 4261 4321 par.gridflag='y'; 4262 4322 if strcmp(par.gridname,'')|| isempty(par.gridname) … … 4331 4391 par.decimal=int2str(get(handles.decimal,'Value')); 4332 4392 par.deformation=int2str(get(handles.deformation,'Value')); 4333 par.dx=get(handles. dx_civ2,'String');4334 par.dy=get(handles. dy_civ2,'String');4393 par.dx=get(handles.num_Dx,'String'); 4394 par.dy=get(handles.num_Dy,'String'); 4335 4395 if isnan(str2double(par.dx)) 4336 if isempty(get(handles. grid_civ2,'String'));4396 if isempty(get(handles.txt_GridName,'String')); 4337 4397 par.dx='0'; %just read by civ program, not used 4338 4398 else 4339 4399 par.dx='20';%default 4340 set(handles. dx_civ2,'String','20');4400 set(handles.num_Dx,'String','20'); 4341 4401 end 4342 4402 end 4343 4403 if isnan(str2double(par.dy)) 4344 if isempty(get(handles. grid_civ2,'String'));4404 if isempty(get(handles.txt_GridName,'String')); 4345 4405 par.dy='0';%just read by civ program, not used 4346 4406 else 4347 4407 par.dy='20';%default 4348 set(handles. dy_civ2,'String','20');4408 set(handles.num_Dy,'String','20'); 4349 4409 end 4350 4410 end … … 4356 4416 par.npy=num2str(sizim(1)); 4357 4417 %time=get(handles.RootName,'UserData'); %get the set of times 4358 par.gridname=get(handles. grid_civ2,'String');4418 par.gridname=get(handles.txt_GridName,'String'); 4359 4419 par.gridflag='y'; 4360 4420 if strcmp(par.gridname,'')|| isempty(par.gridname) … … 4893 4953 4894 4954 %------------------------------------------------------------------------ 4895 % --- Executes on button press in ImaThreshold.4955 % --- Executes on button press in check_Threshold. 4896 4956 function ImaThreshold_Callback(hObject, eventdata, handles) 4897 4957 %------------------------------------------------------------------------ 4898 if isequal(get(handles. ImaThreshold,'Value'),1)4958 if isequal(get(handles.check_Threshold,'Value'),1) 4899 4959 set(handles.MinIma,'Visible','on') 4900 4960 set(handles.MaxIma,'Visible','on') … … 5242 5302 % -------------------------------------------------------------------- 5243 5303 function MenuHelp_Callback(hObject, eventdata, handles) 5244 path_ to_uvmat=which ('uvmat');% check the path of uvmat5245 pathelp=fileparts(path_to_uvmat);5246 helpfile=fullfile(pathelp,'uvmat_doc','uvmat_doc.html'); 5247 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')5248 else 5249 addpath (fullfile(path elp,'uvmat_doc'))5304 path_civ=fileparts(which ('civ')); 5305 helpfile=fullfile(path_civ,'uvmat_doc','uvmat_doc.html'); 5306 if isempty(dir(helpfile)) 5307 msgbox_uvmat('ERROR','Please put the help file uvmat_doc.html in the sub-directory /uvmat_doc of the UVMAT package') 5308 else 5309 addpath (fullfile(path_civ,'uvmat_doc')) 5250 5310 web([helpfile '#civ']) 5251 5311 end -
trunk/src/series.m
r252 r276 135 135 [path_series,name,ext]=fileparts(which('series')); 136 136 path_series=fullfile(path_series,'series');%path of the function 'series' 137 path_transform=fullfile(path_series,'transform_field');%path of the field transform functions 137 addpath path_series ; %add the path to UVMAT, (useful in case of change of working directory after civ has been s opened in the working directory) 138 path_transform=fullfile(path_series,'transform_field');%path to the field transform functions 138 139 for ilist=1:length(fct_menu) 139 140 fct_path{ilist,1}=path_series;%paths of the fuctions buil-in in 'series.m' -
trunk/src/uvmat.m
r271 r276 242 242 UvData.OpenParam.NbBuiltin=numel(menu_str); %number of functions 243 243 path_uvmat=fileparts(which('uvmat')); 244 addpath(fullfile(path_uvmat,'transform_field')) 244 addpath (path_uvmat) ; %add the path to UVMAT, (useful in case of change of working directory after civ has been s opened in the working directory) 245 addpath(fullfile(path_uvmat,'transform_field'))%add the path to transform functions, 245 246 fct_handle{1,1}=[]; 246 247 testexist=zeros(size(menu_str'));%default
Note: See TracChangeset
for help on using the changeset viewer.