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

New Frame selector Vue component #1086

Merged
merged 39 commits into from
Apr 19, 2023
Merged

New Frame selector Vue component #1086

merged 39 commits into from
Apr 19, 2023

Conversation

annehaley
Copy link
Collaborator

@annehaley annehaley commented Mar 21, 2023

Resolves #498, resolves #1108, resolves #1111

Improvements for future PRs:

  • Histograms
  • Save configurations?
  • Reset button

@manthey
Copy link
Member

manthey commented Apr 5, 2023

@annehaley See the changes I made and the comments on the last commit. If you think this would be clearer rebased onto master, please do so.

@manthey manthey force-pushed the new-frame-selector branch from 3bbeb4c to ad01037 Compare April 5, 2023 17:00
@annehaley
Copy link
Collaborator Author

@manthey thank you for fixing geojs.js! It works smoothly now. I'll rebase and get tests passing, then I'll throw it back to you for review

annehaley and others added 8 commits April 5, 2023 14:33
Remove package-lock.json.
If we don't specify a style, the baseQuad is still used.  Oddly, when we
stop using the baseQuad I see some webGL warnings which I'll hunt down
separately.

It would be better to set a style of undefined if not needed (for
instance not using channel compositing).

There is one workaround of a potential caching bug that I'll also look
into later.
@annehaley annehaley force-pushed the new-frame-selector branch from ad01037 to a563949 Compare April 5, 2023 18:36
@annehaley annehaley force-pushed the new-frame-selector branch from 83675fc to e3cedec Compare April 5, 2023 18:58
@annehaley
Copy link
Collaborator Author

@manthey could you help me figure out why the following failure is happening?

FAILED girder/test_girder/test_web_client.py::testWebClientNoStream[imageViewerSpec.js]

@manthey
Copy link
Member

manthey commented Apr 5, 2023

@manthey could you help me figure out why the following failure is happening?

FAILED girder/test_girder/test_web_client.py::testWebClientNoStream[imageViewerSpec.js]

I used URLSearchParams to extract a value to help with cache control. Our client tests run on an older javascript framework which apparently doesn't define this but since there is a timing factor, it only sometimes fails. Let me switch how this is done or add a polyfill.

@annehaley annehaley marked this pull request as ready for review April 5, 2023 20:38
@annehaley annehaley requested a review from manthey April 5, 2023 20:38
@manthey
Copy link
Member

manthey commented Apr 6, 2023

I don't want to merge anything that shows unfinished functionality. So, we either need to handle the unfinished parts (e.g., bands) or finish them. Once we've done that and addressed my color comments, we could merge this and leave everything else to future PRs.

Ultimately, I haven't seen real-world data sets that have both more than three bands AND channels, so I think that we could have our modes be "Sliders / Composite Frames / Composite Bands". Composite Bands could be an option even on single band (greyscale) images with only one frame, since that would be a way of exposing the min/max controls.

For bands, the colors should default based on the band interpretation (red/green/blue/gray) and then use unused colors for other interpretations (including alpha). The default initial checked bands should just be the first three bands (as opposed to channels where we default to all channels being on and composited).

When we use this in the HistomicsUI context, we'll want these controls to fit in one of the side panels -- we'll be able to use CSS to adjust this. We just need to be aware that controls will be tight (more relevant as we add histograms and options for min/max besides numbers).

