Ignore:
Timestamp:
Jun 18, 2012, 9:23:41 AM (12 years ago)
Author:
sommeria
Message:

sub_background and time series set to the new standards

File:
1 edited

Legend:

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

    r457 r459  
    5454
    5555   
    56 function GUI_config=sub_background (Param)
     56function ParamOut=sub_background (Param)
    5757
    5858%% set the input elements needed on the GUI series when the action is selected in the menu ActionName
    5959if ~exist('Param','var') % case with no input parameter
    60     GUI_config={'NbViewMax';1;...% max nbre of input file series (default='' , no limitation)
     60    ParamOut={'NbViewMax';1;...% max nbre of input file series (default='' , no limitation)
    6161        'AllowInputSort';'off';...% allow alphabetic sorting of the list of input files (options 'off'/'on', 'off' by default)
    6262        'WholeIndexRange';'on';...% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default)
     
    7575%% select different modes,  RUN, parameter input, BATCH
    7676% BATCH  case: read the xml file for batch case
     77ParamOut=Param; %default output
    7778if ischar(Param)
    7879    if strcmp(Param,'input?')
    79         checkrun=1;% will inly search input parameters (preparation of BATCH mode)
     80        checkrun=1;% will search input parameters (preparation of BATCH mode)
    8081    else
    8182        Param=xml2struct(Param);
     
    206207        return
    207208    end
    208     GUI_config.CheckVolume=strcmp(answer{1},'Yes');
    209     GUI_config.SlidingSequenceSize=nbaver_ima;
    210     GUI_config.BrightnessRankThreshold=str2num(answer{3});
     209    ParamOut.Specific.CheckVolume=strcmp(answer{1},'Yes');
     210    ParamOut.Specific.SlidingSequenceSize=nbaver_ima;
     211    ParamOut.Specific.BrightnessRankThreshold=str2num(answer{3});
    211212   
    212213    % apply the image rescaling function 'level' (avoid the blinking effects of bright particles)
    213214    answer=msgbox_uvmat('INPUT_Y-N','apply image rescaling function levels.m after sub_background');
    214     GUI_config.CheckLevelTransform=strcmp(answer,'Yes');
    215     if checkrun==2
     215    ParamOut.Specific.CheckLevelTransform=strcmp(answer,'Yes');
     216    if checkrun==1
    216217         return
    217218    end
    218219    %%%%%%%%%%%%%%%%%%%%%%  STOP HERE FOR PAMETER INPUT MODE  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    219220else
    220     GUI_config=Param.Specific;
    221     if isequal(GUI_config.CheckVolume,1)
     221    if isequal(Param.Specific.CheckVolume,1)
    222222        step=1;
    223223    else
    224224        step=nbfield_j;%case of bursts: the sliding background is shifted by the length of one burst
    225225    end
    226     nbaver_ima=GUI_config.SlidingSequenceSize;%number of images for the sliding background
     226    nbaver_ima=Param.Specific.SlidingSequenceSize;%number of images for the sliding background
    227227    nbaver=ceil(nbaver_ima/step);%number of bursts for the sliding background
    228228    if isequal(floor(nbaver/2),nbaver)
     
    237237
    238238% calculate absolute brightness rank
    239 rank=floor(GUI_config.BrightnessRankThreshold*nbaver_ima);
     239rank=floor(ParamOut.Specific.BrightnessRankThreshold*nbaver_ima);
    240240if rank==0
    241241    rank=1;%rank selected in the sorted image series
     
    341341       
    342342        %write result file
    343         if GUI_config.CheckLevelTransform
     343        if ParamOut.Specific.CheckLevelTransform
    344344            C=levels(Acor);
    345345            imwrite(C,newname,'BitDepth',8); % save the new image
     
    390390                    newname=fullfile_uvmat(RootPath{1},Param.OutputSubDir,RootFile{1},FileExtOut,NomTypeOut,i1_series{1}(ifile),[],j1);
    391391                    %write result file
    392                     if GUI_config.CheckLevelTransform
     392                    if ParamOut.Specific.CheckLevelTransform
    393393                        C=levels(Acor);
    394394                        imwrite(C,newname,'BitDepth',8); % save the new image
     
    425425       
    426426        %write result file
    427         if GUI_config.CheckLevelTransform
     427        if ParamOut.Specific.CheckLevelTransform
    428428            C=levels(Acor);
    429429            imwrite(C,newname,'BitDepth',8); % save the new image
Note: See TracChangeset for help on using the changeset viewer.