trackmate-sc / TrackMate

TrackMate is your buddy for your everyday tracking.
https://imagej.net/plugins/trackmate
GNU General Public License v3.0
169 stars 76 forks source link

Draft PR that targets the work done towards TrackMate v9 #308

Open tinevez opened 2 weeks ago

tinevez commented 2 weeks ago

Reopened from #263

Support 3D segmentation by adding spots with triangular meshes.

A 3D viewer for TrackMate based on the BVV.

280

image

A tool to configure a sub-selection of feature analyzers.

261

There is now a new 'plugin' that launches a configuration panel for the TrackMate feature analyzers.

It can be launched with the menu item: Edit > Options > Configure TrackMate feature analyzers.... and show this dialog:

Screenshot 2023-05-10 at 17 05 43

It allows selecting or deselecting feature analyzers. Upon pressing the Save to user defaults button, a JSON file is created:

❯ pwd
/Users/tinevez/.trackmate
❯ cat featureselection.json
{
  "allAnalyzers": {
    "spots": {
      "Manual spot color": true,
      "Spot 2D shape descriptors": true,
      "Spot 3D shape descriptors": true,
      "Spot contrast and SNR": false,
      "Spot fit 2D ellipse": true,
      "Spot fit 3D ellipsoid": true,
      "Spot intensity": true
    },
    "edges": {
      "Directional change": true,
      "Edge location": true,
      "Edge speed": true,
      "Edge target": true,
      "Manual edge color": true
    },
    "tracks": {
      "Branching analyzer": true,
      "Track duration": true,
      "Track index": true,
      "Track location": true,
      "Track motility analysis": true,
      "Track quality": true,
      "Track speed": true
    }
  }
}%                         

This selection will be used next time the user launches the TrackMate GUI. This allows skipping the computation of analyzers that the users do not need. This will become useful in particular for 3D analysis with segmentation, where iterating through all the pixels of all meshes might be very long.

However it brings a risk: because TrackMate does not manage dependencies, the user might remove an analyzer that is needed by another one (example: spot SNR requires spot intensity). This risk is not mitigated yet.

Spot is now an interface, with 3 derived class.

Spot -> the main interface, used by default in trackers. Define basic methods to get and store feature values. SpotBase -> Plain spots, like for TrackMate v<7 SpotRoi -> spot has a polygon as a contour in 2D SpotMesh -> spot has a 3D mesh

More elegant and extensible to app consuming TrackMate trackers with special objects.

The detection preview is cancelable.

Of course it only actually cancels the preview if the detector that is used is itself cancelable. Screenshot 2024-03-28 at 20 21 43