Class ColoredObjectCollection

Object
ColoredObjectCollection

public class ColoredObjectCollection extends Object
Associates a ColorList with a ObjectCollection

Operations ensure both maintain an identical number of objects

Author:
Owen Feehan
  • Constructor Details

    • ColoredObjectCollection

      public ColoredObjectCollection()
      Create with an empty collection.
    • ColoredObjectCollection

      public ColoredObjectCollection(Stream<ColoredObject> stream)
      Create from a stream of ColoredObjects.
      Parameters:
      stream - the stream.
    • ColoredObjectCollection

      public ColoredObjectCollection(ObjectMask object, RGBColor color)
      Create with a single object and color.
      Parameters:
      object - the object
      color - the color
    • ColoredObjectCollection

      public ColoredObjectCollection(ObjectCollection objects, ColorList colors)
      Create with an existing object and color list.

      Both arguments are reused internally as data-structures.

      Parameters:
      objects - the object
      colors - the colors, which must have the same number of items as objects
  • Method Details

    • addObjectsWithColor

      public void addObjectsWithColor(ObjectCollectionProvider provider, RGBColor color) throws OperationFailedException
      Adds objects from a ObjectCollectionProvider all with one specific color
      Parameters:
      provider - provides the objects
      color - the color
      Throws:
      OperationFailedException - if the provider cannot create the objects
    • flattenZ

      public ColoredObjectCollection flattenZ()
      A maximum-intensity projection.

      This flattens across z-dimension, setting a voxel to on if it is on in any one slice.

      This is an immutable operation.

      Returns:
      a new ColoredObject flattened in Z dimension.
    • deriveColorList

      public ColorList deriveColorList()
      Derives a ColorList from the collection.
      Returns:
      a newly created list of colors, in identical order to the collection.
    • streamObjectWithProperties

      public Stream<ObjectWithProperties> streamObjectWithProperties()
      Creates a stream of ObjectWithProperties derived from the collection.
      Returns:
      a newly created stream, in identical order to the collection.