Skip to content

make_anno_layer

jaybgager edited this page Oct 2, 2026 · 1 revision

This function converts a list of annotations into a neuroglancer-format dictionary for an annotation layer.

Arguments:

  • datatack (string, mandatory)
    • the name of the datastack the annotations are for
  • annotations (list, mandatory)
    • a list of all the annotations formatted correctly for the type
    • exact structure varies depending on annotation type (point, line, sphere etc.)
  • layer_type (string, mandatory)
    • the type of annotations in the layer
    • supported types are "point", "line", "bbox", "sphere"/"ellipsoid", "polyline", and "mixed"
  • layer_name (string, mandatory)
    • the name you want the layer to have in neuroglancer
  • layer_color (string, optional, default=None)
    • if a hexadecimal value is passed as a string (e.g. "#00FF00"), this will be the color of the annotations
    • default value of None results in yellow
  • descriptions (list of strings, optional, default=[])
    • list of annotation descriptions, length must match list of annotations
  • linked_segs (list of integers, optional, default=[])
    • list of segment IDs to link annotations to, must be same length as list of annotations
    • list shape varies based on what type of annotation is used
    • point = (n)-shaped
    • line = (n,2)-shaped
    • bbox, sphere/ellipsoid, polyline, mixed = (n,m)-shaped
  • linked_seg_layer_name (string, optional, default=None)
    • the name of the segmentation layer if linking one to the annotations
    • mandatory if using linked annotations

Returns:

  • anno_layer_dict (dictionary)
    • dictionary for an annotation layer of the appropriate type
    • structured to work with neuroglancer JSON state format

Example

Coming soon.

Clone this wiki locally