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

set_scene does not change scene when scene ids are duplicated #400

Closed
jil24 opened this issue May 11, 2022 · 20 comments · Fixed by #401
Closed

set_scene does not change scene when scene ids are duplicated #400

jil24 opened this issue May 11, 2022 · 20 comments · Fixed by #401
Labels
admin Various administrative tasks for the package bug Something isn't working

Comments

@jil24
Copy link

jil24 commented May 11, 2022

System and Software

  • aicsimageio Version: 4.7.0
  • Python Version 3.10.4
  • Operating System: Mac OS 12.3.1 / M1

Description

When loading a file via bioformats (a leica LOF) with multiple scenes which are named identically, changing the scene via scene index does not work; no error occurs, but the active scene does not change.

I needed to update the bio formats jar to a more recent version manually since the packaged version does not have LOF support. I have no ability to control scene naming.

>>> import aicsimageio
>>> img = aicsimageio.AICSImage('example.lof', reader=aicsimageio.readers.bioformats_reader.BioformatsReader)
>>> img.scenes
('example-c1', 'example-c1', 'example-c1', 'example-c1')
>>> img.current_scene_index
0
img.set_scene(3)
img.current_scene_index
0
@evamaxfield
Copy link
Collaborator

I think this is because the function is simply misnamed? set_series instead of set_scene? cc @tlambert03 should I just quickly swap the function names?

@evamaxfield
Copy link
Collaborator

@tlambert03
Copy link
Collaborator

cc @tlambert03 should I just quickly swap the function names?

works for me!

@toloudis
Copy link
Collaborator

maybe run_image_file_checks should test scene index too?

@jil24
Copy link
Author

jil24 commented May 11, 2022

So this has nothing to do with my scene/series name duplication at all?

@evamaxfield
Copy link
Collaborator

At the current moment, I do not believe so because you are providing an index and not name.

@jil24
Copy link
Author

jil24 commented May 11, 2022

Hmm, I tried making the changes in those commits; there is no difference in the behavior

@evamaxfield
Copy link
Collaborator

Correction: this is likely because bioformats itself does not support multiple images (read: scenes in an AICSImageIO context) for Leica LOF: https://docs.openmicroscopy.org/bio-formats/6.9.1/supported-formats.html

@jil24
Copy link
Author

jil24 commented May 11, 2022

Yet I can load multiple scenes via bio formats into FIJI from the same file?

@evamaxfield
Copy link
Collaborator

cc @joshmoore / someone from bioformats? Is the table out of date? Are LOF files actually supported?

@dgault
Copy link

dgault commented May 12, 2022

Support for XLEF and LOF files was added in 6.9.0 as an external contribution from Leica Microsystems. So it should be supported if you are using the latest 6.9.1 release. The LOF reader will only read individual files
(https://docs.openmicroscopy.org/bio-formats/6.9.1/formats/leica-lof.html), whereas the XLEF reader will read the entire dataset (https://docs.openmicroscopy.org/bio-formats/6.9.1/formats/leica-xlef.html). So if you have an XLEF file you may want to point at it when opening the dataset.

@jil24
Copy link
Author

jil24 commented May 12, 2022

I did a little more investigation; the problem seems to be not specific to LOF files. When opening a ome-tiff using bio-formats reader, I get the same silent failure to switch scenes. When using the ome_tiff_reader, everything works correctly.

@evamaxfield
Copy link
Collaborator

@tlambert03 would it be possible that the bioformats jar that ships with the python package simply doesn't have the latest version? Do you package that manually or is it auto pulled / built?

@tlambert03
Copy link
Collaborator

needs updating. but I've dragged my feet on that, since we should really be using scyjava. (see tlambert03/bioformats_jar#2)

I'll try to get on it soon

@tlambert03
Copy link
Collaborator

(it's '6.7.0')

@evamaxfield
Copy link
Collaborator

Support for XLEF and LOF files was added in 6.9.0 as an external contribution from Leica Microsystems. So it should be supported if you are using the latest 6.9.1 release.

[bioformats_jar is] '6.7.0'

Well now I am confused... It is opening a file format that it didn't officially support at that point

@evamaxfield
Copy link
Collaborator

needs updating. but I've dragged my feet on that, since we should really be using scyjava. (see tlambert03/bioformats_jar#2)

It never ceases to amaze me how complicated some issues are. As per usual, thanks for all you do

@evamaxfield evamaxfield added bug Something isn't working admin Various administrative tasks for the package labels May 19, 2022
@evamaxfield
Copy link
Collaborator

I have found the bug and updated the PR. @jil24 could you attempt to install and use the branch again. There is a single bug that is maybe related but I will look into next week.

@evamaxfield
Copy link
Collaborator

This should now be fixed and released. pip install --upgrade aicsimageio should install 4.8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
admin Various administrative tasks for the package bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants