Class ThresholderSimpleFillHoles2D


public class ThresholderSimpleFillHoles2D extends Thresholder
A thresholder that applies a simple intensity threshold and then fills holes in 2D.

This thresholder first applies an intensity threshold to create a binary image, and then uses ImageJ's "fill" morphological operation to fill holes in each 2D slice.

  • Constructor Details

    • ThresholderSimpleFillHoles2D

      public ThresholderSimpleFillHoles2D()
    • ThresholderSimpleFillHoles2D

      public ThresholderSimpleFillHoles2D(int minIntensity)
      Creates a new ThresholderSimpleFillHoles2D instance.
      Parameters:
      minIntensity - The minimum intensity value for thresholding.

      Voxels with intensity greater than or equal to this value are considered foreground.

  • Method Details

    • threshold

      public BinaryVoxels<UnsignedByteBuffer> threshold(VoxelsUntyped inputBuffer, BinaryValuesByte binaryValues, Optional<Histogram> histogram, Optional<ObjectMask> objectMask) throws OperationFailedException
      Description copied from class: Thresholder
      Thresholds voxels (across a range of values) so that they have only binary range (i.e. two voxel values representing on and off).

      If a mask is used, the voxels outside the object-mask are left unchanged. They will be either identical to the input-volume or 0 if a new buffer needs to be created.

      Specified by:
      threshold in class Thresholder
      Parameters:
      inputBuffer - the voxels to be thresholded.
      binaryValues - what binary values to be used in the output.
      histogram - a histogram if it's available, which must exactly match the intensity-values of voxels after any object-mask is applied. This exists for calculation efficiency.
      objectMask - an object-mask to restrict thresholding to only some region(s) of the voxels.
      Returns:
      a binary-channel as described above, which may possibly reuse the input voxel-buffers.
      Throws:
      OperationFailedException - if the thresholding operation cannot complete successfully.
    • getMinIntensity

      public int getMinIntensity()
      The minimum intensity value for thresholding.

      Voxels with intensity greater than or equal to this value are considered foreground.

    • setMinIntensity

      public void setMinIntensity(int minIntensity)
      The minimum intensity value for thresholding.

      Voxels with intensity greater than or equal to this value are considered foreground.