seung-lab / cloud-volume

Read and write Neuroglancer datasets programmatically.
https://twitter.com/thundercloudvol
BSD 3-Clause "New" or "Revised" License
136 stars 47 forks source link

cloudvolume.exceptions.EmptyVolumeException #510

Open yuxuanxu-pku opened 3 years ago

yuxuanxu-pku commented 3 years ago

cloudvolume.exceptions.EmptyVolumeException: Bbox([17024, 9984, 13440],[17088, 10048, 13504], dtype=int32) I got an error when i process jenelia hemibrain dataset. My code is blow. `import numpy as np import tifffile import time from cloudvolume import CloudVolume

time_start = time.time()

vol = CloudVolume( "file://512.0x512.0x512.0", mip=0, use_https=True ) cutout = vol[17071:17100,10000:11000,13453:13500] tifffile.imwrite("data.tiff", data=np.transpose(cutout))

time_end = time.time() print('time: ', time_end - time_start) ` What is the meaning of the vol[?;?;?]?As i can see the figure in neuroglancer when cursor location is x(8nm) 17071, y(8nm)23758, z(8nm)13453. Or is there any way that support building the relationship between the neuroglancer RPI and vol shape? Thanks in advance.

william-silversmith commented 3 years ago

Hi Yuxuan,

It's difficult for me to check since it seems the file is located on your local machine or network. Are you sure all files were copied correctly?

The relationship between neuroglancer and the cutout coordinates is neuroglancer is at mip 0, while the cutout coordinates are in the voxels of the current mip level. So 0:16 at mip 0 would be 0:8 at mip 1 etc. There's a CloudVolume function for translating: vol.meta.point_to_mip( (x,y,z), mip, to_mip) and vol.meta.bbox_to_mip( bbx, mip, to_mip).

Try viewing the files using neuroglancer by using cv.viewer() and loading that URL into neuroglancer. You might get a better idea of what's going on.