Flipping

tomni.json_operations.flip_json(json_object: dict, img_dim: int) dict[source]

Flip a JSON object over the y-axis.

Parameters
  • json_object (dict) – JSON object following the standard AxionBio format (ellipse or polygon).

  • img_dim (int) – The y-dimension of the image related to the JSON object.

Raises

ValueError – If the JSON object type is not “ellipse” or “polygon”.

Returns

A new JSON object with coordinates flipped over the y-axis.

Return type

dict