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

Error when opening a large image format #225

Closed
spatre opened this issue Jul 29, 2022 · 6 comments
Closed

Error when opening a large image format #225

spatre opened this issue Jul 29, 2022 · 6 comments

Comments

@spatre
Copy link

spatre commented Jul 29, 2022

I'm getting this RuntimeError('Incompatible keyframe') when I click on the large image icon to open the .btf image.

image

This works fine on an older version of DSA(I'm able to open it properly) but not in the latest.
Below is the error.log when I click on large image icon.

[2022-07-29 20:49:43,511] ERROR: 500 Error
Traceback (most recent call last):
  File "/opt/girder/girder/api/rest.py", line 649, in endpointDecorator
    val = fun(self, path, params)
  File "/opt/girder/girder/api/rest.py", line 1238, in POST
    return self.handleRoute(method, path, params)
  File "/opt/girder/girder/api/rest.py", line 977, in handleRoute
    val = handler(**kwargs)
  File "/opt/girder/girder/api/access.py", line 57, in wrapped
    return fun(*args, **kwargs)
  File "/opt/girder/girder/api/rest.py", line 400, in wrapped
    return fun(*args, **kwargs)
  File "/opt/girder/girder/api/rest.py", line 430, in wrapped
    val = fun(*args, **kwargs)
  File "/opt/large_image/girder/girder_large_image/rest/tiles.py", line 222, in createTiles
    return self.imageItemModel.createImageItem(
  File "/opt/large_image/girder/girder_large_image/models/image_item.py", line 77, in createImageItem
    sourceName = girder_tilesource.getGirderTileSourceName(item, fileObj)
  File "/opt/large_image/girder/girder_large_image/girder_tilesource.py", line 175, in getGirderTileSourceName
    if AvailableGirderTileSources[sourceName].canRead(item):
  File "/opt/large_image/large_image/tilesource/base.py", line 2526, in canRead
    cls(path, *args, **kwargs)
  File "/opt/large_image/large_image/cache_util/cache.py", line 204, in __call__
    raise exc
  File "/opt/large_image/large_image/cache_util/cache.py", line 197, in __call__
    instance = super().__call__(*args, **kwargs)
  File "/opt/large_image/sources/tifffile/large_image_source_tifffile/__init__.py", line 102, in __init__
    for idx, s in enumerate(self._tf.series):
  File "/.pyenv/versions/3.9.13/lib/python3.9/functools.py", line 993, in __get__
    val = self.func(instance)
  File "/opt/venv/lib/python3.9/site-packages/tifffile/tifffile.py", line 3953, in series
    series = getattr(self, '_series_' + name)()
  File "/opt/venv/lib/python3.9/site-packages/tifffile/tifffile.py", line 4500, in _series_sis
    pages = self.pages._getlist(validate=False)
  File "/opt/venv/lib/python3.9/site-packages/tifffile/tifffile.py", line 6368, in _getlist
    pages = [getitem(i, validate=validhash) for i in key]
  File "/opt/venv/lib/python3.9/site-packages/tifffile/tifffile.py", line 6368, in <listcomp>
    pages = [getitem(i, validate=validhash) for i in key]
  File "/opt/venv/lib/python3.9/site-packages/tifffile/tifffile.py", line 6415, in _getitem
    page = tiffpage(self.parent, index=pageindex, keyframe=self._keyframe)
  File "/opt/venv/lib/python3.9/site-packages/tifffile/tifffile.py", line 8648, in __init__
    raise RuntimeError('incompatible keyframe')
RuntimeError: incompatible keyframe

It would be great if you can suggest me what to do to resolve this. Thank you.

@manthey
Copy link
Contributor

manthey commented Jul 29, 2022

Hmm... It looks like your file is trying to be opened via the tifffile source (which didn't exist until a few weeks ago). You can manually uninstall large-image-source-tifffile, but the right solution is to detect that this file shouldn't be handled via that source. I'll look into it further next week.

Would you happen to have a file that can be used for public testing that shows the problem?

@spatre
Copy link
Author

spatre commented Jul 29, 2022

Thank you so much. Let me see If I can find a public BigTiff image that can be used to test this. The one I'm using is from a private dataset.

@spatre
Copy link
Author

spatre commented Aug 1, 2022

@manthey Unfortunately I couldn't find any public image that could be used to test this usecase. However, when I ran the "identify" command from Imagemagick on this image file, I got the below.

hu_prostate_PC4-20200605_2019_01.btf[0] TIFF64 45048x40466 45048x40466+0+0 8-bit sRGB 5.09903GiB 0.010u 0:00.007
hu_prostate_PC4-20200605_2019_01.btf[1] TIFF64 27x25 27x25+0+0 16-bit Grayscale Gray 0.010u 0:00.003 

@manthey
Copy link
Contributor

manthey commented Aug 1, 2022

I think this will be fixed by girder/large_image#903.

That will get built into the dockers later today.

@manthey
Copy link
Contributor

manthey commented Aug 1, 2022

I'll close this (the dockers should be rebuilt in ~ 1 hour). Please reopen if it isn't resolved.

@manthey manthey closed this as completed Aug 1, 2022
@spatre
Copy link
Author

spatre commented Aug 1, 2022

@manthey I pulled the updated dockers and it worked like a charm! Thanks so much for your swift action on this issue.

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