Skip to content

Commit c20adbd

Browse files
committed
WIP: rework the trackmate spot editor documentation.
1 parent b20f541 commit c20adbd

File tree

1 file changed

+63
-56
lines changed

1 file changed

+63
-56
lines changed

_pages/plugins/trackmate/tutorials/trackmate-segmentation-editor.md

Lines changed: 63 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -6,68 +6,29 @@ artifact: sc.fiji:TrackMate
66
section: Tips and Tricks:Closing the editor window
77
---
88

9-
109
Since version 8, TrackMate ships a new feature that allows editing object shape in 2D.
1110
The spot editor is based on [Labkit](/plugins/labkit) components, and is made to simplify and accelerate the creation of tracking ground truth.
12-
In this tutorial we will explain how to use it to modify segmentation results directly in TrackMate
13-
14-
## Preparing the tutorial data
15-
16-
Download [this image](/media/plugins/trackmate/spot-editor/Celegans-2D.tif) and open it in Fiji.
17-
It is a movie of the early development of a _C. elegans_ embryo, projected in 2D, for which the nuclei have been stained in fluorescence.
18-
We will generate an incorrect segmentation of these nuclei in TrackMate, and fix it with the spot editor.
19-
20-
In Fiji, with the image open, launch TrackMate ({% include bc path="Plugins|Tracking|TrackMate"%}).
21-
Click the _Next_ button and select the _Thresholding detector_.
22-
In its configuration page, put a threshold of 1000 and click _Next_.
23-
24-
{% include img src="/media/plugins/trackmate/spot-editor/trackmate-spot-editor-tuto-02.png" align="center" width="300px" %}
25-
26-
Click the _Next_ button until you are in the tracker selection page and select the _LAP tracker_.
27-
In its configuration page,
28-
- put 5 µm as max linking distance,
29-
- uncheck the _Track segment gap closing_ button,
30-
- check the _Track segment splitting_ button and put a _max distance_ of 5 µm,
31-
- uncheck everything else.
32-
33-
You should get the following:
34-
35-
{% include img src="/media/plugins/trackmate/spot-editor/trackmate-spot-editor-tuto-03.png" align="center" width="300px" %}
11+
In this page we explain how to use it to modify segmentation results directly in TrackMate.
3612

37-
## Launching the spot editor
13+
## The editor
3814

39-
The threshold we set is too stringent, and many nuclei are improperly segmented, and some polar bodies are missing.
40-
For instance, in frame 2 the top-left nucleus looks like this:
15+
The editor is made of several UI components:
16+
- The main editor panel, where the image is painted along with the spot masks (center).
17+
- The side panel (left) that contains from top to bottom:
18+
- the 'Close and sen' button, that finishes editing and returns to TrackMate;
19+
- the image visibility tool (with the eye button), that let you hide / unhide the image, perform auto contrast, and open the display settings panel (will appear on the right);
20+
- the spot label list, listing all spots currently in the editor, and a global visibility button (the eye).
21+
- The toolbar (top).
4122

42-
{% include img src="/media/plugins/trackmate/spot-editor/trackmate-spot-editor-tuto-05.png" align="center" width="300px" %}
23+
The toolbar shows the six editing tool we use to annotate an image:
4324

44-
We will use the spot editor to correct some of the mistakes there.
45-
The spot editor can be launched from the _Display options_ panel of TrackMate:
46-
47-
{% include img src="/media/plugins/trackmate/spot-editor/trackmate-spot-editor-tuto-04.png" align="center" %}
48-
49-
Move to frame 2 and click the `Launch spot editor button`.
50-
The user interface of TrackMate is frozen and a new window appear:
51-
52-
{% include img src="/media/plugins/trackmate/spot-editor/trackmate-spot-editor-tuto-06.png" align="center" %}
53-
54-
The large bottom right panel displays the image overlaid with the spots.
55-
Notice that the spots have been converted to masks, and that they have the same color that in the TrackMate UI.
56-
57-
The top bar is made of widgets that change the brush mode (navigate, add, remove, fill, ...) and the brush size.
58-
We will describe them below.
59-
60-
The left side bar contains (from top to bottom)
61-
- the button to end editing,
62-
- auto-contrast and display config panel for the spot editor,
63-
- the list of labels currently in the editor, initially there is one label per spot,
64-
- a button to create a new label, possibly for a new spot.
25+
{% include img src="/media/plugins/trackmate/spot-editor/trackmate-spot-editor-six-tools-annotation-bis.png" align="center" %}
6526

