- Edit segmentation on single time frame
- Edit segmentation on several time frames
- Cleaning options: general cleaning/checking of the segmentation and EpiCure files to ensure.
- Group cells options: classify cells into group (type) of cells.
- ROI options: apply some process to only some drawn region.
-
Seeds options: to perform a watershed segmentation from several placed seed points.
Edit segmentation on single time frame
EpiCure
proposes features to ease the manual segmentation correction on single time frame (the current one), through several shortcuts.
Shortcuts
The segmented cells are represented as label. There are several possibility for label edition in Napari
+ extra features from EpiCure
.
EpiCure shortcuts are linked to the Segmentation
layer, so it should be selected for the shortcuts to work.
General shortcuts are documented here.

-
You can merge two neighboring cells that were wrongly segmented as 2 instead of one cell.
EpiCure
will relabel one of these two cell with the other cell label, and performs a morphological closing to bring them together if they are not touching. Note that if there is another cell is between, they cannot be merged; you will get two cells with the same label. Press Control + left-click to merge 2 cells, starting from inside the first cell until the second cell with the mouse button clicked. -
You can also split one cell that was wrongly segmented as one into the two correct separated cells.
Epicure
will do a watershed separation to find the limits of the two cells. Press Control + right-click across the junction to split the cell, starting from the middle of the first cell, until the middle of the second cell with the mouse button clicked. The program uses the first point of the dragged-click as a seed for the first cell, and the last point of the dragged-click as the second seed. If it fails, changing the starting and final points can improve the separation. -
A cell can also be split by drawing the junction (usefull when intensities are very messy making watershed separation to fail). Press Alt + right-click and draw the junction, keeping the right button clicked all along. The plugin will then split the cell in 2, one with the previous value and the new one with the maximum label + 1 value. If your line drawing spread over the neighbor cells, it will not affect them.

