Ignore:
Timestamp:
Apr 1, 2016, 7:22:25 PM (5 years ago)
Author:
sommeria
Message:

group writing access set for result files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series/merge_proj.m

    r937 r938  
    252252    %%%%%%%%%%%%%%%% loop on field indices %%%%%%%%%%%%%%%%
    253253tstart=tic; %used to record the computing time
     254CheckOverwrite=1;%default
     255if isfield(Param,'CheckOverwrite')
     256    CheckOverwrite=Param.CheckOverwrite;
     257end
    254258for index=1:NbField
    255259        update_waitbar(WaitbarHandle,index/NbField)
     
    258262        return
    259263    end
     264   
     265     %% generating the name of the merged field
     266    i1=i1_series{1}(index);
     267    if ~isempty(i2_series{end})
     268        i2=i2_series{end}(index);
     269    else
     270        i2=i1;
     271    end
     272    j1=1;
     273    j2=1;
     274    if ~isempty(j1_series{1})
     275        j1=j1_series{1}(index);
     276        if ~isempty(j2_series{end})
     277            j2=j2_series{end}(index);
     278        else
     279            j2=j1;
     280        end
     281    end
     282    OutputFile=fullfile_uvmat(RootPath{1},OutputDir,RootFileOut,FileExtOut,NomTypeOut,i1,i2,j1,j2);
     283    if ~CheckOverwrite && exist(OutputFile,'file')
     284            disp(['existing output file ' OutputFile ' already exists, skip to next field'])
     285            continue% skip iteration if the mode overwrite is desactivated and the result file already exists
     286    end
     287       
    260288    %%%%%%%%%%%%%%%% loop on views (input lines) %%%%%%%%%%%%%%%%
    261289    Data=cell(1,NbView);%initiate the set Data
     
    268296            return
    269297        end
     298       
    270299        ListVar=Data{iview}.ListVarName;
    271300        for ilist=1:numel(ListVar)
     
    325354    end
    326355
    327     %% generating the name of the merged field
    328     i1=i1_series{1}(index);
    329     if ~isempty(i2_series{end})
    330         i2=i2_series{end}(index);
    331     else
    332         i2=i1;
    333     end
    334     j1=1;
    335     j2=1;
    336     if ~isempty(j1_series{1})
    337         j1=j1_series{1}(index);
    338         if ~isempty(j2_series{end})
    339             j2=j2_series{end}(index);
    340         else
    341             j2=j1;
    342         end
    343     end
    344     OutputFile=fullfile_uvmat(RootPath{1},OutputDir,RootFileOut,FileExtOut,NomTypeOut,i1,i2,j1,j2);
    345 
     356 
    346357    %% recording the merged field
    347358    if strcmp(FileExtOut,'.png')    %output as image
Note: See TracChangeset for help on using the changeset viewer.