Clear Filters
Clear Filters

Signal duplicates/repeats in spatio-temporal filtering

2 views (last 30 days)
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:
  1. Why do these objects appear after filtering the image?
  2. How can I remove them?
n_frames = 100;
ims = zeros(400,400,n_frames);
for ii=1:n_frames
ims(200,ii,ii) = 1;
end
dx = 1;
dz = 1;
fs = 1;
vel = 1; % filtering velocity
phi = 90; % filtering angle
sigma_t = 100; % gaussian filter sigma
[zDim,xDim,Nframes] = size(ims);
% fourier transform
IMS = fftshift(fftn(ims));
% spatial sampling frequencies
Kx = 2*pi/dx;
Kz = 2*pi/dz;
% step size for spatial frequencies
dkx = Kx/xDim;
dkz = Kz/zDim;
% temporal step size
dt = 1/fs;
Omega = 2*pi/dt;
% frequency step size
domega = Omega/Nframes;
% null-centered frequency vectors
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);
% kx in the first layer, kz in the second
k_grid(:,:,1) = kxx;
k_grid(:,:,2) = kzz;
% velocity vector with x- and z-components
vx = vel * sind(phi);
vz = vel * cosd(phi);
vvect = [vx vz];
% vx in the first layer, vz in the second layer; same dimensions like
% spatial frequencies
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);
% adding time frequencies
nvect_array = repmat(nvect_matrix,1,1,Nframes);
% fitting time frequencies to image size
omegas_new(1,1,:) = omegas;
omegas_array = repmat(omegas_new,size(k_grid,1),size(k_grid,2));
% filter transfer function
W = exp(-(omegas_array + nvect_array).^2 * sigma_t^2 / 2);
% filtering by multiplication in frequency domain
filtered_IMS = IMS .* W;
% inverse fourier transform
filtered_ims = abs(ifftn(ifftshift(filtered_IMS)));

Answers (1)

Gyan Vaibhav
Gyan Vaibhav on 29 Dec 2023
Hi Sebastian,
I understand that you are trying to implement spatio-temporal filtering to separate moving objects.
The appearance of duplicate objects after spatio-temporal filtering can be attributed to the side lobes of the filter's frequency response.
Here are a few possible reasons:
  1. Filter Side Lobes: As mentioned above, the filter has side lobes that can let through unwanted frequencies, leading to artifacts.
  2. Aliasing: If the sampling rate (fs) is not high enough to capture the motion properly, aliasing can occur, which might create duplicates or ghost images of the moving objects.
Here are a few possible ways to fix:
  1. Adjust the Filter: You can try adjusting the filter's parameters, such as sigma_t, to find a balance between removing unwanted objects and retaining the desired ones.
  2. Increase Sampling Rate: If aliasing is a problem, increasing the sampling rate (fs) can help capture the motion more accurately and reduce the chances of aliasing artifacts.
  3. Bandpass Filtering: Implement a bandpass filter that only allows a narrow range of frequencies corresponding to the expected velocities of the microbubbles.
Hope this helps.
Thanks
Gyan

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!