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

Clean up the existing watershed algorithm #1652

Merged
merged 1 commit into from
Nov 18, 2019
Merged

Conversation

ttung
Copy link
Collaborator

@ttung ttung commented Nov 14, 2019

  1. Refactor some anonymous numpy functionality into a pipeline-component-like model.
  2. Remove unnecessary work in ISS.py (stuff that's been inlined into Segment.Watershed ages ago).

Test plan: Ran iss.py and got 69 segmented cells, same as before this change

@ttung ttung requested a review from shanaxel42 November 14, 2019 07:34
@codecov-io
Copy link

codecov-io commented Nov 14, 2019

Codecov Report

Merging #1652 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1652      +/-   ##
==========================================
+ Coverage   89.67%   89.69%   +0.01%     
==========================================
  Files         220      220              
  Lines        8236     8236              
==========================================
+ Hits         7386     7387       +1     
+ Misses        850      849       -1
Impacted Files Coverage Δ
starfish/core/image/Segment/watershed.py 96.55% <100%> (ø) ⬆️
starfish/core/image/Filter/reduce.py 100% <0%> (+3.57%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 838a1ac...e0d390d. Read the comment docs.

@shanaxel42 shanaxel42 closed this Nov 14, 2019
@shanaxel42 shanaxel42 reopened this Nov 14, 2019
@ttung ttung force-pushed the tonytung-watershed-cleanup branch from 4eb43f4 to 4661696 Compare November 17, 2019 22:11
Copy link
Collaborator

@shanaxel42 shanaxel42 left a comment

Choose a reason for hiding this comment

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

Could've marked this one [easy]!

1. Refactor some anonymous numpy functionality into a pipeline-component-like model.
2. Remove unnecessary work in ISS.py (stuff that's been inlined into Segment.Watershed ages ago).

Test plan: Ran iss.py and got 69 segmented cells, same as before this change
@ttung ttung force-pushed the tonytung-watershed-cleanup branch from 4661696 to e0d390d Compare November 18, 2019 18:52
@ttung ttung merged commit 737214f into master Nov 18, 2019
@ttung ttung deleted the tonytung-watershed-cleanup branch November 18, 2019 20:50
ttung pushed a commit that referenced this pull request Dec 3, 2019
#1652 replaced a block of code that scales the intensity of the image by the max, with a reduce operation that does Clip.SCALE_BY_IMAGE.  As I discovered later, Clip.SCALE_BY_IMAGE does not do what the documentation says it does, and in fact, it only scales by the max intensity if the max intensity is > 1.0.  That means it's not a refactor and actually affected the output.

Levels.SCALE_BY_IMAGE, however, does what we want here and can do what we originally had here.

Depends on #1669
Test plan: pretty much none.
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.

3 participants