Changeset 676


Ignore:
Timestamp:
Aug 27, 2013, 11:25:59 PM (8 years ago)
Author:
sommeria
Message:

various bugs corrected

Location:
trunk/src/series
Files:
4 edited

Legend:

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

    r668 r676  
    546546        Data.Civ2_ImageA=ImageName_A;
    547547        Data.Civ2_ImageB=ImageName_B;
    548         Data.Civ2_Time=1;
    549         Data.Civ2_Dt=1;
     548        i1=i1_series_Civ2(ifield);
     549        i2=i1;
     550        if ~isempty(i2_series_Civ2)
     551            i2=i2_series_Civ2(ifield);
     552        end
     553        j1=1;
     554        if ~isempty(j1_series_Civ2)
     555            j1=j1_series_Civ2(ifield);
     556        end
     557        j2=j1;
     558        if ~isempty(j2_series_Civ1)
     559            j2=j2_series_Civ2(ifield);
     560        end
     561        Data.Civ2_Time=(time(i2+1,j2+1)+time(i1+1,j1+1))/2;
     562        Data.Civ2_Dt=time(i2+1,j2+1)-time(i1+1,j1+1);
     563%         Data.Civ2_Time=1;
     564%         Data.Civ2_Dt=1;
    550565        for ilist=1:length(list_param)
    551566            Data.(Civ2_param{4+ilist})=Param.ActionInput.Civ2.(list_param{ilist});
  • trunk/src/series/merge_proj.m

    r673 r676  
    129129    diff_time=max(max(diff(time)));
    130130    if diff_time>0
    131         disp_uvmat('WARNING',['times of series differ by (max) ' num2str(diff_time) ': time of first series chosen in result'],checkrun)
     131        disp_uvmat('WARNING',['times of series differ by (max) ' num2str(diff_time) ': the mean time is chosen in result'],checkrun)
    132132    end   
    133133end
     134if ~isempty(errormsg)
     135    disp_uvmat('WARNING',erromsg,checkrun)
     136end
     137time=mean(time,1); %averaged time taken for the merged field
    134138
    135139%% coordinate transform or other user defined transform
     
    174178MaskData=cell(NbView,1);
    175179if Param.CheckMask
     180    if ischar(Param.MaskTable)% case of a single mask (char chain)
     181        Param.MaskTable={Param.MaskTable};
     182    end
    176183    for iview=1:numel(Param.MaskTable)
    177184        if exist(Param.MaskTable{iview},'file')
     
    204211    %%%%%%%%%%%%%%%% loop on views (input lines) %%%%%%%%%%%%%%%%
    205212    Data=cell(1,NbView);%initiate the set Data
    206     nbtime=0;
     213    timeread=zeros(1,NbView);
    207214    for iview=1:NbView
    208215        %% reading input file(s)
     
    212219            return
    213220        end
    214         timeread(iview)=0;
    215         if isfield(Data{iview},'Time')
     221        % get the time defined in the current file if not already defined from the xml file
     222        if ~isempty(time) && isfield(Data{iview},'Time')
    216223            timeread(iview)=Data{iview}.Time;
    217             nbtime=nbtime+1;
    218224        end
    219225        if ~isempty(NbSlice_calib)
     
    258264
    259265    %% time of the merged field: take the average of the different views
    260     if ~isempty(time)% time defined from ImaDoc
    261         timeread=time(:,index);
    262     end
    263     timeread=mean(timeread);
     266    if ~isempty(time)
     267        timeread=time(index);   
     268    elseif ~isempty(find(timeread))% time defined from ImaDoc
     269        timeread=mean(timeread(timeread~=0));% take average over times form the files (when defined)
     270    else
     271        timeread=index;% take time=file index
     272    end
    264273
    265274    %% generating the name of the merged field
     
    320329       
    321330    else
    322         MergeData.ListGlobalAttribute={'Conventions','Project','InputFile_1','InputFile_end','nb_coord','nb_dim','dt','Time','civ'};
     331        MergeData.ListGlobalAttribute={'Conventions','Project','InputFile_1','InputFile_end','nb_coord','nb_dim'};
    323332        MergeData.Conventions='uvmat';
    324333        MergeData.nb_coord=2;
     
    333342            end
    334343        end
    335         if isempty(dt)
    336             MergeData.ListGlobalAttribute(6)=[];
    337         else
     344        if ~isempty(timeread)
     345            MergeData.ListGlobalAttribute=[MergeData.ListGlobalAttribute {'Time'}];
     346            MergeData.Time=timeread;
     347        end
     348        if ~isempty(dt)
     349            MergeData.ListGlobalAttribute=[MergeData.ListGlobalAttribute {'dt'}];
    338350            MergeData.dt=dt;
    339351        end
    340         MergeData.Time=timeread;
    341352        error=struct2nc(OutputFile,MergeData);%save result file
    342353        if isempty(error)
     
    381392            case 'grid'        %case of fields defined on a structured  grid
    382393                FFName='';
    383                 if ~isempty(CellInfo{icell}.VarIndex_errorflag)
     394                if isfield(CellInfo{icell},'VarIndex_errorflag') && ~isempty(CellInfo{icell}.VarIndex_errorflag)
    384395                    FFName=Data{1}.ListVarName{CellInfo{icell}.VarIndex_errorflag};% name of errorflag variable
    385396                end
  • trunk/src/series/sub_background.m

    r642 r676  
    5353function ParamOut=sub_background (Param)
    5454
    55 %% input preparation mode (no RUN)
     55%%%%%%%%%%%%%%%%%    INPUT PREPARATION MODE (no RUN)    %%%%%%%%%%%%%%%%%
    5656if isstruct(Param) && isequal(Param.Action.RUN,0)
    5757    ParamOut.AllowInputSort='off';% allow alphabetic sorting of the list of input file SubDir (options 'off'/'on', 'off' by default)
     
    6565    ParamOut.OutputDirExt='.sback';%set the output dir extension
    6666    ParamOut.OutputFileMode='NbInput';% '=NbInput': 1 output file per input file index, '=NbInput_i': 1 file per input file index i, '=NbSlice': 1 file per slice
    67     filecell=get_file_series(Param);%check existence of the first input file
    68     %%%%%%%%%%%% STANDARD PART (DO NOT EDIT) %%%%%%%%%%%%
    6967   
    7068    %% root input file(s) and type
     
    7472        return
    7573    end
    76     %%%%%%%%%%%%
    77     % The cell array filecell is the list of input file names, while
    78     % filecell{iview,fileindex}:
    79     %        iview: line in the table corresponding to a given file series
    80     %        fileindex: file index within  the file series,
    81     % i1_series(iview,ref_j,ref_i)... are the corresponding arrays of indices i1,i2,j1,j2, depending on the input line iview and the two reference indices ref_i,ref_j
    82     % i1_series(iview,fileindex) expresses the same indices as a 1D array in file indices
    83     %%%%%%%%%%%%
    84     NbSlice=1;%default
    85     if isfield(Param.IndexRange,'NbSlice')&&~isempty(Param.IndexRange.NbSlice)
    86         NbSlice=Param.IndexRange.NbSlice;
    87     end
    88     nbview=numel(i1_series);%number of input file series (lines in InputTable)
    89     nbfield_j=size(i1_series{1},1); %nb of fields for the j index (bursts or volume slices)
    90     nbfield_i=size(i1_series{1},2); %nb of fields for the i index
    91     nbfield=nbfield_j*nbfield_i; %total number of fields
    92     nbfield_i=floor(nbfield/NbSlice);%total number of  indexes in a slice (adjusted to an integer number of slices)
    93     nbfield=nbfield_i*NbSlice; %total number of fields after adjustement
    94    
    95     %determine the file type on each line from the first input file
    96 
    97    
    98     %% calibration data and timing: read the ImaDoc files
    99     %not relevant here
    100    
    101     %% check coincidence in time for several input file series
    102     %not relevant here
    103    
    104     %% coordinate transform or other user defined transform
    105     %not relevant here
    106    
    107     %%%%%%%%%%%% END STANDARD PART  %%%%%%%%%%%%
    108     % EDIT FROM HERE
    10974   
    11075    %% check the validity of  input file types
     
    11782    end
    11883   
    119     %% Set field names and velocity types
    120     %not relevant here
    121    
    122     %% Initiate output fields
    123     %not relevant here
    124    
    125     %%% SPECIFIC PART BEGINS HERE
    126     NbSlice=1;
    127     if isfield(Param.IndexRange,'NbSlice')
    128         NbSlice=Param.IndexRange.NbSlice; %number of slices
    129     end
    130     %siz=size(i1_series);
    131     nbaver_init=23;%approximate number of images used for the sliding background: to be adjusted later to include an integer number of bursts
    132     j1=[];%default
    133    
    134     %% adjust the proposed number of images in the sliding average to include an integer number of bursts
     84    %% numbers of fields
     85    NbSlice=1;%default
     86    if isfield(Param.IndexRange,'NbSlice')&&~isempty(Param.IndexRange.NbSlice)
     87        NbSlice=Param.IndexRange.NbSlice;
     88    end
     89    %nbview=numel(i1_series);%number of input file series (lines in InputTable)
     90    nbfield_j=size(i1_series{1},1); %nb of fields for the j index (bursts or volume slices)
     91    nbfield_i=size(i1_series{1},2); %nb of fields for the i index
     92    nbfield=nbfield_j*nbfield_i; %total number of fields
     93    nbfield_i=floor(nbfield/NbSlice);%total number of  indexes in a slice (adjusted to an integer number of slices)
     94   
     95    %% setting of  parameters specific to sub_background
     96    nbaver_init=23; %default number of images used for the sliding background: to be adjusted later to include an integer number of bursts 
    13597    if nbfield_i~=1
    13698        nbaver=floor(nbaver_init/nbfield_j); % number of bursts used for the sliding background,
     
    141103    end
    142104   
    143     %% input of specific parameters
    144     %if checkrun %get specific parameters interactively
    145     if isequal(Param.Action.RUN,0)
    146         prompt = {'volume scan mode (Yes/No)';'Number of images for the sliding background (MUST FIT IN COMPUTER MEMORY)';...
    147             'the luminosity rank chosen to define the background (0.1=for dense particle seeding, 0.5 (median) for sparse particles'};
    148         dlg_title = 'get (slice by slice) a sliding background and substract to each image';
    149         num_lines= 3;
    150         def     = { 'No';num2str(nbaver_init);'0.1'};
    151         answer = inputdlg(prompt,dlg_title,num_lines,def);
    152        
    153         %check input consistency
    154         if strcmp(answer{1},'No') && ~isequal(NbSlice,1)
    155             check=msgbox_uvmat('INPUT_Y-N',['confirm the multi-level splitting into ' num2str(NbSlice) ' slices']);
    156             if ~strcmp(check,'Yes')
    157                 return
    158             end
    159         end
    160         if strcmp(answer{1},'Yes')
    161             step=1;
    162         else
    163             step=nbfield_j;%case of bursts: the sliding background is shifted by the length of one burst
    164         end
    165         nbaver_ima=str2num(answer{2});%number of images for the sliding background
    166         nbaver=ceil(nbaver_ima/step);%number of bursts for the sliding background
    167         if isequal(floor(nbaver/2),nbaver)
    168             nbaver=nbaver+1;%set the number of bursts to an odd number (so the middle burst is defined)
    169         end
    170         nbaver_ima=nbaver*step;
    171     end
     105    prompt = {'volume scan mode (Yes/No)';'Number of images for the sliding background (MUST FIT IN COMPUTER MEMORY)';...
     106        'the luminosity rank chosen to define the background (0.1=for dense particle seeding, 0.5 (median) for sparse particles'};
     107    dlg_title = 'get (slice by slice) a sliding background and substract to each image';
     108    num_lines= 3;
     109    def     = { 'No';num2str(nbaver_init);'0.1'};
     110    answer = inputdlg(prompt,dlg_title,num_lines,def);
     111   
     112    %check input consistency
     113    if strcmp(answer{1},'No') && ~isequal(NbSlice,1)
     114        check=msgbox_uvmat('INPUT_Y-N',['confirm the multi-level splitting into ' num2str(NbSlice) ' slices']);
     115        if ~strcmp(check,'Yes')
     116            return
     117        end
     118    end
     119    if strcmp(answer{1},'Yes')
     120        step=1;
     121    else
     122        step=nbfield_j;%case of bursts: the sliding background is shifted by the length of one burst
     123    end
     124    nbaver_ima=str2num(answer{2});%number of images for the sliding background
     125    nbaver=ceil(nbaver_ima/step);%number of bursts for the sliding background
     126    if isequal(floor(nbaver/2),nbaver)
     127        nbaver=nbaver+1;%set the number of bursts to an odd number (so the middle burst is defined)
     128    end
     129    nbaver_ima=nbaver*step;% correct the nbre of images corresponding to nbaver
    172130    ParamOut.ActionInput.CheckVolume=strcmp(answer{1},'Yes');
    173131    ParamOut.ActionInput.SlidingSequenceLength=nbaver_ima;
     
    179137    return
    180138end
    181 %%%%%%%%%%%%%%%%%%%%%%  STOP HERE FOR PAMETER INPUT MODE  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     139%%%%%%%%%%%%%%%%%    STOP HERE FOR PAMETER INPUT MODE   %%%%%%%%%%%%%%%%%
    182140
    183141%% read input parameters from an xml file if input is a file name (batch mode)
     
    190148RUNHandle=findobj(hseries,'Tag','RUN');%handle of RUN button in GUI series
    191149WaitbarHandle=findobj(hseries,'Tag','Waitbar');%handle of waitbar in GUI series
    192 %% Input preparation
     150
     151%% input preparation
    193152nbaver_ima=Param.ActionInput.SlidingSequenceLength;
    194153NbSlice=Param.IndexRange.NbSlice;
     
    202161FileExt=Param.InputTable(:,5);
    203162[filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param);
     163%%%%%%%%%%%%
     164    % The cell array filecell is the list of input file names, while
     165    % filecell{iview,fileindex}:
     166    %        iview: line in the table corresponding to a given file series
     167    %        fileindex: file index within  the file series,
     168    % i1_series(iview,ref_j,ref_i)... are the corresponding arrays of indices i1,i2,j1,j2, depending on the input line iview and the two reference indices ref_i,ref_j
     169    % i1_series(iview,fileindex) expresses the same indices as a 1D array in file indices
     170%%%%%%%%%%%%
    204171[FileType{1},FileInfo{1},MovieObject{1}]=get_file_type(filecell{1,1});
    205172    if ~isempty(j1_series{1})
     
    214181nbfield=nbfield_i*NbSlice; %total number of fields after adjustement
    215182
    216 %% Output
     183%% output
    217184FileExtOut='.png'; % write result as .png images for image inputs
    218185if strcmp(lower(NomType{1}(end)),'a')
     
    264231end
    265232
    266 %% update the xml file
    267 % SubDirBase=regexprep(Param.InputTable{1,2},'\..*','');%take the root part of SubDir, before the first dot '.'
    268 % filexml=fullfile(RootPath{1},[SubDirBase '.xml']);
    269 % if ~exist(filexml,'file') && exist([fullfile(RootPath{1},SubDir{1},RootFile{1}) '.xml'],'file')% xml inside the image directory
    270 %     copyfile([filebase '.xml'],filexml);% copy the .xml file
    271 % end
    272 % if exist(filexml,'file')
    273 %     t=xmltree(filexml); 
    274 %     %update information on the first image name in the series
    275 %     uid_Heading=find(t,'ImaDoc/Heading');
    276 %     if isempty(uid_Heading)
    277 %         [t,uid_Heading]=add(t,1,'element','Heading');
    278 %     end
    279 %     uid_ImageName=find(t,'ImaDoc/Heading/ImageName');
    280 %     if ~isempty(j1_series{1})
    281 %         j1=j1_series{1}(1);
    282 %     end
    283 %     ImageName=fullfile_uvmat([dir_images term],'',RootFile{1},'.png',NomType,i1_series(1,1),[],j1);
    284 %     [pth,ImageName]=fileparts(ImageName);
    285 %     ImageName=[ImageName '.png'];
    286 %     if isempty(uid_ImageName)
    287 %         [t,uid_ImageName]=add(t,uid_Heading,'element','ImageName');
    288 %     end
    289 %     uid_value=children(t,uid_ImageName);
    290 %     if isempty(uid_value)
    291 %         t=add(t,uid_ImageName,'chardata',ImageName);%indicate  name of the first image, with ;png extension
    292 %     else
    293 %         t=set(t,uid_value(1),'value',ImageName);%indicate  name of the first image, with ;png extension
    294 %     end
    295 %     
    296 %     %add information about image transform
    297 %     [t,new_uid]=add(t,1,'element','ImageTransform');
    298 %     [t,NameFunction_uid]=add(t,new_uid,'element','NameFunction');
    299 %     [t]=add(t,NameFunction_uid,'chardata','sub_background');
    300 %     if GUI_config.CheckLevel
    301 %         [t,NameFunction_uid]=add(t,new_uid,'element','NameFunction');
    302 %         [t]=add(t,NameFunction_uid,'chardata','levels');
    303 %     end
    304 %     [t,NbSlice_uid]=add(t,new_uid,'element','NbSlice');
    305 %     [t]=add(t,new_uid,'chardata',num2str(NbSlice));
    306 %     [t,NbSlidingImages_uid]=add(t,new_uid,'element','NbSlidingImages');
    307 %     [t]=add(t,NbSlidingImages_uid,'chardata',num2str(nbaver));
    308 %     [t,LuminosityRank_uid]=add(t,new_uid,'element','RankBackground');
    309 %     [t]=add(t,LuminosityRank_uid,'chardata',num2str(rank));% luminosity rank almong the nbaver sliding images
    310 %     save(t,filexml)
    311 % end
    312 %copy the mask
    313 % if exist([filebase '_1mask_1'],'file')
    314 %     copyfile([filebase '_1mask_1'],[filebase_b '_1mask_1']);% copy the mask file
    315 % end
    316 
    317 %MAIN LOOP ON SLICES
    318 % for islice=1:NbSlice
    319 %% select the series of image indices
     233%% summary of the parameters:
     234% nbfield : total number of images treated (in case of multislices the function sub_background is repeated for each slice)
     235% step: shift at each step of the sliding background (corresponding to the nbre of images in a burst)
     236% nbaver_ima: length of the sequence used for the sliding background
     237
     238% nbaver=nbaver_ima/step: nbaver_ima has been adjusted so that nbaver is an odd integer
     239halfnbaver=floor(nbaver/2); % half width (in unit of bursts) of the sliding background
     240
     241%% select the series of image indices to process
    320242indselect=1:step:nbfield;% select file indices of the slice
    321243for ifield=1:step-1
     
    335257Asort=sort(Ak,3);%sort the luminosity of images at each point
    336258B=Asort(:,:,rank);%background image
     259
     260%% substract the first background image to the first images
    337261display( 'first background image will be substracted')
    338 nbfirst=(ceil(nbaver/2))*step;
    339 for ifield=1:nbfirst
     262for ifield=1:step*(halfnbaver+1);% nbre of images treated by the first background image
    340263    Acor=double(Ak(:,:,ifield))-double(B);%substract background to the current image
    341264    Acor=(Acor>0).*Acor; % put to 0 the negative elements in Acor
     
    365288display('sliding background image will be substracted')
    366289if nbfield_i > nbaver_ima
    367     for ifield = step*ceil(nbaver/2)+1:step:nbfield_i-step*floor(nbaver/2)
    368                 update_waitbar(WaitbarHandle,ifield/nbfield_i)
    369     if ~isempty(RUNHandle) &&ishandle(RUNHandle) && ~strcmp(get(RUNHandle,'BusyAction'),'queue')
    370         disp('program stopped by user')
    371         return
    372     end
    373 %         if isequal(stopstate,'queue')% enable STOP command
    374             Ak(:,:,1:nbaver_ima-step)=Ak(:,:,1+step:nbaver_ima);% shift the current image series by one burst (step)
    375             %incorporate next burst in the current image series
    376             for iburst=1:step
    377                 ifile=indselect(ifield+step*floor(nbaver/2)+iburst-1);
    378                 filename=fullfile_uvmat(RootPath{1},SubDir{1},RootFile{1},FileExt{1},NomType{1},i1_series{1}(ifile),[],j1_series{1}(ifile));
    379                 Aread=read_image(filename,FileType{1},MovieObject{1},i1_series{1}(ifile));
    380                 if ndims(Aread)==3;%color images
    381                     Aread=sum(double(Aread),3);% take the sum of color components
     290    for ifield = step*(halfnbaver+1):step:nbfield_i-step*(halfnbaver+1)% ifield +iburst=index of the current processed image
     291        update_waitbar(WaitbarHandle,ifield/nbfield_i)
     292        if ~isempty(RUNHandle) &&ishandle(RUNHandle) && ~strcmp(get(RUNHandle,'BusyAction'),'queue')
     293            disp('program stopped by user')
     294            return
     295        end
     296        Ak(:,:,1:nbaver_ima-step)=Ak(:,:,1+step:nbaver_ima);% shift the current image series by one burst (step)
     297        %incorporate next burst in the current image series
     298        for iburst=1:step
     299            ifile=indselect(ifield+iburst+step*halfnbaver);
     300            filename=fullfile_uvmat(RootPath{1},SubDir{1},RootFile{1},FileExt{1},NomType{1},i1_series{1}(ifile),[],j1_series{1}(ifile));
     301            Aread=read_image(filename,FileType{1},MovieObject{1},i1_series{1}(ifile));
     302            if ndims(Aread)==3;%color images
     303                Aread=sum(double(Aread),3);% take the sum of color components
     304            end
     305            Ak(:,:,nbaver_ima-step+iburst)=Aread;% fill the last burst of the current image series by the new image
     306        end
     307        Asort=sort(Ak,3);%sort the new current image series by luminosity
     308        B=Asort(:,:,rank);%current background image
     309        %substract the background for the current burst
     310        for iburst=1:step
     311            Acor=double(Ak(:,:,step*halfnbaver+iburst))-double(B); %the current image has been already read ans stored as index step*halfnbaver+iburst in the current series
     312            Acor=(Acor>0).*Acor; % put to 0 the negative elements in Acor
     313            ifile=indselect(ifield+iburst);
     314            if ~isempty(j1_series{1})
     315                j1=j1_series{1}(ifile);
     316            end
     317            newname=fullfile_uvmat(RootPath{1},OutputDir,RootFile{1},FileExtOut,NomTypeOut,i1_series{1}(ifile),[],j1);
     318            %write result file
     319            if Param.ActionInput.CheckLevelTransform
     320                C=levels(Acor);
     321                imwrite(C,newname,'BitDepth',8); % save the new image
     322            else
     323                if isequal(FileInfo{1}.BitDepth,16)
     324                    C=uint16(Acor);
     325                    imwrite(C,newname,'BitDepth',16); % save the new image
     326                else
     327                    C=uint8(Acor);
     328                    imwrite(C,newname,'BitDepth',8); % save the new image
    382329                end
    383                 Ak(:,:,nbaver_ima-step+iburst)=Aread;
    384330            end
    385             Asort=sort(Ak,3);%sort the new current image series by luminosity
    386             B=Asort(:,:,rank);%current background image
    387             for iburst=1:step
    388                 index=step*floor(nbaver/2)+iburst;
    389                 Acor=double(Ak(:,:,index))-double(B);
    390                 Acor=(Acor>0).*Acor; % put to 0 the negative elements in Acor
    391                 ifile=indselect(ifield+iburst-1);
    392                 if ~isempty(j1_series{1})
    393                     j1=j1_series{1}(ifile);
    394                 end
    395                 newname=fullfile_uvmat(RootPath{1},OutputDir,RootFile{1},FileExtOut,NomTypeOut,i1_series{1}(ifile),[],j1);
    396                 %write result file
    397                 if Param.ActionInput.CheckLevelTransform
    398                     C=levels(Acor);
    399                     imwrite(C,newname,'BitDepth',8); % save the new image
    400                 else
    401                     if isequal(FileInfo{1}.BitDepth,16)
    402                         C=uint16(Acor);
    403                         imwrite(C,newname,'BitDepth',16); % save the new image
    404                     else
    405                         C=uint8(Acor);
    406                         imwrite(C,newname,'BitDepth',8); % save the new image
    407                     end
    408                 end
    409                 display([newname ' written'])
    410                
    411             end
    412 %         else
    413 %             return
    414 %         end
     331            display([newname ' written'])       
     332        end
    415333    end
    416334end
     
    418336%% substract the background from the last images
    419337display('last background image will be substracted')
    420 ifield=nbfield_i-(step*ceil(nbaver/2))+1:nbfield_i;
    421 for ifield=nbfield_i-(step*floor(nbaver/2))+1:nbfield_i
    422     index=ifield-nbfield_i+step*(2*floor(nbaver/2)+1);
    423     Acor=double(Ak(:,:,index))-double(B);
     338for  ifield=nbfield_i-step*halfnbaver+1:nbfield_i
     339    Acor=double(Ak(:,:,ifield-nbfield_i+step*(2*halfnbaver+1)))-double(B);
    424340    Acor=(Acor>0).*Acor; % put to 0 the negative elements in Acor
    425341    ifile=indselect(ifield);
     
    427343        j1=j1_series{1}(ifile);
    428344    end
    429     newname=fullfile_uvmat(RootPath{1},OutputDir,RootFile{1},FileExtOut,NomTypeOut,i1_series{1}(ifile),[],j1);
    430    
     345    newname=fullfile_uvmat(RootPath{1},OutputDir,RootFile{1},FileExtOut,NomTypeOut,i1_series{1}(ifile),[],j1); 
    431346    %write result file
    432347    if Param.ActionInput.CheckLevelTransform
  • trunk/src/series/time_series.m

    r668 r676  
    214214%%%%%%%%%%%%%%%% loop on field indices %%%%%%%%%%%%%%%%
    215215for index=1:nbfield
     216    index
    216217            update_waitbar(WaitbarHandle,index/nbfield)
    217218    if ~isempty(RUNHandle) && ~strcmp(get(RUNHandle,'BusyAction'),'queue')
Note: See TracChangeset for help on using the changeset viewer.