NivLink 0.1
  • Install
  • Projects
  • DataViewer
  • API
  • Contribute
  • Site

    nivlink.screen.ScreenInfo¶

    class nivlink.screen.ScreenInfo(xdim, ydim, sfreq, n_screens=1)[source]¶

    Container for visual stimuli information.

    Parameters:
    xdim : int

    Screen size along horizontal axis (in pixels).

    ydim : int

    Screen size along vertical axis (in pixels).

    sfreq : float

    Sampling rate of eyetracker.

    n_screens: int

    Number different screens corresponding to different AoI distributions. Defauls to 1.

    Attributes:
    labels : array

    List of unique AoIs.

    indices : array, shape (xdim, ydim)

    Look-up table matching pixels to AoIs.

    Methods

    add_ellipsoid_aoi(x, y, x_radius, y_radius) Generate coordinates of pixels within ellipse.
    add_rectangle_aoi(xmin, xmax, ymin, ymax[, …]) Add rectangle area of interest to screen.
    plot_aoi(screen_id[, height, ticks, cmap]) Plot areas of interest.
    add_ellipsoid_aoi(x, y, x_radius, y_radius, rotation=0.0, screen_id=1, mask=None)[source]¶

    Generate coordinates of pixels within ellipse.

    Parameters:
    x, y : int

    Center coordinate of ellipse.

    x_radius, y_radius : int

    Axes along the x- and y-dimensions.

    rotation : float

    Set the ellipse rotation (rotation) in range \([-\pi, \pi]\) in contra-clockwise direction, so \(\pi / 2\) degree means swap ellipse axis.

    screen_id: int

    Which screen to add AoI to. Defaults to 1.

    mask: int

    Screen-sized array of 0s and 1s used to mask out parts of the display. Defaults to none.

    Returns:
    None

    indices and labels modified in place.

    add_rectangle_aoi(xmin, xmax, ymin, ymax, screen_id=1)[source]¶

    Add rectangle area of interest to screen.

    Parameters:
    xmin, ymin : int or float

    Coordinates of top-left corner of AoI. Accepts absolute or fractional [0-1] position.

    xmax, ymax : int or float

    Coordinates of bottom-right corner of AoI.

    screen_id: int

    Which screen to add AoI to. Defaults to 1.

    Returns:
    None

    indices and labels modified in place.

    plot_aoi(screen_id, height=3, ticks=False, cmap=None)[source]¶

    Plot areas of interest.

    Parameters:
    screen_id: int

    Set of AoIs to plot.

    height : float

    Height of figure (in inches).

    ticks : bool

    Include axis ticks.

    cmap : matplotlib.cm object

    Colormap. Defaults to ListedColorMap.

    Returns:
    fig, ax : plt.figure

    Figure and axis of plot.

    Notes

    Requires matplotlib.

    Back to top

    © Copyright 2018, Niv Lab.