Skip to content

Commit cbd53f2

Browse files
authored
fix volume_size param in create-info command for multichannel case (#301)
Co-authored-by: Erik Schomburg <eschomburg@flatironinstitute.org>
1 parent 0dc816a commit cbd53f2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

chunkflow/flow/flow.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ def cleanup(dir: str, mode: str, suffix: str):
492492
type=click.INT, default=0,
493493
help = 'maximum mip level.')
494494
@operator
495-
def create_info(tasks,input_chunk_name: str, volume_path: str, channel_num: int,
495+
def create_info(tasks, input_chunk_name: str, volume_path: str, channel_num: int,
496496
layer_type: str, data_type: str, encoding: str, voxel_size: tuple,
497497
voxel_offset: tuple, volume_size: tuple, block_size: tuple, factor: tuple, max_mip: int):
498498
"""Create attrsdata for Neuroglancer Precomputed volume."""
@@ -506,8 +506,10 @@ def create_info(tasks,input_chunk_name: str, volume_path: str, channel_num: int,
506506
chunk = task[input_chunk_name]
507507
if chunk.ndim == 3:
508508
channel_num = 1
509+
volume_size = chunk.shape
509510
elif chunk.ndim == 4:
510511
channel_num = chunk.shape[0]
512+
volume_size = chunk.shape[1:]
511513
else:
512514
raise ValueError('chunk dimension can only be 3 or 4')
513515

@@ -516,7 +518,6 @@ def create_info(tasks,input_chunk_name: str, volume_path: str, channel_num: int,
516518
if voxel_size is None:
517519
voxel_size = chunk.voxel_size
518520

519-
volume_size = chunk.shape
520521
data_type = chunk.dtype.name
521522

522523
if layer_type is None:

0 commit comments

Comments
 (0)