Simulate image data representative of a real experiment
Afficher commentaires plus anciens
As part of my research, I need to validate a particular experimental approach of image capture and particle trajectory analysis by simulating "fake" data where I have control of the parameters.
More specifically, my task is to:
- generate multiple particles' stochastic trajectories;
- create a gaussian blur of the simulated point particles, where the gaussian blur is related to the radius parameter I specifiy;
- discretize that gaussian-blurred particle into a grid corresponding to some pixel resolution related to the real experimental setup; and
- output each time step in the trajectory as a pixelated image.
I can easily complete Step 1, but my issues reside with Step 2-4. The image I've attached will hopefully provide a useful diagram that may better descripe my goal. The portion in blue is what I desire to output.

The experimental setup involves a microscope viewing top-down the trajectory of particles on a flat plane, so my "fake data" images need to represent that setup.
I've spent quite a while looking through Matlab's imaging capabilitites; however, either due to my ignorance of imaging or to my ignorance of Matlab, I have been unable to come up with an approach that meets my needs.
I appreciate any input anyone can offer.
5 commentaires
J. Alex Lee
le 2 Oct 2020
are you able to create a movie/image stack of the unblurred simulated particle trajectories, and all you need is the blur? it's not clear where exactly you are stuck...you can look into imfilter() and conv2() for the blurring.
for these experiments, is it important for you that blur alone won't simulate things like the bright ring (i forget the name of it) when particles are in specific depth relative to focal plane?
Ryan Muoio
le 2 Oct 2020
Ryan Muoio
le 3 Oct 2020
Bjorn Gustavsson
le 3 Oct 2020
Modifié(e) : Bjorn Gustavsson
le 3 Oct 2020
OK, since it was useful I'll move it to "answer"...
You can look for the keyword "splatting methods" in papers about calculating images of 3-D projections for tomographic imaging. We used a variant of that looks pretty much like this (with additional geometry-handling and such).
Ryan Muoio
le 5 Oct 2020
Réponse acceptée
Plus de réponses (1)
J. Alex Lee
le 2 Oct 2020
Bjorn's answer contains the conv2() route to blurring
fK = exp(-X.^2/dx^2-Y.^2/dy^2);
fK = fK/sum(fK(:));
Im = conv(full(dIm),fK,'same');
And if you have image processing, you could do it somewhat simpler as
Im = imgaussfilt(dIm,[dy,dx]); % or dx,dy, depending on which way is x
As for "pixelating", if you just mean binning the gray values, you could just use rounding like
s = 8; % round to nearest 6th gray value
ImP = round(Im/8)*8
1 commentaire
Ryan Muoio
le 3 Oct 2020
Catégories
En savoir plus sur Image Processing Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!