Manual Nucleus Segmentation Tutorial

General Information

This tutorial is intended to show the semi-automatic nucleus segmentation procedure.
It is useful when nuclei are too close to be automatically separated.
Follow the first tutorial to learn the basics.


This is a semi-automatic procedure to segment nuclei. It take less than 1 minute per nuclei to an experimented user.
This idea is:
  1. the user manually draw a ROI (Region of Interest) around a nucleus, on a few slices of the stack (at least upper, lower and middle slice of the nucleus)
  2. ROIs are linearly interpolated between drawn nuclei -> it generated a 3D mask that roughly contains a signle nucleus
  3. The mask is adjusted to the original image using a segmentation procedure within the mask.


Create an experiment

Create a new project, a new experiment with one channel image
Add one structure
Save and Import the sample image:
  • Click on Save
  • Download the sample image provided with this tutorial. Unzip the "tangoSampleImageManualNuc.tif" file.
  • Scale option: unselect "use global scale".
  • Select the import file method: choose "BIOFORMAT-LOCI" in this case.
  • Click on the "Import Images" button and select the unzipped file.
  • After the process, a new field will be visible in the data tab.

Draw a nucleus mask manually

In the data tab, select >Manual Nucleus Segmentation>. It will display 2 new lists, the middle-list contains the segmented nuclei and the far-right list is a kind of ROI manager, in which each element represent the ROI at the corresponding slice.
Select the field to be processed in the list.
Click on the input button to open the input image.
Using the freehand selection tool of ImageJ, draw a ROI around a single nucleus, click on add/update ROI: it will record the ROI and associate it to its slice in the far-right list.
Draw ROIs on other slice. At least at the top and the bottom of the nucleus, and when the shape changes rapidly in the Z direction. Consider using ImageJ's Selection Brush tool to modify an existing ROI.
Image Image Image
When all necessary ROIs are drawn, click on interpolate: it will compute ROIs between manually drawn ROIs.
Click on show to display the ROIs on the active image while the slice change. At this step it is possible to adjust ROIs (to record a modification click on add/update ROI )
To create a 3D mask from the ROIs:
  1. create a new object by clicking on New Object
  2. Select the newly created object
  3. Click on ROIs->Mask
  4. To display the global mask image, click on Mask. An image of the size of the input image will show up with the ROIs filled with the label of the current object.

Adjust to the Nucleus

The previously created mask contains a single nucleus, but is not well adjusted to its edges.
To adjust it, we will apply a processing chain within the manually drawn mask.
In this case, the signal-to-noise ratio of the nucleoplasm doesn't allow us to apply a watershed algorithm. We will use a simpler strategy: use a thresholding approach within the mask and then correct the segmented nucleus using post-process (2D fill holes and 3D closing).
To do so, import the supplied processing chain for this tutorial: (as described in the previous tutorial):
  1. Download the sample processing chains and save it to yous disk. Unzip it.
  2. In the connect tab, click on import processing chain and select the unzipped folder.
Assign the processing chain to the nucleus structure:
  1. In the edit processing chain tab, select the structure corresponding to the nucleus (called "nucleus" in our case),
  2. Select the imported template processing chain called manual segmentation
  3. Click on copy from template
  4. Click on save

we will then manually determine the threshold on the pre-filtered image to segment the nucleus, because no automatic method give good results. To display the pre-filtered image:
  1. in the data tab , select the object to process,
  2. check only the box "pre-process & segment",
  3. click on test
  4. select the pre-filtered image and choose the threshold using ImageJ's adjust threshold tool
set this threshold to the segmenter:
in the edit processing chain tab, click on the edit button of the segmenter, set the threshold value and click on save.
In the data tab, test the complete procedure:
check the boxes: pre-filter & segment, intersect with manual mask (if selected the segmented voxel outside the manually drawn mask will be erased) and post-process.
click on test to test the complete procedure.
Click on run to process the selected nucleus (nuclei). The mask of the selected nucleus (nuclei) will be changed on global mask image.
Changes can be reverted by clicking on revert, or saved by clicking on save
ROIs of the selected nucleus (nuclei) can be displayed on any opened image by toggeling on the ROIs and selecting the image to display the ROIs on and then selecting the nucleus (nuclei).

ROIs can still be adjusted slice by slice:
  1. select the nucleus to correct
  2. record its ROIs on the internal ROI manager (button mask -> ROI)
  3. modify ROIs and record the modification (button add/modify ROIs)
  4. record the modifications on the selected nucleus (button ROIs -> mask)
  5. click on save

To segment other nuclei, repeat the steps of the sections Draw a nucleus mask manually and adjust to the nucleus

When enough nuclei are segmented, continue the normal process from the step crop cells, as described in the tutorial.
Caution: if you run the step process nuclei it will erase the manually segmented nuclei