Fit function/image to detect spots

Hi,
I would like to fit a 2D (3D) gaussian in an image in order to detect fluorescent spots.
I’d like to know if there is already an implementation using imgLib2 (in Fourier space or not).
Thanks,
Jean

Hi Jean,

maybe you could just use the spot detector from @tinevez very impressive TrackMate plugin. Just see the corresponding scripting how-to for ideas and details.

Cheers
Niko

Hi Niko,
I saw they implemented detector based on LoG / DoG filtering, but those types of filtering are not sufficient for the images I have, this is why I’m looking for fitting metohds. Are there other methods for spot detection in track mate?
Thanks,
Jean

Hi Jean,

that’s probably more a question for Jean-Yves himself. You could check out the TrackMate javadocs in the meantime.

Cheers
Niko

Hi @jeanollion

TrackMate uses quadratic fitting to subpixel localize the spot location. This is probably not what you are looking for.

A while ago I pushed to imglib2 something that does what you want, but it is in a dangling state. You would have to crawl through the code. Check this package:

I also made some interactive tests for it:

Good luck!
Also, keep us posted because so far I think this code has no use.

1 Like

Hi @tinevez,
Thanks for your reply, that’s what I was looking for, and there are tests for it that’s perfect. I’ll take a look at it and keep you posted.
Best,
Jean
PS: Is the quadratic fitting for sub-voxel detection of local maxima within the filtered image?

Yes.

tralalalalala, youplahou.

1 Like

If you quote the specific question you are replying to, by highlighting with the mouse and clicking “quote”, then I think you won’t get hit by the silly minimum character limit.

1 Like

False.
Yodlediyihou.

Ah, so sad. Tragic, really.

Could we introduce badges for the most creative way of circumventing :twisted_rightwards_arrows: the minimum character limit, please? :wink:

for the sake of clarity & readability of this thread I suggest you start a new thread to discuss this matter :wink:

1 Like

@jeanollion coming back to your application:
Please keep us posted if you use the imglib2 code.
I initially developed it for a user that let me down. So I did not get a chance to know if the code could be used efficiently. Your application is a second chance.
So I would welcome comments on the design, the javadocs, etc…
I guess we will get this feedback in some weeks.

Hello @tinevez,
I run your test classes, it works great, out-of-the-box.
I also tested on real images, its seems very promising, but the solver sometimes goes crazy and finds solutions very far from initial conditions (large sigmas and/or large spatial displacement); this happens mostly in case of false positive spots, but also in a noisy environment.

So here are my first remarks (using the text-formatting capacities of the forum :stuck_out_tongue: ) :

  1. My initial idea was actually to use a threshold on the error (distance between observed data to the fit) in order to filter local maxima. In order to achieve this, I think a solution could be to be able to limit the seach-space. I didn’t see how to constraint the parameters of the fit, but maybe it is already possible? Would it be possible for you to make those changes? Maybe I could help?
  2. To take in account the influence of neighboring spots, it would be good to be able to fit several gaussian simultaneously
  3. Also it would be more convenient if the solver could return the error (but it is currently not a limitation because it can be computed afterwards).
  4. Last, could you explain the lambda parameter (I didn’t go that far in your code!) I don’t understand provided javadoc.

I’m very grateful for those tools you provide.
Best,
Jean

PS: you talked about schedule, so for information, I’m going on vacations for 2 weeks tomorrow, but after tomorrow, you will hear about me when I come back.