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

Failing with 19 channels #199

Open
FaehlingT opened this issue Sep 26, 2023 · 1 comment
Open

Failing with 19 channels #199

FaehlingT opened this issue Sep 26, 2023 · 1 comment

Comments

@FaehlingT
Copy link

Hi and thanks for the great tool :)

When using the fileseries command on a fileseries with 19 channels, ashlar fails at the process of saving the pyramid when I have it save all channels. When I limit it to ≤18 channels, it works (regardless of the channel I omit). Now, I also had the same problem when running 18 channels, which usually worked.
Command that works mostly:

ashlar 'fileseries|/path/to/raw|pattern=tile{series:2}.ome.tiff|width=5|height=6|pixel_size=0.182|overlap=0.05' \
            -o /path/to/output.ome.tif \
            -c 17 \
            --flip-x \
            --output-channels 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 18 \ # it does not matter which channel I omit here
            --maximum-shift 2 \
            --ffp '/path/to/ffp.tif' \
            --dfp '/path/to/dfp.tif';

Command that never worked:

ashlar 'fileseries|/path/to/raw|pattern=tile{series:2}.ome.tiff|width=5|height=6|pixel_size=0.182|overlap=0.05' \
            -o /path/to/output.ome.tif \
            -c 17 \
            --flip-x \
            --maximum-shift 2 \
            --ffp '/path/to/ffp.tif' \
            --dfp '/path/to/dfp.tif';

It shows the following error message:

...
Channel 18:
    merging tile 35/35
Generating pyramid
  Level 1 (12788 x 15437)
<tifffile.TiffPages @16> invalid page offset 3250604960 # the page offset varies when I repeat the process
    processing channel 3/19Traceback (most recent call last): # It happens in different channels.
 File “/home/xx/.local/bin/ashlar”, line 8, in <module>
  sys.exit(main())
 File “/home/xx/.local/lib/python3.9/site-packages/ashlar/scripts/ashlar.py”, line 212, in main
  return process_single(
 File “/home/xx/.local/lib/python3.9/site-packages/ashlar/scripts/ashlar.py”, line 277, in process_single
  writer.run()
 File “/home/xx/.local/lib/python3.9/site-packages/ashlar/reg.py”, line 1247, in run
  tiff.write(
 File “/home/xx/.local/lib/python3.9/site-packages/tifffile/tifffile.py”, line 3337, in write
  iteritem = next(dataiter)
 File “/home/xx/.local/lib/python3.9/site-packages/tifffile/tifffile.py”, line 22910, in newiter
  yield from iterator
 File “/home/xx/.local/lib/python3.9/site-packages/ashlar/reg.py”, line 1206, in subres_tiles
  a = zimg[c, y:y+th, x:x+tw, 0]
 File “/home/xx/.local/lib/python3.9/site-packages/zarr/core.py”, line 842, in __getitem__
  result = self.get_orthogonal_selection(pure_selection, fields=fields)
 File “/home/xx/.local/lib/python3.9/site-packages/zarr/core.py”, line 1122, in get_orthogonal_selection
  indexer = OrthogonalIndexer(selection, self)
 File “/home/xx/.local/lib/python3.9/site-packages/zarr/indexing.py”, line 617, in __init__
  dim_indexer = IntDimIndexer(dim_sel, dim_len, dim_chunk_len)
 File “/home/xx/.local/lib/python3.9/site-packages/zarr/indexing.py”, line 150, in __init__
  dim_sel = normalize_integer_selection(dim_sel, dim_len)
 File “/home/xx/.local/lib/python3.9/site-packages/zarr/indexing.py”, line 124, in normalize_integer_selection
  raise BoundsCheckError(dim_len)
zarr.errors.BoundsCheckError: index out of bounds for dimension with length 2
@jmuhlich
Copy link
Collaborator

What version of ashlar, tifffile, and zarr do you have installed?

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

No branches or pull requests

2 participants