dvid.fetch.edit_annotation

dvid.fetch.edit_annotation(bodyid, annotation, server=None, node=None, verbose=True)[source]

Edit annotations for given body.

Parameters
  • bodyid (int | str) – ID of body for which to edit annotations.

  • annotation (dict) –

    Dictionary of new annotations. Possible fields are:

    {
     "status": str,
     "comment": str,
     "body ID": int,
     "name": str,
     "class": str,
     "user": str,
     "naming user": str
    }
    

    Fields other than the above will be ignored!

  • server (str, optional) – If not provided, will try reading from global.

  • node (str, optional) – If not provided, will try reading from global.

  • verbose (bool, optional) – If True, will warn if entirely new annotations are added (as opposed to just updating existing annotations)

Return type

None

Examples

>>> # Get annotations for given body
>>> an = dvidtools.get_annotation('1700937093')
>>> # Edit field
>>> an['name'] = 'New Name'
>>> # Update annotation
>>> dvidtools.edit_annotation('1700937093', an)