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

Remove background averaging #169

Merged
merged 10 commits into from
Sep 12, 2022
Merged

Remove background averaging #169

merged 10 commits into from
Sep 12, 2022

Conversation

talonchandler
Copy link
Collaborator

@talonchandler talonchandler commented Sep 11, 2022

When I was testing calibration using an ROI, I noticed that the background correction changed behavior.

I found that when a calibration ROI was used, the background correction averaged over this ROI then applied that background correction uniformly over the whole image. I cannot think of a reason to average over a FOV within a background image, so I removed this functionality.

This functionality severely reduces the effectiveness of the "Measured" background corrections when calibrating within an ROI. It's also likely that this bug was partially responsible for Yuming's poor background corrections.

@talonchandler talonchandler added this to the 0.2.0 milestone Sep 11, 2022
@codecov-commenter
Copy link

codecov-commenter commented Sep 12, 2022

Codecov Report

Merging #169 (5aa5f91) into main (bc8344a) will increase coverage by 0.02%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main     #169      +/-   ##
==========================================
+ Coverage   11.18%   11.21%   +0.02%     
==========================================
  Files          45       45              
  Lines        5997     5984      -13     
==========================================
  Hits          671      671              
+ Misses       5326     5313      -13     
Impacted Files Coverage Δ
recOrder/io/utils.py 0.00% <0.00%> (ø)
recOrder/pipelines/qlipp_pipeline.py 0.00% <0.00%> (ø)
recOrder/plugin/widget/main_widget.py 0.00% <0.00%> (ø)
recOrder/plugin/workers/acquisition_workers.py 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@deprecated-napari-hub-preview-bot
Copy link

deprecated-napari-hub-preview-bot bot commented Sep 12, 2022

Preview page for your plugin is ready here:
https://preview.napari-hub.org/mehta-lab/recOrder/169
Updated: 2022-09-12T23:24:30.270411

@ziw-liu
Copy link
Contributor

ziw-liu commented Sep 12, 2022

Do you think a warning is still needed since we are altering the behavior of the pipeline?

@ziw-liu ziw-liu added the bug Something isn't working label Sep 12, 2022
@talonchandler
Copy link
Collaborator Author

I think I removed the warning and decided to completely remove the background averaging.

I initially thought I was going to just add a warning, then I changed my mind and decided to remove background averaging. Sorry I didn't do a very good job cleaning up after myself: the warning is still in the commit history and in the name of this branch.

@ziw-liu
Copy link
Contributor

ziw-liu commented Sep 12, 2022

Sorry I didn't do a very good job cleaning up after myself: the warning is still in the commit history and in the name of this branch.

I wasn't making it clear, but I was suggesting adding the warning back (with different articulation) so that any user who was relying on that bug/feature would be advised of the change we are making. Although the previous behavior was more like a bug, this 'breaking' change still alters the output value of the pipeline if, for example, someone would like to revisit their previous analysis.

@talonchandler
Copy link
Collaborator Author

Aha! Excellent point. I didn't maintain backwards compatibility.

I've reverted the changes, added a warning, fixed the bug, and added reminders for what needs to be removed for 1.0.0.

Thanks Ziwen...great catch.

Warning: earlier versions of recOrder would have averaged over the background ROI. This behavior is
now considered a bug, and future versions of recOrder will not average over the background.
"""
print(warning_msg)
Copy link
Contributor

@ziw-liu ziw-liu Sep 12, 2022

Choose a reason for hiding this comment

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

Same question as in this comment, as this message may not be visible from the napari window.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Again...good catch. Changed from print to logging.warning.

@talonchandler talonchandler merged commit 67caa9b into main Sep 12, 2022
@talonchandler talonchandler deleted the warn-bkg-averaging branch September 12, 2022 23:32
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.

3 participants