The use of "0" as undefined for min/max isn't appropriate. Technically, the unset value can be different than 0 for min (and is determined based on datatype for max), and with float-based samples, 0 might actually be a sensible max in some odd case. We eventually want to have a mode for min and max that would be "default/value/min(or max)" where "default" wouldn't use a number, "value" would be the current mode (but there can be data where this is floating point on a scale of [0,1] or [-1,1] or other values, so the controls can't restrict to integers unless we check that makes sense), and "min" or "max" would let you specify a numerical value from [0,1] (or maybe from [0%, 100%]) which would be the amount of the histogram to exclude from the ends (e.g., "min:0.002" sets the minimum such that 0.2% of the samples are below the picked value).

And, for non-composited axes, we'll eventually want a "max-merge" option (which would disable the slider). This might conceptually have other choices (so maybe it is a drop-down control of slider/max-merge rather than a checkbox).

When we do show this histogram, it is relatively cheap to get the histogram for all the bands of the current frame. For multiple channels, we end up needing to currently ask for the histogram for all channels at the current frame position. Since each frame has its own histogram, we might want to overlay two histograms -- one of the current frame/channel (possibly applying max-merge) and one of the combined histograms of all frames with that channel. Getting that combined histogram is initially expensive in time (and when we have it, we might want an additional min/max mode of combined min/combined max). We'll want to show the min/max values on the histogram as vertical bars.

And, in my list of wants, we may eventually want a checkbox to enable/disable all channels (or bands) so that you can quickly re-enable them or go to a single channel/band.

@manthey
Copy link
Member

manthey commented Apr 7, 2023

When we construct the style, it is somewhat more efficient to specify the base frame as the frame parameter and the style with framedelta rather than frame per band (see https://girder.github.io/large_image/tilesource_options.html#style).

@annehaley annehaley marked this pull request as draft April 7, 2023 18:43
@annehaley
Copy link
Collaborator Author

When we construct the style, it is somewhat more efficient to specify the base frame as the frame parameter and the style with framedelta rather than frame per band (see https://girder.github.io/large_image/tilesource_options.html#style).

Could you provide an example? I don't understand what this would look like from the documentation.

@manthey
Copy link
Member

manthey commented Apr 7, 2023

I see some linting errors in the latest commit. Running tox -e format,formatclient should resolve most such issues.

@annehaley annehaley force-pushed the new-frame-selector branch from 1de78dd to bf9766f Compare April 12, 2023 13:34
@annehaley
Copy link
Collaborator Author

If you have enough channels that you need to scroll, the color pickers appear in the wrong place instead of scrolling with the channels (and, for an item with 40 channels, a select all/none would be really handy)

Changed in 21e920a and 464146c

@annehaley annehaley marked this pull request as ready for review April 14, 2023 15:04
@annehaley annehaley requested a review from manthey April 14, 2023 15:04
@manthey
Copy link
Member

manthey commented Apr 18, 2023

When I have the axis mode and slide the channel slide to a non-zero value and then switch to composite channels, it still adds frame = so it ends up with the wrong frames being composited or fails if the last channel is picked.

@manthey
Copy link
Member

manthey commented Apr 18, 2023

Ideally, when we switch between frame and axis or vice versa we would preserve the view (that is frame is directly equivalent to a set of axis values and vice versa).

This could be fixed in a follow on PR.

@annehaley
Copy link
Collaborator Author

@manthey is 1b15871 what you mean?

var params = {
useCredentials: true,
autoshareRenderer: false,
keepLower: false,
Copy link
Member

Choose a reason for hiding this comment

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

This is undesirable when we don't have a base image (such as a map). It makes panning much less attractive as low res tiles aren't shown while high res tiles are loaded. Probably when we are using keepLower false, we need to explicitly hide the lower of our two styled layers. Can you recall what the symptoms were that you were correcting?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I had included this because it was in the params object on line 98 previously, but now I understand that this was only intended for the geospatial cases. I can move this to the geospatial if block instead.

const baseUrl = this._getTileUrl('{z}', '{x}', '{y}');
const match = baseUrl.match(/[?&](_=[^&]*)/);
const updated = match && match[1] ? ('&' + match[1]) : '';
setFrameQuad(this.metadata, this._layer, {
Copy link
Member

Choose a reason for hiding this comment

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

Let me look into how to refactor what you've done -- we really don't want to use the setFrameQuad on images that aren't multiframe or are geospatial.

@manthey
Copy link
Member

manthey commented Apr 19, 2023

If you think my latest changes are good and CI passes, go ahead and merge.

@annehaley annehaley merged commit cd96e81 into master Apr 19, 2023
@annehaley annehaley deleted the new-frame-selector branch April 19, 2023 19:19
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.

Increase z value of color picker Put fixed width on labels in frame selector Better frame selection
2 participants