Skip to content

Commit 5837ede

Browse files
authored
Merge pull request #394 from imagej/rework-trackmate-cellpose-docs
Rework the doc pages for the Trackmate Cellpose and Omnipose integration
2 parents 5e26291 + 64f356f commit 5837ede

File tree

83 files changed

+178
-835
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+178
-835
lines changed

_pages/plugins/trackmate/detectors/trackmate-cellpose-advanced.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ artifact: sc.fiji:TrackMate-Cellpose
88
section: TrackMate-Cellpose.:Usage:cellpose parameters in the TrackMate UI.
99
---
1010

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' %}
1212

1313
This page describes the advanced version of the cellpose detector in [TrackMate](/plugins/trackmate/index), documented [here](trackmate-cellpose).
1414
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
3333
We describe here the advanced parameters that are specific to the advanced detector.
3434
Core parameters are described in the [TrackMate-Cellpose](trackmate-cellpose) documentation page.
3535

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' %}
4537

4638
##### `Flow threshold`
4739
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
5244

5345
_By default in the non-advanced option, this parameter is `0.4`._
5446

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+
5554

56-
##### `Resample`
55+
##### `Do not resample`
5756

5857
Cellpose resizes your image to have the mean cell size (`mean diameter` parameter above) equals to the mean diameter of the trained model.
5958
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
6261
- 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).
6362
- 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.
6463

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+
<!--------------
6669
6770
#### Parameters for 3D stacks
6871
@@ -82,7 +85,7 @@ In both cases, the **deep learning part of CellPose segmentation is done in 2D**
8285
The parameters available in `TrackMate-Cellpose` are documented above.
8386
Below we document the additional parameters that are available when the images are 3D.
8487
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' %}
8689
8790
_By default, TrackMate uses the `3D mode` in the non-advanced version. You can change it through the `Advanced Cellpose detector` interface._
8891
@@ -141,7 +144,7 @@ Open the movie to process.
141144
Start TrackMate by going to {% include bc path='Plugins | Tracking | TrackMate' %}.
142145
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.
143146
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' %}
145148
146149
Click on `Next` to choose the detector and select `Cellpose advanced detector`.
147150
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
153156
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.
154157
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.
155158
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' %}
157160
158161
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.
159162
@@ -166,7 +169,7 @@ At any step of the process, you can visualize your movie and your detections in
166169
If you click on the 🔧 icon at he bottom of TrackMate interface, you get to the panel to set-up the display parameters.
167170
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.
168171
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' %}
170173
171174
#### Smoothing the results
172175
@@ -176,7 +179,7 @@ You can undo the smoothing if the results are not satisfying and try another num
176179
177180
Note that Cellpose with `2D+Z` mode will directly gives much smoother detections as it is using the *flow threshold* parameter in the segmentation.
178181
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' %}
180183
181184
182185
#### Tracking cells
@@ -187,5 +190,6 @@ Here, you can choose the `Overlap Tracker` with an IOU of 0.25 to obtain an acce
187190
188191
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.
189192
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' %}
191194
195+
----------->

_pages/plugins/trackmate/detectors/trackmate-cellpose-sam.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
title: TrackMate-Cellpose-SAM
33
categories: [Segmentation,Tracking,Deep Learning]
44
icon: /media/icons/cellpose.png
5-
description: cellpose-SAM integration in TrackMate.
5+
description: Cellpose-SAM integration in TrackMate.
66
categories: [Segmentation,Tracking,Machine Learning]
77
artifact: sc.fiji:TrackMate-Cellpose
88
---
99

10-
{% 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' %}
1111

1212
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.
1313

@@ -76,13 +76,13 @@ If you have not done it yet, you need to [configure the TrackMate conda path in
7676

7777
### Cellpose parameters in the TrackMate UI
7878

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' %}
8080
We document these parameters from top to bottom in the GUI.
8181

8282
##### `Conda environment`
8383

8484
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).
8686

8787
##### `Pretrained model`
8888

@@ -121,14 +121,14 @@ This image comes from the lab of Guillaume Jacquemet and was used in {% include
121121

122122

123123
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' %}
125125

126126
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' %}
128128

129129
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' %}
131131

132132
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' %}
134134

0 commit comments

Comments
 (0)