Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions webknossos/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ For upgrade instructions, please check the respective _Breaking Changes_ section

### Fixed
- Fixed test.py to parse the command line arguments correctly. [#1383](https://github.com/scalableminds/webknossos-libs/pull/1383)
- Fixed a bug in the CLI tool export_as_tiff, where filenames would not match the data z position exactly. [#1387](https://github.com/scalableminds/webknossos-libs/pull/1387)


## [2.5.0](https://github.com/scalableminds/webknossos-libs/releases/tag/v2.5.0) - 2025-10-06
Expand Down
8 changes: 4 additions & 4 deletions webknossos/webknossos/cli/export_as_tiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ def _slice_to_image(data_slice: np.ndarray, downsample: int = 1) -> Image.Image:
return Image.fromarray(data_slice)


def export_tiff_slice(
def export_tiff_slice_batch(
dest_path: UPath,
name: str,
tiling_size: None | tuple[int, int],
downsample: int,
start_slice_index: int,
start_slice_z_mag1: int,
view: View,
) -> None:
tiff_bbox_mag1 = view.bounding_box
Expand All @@ -97,7 +97,7 @@ def export_tiff_slice(
tiff_data = padded_tiff_data
for slice_index in range(tiff_bbox.size.z):
slice_name_number = (
tiff_bbox_mag1.topleft.z + slice_index + 1 - start_slice_index
tiff_bbox_mag1.topleft.z + slice_index * view.mag.z - start_slice_z_mag1
)
if tiling_size is None:
tiff_file_name = _make_tiff_name(name, slice_name_number)
Expand Down Expand Up @@ -165,7 +165,7 @@ def export_tiff_stack(
wait_and_ensure_success(
executor.map_to_futures(
partial(
export_tiff_slice,
export_tiff_slice_batch,
destination_path,
name,
tiling_slice_size,
Expand Down
Loading