Getting Started
Important
If using imageryclient on a CAVE-hosted dataset, we recommend installing CAVEclient for easier access to data. If so, please see the CAVEclient documentation for more information.
We make use of Numpy arrays and Pillow Images to represent data. Both are extremely rich tools, and to learn more about them please see the appropriate documentation for information about saving data to image files and more.
Installation
ImageryClient can be installed with pip:
pip install imageryclient
While not required, if you are using a CAVE-hosted dataset, installing CAVEclient will make your life much easier.
Troubleshooting
If you have installation issues due to CloudVolume, which can have a complex set of requirements, we recommend looking at its github issues page for help.
Basic example
A small example that uses all of the major components of ImageryClient: Downloading aligned images and segmentation, specifying specific segmentations to visualize, and generating an image overlay. This uses the pubically available Kasthuri et al. 2014 dataset.
import imageryclient as ic
img_src = 'precomputed://gs://neuroglancer-public-data/kasthuri2011/image_color_corrected'
seg_src = 'precomputed://gs://neuroglancer-public-data/kasthuri2011/ground_truth'
img_client = ic.ImageryClient(image_source=img_src, segmentation_source=seg_src)
bounds = [
[5119, 8477, 1201],
[5519, 8877, 1202]
]
root_ids = [2282, 4845]
image, segs = img_client.image_and_segmentation_cutout(bounds,
split_segmentations=True,
root_ids=root_ids)
ic.composite_overlay(segs, imagery=image)