perimeter#
- perimeter(domain, population=None, include_boundaries=None, exclude_boundaries=None, boundary_exclude_distance=0, add_as_label=True, label_name='Perimeter', cmap='viridis')#
Returns the perimeter of the objects in the domain. Add results as a label if required.
- Parameters:
- domainobject
The domain containing the objects whose perimeters are to be calculated.
- populationvarious, optional
A query, list/tuple of indices, or a single int specifying the objects to consider. Defaults to None.
- include_boundariesarray-like, query-like, or None, optional
Boundaries to include in the analysis. Defaults to None.
- exclude_boundariesarray-like, query-like, or None, optional
Boundaries to exclude from the analysis. Defaults to None.
- boundary_exclude_distancefloat, optional
Buffer to exclude objects located within boundary_exclude_distance from the boundaries. Defaults to 0.
- add_as_labelbool, optional
Whether to add the calculated perimeters as a label to the domain. Defaults to True.
- label_namestr, optional
The name of the label to be added. Defaults to ‘Perimeter’.
- cmapstr, optional
The colormap to be used if adding labels. Defaults to ‘viridis’.
- Returns:
- perimetersnumpy.ndarray
The calculated perimeters of the objects.
- object_indicesnumpy.ndarray
The indices of the objects for which the perimeters were calculated.
- Raises:
- ValueError
If the query is not of the correct type.