Convert image to SpatialPolygons

image_to_poly(dir, file)

Arguments

dir

String. Directory for images.

file

String. File name.

Value

A list with components:

cells

sf MULTIPOLYGON. All cells, with values stored in a 'value' column.

junction_coords

Dataframe with two columns: x and y coordinates of tri-cell junctions.