Class SuppressNonMaximum<T extends InferenceModel>
Object
org.anchoranalysis.bean.AnchorBean<B>
org.anchoranalysis.bean.initializable.InitializableBean<T,org.anchoranalysis.image.bean.nonbean.init.ImageInitialization>
org.anchoranalysis.image.bean.ImageBean<T>
org.anchoranalysis.image.bean.segment.SegmentationBean<SegmentStackIntoObjectsPooled<T>>
org.anchoranalysis.image.inference.bean.segment.instance.SegmentStackIntoObjectsPooled<T>
org.anchoranalysis.image.inference.bean.segment.instance.SuppressNonMaximum<T>
- Type Parameters:
T- model-type
public class SuppressNonMaximum<T extends InferenceModel> extends SegmentStackIntoObjectsPooled<T>
Applies a segmentation procedure followed by non-maximum suppression.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description SuppressNonMaximum()SuppressNonMaximum(SegmentStackIntoObjectsPooled<T> segment)Creates with a particular segmentation algorithm as an input.SuppressNonMaximum(SegmentStackIntoObjectsPooled<T> segment, ReduceElements<org.anchoranalysis.image.voxel.object.ObjectMask> reduce, boolean separateEachLabel) -
Method Summary
Modifier and Type Method Description ConcurrentModelPool<T>createModelPool(ConcurrencyPlan plan, Logger logger)Creates the model pool (to be used by multiple threads).ReduceElements<org.anchoranalysis.image.voxel.object.ObjectMask>getReduce()The algorithm for reducing the number of object-masks.SegmentStackIntoObjectsPooled<T>getSegment()The segmentation algorithm that is applied as an input to non-maximum suppression.booleanisSeparateEachLabel()If true, each label is reduced separately.SegmentedObjectssegment(Stack stack, ConcurrentModelPool<T> modelPool, ExecutionTimeRecorder executionTimeRecorder)Segments a stack to produce an object-collection.voidsetReduce(ReduceElements<org.anchoranalysis.image.voxel.object.ObjectMask> reduce)The algorithm for reducing the number of object-masks.voidsetSegment(SegmentStackIntoObjectsPooled<T> segment)The segmentation algorithm that is applied as an input to non-maximum suppression.voidsetSeparateEachLabel(boolean separateEachLabel)If true, each label is reduced separately.Methods inherited from class org.anchoranalysis.image.inference.bean.segment.instance.SegmentStackIntoObjectsPooled
resolve, segmentMethods inherited from class org.anchoranalysis.bean.initializable.InitializableBean
getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized, onInitializationMethods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
SuppressNonMaximum
Creates with a particular segmentation algorithm as an input.- Parameters:
segment- the segmentation algorithm to use, before applying non-maximum suppression.
-
SuppressNonMaximum
public SuppressNonMaximum() -
SuppressNonMaximum
public SuppressNonMaximum(SegmentStackIntoObjectsPooled<T> segment, ReduceElements<org.anchoranalysis.image.voxel.object.ObjectMask> reduce, boolean separateEachLabel)
-
-
Method Details
-
createModelPool
public ConcurrentModelPool<T> createModelPool(ConcurrencyPlan plan, Logger logger) throws CreateModelFailedExceptionDescription copied from class:SegmentStackIntoObjectsPooledCreates the model pool (to be used by multiple threads).- Specified by:
createModelPoolin classSegmentStackIntoObjectsPooled<T extends InferenceModel>- Parameters:
plan- the number and types of processors available for concurrent execution.logger- the logger.- Returns:
- the newly created model pool.
- Throws:
CreateModelFailedException- if a model cannot be created.
-
segment
public SegmentedObjects segment(Stack stack, ConcurrentModelPool<T> modelPool, ExecutionTimeRecorder executionTimeRecorder) throws org.anchoranalysis.image.bean.nonbean.segment.SegmentationFailedExceptionDescription copied from class:SegmentStackIntoObjectsPooledSegments a stack to produce an object-collection.Any created objects will always exist inside the stack's
Extent.- Specified by:
segmentin classSegmentStackIntoObjectsPooled<T extends InferenceModel>- Parameters:
stack- the stack to segment.modelPool- the pool of model instances which can each be used for inference (in parallel).executionTimeRecorder- measures execution-times of particular operations.- Returns:
- a collection of objects with corresponding confidence scores.
- Throws:
org.anchoranalysis.image.bean.nonbean.segment.SegmentationFailedException- if anything goes wrong during the segmentation.
-
getSegment
The segmentation algorithm that is applied as an input to non-maximum suppression. -
setSegment
The segmentation algorithm that is applied as an input to non-maximum suppression. -
getReduce
The algorithm for reducing the number of object-masks. -
setReduce
The algorithm for reducing the number of object-masks. -
isSeparateEachLabel
public boolean isSeparateEachLabel()If true, each label is reduced separately. if false, all labels are reduced together. -
setSeparateEachLabel
public void setSeparateEachLabel(boolean separateEachLabel)If true, each label is reduced separately. if false, all labels are reduced together.
-