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
section: TrackMate-Cellpose.:Usage:cellpose parameters in the TrackMate UI.
9
9
---
10
10
11
-
{% include img src="/media/plugins/trackmate/trackmate-cellpose-screenshot.png" align='center' width='500' %}
11
+
{% include img src="/media/plugins/trackmate/detectors/cellpose/trackmate-cellpose-screenshot.png" align='center' width='500' %}
12
12
13
13
This page describes the advanced version of the cellpose detector in [TrackMate](/plugins/trackmate/index), documented [here](trackmate-cellpose).
14
14
These two detectors rely both on the [cellpose](https://cellpose.readthedocs.io/en/latest/) software, but this one offers more configuration options that are hidden in the non-advanced version.
@@ -33,15 +33,7 @@ In particular the _Installing cellpose_ paragraph in the _Additional informatio
33
33
We describe here the advanced parameters that are specific to the advanced detector.
34
34
Core parameters are described in the [TrackMate-Cellpose](trackmate-cellpose) documentation page.
35
35
36
-
{% include img src="/media/plugins/trackmate/detectors/trackmate-cellpose-ui-advanced-2D.png" align='center' width='300' %}
37
-
38
-
##### `Cell probability threshold`
39
-
One of the neural network output of cellpose is a cell probability map: each pixel contains the value of its probability to belongs to a cell.
40
-
This parameter controls the amount of confidence to keep a pixel in the cell: all pixels with a probability above `cell_probability_threshold` will be kept.
41
-
This value can range from `-6.0` (more and larger cells) to `6.0` (less and smaller but most likely cells).
42
-
43
-
_By default in the non-advanced option, this parameter is `0.0`._
44
-
36
+
{% include img src="/media/plugins/trackmate/detectors/cellpose/trackmate-cellpose-ui-advanced-2D.png" align='center' width='300' %}
45
37
46
38
##### `Flow threshold`
47
39
Cellpose performs an additional step after a first reconstruction of the shape to check the consistency between the calculated cell shapes and the computed flows.
@@ -52,8 +44,15 @@ If it's `0`, this step will not be performed (all detections whatever the shape
52
44
53
45
_By default in the non-advanced option, this parameter is `0.4`._
54
46
47
+
##### `Cell probability threshold`
48
+
One of the neural network output of cellpose is a cell probability map: each pixel contains the value of its probability to belongs to a cell.
49
+
This parameter controls the amount of confidence to keep a pixel in the cell: all pixels with a probability above `cell_probability_threshold` will be kept.
50
+
This value can range from `-6.0` (more and larger cells) to `6.0` (less and smaller but most likely cells).
51
+
52
+
_By default in the non-advanced option, this parameter is `0.0`._
53
+
55
54
56
-
##### `Resample`
55
+
##### `Do not resample`
57
56
58
57
Cellpose resizes your image to have the mean cell size (`mean diameter` parameter above) equals to the mean diameter of the trained model.
59
58
The flows are computed on these rescaled images.
@@ -62,7 +61,11 @@ It will affect the smoothness of the resulting segmentation and the computing ti
62
61
- If your mean diameter > model diameter, the image is downscaled. In this case, resampling will create smoother ROIs but will be slower (the calculation will be done in the original image size, so on larger image).
63
62
- If your mean diameter < model diameter, the image is upscaled. In this case, resampling will be faster (running on smaller image), but will find less detections than without resampling.
64
63
65
-
_By default in the non-advanced option, this parameter is set to `True`._
64
+
_By default in the non-advanced option, this parameter is set to `False`.
65
+
The images are resampled._
66
+
67
+
68
+
<!--------------
66
69
67
70
#### Parameters for 3D stacks
68
71
@@ -82,7 +85,7 @@ In both cases, the **deep learning part of CellPose segmentation is done in 2D**
82
85
The parameters available in `TrackMate-Cellpose` are documented above.
83
86
Below we document the additional parameters that are available when the images are 3D.
84
87
85
-
{% include img src="/media/plugins/trackmate/detectors/trackmate-cellpose-ui-parameters-3D.png" align='center' width='450' %}
88
+
{% include img src="/media/plugins/trackmate/detectors/cellpose/trackmate-cellpose-ui-parameters-3D.png" align='center' width='450' %}
86
89
87
90
_By default, TrackMate uses the `3D mode` in the non-advanced version. You can change it through the `Advanced Cellpose detector` interface._
88
91
@@ -141,7 +144,7 @@ Open the movie to process.
141
144
Start TrackMate by going to {% include bc path='Plugins | Tracking | TrackMate' %}.
142
145
If your movie is large or contains a lot of time frames, we advise you to set-up all the detection and tracking parameters on a cropped movie (both spatially and temporally) and to apply it only after on the full movie. For this, when the first panel of TrackMate opens, you can draw a rectangular ROI to select the area to process. Click on `Refresh ROI` to apply your selection, the `X` and `Y` values should update. You can also set the `T` parameters: first time point to last time point to crop the movie temporally for the parameter tunning.
143
146
144
-
{% include img src="/media/plugins/trackmate/detectors/trackmate-cellpose-tutorial_CP3D_cropmovie.png" width='600' align='center' %}
147
+
{% include img src="/media/plugins/trackmate/detectors/cellpose/trackmate-cellpose-tutorial_CP3D_cropmovie.png" width='600' align='center' %}
145
148
146
149
Click on `Next` to choose the detector and select `Cellpose advanced detector`.
147
150
Choose the path to your python environment where cellpose is installed.
@@ -153,7 +156,7 @@ We don't have the nuclei staining, so we keep the `Optional second channel` to 0
153
156
The `Cell diameter` parameter has a strong effect on the result and the computing time (the images will be rescaled to the trained model scale). Put the average cell diameter in micron and click on `Preview` to test it on the current time frame only.
154
157
Change its value if necessary until you get accceptable detections. If you don't succeed to get a proper segmentation, you can select another pretrained model, try to do the segmentation in the `2D+Z` mode or retrain a model in cellpose 2.0 on your dataset.
155
158
156
-
{% include img src="/media/plugins/trackmate/detectors/trackmate-cellpose-tutorial-CP3D_previews.png" align='center' %}
159
+
{% include img src="/media/plugins/trackmate/detectors/cellpose/trackmate-cellpose-tutorial-CP3D_previews.png" align='center' %}
157
160
158
161
Once the detection parameters give good results on your previews, click `Next` to run the detection on the frames that you selected in the first panel (or on all the movie if you didn't changed the `T` parameter). You reach the `Initial thresholding` panel in which you can remove false positive detections based on the spots quality measure.
159
162
@@ -166,7 +169,7 @@ At any step of the process, you can visualize your movie and your detections in
166
169
If you click on the 🔧 icon at he bottom of TrackMate interface, you get to the panel to set-up the display parameters.
167
170
Click on `3D view` to open the 3D viewer interface. In this interface, you can see in 3D your movie overlayed with your detections. The color display of the detection are synchronized between the 2D and the 3D viewer.
168
171
169
-
{% include img src="/media/plugins/trackmate/detectors/trackmate-cellpose-tutorial_CP3D_3dviewing.png" align='center' %}
172
+
{% include img src="/media/plugins/trackmate/detectors/cellpose/trackmate-cellpose-tutorial_CP3D_3dviewing.png" align='center' %}
170
173
171
174
#### Smoothing the results
172
175
@@ -176,7 +179,7 @@ You can undo the smoothing if the results are not satisfying and try another num
176
179
177
180
Note that Cellpose with `2D+Z` mode will directly gives much smoother detections as it is using the *flow threshold* parameter in the segmentation.
178
181
179
-
{% include img src="/media/plugins/trackmate/detectors/trackmate-cellpose-tutorial-CP3D_smooth.png" align='center' %}
182
+
{% include img src="/media/plugins/trackmate/detectors/cellpose/trackmate-cellpose-tutorial-CP3D_smooth.png" align='center' %}
180
183
181
184
182
185
#### Tracking cells
@@ -187,5 +190,6 @@ Here, you can choose the `Overlap Tracker` with an IOU of 0.25 to obtain an acce
187
190
188
191
When all the parameters have been chosen, go back to the first panel of TrackMate, remove the rectangular ROI and click on `refresh ROI`. This will reset all the parameters to take the full movie in the analysis. You can then perform all the steps with the full movie. All parameters should be set to the latest configuration so you should only have to click on `Next` for each step. The computation of the detection can take some time as it will run a 3D Cellpose segmentation for each frame.
189
192
190
-
{% include img src="/media/plugins/trackmate/detectors/trackmate-cellpose-tutorial_CP3D_tracked.gif" align='center' %}
193
+
{% include img src="/media/plugins/trackmate/detectors/cellpose/trackmate-cellpose-tutorial_CP3D_tracked.gif" align='center' %}
{% include img src="/media/plugins/trackmate/detectors/trackmate-cellpose-sam-R2_multiC.gif" width='400' %} {% include img src="/media/plugins/trackmate/detectors/trackmate-cellpose-sam-01.png" width='200' %}
10
+
{% include img src="/media/plugins/trackmate/detectors/cellpose/trackmate-cellpose-sam-R2_multiC.gif" width='400' %} {% include img src="/media/plugins/trackmate/detectors/cellpose/trackmate-cellpose-sam-01.png" width='200' %}
11
11
12
12
This page describes a detector module for [TrackMate](/plugins/trackmate/index) that relies on the latest version of [cellpose](https://cellpose.readthedocs.io/en/latest/) to segment cells in 2D. It is not included in the core of TrackMate and must be installed via its own [update site](/update-sites/following). It also requires cellpose to be installed on your system and working independently. This tutorial page gives installation details and advices at how to use the cellpose integration in TrackMate.
13
13
@@ -76,13 +76,13 @@ If you have not done it yet, you need to [configure the TrackMate conda path in
76
76
77
77
### Cellpose parameters in the TrackMate UI
78
78
79
-
{% include img src="/media/plugins/trackmate/detectors/trackmate-cellpose-sam-01.png" align='center' width='400' %}
79
+
{% include img src="/media/plugins/trackmate/detectors/cellpose/trackmate-cellpose-sam-01.png" align='center' width='400' %}
80
80
We document these parameters from top to bottom in the GUI.
81
81
82
82
##### `Conda environment`
83
83
84
84
Specify in what conda environment you installed Cellpose-SAM.
85
-
If you get an error at this stage, it is likely because the conda path for TrackMate was not configured properly. Check [this page]((/plugins/trackmate/trackmate-conda-path).
85
+
If you get an error at this stage, it is likely because the conda path for TrackMate was not configured properly. Check [this page](/plugins/trackmate/trackmate-conda-path).
86
86
87
87
##### `Pretrained model`
88
88
@@ -121,14 +121,14 @@ This image comes from the lab of Guillaume Jacquemet and was used in {% include
121
121
122
122
123
123
With all channels:
124
-
{% include img src="/media/plugins/trackmate/detectors/trackmate-cellpose-sam-allchannels.png" align='center' %}
124
+
{% include img src="/media/plugins/trackmate/detectors/cellpose/trackmate-cellpose-sam-allchannels.png" align='center' %}
125
125
126
126
Channel 1 only, in which nuclei are painted in red:
127
-
{% include img src="/media/plugins/trackmate/detectors/trackmate-cellpose-sam-channel-1.png" align='center' %}
127
+
{% include img src="/media/plugins/trackmate/detectors/cellpose/trackmate-cellpose-sam-channel-1.png" align='center' %}
128
128
129
129
Channel 2 only, in which the cell cytoplasm appears in green:
130
-
{% include img src="/media/plugins/trackmate/detectors/trackmate-cellpose-sam-channel-2.png" align='center' %}
130
+
{% include img src="/media/plugins/trackmate/detectors/cellpose/trackmate-cellpose-sam-channel-2.png" align='center' %}
131
131
132
132
Channel 3 only, which is empty:
133
-
{% include img src="/media/plugins/trackmate/detectors/trackmate-cellpose-sam-channel-3.png" align='center' %}
133
+
{% include img src="/media/plugins/trackmate/detectors/cellpose/trackmate-cellpose-sam-channel-3.png" align='center' %}
0 commit comments