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

Modify extension to request raw tiles when possible #1

Merged
merged 26 commits into from
Mar 28, 2024

Conversation

melissalinkert
Copy link
Member

If the server can supply raw tiles via microservices, request them directly. This expands the range of data types supported to more than just 3 channel/uint8.

/cc @muhanadz

@melissalinkert
Copy link
Member Author

I think the .github/workflows/gradle.yml will do what we need for testing now, but I suspect this needs to be manually enabled (and I do not seem to have permission to do so).

@melissalinkert
Copy link
Member Author

@muhanadz : build is now passing here.

Copy link
Member

@muhanadz muhanadz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few issues I've encountered while testing:

  1. Login always fails first time:
Screenshot 2024-03-07 at 9 01 58 pm

However the server is added to the list of server and works if clicked from the extentions menu:
Screenshot 2024-03-07 at 9 02 10 pm

  1. I cannot load none uint8 + 3 channel images:
    Without PR:
Screenshot 2024-03-07 at 9 00 30 pm

With this PR:
Screenshot 2024-03-07 at 9 02 42 pm

I'd expect to be able to load all images since we're getting the raw tiles.


Otherwise valid images load as expected, but will need to further test and confirm that the microservices are being used.

Testing on QuPath 0.4.4 macOS 13.5.1, M1. Happy to switch to a windows environment for less unknown variables if needed.

@melissalinkert
Copy link
Member Author

All of the work here was against QuPath 0.3.2 as agreed approximately a year ago; I don't think we had discussed moving to a newer version of QuPath.

I can reproduce the issues above, all of which are a result of not being able to find the session cookie after login. That means there is no communication with the microservice at all because the sessionid can't be set. I suspect (but am not 100% certain) that this is a result of QuPath requiring Java 17 with 0.4.0+. Note https://github.com/qupath/qupath-extension-omero/releases/tag/v0.1.0-rc4 with QuPath 0.5.0 also cannot use the microservice.

If you test with QuPath 0.3.2, I'd expect all of this to work (keep in mind this is a public PR if adding screenshots). Before I update this PR, let's decide for sure which QuPath version we're now targeting, as I'd expect 0.4.x and 0.5.x to require different amounts of work.

@melissalinkert
Copy link
Member Author

I believe the last 3 commits here are sufficient to upgrade from QuPath 0.3.2 to 0.5.1. @muhanadz, if you see any issues with 0.5.1 and the latest build (https://github.com/glencoesoftware/qupath-extension-omero/actions/runs/8257393991?pr=1) just let me know.

@muhanadz
Copy link
Member

Introduced in 4e819fe: When adding the extension for the first time and trying to add a server, since there are no servers added by default, the JSON deserialisation fails and the usedServers remains null which throws this exception:

10:40:07.111	[JavaFX Application Thread]	INFO	qupath.lib.gui.ExtensionClassLoader	Adding jar: /QuPath/v0.5/extensions/qupath-extension-omero-0.3.1-SNAPSHOT 2.jar
10:40:07.115	[JavaFX Application Thread]	INFO	qupath.lib.gui.ExtensionManager	Loaded extension OMERO extension (2 ms)
10:40:10.249	[JavaFX Application Thread]	ERROR	qupath.lib.gui.QuPathUncaughtExceptionHandler	Cannot invoke "java.util.List.iterator()" because "usedServers" is null	java.lang.NullPointerException: Cannot invoke "java.util.List.iterator()" because "usedServers" is null
	at qupath.lib.images.servers.omero.OmeroExtension.lambda$createServerListMenu$3(OmeroExtension.java:148)
	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
	at javafx.event.Event.fireEvent(Event.java:198)
	at javafx.scene.control.Menu.setShowing(Menu.java:205)
	at javafx.scene.control.Menu.show(Menu.java:412)
	at com.sun.javafx.scene.control.GlobalMenuAdapter.lambda$new$1(GlobalMenuAdapter.java:78)
	at com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(ExpressionHelper.java:136)
	at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
	at javafx.beans.property.ReadOnlyBooleanPropertyBase.fireValueChangedEvent(ReadOnlyBooleanPropertyBase.java:78)
	at javafx.beans.property.ReadOnlyBooleanWrapper.fireValueChangedEvent(ReadOnlyBooleanWrapper.java:103)
	at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:111)
	at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:145)
	at javafx.scene.control.Menu.setShowing(Menu.java:209)
	at javafx.scene.control.Menu.show(Menu.java:412)
	at com.sun.javafx.tk.quantum.GlassMenuEventHandler.handleMenuOpening(GlassMenuEventHandler.java:41)
	at com.sun.glass.ui.Menu.notifyMenuOpening(Menu.java:186)

No way currently to avoid the exception and add a server since it's trying to iterate null every time I try to add a server.

@melissalinkert
Copy link
Member Author

660edd4 should fix the issue noted in #1 (comment).

@muhanadz
Copy link
Member

Thank Melissa for the changes.

I can now connect to an omero server and retrieve images fine. I'll continue with the thorough testing on that. Meanwhile a small issue I noticed when logging in. The server gets duplicated from the Browse Server, the first time I connect to it. Starting with the following 3 servers as an example:

Screenshot 2024-03-14 at 12 42 59 pm

