deepof.arena_utils.extract_polygonal_arena_coordinates

deepof.arena_utils.extract_polygonal_arena_coordinates(video_path: str, arena_type: str, video_index: int, videos: list, list_of_rois: list = 0, roi_dicts: dict = {}, arena_dict: dict = {}, key_current: str | None = None, get_arena: bool = True, arena_dims: float = 1.0, norm_dist: float | None = None, image_export_path: str | None = None, edit_tag: str = '', test: bool = False)

Read a random frame from the selected video, and opens an interactive GUI to let the user delineate the arena manually.

Parameters:
  • video_path (str) – Path to the video file.

  • arena_type (str) – Type of arena to be used. Must be one of the following: “circular-manual”, “polygonal-manual”.

  • video_index (int) – Index of the current video in the list of videos.

  • videos (list) – List of videos to be processed.

  • list_of_rois (int) – list of roi numbers to draw,

  • get_arena (bool) – retrieve arena or skip step (default is True)

  • arena_dims (float) – Distance as taken from video in pixels

  • norm_dist (float) – Same distance as arena_dims for normalization in mm

  • arena_params (np.ndarray) – nx2 array containing the x-y coordinates of all n corners of the polygonal arena.

  • edit_tag (str) – optional affix for arena or roi name to prevent overwriting of existing images.

  • test (bool) – Runs project in test mode and bypasses manual inputs, defaults to false

Returns:

nx2 array containing the x-y coordinates of all n corners of the polygonal arena. int: Height of the video. int: Width of the video.

Return type:

arena_corners (np.ndarray)