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

Fix persistence of more image adjustment settings: brightness, contrast, and opacity #79

Merged
merged 3 commits into from
Sep 22, 2021

Conversation

yoda-vid
Copy link
Collaborator

@yoda-vid yoda-vid commented Sep 4, 2021

PR #76 fixed persistence of both auto and manual intensity settings in the image adjustment panel, but opacity, brightness, and contrast settings are still reset when scrolling through images. This PR makes these settings persistent while scrolling through a given image.

Additionally, the brightness and contrast settings have conflicted with one another, where adjusting one caused the other setting to be ignored. The brightness and contrast settings both operate on the original image, meaning that they need to know any changes to the other setting to reapply it when making any adjustments. This PR fixes the settings by applying both brightness and contrast together with any change to one value.

The file dialog to select a labels reference file defaults to the current working directory. To set the default directory to the current image's directory, a separate file dialog must be set rather than using the TraitsUI FileEditor. Implement a Pyface file dialog triggered by a new button, similar to the figure save button, with default directory set to that of the image.
Brightness and contrast adjustments operate on the original image to avoid creating a feedback loop from changes. After adjusting brightness, however, any adjustment to contrast wipes out the brightness change and vice versa. Fix by including both brightness and contrast values when making adjustments to either to provide the current baseline for each value when adjusting the original image.
…through planes

- Reuse the opacity value from the last displayed image
- Store and reuse brightness and contrast values when adjusting them
@yoda-vid yoda-vid added the bug Something isn't working label Sep 4, 2021
@yoda-vid yoda-vid added this to the v1.5.0 milestone Sep 4, 2021
@yoda-vid yoda-vid merged commit f2b89ea into master Sep 22, 2021
@yoda-vid yoda-vid deleted the fix_auto_intensity2 branch September 22, 2021 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant