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

imagestack: fix adjustment single channel images #618

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

JoepVanlier
Copy link
Member

@JoepVanlier JoepVanlier commented Jan 30, 2024

Why this PR?
We introduced a regression when it comes to color adjustments for single channel WIT stacks in 1.3.0 here.

If you try to do a color adjustment on a stack and then plot without specifying a color channel or specifying "rgb" no adjustment is applied.

This PR fixes that and adds a test to cover the single channel case. I will squash to a single commit when approved, but left it separate so you can verify that the test fires without the fix.

Example:

plt.subplot(1, 2, 1)
stack.plot(frame=300, adjustment=lk.ColorAdjustment(0, 97, "percentile"))
plt.title("")

plt.subplot(1, 2, 2)
stack.plot("r", frame=300, adjustment=lk.ColorAdjustment(0, 97, "percentile"))
plt.title("")

Expected:
image

Result:
image

Copy link
Contributor

@rpauszek rpauszek left a comment

Choose a reason for hiding this comment

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

👍

changelog.md Outdated
@@ -11,6 +11,7 @@
* Fixed a bug where the time indicator was off by one frame in [`ImageStack.plot_correlated()`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.ImageStack.html#lumicks.pylake.ImageStack.plot_correlated) and [`ImageStack.export_video()`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.ImageStack.html#lumicks.pylake.ImageStack.export_video).
* Fixed a bug where the time between frames was incorrectly not excluded when calling [`ImageStack.frame_timestamp_ranges()`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.ImageStack.html#lumicks.pylake.ImageStack.frame_timestamp_ranges) with `include_dead_time=False`. Note that `Scan` and `Kymo` are not affected.
* Fixed a bug where [`ImageStack.plot_correlated()`](https://lumicks-pylake.readthedocs.io/en/v1.3.0/_api/lumicks.pylake.ImageStack.html#lumicks.pylake.ImageStack.plot_correlated) was not excluding the dead time between frames.
* Fixed a bug where color adjustments on a single channel [`ImageStack`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.ImageStack.html#lumicks.pylake.ImageStack) would not be applied for single channel stacks unless a single channel was provided as argument. This bug was introduced in `v1.3.0`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Fixed a bug where color adjustments on a single channel [`ImageStack`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.ImageStack.html#lumicks.pylake.ImageStack) would not be applied for single channel stacks unless a single channel was provided as argument. This bug was introduced in `v1.3.0`.
* Fixed a bug where color adjustments on a single channel [`ImageStack`](https://lumicks-pylake.readthedocs.io/en/latest/_api/lumicks.pylake.ImageStack.html#lumicks.pylake.ImageStack) would not be applied unless a channel was provided as argument. This bug was introduced in `v1.3.0`.

Copy link
Member Author

Choose a reason for hiding this comment

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

ah yeah, I guess the fact that it is about stacks is already implied by the API reference

@JoepVanlier JoepVanlier merged commit ada456b into release/1.3 Feb 6, 2024
8 checks passed
@JoepVanlier JoepVanlier deleted the color_adjustment_bug branch February 6, 2024 15:10
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.

None yet

2 participants