Ignore:
Timestamp:
Jun 13, 2012, 5:04:14 PM (12 years ago)
Author:
sommeria
Message:

aver_stat, ima_levels , sub_background now adapted to the new settings
merge_proj, time_series still need to be modified

File:
1 edited

Legend:

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

    r451 r454  
    6363% get the set of input file names (cell array filecell), and the lists of
    6464% input file or frame indices i1_series,i2_series,j1_series,j2_series
     65
    6566[filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param);
     67
    6668% filecell{iview,fileindex}: cell array representing the list of file names
    6769%        iview: line in the table corresponding to a given file series
     
    7072% i1_series(iview,fileindex) expresses the same indices as a 1D array in file indices
    7173% set of frame indices used for movie or multimage input
    72 if ~isempty(j1_series)
    73     frame_index=j1_series;
    74 else
    75     frame_index=i1_series;
    76 end
     74
    7775
    7876%% root input file(s) and type
     
    8886    NbSlice=Param.IndexRange.NbSlice;
    8987end
    90 nbview=size(i1_series,1);%number of input file series (lines in InputTable)
    91 nbfield_j=size(i1_series,2); %nb of consecutive fields at each level(burst
    92 nbfield=nbfield_j*size(i1_series,3); %total number of files or frames
    93 nbfield_i=floor(nbfield/NbSlice);%total number of i indexes (adjusted to an integer number of slices)
    94 nbfield=nbfield_i*nbfield_j; %total number of fields after adjustement
     88nbview=numel(i1_series);%number of input file series (lines in InputTable)
     89nbfield_j=size(i1_series{1},1); %nb of consecutive fields for the j index (bursts or volume slices)
     90nbfield_i=size(i1_series{1},2); %nb of consecutive fields for the i index
     91nbfield=nbfield_j*nbfield_i; %total number of files or frames
     92nbfield_i=floor(nbfield/NbSlice);%total number of  indexes in a slice (adjusted to an integer number of slices)
     93nbfield=nbfield_i*NbSlice; %total number of fields after adjustement
    9594
    9695%determine the file type on each line from the first input file
     
    106105    CheckImage{iview}=~isempty(find(strcmp(FileType{iview},ImageTypeOptions)));% =1 for images
    107106    CheckNc{iview}=~isempty(find(strcmp(FileType{iview},NcTypeOptions)));% =1 for netcdf files
     107    if ~isempty(j1_series{iview})
     108        frame_index{iview}=j1_series{iview};
     109    else
     110        frame_index{iview}=i1_series{iview};
     111    end
    108112end
    109113
     
    178182    end   
    179183end
    180 if size(time,2) < i2_series(1,end) || size(time,3) < j2_series(1,end)% time array absent or too short in ImaDoc xml file'
     184if size(time,2) < i2_series{1}(end) || size(time,3) < j2_series{1}(end)% time array absent or too short in ImaDoc xml file'
    181185    time=[];
    182186end
     
    279283       
    280284        %%%%%%%%%%%%%%%% loop on views (input lines) %%%%%%%%%%%%%%%%
     285        index
    281286        for iview=1:nbview
    282287            % reading input file(s)
    283             [Data{iview},ParamOut,errormsg] = read_field(filecell{iview,index},FileType{iview},InputFields{iview},frame_index(iview,index));
     288            [Data{iview},ParamOut,errormsg] = read_field(filecell{iview,index},FileType{iview},InputFields{iview},frame_index{iview}(index));
    284289            if ~isempty(errormsg)
    285290                errormsg=['error of input reading: ' errormsg];
     
    287292            end
    288293            if ~isempty(NbSlice_calib)
    289                 Data{iview}.ZIndex=mod(i1_series(iview,index)-1,NbSlice_calib{1})+1;%Zindex for phys transform
     294                Data{iview}.ZIndex=mod(i1_series{iview}(index)-1,NbSlice_calib{iview})+1;%Zindex for phys transform
    290295            end
    291296        end
     
    373378        end
    374379    else  % time from ImaDoc prevails
    375         DataOut.Time=time(1,i1_series(1,1),j1_series(1,1));
    376         DataOut.Time_end=time(end,i1_series(end,end),j1_series(end,end));
     380        DataOut.Time=time(1,i1_series{1}(1),j1_series{1}(1));
     381        DataOut.Time_end=time(end,i1_series{end}(end),j1_series{end}(end));
    377382    end
    378383   
    379384    %writing the result file
    380     OutputFile=fullfile_uvmat(RootPath{1},Param.OutputSubDir,RootFile{1},FileExtOut,NomTypeOut,i1_series(1,1),i1_series(1,end),i_slice,[]);
     385    OutputFile=fullfile_uvmat(RootPath{1},Param.OutputSubDir,RootFile{1},FileExtOut,NomTypeOut,i1_series{1}(1),i1_series{1}(end),i_slice,[]);
    381386    if CheckImage{1} %case of images
    382387        if isequal(FileInfo{1}.BitDepth,16)||(numel(FileInfo)==2 &&isequal(FileInfo{2}.BitDepth,16))
Note: See TracChangeset for help on using the changeset viewer.