Skip to content

client.skeleton

Client for interacting with the skeleton service.

Methods:

Name Description
get_skeleton

Gets one skeleton, blocking for skeletonization if necessary.

get_cache_contents

Mirror CloudFiles.list() for skeletons as a pass-through interface to the underlying service and bucket.

skeletons_exist

Confirm or deny that a set of root ids have H5 skeletons in the cache.

get_bulk_skeletons

Generates skeletons for a list of root ids in a "small" bulk (ten at the time of this writing). Use the async interface for larger bulk requests.

generate_bulk_skeletons_async

Generates skeletons for a list of root ids without retrieving them.

fetch_skeletons

Retrieve already-cached skeletons in bulk, up to 500 at a time.

Attributes:

Name Type Description
server_version Optional[Version]

The version of the service running on the remote server. Note that this

server_version property

The version of the service running on the remote server. Note that this refers to the software running on the server and has nothing to do with the version of the datastack itself.

get_skeleton(root_id, datastack_name=None, skeleton_version=4, output_format='dict', log_warning=True, verbose_level=0)

Gets one skeleton, blocking for skeletonization if necessary.

Parameters:

Name Type Description Default
root_id int

The root id of the skeleton to retrieve

required
datastack_name str

The name of the datastack to check

None
skeleton_version int

The skeleton version to generate and retrieve. Options are documented in SkeletonService. Use 0 for Neuroglancer-compatibility. Use -1 for latest.

4
output_format string

The format to retrieve. Options are: - 'dict': A dictionary - 'swc': A pandas DataFrame

'dict'

Returns:

Type Description

Skeleton of the requested type. See output_format for details.

get_cache_contents(datastack_name=None, skeleton_version=4, root_id_prefixes=0, limit=0, log_warning=True, verbose_level=0)

Mirror CloudFiles.list() for skeletons as a pass-through interface to the underlying service and bucket.

skeletons_exist(datastack_name=None, skeleton_version=4, root_ids=0, log_warning=True, verbose_level=0)

Confirm or deny that a set of root ids have H5 skeletons in the cache.

get_bulk_skeletons(root_ids, datastack_name=None, skeleton_version=4, output_format='dict', generate_missing_skeletons=False, log_warning=True, verbose_level=0)

Generates skeletons for a list of root ids in a "small" bulk (ten at the time of this writing). Use the async interface for larger bulk requests.

Parameters:

Name Type Description Default
root_ids List

A list of root ids of the skeletons to generate

required
datastack_name str

The name of the datastack to check

None
skeleton_version int

The skeleton version to generate. Use 0 for Neuroglancer-compatibility. Use -1 for latest.

4

generate_bulk_skeletons_async(root_ids, datastack_name=None, skeleton_version=None, log_warning=True, verbose_level=0)

Generates skeletons for a list of root ids without retrieving them.

Parameters:

Name Type Description Default
root_ids List

A list of root ids of the skeletons to generate

required
datastack_name str

The name of the datastack to check

None
skeleton_version int

The skeleton version to generate. Use 0 for Neuroglancer-compatibility. Use -1 for latest.

None

Returns:

Type Description
float

The estimated time in seconds to generate all skeletons (a comparable message will be output to the console prior to return).

fetch_skeletons(root_ids, datastack_name=None, skeleton_version=4, output_format='dict', method='server', generate_missing_skeletons=False, verbose_level=0)

Retrieve already-cached skeletons in bulk, up to 500 at a time.

Unlike :meth:get_bulk_skeletons, this method:

  • Accepts up to 500 root IDs per call (vs the 10-skeleton limit of get_bulk_skeletons)
  • Skips per-RID chunkedgraph validation, so it never blocks on network calls
  • Never generates skeletons inline; only returns what is already in the cache

Root IDs not found in the cache are simply absent from the returned dict.

Parameters:

Name Type Description Default
root_ids List

Root IDs to retrieve. Truncated to 500 if longer.

required
datastack_name str

Datastack name. Defaults to the client's configured datastack.

None
skeleton_version int

Skeleton version. Default is 4 (latest).

4
output_format 'dict' or 'swc'

Output format. Default is "dict". method="gcs" only supports "dict".

'dict'
method 'server' or 'gcs'

How to retrieve skeletons.

"server" (default) — POST root IDs to the server; server decodes and returns skeletons.

"gcs" — Obtain a short-lived downscoped GCS token (cached client-side), then download and parse H5 files directly from the storage bucket, bypassing the service for data transfer. Significantly faster for large batches. Only supports output_format="dict".

'server'
generate_missing_skeletons bool

If True, root IDs not found in the cache are queued for async background generation. They will still be absent from the returned dict. Default False.

False
verbose_level int

Verbosity level for server-side logging.

0

Returns:

Type Description
dict

Mapping of root_id (str) → skeleton object. Only root IDs successfully retrieved appear in the dict; missing ones are absent.