Filter Labels#

Dialog for the count labels module.

Parameters#

labels layer: The napari labels layer on which to apply filtering.

Remove:

  • Small labels: Removes labels that are smaller than the minimum pixel/voxel area selected.

  • Boundary labels: Removes labels on the boundary of the image.

Minimum pixel/voxel area: Minimum pixel/voxel area to keep. Labels smaller than this threshold will be removed.

Apply to:

  • Current image: Applies the remove selection to the current image in the napari viewer.

  • 2D patches: Applies the remove selection to the entire 2D stack of images. Select this option if batch mode was used during inference.

  • 3D volume: Applies the remove selection to labels in the 3D volume image. Generally should be checked when proofreading 3D segmentations and unchecked when proofreading a stack of 2D segmentations (for example, leave it unchecked when proofreading the output of 2D Batch Mode inference).

Note

If 2D patches is selected, only images where a label mask actually touches the boundary is deleted. If 3D volume is selected, the entire label mask is deleted if at any point the label touches the boundary.

Output#

Remove small labels: Filters and removes labels smaller than a user selected threshold and saves as a new napari labels layer.

Note

If the Minimum pixel/voxel area value is too small, there will be a printout in the terminal stating the smallest label ID and its corresponding area/volume. See example below.

../_images/small_area_example.png

Remove boundary labels: Removes labels on the boundaries of an image and saves as a new napari labels layer.

Note

Removing boundary labels with the 3D volume option selected can take time depending on the number of instances in the label map. For example, when applied to a label map that had ~250 labels, it took roughly ~3 minutes on a mac laptop but for a label map that had ~500 instances it took ~10 minutes to complete on the same mac laptop.

Demos#

Filter small labels module demo video
Filter boundary labels module demo video