resegment from tree

‘Resegment from tree’ uses the lineage tree structure to fix the underlying segmentation and tracking. It is very handy, and fixes the vast majority of segmentation and tracking mistakes automatically. This page describes how to use it.

Launch LEVER, and either (1) segment and track your dataset or (2) open an already segmented and tracked dataset.

LEVER will open the image window and the lineage window. Arrange the windows on your desktop so you can see them both (hint – windows key+left arrow and windows key+right arrow).

For best results, select the first cell on the clone you want to resegment. Choose ‘edit/end tree here’, then ‘edit/lock tree’ to start with a clean slate, and follow the instructions below.

General Controls

These work in and out of resegment mode, but you will primarily use them inside.

Scroll Wheel moves through the movie one frame at a time

Middle Mouse click will split a cell into two, or add a new cell if there is none there

Ctrl + click allows you to select multiple cells at once

Clicking and dragging allows you to swap cell labels

Ctrl + L toggles cell labs

Ctrl + B shows sibling lines

Page Up moves 5 frames into the future

Page Down moves 5 frames back

Right Click Menu – Movie Window

Add mitosis

Change label is self explanatory – note that you need to use a valid label, which could be either a cells numerical label or a case sensitive short label.

Number of cells – can be used instead of middle mouse click, to add a hull or divide one hull into multiple ones.

Remove cell (this frame) is self explanatory

Remove from tree removes the a cell for the rest of the tree – done in conjunction w/ marking a cell as dead

Multi tree

Phenotype submenu: only worry about ‘died’, if two cells merge and do not separate for many frames, mark the lamer colored one dead and remove it from the tree.

Finding clones to focus on

Toggle off cell labels (ctrl + L), then click on the bottom of the lineage tree. You want a large grouping of cells. Gradually follow that grouping backwards at ~300 frame intervals to find the original cell. Note that the cell grouping should not go off (a fully zoomed out) screen.

selecting a cell(s) for reseg
Picking which cells to work on

In the image below green arrows point to good cell groupings, the yellow to a grouping that goes off-screen, and red to a cell that does not do anything.

reseg cell selection
The two green clones are the ones we want to work on.

There may be multiple original cells that multiply into clones that intermingle. To make your life easier, LEVER has a handy function that allows to make a multi-tree, or extended family, where you can resegment several clones at once.To add cells to an extended family, you need at least two cells that are close to each other at the very beginning. Pick on, right click it, navigate to the ‘Multitree’ submenu and select ‘Add To Extended Family’

selecting cells for multitree
Work on interacting clones simultaneously
launching reseg
Launching Resegment from tree

This is what launching resegment from tree mode will look like. That pop-up box asks for root cell IDs. They are the numerical labels for the 4 original cells that this lineage began from. You can see their numbers in the large circles at the top of the lineage tree in the right tab.

Congratulations, you have launched resegment from tree mode. Now, your work will revolve around noting mitotic events and correcting the odd tracking error.

Controls in ‘resegment from tree’ mode

reseg buttons w circle

After you launch ‘resegment from tree’, you will notice a new toolbar with 4 handy dandy buttons.

[FORWARD] This will resegment only the very next frame.

[PLAY] This is the best way to go. It resegments continuously. If you pause, it will still resegment the next frame

[BACKWARD] Undoes that frames resegmentation.

[STOP] The stop button will exit resegment mode.

After you exit resegment from tree, if you press ‘undo’ it will undo the entire process.

Resegment UI on the Lineage Window

Notice in the picture below there is a red line with circles on it. That red line indicated the current frame shown in the movie. If you are not at the latest frame, there will be a blue line that shows where it is. Do not make changes beyond the last frame re-segmented, except in the case of a database error, which will be elaborated on later.

The circles show that the movie is displaying the most recently re-segmented frame, and that those cells with circles are up last seen on that frame. A specific cell -in this case G- without a circle means  LEVER does not have a place for the cell in this current frame

red circles
Red circles on the red line indicate you are on the most recent frame. I removed ‘G’ manually for illustration purposes.
red blue no circles
No circles when the red and blue lines do not coincide.


LEVER sometimes loses a cell for a frame because it cannot find a spot for it. This is common when two cells are overlapped or a cell does not have an obvious delineation. This is not something to worry about. Most of the time LEVER will fix it for the next frame.

Only if LEVER does not place the cell correctly after multiple frames, or places it in the wrong place, will you need to pause resegmenting and manually correct it.

Adding a Mitosis event

mitosis 1
These two cells just split off. LEVER did not catch the mitosis, so this one is on you.
mitosis 2
Middle mouse click to break that hull in two.
mitosis 3
Right click on the new cell (not the original one) and click the first option, ‘Add Mitosis’.
mitosis 4
Add that new cell as a sibling to the original cell, 34502.
mitosis 5
You have successfully added a mitosis.

Helpful Hints

Cells tend to split at roughly equal speeds and intervals. If one just split, more will probably follow.

Cells might not be tracked correctly for a frame but will normally revert to the correct location. Only if the incorrect tracking persists for 2+ frames is it an issue.

Evil Errors

The most common error is the diabolical database error.

This can be caused by several things.

The simplest to fix is a mistake in labeling. If you change a cell’s label to something that does not exist at that frame, this error will occur. Simply accept and then correctly label that cell.

The next situation is where lever has gotten confused with some cells that are very close. The normal database error will popup, and after you close that, another window will appear, telling you the long labels of the offending cells. Remember those labels. Go to the view tab and turn off ‘Show Short Labels’. Locate the offending cells and go one frame past where you keep getting stuck (if you are stuck at 301, you should go to 302). Manually add whichever cells are causing the issue to the movie, where they should be. Middle mouse click and, if necessary, label the cells.

In the third instance, a cell will have been lost for a frame, and then you try and make a change with it the frame after. If cell P is correct at frame 601, gets lost at 602, and splits at 603, adding P and then trying to add a mitotic event at 603 will cause the database error. This can be fixed by adding cell P at frame 602.

Finishing a Clone

After you are done with a clone, there a still a few things you need to do.

edit tab
The last three options are the ones relevant here

The following commands can be found in the edit tab of both the movie and the lineage window.

If you could not accurately track cells to the end of the movie because there are to many cells or quality degrades to many frames, select ‘Stop tree here’.

Lock tree (Ctrl + U) is used if you are confident in the tree’s structure but not its segmentation or tracking

Freeze Tree (Ctrl + R) means that you are completely done.

Remember that even if you fully tracked a clone in your movie, there could still be others clones that you can track. It is not uncommon to have 2, 3, or even 4 clones satisfy the requirements laid out here.