Class AssignOverlappingObjects

Object
org.anchoranalysis.annotation.io.assignment.AssignOverlappingObjects

public class AssignOverlappingObjects
extends Object
Creates a one-to-one assignment between two sets of ObjectMasks.

As arbitrary naming, these sets are termed left and right.

An assignment is one-to-one mapping between the first set and the second, borrowing terminology from the assignment problem.

Not all objects must be mapped. An object may only be mapped to maximally one object in the other set.

The Hungarian Algorithm is used to determine the assignment, based upon an overlap function between the corresponding objects. The assignments are chosen to maximize total overlap.

Author:
Owen Feehan
  • Constructor Summary

    Constructors 
    Constructor Description
    AssignOverlappingObjects​(org.anchoranalysis.image.feature.bean.evaluator.FeatureEvaluator<org.anchoranalysis.image.feature.input.FeatureInputPairObjects> featureEvaluator, boolean flatten)  
  • Method Summary

    Modifier and Type Method Description
    OverlappingObjects createAssignment​(org.anchoranalysis.image.voxel.object.ObjectCollection left, org.anchoranalysis.image.voxel.object.ObjectCollection right, double maxAcceptedCost, org.anchoranalysis.image.core.dimensions.Dimensions dimensions)
    Creates an assignment from the objects in left to those in right.
    CostMatrix<org.anchoranalysis.image.voxel.object.ObjectMask> getCosts()
    A matrix linking the overlap between each ObjectMask to each other, respectively as rows and columns.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AssignOverlappingObjects

      public AssignOverlappingObjects​(org.anchoranalysis.image.feature.bean.evaluator.FeatureEvaluator<org.anchoranalysis.image.feature.input.FeatureInputPairObjects> featureEvaluator, boolean flatten)
  • Method Details

    • createAssignment

      public OverlappingObjects createAssignment​(org.anchoranalysis.image.voxel.object.ObjectCollection left, org.anchoranalysis.image.voxel.object.ObjectCollection right, double maxAcceptedCost, org.anchoranalysis.image.core.dimensions.Dimensions dimensions) throws org.anchoranalysis.feature.calculate.FeatureCalculationException
      Creates an assignment from the objects in left to those in right.

      See the class documentation for the algorithm involved.

      Parameters:
      left - the left objects.
      right - the right objects.
      maxAcceptedCost - an upper-maximum cost, above which a mapping will be disallowed between objects.
      dimensions - the dimensions of the scene in which all objects reside.
      Returns:
      a newly created assignment.
      Throws:
      org.anchoranalysis.feature.calculate.FeatureCalculationException - if overlap cannot be calculated.
    • getCosts

      public CostMatrix<org.anchoranalysis.image.voxel.object.ObjectMask> getCosts()
      A matrix linking the overlap between each ObjectMask to each other, respectively as rows and columns.