Binary operations (legacy)

DEPRECATED: This Module has been superseeded by separate Modules for 2D and 3D binary operations.

Description

DEPRECATED: This Module has been superseeded by separate Modules for 2D and 3D binary operations. It will be removed in a future release.

Applies stock binary operations to an image in the workspace. This image must be 8-bit and have the logic black foreground (intensity 0) and white background (intensity 255). Operations labelled "2D" are performed using the stock ImageJ implementations, while those labelled "3D" use the MorphoLibJ implementations. If 2D operations are applied on higher dimensionality images the operations will be performed in a slice-by-slice manner.

Parameters

ParameterDescription
Input imageImage from workspace to apply binary operation to. This must be an 8-bit binary image (255 = background, 0 = foreground).
Apply to input imageWhen selected, the post-operation image will overwrite the input image in the workspace. Otherwise, the image will be saved to the workspace with the name specified by the "Output image" parameter.
Output imageIf "Apply to input image" is not selected, the post-operation image will be saved to the workspace with this name.
Filter modeControls which binary operation will be applied. All operations assume the default ImageJ logic of black objects on a white background. The 2D operations are described in full at https://imagej.nih.gov/ij/docs/guide/146-29.html:
  • "Dilate 2D" Change any foreground-connected background pixels to foreground. This effectively expands objects by one pixel. Uses ImageJ implementation.
  • "Dilate 3D" Change any foreground-connected background pixels to foreground. This effectively expands objects by one pixel. Uses MorphoLibJ implementation.
  • "Distance map 3D" Create a 32-bit greyscale image where the value of each foreground pixel is equal to its Euclidean distance to the nearest background pixel. Uses MorphoLibJ implementation.
  • "Erode 2D" Change any background-connected foreground pixels to background. This effectively shrinks objects by one pixel. Uses ImageJ implementation.
  • "Erode 3D" Change any background-connected foreground pixels to background. This effectively shrinks objects by one pixel. Uses MorphoLibJ implementation.
  • "Fill holes 2D" Change all background pixels in a region which is fully enclosed by foreground pixels to foreground. Uses ImageJ implementation.
  • "Fill holes 3D" Change all background pixels in a region which is fully enclosed by foreground pixels to foreground. Uses MorphoLibJ implementation.
  • "Outline 2D" Convert all non-background-connected foreground pixels to background. This effectively creates a fully-background image, except for the outer band of foreground pixels. Uses ImageJ implementation.
  • "Skeletonise 2D" Repeatedly applies the erode process until each foreground region is a single pixel wide. Uses ImageJ implementation.
  • "Watershed 2D" Peforms a distance-based watershed transform on the image. This process is able to split separate regions of a single connected foreground region as long as the sub-regions are connected by narrow necks (e.g. snowman shape). Background lines are drawn between each sub-region such that they are no longer connected. Uses ImageJ implementation.
  • "Watershed 3D" Peforms a watershed transform on the image. This process is able to split separate regions of a single connected foreground region as long as the sub-regions are connected by narrow necks (e.g. snowman shape). Background lines are drawn between each sub-region such that they are no longer connected. Unlike the 2D ImageJ implementation, this version can use specific markers and be run in either distance or intensity-based modes. Uses MorphoLibJ implementation.
Number of iterationsNumber of times the operation will be run on a single image. For example, this allows objects to be eroded further than one pixel in a single step.
Use markers(3D watershed only) When selected, this option allows the use of markers to define the starting point of each region. The marker image to use is specified using the "Input marker image" parameter. If not selected, a distance map will be generated for the input binary image and extended minima created according to the dynamic specified by "Dynamic".
Input marker image(3D watershed only) Marker image to be used if "Use markers" is selected. This image must be of equal dimensions to the input image (to which the transform will be applied). The image must be 8-bit binary with markers in black (intensity 0) on a white background (intensity 255).
Intensity mode(3D watershed only) Controls the source for the intensity image against which the watershed transform will be computed. Irrespective of mode, the image (raw image or object distance map) will act as a surface that the starting points will evolve up until adjacent regions come into contact (at which point creating a dividing line between the two):
  • "Distance" A distance map will be created from the input binary image and used as the surface against which the watershed regions will evolve.
  • "Input image intensity" The watershed regions will evolve against an image from the workspace. This image will be unaffected by this process. The image should have lower intensity coincident with the markers, rising to higher intensity along the boundaries between regions.
Intensity image(3D watershed only) If "Intensity mode" is set to "Input image intensity", this is the image from the workspace against which the watershed regions will evolve. The image should have lower intensity coincident with the markers, rising to higher intensity along the boundaries between regions.
Dynamic(3D watershed only) If "Use markers" is not selected, the initial region markers will be created by generating a distance map for the input binary image and calculating the extended minima. This parameter specifies the maximum permitted pixel intensity difference for a single marker. Local intensity differences greater than this will result in creation of more markers. The smaller the dynamic value is, the more the watershed transform will split the image.
Connectivity(3D watershed only) Controls which adjacent pixels are considered:
  • "6" Only pixels immediately next to the active pixel are considered. These are the pixels on the four "cardinal" directions plus the pixels immediately above and below the current pixel. If working in 2D, 4-way connectivity is used.
  • "26" In addition to the core 6-pixels, all immediately diagonal pixels are used. If working in 2D, 8-way connectivity is used.
Match Z to XYWhen selected, an image is interpolated in Z (so that all pixels are isotropic) prior to calculation of a distance map. This prevents warping of the distance map along the Z-axis if XY and Z sampling aren't equal.