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

Galaxy overlay_images plugin AttributeError: 'NoneType' object has no attribute 'seek' #121

Open
cgirardot opened this issue Jun 12, 2024 · 4 comments

Comments

@cgirardot
Copy link

Dear,

I have deployed the Galaxy overlay_images (Galaxy Version 0.0.4+galaxy3) in our local galaxy and followed the "Introduction to image analysis using Galaxy" tutorial, but I am getting this error (see below).

Note that I also used the "Galaxy Version 0.0.3-3" version as in the tutorial which worked after I fixed the mulled conda env ; I indeed had to (re)install numpy.

Could you advise?

Traceback (most recent call last):
  File "/g/funcgen/galaxy-production/shed_tools/toolshed.g2.bx.psu.edu/repos/imgteam/overlay_images/8dc02c854048/overlay_images/overlay_images.py", line 121, in <module>
    seg_contour(args.im1, args.im2, args.out,
  File "/g/funcgen/galaxy-production/shed_tools/toolshed.g2.bx.psu.edu/repos/imgteam/overlay_images/8dc02c854048/overlay_images/overlay_images.py", line 77, in seg_contour
    labels = giatools.io.imread(im2_fn)
  File "/g/funcgen/galaxy-production/database/dependencies/_conda/envs/mulled-v1-ab2c0f314a3c4674b82222c696598109c6abab527a4e27a3e115a79787e5ca0d/lib/python3.9/site-packages/giatools/io.py", line 25, in imread
    return impl(*args, **kwargs)
  File "/g/funcgen/galaxy-production/database/dependencies/_conda/envs/mulled-v1-ab2c0f314a3c4674b82222c696598109c6abab527a4e27a3e115a79787e5ca0d/lib/python3.9/site-packages/skimage/io/_io.py", line 48, in imread
    img = call_plugin('imread', fname, plugin=plugin, **plugin_args)
  File "/g/funcgen/galaxy-production/database/dependencies/_conda/envs/mulled-v1-ab2c0f314a3c4674b82222c696598109c6abab527a4e27a3e115a79787e5ca0d/lib/python3.9/site-packages/skimage/io/manage_plugins.py", line 207, in call_plugin
    return func(*args, **kwargs)
  File "/g/funcgen/galaxy-production/database/dependencies/_conda/envs/mulled-v1-ab2c0f314a3c4674b82222c696598109c6abab527a4e27a3e115a79787e5ca0d/lib/python3.9/site-packages/skimage/io/_plugins/imageio_plugin.py", line 10, in imread
    return np.asarray(imageio_imread(*args, **kwargs))
  File "/g/funcgen/galaxy-production/database/dependencies/_conda/envs/mulled-v1-ab2c0f314a3c4674b82222c696598109c6abab527a4e27a3e115a79787e5ca0d/lib/python3.9/site-packages/imageio/__init__.py", line 97, in imread
    return imread_v2(uri, format=format, **kwargs)
  File "/g/funcgen/galaxy-production/database/dependencies/_conda/envs/mulled-v1-ab2c0f314a3c4674b82222c696598109c6abab527a4e27a3e115a79787e5ca0d/lib/python3.9/site-packages/imageio/v2.py", line 360, in imread
    result = file.read(index=0, **kwargs)
  File "/g/funcgen/galaxy-production/database/dependencies/_conda/envs/mulled-v1-ab2c0f314a3c4674b82222c696598109c6abab527a4e27a3e115a79787e5ca0d/lib/python3.9/site-packages/imageio/plugins/pillow.py", line 252, in read
    image = self._apply_transforms(
  File "/g/funcgen/galaxy-production/database/dependencies/_conda/envs/mulled-v1-ab2c0f314a3c4674b82222c696598109c6abab527a4e27a3e115a79787e5ca0d/lib/python3.9/site-packages/imageio/plugins/pillow.py", line 335, in _apply_transforms
    meta = self.metadata(index=self._image.tell(), exclude_applied=False)
  File "/g/funcgen/galaxy-production/database/dependencies/_conda/envs/mulled-v1-ab2c0f314a3c4674b82222c696598109c6abab527a4e27a3e115a79787e5ca0d/lib/python3.9/site-packages/imageio/plugins/pillow.py", line 537, in metadata
    if self._image.getexif():
  File "/g/funcgen/galaxy-production/database/dependencies/_conda/envs/mulled-v1-ab2c0f314a3c4674b82222c696598109c6abab527a4e27a3e115a79787e5ca0d/lib/python3.9/site-packages/PIL/Image.py", line 1389, in getexif
    self._exif.load_from_fp(self.fp, self.tag_v2._offset)
  File "/g/funcgen/galaxy-production/database/dependencies/_conda/envs/mulled-v1-ab2c0f314a3c4674b82222c696598109c6abab527a4e27a3e115a79787e5ca0d/lib/python3.9/site-packages/PIL/Image.py", line 3445, in load_from_fp
    self.fp.seek(offset)
AttributeError: 'NoneType' object has no attribute 'seek'
@cgirardot cgirardot changed the title Galaxy overlay_images plugin ValueError: unknown dtype: int32 Galaxy overlay_images plugin AttributeError: 'NoneType' object has no attribute 'seek' Jun 12, 2024
@bgruening
Copy link
Collaborator

Is there an option to try the Container for that tool?

@cgirardot
Copy link
Author

we dont have this set up available on our local instance, so ...no sorry.

@kostrykin
Copy link
Member

worked after I fixed the mulled conda env ; I indeed had to (re)install numpy.

@cgirardot What was the error that you were getting? Was it this maybe?

AttributeError: module 'numpy.typing' has no attribute 'NDArray'

@kostrykin
Copy link
Member

@cgirardot With #130, version 0.0.4+galaxy4 of the tool works nicely for me running a local Galaxy instance without containerization. Can you maybe check whether the issue still persists for you with version 0.0.4+galaxy4 of the tool?

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