Changeset 137


Ignore:
Timestamp:
Nov 26, 2010, 5:43:24 AM (13 years ago)
Author:
sommeria
Message:

suppression of the replacement of ./fsnet (pb now solved on the cluster). Various cleaning.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ.m

    r136 r137  
    469469
    470470%default first_i and j and increments
    471 first_i=str2num(get(handles.first_i,'String'));%value possibly set by uvmat_Opening
    472 if isempty(first_i)|| first_i < 1
     471first_i=str2double(get(handles.first_i,'String'));%value possibly set by uvmat_Opening
     472if isnan(first_i)|| first_i < 1
    473473    first_i=1; %default first_i
    474474end
    475 last_i=str2num(get(handles.last_i,'String'));
    476 if isempty(last_i)|| last_i < first_i
     475last_i=str2double(get(handles.last_i,'String'));
     476if isnan(last_i)|| last_i < first_i
    477477    last_i=first_i;  %default last_i
    478478end
    479 first_j=str2num(get(handles.first_j,'String'));
    480 if isempty(first_j)|| first_j < 1
     479first_j=str2double(get(handles.first_j,'String'));
     480if isnan(first_j)|| first_j < 1
    481481    first_j=1; %default first_j
    482482end
    483 last_j=str2num(get(handles.last_j,'String'));
    484 if isempty(last_j)|| last_j < first_j
     483last_j=str2double(get(handles.last_j,'String'));
     484if isnan(last_j)|| last_j < first_j
    485485    last_j=first_j; %default last_j
    486486end
    487 incr_i=str2num(get(handles.incr_i,'String'));
    488 if isempty(incr_i) || incr_i < 1;
     487incr_i=str2double(get(handles.incr_i,'String'));
     488if isnan(incr_i) || incr_i < 1;
    489489    set(handles.incr_i,'String','1') %default incr_i
    490490end
    491 incr_j=str2num(get(handles.incr_j,'String'));
    492 if isempty(incr_j) || incr_j < 1;
     491incr_j=str2double(get(handles.incr_j,'String'));
     492if isnan(incr_j) || incr_j < 1;
    493493    set(handles.incr_j,'String','1') %default incr_j
    494494end
     
    696696 
    697697    %determine the set of times and possible intervals for CIV
    698     %   dt=(1/1000)*str2num(get(handles.dt,'String'));
     698    %   dt=(1/1000)*str2double(get(handles.dt,'String'));
    699699    time=(0:nbfield-1)';% time=file index -1  by default
    700700    if numel(regexp(nom_type_search,'\D'))>=1%two indices i and j
     
    790790    txt=ver;
    791791    Release=txt(1).Release;
    792     relnumb=str2num(Release(3:4));
     792    relnumb=str2double(Release(3:4));
    793793    if relnumb >= 14
    794794        save (profil_perso,'RootPath','-V6'); %store the root name for future opening of uvmat
     
    816816end
    817817displ_num=[];%default
    818 ref_i=str2num(get(handles.ref_i,'String'));
     818ref_i=str2double(get(handles.ref_i,'String'));
    819819% last_i=str2num(get(handles.last_i,'String'));
    820820time=get(handles.RootName,'UserData'); %get the set of times
     
    12031203%     return
    12041204% end
    1205 ref_i=str2num(get(handles.ref_i_civ2,'String'));
     1205ref_i=str2double(get(handles.ref_i_civ2,'String'));
    12061206if isequal(mode,'pair j1-j2')%|isequal(mode,'st_pair j1-j2')
    12071207    ref_j=0;
    12081208else
    1209     ref_j=str2num(get(handles.ref_j_civ2,'String'));
     1209    ref_j=str2double(get(handles.ref_j_civ2,'String'));
    12101210end
    12111211time=get(handles.RootName,'UserData'); %get the set of times
     
    13041304val=get(handles.list_pair_civ2,'Value');
    13051305ichoice=min(find(select));
    1306 if (isempty(ichoice) | ichoice < 1); ichoice=1; end;
    1307 if get(handles.CIV2,'Value')==0 & get(handles.CIV1,'Value')==0 & get(handles.FIX1,'Value')==0 & get(handles.PATCH1,'Value')==0
     1306if (isempty(ichoice) || ichoice < 1); ichoice=1; end;
     1307if get(handles.CIV2,'Value')==0 && get(handles.CIV1,'Value')==0 && get(handles.FIX1,'Value')==0 && get(handles.PATCH1,'Value')==0
    13081308    val=ichoice;% first valid pair proposed by default in the menu
    13091309end
     
    13241324last_i=str2double(get(handles.last_i,'String'));%last index i
    13251325incr=str2double(get(handles.incr_i,'String'));% increment
    1326 num_i=[first_i:incr:last_i];% list of i indices (reference values for each pair)
     1326num_i=first_i:incr:last_i;% list of i indices (reference values for each pair)
    13271327if isequal(get(handles.first_j,'Visible'),'on')
    13281328    first_j=str2double(get(handles.first_j,'String'));%first index j
     
    13621362    str_raw=str_civ1(indsel);
    13631363    indsepar=find(str_raw=='|'); %character index of the separator
    1364     d1=str2double(str_civ1([indsel(indsepar-1)+1:indsel(indsepar)-1]));
     1364    d1=str2double(str_civ1(indsel(indsepar-1)+1:indsel(indsepar)-1));
    13651365    if indsepar==length(str_raw)
    1366         d2=str2double(str_civ1([indsel(indsepar)+1:end]));
     1366        d2=str2double(str_civ1(indsel(indsepar)+1:end));
    13671367    else
    1368         d2=str2double(str_civ1([indsel(indsepar)+1:indsel(indsepar+1)-1]));
     1368        d2=str2double(str_civ1(indsel(indsepar)+1:indsel(indsepar+1)-1));
    13691369    end
    13701370    num1_civ1=num_i-d1;% set of first image numbers
     
    13771377    str_raw=str_civ2(indsel);
    13781378    indsepar=find(str_raw=='|'); %character index of the separator
    1379     d1=str2num(str_civ2([indsel(indsepar-1)+1:indsel(indsepar)-1]));
     1379    d1=str2double(str_civ2(indsel(indsepar-1)+1:indsel(indsepar)-1));
    13801380    if indsepar==length(str_raw)
    1381         d2=str2num(str_civ2([indsel(indsepar)+1:end]));
     1381        d2=str2double(str_civ2(indsel(indsepar)+1:end));
    13821382    else
    1383         d2=str2num(str_civ2([indsel(indsepar)+1:indsel(indsepar+1)-1]));
    1384     end
    1385     if isempty(d1)
     1383        d2=str2double(str_civ2(indsel(indsepar)+1:indsel(indsepar+1)-1));
     1384    end
     1385    if isnan(d1)
    13861386        num1_civ2=num_i;
    13871387    else
    13881388        num1_civ2=num_i-d1;% set of first image numbers
    13891389    end
    1390     if isempty(d2)
     1390    if isnan(d2)
    13911391        num2_civ2=num_i;
    13921392    else
     
    13971397   
    13981398    % adjust the first and last field number
    1399     lastfield=str2num(get(handles.nb_field,'String'));
     1399    lastfield=str2double(get(handles.nb_field,'String'));
    14001400    if isequal(lastfield,[])
    14011401        indsel=find((num1_civ1 >= 1)&(num1_civ2 >= 1));
     
    14151415    end
    14161416elseif isequal (mode,'series(Dj)')
    1417     lastfield_j=str2num(get(handles.nb_field2,'String'));
     1417    lastfield_j=str2double(get(handles.nb_field2,'String'));
    14181418    num1_civ1=num_i;% set of first image numbers
    14191419    num2_civ1=num_i;
     
    14251425    num_b_civ2=num_j+ceil(index_civ2/2)*ones(size(num_j));
    14261426    % adjust the first and last field number
    1427     if isequal(lastfield_j,[])
     1427    if isnan(lastfield_j)
    14281428        indsel=find((num_a_civ1 >= 1)&(num_a_civ2 >= 1));
    14291429    else
     
    14711471index_pair=get(handles.list_pair_civ1,'Value');
    14721472displ_num=get(handles.list_pair_civ1,'UserData');
    1473 num_a=displ_num(1,index_pair);
    1474 num_b=displ_num(2,index_pair);
     1473% num_a=displ_num(1,index_pair);
     1474% num_b=displ_num(2,index_pair);
    14751475list_pair2=get(handles.list_pair_civ2,'String');%get the menu of image pairs
    14761476if index_pair<=length(list_pair2)
     
    14831483mode=mode_list{mode_value};
    14841484if isequal(mode,'series(Di)')
    1485     first_i=str2num(get(handles.first_i,'String'));
    1486     last_i=str2num(get(handles.last_i,'String'));
    1487     incr_i=str2num(get(handles.incr_i,'String'));
     1485    first_i=str2double(get(handles.first_i,'String'));
     1486    last_i=str2double(get(handles.last_i,'String'));
     1487    incr_i=str2double(get(handles.incr_i,'String'));
    14881488    num1=first_i:incr_i:last_i;
    1489     lastfield=str2num(get(handles.nb_field,'String'));
    1490     if ~isequal(lastfield,[])
     1489    lastfield=str2double(get(handles.nb_field,'String'));
     1490    if ~isnan(lastfield)
    14911491        ind=find((num1-floor(index_pair/2)*ones(size(num1))>0)& ...
    14921492            (num1+ceil(index_pair/2)*ones(size(num1))<=lastfield));
     
    14961496    set(handles.last_i,'String',num2str(num1(end)));
    14971497elseif isequal(mode,'series(Dj)')
    1498     first_j=str2num(get(handles.first_j,'String'));
    1499     last_j=str2num(get(handles.last_j,'String'));
    1500     incr_j=str2num(get(handles.incr_j,'String'));
     1498    first_j=str2double(get(handles.first_j,'String'));
     1499    last_j=str2double(get(handles.last_j,'String'));
     1500    incr_j=str2double(get(handles.incr_j,'String'));
    15011501    num_j=first_j:incr_j:last_j;
    1502     lastfield2=str2num(get(handles.nb_field2,'String'));
    1503     if ~isequal(lastfield2,[])
     1502    lastfield2=str2double(get(handles.nb_field2,'String'));
     1503    if ~isnan(lastfield2)
    15041504        ind=find((num_j-floor(index_pair/2)*ones(size(num_j))>0)& ...
    15051505            (num_j+ceil(index_pair/2)*ones(size(num_j))<=lastfield2));
     
    15211521mode=mode_list{mode_value};
    15221522if isequal(mode,'series(Di)')
    1523     first_i=str2num(get(handles.first_i,'String'));
    1524     last_i=str2num(get(handles.last_i,'String'));
    1525     incr_i=str2num(get(handles.incr_i,'String'));
     1523    first_i=str2double(get(handles.first_i,'String'));
     1524    last_i=str2double(get(handles.last_i,'String'));
     1525    incr_i=str2double(get(handles.incr_i,'String'));
    15261526    num1=first_i:incr_i:last_i;
    1527     lastfield=str2num(get(handles.nb_field,'String'));
    1528     if ~isequal(lastfield,[])
     1527    lastfield=str2double(get(handles.nb_field,'String'));
     1528    if ~isnan(lastfield)
    15291529        ind=find((num1-floor(index_pair/2)*ones(size(num1))>0)& ...
    15301530            (num1+ceil(index_pair/2)*ones(size(num1))<=lastfield));
     
    15341534    set(handles.last_i,'String',num2str(num1(end)));
    15351535elseif isequal(mode,'series(Dj)')
    1536     first_j=str2num(get(handles.first_j,'String'));
    1537     last_j=str2num(get(handles.last_j,'String'));
    1538     incr_j=str2num(get(handles.incr_j,'String'));
     1536    first_j=str2double(get(handles.first_j,'String'));
     1537    last_j=str2double(get(handles.last_j,'String'));
     1538    incr_j=str2double(get(handles.incr_j,'String'));
    15391539    num_j=first_j:incr_j:last_j;
    1540     lastfield2=str2num(get(handles.nb_field2,'String'));
    1541     if ~isequal(lastfield2,[])
     1540    lastfield2=str2double(get(handles.nb_field2,'String'));
     1541    if ~isnan(lastfield2)
    15421542        ind=find((num_j-floor(index_pair/2)*ones(size(num_j))>0)& ...
    15431543            (num_j+ceil(index_pair/2)*ones(size(num_j))<=lastfield2));
     
    15961596end
    15971597
    1598 
    1599 
    16001598%check mask if selecetd
    16011599if isequal(get(handles.get_mask_civ1,'Value'),1)
     
    16241622end
    16251623
    1626 %% initialize the waitbars
     1624%% initialize the waitbars: TO suppress, waitbar not used
    16271625set(handles.waitbar_1,'Position',[0.946 0.876 0.03 0.001])
    16281626set(handles.waitbar_patch1,'Position',[0.946 0.439 0.03 0.001])
     
    16361634[filecell,num1_civ1,num2_civ1,num_a_civ1,num_b_civ1,num1_civ2,num2_civ2,num_a_civ2,num_b_civ2,nom_type_nc]=...
    16371635    set_civ_filenames(handles,compare,box_test);
    1638 if isempty(filecell)
     1636if isempty(filecell)% (error message displayed in fct set_civ_filenames)
    16391637    return
    16401638end
    1641 filecell
    1642 
    16431639nbfield=numel(num1_civ1);
    16441640nbslice=numel(num_a_civ1);
     
    18871883                else
    18881884                    maskbase=[filecell.filebase '_' maskdispl]; %
    1889                     nbslice_mask=str2num(maskdispl(1:end-4)); %
     1885                    nbslice_mask=str2double(maskdispl(1:end-4)); %
    18901886                    num1_mask=mod(num1_civ1(ifile)-1,nbslice_mask)+1;
    18911887                    par_civ1.maskname=name_generator(maskbase,num1_mask,1,'.png','_i');
     
    19041900                gridname=get(handles.grid_civ1,'String');
    19051901                if isequal(gridname(end-3:end),'grid')
    1906                     nbslice_grid=str2num(gridname(1:end-4)); %
    1907                     if ~isempty(nbslice_grid)
     1902                    nbslice_grid=str2double(gridname(1:end-4)); %
     1903                    if ~isnan(nbslice_grid)
    19081904                        num1_grid=mod(num1_civ1(ifile)-1,nbslice_grid)+1;
    19091905                        par_civ1.gridname=[filecell.filebase '_' name_generator(gridname,num1_grid,1,'.grid','_i')];
     
    19471943            else
    19481944                maskdispl=get(handles.mask_fix1,'String');
    1949                 nbslice_mask=str2num(maskdispl(1:end-4)); %
     1945                nbslice_mask=str2double(maskdispl(1:end-4)); %
    19501946                num1_mask=mod(num1_civ1(ifile)-1,nbslice_mask)+1;
    19511947                maskbase=[filecell.filebase '_' maskdispl];
     
    19941990                    gridname=get(handles.grid_patch1,'String');
    19951991                    if isequal(gridname(end-3:end),'grid')
    1996                         nbslice_grid=str2num(gridname(1:end-4)); %
    1997                         if ~isempty(nbslice_grid)
     1992                        nbslice_grid=str2double(gridname(1:end-4)); %
     1993                        if ~isnan(nbslice_grid)
    19981994                            num1_grid=mod(num1_civ1(ifile)-1,nbslice_grid)+1;
    19991995                            patch1.gridPatch=[filecell.filebase '_' name_generator(gridname,num1_grid,1,'.grid','_i')];
     
    20562052                else
    20572053                    maskbase=[filecell.filebase '_' maskdispl]; %
    2058                     nbslice_mask=str2num(maskdispl(1:end-4)); %
     2054                    nbslice_mask=str2double(maskdispl(1:end-4)); %
    20592055                    num1_mask=mod(num1_civ2(ifile)-1,nbslice_mask)+1;
    20602056                    par_civ2.maskname=name_generator(maskbase,num1_mask,1,'.png','_i');
     
    20682064            end
    20692065            %TESTgrid
    2070             test_grid=get(handles.browse_gridciv2,'Value');
     2066            %test_grid=get(handles.browse_gridciv2,'Value');
    20712067            gridname=get(handles.grid_civ2,'String');
    2072             gridflag='y';
     2068            %gridflag='y';
    20732069            if numel(gridname)>=4 && isequal(gridname(end-3:end),'grid')
    2074                 nbslice_grid=str2num(gridname(1:end-4)); %
    2075                 if ~isempty(nbslice_grid)
     2070                nbslice_grid=str2double(gridname(1:end-4)); %
     2071                if ~isnan(nbslice_grid)
    20762072                    par_civ2.gridflag='y';
    20772073                    num1_grid=mod(num1_civ2(ifile)-1,nbslice_grid)+1;
     
    21232119                maskdispl=get(handles.mask_fix2,'String');
    21242120                maskbase=[filecell.filebase '_' maskdispl]; %
    2125                 nbslice_mask=str2num(maskdispl(1:end-4)); %
     2121                nbslice_mask=str2double(maskdispl(1:end-4)); %
    21262122                num1_mask=mod(num1_civ2(ifile)-1,nbslice_mask)+1;
    21272123                maskname =name_generator(maskbase,num1_mask,1,'.png','_i');
     
    21692165                    gridname=get(handles.grid_patch2,'String');
    21702166                    if isequal(gridname(end-3:end),'grid')
    2171                         nbslice_grid=str2num(gridname(1:end-4)); %
    2172                         if ~isempty(nbslice_grid)
     2167                        nbslice_grid=str2double(gridname(1:end-4)); %
     2168                        if ~isnan(nbslice_grid)
    21732169                            num1_grid=mod(num1_civ2(ifile)-1,nbslice_grid)+1;
    21742170                            patch2.gridPatch=[filecell.filebase '_' name_generator(gridname,num1_grid,1,'.grid','_i')];
     
    22412237end
    22422238
    2243 
    2244 if ~batch%TODO: a revoir, cas 'run as background task'
     2239if ~batch
    22452240    [Rootbat,Filebat,extbat]=fileparts(filename_cmx);
    22462241    filename_superbat=fullfile(Rootbat,['job_list.bat']);
     
    22552250end
    22562251
    2257 
    2258 %save interface state
     2252%% save interface state
    22592253if isfield(filecell,'nc')
    22602254    if isfield(filecell.nc,'civ2')
     
    22942288end
    22952289
    2296 filebase=regexprep(filebase,'\.fsnet','fsnet');% temporary fix for cluster Coriolis
     2290%filebase=regexprep(filebase,'\.fsnet','fsnet');% temporary fix for cluster Coriolis
    22972291filecell.filebase=filebase;
    22982292
     
    23082302    mode=mode_list{mode_value};
    23092303end
    2310 time=get(handles.RootName,'UserData'); %get the set of times
     2304%time=get(handles.RootName,'UserData'); %get the set of times
    23112305ext_ima=get(handles.ImaExt,'String');
    23122306nom_type_nc=browse.nom_type_nc;
     
    23582352    ref=get(handles.ref_fix1,'UserData');%read data on the ref file stored by get_ref_fix1_Callback
    23592353    if ~isempty(ref)
    2360         first_i=str2num(get(handles.first_i,'String'));
    2361         last_i=str2num(get(handles.last_i,'String'));
    2362         incr_i=str2num(get(handles.incr_i,'String'));
    2363         first_j=str2num(get(handles.first_j,'String'));
    2364         last_j=str2num(get(handles.last_j,'String'));
    2365         incr_j=str2num(get(handles.incr_j,'String'));
     2354        first_i=str2double(get(handles.first_i,'String'));
     2355        last_i=str2double(get(handles.last_i,'String'));
     2356        incr_i=str2double(get(handles.incr_i,'String'));
     2357        first_j=str2double(get(handles.first_j,'String'));
     2358        last_j=str2double(get(handles.last_j,'String'));
     2359        incr_j=str2double(get(handles.incr_j,'String'));
    23662360        num_i_ref=first_i:incr_i:last_i;
    23672361        num_j_ref=first_j:incr_j:last_j;
     
    24852479    vers=0;
    24862480    subdir_civ1_new=subdir_civ1;
    2487     while detect==1 %create a new subdir if the netcdf files already exist
     2481    ind_test=0;
     2482    while detect==1 && ind_test<10%create a new subdir if the netcdf files already exist
    24882483        for ifile=1:nbfield
    24892484            for j=1:nbslice
     
    24912486                detect=exist(filename,'file')==2;
    24922487                if detect% if a netcdf file already exists
    2493                     indstr=regexp(subdir_civ1,'\D');
    2494                     if indstr(end)<length(subdir_civ1) %subdir_civ1 ends by a number
    2495                         vers=str2double(subdir_civ1(indstr(end)+1:end))+1;
    2496                         subdir_civ1_new=[subdir_civ1(1:indstr(end)) num2str(vers)];
     2488                    indstr=regexp(subdir_civ1_new,'\D');
     2489                    if indstr(end)<length(subdir_civ1_new) %subdir_civ1 ends by a number
     2490                        vers=str2double(subdir_civ1_new(indstr(end)+1:end))+1;
     2491                        subdir_civ1_new=[subdir_civ1_new(1:indstr(end)) num2str(vers)];
    24972492                    else
    24982493                        vers=vers+1;
    2499                         subdir_civ1_new=[subdir_civ1(1:indstr(end)) '_' num2str(vers)];       
     2494                        subdir_civ1_new=[subdir_civ1_new(1:indstr(end)) '_' num2str(vers)];       
    25002495                    end
    2501                     subdir_civ2=subdir_civ1;
     2496                    subdir_civ2=subdir_civ1_new;
    25022497                    break
    25032498                end
     
    25292524        end
    25302525        if strcmp(compare,'stereo PIV')&&(strcmp(mode,'pair j1-j2')||strcmp(mode,'series(Dj)')||strcmp(mode,'series(Di)'))%check second nc series
    2531 %             vers=0;
    2532 %             subdir_civ1_new=subdir_civ1;
    25332526            for ifile=1:nbfield
    25342527                for j=1:nbslice
     
    25362529                    detect=exist(filename,'file')==2;
    25372530                    if detect% if a netcdf file already exists
    2538                        indstr=regexp(subdir_civ1,'\D');
    2539                        if indstr(end)<length(subdir_civ1) %subdir_civ1 ends by a number
    2540                            vers=str2double(subdir_civ1(indstr(end)+1:end))+1;
    2541                            subdir_civ1_new=[subdir_civ1(1:indstr(end)) num2str(vers)];
     2531                       indstr=regexp(subdir_civ1_new,'\D');
     2532                       if indstr(end)<length(subdir_civ1_new) %subdir_civ1 ends by a number
     2533                           vers=str2double(subdir_civ1_new(indstr(end)+1:end))+1;
     2534                           subdir_civ1_new=[subdir_civ1_new(1:indstr(end)) num2str(vers)];
    25422535                       else
    25432536                           vers=vers+1;
    2544                            subdir_civ1_new=[subdir_civ1 '_' num2str(vers)];
     2537                           subdir_civ1_new=[subdir_civ1_new '_' num2str(vers)];
    25452538                       end
    25462539                       subdir_civ2=subdir_civ1;
     
    25532546                end
    25542547            end
    2555 %             subdir_civ1=subdir_civ1_new;
    25562548            %create the new subdir_civ1
    25572549            if exist(fullfile(Path_ima,subdir_civ1_new),'dir')
     
    30933085%------------------------------------------------------------------------
    30943086% last_i_Callback(hObject, eventdata, handles)
    3095 first_i=str2num(get(handles.first_i,'String'));
     3087first_i=str2double(get(handles.first_i,'String'));
    30963088% last_i=str2num(get(handles.last_i,'String'));
    30973089% ref_i=ceil((first_i+last_i)/2);
     
    31233115mode=mode_list{mode_value};
    31243116if isequal (mode, 'series(Di)' )
    3125     ref_i=str2num(get(handles.ref_i,'String'));
     3117    ref_i=str2double(get(handles.ref_i,'String'));
    31263118    num1=ref_i-floor(index/2);%  first image numbers
    31273119    num2=ref_i+ceil(index/2);
     
    31313123    num1=1;
    31323124    num2=1;
    3133     ref_j=str2num(get(handles.ref_j,'String'));
     3125    ref_j=str2double(get(handles.ref_j,'String'));
    31343126    num_a=ref_j-floor(index/2);%  first image numbers
    31353127    num_b=ref_j+ceil(index/2);
    31363128elseif isequal(mode,'pair j1-j2') %case of bursts (png_old or png_2D)
    3137     ref_i=str2num(get(handles.ref_i,'String'));
     3129    ref_i=str2double(get(handles.ref_i,'String'));
    31383130    num1=ref_i;
    31393131    num2=ref_i;
     
    31423134end
    31433135dt=time(num2,num_b)-time(num1,num_a);
    3144 ibx=str2num(get(handles.ibx,'String'));
    3145 iby=str2num(get(handles.iby,'String'));
    3146 umin=dt*pxcmx*str2num(get(handles.umin,'String'));
    3147 umax=dt*pxcmx*str2num(get(handles.umax,'String'));
    3148 vmin=dt*pxcmy*str2num(get(handles.vmin,'String'));
    3149 vmax=dt*pxcmy*str2num(get(handles.vmax,'String'));
     3136ibx=str2double(get(handles.ibx,'String'));
     3137iby=str2double(get(handles.iby,'String'));
     3138umin=dt*pxcmx*str2double(get(handles.umin,'String'));
     3139umax=dt*pxcmx*str2double(get(handles.umax,'String'));
     3140vmin=dt*pxcmy*str2double(get(handles.vmin,'String'));
     3141vmax=dt*pxcmy*str2double(get(handles.vmax,'String'));
    31503142shiftx=round((umin+umax)/2);
    31513143shifty=round((vmin+vmax)/2);
     
    33793371    ind_mask=findstr('mask',Name);
    33803372    i=ind_mask-1;
    3381     while val(i)==0 & i>0
     3373    while val(i)==0 && i>0
    33823374        i=i-1;
    33833375    end
    3384     nbslice=str2num(Name(i+1:ind_mask-1));
    3385     if ~isequal(nbslice,[]) & Name(i)=='_'
     3376    nbslice=str2double(Name(i+1:ind_mask-1));
     3377    if ~isnan(nbslice) && Name(i)=='_'
    33863378        flag_mask=1;
    33873379    else
     
    34113403    ind_mask=findstr('grid',Name);
    34123404    i=ind_mask-1;
    3413     while val(i)==0 & i>0
     3405    while val(i)==0 && i>0
    34143406        i=i-1;
    34153407    end
    3416     nbslice=str2num(Name(i+1:ind_mask-1));
    3417     if ~isequal(nbslice,[]) & Name(i)=='_'
     3408    nbslice=str2double(Name(i+1:ind_mask-1));
     3409    if ~isnan(nbslice) && Name(i)=='_'
    34183410        flag_mask=1;
    34193411    else
Note: See TracChangeset for help on using the changeset viewer.