warnings.warn("No particles found in the image before refinement.")
return coords_df
coords_df = coords_df.astype(float)
refined = {}
for i, coords in coords_df.iterrows():
result = refine_brightfield_ring(image, radius, coords,
After Change
// Make a copy of old coords and overwrite with result
// In this way any extra columns from previous_coords are preserved
new_coords = coords.copy()
for column in result.index.tolist():
// make a new column if necessary, otherwise overwrite
new_coords[column] = result.get(column)
refined[i] = new_coords
columns = np.unique(np.concatenate((pos_columns, ["r"], coords_df.columns)))
if len(refined) == 0: