Class SegmentChannelIntoObjects
Object
org.anchoranalysis.bean.AnchorBean<B>
org.anchoranalysis.bean.initializable.InitializableBean<T,ImageInitialization>
org.anchoranalysis.image.bean.ImageBean<T>
org.anchoranalysis.image.bean.segment.SegmentationBean<SegmentChannelIntoObjects>
org.anchoranalysis.image.bean.segment.object.SegmentChannelIntoObjects
- Direct Known Subclasses:
SegmentChannelIntoObjectsUnary
public abstract class SegmentChannelIntoObjects extends SegmentationBean<SegmentChannelIntoObjects>
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 Modifier Constructor Description protectedSegmentChannelIntoObjects() -
Method Summary
Modifier and Type Method Description protected 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<org.anchoranalysis.image.voxel.object.ObjectMask> objectMask)Throws an exception ifobjectis present, as it is unsupported by the implementation.protected static voidcheckUnsupportedSeeds(Optional<org.anchoranalysis.image.voxel.object.ObjectCollection> seeds)Throws an exception ifseedsis present, as it is unsupported by the implementation.abstract org.anchoranalysis.image.voxel.object.ObjectCollectionsegment(Channel channel, Optional<org.anchoranalysis.image.voxel.object.ObjectMask> objectMask, Optional<org.anchoranalysis.image.voxel.object.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 org.anchoranalysis.image.voxel.object.ObjectCollection segment(Channel channel, Optional<org.anchoranalysis.image.voxel.object.ObjectMask> objectMask, Optional<org.anchoranalysis.image.voxel.object.ObjectCollection> seeds) throws SegmentationFailedExceptionSegments 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<org.anchoranalysis.image.voxel.object.ObjectMask> objectMask) throws SegmentationFailedExceptionThrows 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<org.anchoranalysis.image.voxel.object.ObjectCollection> seeds) throws SegmentationFailedExceptionThrows 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.
-