Changeset 276


Ignore:
Timestamp:
Nov 18, 2011, 10:45:09 AM (9 years ago)
Author:
sommeria
Message:

further cleaning after new GUI civ: rationalisation of check_Grid and txt_gridName
records the path of uvmat, series, civ, by addpath

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ.m

    r275 r276  
    2323%TODO: search range
    2424
    25 % Last Modified by GUIDE v2.5 17-Nov-2011 23:05:55
     25% Last Modified by GUIDE v2.5 18-Nov-2011 10:14:23
    2626% Begin initialization code - DO NOT EDIT
    2727gui_Singleton = 1;
     
    4848%------------------------------------------------------------------------
    4949% This function has no output args, see OutputFcn.
    50 global patch_newBin %=1 if new patch processing available
    5150%filebase: root name
    5251%nom_type: nomencalture used ('png_old','_i_j'...)
     
    6564
    6665%% 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
     67path_civ=fileparts(which('civ')); %path to civ
     68addpath (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)
    6969errormsg=[];%default error message
    7070xmlfile='PARAM.xml';
     
    9595if isfield(sparam.RunParam,'CivBin')
    9696    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);
    9898    end
    9999else
     
    165165set(handles.ImaDoc,'String',ext)
    166166
    167 % patch_newBin=exist(sparam.RunParam.CivBin,'file');
    168 % set(handles.subdir_civ1,'String',subdir)%default subdir on which uvmat was working
    169 % set(handles.subdir_civ2,'String',subdir)%default subdir on which uvmat was working
    170 
    171167%initiate advised operations
    172 % if isemp(ind_opening,[])
    173 %     ind_opening=1; % default
    174 % end
    175 % set default operation options
    176168enable_civ1(handles,0)
    177169enable_civ2(handles,0)
     
    15211513%% check mask if selecetd
    15221514%could be included in get_mask callback ?
    1523 if isequal(get(handles.get_mask_civ1,'Value'),1)
    1524     maskname=get(handles.mask_civ1,'String');
     1515if isequal(get(handles.check_Mask,'Value'),1)
     1516    maskname=get(handles.txt_MaskName,'String');
    15251517    if ~exist(maskname,'file')
    15261518        get_mask_civ1_Callback(hObject, eventdata, handles);
     
    15331525    end
    15341526end
    1535 if isequal(get(handles.get_mask_civ2,'Value'),1)
    1536     maskname=get(handles.mask_civ2,'String');
     1527if isequal(get(handles.check_Mask,'Value'),1)
     1528    maskname=get(handles.txt_Mask,'String');
    15371529    if ~exist(maskname,'file')
    15381530        get_mask_civ2_Callback(hObject, eventdata, handles);
     
    15711563
    15721564%% 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 uvmat
     1565path_civ=fileparts(which('civ')); %path to the source directory of uvmat
    15741566xmlfile='PARAM.xml';
    15751567if exist(xmlfile,'file')% search parameter xml file in the whole matlab path
     
    16321624             if isfield(param.global,bin_name{1})
    16331625                 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}));
    16351627                     if exist(fullname,'file')
    16361628                         param.global.(bin_name{1})=fullname;
     
    17521744           
    17531745            % 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');
    17561748                if exist(maskdispl,'file')
    17571749                    param.civ1.maskname=maskdispl;
     
    17751767           
    17761768            % read grid parameters
    1777             if get(handles.browse_gridciv1,'Value')
     1769            if get(handles.check_Grid,'Value')
    17781770                param.civ1.gridflag='y';
    1779                 gridname=get(handles.grid_civ1,'String');
     1771                gridname=get(handles.txt_GridName,'String');
    17801772                if isequal(gridname(end-3:end),'grid')
    17811773                    nbslice_grid=str2double(gridname(1:end-4)); %
     
    19081900            param.civ2.filename_nc1=filecell.nc.civ1{ifile,j};
    19091901            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');
    19111903            if test_mask==0
    19121904                param.civ2.maskname='noFile use default';
    19131905                param.civ2.maskflag='n';
    19141906            else
    1915                 maskdispl=get(handles.mask_civ2,'String');
     1907                maskdispl=get(handles.txt_Mask,'String');
    19161908                if exist(maskdispl,'file')
    19171909                    param.civ2.maskname=maskdispl;
     
    19301922                end
    19311923            end
    1932             gridname=get(handles.grid_civ2,'String');
     1924            gridname=get(handles.txt_GridName,'String');
    19331925            if numel(gridname)>=4 && isequal(gridname(end-3:end),'grid')
    19341926                nbslice_grid=str2double(gridname(1:end-4)); %
     
    34173409end
    34183410
    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
    34663461
    34673462%------------------------------------------------------------------------
     
    34983493    if isequal(mask_displ,'no mask')
    34993494        set(handles.get_mask_fix1,'Value',0)
    3500         set(handles.get_mask_civ2,'Value',0)
     3495        set(handles.check_Mask,'Value',0)
    35013496        set(handles.get_mask_fix2,'Value',0)
    35023497    else
    3503         %set(handles.get_mask_civ2,'Value',1)
     3498        %set(handles.check_Mask,'Value',1)
    35043499        set(handles.get_mask_fix2,'Value',1)
    35053500    end
    35063501    set(handles.mask_fix1,'String',mask_displ)
    3507     set(handles.mask_civ2,'String',mask_displ)
     3502    set(handles.txt_Mask,'String',mask_displ)
    35083503    set(handles.mask_fix2,'String',mask_displ)
    35093504end
    35103505
    35113506%------------------------------------------------------------------------
    3512 % --- Executes on button press in get_mask_civ2: select box for mask option
     3507% --- Executes on button press in check_Mask: select box for mask option
    35133508function get_mask_civ2_Callback(hObject, eventdata, handles)
    35143509%------------------------------------------------------------------------
    3515 maskval=get(handles.get_mask_civ2,'Value');
     3510maskval=get(handles.check_Mask,'Value');
    35163511if isequal(maskval,0)
    3517     set(handles.mask_civ2,'String','')
     3512    set(handles.txt_Mask,'String','')
    35183513else
    35193514    mask_displ='no mask'; %default
     
    35413536    end
    35423537    if isequal(mask_displ,'no mask')
    3543         set(handles.get_mask_civ2,'Value',0)
     3538        set(handles.check_Mask,'Value',0)
    35443539        set(handles.get_mask_fix2,'Value',0)
    35453540    else
    35463541        set(handles.get_mask_fix2,'Value',1)
    35473542    end
    3548     set(handles.mask_civ2,'String',mask_displ)
     3543    set(handles.txt_Mask,'String',mask_displ)
    35493544    set(handles.mask_fix2,'String',mask_displ)
    35503545end
     
    37083703
    37093704%------------------------------------------------------------------------
    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.
     3706function check_Grid_Callback(hObject, eventdata, handles)
     3707%------------------------------------------------------------------------
     3708value=get(hObject,'Value');
     3709hparent=get(hObject,'parent');
     3710hchildren=get(hparent,'children');
     3711handle_txtbox=findobj(hchildren,'tag','txt_GridName');
     3712handle_dx=findobj(hchildren,'tag','num_Dx');
     3713handle_dy=findobj(hchildren,'tag','num_Dy');
    37143714testgrid=0;
     3715filegrid='';
    37153716if value
    37163717    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
    37183719    if isequal(flag_grid,1)
    37193720        filegrid=[num2str(nbslice) 'grid'];
    37203721        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
    37223727        [FileName, PathName, filterindex] = uigetfile( ...
    37233728            {'*.grid', ' (*.grid)';
     
    37263731            'Pick a file',filebase);
    37273732        filegrid=fullfile(PathName,FileName);
     3733        set(hObject,'UserData',filegrid);%store for future use
    37283734        if ~(isempty(FileName)||isempty(PathName)||isequal(FileName,0)||~exist(filegrid,'file'))
    37293735            testgrid=1;
     
    37323738end
    37333739if 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)
     3744else
     3745    set(hObject,'Value',0);
     3746    set(handle_dx,'Visible','on');
     3747    set(handle_dy,'Visible','on');
     3748    set(handle_txtbox,'Visible','off')
     3749end
     3750
     3751%% if hObject is on the civ1 frame, duplicate action for civ2 frame
     3752PanelName=get(hparent,'tag');
     3753if 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
     3773end
     3774%------------------------------------------------------------------------
     3775% --- Executes on button press in check_Mask.
     3776function check_Mask_Callback(hObject, eventdata, handles)
     3777%------------------------------------------------------------------------
     3778value=get(hObject,'Value');
     3779testmask=0;
     3780if 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
     3802end
     3803if 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)
     3810else
     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')
     3818end
     3819
     3820%------------------------------------------------------------------------
     3821% --- Executes on button press in check_Grid.
    37623822function browse_gridciv2_Callback(hObject, eventdata, handles)
    37633823%------------------------------------------------------------------------
    3764 value=get(handles.browse_gridciv2,'Value');
     3824value=get(handles.check_Grid,'Value');
    37653825if value
    37663826    filebase=get(handles.RootName,'String');
     
    37683828    if isequal(flag_grid,1)
    37693829        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');
    37733833    else
    37743834        [FileName, PathName, filterindex] = uigetfile( ...
     
    37793839        filegrid=fullfile(PathName,FileName);
    37803840        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','');
    37863846        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
     3853else
     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','');
     3858end
     3859
     3860% % --- Executes on button press in check_Grid.
    38013861% function browse_gridciv2_Callback(hObject, eventdata, handles)
    38023862%
     
    38083868%         'Pick a file',filebase);
    38093869% 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',' ');
    38133873% % set(handles.grid_patch2,'string',filegrid);
    38143874
     
    38623922set(handles.shifty,'Visible',state)
    38633923set(handles.rho,'Visible',state)
    3864 set(handles.dx_civ1,'Visible',state)
    3865 set(handles.dy_civ1,'Visible',state)
     3924set(handles.num_Dx,'Visible',state)
     3925set(handles.num_Dy,'Visible',state)
    38663926set(handles.SearchRange,'Visible',state)
    38673927set(handles.u_title,'Visible',state)
     
    38733933set(handles.vmin,'Visible',state)
    38743934set(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)
     3935set(handles.txt_GridName,'Visible',state)
     3936set(handles.txt_MaskName,'Visible',state)
     3937set(handles.check_Grid,'Visible',state)
     3938set(handles.check_Mask,'Visible',state)
    38793939set(handles.parameters,'Visible',state)
    38803940set(handles.grid,'Visible',state)
    3881 set(handles.dx_civ1,'Visible',state)
    3882 set(handles.dy_civ1,'Visible',state)
    3883 set(handles.ImaThreshold,'Visible',state)
     3941set(handles.num_Dx,'Visible',state)
     3942set(handles.num_Dy,'Visible',state)
     3943set(handles.check_Threshold,'Visible',state)
    38843944if isequal(state,'off')
    38853945    set(handles.MinIma,'Visible','off')
    38863946    set(handles.MaxIma,'Visible','off')
    3887     set(handles.ImaThreshold,'Value',0)
     3947    set(handles.check_Threshold,'Value',0)
    38883948end
    38893949set(handles.dx_civ1_title,'Visible',state)
     
    40124072set(handles.deformation,'Visible',state)
    40134073set(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)
     4074set(handles.num_Dx,'Visible',state)
     4075set(handles.num_Dy,'Visible',state)
     4076set(handles.check_Grid,'Visible',state)
     4077set(handles.check_Mask,'Visible',state)
    40184078set(handles.parameters,'Visible',state)
    40194079set(handles.grid,'Visible',state)
    40204080set(handles.parameters_text,'Visible',state)
    40214081set(handles.grid_text,'Visible',state)
    4022 set(handles.grid_civ2,'Visible',state)
    4023 set(handles.mask_civ2,'Visible',state)
     4082set(handles.txt_GridName,'Visible',state)
     4083set(handles.txt_Mask,'Visible',state)
    40244084set(handles.dx_civ2_title,'Visible',state)
    40254085set(handles.dy_civ2_title,'Visible',state)
     
    42284288    par.rho=par.rho{index};
    42294289end
    4230 par.dx=get(handles.dx_civ1,'String');
    4231 par.dy=get(handles.dy_civ1,'String');
     4290par.dx=get(handles.num_Dx,'String');
     4291par.dy=get(handles.num_Dy,'String');
    42324292if isnan(str2double(par.dx))
    4233     if isempty(get(handles.grid_civ1,'String'));
     4293    if isempty(get(handles.txt_GridName,'String'));
    42344294        par.dx='0'; %just read by civ program, not used
    42354295    else
    42364296        par.dx='20';%default
    4237         set(handles.dx_civ1,'String','20');
     4297        set(handles.num_Dx,'String','20');
    42384298    end
    42394299end
    42404300if isnan(str2double(par.dy))
    4241     if isempty(get(handles.grid_civ1,'String'));
     4301    if isempty(get(handles.txt_GridName,'String'));
    42424302        par.dy='0';%just read by civ program, not used
    42434303    else
     
    42584318% end
    42594319%time=get(handles.RootName,'UserData'); %get the set of times
    4260 par.gridname=get(handles.grid_civ1,'String');
     4320par.gridname=get(handles.txt_GridName,'String');
    42614321par.gridflag='y';
    42624322if strcmp(par.gridname,'')|| isempty(par.gridname)
     
    43314391par.decimal=int2str(get(handles.decimal,'Value'));
    43324392par.deformation=int2str(get(handles.deformation,'Value'));
    4333 par.dx=get(handles.dx_civ2,'String');
    4334 par.dy=get(handles.dy_civ2,'String');
     4393par.dx=get(handles.num_Dx,'String');
     4394par.dy=get(handles.num_Dy,'String');
    43354395if isnan(str2double(par.dx))
    4336     if isempty(get(handles.grid_civ2,'String'));
     4396    if isempty(get(handles.txt_GridName,'String'));
    43374397        par.dx='0'; %just read by civ program, not used
    43384398    else
    43394399        par.dx='20';%default
    4340         set(handles.dx_civ2,'String','20');
     4400        set(handles.num_Dx,'String','20');
    43414401    end
    43424402end
    43434403if isnan(str2double(par.dy))
    4344     if isempty(get(handles.grid_civ2,'String'));
     4404    if isempty(get(handles.txt_GridName,'String'));
    43454405        par.dy='0';%just read by civ program, not used
    43464406    else
    43474407        par.dy='20';%default
    4348         set(handles.dy_civ2,'String','20');
     4408        set(handles.num_Dy,'String','20');
    43494409    end
    43504410end
     
    43564416par.npy=num2str(sizim(1));
    43574417%time=get(handles.RootName,'UserData'); %get the set of times
    4358 par.gridname=get(handles.grid_civ2,'String');
     4418par.gridname=get(handles.txt_GridName,'String');
    43594419par.gridflag='y';
    43604420if strcmp(par.gridname,'')|| isempty(par.gridname)
     
    48934953
    48944954%------------------------------------------------------------------------
    4895 % --- Executes on button press in ImaThreshold.
     4955% --- Executes on button press in check_Threshold.
    48964956function ImaThreshold_Callback(hObject, eventdata, handles)
    48974957%------------------------------------------------------------------------
    4898 if isequal(get(handles.ImaThreshold,'Value'),1)
     4958if isequal(get(handles.check_Threshold,'Value'),1)
    48994959    set(handles.MinIma,'Visible','on')
    49004960    set(handles.MaxIma,'Visible','on')
     
    52425302% --------------------------------------------------------------------
    52435303function MenuHelp_Callback(hObject, eventdata, handles)
    5244 path_to_uvmat=which ('uvmat');% check the path of uvmat
    5245 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(pathelp,'uvmat_doc'))
     5304path_civ=fileparts(which ('civ'));
     5305helpfile=fullfile(path_civ,'uvmat_doc','uvmat_doc.html');
     5306if 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')
     5308else
     5309    addpath (fullfile(path_civ,'uvmat_doc'))
    52505310    web([helpfile '#civ'])
    52515311end
  • trunk/src/series.m

    r252 r276  
    135135[path_series,name,ext]=fileparts(which('series'));
    136136path_series=fullfile(path_series,'series');%path of the function 'series'
    137 path_transform=fullfile(path_series,'transform_field');%path of the field transform functions
     137addpath 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)
     138path_transform=fullfile(path_series,'transform_field');%path to the field transform functions
    138139for ilist=1:length(fct_menu)
    139140    fct_path{ilist,1}=path_series;%paths of the fuctions buil-in in 'series.m'
  • trunk/src/uvmat.m

    r271 r276  
    242242UvData.OpenParam.NbBuiltin=numel(menu_str); %number of functions
    243243path_uvmat=fileparts(which('uvmat'));
    244 addpath(fullfile(path_uvmat,'transform_field'))
     244addpath (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)
     245addpath(fullfile(path_uvmat,'transform_field'))%add the path to transform functions,
    245246fct_handle{1,1}=[];
    246247testexist=zeros(size(menu_str'));%default
Note: See TracChangeset for help on using the changeset viewer.