Ignore:
Timestamp:
Jun 26, 2012, 8:41:27 AM (12 years ago)
Author:
sommeria
Message:

series fcts updated to fit with new waitbar fct and background run mode, and various bug repairs

File:
1 edited

Legend:

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

    r470 r478  
    4949end
    5050
    51 %% get input parameters, file names and indices
     51%%%%%%%%%%%%  STANDARD PART  %%%%%%%%%%%%
     52%% select different modes,  RUN, parameter input, BATCH
    5253% BATCH  case: read the xml file for batch case
     54if ischar(Param)
     55        Param=xml2struct(Param);
     56        checkrun=0;
     57% RUN case: parameters introduced as the input structure Param
     58else
     59    if isfield(Param,'Specific')&& strcmp(Param.Specific,'?')
     60        checkrun=1;% will only search interactive input parameters (preparation of BATCH mode)
     61    else
     62        checkrun=2; % indicate the RUN option is used
     63    end
     64    hseries=guidata(Param.hseries);%handles of the GUI series
     65end
    5366ParamOut=Param; %default output
    54 if ischar(Param) && ~isempty(find(regexp('Param','.xml$')))
    55     Param=xml2struct(Param);
    56     checkrun=0;
    57 % RUN case: parameters introduced as the input structure Param 
    58 else
    59     hseries=guidata(Param.hseries);%handles of the GUI series
    60     WaitbarPos=get(hseries.waitbar_frame,'Position');%position of the waitbar on the GUI series
    61     checkrun=1; % indicate the RUN option is used
    62 end
    63 % get the set of input file names (cell array filecell), and the lists of
    64 % input file or frame indices i1_series,i2_series,j1_series,j2_series
    65 [filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param);
    66 % filecell{iview,fileindex}: cell array representing the list of file names
    67 %        iview: line in the table corresponding to a given file series
    68 %        fileindex: file index within  the file series,
    69 % 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
    70 % i1_series(iview,fileindex) expresses the same indices as a 1D array in file indices
    71 % 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
    77 
     67%OutputDir=[Param.OutputSubDir Param.OutputDirExt];NO OUTPUT FILE
     68   
    7869%% root input file(s) and type
    7970RootPath=Param.InputTable(:,1);
     
    8273NomType=Param.InputTable(:,4);
    8374FileExt=Param.InputTable(:,5);
    84 
    85 % numbers of slices and file indices
     75[filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param);
     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%%%%%%%%%%%%
    8684NbSlice=1;%default
    87 if isfield(Param.IndexRange,'NbSlice')
     85if isfield(Param.IndexRange,'NbSlice')&&~isempty(Param.IndexRange.NbSlice)
    8886    NbSlice=Param.IndexRange.NbSlice;
    8987end
    9088nbview=numel(i1_series);%number of input file series (lines in InputTable)
    91 nbfield_j=size(i1_series{1},1); %nb of consecutive fields at each level(burst
    92 nbfield=nbfield_j*size(i1_series{1},2); %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
     89nbfield_j=size(i1_series{1},1); %nb of fields for the j index (bursts or volume slices)
     90nbfield_i=size(i1_series{1},2); %nb of fields for the i index
     91nbfield=nbfield_j*nbfield_i; %total number of fields
     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
     
    123122                stopstate=get(hseries.RUN,'BusyAction');
    124123                if isequal(stopstate,'queue')% enable STOP command
    125                     update_waitbar(hseries.waitbar_frame,WaitbarPos,ifile/nbfield_i)         
     124                    update_waitbar(hseries.Waitbar,ifile/nbfield_i)         
    126125                    file=filecell{iview,index_slice(ifile)};
    127126                    [Path,Name,ext]=fileparts(file);
Note: See TracChangeset for help on using the changeset viewer.