neuroglancer_scripts.http_accessor module

Access to a Neuroglancer pre-computed dataset over HTTP.

See the accessor module for a description of the API.

class neuroglancer_scripts.http_accessor.HttpAccessor(base_url)[source]

Bases: Accessor

Access a Neuroglancer pre-computed pyramid with HTTP.

Note

This is a read-only accessor.

Parameters:

base_url (str) – the URL containing the pyramid

can_read = True

This accessor is able to read data.

can_write = False

This accessor is able to write data.

chunk_relative_url(key, chunk_coords)[source]
fetch_chunk(key, chunk_coords)[source]

Fetch a chunk from the pyramid as a bytes buffer.

Parameters:
  • key (str) – the scale’s key

  • chunk_coords (tuple) – tuple of the chunk coordinates (xmin, xmax, ymin, ymax, zmin, zmax)

Returns:

the data for the chunk (uncompressed for gzip)

Return type:

bytes

Raises:
fetch_file(relative_path)[source]

Fetch a file relative to the precomputed pyramid’s base directory.

Parameters:

relative_path (str) – path to the file relative to the base directory of the pyramid

Returns:

contents of the fetched file

Return type:

bytes

Raises:
file_exists(relative_path)[source]

Test existence of a file relative to the base directory.

Parameters:

relative_path (str) – path to the file relative to the base directory of the pyramid

Returns:

True if the file exists

Return type:

bool

Raises: