fenestration.calculate.deg_to_pix#

fenestration.calculate.deg_to_pix(img_res: tuple[int, int], max_ecc: float = 15) → float#

Calculate the degree-to-pixel conversion factor.

We assume img_res is the full resolution of the image and max_ecc is the radius of the image in degrees. Thus, we divide half of img_res by max_ecc. However, we want to be able to handle non-square images, so we assume the value you want to use is the max of the two numbers in img_res (this is the way we construct the PoolingWindow objects; we want the windows to fill the full image).

Parameters:
  • img_res – The resolution of our image (should therefore contains integers).

  • max_ecc – The eccentricity (in degrees) of the edge of the image

Returns:

deg_to_pix – The factor to convert degrees to pixels (in pixels/degree). E.g., multiply the eccentricity (in degrees) by deg_to_pix to get it in pixels