deepof.arena_utils.get_arenas
- deepof.arena_utils.get_arenas(coordinates: deepof_project | deepof_coordinates, arena: str, arena_dims: int, number_of_rois: int, segmentation_model_path: str, video_path: str, videos: list | None = None, test: bool = False, roi_dicts: dict | None = None, arena_params: dict | None = None, edit_tag: str = '', scales: dict | None = None)
Extract arena parameters from a project or coordinates object.
- Parameters:
coordinates (coordinates) – Coordinates object.
tables (table_dict) – TableDict object containing tracklets per animal.
arena (str) – Arena type (must be either “polygonal-manual”, “circular-manual”, “polygonal-autodetect”, or “circular-autodetect”).
arena_dims (int) – Arena dimensions.
number_of_rois (int) – number of behavior rois,
segmentation_model_path (str) – Path to segmentation model used for automatic arena detection.
video_path (str) – Path to folder with videos.
videos (dict) – Dictionary of videos to extract arena parameters from. Defaults to None (all videos are used).
debug (bool) – If True, a frame per video with the detected arena is saved. Defaults to False.
edit_tag (str) – optional affix for arena or roi name to prevent overwriting of existing images.
test (bool) – If True, the function is run in test mode. This means that instead of waiting for user-inputs fixed artifical user-inputs are used. Defaults to False.
- Returns:
- Dictionary of scaling information. Each scales object consists of:
x position of the center of arena in mm
y position of the center of the arena in mm
diameter of the arena (when circular) or length of first edge in pixels
diameter of the arena (when circular) or length of first edge in mm
- arena_params (dict): Dictionary of arena parameters. Each arena parameter object consists of:
(when circular) - x position of the center of arena in pixel - y position of the center of the arena in pixel - x axis radii of the arena in pixel - y axis radii of the arena in pixel - angle of the elipse (when polygonal) - x and y positions of the polygon vertices in pixel
- video_resolution (dict): Dictionary of video resolutions. Each video resolution object consists of:
height of the video in pixel
width of the video in pixel
- Return type:
scales (dict)