Package qupath.lib.objects.utils
Class OverlapFixer.Builder
java.lang.Object
qupath.lib.objects.utils.OverlapFixer.Builder
- Enclosing class:
OverlapFixer
Builder for the OverlapFixer.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build the overlap fixer.Clip overlapping objects, excluding the parts that overlap with a 'higher priority' object according to the comparator.Equivalent to keepFragments(false).Retain only the 'highest priority' objects when overlaps occur, and drop the others.Equivalent to keepFragments(true).keepFragments
(boolean doKeep) Set whether to keep fragments when clipping objects.setComparator
(Comparator<PathObject> comparator) Set the comparator to use for sorting objects.setMinArea
(double minArea) Set the minimum area for objects to be retained, in pixels.setStrategy
(OverlapFixer.Strategy strategy) Set the strategy for handling overlaps.Set the comparator to sort by area, with the largest objects given a higher priority.Set the comparator to sort by solidity, with the most solid objects given a higher priority.
-
Method Details
-
setMinArea
Set the minimum area for objects to be retained, in pixels. Objects with an area less than this (either before or after clipping) will be dropped.- Parameters:
minArea
-- Returns:
-
setComparator
Set the comparator to use for sorting objects. This assigns a 'priority' to objects, which is used to determine which objects are kept when overlaps occur. Objects that are sorted to be earlier in the list are considered to have a higher priority.- Parameters:
comparator
-- Returns:
-
sortBySolidity
Set the comparator to sort by solidity, with the most solid objects given a higher priority. Subsequent sorting is by area, length, number of points, and finally by the default comparator.- Returns:
-
sortByArea
Set the comparator to sort by area, with the largest objects given a higher priority. Subsequent sorting is by length, number of points, and finally by the default comparator.- Returns:
-
keepFragments
Equivalent to keepFragments(true).- Returns:
-
keepFragments
Set whether to keep fragments when clipping objects. Fragments are defined as objects that are split into more pieces after clipping than they were before.- Parameters:
doKeep
-- Returns:
-
discardFragments
Equivalent to keepFragments(false).- Returns:
-
setStrategy
Set the strategy for handling overlaps.- Parameters:
strategy
-- Returns:
-
clipOverlaps
Clip overlapping objects, excluding the parts that overlap with a 'higher priority' object according to the comparator.- Returns:
-
dropOverlaps
Retain only the 'highest priority' objects when overlaps occur, and drop the others. Priority is determined by the comparator.- Returns:
-
build
Build the overlap fixer.- Returns:
-