Skip to content

statebuilder.site_utils

Functions:

add_neuroglancer_site(site_name, site_url, set_default=False)

Add a neuroglancer site to the list of available sites.

Parameters:

  • site_name (str) –

    Name of the neuroglancer site.

  • site_url (str) –

    URL of the neuroglancer site.

get_default_neuroglancer_site()

Get the default neuroglancer site URL.

Returns:

  • dict

    Single element dictionary with the site and URL of the default neuroglancer site.

get_neuroglancer_sites()

Get the list of available neuroglancer sites.

Returns:

  • dict

    List of available neuroglancer URLs and their names.

neuroglancer_url(url=None, target_site=None)

Check neuroglancer info to determine which kind of site a neuroglancer URL is. If either url or target_site are provided, it will use these values, looking up target site from the fallback values in the config. Otherwise, it falls back to the value of "target_url" in the config.

Parameters:

  • url (str, default: None ) –

    URL to check, by default None

  • target_site (str, default: None ) –

    Target site to check, by default None

Returns:

  • str

    URL of the neuroglancer viewer

set_default_neuroglancer_site(site_name)

Set the default neuroglancer site.

Parameters:

  • site_name (str) –

    Name of the neuroglancer site to set as default.