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

Restore image settings during refresh #613

Merged
merged 8 commits into from
Jan 31, 2024
Merged

Conversation

yoda-vid
Copy link
Collaborator

Refreshing the image has reset the image to default settings, but the user often wishes to keep adjusted settings, such as when viewing the same image. Now these settings are restored except when viewing a new image.

This change also fixes synchronization between the image adjustment controls and the refreshed image since the auto button would remain unchecked after refreshing the image despite previously reverting to default setings. Now the auto button remains appropriately unchecked since the custom setting is restored.

Refreshing the image has reset the image to default settings, but the user often wishes to keep adjusted settings, such as when viewing the same image. Now these settings are restored except when viewing a new image.

This change also fixes synchronization between the image adjustment controls and the refreshed image since the auto button would remain unchecked after refreshing the image despite previously reverting to default setings. Now the auto button remains appropriately unchecked since the custom setting is restored.
@yoda-vid yoda-vid added bug Something isn't working enhancement New feature or request labels Jan 25, 2024
@yoda-vid yoda-vid added this to the v1.6.0 milestone Jan 25, 2024
On testing in Linux, relaunching an editor triggers an image adjustment channel control event, populating the adjustment controls with the new image's settings and preventing restoration of the prior image's settings.

- Fix by flagging to ignore this channel control event
- Update comment about ignoring change to empty image adjustment channels value
Redrawing the editor has not updated the adjustment controls, leaving them in a stale state until the adjustment channel control is changed. This stale state has been used now to restore adjustment settings to the new image, but the settings need to be updated when the settings are not restored, fixed here.
To speed up responsiveness, automically refresh the image when the user changes the image channel control. This change requires using an ignore flag to ignore channel changes during the control's initialization. The refresh also serves as a way to fully refresh the image without reloading the image now that the Redraw button leaves some settings intact.
Normalize the filtered ROI's range to the original image since filtering typically shifts the range considerably, causing the ROI Editor's overview and zoomed images to have very different ranges. This change also makes the ROI's intensity easier to adjust since otherwise it is typically a very low range below the scale bar's normal resolution.
Calculate the near min/max since the image has been fully loaded anyway rather than only memory mapped.
The range adjustments in the `RangeEditor` `xslider` do not adapt below a high of 10, making slider adjustments difficult for low ranges, such as 0-1. For these values, use the image's near max, especially now that images loaded as registered images calculate this value. If this range is too small, the user can enter higher values manually into the control's text field. To allow the user to use the scroller afterward, expand the intensity high range to this manually input value. Although the range cannot be decreased, the control can be reset by refreshing the image (now by changing a channel).
@yoda-vid yoda-vid merged commit 4cc3720 into master Jan 31, 2024
35 of 36 checks passed
@yoda-vid yoda-vid deleted the restore_img_settings branch January 31, 2024 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant