Trackmate not finding spots



Hi all,

I’m using Trackmate to follow cells moving and found some settings using the GUI that works and give me good results. But when using the same settings in python, I get an error saying that “The spot collection is empty.”, is there something I’m missing ?

Those are the settings I’m using

settings.detectorFactory = DogDetectorFactory()
settings.detectorSettings = {
    DetectorKeys.KEY_RADIUS : 150,
    DetectorKeys.KEY_TARGET_CHANNEL : 1,
    DetectorKeys.KEY_THRESHOLD : 2,
    DetectorKeys.KEY_DO_MEDIAN_FILTERING : False,
# Configure tracker
settings.trackerFactory = SparseLAPTrackerFactory()
settings.trackerSettings = LAPUtils.getDefaultLAPSettingsMap()
settings.trackerSettings['LINKING_MAX_DISTANCE'] = 200.0
settings.trackerSettings['MAX_FRAME_GAP']= 3

Thanks for the help


I am not entirely sure, but maybe the radius is odd.
First it is very large.
Second, you specify it as an integer (150 with a dot at the end).
Try to specify as a floating point number (150.0).
The same for Threshold.

Can you try that and report back?


Hi @tinevez

Thanks for the fast answer ! :smiley:

I just tried putting floating point number but same error.

To consider it as large, is TrackMate using pixel or µm (or anything else) as unit ? The file I have don’t have the calibration, could that be an issue ?


TrackMate uses whatever calibration you have in the source image. So if you have no calibration, that is pixels.

Also then, I would check if you have the right dimensionality: Do you have XYT of XYZ, and what do you expect to have?

If nothing leads to closure, please post the full script and image.


Thanks for the clarification on the calibration.

I have a XYT image and what I really want is the statistics for each spots that we get at the end of the GUI. I have re run the script with the calibration but still no luck so here is the script and the image.

Thanks a lot for your help :slight_smile:


Yep, this is what I thought:

  • Your image is XY over time, but when you open it, it is seen as a single XYZ stack. You have to change the dimensionality.
  • And it is actually calibrated in um. So when you enter 150.0, you mean to say 150um, which of course is too big. Your cells look like 15um roughly in diameter so I would put something like 7um as radius.

Without changing anything else, this is what I get:


I added the calibration when I realized that it got lost at some point during the pre processing part.

As for the dimensionality, I don’t get it. I just opened it again, checked the properties and it does say Slices (z): 1 & Frames (t): 18. Shouldn’t it be that way ?

Edit: Is there a way to get the spots statistics directly in the script ? I couldn’t find that in the examples you put online but maybe I missed it…

Thanks again for your help :slight_smile:


For the analysis script just go there:

I think you can also search this forum for another answer related to yours.


Thanks a lot ! I indeed found the solution looking at that page but didn’t want to double post… :slight_smile:

See you in Neubias Jean Yves !


No need to double post, you can edit your previous posts anytime by clicking on the pencil icon (image) at the bottom of the post :slight_smile:

(Just note when doing substantial edits to your posts, it is good practice to clearly indicate the parts you edited, e.g. by adding EDIT to an added paragraph, or using the <s>...</s> syntax to mark deleted text or outdated information.)


Thanks @imagejan.

Will do next time :wink: