usage:segmentation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
usage:segmentation [2019/07/29 19:12] – [Viewport control] pseudomoanerusage:segmentation [2022/10/20 10:35] (current) pseudomoaner
Line 15: Line 15:
 To run this module, click the **Segmentation** button on the home panel. This should bring up the following GUI: To run this module, click the **Segmentation** button on the home panel. This should bring up the following GUI:
  
-{{ :usage:segmentationannotated.png?800 |}}+{{ :usage:segmentationannotatednew.png?800 |}}
  
 To begin, you will need to set the channel you wish to use for segmentation using the **segmentation channel** dropdown menu. Channel 1 is typically the brightfield/phase channel, with additional channels associated fluorescence images. You will also need to choose if the objects within this image are bright or dark relative to the background. The appropriate option should be selected in the **Foreground colour** field. To begin, you will need to set the channel you wish to use for segmentation using the **segmentation channel** dropdown menu. Channel 1 is typically the brightfield/phase channel, with additional channels associated fluorescence images. You will also need to choose if the objects within this image are bright or dark relative to the background. The appropriate option should be selected in the **Foreground colour** field.
 +
 ===== Viewport control ===== ===== Viewport control =====
  
Line 26: Line 27:
 ===== Parameter selection ===== ===== Parameter selection =====
  
-The key to a high-quality segmentation is the selection of good parameters. To assist with this process, each of the overlays under the **Overlay type** drop-down menu will allow you to optimise the parameters associated with each stage of the segmentation pipeline. We will begin with the default option, **Threshold**. +The key to a high-quality segmentation is the selection of good parameters. To assist with this process, each of the overlays under the **Overlay type** drop-down menu will allow you to optimise the parameters associated with each stage of the segmentation pipeline. We will begin with the default option, **Texture**.
-==== Thresholding ====+
  
-In the first stage of the pipeline, a global intensity threshold is chosen and applied to the image. This provides a general indication of where objects are, without necessarily separating closely-packed individuals. In this overlay, red indicates regions classified as forground (objects).+==== Texture ====
  
-{{ :usage:segmentationthresh.png?800 |}}+In the first stage of the pipeline, a texture metric is applied to the imageThis provides a general separation of foreground (textured regions) and background (untextured regions), without necessarily separating closely-packed objects. In this overlay, red indicates regions classified as forground (objects):
  
-Choose an appropriate threshold by using the slider or the text boxValues should be between 0 (all foreground) and 1 (all background).+{{ :usage:segmentationthreshnew.png?800 |}} 
 + 
 +The texture analysis stage is associated with two parameters: 
 + 
 +  - **Neighbourhood size**: This determines the spatial scale over which the texture is measuredIn general, this value should be around the same as the width of your largest objects (in pixels)
 +  - **Texture Threshold**: This determines the cutoff when binarising the texture metric. Reduce to make more of the image appear as foreground.
  
-<note tip> 
-If the background intensity of your image is highly variable, you may be unable to find an effective global intensity threshold. In these cases, it is usually best to set this threshold to 0 and rely upon ridge detection. 
-</note> 
 ==== Ridge detection ==== ==== Ridge detection ====
  
Line 48: Line 50:
   - **Minimum Ridge Area**: This specifies the minimum size of a binary ridge. Larger values help to remove small ridges created by noise in the image.    - **Minimum Ridge Area**: This specifies the minimum size of a binary ridge. Larger values help to remove small ridges created by noise in the image. 
  
-In these overlays, red regions indicate the binary ridges that are subtracted from the thresholded binary image to generate an initial segmentation:+In this overlay, red regions indicate the binary ridges that are subtracted from the binary texture image to generate an initial segmentation:
  
-{{ :usage:segmentationridge.png?800 |}}+{{ :usage:segmentationridgenew.png?800 |}}
  
 This initial segmentation is next refined by the application of the watershed algorithm. This initial segmentation is next refined by the application of the watershed algorithm.
Line 57: Line 59:
 Choosing next the **Watershed** overlay option, your view should now switch to one consisting of red and yellow outlines: Choosing next the **Watershed** overlay option, your view should now switch to one consisting of red and yellow outlines:
  
-{{ :usage:segmentationwatershed.png?800 |}}+{{ :usage:segmentationwatershednew.png?800 |}}
  
