Skip to content

site_utils

Functions:

  • check_target_site

    Check neuroglancer info to determine which kind of site a neuroglancer URL is.

  • get_default_config

    Get the current configuration for nglui viewers and statebuilders.

  • set_default_config

    Set default configuration for nglui viewers and statebuilders.

check_target_site(ngl_url, client)

Check neuroglancer info to determine which kind of site a neuroglancer URL is.

get_default_config(config_key=None)

Get the current configuration for nglui viewers and statebuilders.

Parameters:

  • config_key (str, default: None ) –

    Key for the configuration setting, by default "default"

get_target_site(url=None, target_site=None, config_key=None, client=None)

Check target site based on parameters provided.

Parameters:

  • url (Optional[str], default: None ) –

    URL to a neuroglancer deployment, by default None

  • target_site (Optional[str], default: None ) –

    Categorical neuroglancer target site, by default None

  • config_key (Optional[str], default: None ) –

    Dictionary key for config, by default None

  • client (Optional[CAVEclient], default: None ) –

    Initialized CAVEclient, by default None

Returns:

  • _description_

neuroglancer_url(url=None, target_site=None, config_key='default')

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

reset_config(config_key='default')

Reset the configuration for nglui viewers and statebuilders to the default.

Parameters:

  • config_key (str, default: 'default' ) –

    Key for the configuration setting, by default "default"

set_default_config(target_site=None, target_url=None, seunglab_fallback_url=None, mainline_fallback_url=None, datastack_name=None, caveclient=None, url_from_client=False, config_key='default')

Set default configuration for nglui viewers and statebuilders.

Parameters:

  • target_site (str, default: None ) –

    Target site for the neuroglancer viewer, by default None

  • target_url (str, default: None ) –

    Target URL for the neuroglancer viewer, by default None

  • seunglab_fallback_url (str, default: None ) –

    URL for the seunglab neuroglancer viewer, by default None

  • mainline_fallback_url (str, default: None ) –

    URL for the mainline neuroglancer viewer, by default None

  • datastack_name (str, default: None ) –

    Name of the datastack, by default None

  • caveclient (CAVEclient, default: None ) –

    CAVEclient object, by default None.