The seeded watershed algorithm is an image segmentation algorithm for interactive object extraction from image data. The algorithm input is user-defined object markers (see example below) for the inside (green) and outside (red) of an object. From these markers, an initial segmentation is calculated that can be refined interactively. The seeded watershed relies on discernible object boundaries in the image data and not on the inner appearance of an object like for example the pixel classification workflow.
While the Pixel Classification module is useful for segmenting objects with discernible brightness, color or textural differences in comparison to their surroundings, the carving module’s purpose is to aid in the extraction of objects from images that are only separable by their boundary - i.e. objects that do not differ from the rest of the image by their internal appearance.
From the two example images above, the left image is clearly more suitable for the classification module since the cell cores have a strong red color component in comparison to their surrounding. The right image, on the other hand, is a good example for the applicability of the seeded watershed segmentation (the problem setting is the segmentation of a single cell from electron microscopy image of neural tissue) since the neural cells have similar color distributions but can be separated by the dark cell membranes dividing them. (NOTE: the seeded watershed could also be applied to segment individual cell cores in the left image interactively, but in such a case where there is a clear visible difference between the objects of interest and their surrounding the pixel classification module is a better choice.)
The algorithm is applicable to a wide range of segmentation problems that fulfill these properties. In the case of data where the boundaries are not clearly visible or in the case of very noisy data, a boundary detection filter can be applied to improve results - this is the topic of the following section.
Assuming the user has already created or loaded an existing ilastik project and added a dataset, the first step is to switch to the Preprocessing Applet where the filter selection and computation are performed.
Here the user can select how boundaries are represented in the image.
In the example image above, a good boundary choice would clearly be dark lines.
To check if the computed boundaries visually correspond with the edges in the image the visibility of the Filtered Data layer can be toggled by clicking on the eye icon () in that layer:
If the boundary map looks too noisy or overly smooth the size of the smoothing kernel needs to be changed with the sigma option. The Filtered Data layer is updated when the user changes the size of the smoothing kernel. This setting should be changed until a satisfactory boundary map is obtained.
When everything looks fine, the user can click on the Run Preprocessing button to calculate a sparse supervoxel graph of the image and boundary map which will speed up segmentation times.
Note: The preprocessing may take a long time depending on the size of the dataset. On a i7 2.4GHz computer a 500×500×500 3D dataset requires 15 minutes of preprocessing.
After the necessary preprocessing the interactive segmentation of objects in the labeling applet is the next step.
Two different types of seeds exist, Object seeds and Background seeds - per default the background seed receives a higher priority such that the background seed is preferred in the case of ambiguous boundaries.
After marking the objects of interest with an object seed and the outside with a background seed the button Segment can be clicked to obtain a seeded watershed segmentation starting from the seeds.
The seeds can be refined by drawing markers, the currently active seed type can be selected on the left side by clicking on the corresponding seed. To erase erroneous markers, the Brush mode (below the seeds) needs to be changed to the eraser to switch back to drawing mode the paint brush item has to be activated again.
Additional available interactions include:
To learn more about how to navigate the data (**scroll, change slice, enable/disable overlays, change overlay capacity etc. **) please read the Navigation guide.
The seeded watershed algorithm of the module has some advanced options which can be changed to obtain improved segmentations when the default settings are not sufficient.
These additional options described below can be displayed by scrolling down in the labeling applet on the left side.
Once the user has successfully segmented an object, the result can be stored by clicking on the Save As button. A dialog will pop up that asks for the object name, by default it will be generated from Object name prefix and sequential number:
After saving an object, all existing markers will be removed to allow segmenting a new object from scratch. To see which objects have already been segmented and saved the Completed Segments overlay can be enabled by clicking on the eye icon () in that layer:
already segmented (and saved) objects will be highlighted to prevent segmenting something twice.
Sometimes it is necessary to refine the segmentation of an already saved object. To do so, click on the Browse objects button and load the corresponding object.
Right-clicking on the highlighted object in Completed segments overlay and navigating to a submenu with object name (in this case it’s “Object 1”) provides the following options:
Wonderful users of ilastik have created these tools to post-process carving results and made them available for all: