I'm trying to implement spatio-temporal filtering in order to seperate moving objects (microbubbles in ultrasound localization microscopy) in an image series to enhance localization. While my implementation already manages to distort objects moving at a different velocity or in a different direction, duplicates of my objects are appearing after I filtered the image series.
I don't quite understand where these objects come from. I included a minimal example to replicate the output. I noticed that a lower value for sigma_t reduces the effect. However, this also reduces attenuation of objects moving at different velocities.
My questions are:
- Why do these objects appear after filtering the image?
- How can I remove them?
ims = zeros(400,400,n_frames);
[zDim,xDim,Nframes] = size(ims);
IMS = fftshift(fftn(ims));
kx = [-xDim/2:xDim/2-1]*dkx;
kz = [-zDim/2:zDim/2-1]*dkz;
omegas = [-Nframes/2:Nframes/2-1]*domega;
[kxx,kzz] = meshgrid(kx,kz);
vvect = permute(vvect,[3,1,2]);
v_grid = repmat(vvect,size(k_grid,1),size(k_grid,2));
nvect_matrix = sum(k_grid.*v_grid,3);
nvect_array = repmat(nvect_matrix,1,1,Nframes);
omegas_new(1,1,:) = omegas;
omegas_array = repmat(omegas_new,size(k_grid,1),size(k_grid,2));
W = exp(-(omegas_array + nvect_array).^2 * sigma_t^2 / 2);
filtered_ims = abs(ifftn(ifftshift(filtered_IMS)));