Skip to content

Calculation of equivalent voxel number for 100 micron length

FelixChihTing edited this page Apr 8, 2021 · 1 revision

Use resolution in info to check the corresponding physical size of each voxel. The values acquired are in nanometers.

url = "s3://open-neurodata/brainlit/brain1"
vol = CloudVolume(url)
L = len(vol.info['scales'])
volume_size = []
resolution = []
chunk_sizes = []
for x in range(0,L):
    resolution.append(vol.info['scales'][x]['resolution']) 
    volume_size.append(vol.info['scales'][x]['size'])
    chunk_sizes.append(vol.info['scales'][x]['chunk_sizes'])

calculate how many voxels is equivalent to 1 micron at each scales (mip=0:6):

for x in range(0,L):
    print('mip=',x,'X=',round(100/(resolution[x][0]/1000)),'Y=',round(100/(resolution[x][1]/1000)),'Z=',round(100/(resolution[x][2]/1000)))

the results:

mip= 0 X= 335 Y= 328 Z= 101
mip= 1 X= 167 Y= 164 Z= 51
mip= 2 X= 84 Y= 82 Z= 25
mip= 3 X= 42 Y= 41 Z= 13
mip= 4 X= 21 Y= 21 Z= 6
mip= 5 X= 10 Y= 10 Z= 3
mip= 6 X= 5 Y= 5 Z= 2
Clone this wiki locally