Ignore:
Timestamp:
May 25, 2015, 8:48:58 PM (8 years ago)
Author:
sommeria
Message:

sub_background corrected for volume and multilevel cases

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/transform_field/ima_remove_particles.m

    r810 r897  
    3232if strcmp(DataIn,'*')
    3333    return
     34   
    3435end
    3536
    3637%parameters
    3738threshold=200;
    38 nblock_x=30;%size of image subblocks for analysis
    39 nblock_y=30;
     39nblock_x=10;%size of image subblocks for analysis
     40nblock_y=10;
    4041%---------------------------------------------------------
    4142DataOut=DataIn;%default
     
    4950Atype=class(DataIn.A);
    5051A=double(DataIn.A);
    51 Backg=zeros(size(A));
     52% Backg=zeros(size(A));
    5253Aflagmin=sparse(imregionalmin(A));%Amin=1 for local image minima
    5354Amin=A.*Aflagmin;%values of A at local minima
     
    5859Backg=Backg./Bmin; % find the average of minima in blocks
    5960B=imresize(Backg,size(A),'bilinear');% interpolate to the initial size image
    60 ImPart=(A-B);
    61 ImPart=ImPart.*(ImPart>threshold);
    62 DataOut.A=A-ImPart;%
     61DataOut.A=B;
     62% ImPart=(A-B);
     63% ImPart=ImPart.*(ImPart>threshold);
     64% DataOut.A=A-ImPart;%
    6365DataOut.A=feval(Atype,DataOut.A);
    6466
Note: See TracChangeset for help on using the changeset viewer.