Skip to content

Commit a9efb0d

Browse files
fix dtype inference
1 parent 091d075 commit a9efb0d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

wkcuber/downsampling.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ def downsample_cube_job(
185185

186186
with open_wkw(source_wkw_info) as source_wkw:
187187
num_channels = source_wkw.header.num_channels
188+
source_dtype = source_wkw.header.voxel_type
189+
target_wkw_info.dtype = source_dtype
188190
with open_wkw(
189191
target_wkw_info,
190192
pool_get_lock(),
@@ -195,7 +197,7 @@ def downsample_cube_job(
195197
source_wkw.header.file_len * source_wkw.header.block_len
196198
)
197199
shape = (num_channels,) + (wkw_cubelength,) * 3
198-
file_buffer = np.zeros(shape, target_wkw.header.voxel_type)
200+
file_buffer = np.zeros(shape, source_dtype)
199201
tile_length = cube_edge_len
200202
tile_count_per_dim = wkw_cubelength // tile_length
201203
assert (

0 commit comments

Comments
 (0)