Ignore:
Timestamp:
Jun 17, 2012, 10:52:04 PM (12 years ago)
Author:
sommeria
Message:

merg_i_j transformed to the new standards.
Various improvements

File:
1 edited

Legend:

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

    r455 r457  
    1 %'sub_background': substract background to an image series, used with series.fig
     1%'sub_background': substract a sliding background to an image series
     2% This is an example of action on a series of input images
    23%------------------------------------------------------------------------
    34% Method:
     
    1415    % Else nbfield2=nbfield_j =nbre of images in a burst (j index)
    1516   
    16 % function GUI_series_config=sub_background(Param)
     17% function GUI_config=sub_background(Param)
    1718%
    1819%%%%%%%%%%% GENERAL TO ALL SERIES ACTION FCTS %%%%%%%%%%%%%%%%%%%%%%%%%%%
     20%
     21% This function is used in four modes by the GUI series:
     22%           1) config GUI: with no input argument, the function determine the suitable GUI configuration
     23%           2) interactive input: the function is used to interactively introduce input parameters, and then stops
     24%           3) RUN: the function itself runs, when an appropriate input  structure Param has been introduced.
     25%           4) BATCH: the function itself proceeds in BATCH mode, using an xml file 'Param' as input.
     26%
    1927%OUTPUT
    2028% GUI_series_config=list of options in the GUI series.fig needed for the function
     
    5260    GUI_config={'NbViewMax';1;...% max nbre of input file series (default='' , no limitation)
    5361        'AllowInputSort';'off';...% allow alphabetic sorting of the list of input files (options 'off'/'on', 'off' by default)
     62        'WholeIndexRange';'on';...% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
    5463        'NbSlice';'on'; ...%nbre of slices ('off' by default)
    5564        'VelType';'off';...% menu for selecting the velocity type (options 'off'/'one'/'two',  'off' by default)
     
    6473
    6574%%%%%%%%%%%% STANDARD PART (DO NOT EDIT) %%%%%%%%%%%%
    66 %% get input parameters, file names and indices
     75%% select different modes,  RUN, parameter input, BATCH
    6776% BATCH  case: read the xml file for batch case
    68 if ischar(Param) && ~isempty(find(regexp(Param,'.xml$'))) %batch mode
     77if ischar(Param)
     78    if strcmp(Param,'input?')
     79        checkrun=1;% will inly search input parameters (preparation of BATCH mode)
     80    else
    6981        Param=xml2struct(Param);
    7082        checkrun=0;
    71     % RUN case: parameters introduced as the input structure Param
     83    end
     84% RUN case: parameters introduced as the input structure Param
    7285else
    7386    hseries=guidata(Param.hseries);%handles of the GUI series
    7487    WaitbarPos=get(hseries.waitbar_frame,'Position');%position of the waitbar on the GUI series
    75     checkrun=1; % indicate the RUN option is used
    76 end
     88    checkrun=2; % indicate the RUN option is used
     89end
     90
     91%% root input file(s) and type
     92RootPath=Param.InputTable(:,1);
     93RootFile=Param.InputTable(:,3);
     94SubDir=Param.InputTable(:,2);
     95NomType=Param.InputTable(:,4);
     96FileExt=Param.InputTable(:,5);
     97
    7798% get the set of input file names (cell array filecell), and the lists of
    7899% input file or frame indices i1_series,i2_series,j1_series,j2_series
     
    84105% i1_series(iview,fileindex) expresses the same indices as a 1D array in file indices
    85106% set of frame indices used for movie or multimage input
    86 
    87 
    88 %% root input file(s) and type
    89 RootPath=Param.InputTable(:,1);
    90 RootFile=Param.InputTable(:,3);
    91 SubDir=Param.InputTable(:,2);
    92 NomType=Param.InputTable(:,4);
    93 FileExt=Param.InputTable(:,5);
    94 
    95107% numbers of slices and file indices
     108
    96109NbSlice=1;%default
    97 if isfield(Param.IndexRange,'NbSlice')
     110if isfield(Param.IndexRange,'NbSlice')&&~isempty(Param.IndexRange.NbSlice)
    98111    NbSlice=Param.IndexRange.NbSlice;
    99112end
     
    162175end
    163176
    164 %% set processing parameters
    165 if ~isfield(Param,'Specific')
     177%% input of specific parameters
     178if checkrun %get specific parameters interactively
    166179    prompt = {'volume scan mode (Yes/No)';'Number of images for the sliding background (MUST FIT IN COMPUTER MEMORY)';...
    167180        'the luminosity rank chosen to define the background (0.1=for dense particle seeding, 0.5 (median) for sparse particles'};
     
    200213    answer=msgbox_uvmat('INPUT_Y-N','apply image rescaling function levels.m after sub_background');
    201214    GUI_config.CheckLevelTransform=strcmp(answer,'Yes');
    202    
    203 %     % return to BATCH mode
    204 %     if checkrun==-1
    205         return %transfer to BATCH mode
    206 %     end
     215    if checkrun==2
     216         return
     217    end
     218    %%%%%%%%%%%%%%%%%%%%%%  STOP HERE FOR PAMETER INPUT MODE  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    207219else
    208220    GUI_config=Param.Specific;
Note: See TracChangeset for help on using the changeset viewer.