Then when I connect to a server, qupath-testing for example, I see:

Screenshot 2024-03-14 at 12 46 31 pm

@melissalinkert
Copy link
Member Author

5d64b83 should fix the issue noted in #1 (comment).

Copy link
Member

@muhanadz muhanadz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with connections to different valid servers. Microservices are used when detected, otherwise falls back to previous behaviour. If Microservices are present, able to load multi-channel images not only uint8 but also uint16 uint32 uint64. Tile loading takes 2-3 seconds depends on connection and distance to the server but that's expected and doesn't seem to be an issue. Downstream analysis with QuPath works as expected such as cell detection. Sending ROIs from QuPath to OMERO via the extension work as expected as long as iviewer is installed and configured correctly.

@sbesson sbesson self-requested a review March 20, 2024 16:25
Copy link
Member

@sbesson sbesson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At first glance the proposed changes make sense. Talking to Muhanad, there has been some recent evolution upstream as this extension has been renamed as qupath-extension-omero-web (but the artifact name is still qupath-extension-omero) and work has started on a new experimental https://github.com/qupath/qupath-extension-omero extension still released below 0.1.0 that should include native support for OMERO deployments with micro-services amongst others. The QuPath documentation has been updated accordingly - see https://qupath.readthedocs.io/en/stable/docs/advanced/omero.html#omero-extension.

As the above is already confusing, my best suggestion would be to match the upstream name i.e.

  1. rename this fork (and any of our forks) as qupath-extension-omero-web
  2. keep the artifact name as qupath-extension-omero like upstream
  3. use a version with a suffix indicating this is our custom build on top of the official QuPath extension release e.g. 0.4.0-gs or 0.4.1-gs
  4. update the readme to describe the intent of this fork i.e. adding micro-service support to the qupath-extension-omero-web extension
  5. also include the blurb above to the release notes on the GitHub release page

In addition to the above, should we try to sync the changes made upstream in v0.4.0? Looking at the [diff
(https://github.com/glencoesoftware/qupath-extension-omero/compare/main...qupath:qupath-extension-omero-web:v0.4.0), the main changes are:

  • refactoring of the top-level build configuration
  • Gradle wrapper upgrade to 8.6
  • miscellaneous changes to the source code - some of them overlapping with changes on this branch e.g. OmeroWebClientsCommand.java or OmeroWebImageServerBrowserCommand.java

@melissalinkert melissalinkert mentioned this pull request Mar 22, 2024
@melissalinkert
Copy link
Member Author

At first glance the proposed changes make sense. Talking to Muhanad, there has been some recent evolution upstream as this extension has been renamed as qupath-extension-omero-web (but the artifact name is still qupath-extension-omero) and work has started on a new experimental https://github.com/qupath/qupath-extension-omero extension still released below 0.1.0 that should include native support for OMERO deployments with micro-services amongst others. The QuPath documentation has been updated accordingly - see https://qupath.readthedocs.io/en/stable/docs/advanced/omero.html#omero-extension.

As the above is already confusing, my best suggestion would be to match the upstream name i.e.

  1. rename this fork (and any of our forks) as qupath-extension-omero-web

No objection, but it doesn't look like I have permission to do this.

  1. keep the artifact name as qupath-extension-omero like upstream

👍

  1. use a version with a suffix indicating this is our custom build on top of the official QuPath extension release e.g. 0.4.0-gs or 0.4.1-gs

0095d5a updates to 0.4.1-gs-SNAPSHOT; as with everything else, the -SNAPSHOT would be dropped when we tag a release.

  1. update the readme to describe the intent of this fork i.e. adding micro-service support to the qupath-extension-omero-web extension

Done in b178bd2.

  1. also include the blurb above to the release notes on the GitHub release page

Can do when we merge this and tag the release.

In addition to the above, should we try to sync the changes made upstream in v0.4.0? Looking at the [diff (https://github.com/glencoesoftware/qupath-extension-omero/compare/main...qupath:qupath-extension-omero-web:v0.4.0), the main changes are:

See #2. I had intended to push directly to main, but don't have permission to do so. That means that in order:

@melissalinkert
Copy link
Member Author

Conflicts fixed and latest build is passing, so ready for re-testing as discussed. The gradle.yml workflow should start on every push, so I don't believe further changes are needed to build tags.

@muhanadz muhanadz self-requested a review March 26, 2024 15:02
Copy link
Member

@muhanadz muhanadz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performed similar tests mentioned in the previous comment #1 (review), all looks good to me ✅

The OMERO extension version is now listed correctly in the Extension manager which was "unknown" before:

Screenshot 2024-03-26 at 3 13 41 pm
The GitHub button link redirects to https://github.com/qupath/qupath-extension-omero. Might be worth making a change to redirect it to this repository.

@melissalinkert
Copy link
Member Author

eedc8c5 should fix the GitHub button in the extension manager to point to this repository. Note that is an actual code change, not a build configuration change.

Copy link
Member

@muhanadz muhanadz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The button now redirects to this repository, hopefully this change clears any confusion.
Thanks, looks great.

@melissalinkert
Copy link
Member Author

Thanks @muhanadz. Merging as discussed, in preparation for release.

@melissalinkert melissalinkert merged commit 6738f1b into glencoesoftware:main Mar 28, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

3 participants