Changeset 459 for trunk/src/series/sub_background.m
- Timestamp:
- Jun 18, 2012, 9:23:41 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/sub_background.m
r457 r459 54 54 55 55 56 function GUI_config=sub_background (Param)56 function ParamOut=sub_background (Param) 57 57 58 58 %% set the input elements needed on the GUI series when the action is selected in the menu ActionName 59 59 if ~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) 61 61 'AllowInputSort';'off';...% allow alphabetic sorting of the list of input files (options 'off'/'on', 'off' by default) 62 62 'WholeIndexRange';'on';...% prescribes the file index ranges from min to max (options 'off'/'on', 'off' by default) … … 75 75 %% select different modes, RUN, parameter input, BATCH 76 76 % BATCH case: read the xml file for batch case 77 ParamOut=Param; %default output 77 78 if ischar(Param) 78 79 if strcmp(Param,'input?') 79 checkrun=1;% will inlysearch input parameters (preparation of BATCH mode)80 checkrun=1;% will search input parameters (preparation of BATCH mode) 80 81 else 81 82 Param=xml2struct(Param); … … 206 207 return 207 208 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}); 211 212 212 213 % apply the image rescaling function 'level' (avoid the blinking effects of bright particles) 213 214 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== 2215 ParamOut.Specific.CheckLevelTransform=strcmp(answer,'Yes'); 216 if checkrun==1 216 217 return 217 218 end 218 219 %%%%%%%%%%%%%%%%%%%%%% STOP HERE FOR PAMETER INPUT MODE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 219 220 else 220 GUI_config=Param.Specific; 221 if isequal(GUI_config.CheckVolume,1) 221 if isequal(Param.Specific.CheckVolume,1) 222 222 step=1; 223 223 else 224 224 step=nbfield_j;%case of bursts: the sliding background is shifted by the length of one burst 225 225 end 226 nbaver_ima= GUI_config.SlidingSequenceSize;%number of images for the sliding background226 nbaver_ima=Param.Specific.SlidingSequenceSize;%number of images for the sliding background 227 227 nbaver=ceil(nbaver_ima/step);%number of bursts for the sliding background 228 228 if isequal(floor(nbaver/2),nbaver) … … 237 237 238 238 % calculate absolute brightness rank 239 rank=floor( GUI_config.BrightnessRankThreshold*nbaver_ima);239 rank=floor(ParamOut.Specific.BrightnessRankThreshold*nbaver_ima); 240 240 if rank==0 241 241 rank=1;%rank selected in the sorted image series … … 341 341 342 342 %write result file 343 if GUI_config.CheckLevelTransform343 if ParamOut.Specific.CheckLevelTransform 344 344 C=levels(Acor); 345 345 imwrite(C,newname,'BitDepth',8); % save the new image … … 390 390 newname=fullfile_uvmat(RootPath{1},Param.OutputSubDir,RootFile{1},FileExtOut,NomTypeOut,i1_series{1}(ifile),[],j1); 391 391 %write result file 392 if GUI_config.CheckLevelTransform392 if ParamOut.Specific.CheckLevelTransform 393 393 C=levels(Acor); 394 394 imwrite(C,newname,'BitDepth',8); % save the new image … … 425 425 426 426 %write result file 427 if GUI_config.CheckLevelTransform427 if ParamOut.Specific.CheckLevelTransform 428 428 C=levels(Acor); 429 429 imwrite(C,newname,'BitDepth',8); % save the new image
Note: See TracChangeset
for help on using the changeset viewer.