Class SegmentChannelIntoObjects
- Direct Known Subclasses:
ConnectedComponentsFromBinarySegmentation,FloodFillEachIntensityLevel,Mser,SegmentChannelIntoObjectsUnary,WatershedYeong
A base class for algorithms to segment a channel into one or more objects.
Some algorithms can be restricted by an object-mask on the channel.
Some algorithms can be influenced by passing a set of seeds.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidcheckUnsupported3D(Channel channel) Throws an exception if the channel has more than one z-slice, as 3D is unsupported by the implementation.protected static voidcheckUnsupportedObjectMask(Optional<ObjectMask> objectMask) Throws an exception ifobjectis present, as it is unsupported by the implementation.protected static voidThrows an exception ifseedsis present, as it is unsupported by the implementation.abstract ObjectCollectionsegment(Channel channel, Optional<ObjectMask> objectMask, Optional<ObjectCollection> seeds) Segments a channel to produce an object-collection.Methods 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
-
SegmentChannelIntoObjects
protected SegmentChannelIntoObjects()
-
-
Method Details
-
segment
public abstract ObjectCollection segment(Channel channel, Optional<ObjectMask> objectMask, Optional<ObjectCollection> seeds) throws SegmentationFailedException Segments a channel to produce an object-collection.- Parameters:
channel- the channel to segmentobjectMask- an object-mask that can restrict which areas of the channel are considered.seeds- seeds that can be used to determine starting-points for segmentation regions.- Returns:
- a newly created collection of objects for each segment. The created objects will always exist inside the channel's extent.
- Throws:
SegmentationFailedException- if anything goes wrong during the segmentation.
-
checkUnsupportedObjectMask
protected static void checkUnsupportedObjectMask(Optional<ObjectMask> objectMask) throws SegmentationFailedException Throws an exception ifobjectis present, as it is unsupported by the implementation.- Parameters:
objectMask- an optionalObjectMask.- Throws:
SegmentationFailedException- ifobjectMaskis present.
-
checkUnsupportedSeeds
protected static void checkUnsupportedSeeds(Optional<ObjectCollection> seeds) throws SegmentationFailedException Throws an exception ifseedsis present, as it is unsupported by the implementation.- Parameters:
seeds- an optionalObjectMask.- Throws:
SegmentationFailedException- ifseedsis present.
-
checkUnsupported3D
Throws an exception if the channel has more than one z-slice, as 3D is unsupported by the implementation.- Parameters:
channel- the channel that have multiple z-slices (i.e. is 3D) or a single z-slice (i.e. is 2D).- Throws:
SegmentationFailedException- ifchannelis 3D.
-