-
Press 2 to switch to drawing mode or click on the pencil icon. You can draw a label with this pencil tool. When it is selected, it will draw with the current value in the field below. You can choose the precision of your drawing with the
brush stroke
parameter (the brush size can be decreased with [ and increased with ]. -
Press 3 to switch to fill mode. To replace a whole label by a new value (label), you can use the
fill
option. Put the desired value in the label field and click on the label to fill with it. -
To select a label, you can put the value in the
label
field or you can use the picker tool and click on the corresponding area. Press 4 to switch to picker mode. -
To delete a label, put
0
as the current value (or press 1), select thefill
tool and click on the label to remove. Or right-click on a label to erase it directly. -
To draw a new cell, you have to select a value that is not used yet in all the movie. The simpler is to use the maximal current value and add one to be sure to use a new value. You can get this value by pressing m. It will directly put the max value + 1 in the active label field and active the drawing mode.
-
The
preserve labels
option allows you to freeze other labels than the current active one. If you try to draw on top of another label, it will not work as the other labels have been locked. This is convenient when you draw a new label to be sure to draw the new cell just against the other ones without modifying them. If you try to draw on a label when this option is activated, you will get an error message appearing.
Complete list of Napari label layer shortcuts (From File>Preferences>Shortcuts):
Edit segmentation on several time frames
Manual tracking edition
Press t to go into manual tracking mode (a message should appear when you enter this mode). Left-click on the cell to track from the beginning of its track to its end.
The first left-click that you do would determine the id of the track to edit (the cell value that you clicked), and the movie will go to the next frame. Then, for each left-click, the cell below the cursor will be set to this track id value and the movie will move to the next frame.
To finish the track editing, right-click and a confirmation message will appear. If you reach the end of the movie and do one more left-clik, the manual tracking mode will also be stopped.
Cleaning options
Options to ensure clean and correct EpiCure files.
Remove border cells
Remove all segmented cells that touch the spatial borders of the image. This parameter allows to get rid of cells that are partially outside of the imaged region and thus not complete.
The parameter Border width
allows to extend the requirement for the cells to be considered as fully inside. Cells that have at least one pixel at a distance less than Border width
pixels from the image limits will be removed.
Note that this action will be applied to all the time frames of the movie, and cannot be cancelled (if you wish to cancel it, you then need to restart EpiCure without saving the files).
Sanity check
This option performs several checks to ensure that the files follows EpiCure's standards and can fix some errors.
For example, the tracks must not have frame gaps (missing one frame). If that happens, the sanity check
option will detect it and fix it by splitting the gap in two different gaps.
If some napari layers had been wrongly closed, this step will also re-open them.
It also checks if the labels seemed ok or if something is weird.
Group cells options
Allows to create group of cells (classify them). Cells can be manually assigned to a cell group by clicking on them. This is useful to distinguish different type of cells visually or/and in the analysis in the Outputs options.
Group name
allows to choose the name to give to a new Group of cells, or to assign a cell to the current Group name
group.
A cell can be assigned to the current group by holding Shift+Left click on the cell. Shift+Right click will remove the cell under the cursor from its current group, and set it as unassigned.
Show groups
will add a Groups
layer in Napari, in which the cell are colored by the group they are in. Cells that are not in any group are black.
Reset groups
remove all created groups. All cells are not in any groups.
Cells inside ROI to group
: assign all the cells that are inside the currently selected ROI in the current frame (in the ROIs
layer) to the current group (set by Group name
). Cells that are assigned to a group are assigned all along the track (in all frames where this cell is present).
When the segmentation is saved by clicking on s when the Segmentation
layer is active, the group information is also saved, in the EpiCure data file (file in the epics
folder that ends with _epidata.pkl
. When the movie is reopened in EpiCure, it will be automatically reloaded.
ROI options
This option allows to do operations on several neighboring cells at once, by selecting a region.
Draw a selection/Region of Interest
When you select the Selection option
in the Edit
panel, press the first button Draw/Select ROI
to draw a new shape or select an existing one. The shapes should be in the Drawings
layer, by default not visible. When you click on this button, the layer will be visible and active.
Choose the drawing tool that you want (ellipse, polygon, rectangle, triangle), the shape should be a closed one (so not a line). Draw the contour of the region that you want to use. The selected cells will be all the ones that have their centroids inside the drawn shape in the current frame.
If the selected cells (labels) are present in other frames (tracking has been done), they will also be selected.
Remove cells inside ROI
This will remove all the cells that are inside the currently selected shape/ROI. However, if some of those cells are "checked", they will not be removed.
If no shape is selected, but there is exactly one shape in the Drawings
layer, this shape will be selected. Otherwise, an error message will show off.
Seeds options
This option performs an automatic segmentation of cells starting from manually placed points (seeds).
Manual positioning of seeds
To place/add seeds, you can either check the Seed options
parameter in the Edit
panel, press create seeds layer
if it's not there yet and select the +
button in the top left panel to add points.
Shortcut: You can directly press e when the Segmentation
layer is active, and each left-click will place a new seed if there is no cell below. right-click to stop adding seeds.
Automatic positioning of seeds from previous time point
In the case of movies, we can use the information from the previous frame to place the seeds in the region that are not segmented yet. This option Load seeds from previous time point
simply takes the centers of each cell of the previous frame as a seed.
Automatic segmentation from seeds
Several methods to segment the cells from the seeds are proposed:
- Intensity-based: classic watershed method, starting filling from the seeds and stopping at high intensity gradient
- Distance-based: purely based on the distance to the seed points, voronoi-like segmentation.
- Diffusion-based: random walk approach from the seeds. The segmentation is spread by diffusion from the seeds through similar intensity pixels in the image (sensitive to both the distance and the intensity).
The parameter max cell radius
controls the maximum cell size. It will constrained the segmentation for the Distance-based
method and is used to crop the image around the seeds for computation efficiency with the two other methods.
Select the segmentation method and click on Segment cells from seeds
to run it.