fishtank.scripts.assign_spots#
- fishtank.scripts.assign_spots(input, polygons='polygons.json', output='assigned_spots.csv', max_dist=0, cell_column='cell', subset=None, x_column='global_x', y_column='global_y', z_column=None, polygons_z_column=None, cell_fill=0, alignment=None, map_z=False, **kwargs)#
Assign spots to the nearest polygon.
fishtank assign-spots -i input -p polygons -o output
- Parameters:
polygons (
str|Path(default:'polygons.json')) – Polygons input file path.output (
str|Path(default:'assigned_spots.csv')) – Output file path.max_dist (
float(default:0)) – Maximum distance from polygon edge for spot assignment.cell_column (
str(default:'cell')) – Column containing cell ID in polygons.subset (
Union[str,Path,None] (default:None)) – Set of polygons to assign spots to.x_column (
str(default:'global_x')) – Column containing x-coordinate in spots.y_column (
str(default:'global_y')) – Column containing y-coordinate in spots.z_column (
Optional[str] (default:None)) – Column containing z-slice in spots. None for 2D polygons.polygons_z_column (
Optional[str] (default:None)) – Column containing z-slice in polygons. Defaults to z_column.cell_fill (
int(default:0)) – Fill value for unassigned cells.alignment (
Union[str,Path,None] (default:None)) – File used to align spots space to polygons space.map_z (
bool(default:False)) – Map spot z values to polygon z values.