Skip to content

Instantly share code, notes, and snippets.

@william-silversmith
Created September 11, 2019 00:25
Show Gist options
  • Save william-silversmith/d0f2f6fb49913c038319bca396761033 to your computer and use it in GitHub Desktop.
Save william-silversmith/d0f2f6fb49913c038319bca396761033 to your computer and use it in GitHub Desktop.
Accessing FlyWire Proofread Reconstructions with CloudVolume
from cloudvolume import CloudVolume
cv = CloudVolume(
'graphene://https://fafbv2.dynamicannotationframework.com/segmentation/1.0/fly_v31', # neuroglancer layer
use_https=True # uses the public access interface
)
# Download and Save a Mesh to Disk
mesh = cv.mesh.get(720575940621065107)
with open('720575940621065107.ply', 'wb') as f:
f.write(mesh.to_ply())
# Extracting a Volumetric Image Label from an ROI
img = cv.download_point(
(161493, 46884, 2759), # point in neuroglancer
segids=[ 720575940627678160 ],
mip=0, size=(256, 256, 256),
coord_resolution=(4,4,40) # neuroglancer display resolution
)
@william-silversmith
Copy link
Author

william-silversmith commented Sep 11, 2019

Requires cloud-volume >= 0.61.0

For installation instructions, check out the main CloudVolume repository here:
https://github.com/seung-lab/cloud-volume

pip install cloud-volume usually suffices though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment