Class RegionMap


public class RegionMap extends AnchorBean<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 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

      public RegionMembership membershipForIndex(int index)
      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

      public RegionMembershipWithFlags membershipWithFlagsForIndex(int index)
      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

      public List<RegionMembershipWithFlags> 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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getList

      public List<RegionMembership> getList()
      List of region memberships.

      Each element in this list represents a mapping between an integer ID and a sub-region.

    • setList

      public void setList(List<RegionMembership> list)
      List of region memberships.

      Each element in this list represents a mapping between an integer ID and a sub-region.