You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _pages/plugins/trackmate/tutorials/trackmate-segmentation-editor.md
+63-56Lines changed: 63 additions & 56 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,68 +6,29 @@ artifact: sc.fiji:TrackMate
6
6
section: Tips and Tricks:Closing the editor window
7
7
---
8
8
9
-
10
9
Since version 8, TrackMate ships a new feature that allows editing object shape in 2D.
11
10
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.
36
12
37
-
## Launching the spot editor
13
+
## The editor
38
14
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).
41
22
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:
43
24
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" %}
65
26
66
27
## Navigating in the editor
67
28
68
29
The editor window is actually a [BDV component](/plugins/bdv/index).
69
30
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.
71
32
72
33
### Panning, rotating and zooming
73
34
@@ -87,6 +48,8 @@ Otherwise here is how to navigate in the image panel.
87
48
### Navigating to spots
88
49
89
50
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.
90
53
Shift-clicking on a label in the list will center the image view on the corresponding spot mask
91
54
92
55
{% 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
101
64
102
65
## Editing spots
103
66
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:
0 commit comments