Class OverlappingObjects
Object
org.anchoranalysis.annotation.io.assignment.OverlappingObjects
- All Implemented Interfaces:
Assignment<org.anchoranalysis.image.voxel.object.ObjectMask>
public class OverlappingObjects extends Object implements Assignment<org.anchoranalysis.image.voxel.object.ObjectMask>
Pairs an
ObjectMask in one set with an ObjectMask in another, if deemed to
overlap sufficiently.
The sets are termed left and right as arbitrary names.
Several statistics based upon overlap, the number of pairs, the number of unassigned objects are derived.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description OverlappingObjects() -
Method Summary
Modifier and Type Method Description voidaddAssignedPair(org.anchoranalysis.image.voxel.object.ObjectMask object1, org.anchoranalysis.image.voxel.object.ObjectMask object2, double overlapRatio)Adds an assigned pair of objects with a particular overlap-ratio.voidaddUnassignedLeft(org.anchoranalysis.image.voxel.object.ObjectCollection objects)Add unassigned objects to the left set.voidaddUnassignedLeft(org.anchoranalysis.image.voxel.object.ObjectMask object)Add an unassigned object to the left set.voidaddUnassignedRight(org.anchoranalysis.image.voxel.object.ObjectCollection objects)Add unassigned objects to the right set.voidaddUnassignedRight(org.anchoranalysis.image.voxel.object.ObjectMask object)Add an unassigned object to the right set.static OverlappingObjectscreateWithLeftUnassigned(org.anchoranalysis.image.voxel.object.ObjectCollection objects)Creates with only left unassigned objects.static OverlappingObjectscreateWithRight(org.anchoranalysis.image.voxel.object.ObjectCollection objects)Creates with only right unassigned objects.List<org.anchoranalysis.image.voxel.object.ObjectMask>getLeftUnassigned()The unassigned objects in the left set.List<org.anchoranalysis.image.voxel.object.ObjectMask>getRightUnassigned()The unassigned objects in the right set.intleftSize()The total number of objects in the left set.intnumberPaired()The number of items that are paired.intnumberUnassigned(boolean left)The number of items in a particular set that are not paired.intnumberUnassignedLeft()The number of unassigned objects in the left set.intnumberUnassignedRight()The number of unassigned objects in the right set.List<org.anchoranalysis.image.voxel.object.ObjectMask>paired(boolean left)The items that are paired for a particular set.doublepercentLeftAssigned()The percentage of objects in the left set that have been paired.doublepercentRightAssigned()The percentage of objects in the right set that have been paired.voidremoveTouchingBorderXY(org.anchoranalysis.spatial.box.Extent extent)Removes any objects from the assignment if they touch the X or Y scene border.intrightSize()The total number of objects in the right set.StatisticsToExportstatistics()The statistics associated with the assignment.doublesumOverlapFromPaired()Sums the overlap-ratio across all assigned pairs.List<org.anchoranalysis.image.voxel.object.ObjectMask>unassigned(boolean left)The items that are not paired for a particular set.
-
Constructor Details
-
OverlappingObjects
public OverlappingObjects()
-
-
Method Details
-
createWithLeftUnassigned
public static OverlappingObjects createWithLeftUnassigned(org.anchoranalysis.image.voxel.object.ObjectCollection objects)Creates with only left unassigned objects.- Parameters:
objects- the objects.- Returns:
- a newly created
OverlappingObjects.
-
createWithRight
public static OverlappingObjects createWithRight(org.anchoranalysis.image.voxel.object.ObjectCollection objects)Creates with only right unassigned objects.- Parameters:
objects- the objects.- Returns:
- a newly created
OverlappingObjects.
-
statistics
Description copied from interface:AssignmentThe statistics associated with the assignment.- Specified by:
statisticsin interfaceAssignment<org.anchoranalysis.image.voxel.object.ObjectMask>- Returns:
- the statistics.
-
removeTouchingBorderXY
public void removeTouchingBorderXY(org.anchoranalysis.spatial.box.Extent extent)Removes any objects from the assignment if they touch the X or Y scene border.- Parameters:
extent- the size of the scene, which determines its borders.
-
paired
Description copied from interface:AssignmentThe items that are paired for a particular set.- Specified by:
pairedin interfaceAssignment<org.anchoranalysis.image.voxel.object.ObjectMask>- Parameters:
left- if true, the left-set is considered, otherwise the right-set.- Returns:
- a newly created list containing the paired items.
-
unassigned
Description copied from interface:AssignmentThe items that are not paired for a particular set.- Specified by:
unassignedin interfaceAssignment<org.anchoranalysis.image.voxel.object.ObjectMask>- Parameters:
left- if true, the left-set is considered, otherwise the right-set.- Returns:
- a newly created list containing the unpaired items for the respective set.
-
sumOverlapFromPaired
public double sumOverlapFromPaired()Sums the overlap-ratio across all assigned pairs.- Returns:
- the sum.
-
addUnassignedLeft
public void addUnassignedLeft(org.anchoranalysis.image.voxel.object.ObjectMask object)Add an unassigned object to the left set.- Parameters:
object- the object to add.
-
addUnassignedLeft
public void addUnassignedLeft(org.anchoranalysis.image.voxel.object.ObjectCollection objects)Add unassigned objects to the left set.- Parameters:
objects- the object to add.
-
addUnassignedRight
public void addUnassignedRight(org.anchoranalysis.image.voxel.object.ObjectMask object)Add an unassigned object to the right set.- Parameters:
object- the object to add.
-
addUnassignedRight
public void addUnassignedRight(org.anchoranalysis.image.voxel.object.ObjectCollection objects)Add unassigned objects to the right set.- Parameters:
objects- the object to add.
-
addAssignedPair
public void addAssignedPair(org.anchoranalysis.image.voxel.object.ObjectMask object1, org.anchoranalysis.image.voxel.object.ObjectMask object2, double overlapRatio)Adds an assigned pair of objects with a particular overlap-ratio.- Parameters:
object1- the left object.object2- the right object.overlapRatio- the ratio of overlap between the two objects.
-
percentLeftAssigned
public double percentLeftAssigned()The percentage of objects in the left set that have been paired.- Returns:
- the percentage.
-
percentRightAssigned
public double percentRightAssigned()The percentage of objects in the right set that have been paired.- Returns:
- the percentage.
-
numberPaired
public int numberPaired()Description copied from interface:AssignmentThe number of items that are paired.This is necessarily the same number for either set.
- Specified by:
numberPairedin interfaceAssignment<org.anchoranalysis.image.voxel.object.ObjectMask>- Returns:
- the total number of pairings.
-
numberUnassigned
public int numberUnassigned(boolean left)Description copied from interface:AssignmentThe number of items in a particular set that are not paired.- Specified by:
numberUnassignedin interfaceAssignment<org.anchoranalysis.image.voxel.object.ObjectMask>- Parameters:
left- if true, the left-set is considered, otherwise the right-set.- Returns:
- the number of unpaired items for the respective set.
-
numberUnassignedLeft
public int numberUnassignedLeft()The number of unassigned objects in the left set.- Returns:
- the number of unassigned objects.
-
numberUnassignedRight
public int numberUnassignedRight()The number of unassigned objects in the right set.- Returns:
- the number of unassigned objects.
-
leftSize
public int leftSize()The total number of objects in the left set.- Returns:
- the total number.
-
rightSize
public int rightSize()The total number of objects in the right set.- Returns:
- the total number.
-
getLeftUnassigned
The unassigned objects in the left set. -
getRightUnassigned
The unassigned objects in the right set.
-