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_resis the full resolution of the image andmax_eccis the radius of the image in degrees. Thus, we divide half ofimg_resbymax_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 inimg_res(this is the way we construct thePoolingWindowobjects; 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