6627
## Navigating in the editor
6728

6829
The editor window is actually a [BDV component](/plugins/bdv/index).
6930
If you know your way around BDV you will get your bearings quickly.
70-
Otherwise here is how to navigate in the image panel.
31+
Otherwise, here is how to navigate in the image panel.
7132

7233
### Panning, rotating and zooming
7334

@@ -87,6 +48,8 @@ Otherwise here is how to navigate in the image panel.
8748
### Navigating to spots
8849

8950
On the left side bar, you can see the list of labels currently in the editor.
51+
Each label initially corresponds to a spot in TrackMate.
52+
The label will have the same name and color that of the current view in TrackMate.
9053
Shift-clicking on a label in the list will center the image view on the corresponding spot mask
9154

9255
{% include img src="/media/plugins/trackmate/spot-editor/trackmate-spot-editor-tuto-09.gif" align="center" %}
@@ -101,12 +64,56 @@ The _settings_ button will open a dialog to change the display settings of the i
10164

10265
## Editing spots
10366

104-
Let's fix the top left nucleus in frame 2.
105-
Center and zoom in on it, so that it fills the panel.
106-
We see that there are two spurious detections on the side, of 1-pixel size, and that the largest spot is not large enough to cover the nucleus.
107-
Let's first remove the spurious detections.
67+
Editing spots is made by painting labels in the editor.
68+
When you modify a label, the modifications will be reimported into TrackMate when you close the editor.
69+
In TrackMate, 2D spots are polygons, but we found out that painting inside the input image then converting to spots was fast and convenient, particularly with a tablet.
70+
71+
### For editing, TrackMate spots are written into labels
72+
73+
The editor will display the spots as a 'labeling', a colored image where the pixels inside each spot is painted with a specific label.
74+
All the labels corresponding to the spots in the image are listed on the left side bar.
75+
Modifying a spot is adding a removing pixels from its shape.
76+
77+
There is a gotcha however: When you finish editing the actual label of a spot does not matter anymore.
78+
For instance, if you paint a new spot with an existing label, so that the new spot is disconnected from the initial spot or even on another time-point, the new spot will be created as a separated one in TrackMate.
79+
The fact that the initial spot and the new one have the same label plays no role if they are not touching.
80+
81+
### The six editing tools
82+
83+
When you select one of the tool by cliking on its icon or with F1 - F6, the right part of the toolbar changes to show the tool controls.
84+
85+
### The pan tool - {% include key key="F1" %}
86+
87+
See above.
88+
When this tool is selected, the mouse is used to navigate in the image.
89+
90+
### Painting labels - {% include key key="F2" %}
91+
92+
When the paint tool is selected, left clicking in the image will paint the label currently selected in the image, as if you had a brush.
93+
You can select a label in the side bar, or create a new label to create a new spot.
94+
The select label tool described below is used to select a label at a given pixel.
95+
96+
You can change the diameter of the brush with the slider that appears right of the toolbar.
97+
The default key shortcuts to do so are {% include key key="Q" %} / {% include key key="E" %} and {% include key key="Shift|Q" %} / {% include key key="Shift|E" %}
98+
99+
The rightmost list allows changing the paint mode.
100+
There are three of them: _Replace, Add, Preserve_.
101+
102+
#### Paint Replace
103+
104+
#### Pain Add
105+
106+
In TrackMate the spots can be overlapping, and as a consequence, in the editor you can have several labels on one pixel.
107+
This is the way to edit overlapping spots.
108+
The _Add_ mode paint labels, and if there is an existing label, it will add the selected one, and not remove the existing one:
109+
110+
<iframe width="480" height="270" align="center" src="/media/plugins/trackmate/spot-editor/TrackMate-Editor-Paint-AddMode_halfsize.mp4" allow="autoplay">
111+
112+
113+
#### Paint Preserve
114+
108115
109-
### Deleting pixels
116+
### Deleting pixels - {% include key key="F3" %}
110117
111118
The fourth button on the top bar is the _Delete_ button.
112119
Click it to make the delete brush mode active.

0 commit comments

Comments
 (0)