Skip to content

Commit f61321f

Browse files
committed
Use a worker size of 8 chunks.
1 parent 4a64e52 commit f61321f

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

flyapp.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ def map_points(dataset, scale, locs):
178178
Output: [n,5] numpy array representing n (new_x, new_y, new_z, new_dx, new_dy)
179179
"""
180180
n5 = get_datasource(dataset, scale)
181+
blocksize = np.asarray(n5.shape[:3]) * 2
181182
voxel_offset = n5.attrs['voxel_offset']
182183

183184
query_points = np.empty_like(locs)
@@ -193,7 +194,8 @@ def map_points(dataset, scale, locs):
193194
field = np.full((query_points.shape[0], 2), np.NaN)
194195
else:
195196
field = process.get_multiple_ids(query_points, n5,
196-
max_workers=config.MaxWorkers)
197+
max_workers=config.MaxWorkers,
198+
blocksize=blocksize)
197199

198200
results = np.zeros(locs.shape[0], dtype=[('x', '<f4'), ('y', '<f4'), ('z', '<f4'), ('dx', '<f4'), ('dy', '<f4')])
199201

process.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def _get_ids(vol, bl, co):
4444
return co_id
4545

4646

47-
def get_multiple_ids(x, vol, max_workers=mp.cpu_count() - 5):
47+
def get_multiple_ids(x, vol, max_workers=mp.cpu_count() - 5, blocksize=np.array([512, 512, 32])):
4848
"""Return multiple segment IDs using cloudvolume.
4949
5050
Parameters
@@ -62,9 +62,6 @@ def get_multiple_ids(x, vol, max_workers=mp.cpu_count() - 5):
6262
if not max_workers:
6363
max_workers = 1
6464

65-
# Hard coded block size
66-
blocksize = np.array([512, 512, 32])
67-
6865
# Make bins to fit with blocksize
6966
xbins = np.arange(0, np.nanmax(x) + blocksize[0] + 1, blocksize[0]).astype(int)
7067
ybins = np.arange(0, np.nanmax(x) + blocksize[1] + 1, blocksize[1]).astype(int)

0 commit comments

Comments
 (0)