convert_to_contours#

ROTATIONS = {'side1': (0, 2, 1), 'side2': (2, 1, 0), 'top': (0, 1, 2)}#

Axis rotations for different contour views.

convert_to_contours(series_key: str, locations_tar: TarFile, frame: int, regions: list[str], box: tuple[int, int, int], indices: dict[str, list[int]]) dict[str, dict[str, dict[int, list]]][source]#

Convert data to iso-valued contours.

Contours are calculated using “marching squares” method. Note that these contours follow the iso-values, which means that a single “square” voxel will produce a diamond-shaped contour. For the exact outline of a set of voxels, consider using extract_voxel_contours from the abm_shape_collection package.

Parameters:
  • series_key – Simulation series key.

  • locations_tar – Archive of location data.

  • frame – Frame number.

  • regions – List of regions.

  • box – Size of bounding box.

  • indices – Map of view to slice indices.

Returns:

Map of region, view, and index to contours.