Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyramid building not using dictionary store #901

Closed
jluethi opened this issue Jan 16, 2025 · 4 comments
Closed

pyramid building not using dictionary store #901

jluethi opened this issue Jan 16, 2025 · 4 comments
Assignees

Comments

@jluethi
Copy link
Collaborator

jluethi commented Jan 16, 2025

I've observed 2 unexpected issues with the new chunking parameters exposed through the new converter task in 1.4.1:

  1. Errors like ZeroDivisionError: integer division or modulo by zero in the converter task
Traceback (most recent call last):
  File "/path/to/FRACTAL_TASK_DIR/7/fractal-tasks-core/1.4.1/venv/lib/python3.10/site-packages/fractal_tasks_core/tasks/cellvoyager_to_ome_zarr_compute.py", line 249, in <module>
    run_fractal_task(
  File "/path/to/FRACTAL_TASK_DIR/7/fractal-tasks-core/1.4.1/venv/lib/python3.10/site-packages/fractal_tasks_core/tasks/_utils.py", line 79, in run_fractal_task
    metadata_update = task_function(**pars)
  File "/path/to/FRACTAL_TASK_DIR/7/fractal-tasks-core/1.4.1/venv/lib/python3.10/site-packages/pydantic/validate_call_decorator.py", line 60, in wrapper_function
    return validate_call_wrapper(*args, **kwargs)
  File "/path/to/FRACTAL_TASK_DIR/7/fractal-tasks-core/1.4.1/venv/lib/python3.10/site-packages/pydantic/_internal/_validate_call.py", line 96, in __call__
    res = self.__pydantic_validator__.validate_python(pydantic_core.ArgsKwargs(args, kwargs))
  File "/path/to/FRACTAL_TASK_DIR/7/fractal-tasks-core/1.4.1/venv/lib/python3.10/site-packages/fractal_tasks_core/tasks/cellvoyager_to_ome_zarr_compute.py", line 199, in cellvoyager_to_ome_zarr_compute
    da.array(FOV_4D).to_zarr(
  File "/path/to/FRACTAL_TASK_DIR/7/fractal-tasks-core/1.4.1/venv/lib/python3.10/site-packages/dask/array/core.py", line 2978, in to_zarr
    return to_zarr(self, *args, **kwargs)
  File "/path/to/FRACTAL_TASK_DIR/7/fractal-tasks-core/1.4.1/venv/lib/python3.10/site-packages/dask/array/core.py", line 3817, in to_zarr
    old_chunks = normalize_chunks(z.chunks, z.shape)
  File "/path/to/FRACTAL_TASK_DIR/7/fractal-tasks-core/1.4.1/venv/lib/python3.10/site-packages/dask/array/core.py", line 3151, in normalize_chunks
    chunks = _convert_int_chunk_to_tuple(shape, chunks)
  File "/path/to/FRACTAL_TASK_DIR/7/fractal-tasks-core/1.4.1/venv/lib/python3.10/site-packages/dask/array/core.py", line 3177, in _convert_int_chunk_to_tuple
    return sum(
  File "/path/to/FRACTAL_TASK_DIR/7/fractal-tasks-core/1.4.1/venv/lib/python3.10/site-packages/dask/array/core.py", line 3180, in <genexpr>
    blockdims_from_blockshape((s,), (c,))
  File "/path/to/FRACTAL_TASK_DIR/7/fractal-tasks-core/1.4.1/venv/lib/python3.10/site-packages/dask/array/core.py", line 1279, in blockdims_from_blockshape
    return tuple(
  File "/path/to/FRACTAL_TASK_DIR/7/fractal-tasks-core/1.4.1/venv/lib/python3.10/site-packages/dask/array/core.py", line 1280, in <genexpr>
    ((bd,) * (d // bd) + ((d % bd,) if d % bd else ()) if d else (0,))
ZeroDivisionError: integer division or modulo by zero
  1. Lower pyramid resolutions appear to be black => it looks like your images are empty. When you zoom in, you can see that your images aren't actually empty.
@jluethi
Copy link
Collaborator Author

jluethi commented Jan 16, 2025

Issue 1 was a false positive of a user setting chunk sizes to 0.

2 seems to be an issue with the pyramid building. Will have to investigate whether it's related to the chunk sizes or the new way of building pyramids introduced in #895

@jluethi
Copy link
Collaborator Author

jluethi commented Jan 16, 2025

It turns out, the cause for the issue is dimension separators. The new version of creating the zarr in the PR defaults to using the . separator. napari-ome-zarr can't display OME-Zarrs with that.
I'll revert back to forcing it to use the "/" separator.

cc @m-albert for context, you'll want to switch to fractal-tasks-core 1.4.3 once released to avoid issues with the pyramids that are built.

@jluethi jluethi changed the title Cellvoyager converter: Issues with new chunking parameters pyramid building not using dictionary store Jan 16, 2025
@jluethi
Copy link
Collaborator Author

jluethi commented Jan 16, 2025

This made it into fractal-tasks-core 1.4.2, not 1.4.3 in the end :)

@m-albert
Copy link
Contributor

Thanks for the heads up and the fix @jluethi! I've seen you've already adapted the stitching task over at m-albert/fractal-ome-zarr-hcs-stitching#27.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants