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

ValueError: <COMPRESSION.LZW: 5> requires the 'imagecodecs' package #174

Closed
josenimo opened this issue Mar 13, 2023 · 3 comments
Closed

Comments

@josenimo
Copy link

Hello @jmuhlich ,

I am trying to stitch and register MACSima raw data, I was able to use ASHLAR without any issue using the docker image from version 1.14, however QuPath does not recognize the pyramid format, it sees the image as a series of levels instead of a pyramid, which usually works well.

Then I tried to use the docker image of version 1.17, however as you see below it runs into an error.
am I committing a formating mistake? or is it just missing the package?

Happy to provide more info if needed.
Best,
Jose


docker run \
> -v "/mnt/y/Sonja/mIF03/MICS_2023-03-07_22-23-50_230307_mIF03_Tonsil_PPS_glass/ashlar/ROI_2":/input \
> -v "/mnt/y/Sonja/mIF03/MICS_2023-03-07_22-23-50_230307_mIF03_Tonsil_PPS_glass/ashlar_output":/output \
> -it labsyspharm/ashlar:1.17.0 ashlar \
> -o "ashlar_all_v1_17.ome.tif" \
> --align-channel 0 \
> "fileseries|/input|pattern=ROI_2_Cycle_000_Channel_{channel:1}_Frame_{series:3}.tif|width=6|height=7|overlap=0.075|pixel_size=0.17|layout=snake|direction=vertical" \
> "fileseries|/input|pattern=ROI_2_Cycle_001_Channel_{channel:1}_Frame_{series:3}.tif|width=6|height=7|overlap=0.075|pixel_size=0.17|layout=snake|direction=vertical" \
> "fileseries|/input|pattern=ROI_2_Cycle_002_Channel_{channel:1}_Frame_{series:3}.tif|width=6|height=7|overlap=0.075|pixel_size=0.17|layout=snake|direction=vertical" \
> "fileseries|/input|pattern=ROI_2_Cycle_003_Channel_{channel:1}_Frame_{series:3}.tif|width=6|height=7|overlap=0.075|pixel_size=0.17|layout=snake|direction=vertical" \
> "fileseries|/input|pattern=ROI_2_Cycle_004_Channel_{channel:1}_Frame_{series:3}.tif|width=6|height=7|overlap=0.075|pixel_size=0.17|layout=snake|direction=vertical" \
> "fileseries|/input|pattern=ROI_2_Cycle_005_Channel_{channel:1}_Frame_{series:3}.tif|width=6|height=7|overlap=0.075|pixel_size=0.17|layout=snake|direction=vertical" \
> "fileseries|/input|pattern=ROI_2_Cycle_006_Channel_{channel:1}_Frame_{series:3}.tif|width=6|height=7|overlap=0.075|pixel_size=0.17|layout=snake|direction=vertical" \
> "fileseries|/input|pattern=ROI_2_Cycle_007_Channel_{channel:1}_Frame_{series:3}.tif|width=6|height=7|overlap=0.075|pixel_size=0.17|layout=snake|direction=vertical" \
> "fileseries|/input|pattern=ROI_2_Cycle_008_Channel_{channel:1}_Frame_{series:3}.tif|width=6|height=7|overlap=0.075|pixel_size=0.17|layout=snake|direction=vertical" \
> "fileseries|/input|pattern=ROI_2_Cycle_009_Channel_{channel:1}_Frame_{series:3}.tif|width=6|height=7|overlap=0.075|pixel_size=0.17|layout=snake|direction=vertical" \
> "fileseries|/input|pattern=ROI_2_Cycle_010_Channel_{channel:1}_Frame_{series:3}.tif|width=6|height=7|overlap=0.075|pixel_size=0.17|layout=snake|direction=vertical" \
> "fileseries|/input|pattern=ROI_2_Cycle_011_Channel_{channel:1}_Frame_{series:3}.tif|width=6|height=7|overlap=0.075|pixel_size=0.17|layout=snake|direction=vertical" \
> "fileseries|/input|pattern=ROI_2_Cycle_012_Channel_{channel:1}_Frame_{series:3}.tif|width=6|height=7|overlap=0.075|pixel_size=0.17|layout=snake|direction=vertical" \
> --maximum-shift 50 \
> --tile-size 512 \
> --pyramid
Stitching and registering input images
Cycle 0:
    reading fileseries|/input|pattern=ROI_2_Cycle_000_Channel_{channel:1}_Frame_{series:3}.tif|width=6|height=7|overlap=0.075|pixel_size=0.17|layout=snake|direction=vertical
Traceback (most recent call last):
  File "/usr/local/bin/ashlar", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/dist-packages/ashlar/scripts/ashlar.py", line 212, in main
    return process_single(
  File "/usr/local/lib/python3.10/dist-packages/ashlar/scripts/ashlar.py", line 237, in process_single
    reader = build_reader(filepaths[0], plate_well=plate_well)
  File "/usr/local/lib/python3.10/dist-packages/ashlar/scripts/ashlar.py", line 358, in build_reader
    reader = reader_class(path, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/ashlar/fileseries.py", line 180, in __init__
    self.metadata = FileSeriesMetadata(
  File "/usr/local/lib/python3.10/dist-packages/ashlar/fileseries.py", line 54, in __init__
    self._enumerate_tiles()
  File "/usr/local/lib/python3.10/dist-packages/ashlar/fileseries.py", line 85, in _enumerate_tiles
    img = skimage.io.imread(str(path))
  File "/usr/local/lib/python3.10/dist-packages/skimage/io/_io.py", line 53, in imread
    img = call_plugin('imread', fname, plugin=plugin, **plugin_args)
  File "/usr/local/lib/python3.10/dist-packages/skimage/io/manage_plugins.py", line 207, in call_plugin
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/skimage/io/_plugins/tifffile_plugin.py", line 30, in imread
    return tifffile_imread(fname, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/tifffile/tifffile.py", line 995, in imread
    return tif.asarray(
  File "/usr/local/lib/python3.10/dist-packages/tifffile/tifffile.py", line 4051, in asarray
    result = page0.asarray(out=out, maxworkers=maxworkers)
  File "/usr/local/lib/python3.10/dist-packages/tifffile/tifffile.py", line 8172, in asarray
    for _ in self.segments(
  File "/usr/local/lib/python3.10/dist-packages/tifffile/tifffile.py", line 7994, in segments
    yield decode(segment)
  File "/usr/local/lib/python3.10/dist-packages/tifffile/tifffile.py", line 7982, in decode
    return func(decode(*args, **decodeargs))
  File "/usr/local/lib/python3.10/dist-packages/tifffile/tifffile.py", line 7466, in decode_raise_compression
    raise ValueError(f'{exc}')
ValueError: <COMPRESSION.LZW: 5> requires the 'imagecodecs' package

@jmuhlich
Copy link
Collaborator

jmuhlich commented Apr 2, 2023

We just need to add imagecodecs python package to the container. Maybe it ended up included in the 1.14 container due to differing transitive dependencies. I'll make sure to do this for the 1.18 release, coming next week.

@josenimo
Copy link
Author

josenimo commented Apr 3, 2023

excellent news @jmuhlich thank you, will be testing soon :)

@josenimo josenimo closed this as completed Apr 3, 2023
@emmanuel-contreras
Copy link

I think this still seems to be an issue with version 1.18.0b3 that I am playing around with. It only happens when trying to export as an ome.tiff, tiff exports just fine

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

3 participants