hest.find_pixel_size_from_spot_coords

hest.find_pixel_size_from_spot_coords(my_df: DataFrame, inter_spot_dist: float = 100.0, packing: SpotPacking = SpotPacking.ORANGE_CRATE_PACKING) Tuple[float, int]

Estimate the pixel size of an image in um/px given a dataframe containing the spot coordinates in that image

Parameters:
  • my_df (pd.DataFrame) – dataframe containing the coordinates of each spot in an image, it must contain the following columns: [‘pxl_row_in_fullres’, ‘pxl_col_in_fullres’, ‘array_col’, ‘array_row’]

  • inter_spot_dist (float, optional) – the distance in um between two spots on the same row. Defaults to 100..

  • packing (SpotPacking, optional) – disposition of the spots on the slide. Defaults to SpotPacking.ORANGE_CRATE_PACKING.

Raises:

Exception – if cannot find two spots on the same row

Returns:

approximation of the pixel size in um/px and over how many spots that pixel size was estimated

Return type:

Tuple[float, int]