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 Summary
Constructors Constructor Description MultiScaleObject(Supplier<org.anchoranalysis.image.voxel.object.ObjectMask> inputScale, Supplier<org.anchoranalysis.image.voxel.object.ObjectMask> modelScale)Creates with a separate supplier of anObjectMaskfor each respective scale. -
Method Summary
Modifier and Type Method Description static <T> MultiScaleObjectextractFrom(DualScale<T> dual, Function<T,org.anchoranalysis.image.voxel.object.ObjectMask> extractObject)static <T, S> MultiScaleObjectextractFrom(DualScale<T> dual1, DualScale<S> dual2, BiFunction<T,S,org.anchoranalysis.image.voxel.object.ObjectMask> extractObject)org.anchoranalysis.image.voxel.object.ObjectMaskgetInputScale()Gets theObjectMaskat the scale associated with the input-image.org.anchoranalysis.image.voxel.object.ObjectMaskgetModelScale()Gets theObjectMaskat the scale associated with the segmentation.
-
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 anObjectMaskfor each respective scale.The suppliers will be cached internally, so are guaranteed to be called maximally one time.
- Parameters:
inputScale- supplies anObjectMaskfor the input-scale.modelScale- supplies anObjectMaskfor 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 newMultiScaleObjectby extracting aObjectMaskfrom aDualScale.This extract occurs lazily, only when needed.
- Type Parameters:
T- the element-type of theDualScale.- Parameters:
dual- theDualScalethe object is extracted from.extractObject- a function applied to the respective scale inDualScaleto extract anObjectMask.- 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 newMultiScaleObjectby extracting aObjectMaskfrom twoDualScales.This extract occurs lazily, only when needed.
- Type Parameters:
T- the element-type ofdual1.S- the element-type ofdual2.- Parameters:
dual1- the firstDualScalethe object is extracted from.dual2- the secondDualScalethe object is extracted from.extractObject- a function applied to the respective scale in the twoDualScales respectively to extract anObjectMask.- Returns:
- a newly created
MultiScaleObject, as per above.
-
getInputScale
public org.anchoranalysis.image.voxel.object.ObjectMask getInputScale()Gets theObjectMaskat the scale associated with the input-image.- Returns:
- the object.
-
getModelScale
public org.anchoranalysis.image.voxel.object.ObjectMask getModelScale()Gets theObjectMaskat the scale associated with the segmentation.- Returns:
- the object.
-