Changeset 457 for trunk/src/series/sub_background.m
- Timestamp:
- Jun 17, 2012, 10:52:04 PM (12 years ago)
- 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 2 3 %------------------------------------------------------------------------ 3 4 % Method: … … 14 15 % Else nbfield2=nbfield_j =nbre of images in a burst (j index) 15 16 16 % function GUI_ series_config=sub_background(Param)17 % function GUI_config=sub_background(Param) 17 18 % 18 19 %%%%%%%%%%% 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 % 19 27 %OUTPUT 20 28 % GUI_series_config=list of options in the GUI series.fig needed for the function … … 52 60 GUI_config={'NbViewMax';1;...% max nbre of input file series (default='' , no limitation) 53 61 '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) 54 63 'NbSlice';'on'; ...%nbre of slices ('off' by default) 55 64 'VelType';'off';...% menu for selecting the velocity type (options 'off'/'one'/'two', 'off' by default) … … 64 73 65 74 %%%%%%%%%%%% STANDARD PART (DO NOT EDIT) %%%%%%%%%%%% 66 %% get input parameters, file names and indices75 %% select different modes, RUN, parameter input, BATCH 67 76 % BATCH case: read the xml file for batch case 68 if ischar(Param) && ~isempty(find(regexp(Param,'.xml$'))) %batch mode 77 if ischar(Param) 78 if strcmp(Param,'input?') 79 checkrun=1;% will inly search input parameters (preparation of BATCH mode) 80 else 69 81 Param=xml2struct(Param); 70 82 checkrun=0; 71 % RUN case: parameters introduced as the input structure Param 83 end 84 % RUN case: parameters introduced as the input structure Param 72 85 else 73 86 hseries=guidata(Param.hseries);%handles of the GUI series 74 87 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 89 end 90 91 %% root input file(s) and type 92 RootPath=Param.InputTable(:,1); 93 RootFile=Param.InputTable(:,3); 94 SubDir=Param.InputTable(:,2); 95 NomType=Param.InputTable(:,4); 96 FileExt=Param.InputTable(:,5); 97 77 98 % get the set of input file names (cell array filecell), and the lists of 78 99 % input file or frame indices i1_series,i2_series,j1_series,j2_series … … 84 105 % i1_series(iview,fileindex) expresses the same indices as a 1D array in file indices 85 106 % set of frame indices used for movie or multimage input 86 87 88 %% root input file(s) and type89 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 95 107 % numbers of slices and file indices 108 96 109 NbSlice=1;%default 97 if isfield(Param.IndexRange,'NbSlice') 110 if isfield(Param.IndexRange,'NbSlice')&&~isempty(Param.IndexRange.NbSlice) 98 111 NbSlice=Param.IndexRange.NbSlice; 99 112 end … … 162 175 end 163 176 164 %% set processingparameters165 if ~isfield(Param,'Specific')177 %% input of specific parameters 178 if checkrun %get specific parameters interactively 166 179 prompt = {'volume scan mode (Yes/No)';'Number of images for the sliding background (MUST FIT IN COMPUTER MEMORY)';... 167 180 'the luminosity rank chosen to define the background (0.1=for dense particle seeding, 0.5 (median) for sparse particles'}; … … 200 213 answer=msgbox_uvmat('INPUT_Y-N','apply image rescaling function levels.m after sub_background'); 201 214 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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 207 219 else 208 220 GUI_config=Param.Specific;
Note: See TracChangeset
for help on using the changeset viewer.