Class MultiScaleObject

Object
org.anchoranalysis.image.inference.segment.MultiScaleObject

public class MultiScaleObject
extends Object
An ObjectMask that exists at multiple scales.

Specifically the scales are:

  • the scale associated with the input-image.
  • the scale associated with the segmentation (usually a scaled down version of the above).
Author:
Owen Feehan
  • Constructor Details

    • MultiScaleObject

      public MultiScaleObject​(Supplier<org.anchoranalysis.image.voxel.object.ObjectMask> inputScale, Supplier<org.anchoranalysis.image.voxel.object.ObjectMask> modelScale)
      Creates with a separate supplier of an ObjectMask for each respective scale.

      The suppliers will be cached internally, so are guaranteed to be called maximally one time.

      Parameters:
      inputScale - supplies an ObjectMask for the input-scale.
      modelScale - supplies an ObjectMask for the model-scale.
  • Method Details

    • extractFrom

      public static <T> MultiScaleObject extractFrom​(DualScale<T> dual, Function<T,​org.anchoranalysis.image.voxel.object.ObjectMask> extractObject)
      Creates a new MultiScaleObject by extracting a ObjectMask from a DualScale.

      This extract occurs lazily, only when needed.

      Type Parameters:
      T - the element-type of the DualScale.
      Parameters:
      dual - the DualScale the object is extracted from.
      extractObject - a function applied to the respective scale in DualScale to extract an ObjectMask.
      Returns:
      a newly created MultiScaleObject, as per above.
    • extractFrom

      public static <T,​ S> MultiScaleObject extractFrom​(DualScale<T> dual1, DualScale<S> dual2, BiFunction<T,​S,​org.anchoranalysis.image.voxel.object.ObjectMask> extractObject)
      Creates a new MultiScaleObject by extracting a ObjectMask from two DualScales.

      This extract occurs lazily, only when needed.

      Type Parameters:
      T - the element-type of dual1.
      S - the element-type of dual2.
      Parameters:
      dual1 - the first DualScale the object is extracted from.
      dual2 - the second DualScale the object is extracted from.
      extractObject - a function applied to the respective scale in the two DualScales respectively to extract an ObjectMask.
      Returns:
      a newly created MultiScaleObject, as per above.
    • getInputScale

      public org.anchoranalysis.image.voxel.object.ObjectMask getInputScale()
      Gets the ObjectMask at the scale associated with the input-image.
      Returns:
      the object.
    • getModelScale

      public org.anchoranalysis.image.voxel.object.ObjectMask getModelScale()
      Gets the ObjectMask at the scale associated with the segmentation.
      Returns:
      the object.