Class RegionMap
Maps integer IDs to sub-regions in the map.
This class is used to represent a mapping of integer IDs to sub-regions. It is particularly useful in scenarios where object masks need to be compared, such as in org.anchoranalysis.plugin.image.feature.bean.stack.object.AsObjectMask.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Creates a list of all region memberships with their corresponding flags.boolean
getList()
List of region memberships.int
hashCode()
membershipForIndex
(int index) Gets the region membership for a specific index.membershipWithFlagsForIndex
(int index) Gets the region membership with flags for a specific index.int
Gets the number of regions in the map.void
setList
(List<RegionMembership> list) List of region memberships.Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
RegionMap
public RegionMap(int index) Creates a region map with a single entry mapping to a particular region.- Parameters:
index
- the index of the region to map
-
RegionMap
public RegionMap()
-
-
Method Details
-
numRegions
public int numRegions()Gets the number of regions in the map.- Returns:
- the number of regions
-
membershipForIndex
Gets the region membership for a specific index.- Parameters:
index
- the index of the region membership to retrieve- Returns:
- the RegionMembership at the specified index
-
membershipWithFlagsForIndex
Gets the region membership with flags for a specific index.- Parameters:
index
- the index of the region membership to retrieve- Returns:
- a new RegionMembershipWithFlags object for the specified index
-
createListMembershipWithFlags
Creates a list of all region memberships with their corresponding flags.- Returns:
- a list of RegionMembershipWithFlags objects for all regions in the map
-
equals
-
canEqual
-
hashCode
public int hashCode() -
getList
List of region memberships.Each element in this list represents a mapping between an integer ID and a sub-region.
-
setList
List of region memberships.Each element in this list represents a mapping between an integer ID and a sub-region.
-