-These indicate the segmentation boundaries set by the combination of the threshold and ridge detection stages (yellow), and the boundaries added by the morphological watershed stage.+These indicate the segmentation boundaries set by the combination of the threshold and ridge detection stages (yellow), and the boundaries added by the morphological watershed stage (red).
  
-As can be seen in the above image, the watershed stage acts to complete the separation of objects that have been mostly (but not completely) separated by thresholding or ridge detection. The strength of the watershed operation can be controlled by the **Watershed threshold** parameter. Lower values increase the number of cuts made by the algorithm, while higher values reduce the number of cuts.+As can be seen in the above image, the watershed stage acts to complete the separation of objects that have been mostly (but not completely) separated by texture analysis or ridge detection. The strength of the watershed operation can be controlled by the **Watershed threshold** parameter. Lower values increase the number of cuts made by the algorithm, while higher values reduce the number of cuts.
  
 ==== Final segmentation ==== ==== Final segmentation ====
  
-When the **Segmentation** overlay is chosen, you will be able to vary the **Object area threshold (low)** and **Object area threshold (high)** parameters. These parameters set the minimum and maximum area an object is allowed to fall between to be included in the final segmentation, in pixels. In this overlay, each segmented object is indicated by a separate colour:+When the **Segmentation** overlay is chosen, you will be able to vary the **Object area threshold (low)** and **Object area threshold (high)** parameters. These parameters set the minimum and maximum area (in pixels) an object is allowed to fall between to be included in the final segmentation. In this overlay, each segmented object is indicated by a separate colour:
  
-{{ :usage:segmentationfinal.png?800 |}}+{{ :usage:segmentationfinalnew.png?800 |}} 
 + 
 +The two segmentation refinement checkboxes provide additional tools to further improve the quality of your segmentation: 
 + 
 +  * **Remove halos**: This checkbox is intended for use with objects that are surrounded by bright halos, particularly phase-contrast images. The texture detection stage can struggle to separate these halos from the cell bodies, resulting in unwanted chunks of halo being detected as objects in the final segmentation. Upon selection of this option, the system will measure the average intensity of each segmented object and discard any that are substantially lighter than the dark population of objects. 
 + 
 +<note warning> 
 + 
 +If some frames of your dataset do not contain two distinct populations of segmented objects, this option will erroneously discard some of your target objects. If in doubt, leave the remove halos box unchecked.  
 + 
 +</note>  
 + 
 +{{ :usage:remhalosdemo.png?800 |}} 
 + 
 +  * **Recursive watershed**: If the set of segmentation stages up to this point fails to separate some objects, they will typically remain in the image as large, fused clumps. By default, these clumps are removed when the **Object Area Threshold (High)** slider is set to a value smaller than their area. However, an alternative approach is to attempt to resegment these objects using less stringent parameters. By checking this box, you can recursively apply the watershed segmentation stage, progressively reducing the watershed threshold until all sub-objects are smaller than the specified threshold. 
 + 
 +<note> 
 + 
 +The recursive watershed algorithm will terminate if the watershed threshold falls too low, and any remaining objects larger than the specified upper area threshold will be discarded. 
 + 
 +</note> 
 + 
 +{{ :usage:recurswaterdemo.png?800 |}}
  
 Once you are happy with your final segmentation, press the button labelled **Process 'em all** to start segmentation of the entire dataset. This will generate a new directory in your root directory and fill it with the segmented images.  Once you are happy with your final segmentation, press the button labelled **Process 'em all** to start segmentation of the entire dataset. This will generate a new directory in your root directory and fill it with the segmented images. 
  
 Wait until the loading bar indicating segmentation progress has disappeared, and then close the segmentation GUI. You should now be able to click the next button in the home panel, allowing access to the [[usage:feature extraction|feature extraction module]]. We will move to this in the next part of the tutorial.   Wait until the loading bar indicating segmentation progress has disappeared, and then close the segmentation GUI. You should now be able to click the next button in the home panel, allowing access to the [[usage:feature extraction|feature extraction module]]. We will move to this in the next part of the tutorial.  
 +
 +===== Video demonstration =====
 +
 +{{ youtube>-nW_VSPWlyA?large }}
  • usage/segmentation.1564423973.txt.gz
  • Last modified: 2019/07/29 19:12
  • by pseudomoaner