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

ENH: Add visualization parameters to DSA annotations script #390

Merged
merged 1 commit into from
May 31, 2022

Conversation

fepegar
Copy link
Contributor

@fepegar fepegar commented May 31, 2022

This PR adds the rescale and colormap parameters to the script in the girder module, to improve flexibility and facilitate experimentation.

Defaults

Greens is the default colormap because

  1. It goes from white to a dark colour. This is nice because the slides background is typically white as well.
  2. Green has the best contrast to the typical tissue colour (~magenta)

Rescaling is not performed by default because it might artificially emphasise attention values that are only slight larger than others. E.g., compare (0.04, 0.06, 0.95) and (0.32, 0.33, 0.34) with their rescaled equivalents: (0, 0.02, 1) and (0, 0.5, 1). The differences between values of the second array are very exaggerated. However, as pointed out in our meetings, this might not be relevant because the values depend on the number of tiles anyway, so we might as well simply use the logits. To be considered in the future.

Screenshots

Default (no rescaling, Greens):

Screenshot 2022-05-31 101513

Rescaling, `Greens:

Screenshot 2022-05-31 101534

No rescaling, viridis:

Screenshot 2022-05-31 101555

Rescaling, viridis:

Screenshot 2022-05-31 101612

@codecov
Copy link

codecov bot commented May 31, 2022

Codecov Report

Merging #390 (8362a90) into main (d320962) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

Flag Coverage Δ
hi-ml-histopathology 74.67% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@harshita-s
Copy link
Contributor

Thanks @fepegar for the rescaling and visualization examples. Could we also display the 0-1 scale somewhere? This could be useful as different colormaps appear differently, e.g., Greens have lighter color for smaller values, but it is vice-versa for Viridis. One question that we had was which colors are the higher values, perhaps the scale could make this clearer?

@fepegar
Copy link
Contributor Author

fepegar commented May 31, 2022

Thanks @fepegar for the rescaling and visualization examples. Could we also display the 0-1 scale somewhere? This could be useful as different colormaps appear differently, e.g., Greens have lighter color for smaller values, but it is vice-versa for Viridis. One question that we had was which colors are the higher values, perhaps the scale could make this clearer?

I agree a colour bar would definitely be useful. I haven't seen this in DSA, I'm not sure it's supported. But I'll contact the developers and add it in a future PR, if possible.

@fepegar fepegar merged commit c5d8bf6 into main May 31, 2022
@fepegar fepegar deleted the add-dsa-viz-options branch May 31, 2022 10:29
@fepegar
Copy link
Contributor Author

fepegar commented May 31, 2022

Thanks for reviewing, @harshita-s and @vale-salvatelli!

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