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

Create, select, and delete image view presets #1237

Merged
merged 15 commits into from
Jul 26, 2023
Merged

Conversation

annehaley
Copy link
Collaborator

@annehaley annehaley commented Jul 10, 2023

This PR adds a widget for Image View Presets on the righthand side of the image controls.
The user doe the following:

  1. select from existing presets to apply one
  2. use the plus button to name and save the current state as a new preset
  3. delete the selected preset

Requesting @manthey to take a look, since this will probably need a few iterations.

image

@annehaley annehaley force-pushed the frame-selection-presets branch from c2e21e6 to c0599fd Compare July 11, 2023 16:21
@manthey
Copy link
Member

manthey commented Jul 14, 2023

Is there any way to close the "new preset" after it has been expanded? Maybe clicking the plus again would hide it. It feel like once you start creating a present you are stuck doing so.

@annehaley
Copy link
Collaborator Author

Is there any way to close the "new preset" after it has been expanded? Maybe clicking the plus again would hide it. It feel like once you start creating a present you are stuck doing so.

Yes, I can do that. Changed in 312e6ed

@manthey
Copy link
Member

manthey commented Jul 14, 2023

This is an opinion question (not necessarily a problem). I created a preset with a selection. I then decided it wasn't as good as it could be, so I twiddled some settings. To replace an existing preset without recreating the settings manually, I then have to (1) create a new preset with a name I don't want, (2) switch to the old version, (3) delete it, (4) switch to the undesired name, (5) create a new preset with the original name, (6) switch back to the undesired name, (7) delete it.

Obviously, replacing an existing preset should have some warning, but refusing to replace it makes updating a present hard. What if instead when there was a name collision the "Save preset" button changed to "Update preset"?

'frame': this.currentFrame,
'style': this.currentStyle,
}
if (this.availablePresets.find((p) => p.name === newPreset.name)) {
Copy link
Member

Choose a reason for hiding this comment

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

We should trim the name before comparison and saving it. I made a preset called "foo" and it let me create "foo ", which looks like a name collision.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed in 4ced213

@manthey
Copy link
Member

manthey commented Jul 14, 2023

  1. I create a preset with some channels selected and one with all channels selected. When I switch between them, it visually looks right, but the check boxes don't clear when channels are deselected.
  2. When a preset has all channels selected, the "all" check mark isn't checked.
  3. The auto range now looks like 0.002% rather than 0.2%.

@manthey
Copy link
Member

manthey commented Jul 14, 2023

Would it be possible to compare the current frame and style values and switch the preset drop down to "Select a preset" when things are changed and switch to a specific preset when they match?

@manthey
Copy link
Member

manthey commented Jul 14, 2023

You can't switch back to a preset with spaces at the end of its name.

@manthey
Copy link
Member

manthey commented Jul 14, 2023

On a multi-axis preset, I set each axis to a different value and it then render it as if the first axis was the overall frame number and the other axes were 0.

@annehaley
Copy link
Collaborator Author

Obviously, replacing an existing preset should have some warning, but refusing to replace it makes updating a present hard. What if instead when there was a name collision the "Save preset" button changed to "Update preset"?

Good idea. Changed in 4ced213.

@annehaley annehaley force-pushed the frame-selection-presets branch from 4e436e9 to 97b67e9 Compare July 17, 2023 15:39
@annehaley
Copy link
Collaborator Author

Would it be possible to compare the current frame and style values and switch the preset drop down to "Select a preset" when things are changed and switch to a specific preset when they match?

Added in 7f37a10

@annehaley
Copy link
Collaborator Author

On a multi-axis preset, I set each axis to a different value and it then render it as if the first axis was the overall frame number and the other axes were 0.

Can you give a more specific example? When I try this on multi_all.yml, it works as expected.
image

@annehaley annehaley linked an issue Jul 17, 2023 that may be closed by this pull request
@manthey
Copy link
Member

manthey commented Jul 24, 2023

On a multi-axis preset, I set each axis to a different value and it then render it as if the first axis was the overall frame number and the other axes were 0.

Can you give a more specific example? When I try this on multi_all.yml, it works as expected. image

On DDX58_AXL_EGFR_well2.nd2, I set the following:
image
Then save the preset and I see
image

@annehaley annehaley requested a review from manthey July 25, 2023 18:56
@annehaley annehaley merged commit f842b95 into master Jul 26, 2023
@annehaley annehaley deleted the frame-selection-presets branch July 26, 2023 12:34
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.

Frame control presets
2 participants