fafbseg.flywire.decode_url#

fafbseg.flywire.decode_url(url, format='json')[source]#

Decode neuroglancer URL.

Parameters:
  • url (str | list of str) – URL(s) to decode. Can be shortened URL. Note that not all formats work with multiple URLs.

  • format ("json" | "brief" | "dataframe") –

    What to return:
    • ”json” (default) returns the full JSON

    • ”brief” only returns position (in voxels), selected segments and annotations

    • ”dataframe” returns a frame with segment IDs and which layers they came from

Returns:

  • dict – If format is “json” or “brief”.

  • DataFrame – If format=’dataframe’.

Examples

>>> from fafbseg import flywire
>>> flywire.decode_url('https://ngl.flywire.ai/?json_url=https://globalv1.flywire-daf.com/nglstate/6267328375291904',
...                    format='brief')
{'position': [132715.625, 55805.6796875, 3289.61181640625],
 'annotations': [],
 'selected': ['720575940621039145']}