diff --git a/tests/scripts/tiff_cubing.sh b/tests/scripts/tiff_cubing.sh index 08b1a678d..6e7569b8b 100755 --- a/tests/scripts/tiff_cubing.sh +++ b/tests/scripts/tiff_cubing.sh @@ -9,6 +9,7 @@ docker run \ --jobs 2 \ --batch_size 8 \ --layer_name color \ + --wkw_file_len 32 \ /testdata/tiff /testoutput/tiff [ -d testoutput/tiff/color ] [ -d testoutput/tiff/color/1 ] diff --git a/wkcuber/cubing.py b/wkcuber/cubing.py index 350ec55f0..1c8f11d0e 100644 --- a/wkcuber/cubing.py +++ b/wkcuber/cubing.py @@ -54,6 +54,7 @@ def create_parser(): parser.add_argument( "--wkw_file_len", default=32, + type=int, help="Amount of blocks which are written per dimension to a wkw cube. The default value of 32 means that 1024 slices are written to one cube (since one block has 32**3 voxels by default). For single-channel uint8 data, this results in 1 GB per cube file. If file_len is set to 1, only 32 slices are written to one cube. Must be a power of two.", ) diff --git a/wkcuber/export_wkw_as_tiff.py b/wkcuber/export_wkw_as_tiff.py index fd8c118a2..2c6d00af9 100644 --- a/wkcuber/export_wkw_as_tiff.py +++ b/wkcuber/export_wkw_as_tiff.py @@ -128,14 +128,17 @@ def export_tiff_slice( ], ] ): - batch_number, ( - tiff_bbox, - dest_path, - name, - dataset_path, - tiling_size, - batch_size, - downsample, + ( + batch_number, + ( + tiff_bbox, + dest_path, + name, + dataset_path, + tiling_size, + batch_size, + downsample, + ), ) = export_args tiff_bbox = tiff_bbox.copy() number_of_slices = min(tiff_bbox["size"][2] - batch_number * batch_size, batch_size) diff --git a/wkcuber/tile_cubing.py b/wkcuber/tile_cubing.py index 74112a85c..81cb22152 100644 --- a/wkcuber/tile_cubing.py +++ b/wkcuber/tile_cubing.py @@ -183,9 +183,16 @@ def find_file_with_dimensions( def tile_cubing_job(args): - target_wkw_info, z_batches, input_path_pattern, batch_size, tile_size, min_dimensions, max_dimensions, decimal_lengths = ( - args - ) + ( + target_wkw_info, + z_batches, + input_path_pattern, + batch_size, + tile_size, + min_dimensions, + max_dimensions, + decimal_lengths, + ) = args if len(z_batches) == 0: return @@ -251,9 +258,12 @@ def tile_cubing( target_path, layer_name, dtype, batch_size, input_path_pattern, args=None ): decimal_lengths = get_digit_counts_for_dimensions(input_path_pattern) - min_dimensions, max_dimensions, arbitrary_file, file_count = detect_interval_for_dimensions( - input_path_pattern, decimal_lengths - ) + ( + min_dimensions, + max_dimensions, + arbitrary_file, + file_count, + ) = detect_interval_for_dimensions(input_path_pattern, decimal_lengths) if not arbitrary_file: logging.error(