- Timestamp:
- Apr 18, 2011, 10:55:57 PM (14 years ago)
- Location:
- trunk/src/series
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/sub_background.m
r217 r239 129 129 try 130 130 mkdir([dir_images term]); 131 catch 132 errormsg=lasterr 133 msgbox_uvmat('ERROR',errormsg); 131 catch ME 132 msgbox_uvmat('ERROR',ME.message); 134 133 return 135 134 end … … 142 141 143 142 %% set processing parameters 144 prompt = {'Number of images for the sliding background ';'The number of positions (laser slices)';'volume scan mode (Yes/No)';...143 prompt = {'Number of images for the sliding background (MUST FIT IN COMPUETER MEMORY)';'The number of positions (laser slices)';'volume scan mode (Yes/No)';... 145 144 'the luminosity rank chosen to define the background (0.1=for dense particle seeding, 0.5 (median) for sparse particles'}; 146 145 dlg_title = ['get (slice by slice) a sliding background and substract to each image, result in subdir ' subdir_ima term]; … … 154 153 nbaver=ceil(nbaver_ima/siz(1));%number of bursts for the sliding background 155 154 if isequal(floor(nbaver/2),nbaver) 156 nbaver=nbaver+1 %put the number of burst to an odd number (so the middle burst is defined)155 nbaver=nbaver+1;%put the number of burst to an odd number (so the middle burst is defined) 157 156 end 158 157 step=siz(1);%case of bursts: the sliding background is shifted by one burst … … 181 180 nbfield_slice=nbfield*nbfield2;% number of fields per slice 182 181 if nbaver_ima > nbfield*nbfield2 183 errordlg('number of images in a slice smaller than the proposed number of images for the sliding average')182 msgbox_uvmat('ERROR','number of images in a slice smaller than the proposed number of images for the sliding average') 184 183 return 185 184 end … … 189 188 step=1; 190 189 nbaver=nbaver_ima; 190 end 191 192 %% prealocate memory for the sliding background 193 first_image=name_generator(filebase,num_i1(1),num_j1(1),Series.FileExt,Series.NomType); 194 Afirst=read_image(first_image,FileType,num_i1(1),MovieObject); 195 [npy,npx]=size(Afirst); 196 try 197 Ak=zeros(npy,npx,nbaver_ima,'uint16'); %prealocate memory 198 Asort=zeros(npy,npx,nbaver_ima,'uint16'); %prealocate memory 199 catch ME 200 msgbox_uvmat('ERROR',ME.message) 201 return 191 202 end 192 203 … … 204 215 ImageName=name_generator(filebase_b,num_i1(1),num_j1(1),'.png',Series.NomType); 205 216 [pth,ImageName]=fileparts(ImageName); 206 ImageName=[ImageName '.png'] 217 ImageName=[ImageName '.png']; 207 218 if isempty(uid_ImageName) 208 219 [t,uid_ImageName]=add(t,uid_Heading,'element','ImageName'); … … 210 221 uid_value=children(t,uid_ImageName); 211 222 if isempty(uid_value) 212 t=add(t,uid_ImageName,'chardata',ImageName) %indicate name of the first image, with ;png extension223 t=add(t,uid_ImageName,'chardata',ImageName);%indicate name of the first image, with ;png extension 213 224 else 214 t=set(t,uid_value(1),'value',ImageName) %indicate name of the first image, with ;png extension225 t=set(t,uid_value(1),'value',ImageName);%indicate name of the first image, with ;png extension 215 226 end 216 227 … … 239 250 240 251 %MAIN LOOP ON SLICES 252 241 253 for islice=1:nbslice_i 242 254 %% select the series of image indices at the level islice … … 360 372 windowsize=round(min(size(B,1),size(B,2))/20); 361 373 windowsize=floor(windowsize/2)*2+1; 362 ix= [1/2-windowsize/2:-1/2+windowsize/2];%374 ix=1/2-windowsize/2:-1/2+windowsize/2;% 363 375 %del=np/3; 364 376 %fct=exp(-(ix/del).^2);
Note: See TracChangeset
for help on using the changeset viewer.