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:
AccessorAccess 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.
- fetch_chunk(key, chunk_coords)[source]¶
Fetch a chunk from the pyramid as a bytes buffer.
- Parameters:
- Returns:
the data for the chunk (uncompressed for gzip)
- Return type:
- Raises:
DataAccessError – if the chunk cannot be retrieved
NotImplementedError – if
can_readis False
- 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:
- Raises:
DataAccessError – if the requested file cannot be retrieved
NotImplementedError – if
can_readis False
- 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:
- Raises:
DataAccessError – if an error occurs when probing file existence
NotImplementedError – if
can_readis False