Class ObjectsFromConnectedComponentsFactory

Object
ObjectsFromConnectedComponentsFactory

public class ObjectsFromConnectedComponentsFactory extends Object
Creates a ObjectCollection from the connected-components of a mask or binary-voxels.
Author:
Owen Feehan
  • Constructor Details

    • ObjectsFromConnectedComponentsFactory

      public ObjectsFromConnectedComponentsFactory()
      Creates to use a small-neighborhood.

      See NeighborhoodFactory.

    • ObjectsFromConnectedComponentsFactory

      public ObjectsFromConnectedComponentsFactory(boolean bigNeighborhood)
      Creates to use a specified type of neighborhood.
      Parameters:
      bigNeighborhood - if true, use 8-Connectivity instead of 4 in 2D, and 26-connectivity instead of 6 in 3D, as per NeighborhoodFactory.
    • ObjectsFromConnectedComponentsFactory

      public ObjectsFromConnectedComponentsFactory(int minNumberVoxels)
      Creates to use a minimum number of voxels for each connected component.
      Parameters:
      minNumberVoxels - the minimum number of voxels that must exist for an independent connected-component, otherwise the connected-component is omitted.
    • ObjectsFromConnectedComponentsFactory

      public ObjectsFromConnectedComponentsFactory(boolean bigNeighborhood, int minNumberVoxels)
      Creates to use a specified type of neighborhood, and minimum number of voxels.
      Parameters:
      bigNeighborhood - if true, use 8-Connectivity instead of 4 in 2D, and 26-connectivity instead of 6 in 3D, as per NeighborhoodFactory.
      minNumberVoxels - the minimum number of voxels that must exist for an independent connected-component, otherwise the connected-component is omitted.
  • Method Details

    • createUnsignedByte

      public ObjectCollection createUnsignedByte(BinaryVoxels<UnsignedByteBuffer> voxels)
      Finds the connected-components in unsigned byte voxels.

      Connected-components are considered to be contiguous neighboring voxels with on states.

      Parameters:
      voxels - the voxels to find connected-components in. Note that these voxel values are changed, as the algorithm runs.
      Returns:
      the connected-components, each encoded as an ObjectMask.
    • createUnsignedInt

      public ObjectCollection createUnsignedInt(BinaryVoxels<UnsignedIntBuffer> voxels)
      Finds the connected-components in unsigned int voxels.

      Connected-components are considered to be contiguous neighboring voxels with on states.

      Parameters:
      voxels - the voxels to find connected-components in. Note that these voxel values are changed, as the algorithm runs.
      Returns:
      the connected-components, each encoded as an ObjectMask.